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

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

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

revision 336 by rakin, Mon Jul 29 17:28:31 2024 UTC revision 337 by rakin, Mon Jul 29 17:29:37 2024 UTC
# Line 1  Line 1 
1  import { BanOptions, CommandInteraction, EmojiIdentifierResolvable, GuildMember, Interaction, Message, TextChannel, User } from 'discord.js';  import { BanOptions, CommandInteraction, EmojiIdentifierResolvable, GuildMember, Interaction, Message, 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';
 import CommandOptions from '../../types/CommandOptions';  
4  import InteractionOptions from '../../types/InteractionOptions';  import InteractionOptions from '../../types/InteractionOptions';
 import MessageEmbed from '../../client/MessageEmbed';  
 import getUser from '../../utils/getUser';  
 import getMember from '../../utils/getMember';  
 import History from '../../automod/History';  
 import { fetchEmoji } from '../../utils/Emoji';  
5  import { Modal, ModalSubmitInteraction, showModal, TextInputComponent } from 'discord-modals';  import { Modal, ModalSubmitInteraction, showModal, TextInputComponent } from 'discord-modals';
6  import PunishmentAppeal from '../../models/PunishmentAppeal';  import PunishmentAppeal from '../../models/PunishmentAppeal';
7    
# Line 26  export default class AppealCommand exten Line 20  export default class AppealCommand exten
20              await PunishmentAppeal.create({              await PunishmentAppeal.create({
21                  user_id: interaction.member.id,                  user_id: interaction.member.id,
22                  guild_id: interaction.guild!.id,                  guild_id: interaction.guild!.id,
23                  content                  content,
24                    createdAt: new Date()
25              });              });
26    
27              await interaction.reply({              await interaction.reply({
# Line 38  export default class AppealCommand exten Line 33  export default class AppealCommand exten
33    
34      async run(client: DiscordClient, interaction: CommandInteraction, options: InteractionOptions) {      async run(client: DiscordClient, interaction: CommandInteraction, options: InteractionOptions) {
35          const existingData = await PunishmentAppeal.findOne({          const existingData = await PunishmentAppeal.findOne({
36              where: {              user_id: interaction.member!.user.id,
37                  user_id: interaction.member!.user.id,              guild_id: interaction.guild!.id
                 guild_id: interaction.guild!.id  
             }  
38          });          });
39    
40          if (!existingData) {          if (!existingData) {

Legend:
Removed from v.336  
changed lines
  Added in v.337

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26