Compare commits

..

No commits in common. "8cd228f38c56f8718ea1ce4e060c1aec27a17bb2" and "0dc8cde7b2de59000f7986511b70b6c93d6a74ce" have entirely different histories.

5 changed files with 9 additions and 20 deletions

View File

@ -17,7 +17,6 @@ DISCORD_TOKEN=BOT_TOKEN
DISCORD_CLIENT_INTENTS=32767 DISCORD_CLIENT_INTENTS=32767
GUILD_ID=653083797763522580 GUILD_ID=653083797763522580
BOT_GUILD_ID=653083797763522580
REVIEW_GUILD_ID=906537041326637086 REVIEW_GUILD_ID=906537041326637086
GITHUB_CLIENT_ID=GH_CLIENT_ID GITHUB_CLIENT_ID=GH_CLIENT_ID

View File

@ -24,7 +24,7 @@ import {
objectDiff, objectDiff,
serialize, serialize,
} from '@utils/Tools' } from '@utils/Tools'
import { discordLog, getBotGuild, getMainGuild, webhookClients } from '@utils/DiscordBot' import { discordLog, getMainGuild, webhookClients } from '@utils/DiscordBot'
import { KoreanbotsEndPoints } from '@utils/Constants' import { KoreanbotsEndPoints } from '@utils/Constants'
const patchLimiter = rateLimit({ const patchLimiter = rateLimit({
@ -181,7 +181,6 @@ const Bots = RequestHandler()
return ResponseWrapper(res, { code: 400, message: '봇 이름을 입력해주세요.' }) return ResponseWrapper(res, { code: 400, message: '봇 이름을 입력해주세요.' })
await remove.bot(bot.id) await remove.bot(bot.id)
await getMainGuild().members.cache.get(bot.id)?.kick('봇 삭제됨.') await getMainGuild().members.cache.get(bot.id)?.kick('봇 삭제됨.')
await getBotGuild().members.cache.get(bot.id)?.kick('봇 삭제됨.')
get.user.clear(user) get.user.clear(user)
await discordLog( await discordLog(
'BOT/DELETE', 'BOT/DELETE',

View File

@ -14,8 +14,7 @@ if (!global.kodl) {
global.kodl.on('ready', async () => { global.kodl.on('ready', async () => {
console.log('Discord Client is ready') console.log('Discord Client is ready')
await getMainGuild().members.fetch() await getMainGuild().members.fetch()
await getBotGuild().members.fetch() console.log(`Fetched ${getMainGuild().members.cache.size} Members`)
console.log(`Fetched ${getMainGuild().members.cache.size} + ${getBotGuild().members.cache.size} Members`)
}) })
global.kodl.login(process.env.DISCORD_TOKEN ?? '') global.kodl.login(process.env.DISCORD_TOKEN ?? '')
@ -67,8 +66,6 @@ export const webhookClients = {
export const getMainGuild = () => DiscordBot.guilds.cache.get(process.env.GUILD_ID ?? '') 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 ( export const discordLog = async (
type: string, type: string,
issuerID: string, issuerID: string,

View File

@ -32,9 +32,7 @@ import {
VOTE_COOLDOWN, VOTE_COOLDOWN,
} from './Constants' } from './Constants'
import knex from './Knex' import { DiscordBot, getMainGuild } from './DiscordBot'
import { Bots, Servers } from './Mongo'
import { DiscordBot, getBotGuild, getMainGuild } from './DiscordBot'
import { sign, verify } from './Jwt' import { sign, verify } from './Jwt'
import knex from './Knex' import knex from './Knex'
import { Bots, Servers } from './Mongo' import { Bots, Servers } from './Mongo'
@ -89,13 +87,9 @@ async function getBot(id: string, topLevel = true): Promise<Bot> {
.where({ id }) .where({ id })
.then((r) => r) .then((r) => r)
} }
const botMember = const botMember = (await getMainGuild()
((await getMainGuild()
?.members?.fetch(res.id) ?.members?.fetch(res.id)
.catch((e) => null)) ?? .catch((e) => e)) as GuildMember
((await getBotGuild()
?.members?.fetch(res.id)
.catch((e) => null))) as GuildMember)
const name = discordBot.displayName const name = discordBot.displayName
res.flags = res.flags =
res.flags | res.flags |

View File

@ -8417,9 +8417,9 @@ node-fetch@^2.6.9, node-fetch@^2.7.0:
whatwg-url "^5.0.0" whatwg-url "^5.0.0"
node-forge@^1.3.1: node-forge@^1.3.1:
version "1.3.2" version "1.3.1"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.2.tgz#d0d2659a26eef778bf84d73e7f55c08144ee7750" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3"
integrity sha512-6xKiQ+cph9KImrRh0VsjH2d8/GXA4FIMlgU4B757iI1ApvcyA9VlouP0yZJha01V+huImO+kKMU7ih+2+E14fw== integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==
node-gyp-build@<4.0, node-gyp-build@^3.9.0: node-gyp-build@<4.0, node-gyp-build@^3.9.0:
version "3.9.0" version "3.9.0"