8000 fix duplicate bot name in status update message by flapjax · Pull Request #458 · aeon0/botty · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.

fix duplicate bot name in status update message #458

Merged
merged 2 commits into from
Jan 24, 2022
Merged

fix duplicate bot name in status update message #458

merged 2 commits into from
Jan 24, 2022

Conversation

flapjax
Copy link
Contributor
@flapjax flapjax commented Jan 18, 2022

When the generic_api is in use, the bot name appears twice at the start of each status update message, because the bot name is added at the start by both the GameStats _send_status_update method and the GenericApi _send method.

example of bug:
example

This commit changes the behavior of the _send_status_update method. If the generic_api is in use, it will avoid adding the bot name to the start of the message.

This commit changes the behavior of the _send_status_update method. If the generic_api is in use, it will avoid adding the bot name to the start of the message because the bot name is already added by the generic api.
if self._config.general["message_api_type"] == "generic_api":
msg = f"Status Report\n{self._create_msg()}\nVersion: {__version__}"
else:
msg = f"{self._config.general['name']}: Status Report\n{self._create_msg()}\nVersion: {__version__}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather remove the name here and add it to the DiscordEmbeds class instead of this if clause

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no prob, will do.

This commit moves the fix to the DiscordEmbeds class instead of performing it with an if statement in the GameStats class.
@flapjax
Copy link
Contributor Author
flapjax commented Jan 23, 2022

Made the changes and re-tested both api modes today. Good to go from my end.

@aeon0 aeon0 merged commit 724e573 into aeon0:master Jan 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0