owengombas / discord.ts

🤖 Create your discord bot by using TypeScript and decorators!
https://owencalvin.github.io/discord.ts/
325 stars 40 forks source link

Multiple bots support #49

Closed vijayymmeena closed 3 years ago

vijayymmeena commented 3 years ago

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.

vijayymmeena commented 3 years ago

Closed

Reason: package is not maintained regularly.