Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OWOP.chat.send("/nick Dad Bot[BOT]");
- OWOP.chat.recvModifier = function(msg) {
- if (chatType(msg) == "nickuser") {
- nick = msg.substr((msg.indexOf("]") + 2),(msg.indexOf(": ") - 7));
- } else {
- nick = "ID " + getChatId(msg);
- }
- m = getRealChat(msg);
- if (m.toLowerCase().split(' ')[0] == "im") {
- fm = m.toLowerCase();
- m = m.substr(fm.indexOf('im') + 3,m.length);
- fm = m.toLowerCase();
- if (fm == "dad") {
- OWOP.chat.send("No you're not, you're " + nick);
- } else {
- OWOP.chat.send("Hi " + m + ", I'm Dad");
- }
- }
- if (m.toLowerCase().split(' ')[0] == "i'm") {
- fm = m.toLowerCase();
- m = m.substr(fm.indexOf("i'm") + 4,m.length);
- fm = m.toLowerCase();
- if (fm == "dad") {
- OWOP.chat.send("No you're not, you're " + nick);
- } else {
- OWOP.chat.send("Hi " + m + ", I'm Dad");
- }
- }
- console.log(m);
- return msg;
- }
- function getRealChat(message) {
- var nickname = message.split(": ")[0] + ": ";
- var text = message.slice(nickname.length);
- var idIndex = text.indexOf(': ');
- var ntext = text.substr(0, idIndex);
- return ntext.replace(/\d+/g, '') + text.slice(idIndex + 1);
- }
- function chatType(text) {
- text = text.toString();
- if (text.startsWith("[D]")) {
- return "discord";
- } else if (text.startsWith("Server]") || text.startsWith("Server:") || text.startsWith("Nickname set to") || text.startsWith("User: ")) {
- return "server";
- } else if (text.startsWith("->")) {
- return "tell";
- } else if (text.startsWith("(M)")) {
- return "moderator";
- } else if (isNaN(text.split(": ")[0]) && text.split(": ")[0].charAt(0) != "[") {
- return "admin";
- } else if (text.split(": ")[0].charAt(0) == "[") {
- return "nickuser";
- } else {
- return "nonick";
- }
- }
- function getChatId(m) {
- if (chatType(m) == "nickuser") {
- return m.substr(1,m.indexOf("]") - 1);
- } else {
- if (chatType(m) == "nonick") {
- return m.substr(0,m.indexOf(": "));
- } else {
- return undefined;
- }
- }
- }
- // By Nurutomo #6541
Advertisement
Add Comment
Please, Sign In to add comment