Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pluggable chat transports for lykos? #521

Open
farooqkz opened this issue Jan 25, 2024 · 3 comments
Open

Pluggable chat transports for lykos? #521

farooqkz opened this issue Jan 25, 2024 · 3 comments

Comments

@farooqkz
Copy link

Hello. It could be nice if lykos had pluggable chat platforms. So it could be easily ported to other IMs supporting bot clients such as Matrix, XMPP, DeltaChat, Jami and so on. What do you think?

@Vgr255
Copy link
Member

Vgr255 commented Jan 25, 2024

Hey! We agree, and in fact this is something we want to be doing. Unfortunately, the current IRC library we use is not async, meaning the code isn't made to support other transports. The first step towards making this happens is to move libraries, and update the code to be async. Once that's done, the rest should be relatively easy!

@skizzerz
Copy link
Member

Although I note "pluggable" isn't an explicit goal here; all the transport code would live in the bot itself. There's a fair amount of work to be made to make the game code agnostic to what transport is used, rough sketch as follows:

  1. Common abstraction layer that all transports must implement, that will call into game code (via Events) and be called by the game code (via async calls)
  2. Refactor the User and Channel concepts to be more generic; only capturing game-relevant info at the top level and having transport-specific subclasses. Right now both inherit from IRCContext, and while the existing implementations would likely be mostly used as-is for the IRC-specific subclass there would need to be a higher-level abstract User and Channel that exposes a smaller API for gameplay
  3. Migrate IRC library to something that supports async in order to fit in with the new abstractions created by the above steps. We've already identified a suitable library for this called ircrobots, but no migration work has been made yet.

Once those steps are complete, using a different transport should be a simple matter of changing botconfig; the botconfig aspect is already designed to be transport-agnostic in preparation for the above steps.

@farooqkz
Copy link
Author

Yeah transport agnostic is a much better phrase. I didn't mean explicit pluggeable. Maybe label this issue as feature request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants