Skip to content

Commit

Permalink
fix: role check in inline queryes
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Jul 12, 2024
1 parent c295de9 commit 867005c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,21 @@

[![inlang status badge](https://inlang.com/badge?url=github.com/hiddify/hiddifypanel_bot)](https://inlang.com/editor/github.com/hiddify/hiddifypanel_bot?ref=badge)
</div>


# Installation:
```
git clone https://github.com/hiddify/hiddifypanel_bot
cd hiddifypanel_bot
cp .env_example .env
#Enter the user panel link and admin panel link and bot token in .env file
nano .env
pip install -e .
hiddifypanel_bot
```


# Add new module
See examples in hiddifypanel_bot/modules

7 changes: 3 additions & 4 deletions hiddifypanel_bot/basebot/storage_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ async def check(self, obj, val):
"""
:meta private:
"""
if isinstance(obj,types.Message):
message=obj
if hasattr(obj,'db'):
storage=obj.db
elif hasattr(obj,'message'):
message=obj.message
storage=obj.message.db
else:
return
if not isinstance(val, dict):
raise ValueError("Invalid Usage")

storage=message.db
for k,v in val.items():
l=v if isinstance(v, list) else [v]
data=await storage[k]
Expand Down
2 changes: 1 addition & 1 deletion hiddifypanel_bot/modules/admin/add_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def add_user_complete(msg: HMessage, name: str, package_days: int, usage_l
resp=tghelper.format_user_message(msg.lang,user_info)
uuid = user_data.get("uuid", "N/A")
sublink_data = user_info['profile_url']
qr_code = await msg.hapi.generate_qr_code(sublink_data)
qr_code = msg.hapi.generate_qr_code(sublink_data)

inline_keyboard = InlineKeyboardMarkup()
# inline_keyboard.add(InlineKeyboardButton(text="Open Sublink", web_app=WebAppInfo(sublink_data)))
Expand Down

0 comments on commit 867005c

Please sign in to comment.