DarkAtra / v-rising-discord-bot

This bot allows you to display some information about your v rising server on Discord.
https://vrising.darkatra.dev
MIT License
14 stars 4 forks source link

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

Open DarkAtra opened 2 months ago

DarkAtra commented 2 months ago

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:

Messages from Discord to Game:

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

DarkAtra commented 2 months ago

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

DarkAtra commented 1 week ago

For "Game to Discord Chat" see: https://github.com/DarkAtra/v-rising-discord-bot-companion/pull/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