fix(twitch): Fix followage and whisper ctxvars.
This commit is contained in:
+8
-3
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user