Skip to content

Commit

Permalink
Merge pull request #3 from cirebon-dev/dev
Browse files Browse the repository at this point in the history
fix midleware
  • Loading branch information
guangrei authored Jan 15, 2024
2 parents 2712f17 + 802031c commit 6efd3a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions chatrouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""

__author__ = "guangrei"
__version__ = "v1.0.2"
__version__ = "v1.0.3"

_data: dict = {} # chatrouter storage
data_user: Any = None # data user storage
Expand Down Expand Up @@ -246,7 +246,7 @@ def run(route: group, msg: str) -> Union[str, None]:
ini adalah fungsi utama untuk interpretasi chatrouter
"""
if "__midleware__" in _data[route.id]:
coba = _data[route.id]["__default__"]["callback"]()
coba = _data[route.id]["__midleware__"]["callback"]()
if coba is not True:
return coba
if len(msg):
Expand All @@ -266,7 +266,7 @@ async def async_run(route: group, msg: str) -> Union[str, None]:
ini adalah versi async dari function run
"""
if "__midleware__" in _data[route.id]:
coba = await _data[route.id]["__default__"]["callback"]()
coba = await _data[route.id]["__midleware__"]["callback"]()
if coba is not True:
return coba
if len(msg):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "chatrouter"
version = "1.0.2"
version = "1.0.3"
description = "router for chatbot"
authors = ["guangrei"]
license = "mit"
Expand Down

0 comments on commit 6efd3a6

Please sign in to comment.