Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Open search functionality to everyone
Browse files Browse the repository at this point in the history
  • Loading branch information
Nukesor committed Jul 30, 2020
1 parent acb0cd0 commit aaff0b8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
11 changes: 11 additions & 0 deletions i18n/English.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ text:
"3000": "3000 Stickers.... \n You should really stop."

misc:
private_access: |
*Hello there! 😊*
Sadly, this instance of StickerFinder is private and you aren't authorized to interact with it. 😓
⭐️ You may still use it's *search functionality* ⭐️\
Just start by typing `@%{username}`.
However, this project is open-source!
Check out the [Github repository](https://github.com/nukesor/sticker-finder) for the code and latest database dump in case you want to host your own bot.
error: |
An unknown error occurred. I probably just got a notification about this and I'll try to fix it as quickly as possible.
In case this error still occurs in a day or two, please report the bug to me :). The link to the Github repository is in the /help text.
Expand Down
10 changes: 7 additions & 3 deletions stickerfinder/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,13 @@ def wrapper(update, context):

user = get_user(session, update)
if config["mode"]["authorized_only"] and not user.authorized:
text = "StickerFinder is officially offline. Access will still be granted for [Patreons](https://www.patreon.com/nukesor).\n"
text += "Check the repository for the latest database dump in case you want to host your own bot."
message.chat.send_message(text, parse_mode="Markdown")
text = i18n.t(
"text.misc.private_access",
username=config["telegram"]["bot_name"],
)
message.chat.send_message(
text, parse_mode="Markdown", disable_web_page_preview=True,
)
session.commit()
return
if not is_allowed(user, update, admin_only=admin_only):
Expand Down

0 comments on commit aaff0b8

Please # to comment.