Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jwdb
Last active March 27, 2019 07:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwdb/6e5b4daa360ce0c793dfd48ee765789f to your computer and use it in GitHub Desktop.
Save jwdb/6e5b4daa360ce0c793dfd48ee765789f to your computer and use it in GitHub Desktop.
TGBot in one line because @baaakaaaaaaaaa didn't believe me
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});}}}
@NoodleSoup
Copy link

Lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment