This file contains hidden or 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
| 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}"); | |
| } |
This file contains hidden or 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.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 { |
This file contains hidden or 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; | |
| using UnityEngine; | |
| public static class CoroutineUtils | |
| { | |
| public static Coroutine StartThrowingCoroutine(this MonoBehaviour monoBehaviour, IEnumerator enumerator, Action<Exception> done) | |
| { | |
| return monoBehaviour.StartCoroutine(RunThrowingIterator(enumerator, done)); | |
| } |