Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Discord = require("discord.js")
- toml = require("toml")
- fs = require("fs")
- client = new Discord.Client()
- starttime = 0
- emotes = 0
- reloadCFG = ->
- emotes = toml.parse(fs.readFileSync('./emotes.toml', 'utf-8'))
- reloadCFG()
- logtime = ->
- d = new Date()
- time = d.getTime()
- console.log("Current time: #{time}")
- console.log("Bot has been online for #{Math.round((time - starttime)/1000)} seconds")
- client.on "ready", ->
- client.generateInvite().then((link) -> console.log(link)).catch(console.error)
- d = new Date()
- starttime = d.getTime()
- console.log("Starttime: #{starttime}")
- #setInterval(logtime, 3 * 1000)
- console.dir(toml)
- # add message as a parameter to your callback function
- client.on "message", (msg) ->
- # Now, you can use the message variable inside
- if msg.content.match /^u\!lööp/
- msg.channel.send("Set lööp")
- interval = setInterval ->
- # use the message's channel (TextChannel) to send a new message
- msg.channel.send("Headpats for Kyu")
- ,100 * 1000
- if msg.content.match /^u\!gibemotes/
- #console.log(msg.channel.guild.emojis.array())
- for emote in msg.channel.guild.emojis.array()
- em = msg.channel.send("<:#{emote.name}:#{emote.id}>")
- em.then (msg) ->
- console.log(msg.content)
- if msg.content.match /^u\!gibemotelinks/
- em = ""
- for emote in emotes["emotes"]["all"]
- em = em + "#{emote[0]}: #{emote[1]} \n"
- msg.channel.send(em)
- if v = msg.content.match /^u\!add ([\w\W]*) ([\w\W]+)$/
- emotes["emotes"]["all"] += [v[2],v[1],0]
- reloadCFG()
- client.login('');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement