Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var inquirer = require('inquirer');
- var clear = require("cli-clear");
- var fs = require("fs");
- var yaml = require("js-yaml");
- clear();
- console.log("\n Megamind \n v2.0 \n Coded by rjt.rockx \n")
- var doc = yaml.safeLoad(fs.readFileSync('config.yaml', 'utf8'));
- var questions = [
- {
- type: 'input',
- name: 'discord_email',
- message: 'Email ID'
- },
- {
- type: 'password',
- message: 'Password',
- name: 'discord_password'
- }
- ];
- var credentials = {d_email:"",d_pass:""};
- inquirer.prompt(questions).then(function (answers) {
- credentials.d_email = JSON.parse(JSON.stringify(answers, null, ' ')).discord_email;
- credentials.d_pass = JSON.parse(JSON.stringify(answers, null, ' ')).discord_password;
- var Discord = require("discord.js");
- var selfbot = new Discord.Client();
- selfbot.login(credentials.d_email,credentials.d_pass);
- // ------------------------------------------------------------------------------------------------------------------------------------
- //
- // BOT CODE
- //
- // ------------------------------------------------------------------------------------------------------------------------------------
- selfbot.on('ready', () => {
- console.log("\n");
- console.log(`Logged in as ${selfbot.user.username}#${selfbot.user.discriminator}`);
- selfbot.channels.get(doc.logchannel).sendMessage(`Logged in as ${selfbot.user.username}#${selfbot.user.discriminator}`);
- });
- var doAction = [function(bot, doc, msg){}];
- selfbot.on('message', msg => {
- if ((msg.content.startsWith(doc.prefix)&& (!(msg.author.bot)))&&msg.author.id===selfbot.user.id)
- {
- var loguser = "**User : **" + msg.author.username + "**#" + msg.author.discriminator + "**";
- var logcontent = "**Content : ** \n" + msg.cleanContent;
- var logplace = "** Location : ** #" + msg.channel.name + " in " + msg.guild;
- var msgtime = msg.createdAt;
- var logdate = msgtime.getFullYear()+'/'+(msgtime.getMonth()+1)+'/'+msgtime.getDate();
- var logtime = msgtime.getHours() + ":" + msgtime.getMinutes() + ":" + msgtime.getSeconds();
- var logdatetime = logdate+' '+logtime;
- var logtime = "** Time : **" + logdatetime;
- var logdetails = loguser + "\n" + logcontent + "\n" + logplace + "\n" + logtime;
- selfbot.channels.get(doc.logchannel).sendMessage(logdetails);
- try{
- var messagecontent = msg.content;
- messagecontent = messagecontent.toLowerCase().trim();
- for(i=0;i<doAction.length;i++)
- doAction[i](selfbot,doc,msg,messagecontent);
- }
- catch(error){
- console.log(error);
- }
- }
- /* if(msg.isMentioned(selfbot.user.id)&&msg.author.id!==selfbot.user.id){
- if(doc.afkmsg!=="mgmdafk"){
- msg.reply(selfbot.user.username + " is afk. \n" + doc.afkmsg)
- }
- if(doc.afkmsg==="mgmdafk"){
- msg.reply(selfbot.user.username + " is afk.")
- }
- } */
- });
- // Lenny
- doAction.push(function something(bot, doc, msg, content){
- if(content.startsWith(doc.prefix + "lenny")){
- var newcontent = "( ͡° ͜ʖ ͡°)";
- if(msg.editable)
- {
- msg.edit(newcontent);
- }
- if(!msg.editable)
- {
- msg.reply(newcontent);
- }
- }
- });
- // Bootify
- doAction.push(function something(bot, doc, msg, content){
- if(content.startsWith(doc.prefix + "bootify")){
- var newcontent=content;
- if(msg.editable)
- {
- msg.edit("", {embed: {
- title: "~---==Eval==---~",
- color: 0xe1ee17,
- fields: [{
- name: "something",
- value: "something"
- }, {
- name: "somethingelse",
- value: "somethingelse"
- }]
- }});
- }
- if(!msg.editable)
- {
- msg.reply("", {embed: {
- title: "Something",
- color: 0xFF0000,
- fields: [{
- name: "Message",
- value: "test"
- }]
- }});
- }
- }
- });
- // ------------------------------------------------------------------------------------------------------------------------------------
- //
- // END OF BOT CODE
- //
- // ------------------------------------------------------------------------------------------------------------------------------------
- });
Add Comment
Please, Sign In to add comment