Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- const TOKEN = "NjMyNDA3MDE3NTI0NDI4ODAw.XaE-lQ.THjKDaaSkgdjMXcLdRNnJ7e3aa0";
- const PREFIX = "0£0$";
- var bot = new Discord.Client();
- const Halloween = "October";
- const Christmas = "December";
- const Easter = "April";
- var objToday = new Date(),
- weekday = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'),
- dayOfWeek = weekday[objToday.getDay()],
- domEnder = function() { var a = objToday; if (/1/.test(parseInt((a + "").charAt(0)))) return "th"; a = parseInt((a + "").charAt(1)); return 1 == a ? "st" : 2 == a ? "nd" : 3 == a ? "rd" : "th" }(),
- dayOfMonth = today + ( objToday.getDate() < 10) ? '0' + objToday.getDate() + domEnder : objToday.getDate() + domEnder,
- months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'),
- curMonth = months[objToday.getMonth()],
- curYear = objToday.getFullYear(),
- curHour = objToday.getHours() > 12 ? objToday.getHours() - 12 : (objToday.getHours() < 10 ? "0" + objToday.getHours() : objToday.getHours()),
- curMinute = objToday.getMinutes() < 10 ? "0" + objToday.getMinutes() : objToday.getMinutes(),
- curSeconds = objToday.getSeconds() < 10 ? "0" + objToday.getSeconds() : objToday.getSeconds(),
- curMeridiem = objToday.getHours() > 12 ? "PM" : "AM";
- var today = curMonth
- var dmDate = `It was asked at | _${curMonth} ${dayOfMonth} ${curYear} At ${curHour}${curMeridiem} and ${curMinute} minutes_`
- bot.on("ready", function(){
- console.log("Running");
- if(Halloween === curMonth) {
- bot.user.setUsername("🎃TARS")
- console.log("Halloween TARS")
- };
- if(Christmas === curMonth) {
- bot.user.setUsername("🎅TARS")
- console.log("Christmas TARS")
- };
- if(Easter === curMonth) {
- bot.user.setUsername("🐇TARS")
- console.log("Easter TARS")
- };
- if(Easter != curMonth) {
- if(Christmas != curMonth) {
- if(Halloween != curMonth) {
- bot.user.setUsername("TARS")
- console.log("No ongoing events")
- };
- };
- };
- });
- bot.on("message", function(message) {
- if (message.author.equals(bot.user)) return;
- var args = message.content.toLowerCase().split(" ");
- var answermessage = message.content.toLowerCase();
- var serverdm = message.guild;
- var usersMessage = message.author;
- console.log(usersMessage);
- console.log(args);
- if (answermessage.includes("what is tars")) {
- message.reply("contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I am in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("who is tars")) {
- message.reply("contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask who I am in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("what does tars do")) {
- message.reply("contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I do in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("whats tars")) {
- message.reply("contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I am in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("what\'s tars")) {
- message.reply("contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I am in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("whos tars")) {
- message.reply("contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask who I am in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("who\'s tars")) {
- message.reply("contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask who I am in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("who made tars")) {
- message.reply("contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask who created me in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("who created tars")) {
- message.reply("contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask who created me in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("wtf is tars")) {
- message.reply("contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I am in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("what the fuck is tars")) {
- message.reply("contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I am in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("how was tars created")) {
- message.reply("Contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask how I was made in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- It was sent at ${dmDate}`)
- };
- if (answermessage.includes("how was tars made")) {
- message.reply("Contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask how I was made in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- It was sent at ${dmDate}`)
- };
- if (answermessage.includes("how did tars get created")) {
- message.reply("Contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask how I was made in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- if (answermessage.includes("how did tars get made")) {
- message.reply("Contacting <@224237621503721475>, please wait.")
- bot.users.get("224237621503721475").send(`Hey, someone is trying to ask how I was made in ${serverdm}. Would you mind answering them?
- ${usersMessage}\'s message is:
- \`${answermessage}\`
- ${dmDate}`)
- };
- });
- bot.login(TOKEN);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement