Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor unnecessary else / elif when if block has a return statement #92

Open
wants to merge 1 commit into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mareabot/api/actv.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
def get_actv(hight: int) -> (str, int):
if hight >= 140:
return H140, 140
elif hight >= 130:
if hight >= 130:
return H130, 130
elif hight >= 120:
if hight >= 120:
return H120, 120
elif hight >= 95:
if hight >= 95:
return H95, 95
return "", 0
6 changes: 2 additions & 4 deletions mareabot/social/telegram_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ def telegram_send(text: str, user: str) -> Tuple[int, bool]:
logger.info(r.json())
if r.json()["ok"]:
return r.json()["result"]["message_id"], True
else:
return None, False
return None, False


def telegram_channel_send(text: str) -> Tuple[int, bool]:
Expand All @@ -34,5 +33,4 @@ def telegram_channel_delete_message(message_id: int, chat: str = CHANNEL) -> boo
logger.info(r.json())
if r.json()["ok"]:
return True
else:
return False
return False