Skip to content

Commit

Permalink
fix: circular ref
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Jan 27, 2024
1 parent 6251b5c commit 0a212dd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/src/services/EventManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const { generate, read } = require('@rm/masterfile')

const PoracleAPI = require('./api/Poracle')
const { getCache, setCache } = require('./cache')
const DiscordClient = require('./DiscordClient')

class EventManager {
constructor() {
Expand Down Expand Up @@ -123,15 +122,15 @@ class EventManager {
async chatLog(embed, clientName) {
if (clientName) {
const client = this.Clients[clientName]
if (client instanceof DiscordClient && typeof embed === 'object') {
if ('discordEvents' in client && typeof embed === 'object') {
await client.sendMessage(embed, 'event')
} else if (typeof embed === 'string') {
await client.sendMessage(embed, 'event')
}
} else {
await Promise.allSettled(
Object.values(this.Clients).map(async (client) => {
if (client instanceof DiscordClient && typeof embed === 'object') {
if ('discordEvents' in client && typeof embed === 'object') {
await client.sendMessage(embed, 'event')
} else if (typeof embed === 'string') {
await client.sendMessage(embed, 'event')
Expand Down

0 comments on commit 0a212dd

Please sign in to comment.