Build 20200220.2 failed
Requested by
GitHub
Duration
00:00:51
Build pipeline
Bot
1 messages ยท Page 41 of 1
Build 20200220.2 failed
GitHub
00:00:51
Bot
Build 20200220.3 succeeded
GitHub
00:01:39
Bot
Yeah, I was referring to docker-compose. This is more for people who want to run snekbox themselves; the only source of information on how to handle the network (assuming they aren't too familiar with Docker) is the docker-compose file, which has network mode set to host.
Maybe this should be closed and added in https://github.com/python-discord/snekbox/issues/57, since that's about how people who want to run snekbox themselves can do so.
Oops, sorry, snekbox-base was a typo, should've been just snekbox.
Once snekbox is up and running, I agree, there are plenty of instructions on how to communicate with it. This is more about how to get the docker container running. This might be more of an issue for docker hub, but I'm not sure if that has an issue system :man_shrugging:
I'm not sure why you say you can't just boot it up; isn't that what the snippet I provided does?
Build 20200220.4 succeeded
Joseph Banks
00:03:21
Bot
Add the sentry logo to our sponsors section.
Build 20200220.1 succeeded
GitHub
00:01:41
Site
Build 20200220.3 succeeded
GitHub
00:02:09
Site
330571e Add sentry_sdk dependency - jos-b
daf85f4 Add sentry SDK init to settings.py - jos-b
This PR enables the DjangoIntegration of the Sentry SDK.
Build 20200221.1 failed
GitHub
00:01:15
Site
Build 20200221.1 failed
GitHub
00:01:19
Site
Build 20200221.2 succeeded
Joseph Banks
00:01:37
Site
Build 20200221.1 failed
GitHub
00:01:26
Site
Build 20200221.3 succeeded
GitHub
00:01:45
Site
Drawing a straight horizontal line along the bottom of the text, it becomes evident the Adafruit logo is too low. But it's close enough.
Build 20200221.4 succeeded
GitHub
00:03:33
Site
Build 20200221.5 succeeded
GitHub
00:01:46
Site
330571e Add sentry_sdk dependency - jos-b
a103f7c Add sentry SDK init to settings.py - jos-b
bdf7add Merge branch 'master' into add-sentry-sdk - jos-b
0cdb0b6 Merge pull request #333 from python-discord/add... - jos-b
Build 20200221.6 succeeded
Joseph Banks
00:03:38
Site
Implement the Sentry SDK to the bot.
This PR will also setup basic tags to link errors together.
Build 20200221.1 failed
GitHub
00:01:26
Bot
This PR has also had to remove the API logging handler (on our plan anyway) since it was blocking sentry from making it's API calls.
Build 20200221.2 failed
GitHub
00:00:49
Bot
No reason in particular I can think of, but @scragly is the one responsible for that change (it used to map ports back when it still used RMQ and Flask).
This is a valid concern; I agree it should be added. One shouldn't have to resort to the development guide if one is not interested in contributing. The current steps involve cloning the repo and building the Docker images, but that's complicated relative to what you've shown.
Postgres backup completed!
Build 20200221.3 failed
GitHub
00:01:14
Bot
Build 20200221.4 failed
GitHub
00:00:57
Bot
Build 20200221.5 failed
GitHub
00:01:28
Bot
Lemon doing a thoubs up , or Pat Pat
Build 20200221.6 failed
GitHub
00:01:34
Bot
Build 20200221.7 succeeded
GitHub
00:01:29
Bot
Apologies for the delay, and thanks for the assistance @sco1. All changes have been made and checks have been fixed. This should be ready for another review ๐
Build 20200221.8 succeeded
GitHub
00:01:37
Bot
This seems to work well! I guess the real test will come once we put this in production.
Is this going to complain about not being created inside an async function?
It won't but I have just realised this is intended for aiohttp servers, not clients.
5c08198 Remove AIOHTTP integration from Sentry since it... - jos-b
Is this still going to be logged to stdout? (by the way, in #757 I changed this to use exec_info instead of raising)
Build 20200221.9 succeeded
GitHub
00:01:26
Bot
log.error should go to stdout shouldn't it?
Well yes but the point is that you've completely removed these lines.
Will use exc_info though, I like that
Oh wait, I didn't understand this right, I removed the log.error, adding back.
Since you're still doing capture_exception, will Sentry not end up with duplicate entries for this exception?
Yeah, I've removed the capture_exception and added log.error:
<img width="973" alt="image" src="https://user-images.githubusercontent.com/20439493/75058001-19be7900-54d2-11ea-9134-41c35ffae1a2.png">
<img width="857" alt="image" src="https://user-images.githubusercontent.com/20439493/75058053-35c21a80-54d2-11ea-81c7-b1839ce62f9e.png">
It still gets those extra tags set?
Yeah, because I run the log command from inside a scope I've created
ad4f53c Use log.error instead of capture_exception - jos-b
@SebastiaanZ Thanks. Any thoughts on the concerns (most importantly, โ 5)?
Build 20200221.11 succeeded
GitHub
00:01:28
Bot
There are still some unresolved comments form previous reviews.
This doesn't need to be broken up into multiple lines.
Build 20200221.12 succeeded
GitHub
00:01:40
Bot
@SebastiaanZ Thanks. Any thoughts on the concerns (most importantly, โ 5)?
I'm honestly not quite sure. It currently pretty much locks all features that rely on the new signal, but it really should be a freak occurrence that will probably only be solved by restarting the bot (or manually triggering that method with an internal eval to recheck the state). We could add something that tries to send an alert to the guild using a method that not relies on the cache (e.g., fetching a webhook f...
Yeah, from List[Tuple] (command_name, aliases...) into a list of command names and aliases
Wouldn't this single loop be equivalent to the two list comprehensions?
raw_commands = []
for cmd in self.bot.walk_commands():
if not cmd.hidden:
raw_commands += (cmd.name, *cmd.aliases)
Need to return after this otherwise the embed still gets sent.
Tested, everything seems to work. I'm not familiar enough with the sentry_sdk to think deeply about the actual integration, though.
Is this ready to be merged @jos-b? Is the environment variable set in prod?
@SebastiaanZ It's something which we can adapt as we find a workflow which suits us well. Right now just storing errors somewhere is useful and we'll find out if we need anything else as time goes on.
@MarkKoz the variable is in prod ๐
We could add something that tries to send an alert to the guild using a method that not relies on the cache (e.g., fetching a webhook from the API directly and using that),
If you think that's helpful then sure, that could be implemented.
Build 20200221.13 succeeded
GitHub
00:03:04
Bot
Connected!
Sentry Issue: BOT-11
It currently uses log.exception() for all exceptions. Forbidden should probably be a special case and use a lower log level.
try:
await ctx.author.send(WELCOME_MESSAGE)
except Exception:
# Catch the exception, in case they have DMs off or something
log.exception(f"Unable to send welcome message to user {ctx.author...
Sentry Issue: BOT-10
AttributeError: 'NoneType' object has no attribute 'mention'
File "bot/cogs/reminders.py", line 53, in reschedule_reminders
await self.send_reminder(reminder, late)
File "bot/cogs/reminders.py", line 121, in send_reminder
content=user.mention,
Task exception was never retrieved
future: <Task finished coro= exception=AttributeError("'NoneType' object has no at...
Build 20200221.14 succeeded
GitHub
00:01:32
Bot
Build 20200221.15 succeeded
GitHub
00:01:51
Bot
Build 20200221.16 succeeded
GitHub
00:03:13
Bot
Connected!
Yeah, I probably just never changed it from my own janky dev setup at the time. It can be set back to specific ports.
cb4ebe8 Use port mapping, change container name to snekbox - scragly
Closes #58
The provided compose currently runs in host mode, which is unnecessary. This adjusts it back to only expose the required port.
The service name has been changed to "snekbox" instead also, as we're moving away from using the pd prefix on our services. It also doesn't make too much sense to have such a prefix and shortened name if we're to accommodate public usage.
The hostname field has been removed, and container_name field added. By default, the hostname will be set to...
Closes #58
The provided compose currently runs in host mode, which is unnecessary. This adjusts it back to only expose the required port.
The service name has been changed to "snekbox" instead also, as we're moving away from using the pd prefix on our services. It also doesn't make too much sense to have such a prefix and shortened name if we're to accommodate public usage.
The hostname field has been removed, and container_name field added. By default, the hostname will be set to...
Build 20200221.1 failed
GitHub
00:03:10
Snekbox
Build 20200221.2 failed
GitHub
00:03:14
Snekbox
The devsh script is failing to execute Python via NsJail. I was running into this issue locally too. Guess it really is a big problem...
It seems to be related to what is being mounted in the jail. If root is mounted (and other mounts are removed), then it is successfully launched.
Here's the error with verbose logging:
[D][2020-02-21T22:26:45+0000][73] std::unique_ptr nsjail::getTC(int)():179 Saved the current state of the TTY
[I][2020-02-21T22:26:45+0000] Mode: STANDALONE_ONCE
[I][2020-02-21T22:26:45+0000] Jail parameters: hostname:'snekbox', chroot:'', process:'/snekbox/.venv/bin/python3', bind:[::]:0, max_conn...
Build 20200221.17 succeeded
Joseph Banks
00:03:11
Bot
Connected!
Fix seems to be to mount all of /usr. But why? I'd rather mount as little as I can get away with.
@scragly said the tests run successfully for him locally, yet they fail for me locally and in CI.
Actually, mounting /usr/lib along with /usr/local seems to be adequate. Let's see if this can be narrowed down further...
Yeah OK this seems a bit obvious in hindsight. /snekbox/local/bin/python is a symlink to /usr/local/bin/python.
Connected!
Build 20200221.18 succeeded
Joseph Banks
00:03:11
Bot
f622e84 CI: install Pipfile into system interpreter - MarkKoz
A virtual environment is redundant in the context of deployment. It just increases the size and build time of the image.
Build 20200222.1 succeeded
GitHub
00:03:15
Snekbox
Should be changed here too:
(Yes I don't like that this is in 3 places either)
Appears to work without issue.
Build 20200222.3 succeeded
GitHub
00:03:18
Snekbox
Postgres backup completed!
Build 20200222.4 failed
GitHub
00:00:00
Snekbox
Build 20200222.5 succeeded
GitHub
00:02:56
Snekbox
Currently, it is possible for someone to write a command that shadows an existing alias. Discord will not crash, it will simply short circuit and make the other alias unavailable.
It ought to be possible to add an automated check for this in the form of a unit test. This test might make use of ast (which has a means of checking decorator arguments) and then iterate over all cogs to determine if there are any alias duplicates.
@tehybel I'm giving it a spin now, and running into a strange bug with some of the free content. Any idea why this perfectly valid 3.6 feature is being interpreted as a SyntaxError?

@tehybel here's another interesting thing that should've worked in 3.7:

meanwhile, this feature works and it's 3.7 only:

Looks like you're running some sort of pseudo-3.7
It doesn't even support f-strings, which are sort of the keystone python 3 feature that everyone loves -

@tehybel
Overall, I think this project shows promise and there are definitely good parts, but I don't think we can recommend this in our resources list until it supports (and teaches) modern Python 3 features, like f-strings, type annotations and asyncio.
Feel free to let us know if you add support for these things, and we'll be glad to reconsider it.
We're currently filtering malicious filetypes in our filetype filter - to be specific, we're filtering all filetypes we haven't specifically whitelisted. This does not, however, apply to URLs. That means it's easy enough to get around our filter by posting the file in a DM or on a different server, and then just linking the content instead.
This also allows users to post URLs that literally point at viruses, which isn't something we should permit.
Let's write a second filter that uses t...
Currently, we have certain channels whitelisted for certain filters and some filters apply to all members, even Owners cannot post filetypes that aren't on the whitelist!
Please change this so that absolutely all filters will ignore all staff members. It is not necessary to whitelist staff channels or to keep any other kind of exceptions to the filters once this very simple exception has been added, so please clean up any such exceptions while you're at it.
If msg['delete_date'] contains a datetime string with a timezone (like the ones returned by the API), then we should make sure to strip the tzinfo here like we do in L418.
Currently, we're getting this each time we try to delete a rescheduled message:
Traceback (most recent call last):
File "/home/sebastiaan/pydis/repositories/bot/bot/cogs/filtering.py", line 405, in _scheduled_task
await wait_until(delete_at)
File "/home/sebastiaan/pydis/repositories/bot/bot/utils/t...
What kind of errors would cause this?
Currently, this error handling means that we would not remove the actual message, but do remove the entry from the database down below. So, the offensive message remains and will never be deleted. If these type of errors are mainly triggered by things like temporary disruptions at Discord's end, then it could be a good idea to keep the rows in the database and attempt removal at a later point in time.
However, that strategy would mean that completel...
@lemonsaurus Thank you for taking the time to tell me about all this, it really is appreciated. There is definitely a bug causing most of these issues; I think the module that parses the syntax tree of user input to provide helpful feedback needs an update. I'll look into it.
I don't believe that type annotation and asyncio are in scope for this course, since it is for complete beginners. Expanding the course contents to cover more advanced concepts isn't a priority at this time.
Either...
@tehybel
I suppose asyncio might fall outside the scope of a beginners course, but I think a precursory glance at how type annotations look and work would fit well in a beginners course. it is, after all, syntax. it's not very difficult, and I don't think a beginners course should leave its takers confused about basic syntax when they encounter it.
This still needs to be addressed.
I changed the implementation to return false, I will check what is wrong.
I think you are confused about what this comment refers to. It's specifically regarding an embed being sent with the message "**There are no tags in the database!**", which I'm suggesting should not be sent at all if called from the error handler (i.e. merely returning False will not be adequate).
Oh ok, but we also need to return false at the end of the function, correct?
Don't think it matters since that line will never be reached (every branch of execution already has a return statement), but I suppose no harm in keeping it.
1f17d0e Add unit test case for burst antispam rule - kwzrd
b0713be Add unit test case for burst shared antispam rule - kwzrd
f15f318 Add unit test case for chars antispam rule - kwzrd
4bfe30d Add unit test case for discord emojis antispam ... - kwzrd
f32ffaf Add unit test case for role mentions antispam rule - kwzrd
Build 20200222.1 succeeded
GitHub
00:01:38
Bot
Sentry Issue: BOT-19
tried to get the 'ask' tag, but the tag is on cooldown. Cooldown ends in 2.8 seconds.
Like I said,
merely returning False will not be adequate
The embed should not be sent when this function is called by the error handler. I've proposed the solution of adding a parameter to indicate that.
This should still return True otherwise the bot will send a command suggestion after the tag suggestions, which is not desirable.
Yeah, I will add a parameter in that case
I don't know how you merged but you did something wrong cause all the commits are co-authored by you and that should absolutely not happen. Do you know how to fix this? If not, I can attempt a fix myself.
I don't know how you merged but you did something wrong cause all the commits are co-authored by you and that should absolutely not happen. Do you know how to fix this? If not, I can attempt a fix myself.
I think it'll be better if you try, I just meged master into my branch, weird
Okay. Please don't push anything until I let you know I've fixed it.
Both Current tags and There are no tags in the database! embeds shouldn't be sent if the error handler invoked the function, correct?
1f17d0e Add unit test case for burst antispam rule - kwzrd
b0713be Add unit test case for burst shared antispam rule - kwzrd
f15f318 Add unit test case for chars antispam rule - kwzrd
4bfe30d Add unit test case for discord emojis antispam ... - kwzrd
f32ffaf Add unit test case for role mentions antispam rule - kwzrd
OK should be good to go. By the way, there was a lint error - contextlib was imported but unused. I fixed it. Do you not have the pre-commit hook installed?
Build 20200222.2 succeeded
GitHub
00:01:41
Bot
OK should be good to go. By the way, there was a lint error -
contextlibwas imported but unused. I fixed it. Do you not have the pre-commit hook installed?
Yeah I fixed it already, maybe the merge / pull changed it, thanks for fixing it
Sorry, never mind. I just realised those only get sent if tag_name is None. The error handler never sends None as the name so nothing needs to be changed.
if not tags_cog or not tags_get_command:
It would be nice to have a channel tracking some of the official python mailing lists, such as python-dev@python.org.
A background task will make the bot fetch from an email API to check if a new email from one of the tracked mailing list have been received, if any email is found, it will post them as an embed to a specific channel inside the server. Some additional content can be put in the embed, such as some informations about the sender, or a jump link t...
Yeah, that makes sense, cool, releasing latest commits and i think we are there
Build 20200222.3 succeeded
GitHub
00:01:36
Bot
We can probably strip the loop parameter/argument from the APIClient in the future and use the higher-level interface of asyncio.create_task within the APIClient instead. Not really relevant for this PR, but my memory is not great, so I'm writing it down anyway.
I've looked over the PR and share some of your lack of confidence in what the best method for this should be, but the approach you've chosen looks robust to me. I've tested it and everything seems to work well. I think that's the best we can do for this at the moment.
It's a bit of dense block of code, but it works well. I think that we should extend our BadArgument handling in the future to include more specific information on what exactly is off instead of providing the end user with the entire help embed. There was some discussion about this in the #admins channel and I think @scragly has an approach for that lying around.
Maybe I just don't follow the flow of execution, but if you're afraid that a scheduled task is being cancelled because of its parent being cancelled, you could also use asyncio.shield to prevent it from being cancelled in such a situation.
The scheduler base class holds onto a Task for _scheduled_task(). Inside _scheduled_task(), the coroutine deactivate_infraction() is awaited. Inside this coroutine, the aforementioned task is cancelled.
So a child is effectively cancelling its parent before the child itself can finish. Hope that makes sense. Does shield work to prevent that situation? I'm no...
Describe the bug
In nested classes, methods which use self are flagged with ANN001 instead of ANN101. This causes problems when the user is attempting to ignore ANN101 but not ANN001 errors.
To Reproduce
Minimal code example to reproduce the behavior:
class Foo:
class Bar:
def __init__(self):
pass
def __init__(self):
pass
Results in:
test.py:3:22: ANN001 Missing type annotation for function argument 'sel...
Description
Add a new option like allowed-unannotated-argument-names which is a comma separated list of argument names that are fine to not have annotated.
Rationale/Use Case
Examples: often I need to ingest variables in my functions that I never use (callbacks from another library for example). In these cases, I often will just use _ as my variable.
Here is an example of a GTK callback:
def on_download_all_click(self, _: Any):
CacheManager.batch_downloa...
I am realising there is a side issue here when an infraction gets edited and re-scheduled in the middle of that same infraction being deactivated. Still, it's good that a deactivation doesn't get aborted half-way (could leave it in a poor state e.g. expired in the DB but the user still has the mute role).
Describe the bug
When an outer function returns None, but a function which is defined within it returns something that isn't None, the outer function is falsly marked with an ANN2** error.
To Reproduce
Minimal code example to reproduce the behavior:
def foo():
def bar() -> int:
return 1
print(bar())
foo()
Version Information
$ flake8 --version
3.7.9 (flake8-annotations: 2.0.0, flake8-comprehensions: 3.2.2, flake8-print: 3...
This isnโt a false positive, foo should be annotated here as it implicitly returns None.
Sorry, meant to mention that this happens even when suppress-none-returning = True
While a generalized case is not something weโre interested in pursuing, as string parsing introduces its own set of complexity, there could be a case here for a special-case flag for suppressing colloquial โdummyโ argument names.
Describe the bug
The ANN202 is reported in the incorrect column location when the last parameter has a type annotation.
To Reproduce
Minimal code example to reproduce the behavior:
def foo(bar: int):
return 1
def bar():
return 1
Results:
test.py:1:13: ANN201 Missing return type annotation for public function
test.py:5:11: ANN201 Missing return type annotation for public function
Expected: the first one should have a column number ...
If it helps, looking at this more, it appears like the error is always marked as being right after the first parameter. Example:
def row_score(key: str, row_items: Iterable[str]):
return max(map(lambda m: m[1], process.extract(key, row_items)))
the error shows up between the : and s.
Build 20200223.1 failed
GitHub
00:00:20
Snekbox
Build 20200223.2 succeeded
GitHub
00:01:12
Snekbox
Build 20200223.3 succeeded
GitHub
00:01:07
Snekbox
Build 20200223.4 failed
GitHub
00:00:12
Snekbox
Build 20200223.5 failed
GitHub
00:00:18
Snekbox
Build 20200223.6 failed
GitHub
00:00:14
Snekbox
Build 20200223.7 failed
GitHub
00:00:15
Snekbox
Build 20200223.8 failed
GitHub
00:00:16
Snekbox
Sentry Issue: BOT-1A
NotFound: 404 NOT FOUND (error code: 10008): Unknown Message
(3 additional frame(s) were not displayed)
...
File "bot/cogs/moderation/management.py", line 196, in search_user
await self.send_infraction_list(ctx, embed, infraction_list)
File "bot/cogs/moderation/management.py", line 236, in send_infraction_list
max_size=1000
File "bot/pagination.py", line 285...
For future reference, this is what it looks like on the website

Build 20200223.9 succeeded
GitHub
00:00:59
Snekbox
98057a2 CI: always check if the base image can be pulle... - MarkKoz
80985b1 CI: add more logging in check_dockerfiles.sh - MarkKoz
fde1bfc CI: update agent to Ubuntu 18.04 - MarkKoz
ddaf1c2 CI: move lint & tests job into templates - MarkKoz
034e9a0 CI: diff base against master only if venv changed - MarkKoz
Postgres backup completed!
Build 20200223.12 failed
GitHub
00:00:49
Snekbox
Closes #770
A paginator session will eventually timeout and clear it's reactions so it can stop listening to events to paginate to. Sometimes we delete these messages entirely, but the paginator session still is waiting for the timeout. When it finally come time for it to clear itself and stop listening to events, it gets instead a discord.NotFound exception as there's no longer a message to clear reactions from.
For now, this is a simple PR that addresse...
Build 20200223.1 succeeded
GitHub
00:01:41
Bot
Build 20200223.2 succeeded
GitHub
00:03:20
Bot
Connected!
a809754 Don't log exception traceback on Forbidden for ... - scragly
Closes #763.
Members have a welcome DM sent to them on accepting rules, which may raise a discord.Forbidden exception in the case they have DMs disabled in their privacy settings.
The current implementation catches a broad Exception and uses log.exception to allow the error to be logged fully with traceback as an exception without interrupting the code.
This is an unnecessary log since it's something by design, not an error, and the broad Exception catching is agai...
Build 20200223.3 succeeded
GitHub
00:01:27
Bot
cab9d3a Check reminder user and channel before send and... - scragly
0585a54 Remove call to delete reminder, as ensure metho... - scragly
Closes #764.
On bot load, the reminders are retrieved from the site api and rescheduled to be sent at their expiry datetime.
If someone creates a reminder, leaves the guild, and the reminder gets sent while they are no longer a member then the bot will raise an AttributeError due to user returning None and us not checking before attempting to get the user mention string.
This PR addresses this issue by checking that the user is present when going through reminder...
Build 20200223.4 succeeded
GitHub
00:01:26
Bot
1f17d0e Add unit test case for burst antispam rule - kwzrd
b0713be Add unit test case for burst shared antispam rule - kwzrd
f15f318 Add unit test case for chars antispam rule - kwzrd
4bfe30d Add unit test case for discord emojis antispam ... - kwzrd
f32ffaf Add unit test case for role mentions antispam rule - kwzrd
Build 20200223.6 succeeded
GitHub
00:01:26
Bot
Build 20200223.5 succeeded
GitHub
00:03:12
Bot
Connected!
62d198b Pagination migrations - Emoji Data Structure Mo... - F4zii
e8ad8bb Don't set project log level so it uses root level. - scragly
a809754 Don't log exception traceback on Forbidden for ... - scragly
43cda48 Merge pull request #772 from python-discord/dm_... - sco1
ada8568 Merge branch 'master' into optimize/pagination/... - sco1
Build 20200223.8 succeeded
GitHub
00:01:24
Bot
Build 20200223.7 succeeded
GitHub
00:03:10
Bot
Connected!
Build 20200223.9 succeeded
GitHub
00:03:06
Bot
Connected!
Build 20200223.10 succeeded
GitHub
00:01:31
Bot
debe73a No longer check if every role is @everyone; jus... - Deniz
7663315 Roles cannot return None because everyone has t... - Deniz
515b490 Remove some a lot of unneccesary newlines that ... - Deniz
5f799b6 Refactor how channels and statuses are counted;... - Deniz
79fb507 Update tests to reflect status changes - Deniz
Build 20200223.11 succeeded
GitHub
00:02:39
Bot
Connected!
I would like to propose that branding is cleaned up a little bit, and in particular the logos directory is re-organized to something easier to navigate for both humans and bots. I introduce two possible approaches for reducing the current complexity of showing Seasonalbots which icons to load.
As we've been adding more and more logos, banners and other branding features over the past months, it feels that branding has become a bit of a mess that is diffic...
This looks like something that can be closed.
Have we done Change the banner used in various invites on our partner servers and Change the icon used in the emoji on the server?
we haven't done the latter, but I can do it now.
It looks like https://paste.pydis.com uses a slightly different banner than the one in this issue.
I'm actually leaning towards approach 1 here, because it's simple and straight forward and I don't know how much of that flexibility we really need.
I would simplify the structure you suggested even further, since there's quite a few folders that are fairly superfluous. For example
โโโ branding/
โ โโโ seasonal/
โ โ โโโ christmas/
โ โ โ โโโ icons/
โ โ โ โ โโโ snowing.gif
โ โ โ โ โโโ bells.gif
โ โ โ โ โโโ santa.png
โ โ โ โโโ misc/
โ โ โ โ โโโ banner_2018.png
โ โ โ โ โโโ sant...
470adee Reduce log level of tag cooldown notice. - scragly
Well I know why this is happening but it's looking like the fix is going to be challenging.
While the return node visitor approach is an elegant one for most cases, it breaks for nested functions because it is visiting the return nodes without any knowledge of their containing function. In the code snippet above, for example, the return node ends up being visited twice, once for bar, as expected, and the other for foo, since the return node is in the body of the foo function node.
...
Closes #768.
When the tag command is used too often, it may hit cooldown. The log entry when this occurs is informative and by design rather than any potential concern, so should not be logged as a warning.
The log level has been reduced to info and the code style has been adjusted to conform to our typical project style, with a correctly dropped line continuation.
Build 20200223.12 succeeded
GitHub
00:01:41
Bot
We've decided to use this plugin in our linting toolchain, which allows us to test things like variable name casing (no camelCase please!) and whether classes and methods use cls and self.
Here are the errors it can catch:
| code | sample message |
|---|---|
| N801 | class names should use CapWords convention |
| N802 | function name should be lowercase |
| N803 | argument name should be lowercase |
| N804 | first argument of a classmethod should be named 'cls' |
| N805 | first arg... |
We've decided to use this plugin in our linting toolchain, which allows us to test things like variable name casing (no camelCase please!) and whether classes and methods use cls and self.
Here are the errors it can catch:
| code | sample message |
|---|---|
| N801 | class names should use CapWords convention |
| N802 | function name should be lowercase |
| N803 | argument name should be lowercase |
| N804 | first argument of a classmethod should be named 'cls' |
| N805 | first arg... |
We've decided to use this plugin in our linting toolchain, which allows us to test things like variable name casing (no camelCase please!) and whether classes and methods use cls and self.
Here are the errors it can catch:
| code | sample message |
|---|---|
| N801 | class names should use CapWords convention |
| N802 | function name should be lowercase |
| N803 | argument name should be lowercase |
| N804 | first argument of a classmethod should be named 'cls' |
| N805 | first arg... |
We've decided to use this plugin in our linting toolchain, which allows us to test things like variable name casing (no camelCase please!) and whether classes and methods use cls and self.
Here are the errors it can catch:
| code | sample message |
|---|---|
| N801 | class names should use CapWords convention |
| N802 | function name should be lowercase |
| N803 | argument name should be lowercase |
| N804 | first argument of a classmethod should be named 'cls' |
| N805 | first arg... |
We've decided to use this plugin in our linting toolchain, which allows us to test things like variable name casing (no camelCase please!) and whether classes and methods use cls and self.
Here are the errors it can catch:
| code | sample message |
|---|---|
| N801 | class names should use CapWords convention |
| N802 | function name should be lowercase |
| N803 | argument name should be lowercase |
| N804 | first argument of a classmethod should be named 'cls' |
| N805 | first arg... |
Back when our Django site was built, we needed django-wiki support in Django 2.2. Since the author did not have this available in the package that was available on PyPI, we decided to fork it and add the support ourselves.
The latest version of django-wiki, however, supports Django all the way up to Django 3. In other words, we no longer need to rely on this fork.
docker, we no longer need to load this wheel. see12fdfde Change verification post log level to info, tid... - scragly
Addresses sentry issue BOT-1B.
Verified users posting in checkpoint was set to warning level, but the notice is meant to be info.
This PR adjusts it down the appropriate level, as well as does a tiny bit of a tidy of code surrounding the change.
After much deliberating, we've decide to change the way that tags are added, removed and edited. This has been a controversial issue, but the executive staff has voted to go for this solution and we're not going to be discussing it further for the time being.
In the new system, tags will simply be markdown files stored in this repository. This means we will need to simplify the way the bot handles tags.
Currently, all the tags are supposed to b...
Build 20200223.13 succeeded
GitHub
00:01:25
Bot
Going to ignore N802 and N806, as the functions/args this raises linting errors for use names that are either required by ast or correlate to specific error classes.
We're overhauling the way tags are handled, and this means we will no longer be handling them on the site or storing them in the database at all.
Please note that this issue should not be completed until the following bot issue has been completed:
https://github.com/python-discord/bot/issues/777
You completely annihilate Tags from this repo. We don't need a model for it, the data in the database can be deleted, and we don't need any tags-related views.
We may want to restrict certain tags to certain roles. For example, we may want tags that are only available to moderators and higher, which explain moderation guidelines, bot commands, stuff like that. We may want tags that are only available to Contributors that explain certain details related to our bot and site repos.
Well first of all, we should probably wait until https://github.com/python-discord/bot/issues/777 is solved.
Once that has been don...
@lemonsaurus I like this a lot, it's fairly different from my vision of approach 1. The only downside is that in order to make adjustments, we will need to move the files themselves, rather than some sort of a reference. But that's ok.
If no one else has any suggestions, I'd be happy to go with this.
@RohanJnr I'm afraid this pull request will no longer be necessary, as we have decided to remove tags from the site repo completely. Please see https://github.com/python-discord/bot/issues/777 and https://github.com/python-discord/site/issues/336 for more information on this.
We've decided we will not be implementing this. Please see python-discord/bot#777 and #336 for more information on this.
Sentry Issue: BOT-15
This seems to be a result of the syncer retrieving a list of users to add to the API after a member has joined but before the on_member_join listener event has finished adding the data itself to the API, only to have the syncer get around to attempting to add it a second time which is met with a 400 status and a notice that the user exists in the db already.
ResponseCode...
Are there any significant differences in markdown implementation between Discord-flavored and other flavors?
If there are, where should this validation occur? Iโm assuming we eventually donโt want to have to do this manually.
@lemonsaurus So you propose to dump all other resolutions of images into a misc folder? Sounds like it could get messy. How would you handle something like this, which has lots of files?
Closing in favour of lucky number #777
1f17d0e Add unit test case for burst antispam rule - kwzrd
b0713be Add unit test case for burst shared antispam rule - kwzrd
f15f318 Add unit test case for chars antispam rule - kwzrd
4bfe30d Add unit test case for discord emojis antispam ... - kwzrd
f32ffaf Add unit test case for role mentions antispam rule - kwzrd
Build 20200223.14 succeeded
GitHub
00:01:31
Bot
c0bc8d0 Fix missing Django logs when using Docker Compose - MarkKoz
470adee Reduce log level of tag cooldown notice. - scragly
b9dcd08 Merge branch 'master' into bug/backend/s329/doc... - scragly
5fbd268 Merge pull request #774 from python-discord/coo... - sco1
f0cb3ba Merge pull request #756 from python-discord/bug... - scragly
Connected!
Build 20200223.15 succeeded
GitHub
00:02:50
Bot
Build 20200223.16 succeeded
GitHub
00:01:35
Bot
Build 20200223.17 succeeded
GitHub
00:02:50
Bot
Connected!
debe73a No longer check if every role is @everyone; jus... - Deniz
7663315 Roles cannot return None because everyone has t... - Deniz
515b490 Remove some a lot of unneccesary newlines that ... - Deniz
5f799b6 Refactor how channels and statuses are counted;... - Deniz
79fb507 Update tests to reflect status changes - Deniz
Build 20200223.18 succeeded
GitHub
00:02:46
Bot
Connected!
Build 20200223.19 succeeded
GitHub
00:01:26
Bot
Build 20200223.20 succeeded
Joseph Banks
00:02:58
Bot
Connected!
Would there be a way to make the syncer wait for event handlers in the cog to finish first? Is that even a good idea? Would the opposite also be an issue i.e. an event handler trying to make a request to the API after the syncer already has?
Build 20200223.21 succeeded
Leon Sandรธy
00:03:03
Bot
Connected!
@MarkKoz hmm, no, that's not quite what I meant. misc is just an example. Since the implementation would ignore all other folders apart from icons, we could easily have additional folders and subfolders structured however we wanted. it might be a good idea to have a misc folder (or some other name) at the top level, for sake of consistency, but inside that folder we could do whatever we needed to.
It would likely be easier for any update event listeners (such as on_member_join) to not proceed if it can tell a sync is in process already, perhaps with an asyncio.Lock or asyncio.Event to reference.
When the syncer finishes, the listeners will need to know e.g. that the syncer already created the user so the listener shouldn't attempt to do it again. Otherwise, it'd result in the same error.
Hmm, we could probably build some special method that can be awaited, and it returns a list of IDs. If it's in the middle of syncing, it'll wait till it's done and return the ID list it processed. If it isn't syncing at that time, it can immediately return with an empty list.
I would like to work on this.
Similar to #69, the cause of this is simple with a seemingly non-simple fix.
The issue here is that the current handling of nesting inside classes is too simplistic. With non-class function nesting, ast.generic_visit() is sufficient to properly visit & parse all nested definitions, but since class node traversal requires a different constructor (to identify contained functions as class method), visiting of these nodes is being handled by the more generic function visitors so they don't g...
Build 20200223.13 succeeded
GitHub
00:01:09
Snekbox
Related to https://github.com/python-discord/seasonalbot/issues/335, the bot's channel constants can occasionally get out of sync, resulting in #deleted-channel references in some of the error responses.
In order to alert staff that this desync has occurred, a utility function should be added to the bot's startup routine that validates the channel constants & logs a warning if any of the channels do not exist so the constants file can be updated appropriately.
f91c32f Reminders: don't cancel task if reminder is inv... - MarkKoz
#773 introduced this bug. If a reminder is invalid, it won't get rescheduled. Therefore, there wouldn't exist a task to cancel and it'd raise a warning.
Fixes BOT-1C
Build 20200223.22 succeeded
GitHub
00:01:34
Bot
Will use 0.5, which only supports up to Django 2.2, rather than the latest (0.6.x) because it's still a pre-release.
Resolves #335
A version of wiki which supports Django 2.2 was released on PyPI so there's no longer a need to use our fork.
I'd like to give this a try if you weren't planning for the same assignee as on the seasonalbot issue.
For the logging, should it also send a message somewhere to notify or just log as a warning/error?
Build 20200223.1 succeeded
GitHub
00:01:45
Site
discord.py 1.3.2, which fixes the aforementioned upstream bug, was released recently. I see nothing else blocking this any further.
Once it is updated, separate issues should be made for making changes to utilise features new to 3.8 (like updating the test mocks).
Go for it. With Sentry now integrated, logging a warning is sufficient.
Would we want to pin an exact version or let the patch version go up?
Patch version should be fine
Looks excellent. Let's get it merged.
1f17d0e Add unit test case for burst antispam rule - kwzrd
b0713be Add unit test case for burst shared antispam rule - kwzrd
f15f318 Add unit test case for chars antispam rule - kwzrd
4bfe30d Add unit test case for discord emojis antispam ... - kwzrd
f32ffaf Add unit test case for role mentions antispam rule - kwzrd
Build 20200223.23 succeeded
GitHub
00:01:30
Bot
Overall I think this is quite a good pull request, mostly with clean and atomic commits and making some nice improvements. The re-eval feature, which you even wrote the issue for, is particularly well implemented.
Nice work.
Using a unicode literal like this can sometimes be problematic. What you see in other parts of the bot is that these emojis are defined as constants that use unicode code points instead (like "\U0001F195"), because this tends to be a safer way of dealing with them. Some users have reported running into weird errors when the actual emoji is left inside of code like this.
419a8e6 Add reminder ID to footer of confirmation message - sco1
b1c1f8c Add reminder target datetime to footer of confi... - sco1
ee930bd Expand reminder channel whitelist to dev-contri... - sco1
5086ca9 Styling & refactors from review - sco1
d2451bd Add full capture of reason string to superstari... - sco1
Build 20200223.24 succeeded
Leon Sandรธy
00:02:48
Bot
Because both this and #206 are stale, I'm just going to go ahead and rename the constant now.
05de1f7 Update to Python 3.8 and discord.py 1.3.2 - SebastiaanZ
d3f4673 Use mixin-composition not inheritance for Loggi... - SebastiaanZ
135d6da Use IsolatedAsyncioTestCase instead of async_test - SebastiaanZ
b6500eb Remove lingering pytest test_time.py file - SebastiaanZ
ea64d7c Use unittest's AsyncMock instead of our AsyncMock - SebastiaanZ
27b658d Config: rename roles to match their names in th... - MarkKoz
df137cb Config: split roles into categories - MarkKoz
f8a687f Config: split channels into categories - MarkKoz
bc52e40 Config: shorten name of PYTHON_COMMUNITY_ROLE - MarkKoz
21872d4 Config: remove checkpoint_test and devtest - MarkKoz
Resolves #496
Contributors will have an easier time configuring the constants if their names line up with the names in the guild. Not all names were changed to be exact; mostly the staff-only channels were left alone since they were already adequately descriptive.
Build 20200223.25 failed
GitHub
00:01:07
Bot
Build 20200223.26 failed
GitHub
00:01:15
Bot
Build 20200223.27 succeeded
GitHub
00:01:43
Bot
I have upgraded the Python version we use for the bot to Python 3.8. One of the major upgrades this offers for us is that we can now use the utilities for testing asynchronous code instead of having to define our own Async-helper for every asyncio-aspect we'd like to test.
This means that this PR also removes those helpers and introduced the proper equivalents that now ship with Python where needed. Another major change that impacts the run time of the test suite significantly is that the ...
Build 20200223.28 failed
GitHub
00:01:03
Bot
Build 20200223.29 succeeded
GitHub
00:01:34
Bot
Looks exceptional. I've left some optional minor nitpicks for you to look at, it's up to you whether you wanna change these lines or not.
This is much better than the current situation - good object oriented design, these syncers are a very elegant solution.
Maybe if we put the diff._asdict() on a different line, and explained wtf. something like
diff = await self._get_diff(guild)
diff_dict = diff._asdict() # Ugly method for transforming the NamedTuple into a dict
totals = {key: len(value) for key, value in diff_dict.items() if value is not None}
(Yeah, sorry, I hate k, v)
Here, instead of sad smiley conditionaling this, my preference is to create a bool first and then have a one-line if. For example:
was_updated = (
before.name != after.name
or before.colour != after.colour
or before.permissions != after.permissions
or before.position != after.position
)
if was_updated:
...
1f17d0e Add unit test case for burst antispam rule - kwzrd
b0713be Add unit test case for burst shared antispam rule - kwzrd
f15f318 Add unit test case for chars antispam rule - kwzrd
4bfe30d Add unit test case for discord emojis antispam ... - kwzrd
f32ffaf Add unit test case for role mentions antispam rule - kwzrd
Build 20200223.30 succeeded
GitHub
00:01:33
Bot
Forgot to make it key, value. It's a casualty. Oh well.
Passing an ordered dict is fine. I don't know why I was unpacking...
7806638 Bot: add wait_until_guild_available - MarkKoz
c1a8646 Bot: make the connector attribute private - MarkKoz
04d8e14 Use wait_until_guild_available instead of wait_... - MarkKoz
e980dab Constants: add dev-core channel and check mark ... - MarkKoz
705963a API: define functions with keyword-only arguments - MarkKoz
Build 20200223.31 succeeded
GitHub
00:02:59
Bot
Connected!
Right now, when syncing user or guilds, if there is an API error, the entire sync will abort. Instead, the sync should log the error and continue syncing the rest of the users.
As a bonus, it'd be nice if the sync command would display how many failed and how many succeeded out of the total.
b9cafd1 Update Dockerfile to use python:3.8-slim - SebastiaanZ
Why not remove these comments entirely?
closes: #780
Adds new ConfigVerifier cog which now verifies if configured channels are present in server.
Build 20200224.1 succeeded
GitHub
00:01:37
Bot
7806638 Bot: add wait_until_guild_available - MarkKoz
c1a8646 Bot: make the connector attribute private - MarkKoz
04d8e14 Use wait_until_guild_available instead of wait_... - MarkKoz
e980dab Constants: add dev-core channel and check mark ... - MarkKoz
705963a API: define functions with keyword-only arguments - MarkKoz
I've changed this into a more realistic use case with a class both implementing this mixin as well as a proper TestCase class. That's how it's going to be used when it's implemented as well.
Build 20200224.2 succeeded
GitHub
00:01:45
Bot
Postgres backup completed!
Build 20200224.3 succeeded
GitHub
00:01:39
Bot
I wonder... is there still no better way to do this despite all the async support that 3.8 had added?
Everything looks good besides the comment I left and the following:
Is it out of scope to change assertions to use the new await assertions?
I should probably just set an explicit MagicMock as the return value instead of an actual _Diff object, but the "issue" here is that the AsyncMock you've used to mock _get_diff will return another AsyncMock as its child when its called and awaited. (The default behavior for mocks is to return a child mock of its own type.)
Because of that "child is like parent" behavior, this will happen in [lines 194-196 of bot.cogs.sync.syncers](https://github.com/python-discord/bot/blob/c81a4d...
I'm not quite sure. The create_task method is not a coroutine but a regular method that, if actually used, returns an awaitable Task object. The thing I've changed here is that instead of mocking the sync_guild with an AsyncMock, I've mocked it with a MagicMock; the reason is that we're not actually interested in the async interface, but merely want to check if create_task was called with the right thing.
The latter is more difficult with an AsyncMock as when we call an AsyncMo...
Is it out of scope to change assertions to use the new await assertions?
We could declare that within the scope of the PR, but it will delay it quite some while, I think. I haven't looked into it too deeply yet, but if we go that route, it basically means reevaluating each test method that uses coroutines to see if we can modernize the assert strategy.
Such a modernization would be a good (a...
Build 20200224.4 succeeded
GitHub
00:01:42
Bot
Build 20200224.5 succeeded
GitHub
00:01:41
Bot
By default, the webhooks sent by Azure use a link which requires an authorised account to access. If the site intercepts the webhook, modifies the field for the URL, and sends it back out again, developers will be happier and more productive!
Here is the URL the webhook currently uses:
A more accessible URL for the same build is:
https://de...
Oh yeah I remember you mentioning that weird issue in VC. However, I ran it without that change locally and the test passed.
Actually, that may be because I changed the syncer to use autospecs (which I believe is smarter about specing attributes than just using the same mock as the parent).
Thanks for your input. I was never too happy with my solution for this but it was far cleaner than my first attempts.
OK now I realise what was going on here. The mixin relies on methods from TestCase but it doesn't actually subclass it. Hence the class above is needed so it can subclass TestCase.
That's for the test_cog file, right? The test_base file uses this:
class TestSyncer(Syncer):
"""Syncer subclass with mocks for abstract methods for testing purposes."""
name = "test"
_get_diff = mock.AsyncMock()
_sync = mock.AsyncMock()
If I comment out line 343 in test_base, I do get the mocking behavior above (and the exception/unawaited coroutine warnings).
What do you think?
Let's get this merged and take care of the await assertions in another PR. The 3.8 upgrade hasn't caused a regression regarding assertions - they are at least as effective as they were before. The await assertions are merely an improvement so they don't block anything. I'd rather have this merged first in case anyone else needs to write tests in their PRs.
Yeah you're right about the autospecs. That change is actually irrelavant. Anyway, I ran the test again and it's failing now. I don't know why it appeared to pass last night.
Loosely related rambling ahead, beware:
I played around with the idea of using autospecs for the mock helpers. Unfortunately the problem is that it cannot create a class from an instance spec (but it can do it the other way around). Recall that instances are used as the spec so that instance attributes get mocked too.
I was hoping using autospecs would remove the need to create subclasses in simple cases (i.e. the mocks require no modification of attributes). However, this limitation o...
Build 20200224.6 succeeded
GitHub
00:01:44
Bot
ac6d87d Resources: add JSON with array of chemical elem... - MarkKoz
dd78ccb HelpChannels: create boilerplate extension and cog - MarkKoz
3c349f9 HelpChannels: load element names from JSON - MarkKoz
8ebee01 Constants: add constants for HelpChannels cog - MarkKoz
e7cee78 HelpChannels: add constants for active/dormant ... - MarkKoz
Follows the design outlined in https://github.com/python-discord/organisation/issues/200#issuecomment-590000882
PermissionOverwriteBuild 20200224.7 succeeded
GitHub
00:01:25
Bot
6a6abf5 HelpChannels: add method stubs - MarkKoz
da1ec9e HelpChannels: add a logger - MarkKoz
7a663b1 HelpChannels: add a function to get a channel o... - MarkKoz
e271957 HelpChannels: add a function to init the catego... - MarkKoz
298b8f2 HelpChannels: add a function to initialise the cog - MarkKoz
Build 20200224.8 succeeded
GitHub
00:01:17
Bot
Build 20200224.9 succeeded
GitHub
00:01:47
Bot
Build 20200224.10 succeeded
GitHub
00:01:22
Bot
01e47a3 Constants: implement init_available - MarkKoz
40f8a7a Constants: add a named tuple for scheduled task... - MarkKoz
0365c69 HelpChannels: implement move_idle_channels - MarkKoz
c7b9f78 HelpChannels: fix creation of queues in init_cog - MarkKoz
15d0ca5 HelpChannels: make move_idle_channels only hand... - MarkKoz
Build 20200225.1 succeeded
GitHub
00:01:48
Bot
Build 20200225.2 succeeded
GitHub
00:01:35
Bot
Build 20200225.3 succeeded
GitHub
00:01:40
Bot
Build 20200225.4 succeeded
GitHub
00:01:47
Bot
d2925bf HelpChannels: fix creation of the init_cog task - MarkKoz
12b6e1d Resources: make all element names lower cased - MarkKoz
013e3e8 HelpChannels: ignore messages sent by bots - MarkKoz
6b418f2 HelpChannels: fix acquisition of the on_message... - MarkKoz
5d14496 HelpChannels: add missing units of time in mess... - MarkKoz
Build 20200225.5 succeeded
GitHub
00:01:39
Bot
Don't know exactly what triggered it cause I noticed it way up in my bot's log history.
Ignoring exception in on_command_error
Traceback (most recent call last):
File "/home/mark/repos/python/bot-pydis/.venv/lib/python3.7/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "/home/mark/repos/python/bot-pydis/bot/cogs/error_handler.py", line 92, in on_command_error
await ctx.invoke(tags_get_command, tag_name=ctx.invoked_with)
Fi...
Build 20200225.6 succeeded
GitHub
00:01:55
Bot
Forgot to mention . added self deletion after 7.5 seconds. same as in error_handler
a38d64a HelpChannels: explain the system in the cog doc... - MarkKoz
Build 20200225.7 succeeded
GitHub
00:01:36
Bot
Similar to how we filter out leaked Discord bot tokens, it might be a good idea to investigate an approach to identify & filter leaked Discord webhook links and then strongly encourage them to generate a new URL before they get annihilated by spam.
Postgres backup completed!
Seems like no match (REGEX_NON_ALPHABET) was found, Is returning (unreachable value?) an option?
The current declaration of _fuzzy_search is:
@staticmethod
def _fuzzy_search(search: str, target: str) -> int```
while the return value is a float.
```py
return current / len(_search) * 100```
## Available fixes
We can change the return value from *int* to *float* or convert the division mark to floor the result:
```py
def _fuzzy_search(search: str, target: str) -> float```
**or**
```py
return current // len(_search) * 100```
I can fix it when it's approved :+1:
for genre in self.genres:
Shouldn't be needed
Looks good, a few suggestions on code
Could this be looked up, and instead display the full name with possible ways to use it.
For instance:
Role-playing (rpg) is a combination of Role-playing & the lookup key rpg so that the user can use both the full name and a shorthand? Not everyone, especially casual gamers will know what rpb, tbs and rts stands for.
Why is this needed? The use of it seems inconsistent with for instance L236 and L224. Might as well use data in those places?
Build 20200225.1 succeeded
GitHub
00:01:10
Seasonal Bot
Any reason for not using asyncio.create_task here over the lower-level loop.create_task?
I like this change; it signals that we really should be using the Scheduler API instead of manipulating the mapping of scheduled tasks directly (which bypasses the checks, callbacks, and logging steps done below).
Is there any chance of a task ending with another type of exception than CancelledError and a new task being rescheduled with the same id before this callback is executed? (Callbacks are scheduled with "call_soon", so they don't happen directly after the task is done, although they should happen "soon".)
If so, I think this will cancel the new task as we're cancelling it purely using the task_id which, if I read this comment right, may or may not assigned to the task this callback wa...
Build 20200225.2 succeeded
GitHub
00:00:54
Seasonal Bot
Build 20200225.3 succeeded
GitHub
00:00:55
Seasonal Bot
What about
pages = [await self.create_page(game) for game in data]
Doesn't that work?
This seems entirely adequate as a stopgap solution to get us through March. nice work
Build 20200225.4 succeeded
GitHub
00:00:51
Seasonal Bot
Looks good, code wise. Someone should try it bfeore merging, I don't have the opportunity to run it myself atm.
While we used to do this (and probably had to us this prior to Python 3.7), I think we should switch to using the higher level asyncio API with asyncio.create_task instead of using the lower-level loop API of loop.create_task. I think this is as good a point as any to introduce a new habit.
I think it's also a good idea to keep a reference to the task around. That will make it easier to debug since we can inspect exceptions and so on if something breaks.
So, would suggest, **with an...
We've had issues with the guild cache not being available when the READY signal was dispatched (discord.py only waits for 2 seconds which, during Discord API lag, is occasionally too short). To prevent that, we've implemented a custom wait_until_guild_available that ensures that the cache is actually loaded before doing things that rely on the cache being available.
Since this validator...
This fails as the bot's event loop is not running yet and it can't fetch it if I'm understanding it right. Should it at least be assigned to a var?
7806638 Bot: add wait_until_guild_available - MarkKoz
c1a8646 Bot: make the connector attribute private - MarkKoz
04d8e14 Use wait_until_guild_available instead of wait_... - MarkKoz
e980dab Constants: add dev-core channel and check mark ... - MarkKoz
705963a API: define functions with keyword-only arguments - MarkKoz
Build 20200225.8 succeeded
GitHub
00:01:45
Bot
Build 20200225.9 succeeded
GitHub
00:01:49
Bot
This would probably be best included with the fix for #787
Oh never mind you already said that
I don't think it's particularly critical that we ensure persistence for something that's probably going to be rewritten soonTM anyway. We can live with the occasional short update timer.
Build 20200225.5 succeeded
GitHub
00:02:03
Seasonal Bot
Active Season: Valentines
Build 20200225.6 succeeded
GitHub
00:02:02
Seasonal Bot
The user events setup we have now seems to adequately address the gist of this proposal so there isn't much that can be actioned here.
With the impending overhaul of Seasonalbot's functionality to lose the season manager we'll be moving to a more hands-on, lower cadence implementation of events.
Automated season announcements are going away so we don't need to do this.
Season management is going away so this no longer needs to be implemented.
I'm going to revert the status of this to planning & defer it until after #329 is complete, with the removal of the seasonal manager we need to determine whether or not this feature is still wanted (probably yes) and how to implemented it inside of the new system.
All of these (#357, #358, #359, #360) look fine. Rather than implementing these as individual cogs, they should ultimately end up being contained inside one cog and implemented as subcommands.
With that in mind, please take a look at their respective APIs and see if there is any functionality that could be implemented for each beyond just returning a random picture. Are there any "generes" or other filters that we could use? Photos from specific missions? Specific topic araeas? etc.
All of these (#357, #358, #359, #360) look fine. Rather than implementing these as individual cogs, they should ultimately end up being contained inside one cog and implemented as subcommands.
With that in mind, please take a look at their respective APIs and see if there is any functionality that could be implemented for each beyond just returning a random picture. Are there any "generes" or other filters that we could use? Photos from specific missions? Specific topic araeas? etc.
All of these (#357, #358, #359, #360) look fine. Rather than implementing these as individual cogs, they should ultimately end up being contained inside one cog and implemented as subcommands.
With that in mind, please take a look at their respective APIs and see if there is any functionality that could be implemented for each beyond just returning a random picture. Are there any "generes" or other filters that we could use? Photos from specific missions? Specific topic araeas? etc.
All of these (#357, #358, #359, #360) look fine. Rather than implementing these as individual cogs, they should ultimately end up being contained inside one cog and implemented as subcommands.
With that in mind, please take a look at their respective APIs and see if there is any functionality that could be implemented for each beyond just returning a random picture. Are there any "generes" or other filters that we could use? Photos from specific missions? Specific topic araeas? etc.
so
cog named space :
.apod
.nasa
.mars
.earth
If i am not wrong.
That should be a fine start
Connected!
Build 20200225.10 succeeded
GitHub
00:03:03
Bot
Looks like the error handler tags don't go through TagNameConverter which discards invalid tag names, can look at it more if assigned.
7806638 Bot: add wait_until_guild_available - MarkKoz
c1a8646 Bot: make the connector attribute private - MarkKoz
04d8e14 Use wait_until_guild_available instead of wait_... - MarkKoz
e980dab Constants: add dev-core channel and check mark ... - MarkKoz
705963a API: define functions with keyword-only arguments - MarkKoz
I've resolved the merge conflict & added the role & channel groupings to the YAML that were only present in constants.py.
I still need to test the changes but I'm not currently at a machine capable of doing so.
Build 20200225.11 failed
GitHub
00:01:17
Bot
Build 20200225.12 failed
GitHub
00:01:17
Bot
1f17d0e Add unit test case for burst antispam rule - kwzrd
b0713be Add unit test case for burst shared antispam rule - kwzrd
f15f318 Add unit test case for chars antispam rule - kwzrd
4bfe30d Add unit test case for discord emojis antispam ... - kwzrd
f32ffaf Add unit test case for role mentions antispam rule - kwzrd
1f17d0e Add unit test case for burst antispam rule - kwzrd
b0713be Add unit test case for burst shared antispam rule - kwzrd
f15f318 Add unit test case for chars antispam rule - kwzrd
4bfe30d Add unit test case for discord emojis antispam ... - kwzrd
f32ffaf Add unit test case for role mentions antispam rule - kwzrd
Build 20200225.13 succeeded
GitHub
00:01:44
Bot
1f17d0e Add unit test case for burst antispam rule - kwzrd
b0713be Add unit test case for burst shared antispam rule - kwzrd
f15f318 Add unit test case for chars antispam rule - kwzrd
4bfe30d Add unit test case for discord emojis antispam ... - kwzrd
f32ffaf Add unit test case for role mentions antispam rule - kwzrd
Build 20200225.14 succeeded
GitHub
00:01:41
Bot
As all other checks already have staff ignore, so I added here too. Closes #767 .
Build 20200225.15 failed
GitHub
00:01:00
Bot
Build 20200225.16 succeeded
GitHub
00:01:30
Bot
Build 20200225.17 succeeded
GitHub
00:01:34
Bot
Sentry Issue: BOT-1Q
The !roles information command currently sticks role ID's & a corresponding mention into the description field of the embed:
However, the description field has a character limit of 2048 characters and we now have more roles than can fit into this space...
While testing locally it appears that contextlib.suppress is not stopping CancelledError from being raised.
bot_1 | 2020-02-25 19:23:16,017 | asyncio | ERROR | Exception in callback _silent_exception(>) at /bot/bot/utils/scheduling.py:71
bot_1 | handle: <Handle _silent_exception(>) at /bot/bot/utils/scheduling.py:71>
bot_1 | Traceback (most recent call last):
bot_1 | File "/usr/local/lib/python3.8/asyncio/events.py", line 81, in _run
bot_1 | s...
Since we added attachments to the deleted message logs the clean command was not updated to store this.
When running a clean command the following error is returned:
web_1 | Bad Request: /bot/deleted-messages
web_1 | "POST /bot/deleted-messages HTTP/1.1" 400 792
bot_1 | 2020-02-25 19:32:41,081 | bot.cogs.error_handler | DEBUG | API responded with 400 for command clean all: {'deletedmessage_set': [{'attachments': ['This field may not be null.']}, {'attachments': ['...
Build 20200225.18 failed
GitHub
00:01:23
Bot
Build 20200225.19 succeeded
GitHub
00:01:32
Bot
I think this looks good overall!
Just a matter of preference, but I think these would read nicer as:
if None in (...):
log.error(...
return
bot.add_cog(...
Feel free to keep as is though.
This will look too deep and fail on a KeyError for all inheriting classes where subsection is None e.g. Bot, Guild etc. If the metaclass supports iteration, then it should be able to handle it for both levels of nesting.
We could, for example, iterate cls.__annotations__ and delegate the name look-up to __getattr__ above, which handles both levels of nesting.
Guess it depends on the behavior we want from it on sections, list only its config values or the subsections too?
I stylized it with the intended case as the first one (although the eyes fall more onto the log...), maybe a third opinion?
Subsections have their own config classes. I think this should only feed values annotated in the class that is being iterated.
Build 20200225.20 succeeded
GitHub
00:01:39
Bot
I missed this: if unconfigured, these will be empty strings, not None.
It's None when excluded from the .env, empty strings if just the values are unset.
Empty string get caught when the cog tries to authenticate and is then unloaded.
Under docker, they default to empty strings when excluded from .env. I think it would make sense to check for both in the setup.
Sorry, I realize now that the issue this addresses is that the cog crashes if these two sneak in as Nones. I assume that this is then a problem that only happens when running without docker.
I still think that it'd make sense to unload & log if they are empty strings, but I'll re-approve now. If you don't want to do that, then you can mark this as resolved.
At a minimum it'll save 3 requests which are done before the cog is unloaded so won't hurt.
Build 20200225.21 succeeded
GitHub
00:01:40
Bot
The old and new topics should each be in separate in-line code blocks. The arrow should be between and outside the two code blocks.

Build 20200226.2 succeeded
GitHub
00:01:49
Bot
Build 20200226.3 succeeded
GitHub
00:01:48
Bot
Sure @Numerlor, I've assigned you.
This simple thing can probably be thrown in with #785, which already has another minor fix to the Reddit cog in it
@F4zii You can go ahead and work on this but since someone else was assigned to the other issue maybe they should take care of this one too.
Build 20200226.4 succeeded
GitHub
00:01:50
Bot
You've brought up some good points I think. I'm going to try to rework the task cancellation.
Postgres backup completed!
Build 20200226.5 succeeded
GitHub
00:01:41
Bot
Build 20200226.6 succeeded
GitHub
00:01:49
Bot
e173cd2 Scheduler: only send warning in callback if tas... - MarkKoz
Was just being consistent with the rest of the code but you're right, we should start taking opportunities to phase out loop.whatever where applicable.
Anyway, this has been replaced with a shield as you suggest so it's no longer relevant.
Build 20200226.7 succeeded
GitHub
00:01:55
Bot
OK, I came up with a much better and simpler solution. I don't know what the hell I was thinking before but the previously implementation was just wrong in several ways. See commit messages for details.
I noticed that reminders send a duplicate DELETE request from the scheduled task. send_reminder() already deletes the reminder too but the task also tries to delete the reminder afterwards. _delete_reminder() also cancels the task after sending the request. Because a shield isn't being used, the API error ends up being suppressed (a 404 occurs because the reminder was already deleted). If not for the 404, then task being cancelled would at the least still send a warning cause the task wou...
Does it make sense to raise it or should it be logged instead? Haven't tested this yet. I am guessing that if raised, it will just show up as
asyncio | ERROR | Task exception was never retrieved
If logged here, more context could be provided.
Build 20200226.8 succeeded
GitHub
00:01:47
Bot
When going over the last commit I noticed this: https://github.com/python-discord/bot/blob/1ccc0f11fd4511d13c7cdf59070dca86465fe59f/bot/cogs/reddit.py#L43-L47
Is the comparison operator supposed to be checking the other way around?
Tokens auto expire and become unusable in an hour, and now the check only executes if the token's already expired (expired time before current) if I'm getting it right
I agree with @sco1's assessment. It might be something we want, but it should not be implemented until after the deseasonification is complete.
if not RedditConfig.secret or not RedditConfig.client_id:
This do same and is more readable.
No need for this after change in L294.
Build 20200226.9 succeeded
GitHub
00:01:44
Bot
These should !package command, that fetch information from PyPi JSON API. This should go under Utils cog.
I can work with this after my current PR get merged.
For the project descriptions, there may be some problems picking up the relevant data out of them; some start with an introduction, others with an install guide etc. There's always the option to not include the description or just cut it off before the char limit but something to take into consideration.
Also I think this should probably have its own cog if the above parsing gets involved
@Numerlor My idea is showing only short summary, author, supported Python versions, license, home page, PyPi page and latest version there, due READMEs may REALLY big.
It's more efficient if the roles are checked after the check for existence of attachments (line 25). Furthermore, at the least, use isinstance() rather than type() is .... However, I think checking if the attribute exists is even better:
if hasattr(message.author, "roles") and any(role.id in STAFF_ROLES for role in message.author.roles):
That being said, this should probably ignore DMs (if not message.guild). If that happens, then it may be safe to assu...
The implementation details of this needs a lot more thought put into it & provided in the description before this can move forward.
The amount of information present in a project's PyPI page ranges from very little to a whole lot, so it needs to be identified which information is always present and what is optionally present and, out of those, decide what we want to display in the embed while respecting the embed's various character limits.
@Numerlor Yes, I believe the operator in the datetime comparison should be flipped around i.e. revoke the token if it's still valid. Also realised there needs to be a None check for the access token as it's not guaranteed to have been created before the cog unloads.
Build 20200226.10 succeeded
GitHub
00:01:45
Bot
@Numerlor Yes, I believe the operator in the datetime comparison should be flipped around i.e. revoke the token if it's still valid. Also realised there needs to be a None check for the access token as it's not guaranteed to have been created before the cog unloads.
Pushing a fix through, just made sure it's not intended. Already included a bool if check on the access_token in https://github.com/python-discord/bot/pull/785/commits/e8e2fa9ee8f607bb6593b7c8325446dc074a972d
Build 20200226.11 succeeded
GitHub
00:01:48
Bot
Thanks. Would you mind including the guild check like I discussed? In addition to moderating DMs being pointless, it turns out that it can't even function in DMs since it can't delete messages:
discord.errors.Forbidden: 403 FORBIDDEN (error code: 50003): Cannot execute action on a DM channel
This will also get triggered when going through the tag commands, but passing a tag name without any letters. Do we want to allow those or should they also be rejected in the converter?
Without letters? As in A-Z? Or do you mean without any characters? Cause I think tag names with, for example, digits only, should be allowed (kind of weird but why not).
Tag names with only numbers already get rejected
https://github.com/python-discord/bot/blob/1ccc0f11fd4511d13c7cdf59070dca86465fe59f/bot/converters.py#L166-L170
But other ascii characters go through and fail at the alpha regex e.g. ----- or $+-(
Build 20200226.12 succeeded
GitHub
00:01:39
Bot
@sco1 I added information about what would be in embed.
In that case, follow in its footsteps and also ignore symbol only characters. Probably can merge the number and symbol check together by checking that at least one letter exists.
I don't know what exactly the regex problem is. If the above does not fix it, then the regex should support symbols too (if it's feasible). If it's too much trouble then I suppose the symbols should be completely blacklisted.
The error handler fallback allowed any tag names through and tags not containing any letters were not restricted by the TagNameConverter, resulting in a ZeroDivisionError when fuzzy matched and passed through REGEX_NON_ALPHABET
Build 20200226.13 succeeded
GitHub
00:02:54
Bot
Build 20200226.14 succeeded
GitHub
00:01:37
Bot
Especially now that we use Sentry, these shouldn't warnings. In fact, with #757, there'll be no need to log this as the exception will already get logged in the command error handler. These log messages can be removed from this converter.
As a follow up to my other comment, the BadArgument should be caught and logged since the converter won't log it any more. Forwarding the error to the command handler is not a good idea since it handles the error undesirably (sends messages to the channel).
How should this be logged, through a logging warning like in the converter? (Or a lower level since it's just an invalid command at that point)
Build 20200226.15 succeeded
Joseph Banks
00:03:19
Bot
Connected!
Build 20200226.16 succeeded
GitHub
00:01:33
Bot
Build 20200226.17 succeeded
GitHub
00:01:27
Bot
Build 20200226.18 succeeded
GitHub
00:01:51
Bot
Build 20200226.19 succeeded
GitHub
00:02:53
Bot
Connected!
4572d53 Add logging to antimalware cog & expand user fe... - sco1
Go home GitHub you're drunk
Closes #357
Closes #358
Closes #359
Closes #360
Gonna only use pictures from curiosity as only that have some interesting pictures.
Note:-
It needs an API key generated from https://api.nasa.gov/
and stored in env variable named NASA_API
pipenv lock?pipenv run lint...Build 20200227.1 failed
GitHub
00:00:25
Seasonal Bot
Build 20200227.2 failed
GitHub
00:00:26
Seasonal Bot
Postgres backup completed!
Build 20200227.3 failed
GitHub
00:00:25
Seasonal Bot
Build 20200227.4 failed
GitHub
00:00:25
Seasonal Bot
Build 20200227.5 failed
GitHub
00:00:27
Seasonal Bot
This can raise 3 exceptions:
Raises:
While this can be rare, if this happens just once the entire loop will end, leaving all reactions on the messa...
The comment here should be put above the await ctx.send instead, since it is for the send, not for the exception.
For the exception, you can put a comment similar to
# if failed to DM the user, most likely because they are blocking DM
await ctx.send(f"{user.mention} Please enable your DM to receive the message.", delete_after=7.5)
Minor grammar mistake
Should be moved inside of class.
Should be moved to constants.py (under Tokens).
Please add comments and split code to smaller code blocks.
Use await response.json() to instantly return Dictionary.
Build 20200227.6 succeeded
GitHub
00:00:43
Seasonal Bot
Build 20200227.7 succeeded
GitHub
00:00:46
Seasonal Bot
Build 20200227.8 succeeded
GitHub
00:00:46
Seasonal Bot
In the pull request template, we have asked you whether you have remembered to:
You said yes to both of these, in spite of the fact that you obviously did not do either of them.
You have also added a dependency, requests, which has no place in an asyncronous bot. The most astounding thing is that you are using it alongside aiohttp in this pull request, which you're using to create a ...
Build 20200227.9 succeeded
GitHub
00:00:48
Seasonal Bot
Build 20200227.1 succeeded
GitHub
00:02:00
Bot
As I've asked, please do not automatically resolve the conversation.
As of right now, you are adding more exception to the try, while the line that can cause exception is inside your except discord.Forbidden block, adding more except outside will not catch the exception of reaction.remove(user)
Thanks. The split make it look much nicer. Just several more small things.
Instead of returning a tuple with boolean, return only the code and make the caller check if it's None.
NotFound error needs to be suppressed in case user deletes the message themselves.
NotFound error needs to be suppressed in case user deletes the message themselves.
Thanks! Even helped me find a few misconfigured channels in my own config.
Build 20200227.2 succeeded
GitHub
00:01:33
Bot
Build 20200227.3 succeeded
GitHub
00:03:12
Bot
Connected!
671052c Moderation: fix task cancellation for permanent... - MarkKoz
A task should not be cancelled if an infraction is permanent because tasks don't exist for permanent infractions.
Fixes BOT-1V
Build 20200227.4 succeeded
GitHub
00:01:38
Bot
Build 20200227.5 succeeded
GitHub
00:03:19
Bot
Connected!
Build 20200227.6 succeeded
GitHub
00:01:40
Bot
Tested it and here is what the exception looks like when raised:
2020-02-27 10:09:00,551 | asyncio | ERROR | Exception in callback Scheduler._task_done_callback(34)(<Task finishe...Error('aaah')>)
handle: <Handle Scheduler._task_done_callback(34)(<Task finishe...Error('aaah')>)>
Traceback (most recent call last):
File "/opt/pyenv/versions/3.7.5/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/home/mark/repos/python/b...
Logging it ourselves looks nicer. However, a user wouldn't know that an error occurred either way. How could they be notified (if applicable i.e. if it was ultimately invoked by a user)?
I think that user-specific feedback would be rather difficult to accomplish, since there could be a long time between the user action and the failing of scheduled task. It also creates the issue of logistics: How are we going to know what to do from within the generic "done callback"?
Another option would be that, for more critical schedulers, we add an additional, scheduler-specific callback that handles it in some way. For the moderation scheduler, this could be a callback that has the M...
Build 20200227.7 succeeded
GitHub
00:01:26
Bot
My surface level testing has shown that the cog is functional, but there are some code quality concerns that I'd like to see addressed. I'm a little bummed out about the copy-pasted docstrings from the Movie cog.
If the Tokens.igdb contant is not set, the cog will crash on start-up. Since the cog cannot function without the API key, there should be a conditional check here to verify that a key is configured. It would also be good to log a warning if no key is available.
Looking over this is very confusing. Correct me if I'm wrong, but you're creating aliases for long genre names.
It would be a lot more maintainable to handle the aliasing logic in a generic loop, test it to make sure it works properly, and then simply define the aliases on the side.
aliases = {
"Role-playing (rpg)": ["Role-playing", "Rpg"],
}
for original, aliases in aliases.items():
for alias in aliases:
genres[alias] = original[original]
In this p...
Consider using a better name for the param, such as search_term.
Build 20200227.8 succeeded
GitHub
00:01:39
Bot
Looks good, code wise. Someone should try it bfeore merging, I don't have the opportunity to run it myself atm.
A couple minor additional points in addition to @kwzrd's broader comments.
For the longer string concatenation, you can use the main bot's information cog as an example how to mix multiline fstrings and, if necessary, template strings into something that's much easier to follow.
There's a lot of mixing of double and single quotes here as well. The prevailing code styl...
Let's use an fstring here
async with self.http_session.get(f"{BASE_URL}genres", data=body, headers=HEADERS) as resp:
It's probably more readable to strip the trailing / from BASE_URL so these concatenations would end up being f"{BASE_URL}/genres" instead.
I don't think just sending the command's help here is useful. There should be feedback to the user that there's something wrong with the genre they provided.
Having to mix so many things and use a multiline string on top of it is generally an indication that this should be broken up into discrete chunks.
Okay I think I'm going to log it for now because that's that looks better.
This change feels out of the scope for this pull request because it may
require a relatively significant redesign. As we said we can redesign it so
it's not inherited but composition instead and maybe that pull request can
also include your idea.
Den tors 27 feb. 2020 12:25Sebastiaan Zeeff notifications@github.com
skrev:
@SebastiaanZ commented on this pull request.
In bot/ut...
Build 20200228.1 succeeded
GitHub
00:01:39
Bot
Build 20200228.1 succeeded
GitHub
00:02:07
Site
Build 20200228.2 succeeded
GitHub
00:03:50
Site
Thanks for your hard work, looks good.
98057a2 CI: always check if the base image can be pulle... - MarkKoz
80985b1 CI: add more logging in check_dockerfiles.sh - MarkKoz
fde1bfc CI: update agent to Ubuntu 18.04 - MarkKoz
ddaf1c2 CI: move lint & tests job into templates - MarkKoz
034e9a0 CI: diff base against master only if venv changed - MarkKoz
Build 20200228.1 succeeded
GitHub
00:01:24
Snekbox
Postgres backup completed!
When invoking the eval command with a code that includes a time sleep, the bot doesn't send any output and triggers the typing even after sending the output message.

The issue seems that the typing error is caused by the fact that the eval timed out, because using a 3 seconds sleep doesn't cause the bug, but using asyncio also cause the bug to appear. Also, this seems like an heisenbug since this bug seems to randomly appear. This behavior is even more peculiar knowing that the typing functionality is triggered by a context manager.
Yeah, this only happens when you sleep for more than 5 seconds.
Build 20200228.2 succeeded
GitHub
00:01:53
Bot
This was suggested in meta:

Build 20200228.3 succeeded
GitHub
00:01:43
Bot
f12d76d Config: rename roles to match their names in th... - MarkKoz
ffdde0f Config: split roles into categories - MarkKoz
bf7dd8c Config: split channels into categories - MarkKoz
707d2f7 Config: shorten name of PYTHON_COMMUNITY_ROLE - MarkKoz
8c1a31b Config: remove checkpoint_test and devtest - MarkKoz
Build 20200228.4 succeeded
Leon Sandรธy
00:03:14
Bot
Connected!
nice to get this broken off into a separate function.
works fine, and it's very well written. A pleasure to review.
f12d76d Config: rename roles to match their names in th... - MarkKoz
ffdde0f Config: split roles into categories - MarkKoz
bf7dd8c Config: split channels into categories - MarkKoz
707d2f7 Config: shorten name of PYTHON_COMMUNITY_ROLE - MarkKoz
8c1a31b Config: remove checkpoint_test and devtest - MarkKoz
Build 20200228.5 succeeded
GitHub
00:02:02
Bot
6f25814 Moderation: fix member not found error not bein... - MarkKoz
a83d268 Error handler: create separate function to hand... - MarkKoz
eab4b16 Error handler: create separate function to hand... - MarkKoz
29e3c3e Error handler: log unhandled exceptions instead... - MarkKoz
806c69f Error handler: move tag retrieval to a separate... - MarkKoz
Connected!
Build 20200228.6 succeeded
Leon Sandรธy
00:03:23
Bot
Build 20200228.1 succeeded
GitHub
00:00:46
Seasonal Bot
@sco1 @kwzrd After 6 hours of work, this is done.
Build 20200228.7 succeeded
GitHub
00:01:28
Bot
Build 20200228.2 succeeded
GitHub
00:01:24
Snekbox
This has been resolved from the snekbox repository.
Here I'll provide a small explanation as what was happening to cause this behaviour.
The part of the eval command when waiting for a response is contained in the context manager of ctx.typing.
Internally, the typing event is resent to the Discord API every 5 seconds so long as the code has not existed ...
Build 20200228.3 succeeded
GitHub
00:01:09
Snekbox
Build 20200228.4 succeeded
GitHub
00:01:17
Snekbox
Note: this is written as if #755 has already been merged.
The scheduler currently designed with inheritance. The task scheduled is an abstract method which subclasses have to implemented. This design is restrictive because it only supports that one ...
deeb8f8 Resources: map element names to alphabetic indices - MarkKoz
c2e62cb Resources: remove all but first 50 elements - MarkKoz
7ab1c7d HelpChannels: rename elements constant - MarkKoz
4a9d439 HelpChannels: sort dormant channels alphabetically - MarkKoz
60464d0 HelpChannels: add a warning if more than 50 cha... - MarkKoz
Putting this as high as this would be helpful for #786, which will need to schedule separate coroutines for making channels dormant and for removing permission overwrites for users.
1f17d0e Add unit test case for burst antispam rule - kwzrd
b0713be Add unit test case for burst shared antispam rule - kwzrd
f15f318 Add unit test case for chars antispam rule - kwzrd
4bfe30d Add unit test case for discord emojis antispam ... - kwzrd
f32ffaf Add unit test case for role mentions antispam rule - kwzrd
This is great work. Thanks for taking the initiative to fix those bugs and, of course, add the very useful re-evaluation feature. It's a simple and intuitive design. I believe it will be much appreciate by the users (I made a change to hopefully help them know about it). 100% coverage on the test suite is impressive - I know how tedious achieving that can be, especially for larger features such as snekbox.
Build 20200228.8 succeeded
GitHub
00:01:39
Bot
Build 20200228.9 succeeded
GitHub
00:03:11
Bot
Connected!
Build 20200228.10 succeeded
GitHub
00:01:41
Bot
Build 20200228.11 succeeded
GitHub
00:01:32
Bot
Build 20200228.12 succeeded
GitHub
00:01:27
Bot
Build 20200228.13 succeeded
GitHub
00:01:35
Bot
Build 20200228.14 succeeded
GitHub
00:01:25
Bot
776509b Wrong annotation for Tags._fuzzy_search - F4zii
Wrong annotation for Tags._fuzzy_search
The returned value from _fuzzy_search is a float
The current type annotation is an int,
solved this problem by switching it into a float
Resolves #789
If this is merged make sure to pull the changes from master since this branch can be outdated
I will recreate this pr from another branch
ea80e14 Rearchitect FunctionVisitor to utilize context ... - sco1
pep8-naming to linting toolchainblackcheck-merge-conflictcheck-tomlcheck-yamlend-of-file-fixermixed-line-endingpython-check-blanket-noqaArgument and Function __repr__ methods to make the string more helpful to readLTGM (and tests passed on Windows :))
Postgres backup completed!
Build 20200229.1 succeeded
GitHub
00:01:54
Bot
Right now there is a rare chance that it can be a tag instead, can we move it up to check for commands, specially if invoker is a mod+?

b4aa527 Wrong annotation for Tags._fuzzy_search - F4zii
@AnonGuy Looks like this is a good start, but there are multiple cases that this PR does not resolve, so it feels a bit like a half measure.
This PR does catch the simplest, ||badword||, but beyond that it does not catch most of the stuff discussed in this PR and in the issue this was based on.
For example, have a look at this embed:

Sure, the filter does match it, but t...
Wrong annotation for Tags._fuzzy_search
The returned value from _fuzzy_search is a float
The current type annotation is an int,
solved this problem by switching it into a float
Resolves #789
Build 20200229.2 succeeded
GitHub
00:01:49
Bot
This can be reduced to
return cooldown_conditions
And because of that, I suggest changing them to this
is_on_cooldown = (
tag_name
and tag_name in self.tag_cooldowns
and (now - self.tag_cooldowns[tag_name]["time"]) < Cooldowns.tags
and self.tag_cooldowns[tag_name]["channel"] == ctx.channel.id
)
return is_on_cooldown
You can even return it directly
I concur that this should return a True, otherwise this is possible

Build 20200229.3 succeeded
GitHub
00:02:01
Bot
68f9758 Make sure tag name contains at least one letter. - Numerlor
b4a52ad Pass error handler tag fallback through TagName... - Numerlor
432311c Remove number check on tags. - Numerlor
c0d2f51 Adjust tests for new converter behavior. - Numerlor
5ae3949 Remove logging from tag converters. - Numerlor
Okay, I got two issues with this:
It's a bit strict. For example, if there are only pipes before but not after the word, this will break. If the words are wrapped in single pipes instead of doubles, this will break. Perhaps it would be better to get rid of an arbitrary amount of pipes, or to just get rid of all the pipes in the entire word before filtering.
Do we really need regex for just getting rid of pipes? maybe we should solve this with just content.replace or something.
Build 20200229.4 succeeded
GitHub
00:03:24
Bot
Connected!
Build 20200229.5 succeeded
GitHub
00:01:41
Bot
A few observations here:
black or something?All of this taken into account, I ...
This stuff isn't my strong suit but it does look reasonable to me.
closes #777
This PR is to remove API reliability for the Tags and use static files instead, so adding, editing or deleting of a tag will happen only through a PR and not from a discord bot command.
This has an issue and PR opened #802