mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
fix: fix overflow from bit calculation (#489)
* fix: fix overflow from bit caculation * fix: fix typing issue Co-authored-by: Byungchul Kim <64084503+chul0721@users.noreply.github.com>
This commit is contained in:
parent
cf0bc9dc08
commit
79c31256ca
@ -29,7 +29,7 @@ const Calculator:NextPage<CalculatorProps> = ({ query }) => {
|
||||
description: '디스코드 봇 초대링크를 간편하게 생성하세요'
|
||||
}} />
|
||||
<h1 className='text-4xl font-bold mt-2 mb-4'>봇 초대링크 생성기</h1>
|
||||
<div className='text-2xl font-bold inline-flex items-center'>권한: {Object.keys(value).filter(el => value[el]).map(el => Number(el)).reduce((prev, curr) => prev | curr, 0)}
|
||||
<div className='text-2xl font-bold inline-flex items-center'>권한: {String(Object.keys(value).filter(el => value[el]).map(el => Number(el)).reduce((prev, curr) => BigInt(prev) | BigInt(curr), BigInt(0)))}
|
||||
<span className='ml-2 text-lg font-semibold'>= { Object.keys(value).filter(el => value[el]).map(el => `0x${Number(el).toString(16)}`).join(' | ') }</span>
|
||||
</div>
|
||||
<div className='grid gap-2 grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 mt-2'>
|
||||
@ -125,4 +125,4 @@ interface CalculatorProps {
|
||||
query: ParsedUrlQuery
|
||||
}
|
||||
|
||||
export default Calculator
|
||||
export default Calculator
|
||||
|
||||
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user