From 820006e05871619164f91c973584a720e45f3b99 Mon Sep 17 00:00:00 2001 From: Jacob Marks Date: Thu, 4 Apr 2024 20:05:49 -0400 Subject: [PATCH 1/2] Use ctx.ops to set view --- __init__.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/__init__.py b/__init__.py index ac17173..a92c502 100644 --- a/__init__.py +++ b/__init__.py @@ -93,10 +93,7 @@ def execute(self, ctx): def view(self, ctx, view): if view != ctx.view: - return ctx.trigger( - "set_view", - params=dict(view=serialize_view(view)), - ) + ctx.ops.set_view(view=view) def message(self, ctx, message, messages, overwrite_last=False): if overwrite_last: @@ -218,10 +215,7 @@ def execute(self, ctx): def view(self, ctx, view): if view != ctx.view: - return ctx.trigger( - "set_view", - params=dict(view=serialize_view(view)), - ) + ctx.ops.set_view(view=view) def message(self, ctx, message, **kwargs): return self.show_message(ctx, message, types.MarkdownView(), **kwargs) From ba1d5b6cfde6ee16d0a09cabbc797fe6be62cd09 Mon Sep 17 00:00:00 2001 From: Jacob Marks Date: Thu, 4 Apr 2024 20:06:01 -0400 Subject: [PATCH 2/2] remove unused import --- __init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/__init__.py b/__init__.py index a92c502..e102865 100644 --- a/__init__.py +++ b/__init__.py @@ -7,7 +7,6 @@ """ import json import os -import sys import traceback from bson import json_util