mirror of
https://github.com/koreanbots/core.git
synced 2026-06-17 17:28:56 +00:00
Merge branch 'master' into feat/bot-servercount-edit
This commit is contained in:
commit
8cd228f38c
@ -17,6 +17,7 @@ DISCORD_TOKEN=BOT_TOKEN
|
||||
DISCORD_CLIENT_INTENTS=32767
|
||||
|
||||
GUILD_ID=653083797763522580
|
||||
BOT_GUILD_ID=653083797763522580
|
||||
REVIEW_GUILD_ID=906537041326637086
|
||||
|
||||
GITHUB_CLIENT_ID=GH_CLIENT_ID
|
||||
|
||||
@ -24,7 +24,7 @@ import {
|
||||
objectDiff,
|
||||
serialize,
|
||||
} from '@utils/Tools'
|
||||
import { discordLog, getMainGuild, webhookClients } from '@utils/DiscordBot'
|
||||
import { discordLog, getBotGuild, getMainGuild, webhookClients } from '@utils/DiscordBot'
|
||||
import { KoreanbotsEndPoints } from '@utils/Constants'
|
||||
|
||||
const patchLimiter = rateLimit({
|
||||
@ -181,6 +181,7 @@ const Bots = RequestHandler()
|
||||
return ResponseWrapper(res, { code: 400, message: '봇 이름을 입력해주세요.' })
|
||||
await remove.bot(bot.id)
|
||||
await getMainGuild().members.cache.get(bot.id)?.kick('봇 삭제됨.')
|
||||
await getBotGuild().members.cache.get(bot.id)?.kick('봇 삭제됨.')
|
||||
get.user.clear(user)
|
||||
await discordLog(
|
||||
'BOT/DELETE',
|
||||
|
||||
@ -14,7 +14,8 @@ if (!global.kodl) {
|
||||
global.kodl.on('ready', async () => {
|
||||
console.log('Discord Client is ready')
|
||||
await getMainGuild().members.fetch()
|
||||
console.log(`Fetched ${getMainGuild().members.cache.size} Members`)
|
||||
await getBotGuild().members.fetch()
|
||||
console.log(`Fetched ${getMainGuild().members.cache.size} + ${getBotGuild().members.cache.size} Members`)
|
||||
})
|
||||
|
||||
global.kodl.login(process.env.DISCORD_TOKEN ?? '')
|
||||
@ -66,6 +67,8 @@ export const webhookClients = {
|
||||
|
||||
export const getMainGuild = () => DiscordBot.guilds.cache.get(process.env.GUILD_ID ?? '')
|
||||
|
||||
export const getBotGuild = () => DiscordBot.guilds.cache.get(process.env.BOT_GUILD_ID ?? '')
|
||||
|
||||
export const discordLog = async (
|
||||
type: string,
|
||||
issuerID: string,
|
||||
|
||||
@ -32,7 +32,9 @@ import {
|
||||
VOTE_COOLDOWN,
|
||||
} from './Constants'
|
||||
|
||||
import { DiscordBot, getMainGuild } from './DiscordBot'
|
||||
import knex from './Knex'
|
||||
import { Bots, Servers } from './Mongo'
|
||||
import { DiscordBot, getBotGuild, getMainGuild } from './DiscordBot'
|
||||
import { sign, verify } from './Jwt'
|
||||
import knex from './Knex'
|
||||
import { Bots, Servers } from './Mongo'
|
||||
@ -87,9 +89,13 @@ async function getBot(id: string, topLevel = true): Promise<Bot> {
|
||||
.where({ id })
|
||||
.then((r) => r)
|
||||
}
|
||||
const botMember = (await getMainGuild()
|
||||
?.members?.fetch(res.id)
|
||||
.catch((e) => e)) as GuildMember
|
||||
const botMember =
|
||||
((await getMainGuild()
|
||||
?.members?.fetch(res.id)
|
||||
.catch((e) => null)) ??
|
||||
((await getBotGuild()
|
||||
?.members?.fetch(res.id)
|
||||
.catch((e) => null))) as GuildMember)
|
||||
const name = discordBot.displayName
|
||||
res.flags =
|
||||
res.flags |
|
||||
|
||||
@ -8417,9 +8417,9 @@ node-fetch@^2.6.9, node-fetch@^2.7.0:
|
||||
whatwg-url "^5.0.0"
|
||||
|
||||
node-forge@^1.3.1:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3"
|
||||
integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.2.tgz#d0d2659a26eef778bf84d73e7f55c08144ee7750"
|
||||
integrity sha512-6xKiQ+cph9KImrRh0VsjH2d8/GXA4FIMlgU4B757iI1ApvcyA9VlouP0yZJha01V+huImO+kKMU7ih+2+E14fw==
|
||||
|
||||
node-gyp-build@<4.0, node-gyp-build@^3.9.0:
|
||||
version "3.9.0"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user