about summary refs log tree commit diff
path: root/ExampleBots/LibMatrix.ExampleBot/Bot/Commands/PingCommand.cs
blob: f70cd78451f817fe5a669d0ff054488c07c68d81 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
using LibMatrix.ExampleBot.Bot.Interfaces;
using LibMatrix.StateEventTypes.Spec;

namespace LibMatrix.ExampleBot.Bot.Commands;

public class PingCommand : ICommand {
    public string Name { get; } = "ping";
    public string Description { get; } = "Pong!";

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