1 |
import { BanOptions, CommandInteraction, Guild, GuildMember, Interaction, Message, User } from 'discord.js'; |
import { CommandInteraction, Message } 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'; |
5 |
import InteractionOptions from '../../types/InteractionOptions'; |
import InteractionOptions from '../../types/InteractionOptions'; |
6 |
import MessageEmbed from '../../client/MessageEmbed'; |
import MessageEmbed from '../../client/MessageEmbed'; |
|
import getUser from '../../utils/getUser'; |
|
|
import History from '../../automod/History'; |
|
|
import getMember from '../../utils/getMember'; |
|
|
import ms from 'ms'; |
|
7 |
import Note from '../../models/Note'; |
import Note from '../../models/Note'; |
8 |
import { fetchEmojiStr } from '../../utils/Emoji'; |
import { fetchEmojiStr } from '../../utils/Emoji'; |
9 |
|
|
30 |
let id: string; |
let id: string; |
31 |
|
|
32 |
if (options.isInteraction) { |
if (options.isInteraction) { |
33 |
id = await <string> options.options.getNumber('id')?.toString(); |
id = await <string> options.options.getString('id'); |
34 |
} |
} |
35 |
else { |
else { |
36 |
id = await options.args[0]; |
id = await options.args[0]; |
37 |
} |
} |
38 |
|
|
39 |
const note = await Note.findOne({ |
const note = await Note.findOne({ |
40 |
where: { |
guild_id: msg.guild!.id, |
41 |
guild_id: msg.guild!.id, |
_id: id |
|
id |
|
|
} |
|
42 |
}); |
}); |
43 |
|
|
44 |
if (!note) { |
if (!note) { |
46 |
return; |
return; |
47 |
} |
} |
48 |
|
|
49 |
await note.destroy(); |
await note.delete(); |
50 |
|
|
51 |
await msg.reply({ |
await msg.reply({ |
52 |
embeds: [ |
embeds: [ |