mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 14:30:22 +00:00
fix: do not send vanity log when no changes are made
This commit is contained in:
parent
54c89490a4
commit
7ca716e48f
@ -219,7 +219,8 @@ const Bots = RequestHandler()
|
|||||||
const csrfValidated = checkToken(req, res, req.body._csrf)
|
const csrfValidated = checkToken(req, res, req.body._csrf)
|
||||||
if (!csrfValidated) return
|
if (!csrfValidated) return
|
||||||
|
|
||||||
const validated: ManageBot = await getManageBotSchema(isPerkAvailable).validate(req.body, { abortEarly: false })
|
const validated: ManageBot = await getManageBotSchema(isPerkAvailable)
|
||||||
|
.validate(req.body, { abortEarly: false })
|
||||||
.then((el) => el)
|
.then((el) => el)
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
ResponseWrapper(res, { code: 400, errors: e.errors })
|
ResponseWrapper(res, { code: 400, errors: e.errors })
|
||||||
@ -241,14 +242,14 @@ const Bots = RequestHandler()
|
|||||||
errors: ['다른 커스텀 URL로 다시 시도해주세요.'],
|
errors: ['다른 커스텀 URL로 다시 시도해주세요.'],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (validated.vanity !== bot.vanity) {
|
||||||
await webhookClients.internal.noticeLog.send({
|
await webhookClients.internal.noticeLog.send({
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
title: '한디리 커스텀 URL 변경',
|
title: '한디리 커스텀 URL 변경',
|
||||||
description: `봇: ${bot.name} - <@${bot.id}> ([${bot.id}](${KoreanbotsEndPoints.URL.bot(
|
description: `봇: ${bot.name} - <@${bot.id}> ([${
|
||||||
bot.id
|
bot.id
|
||||||
)}))`,
|
}](${KoreanbotsEndPoints.URL.bot(bot.id)}))`,
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: '이전',
|
name: '이전',
|
||||||
@ -264,6 +265,7 @@ const Bots = RequestHandler()
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const result = await update.bot(req.query.id, validated)
|
const result = await update.bot(req.query.id, validated)
|
||||||
if (result === 0) return ResponseWrapper(res, { code: 400 })
|
if (result === 0) return ResponseWrapper(res, { code: 400 })
|
||||||
else {
|
else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user