discord-py

The Discord bot does not start

CODE: import discord client = discord.Client() @client.event async def on_ready(): print('We have logged in as ') @clie ... ent loop is closed') RuntimeError: Event loop is closed I wanted to create a discord bot (according to their documentation)

How do I get or track who clicked on a reaction in a message? Discord bot

There is a discord bot. You need to create reactions under the messages that the bot sends, and get information about who clicked on which reaction.

Development of Discord bots on discord.py

I'm writing a function that changes the channel name when someone leaves or comes to the server. It outputs the number of ser ... ков: {}".format(len(member.guild.members)) ) What is the problem? Maybe this is because my computer is slowing down?

How do I make the bot in the discord click on the Link link(abbreviated)?

I need to write a bot for discord that will follow the link link, I have already searched the entire Internet, but there is n ... m should recognize and click on the link (I know how to open the link in the browser, I need to handle this message exactly)

How to output a message from discord in python to the command line (discord.py)

I wanted to make a bot for the Admin to communicate via the bot's command line. Is it possible to somehow make the messages f ... def test(ctx, arg): while True: print(arg) text = input("Введите текст:") await ctx.send(text) bot.run(TOKEN)

Discord.py, how to issue a role when using the command?

from SimpleQIWI import * from time import sleep import discord token = "Token" # https://qiwi.com/api phone = "numbe ... break time.sleep(1) api.stop() client = MyClient() client.run('Token')

How do I find out the category id? (discord.py)

How to find out the id of the category by its name, for example: the category is called "Main" and it is necessary that after ... f"{OSNid}", reason=None) await ctx.guild.create_text_channel(f"TEST8", overwrites=None,category=f"{OSNid}", reason=None)

Discord.py | How to find out the role ID of the person who wrote the command

In this code snippet, I need to find out if the ID of this role is in the list of author roles. Role ID- 767450270888099910 @ ... ctx.send('Предателям не давали право открывать рот! Скажи спасибо что ты можешь остаться на сервере...') return True

Hyperlink in the message

I tried the following code: await ctx.send("`uwu`\n\nUsage = `sun.uwu <[arg1]>`\n\nNOTE: " + ["Sunrise"]("https://disco ... d, the TypeError comes out. Please help, preferably by explaining how to add a hyperlink to a message. Solved: solution below

Changing the command prefix discord.py

How can I change the bot prefix via the command in discord.py? I tried to use this code, but it says that the setprefix comma ... , prefixes=""): custom_prefixes[ctx.guild.id] = prefixes.split() or default_prefixes await ctx.send("Prefixes set!")

Discord.py deleting all messages in a text channel

I've been trying to clear messages (everything) in my Discord bot for a long time using the command: /clear, but it doesn't w ... ): await client.delete_message(msg) What am I doing wrong? I just close the file (when opened). Please help me!

Commands for admins

I make a bot and I don't want some commands like clear to be used by ordinary mortals. How to make a role restriction on the ... x.channel.purge(limit=int(amount)) await ctx.channel.send(':: Сообщения успешно удалены') print('Готов') bot.run(token)

How to get a list of all discord server members (discord.py)

How can I write all the server participants to a list? I tried it like this: @bot.command() async def members(ctx): for ... for member in guild.members: await ctx.send(member) But it only gave out the nickname and tag of my bot

Get text from Embed in in discord

Writing a bot discord.py . I have an Embed and there is text in the description. I need to convert it to plain text. How to d ... u need to get the "text that needs to be intercepted". In general, it is better to use the entire text. Thank you in advance.

Discord BOT, auto-assignment of roles

I write my bot in discord on python. I ran into a problem: after watching the video, I decided to make an auto-release of the ... xcept Exception as e: print(repr(e)) # Connect token = open('token.txt', 'r').readline() client.run( token )

I run the bot for discord via cmd there is no error, but the bot does not run in discord

Here is the code: import discord import config class MyClient(discord.Client): async def on_ready(self): print( ... essage from {0.author}: {0.content}' .format(message)) client = MyClient() client.run(config.TOKEN)

How do I create a channel on a specific discord server?

Tell me how to create a text channel on a specific server using a command on another? That is, there is a server X where the command is entered !channelcreate (channel name) (server id Y) then a text channel is created on server Y.

How to check whether a user has a role for the discord bot?

How can I check if a discord user has a role? I want to make a special role so that the bot executes commands only for those ... mple, "Admin". And if there is no role, he wrote that they need such and such a role. I don't know much about Python, library

How do I disable the discord bot from the voice channel?

There is a problem when disconnecting the bot from the voice chat: import discord import asyncio from discord.ext import com ... InvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'disconnect' How do I fix this?

Bold yellow text in the discord code block

I wanted to ask a question about discord. Fixed a screen from my bos, where you can see that the bot writes in yellow bold te ... e code block. I can't find anywhere how to do this and whether it can be done using the library discord.py or just on python