Skip to content

Commit

Permalink
updated command examples, updated fun commands, fixed trivia images n…
Browse files Browse the repository at this point in the history
…ot displaying
  • Loading branch information
sabattle committed Aug 30, 2020
1 parent 5a01f74 commit 434b9d1
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 26 deletions.
4 changes: 0 additions & 4 deletions data/trivia/cars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ questions:
answers:
- Lamborghini Countach
- Countach
- question: What car is this? http://i.imgur.com/inkXwim.jpg
answers:
- Lamborghini Diablo
- Diablo
- question: What car is this? http://i.imgur.com/qGwQa38.jpg
answers:
- Lamborghini Huracan Super Trofeo
Expand Down
2 changes: 1 addition & 1 deletion data/trivia/sports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ questions:
- Basketball
- question: Squash is a member of which sport family?
answers:
- Racket Sport
- Racket Sports
- Racket
- question: The Kangaroo Hoppet is a long distance cross-country skiing race that is held in which county?
answers:
Expand Down
11 changes: 7 additions & 4 deletions src/commands/fun/8ball.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,19 @@ module.exports = class EightBallCommand extends Command {
super(client, {
name: '8ball',
aliases: ['fortune'],
usage: '8ball [question]',
usage: '8ball <question>',
description: 'Asks the Magic 8-Ball for some psychic wisdom.',
type: client.types.FUN,
examples: ['8ball Am I going to win the lottery?']
});
}
run(message) {
run(message, args) {
const question = args.join(' ');
if (!question) return this.sendErrorMessage(message, 0, 'Please provide a question to ask');
const embed = new MessageEmbed()
.setTitle('🎱 The Magic 8-Ball Says 🎱')
.setDescription(`${answers[Math.floor(Math.random() * answers.length)]}`)
.setTitle('🎱 The Magic 8-Ball 🎱')
.addField('Question', question)
.addField('Answer', `${answers[Math.floor(Math.random() * answers.length)]}`)
.setFooter(message.member.displayName, message.author.displayAvatarURL({ dynamic: true }))
.setTimestamp()
.setColor(message.guild.me.displayHexColor);
Expand Down
10 changes: 6 additions & 4 deletions src/commands/fun/solotrivia.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,22 @@ module.exports = class SoloTriviaCommand extends Command {
const n = Math.floor(Math.random() * questions.length);
const question = questions[n].question;
const answers = questions[n].answers;
const origAnswers = [...answers];
const origAnswers = [...answers].map(a => `\`${a}\``);
// Clean answers
for (let i = 0; i < answers.length; i++) {
answers[i] = answers[i].trim().toLowerCase().replace(/\.|'|-|\s/g, '');
}

// Get user answer
const questionEmbed = new MessageEmbed()
.setTitle('Trivia')
.setTitle('Solo Trivia')
.addField('Topic', `\`${topic}\``)
.addField('Question', `${question}`)
.setFooter(message.member.displayName, message.author.displayAvatarURL({ dynamic: true }))
.setTimestamp()
.setColor(message.guild.me.displayHexColor);
const url = question.match(/\bhttps?:\/\/\S+/gi);
if (url) questionEmbed.setImage(url[0]);
message.channel.send(questionEmbed);
let winner;
const collector = new MessageCollector(message.channel, msg => {
Expand All @@ -60,15 +62,15 @@ module.exports = class SoloTriviaCommand extends Command {
});
collector.on('end', () => {
const answerEmbed = new MessageEmbed()
.setTitle('Trivia')
.setTitle('Solo Trivia')
.setFooter(message.member.displayName, message.author.displayAvatarURL({ dynamic: true }))
.setTimestamp()
.setColor(message.guild.me.displayHexColor);
if (winner)
message.channel.send(answerEmbed.setDescription(`Congratulations ${winner}, you gave the correct answer!`));
else message.channel.send(answerEmbed
.setDescription(`Sorry ${message.member}, time's up! Better luck next time.`)
.addField('Correct Answers', origAnswers.join(', '))
.addField('Correct Answers', origAnswers.join('\n'))
);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/fun/thouart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = class ThouArtCommand extends Command {
If no user is given, then the insult will be directed at you!
`,
type: client.types.FUN,
examples: ['thouart @Calypso']
examples: ['thouart @Nettles']
});
}
async run(message, args) {
Expand Down
6 changes: 4 additions & 2 deletions src/commands/fun/trivia.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = class TriviaCommand extends Command {
const n = Math.floor(Math.random() * questions.length);
const question = questions[n].question;
const answers = questions[n].answers;
const origAnswers = [...answers];
const origAnswers = [...answers].map(a => `\`${a}\``);
// Clean answers
for (let i = 0; i < answers.length; i++) {
answers[i] = answers[i].trim().toLowerCase().replace(/\.|'|-|\s/g, '');
Expand All @@ -47,6 +47,8 @@ module.exports = class TriviaCommand extends Command {
.setFooter(message.member.displayName, message.author.displayAvatarURL({ dynamic: true }))
.setTimestamp()
.setColor(message.guild.me.displayHexColor);
const url = question.match(/\bhttps?:\/\/\S+/gi);
if (url) questionEmbed.setImage(url[0]);
message.channel.send(questionEmbed);
let winner;
const collector = new MessageCollector(message.channel, msg => {
Expand All @@ -68,7 +70,7 @@ module.exports = class TriviaCommand extends Command {
message.channel.send(answerEmbed.setDescription(`Congratulations ${winner}, you gave the correct answer!`));
else message.channel.send(answerEmbed
.setDescription('Sorry, time\'s up! Better luck next time.')
.addField('Correct Answers', origAnswers.join(', '))
.addField('Correct Answers', origAnswers.join('\n'))
);
});
}
Expand Down
3 changes: 2 additions & 1 deletion src/commands/fun/trumptweet.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = class TrumpTweetCommand extends Command {
constructor(client) {
super(client, {
name: 'trumptweet',
aliases: ['trump'],
usage: 'trumptweet <message>',
description: 'Display\'s a custom tweet from Donald Trump with the message provided.',
type: client.types.FUN,
Expand All @@ -23,7 +24,7 @@ module.exports = class TrumpTweetCommand extends Command {
const res = await fetch('https://nekobot.xyz/api/imagegen?type=trumptweet&text=' + tweet);
const img = (await res.json()).message;
const embed = new MessageEmbed()
.setTitle(':flag_us: Trump Tweet :flag_us: ')
.setTitle(':flag_us: Trump Tweet :flag_us: ')
.setImage(img)
.setFooter(message.member.displayName, message.author.displayAvatarURL({ dynamic: true }))
.setTimestamp()
Expand Down
8 changes: 4 additions & 4 deletions src/commands/fun/yomomma.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ module.exports = class YoMommaCommand extends Command {
constructor(client) {
super(client, {
name: 'yomomma',
aliases: ['yourmom', 'ym'],
aliases: ['yourmom', 'yomamma', 'yomama', 'ym'],
usage: 'yomomma [user mention/ID]',
description: oneLine`
Says a random "yo momma" joke to the specified user.
If no user is given, then the joke will be directed at you!
`,
type: client.types.FUN,
examples: ['yomomma @Calypso'],
disabled: true
examples: ['yomomma @Nettles']
});
}
async run(message, args) {
Expand All @@ -26,8 +25,9 @@ module.exports = class YoMommaCommand extends Command {
const res = await fetch('https://api.yomomma.info');
let joke = (await res.json()).joke;
joke = joke.charAt(0).toLowerCase() + joke.slice(1);
if (!joke.endsWith('!') && !joke.endsWith('.')) joke += '!';
const embed = new MessageEmbed()
.setTitle('🤱 Yo Momma 🤱')
.setTitle('🍼 Yo Momma 🍼')
.setDescription(`${member}, ${joke}`)
.setFooter(message.member.displayName, message.author.displayAvatarURL({ dynamic: true }))
.setTimestamp()
Expand Down
2 changes: 1 addition & 1 deletion src/commands/info/avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = class AvatarCommand extends Command {
usage: 'avatar [user mention/ID]',
description: 'Displays a user\'s avatar (or your own, if no user is mentioned).',
type: client.types.INFO,
examples: ['avatar @Calypso']
examples: ['avatar @Nettles']
});
}
run(message, args) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/info/findid.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = class FindIdCommand extends Command {
usage: 'findid <user/role/channel mention>',
description: 'Finds the ID of the mentioned user, role, or text channel.',
type: client.types.INFO,
examples: ['findid @Calypso', 'findid #general']
examples: ['findid @Nettles', 'findid #general']
});
}
run(message, args) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/info/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = class PermissionsCommand extends Command {
If no user is given, your own permissions will be displayed.
`,
type: client.types.INFO,
examples: ['permissions @Calypso']
examples: ['permissions @Nettles']
});
}
run(message, args) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/info/userinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = class UserInfoCommand extends Command {
usage: 'userinfo [user mention/ID]',
description: 'Fetches a user\'s information. If no user is given, your own information will be displayed.',
type: client.types.INFO,
examples: ['userinfo @Calypso']
examples: ['userinfo @Nettles']
});
}
async run(message, args) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/mod/setnickname.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = class SetNicknameCommand extends Command {
if (!args[1]) return this.sendErrorMessage(message, 0, 'Please provide a nickname');

let nickname = nickname = args[1];
if (args[1].startsWith('"')) {
if (nickname.startsWith('"')) {
nickname = message.content.slice(message.content.indexOf(args[1]) + 1);
nickname = nickname.slice(0, nickname.indexOf('"'));
} else if (nickname.length > 32) {
Expand Down

0 comments on commit 434b9d1

Please sign in to comment.