DanBot Re-Coded!

Status
Not open for further replies.

danielpmc

Dank Memer
Staff member
Owner
Member
Developer
#1
DanBot is currently getting re-coded by danielpmc. here i will try to keep an upto date version of the bot for anyone who wants to use some code.
 

danielpmc

Dank Memer
Staff member
Owner
Member
Developer
#2
index.js
Code:
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require("./config.json");
const memes = require("./memes.json");
client.login(config.token);

client.on("ready", () => {
    console.log("Bot is now online!");
    client.user.setActivity(`on ${client.guilds.size} servers | !help | ${Math.round(client.ping)}`);;
    client.setNick("Bot");
});

client.on('message', (message) => {
 
    if(message.content =='Hello'){
        message.channel.send('Hello From The Other Side!');
    
    }
})
client.on('message', (message) => {
 
    if(message.content =='hello'){
        message.channel.send('Hello From The Other Side!');
    
    }
})
var prefix = "!";
var commands = {
    help: function(message) {
      var helpMessage = "hi\n";
      helpMessage += "This Bot is currently getting recoded please wait for the help command to be finished!";
      message.channel.sendMessage(helpMessage);
      message.reply("Test")
    },
    }
client.on('message', (message) => {
    if(message.content =='!ping') {
        const m = message.reply("Waiting for your ping...");
        message.reply(`Pong! Your ping is ${Math.round(client.ping)}ms`);
    }
})
client.on('message', (message) => {
if(message.content =='!hey') {
    const m = message.reply("Hello Its Me!");
    message.delete();
}})
client.on('message', (message) => {
    if(message.content =='!help') {
        message.channel.send(`Here is all the commands: \n !memes : Outputs a list of memes. !output : Uploads the latest save of the bots code to the webserver \n !ping : Shows your ping. \n !hey : Says "Hello Its Me!" \n !help : Shows this menu :face_palm: \n NOTE: There is more to come just not alot added right now as the bot is getting a full re-code from python to js`);
    }
})
client.on('message', (message) => {
    if(message.content =='!memes') {
        message.channel.send(config.memes);
    }
})
client.on('message', (message) => {
    if(message.content =='!memes wae') {
        message.channel.send(memes.wae);
    }
})
//Leave and join messages:
client.on("guildMemberAdd", member => {
    member.addRole(member.guild.roles.find("name","User"));
    member.guild.channels.find("name","general").send(`Hello **${member}**! Welcome To Ecotropolis Network! If you want to know the Server Ip's Address use the command ^ips  :smiley:`);
  });
  client.on("guildMemberRemove", member => {
    member.guild.channels.find("name","general").send(`Bye ${member.user.username} You are now the worlds biggest shrub... :wave:`);
  });

  client.on('message', (message) => {
    if(message.content =='!Serverinfo') {
        message.channel.send("Server Information \n Requsted by ${message.author.tag}` message.author.avatarURL \n » Server Name, ${message.guild.name}," );
    }
})
memes.json
Code:
{
    "wae": "Do you know da wae??? I can show you da wae... https://i.ecotropolis.us/uploads/do_you_know_the_way.jpg"
  }
 
Status
Not open for further replies.