Skip to content

feat: insight cog #423

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

Merged
merged 5 commits into from
Oct 11, 2023
Merged

feat: insight cog #423

merged 5 commits into from
Oct 11, 2023

Conversation

HadesArmy
Copy link
Contributor

Summary

close #95

Checklist

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

  • Have you tested the changes? (pytest & dpytest)
  • Have you followed PEP-8 for naming and styling?
  • Has your code been properly documented with RestructuredText docstrings?
  • Have you added your changes to CHANGELOG.md under the [Unreleased] heading?
  • If your code added new bot commands, have you updated documentation.json?

  • All of this code is your own, or follows the author repo's licence.

@HadesArmy HadesArmy requested review from JayDwee and abluey October 9, 2023 20:29
@HadesArmy HadesArmy self-assigned this Oct 9, 2023
@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Merging #423 (d705df6) into master (7ef2898) will increase coverage by 0.14%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #423      +/-   ##
==========================================
+ Coverage   87.35%   87.49%   +0.14%     
==========================================
  Files         125      130       +5     
  Lines        9110     9214     +104     
==========================================
+ Hits         7958     8062     +104     
  Misses       1152     1152              
Flag Coverage Δ
unittests 87.49% <100.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
koala/cogs/__init__.py 100.00% <100.00%> (ø)
koala/cogs/insights/__init__.py 100.00% <100.00%> (ø)
koala/cogs/insights/cog.py 100.00% <100.00%> (ø)
koala/cogs/insights/core.py 100.00% <100.00%> (ø)
koala/cogs/insights/log.py 100.00% <100.00%> (ø)
koalabot.py 74.13% <100.00%> (ø)
tests/cogs/insights/test_cog.py 100.00% <100.00%> (ø)

Copy link
Member

@JayDwee JayDwee left a comment

Choose a reason for hiding this comment

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

Almost there, main thing is to use core.py purely to try to conform to the new approach we are taking to file structure

@HadesArmy HadesArmy requested a review from JayDwee October 10, 2023 18:16
Copy link
Member

@JayDwee JayDwee left a comment

Choose a reason for hiding this comment

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

sorreee little more to change, last thing I promise

partial_message += f", {guild}"
messages.append(partial_message)
else:
return [f"No servers found containing the string \"{filter_string}\"."]
Copy link
Member

Choose a reason for hiding this comment

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

This can just return empty list, and have cog.py deal with sending this message if result = []

"""

for message in get_servers(self.bot, filter_string):
await ctx.send(message)
Copy link
Member

Choose a reason for hiding this comment

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

We should not use ctx.send this many times for one request as we could hit the ratelimit. We should instead group up to 2k characters into one message using \n then if more than 2k characters move to new message

@HadesArmy HadesArmy requested a review from JayDwee October 11, 2023 14:42
Copy link
Member

@JayDwee JayDwee left a comment

Choose a reason for hiding this comment

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

Lgtm

@JayDwee JayDwee merged commit d671c6f into master Oct 11, 2023
@JayDwee JayDwee deleted the feature/insights branch October 16, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Insights
2 participants