Skip to content

Instantly share code, notes, and snippets.

Created Jun 13, 2020
What would you like to do?
Give roles on going Live on twitch
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='?')
async def on_member_update(before, after):
streaming_role = after.guild.get_role(<replace this>)
if after.activity is discord.Streaming:
if not streaming_role in after.roles:
await after.add_roles(streaming_role)
elif after.activity is not discord.Streaming:
if streaming_role in after.roles:
await after.remove_roles(streaming_role)'token')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment