mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-04-19 21:03:56 +02:00
Add playlist-limit in config command
This commit is contained in:
parent
11eba5746d
commit
4364f459be
1 changed files with 15 additions and 1 deletions
|
@ -11,6 +11,7 @@ export default class implements Command {
|
||||||
public examples = [
|
public examples = [
|
||||||
['config prefix !', 'set the prefix to !'],
|
['config prefix !', 'set the prefix to !'],
|
||||||
['config channel music-commands', 'bind the bot to the music-commands channel'],
|
['config channel music-commands', 'bind the bot to the music-commands channel'],
|
||||||
|
['config playlist-limit 30', 'set the playlist song limit to 30'],
|
||||||
];
|
];
|
||||||
|
|
||||||
public async execute(msg: Message, args: string []): Promise<void> {
|
public async execute(msg: Message, args: string []): Promise<void> {
|
||||||
|
@ -20,7 +21,8 @@ export default class implements Command {
|
||||||
|
|
||||||
if (settings) {
|
if (settings) {
|
||||||
let response = `prefix: \`${settings.prefix}\`\n`;
|
let response = `prefix: \`${settings.prefix}\`\n`;
|
||||||
response += `channel: ${msg.guild!.channels.cache.get(settings.channel)!.toString()}`;
|
response += `channel: ${msg.guild!.channels.cache.get(settings.channel)!.toString()}\n`;
|
||||||
|
response += `playlist-limit: ${settings.playlistLimit}`;
|
||||||
|
|
||||||
await msg.channel.send(response);
|
await msg.channel.send(response);
|
||||||
}
|
}
|
||||||
|
@ -73,6 +75,18 @@ export default class implements Command {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'playlist-limit': {
|
||||||
|
const playlistLimit = Number(args[1]);
|
||||||
|
if (!playlistLimit || playlistLimit <= 0) {
|
||||||
|
await msg.channel.send(errorMsg('please enter a valid number'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await Settings.update({playlistLimit}, {where: {guildId: msg.guild!.id}});
|
||||||
|
await msg.channel.send(`👍 playlist-limit updated to ${playlistLimit}`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
await msg.channel.send(errorMsg('I\'ve never met this setting in my life'));
|
await msg.channel.send(errorMsg('I\'ve never met this setting in my life'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue