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