ало сука не запускать не работает кал нахуй просто жди
This commit is contained in:
1 parent
6372a96f87
commit
48df539ee6
3 files changed
+159
-67
No files matched your search
+146
-54
@@ -65,13 +65,13 @@ async def select_provider_callback(callback: CallbackQuery):
|
|||||||
buttons = [
|
buttons = [
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(
|
InlineKeyboardButton(
|
||||||
text="🚫 нет моделей", callback_data=f"models%{user_id}"
|
text="🚫 нет моделей", callback_data=f"models%{user_id}", style="danger"
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
buttons.append(
|
buttons.append(
|
||||||
[InlineKeyboardButton(text="⬅️ назад", callback_data=f"models%{user_id}")]
|
[InlineKeyboardButton(text="⬅️ назад", callback_data=f"models%{user_id}", style="primary")]
|
||||||
)
|
)
|
||||||
|
|
||||||
await callback.message.edit_text(
|
await callback.message.edit_text(
|
||||||
@@ -99,11 +99,11 @@ async def models_callback(callback: CallbackQuery, alo=""):
|
|||||||
if AUTO_MODEL and AUTO_MODELS:
|
if AUTO_MODEL and AUTO_MODELS:
|
||||||
if config["model"] == "all*auto":
|
if config["model"] == "all*auto":
|
||||||
buttons.append(
|
buttons.append(
|
||||||
[InlineKeyboardButton(text="✅ автовыбор", callback_data=f"set_model%{user_id}%{DEFAULT_MODEL}")]
|
[InlineKeyboardButton(text="✅ автовыбор", callback_data=f"set_model%{user_id}%{DEFAULT_MODEL}", style="success")]
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
buttons.append(
|
buttons.append(
|
||||||
[InlineKeyboardButton(text="😱 автовыбор", callback_data=f"set_model%{user_id}%all*auto")]
|
[InlineKeyboardButton(text="😱 автовыбор", callback_data=f"set_model%{user_id}%all*auto", style="success")]
|
||||||
)
|
)
|
||||||
|
|
||||||
for provider in MODELS:
|
for provider in MODELS:
|
||||||
@@ -129,13 +129,13 @@ async def models_callback(callback: CallbackQuery, alo=""):
|
|||||||
buttons.append(
|
buttons.append(
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(
|
InlineKeyboardButton(
|
||||||
text="🚫 нет провайдеров!", callback_data=f"settings%{user_id}"
|
text="🚫 нет провайдеров!", callback_data=f"settings%{user_id}", style="danger"
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
buttons.append(
|
buttons.append(
|
||||||
[InlineKeyboardButton(text="⬅️ назад", callback_data=f"settings%{user_id}")]
|
[InlineKeyboardButton(text="⬅️ назад", callback_data=f"settings%{user_id}", style="primary")]
|
||||||
)
|
)
|
||||||
|
|
||||||
await callback.message.edit_text(
|
await callback.message.edit_text(
|
||||||
@@ -181,7 +181,7 @@ async def set_model_callback(callback: CallbackQuery):
|
|||||||
f"выбрана модель: `{new_model}`",
|
f"выбрана модель: `{new_model}`",
|
||||||
reply_markup=InlineKeyboardMarkup(inline_keyboard=
|
reply_markup=InlineKeyboardMarkup(inline_keyboard=
|
||||||
[
|
[
|
||||||
[InlineKeyboardButton(text="⬅️ назад", callback_data=f"models%{user_id}")]
|
[InlineKeyboardButton(text="⬅️ назад", callback_data=f"models%{user_id}", style="primary")]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -209,7 +209,7 @@ async def prompts_callback(callback: CallbackQuery):
|
|||||||
InlineKeyboardButton(text=f"🤝 твои промпты ({user_prompts_count})", callback_data=f"user_prompts%{user_id}"),
|
InlineKeyboardButton(text=f"🤝 твои промпты ({user_prompts_count})", callback_data=f"user_prompts%{user_id}"),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(text="⬅️ назад", callback_data=f"settings%{user_id}"),
|
InlineKeyboardButton(text="⬅️ назад", callback_data=f"settings%{user_id}", style="primary"),
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ async def view_system_prompt_callback(callback: CallbackQuery, dataalo=""):
|
|||||||
InlineKeyboardButton(text=prompt_apply_t, callback_data=f"sp%{user_id}%0%{prompt_id}%3"),
|
InlineKeyboardButton(text=prompt_apply_t, callback_data=f"sp%{user_id}%0%{prompt_id}%3"),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(text="⬅️ назад", callback_data=f"system_prompts%{user_id}"),
|
InlineKeyboardButton(text="⬅️ назад", callback_data=f"system_prompts%{user_id}", style="primary"),
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@ async def view_prompt_callback(callback: CallbackQuery, dataalo=""):
|
|||||||
InlineKeyboardButton(text=prompt_apply_t, callback_data=f"sp%{user_id}%0%{prompt_id}%1"),
|
InlineKeyboardButton(text=prompt_apply_t, callback_data=f"sp%{user_id}%0%{prompt_id}%1"),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(text="⬅️ назад", callback_data=f"user_prompts%{user_id}"),
|
InlineKeyboardButton(text="⬅️ назад", callback_data=f"user_prompts%{user_id}", style="primary"),
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -401,15 +401,15 @@ async def user_prompts_callback(callback: CallbackQuery, dataalo=""):
|
|||||||
buttons.append(
|
buttons.append(
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(
|
InlineKeyboardButton(
|
||||||
text="🚫 нет промптов!", callback_data=f"prompts%{user_id}"
|
text="🚫 нет промптов!", callback_data=f"prompts%{user_id}", style="danger"
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
buttons.append(
|
buttons.append(
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(text="⬅️ назад", callback_data=f"prompts%{user_id}"),
|
InlineKeyboardButton(text="⬅️ назад", callback_data=f"prompts%{user_id}", style="primary"),
|
||||||
InlineKeyboardButton(text="📝 создать", callback_data=f"create%{user_id}"),
|
InlineKeyboardButton(text="📝 создать", callback_data=f"create%{user_id}", style="primary"),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -461,7 +461,7 @@ async def view_text_callback(callback: CallbackQuery, dataalo=""):
|
|||||||
buttons = [
|
buttons = [
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(
|
InlineKeyboardButton(
|
||||||
text="⬅️ назад", callback_data=f"vp%{user_id}%{prompt_id}"
|
text="⬅️ назад", callback_data=f"vp%{user_id}%{prompt_id}", style="primary"
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -609,7 +609,7 @@ async def edit_prompt_name_callback(callback: CallbackQuery):
|
|||||||
buttons = [
|
buttons = [
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(
|
InlineKeyboardButton(
|
||||||
text="❌ отменить", callback_data=f"p_cancel%{user_id}"
|
text="❌ отменить", callback_data=f"p_cancel%{user_id}", style="danger"
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -636,7 +636,7 @@ async def edit_prompt_prompt_callback(callback: CallbackQuery):
|
|||||||
buttons = [
|
buttons = [
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(
|
InlineKeyboardButton(
|
||||||
text="❌ отменить", callback_data=f"p_cancel%{user_id}"
|
text="❌ отменить", callback_data=f"p_cancel%{user_id}", style="danger"
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -699,7 +699,7 @@ async def create_prompt_callback(callback: CallbackQuery):
|
|||||||
buttons = [
|
buttons = [
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(
|
InlineKeyboardButton(
|
||||||
text="❌ отменить", callback_data=f"p_cancel%{user_id}"
|
text="❌ отменить", callback_data=f"p_cancel%{user_id}", style="danger"
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -753,14 +753,14 @@ async def system_prompts_callback(callback: CallbackQuery):
|
|||||||
buttons.append(
|
buttons.append(
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(
|
InlineKeyboardButton(
|
||||||
text="🚫 нет промптов!", callback_data=f"prompts%{user_id}"
|
text="🚫 нет промптов!", callback_data=f"prompts%{user_id}", style="danger"
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
buttons.append(
|
buttons.append(
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(text="⬅️ назад", callback_data=f"prompts%{user_id}"),
|
InlineKeyboardButton(text="⬅️ назад", callback_data=f"prompts%{user_id}", style="primary"),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -806,16 +806,12 @@ async def set_prompt_callback(callback: CallbackQuery):
|
|||||||
else:
|
else:
|
||||||
await add_prompt_callback(callback, f"0%{user_id}%{prompt_user_id}%{data[3]}", alo=False)
|
await add_prompt_callback(callback, f"0%{user_id}%{prompt_user_id}%{data[3]}", alo=False)
|
||||||
|
|
||||||
set_user_config(
|
set_user_setting(
|
||||||
user_id,
|
user_id,
|
||||||
config.get("model"),
|
"prompt": new_status,
|
||||||
config.get("stream"),
|
"prompts": get_user_config(user_id).get("prompts")
|
||||||
config.get("call"),
|
|
||||||
new_status,
|
|
||||||
config.get("notify"),
|
|
||||||
config.get("markdown"),
|
|
||||||
get_user_config(user_id).get("prompts")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if msg_type == 0:
|
if msg_type == 0:
|
||||||
await callback.answer("da поменял на " + new_status)
|
await callback.answer("da поменял на " + new_status)
|
||||||
await settings_handler(callback)
|
await settings_handler(callback)
|
||||||
@@ -865,16 +861,11 @@ async def add_prompt_callback(callback: CallbackQuery, dataalo="", alo=True):
|
|||||||
new_prompt["public"] = False
|
new_prompt["public"] = False
|
||||||
new_prompts = new_prompts | {data[3]: new_prompt}
|
new_prompts = new_prompts | {data[3]: new_prompt}
|
||||||
|
|
||||||
set_user_config(
|
set_user_setting(
|
||||||
user_id,
|
user_id,
|
||||||
config.get("model"),
|
"prompts": new_prompts
|
||||||
config.get("stream"),
|
|
||||||
config.get("call"),
|
|
||||||
config.get("prompt"),
|
|
||||||
config.get("notify"),
|
|
||||||
config.get("markdown"),
|
|
||||||
new_prompts
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if alo:
|
if alo:
|
||||||
return await callback.answer("добавил твой промпт da.")
|
return await callback.answer("добавил твой промпт da.")
|
||||||
|
|
||||||
@@ -924,15 +915,9 @@ async def set_markdown_callback(callback: CallbackQuery, message=None):
|
|||||||
await callback.answer("нет, не трогай это не твое")
|
await callback.answer("нет, не трогай это не твое")
|
||||||
return
|
return
|
||||||
config = get_user_config(user_id)
|
config = get_user_config(user_id)
|
||||||
set_user_config(
|
set_user_setting(
|
||||||
user_id,
|
user_id,
|
||||||
config.get("model"),
|
"markdown": "new"
|
||||||
config.get("stream"),
|
|
||||||
config.get("call"),
|
|
||||||
config.get("prompt"),
|
|
||||||
config.get("notify"),
|
|
||||||
"new",
|
|
||||||
config.get("prompts")
|
|
||||||
)
|
)
|
||||||
if message:
|
if message:
|
||||||
await message.delete()
|
await message.delete()
|
||||||
@@ -949,15 +934,9 @@ async def set_markdown_callback(callback: CallbackQuery, message=None):
|
|||||||
await callback.answer("нет, не трогай это не твое")
|
await callback.answer("нет, не трогай это не твое")
|
||||||
return
|
return
|
||||||
config = get_user_config(user_id)
|
config = get_user_config(user_id)
|
||||||
set_user_config(
|
set_user_setting(
|
||||||
user_id,
|
user_id,
|
||||||
config.get("model"),
|
"markdown": "old"
|
||||||
config.get("stream"),
|
|
||||||
config.get("call"),
|
|
||||||
config.get("prompt"),
|
|
||||||
config.get("notify"),
|
|
||||||
"old",
|
|
||||||
config.get("prompts")
|
|
||||||
)
|
)
|
||||||
if message:
|
if message:
|
||||||
await message.delete()
|
await message.delete()
|
||||||
@@ -987,7 +966,7 @@ async def about_callback(callback: CallbackQuery):
|
|||||||
return
|
return
|
||||||
|
|
||||||
buttons = [
|
buttons = [
|
||||||
[InlineKeyboardButton(text="назад", callback_data=f"settings%{user_id}")]
|
[InlineKeyboardButton(text="назад", callback_data=f"settings%{user_id}", style="primary")]
|
||||||
]
|
]
|
||||||
|
|
||||||
await callback.message.edit_text(
|
await callback.message.edit_text(
|
||||||
@@ -1008,7 +987,7 @@ async def donate_callback(callback: CallbackQuery):
|
|||||||
return
|
return
|
||||||
|
|
||||||
buttons = [
|
buttons = [
|
||||||
[InlineKeyboardButton(text="назад", callback_data=f"settings%{user_id}")],
|
[InlineKeyboardButton(text="назад", callback_data=f"settings%{user_id}", style="primary")],
|
||||||
]
|
]
|
||||||
|
|
||||||
await callback.message.edit_text(
|
await callback.message.edit_text(
|
||||||
@@ -1063,7 +1042,7 @@ async def group_post_prompt_callback(callback: CallbackQuery):
|
|||||||
reply_markup=InlineKeyboardMarkup(
|
reply_markup=InlineKeyboardMarkup(
|
||||||
inline_keyboard=[
|
inline_keyboard=[
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(text="❌ отменить", callback_data=f"gcancel%{group_id}%{user_id}")
|
InlineKeyboardButton(text="❌ отменить", callback_data=f"gcancel%{group_id}%{user_id}", style="danger")
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
@@ -1083,3 +1062,116 @@ async def group_cancel_callback(callback: CallbackQuery):
|
|||||||
alo_command[int(user_id)] = {"action": None, "chat_id": callback.message.chat.id, "message_id": callback.message.message_id}
|
alo_command[int(user_id)] = {"action": None, "chat_id": callback.message.chat.id, "message_id": callback.message.message_id}
|
||||||
|
|
||||||
await group_settings_handler(callback, dataalo=f"group%{group_id}")
|
await group_settings_handler(callback, dataalo=f"group%{group_id}")
|
||||||
|
|
||||||
|
|
||||||
|
@router.callback_query(F.data.startswith("call%"))
|
||||||
|
async def call_callback(callback: CallbackQuery):
|
||||||
|
data = callback.data.split("%", 1)
|
||||||
|
user_id = data[1]
|
||||||
|
if user_id != str(callback.from_user.id):
|
||||||
|
await callback.answer("прости но нет")
|
||||||
|
return
|
||||||
|
|
||||||
|
config = get_user_config(user_id)
|
||||||
|
calling_dots = ""
|
||||||
|
call_dots = ""
|
||||||
|
|
||||||
|
if config["call"] == "da":
|
||||||
|
call_status = "✅"
|
||||||
|
call_status2 = "вкл"
|
||||||
|
call_style = "success"
|
||||||
|
call_cb = "net"
|
||||||
|
else:
|
||||||
|
call_status = "❌"
|
||||||
|
call_status2 = "выкл"
|
||||||
|
call_style = "danger"
|
||||||
|
call_cb = "da"
|
||||||
|
|
||||||
|
# хуй хуй хуй
|
||||||
|
# сиськам сись писькам пись
|
||||||
|
|
||||||
|
if config["calling"] == []:
|
||||||
|
calling_status = "свои слова отклика ->"
|
||||||
|
calling_status2 = ["✅", ""]
|
||||||
|
else:
|
||||||
|
calling_status = ", ".join(config["calling"])[:35]
|
||||||
|
calling_status2 = ["", "✅"]
|
||||||
|
|
||||||
|
if len(", ".join(config["calling"])) > 35:
|
||||||
|
calling_dots = "..."
|
||||||
|
|
||||||
|
if len(", ".join(BOT_CALLS)) > 35:
|
||||||
|
call_dots = "..."
|
||||||
|
|
||||||
|
buttons = [
|
||||||
|
[
|
||||||
|
InlineKeyboardButton(
|
||||||
|
text=f"{call_status} отклик на слова: {call_status2} {call_status}",
|
||||||
|
callback_data=f"set%call%{user_id}%{call_cb}",
|
||||||
|
style=call_style
|
||||||
|
),
|
||||||
|
],
|
||||||
|
]
|
||||||
|
|
||||||
|
if config["call"] == "da":
|
||||||
|
buttons += [
|
||||||
|
[InlineKeyboardButton(
|
||||||
|
text=f"{calling_status2[0]} {', '.join(BOT_CALLS)[:35]}{call_dots}",
|
||||||
|
callback_data=f"scall%{user_id}%1")
|
||||||
|
],
|
||||||
|
[InlineKeyboardButton(
|
||||||
|
text=f"{calling_status2[1]} {calling_status}{calling_dots}",
|
||||||
|
callback_data=f"scall%{user_id}%0")
|
||||||
|
],
|
||||||
|
]
|
||||||
|
|
||||||
|
buttons += [
|
||||||
|
[
|
||||||
|
InlineKeyboardButton(
|
||||||
|
text=f"⬅️ назад",
|
||||||
|
callback_data=f"settings%{user_id}",
|
||||||
|
style="primary"
|
||||||
|
)
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
await callback.message.edit_text(
|
||||||
|
"меню выбора на что звать меня дорогой друг",
|
||||||
|
reply_markup=InlineKeyboardMarkup(inline_keyboard=buttons),
|
||||||
|
)
|
||||||
|
|
||||||
|
await callback.answer()
|
||||||
|
|
||||||
|
|
||||||
|
@router.callback_query(F.data.startswith("scall%"))
|
||||||
|
async def call_callback(callback: CallbackQuery):
|
||||||
|
# чем выше забор, тем ниже плинтус
|
||||||
|
data = callback.data.split("%", 2)
|
||||||
|
user_id = data[1]
|
||||||
|
call_type = data[2]
|
||||||
|
if user_id != str(callback.from_user.id):
|
||||||
|
await callback.answer("прости но нет")
|
||||||
|
return
|
||||||
|
|
||||||
|
config = get_user_config(user_id)
|
||||||
|
|
||||||
|
if call_type == "1":
|
||||||
|
set_user_setting
|
||||||
|
|
||||||
|
|
||||||
|
buttons = [
|
||||||
|
[
|
||||||
|
InlineKeyboardButton(
|
||||||
|
text=f"⬅️ назад",
|
||||||
|
callback_data=f"call%{user_id}",
|
||||||
|
style="primary"
|
||||||
|
)
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
await callback.message.edit_text( # 7 раз измерь 1 хуй неправильно
|
||||||
|
"напиши слова для отклика узбекгпт через запятую ✅:",
|
||||||
|
reply_markup=InlineKeyboardMarkup(inline_keyboard=buttons),
|
||||||
|
)
|
||||||
|
|
||||||
|
await callback.answer()
|
||||||
+6
-13
@@ -464,13 +464,6 @@ async def settings_handler(event: Union[Message, CallbackQuery]):
|
|||||||
stream_status = "net"
|
stream_status = "net"
|
||||||
stream_cb = "native"
|
stream_cb = "native"
|
||||||
|
|
||||||
if config["call"] == "da":
|
|
||||||
call_status = "da"
|
|
||||||
call_cb = "net"
|
|
||||||
else:
|
|
||||||
call_status = "net"
|
|
||||||
call_cb = "da"
|
|
||||||
|
|
||||||
if config["notify"] == "da":
|
if config["notify"] == "da":
|
||||||
notify_status = "da"
|
notify_status = "da"
|
||||||
notify_cb = "net"
|
notify_cb = "net"
|
||||||
@@ -489,10 +482,10 @@ async def settings_handler(event: Union[Message, CallbackQuery]):
|
|||||||
inline_keyboard=[
|
inline_keyboard=[
|
||||||
[
|
[
|
||||||
InlineKeyboardButton(
|
InlineKeyboardButton(
|
||||||
text=f"модели ({models_count})", callback_data=f"models%{user_id}"
|
text=f"модели ({models_count}) ->", callback_data=f"models%{user_id}"
|
||||||
),
|
),
|
||||||
InlineKeyboardButton(
|
InlineKeyboardButton(
|
||||||
text=f"промпты ({prompts_count})", callback_data=f"prompts%{user_id}"
|
text=f"промпты ({prompts_count}) ->", callback_data=f"prompts%{user_id}"
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -501,8 +494,8 @@ async def settings_handler(event: Union[Message, CallbackQuery]):
|
|||||||
callback_data=f"set%stream%{user_id}%{stream_cb}",
|
callback_data=f"set%stream%{user_id}%{stream_cb}",
|
||||||
),
|
),
|
||||||
InlineKeyboardButton(
|
InlineKeyboardButton(
|
||||||
text=f"отклик: {call_status}",
|
text=f"на что отвечат ->",
|
||||||
callback_data=f"set%call%{user_id}%{call_cb}",
|
callback_data=f"call%{user_id}",
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -516,8 +509,8 @@ async def settings_handler(event: Union[Message, CallbackQuery]):
|
|||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
[InlineKeyboardButton(text="💸 донат", callback_data=f"donate%{user_id}")],
|
[InlineKeyboardButton(text="💸 донат ->", callback_data=f"donate%{user_id}")],
|
||||||
[InlineKeyboardButton(text="🤖 о боте", callback_data=f"about%{user_id}")],
|
[InlineKeyboardButton(text="🤖 о боте ->", callback_data=f"about%{user_id}")],
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -426,6 +426,7 @@ def set_user_config(
|
|||||||
notify=DEFAULT_NOTIFY,
|
notify=DEFAULT_NOTIFY,
|
||||||
markdown=DEFAULT_MARKDOWN,
|
markdown=DEFAULT_MARKDOWN,
|
||||||
prompts={},
|
prompts={},
|
||||||
|
calling={},
|
||||||
):
|
):
|
||||||
with shelve.open("users") as db:
|
with shelve.open("users") as db:
|
||||||
db[str(user_id)] = {
|
db[str(user_id)] = {
|
||||||
@@ -436,6 +437,7 @@ def set_user_config(
|
|||||||
"notify": notify,
|
"notify": notify,
|
||||||
"markdown": markdown,
|
"markdown": markdown,
|
||||||
"prompts": prompts,
|
"prompts": prompts,
|
||||||
|
"calling": calling,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -449,6 +451,7 @@ def set_user_setting(
|
|||||||
notify=None,
|
notify=None,
|
||||||
markdown=None,
|
markdown=None,
|
||||||
prompts=None,
|
prompts=None,
|
||||||
|
calling=None,
|
||||||
):
|
):
|
||||||
with shelve.open("users") as db:
|
with shelve.open("users") as db:
|
||||||
user_id = str(user_id)
|
user_id = str(user_id)
|
||||||
@@ -464,6 +467,7 @@ def set_user_setting(
|
|||||||
if notify is not None: settings["notify"] = notify
|
if notify is not None: settings["notify"] = notify
|
||||||
if markdown is not None: settings["markdown"] = markdown
|
if markdown is not None: settings["markdown"] = markdown
|
||||||
if prompts is not None: settings["prompts"] = prompts
|
if prompts is not None: settings["prompts"] = prompts
|
||||||
|
if calling is not None: settings["calling"] = calling
|
||||||
|
|
||||||
db[user_id] = settings
|
db[user_id] = settings
|
||||||
|
|
||||||
@@ -490,6 +494,7 @@ def ensure_user(
|
|||||||
notify_mode=DEFAULT_NOTIFY,
|
notify_mode=DEFAULT_NOTIFY,
|
||||||
markdown=DEFAULT_MARKDOWN,
|
markdown=DEFAULT_MARKDOWN,
|
||||||
prompts={},
|
prompts={},
|
||||||
|
calling=[],
|
||||||
):
|
):
|
||||||
with shelve.open("users") as db:
|
with shelve.open("users") as db:
|
||||||
key = str(user_id)
|
key = str(user_id)
|
||||||
@@ -503,6 +508,7 @@ def ensure_user(
|
|||||||
"notify": notify_mode,
|
"notify": notify_mode,
|
||||||
"markdown": markdown,
|
"markdown": markdown,
|
||||||
"prompts": prompts,
|
"prompts": prompts,
|
||||||
|
"calling": calling,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -517,6 +523,7 @@ def get_user_config(user_id):
|
|||||||
"notify": DEFAULT_NOTIFY,
|
"notify": DEFAULT_NOTIFY,
|
||||||
"markdown": DEFAULT_MARKDOWN,
|
"markdown": DEFAULT_MARKDOWN,
|
||||||
"prompts": {},
|
"prompts": {},
|
||||||
|
"calling": [],
|
||||||
}
|
}
|
||||||
updated = False
|
updated = False
|
||||||
for key, value in defaults.items():
|
for key, value in defaults.items():
|
||||||
|
|||||||
Reference in new issue
Block a user