Last active
March 27, 2019 07:56
-
-
Save jwdb/6e5b4daa360ce0c793dfd48ee765789f to your computer and use it in GitHub Desktop.
TGBot in one line because @baaakaaaaaaaaa didn't believe me
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO;using Telegram.Bot.Helper;using Telegram.Bot;using Telegram.Bot.Types.Enums;using Telegram.Bot.Types.ReplyMarkups;namespace TGBotLiner{class Program{static void Main(string[] args){TelegramBotHelper _h;_h=new TelegramBotHelper(()=>new TelegramBotClient(File.ReadAllText("token.txt")));_h.Client.OnUpdate+=async(o,e)=>{await _h.UpdateReceived(e.Update);};_h.Messages(_m=>{_m["/start"]=async(m,_)=>{await _h.Client.SendTextMessageAsync(m.Chat.Id,"Hello in my test bot!",replyMarkup:new ReplyKeyboardMarkup(new KeyboardButton("About")));};_m["About"]=async(m,_)=>{await _h.Client.SendTextMessageAsync(m.Chat.Id,"This bot was created by Psyonity.");};});_h.Client.StartReceiving(allowedUpdates:new[]{UpdateType.Message,UpdateType.CallbackQuery});}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lol