Skip to content

Commit

Permalink
ENH: Add /users to /help response
Browse files Browse the repository at this point in the history
VER: 1.3.1
  • Loading branch information
toddrob99 committed Oct 26, 2020
1 parent 044d1b9 commit 92ae272
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions searcharr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import sonarr
import settings

__version__ = "1.3.0"
__version__ = "1.3.1"

DBPATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data")
DBFILE = "searcharr.db"
Expand Down Expand Up @@ -692,23 +692,25 @@ def handle_error(self, update, context):

def cmd_help(self, update, context):
logger.debug(f"Received help cmd from [{update.message.from_user.username}]")
if not self._authenticated(update.message.from_user.id):
auth_level = self._authenticated(update.message.from_user.id)
if not auth_level:
update.message.reply_text(
"Please authenticate with `/start <password>` and then try again."
)
return
if settings.sonarr_enabled and settings.radarr_enabled:
update.message.reply_text(
"Use /movie <title> to add a movie to Radarr, and /series <title> to add a series to Sonarr."
)
resp = "Use /movie <title> to add a movie to Radarr, and /series <title> to add a series to Sonarr."
elif settings.sonarr_enabled:
update.message.reply_text("Use /series <title> to add a series to Sonarr.")
resp = "Use /series <title> to add a series to Sonarr."
elif settings.radarr_enabled:
update.message.reply_text("Use /movie <title> to add a movie to Radarr.")
resp = "Use /movie <title> to add a movie to Radarr."
else:
update.message.reply_text(
"Sorry, but all of my features are currently disabled."
)
resp = "Sorry, but all of my features are currently disabled."

if auth_level == 2:
resp += " Since you are an admin, you can also use /users to manage users."

update.message.reply_text(resp)

def _strip_entities(self, message):
text = message.text
Expand Down

0 comments on commit 92ae272

Please sign in to comment.