-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bunnies, Trivia, Trump and Yo Mama Commands. #23
base: develop
Are you sure you want to change the base?
Conversation
fixes?
good stuff
also thank you for the help KhaaZ
pheww 3 hours gone for good
src/commands/Bunnies.js
Outdated
async execute({ message }) { | ||
try { | ||
const utils = this.utils; | ||
const errorText = `Error: ${this.config.emojis.sadcat || '🐰'} No bunnies found.`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uses sadcat emoji here, shouldn't
src/commands/Bunnies.js
Outdated
}, | ||
}); | ||
} catch(err) { | ||
return this.error(message.channel, errorText); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errorText is not defined in the proper scope to be referenced here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So do I remove it then? Or will I have to define it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fix it, the var errorText is not defined in a scope thats accessible here
src/commands/Bunnies.js
Outdated
async execute({ message }) { | ||
try { | ||
const utils = this.utils; | ||
const errorText = `Error: ${this.config.emojis.rabbit || '🐰'} No bunnies found.`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just move this up 3 lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by move? I can't see an error.
Done? |
No, review changes were never finished/fixed |
Boy am I slow.
YES I DID IT (thanks KhaaZ 🍳 ) |
src/commands/Bunnies.js
Outdated
|
||
async execute({ message }) { | ||
const errorText = `Error: ${this.config.emojis.rabbit || '🐰'} No bunnies found.`; | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent spacing between errorText and try {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/commands/Bunnies.js
Outdated
image: { | ||
url: `https://random.birb.pw/img/${res.body.media.poster}`, | ||
}, | ||
url: `https://random.birb.pw/img/${res.body.media.poster}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work. The return values for the bunnies api is:
{"id":"141","media":{"poster":"https://bunnies.media/poster/141.png"},"source":"unknown","thisServed":708,"totalServed":830204}
Which means that this willl resolve to something like this:
https://random.birb.pw/img/$https://bunnies.media/poster/141.png
And thus, will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So remove the .poster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh crap i should of fixed that a while ago
src/commands/YoMama.js
Outdated
async execute({ message }) { | ||
try { | ||
let res = await superagent.get('http://api.yomomma.info/'); | ||
return this.sendMessage(message.channel, JSON.parse(res.text).joke); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent spacing (missing tab before return)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought i fixed it 🤔
src/commands/Bunnies.js
Outdated
{ search: 'Looking for a bunnies...', found: 'Found one!' }, | ||
]; | ||
|
||
const response = responses[utils.getRandomInt(0, responses.length - 1)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look like it's needed, since we only have a single response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/commands/Bunnies.js
Outdated
const response = responses[utils.getRandomInt(0, responses.length - 1)]; | ||
const msg = await this.sendMessage(message.channel, response.search); | ||
|
||
let res = await superagent.get('https://api.bunnies.io/v2/loop/random/?media=poster'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to group this.sendMessage()
and superagent.get()
in a Promise.all([])
so we're not waiting for the message to send before querying the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will that be formatted? I've yet to write a Promise.all statement,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an example:
Dyno-fun/src/commands/Space.js
Lines 19 to 25 in 1abf8af
let [iss, issPeople] = await Promise.all([ | |
superagent.get('http://api.open-notify.org/iss-now.json'), | |
superagent.get('http://api.open-notify.org/astros.json'), | |
]); | |
iss = iss.body; | |
issPeople = issPeople.body; |
Done. |
Anything else friends? |
it says there's requested changes ;) |
Last of the bug fixes and It looks like I have finished. Someone confirm that everything has been fixed? |
Are these commands going to get check? They don't have to become commands; just let me know. :(( |
Thank you KhaaZ. Hopefully there are less and less problems in these commands, if there are any... hammer me down 😸