mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
fix: unable to edit if webhook is null (#551)
* fix: unable to edit if webhook is null * fix: use null instead of true * fix: equivalent bug in servers
This commit is contained in:
parent
72843bfeb1
commit
336300bd9a
@ -158,7 +158,7 @@ const Bots = RequestHandler()
|
||||
})
|
||||
|
||||
if (!validated) return
|
||||
const key = await verifyWebhook(validated.webhookURL)
|
||||
const key = validated.webhookURL ? await verifyWebhook(validated.webhookURL) : null
|
||||
if(key === false) {
|
||||
return ResponseWrapper(res, { code: 400, message: '웹후크 주소를 검증할 수 없습니다.', errors: ['웹후크 주소가 올바른지 확인해주세요.\n웹후크 주소 검증에 대한 자세한 내용은 API 문서를 참고해주세요.'] })
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ const Servers = RequestHandler()
|
||||
const invite = await DiscordBot.fetchInvite(validated.invite).catch(() => null)
|
||||
if(invite?.guild.id !== server.id || invite.expiresAt) return ResponseWrapper(res, { code: 400, message: '올바르지 않은 초대코드입니다.', errors: ['입력하신 초대코드가 올바르지 않습니다. 올바른 초대코드를 입력했는지 다시 한 번 확인해주세요.', '만료되지 않는 초대코드인지 확인해주세요.'] })
|
||||
|
||||
const key = await verifyWebhook(validated.webhook)
|
||||
const key = validated.webhook ? await verifyWebhook(validated.webhook) : null
|
||||
if(key === false) {
|
||||
return ResponseWrapper(res, { code: 400, message: '웹후크 주소를 검증할 수 없습니다.', errors: ['웹후크 주소가 올바른지 확인해주세요.\n웹후크 주소 검증에 대한 자세한 내용은 API 문서를 참고해주세요.'] })
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user