diff --git a/pages/calculator.tsx b/pages/calculator.tsx index 1755667..edc75a8 100644 --- a/pages/calculator.tsx +++ b/pages/calculator.tsx @@ -29,7 +29,7 @@ const Calculator:NextPage = ({ query }) => { description: '디스코드 봇 초대링크를 간편하게 생성하세요' }} />

봇 초대링크 생성기

-
권한: {Object.keys(value).filter(el => value[el]).map(el => Number(el)).reduce((prev, curr) => prev | curr, 0)} +
권한: {String(Object.keys(value).filter(el => value[el]).map(el => Number(el)).reduce((prev, curr) => BigInt(prev) | BigInt(curr), BigInt(0)))} = { Object.keys(value).filter(el => value[el]).map(el => `0x${Number(el).toString(16)}`).join(' | ') }
@@ -125,4 +125,4 @@ interface CalculatorProps { query: ParsedUrlQuery } -export default Calculator \ No newline at end of file +export default Calculator diff --git a/utils/Constants.ts b/utils/Constants.ts index 4327817..891230c 100644 --- a/utils/Constants.ts +++ b/utils/Constants.ts @@ -241,7 +241,7 @@ export const DiscordEnpoints = { Token: BASE_URLs.api + '/oauth2/token', Me: BASE_URLs.api + '/v9/users/@me', Guilds: BASE_URLs.api + '/v9/users/@me/guilds', - InviteApplication: (id: string, perms: { [perm: string]: boolean }, scope: string, redirect?: string, guild_id?: string): string => `${BASE_URLs.api}/oauth2/authorize?client_id=${id ? id.split(' ')[0] : 'CLIENT_ID'}&permissions=${Object.keys(perms).filter(el => perms[el]).map(el => Number(el)).reduce((prev, curr) => prev | curr, 0)}&scope=${scope ? encodeURI(scope) : 'bot'}${redirect ? `&redirect_uri=${encodeURIComponent(redirect)}` : ''}${guild_id ? `&guild_id=${guild_id}` : ''}`, + InviteApplication: (id: string, perms: { [perm: string]: boolean }, scope: string, redirect?: string, guild_id?: string): string => `${BASE_URLs.api}/oauth2/authorize?client_id=${id ? id.split(' ')[0] : 'CLIENT_ID'}&permissions=${Object.keys(perms).filter(el => perms[el]).map(el => Number(el)).reduce((prev, curr) => BigInt(prev) | BigInt(curr), BigInt(0))}&scope=${scope ? encodeURI(scope) : 'bot'}${redirect ? `&redirect_uri=${encodeURIComponent(redirect)}` : ''}${guild_id ? `&guild_id=${guild_id}` : ''}`, ServerInvite: (code: string): string => `${BASE_URLs.invite}/${code}`, CDN: class CDN { static root = BASE_URLs.cdn @@ -520,4 +520,4 @@ export const GuildPermissions = { twofactor: true } ] -} \ No newline at end of file +}