Skip to content

Instantly share code, notes, and snippets.

@Useems
Created December 28, 2017 14:56
Show Gist options
  • Save Useems/350aaf2d1df6129eebb8d1c33be0b1bb to your computer and use it in GitHub Desktop.
Save Useems/350aaf2d1df6129eebb8d1c33be0b1bb to your computer and use it in GitHub Desktop.
var Eris = require('eris');
var bot = new Eris("Mzk1NzMxNjI1MTIxNDE1MTY4.DSXJiQ.Zgm2qJPDVnRqSRI5hKQfLafN6dk");
console.log("Connecting...");
bot.on("ready", () =>{
console.log("Sucess");
});
bot.on("messageCreate", (msg) =>{
if(msg.content.indexOf(".msg") == 0){
msg.delete()
msg.content=msg.content.replace('.msg','').toLowerCase().replace(/[^a-zA-Z.]/g,'');
var allmsg = ""
for (var i=0;i < msg.content.length; i++){
allmsg = allmsg+":regional_indicator_"+msg.content[i]+": "
};
bot.createMessage(msg.channel.id, allmsg);
}
if(msg.content.indexOf(".mention") == 0 && msg.author.id == "294919314442813440"){
msg.delete()
bot.createMessage(msg.channel.id, "<@"+msg.mentions[0].id+">");
}
});
bot.connect();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment