OokamiPupV2/cmd_twitch.py

31 lines
1019 B
Python

# cmd_twitch.py
from twitchio.ext import commands
from cmd_common import common_commands as cc
from modules.permissions import has_permission
def setup(bot):
@bot.command(name="greet")
async def greet(ctx):
result = cc.greet(ctx.author.display_name, "Twitch")
await ctx.send(result)
@bot.command(name="ping")
async def ping(ctx):
result = cc.ping()
await ctx.send(result)
@bot.command(name="howl")
async def howl(ctx):
result = cc.howl(ctx.author.display_name)
await ctx.send(result)
@bot.command(name="hi")
async def hi_command(ctx):
user_id = str(ctx.author.id) # Twitch user ID
user_roles = [role.lower() for role in ctx.author.badges.keys()] # Use Twitch badges as roles
if not has_permission("hi", user_id, user_roles, "twitch"):
await ctx.send("You don't have permission to use this command.")
return
await ctx.send("Hello there!")