Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb6a2208

Browse files
authored
Add a Privacy Policy (#141)
1 parent469a644 commitb6a2208

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

‎components/callbacks.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
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
raiseApplicationHandlerStop
582+
583+
584+
asyncdefprivacy(update:Update,_:ContextTypes.DEFAULT_TYPE)->None:
585+
"""Reply with the privacy policy"""
586+
message=cast(Message,update.effective_message)
587+
awaitmessage.reply_text(
588+
f"Please read my privacy policy in <a href={PRIVACY_POLICY}>here</a>."
589+
)

‎components/const.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,19 @@
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+
"""

‎components/util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def build_command_list(
149149
returnbase_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."),

‎rules_bot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
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,
@@ -47,11 +48,13 @@
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
)
5659
fromcomponents.errorhandlerimporterror_handler
5760
fromcomponents.joinrequestsimportjoin_request_buttons,join_request_callback
@@ -78,6 +81,9 @@ async def post_init(application: Application) -> None:
7881
bot=application.bot
7982
awaitcast(Search,application.bot_data["search"]).initialize(application)
8083

84+
awaitbot.set_my_short_description(SHORT_DESCRIPTION)
85+
awaitbot.set_my_description(DESCRIPTION)
86+
8187
# set commands
8288
awaitbot.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(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp