Skip to content

Instantly share code, notes, and snippets.

@aikocc

aikocc/bot.py

Created Jun 13, 2020
Embed
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='?')
@bot.event
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)
bot.run('token')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment