/[sudobot]/trunk/src/commands/settings/AboutCommand.ts
ViewVC logotype

Contents of /trunk/src/commands/settings/AboutCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 387 - (show annotations)
Mon Jul 29 17:29:55 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 2480 byte(s)
chore: add license notice in the about command (#76)
1 import { CommandInteraction, Message } from 'discord.js';
2 import BaseCommand from '../../utils/structures/BaseCommand';
3 import DiscordClient from '../../client/Client';
4 import CommandOptions from '../../types/CommandOptions';
5 import InteractionOptions from '../../types/InteractionOptions';
6 import MessageEmbed from '../../client/MessageEmbed';
7
8 export default class AboutCommand extends BaseCommand {
9 supportsInteractions: boolean = true;
10 metadata = require('../../../package.json');
11
12 constructor() {
13 super('about', 'settings', []);
14 }
15
16 async run(client: DiscordClient, message: Message | CommandInteraction, options: CommandOptions | InteractionOptions) {
17 await message.reply({
18 embeds: [
19 new MessageEmbed()
20 .setAuthor({ iconURL: client.user?.displayAvatarURL(), name: "SudoBot" })
21 .setDescription(`
22 A free and open source Discord moderation bot, specially created for **The Everything Server**.
23
24 Copyright (C) ${new Date().getFullYear()} OSN Inc.
25 This bot comes with ABSOLUTELY NO WARRANTY.
26 This is free software, and you are welcome to redistribute it under certain conditions.
27 See the [GNU Affero General Public License v3](https://www.gnu.org/licenses/agpl-3.0.en.html) for more detailed information.
28 `)
29 .addFields({
30 name: 'Version',
31 value: this.metadata.version,
32 inline: true
33 }, {
34 name: 'Source Code',
35 value: `[GitHub](${this.metadata.repository.url})`,
36 inline: true,
37 }, {
38 name: 'Licensed Under',
39 value: `[GNU Affero General Public License v3](https://www.gnu.org/licenses/agpl-3.0.en.html)`,
40 inline: true
41 })
42 .addFields({
43 name: "Author",
44 value: `[${this.metadata.author.name}](${this.metadata.author.url})`,
45 inline: true
46 }, {
47 name: 'Support',
48 value: this.metadata.author.email,
49 inline: true
50 })
51 .setFooter({
52 text: `Copyright © OSN Inc 2022. All rights reserved.`
53 })
54 ]
55 });
56 }
57 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26