-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Updated & Optimized #70
base: devel
Are you sure you want to change the base?
Conversation
@@ -46,9 +46,6 @@ def error_handler(e): | |||
logger.info("Sleeping for five minutes.") | |||
time.sleep(5 * 60) | |||
|
|||
# for other types of issues with specific behaviour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a specific reason to delete this comment?
@@ -56,7 +56,7 @@ def tweet_banner(message): | |||
This is a standard tweet to spread info about the bot. | |||
""" | |||
tweet = str(datetime.datetime.now()) + "\n" | |||
tweet += "This is a bot at the service of @" + globals.user + ".\n" | |||
tweet += f"This is a bot at the service of @{globals.user}" + ".\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the final ".\n"
is not included in the string
_ = open(directory + "/" + filename, "w+") | ||
if not os.path.exists(f"{directory}/{filename}"): | ||
_ = open(f"{directory}/{filename}", "w+") | ||
elif answer := ask_confirmation(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of assigning answer
here?
if thread.getName() == "bot" and not thread.is_alive(): | ||
return "error", 500 | ||
return "ok" | ||
return next( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm not understanding this return statement...
for i in range(0, len(values)): | ||
result += values[i][2] | ||
return str(result) | ||
result = sum(values[i][2] for i in range(0, len(values))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not a direct return ...
?
else: | ||
result = values[0][3] | ||
return str(result) | ||
result = values[0][3] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not a direct return ...
?
@@ -39,11 +39,11 @@ def check_stat(username): | |||
logger = logging.getLogger("matplotlib") | |||
logger.setLevel(logging.CRITICAL) | |||
logger = logging.getLogger("__main__") | |||
dates = [] # contains all the dates stored in the database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of deleting the comment?
No description provided.