/[sudobot]/branches/4.x/src/commands/information/SnipeCommand.ts
ViewVC logotype

Annotation of /branches/4.x/src/commands/information/SnipeCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 577 - (hide annotations)
Mon Jul 29 18:52:37 2024 UTC (8 months, 1 week ago) by rakinar2
File MIME type: application/typescript
File size: 2049 byte(s)
chore: add old version archive branches (2.x to 9.x-dev)
1 rakinar2 577 /**
2     * This file is part of SudoBot.
3     *
4     * Copyright (C) 2021-2022 OSN Inc.
5     *
6     * SudoBot is free software; you can redistribute it and/or modify it
7     * under the terms of the GNU Affero General Public License as published by
8     * the Free Software Foundation, either version 3 of the License, or
9     * (at your option) any later version.
10     *
11     * SudoBot is distributed in the hope that it will be useful, but
12     * WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU Affero General Public License for more details.
15     *
16     * You should have received a copy of the GNU Affero General Public License
17     * along with SudoBot. If not, see <https://www.gnu.org/licenses/>.
18     */
19    
20     import { Message, Permissions } from "discord.js";
21     import DiscordClient from "../../client/Client";
22     import MessageEmbed from "../../client/MessageEmbed";
23     import CommandOptions from "../../types/CommandOptions";
24     import { emoji } from "../../utils/Emoji";
25     import BaseCommand from "../../utils/structures/BaseCommand";
26    
27     export default class SnipeCommand extends BaseCommand {
28     permissions = [Permissions.FLAGS.MANAGE_MESSAGES];
29     name = "snipe";
30     category = "information";
31    
32     async run(client: DiscordClient, message: Message, options: CommandOptions) {
33     const { lastDeletedMessage } = client.utils;
34    
35     if (!lastDeletedMessage) {
36     await message.reply(`${emoji('error')} No deleted message was recorded yet.`);
37     return;
38     }
39    
40     await message.reply({
41     embeds: [
42     new MessageEmbed({
43     author: {
44     name: lastDeletedMessage.author.tag,
45     iconURL: lastDeletedMessage.author.displayAvatarURL(),
46     },
47     color: 'RANDOM',
48     description: lastDeletedMessage.content,
49     footer: {
50     text: "Sniped"
51     }
52     })
53     .setTimestamp()
54     ]
55     });
56     }
57     }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26