mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 22:30:23 +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 { Readable } from 'stream'
|
||||||
import { perms } from './Constants'
|
import { ImageOptions, UserPemissionFlags } from '@types'
|
||||||
|
import { Oauth, perms } from './Constants'
|
||||||
|
|
||||||
export function formatNumber(value: number):string {
|
export function formatNumber(value: number):string {
|
||||||
const suffixes = ['', '만', '억', '조','해']
|
const suffixes = ['', '만', '억', '조','해']
|
||||||
@ -49,4 +50,21 @@ export function checkBrowser(){
|
|||||||
return M.join(' ')
|
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'
|
export { anchorHeader } from './ShowdownExtensions'
|
||||||
Loading…
x
Reference in New Issue
Block a user