owengombas / discord.ts

🤖 Create your discord bot by using TypeScript and decorators!

Home Page:https://owencalvin.github.io/discord.ts/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple bots support

samarmeena opened this issue · comments

When we import discord.ts and create new client, it initialize MetaStorage once, https://github.com/OwenCalvin/discord.ts/blob/slash/src/logic/metadatas/MetadataStorage.ts.

so when a event or command triggered from bot a it will also execute bot b events. Cause of this issue, only one bot can be used under one deployment.

Steps to reproduce

  1. create a bot with a event like onready.
  2. create another bot with a event like onready but different output.
  3. turn on both bots, and when your bots ready, you will see 4 outputs, but you were expecting only two outputs.

Reason of problem

Metadata does not differentiate between multiple Client objects, because it's scope is globally initialized.

Closed

Reason: package is not maintained regularly.