Send a message on guild join

This commit is contained in:
Dragon Fire
2020-07-07 17:10:34 -04:00
parent 1d2ae54f2b
commit 98a8aba9b8
8 changed files with 22 additions and 10 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ module.exports = class HelpCommand extends Command {
__Command **${command.name}**__${command.guildOnly ? ' (Usable only in servers)' : ''}
${command.description}${command.details ? `\n${command.details}` : ''}
**Format:** ${msg.anyUsage(`${command.name} ${command.format || ''}`)}
**Format:** ${command.usage(command.format || '')}
**Aliases:** ${command.aliases.join(', ') || 'None'}
**Group:** ${command.group.name} (\`${command.groupID}:${command.memberName}\`)
**NSFW:** ${command.nsfw ? 'Yes' : 'No'}
+1 -2
View File
@@ -21,9 +21,8 @@ module.exports = class UnknownCommandCommand extends Command {
const command = msg.content.match(this.client.dispatcher._commandPatterns[this.client.commandPrefix]);
const str = command ? command[2] : msg.content.split(' ')[0];
const results = didYouMean(str, commands, { returnType: ReturnTypeEnums.ALL_SORTED_MATCHES });
const inGuild = msg.guild ? undefined : null;
return msg.reply(stripIndents`
Unknown command. Use ${msg.anyUsage('help', inGuild, inGuild)} to view the command list.
Unknown command. Use ${this.client.registry.commands.get('help').usage()} to view the command list.
${results.length ? `Did You Mean: ${results.slice(0, 5).map(c => `\`${c}\``).join(', ')}` : ''}
`);
+2 -2
View File
@@ -27,10 +27,10 @@ module.exports = class AirhornCommand extends Command {
}
async run(msg) {
const inGuild = msg.guild ? undefined : null;
const connection = this.client.voice.connections.get(msg.guild.id);
if (!connection) {
return msg.reply(`I am not in a voice channel. Use ${msg.anyUsage('join', inGuild, inGuild)} to fix that!`);
const usage = this.client.registry.commands.get('join').usage();
return msg.reply(`I am not in a voice channel. Use ${usage} to fix that!`);
}
const airhorn = sounds[Math.floor(Math.random() * sounds.length)];
connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', 'airhorn', airhorn));
+2 -1
View File
@@ -49,7 +49,8 @@ module.exports = class DECTalkCommand extends Command {
const inGuild = msg.guild ? undefined : null;
const connection = this.client.voice.connections.get(msg.guild.id);
if (!connection) {
return msg.reply(`I am not in a voice channel. Use ${msg.anyUsage('join', inGuild, inGuild)} to fix that!`);
const usage = this.client.registry.commands.get('join').usage();
return msg.reply(`I am not in a voice channel. Use ${usage} to fix that!`);
}
try {
const { url } = await request
+2 -1
View File
@@ -66,7 +66,8 @@ module.exports = class SoundboardCommand extends Command {
const inGuild = msg.guild ? undefined : null;
const connection = this.client.voice.connections.get(msg.guild.id);
if (!connection) {
return msg.reply(`I am not in a voice channel. Use ${msg.anyUsage('join', inGuild, inGuild)} to fix that!`);
const usage = this.client.registry.commands.get('join').usage();
return msg.reply(`I am not in a voice channel. Use ${usage} to fix that!`);
}
connection.play(path.join(__dirname, '..', '..', 'assets', 'sounds', 'soundboard', sound));
if (msg.channel.permissionsFor(this.client.user).has(['ADD_REACTIONS', 'READ_MESSAGE_HISTORY'])) {