This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
TextChannel, | |
DMChannel | |
} = require('discord.js') | |
function isTextBasedChannel (channel) { | |
return channel instanceof TextChannel || channel instanceof DMChannel | |
} | |
module.exports = function (channel, limit) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.on('message', (message) => { | |
console.log('child received:', message) | |
process.send(message) // echo the message back to parent | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExtendedMap extends Map { | |
constructor (iter) { | |
super(iter) | |
this._array = null | |
} | |
set (key, val) { | |
this._array = null | |
return super.set(key, val) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type JobFunction<T> = (...args: Array<any>) => Promise<T> // eslint-disable-line @typescript-eslint/no-explicit-any | |
export type JobResult<T> = { | |
id: number | |
priority?: number | |
data: T | |
} | |
export type Job<T> = { | |
id: number | |
priority?: number | |
handlePromise: { |
NewerOlder