MCPcopy Create free account

hub / github.com/H-T-H/Gemini-Telegram-Bot / functions

Functions92 in github.com/H-T-H/Gemini-Telegram-Bot

↓ 20 callersMethodreply_to
(self, message, text, **kwargs)
tests/test_storage.py:200
↓ 12 callersFunction_connect
()
src/storage.py:25
↓ 8 callersMethodanswer_callback_query
(self, callback_query_id, text=None, show_alert=None, **kwargs)
tests/test_storage.py:206
↓ 8 callersMethodedit_message_text
(self, text, **kwargs)
tests/test_storage.py:209
↓ 6 callersFunctionensure_authorized
(message: Message, bot: TeleBot)
src/handlers.py:64
↓ 6 callersFunctionis_admin
(user_id: int)
src/access_control.py:27
↓ 5 callersFunction_now
()
src/storage.py:14
↓ 5 callersFunctionget_client
()
src/utils.py:43
↓ 5 callersFunctioninit_user
if user not exist in chat_dict, create one Args: user_id: (int): user's id Returns: UserSession: user's chat session sta
src/utils.py:86
↓ 5 callersMethodsend_message
(self, chat_id, text, **kwargs)
tests/test_storage.py:203
↓ 5 callersFunctionsend_model_picker
(message: Message, bot: TeleBot)
src/handlers.py:98
↓ 4 callersMethodcreate
(self, model: str, history: list | None = None)
tests/test_storage.py:143
↓ 4 callersFunctionget_current_model
(user_id: int)
src/utils.py:132
↓ 3 callersFunctionget_access_subject
(message)
src/access_control.py:35
↓ 3 callersFunctionget_subject_access_status
(subject_type: str, subject_id: int)
src/access_control.py:39
↓ 3 callersFunctionget_user_error_message
(error: Exception)
src/gemini.py:16
↓ 2 callersFunctionare_access_requests_enabled
()
src/access_control.py:43
↓ 2 callersFunctionlist_available_models
(force_refresh: bool = False)
src/utils.py:68
↓ 2 callersFunctionreview_access
(subject_type: str, subject_id: int, status: str, reviewed_by: int)
src/access_control.py:80
↓ 1 callersFunction_get_db_path
()
src/storage.py:18
↓ 1 callersFunction_is_chat_model
(model_name: str, supported_actions: list[str])
src/utils.py:51
↓ 1 callersFunction_normalize_contents_for_history
(contents: str | list[Any])
src/utils.py:157
↓ 1 callersFunction_normalize_model_name
(model_name: str)
src/utils.py:48
↓ 1 callersFunctionbuild_access_markup
(subject_type: str, subject_id: int)
src/handlers.py:31
↓ 1 callersFunctionbuild_model_markup
(models: list[str])
src/handlers.py:92
↓ 1 callersFunctionbuild_revoke_markup
(subject_type: str, subject_id: int)
src/handlers.py:168
↓ 1 callersFunctionclear_history
clear user's history Args: user_id (int): user's id Returns: None
src/utils.py:136
↓ 1 callersFunctionformat_access_request
(message: Message)
src/handlers.py:39
↓ 1 callersFunctionformat_approved_access_record
(record: dict[str, object])
src/handlers.py:156
↓ 1 callersFunctionget_admin_user_ids
()
src/access_control.py:31
↓ 1 callersFunctionget_approved_access_records
()
src/access_control.py:88
↓ 1 callersFunctionget_setting
(key: str, default: str | None = None)
src/storage.py:222
↓ 1 callersFunctioninit_admin_user_ids
(user_ids: str)
src/access_control.py:15
↓ 1 callersFunctioninit_client
Initialize the Gemini client once during application startup.
src/utils.py:38
↓ 1 callersFunctioninit_db
(path: str)
src/storage.py:38
↓ 1 callersFunctionis_subject_authorized
(subject_type: str, subject_id: int, actor_user_id: int)
src/access_control.py:51
↓ 1 callersFunctionis_user_authorized
(user_id: int)
src/access_control.py:57
↓ 1 callersFunctionmain
()
src/main.py:34
↓ 1 callersFunctionnotify_admins_access_request
(message: Message, bot: TeleBot)
src/handlers.py:52
↓ 1 callersFunctionrequest_access
(message)
src/access_control.py:63
↓ 1 callersFunctionrevoke_access
(subject_type: str, subject_id: int, reviewed_by: int)
src/access_control.py:84
↓ 1 callersFunctionsave_turn
(user_id: int, contents: str | list[Any], model_text: str)
src/utils.py:171
↓ 1 callersFunctionselect_model
Select user's chat model, keeping history when a chat already exists. Args: user_id (int): user's id new_model (str): model t
src/utils.py:110
↓ 1 callersFunctionset_access_request_enabled
(enabled: bool)
src/access_control.py:47
↓ 1 callersFunctionset_setting
(key: str, value: str)
src/storage.py:233
Method__init__
(self, model: str, history: list | None = None)
tests/test_storage.py:134
Method__init__
( self, user_id: int, username: str | None = "user", first_name: str | None =
tests/test_storage.py:156
Method__init__
(self, chat_id: int = 1, chat_type: str = "private", title: str | None = None)
tests/test_storage.py:170
Method__init__
(self, user_id: int, chat_type: str = "private", chat_id: int = 1, title: str | None = None)
tests/test_storage.py:177
Method__init__
(self, user_id: int, data: str)
tests/test_storage.py:183
Method__init__
(self)
tests/test_storage.py:194
Function_fetch_available_models
()
src/utils.py:58
Functionaccess
(message: Message, bot: TeleBot)
src/handlers.py:175
Functionaccess_callback
(call: CallbackQuery, bot: TeleBot)
src/handlers.py:225
Functionaccessrequest
(message: Message, bot: TeleBot)
src/handlers.py:195
Functionappend_turn
( user_id: int, model: str, user_text: str, model_text: str, max_turns: int | None = None,
src/storage.py:164
MethodasyncSetUp
(self)
tests/test_storage.py:214
MethodasyncTearDown
(self)
tests/test_storage.py:221
Functionclear
(message: Message, bot: TeleBot)
src/handlers.py:139
Functionclear_user_history
(user_id: int)
src/storage.py:217
Functioncreate_access_request
( subject_type: str, subject_id: int, username: str | None, first_name: str | None, last_n
src/storage.py:271
Functiongemini_handler
(message: Message, bot: TeleBot)
src/handlers.py:126
Functiongemini_photo_handler
(message: Message, bot: TeleBot)
src/handlers.py:278
Functiongemini_private_handler
(message: Message, bot: TeleBot)
src/handlers.py:269
Functiongemini_stream
(bot:TeleBot, message:Message, contents:str|list)
src/gemini.py:38
Functionget_access_requests_enabled
()
src/storage.py:248
Functionget_access_status
(subject_type: str, subject_id: int)
src/storage.py:256
Methodget_history
(self)
tests/test_storage.py:138
Functionget_user_model
(user_id: int)
src/storage.py:109
Functionlist_approved_access
()
src/storage.py:380
Functionload_history
(user_id: int, limit_turns: int | None = None)
src/storage.py:135
Functionmodel
(message: Message, bot: TeleBot)
src/handlers.py:148
Functionmodel_callback
(call: CallbackQuery, bot: TeleBot)
src/handlers.py:205
Functionreview_access_request
( subject_type: str, subject_id: int, status: str, reviewed_by: int, )
src/storage.py:347
MethodsetUp
(self)
tests/test_storage.py:17
Functionset_access_requests_enabled
(enabled: bool)
src/storage.py:252
Functionset_user_model
(user_id: int, model: str)
src/storage.py:120
Functionstart
(message: Message, bot: TeleBot)
src/handlers.py:116
MethodtearDown
(self)
tests/test_storage.py:22
Methodtest_access_list_is_admin_only_and_revoke_is_protected
(self)
tests/test_storage.py:318
Methodtest_access_request_and_admin_review_flow
(self)
tests/test_storage.py:261
Methodtest_access_request_lifecycle
(self)
tests/test_storage.py:61
Methodtest_access_request_setting_defaults_to_enabled
(self)
tests/test_storage.py:123
Methodtest_access_request_switch_is_admin_only
(self)
tests/test_storage.py:340
Methodtest_approved_list_only_returns_users
(self)
tests/test_storage.py:98
Methodtest_existing_pending_request_still_reports_when_switch_is_closed
(self)
tests/test_storage.py:367
Methodtest_generic_error_uses_default_message
(self)
tests/test_gemini_errors.py:30
Methodtest_group_access_is_checked_by_user_id
(self)
tests/test_storage.py:300
Methodtest_model_history_trim_and_clear
(self)
tests/test_storage.py:25
Methodtest_quota_error_is_sanitized
(self)
tests/test_gemini_errors.py:13
Methodtest_rejected_user_is_not_resubmitted
(self)
tests/test_storage.py:288
Methodtest_restore_switch_clear_and_image_summary
(self)
tests/test_storage.py:227