mirror of
https://github.com/Jetsparrow/karmabot.git
synced 2026-01-21 00:56:09 +03:00
21 lines
531 B
C#
21 lines
531 B
C#
using System.Collections.Generic;
|
|
using Telegram.Bot.Args;
|
|
using Perfusion;
|
|
|
|
namespace JetKarmaBot.Commands
|
|
{
|
|
public class StartCommand : IChatCommand
|
|
{
|
|
[Inject(true)]Db Db;
|
|
|
|
public IReadOnlyCollection<string> Names => new[] { "start" };
|
|
|
|
public bool Execute(CommandString cmd, MessageEventArgs args)
|
|
{
|
|
Db.AddChat(new Db.Chat { ChatId = args.Message.Chat.Id });
|
|
Db.AddUser(new Db.User { UserId = args.Message.From.Id });
|
|
return true;
|
|
}
|
|
}
|
|
}
|