about summary refs log tree commit diff
path: root/MatrixRoomUtils.Bot/Bot/Commands/PingCommand.cs
blob: a00cc8b00932893dda4449969eda18b9d81f23ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System.Text;
using MatrixRoomUtils.Bot.Interfaces;
using Microsoft.Extensions.DependencyInjection;

namespace MatrixRoomUtils.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!"
        });
    }
}