mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 04:12:50 +02:00
allow migrating from old to new bridge
This commit is contained in:
parent
5185ae45ab
commit
39458bd2bf
13 changed files with 214 additions and 42 deletions
|
@ -12,9 +12,9 @@ const discordPackets = sync.require("./discord-packets")
|
|||
class DiscordClient {
|
||||
/**
|
||||
* @param {string} discordToken
|
||||
* @param {boolean} listen whether to set up the event listeners for OOYE to operate
|
||||
* @param {string} listen "full", "half", "no" - whether to set up the event listeners for OOYE to operate
|
||||
*/
|
||||
constructor(discordToken, listen = true) {
|
||||
constructor(discordToken, listen = "full") {
|
||||
this.discordToken = discordToken
|
||||
this.snow = new SnowTransfer(discordToken)
|
||||
this.cloud = new CloudStorm(discordToken, {
|
||||
|
@ -44,8 +44,8 @@ class DiscordClient {
|
|||
this.guilds = new Map()
|
||||
/** @type {Map<string, Array<string>>} */
|
||||
this.guildChannelMap = new Map()
|
||||
if (listen) {
|
||||
this.cloud.on("event", message => discordPackets.onPacket(this, message))
|
||||
if (listen !== "no") {
|
||||
this.cloud.on("event", message => discordPackets.onPacket(this, message, listen))
|
||||
}
|
||||
this.cloud.on("error", console.error)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue