mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 04:12:50 +02:00
script for capturing message update events
This commit is contained in:
parent
f501718691
commit
cae591e5fd
5 changed files with 154 additions and 95 deletions
|
@ -14,7 +14,7 @@ class DiscordClient {
|
|||
* @param {string} discordToken
|
||||
* @param {boolean} listen whether to set up the event listeners for OOYE to operate
|
||||
*/
|
||||
constructor(discordToken, listen) {
|
||||
constructor(discordToken, listen = true) {
|
||||
this.discordToken = discordToken
|
||||
this.snow = new SnowTransfer(discordToken)
|
||||
this.cloud = new CloudStorm(discordToken, {
|
||||
|
@ -44,7 +44,9 @@ class DiscordClient {
|
|||
this.guilds = new Map()
|
||||
/** @type {Map<string, Array<string>>} */
|
||||
this.guildChannelMap = new Map()
|
||||
this.cloud.on("event", message => discordPackets.onPacket(this, message))
|
||||
if (listen) {
|
||||
this.cloud.on("event", message => discordPackets.onPacket(this, message))
|
||||
}
|
||||
this.cloud.on("error", console.error)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue