diff --git a/components/Docs.tsx b/components/Docs.tsx index 8cb455d..f71d240 100644 --- a/components/Docs.tsx +++ b/components/Docs.tsx @@ -4,9 +4,16 @@ import dynamic from 'next/dynamic' const Container = dynamic(() => import('@components/Container')) const Docs: React.FC = ({ title, header, description, subheader, children }) => { + const t = typeof header === 'string' ? header : title + const d = description || subheader return ( <> - +

diff --git a/components/Hero.tsx b/components/Hero.tsx index 966bf69..8427217 100644 --- a/components/Hero.tsx +++ b/components/Hero.tsx @@ -9,7 +9,10 @@ const Search = dynamic(()=> import('@components/Search')) const Hero:React.FC = ({ header, description }) => { return <> - +

diff --git a/pages/addbot.tsx b/pages/addbot.tsx index 3c6c112..5456eab 100644 --- a/pages/addbot.tsx +++ b/pages/addbot.tsx @@ -71,10 +71,14 @@ const AddBot:NextPage = ({ logged, user, csrfToken, theme }) => { } if(!logged) return - + return - +

새로운 봇 추가하기

안녕하세요, {user.username}#{user.tag}님! 본인이 아니신가요? diff --git a/pages/calculator.tsx b/pages/calculator.tsx index 26380ad..1755667 100644 --- a/pages/calculator.tsx +++ b/pages/calculator.tsx @@ -24,7 +24,10 @@ const Calculator:NextPage = ({ query }) => { } return - +

봇 초대링크 생성기

권한: {Object.keys(value).filter(el => value[el]).map(el => Number(el)).reduce((prev, curr) => prev | curr, 0)} = { Object.keys(value).filter(el => value[el]).map(el => `0x${Number(el).toString(16)}`).join(' | ') } diff --git a/utils/Query.ts b/utils/Query.ts index 471a202..2d60fbe 100644 --- a/utils/Query.ts +++ b/utils/Query.ts @@ -44,9 +44,9 @@ async function getBot(id: string, owners=true):Promise { .orWhere({ vanity: id, trusted: true }) .orWhere({ vanity: id, partnered: true }) if (res[0]) { - const discordBot = await DiscordBot.users.fetch(res[0].id) - await getMainGuild()?.members?.fetch(res[0].id).catch(e=> e) + const discordBot = await DiscordBot.users.fetch(res[0].id).then(r=> r).catch(() => null) if(!discordBot) return null + await getMainGuild()?.members?.fetch(res[0].id) res[0].flags = res[0].flags | (discordBot.flags?.bitfield && DiscordUserFlags.VERIFIED_BOT ? BotFlags.verified : 0) | (res[0].trusted ? BotFlags.trusted : 0) | (res[0].partnered ? BotFlags.partnered : 0) res[0].tag = discordBot.discriminator res[0].avatar = discordBot.avatar diff --git a/utils/ResponseWrapper.ts b/utils/ResponseWrapper.ts index 391101f..c940c3c 100644 --- a/utils/ResponseWrapper.ts +++ b/utils/ResponseWrapper.ts @@ -7,8 +7,8 @@ export default function ResponseWrapper( ) { if (!code) throw new Error('`code` is required.') if (!http.STATUS_CODES[code]) throw new Error('Invalid http code.') - res.status(code) res.setHeader('Access-Control-Allow-Origin', process.env.KOREANBOTS_URL) + res.status(code) res.json({ code, data,