about summary refs log tree commit diff
path: root/Utilities/LibMatrix.Utilities.Bot
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-11-14 10:48:26 +0100
committerRory& <root@rory.gay>2025-11-14 10:48:26 +0100
commit3558ba25896876b0c546f4c2decbb0671187745b (patch)
tree4e1a21a109726bbd7768e8a63b36f720c36f97f9 /Utilities/LibMatrix.Utilities.Bot
parentHandle some non-browser network errors, clean up some well known resolver stuff (diff)
downloadLibMatrix-3558ba25896876b0c546f4c2decbb0671187745b.tar.xz
StateEvent -> MatrixEvent
Diffstat (limited to 'Utilities/LibMatrix.Utilities.Bot')
-rw-r--r--Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs2
-rw-r--r--Utilities/LibMatrix.Utilities.Bot/Interfaces/RoomInviteContext.cs2
-rw-r--r--Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs4
3 files changed, 4 insertions, 4 deletions
diff --git a/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs b/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs

index 71ecbed..4da6df2 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs
@@ -7,7 +7,7 @@ namespace LibMatrix.Utilities.Bot.Interfaces; public class CommandContext { public required GenericRoom Room { get; set; } - public required StateEventResponse MessageEvent { get; set; } + public required MatrixEventResponse MessageEvent { get; set; } public string MessageContentWithoutReply => (MessageEvent.TypedContent as RoomMessageEventContent)! diff --git a/Utilities/LibMatrix.Utilities.Bot/Interfaces/RoomInviteContext.cs b/Utilities/LibMatrix.Utilities.Bot/Interfaces/RoomInviteContext.cs
index 380c1c7..c5ffc7c 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Interfaces/RoomInviteContext.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Interfaces/RoomInviteContext.cs
@@ -7,7 +7,7 @@ namespace LibMatrix.Utilities.Bot.Interfaces; public class RoomInviteContext { public required string RoomId { get; init; } public required AuthenticatedHomeserverGeneric Homeserver { get; init; } - public required StateEventResponse MemberEvent { get; init; } + public required MatrixEventResponse MemberEvent { get; init; } public required SyncResponse.RoomsDataStructure.InvitedRoomDataStructure InviteData { get; init; } public async Task<string> TryGetInviterNameAsync() { diff --git a/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs b/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs
index 7a5f408..5b697de 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs
@@ -119,7 +119,7 @@ public class CommandListenerHostedService( await _cts.CancelAsync(); } - private async Task<string?> GetUsedPrefix(StateEventResponse evt) { + private async Task<string?> GetUsedPrefix(MatrixEventResponse evt) { var messageContent = evt.TypedContent as RoomMessageEventContent; var message = messageContent!.BodyWithoutReplyFallback; var prefix = config.Prefixes.OrderByDescending(x => x.Length).FirstOrDefault(message.StartsWith); @@ -139,7 +139,7 @@ public class CommandListenerHostedService( return prefix; } - private async Task<CommandResult> InvokeCommand(StateEventResponse evt, string usedPrefix) { + private async Task<CommandResult> InvokeCommand(MatrixEventResponse evt, string usedPrefix) { var message = evt.TypedContent as RoomMessageEventContent; var room = hs.GetRoom(evt.RoomId!);