Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
iuiaoin committed Jul 11, 2023
1 parent 1c8336c commit e129098
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion channel/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def handle_single(self, msg):
pass

@abstractmethod
def generate_reply(self, context):
def handle_reply(self, msg, context):
pass

@abstractmethod
Expand Down
6 changes: 3 additions & 3 deletions channel/wechat.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def handle_group(self, msg: Message):
match_prefix = check_prefix(query, create_image_prefix)
if match_prefix:
context.type = ContextType.CREATE_IMAGE
self.handle_reply(context, msg)
self.handle_reply(msg, context)

def handle_single(self, msg: Message):
# ignore message sent by public/subscription account
Expand All @@ -132,9 +132,9 @@ def handle_single(self, msg: Message):
match_image_prefix = check_prefix(query, create_image_prefix)
if match_image_prefix:
context.type = ContextType.CREATE_IMAGE
self.handle_reply(context, msg)
self.handle_reply(msg, context)

def handle_reply(self, context: Context, msg: Message):
def handle_reply(self, msg: Message, context: Context):
e1 = PluginManager().emit(
Event(
EventType.WILL_GENERATE_REPLY,
Expand Down
1 change: 1 addition & 0 deletions common/reply.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Reply(BaseModel):
content: str = None

def __init__(self, type: ReplyType, content: str):
super().__init__()
self.type = type
self.content = content

Expand Down

0 comments on commit e129098

Please sign in to comment.