/[sudobot]/trunk/src/utils/Help.ts
ViewVC logotype

Diff of /trunk/src/utils/Help.ts

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

revision 33 by rakin, Mon Jul 29 17:28:17 2024 UTC revision 49 by rakin, Mon Jul 29 17:28:21 2024 UTC
# Line 3  const MessageEmbed = require("../src/Mes Line 3  const MessageEmbed = require("../src/Mes
3  const { escapeRegex } = require("../src/util");  const { escapeRegex } = require("../src/util");
4    
5  module.exports = {  module.exports = {
6      version: "1.6.1",      version: "1.10.0",
7      commands: [      commands: [
8          {          {
9                name: 'about',
10                shortBrief: "Show information about the bot.",
11                description: null,
12                structure: "",
13                example: "`%%about`",
14                notes: null
15            },
16            {
17                name: 'addqueue',
18                shortBrief: "Add a queue job.",
19                description: 'Adds a queued command to the bot\'s memory and after the given amount of time it gets executed.',
20                structure: "<time> <command>",
21                example: "`%%addqueue 15m echo Hello world`\n`%%addqueue 12h kick 875275828247255`",
22                notes: null
23            },
24            {
25              name: 'addsnippet',              name: 'addsnippet',
26              shortBrief: "Adds a snippet.",              shortBrief: "Adds a snippet.",
27              description: null,              description: null,
# Line 32  module.exports = { Line 48  module.exports = {
48          {          {
49              name: 'ban',              name: 'ban',
50              shortBrief: "Ban someone in this server.",              shortBrief: "Ban someone in this server.",
51              description: null,              description: "Ban a user in this server.",
52              structure: "<UserID|Mention> [Reason]",              structure: "<UserID|UserTag|Mention> [-d=DAYS] [Reason]",
53              example: "`%%ban 385753607325075320`\n`%%ban @Someone You are spamming a lot`",              example: "`%%ban 385753607325075320`\n`%%ban @Someone You are spamming a lot`\n`%%ban @Someone -d 5`\n`%%ban 385753607325075320 -d 5 You are spamming a lot`",
54              notes: null              notes: null,
55                options: {
56                    "-d": "The number of days old messages to delete. It must be in range 0-7. An argument is required.",
57                }
58          },          },
59          {          {
60              name: 'bean',              name: 'bean',
61              shortBrief: "Bean someone in this server.",              shortBrief: "Bean someone in this server.",
62              description: "Bean someone. It doesn't do anything except pretending.",              description: "Bean someone. It doesn't do anything except pretending.",
63              structure: "<UserID|Mention> [Reason]",              structure: "<UserID|UserTag|Mention> [Reason]",
64              example: "`%%bean 385753607325075320`\n`%%bean @Someone You are spamming a lot`",              example: "`%%bean 385753607325075320`\n`%%bean @Someone You are spamming a lot`",
65              notes: null              notes: null
66          },          },
# Line 57  module.exports = { Line 76  module.exports = {
76              name: 'clear',              name: 'clear',
77              shortBrief: "Clear all messages from a user.",              shortBrief: "Clear all messages from a user.",
78              description: "Clear all messages from a user, in the current channel. This might take a while.",              description: "Clear all messages from a user, in the current channel. This might take a while.",
79              structure: "<UserID|UserMention>",              structure: "<UserID|UserTag|UserMention>",
80              example: "`%%clear 83474924191884727`\n`%%clear @Someone`",              example: "`%%clear 83474924191884727`\n`%%clear @Someone`",
81              notes: null              notes: null
82          },          },
83          {          {
84                name: 'delqueue',
85                shortBrief: "Delete a queue job.",
86                description: "Delete a queued command by its ID.",
87                structure: "<QueueID>",
88                example: "`%%delqueue 80`",
89                notes: null
90            },
91            {
92              name: 'delsnippet',              name: 'delsnippet',
93              shortBrief: "Deletes a snippet.",              shortBrief: "Deletes a snippet.",
94              description: null,              description: null,
# Line 86  module.exports = { Line 113  module.exports = {
113              notes: null              notes: null
114          },          },
115          {          {
116                name: 'expire',
117                shortBrief: "Echo (re-send) a message and delete it after the given time.",
118                description: "Re-send a message from the bot and delete it automatically after the given time interval.",
119                structure: "<timeInterval> <content> [channelMention]",
120                example: "`%%echo 25m Something\nVery Cool`\n`%%echo 1h Something\nVery Cool #general`",
121                notes: null
122            },
123            {
124                name: 'expiresc',
125                shortBrief: "Schedule a message and delete it after the given time.",
126                description: "Schedule a message from the bot and delete it automatically after the given time interval.",
127                structure: "<scheduleTimeInterval> <expireTimeInterval> <content> [channelMention]",
128                example: "`%%echo 25m 5h Something\nVery Cool`\n`%%echo 1h 7d Something\nVery Cool #general`",
129                notes: null
130            },
131            {
132              name: 'general-role',              name: 'general-role',
133              shortBrief: "Set the general role.",              shortBrief: "Set the general role.",
134              description: null,              description: null,
# Line 126  module.exports = { Line 169  module.exports = {
169              notes: null              notes: null
170          },          },
171          {          {
172                name: 'joke',
173                shortBrief: "Fetch a random joke from The Joke API.",
174                description: null,
175                structure: "",
176                example: "`%%joke`",
177                notes: null
178            },
179            {
180              name: 'kick',              name: 'kick',
181              shortBrief: "Kick someone from this server.",              shortBrief: "Kick someone from this server.",
182              description: null,              description: null,
183              structure: "<UserID|Mention> [Reason]",              structure: "<UserID|UserTag|Mention> [Reason]",
184              example: "`%%kick 385753607325075320`\n`%%kick @Someone You are spamming a lot`",              example: "`%%kick 385753607325075320`\n`%%kick @Someone You are spamming a lot`",
185              notes: null              notes: null
186          },          },
# Line 142  module.exports = { Line 193  module.exports = {
193              notes: null,              notes: null,
194              options: {              options: {
195                  "--no-send": "Do not send a confirmation message to the locked channel",                  "--no-send": "Do not send a confirmation message to the locked channel",
                 "--everyone": "Lock the channels for @everyone rather than the general role",  
196              }              }
197          },          },
198          {          {
# Line 154  module.exports = { Line 204  module.exports = {
204              notes: null,              notes: null,
205              options: {              options: {
206                  "--no-send": "Do not send a confirmation message to the locked channel",                  "--no-send": "Do not send a confirmation message to the locked channel",
                 "--everyone": "Lock the channels for @everyone rather than the general role",  
207              }              }
208          },          },
209          {          {
# Line 169  module.exports = { Line 218  module.exports = {
218              name: 'mute',              name: 'mute',
219              shortBrief: "Mute someone in this server.",              shortBrief: "Mute someone in this server.",
220              description: null,              description: null,
221              structure: "<UserID|Mention> [-t=DURATION] [Reason]",              structure: "<UserID|UserTag|Mention> [-t=DURATION] [Reason]",
222              example: "`%%mute 385753607325075320`\n`%%mute @Someone You are spamming a lot`\n`%%mute @Someone -t 10m You are spamming a lot`",              example: "`%%mute 385753607325075320`\n`%%mute @Someone You are spamming a lot`\n`%%mute @Someone -t 10m You are spamming a lot`",
223              options: {              options: {
224                  "-t": "Set the mute duration"                  "-t": "Set the mute duration"
# Line 196  module.exports = { Line 245  module.exports = {
245              name: 'note',              name: 'note',
246              shortBrief: "Take a note about an user.",              shortBrief: "Take a note about an user.",
247              description: null,              description: null,
248              structure: "<UserID|UserMention> <note>",              structure: "<UserID|UserTag|UserMention> <note>",
249              example: "`%%note @Someone Simple note.`",              example: "`%%note @Someone Simple note.`",
250              notes: null              notes: null
251          },          },
# Line 220  module.exports = { Line 269  module.exports = {
269              name: 'notes',              name: 'notes',
270              shortBrief: "Get all notes for a specific user.",              shortBrief: "Get all notes for a specific user.",
271              description: null,              description: null,
272              structure: "<UserID|UserMention>",              structure: "<UserID|UserTag|UserMention>",
273              example: "`%%notes @Someone`",              example: "`%%notes @Someone`",
274              notes: null              notes: null
275          },          },
# Line 241  module.exports = { Line 290  module.exports = {
290              notes: null              notes: null
291          },          },
292          {          {
293                name: 'queues',
294                shortBrief: "Show a list of all queue jobs.",
295                description: null,
296                structure: "",
297                example: "`%%queues`",
298                notes: null
299            },
300            {
301                name: 'schedule',
302                shortBrief: "Echo (re-send) a message after the given time.",
303                description: "Re-send a message from the bot automatically after the given time interval.",
304                structure: "<timeInterval> <content> [channelMention]",
305                example: "`%%echo 25m Something\nVery Cool`\n`%%echo 1h Something\nVery Cool #general`",
306                notes: null
307            },
308            {
309              name: 'setconfig',              name: 'setconfig',
310              shortBrief: "Change the bot configuration keys.",              shortBrief: "Change the bot configuration keys.",
311              description: null,              description: null,
# Line 252  module.exports = { Line 317  module.exports = {
317              name: 'send',              name: 'send',
318              shortBrief: "Send a DM to a user.",              shortBrief: "Send a DM to a user.",
319              description: null,              description: null,
320              structure: "<UserID|Mention> <content>",              structure: "<UserID|UserTag|Mention> <content>",
321              example: "`%%send 278358918549759428 Hello world`\n`%%send @Someone Hello world`",              example: "`%%send 278358918549759428 Hello world`\n`%%send @Someone Hello world`",
322              notes: null              notes: null
323          },          },
# Line 289  module.exports = { Line 354  module.exports = {
354              notes: null,              notes: null,
355              options: {              options: {
356                  "--no-send": "Do not send a confirmation message to the locked channel",                  "--no-send": "Do not send a confirmation message to the locked channel",
                 "--everyone": "Unlock the channels for @everyone rather than the general role",  
357              }              }
358          },          },
359          {          {
# Line 301  module.exports = { Line 365  module.exports = {
365              notes: null,              notes: null,
366              options: {              options: {
367                  "--no-send": "Do not send a confirmation message to the locked channel",                  "--no-send": "Do not send a confirmation message to the locked channel",
                 "--everyone": "Lock the channels for @everyone rather than the general role",  
368                  "--raid": "Unlock all Raid-locked channels"                  "--raid": "Unlock all Raid-locked channels"
369              }              }
370          },          },
# Line 309  module.exports = { Line 372  module.exports = {
372              name: 'unmute',              name: 'unmute',
373              shortBrief: "Unmute someone in this server.",              shortBrief: "Unmute someone in this server.",
374              description: null,              description: null,
375              structure: "<UserID|Mention>",              structure: "<UserID|UserTag|Mention>",
376              example: "`%%unmute 385753607325075320`\n`%%unmute @Someone You are spamming a lot`",              example: "`%%unmute 385753607325075320`\n`%%unmute @Someone You are spamming a lot`",
377              notes: null              notes: null
378          },          },
# Line 317  module.exports = { Line 380  module.exports = {
380              name: 'warn',              name: 'warn',
381              shortBrief: "Warn someone in this server.",              shortBrief: "Warn someone in this server.",
382              description: null,              description: null,
383              structure: "<UserID|Mention> [Reason]",              structure: "<UserID|UserTag|Mention> [Reason]",
384              example: "`%%warn 385753607325075320`\n`%%warn @Someone You are spamming a lot`",              example: "`%%warn 385753607325075320`\n`%%warn @Someone You are spamming a lot`",
385              notes: null              notes: null
386          },          },
# Line 341  module.exports = { Line 404  module.exports = {
404              name: 'warnings',              name: 'warnings',
405              shortBrief: "Show all warnings.",              shortBrief: "Show all warnings.",
406              description: "Show all warnings in this server. Passing an user will only show their warnings.",              description: "Show all warnings in this server. Passing an user will only show their warnings.",
407              structure: "[UserId|Mention]",              structure: "[UserId|UserTag|Mention]",
408              example: "`%%warnings`\n`%%warnings 948489127957979253978538`",              example: "`%%warnings`\n`%%warnings 948489127957979253978538`",
409              notes: null              notes: null
410          },          },
# Line 357  module.exports = { Line 420  module.exports = {
420      },      },
421      async handle(msg, cm) {      async handle(msg, cm) {
422          if (typeof cm.args[0] === 'undefined') {          if (typeof cm.args[0] === 'undefined') {
             // await msg.reply({  
             //     embeds: [  
             //         new MessageEmbed()  
             //         .setColor('#f14a60')  
             //         .setDescription(`This command requires at least one argument.`)  
             //     ]  
             // });  
   
423              await msg.reply({              await msg.reply({
424                  embeds: [                  embeds: [
425                      new MessageEmbed()                      new MessageEmbed()
426                      .setDescription("The command list. Run `" + app.config.get('prefix') + "help <commandName>` for more information about a specific command.\n" + await this.render())                      .setDescription("The command list.\n\n`<...>` means required argument, `[...]` means optional argument.\n\nRun `" + app.config.get('prefix') + "help <commandName>` for more information about a specific command.\n" + await this.render())
427                      .setTitle('Help')                      .setTitle('Help')
428                  ],                  ],
429              });              });
# Line 426  module.exports = { Line 481  module.exports = {
481              embeds: [              embeds: [
482                  new MessageEmbed()                  new MessageEmbed()
483                  .setTitle(`${app.config.get('prefix')}${cmd.name}`)                  .setTitle(`${app.config.get('prefix')}${cmd.name}`)
484                  .setDescription(cmd.description !== null ? cmd.description : cmd.shortBrief)                  .setDescription("`<...>` means required argument, `[...]` means optional argument.\n\n" + (cmd.description !== null ? cmd.description : cmd.shortBrief))
485                  .addFields(fields)                  .addFields(fields)
486              ]              ]
487          });          });

Legend:
Removed from v.33  
changed lines
  Added in v.49

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26