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

feat: Implement a Bi-Directional Chat - V Rising <-> Discord #104

Open
DarkAtra opened this issue Apr 29, 2024 · 2 comments
Open

feat: Implement a Bi-Directional Chat - V Rising <-> Discord #104

DarkAtra opened this issue Apr 29, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@DarkAtra
Copy link
Owner

DarkAtra commented Apr 29, 2024

It would be great if chat messages from within the game are visible on Discord and messages in a specific discord channel are also visible in game. This is how it could be implemented:

Message from Game to Discord:

  • capture chat messages using the bot-companion and send them to discord via Webhooks

Messages from Discord to Game:

  • expose and API endpoint using the bot-companion that allows the discord bot to post messages to the chat. Every message in a given channel could then be posted to that endpoint so that it's visible in game.

Might be useful to implement some form of rate limiting here.

@DarkAtra DarkAtra added the enhancement New feature or request label Apr 29, 2024
@DarkAtra
Copy link
Owner Author

DarkAtra commented May 1, 2024

waiting for the next update to drop as it will likely break all mods again... i'll look into implementing this afterwards

@DarkAtra
Copy link
Owner Author

DarkAtra commented Jun 26, 2024

For "Game to Discord Chat" see: DarkAtra/v-rising-discord-bot-companion#24

According to https://discord.com/safety/using-webhooks-and-embeds webhooks are limited to posting 30 messages a minute.

A webhook can only send 30 messages per minute

This might be an issue... maybe a more general solution for bi-directional communication would be preferred here. Having a bi-directional communication channel would allow the bot companion to push data to the bot and thus reduce the amount of requests the bot has to make while also increasing the speed at which changes are reflected in discord. This would probably also benefit the activity feed, kill feed and, in the future, the leaderboard features.

I think i'll invest some time into researching if the v rising server is capable of sending Server-Sent Events. Ktor will likely support SSE in the next release as well: https://ktor.io/docs/3.0.0-beta-1/sse-client.html

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

No branches or pull requests

1 participant