#๐ Code is unreachable??
10 messages ยท Page 1 of 1 (latest)
@royal mural
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
why is it not reachable
@selfie.command()
async def remove(ctx: commands.Context, member: discord.Member = None):
if not member:
await ctx.send(" **Please mention a user to remove the role from**")
return
if not any(role.id == STAFF_ROLE_ID for role in ctx.author.roles):
await ctx.send(" **You do not have permission to use this command**")
return
selfie_role = ctx.guild.get_role(VERIFIED_ROLE_ID)
if selfie_role in member.roles:
await member.remove_roles(selfie_role)
await ctx.send(f" **Verified role removed from {member.mention}**")
else:
await ctx.send(f" {member.mention} **doesn't have the Selfie role**")```
btw your annotation is invalid, as None is not a discord.Member
try member: discord.Member | None
Does it mark it reachable if you do if member is None: ?
presumably a discord.Member is always truthy
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.