Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //All Copyrights to Erike.#5662
- const Discord = require("discord.js");
- const bot = new Discord.Client()
- const config = require("./userconfig.json")
- const db = require("quick.db")
- let prefix = config.prefix
- async function CR(){
- await db.set(`Author`, `@Erike.#5662`)
- }
- CR()
- bot.on("ready", () => {
- async function readyDo(){
- let status = await db.fetch(`StatusGame`)
- if(status === null) status = "$help";
- bot.user.setGame(`${status}`, 'https://www.twitch.tv/Marshal')
- }
- readyDo()
- })
- bot.on("message", message => {
- if(message.content.toLowerCase() === prefix + "setgame"){
- let permission = message.member.hasPermission("ADMINISTRATOR")
- if(!permission) return;
- let newwstatus = message.content.split(1).join(" ")
- if(!newwstatus) return message.reply("Please write anything to use it")
- message.channel.send("Please wait...").then(msg => {msg.delete(3000)})
- async function setnewgame(){
- await db.set(`StatusGame`, `${newwstatus}`)
- setTimeout(function(){
- async function checkStatus(){
- let currentstatus = await db.fetch(`StatusGame`)
- message.reply(`Status is Changed :) - new Status: ${currentstatus}`)
- let author = await db.fetch(`Author`);
- if(author === null) author = "@Erike.#5662";
- message.channel.sendMessage("` Code Created By: " + author + "`");
- setTimeout(function(){
- process.exit()
- }, 1000)
- }
- checkStatus()
- }, 3000)
- }
- setnewgame()
- }
- })
- bot.login(config.token)
Advertisement
Add Comment
Please, Sign In to add comment