Python telegram bot: how to distinguish a user with hidden profile? - python

I have a feedback bot that forwards messages from users to a group chat of admins. Admins reply to a message and the bot sends their response back to the person it received the message from.
Telegram has a privacy setting to disable linking a forwarded message to users' account:
example
In this case, the bot is unable to send back the response. I would like to detect that a person has a hidden account and warn them that they won't get a response. I can't seem to figure out what method/property could give me that information.

I recommend to keep track of which user message originated which message in the admin chat rather than relying on the message.forward_from attribute. Since you tagged the python-telegram-bot library, let my point you to this thread on GitHub which has the same topic.

Related

discord.py: Hide messages from all other users, but the #mention user

I'm developing a matchmaking bot for discord. I read through the documentation and looked through stack exchange, I can't find relevant information on this. I'm trying to eliminate clutter and make it easier for a users to accept and decline a matchmaking request. The bot would listen for a "!match #user" and handle the event. I only want the #user to see and accept it and the user that sent the message to see it (obviously). Right now, I believe it's not possible unless it assigns a secret role and deletes these roles after they are finished; this wouldn't be ideal though. Any information or forward to a post, that would help tremendously. Thanks in advance.
You can not currently hide messages for any specific user/role.
You can try 2 approaches:
Send Message in User DMs
Make a channel and set it permissions for a specific role and assign that role to the user

Check if number has opted out in twilio

I am building a web application that needs to be able to send SMS messages and check if a number has opted out of SMS. The only option that I have found is to use a web-hook for SMS replies and check there.
I am looking for an option where I can just ping the API and check if a number has been opted-out.
Opt-outs are handled on your side, so you will need to keep track when opt-out keywords are sent toward your application and if so, update your CRM to remove the consumers mobile number from receiving future SMS.
If you attempt to send an SMS to an opted-out consumer, you will receive an error message from Twilio.
ERROR - 21610 - Attempt to send to unsubscribed recipient
Twilio support for opt-out keywords (SMS STOP filtering)
"These messages will also be delivered to your Twilio account, and the defined web hook, so you can update your application logic."

Is it possible to get all channels a slack bot is allowed to write?

I am trying to build a slack bot based on heroku and python which writes messages every 10 minutes to all channels the bot is allowed to write messages. It would be perfect if I could just read from the slack api to which channelId's the bot is connected and let the bot post the message to all channels at the same time.
Till now I couldnt find such function in the slack api. On the other hand I have to addmit that I am pretty new to slack. Is there a similiar function out there or can you think of a work around? If possible I would like to avoid storing data additionally somewhere.
Yes there is. Call users.conversations with your bot token to get the list of channels it is a member of.
From the documentation:
This method helps answer questions like:
Which conversations am I a member of?
Which public channels is my bot user in?
Do I have any direct messages open with my friend Suzy?
Is my bot a member of any private channels?

Django: Facebook Bot, send automatic messages

Hello my question is how I can send automatic messages to my users by Facebook with a bot, I do my bot with this tutotial: https://abhaykashyap.com/blog/post/tutorial-how-build-facebook-messenger-bot-using-django-ngrok
My aplication is an intelligent security house system so I want to send a message when, for example, the levels of temperature are so high or something like that, the only thing that I want to know is this part of send the message to the correct FB user.

Online status for Jabber bot

I use xmpppy library for creating my bot. I run the bot and it works correctly, but when I enter to MirandaIM with other user account(not bot account) for testing it I see that its status is offline. Although I can send and receive messages. How can I send to all bot's 'friends' that it is online?
To manage presence with your bot you need to:
Make sure the roster is properly defined. For example, you bot contact and your user should be each other in their respective contact list.
Once it is done, send a presence packet when you login and you should see the presence properly broadcasted.
Reference document is: http://xmpp.org/rfcs/rfc3921.html#int

Categories

Resources