-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatusmgr.js
30 lines (25 loc) · 901 Bytes
/
statusmgr.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { bot } from "./main.js"
import activities from "./status.json" assert {type: "json"}
import Logger from "./logger.js"
import { COLOR } from "./logger.js"
import { lyrics } from "./lyrics.js"
const logger = new Logger("StatusMgr", COLOR.LIGHT_YELLOW)
export default function run() {
setInterval(updatePresence, 11000)
updatePresence()
logger.log("running!")
}
function updatePresence() {
let random = Math.floor(Math.random() * (activities.length))
let act = activities[random]
let r = Math.floor(Math.random() * lyrics.length)
act.name = act.name.replaceAll("%u", bot.users.cache.size)
act.name = act.name.replaceAll("%g", bot.guilds.cache.size)
act.name = act.name.replaceAll("%s", lyrics.length)
act.name = act.name.replaceAll("%t", lyrics[r].title)
act.name = act.name.replaceAll("%a", lyrics[r].author)
bot.user.setPresence({
status: "online",
activities: [act]
})
}