Kraigie / nostrum

Elixir Discord Library
https://kraigie.github.io/nostrum/
MIT License
588 stars 125 forks source link

Feature planning: Behaviours #592

Open jchristgit opened 1 month ago

jchristgit commented 1 month ago

Behaviours

Th3-M4jor commented 1 month ago

What if as part of this we rip Nostrum out of the Application path and require users start it as part of their own Supervision tree instead?

More or less taking inspiration from how Ecto allows you to have multiple Repos running at the same time?

jchristgit commented 1 month ago

Yes, this is the plot. To properly support multi-bot usage with that though we need to make it flexible enough such that users can choose their own implementation of e.g. ratelimiting. For instance, the request method of the ratelimiter should probably be a behaviour and accept, as its last argument, the bot ID to run the request on.