#๐ Python
16 messages ยท Page 1 of 1 (latest)
@verbal moon
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.
Role Status
hello, please try posting your question with the Discord invite masked
my code deletes all the time
Per Rule 6, your invite link has been removed. Our server rules can be found here: https://pythondiscord.com/pages/rules
The rules of our community.
it's because of the Discord invite link
I coughed them up
REMOVE_ROLE_ID = 1226953019573407755
@bot.command()
async def get_role(ctx):
activities = ctx.author.activities
for activity in activities:
if isinstance(activity, discord.CustomActivity) and "TEST" in activity.name:
member = ctx.author
add_role_id = ADD_ROLE_ID
remove_role_id = REMOVE_ROLE_ID
add_role = discord.utils.get(ctx.guild.roles, id=add_role_id)
remove_role = discord.utils.get(ctx.guild.roles, id=remove_role_id)
if add_role:
await member.add_roles(add_role)
await ctx.send(f"Role {add_role.name} added.")
else:
await ctx.send("The role to add does not exist.")
if remove_role and remove_role in member.roles:
await member.remove_roles(remove_role)
await ctx.send(f"Role {remove_role.name} removed.")
return
await ctx.send("You must have 'TEST' in your custom status to use this command.")```
even with the TEST status it does nothing with the roles
@last bobcat
I'm the wrong person to ask for Discord bots
ok ok
perhaps try asking in #discord-bots, if you don't find help here
ok
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.