Merge pull request #124 from DjDeveloperr/refactor

fix slash commands in deploy
This commit is contained in:
DjDeveloper 2021-04-10 09:30:30 +05:30 committed by GitHub
commit 7018bf6094
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,6 +75,23 @@ export function handle(
client.handle(cmd, handler) client.handle(cmd, handler)
} }
// Hacky workaround. Timers don't exist in Deploy runtime :(
if (typeof (window as any).setTimeout !== 'function') {
Object.defineProperty(window, 'setTimeout', {
value: (fn: CallableFunction, _ms: number, ...args: any[]) => {
fn(...args)
return 0
}
})
}
if (typeof (window as any).clearTimeout !== 'function') {
Object.defineProperty(window, 'clearTimeout', {
value: (_id: number) => {}
})
}
export { commands, client } export { commands, client }
export * from './src/types/slash.ts' export * from './src/types/slash.ts'
export * from './src/structures/slash.ts' export * from './src/structures/slash.ts'