Created
June 13, 2020 02:48
-
-
Save aikocc/a1c149e9e72804bbff47a6e197b28309 to your computer and use it in GitHub Desktop.
Give roles on going Live on twitch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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