Telegram Bot - Persist Pickle Context across all Users in a Group Chat - python

I set out to create a Telegram bot that tracks 'upvote' like functionality in a Group Chat. To try to do this, I adapted the persistentconversationbot.py code from the python-telegram-bot package. I got the bot running and managed to deploy it on to Heroku.
Once I invited the bot into a private group chat, I noticed that this approach is only remembering conversations with specific users. I'd like to have the bot remember conversations it has had with all users in a group chat. Would any of you happen to know how I can do this?
Thank you!

Please see this explanation on the per_* parameters of ConversationHandler. Note that this is independent of whether your bot uses persistence or not.

Related

How can i get someone telegram chat id with python?

Hi everyone i want to create a new telegram bot similar to #usinifobot.
this is how it works:
you just send someone username to this bot and it will give you back his/her chat id.
i want to do same thing but i dont khow how to do it with python-telegram-bot.
python-telegram-bot can't help with this, because telegram bot api can't provide ids of unrelated entities to the bot - only ones with which bot iteracts
you need telegram client api for this and to hold a real account (not a bot) online to make checks by another library
and with bot library like python-telegram-bot you could only get ids of users who write to bot, channels and groups bot is in and reposted messages from other users
I created similar bot #username_to_id_bot for getting ids of any entity and faced all these moments

Is it possible to read discord messages from a group where you aren't an admin? (python)

Is it possible to read discord messages from a group where you aren't an admin in python?
I've seen that discord.py is the most used library for discord related stuff but I only can find how to create a bot. I just want to read messages from a specific text channel of a group.
Is this possible?
Or do I need to use a web scraper?
Bot accounts cannot be added to group DMs. The (still unfulfilled) feature request can be found here.
Self-botting, meaning running code from your own Discord account is against the Discord TOS and might get you banned. Don't do it.
As those are the only two options there is currently no way to read Group DMs programmatically.

How to login as user rather bot in discord server and run commands?

Slack API provides you two options: use app as a bot and as a logged in user itself. I want to create App that will be working as a user and run channel commands. How can I do with discord.py?
Discord.py is no longer maintained to work on user accounts, so given the recent updates in the user api, it is no longer the ideal framework which selfbots should be written in.
There are a number of selfbot api libs out there, but the best one that's written in python is this: https://github.com/Merubokkusu/Discord-S.C.U.M
P.S. selfbotting against tos - so be careful (respect rate limits and don't act like a bot)
As Wright has commented, this is against discord's ToS. If you get caught using a selfbot, your account will be banned. However, if you still REALLY want to do this, what you need to do is add/replace bot.run('email', 'password') to the bottom of your bot, or client.run('email', 'password') to the bottom depending on how your bot is programmed.

Is it possible to create a telegram bot which forwards messages from another bot to telegram group or channel?

I want to create a telegram bot which would immediately forward message from another bot, that regularly posts some info. I've tried to find some ready templates, but alas... I would be grateful for any useful info. Thanks!
I don't think this is possible. As far as I know, bots can't communicate with other bots.
But you can add bots to groups

How to join my Telegram Bot to PUBLIC channel

My question is:
how to join my telegram bot to a telegram public channel that I am not an administrator of it, and without asking the channel's admin to add my bot to the channel?
Maybe, the chatId of channel or thru link of channel?
I have heard that some people claim to do this join their bot to channels, and scrape data.
So if Telegram does not allow it, how can they do it? can you think of any work around?
Thank you in advance :)
Answer to your edited question.
It was possible to add a bot to a group/channel with just an invite link. This was achieved by allowing a bot to access the mtproto methods like messages.importChatInvite for private links and channels.joinChannel. However telegram patched this. However, you can still do this with normal user accounts! Since you are using python you can give this a shot. I can confirm the methods still work on Madeline Proto.
Till today, only the Channel Creator can add a bot (as Administrator or Member) to the Channel, whether public or private. Even the other Channel Administrators cannot add a normal member leave alone adding a bot, rather they can only post into the channel.
As far as joining the bot via the invite link, there is yet no such method in Bot API to do so. All such claims of adding the bot to a channel by non Creator are false.
Another way of "scraping the data" from several channels would be to listen to these channels with a Junction Bot aka Channels, Multi Feed Edge Bot, or alike. You just need to go to the channel info and share the link of the desired channel with the Junction Bot to automate the process of receiving new messages from the(se) channel(s). There are also other quite advanced ways described in their FAQ.
Multi Feed Edge Bot also seems to work O'kay, however, you need to follow these steps to add the redirection:
/add #TelespaceNews https://t.me/joinchat/AAAAAFIaTHjZp8ltykgwEQ
You can only add bots to channels you are an admin in them and bots can only be added as admins. for this go to Manager Channel, click on Administrators / Add Administrator then search for the bot you want to add to your channel.

Categories

Resources