Skip to content

Instantly share code, notes, and snippets.

View immmdreza's full-sized avatar
🪐
Traveling through codes

MohammadReza immmdreza

🪐
Traveling through codes
View GitHub Profile
// Parse string initData from telegram.
var data = HttpUtility.ParseQueryString(initData);
// Put data in a alphabetically sorted dict.
var dataDict = new SortedDictionary<string, string>(
data.AllKeys.ToDictionary(x => x!, x => data[x]!),
StringComparer.Ordinal);
// Constant key to genrate secret key.
var constantKey = "WebAppData";
@immmdreza
immmdreza / Program.vb
Created March 3, 2022 09:12
VB example of telegram bot,
Imports System.Threading
Imports Telegram.Bot
Imports Telegram.Bot.Extensions.Polling
Imports Telegram.Bot.Types
Imports Telegram.Bot.Types.Enums
Module Program
Sub Main()
Dim bot = New TelegramBotClient("BOT_TOKEN")