import requests # Replace with your actual bot token, guild ID, and role ID BOT_TOKEN = 'YOUR_BOT_TOKEN' GUILD_ID = 'YOUR_GUILD_ID' ROLE_ID = 'YOUR_ROLE_ID' # Discord API endpoint for modifying a role url = f'https://discord.com/api/v9/guilds/{GUILD_ID}/roles/{ROLE_ID}' # Headers for authentication headers = { 'Authorization': f'Bot {BOT_TOKEN}', 'Content-Type': 'application/json' } # Data for updating the role data = { 'name': 'New Role Name', # New name for the role 'permissions': 'permissions_integer_value', # Permissions integer (optional) 'color': 0x1ABC9C, # New color for the role (optional) 'hoist': True, # Whether the role should be displayed separately in the sidebar (optional) 'mentionable': True # Whether the role should be mentionable (optional) } # Make the PATCH request to update the role response = requests.patch(url, headers=headers, json=data) # Check if the request was successful if response.status_code == 200: print('Role updated successfully.') else: print(f'Failed to update role: {response.status_code}') print(response.json())