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; | |
// using System.Text; | |
// using System.Security.Cryptography; | |
static bool CheckAuthorization(Dictionary<string, string> fields, string token, string hash) | |
{ | |
int allowedTimeOffset = 30; // Or whatever you choose | |
if (!fields.ContainsKey("auth_date")) return false; | |
if (long.TryParse(fields["auth_date"], out long timestamp)) | |
{ |
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; | |
using System.Text; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Threading.Tasks; | |
using System.Collections.Generic; | |
namespace MihaZupan | |
{ |
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; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Threading; | |
namespace MihaZupan | |
{ | |
/// <summary> | |
/// A simple request scheduler to help you conform to rate limiting | |
/// </summary> |
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; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace MihaZupan | |
{ | |
// Block the caller of WaitOne as long as necesarry | |
public class RequestScheduler |
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; | |
using System.Net; | |
using System.IO; | |
using Newtonsoft.Json; | |
using Telegram.Bot.Types; | |
namespace StackExBot | |
{ | |
class WebHook | |
{ |
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
tg://resolve/?domain=telegrampassport&bot_id=324335643&scope=%5B%22personal_details%22%2C%22passport%22%2C%22internal_passport%22%2C%22driver_license%22%2C%22identity_card%22%2C%22id_document%22%2C%22id_selfie%22%2C%22address%22%2C%22utility_bill%22%2C%22bank_statement%22%2C%22rental_agreement%22%2C%22passport_registration%22%2C%22temporary_registration%22%2C%22phone_number%22%2C%22email%22%5D&public_key=-----BEGIN%20PUBLIC%20KEY-----%0AMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA9zdenQAkqceYK1j9gXG2%0ANSXH0YZpOB5tJbxAzYZad5lglVEZgUA%2FljIX%2BhZpezSMuqLVIM8r6hoK2KRcRzPv%0AMnQVAy8KCR%2FvMKYNeLOvAJ2FZ%2FIYYbwE4zxP2l8trsx00CtegxUgrbvZEcarGzvl%0AxUPZZxIP9wx9DDVyHZDryVFIffTUJpoSibZci0mjRGMXTgDQTjV7TvQbJOcl3gp4%0Axuf73uiz16MkRlM9xILg0axUfWl9PoVM9bzHOCWScLvNLk9ZSGTiDHlTrQs%2BP%2BMb%0AEpIWS9e5pyR1%2FzULO76OrVgIRSFf5Un2Iea5Sphdg3B8ikEUvt6UKQMWbGN4%2BG26%0AcpgNITcGhv7WP701Zs6%2BBkTpkCcz3ufLt%2FYLt0ZztwIDqa8NGknkyd2Ogq3DAPfH%0ACvEA01%2F0YBwkXAvygylwVXouD%2Fz7gI2nHeOiCnJNQkoVELFu2GoHFmHoUrj3RjKX%0Acu7mqDTvUGTYqCfQqNGc8Ub |
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
tg://resolve/?domain=telegrampassport&bot_id=324335643&scope=%5B%22personal_details%22%2C%22passport%22%2C%22internal_passport%22%2C%22driver_license%22%2C%22identity_card%22%2C%22id_document%22%2C%22id_selfie%22%2C%22address%22%2C%22utility_bill%22%2C%22bank_statement%22%2C%22rental_agreement%22%2C%22passport_registration%22%2C%22temporary_registration%22%2C%22phone_number%22%2C%22email%22%5D&public_key=-----BEGIN%20PUBLIC%20KEY-----%0AMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA9zdenQAkqceYK1j9gXG2%0ANSXH0YZpOB5tJbxAzYZad5lglVEZgUA%2FljIX%2BhZpezSMuqLVIM8r6hoK2KRcRzPv%0AMnQVAy8KCR%2FvMKYNeLOvAJ2FZ%2FIYYbwE4zxP2l8trsx00CtegxUgrbvZEcarGzvl%0AxUPZZxIP9wx9DDVyHZDryVFIffTUJpoSibZci0mjRGMXTgDQTjV7TvQbJOcl3gp4%0Axuf73uiz16MkRlM9xILg0axUfWl9PoVM9bzHOCWScLvNLk9ZSGTiDHlTrQs%2BP%2BMb%0AEpIWS9e5pyR1%2FzULO76OrVgIRSFf5Un2Iea5Sphdg3B8ikEUvt6UKQMWbGN4%2BG26%0AcpgNITcGhv7WP701Zs6%2BBkTpkCcz3ufLt%2FYLt0ZztwIDqa8NGknkyd2Ogq3DAPfH%0ACvEA01%2F0YBwkXAvygylwVXouD%2Fz7gI2nHeOiCnJNQkoVELFu2GoHFmHoUrj3RjKX%0Acu7mqDTvUGTYqCfQqNGc8Ub |
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; | |
using System.IO; | |
namespace Telegram.Bot.Types.InputFiles | |
{ | |
public class NotifyingInputOnlineFile : InputOnlineFile | |
{ | |
private readonly NotifyingStream _notifyingStream; | |
public NotifyingInputOnlineFile(Stream content, long size) |
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; | |
using Telegram.Bot; | |
using Telegram.Bot.Args; | |
using Telegram.Bot.Types; | |
using Telegram.Bot.Types.Enums; | |
namespace HelloBot | |
{ | |
class Program | |
{ |
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.Collections.Immutable; | |
using System.Composition; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.CodeActions; | |
using Microsoft.CodeAnalysis.CodeFixes; | |
using Microsoft.CodeAnalysis.CSharp.Syntax; | |
using Microsoft.CodeAnalysis.Diagnostics; |
OlderNewer