diff --git a/pages/api/v2/bots/[id]/index.ts b/pages/api/v2/bots/[id]/index.ts index cd6ecc3..c190292 100644 --- a/pages/api/v2/bots/[id]/index.ts +++ b/pages/api/v2/bots/[id]/index.ts @@ -136,7 +136,7 @@ const Bots = RequestHandler() { prefix: bot.prefix, library: bot.lib, web: bot.web, git: bot.git, url: bot.url, discord: bot.discord, intro: bot.intro, category: JSON.stringify(bot.category) }, { prefix: validated.prefix, library: validated.library, web: validated.website, git: validated.git, url: validated.url, discord: validated.discord, intro: validated.intro, category: JSON.stringify(validated.category) } ) - diffData.map(d => { + diffData.forEach(d => { embed.addField(d[0], makeDiscordCodeblock(diff(d[1][0] || '', d[1][1] || ''), 'diff')) }) await discordLog('BOT/EDIT', user, embed, diff --git a/pages/api/v2/management/bots/submits/[id]/[date]/approve.ts b/pages/api/v2/management/bots/submits/[id]/[date]/approve.ts index 5a2e00b..13fd2fa 100644 --- a/pages/api/v2/management/bots/submits/[id]/[date]/approve.ts +++ b/pages/api/v2/management/bots/submits/[id]/[date]/approve.ts @@ -19,7 +19,7 @@ const ApproveBotSubmit = RequestHandler() get.botSubmit.clear(JSON.stringify({ id: req.query.id, date: req.query.date })) get.bot.clear(req.query.id) const embed = new MessageEmbed().setTitle('승인').setColor('GREEN').setDescription(`[${submit.id}/${submit.date}](${KoreanbotsEndPoints.URL.submittedBot(submit.id, submit.date)})`).setTimestamp() - if(req.body.note) embed.addField('📃 정보', `${req.body.note ? `${req.body.note}` : ''}`) + if(req.body.note) embed.addField('📃 정보', req.body.note) await getBotReviewLogChannel().send(embed) return ResponseWrapper(res, { code: 200 }) }) diff --git a/utils/DiscordBot.ts b/utils/DiscordBot.ts index 0257af0..2e9c5d6 100644 --- a/utils/DiscordBot.ts +++ b/utils/DiscordBot.ts @@ -25,7 +25,7 @@ export const discordLog = async (type: string, issuerID: string, embed?: Discord content: `[${type}] <@${issuerID}> (${issuerID})\n${content || ''}`, embed: embed && embed.setTitle(type).setTimestamp(new Date()), ...(attachment && { files: [ - attachment && new Discord.MessageAttachment(Buffer.from(attachment.content), `${type.toLowerCase().replace(/\//g, '-')}-${issuerID}-${Date.now()}.${attachment.format}`) + new Discord.MessageAttachment(Buffer.from(attachment.content), `${type.toLowerCase().replace(/\//g, '-')}-${issuerID}-${Date.now()}.${attachment.format}`) ] }) })