Forgot some args

This commit is contained in:
Loic Bersier 2018-12-30 01:44:10 +01:00
parent 2fb624e265
commit 37f8e97650
7 changed files with 58 additions and 6 deletions

52
commands/admin/untag.js Normal file
View file

@ -0,0 +1,52 @@
const { Command } = require('discord-akairo');
const fs = require('fs');
class UnTagCommand extends Command {
constructor() {
super('untag', {
aliases: ['untag'],
category: 'admin',
split: 'none',
args: [
{
id: "trigger",
type: "string"
}
],
channelRestriction: 'guild',
description: {
content: 'Remove created custom autoresponse',
usage: '[trigger]',
examples: ['"do you know da wea"']
}
});
}
async exec(message, args) {
let trigger = args.trigger;
trigger = trigger.toLowerCase();
let customresponse = {}
let json = JSON.stringify(customresponse)
fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data){
if (err){
console.log(err);
} else {
customresponse = JSON.parse(data); //now it an object
delete customresponse[trigger]
json = JSON.stringify(customresponse); //convert it back to json
fs.writeFile(`./tag/${message.guild.id}.json`, json, 'utf8', function(err) {
if(err) {
return console.log(err);
}
})}});
return message.say(`The following autoresponse have been deleted: ${trigger}`);
}
}
module.exports = UnTagCommand;

View file

@ -12,7 +12,7 @@ class GodCommand extends Command {
});
}
async exec(message) {
async exec(message, args) {
let Attachment = (message.attachments).array();
let image = args.image;
if (!Attachment[0] && !image)

View file

@ -11,7 +11,7 @@ class IdubbbzCommand extends Command {
});
}
async exec(message) {
async exec(message, args) {
let Attachment = (message.attachments).array();
let image = args.image;
if (!Attachment[0] && !image)

View file

@ -11,7 +11,7 @@ class IdubbbzPaintCommand extends Command {
});
}
async exec(message) {
async exec(message, args) {
let Attachment = (message.attachments).array();
let image = args.image;
if (!Attachment[0] && !image)