Online status for Jabber bot - python

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

Related

Telegram start new chat with Python

I want to start a new chat in Telegram with a Python script but I know with neither Telegram's BOT nor its API it is possibile.
I don't want the user starts the chat with a BOT before!
However I was wandering if you can achieve this in anther way. I mean, when you create a new chat with Telegram application, there will be, somehow, and endpoint which handle this request.
Why is it impossibile to create a Python script which emulates this action?
I don't want the user starts the chat with a BOT before!
This is not possible. A Bot can never start a chat, that has to be done by the user him/her self.
After the user has started a conversation with the Bot, you can send anything to the user until the user stops the conversation.

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

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.

How to don't send the bot's username in python telegram bot switch_inline_query

I am making the inviting friend into the bot.
InlineKeyboardButton('👬 Invite Friend', switch_inline_query = 'https://t.me/xxxx?start=friend-' + str(user['id']))
After the click, the button and I choose the chat on my contacts.
But on a friend's chat, the bot's username is inserted. I want to send only the link.
I want to remove this.
or I want to make like this.
There is no way to remove the username of the bot from the message itself.
Altough many bots use a workaround where you are prompted with a username and a special identifier which allows the bot to prompt the InlineQuery mode and show up a button which can send any text you want
(I've found this simple bot that does this too, you can try it here)
Here's also an example found on the official python_telegram_bot repo

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.

Scrape Telegram channel for changes

Can anyone point me to a way to programatically check for changes in a Telegram room? I can't decipher the API. I want to do something like:
telegram.onMessageReceived('room_id', (msg) => {
console.log(msg.content);
}
I usually use Python, but open to using NodeJS because I want to have it always running, monitoring for changes on an Ubuntu server.
As far as I can find on the internet, everything is pointing to the bot API, but as I understand it, it would only be notified of updates to messages to the bot. I want to monitor public rooms in which I cannot add the bot as an administrator since I did not create the room. Or is there some way to add a bot to public rooms? I don't think so.
Also the room I want to monitor doesn't allow anyone to chat. It's just to notify subscribers.
I've read these SOs so far and am still confused:
Can a Telegram bot read messages of channel
How do I join my bot to the Channel?
How to join my Telegram Bot to PUBLIC channel
in node.js telegram library you can check the last message.date and compare with last date you have stored. if changed there is new message

Categories

Resources