Anonymous Anonymous - 3 months ago
136 0

Bot need help

Javascript

!spell

let url = "http://ephe.github.io/grimoire/spells/";
let d = "-";
let prefix = "!";

bot.on('ready', () => {
  console.log('I am ready!');
});

bot.on('message', message => {
	
	if (message.content.startsWith(prefix + "spell")) {
  let args = message.content.split(" ").slice(1);
		
	
	if (args[0] !== undefined){
		let s1 = args[0];
		let spell = url.concat(s1);
		message.reply(spell);
							}
					
							
	if (args[1] !== undefined){
		
		let s1 = args[0];
		let s2 = args[1];
		let spell = url.concat(s1,d,s2);
		message.reply(spell);
		
								}
	
								
	if (args[2] !== undefined) {
		let s1 = args[0];
		let s2 = args[1];
		let s3 = args[2];
		let spell = url.concat(s1,d,s2,d,s3);
		message.reply(spell);
		
								}
								
 
}});