Added CTX_ROOM_EVENT

This commit is contained in:
2026-10-31 21:00:45 +03:00
parent d5367ebc6b
commit ada7af9dd6
6 changed files with 57 additions and 3 deletions

View File

@@ -34,7 +34,6 @@ async def on_help_message(ctx: EventContext, vars: ContextVars) -> None:
async def on_cmd_create(ctx: EventContext, vars: ContextVars) -> None:
"""!create"""
raise NotImplementedError()
await ctx.bot.rooms.create()
alias = "".join([random.choice("abcdefghj") for i in range(10)])
name = alias.capitalize()
@@ -44,7 +43,7 @@ async def on_cmd_create(ctx: EventContext, vars: ContextVars) -> None:
alias=alias,
name=name,
topic=topic,
invite_list=[vars[CTX_EVENT]]
invite_list=[vars[CTX_ROOM_EVENT].sender]
)
await ctx.bot.send.text(ctx.room, f"Created the room {res}")
except: