telegram

'stream.ReadTimeout' threw an exception of type 'System.InvalidOperationException' sending photo to telegram bot

故事扮演 提交于 2019-11-30 19:19:47
I wrote below code for sending a photo to my bot, but in my stream, I have two exceptions for read and write and my photo was not send. I think maybe the reason was this error, but I couldn't fix it: stream.ReadTimeout threw an exception of type 'System.InvalidOperationException' using (var stream = System.IO.File.Open("a.jpg", FileMode.Open)) { var fileToSend = new FileToSend("a.jpg", stream); Task.Run(() => bot.SendPhotoAsync(u.Message.Chat.Id, fileToSend).ConfigureAwait(false)); } René Vogt The reason for this exception is probably that you Dispose the stream immediatly after starting the

Peculiar Eclipse java.lang.UnsupportedClassVersionError, Unsupported major.minor version 52.0

假装没事ソ 提交于 2019-11-30 18:14:51
First of all, I'd like to point out that I am aware that this question has been asked countless times and I am aware of the usual solution. However, it doesn't seem to work for me. When the error Exception in thread "main" java.lang.UnsupportedClassVersionError: org/telegram/mtproto/state/ConnectionInfo : Unsupported major.minor version 52.0 occurs, it is generally caused by compiling with an incompatible JDK-JRE combination. However, as shown by the images below, my setup seems to be in order: Fig. 1. JDK Compliance Fig. 2. JRE Setting Fig. 3. Java Home What seems to be the problem? What am I

send bold & italic text on telegram bot with html

这一生的挚爱 提交于 2019-11-30 10:55:09
I've created a bot in telegram I want to send bold and italic text with HTML page to bot My HTML code is: <html> <head><title>Telegram</title></head> <body> <form method="GET" action="https://api.telegram.org/bot(token)/sendMessage"> <input type="hidden" name="chat_id" value="@testadminch"> <input type="hidden" name="parse_mod" value="markdown"> <textarea name="text"></textarea> <input type="submit" value="Submit"> </form> </body> </html> If I send *bold* the output should be bold but it doesn't work Maak There are two possibilities to get: bold Set the parse_mode to markdown and send *bold*

How to add a bot to a Telegram Group?

烂漫一生 提交于 2019-11-30 10:47:30
问题 I been trying to add a bot to my Telegram group in Android Device but I am not able to do so. I tried @bot_name, /bot_name but it doesn't work. Can anyone tell me is it possible to add a bot to the group or should I create a new bot using Telegram API(not bot API) so I can add the contact number to the group? 回答1: Edit: now there is yet an easier way to do this - when creating your group, just mention the full bot name (eg. @UniversalAgent1Bot) and it will list it as you type. Then you can

telegram bot SSL error: SSL error {error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}

这一生的挚爱 提交于 2019-11-30 09:26:30
问题 I use let's encrypt free SSL (my host provider support it by default), I checked my site at sslshopper.com (the only warning was: The certificate is not trusted in all web browsers. You may need to install an Intermediate/chain certificate to link it to a trusted root certificate. Learn more about this error. The fastest way to fix this problem is to contact your SSL provider. ) and https://www.geocerts.com/ssl_checker the result was that my site passed all tests, except Certificate Chain

Keystore file D\\Telegram-master\\TMessagesProj\\config\\release.keystore not found for signing config 'debug'

China☆狼群 提交于 2019-11-30 08:48:57
I downloaded new version of Telegram. When run it,This error has shown: Keystore file D\Telegram-master\TMessagesProj\config\release.keystore not found for signing config 'debug'. How fix it? Checkout the signingConfig part of build.gradle file: signingConfigs { debug { storeFile file("config/release.keystore") storePassword RELEASE_STORE_PASSWORD keyAlias RELEASE_KEY_ALIAS keyPassword RELEASE_KEY_PASSWORD } release { storeFile file("config/release.keystore") storePassword RELEASE_STORE_PASSWORD keyAlias RELEASE_KEY_ALIAS keyPassword RELEASE_KEY_PASSWORD } } RELEASE_STORE_PASSWORD, RELEASE_KEY

Using Telegram API for Java Desktop App?

不问归期 提交于 2019-11-30 06:23:25
问题 I am not that new to Java Programming, but I have never worked with external libraries etc. Now I want to develop a desktop client for the "Telegram" open-source messaging platform, and I'm stuck when it comes to API-Usage. There is pretty much documentation about the Telegram API, found at https://core.telegram.org/api, and I've already downloaded mtproto, telegram-api and tl-core from github, and compiled my own library jar from source by using gradle. As well, I've already written a small

Peculiar Eclipse java.lang.UnsupportedClassVersionError, Unsupported major.minor version 52.0

三世轮回 提交于 2019-11-30 01:20:36
问题 First of all, I'd like to point out that I am aware that this question has been asked countless times and I am aware of the usual solution. However, it doesn't seem to work for me. When the error Exception in thread "main" java.lang.UnsupportedClassVersionError: org/telegram/mtproto/state/ConnectionInfo : Unsupported major.minor version 52.0 occurs, it is generally caused by compiling with an incompatible JDK-JRE combination. However, as shown by the images below, my setup seems to be in

How to use Telegram API in C# to send a message

允我心安 提交于 2019-11-29 23:09:18
I want use Telegram API in C# for send a simple message to a number. I found some lib's on GitHub but I am not able to use them. Can anyone give a simple code ? Can I simply make HTTP calls ? arlak Install-Package Telegram.Bot Create a bot using the botfather get the api key using the /token command (still in botfather) use this code: var bot = new Api("your api key here"); var t = await bot.SendTextMessage("@channelname or chat_id", "text message"); You can now pass a channel username (in the format @channelusername) in the place of chat_id in all methods (and instead of from_chat_id in

How to add a bot to a Telegram Group?

五迷三道 提交于 2019-11-29 22:56:54
I been trying to add a bot to my Telegram group in Android Device but I am not able to do so. I tried @bot_name, /bot_name but it doesn't work. Can anyone tell me is it possible to add a bot to the group or should I create a new bot using Telegram API(not bot API) so I can add the contact number to the group? Edit: now there is yet an easier way to do this - when creating your group, just mention the full bot name (eg. @UniversalAgent1Bot) and it will list it as you type. Then you can just tap on it to add it. Old answer: Create a new group from the menu. Don't add any bots yet Find the bot