20 lines
562 B
Python
20 lines
562 B
Python
# cmd_twitch/funfact.py
|
|
from twitchio.ext import commands
|
|
from cmd_common import common_commands as cc
|
|
|
|
def setup(bot):
|
|
"""
|
|
Registers the '!funfact' command for Twitch.
|
|
"""
|
|
@bot.command(name='funfact', aliases=['fun-fact'])
|
|
async def cmd_funfact(ctx: commands.Context, *keywords: str):
|
|
"""
|
|
Handle the '!funfact' command.
|
|
|
|
Usage:
|
|
- !funfact <keywords>
|
|
-> Displays a fun fact related to the given keywords.
|
|
"""
|
|
fact = cc.get_fun_fact(list(keywords))
|
|
await ctx.reply(fact)
|