discord.py

Error loading discord bot on startup. hosted through repl.it

僤鯓⒐⒋嵵緔 提交于 2020-08-09 19:35:33
问题 A couple days ago my discord bot suddenly went offline, i host my bot through repl.it and i cant get it to work as it gives a dirty error. Traceback (most recent call last): File "main.py", line 584, in <module> bot.run("NTg0NjkyODA1NTcwNjU4MzEz.XPOnmw.VpE_ILHaDdQ6k--OIBRovc1h80o") File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 640, in run return future.result() File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 621, in

Error loading discord bot on startup. hosted through repl.it

不问归期 提交于 2020-08-09 19:31:06
问题 A couple days ago my discord bot suddenly went offline, i host my bot through repl.it and i cant get it to work as it gives a dirty error. Traceback (most recent call last): File "main.py", line 584, in <module> bot.run("NTg0NjkyODA1NTcwNjU4MzEz.XPOnmw.VpE_ILHaDdQ6k--OIBRovc1h80o") File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 640, in run return future.result() File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 621, in

channel set permissions and move_to channel

和自甴很熟 提交于 2020-08-09 09:25:13
问题 So I am using discord.py to make a discord Client. I am using on_voice_state_update to see if the VoiceState of a member changes. If a member is inside a specific VoiceChannel, I want the client to create a new voice channel, using the member's username as the name of the channel, and move the member inside that new voice channel. Here is my code: import discord, asyncio app = discord.Client() @app.event async def on_voice_state_update(user_name, user_id, after): name2 = str(user_name) ch =

channel set permissions and move_to channel

让人想犯罪 __ 提交于 2020-08-09 09:25:08
问题 So I am using discord.py to make a discord Client. I am using on_voice_state_update to see if the VoiceState of a member changes. If a member is inside a specific VoiceChannel, I want the client to create a new voice channel, using the member's username as the name of the channel, and move the member inside that new voice channel. Here is my code: import discord, asyncio app = discord.Client() @app.event async def on_voice_state_update(user_name, user_id, after): name2 = str(user_name) ch =

Discord.py - bot sending information about message instead of message

血红的双手。 提交于 2020-08-09 08:11:11
问题 I am trying to make a system where when you react to an emoji, it will send that message (depending on what emoji you reacted with) - to another text-channel, now it is returning this instead of the actual message: <Message id=733788372891467838 channel=<TextChannel id=733721953134837861 name='admin-bug' position=1 nsfw=False news=False category_id=733717942604398684> type=<MessageType.default: 0> author=<Member id=733720584831369236 name='ReefCraft' discriminator='3102' bot=True nick=None

With Discord.py, is there a way to read embedded messages?

瘦欲@ 提交于 2020-08-09 07:22:07
问题 My code print out the message the user sends. However, when an embedded message gets sent, there is nothing on the terminal and nothing is read. Is there a way for my bot to read embedded messages along with normal messages on discord Python 3.8 client = discord.Client() @client.event async def on_message(message): print(message.content) client.run(token) 回答1: You can get list of embeds from message with message.embeds . Link for docs. Try this solution: @client.event async def on_message

Discord.py - Make a bot react to its own message(s)

感情迁移 提交于 2020-07-28 04:44:26
问题 I am trying to make my discord bot react to its own message, pretty much. The system works like this: A person uses the command !!bug - And gets a message in DM', she/she is supposed to answer those questions. And then whatever he/she answered, it will be transferred an embedded message to an admin text-channel. But I need to add 3 emojis, or react with three different emojis. And depending on what the admin chooses, it will transfer the message once more. So if an admin reacts to an emoji

Change the permissions of a discord text channel with discord.py

最后都变了- 提交于 2020-07-28 04:05:08
问题 I would have liked to make a command that allows to modify the permissions of a particular text channel discord with discord.py. For example, disable sending messages in a specific channel. I looked at the documentation of discord.py and I saw that there is a PermissionOverwrite class (https://discordpy.readthedocs.io/en/latest/api.html?highlight=app#permissionoverwrite) allowing to do some things at the level of the permissions (notably with the function update) @client.command() async def

Change the permissions of a discord text channel with discord.py

你说的曾经没有我的故事 提交于 2020-07-28 04:02:27
问题 I would have liked to make a command that allows to modify the permissions of a particular text channel discord with discord.py. For example, disable sending messages in a specific channel. I looked at the documentation of discord.py and I saw that there is a PermissionOverwrite class (https://discordpy.readthedocs.io/en/latest/api.html?highlight=app#permissionoverwrite) allowing to do some things at the level of the permissions (notably with the function update) @client.command() async def

discord.py delete author message after executing command

六月ゝ 毕业季﹏ 提交于 2020-07-22 21:36:56
问题 I need the bot to delete the message from the command author, and leave the bot message. Any help will be appreciated! thank you. I have already tried looking for a answer on google but nothing has worked 回答1: You can obtain the message that called the command by passing the context with the command using the pass_context option. You can use the Client.delete_message coroutine to delete messages. from discord.ext import commands bot = commands.Bot(command_prefix='!') @bot.command(pass_context