Skip to content

Instantly share code, notes, and snippets.

View k0dep's full-sized avatar
🚀

Stanislav Petrov k0dep

🚀
View GitHub Profile

README

@k0dep
k0dep / Program.Message.cs
Created June 23, 2020 21:34
C# telegram bot handle message
static async Task BotOnMessageReceived(Message message) {
Console.WriteLine($"Receive message type: {message.Type}");
if (message.Type != MessageType.Text)
return;
await Bot.SendTextMessageAsync(message.Chat.Id, $"Received {message.Text}");
}
@k0dep
k0dep / Program.cs
Last active January 25, 2023 12:39
C# telegram ping bot
using System;
using System.Threading;
using System.Threading.Tasks;
using Telegram.Bot;
using Telegram.Bot.Exceptions;
using Telegram.Bot.Extensions.Polling;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
static class Program {
using System;
using System.Collections;
using UnityEngine;
public static class CoroutineUtils
{
public static Coroutine StartThrowingCoroutine(this MonoBehaviour monoBehaviour, IEnumerator enumerator, Action<Exception> done)
{
return monoBehaviour.StartCoroutine(RunThrowingIterator(enumerator, done));
}