feat: added oauth URL generate method and buffter to stream

This commit is contained in:
원더 2021-01-24 10:14:08 +09:00
parent 17149e7b4a
commit 972a91b8de

View File

@ -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'