about summary refs log tree commit diff
path: root/Jenny/Handlers/InviteHandler.cs
blob: 128de445744a0d757ad3f5e770ad7fed85dcd43f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
using LibMatrix.EventTypes.Spec;
using LibMatrix.Utilities.Bot.Services;

namespace Jenny.Handlers;

public static class InviteHandler {
    public static async Task HandleAsync(InviteHandlerHostedService.InviteEventArgs invite) {
        var room = invite.Homeserver.GetRoom(invite.RoomId);
        await room.JoinAsync();
        await room.SendMessageEventAsync(new RoomMessageEventContent("m.notice", "Hello! I'm Jenny!"));
    }
}