Skip to content
This repository was archived by the owner on Sep 9, 2022. It is now read-only.

Commit e2d8b63

Browse files
author
shrams
committed
give this a whirl
1 parent c5829f8 commit e2d8b63

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/commands/everyone/drug.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ module.exports = class drugCommand extends commando.Command {
233233
deleteCommandMessages(msg);
234234
return msg.embed(createDrugEmbed(tripSit, result));
235235
}
236+
else if (tripresult === 'Problem communicating with the TripSit API') {
237+
deleteCommandMessages(msg);
238+
return msg.say('Problem communicating with the TripSit API');
239+
}
236240
deleteCommandMessages(msg);
237241
return msg.embed(createDrugEmbed(tripSit, result));
238242
});

src/commands/everyone/trip.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ module.exports = class tripCommand extends commando.Command {
6565
if (!member.roles.cache.has(tripRole.id)) {
6666
let prettyName;
6767
getTripSitDrug(args.drugName).then(function(result){
68+
if (result === 'Problem communicating with the TripSit API') {
69+
return msg.say('Problem communicating with the TripSit API');
70+
}
6871
prettyName = result.pretty_name;
6972
if (prettyName === 'Cannabis') {
7073
msg.reply('Please use the baked command for Cannabis next time');

src/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const getTripSitDrug = function(drugName) {
108108
}, function(error, response, body) {
109109
if (error) {
110110
console.log(error);
111-
reject('Problem communicating with the TripSit API');
111+
resolve('Problem communicating with the TripSit API');
112112
}
113113
else if (response.statusCode !== 200 || body.err) {
114114
resolve('Couldn\'t find any results. Is the drug name correct?');

0 commit comments

Comments
 (0)