mirror of
https://github.com/koreanbots/core.git
synced 2026-06-18 01:38:55 +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
|
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
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import {
|
|||||||
objectDiff,
|
objectDiff,
|
||||||
serialize,
|
serialize,
|
||||||
} from '@utils/Tools'
|
} from '@utils/Tools'
|
||||||
import { discordLog, getMainGuild, webhookClients } from '@utils/DiscordBot'
|
import { discordLog, getBotGuild, getMainGuild, webhookClients } from '@utils/DiscordBot'
|
||||||
import { KoreanbotsEndPoints } from '@utils/Constants'
|
import { KoreanbotsEndPoints } from '@utils/Constants'
|
||||||
|
|
||||||
const patchLimiter = rateLimit({
|
const patchLimiter = rateLimit({
|
||||||
@ -181,6 +181,7 @@ 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',
|
||||||
|
|||||||
@ -14,7 +14,8 @@ 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()
|
||||||
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 ?? '')
|
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 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,
|
||||||
|
|||||||
@ -32,7 +32,9 @@ import {
|
|||||||
VOTE_COOLDOWN,
|
VOTE_COOLDOWN,
|
||||||
} from './Constants'
|
} 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 { sign, verify } from './Jwt'
|
||||||
import knex from './Knex'
|
import knex from './Knex'
|
||||||
import { Bots, Servers } from './Mongo'
|
import { Bots, Servers } from './Mongo'
|
||||||
@ -87,9 +89,13 @@ async function getBot(id: string, topLevel = true): Promise<Bot> {
|
|||||||
.where({ id })
|
.where({ id })
|
||||||
.then((r) => r)
|
.then((r) => r)
|
||||||
}
|
}
|
||||||
const botMember = (await getMainGuild()
|
const botMember =
|
||||||
|
((await getMainGuild()
|
||||||
?.members?.fetch(res.id)
|
?.members?.fetch(res.id)
|
||||||
.catch((e) => e)) as GuildMember
|
.catch((e) => null)) ??
|
||||||
|
((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 |
|
||||||
|
|||||||
@ -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.1"
|
version "1.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3"
|
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.2.tgz#d0d2659a26eef778bf84d73e7f55c08144ee7750"
|
||||||
integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==
|
integrity sha512-6xKiQ+cph9KImrRh0VsjH2d8/GXA4FIMlgU4B757iI1ApvcyA9VlouP0yZJha01V+huImO+kKMU7ih+2+E14fw==
|
||||||
|
|
||||||
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"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user