Skip to content

Instantly share code, notes, and snippets.

@jwdb

jwdb/Program.cs

Last active Mar 27, 2019
Embed
What would you like to do?
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});}}}
@idkwhoiam322

This comment has been minimized.

Copy link

@idkwhoiam322 idkwhoiam322 commented Mar 26, 2019

I'ma DMCA this ;-;

@NoodleSoup

This comment has been minimized.

Copy link

@NoodleSoup NoodleSoup commented Mar 26, 2019

Lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.