This repository was archived by the owner on Sep 9, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,10 @@ module.exports = class drugCommand extends commando.Command {
233
233
deleteCommandMessages ( msg ) ;
234
234
return msg . embed ( createDrugEmbed ( tripSit , result ) ) ;
235
235
}
236
+ else if ( tripresult === 'Problem communicating with the TripSit API' ) {
237
+ deleteCommandMessages ( msg ) ;
238
+ return msg . say ( 'Problem communicating with the TripSit API' ) ;
239
+ }
236
240
deleteCommandMessages ( msg ) ;
237
241
return msg . embed ( createDrugEmbed ( tripSit , result ) ) ;
238
242
} ) ;
Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ module.exports = class tripCommand extends commando.Command {
65
65
if ( ! member . roles . cache . has ( tripRole . id ) ) {
66
66
let prettyName ;
67
67
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
+ }
68
71
prettyName = result . pretty_name ;
69
72
if ( prettyName === 'Cannabis' ) {
70
73
msg . reply ( 'Please use the baked command for Cannabis next time' ) ;
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ const getTripSitDrug = function(drugName) {
108
108
} , function ( error , response , body ) {
109
109
if ( error ) {
110
110
console . log ( error ) ;
111
- reject ( 'Problem communicating with the TripSit API' ) ;
111
+ resolve ( 'Problem communicating with the TripSit API' ) ;
112
112
}
113
113
else if ( response . statusCode !== 200 || body . err ) {
114
114
resolve ( 'Couldn\'t find any results. Is the drug name correct?' ) ;
You can’t perform that action at this time.
0 commit comments