feat/40-reroll-on-disinterest #54
@ -23,7 +23,7 @@ export class ExtendedClient extends Client {
|
||||
private pollCloseBackgroundTasks: Collection<string, ScheduledTask> = new Collection()
|
||||
public constructor(jf: JellyfinHandler) {
|
||||
const intents: IntentsBitField = new IntentsBitField()
|
||||
intents.add(IntentsBitField.Flags.GuildMembers, IntentsBitField.Flags.MessageContent, IntentsBitField.Flags.Guilds, IntentsBitField.Flags.DirectMessages, IntentsBitField.Flags.GuildScheduledEvents, IntentsBitField.Flags.GuildVoiceStates)
|
||||
intents.add(IntentsBitField.Flags.GuildMembers, IntentsBitField.Flags.MessageContent, IntentsBitField.Flags.Guilds, IntentsBitField.Flags.DirectMessages, IntentsBitField.Flags.GuildScheduledEvents, IntentsBitField.Flags.GuildMessageReactions, IntentsBitField.Flags.GuildVoiceStates)
|
||||
const options: ClientOptions = { intents }
|
||||
super(options)
|
||||
this.jellyfin = jf
|
||||
@ -75,6 +75,7 @@ export class ExtendedClient extends Client {
|
||||
this.registerCommands(slashCommands, guilds)
|
||||
this.cacheUsers(guilds)
|
||||
await this.cacheAnnouncementServer(guilds)
|
||||
this.fetchAnnouncementChannelMessage(this.announcementChannels)
|
||||
this.startAnnouncementRoleBackgroundTask(guilds)
|
||||
this.startPollCloseBackgroundTasks()
|
||||
})
|
||||
@ -82,6 +83,11 @@ export class ExtendedClient extends Client {
|
||||
logger.info(`Error refreshing slash commands: ${error}`)
|
||||
}
|
||||
}
|
||||
private async fetchAnnouncementChannelMessage(channels: Collection<string, TextChannel>): Promise<void> {
|
||||
channels.each(async ch => {
|
||||
ch.messages.fetch()
|
||||
kenobi marked this conversation as resolved
Outdated
|
||||
})
|
||||
}
|
||||
private async cacheAnnouncementServer(guilds: Collection<Snowflake, Guild>) {
|
||||
for (const guild of guilds.values()) {
|
||||
const channels: TextChannel[] = <TextChannel[]>(await guild.channels.fetch())
|
||||
|
Loading…
Reference in New Issue
Block a user
why is this necessary?
It's complicated. I put in some JSDoc comments:
Figured something like that. Thanks for the comment