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

Split Long Responses in Two and Improve Logging #35

Merged
merged 1 commit into from
Feb 3, 2024
Merged

Conversation

rlywtf
Copy link

@rlywtf rlywtf commented Feb 2, 2024

This fixes #42 by splitting any response that is long into two messages from a newline closest to the middle.

While here I've improved the logging capabilities.

Flake8's line length test is set to 99 overriding the default and I also bumped the complexity limit from 10 to 20.

The on_message function has been broken up to avoid the Flake8 complexity failures. We now have one function for DMs and another for channel messages.

The discordian.sh script's redundant background mode was removed.

@rlywtf rlywtf force-pushed the response_splitting branch from 7c82aed to 38b961d Compare February 2, 2024 23:31
@rlywtf rlywtf force-pushed the response_splitting branch 13 times, most recently from 8e6e927 to 552b246 Compare February 3, 2024 01:41
This fixes https://github.com/rlywtf/DiscordianAI/issues/14 by
splitting any response that is long into two messages from a
newline closest to the middle.

While here I've improved the logging capabilities.

`Flake8`'s line length test is set to 99 overriding the default
and I also bumped the complexity limit from 10 to 20.

The `on_message` function has been broken up to avoid the Flake8
complexity failures. We now have one function for DMs and another
for channel messages.

The `discordian.sh` script's redundant background mode was removed.
@rlywtf rlywtf force-pushed the response_splitting branch from 552b246 to c61eb44 Compare February 3, 2024 01:45
@rlywtf rlywtf merged commit ada6b3b into main Feb 3, 2024
3 checks passed
@rlywtf rlywtf deleted the response_splitting branch February 3, 2024 01:49
@@ -33,7 +33,7 @@ jobs:
# stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --max-complexity=10 --statistics
flake8 . --count --max-complexity=20 --statistics --max-line-length=99
Copy link

Choose a reason for hiding this comment

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

Use black instead

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the suggestion @bart-of I will def. check it out! 🥳

johndotpub added a commit that referenced this pull request Feb 19, 2024
Split Long Responses in Two and Improve Logging
@johndotpub johndotpub added this to the v0.1.5 milestone Feb 19, 2024
@johndotpub johndotpub added bug Something isn't working enhancement New feature or request labels Feb 19, 2024
@johndotpub johndotpub self-assigned this Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discord Messages over 2000 Charaters Fail
4 participants