fix(twitch): Fix followage and whisper ctxvars.

This commit is contained in:
2026-05-31 07:49:48 +10:00
parent 17c0dc00c1
commit 688282b6ac
3 changed files with 17 additions and 10 deletions
+8 -3
View File
@@ -4,23 +4,28 @@ from typing import Optional
stuff = {}
def register_var(name: str | None = None):
def wrapper(coro):
varname = name or coro.__name__
stuff[varname] = coro
return coro
return coro
return wrapper
@register_var('random')
@register_var("random")
async def random_func(ctx, a: int, b: Optional[int] = None):
a = int(a)
b = int(b) if b is not None else None
if b is not None:
low, high = a, b
else:
low, high = 0, a
return random.randint(low, high)
@register_var('user')
@register_var("user")
async def user_func(ctx, userstr: int | str):
"""
Attempt to turn the given userstr into a user.