diff --git a/utils/Tools.ts b/utils/Tools.ts index b230431..23cb763 100644 --- a/utils/Tools.ts +++ b/utils/Tools.ts @@ -1,5 +1,6 @@ -import { ImageOptions, UserPemissionFlags } from '../types' -import { perms } from './Constants' +import { Readable } from 'stream' +import { ImageOptions, UserPemissionFlags } from '@types' +import { Oauth, perms } from './Constants' export function formatNumber(value: number):string { const suffixes = ['', '만', '억', '조','해'] @@ -49,4 +50,21 @@ export function checkBrowser(){ return M.join(' ') } +export function generateOauthURL(provider: 'discord', clientID: string, scope: string) { + return Oauth[provider](clientID, scope) +} + +export default function bufferToStream(binary: Buffer) { + + const readableInstanceStream = new Readable({ + read() { + this.push(binary) + this.push(null) + } + }) + + return readableInstanceStream +} + + export { anchorHeader } from './ShowdownExtensions' \ No newline at end of file