mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
first message command, various single response commands
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
|
||||
module.exports = class FirstMessageCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'first-message',
|
||||
aliases: ['first-msg'],
|
||||
group: 'info',
|
||||
memberName: 'first-message',
|
||||
description: 'Responds with the first message ever sent to a channel.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'channel',
|
||||
prompt: 'Which channel would you like to get the first message of?',
|
||||
type: 'channel',
|
||||
default: msg => msg.channel
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { channel }) {
|
||||
const messages = await channel.messages.fetch({ after: 1, limit: 1 });
|
||||
const message = messages.first();
|
||||
const format = message.author.avatar && message.author.avatar.startsWith('a_') ? 'gif' : 'png';
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(message.member ? message.member.displayHexColor : 0x00AE86)
|
||||
.setThumbnail(message.author.displayAvatarURL({ format }))
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL({ format }))
|
||||
.setDescription(message.content)
|
||||
.setTimestamp(message.createdAt)
|
||||
.setFooter(`ID: ${message.id}`)
|
||||
.addField('❯ Jump', message.url);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
@@ -25,7 +25,7 @@ module.exports = class MessageInfoCommand extends Command {
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(message.member ? message.member.displayHexColor : 0x00AE86)
|
||||
.setThumbnail(message.author.displayAvatarURL({ format }))
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL({ format }))
|
||||
.setAuthor(message.author.tag, message.author.displayAvatarURL({ format }))
|
||||
.setDescription(message.content)
|
||||
.setTimestamp(message.createdAt)
|
||||
.setFooter(`ID: ${message.id}`)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class NomCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'nom',
|
||||
aliases: ['kanna-crab'],
|
||||
group: 'single',
|
||||
memberName: 'nom',
|
||||
description: 'Posts a GIF of Kanna eating a crab.',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'nom.gif')] });
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class SourceCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'source',
|
||||
aliases: ['sauce'],
|
||||
group: 'single',
|
||||
memberName: 'source',
|
||||
description: 'Hello! Can you give me the source?',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'source.png')] });
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = class SourceCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'yoff',
|
||||
group: 'single',
|
||||
memberName: 'yoff',
|
||||
description: 'Posts a picture that truly defines modern art.',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'yoff.png')] });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user