-
Notifications
You must be signed in to change notification settings - Fork 649
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
Discord Ahelp Reply System #2283
Changes from all commits
96a5f78
da2a809
780ce08
bdf791b
432c3ef
ce6f098
977e513
e513e29
551da03
9f94a64
78c8252
a7276e7
83c7244
58f1882
6a78daf
04bbf9f
125a681
eb8df53
7a4757c
f362beb
a968075
992e8df
3ae3bbf
9ceec41
43fd204
af06b18
3939f30
c98e417
06af92d
0cfe249
9fee8f6
edb1cf9
2dee7fa
f20cb90
1e96a14
124f737
9b2895e
3e4f125
f9ae1f4
7db8dfc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ namespace Content.Server.Discord; | |
// https://discord.com/developers/docs/resources/channel#message-object-message-structure | ||
public struct WebhookPayload | ||
{ | ||
[JsonPropertyName("UserID")] // Frontier, this is used to identify the players in the webhook | ||
public Guid? UserID { get; set; } | ||
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this structure even extensible? If this isn't a Discord structure (if you have your own webhook), could you define this elsewhere? Surely you don't need most of these fields (edit: if this is another interface). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tried out a custom webhook and in the end used a default discord one, Discord simply ignores extra fields given to it. The bot uses Most fields expect username and avatar_url are impossible to use on a Bot message and allowed_mentions is already done botsided. |
||
/// <summary> | ||
/// The message to send in the webhook. Maximum of 2000 characters. | ||
/// </summary> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should do some minimal validation on the data it's given before passing it into the BwoinkSystem itself.
For example, you aren't updating the _activeConversations set that OnBwoinkTextMessage sends, limiting rates, and you trust that the formatted string is valid rather than applying the formatting in the BwoinkSystem.
Your use case is different from BwoinkSystem.OnBwoinkTextMessage, but it isn't too far off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the point is still valid - why couldn't the function look something like this:
Whatever function this ends up calling (either through an event or through a direct call) should go through the same logic that the other bwoinks go through - text escaping, admin notifications, all of it. Ideally, both this and OnBwoinkTextMessage call one function and aren't defined twice. If you want selective admin notification, great, but shouldn't that be available on both sides? If not, why? I think that the discord UI should, as much as possible, be a separate view on the same internal interface and not its own one with idiosyncracies to the in-game bwoink system.
No suggestion, I don't have anything working.