mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
feat: added oauth URL generate method and buffter to stream
This commit is contained in:
parent
17149e7b4a
commit
972a91b8de
@ -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'
|
||||
Loading…
x
Reference in New Issue
Block a user