mirror of
https://github.com/keanuplayz/TravBot-v3.git
synced 2024-08-15 02:33:12 +00:00
Apply suggestions from code review
Co-authored-by: WatDuhHekBro <watduhhekbro@protonmail.com>
This commit is contained in:
parent
58858c5d09
commit
6003367a6b
1 changed files with 14 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
import {MessageAttachment, User} from "discord.js";
|
||||
import {NamedCommand, Command} from "onion-lasers";
|
||||
import {NamedCommand, Command, RestCommand, getUserByNickname} from "onion-lasers";
|
||||
import petPetGif from "pet-pet-gif";
|
||||
|
||||
export default new NamedCommand({
|
||||
|
@ -26,5 +26,18 @@ export default new NamedCommand({
|
|||
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);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue