Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/commands/image/handhold.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Created on 14.08.2020
*/
const cfg = require('../../config/main.json');
let RRACommand = require('../../structures/rraCommand');
let winston = require('winston');

class HandholdImage extends RRACommand {
constructor({t}) {
super();
this.cmd = 'handhold';
this.cat = 'image';
this.needGuild = false;
this.t = t;
this.accessLevel = 0;
}

async run(msg) {
if (!cfg.use_weeb) {
winston.debug('Handhold imagetype isn\'t available on the rra.ram.moe API.');
return msg.channel.createMessage('This command is unavailable at the moment.');
}
return await super.run(msg);
}
}
module.exports = HandholdImage;
4 changes: 2 additions & 2 deletions src/structures/rraCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Command extends EventEmitter {
if (cfg.use_weeb) {
let res = await axios.get('https://api.weeb.sh/images/random', {
headers: {Authorization: cfg.weebsh_token},
params: {"type": this.cmd === 'nyan' ? 'neko' : this.cmd}
params: {"type": this.cmd === 'nyan' ? 'neko' : this.cmd === 'handhold' ? 'handholding' : this.cmd}
});
return msg.channel.createMessage(res.data.url);
} else {
Expand All @@ -39,4 +39,4 @@ class Command extends EventEmitter {
}
}

module.exports = Command;
module.exports = Command;