discord.py

Getting None in message.guild.get_member_named(“member_name”)

女生的网名这么多〃 提交于 2021-02-15 07:45:47
问题 I'm getting NoneType in message.guild.get_member_named("Testing Account") and there is a person/account named Testing Account in the discord server. 回答1: First, make sure your bot has members intent enabled in the developer portal Enable intents in the code, and pass them in your bot/client with the intents kwarg. intents = discord.Intents.default() intents.members = True client = commands.Bot(command_prefix='!', intents=intents) I will update the question if the way you setup your bot is

Enable intents for discord.py bot

馋奶兔 提交于 2021-02-13 17:37:07
问题 Im making a discord bot, and every time it joins a new server, the bot sends me the server info and an invite. However, when I've tested this, it always shows one member which is itself. I have both presence and members intents enabled in the discord developer portal , but it still isn't working. I then changed some code to Guild.fetch_members() to which I received the error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Intents.members must be

Enable intents for discord.py bot

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-13 17:35:39
问题 Im making a discord bot, and every time it joins a new server, the bot sends me the server info and an invite. However, when I've tested this, it always shows one member which is itself. I have both presence and members intents enabled in the discord developer portal , but it still isn't working. I then changed some code to Guild.fetch_members() to which I received the error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Intents.members must be

Obtaining username from user id | discord.py

本小妞迷上赌 提交于 2021-02-13 17:07:56
问题 Well I have been working with databases for a while with discord in order to obtain major lists of user id's in a queue, although I am having problem's obtaining the user from user id as it returns none For Example members = list(privateduos[matchid]) user = discord.User(id=int(members[0])) await client.say("Say `test` " + str(user)) await client.wait_for_message(content="test", author=user) This is the Output The client.wait_for_message doesnt seem to detect the message author in the code as

Obtaining username from user id | discord.py

和自甴很熟 提交于 2021-02-13 17:05:43
问题 Well I have been working with databases for a while with discord in order to obtain major lists of user id's in a queue, although I am having problem's obtaining the user from user id as it returns none For Example members = list(privateduos[matchid]) user = discord.User(id=int(members[0])) await client.say("Say `test` " + str(user)) await client.wait_for_message(content="test", author=user) This is the Output The client.wait_for_message doesnt seem to detect the message author in the code as

Obtaining username from user id | discord.py

北战南征 提交于 2021-02-13 17:03:42
问题 Well I have been working with databases for a while with discord in order to obtain major lists of user id's in a queue, although I am having problem's obtaining the user from user id as it returns none For Example members = list(privateduos[matchid]) user = discord.User(id=int(members[0])) await client.say("Say `test` " + str(user)) await client.wait_for_message(content="test", author=user) This is the Output The client.wait_for_message doesnt seem to detect the message author in the code as

Discord Bot doesn't join voice channel

倾然丶 夕夏残阳落幕 提交于 2021-02-11 16:28:19
问题 im struggling to making my bot get into a voice channel, i have already read alot of posts that are here and none of them has been able to solve my problem, im trying to get my bot to reproduce the voice of a yt video but it doesn't even join and i dont know what to do, here is the code: import os import discord import youtube_dl from random import random, choice, randint from dotenv import load_dotenv from discord.ext import commands load_dotenv() token = os.getenv("DISCORD_TOKEN") GUILD =

Discord Bot doesn't join voice channel

不问归期 提交于 2021-02-11 16:27:45
问题 im struggling to making my bot get into a voice channel, i have already read alot of posts that are here and none of them has been able to solve my problem, im trying to get my bot to reproduce the voice of a yt video but it doesn't even join and i dont know what to do, here is the code: import os import discord import youtube_dl from random import random, choice, randint from dotenv import load_dotenv from discord.ext import commands load_dotenv() token = os.getenv("DISCORD_TOKEN") GUILD =

How can I automatically split a list up based on a given requirement?

若如初见. 提交于 2021-02-11 15:21:02
问题 On Discord, you can only have messages of character length 2000 or under. I am trying to append the server name, member amount and server ID for each server that the bot is in to a list, and then sending the list to a channel. However, as the list length exceeds 2000 I have tried to split it up, however the method requires it to be updated every time manually as the list gets larger. How can I make the script automatically split up the list based on how many 'splits' are required and then

Discord.py Python File not running, multiple errors

狂风中的少年 提交于 2021-02-11 15:08:54
问题 I'm pretty new to coding Discord bots on my Mac instead of a Windows, and ran into trouble trying to run my Python file. I run my Python files with Visual Studio Code and the Python extension by Microsoft. I click the green play icon in the top right corner, and VSC runs it in the terminal for me. This usually works on a Windows, but for some reason, I get a ton of errors when I try to run mine. These are the errors: mika@Mikas-Air python-test % /Library/Frameworks/Python.framework/Versions/3