Skip to content

Instantly share code, notes, and snippets.

@txj-xyz
Created May 18, 2016 06:05
Show Gist options
  • Save txj-xyz/c6f1bcb293d9538dd46cbfe960f2c2ff to your computer and use it in GitHub Desktop.
Save txj-xyz/c6f1bcb293d9538dd46cbfe960f2c2ff to your computer and use it in GitHub Desktop.
if(msg[0] == config.prefix + "tag" && e.message.author.id === config.bot_owner){
var entryName = String(msg[2])
var objName = String(msg[1])
var entry = tagsfile["commands"][objName];
var existsEntry = tagsfile["commands"][entryName]
if(msg[1] == "add"){
if(!args2) return;
if(existsEntry) return e.message.edit("exists :thumbsdown:")
var obj = require("./blocklist.json");
var newentry = args2;
obj.commands[entryName] = newentry;
console.log(obj)
require('fs').writeFileSync(config.blocklist, JSON.stringify(obj, null, '\t'))
}
if(msg[1] == entry){
e.message.edit(entry)
}else{
e.message.edit(entry)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment