This commit is contained in:
Daniel Odendahl Jr
2017-06-17 03:26:31 +00:00
parent 5bb78126a9
commit fd4e35533a
129 changed files with 322 additions and 319 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ module.exports = class CleverbotCommand extends Command {
aliases: ['clevs', 'chat'],
group: 'random',
memberName: 'cleverbot',
description: 'Talk to Cleverbot!',
description: 'Talk to Cleverbot.',
args: [
{
key: 'text',
+1 -1
View File
@@ -9,7 +9,7 @@ module.exports = class HoroscopeCommand extends Command {
name: 'horoscope',
group: 'random',
memberName: 'horoscope',
description: 'Gives the horoscope for today for a particular sign.',
description: 'Responds with today\'s horoscope for a particular sign.',
details: `**Signs:** ${signs.join(', ')}`,
clientPermissions: ['EMBED_LINKS'],
args: [
+25
View File
@@ -0,0 +1,25 @@
const Command = require('../../structures/Command');
module.exports = class LMGTFYCommand extends Command {
constructor(client) {
super(client, {
name: 'lmgtfy',
group: 'random',
memberName: 'lmgtfy',
description: 'Creates a LMGTFY link with the query you provide.',
args: [
{
key: 'query',
prompt: 'What would you like the link to search for?',
type: 'string',
parse: (query) => encodeURIComponent(query)
}
]
});
}
run(msg, args) {
const { query } = args;
return msg.say(`http://lmgtfy.com/?iie=1&q=${query}`);
}
};
-28
View File
@@ -1,28 +0,0 @@
const Command = require('../../structures/Command');
const { RichEmbed } = require('discord.js');
const { stripIndents } = require('common-tags');
module.exports = class NitroCommand extends Command {
constructor(client) {
super(client, {
name: 'nitro',
group: 'random',
memberName: 'nitro',
description: 'Sends a "This Message Can Only be viewed by Nitro Members" message.',
clientPermissions: ['EMBED_LINKS']
});
}
run(msg) {
const embed = new RichEmbed()
.setAuthor('Discord Nitro')
.setThumbnail('https://i.imgur.com/wzhMMnl.jpg')
.setColor(0x748BD9)
.setURL('https://discordapp.com/nitro')
.setDescription(stripIndents`
This Message can only be viewed by members with Discord Nitro.
[More Information](https://discordapp.com/nitro)
`);
return msg.embed(embed);
}
};
+8 -4
View File
@@ -38,16 +38,20 @@ module.exports = class SoundboardCommand extends Command {
if (!voiceChannel.permissionsFor(this.client.user).has(['CONNECT', 'SPEAK'])) {
return msg.say('Missing the `CONNECT` or `SPEAK` Permission for the Voice Channel.');
}
if (!voiceChannel.joinable) return msg.say('This Voice Channel is not joinable.');
if (this.client.voiceConnections.get(voiceChannel.guild.id)) return msg.say('I am already playing a sound.');
if (!voiceChannel.joinable) return msg.say('Your Voice Channel is not joinable.');
if (this.client.voiceConnections.has(voiceChannel.guild.id)) return msg.say('I am already playing a sound.');
const { sound } = args;
const connection = await voiceChannel.join();
msg.react('🔊');
await msg.react('🔊');
const dispatcher = connection.playFile(path.join(__dirname, '..', '..', 'assets', 'sounds', paths[sound]));
dispatcher.on('end', () => {
dispatcher.once('end', () => {
voiceChannel.leave();
msg.react('✅');
});
dispatcher.once('error', () => {
voiceChannel.leave();
msg.react('⚠');
});
return null;
}
};
+2 -2
View File
@@ -6,12 +6,12 @@ module.exports = class SpamCommand extends Command {
name: 'spam',
group: 'random',
memberName: 'spam',
description: 'Puts a picture of Spam.',
description: 'Responds with a picture of Spam.',
clientPermissions: ['ATTACH_FILES']
});
}
run(msg) {
return msg.say('https://i.imgur.com/arx7GJV.jpg');
return msg.say({ files: ['https://i.imgur.com/arx7GJV.jpg'] });
}
};
+13 -13
View File
@@ -9,7 +9,7 @@ module.exports = class StarCommand extends Command {
name: 'star',
group: 'random',
memberName: 'star',
description: 'Stars a message.',
description: 'Stars a message, sending it to the starboard.',
args: [
{
key: 'id',
@@ -25,20 +25,13 @@ module.exports = class StarCommand extends Command {
async run(msg, args, reaction) {
const { id } = args;
const channel = msg.guild.channels.get(msg.guild.settings.get('starboard'));
if (!channel ||
!channel.permissionsFor(this.client.user).has('SEND_MESSAGES') ||
this.starred.includes(id)) return null;
if (!channel || this.starred.includes(id)) return null;
const message = await msg.channel.fetchMessage(id);
if (!reaction && msg.author.id === message.author.id) return msg.reply('You cannot star your own messages, baka.'); // eslint-disable-line max-len
if (!reaction && msg.author.id === message.author.id) return msg.reply('You cannot star your own messages.');
this.starred.push(id);
if (!channel.permissionsFor(this.client.user).has('EMBED_LINKS')) {
return msg.say(stripIndents`
**Author:** ${message.author.tag}
**Content:** ${message.content}
**Date:** ${moment(message.createdTimestamp).format('MMMM Do YYYY h:mm:ss A')}
${message.attachments.first() ? `**Image:** ${message.attachments.first().url}` : ''}
`);
} else {
if (!channel.permissionsFor(this.client.user).has('SEND_MESSAGES')) {
return msg.say('Could not send the message to the starboard.');
} else if (channel.permissionsFor(this.client.user).has('EMBED_LINKS')) {
const embed = new RichEmbed()
.setColor(0xFFFF00)
.setAuthor(message.author.tag, message.author.displayAvatarURL)
@@ -46,6 +39,13 @@ module.exports = class StarCommand extends Command {
.setImage(message.attachments.first() ? message.attachments.first().url : null)
.setFooter(moment(message.createdTimestamp).format('MMMM Do YYYY h:mm:ss A'));
return channel.send({ embed });
} else {
return msg.say(stripIndents`
**Author:** ${message.author.tag}
**Content:** ${message.content}
**Date:** ${moment(message.createdTimestamp).format('MMMM Do YYYY h:mm:ss A')}
${message.attachments.first() ? `**Image:** ${message.attachments.first().url}` : ''}
`);
}
}
};
+3 -3
View File
@@ -8,7 +8,7 @@ module.exports = class StrawpollCommand extends Command {
name: 'strawpoll',
group: 'random',
memberName: 'strawpoll',
description: 'Creates a Strawpoll with your options.',
description: 'Creates a Strawpoll from the options you provide.',
args: [
{
key: 'title',
@@ -21,11 +21,11 @@ module.exports = class StrawpollCommand extends Command {
},
{
key: 'options',
prompt: 'What options do you want me pick from? Maximum of 31.',
prompt: 'What options do you want to be able to pick from? Maximum of 30.',
type: 'string',
infinite: true,
validate: (choice) => {
if (choice.length < 160) return true;
if (choice.length < 140) return true;
else return 'Choices must be under 140 characters each.';
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ module.exports = class TodayCommand extends Command {
name: 'today',
group: 'random',
memberName: 'today',
description: 'Tells you what happened today in history.',
description: 'Responds with a random event that occurred today sometime in history.',
clientPermissions: ['EMBED_LINKS']
});
}
+2 -2
View File
@@ -6,10 +6,10 @@ module.exports = class WouldYouRatherCommand extends Command {
constructor(client) {
super(client, {
name: 'would-you-rather',
aliases: ['wyrather'],
aliases: ['wy-rather'],
group: 'random',
memberName: 'would-you-rather',
description: 'Gets a random would you rather question.',
description: 'Responds with a random would you rather question.',
clientPermissions: ['EMBED_LINKS']
});
}