Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const prefix = "mpx:";
- const botname = "MEPHONEX bot (" + prefix + "help)";
- const version = "0.5.0"
- var help = "MEPHONEX bot Commands__\ngv:help, un:say {TEXT}, un:joke, un:fact, un:botinfo, un:roominfo, un:image {IMAGE}";
- var botinfo = "MEPHONEX bot Version " + version + ". Find bot at: https://pastebin.com/SwTqpEWX";
- function sendMsg(msg){
- setTimeout(() => {
- socket.emit("talk",{text: msg});
- },1100);
- }
- setTimeout(() => {socket.emit("command",{list:["name",botname]})},1000);
- setTimeout(() => {socket.emit("command",{list:["name",botname]})},2100);
- setTimeout(() => {socket.emit("command",{list:["color","https://i.imgflip.com/7vil8u.gif"]})},3200);
- setTimeout(() => {
- sendMsg("MEPHONEX bot is online. Type " + prefix + "help to see commands.");
- setInterval( () => {sendMsg("MEPHONEX bot is online. Type " + prefix + "help to see commands.");},60000);
- },4300);
- socket.on("talk", (message) => {
- if(message.text == prefix + "roominfo"){
- sendMsg("Amount of users in the room: " + window.usersAmt);
- }
- if(message.text == prefix + "help"){
- sendMsg(help);
- }
- if(message.text == prefix + "botinfo"){
- sendMsg(botinfo);
- }
- if(message.text.startsWith(prefix + "say")){
- sendMsg(message.text.substring(prefix.length + 3));
- }
- if(message.text.startsWith(prefix + "image")){
- let imgUrl = message.text.substring(prefix.length + 6);
- setTimeout(() => {socket.emit("command",{list:["image",imgUrl]});},1100);
- }
- if(message.text == prefix + "joke"){
- setTimeout(() => {socket.emit("command",{list:["joke"]});},1100);
- }
- if(message.text == prefix + "fact"){
- setTimeout(() => {socket.emit("command",{list:["fact"]});},1100);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement