about summary refs log tree commit diff
path: root/LibMatrix.ExampleBot/Bot/Commands/PingCommand.cs
blob: 664dc5395e81a6a93d58b413eee1f3969761d341 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using LibMatrix.ExampleBot.Bot.Interfaces;

namespace LibMatrix.ExampleBot.Bot.Commands; 

public class PingCommand : ICommand {
    public PingCommand() {
    }

    public string Name { get; } = "ping";
    public string Description { get; } = "Pong!";

    public async Task Invoke(CommandContext ctx) {
        await ctx.Room.SendMessageEventAsync("m.room.message", new() {
            Body = "pong!"
        });
    }
}