Compare commits

..

No commits in common. "077164ed232ef9297b4557c42ad54b5799eb0a5f" and "f643f61f29f463684fc0665b1a7c6c6ea897e6ab" have entirely different histories.

4 changed files with 0 additions and 83 deletions

35
package-lock.json generated
View file

@ -21,7 +21,6 @@
"moment": "^2.29.1", "moment": "^2.29.1",
"ms": "^2.1.3", "ms": "^2.1.3",
"onion-lasers": "^1.1.2", "onion-lasers": "^1.1.2",
"pet-pet-gif": "^1.0.8",
"relevant-urban": "^2.0.0", "relevant-urban": "^2.0.0",
"translate-google": "^1.4.3", "translate-google": "^1.4.3",
"weather-js": "^2.0.0" "weather-js": "^2.0.0"
@ -3016,14 +3015,6 @@
"assert-plus": "^1.0.0" "assert-plus": "^1.0.0"
} }
}, },
"node_modules/gifencoder": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/gifencoder/-/gifencoder-2.0.1.tgz",
"integrity": "sha512-x19DcyWY10SkshBpokqFOo/HBht9GB75evRYvaLMbez9p+yB/o+kt0fK9AwW59nFiAMs2UUQsjv1lX/hvu9Ong==",
"dependencies": {
"canvas": "^2.2.0"
}
},
"node_modules/glob": { "node_modules/glob": {
"version": "7.1.6", "version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
@ -5343,15 +5334,6 @@
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
}, },
"node_modules/pet-pet-gif": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/pet-pet-gif/-/pet-pet-gif-1.0.8.tgz",
"integrity": "sha512-xmQM2DhlSPb1Wo4L5Z6Er4QdzVUjblyUg6LgtvGGtXnwnuhOZBQ0JhNyM+1CL6zxJAG5CQFLhIXxxQa28YpBdg==",
"dependencies": {
"gifencoder": "^2.0.1",
"lodash": "^4.17.21"
}
},
"node_modules/picomatch": { "node_modules/picomatch": {
"version": "2.2.3", "version": "2.2.3",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz",
@ -10197,14 +10179,6 @@
"assert-plus": "^1.0.0" "assert-plus": "^1.0.0"
} }
}, },
"gifencoder": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/gifencoder/-/gifencoder-2.0.1.tgz",
"integrity": "sha512-x19DcyWY10SkshBpokqFOo/HBht9GB75evRYvaLMbez9p+yB/o+kt0fK9AwW59nFiAMs2UUQsjv1lX/hvu9Ong==",
"requires": {
"canvas": "^2.2.0"
}
},
"glob": { "glob": {
"version": "7.1.6", "version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
@ -12014,15 +11988,6 @@
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
}, },
"pet-pet-gif": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/pet-pet-gif/-/pet-pet-gif-1.0.8.tgz",
"integrity": "sha512-xmQM2DhlSPb1Wo4L5Z6Er4QdzVUjblyUg6LgtvGGtXnwnuhOZBQ0JhNyM+1CL6zxJAG5CQFLhIXxxQa28YpBdg==",
"requires": {
"gifencoder": "^2.0.1",
"lodash": "^4.17.21"
}
},
"picomatch": { "picomatch": {
"version": "2.2.3", "version": "2.2.3",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz",

View file

@ -24,7 +24,6 @@
"moment": "^2.29.1", "moment": "^2.29.1",
"ms": "^2.1.3", "ms": "^2.1.3",
"onion-lasers": "^1.1.2", "onion-lasers": "^1.1.2",
"pet-pet-gif": "^1.0.8",
"relevant-urban": "^2.0.0", "relevant-urban": "^2.0.0",
"translate-google": "^1.4.3", "translate-google": "^1.4.3",
"weather-js": "^2.0.0" "weather-js": "^2.0.0"

View file

@ -1,43 +0,0 @@
import {MessageAttachment, User} from "discord.js";
import {NamedCommand, Command, RestCommand, getUserByNickname} from "onion-lasers";
import petPetGif from "pet-pet-gif";
export default new NamedCommand({
description: "Generates a pat GIF of the provided attachment image OR the avatar of the mentioned user.",
usage: "(@user)",
async run({message, send, author}) {
if (message.attachments.size !== 0) {
const attachment = message.attachments.first()!;
const gif = await petPetGif(attachment.url);
const file = new MessageAttachment(gif, "pat.gif");
send(file);
} else {
const gif = await petPetGif(author.displayAvatarURL({format: "png"}));
const file = new MessageAttachment(gif, "pat.gif");
send(file);
}
},
id: "user",
user: new Command({
description: "User to generate a GIF of.",
async run({send, args}) {
const user: User = args[0];
const gif = await petPetGif(user.displayAvatarURL({format: "png"}));
const file = new MessageAttachment(gif, "pat.gif");
send(file);
}
}),
any: new RestCommand({
description: "User to generate a GIF of.",
async run({send, combined, guild}) {
const user = await getUserByNickname(combined, guild);
if (typeof user === "string") send(user);
else {
const gif = await petPetGif(user.displayAvatarURL({format: "png"}));
const file = new MessageAttachment(gif, "pat.gif");
send(file);
}
}
})
});

View file

@ -1,4 +0,0 @@
declare module "pet-pet-gif" {
function petPetGif(image: string): Promise<Buffer>;
export = petPetGif;
}