diff --git a/examples/command_bot.py b/examples/command_bot.py index 8419124..bedfce8 100644 --- a/examples/command_bot.py +++ b/examples/command_bot.py @@ -29,20 +29,26 @@ async def on_help_command(ctx: EventContext, vars: ContextVars) -> None: "
!args arg1 [arg2] ... [arg5] - command that takes 1..5 argumentsraise RuntimeError()..."
+ "Executing raise RuntimeError()...",
+ is_html=True
)
raise RuntimeError()
@@ -50,7 +56,8 @@ async def on_assert_command(ctx: EventContext, vars: ContextVars) -> None:
"""!assert"""
await ctx.bot.send.text(
ctx.room,
- "Executing assert False..."
+ "Executing assert False...",
+ is_html=True
)
assert False
@@ -63,7 +70,11 @@ async def on_mul_command(ctx: EventContext, vars: ContextVars) -> None:
v *= n
response = " * ".join(html.escape("%.2f" % n) for n in numbers)
response += f" = {html.escape(str(v))}"
- await ctx.bot.send.text(ctx.room, response)
+ await ctx.bot.send.text(
+ ctx.room,
+ response,
+ is_html=True
+ )
except Exception as e:
await ctx.bot.send.text(ctx.room, f"Could not process the command: {e}")
@@ -81,7 +92,8 @@ async def on_args_command(ctx: EventContext, vars: ContextVars) -> None:
response += ""
await ctx.bot.send.text(
ctx.room,
- response
+ response,
+ is_html=True
)
except:
await ctx.bot.send.text(
@@ -91,7 +103,10 @@ async def on_args_command(ctx: EventContext, vars: ContextVars) -> None:
async def invalid_usage(ctx: EventContext, vars: ContextVars) -> None:
"""This callback is called when the bot used incorrectly."""
- await ctx.bot.send.text(ctx.room, "Use !help")
+ await ctx.bot.send.text(
+ ctx.room,
+ "Use !help",
+ is_html=True)
async def main() -> None:
diff --git a/examples/image_bot.py b/examples/image_bot.py
index 1af8ae3..c55c395 100644
--- a/examples/image_bot.py
+++ b/examples/image_bot.py
@@ -77,7 +77,8 @@ async def on_wrong_message(ctx: EventContext, vars: ContextVars) -> None:
"""This callback is called when a wrong message is received."""
await ctx.bot.send.text(
ctx.room,
- "Text me something like !gen 0.1 0.7 1.0 or send an image to blur"
+ "Text me something like !gen 0.1 0.7 1.0 or send an image to blur",
+ is_html=True
)
async def main() -> None:
diff --git a/examples/room_bot.py b/examples/room_bot.py
index c729883..0f210a4 100644
--- a/examples/room_bot.py
+++ b/examples/room_bot.py
@@ -30,7 +30,7 @@ async def on_help_message(ctx: EventContext, vars: ContextVars) -> None:
"\n!unban