diff options
| author | 8cy <[email protected]> | 2020-07-23 23:24:17 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-07-23 23:24:17 -0700 |
| commit | bb511abc03bb66848947e37a999502b813c77269 (patch) | |
| tree | 612c010fc8317e1cdf11471a18aad0270819d33e /server/src/commands/bot | |
| parent | fix: if clear amount equal or over 100, round down to 99 (diff) | |
| download | dep-core-bb511abc03bb66848947e37a999502b813c77269.tar.xz dep-core-bb511abc03bb66848947e37a999502b813c77269.zip | |
goodbye old uwufier :cry:
Diffstat (limited to 'server/src/commands/bot')
| -rw-r--r-- | server/src/commands/bot/Info.ts | 61 | ||||
| -rw-r--r-- | server/src/commands/bot/Invite.ts | 27 | ||||
| -rw-r--r-- | server/src/commands/bot/Ping.ts | 23 | ||||
| -rw-r--r-- | server/src/commands/bot/Sin.ts | 35 | ||||
| -rw-r--r-- | server/src/commands/bot/Suggest.ts | 35 |
5 files changed, 181 insertions, 0 deletions
diff --git a/server/src/commands/bot/Info.ts b/server/src/commands/bot/Info.ts new file mode 100644 index 0000000..cda8f7a --- /dev/null +++ b/server/src/commands/bot/Info.ts @@ -0,0 +1,61 @@ +import { Command, version as akairoversion } from 'discord-akairo'; +import { Message, version as djsversion } from 'discord.js'; +import { stripIndents } from 'common-tags'; +import * as moment from 'moment'; +import 'moment-duration-format'; +import { colour, owners } from '../../Config'; + +export default class InfoBot extends Command { + public constructor() { + super('info', { + aliases: ['info', 'stats', 'uptime'], + category: 'bot', + description: { + content: 'Provides some information/ stats on the bot.', + usage: '', + examples: [ + '' + ] + }, + ratelimit: 3 + }); + } + + public async exec(msg: Message): Promise<Message> { + // @ts-ignore + const duration = moment.duration(this.client.uptime!).format(' D[d] H[h] m[m] s[s]'); + const embed = this.client.util.embed() + .setTitle(`${this.client.user!.username} Stats`) + .setColor(colour) + .setThumbnail(this.client.user!.displayAvatarURL()) + .addField(`\`⏰\` Uptime`, duration, true) + .addField(`\`💾\`Memory Usage`, `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB`, true) + .addField( + `\`📊\` General Stats`, + // • Servers: ${this.client.guilds.cache.size.toLocaleString('en-US')} + stripIndents` + • Channels: ${this.client.channels.cache.size.toLocaleString('en-US')} + • Users: ${this.client.guilds.cache + .reduce((prev, val) => prev + val.memberCount, 0) + .toLocaleString('en-US')} + `, true) + /* .addField( + '`👴` Reaction Role Stats', + stripIndents` + • Current: ${this.client.settings.cache.reactions.filter(r => r.active).size} + • Lifetime: ${this.client.settings.cache.reactions.size} + `, + true, + ) */ + .addField( + '`📚` Library Info', + stripIndents` + [\`Akairo Framework\`](https://discord-akairo.github.io/#/): ${akairoversion} + [\`Discord.js\`](https://discord.js.org/#/): ${djsversion} + `, true) + .addField('`👧` Lead Developer', (await this.client.fetchApplication()).owner!.toString(), true) + .setFooter(`For more information about ${this.client.users.resolve(owners[0]).tag}, use ${this.client.commandHandler.prefix}sin`, + `${this.client.users.resolve(owners[0]).avatarURL()}`); + return msg.channel.send(embed); + } +}
\ No newline at end of file diff --git a/server/src/commands/bot/Invite.ts b/server/src/commands/bot/Invite.ts new file mode 100644 index 0000000..a25a20c --- /dev/null +++ b/server/src/commands/bot/Invite.ts @@ -0,0 +1,27 @@ +import { Command } from 'discord-akairo'; +import { Message } from 'discord.js'; +import { colour } from '../../Config'; + +export default class InviteBot extends Command { + public constructor() { + super('invite', { + aliases: ['invite'], + category: 'bot', + description: { + content: 'Gives you the bot\'s invite link.', + usage: '', + examples: [ + '' + ] + }, + ratelimit: 3 + }); + } + + public exec(msg: Message): Promise<Message> { + const embed = this.client.util.embed() + .setColor(colour) + .setDescription('To invite the bot, please use [this link](https://kyzer.co/discord/bots/uwufier/).'); + return msg.channel.send(embed); + } +}
\ No newline at end of file diff --git a/server/src/commands/bot/Ping.ts b/server/src/commands/bot/Ping.ts new file mode 100644 index 0000000..d7857c7 --- /dev/null +++ b/server/src/commands/bot/Ping.ts @@ -0,0 +1,23 @@ +import { Command } from 'discord-akairo'; +import { Message } from 'discord.js'; + +export default class PingBot extends Command { + public constructor() { + super('ping', { + aliases: ['ping'], + category: 'bot', + description: { + content: 'Check the latency of the ping to the Discord API.', + usage: '', + examples: [ + '' + ] + }, + ratelimit: 3 + }); + } + + public exec(msg: Message): Promise<Message> { + return msg.channel.send(`Pong! \`${this.client.ws.ping}ms\`.`); + } +}
\ No newline at end of file diff --git a/server/src/commands/bot/Sin.ts b/server/src/commands/bot/Sin.ts new file mode 100644 index 0000000..66e1f2f --- /dev/null +++ b/server/src/commands/bot/Sin.ts @@ -0,0 +1,35 @@ +import { Command } from 'discord-akairo'; +import { Message } from 'discord.js'; +import { colour } from '../../Config'; +import { stripIndents } from 'common-tags'; + +export default class SinBot extends Command { + public constructor() { + super('sin', { + aliases: ['sin'], + category: 'bot', + description: { + content: 'Will get you more information about Sin, the lead developer.', + usage: '', + examples: [ + '' + ] + }, + ratelimit: 3 + }); + } + + public exec(msg: Message): Promise<Message> { + const embed = this.client.util.embed() + .setColor(colour) + .addField('Sin\'s Stuff', stripIndents` + 💎 [GitHub](https://github.com/8cy) + 🎀 [NPM](https://www.npmjs.com/~sinny) + 🎨 [Twitter](https://twitter.com/__cpuid) + 🎁 [Website](https://kyzer.co) + ✨ [YouTube](https://youtube.com/s1nny) + 🎐 [Top.gg Vote](https://discordbots.org/bot/699473263998271489/vote) + `, false) + return msg.channel.send(embed); + } +}
\ No newline at end of file diff --git a/server/src/commands/bot/Suggest.ts b/server/src/commands/bot/Suggest.ts new file mode 100644 index 0000000..7478182 --- /dev/null +++ b/server/src/commands/bot/Suggest.ts @@ -0,0 +1,35 @@ +import { Command } from 'discord-akairo'; +import { Message } from 'discord.js'; +import { owners } from '../../Config'; + +export default class SuggestBot extends Command { + public constructor() { + super('suggest', { + aliases: ['suggest'], + category: 'bot', + description: { + content: 'Suggest a feature that the bot should add.', + usage: '[suggestion]', + examples: [ + 'walter command please' + ] + }, + ratelimit: 3, + args: [ + { + id: 'suggestion', + type: 'string', + prompt: { + start: 'What would you like to suggest?' + }, + match: 'rest' + } + ] + }); + } + + public async exec(msg: Message, { suggestion }): Promise<Message> { + await this.client.users.resolve(owners[0]).send(`**${msg.author.tag}** suggest; *${suggestion}*`); + return msg.channel.send('Thank you for your suggestion!'); + } +}
\ No newline at end of file |