This code works for sending a DM to a user who joined a guild, but it only executes the first if statement instead of actually checking to see what guild the member joined. I’ll get the first DM from the bot whether I join guild1 or guild2. @client.event async def on_member_join(member): guild1 = client.get_guild(762921541204705321) guild2 ..
My discord bot doesn’t retrieve members whenever I use guild.members or on_member_join . If I try and print members it only shows the bot account. I have ticked server members intent and presence intent so it shouldn’t be that. please help. Source: Python-3x..
I’ve looked and all the posts I could find reference an older version of discord.py when it comes to sending member leave messages. The code below doesn’t give an error, yet also doesn’t send a message when a member leaves a server. Am I missing something? I’ve looked at the documentation and this makes sense… ..
I’m trying to make a help command that sends the current server-prefixes for the bot in an embed. I’m having some trouble trying to figure out how to code this, and I would love some help. I have tried doing: @bot.command() async def help(ctx): embed = discord.Embed( title=’Help’, description=”, colour=discord.Colour.blue()) embed.set_footer(text=’Have fun!’) prefix = command_prefix ..
I have a discord bot written in discord.py and using a mysql database to store all Stuff I need. currently i just connect to my db, then doing whatever I wanna do, and closing again. can this be problematic? thank you 🙂 Source: Python..
i’m doing a Discord bot with python 3.8 and i have a problem with my function on_member_join() @bot.event async def on_member_join(member): embed = discord.Embed( title=f"that doesn’t function") channel = discord.utils.get(member.guild.channels, name=’WELCOME_CHANNEL_NAME’) await member.send(‘Hello’) await channel.send(embed=embed) my member.send function (send a private message with hello) but channel.send send this error await channel.send(embed=embed) AttributeError: ‘NoneType’ object has ..
I’m trying to get my bot to post random images, but it keeps saying it can’t find the file despite having gone into the directory earlier to append the name to a list. I’ve already tried a help discord, and tried running the script from command prompt instead of VSC’s terminal. Any ideas? The images ..
I have recently updated my python version from 3.7 to 3.8.6 (as DiscordPy does not support 3.9). because of this, I had to ‘repip’ discord. Earlier, My Bot would have been able to detect all the users (members) in the channel. For example: async def members(message): x = message.guild.members for member in x: await message.channel.send(member.name) ..
I am working on a discord music bot and I need help queuing songs. It streams audio from YouTube directly into the VC it is connected to. What I need here is to wait for the current song to stop and then execute the user command for the second song and so on. @commands.command() if ..
So, I’m new to discord.py and I was recently making my new bot. I made a coin flip command but for some reason it is not working. It isn’t showing any output at all. It is also not showing any kind of error in console. Here’s my code: import discord from discord.ext import commands import ..