Merge branch 'dev' into 'main'
Dev See merge request illegitimate/illegitimate-bot!227
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { ActivityType, Guild } from "discord.js"
|
||||
|
||||
const statuses = [
|
||||
{ name: "over the Illegitimate Server", type: 3 },
|
||||
{ name: "jon and pit edate", type: 3 },
|
||||
{ name: "for Martina's return", type: 3 },
|
||||
{ name: "w vri's feelings", type: 0 },
|
||||
{ name: "urCryhard steal finals again", type: 3 },
|
||||
{ name: "with Perlcence the AI", type: 0 },
|
||||
{ name: "with ur mom in my bed", type: 0 },
|
||||
{ name: "with Jone the idiot", type: 0 }
|
||||
{ name: (guild: Guild) => { return `over ${guild.memberCount} members` }, type: ActivityType.Watching },
|
||||
{ name: "over the Illegitimate Server", type: ActivityType.Watching },
|
||||
{ name: "jon and pit edate", type: ActivityType.Watching },
|
||||
{ name: "for Martina's return", type: ActivityType.Watching },
|
||||
{ name: "w vri's feelings", type: ActivityType.Playing },
|
||||
{ name: "urCryhard steal finals again", type: ActivityType.Watching },
|
||||
{ name: "with Perlcence the AI", type: ActivityType.Playing },
|
||||
]
|
||||
export = statuses
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { guildid } from "config/options"
|
||||
import statuses from "config/statuses"
|
||||
import { Guild } from "discord.js"
|
||||
import { IEvent } from "interfaces"
|
||||
import { ExtendedClient as Client } from "utils/Client"
|
||||
|
||||
@@ -8,22 +10,24 @@ export = {
|
||||
event: "ready",
|
||||
|
||||
execute(client: Client) {
|
||||
// Playing 0
|
||||
// Streaming 1
|
||||
// Listening 2
|
||||
// Watching 3
|
||||
// Custom 4
|
||||
// Competing 5
|
||||
|
||||
const user = client.user!
|
||||
const guild = client.guilds.cache.get(guildid) as Guild
|
||||
|
||||
user.setActivity({ name: statuses[0].name, type: statuses[0].type })
|
||||
function getActivity(status: ((guild: Guild) => string) | string): string {
|
||||
if (typeof status === "function") {
|
||||
return status(guild)
|
||||
} else {
|
||||
return status
|
||||
}
|
||||
}
|
||||
|
||||
user.setActivity({ name: getActivity(statuses[0].name), type: statuses[0].type })
|
||||
|
||||
let i = 1
|
||||
setInterval(
|
||||
() => user.setActivity(statuses[i++ % statuses.length]),
|
||||
1000 * 60 * 10
|
||||
)
|
||||
setInterval(() => {
|
||||
const status = i++ % statuses.length
|
||||
user.setActivity({ name: getActivity(statuses[status].name), type: statuses[status].type })
|
||||
}, 1000 * 60 * 10)
|
||||
|
||||
user.setStatus("dnd")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user