/[sudobot]/trunk/src/commands/moderation/HistoryCommand.ts
ViewVC logotype

Diff of /trunk/src/commands/moderation/HistoryCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 106 by rakin, Mon Jul 29 17:28:37 2024 UTC revision 125 by rakin, Mon Jul 29 17:28:41 2024 UTC
# Line 1  Line 1 
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';
# Line 13  import PunishmentType from '../../types/ Line 13  import PunishmentType from '../../types/
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) {
# Line 259  export default class HistoryCommand exte Line 260  export default class HistoryCommand exte
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);                

Legend:
Removed from v.106  
changed lines
  Added in v.125

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26