File tree Expand file tree Collapse file tree 4 files changed +33
-0
lines changed
Expand file tree Collapse file tree 4 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 3535 ONTOPIC_CHAT_ID ,
3636 ONTOPIC_RULES ,
3737 ONTOPIC_USERNAME ,
38+ PRIVACY_POLICY ,
3839 TOKEN_TEXT ,
3940 VEGETABLES ,
4041)
@@ -578,3 +579,11 @@ async def job_callback(_: ContextTypes.DEFAULT_TYPE) -> None:
578579
579580 # We don't want this message to be processed any further
580581 raise ApplicationHandlerStop
582+
583+
584+ async def privacy (update : Update , _ : ContextTypes .DEFAULT_TYPE ) -> None :
585+ """Reply with the privacy policy"""
586+ message = cast (Message , update .effective_message )
587+ await message .reply_text (
588+ f"Please read my privacy policy in <a href={ PRIVACY_POLICY } >here</a>."
589+ )
Original file line number Diff line number Diff line change 255255 """ ,
256256 flags = re .VERBOSE ,
257257)
258+
259+ PRIVACY_POLICY = "https://github.com/python-telegram-bot/rules-bot/wiki/Privacy-Policy"
260+
261+ SHORT_DESCRIPTION = (
262+ "Helper bot of the python-telegram-bot groups | Help and source at "
263+ "https://github.com/python-telegram-bot/rules-bot"
264+ )
265+ DESCRIPTION = f"""
266+ Helper bot of the https://python-telegram-bot.org community groups:
267+ { ONTOPIC_CHAT_ID } and { OFFTOPIC_CHAT_ID } .
268+
269+ The privacy policy of this bot can be found at { PRIVACY_POLICY } .
270+
271+ Usage instructions and source code can be found at
272+ https://github.com/python-telegram-bot/rules-bot.
273+ """
Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ def build_command_list(
149149 return base_commands + hint_commands
150150
151151 base_commands += [
152+ ("privacy" , "Show the privacy policy of this bot" ),
152153 ("rules" , "Show the rules for this group." ),
153154 ("buy" , "Tell people to not do job offers." ),
154155 ("token" , "Warn people if they share a token." ),
Original file line number Diff line number Diff line change 3333 leave_chat ,
3434 long_code_handling ,
3535 off_on_topic ,
36+ privacy ,
3637 raise_app_handler_stop ,
3738 regex_token_warning ,
3839 reply_search ,
4748 ALLOWED_CHAT_IDS ,
4849 ALLOWED_USERNAMES ,
4950 COMPAT_ERRORS ,
51+ DESCRIPTION ,
5052 ERROR_CHANNEL_CHAT_ID ,
5153 OFFTOPIC_CHAT_ID ,
5254 OFFTOPIC_USERNAME ,
5355 ONTOPIC_CHAT_ID ,
5456 ONTOPIC_USERNAME ,
57+ SHORT_DESCRIPTION ,
5558)
5659from components .errorhandler import error_handler
5760from components .joinrequests import join_request_buttons , join_request_callback
@@ -78,6 +81,9 @@ async def post_init(application: Application) -> None:
7881 bot = application .bot
7982 await cast (Search , application .bot_data ["search" ]).initialize (application )
8083
84+ await bot .set_my_short_description (SHORT_DESCRIPTION )
85+ await bot .set_my_description (DESCRIPTION )
86+
8187 # set commands
8288 await bot .set_my_commands (
8389 build_command_list (private = True ),
@@ -160,6 +166,7 @@ def main() -> None:
160166 application .add_handler (CommandHandler ("start" , start ))
161167 application .add_handler (CommandHandler ("rules" , rules ))
162168 application .add_handler (CommandHandler ("buy" , buy ))
169+ application .add_handler (CommandHandler ("privacy" , privacy ))
163170
164171 # Stuff that runs on every message with regex
165172 application .add_handler (
You can’t perform that action at this time.
0 commit comments