"minor" refactor

This commit is contained in:
Ryan Cao 2022-06-09 20:46:12 +08:00
parent 1bc5801d8a
commit ef22044922
No known key found for this signature in database
GPG key ID: 528A2C1B6656B97F
7 changed files with 48 additions and 36 deletions

View file

@ -1,5 +1,5 @@
import { MessageEmbed } from 'discord.js';
import { commands } from '..';
import { commands } from '.';
import { Command } from '..';
export const cmd: Command = {

7
src/commands/index.ts Normal file
View file

@ -0,0 +1,7 @@
import { cmd as help } from './help';
import { cmd as members } from './members';
import { cmd as ping } from './ping';
import { cmd as stars } from './stars';
import { cmd as tags } from './tags';
export const commands = [help, members, ping, stars, tags];

View file

@ -1,6 +1,5 @@
import { MessageEmbed } from 'discord.js';
import type { Command } from '../index';
import { tags } from '../index';
import { getTags, type Command } from '..';
export const cmd: Command = {
name: 'tags',
@ -8,6 +7,8 @@ export const cmd: Command = {
exec: async (e) => {
const em = new MessageEmbed().setTitle('tags').setColor('DARK_GREEN');
const tags = await getTags();
for (const i in tags) {
const tag = tags[i];
let text = '';
@ -22,6 +23,7 @@ export const cmd: Command = {
}
em.addField(tag.name, text);
}
await e.reply({ embeds: [em] });
},
};