Discord Name: Nestor10#7163
GitHub Repository (Must be V3): https://gitlab.com/CrunchBangDev/cbd-cogs
Description: A few modest cogs that I couldn’t find anywhere so I wrote myself
Discord Name: Nestor10#7163
GitHub Repository (Must be V3): https://gitlab.com/CrunchBangDev/cbd-cogs
Description: A few modest cogs that I couldn’t find anywhere so I wrote myself
Hi Nestor10, thank you for your patience while I review your repo. I have three small issues to be addressed and everything else is optional or things to look at and consider.
Commit hash at time of review - b07b0deaa0a31ad8b499890c8cbb478c8837acfc
[p]help Bio
to see all the cogs commands.Fun tip you can concatenate strings in python automatically if they’re inside brackets like so:
>>>my_string = (
"This is line 1 "
"and this is line 2."
)
>>>my_string
>>>This is line 1 and this is line 2.
This also works inside function brackets.
async def add_field(self, ctx: commands.Context, *, argFields: str)
will take everything after the base command as a single string eliminating the need to join each item in the tuple. (Optional)LINK_PATTERN = re.compile(r"https?://(\S+)")
at the beginning of the cog and then when you want to search on a message do LINK_PATTERN.findall(message.content)
. This is a good habit to get into as now the cog isn’t trying to compile the regex pattern on every single message it sees causing unnecessary overhead. This can be applied to any regex pattern you plan on utilizing a lot. (Optional)__init__
timeout
is defined but never used. (Optional)[p]help setinterval
It would be very useful for people to be able to see what exactly that command does even if you don’t intend for people to use it you can state so in the help description.Hey Trusty, thanks so much for taking the time to review my code and write such thoughtful feedback! I believe you will find that commit a2243a1efde30f6160d89e8190e31fd1a5c8be89 addresses each of the action items (plus some other docstring updates because I’m a bad git user).
Thanks for making the changes, marking this as approved.