Skip to content

Commit

Permalink
fix: fixed minor error
Browse files Browse the repository at this point in the history
  • Loading branch information
filename24 committed Sep 20, 2023
1 parent e3881d8 commit bc3a976
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/bot/src/events/onGuildMemberJoin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Event } from '@structures/Event'

export default new Event('guildMemberAdd', async (client, member) => {
if (member.guild.id === '831737463571349536') return

let settings = await client.db.guildSettings.findFirst({
where: {
id: member.guild.id
Expand Down
16 changes: 16 additions & 0 deletions apps/bot/src/structures/BotClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { config as dotenvConfig } from 'dotenv'
import * as Dokdo from 'dokdo'

import { Logger } from '@tempo/utils'
import * as Sentry from '@sentry/node'

import { BaseCommand } from '@types'
import { BaseInteraction } from './Interaction.js'
Expand Down Expand Up @@ -74,9 +75,24 @@ export default class BotClient extends Client {

public async start(token: string = config.bot.token): Promise<void> {
logger.info('Logging in bot...')

await this.login(token).then(() => {
this.setStatus()
})

this.rest.on('rateLimited', (data) => {
Sentry.captureException(
new Error(`[429] RateLimited
Retry after : ${data.timeToReset}ms
Global rateLimited: ${data.global}
Hash: ${data.hash}`),
{
tags: {
type: 'RateLimited'
}
}
)
})
}

public setStatus(status: 'dev' | 'online' = 'online', name = '점검중...') {
Expand Down

0 comments on commit bc3a976

Please sign in to comment.