Looks like it is supposed to ping, see this test:

I think the sentence hey @user! was meant to ping the user.
1 messages · Page 38 of 1
Looks like it is supposed to ping, see this test:

I think the sentence hey @user! was meant to ping the user.
It's just a common style we have to refer to a user in embeds, since it leads to a clickable mention that does not actually ping the user. I'm not sure if you can infer the intention from it that you do. I'm not saying that it wouldn't be an option to include it, but I don't think this is an actual bug; it could just be an enhancement.
I think it was left out because the most common way of doing this is !free <mention> instead of !free <id>.
I can't find a consideration for this in the original PR, so I don't know. We should probably discuss if we want this change.
No, not currently. I was waiting on other PRs and eventually forgot about this. If you would like to work on this now, you can. Otherwise, I will try to get started today or tomorrow.
I don't think we're in a hurry, but I was reminded of it from people having some issues with their IDE not recognizing some of the attributes we set dynamically (e.g, api_client). Having a custom Bot class would solve that.
I can work on it, but if you like to work on it, that's fine as well.
I know you didn't touch this but while we're fixing the id_ should this be type_?
Super duper nitpicking on a couple of single quotes but looks fine otherwise 👍
Should this be a double quote?
for colour, hex_value in test_values:
with self.subTest(actual_hex=deletedmessage_filters.hex_colour(colour),
expected_hex=hex_value):
self.assertEqual(actual_hex, expected_hex)
This has no functional difference, but it would make it easier to tell at a glance what the issue was if/when the tests fail. I find that making use of the var names also helps to self-document the exact purpose of...
I definitely approve of the unit test output changes, particularly with organizing them into subtests, and iterating over a tuple of actual and expected results instead of a wall of self.assertEqual(). Here's a couple of minor suggested improvements along the same lines, feel free to rename or reformat:
for text, expected_output in test_values:
with self.subTest(text=text, actual_output=deletedmessage_filters.visible_newlines(text),
expected_output=expected_output):
self.assertEqual(actual_output, expected_output)
ad79540 Use trailing _ instead of leading for some vari... - MarkKoz
There's not an explicit style set though majority prefer double IIRC. There was talks of adding a flake8 plugin for it and if that goes through then this will be taken care of then.
Yeah I went ahead and fixed some of the other ones in the code base (using the regex ^\s*?_\w+).
Build 20191107.1 succeeded
GitHub
00:01:39
Bot
🤔 Where should it go? __main__ would be weird to import from. __init__ already cluttered. bot.py would be weird to import from (cause the package is also named bot).
As the original author of this command, I suppose I should speak on this. @SebastiaanZ is correct, I specifically intended that the bot response not ping the user. Not only does this prevent a double ping with very little effort, but I did not want the bot to ping the user from the invocation of a different user. It is rare for non-staff to ever provide the ID of a user as the argument to a command. While the parsing of the user argument is flexible enough to accept an ID, I intended for ...
In fact, ever since the output of the command was redesigned, I think even the Hey <user> part is completely unnecessary and should've been removed as well.
Now that we have a good idea of how this command is used, I think the !free command should no longer take any arguments. The seek argument is never used, and if the command no longer takes arguments, nothing is stopping users from providing a user mention after the !free invocation.
Postgres backup completed!
Build 20191107.1 failed
GitHub
00:01:38
Site
ec2ae9d Add validation rules to Infraction serializer - SebastiaanZ
cf1a075 Migrate undesirable active infraction to inactive - SebastiaanZ
0d383cb Prevent double active infractions with constraint - SebastiaanZ
6670a3b Merge branch 'master' into active-infractions-v... - SebastiaanZ
e415428 Solve migration conflict by renaming migrations - SebastiaanZ
Build 20191107.2 succeeded
GitHub
00:02:18
Site
3.8 is now (unofficially) present on Azure 🎉
As it stands, the @Helpers role cannot nominate people.
This PR:
@Helpers to the role whitelist for the !nominate commandSTAFF_ROLES and MODERATION_ROLES for the whitelist decoratorsBuild 20191108.1 succeeded
GitHub
00:01:38
Bot
Build 20191108.2 succeeded
GitHub
00:01:39
Bot
Build 20191108.3 succeeded
GitHub
00:03:26
Bot
Connected!
Postgres backup completed!
In the past couple of months, a number of enhancements have been suggested for the commands in the information cog. I decided to make a list of those suggestions (from memory, so please comment the things I've inevitably forgotten) and want to take a stab at implementing those enhancements. In addition, there's also a small bug in the !roles command that needs to be fixed, since it's unusable right now.
!user command targets a non-moderator in a moderat...#532 Is a relevant issue that I've already started work on.
Ah, okay, I missed that in my issue search. I'll just leave the !role commands alone for now.
@atmishra yes, as long as you're comfortable working on both sides of the stack. This will require a change on the site as well.
Excited to grab this one next.
Build 20191108.4 succeeded
GitHub
00:01:37
Bot
Minor formatting nit; argument names should be in asterisks.
"""Makes a message with *total_links* links."""
Build 20191108.5 succeeded
GitHub
00:01:35
Bot
args are in back ticks in all the docstrings I encountered so far so I think it'd be better to just be consistent
it is true that backticks is the prevailing style for this in our repo, and that until we decide to change that, it's probably best to keep doing that. I've never really seen the asterisks thing, and afaik there's nothing about this in PEP257. Can I ask where you picked up that convention @aeros?
Build 20191108.6 succeeded
GitHub
00:01:42
Bot
This doesn't work quite well in this case:

38d9e70 Add unit test for links antispam rule - kwzrd
a216704 Add two more test cases for links rule unit test - kwzrd
9e16b0c Annotate unclear test cases with inline comments - kwzrd
f6ed29c Adjust case to only test a single aspect - kwzrd
9000d92 Add whitespace for readability, consistency & a... - kwzrd
Build 20191108.7 succeeded
GitHub
00:05:07
Bot
Connected!
It's more of a logic bug, since I'm using str.replace() and the deleted word has a length of 1, chances are it will hyperlink more than just one. I'll take a look, if I remember correctly difflib can return the index as well.
@lemonsaurus
Can I ask where you picked up that convention @aeros, or what the reasoning behind it is?
We follow that convention in the CPython docs and docstrings. I don't know the specific reason behind it, but we use backticks for functions or methods, and asterisks for arg names. For example:
`loop.run_in_executor()`
*executor*
Backticks for argument names as well though is probably fine, as long as you're consistent with it.
I'll do some poking around, to see if I can find an actual reason for it or if it's mentioned in a PEP somewhere.
Postgres backup completed!
Interesting. I suppose I can see the usefulness in denoting callables one way and arguments another, what symbol is used might just be arbitrary.
Thanks for the info.
Closes #601.
Implements a unit test for the mentions rule, very similar to #641. Gives 100% coverage.
Also adjusts the docstring style from #641 from asterisk back to backticks for consistency with the rest of the repo.
This was closed by #641.
Build 20191109.1 succeeded
GitHub
00:01:42
Bot
Why are you not using the MockMessage defined in tests.helpers? If it's not important to have a MockMember for author attribute, you can just provide a string for the author field like you do now: MockMessage(author="bob", mentions=list(range(3))) would work and create a mock that follows the specifications of an actual discord.Message object.
I'm not sure if that's desirable though, because in that case the __eq__ will look at the Message's id. So we would need to be manually controlling the id attribute to correctly compare the output tuples. Using a FakeMessage, we simply compare them based on the attribs we need for the test. I believe using MockMessage would introduce needless complexity as a result.
This idea...
Build 20191109.2 succeeded
GitHub
00:01:42
Bot
I'm a bit torn on the complexity argument here.
One of the reasons we use our custom mock objects is because they follow the specifications of an actual instance of the discord.py they are mocking. This means that if a version upgrade in discord.py changes the API of the class/object in a way that's relevant to the code you're testing, the tests will now fail because the code it's testing is trying to use attributes that no longer exist on the actual object.
By creating a static obj...
@scragly Yes, sorry about that, I should have checked before assuming. It looks like discord.Message does not have a custom __eq__ implementation, but I suppose the point is that the id obviously plays a role.
@SebastiaanZ Many thanks for the feedback, I will adjust the test cases as per our discussion on discord.
Build 20191109.4 succeeded
GitHub
00:01:33
Bot
In https://github.com/python-discord/bot/pull/655/commits/16e6c36c6b370300ef7507d2e01421ad0d83f407, tests.helpers.MockMessage is used as suggested. Passing an id (message id, that is) manually actually ends up being unnecessary, as the __eq__ falls back on identity comparison. The test cases just needed to be adjusted so that multiple instances aren't used to represent one message.
Let me know what you think. If this looks good, I will adjust the other rule unit tests to use this met...
This PR rewords the period ping to #checkpoint so it is no longer "ambiguous" to new users.
It also forwards all messages sent in #checkpoint that contained a user or role mention to #mod-alerts.
Consensus from staff is that the previous wording of the message might be the cause for so many users both running !accept and pinging the admins. Full context in issue: [#160](https://github.com/python-discord/organisation/issu...
Build 20191110.1 succeeded
GitHub
00:01:49
Bot
Build 20191110.2 succeeded
GitHub
00:01:50
Bot
Postgres backup completed!
Build 20191110.3 succeeded
GitHub
00:01:46
Bot
Thanks, @lemonsaurus for assigning this to me. I am more comfortable with the site part of this task So it will not be a problem for me. On the command part, can you give me some more details like:
This is my first task on creating a command, So need some more clarity. Thanks!
embed_description = "".join(f"```py\n{textwrap.shorten(signature, 500)}```\n" for signature in signatures)
Adding a newline here improves the style of the embeds by giving a proper space after the codeblock on clients:

Previously, it looked too cramped:

It might be useful to avoid cutting off at a single-sentence paragraph. Doing this resolves cases like glob cutting off at the 'Source code' beginning line if they have too large an introductory paragraph.
In case it is not clear, I changed my code to respond to the requested changes.
resolved in 4795da86d0fef72ac677ae0a8f9e988da1923e17
resolved in 34510f52c6bbe5e2a8bbfc34f8e5d648d0d39a96
Build 20191110.4 succeeded
GitHub
00:01:52
Bot
Build 20191110.6 succeeded
GitHub
00:01:38
Bot
1c0310c Moderation: create a class to handle scheduling... - MarkKoz
832c712 InfractionScheduler: delegate type-specific par... - MarkKoz
c1ab8ec Superstarify: add icons to constants and config - MarkKoz
6ba259a InfractionScheduler: use fetched user for notif... - MarkKoz
3cf0dbf Superstarify: schedule infractions by subclassi... - MarkKoz
4dccaca Reword periodic #checkpoint message - fiskenslakt
01ab4ad Forward user/role pings in checkpoint to mod-al... - fiskenslakt
0425e6c [kaizen] Remove now duplicate channel check - fiskenslakt
f3dbe47 Merge branch 'master' into checkpoint-changes - MarkKoz
51852a1 Merge pull request #656 from python-discord/che... - MarkKoz
Build 20191110.7 succeeded
GitHub
00:01:47
Bot
Build 20191110.8 succeeded
GitHub
00:03:31
Bot
Connected!
Build 20191111.1 succeeded
GitHub
00:01:41
Bot
Postgres backup completed!
Build 20191111.2 failed
GitHub
00:01:30
Bot
ec2ae9d Add validation rules to Infraction serializer - SebastiaanZ
cf1a075 Migrate undesirable active infraction to inactive - SebastiaanZ
0d383cb Prevent double active infractions with constraint - SebastiaanZ
6670a3b Merge branch 'master' into active-infractions-v... - SebastiaanZ
e415428 Solve migration conflict by renaming migrations - SebastiaanZ
09f923b Initial navbar change to add settings button ne... - gdude2002
7bdd610 Bring navbar styling in line on mobile as well - gdude2002
a82e15f Allauth: Re-add GitHub provider, prevent GH sig... - gdude2002
3512a71 GH signup prevention, views and templates for s... - gdude2002
ea149e7 Signals: Move group changes outside of the loop - gdude2002
Build 20191111.1 succeeded
Sebastiaan Zeeff
00:02:47
Site
282d727 Bump flake8 from 3.7.8 to 3.7.9 - dependabot-preview[bot]
Build 20191111.2 succeeded
GitHub
00:09:19
Site
A few additional things have come up that could be worked on RE the account system.
Build 20191111.3 failed
GitHub
00:01:16
Bot
- any restrictions on who can call this command or in which channels?
It should definitely be restricted. I think this falls under the umbrella of server administration, so it would make sense to restrict this to those with the admins or owners role. There are constants defined in config-default.yml/bot.constants with the relevant role IDs. It's not really sensitive information, so I don't think a channel lock-down is necessary to prevent accidental data leaks.
- Should it also ...
Build 20191111.3 succeeded
GitHub
00:02:12
Site
This is added by #40 as part of the 3.8 compatibility changes.
OK, I won't notify you again about this release, but will get in touch when a new version is available.
If you change your mind, just re-open this PR and I'll resolve any conflicts on it.
Hi,
This PR just add a new pipenv run start command that would be very useful to people that run the site without docker.
Build 20191111.4 succeeded
GitHub
00:02:17
Site
Requires --debug flag when using run during development.
Interrobang (‽) is a valid character also.
We should look for any other unicode characters we might have missed that are allowed in channel names.
Currently tags are used randomly, however randomness is pretty far from evenness. It would be nice to make use of tags more evenly, to avoid recently used tags being used multiple times.
One method would be to have a column tracking usage in the current iteration, a bool of True/False. used=False would be the default for new tags. The pool of available tags to pick from will be all tags with used=False. When a tag it picked, it'll be given used=True. Once no tags are returned for `us...
Should we instead store the number of times tags have been used and use that as the weights ( max - current ) so unused tags have more chance to be used? That way we can have a nice chart of tags and its usage as well.
It's possible the original issue description wasn't clear as I for some reason was saying "tags" instead of "names", which is my bad, and partially because I was talking about tags at the same time as writing this up lol.
Since this is for offtopic names, there's no nice chart to be had, since usage would be distributed evenly.
Ah I see, thank you for the clarification. If we only want every name to be used evenly then yes I agree, a column of True / False will be much lighter, and can easily guarantee every name will be used until reset.
Postgres backup completed!
There's no reason to indent all items contained within this if. It's better to invert the if and dedent the contents:
package = await self._fetch_inventory(inventory_url, config)
if not package:
log.trace(f"No inventory for {package_name}.")
return
for group, value in package.items():
Another case of code saying the same thing as the comment, making the comment unnecessary.
This doesn't match the typical style in the project. We drop multilines to a newline:
embed.set_footer(
text=", ".join(renamed for renamed in self.renamed_symbols - {symbol} if renamed.endswith(f".{symbol}"))
)
@scragly I know, this command allows you to do pipenv run start --debug too.
We aren't about to use pipenv run during production, so there's no reason to omit it from the command in it's entirety.
6fe9533 Add the --debug flag to the start command - Akarys42
@scragly flag added :heavy_check_mark:
Build 20191112.1 succeeded
GitHub
00:02:14
Site
Build 20191112.2 succeeded
GitHub
00:04:05
Site
Build 20191112.3 succeeded
GitHub
00:02:27
Site
This comment wasn't made by me, should I remove it anyway?
If you agree with the comment, yeah it would fit under our idea of kaizen, improving upon aspects we work on that might not be immediately required under the scope of the PR.
Build 20191112.1 succeeded
GitHub
00:01:53
Bot
Build 20191112.2 failed
GitHub
00:01:37
Bot
Build 20191113.1 succeeded
GitHub
00:01:47
Bot
Postgres backup completed!
We'd like to be able to link otnames together, so that they always appear at the same time. This issue needs to be handled at the same time as the problem is solved on the bot side, because both will rely on each other for proper testing.
For example, we may want the following names to always appear together:
#ot0-what-is-your-name?
#ot1-what-is-your-quest?
#ot2-what-is-your-favorite-color?
linked_names. This...We'd like to be able to link otnames together, so that they always appear at the same time. This issue needs to be handled at the same time as the problem is solved on the site side, because both will rely on each other for proper testing. The site issue can be found at https://github.com/python-discord/site/issues/310.
For example, we may want the following names to always appear together:
#ot0-what-is-your-name?
#ot1-what-is-your-quest?
#ot2-what-is-your-favorite-color?
Il wouldn’t be smarter to use 2 ForeignKeys inside the linked_name field? I think it would be easier to just create 3 OffTopicName and link them together, so when one the name is chosen, we can just resolve the 2 other name. It would probably be easier for future OT name editing or deletion too.
Yeah, it might be better to use foreignkeys. If we edit one of these off-topic names, we would want the new name to be carried into all the linked_name fields. We should probably think about what happens if we delete one of them too. Will having foreignkeys in the array ensure that they disappear from the array?
We could make them be null value or just make them disappear when deleted by changing the on_delete setting of the field, and make sure the view return a random OT name if one linked_name is null or empty.
well, it's something we'll probably need to play around with. But I'd be open to a solution that involved ForeignKeys as long as it works and solves all our use cases and edge cases.
This issue is to better aid giving context to infractions.
When the bot deletes spam, offending messages are stored in the database and linked to a grouped context ID which has very readable logs viewable on the staff subdomain. The proposal is to allow staff to manually store chosen offended messages for the bot to return a context ID which we can then store within infraction reasons.
A new top-level command group will be created called context and will have the following signature:
...
This pull request introduces several enhancements to our testing suite to make running tests easier and reduce the number of developer surprises. It does come with a couple of breaking changes that may influence currently open PRs (I haven't checked yet, but they should be easy to resolve).
One of the reasons for using custom mock types is because they follow the specifications of the actual objects they're mocking. However, as @kwz...
Build 20191113.2 succeeded
GitHub
00:01:47
Bot
Spectacular work. Let's do it.
Build 20191113.3 succeeded
GitHub
00:01:47
Bot
dceafb8 Prevent unwanted logging while running tests - SebastiaanZ
bf7720f Allow name attribute to be set during Mock init - SebastiaanZ
36e9de4 Prevent setting unknown attributes on d.py mocks - SebastiaanZ
7f4829e Prevent await warnings for MockBot's create_task - SebastiaanZ
d5b6ef4 Merge branch 'master' into unittest-helpers-imp... - scragly
Build 20191113.4 succeeded
GitHub
00:03:49
Bot
Connected!
Build 20191113.5 succeeded
GitHub
00:01:45
Bot
1c0310c Moderation: create a class to handle scheduling... - MarkKoz
832c712 InfractionScheduler: delegate type-specific par... - MarkKoz
c1ab8ec Superstarify: add icons to constants and config - MarkKoz
6ba259a InfractionScheduler: use fetched user for notif... - MarkKoz
3cf0dbf Superstarify: schedule infractions by subclassi... - MarkKoz
Build 20191113.6 succeeded
GitHub
00:01:49
Bot
Build 20191113.7 failed
GitHub
00:01:32
Bot
Build 20191113.8 succeeded
GitHub
00:01:50
Bot
Build 20191114.1 succeeded
GitHub
00:01:47
Bot
Postgres backup completed!
I would mention the additional memory overhead associated with initializing and appending to the internal list; it's not just noisy boilerplate, there's also a significant cost associated with doing so.
It's also worth mentioning somewhere underneath this section when to use a list instead of a generator. Otherwise, a beginner might walk away from this assuming they should always use a generator, which is definitely not the case. If it needs to: be iterated over multiple times, accessed ...
That's some good point, here's a quick benchmark, in my machine,
import timeit
import os
import psutil
process = psutil.Process(os.getpid())
prev = 0
def current_memory(message: str):
global prev
current = process.memory_info().rss / 1024 / 1024
print(message, f"| {current:,.2f} Mb ( +{current - prev:,.2f} )")
prev = current
def get_gen():
return (i for i in range(1_000_000))
def get_list():
return [i for i in range(1_000_000)]
current...
@SebastiaanZ I'm marking this as resolved since we're now using MockMessage, feel free to un-resolve if there's more you'd like me to change.
Build 20191114.2 succeeded
GitHub
00:01:48
Bot
Occasionally, two users will be too busy fighting each other to notice a moderator trying to step in and clean up the situation. In these cases, we want to be able to silence the channel for a few minutes while we sort out what's going on and what we're going to do about it.
Enter: !hush. This command will remove the ability for anyone except staff to post messages in that channel for a short duration, 10 minutes by default.
This will not need any work on the site, so it should be q...
@aeros
Isn't the time and memory overhead mentioned in the second item?
You will have to compute the result (which might be infinite) first, and this can take a lot of time and memory.
Maybe I can make it more explicit, though.
Yeah, but there's a difference between the cost associated with getting all of results at once, vs the cost from initializing and appending to an internal list.
@ikuyarihS
def get_gen():
return (i for i in range(1_000_000))
def get_list():
return [i for i in range(1_000_000)]
Between these two tests, I think there's some degree of bias towards the generator. Upon initialization, it doesn't have to compute any of the results (unlike the list, which it will do all at once). It might paint a more accurate picture if you compared the time to both initialize the comprehensions and iterate over the results. For example:
`...
ccda39c Add bot=False default value to MockMember - SebastiaanZ
61051f9 Add MockAttachment type and attachments default... - SebastiaanZ
8c64fc6 Check only for bot's green checkmark in DuckPond - SebastiaanZ
f56f6ce Refactor DuckPond msg relay to separate method - SebastiaanZ
89890d6 Move payload checks to start of DuckPond.on_raw... - SebastiaanZ
While I love the idea of the dynamic amount of h's idea, I really don't see the point in having a duration for this. Are we assuming that the invoker will forget to unmute the channel? This should absolutely just be a toggle in my opinion. Mute and unmute, that is all.
My rationale for this is two-fold:
Build 20191115.1 succeeded
GitHub
00:01:52
Bot
I just realized that I did not yet add tests for the new mock types I've added. I'll do that tomorrow, sleep first.
I think defaulting to 15m if not passing in duration is a fine idea as well, but having duration will let mods be more flexible in more cases.
I would certainly don't want to see a channel being locked up longer than necessary when there are a lot of people asking.
An example would be like this - After I muted the channel for 5m as a clear sign that the conversation is to be dropped off, if I still see wrong behaviors then I'll issue mute directly and for much longer duration. In that ...
Postgres backup completed!
So far looks good. Have gotten to everything except a692a95896328adf1d52c5a5548e0c72540d6cbc though; will review the rest tomorrow or on the weekend.
Shouldn't this be <@id>? That's how discord.py does it.
Build 20191115.2 succeeded
GitHub
00:01:44
Bot
@fiskenslakt
Duration often causes command misfires due to typing it incorrectly.
...
Having a duration also makes the command more complicated, and will likely cause some staff to forget how it works
The duration is optional and I think the default of 10 minutes is reasonable enough that it would be very rare to need to specify a duration at all. And when you do need to, the syntax is so simple (!hush 5for 5 minutes) that I'm not sure I buy that people would forget it if they ...
80c5799 Allow blank attachment field - Akarys42
912ecff Delete useless migration file - Akarys42
Build 20191115.2 failed
GitHub
00:01:39
Site
071bc9d Add logging for moderation functions - MarkKoz
818e48b Moderation: use trailing _ instead of leading f... - MarkKoz
ad79540 Use trailing _ instead of leading for some vari... - MarkKoz
b7aba6b Merge branch 'master' into moderation-logging - lemonsaurus
bef90dd Merge pull request #619 from python-discord/mod... - lemonsaurus
I'm not sure this part should be deleted, as discussed in #dev-contrib I believe we should wait for response from @SebastiaanZ to confirm what it is doing first.
You can use ContextManager here to ensure buffer will close properly, like this
with BytesIO() as buffer:
await attachment.save(buffer, use_cached=True)
reupload: discord.Message = await channel.send(file=discord.File(buffer, filename=attachment.filename))
out.append(reupload.attachments[0].url)
ec2ae9d Add validation rules to Infraction serializer - SebastiaanZ
cf1a075 Migrate undesirable active infraction to inactive - SebastiaanZ
0d383cb Prevent double active infractions with constraint - SebastiaanZ
6670a3b Merge branch 'master' into active-infractions-v... - SebastiaanZ
e415428 Solve migration conflict by renaming migrations - SebastiaanZ
Build 20191115.3 succeeded
Leon Sandøy
00:03:41
Bot
Connected!
Build 20191115.3 failed
GitHub
00:01:45
Site
Build 20191115.4 succeeded
GitHub
00:02:27
Site
Build 20191115.4 succeeded
GitHub
00:01:52
Bot
One more bracket styling to fix (same as the previous ones but you added this one while removing the others). And adding back in some lost info after a comment was taken out.
for symbol, (package_name, _version, relative_doc_url, _) in value.items():
Removing the comment was under the idea of not removing any provided info, so the second item in the tuple should still be _version to indicate we don't use it (underscore used) and describing the item in case we do need it sometime in future.
This does not match the project style, as we drop the line after the bracket. In this case, though the line fits within the allowed 120 line length so can be reduced to a single line.
embed.set_footer(
text=", ".join(renamed for renamed in self.renamed_symbols - {symbol} if renamed.endswith(f".{symbol}"))
)
I can change it; I used this because name is usually more descriptive in the test output and I did not think having the actual mention format here would aid in testing. If a particular piece of code does need the correct format, an explicit mention can still be passed as a kwarg.
Comment from @SebastiaanZ in #dev-contrib:
It should not wait 10 seconds to delete the messages after triggering, but it should take action as soon as possible
However, since you are going to relay the attachments, that's something that could happen earlier
The DeletionContext tracks the messages that should be deleted
Theaddmethod of that class seems like a good place to relay the attachments and save the links to those
That happens before the messages are deleted
I’m g...
Build 20191115.5 succeeded
GitHub
00:01:44
Bot
Slowmode has been implemented and while formatting isn't perfectly consistent, people have indeed been going much better in the past with adding in all required info into a single message.
I'd like to ask, is it worth the effort of enforcing the above proposed format?
If it is, how would the format be enforced? Filter checking messages posted or maybe having the bot post it on their behalf through a command that asks for info for each part?
Looks good to me now, thanks for your work!
Superstarify could do with a bit of an upgrade.
It has a severe lack of images. Which is a little saddening. But if we add them, it'll be awesome.
It would also be great to add it into the db, add an admin view for it and create bot commands that will add, remove, edit, list stars similar to our off-topic name setup, which would require some work with site as well.
@lemonsaurus also demands an alias be added of !superstar.
Build 20191115.6 succeeded
GitHub
00:01:43
Bot
Related: https://github.com/python-discord/bot/issues/662
In order to allow the superstarify pool of stars to be added into the database, we'll need to define a table schema, the endpoints we'll interact with and the admin view to define for interacting with it on the website admin interface.
The table will require at least:
We need to be able to do the following via the api:
@kosayoda I think that's a good solution. If you get a chance to do it, that'll be great. I've assigned you to the ticket.
Why not simply delete the code and repost it correctly encoded
A few reasons:
I don't see an issue with adding the "you can edit your message" section in with emphasi...
The config alterations can be done at the same time as #206 is addressed.
The site API endpoint may need to be adjusted allow for the option to fetch a moderators latest infraction.
Build 20191115.7 succeeded
GitHub
00:01:45
Bot
4efb97c add handling for duplicate symbols in docs inve... - Numerlor
f1dbb63 show renamed duplicates in embed footer - Numerlor
a05f28c Auto delete messages when docs are not found - Numerlor
eda6cd7 remove "function" from NO_OVERRIDE_GROUPS - Numerlor
d5dea25 Don't include a signature and only get first pa... - Numerlor
Connected!
Build 20191115.8 succeeded
GitHub
00:03:51
Bot
Define it in bot/bot.py. Sure it might feel a little odd but it's the most appropriate place for it.
Stalled until the API side is implemented.
This ticket is open to anyone wishing to claim it.
Tags are now part of the site API, and are editible by mods+ in the admin panel.
For now, we've added a tag directory with tag contents in individual markdown files within the meta repository:
https://github.com/python-discord/meta/tree/master/tags
For now, it's a manual process of adding or editing tags via bot or site admin whenever we get a PR merged in, however in the future this could possibly be more automated.
Due to the change in situation, I'll close this ticket.
Already being addressed as part of #519
I've verified just now that the bug is still present.
It appears this bug has been resolved after moving to the django branch. Closing due to this.
Possible improvements have been discussed for the reminder command:
!remind "@Admins meeting in 5 minutes" every Sunday at 20:55Hi @atmishra, sorry for the delay, you're welcome to take on this ticket if you like. Let me know if you're okay to work on it and I'll assign you to it.
The standards we hold ourselves has greatly increased since the creation of this ticket in regards to handling user data and privacy.
While the concept of having a feature like this is still something that pops up occasionally, the limitations and expectations have shifted a bit.
Statistics on member activity would likely be directly limited to only staff members to avoid potential issues with stats gathering on general members.
The only statistics data point that has been generall...
Is this proposing fuzzymatching along with disambiguation by showing all available choices, or just disambiguation of all exact partial matches.
I closed #388 and the meta repo contains markdown files of any of our tags for now for the public to read through and be able to submit PRs for adding or editing tags.
At the moment the process of adding or editing the tags is done via bot command in-server or by using the site's admin page (mods+ now have full access to the tag admin page).
There's improvements that can be done to make things easier and to automate/integrate the process, but I'm of the opinion that tags will continue...
Merging #126 into the scope of this ticket as they're close enough related.
Kingsley McDonald: many error responses in the
Moderationcog aren't sent as an embed. instead, the messages are sent with a very simple (and ugly) :x:. all occurrences of this should be changed to be consistent with the rest of the bot's responses.
Mark: It seems we are moving away from embeds in favour of plain messages because they have less clutter. The downside is that they are no longer as pr...
Closing this in favour of #131
One can just post the image in the mod channel, copy the url and use an inline link within the reason:
check [this image](https://cdn.discordapp.com/attachments/464905259261755392/644886455243636736/d2ap7cyb1xj31.png) to see the terrible thing
Doing this renders perfectly fine in infr history and it won't involve uploading images anywhere other than the discord channel (which we usually do anyway when getting context for things such as dms).
Due to the above, and the fact that this h...
@MarkKoz and I recently defined groups for the current bot functionality in order to define easy enough to understand area labels in Github.
We settled with the following:
A moderator ping seems to be the go and the ticket has been given a good amount of time for additional discussion.
The flag idea, while fun, does seem to add complexity to a system that cannot be appropriately justified.
Due to this, I'm closing the issue.
I'm moving spirit of the suggestion from #176 to over here for consideration as it falls under the scope of this issue:
Having some form of indication in !user output to indicate how recently an infraction was given if they have one.
The original suggestion calls for a :x: emoji to be placed next to the name, however I personally think it would be better to just have a line stating how long ago the last infraction was above the outputted groups.
Closing in favour of #654
Closing in favour of #468 which encompasses the fix for this.
I think the default of 10 minutes is reasonable enough that it would be very rare to need to specify a duration at all
Agree
!hush forever
I like this option, as it sticks to the idea of having a duration as the argument still, so it doesn't introduce just another thing to remember (unlike !permahush)
ping us in #mod-alerts every 15min or so reminding us
Agree
Yes, sounds like an excellent addition. I've already done most of the stuff outlined in the issue above, but more suggestions are welcome.
This list isn't final even though I'm pretty happy with it personally. Feel
free to comment if you have any suggestion improvements or changes to it.
Furthermore, I think we should take the opportunity to rename the cogs
subpackage to extensions or probably the shorter, and likely better,
exts.
Den fre 15 nov. 2019 08:24scragly notifications@github.com skrev:
@MarkKoz https://github.com/MarkKoz and I recently defined groups for
the current bot functionality in order to define ...
I played around and wrote a possible method to split things up into "interpretations" of text messed up with spoilers:
SPOILER_RE = re.compile(r"\|\|", re.DOTALL)
def process_spoilers(text):
split_text = SPOILER_RE.split(text)
public_text = "".join(split_text[0:][::2])
spoiler_text = "".join(split_text[1:][::2])
cleaned_text = "".join(split_text)
return public_text, spoiler_text, cleaned_text
It was decided in a meeting that we want to go with this approach.
Therefore, I think that if this is going to be closed, there should be a
consensus to reverse the decision to do this. And, to be clear, when this
was decided, the tags view already existed on the API.
Den fre 15 nov. 2019 06:28scragly notifications@github.com skrev:
Closed #388 https://github.com/python-discord/bot/issues/388.
—
You are receiving this because you authored the thread.
Reply to this email direct...
Very well, I'll open an org issue for it to be discussed in the next staff meeting.
There's conflicts that need addressing for this PR before further review.
I's suggest more explicit naming for these and the message_edit args so it's clear what type of object we're working with.
_before could be content_before
before could be msg_before
Same for _after and after.
The same checks need to be present for message edits as well.
One more thing. Aside from that LGTM
Build 20191115.9 succeeded
GitHub
00:03:27
Bot
I think we should take the opportunity to rename the
cogs
subpackage toextensionsor probably the shorter, and likely better,
exts.
definitely agree
It appears ' is treated as punctuation.
!t set ' ' succeeds with:
tag_name: '
tag_content: '''
This works with any character besides ". We could ignore punctuation entirely but that would cause issues with current tags that use - as a separator.
Explicitly allowing separators like -, _, and while ignoring everything else could be an option.
e66ed4b Renamed variables to be more explicit, added ty... - ikuyarihS
I like the way you name them, msg_before and content_before both are good name, and explicit, so I am going to steal them!
Build 20191116.1 succeeded
GitHub
00:01:45
Bot
As stated in the issue, the nickname should be in parenthesis. Right now, this will show the username + discriminator. Keep in mind the nick may be None. In that case, the parenthesised info can also be omitted.
Needs to be the nickname. See other comment.
Needs to be the nickname. See other comment.
Postgres backup completed!
Could add the users anyway to test that the function won't short circuit or something whenever it sees the bot reacted.
To have consistent style these should be like
helpers.MockMessage(
reactions=[
helpers.MockReaction(emoji=self.duck_pond_emoji, users=[self.staff_member]),
helpers.MockReaction(emoji=self.unicode_duck_emoji, users=[self.staff_member]),
]
),
but perhaps making an exception is in order here.
I think asserting the exact message may be going too far.
The site API endpoint may need to be adjusted allow for the option to fetch a moderators latest infraction.
I don't think so. Looks like it already supports filtering by actor and ordering by any field (in this case it'd be inserted_at).
Build 20191116.2 succeeded
GitHub
00:01:40
Bot
Build 20191116.3 succeeded
GitHub
00:01:32
Bot
I've left this be until #625 has been merged - it should be a simple fix then (and to resolve the merge conflicts it will create)
It's to assert it's not another logging message, but the one we actually expect. I can remove it, but it's a pattern that's used more often in our tests (both in bot, but also in site, if I recall correctly).
I was playing with this. The sheer number of lines made me go with this version in the end, although I can change it back to the other style if the consistency trumps the number of lines here. For me, the longer version was less readable, though; the information density was getting low.
No, anyone with manage channel permissions could remove it. If that happens and we don't add it back, an additional duck added by a staff member will cause the message to be relayed again. I think @lemonsaurus has to make a call on this, since it's his design.
What do you mean by shortcut? Without users specified, the AsyncIteratorMock will be initialized with an empty list and never with a user with an id equal to the bot.
Build 20191116.4 succeeded
GitHub
00:01:38
Bot
Build 20191116.5 succeeded
GitHub
00:01:49
Bot
09f923b Initial navbar change to add settings button ne... - gdude2002
7bdd610 Bring navbar styling in line on mobile as well - gdude2002
a82e15f Allauth: Re-add GitHub provider, prevent GH sig... - gdude2002
3512a71 GH signup prevention, views and templates for s... - gdude2002
ea149e7 Signals: Move group changes outside of the loop - gdude2002
Build 20191116.1 succeeded
GitHub
00:02:06
Site
I don't think that a benchmark would fit into a tag -- tags should be very short. I think this can be posted to the wiki (later).
Build 20191116.2 succeeded
GitHub
00:02:08
Site
4efb97c add handling for duplicate symbols in docs inve... - Numerlor
f1dbb63 show renamed duplicates in embed footer - Numerlor
a05f28c Auto delete messages when docs are not found - Numerlor
eda6cd7 remove "function" from NO_OVERRIDE_GROUPS - Numerlor
d5dea25 Don't include a signature and only get first pa... - Numerlor
Build 20191116.6 succeeded
GitHub
00:01:40
Bot
@decorator-factory
I don't think that a benchmark would fit into a tag -- tags should be very short. I think this can be posted to the wiki (later).
Good point. But we should at least mention the important performance differences between lists and generators, so that new users can walk away from this with a basic understanding of when to make use of either.
Let's say the function would return True if it saw the bot reacted, even if the reaction wasn't a green check mark. This is not desirable of course, so we'd want to test that doesn't happen. If the author of the reactions in this test case is made to be the bot, then this test case can also be used to test for the situation described above.
The log is captured from a specific logger and the level is asserted. You don't think that is adequate? It seems that the contents of the message don't actually matter but checking them is merely the way to be sure the correct message is sent. In practice, it's unlikely to be a nuisance but it does seem silly to have to change a test case when one wants to edit a log message.
If you'd like, we can leave this and save the discussion for another place since it affects all tests.
You're right. I tried but didn't see how do it at first.
What does a reset even do here? Does it make it awaitable again?
Also, I think the context managers are kind of ugly. Do you think it still looks better as decorators even if it means having to call reset?
Another option would be to factor out the checks to their own helper methods that can be tested at a unit.
Perhaps, but how would that look? I feel like it'd add bloat to the code considering how simple the checks are. Maybe it's just a necessary thing to deal with if we want nicer tests.
might be overkill. I don't mind if we keep it or not.
I prefer it this way, the fully expanded way is less readable.
Could be something like this:
@staticmethod
def _payload_has_duckpond_emoji(payload: RawReactionActionEvent) -> bool:
"""Test if the RawReactionActionEvent payload contains a duckpond emoji."""
if payload.emoji.is_custom_emoji():
if payload.emoji.id in constants.DuckPond.custom_emojis:
return True
elif payload.emoji.name == "🦆":
return True
return False
@Cog.listener()
async def on_...
Build 20191116.7 succeeded
GitHub
00:01:38
Bot
Build 20191116.8 succeeded
GitHub
00:01:43
Bot
I don't really like helper methods being mixed in with the tests. I'd probably group them all at the top.
Already done so may as well keep it.
Postgres backup completed!
This pull request adds API to manage whitelist in the Database. Includes following changes:
Build 20191117.1 failed
GitHub
00:01:58
Site
Build 20191117.2 failed
GitHub
00:01:54
Site
Build 20191117.3 failed
GitHub
00:02:06
Site
Postgres backup completed!
Users posting the same question in all the help channels at once is a problem that can easily be solved by the bot. Thus, let's add a filter to catch and notify those users.
Implementation details:
Build 20191118.1 succeeded
GitHub
00:02:16
Site
Connected!
Build 20191119.1 succeeded
GitHub
00:03:37
Bot
Postgres backup completed!
There should be a test for the attachment images being in the HTML, similar to the embed tests.
Shouldn't there be some error handling for failed saves? According to the docs, the proxy_url may still fail.
The parameters are indented too far.
Well I'm going to move this function so there shouldn't be a case where the proxy_url fail, but if we get a traceback, we don't really care, because we just abort the re-upload.
I would think it's better to try to upload as many attachments as possible rather than abort when any fail.
Anyway, the re-upload will take place before the message deletion, so there shouldn’t be any reason for the re-upload to fail, and if there is, we should better log it and continue re-uploading isn’t?
Yeah, just a simple log is fine.
Build 20191119.2 succeeded
GitHub
00:01:42
Bot
Despite the parameter is type-annotated, I feel catching AttributeErrors or using hasattr is better than checking the type. Generally I prefer to not set restrictions on entire types unless I have to. All that is needed here is one attribute - we don't actually care what the type is as long as it can give us a name or nick. Maybe it doesn't matter since the type annotation already "restricts" it. What do you think?
Both the user and actor in infraction_to_string need to be modified to be consistent with other outputs (for the actor, it should be plain username + discrim instead of a mention).
Both the search and edit commands could use the expanded endpoint to retrieve usernames (but unfortunately not nicknames). You could fall back to displaying the username in parenthesis if get_member() fails as it'd still be useful if the mention ends up failing due to cache. This applies to the actor too, wh...
So for context, we just had an incident where someone was auto spamming a channel. The bot caught the initial spam, gave them the 10 minute mute, as expected. However, after they were unmuted, the spam continued, at the same rate and enough that it should have triggered a second mute. It didn't. This needs to be investigated.
at the same rate and enough that it should have triggered a second mute
Are you sure this is true? There really isn't enough information here to diagnose what, if anything, needs to be changed here.
I checked and they did not seem to have had activity after their first mute that would trigger an AntiSpam rule normally. Currently, AntiSpam rules look at activity in a single channel, not activity spread out over multiple channels.
Postgres backup completed!
4e85653 Correct the discord tos link in rules endpoint. - scragly
In the rules bot command, the link to the Discord TOS for rule 1 was directing to the guidelines page instead. This corrects that.
Build 20191120.1 succeeded
GitHub
00:02:20
Site
Build 20191120.2 succeeded
GitHub
00:04:22
Site
Hi
So I have a suggestion, not sure if here's where I should post. If it's the wrong place, let me know so I could relocate it
I was thinking, we could have a !wiki command
where !wiki 'xyz' would make the bot fetch the wikipedia article on xyz if it exists.
Just a thought
And I think that's worth looking into as a tweak, at the very least.
In addition to checking the rules for a relevant chunk of channel history, we could also check the rules against a chunk of user history. Downside is that we'd need another async for history call, but it would catch people spamming messages across channels.
Build 20191120.3 succeeded
GitHub
00:02:05
Site
If there are no additional comments I'm going to go ahead and add the current version onto master so it's ready for whenever #40 is merged.
Some aspects of the test suite are written in a way that makes them fairly fragile and difficult to both maintain and add additional cases to.
As an example, test_column_line_numbers relies on explicitly coded locations matching the formatting of column_line_numbers.py, making upda...
Postgres backup completed!
Good idea. Are you planning on working on it?
e528265 Add test for single TYP301 yield per function - sco1
I've partially merged in some of the refactoring being undertaken as part of #50 to fix some bugs that were identified on this release branch
Postgres backup completed!
This has been actioned & added to #40
Hey guys,
I'd love to see this library get going, how are your spirits?
Hey guys,
How are your spirits?
I'd love to see this get going..
What on earth
I'm sure the guys at #esoteric-python would love to see forbiddenfruit to be added, and tbh that would allow us to do some cool things 😁
out of curiosity, why do packages need to be added on the codebase rather than just having a config with allowed modules?
Because nobody has written a feature that allows for the specification of packages in a config file rather than pulling directly from the project’s dependencies
looks to me like a simple requirements-exposed.txt or something would do the trick
Postgres backup completed!
I can work on it if I'm assigned to do so.
I say assigned because I'm slow with these things now, so it would take me a little longer than it would take an experienced guy to code it up and then I'd hate to code it up just to see someone else having done it before me.
So if I can be given the job with some time to do it, and that no-one else is to do it meanwhile, then sure, I'd love to work on it.
That would not be my preference.
It creates more visual distance between the helper method and the place where it's being used (which is the test right below the helper method) and this helper method is specifically written for the test that comes just after it. Moving it up would mean having to scroll up and down to understand the test.
I've copied the style from other tests that already exist. I'll change it to a style that does not use iterable unpacking.
That's okay with me. I liked the verbosity when reading the name, as it spells out what's going to happen at that point in the code and relay_message feels more generic (which this method is not). It doesn't really matter, though, so I'll change it.
We're trying to assert calls to the mock objects; a reset makes sure that the call history of previous (sub)tests don't carry over to the tests after them.
Heyo! I read in #meta that you guys are looking for more animated logos, and I thought I'd give it a shot. I came up with this, and I hope it's okay :)
I can make whatever changes and tweaks requested, if the idea for the icon is accepted 😁
I hope you like it. Thank you for reading and considering this. 😁
Looks good to me!
For the sake of consistency with the other animations we have, could you also export one in 1024 x 1024 resolution, named blinky.gif?
Looks good to me!
For the sake of consistency with the other animations we have, could you also export one in 1024 x 1024 resolution, named
blinky.gif?
Ah, missed that one! Thank you for the positive feedback 😁
Currently we're only able to read messages that were sent as a DM to our bot that trip our filters. We should relay all messages that are sent to the bot, and who sent it.
Depends on #174 being actioned.
This should probably be discussed, but I propose we make it work the same as #big-brother does. I'm not certain on the specifics, so if you are, please edit this issue. Essentially I beli...
15244bb Move test-specific partial functions from helpe... - sco1
This has been actioned
In the upcoming jam, teams will not consist strictly of 2 members anymore.
In addition to showing the expiration datetime, display the time delta between the expiration and creation of the infraction.
This is optional, but it would also be useful knowing how much time is left until the infraction expires. I may create a separate issue for this, and if so, link it here.
Current implementation:
Created: 2019-11-23 20:09
Expires: 2019-11-30 20:15
Suggested implementation:
Created: 2019-11-23 20:09
Expires: 2019...
In addition to the creation and expiration datetimes displayed in an infraction search, display how much time is currently left until the infraction expires at the time of invocation.
Proposal:
Created: 2019-11-23 20:09
Expires: 2019-11-30 20:15
Remaining: 5 days, 1 hour
In regards to granularity, my proposal is to only show the 2 largest units. So if it expires in more than a year, show only years and months. If over a month, show only mont...
I reproduced this by sending 3 duplicate messages, all containing (the same) attachment. Messages do get deleted if they are sent without the attachments.
Ignoring exception in on_message
Traceback (most recent call last):
File "/home/mark/repos/python/bot-pydis/.venv/lib/python3.7/site-packages/discord/client.py", line 270, in _run_event
await coro(*args, **kwargs)
File "/home/mark/repos/python/bot-pydis/bot/cogs/antispam.py", line 203, in on_message
await self.maybe...
Postgres backup completed!
There was another incident today

I had to remove the embed manually, and asked user to change their token.
How's the progress on the issue? Are we still waiting for a reordering / restructuring of the order of on_message events across all cogs? Or are we going to implement a specific fix for this one listener?
The PR is finished, waiting for review for more than a month.
Looks nice! Can you add a 5 second pause to the end of this animation, following the conventions established by the other animated logos? For example, it can blink 6 or 8 times, and then take a 5 second break. During this break it should display the default logo. It's also important that the first frame of the gif is our regular logo (not sure if that's the case here), so that it will display correctly when not hovering.
Otherwise this is good work!
Not sure we will need this, but we might as well merge it.
Gonna close this, no action for almost two months and the event is way over.
I love this one. Not sure we'll ever use it now that the event is over, and given how good Ava's is, but we might as well merge it.
Looks nice! Can you add a 5 second pause to the end of this animation, following the conventions established by the other animated logos? For example, it can blink 6 or 8 times, and then take a 4 second break. During this break it should display the default logo. It's also important that the first frame of the gif is our regular logo (not sure if that's the case here), so that it will display correctly when not hovering.
Otherwise this is good work!
Hey Lemon! Thank you very much ...
Postgres backup completed!
Looks good, just a small comment.
Could this not be in parse_codeblock or a check that returns early before this?
if not TokenRemover.is_token_in_message(msg):
return
...
You can also do:
sha = subprocess.run(['git', 'rev-parse', '--short', 'HEAD'], stdout=subprocess.PIPE).stdout.decode('utf-8')
to get the current commit sha1.
Would it be better to utilise the 1-hour expiry of the tokens to not refresh them every time a command is run, instead only if a command is run and the access token is older than an hour? For me, if I were to check the top command, I would probably check the weekly and daily at the same time - even if I was just testing/seeing what the command does. This may reduce some unnecessary token regeneration, keeping the command a little faster.
Something like
# setting:
self.access_tok...
Hey! I looked at the antimalware.py and felt like I could improve a bit, and I hope I've accomplished that. I look forward to your review of this pull request! :grin:
Here's a list of differences that has been made:
Build 20191125.1 failed
GitHub
00:01:17
Bot
Build 20191125.2 succeeded
GitHub
00:01:45
Bot
I notice that you removed the try/except, any special? Logging is useful
https://paste.pydis.com/ is shorter (which is important for a paste service)
Don't worry about that, reviews automatically get dismissed when new changes are made. This is because the old review is then considered stale, as in, it's no longer good.
This looks better, but the pause seems to be around 3 seconds. can you make it 4 seconds? I'd be happy to approve it at that point. It looks like I wrote both 5 and 4 seconds in the previous request, sorry about that. 4 is what we want.
Hi, also don’t forget to update the evergreen attributes so your new logo can be used! (Pretty cool logo btw)
Don't worry about that, reviews automatically get dismissed when new changes are made. This is because the old review is then considered stale, as in, it's no longer good.
Ahh, thank you for the explanation. That makes sense 😁
This looks better, but the pause seems to be around 3 seconds. can you make it 4 seconds? I'd be happy to approve it at that point. It looks like I wrote both 5 and 4 seconds in the previous request, sorry about that. 4 is what we want.
Phew, looks like ...
I removed the try/except block because I don't think it's possible for it to error when the message is from the on_message event- Am I wrong in thinking so? I will happily add it back if I am 😁
Yes, it is possible, as this is not the only on_message event with the potential to delete the new message.
Build 20191125.3 succeeded
GitHub
00:01:42
Bot
Please prefix each line with an f even if the part does not contain any string interpolation.
You don't gain anything from doing [{PASTE_URL}]({PASTE_URL}) compared to just <{PASTE_URL}>.
I'd rather it use the value defined in the constants so this doesn't have to be hardcoded.
Build 20191125.4 succeeded
GitHub
00:01:37
Bot
Have you created the default constant in the config-default.yml file?
@Akarys42 Another channel just for the occasional image attachment relay seems a bit like overkill to me. That means we'd have a mostly empty channel and there are already a lot of channels in that log category for moderators.
Since we're deleting messages, maybe we should make an exception and have the attachments relayed to message-change-log. We normally suppress bulk deletions (like the antispam deletions), but having those attachments relayed there wouldn't be too bad. I think (I ho...
I've some changes to the attachments test awaiting review in #655, so you might want to look at that if you're still planning to update the test cases. Sorry, did not realize you were planning to look at it too.
Okay, maybe we should just open another channel. I'm going to discuss this with the admins/mods to gauge everyone's preferences.
This is actually fixed by #655. It was being caused by a duplicate message being included in the bulk delete list.
Postgres backup completed!
This sounds interesting, I would like to work on this.
Should we make this a helper function to return the difference between any two given datetime objects in that format? That way we can choose where and when we apply this.
If the question spans across multiple messages ( For example, message 1 2 and 3 ), would this means we would only cache the 3rd message? What if the user goes to another channel and paste only the 1st and 2nd messages and/or copy paste everything into a new message ( 4th ) and post that 4th in another channel?
In this case would checking for contents and check for similarities across most recent messages ( most recent 3 ) be a better case? For example above 70% from difflib?
Here's a quick example of what I thought of:
TIME_MARKS = (
(60, 'second'), # 1 minute
(60, 'minute'), # 1 hour
(24, 'hour'), # 1 day
(7, 'day'), # 1 week
(4, 'week'), # 1 month
(12, 'month'), # 1 year
(1, 'year') # dumb the rest as year
)
def get_duration(date_from: datetime, date_to: datetime) -> str:
div = abs(date_from - date_to).total_seconds()
results = []
for unit, name in TIME_MARKS:
div, amount = divmod(div...

Web console has:
Refused to display 'https://pythondiscord.com/pages/guides/_preview/' in a frame because it set multiple 'X-Frame-Options' headers with conflicting values ('SAMEORIGIN, DENY'). Falling back to 'deny'.
Will need to look into seeing what's up with this one. Might be related to nginx settings yet and have nothing to do with the code.
Postgres backup completed!
Putting a pause on this issue until #668 is fleshed out.
@ikuyarihS this looks promising, and I agree a helper function is the right direction to go in. Let me know if you have any questions along the way.
I've assigned you this issue, and deferred #669 until this issue is fleshed out by you. I look forward to reviewing your progress.
@fiskenslakt I have a question, where would you want to apply this to? Currently I will add it to the embed showing the Expiration ( Expires: date ( duration ) ) like in your example, but I found that there are more than one place with this information - The embed sent to user for example.
In that case, should I also show the user how long ( in human readable format ) their mute / ban will be for, not just when it will expire?
6869366 Implemented get_duration() for bot.utils.time - ikuyarihS
66ffef0 Added pytest for get_duration() - ikuyarihS
dadb915 Implemented get_duration_from_expiry() which ... - ikuyarihS
4ee0164 Fixed TypeError raised by substracting offset-n... - ikuyarihS
1c84213 Added test for get_duration_from_expiry() - ikuyarihS
f737fd4 Fixed "14 minutes, 60 seconds" by rounding `.to... - ikuyarihS
Closes #668
Introducing 2 helper functions that will get the absolute duration between two datetime:
bot.utils.time.get_duration() is the base of the two, which accepts two datetime objects, and return the duration from the two biggest units possible, for example:
bot.utils.time.get_duration_from_expiry() which accepts an expiry in the form of a string isoformat...Build 20191127.1 succeeded
GitHub
00:01:49
Bot
Build 20191127.2 succeeded
GitHub
00:01:44
Bot
I think we can safely override expiry and add the duration without altering the rest of the cog.
You just read my mind, I'm doing a refactor to get it straight from infraction['expires_at']
f5f92b7 Changed get_duration_from_expiry() to return ... - ikuyarihS
0898ce9 Refactored management.py to use the new get_... - ikuyarihS [2147adc](https://github.com/python-discord/bot/commit/2147adc592cf62a9cc21b3ebf5adeec544b4cac2) Refactored scheduler.pyto use the newget_d... - ikuyarihS
493cd41 Updated test cases for `get_duration_from_expir... - ikuyarihS
Aaaaand done, now it's minimum changes to the Cog!
Build 20191127.3 succeeded
GitHub
00:01:41
Bot
f47ec6f Updated docstrings, allow passing parts: Optio... - ikuyarihS [b12fe61](https://github.com/python-discord/bot/commit/b12fe618f73a0dfc31cd5ba4a9572ac0401d65ea) Updated test cases for parts: Optional[int]` - ikuyarihS
Build 20191127.4 succeeded
GitHub
00:01:38
Bot
@Akarys42 We've created a new channel to relay attachments to: #attachment-log with the ID 649243850006855680.
Build 20191127.5 failed
GitHub
00:01:27
Bot
Build 20191127.6 succeeded
GitHub
00:01:49
Bot
Build 20191127.7 succeeded
GitHub
00:01:56
Bot
Build 20191127.8 succeeded
GitHub
00:01:40
Bot
I'm a bit confused by these functions since they seem to share a lot of functionality with the humanize_delta utility function that converts a relativedelta to a human-readable duration string. Why don't we just parse the datetime string, calculate the dateutils.relativedelta and use the existing function to get a human-readable duration?
We don't use pytest for our unit tests anymore. This file is an unfortunately leftover, as it was merged during the unittest migration. There's an issue to migrate this file to unittest.
I've found, Azure Pipelines has a BuildNumber variable, which would be more fitting to use as a version value, imho
However, I haven't used Azure Pipelines and Docker prior to this bot, so implementing it is a bit tricky. ^^
Build 20191127.9 failed
GitHub
00:01:22
Bot
6a50eb6 Relay attachments to #attachment-log - Akarys42
f082251 Use #attachment-log instead of #mod-log - Akarys42
Build 20191127.11 failed
GitHub
00:01:23
Bot
4737e59 Use an underscore instead of a dash - Akarys42
@ikuyarihS @MarkKoz @SebastiaanZ all requested changes have been adressed
Build 20191127.12 failed
GitHub
00:01:34
Bot
Build 20191127.13 succeeded
GitHub
00:01:44
Bot
log.warning(f"Tried to re-upload attachment {attachment.id}, but it has failed.")
Still need to test this out locally but here's a review of what's immediately visible.
This would need to be zip_longest I believe.
I think an attachment ID is meaningless information, at least on its own. It'd be helpful to include the message's ID too and/or the filename.
Since NotFound subclasses HTTPException, just specifying HTTPException is adequate.
I really think it's not worth the hassle. The version number in the user agent is ultimately quite inconsequential. We can just hard-code 1.0.0 or something. Thoughts?
Oh my godness, you are correct, I did not realize we have a humanize_delta right there lol, and it works the same, if not more accurate across months and years!
I will probably just write an extra function to handle the expiry but call humanize_delta instead!
Ah I see, I did not realize that, I would like to work on migrating this to unitest as well.
I would like to work on this please, since I've encountered bot.utils.time.py while working on another PR.
Postgres backup completed!
No, because reupload_attachments() return an empty list if there isn't any message attached
Build 20191128.1 succeeded
GitHub
00:01:49
Bot
Build 20191128.2 succeeded
GitHub
00:01:44
Bot
Build 20191128.3 succeeded
GitHub
00:01:52
Bot
Is that not exactly why it would need to be zip_longest? If the attachments are empty then the resulting zip is empty too:
>>> messages = [1, 2, 3]
>>> attachments = []
>>> list(zip(messages, attachments))
[]
I think I misunderstood you. Did you mean if attachments are empty it means the messages would also be empty anyway?
AFAIK messages will always be a list of Message and attachments a list of list (which could be empty) so I don’t think we need zip_longest since messages and attachments will always have the same length
Thanks @scragly, I'll add it in
def24f5 Expand spoilers to match multiple interpretations - AnonGuy
Build 20191128.5 succeeded
GitHub
00:01:47
Bot
Adds a new icon that's in a hurry to gtfo.
In this PR we add a carefully crafted branding pack for the 2019 festive season, and I'm kaizening in a fix to the off-season spinner logo.
bbc5509: Moves last year's festive branding to a sub-directory named 2018. Once this is merged we will need to update the constant in seasonalbot.
9728601: Adds the full branding pack for 2019. This ...
Please no merge yet, we're planning some adjustments.
Postgres backup completed!
4efb97c add handling for duplicate symbols in docs inve... - Numerlor
f1dbb63 show renamed duplicates in embed footer - Numerlor
a05f28c Auto delete messages when docs are not found - Numerlor
eda6cd7 remove "function" from NO_OVERRIDE_GROUPS - Numerlor
d5dea25 Don't include a signature and only get first pa... - Numerlor
Build 20191129.1 succeeded
GitHub
00:01:47
Bot
@AnonGuy what's the status on this? is it done? it's still labeled WIP.
Adding two adjustments.
In 5376d8b, the snowfall animation is a little bit more smooth and the glow around the snake edges looks less compressed.
Before:

After:

This comes at the cost of bumping up the fil...
Postgres backup completed!
I hate it but it's fine.
I'mma just merge this, it's gotten plenty of reviews and it's far too well tested that it could possibly break.
Build 20191130.1 succeeded
Leon Sandøy
00:03:40
Bot
@kosayoda I think it would be clearer if we just removed the :x: now that we're using the trashcan.
@ikuyarihS makes a good point about automatic removals - the reactions should just time out after a while (and get removed when they do). I think they already do this for the paginator.
This PR looks good to merge once that's been addressed.
@mathsman5133
help_cleanupprovides the opportunity to use the :x: reaction to cleanup help even with no pagination.
https://github.com/python-discord/bot/pull/625 will be changing these to use a :wastebasket: emoji instead. It'd be good if this PR honored that.
oh yeah, I just noticed you saying that you're waiting for #625 to be merged. That's fine. I'll mark this as stalled, then, since it's blocked by #625
if @kwzrd is looking at the attachment tests, then there's no sense in having @alberthdev do it as well. Besides, it's been a month since there's been any activity here. Let's proceed with this PR without expanding its scope.
@alberthdev when will you have time to look at addressing the requests from @MarkKoz ?
f"[Jump to message]({msg_after.jump_url})"
d4269b3 Update bot/cogs/moderation/modlog.py - lemonsaurus
Build 20191130.2 succeeded
GitHub
00:01:39
Bot
4efb97c add handling for duplicate symbols in docs inve... - Numerlor
f1dbb63 show renamed duplicates in embed footer - Numerlor
a05f28c Auto delete messages when docs are not found - Numerlor
eda6cd7 remove "function" from NO_OVERRIDE_GROUPS - Numerlor
d5dea25 Don't include a signature and only get first pa... - Numerlor
Build 20191130.3 succeeded
GitHub
00:01:43
Bot
Build 20191130.6 succeeded
GitHub
00:01:40
Bot
Build 20191130.5 succeeded
GitHub
00:03:30
Bot
Connected!
Connected!
Build 20191130.7 succeeded
Leon Sandøy
00:03:32
Bot
@ikuyarihS taking into account the conversations you had with @SebastiaanZ for his review, what is your plan on this PR to get it finished? Will the test be ported to unittest in this PR or in a different one? If the latter, will the other PR be merged before or after this one? Are you planning to rewrite to make use of humanize_delta?
After merging the duck pond, a few minor bugs and potential for improvements have been uncovered. Please make a PR implementing the following changes:
!duckpond, alias !pondify, !duckpondify and !duckifyAt what level should the new command be role locked to?
A command for forcing a message into the duck pond. something like !duckpond, alias !pondify, !duckpondify and !duckify
What's the use of this? We discussed such a command before, but the argument was that it was only going to be used for historical messages which can easily be relayed using internal eval on the existing relay_message method of the class.
I guess the use is to not have to spend time figuring out how to internal eval it.
and role lock would be admins+ imo
This is a draft/suggestion for a refactoring of this fairly common pattern in the code. I have not gone through thoroughly so I will have missed some spots, I'm mainly asking for opinions.
Build 20191130.8 failed
GitHub
00:01:13
Bot
Sort of relevant issue is #131. We never explicitly decided whether we want embeds or not. However, as I wrote in that issue, we did move towards plain messages when writing new code. Still, some old code using embeds remains. So the question is, do we want embeds? If not, then I don't think a simple ctx.send() would warrant a utility function.
Regarding your implementation:
random.choice(ERROR_REPLIES) is a frequent pattern. How could the utility function take care of that instea...After doing some more trawling around the internet I'm still against providing this as the default behavior due to its ambiguity and lack of a deterministic way to statically identify whether the function does or does not explicitly return something.
However, since we already make similar anti-PEP484 concessions for style by providing the capability to suppress missing return annotations by function type, it's worth exploring the level of effort required to add a configuration option that ...
Postgres backup completed!
@lemonsaurus Yes, sorry for the delay, I will rewrite to use the humanize_delta that we already have for more consistency since we already have it, and it is more than enough for this task.
I've also asked to work on #608 since I will definitely write tests / migrate pytests over to unitests as well.
ac09fa3 Allow snekbox in esoteric-python channel - MarkKoz
Build 20191201.1 succeeded
GitHub
00:01:39
Bot
Build 20191201.2 succeeded
GitHub
00:03:27
Bot
Connected!
This PR contains two updates to the 2019 festive branding pack.
In 6ad5419, the banner receives an overhaul. In particular, we
Build 20191201.1 failed
GitHub
00:01:59
Snekbox
Postgres backup completed!
Build failing is related to #46. Will wait for flake-annotations v1.1.1 to release after python-discord/flake8-annotations#40 is merged because then typed-ast will no longer be required for Python 3.8 and higher.
Closing because #50 will take care of this and needs to update it to an even later version.
It would be nice to be able to re-evaluate the same snippet if it has been edited, using the same message via an emoji interaction.
An emoji like this one 🔄 should be added to every evaluated user message, and if the user react with the same emoji on his message (along with the bot), a new eval task should trigger with the updated message content. If the message content wasn’t updated since last eval, the new eval task should silently cancel. Either way, the ...
Literal (requires 3.7+, implementation by Danny#0007)Build 20191202.1 failed
GitHub
00:01:20
Bot
Build 20191202.2 failed
GitHub
00:01:20
Bot
The implementation uses an unnecessary imagining for commands processing with this Literal converter that's handling something entirely capable of being handled by commands groups, which are already well used elsewhere in the project.
This PR has also not been linted before being created. This is not the first time you've created a PR that has lacked the basic care that's expected when contributing.
Due to the above considerations, I'm closing the PR until you can correctly setup your...
This entire thing appears to be a poor-mans subcommand handler. There's no reason to parse distinct flags contrary to the entire commands framework design when we have the ability to add subcommands through usage of a command group object.
This does not conform to typical project style. Multiline arguments are dropped after the brackets:
async def eval_command(
self, ctx: Context, action: Optional[Literal["-save", "-load"]] = None, *, code: str = None
) -> None:
Unnecessary to add at this point in time due to suggesting to change commands processing to the existing command groups format.
This isn't commented out code, this is a comment explaining the type used so other people working on this know what it is.
Doesn't this fprmat violate PEP8?
No.
The closing brace/bracket/parenthesis on multi-line constructs may either line up under the first non-whitespace character of the last line of li
Build 20191202.3 succeeded
GitHub
00:01:50
Bot
Postgres backup completed!
Returns a human-readable version of the duration between datetime.utcnow() and an expiry.
This style for documenting parameters is not used in our code base. Instead, they are either part of the paragraphs or, in cases with many arguments, as a bullet point list. I don't remember exactly but surely you'll find some examples if you look around elsewhere in the code base.
It's neither clear that this function returns a timestamp nor that it uses format_infraction specifically to format it. This functions seems to have been designed with only returning the duration in mind and then the timestamp was tacked on towards the end. It could only return the duration, but that would mean two function calls in the mod cogs. It may be fine to just rename this function to format_infraction_with_duration (preferably something shorter if you can think of it) and, of c...
self.config is passed to the subTest yet self.config is still used here. If this works as-is, then there is no need to pass it to subTest.
test_disallows_messages_with_too_many_attachments should be now acting like a regression test against that duplicate message bug for attachments, right?
I think this should be plural to be consistent with other routes. Docs would need to be updated with the correct route too.
Should be like
log.trace(
f"Offensive message..."
f"..."
)
Why does the end need to be chopped off when passed to the API? Infractions, for example, don't need to do it.
It'd be better to do this with dateutil as done here.
I have just discovered it and I'm trying to use it in conjunction with Vue components. I'll try to contribute some of my development :)
Added .control wrapper element inside field template to preserve layout from Bulma docs
Build 20191204.1 succeeded
GitHub
00:01:30
Django Crispy Bulma
4242037 Antimalware: fix paste service URL showing repl... - MarkKoz
Build 20191204.1 succeeded
GitHub
00:01:42
Bot
Thank you, I will include this in new commits to avoid having too many small commits.
Hmm, I was actually looking at the function right above, wait_until and I saw this style and thought that it will automatically build the doc from this. I will simply remove this part, it should be clear enough from the type hint and the docstring.
You are right, I was just replacing format_infraction and avoid calling another command on top of it.
I've renamed the function to format_infraction_with_duration ( I can't think of any shorter name, format_infraction_readable kind of saying format_infraction is not readable, so I'd rather go with lengthier name ).
6cf907a Renamed function and improved its docstring to ... - ikuyarihS
Build 20191204.2 succeeded
GitHub
00:01:47
Bot
6869366 Implemented get_duration() for bot.utils.time - ikuyarihS
66ffef0 Added pytest for get_duration() - ikuyarihS
dadb915 Implemented get_duration_from_expiry() which ... - ikuyarihS
4ee0164 Fixed TypeError raised by substracting offset-n... - ikuyarihS
1c84213 Added test for get_duration_from_expiry() - ikuyarihS
Connected!
Build 20191204.3 succeeded
GitHub
00:03:45
Bot
Build 20191204.4 succeeded
GitHub
00:01:51
Bot
Have been busy with other things recently, but I hope to get back to this sometime soon. Hopefully by the end of the year.
Build 20191204.5 succeeded
GitHub
00:03:27
Bot
Connected!
17cedcb ModLog: use more generic type annotations - MarkKoz
e29b65c Utils: support returning URLs from send_attachm... - MarkKoz
336c6d5 Utils: use the guild's filesize_limit to determ... - MarkKoz
4e41410 Utils: add send_attachments param to disable li... - MarkKoz
0f71c81 Utils: log send_attachments failures instead of... - MarkKoz
Build 20191204.6 succeeded
GitHub
00:01:44
Bot
Still need to test this out locally but here's a review of what's immediately visible.
Postgres backup completed!
Since #668 is done, can I work on this?
Sure thing. I'll assign you.
7e25475 Improved type hinting for format_infraction_wi... - ikuyarihS [51f8001](https://github.com/python-discord/bot/commit/51f80015c5db9ab8e85ea2304789491d4c72c053) Created until_expiration to get the remaining... - ikuyarihS [82eb5e1`](https://github.com/python-discord/bot/commit/82eb5e1c46e378a6f3778e17cc342193b910ded5) Implemented remaining time until expiration for... - ikuyarihS
Will show the remaining time until an infraction is expired.
Introduced 1 helper function in time module - until_expiration that makes use of the nicely, already made humanize_delta in the same module.
An active infraction:

An infraction that has yet to expire, but is inactive:

A simple cooldown should be enough, like maximum one re-eval per 10 seconds, right?
pytest tests in tests.utils.test_time.py to unittestformat_infraction_with_durationBuild 20191204.8 succeeded
GitHub
00:01:44
Bot
I'm thinking split the test_format_infraction_with_duration tests into tests for format_infraction and have test_format_infraction_with_duration only test the duration part while asserting format_infraction gets called. It wouldn't make sense to test the same function effectively twice.
Actually, I think we may have agreed not to test format_infraction cause it barely does anything on its own?
Yep, that's why I didn't bother testing it, it is barely doing anything, simply converting isoformat back to datetime, only to reformat it with .strftime(). I think it is not worth it to test format_infraction
These should be in a subtest otherwise this whole loop is treated as a single test case.
Maybe still worth asserting format_infraction is called once.
This applies to the other tests as well
Hmm, can you explain this a bit more? When I was testing, it will actually stop at the failed case when looping/
Do you mean splitting it into cases like:
None expiryAnd then put the cases there?
I'll remove it if you think it's unnecessary.
What I had in mind when adding it was that since the rule's behaviour depends on the config, it should be passed to subTest so that it shows up in the error report. Please correct me if I'm misunderstanding something.
test_disallows_messages_with_too_many_attachmentsshould be now acting like a regression test against that duplicate message bug for attachments, right?
Yes, I suppose. The rule now calls the test in the same way as the antispam cog's on_message does, which wasn't the case previously.
ccdd836 Splitting test cases for `format_infraction_wit... - ikuyarihS
Build 20191204.10 succeeded
GitHub
00:01:58
Bot
fa66195 Introduced test for test_format_infraction, r... - ikuyarihS
I've split them into proper independent tests, as well as added the test for format_infraction
Build 20191204.11 succeeded
GitHub
00:01:50
Bot
They still aren't using the subtest context manager.
Ah, I see the self.subTest now, I will refactor them later tomorrow. Thank you for the swift reply!
5e0b19a Added self.subTest for tests with multiple te... - ikuyarihS
Actually, I might as well do it now before I forget. Does this look better?
Build 20191204.12 succeeded
GitHub
00:01:46
Bot
test_format_infraction_with_duration_none_expiry and test_format_infraction_with_duration_custom_units also need subtests (which would mean putting the cases in a loop).
db341d9 Moved all individual test cases into iterables ... - ikuyarihS
Done, so there should be no test with multiple test cases that are not using subTest context manager now.
Build 20191204.13 succeeded
GitHub
00:01:49
Bot
Build 20191204.14 succeeded
GitHub
00:01:37
Bot
1c58e7e Bump django from 2.2.6 to 2.2.8 - dependabot[bot]
Build 20191205.1 succeeded
GitHub
00:02:22
Site
Postgres backup completed!
Build 20191205.3 succeeded
GitHub
00:01:48
Bot
Postgres backup completed!
Postgres backup completed!
Postgres backup completed!
Resolves #468
Probably don't want to prepends bot.cogs when adding extensions since that would mess up the Extensions extension and require the unload and reload methods to also exhibit this behaviour for consistency while making it impossible to ...
Build 20191208.1 succeeded
GitHub
00:01:47
Bot
These checks may be a bit paranoid - if not self._ready.is_set(): may suffice here. I don't think it's too bad though and doesn't hurt to be a bit safer. 🤷♂
Build 20191208.2 succeeded
GitHub
00:01:44
Bot
Looks good to me.
I've read the source code a few times, ran the test suite locally (although I don't have P3.6, so that was skipped), and did some manual testing as well. I do want to note that I'm a bit out of my comfort zone reviewing this.
No issue, just to make sure you've seen it. Coverage reports that there's never a test case where func_list is empty, so the branch 52 -> exit never runs during testing. I don't think an empty fun_list is a realistic case and it would just return None anyway (just as this function would if no matching function were to be found).
I'm ok with not getting 100% coverage in the test suite as long as it's justifiable. In this case I haven't come up with a rewrite of the logic here that's worth changing to for the sake of getting to 100%; the function is pretty plain.
That was my idea as well.