/[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 16 by rakin, Mon Jul 29 17:28:14 2024 UTC revision 45 by rakin, Mon Jul 29 17:28:20 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.0.0-beta1",      version: "1.8.0",
7      commands: [      commands: [
8          {          {
9              name: 'addsnippet',              name: 'addsnippet',
# Line 14  module.exports = { Line 14  module.exports = {
14              notes: null              notes: null
15          },          },
16          {          {
17                name: 'afk',
18                shortBrief: "Keeps track of your mentions and tells other users that you're AFK.",
19                description: null,
20                structure: "[Reason]",
21                example: "`%%afk`\n`%%afk Having dinner`",
22                notes: null
23            },
24            {
25              name: 'announce',              name: 'announce',
26              shortBrief: "Announce something in the given channel.",              shortBrief: "Announce something in the given channel.",
27              description: "Announce something in the given channel. The channel should be set in the configuration.",              description: "Announce something in the given channel. The channel should be set in the configuration.",
# Line 24  module.exports = { Line 32  module.exports = {
32          {          {
33              name: 'ban',              name: 'ban',
34              shortBrief: "Ban someone in this server.",              shortBrief: "Ban someone in this server.",
35              description: null,              description: "Ban a user. `-d` is the number days old messages to  delete. It must be in range 0-7. If `-d` is passed then an argument after it is required.",
36              structure: "<UserID|Mention> [Reason]",              structure: "<UserID|Mention> [-d=DAYS] [Reason]",
37              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`",
38              notes: null              notes: null
39          },          },
40          {          {
# Line 46  module.exports = { Line 54  module.exports = {
54              notes: null              notes: null
55          },          },
56          {          {
57                name: 'clear',
58                shortBrief: "Clear all messages from a user.",
59                description: "Clear all messages from a user, in the current channel. This might take a while.",
60                structure: "<UserID|UserMention>",
61                example: "`%%clear 83474924191884727`\n`%%clear @Someone`",
62                notes: null
63            },
64            {
65              name: 'delsnippet',              name: 'delsnippet',
66              shortBrief: "Deletes a snippet.",              shortBrief: "Deletes a snippet.",
67              description: null,              description: null,
# Line 70  module.exports = { Line 86  module.exports = {
86              notes: null              notes: null
87          },          },
88          {          {
89                name: 'expire',
90                shortBrief: "Echo (re-send) a message and delete it after the given time.",
91                description: "Re-send a message from the bot and delete it automatically after the given time interval.",
92                structure: "<timeInterval> <content> [channelMention]",
93                example: "`%%echo 25m Something\nVery Cool`\n`%%echo 1h Something\nVery Cool #general`",
94                notes: null
95            },
96            {
97                name: 'expiresc',
98                shortBrief: "Schedule a message and delete it after the given time.",
99                description: "Schedule a message from the bot and delete it automatically after the given time interval.",
100                structure: "<scheduleTimeInterval> <expireTimeInterval> <content> [channelMention]",
101                example: "`%%echo 25m 5h Something\nVery Cool`\n`%%echo 1h 7d Something\nVery Cool #general`",
102                notes: null
103            },
104            {
105              name: 'general-role',              name: 'general-role',
106              shortBrief: "Set the general role.",              shortBrief: "Set the general role.",
107              description: null,              description: null,
# Line 86  module.exports = { Line 118  module.exports = {
118              notes: null              notes: null
119          },          },
120          {          {
121                name: 'history',
122                shortBrief: "Show moderation history for a user.",
123                description: null,
124                structure: "<UserMention|UserID>",
125                example: "`%%history 27372628277272625`\n`%%history @Someone`",
126                notes: null
127            },
128            {
129              name: 'httpcat',              name: 'httpcat',
130              shortBrief: "Get some funny cat memes related to HTTP.",              shortBrief: "Get some funny cat memes related to HTTP.",
131              description: "Get some funny cat memes related to HTTP status codes, using http.cat API.",              description: "Get some funny cat memes related to HTTP status codes, using http.cat API.",
# Line 118  module.exports = { Line 158  module.exports = {
158              notes: null,              notes: null,
159              options: {              options: {
160                  "--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",  
161              }              }
162          },          },
163          {          {
# Line 130  module.exports = { Line 169  module.exports = {
169              notes: null,              notes: null,
170              options: {              options: {
171                  "--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",  
172              }              }
173          },          },
174          {          {
# Line 217  module.exports = { Line 255  module.exports = {
255              notes: null              notes: null
256          },          },
257          {          {
258                name: 'schedule',
259                shortBrief: "Echo (re-send) a message after the given time.",
260                description: "Re-send a message from the bot automatically after the given time interval.",
261                structure: "<timeInterval> <content> [channelMention]",
262                example: "`%%echo 25m Something\nVery Cool`\n`%%echo 1h Something\nVery Cool #general`",
263                notes: null
264            },
265            {
266              name: 'setconfig',              name: 'setconfig',
267              shortBrief: "Change the bot configuration keys.",              shortBrief: "Change the bot configuration keys.",
268              description: null,              description: null,
# Line 225  module.exports = { Line 271  module.exports = {
271              notes: null              notes: null
272          },          },
273          {          {
274                name: 'send',
275                shortBrief: "Send a DM to a user.",
276                description: null,
277                structure: "<UserID|Mention> <content>",
278                example: "`%%send 278358918549759428 Hello world`\n`%%send @Someone Hello world`",
279                notes: null
280            },
281            {
282              name: 'spamfilter',              name: 'spamfilter',
283              shortBrief: "Change the spam filter configuration keys.",              shortBrief: "Change the spam filter configuration keys.",
284              description: null,              description: null,
# Line 233  module.exports = { Line 287  module.exports = {
287              notes: null              notes: null
288          },          },
289          {          {
290                name: 'stats',
291                shortBrief: "Show the server stats.",
292                description: null,
293                structure: "",
294                example: "`%%stats",
295                notes: null
296            },
297            {
298              name: 'unban',              name: 'unban',
299              shortBrief: "Unban a user from this server.",              shortBrief: "Unban a user from this server.",
300              description: null,              description: null,
# Line 249  module.exports = { Line 311  module.exports = {
311              notes: null,              notes: null,
312              options: {              options: {
313                  "--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",  
314              }              }
315          },          },
316          {          {
# Line 261  module.exports = { Line 322  module.exports = {
322              notes: null,              notes: null,
323              options: {              options: {
324                  "--no-send": "Do not send a confirmation message to the locked channel",                  "--no-send": "Do not send a confirmation message to the locked channel",
325                  "--everyone": "Lock the channels for @everyone rather than the general role",                  "--raid": "Unlock all Raid-locked channels"
326              }              }
327          },          },
328          {          {
# Line 316  module.exports = { Line 377  module.exports = {
377      },      },
378      async handle(msg, cm) {      async handle(msg, cm) {
379          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.`)  
             //     ]  
             // });  
   
380              await msg.reply({              await msg.reply({
381                  embeds: [                  embeds: [
382                      new MessageEmbed()                      new MessageEmbed()
383                      .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())
384                      .setTitle('Help')                      .setTitle('Help')
385                  ],                  ],
386              });              });
# Line 385  module.exports = { Line 438  module.exports = {
438              embeds: [              embeds: [
439                  new MessageEmbed()                  new MessageEmbed()
440                  .setTitle(`${app.config.get('prefix')}${cmd.name}`)                  .setTitle(`${app.config.get('prefix')}${cmd.name}`)
441                  .setDescription(cmd.description !== null ? cmd.description : cmd.shortBrief)                  .setDescription("`<...>` means required argument, `[...]` means optional argument.\n\n" + (cmd.description !== null ? cmd.description : cmd.shortBrief))
442                  .addFields(fields)                  .addFields(fields)
443              ]              ]
444          });          });

Legend:
Removed from v.16  
changed lines
  Added in v.45

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26