Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Discord = require("discord.js");
- var client = new Discord.Client();
- var afk = false;
- var timeOut;
- // todo: check if someone talks and reset timer
- function timer() {
- timeOut = setTimeout(AFK, 300000);
- }
- if(timeOut === "1")
- {
- clearTimeout();
- timer();
- }
- function AFK() {
- client.on("message", function(message)
- {
- var input = message.content.toUpperCase();
- if(timeOut === "1")
- {
- clearTimeout();
- // todo: things to do to the afk below here
- }
- });
- }
- client.login("key");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement