1 |
import { BanOptions, CommandInteraction, EmojiIdentifierResolvable, GuildMember, Interaction, InteractionCollector, Message, MessageActionRow, MessageButton, MessageOptions, ReplyOptions, TextChannel, User } from 'discord.js'; |
import { BanOptions, CommandInteraction, ContextMenuInteraction, EmojiIdentifierResolvable, GuildMember, Interaction, InteractionCollector, Message, MessageActionRow, MessageButton, MessageOptions, ReplyOptions, TextChannel, User } from 'discord.js'; |
2 |
import BaseCommand from '../../utils/structures/BaseCommand'; |
import BaseCommand from '../../utils/structures/BaseCommand'; |
3 |
import DiscordClient from '../../client/Client'; |
import DiscordClient from '../../client/Client'; |
4 |
import CommandOptions from '../../types/CommandOptions'; |
import CommandOptions from '../../types/CommandOptions'; |
13 |
|
|
14 |
export default class HistoryCommand extends BaseCommand { |
export default class HistoryCommand extends BaseCommand { |
15 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
16 |
|
supportsContextMenu = true; |
17 |
|
|
18 |
constructor() { |
constructor() { |
19 |
super('history', 'moderation', []); |
super('history', 'moderation', ['Moderation History']); |
20 |
} |
} |
21 |
|
|
22 |
async genEmbed(client: DiscordClient, msg: Message | Interaction, user: User, page: number = 1) { |
async genEmbed(client: DiscordClient, msg: Message | Interaction, user: User, page: number = 1) { |
46 |
return 'Soft Ban'; |
return 'Soft Ban'; |
47 |
case PunishmentType.TEMPBAN: |
case PunishmentType.TEMPBAN: |
48 |
return 'Temporary Ban'; |
return 'Temporary Ban'; |
49 |
case PunishmentType.BEAN: |
case PunishmentType.SHOT: |
50 |
return 'Bean'; |
return 'Shot'; |
51 |
case PunishmentType.MUTE: |
case PunishmentType.MUTE: |
52 |
return 'Mute'; |
return 'Mute'; |
53 |
case PunishmentType.HARDMUTE: |
case PunishmentType.HARDMUTE: |
260 |
|
|
261 |
collector.on('end', async () => { |
collector.on('end', async () => { |
262 |
try { |
try { |
263 |
await message.edit({ |
if (msg instanceof ContextMenuInteraction) { |
264 |
components: [] |
await msg.editReply({ |
265 |
}); |
components: [] |
266 |
|
}); |
267 |
|
} |
268 |
|
else { |
269 |
|
await message.edit({ |
270 |
|
components: [] |
271 |
|
}); |
272 |
|
} |
273 |
} |
} |
274 |
catch (e) { |
catch (e) { |
275 |
console.log(e); |
console.log(e); |
276 |
} |
} |
277 |
}); |
}); |
278 |
} |
} |
|
} |
|
279 |
|
} |