/
help.js
73 lines (70 loc) · 3.42 KB
/
help.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* @typedef {import("discord.js").GuildMember} DiscordJs.GuildMember
* @typedef {import("discord.js").TextChannel} DiscordJs.TextChannel
*/
const Discord = require(".."),
pjson = require("../../../package.json");
// # # ## ### #
// # # # # # #
// # # ### # # ## # ## # ## #
// ##### # # # ## # # # # # # ##
// # # ##### # ## # # # # # # #
// # # # # # ## # # # # # # ##
// # # ### ### # ### # # ## #
// #
// #
/**
* A class that handles the help command.
*/
class HelpCmd {
// # # ##
// # # #
// ### ### ### ### # ##
// # # # # # # # # # # ##
// # # # ## # # # # # ##
// # # # # # # ### ### ##
/**
* Handles the command.
* @param {DiscordJs.GuildMember} member The member using the command.
* @param {DiscordJs.TextChannel} channel The channel the command is being used in.
* @returns {Promise} A promise that returns when the command is done executing.
*/
static async handle(member, channel) {
await Discord.richQueue(
Discord.embedBuilder({
title: `SPRINT Racebot v${pjson.version}`,
description: "A Discord bot for racing Star of Providence.",
fields: [
{
name: "General Commands",
value: "`.help`/`.h` - This help text.\n`.race` - Start a new race.",
inline: true
},
{
name: "Race Room Commands - Before the Race",
value: "`.enter`/`.e` - Enter the race.\n`.ready`/`.r` - Indicate that you are ready to start the race.\n`.unready`/`.u` - Indicate you are not ready and need more time before the race starts.\n`.withdraw`/`.w` - Withdraw from the race."
},
{
name: "Race Room Commands - During the Race",
value: "`.done`/`.d` - Indicate that you have finished the race.\n`.forfeit`/`.f` - Forfeit the race.\n`.notdone`/`.n` - If you did `.done` or `.forfeit`, this undoes that, re-entering you into the race.\n`.time`/`.t` - Get the current elapsed time of the race."
},
{
name: "Race Room Commands - After the Race",
value: "`.notdone`/`.n` - If you did `.done` or `.forfeit`, this undoes that, continuing the race and re-entering you into it.\n`.rematch` - Starts a new race in the same race channel."
},
{
name: "Staff Commands",
value: "`.close` - Immediately close the race room you are in.\n`.kick <@user>` - Kick a player out of the race in the room you are in. You must mention the player. They can rejoin, if the race is still accepting entries.",
inline: true
},
{
name: "Bugs?",
value: "Please report bugs on GitHub, https://github.com/roncli/sprint-racebot"
}
]
}),
channel
);
}
}
module.exports = HelpCmd;