5 |
import InteractionOptions from '../../types/InteractionOptions'; |
import InteractionOptions from '../../types/InteractionOptions'; |
6 |
import MessageEmbed from '../../client/MessageEmbed'; |
import MessageEmbed from '../../client/MessageEmbed'; |
7 |
import getUser from '../../utils/getUser'; |
import getUser from '../../utils/getUser'; |
|
import History from '../../automod/History'; |
|
8 |
import getMember from '../../utils/getMember'; |
import getMember from '../../utils/getMember'; |
9 |
import ms from 'ms'; |
import ms from 'ms'; |
10 |
import Note from '../../models/Note'; |
import Note from '../../models/Note'; |
33 |
let id: string; |
let id: string; |
34 |
|
|
35 |
if (options.isInteraction) { |
if (options.isInteraction) { |
36 |
id = await <string> options.options.getNumber('id')?.toString(); |
id = await <string> options.options.getString('id'); |
37 |
} |
} |
38 |
else { |
else { |
39 |
id = await options.args[0]; |
id = await options.args[0]; |
40 |
} |
} |
41 |
|
|
42 |
const note = await Note.findOne({ |
const note = await Note.findOne({ |
43 |
where: { |
guild_id: msg.guild!.id, |
44 |
guild_id: msg.guild!.id, |
_id: id |
|
id |
|
|
} |
|
45 |
}); |
}); |
46 |
|
|
47 |
if (!note) { |
if (!note) { |
49 |
return; |
return; |
50 |
} |
} |
51 |
|
|
52 |
await note.destroy(); |
await note.delete(); |
53 |
|
|
54 |
await msg.reply({ |
await msg.reply({ |
55 |
embeds: [ |
embeds: [ |