Skip to content

Commit

Permalink
ACTUALLY fix servers in #37
Browse files Browse the repository at this point in the history
was a bug, nothing too special
  • Loading branch information
n1d3v committed Jun 22, 2024
1 parent a8a1544 commit 77056cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Naticord/Classes/WebSocketClientServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ private async void HandleMessageCreateEvent(JToken data)
{
dynamic eventData = data;
string channelId = eventData["channel_id"];

if (channelId != parentServerForm.ChatID.ToString())
{
return;
}

string author = eventData["author"]["global_name"] ?? eventData["author"]["username"];
string content = eventData["content"];
dynamic attachmentData = eventData["attachments"];
Expand Down Expand Up @@ -151,7 +157,7 @@ private async Task ProcessMessageAndUpdateChat(string author, string content, At
bool found = false;
try
{
var messages = await parentServerForm.GetApiResponse($"channels/{parentServerForm.ChatID.ToString()}/messages");
var messages = await parentServerForm.GetApiResponse($"channels/{parentServerForm.ChatID}/messages");

foreach (var message in messages)
{
Expand Down
2 changes: 1 addition & 1 deletion Naticord/Forms/Naticord.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 77056cb

Please sign in to comment.