discord bot adding reaction to message via python - python

I wanna make a bot react with the normal emojis to a message when a certain word is used in the message but I can't seem to find any solution that work for current version of discord.py. Can anyone help me with a format I can use?

You should read the documentation of discordpy. It shows there how to add a reaction to a message and has plenty of explanations (I attached the specific link to your problem).

Related

Cannot send a message with telethon in python

I've tried to send a message in telegram channel branch. It's like channel with a link 't.me/channel_name', but it has multiple parts with links t.me/channel_name/1, t.me/channel_name/2 etc.
I've found out that thes 'categories' have one id, while debugging, and if I get entity with a link it says that there is no such entity.
I wonder if anyone had such a problem or has a method to solve it? HELP ME, PLEASE!
P.S. I've tried it with telebot as well, but there is no result.

I can't create a Spam Group Telegram Bot

I'm trying to create a bot that, given the message I give it through a special command, is able to send the message I previously gave it to the public Telegram groups every certain time given by me.
I'm looking for every solution but I can't achieve it at all, I know it can be done 100%, I've searched everywhere but I can't. Can you help me please?

How to remove a specific link preview (auto-embed) in a specific message with Discord.py bot?

I have a problem with my python bot discord.py.
I need to remove the Twitter previews in some posts and I can't find a way to remove the link preview like in the discord client.
Right now I'm deleting the entire post and posting a new one writing who the original poster is followed by the link without its preview but it's messy.
Thanks.

Remove phone Discord.py

I am currently testing with different selfbots on Discord.py. I wanted to know if there was a way to remove the phone number off my account. I tried bot.remove_phone but that didnt work. I am completely new to python.
Self botting is against the Terms and Service of Discord.
Moreover, Discord doesn't give out features to further hurt their platform by their API. If Discord happens to detect this your account would be banned. Either way, remove_phone attribute is not included in the Official Discord documentation.
But for clarity, anything considered "user account automation" is disallowed, including custom clients and similar.
Here's Discord's reference:
https://support.discord.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-
I cant make an comment so I have to make an answer, but you could make an requests.delete() to discord, you need the token and its password.
You can find more info about how the request should look like by being logged in discord via chrome, then open dev tools with ctrl + i -> go to network and select XHR then you can try and delete phone number with a wrong password to get an idea how the request should look like
also probably should not use your main since you might do couple mistakes and lose your account

Having trouble with a purge command in Discord-Rewrite

As you can see by the title I'm having trouble with Discord-Rewrite.
I have been looking on the api page for the past few days, in multiple discord API servers looking for help and even here on Stack Overflow and only seen code for the Async Branch.
I've tried looking around on youtube for tutorials as well but there weren't that many for python and was mainly dedicated on JavaScript so I tried JavaScript and I have a working purge command but I want to stick to using python as I'm more comfortable with that compared to JavaScript.
I'd really appreciate it if someone was willing to help out whether its posting working code, giving me a guideline, or even the right place to look. Any type of help will be appreciated as I've been stuck for a few days trying to get something working and the closest thing I got was having it delete the bots own message which just stated how many messages it deleted, in this case just 1 (Its own message).
Thanks for taking the time to read this!
You can use TextChannel.purge to delete messages from a certain channel. Your bot will need the manage_messages permission.
#bot.command()
async def purge(ctx, amount: int):
deleted = await ctx.channel.purge(limit=amount)
await ctx.send(f"Deleted {len(deleted)} messages")

Categories