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: post global chat messages to discord #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DarkAtra
Copy link
Owner

@DarkAtra DarkAtra commented Jun 26, 2024

Allows server owners to use a discord webhook to post ingame chat messages (global only) to discord.
See: https://github.com/DarkAtra/v-rising-discord-bot-companion/pull/24/files#diff-5a2f4e90167632d0df9d167fad586935062628fbbe8cb69ac5c0415663fac33aR44-R61

Note: this feature is entirely optional, dotnet6 -> dotnet8
@DarkAtra
Copy link
Owner Author

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

I guess this might be an issue...

private static readonly HttpClient _httpClient = new();
private static readonly JsonSerializerOptions _serializeOptions = new() {
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower
Copy link
Owner Author

@DarkAtra DarkAtra Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JsonNamingPolicy.SnakeCaseLower does not exist in .net6 - see https://github.com/DarkAtra/v-rising-discord-bot-companion/pull/24/files#r1657375255

@@ -4,7 +4,7 @@
<Description>A companion mod for DarkAtra/v-rising-discord-bot.</Description>
<Version>0.4.1</Version>

<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likely has to be reverted - the game uses .net6 and i'm not sure if using a different .net version would cause unexpected issues, so it's safer to stay on the same version as the game for now.

@DarkAtra
Copy link
Owner Author

Progress is tracked here: DarkAtra/v-rising-discord-bot#104

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

Successfully merging this pull request may close these issues.

1 participant