Well, really ive just started to research some APIs (e.g. https://core.telegram.org/bots/samples for telegram) then you start integrating something with a calender (e.g. https://developers.google.com/google-apps/calendar/quickstart/python ). The idea is pretty much to send a poll, so this becomes a proper I/O pipe using the dates as condition for the outputs. All you really need to figure out is how you want to interact (maybe slash-commands? maybe you want something fancy like this or you might want a timer to do that regularly), and what the conditions are (like the fact that we might get wasted so keep the following morning free).
then you dig into what decision tree models are, and before you know it you take the red pill and you stay in Wonderland and figure out how deep the rabbit-hole goes...
> it does seem kind of sketchy how it attaches to the black desert process
Dude, there is a reason why tool developers are adding their source code on Github pages, so you can look inside and check how the tool works. Claiming that it "attaches to the process" is simply wrong.
You can check if your BlackDesert is using internet connection without hacking anything, and only with the tools you have in your system by default, to do this:
open Task Manager, click View-> Select Columns and check ☑ PID column: https://i.imgur.com/93Y8cCX.png
Now you can read what is the PID of your BlackDesert process, but it doesn't tell you if the application is connected or disconnected, it only tells you that it's running.
To check if the BDO is connected to the server you need to use Windows' netstat command (network statistics), press [Windows key + R] and type "cmd" to run the Command Prompt, in cmd you need to run "netstat -aon" and you will see list of all active connections: https://i.imgur.com/lVwmneC.png
Because you know BDO's PID you just check if the Process has connection ESTABLISHED, and if it doesn't it means BDO disconnected.
What you have left to do, is to shutdown it through Task Manager and send your friend SMS that his BDO dced or notify him with another method, like Telegram Bot https://core.telegram.org/bots (this is what this app is using), so that he knows that he has to login again.
if BDO is running and connected then repeat the above steps after some time to check again.
If you replace yourself, Task Manager, CMD netstat and sending texts with this application, then you will have the same functionality WITHOUT "attaching to the process".
There is https://github.com/teloxide/teloxide though, maybe there is a confusion? It's actively maintained?
You also find it on the official Telegram bots code examples: https://core.telegram.org/bots/samples
According to API Documentation:
>Incoming updates are stored on the server until the bot receives them either way, but they will not be kept longer than 24 hours.
É relativamente fácil.
O primeiro passo é registrar o bot. Você começa um chat com o bot "Botfather" e pede para ele criar um bot. Você diz o nome do seu bot, o username público (para que outras pessoas o encontrem), a descrição do que ele faz e recebe de volta um token secreto de autenticação do bot. Recomendo que você use o cliente para desktop pra isto, fica mais fácil de copiar o token.
O próximo passo é codificar o bot. O mecanismo em que eles operam é através de chamadas para uma API na web recebendo e enviando parâmetros em JSON. Para receber notificações existem 2 métodos: o fácil mas pouco eficiente ("getUpdate") e o mais complicadinho mas mais eficiente ("WebHooks").
O método fácil consiste em fazer um programa que fica rodando em loop e fazendo chamadas para o método "getUpdate" no site do Telegram para receber notificações de mensagens, novos usuários, usuários banidos, etc. Tem um monte de exemplos disso no github. Procure pela sua tecnologia preferida, ela vai estar lá (.Net, Java, Python, C++, Lua, etc). Algumas implementações estão com a API desatualizada mas é fácil atualizá-la. Em https://core.telegram.org/bots/api você vê a API atualizada.
O método mais complicado mas mais eficiente consiste em você criar um website que recebe chamadas do Telegram com as notificações. Você vai precisar de lidar com domínio, criar chaves de encriptação (você pode usar certificado TLS ou chaves que você mesmo criou), checar se o teu ISP te libera as portas que o Telegram usa (80, 8080, 443, 8443) e abrir elas no seu router, instalar um servidor, etc. Eu implementei isto tudo com um Raspberry Pi, o servidor OpenResty (Nginx), a linguagem Lua, chaves que eu criei e um provedor (grátis) de DNS dinâmico.
Edit: tem uma explicação mais detalhada aqui:https://tutorials.botsfloor.com/creating-a-bot-using-the-telegram-bot-api-5d3caed3266d
Well, here's current (08 Oct 2016) situation:
1) On Android you can only format text with single (inline code block) or triple backticks (code block)
2) On Deskop: same as Android
3) On iOS: you can select text and format it with Bold and Italic (no Underline), but when you edit text, you need to format it again, otherwise your changes will be discarded.
Bots have some extra features, you can read about them here
You can use this https://core.telegram.org/bots/api#getfile But be aware of the fact that you cannot share directly pictures, otherwise everyone could see your bot token!
To avoid this, you can, for example, use Imgur API and store the image there, than just save the link in your DB and use every time on your website.
If you're familiar with Bot API, you may notice that Telegram sends user's language code with events: https://core.telegram.org/bots/api-changelog#may-18-2017 (look at "Multilingual bots" section)
Fun fact: user may have different language_code with different messages using different apps. For example, if you set your Android device language to Russian, your bot will see "ru_RU" as language_code, but if you send a message from iPhone set to English language, you may have en_US or so.
I'm not quite sure how exactly Telegram determines "primary" language for such bi-, tri- and other -linguals, but they've been collecting such information at least since 2017
Definitions are implemented manually, because we represent some types and methods a different way than they're defined per docs; otherwise, operating on those types would be troublesome. For example, the <code>editMessageText</code> method returns true
if you call it with inline_message_id
or a Message
if you call it with chat_id
and message_id
. Because of that, we decided to split it into two methods: <code>EditMessageText</code> and <code>EditInlineText</code>. This way, it's easier to deal with the return type, and it also prevents you from calling this method with either all the three parameters or none of them.
You can; bots with administrative privileges can remove messages. https://core.telegram.org/bots/api#deletemessage
I believe there's a fair number of Telegram bot API libraries out there that support these commands. In that case, it could be as simple as (pseudocode):
while(true) { messages = getUpdates(...); for (message in messages) { if (message['sticker'] != null && !in_array(message['from'], allowedUsers)) { deleteMessage(message['chat'], message['message_id']); } } }
Yeah that's certainly possible. Set up a bot with it group chat privacy set to enable receiving all messages.
Then add the bot to your group chat, take note of the chat id. Then start a personal chat with the bot, take note of the chat id.
Then you can use the forwardMessage method to forward all the messages from the group chat to you private chat.
Of course you'll need to either enable polling or a webhook to receive the messages send in your group chat. You'll also need to have the application responsible for controlling the telegram bot running on some kind of server or pc which is on for most of the time.
There's certainly some programming involved. It's probably best to use a programming language which has a Telegram API library available so that you don't need to do it manually. Although it's certainly possible.
> You do realize you cant make bots on telegram right?
Are you serious? You can you can make bots on Telegram, it's one of their main differences between TG and Whatsapp, besides stickers and secret chats.
Since you mentioned programming, then using the Telegram Bot API you can implement your own bot (with Python too, here's a nice library) that will do whatever you want, including reading all the messages in a group chat and posting certain responses when triggered by some keyword/phrase.
Do you mean inline buttons (the ones that come attached to messages), or reply keyboard buttons (the ones that replace your regular keyboard)?
if you mean inline buttons, they have the text property and the callback_data property. Just set a different callback data for each
If you mean reply keyboard button, you have no choice. Whatever is written on the text field (the face of the button) will be sent.
edit: ps: As a general courtesy for all the users, next time please use a more descriptive thread title. Also, though yours is not exactly a programming problem, try to give as much detail as you can, like what programming language you are using, as well as the API wrapper (if any).
With this. If you don't want to store values, you may sacrifice some response speed by doing this query on every privileged command, and checking if the ID is there.
You might also want to consider checking for the optional ['from']['chat']['all_members_are_administrators'] value. getchatadministrators only returns members who were explicitly set as admins at one point in the chat's history.
According to Bot API docs, «Incoming updates are stored on the server until the bot receives them either way, but they will not be kept longer than 24 hours»
Well, first of all you should tell us what you are using to create the bot.
Generally speaking, the bot API gives you an update with a field called edited_message
instead of just message
, once someone edited one (see this section in the API documentation). However, both contain a message object, which may have the same message_id
for the original and the changed message. If you use this ID in some strange way, the bot could creash - but this is all just guesses until you give some more info on your bot.
In this subreddit you find plenty of tutorials how to create & host a bot e.g with php, but the problem is, REALLY working with api's you need basic to advanced programming knowledge since you have to work around given structures and need to know how to use them or how to solve basic problems. If you dont have this, you should start with something easier and keep improving with the level of difficulty.
If you decide to ignore my advice, here is the documentation of the api: https://core.telegram.org/bots/api
I guess what you'd be making is a Telegram bot, so you'd need access to Telegram API I think so you can pull info from the chat channels directly.
https://core.telegram.org/bots/samples
Check the Python section and see if those modules might work.
You might also want to look into making regular expressions, regex, so you can sift through content your program scrapes from Telegram that you want to detect and automatically grab whatever follows. For example an expression to detect any download link in the chat, then pass that along no matter how long or short that link is. There's a lot of ways to detect it with regex. It'll just take some learning and practice first.
Automate the Boring Stuff has a good section on regex.
In se non cambiava molto da altre criptovalute ma sarebbe stata interessante l'integrazione con Telegram, soprattutto vista tutta una serie di API disponibili per i pagamenti all'interno dei cosiddetti "merchant bot". Invece di fare tanti cambi valuta per acquistare su bot di nazionalità diversa (col cambio favorevole o sfavorevole) si sarebbe potuto semplicemente convertire in Gram e pagare con quelli, con un grosso vantaggio lato privacy in tutti quei paesi dove Telegram è fortemente ostacolato per via delle sue regole molto rigide in ambito ( tipo la Russia ) . Ovviamente se questo è positivo, l'altro lato della medaglia sarebbe stato uno spopolare di tutta una serie di servizi illegali pagati in questo modo ma non mi sembra un motivo abbastanza valido per tagliare le gambe a un progetto del genere (perché diciamocelo, anche se è stato chiuso per l'aspetto speculativo io dubito sia veramente quello il motivo). Oltretutto un altra ottima idea sarebbe stato lo scambio di denaro tra amici, soprattutto se il Gram fosse stato possibile spenderlo anche al di fuori di Telegram: esempio, abbonamento Netflix condiviso, si raccolgono i soldi su un gruppo e poi uno paga direttamente con quelli, senza passare ad altre valute. Peccato lo abbiano dovuto chiudere, ero davvero curioso di vederne l'effettiva applicazione...
Note that here I'm talking only about group chats:
Every Telegram bot has a setting called "Privacy mode". When privacy mode is ON, a bot in group gets only commands for this bot, replies to bot's messages and messages with bot mention. When privacy mode is OFF, bot reads all messages in chats. If a bot is promoted as group admin, its privacy mode for this exact chat is switched OFF, regardless of global privacy mode setting.
Telegram is great! I use it for a lot of my personal automation work.
It has simple and bot concise API That doesn't require any sign up.
One of the best things in my view is that it has a polling mode to check messages instead of strictly WebHooks, so you can write the whole app on the device.
If you have no idea about how to code no, it's hard. I'm a software developer so for me it's easy to get a code sample from telegram and start playing with it.
​
For you who don't have any ideia how to code it's more difficult, maybe you can integrate with some existing services. I also use the IFTTT bot to do some tasks, this is really easy to configure in their website.
by "can read messages", I meant disabling the privacy mode with Bot Father.
https://core.telegram.org/bots#privacy-mode
>2. Bot admins and bots with privacy mode disabled will receive all messages except messages sent by other bots.
If I were you, I'd look into Telegram - it's an instant messenger that comes with an easy to use HTTP API. You can simply install Telegram on your device, register a bot, then have it message you with a simple HTTP request from Python.
I'm assuming you know about the Bot Payments API. Warning: because it's "bot monetization", it's a digital service and you won't be able to sell to iOS users.
I have been experimenting with making a bot to allow digital artists to take payments for quick sketches and icons. Think Fiverr, but not. The bot side is easy - the hard part is figuring out how to forward that money off to artists without getting screwed on disputes. There's also the legal difficulties of acting as an escrow agent. But in general, that API is a good bit easier to work with than PayPal, you just have to have some knowledge of bot design.
Note that the minimum payment is USD1.00 (other currencies vary) and typically you'll only see USD0.67 of that after fees. Although it's an interesting idea, there are a lot of free budgeting tools out there, and I don't know if I would pay a whole lot for a bot for that unless you have some crazy Mint-like integration deals.
If I remember right there's an URL you can use with Telegram (given the right API keys) which streams all the messages going to/from a chat (in JSON I think), you could just write a code that monitors that data.
Premetto che non avrei idea di come interagire con Facebook, come progetto è sicuramente fattibile; non sapendo programmare potrebbe complicarti un po' le cose (soprattutto all'inizio), ma comunque se sei motivato e disposto ad imparare uno o più linguaggi puoi farcela.
La difficoltà del progetto dipende da cosa hai intenzione di fare: se ad esempio vuoi solo girare una pagina facebook appena pubblicata, potresti creare un bot senza utilizzare database (e quindi un "linguaggio" in medo da studiare), ma se vuoi aggiungere funzioni o feature varie che ogni utente può personalizzare allora dovrai imparare a gestire anche i database.
Per quanto riguarda i linguaggi, ti rimando al sito ufficiale
If you read https://core.telegram.org/bots/api#getupdates you see that it says "By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id", that is if you want to clear the messages, take note of the highest update_id you have seen and pass one plus that value as the offset in the next call.
In order to post a photo you need to issue API request to sendPhoto method, rather than sendMessage (as in example you referred). See API docs for more details. Note that in sendPhoto description parameter is called "caption", not "text".
I'm not sure whether IFTTT is able to send file content using multipart/form-data which is required by Telegram API. I'm pretty sure it should be able to.
PS: I'm the creator of CelebrityGirls channel but it doesn't rely on IFTTT or any similar services.
Si è una cosa realizzabile e credo non sia nemmeno molto complicato da fare (diversi blog hanno questo tipo di bot, vedi leganerdbot, magari trovi qualche tutorial mirato)
Avevo dato un'occhiata al mondo dei bot qualche tempo fa, i diversi linguaggi variano in base all'infrastruttura dove li farai girare (es. php puoi farlo girare su qualsiasi server, python invece no ma puoi farlo fare ad un raspberry pi, ecc...)
L'unica rottura è che ti serve un certificato SSL (cioè di una connessione sicura) che solitamente è a pagamento
Io non sono un programmatore professionista, anzi lo faccio nel poco tempo libero che mi ritrovo, magari qualche altro utente può darti delle dritte più serie
Intanto qui trovi tutto per iniziare
edit: ho trovato queste due guide che potrebbero fare al caso tuo:
Why doesn't my bot see messages from other bots? Bots talking to each other could potentially get stuck in unwelcome loops. To avoid this, we decided that bots will not be able to see messages from other bots regardless of mode. Source
yes and no. When you restart the script, it's like the server is talking with a new entity altogether. The script doesn't really know that you had already seen those updates on the previous call, so it just asks for all of them.
We'll need to somehow preserve the ID of the last update seen, throughout script calls. This means that this value must be written somewhere outside the script. Now, there are plenty of ways to doing this. But let's try a simple file. Create a file on the same folder where your script is and inside the file write a simple '0'.
afterwards, replace line 6 by:
with open('my_last_update_file.txt', 'r') as f: last_update = f.readline().strip()
This way we're telling the script that the last update is not always 0, it's whatever is written in the file (which right now is 0 aswell)
We still have the problem of how to ask the server for only the updates after the last update we've already handled.
You can see in the docs that the getUpdates method (which we're using in line 15) can receive a parameter called offset. What does that do?
> Identifier of the first update to be returned.
Great! it's exactly what we need. So let's call the get updates method properly now:
get_updates = json.loads(requests.get(url + 'getUpdates', params=dict(offset=last_update)).content)
Well hang on. This actually hasn't start working properly yet. Our file has '0' written on it, so it always gets 0. That's because when we write an update, we need to write that to file!
This part I'll leave to you. What you want to do is write to the file you created the contents of the variable "last_update" after the line that reads
last_update = update['update_id'] # Write last_update to file
Try this link for help! Good luck
Bots can provide services and integrations in ways human users cannot. For example, @GitHubBot sends you GitHub notifications and messages, @Pollbot lets you do polls in groups, etc. Check the intro.
The purpose of Bub is to make it easier to program bots with Node. Rather than sending an HTTPS request with umpteen parameters, and then singling out and parsing each message, wouldn't it be simpler if you could just say:
bot.on('/start', doThis);
Is it perhaps an idea to test if the bots adhere to the 'standards'? I use quotes because its not very clear and there is only a short mention of them on the Telegram Bot API site.
Like for example, the bot API site states that bots must have these commands:
/start
/help
/settings (if applicable)
But most bots I try do not have these. So then you have to randomly figure out the commands or hope /setcommands is set correctly by the dev.
Another point is that bots should not respond to /start or /help in group chat, only /help@botname or similar. Imagine you have 10 bots in your chat and someone says /help ...
Anyways, perhaps an idea for an extra column with a big green/red text if it passes certain tests. Since dev's can do whatever they want now, having a big red "NO" in here may motivate them to fix their bot.
https://core.telegram.org/bots/api#replykeyboardmarkup
You have to pass a array for keyboard, with an array with strings in it.
For example [ [ "Top Left", "Top Right" ], [ "Bottom Left", "Bottom Right" ] ]
Not tested.
No, by default a bot will only receive:
>* All messages that start with a slash ‘/’ >* Messages that @mention the bot by username >* Replies to the bot's own messages >* Service messages (people added or removed from the group, etc.)
https://core.telegram.org/bots#privacy-mode
You can check if a bot is in privacy mode: when you look at the list of people in a group, those bots appear last and say 'has no access to messages'.
checkout telegram docs: https://core.telegram.org/bots/api#sendmediagroup
The parameter name is media and it should be array of dict’s (of type given in docs)
Here is an example: https://www.icloud.com/shortcuts/829a0ef22cd24339b37d20bcf41790bc
You don't need any programming or fancy software if you're just sending a static message. After setting up a new bot with @botfather and adding it to your group, you can set a cron job on your system to periodically open the URL https://api.telegram.org/bot<your_bot_token>/sendMessage?chat_id=<group_chat_id>&text=<warning_text> . If you don't use a client that shows the group id, you can use getUpdates once to find out, or use some other bot that's made to tell you the ID and other metadada. If the group is public, using the group's username as the ID could work. (see more on https://core.telegram.org/bots/api#making-requests)
End to end encryption means you have telegrams public key and telegram has your own public key, on which messages are encrypted, and can only be decrypted with a private key you own (for your public key) and telegram owns for his public key.
End to end encryption still doesn't solve the problem with "trust". How do you know, who you are talking to is a telegram server? Well, you know that you are talking to telegram, because a certificate authority tells you that the server you are talking to is telegram. But this certificates can be forged and falsficated. There goes your trust. So if you were having a man in the middle, that does interfere with your data and presents itself as you in the eyes of telegram, and as telegram in your eyes, how can you know? Https and ssl certificates aren't a way to solve this, they are a contrameasure against side walking spy's, or nodes. They encrypt your data, so that nobody that doesn't have the key to decrypt it cant see what's about.
So, to the library you used... It doesn't matter, what library you decided to use, it haa nothing to do with that. If you go to the first page of making your own bot in telegram, search for Making requests in https://core.telegram.org/bots/api. The way your server connects to the api of your server is via a https connection to https://api.telegram.org/bot<token>, making get and posts requests. That is what's happening under the hood of the library you use for your bot.
So, lets say I configure now my router to set a dns with api.telegram.org to another computer in my network, and I simulate being a telegram server. First... How does your server know, I am not a telegram server, and second, what does stop me from sending to your GET request missinformation so the bot tells me anything I want?
I have never tried the approach that you have described as some kind of automation. IMO it seems painful. Interesting what you describe but I would use an api regardless because available api’s for Telegram are wonderful.
You are already aware of Telegram Bot API
https://core.telegram.org/bots/api/
Pointers and some tips:
Method sendVoice is probably what you want.
At a coding level there is a parameter chat_id for users, channels & groups. This param is generally required and would be the root for tg://resolve.
IDbot in Telegram is useful to establish chat_id but not the only way.
bots cannot send messages directly to users by design.
Research limits on sending messages or you could get banned if too quick.
Search for curl sendMessage as keywords.
Another approach is to use userbots. There are multiple ways but I really like Telethon.
Userbots can send messages directly to users. Telethon is possible from Tasker too.
I think it's depends a bit on the context, if you want to read all past messages in a channel you need to build a telegram client, you can look up telethon (python) or tlsharp (c#). If you only need to read new messages you have to create a bot and add it to the channel, there are a ton of libraries you can use. Lots of examples here: https://core.telegram.org/bots/samples
I wrote my own simple framework for this based on the documentation:
https://core.telegram.org/bots/api
Something like this:
class Bot
{
private $token;
public function __construct($token)
{
$this->token = $token;
}
public static function create($token)
{
return new Bot($token);
}
public function sendMessage(SendMessageParams $params)
{
$this->send((array)$params);
}
public function sendMessageTo($chatId, SendMessageParams $params)
{
$arr = (array)$params;
$arr['chat_id'] = $chatId;
$this->send($arr);
}
private function send($data) {
return file_get_contents("https://api.telegram.org/bot$this->token/sendMessage?" . http_build_query($data));
}
}
class SendMessageParams
{
public $chat_id;
public $parse_mode = 'Markdown';
public $text;
public $disable_web_page_preview = null;
public $disable_notification = null;
public $reply_to_message_id = null;
public $reply_markup = null;
/**
* SendMessageParams constructor.
* @param string $text
* @param int $chat_id
*/
public function __construct($text, $chat_id = null)
{
$this->chat_id = $chat_id;
$this->text = $text;
}
public static function create($text, $chat_id = null) {
return new SendMessageParams($text, $chat_id);
}
}
In telegram only a bot can post messages having inline keyboards
https://core.telegram.org/bots/2-0-intro#new-inline-keyboards
You can forward the bot message in your group though.
I would usually do so with an email alert API (maybe the Email Trigger extension for Firebase might help you).. if you'd rather go for something more sleek, you might want to create a simple Telegram Bot script running as a job and with a hardcoded check of your telegram user id\private group id, so that notifications couldn't be read by others.
Yes it would be possible. you would need to set up a telegram bot and have that bot in the group
https://core.telegram.org/bots
https://core.telegram.org/bots/api
you would then send a http request to the bot, using the http request block. https://core.telegram.org/bots/api#making-requests
Hi! In order to start you should have a clear idea of the general setup.
You should create the bot with @BotFather and after the process he will give you a Token. You should know that a bot is run on a server that you should have (an host is fine too). There’re many free services only.
With the previous token, you enable a connection between Telegram and your server. Now it’s code time! You can you whatever language you want. If you don’t know any language, try using PHP, I find it very easy and powerful at the same time.
Last but not least you should have in that forum a RSS feed (usually mywebsite.com/feed or similar). You could use that to see what’s new, combined with a DB (where you store whether you have been already alerted for that post).
Have a look to https://core.telegram.org/bots/api Good 📚studies and 🔧work
Ok, then you should have an online host, where to leave you code always on in order to let the bot be reachable. Then you should link your bot and your host (https://core.telegram.org/bots/api#authorizing-your-bot) and start write your code! You can use PHP that is pretty easy, but you can use any programming language you want. As you see, is not easy at first sight.
However you’re lucky because you don’t need to do this, someone else did it for you. There are many many bots already available that you can use with this scope: @BirthdayReminderBot, @cumple_bot, etc. Or even fork GitHub projects like https://github.com/IronTony-Stark/Telegram-Happy-Birthday-Bot That’s up to you, now!
The big riddle for me too. On the one hand, they say that they support languages. On the other hand, it seems they ignore language silently. I tried direct requests like that
echo '{"chat_id":153812628, "text":"
python\ndef x():\n print\(\\"OK\\"\)\n", "parse_mode":"MarkdownV2"}' | curl -H "Content-Type: application/json" --data-binary @- 'https://api.telegram.org/bot111:AAA/sendMessage'
(use your chat_id
and bot token instead 111:AAA
) And it seems language
changes nothing.
Have a look at https://stackoverflow.com/questions/50521031/how-to-get-the-users-name-in-telegram-bot
In the message api, there’s a from attribute that includes the user’s details including first name
Hi! sorry for the late reply.
Yes I was also thinking of prompting the user to send the text after the command, but I did not know how to do it then. Now I know and have updated the bot to do just that :)
As for materials, its mostly done via reading the telegram API documentation and also this article
I code bots. Bots have an option to send without sound. Read this:
disable_notification Boolean Optional Sends the message silently. Users will receive a notification with no sound.
https://core.telegram.org/bots/api#sendmessage
I'm thinking, perhaps that's it. Bots that require replies are spammy by default and are rejected in many groups because of that. Maybe this developer's strategy to make this bot more palatable is to disable notifications on sent messages and to delete the spam it causes.
The Telegram API tokens looks like this "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11" (taken from telegram docs) what you have looks more like a serial number to me, you can register a new bot a see if it's follows the same pattern.
If you want to make your own bot, you can of course, but first you will need to know how the bot communicates with the app so you can send the information.
Hope this helps a little.
Saludos
Okay, never dealt with getting messages from channels via the bot api but I'm somewhat sure that they are returned in a different way than normal chat messages. In fact, a couple of years ago bots couldn't see channel posts at all. So that could be the reason it doesn't work like expected, maybe IFTTT just doesn't look at channel_post updates and unless you have access to the code there is no way around that basically.
API Docs can be found here: https://core.telegram.org/bots/api
Is there something similar to the Telegram bot API? If not, were do you think I could drop a suggestion or help to built it?
Telegram bots are nice and I would like something similar.
Thanks.
There's this method available in the Bot API for changing the group's permission and you can easily use it if you have a very beginner knowledge about making a Telegram bot
Feel free to message me if you don't know how to use it
As you found out, Twilio is pretty complex because of having to use actual phone numbers the complexity that comes with that. As MirBurrito said, Telegram is good.
Telegram is really really quick to setup and their code is super straightforward to get a bot up and running.
https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot.py
So all you need is to run this telegram "server" on your python app, and then you can just send it messages from your own telgram client on your phone, desktop, etc - just as if you were messaging a friend.
However, one caution is that the bots aren't private. Anyone can add any bot to telegram and message them. So you have to do some kind of authentication, but it's not too difficult. E.g. you can hardcode your userid/chatid so that the bot only talks to you, or you can hardcode a password or something etc.
More info: https://core.telegram.org/bots#6-botfather
Don’t know the Python library, may be helpful though to try send the gif to the RawDataBot ...
From the returning result below, it looks like your answer could be update.message.animation:
{ "update_id": 755023692, "message": { "message_id": 447371, "from": { /* OMISSIS / }, "chat": { "/ OMISSIS */ }, "date": 1596051684, "animation": { "file_name": "mp4.mp4", "mime_type": "video/mp4", "duration": 3, "width": 288, "height": 214, "file_id": "CgACAgQAAxkBAAEG04tfIdDkYGr9AAE_oJEB_spk5i_r_gAAm8CAAJqAaRScHZxxZGSs3kaBA", "file_unique_id": "AgADbwIAAmoBpFI", "file_size": 60508 }, "document": { "file_name": "mp4.mp4", "mime_type": "video/mp4", "file_id": "CgACAgQAAxkBAAEG04tfIdDkYGr9AAE_oJEB_spk5i_r_gAAm8CAAJqAaRScHZxxZGSs3kaBA", "file_unique_id": "AgADbwIAAmoBpFI", "file_size": 60508 }, "via_bot": { "id": 140267078, "is_bot": true, "first_name": "Tenor GIF Search", "username": "gif" } } }
Then, the Tg bot APIs have a getFile method to prepare a file (max 20MB) for download given the file ID. This method should return a link that it is valid at least for 1hr you can and you can use to fetch the file. Check your Python library documentation for the implementation, if there is one
Thanks for your reply (for others https://core.telegram.org/bots#deep-linking). But is this really possible to use inside a conversation and without leaving the messenger (app, desktop app) and open the browser?
First, you'd better use some community-made library or framework, so you won't have to deal with "raw" updates.
Second, you need to update "offset" argument when calling getUpdates, so that Telegram will not repeat all messages again.
Third, you can limit types of updates with "allowed_updates" argument in getUpdates.
Finally, again, just use some library or framework and don't worry about "raw" updates.
Telegram is like Whatsapp, it's a messaging app. But the great thing about it is that you can set a bot, with its own behaviour: https://core.telegram.org/bots
The important thing about having a Telegram Bot working on your board, is that you won't have to open ports on your internet rooter to control your board from outside your home.
And it does not required a mqtt broker, it's more an option. The project work mainly with a rest api, but if you have a broker you can set the mqtt client :)
I don't know if you can do that with just a group, but you could use the bot platform on telegram to do this.
It'll involve programming, but the basic outline is a bot to talk to users and ask for their email address. Verifies that it ends with .edu, and sends them an email with a code that they chat back to the bot, and then it automatically adds the user to the group itself.
To get started, look at this post https://core.telegram.org/bots about bots in telegram.
Hope this helps!
Since Bot API v4.5, you can use file_unique_id field. It is the same over time and even the same for different bots. However you cannot use it to download or reuse (e.g. forward).
https://core.telegram.org/bots/api-changelog#december-31-2019
> My understanding was that I needed to build my own chatbot to use Telegram,
You make it sound like you have to program things. You don't. Creating your own bot is SUPER simple.
How is the bot sending the document?
If it's using https://core.telegram.org/bots/api#senddocument does it send the URL to the Google Sheet as the document parameter?
If yes the Telegram server probably cached the document and won't download it again.
So the bot has to either download the document and upload it as described in the API or use an URL that's different from the previous one. Maybe you can append something to the URL(e.g. an incrementig number, or a uuid) so that each sendDocument call uses a different URL
Short answer: No, not with channels
Long answer: You can use channels for general news but for personalized stuff like this, you can write a bot that the user can interface with. With a bot, you can:
I found the error. I have missed the @ as a part of the channel username. I left off the @ from the channel name probably because of the temporarily switching between chat ID and Channel Username, and forget to put it back as it originally was when it was working.I didn't come to this fact thru the link you pointed out at Tautulli help in which it is even not mentioned.
Sending Messages to a Channel Create a new Public Channel in Telegram. Go to Manage Channel and add your bot to the Administrators. Add a "Link" to your channel. This is your channel username (e.g. t.me/<CHANNEL_USERNAME> ). Copy the Channel Username and fill in the Tautulli setting.
I would appreciate that the @ on either step 3 or step 4 would be nice to be mentioned as a part of Channel Username. I believe that it could help a lot of people to reduce the time searching for a solution for their errors and at the end discover that it was just a "@" the culprit of the whole story. Just a tip. Not even in Telegram in its App itself is clearly mentioning this.Luckily came along to this solution, but not so obvious at first, through the Telegram Help page: https://core.telegram.org/bots/api#forwardmessage
forwardMessage Use this method to forward messages of any kind. On success, the sent Message is returned. ParameterTypeRequiredDescriptionchat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format u/channelusername )from_chat_idInteger or StringYesUnique identifier for the chat where the original message was sent (or channel username in the format u/channelusername )
I hope I could contribute with this observation to reduce a little the try and error from many users of Tautulli and so the workload of the support staff, that may face sometimes. By the way Tautulli is an awesome tool. Thank you very much!
There's Telegram-promoted @imdb
bot (it's mentioned on https://core.telegram.org/bots/inline webpage).
Just open any chat and type @imdb {space} {movie name}
I'm not sure what the question is
OOP is adoptable for a vast majority of problems, Telegram bots being one. I don't know what wrapper are you using but most of the wrappers already have lots of classes defined, this is due to the fact that Telegram Bot API itself is a REST API based on objects
About defining your own classes for whatever you want it's pretty viable too, several of my own bots written in nodejs, including my trivia bot have several classes defined
Node is single-threaded by default and there are no concurrent errors, using classes won't change that. The only async operations you could have are network requests/file requests and timeouts but there is no relation between these operations and classes.
Please note than even in async scenarios some bugs like concurrent access to variables won't happen since js is single-threaded
It's a bot's inline keyboard. That is, there is some kind of bot in your group and this button is part of it. I can't tell you what it's doing, because I have no idea what kind of group it is or what kind of bot it is. But judging by the numbers, it's some kind of wallet address. Anyway, it's part of the bot interface in your group.
Here's an example of what it looks like: https://core.telegram.org/bots/2-0-intro#locations-and-numbers
>have no any chance for understanding official documebtation and examples
I honestly have never used Telegram, but I found the bots help page. Have you worked with this? The Botfather sounds like some assistance at least to get you started.
Since you have some experience, maybe you can make simple automatic bots and then read the generated routines to get an idea how it is done.
>How is that different from any other major platform?
You don't know what they're doing with the data. Not at all open source, is like saying Facebook is open source.
>They have the backend, they don't need bots. Just like every other major platform.
You could technically set up notifications for a particular group, and you could also set up the bot so that it allows you to select which Pokémon you want to be notifiedied about.
But you'd need to create this bot from scratch. See this for more information (look for the botfather section)
Why link external media when Telegram has it covered themselves?
https://core.telegram.org/bots#3-how-do-i-create-a-bot
Also for bot creation, try a google search for your preferred programming language (Lua, Python, C#, PHP, whatever floats your boat) and Telegram (User-) Bot.
Since you've mentioned you're technically savvy, is there something, anything, that could either text your or send you Telegram messages/similar? As annoying as it may be, something that sends a message once an hour during the daylight hours from the same number would:
Ideas on how to do it:
Telegrams protocol is open: https://core.telegram.org/mtproto
You can write your own Telegram client if you want, or use a library: https://github.com/OpenTl/OpenTl.ClientApi
Use different ones. Specify all sorts of privacy settings.
Or write your own bots: https://core.telegram.org/bots
I really like it!
by "can read messages", I meant disabling the privacy mode with Bot Father.
​
https://core.telegram.org/bots#privacy-mode
​
> 2. Bot admins and bots with privacy mode disabled will receive all messages except messages sent by other bots.
Unfortunately bot can't get messages from itself or other bots https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots
So you need to somehow store last message your bot sent.
If you can code, you'd just need to scan each incoming message (bot will need permission to read the full chat, use @botFather) for predefined "forbidden" words. If you detect one, instantly delete the message and take actions against the user.
https://core.telegram.org/bots/api
deleteMessage() , kickChatMember() are the things you are looking for (eventually also unbanChatMember() since for supergroups, kicking = banning). The rest is a completely basic bot.
Where do you get stuck exactly? As long as you have your token, chat ID and the data you want to send, all you need is the 'sendMessage' method. Then have schedule set a daily trigger for "get data from Instagram" and "send this data to my chat".
Thanks for the feedback! Sure, it's up to you to use telegram or not :) And yes, I'll probably build a web UI with push browser notifications, when I'll have a time for it.
About phone number leak and Telegram: telegram does not leak your phone number. No one can access it, not users, not bots. All that bot (and other users) can know about you listed here https://core.telegram.org/bots/api#user
This question would be much better answered in r/telegrambots, as it is very specific to more experienced programming skills.
Still, here is your answer: The solution to this problem is called long polling. This approach to polling greatly reduces the number of requests and is especially helpful for irregular and small data distributions.
The official Telegram bot API mentioned this approach.
Or if you like to read the Wikipedia article.
If you are planning to use your own bot API library for production purposes, I recommend that you use an established library. Since creating your own library requires a lot of programming experience to avoid running into dangerous security or technical problems.
But if you're just testing or gaining experience, then of course keep working on your library.
Good luck with your work.
Most major libraries have some kind of general, higher-level guide that walks you through the basics of how to use the library. It's meant to be used in tandem with the lower-level library API documentation (which is my go to when I need to know how a specific method or class works, but is often useless for grasping the big picture ideas). The above link starts with recent changes to the library, but then moves into all the actions most developers are going to want to take with their library like: authorizing the bot, making requests, getting updates, and major bot methods. The more familiar you get with the library, the more this guide will be less valuable to you (since you'll have a better grasp on the overall idea of how the system works), and the more you'll likely find yourself delving into the low-level docs.
For Telegram, bots are just HTTP web services, so any language can be used. Here's the API.
For Discord, the API is a bit more complex so there are many libraries available in lots of languages.
The Update object has the channel_post
field.
Assuming that you have stored the object in a variable called update, using the dot notation to access object properties, you can find it at.
update.channel_post.chat.id
SMS - use twilio? Whats your experience with it like? I feel Telegram is the way to go here since its free and has tons of libraries and apps already. Also not limited by geographic location. I really like their guides: https://core.telegram.org/bots/samples
Btw, Sparkpost offers 15k free emails a month if you'd like to consider an alternative to Mailgun. Also API/SMTP driven. Disclaimer: I work for Sparkpost. Search for "free developer account" @ https://www.sparkpost.com/pricing/
Honestly, I don't know. I have multiple servers that I use to host my stuff, because I love hosting them by myself. That is where I feel the fun. So I don't think I am the right person to be asked about that :)
I have a few Telegram bots. 2 of them are using telegram-bot and Telethon that served various purpose for my personal usage. They are plugin-based bot, so I can literally do anything with them. My other bots are using Telegram Bot API. Bot for seedbox, bot for muxing subtitle, bot that upload file to a cloud storage. I had some other bots, but accidentally deleted bunch of files from my server including the bot source. I have learned to use git since then XD.
After looking into it further, it appears that the Telegram API uses TCP to send requests. This API seems to be fairly complex and it appears that it's not possible to use it via Workflow (at least not without some intermediary server to translate web requests into TCP requests).
Depending on what you are trying to achieve, you might be able to put something together with the much simpler Bot API, however, this API is more limited in that:
> Bots can't initiate conversations with users. A user must either add them to a group or send them a message first. People can use telegram.me/<bot_username> links or username search to find your bot.
If you explain more what you're trying to achieve, then we might be able to help you out. Otherwise here's a quick example to get you started:
Just need to create a Bot and get an API Token by talking to the BotFather bot.
Since AppSignal supports webhooks I could suggest you a free method but it's a compromise (I personally find it better since I use it as Messenger anyways).
We use a Telegram bot for orders and things that require fast customer interaction. It also gives an easy way to "mute" the bot if you don't want to get spammed if you are off duty.
It works really well for us since we already use Telegram as our main messenger (and file sharing tool in some regards). And you can use it on your PC or any device really.
Requires a bit of coding but it should be fairly easy. I wrote a little framework with Ruby but it's not very polished so I never made it public.
Great! Thanks for trying it out, just recreated that issue locally, I know what's up with it, will fix it in the next path, cheers for posting that up!
To add a bot to a group in telegram, go to add members and then you have to type @ and the bot name. So for HodlBot, type @HodlBot and it should come up as an option to select.
If your interested in developing telegram bots, check out https://core.telegram.org/bots and the community has a lot of wrappers for multiple languages here https://core.telegram.org/bots/samples
I think I remember reading somewhere that bots would receive messages where they are mentioned too... But that's not what is detailed on the bot FAQ
Perhaps we just misunderstood what Telegram meant when it talked about sending a command to a bot explicitly (e.g /command@botname). The fact is, bots with privacy mode on indeed don't receive group messages that simply mention it by username, and I believe that's the intended behavior.
PS: about the last bullet point of the FAQ "Replies to any messages implicitly or explicitly meant for this bot.", it got me confused for a while, but it means: if A replies to your bot, it will receive A's message. If B replies to A, your bot will also receive it. If C replies to B also, and so on, as long as it's in a chain of replies that traces back to one of your bot's messages.
When someone interacts with your bot, you can call a getChatMember using the chat ID of your group and that person's user ID. If the returned status is not “creator”, “administrator” or “member”, say that person is not allowed to use the bot. Otherwise, show the normal message.
They woudn't send a message, but they would definitely do something. When a result is selected, the bot receives a <em>ChosenInlineResult</em>, which I can use to trigger anything in my code.
So at least for me, it would be very handy to have buttons you can use anywhere, without the need to go back to the private chat with the bot. Currently I have them sending something harmless like a smiling emoji. But I would like not to worry about people in groups asking what those out-of-context smileys are about =)
I can't help you with your last request, but about the topic's title: According to the bot API docs, it seems the pending_update_count is simply the number of messages you haven't yet acknowledged arrival. Also according to the docs, if there's something in the url field, then it seems your webhook was successfully set to that address.
Have you read this?
https://core.telegram.org/bots/games
Note: Telegram does not provide HTML5 game development tools, you need to make the game yourself (and you have all the freedom to do so). Telegram only provides the API you need to integrate the game into Telegram.