telegram bot auto leaving from channel - bots

hi all i'm new to telegram apis and bot, i'm having some troubles with my bot: i setted it, got my token and it can become the admin of the channels i do need to admin with it. just the bot every now and then just leave the channel by itself when another administrator of the same channel in whitch it is in posts a message or invite a new user to the channel. does it make any sense to you? is there a solution to keep it in charge of the channel?
other infos: i program in php, the bot is needed to post messages in telegram via a web site programmed in php
i would apreciate a real answear and not just a paste of the link to telegram bot documentation
thanks a lot

Related

Can telegram bot access recent action from telegram supergroup?

So i would like to make a bot that can access recent action from my supergroup. The flow is pretty simple, i want the bot to scrape all of the information inside of it and save it into database. I made it with python and telegram bot API
The bot is already admin and he can do anything that admin could do.
Is it possible to do that???
No. Bots can only do what's listed in the official API docs at https://core.telegram.org/bots/api. Instead, you can just keep track of what's happening in the chat.

Is it possible to have one Discord bot DM another bot?

I'm building out an automated test bot that is meant to test the commands of my main bot. Everything is working fine except that my test bot doesn't seem to be able to receive DMs from the main bot.
I'm currently using discord.js
message.author.send('test dm from one bot to another')
and getting the error:
DiscordAPIError: Cannot send messages to this user
Is there a setting for the bot, or a possible workaround so that I can test my bot's DM functionality?
Both bots can receive DMs from users just fine.
Currently, I don't think it is possible for a bot to send a DM to another bot.

sending direct messages from nodejs script to telegram

Is it possible to send a message from a node.js server to someone's mobile number or telegram Id directly?
is it possible without using a telegram bot?
I need an API like below:
function sendMessage(senderTelegramId, receiverTelegramId, messageText)
In short: No, without a bot no way for now.
Detailed explanation:
In order for you to send users messages on telegram you would need to create your own telegram bot. They have a well documented API which you can read and play around with.
There are 2 things you should know about sending messages to users using telegram bot:
You can't just send random people messages on telegram even if you know their phone number, to send them messages you need to have their chat_id. See how in the docs
To get the chat_id the user must first click the start button that comes up when they open your bot for the first time. Telegram will send you the chat id of that user and you save it for later when you would want to send messages to that user.
There are tons of libraries that makes working telegram bots very easy, it wouldn't take you more than an hour to get started.
I hope this answers the question, feel free to ask further questions, I have made some bots and you can also play around with them to see how it works.
Cheers )
There is actually one more easiest way to send a message to chat
just fetch the URL
https://api.telegram.org/bot[BOT_API_KEY]/sendMessage?chat_id=[MY_CHANNEL_NAME]&text=[MY_MESSAGE_TEXT]
you can find more details here
https://xabaras.medium.com/sending-a-message-to-a-telegram-channel-the-easy-way-eb0a0b32968

How to read a message from a bot via telegram API?

I have a room with a couple of bots, one of them needs to read all the messages on the room including other bot's messages.
Telegram API says bots can't see other bots message otherwise they might get caught in a "loop".
Since i really need to work around this i'm wondering if there is a known workaround?
There cannot be any workaround using the Bot APIs since the messages in getUpdates or webhook of the Bot will be from Users alone.
One workaround could be to use the telegram-cli and create a normal user as a Bot.

How to detect bot message/user message?

My FB-NodeJS-API prototype is not working correctly because my webhook is receiving the bot respond which is then sent to API.AI.
I need to set a condition where only a user's message should be received on the webhook request or only user's message should be sent to API.AI.
Can anyone advise me on this?
Can you explain the problem better? Please add the relevant code.
The bot response should go the user, not the webhook. The user input will come to the webhook.
I would suggest getting the bot to work without API.AI first and then adding support. My bot is in node.js so you may just want to jump to the source code.
For more information on setting up a bot see my article Facebook Bots for Fun and Profit
The example bot is DMS Software Bot
The source code is Github fb-robot

Resources