Ejemplo n.º 1
0
 private async void Bot_OnMessage(object sender, Telegram.Bot.Args.MessageEventArgs e)
 {
     if (e.Message == null || e.Message.Type != Telegram.Bot.Types.Enums.MessageType.Text)
     {
         return;
     }
     await BotAPI.ProcessMessage(this, new TelegramBotIdentifier(e.Message.Chat.Id), e.Message.Text);
 }
Ejemplo n.º 2
0
 private async Task Client_MessageReceived(SocketMessage arg)
 {
     if (arg is SocketSystemMessage)
     {
         var message = arg as SocketSystemMessage;
         if (message.Type == MessageType.GuildMemberJoin)
         {
             await BotAPI.ProcessMessage(this, new DiscordBotIdentifier(arg.Channel.Id), "/start");
         }
     }
     else
     {
         if (arg.Content == null || arg.Content == "")
         {
             return;
         }
         await BotAPI.ProcessMessage(this, new DiscordBotIdentifier(arg.Channel.Id), arg.Content);
     }
 }