#dev-log

1 messages ยท Page 45 of 1

oak estuaryBOT
regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200412.2 succeeded

Requested by

Joseph Banks

Duration

00:03:11

Build pipeline

Bot

oak estuaryBOT
regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200412.3 succeeded

Requested by

Joseph Banks

Duration

00:02:52

Build pipeline

Bot

oak estuaryBOT
regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
north knotBOT
ebon magnetBOT
oak estuaryBOT
regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200412.5 succeeded

Requested by

Joseph Banks

Duration

00:02:52

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200412.1 succeeded

Requested by

GitHub

Duration

00:00:58

Build pipeline

Seasonal Bot

#

Build 20200412.2 succeeded

Requested by

GitHub

Duration

00:00:50

Build pipeline

Seasonal Bot

regal archBOT
regal archBOT
#

I think it's fine for now to not persist the roles. It's a role that a user should have for a maximum of 15 minutes at a time anyway and if people try to abuse the non-persistence by leaving/joining to claim multiple channels (I don't think that will happen often), we can moderate them.

Still, persistence has come up a couple of times now for different elements of the help channel system; we should evaluate in due time if and how we're going to tackle that. Once such persistence gets imple...

regal archBOT
north knotBOT
oak estuaryBOT
ebon magnetBOT
#

Build 20200413.1 succeeded

Requested by

Joseph Banks

Duration

00:03:08

Build pipeline

Bot

ebon magnetBOT
#

Build 20200413.1 succeeded

Requested by

GitHub

Duration

00:01:19

Build pipeline

Seasonal Bot

north knotBOT
#

Postgres backup completed!

regal archBOT
native joltBOT
#

ANN201 is giving the wrong line number if using a multi-line docstring. I assume all the ANN20x would fail for the same reason.

Related to #32, was not fixed correctly.
The logic is searching backwards from a function's body to find : to make the end of the function signature. This is easily broken by having a : inside a docstring, which is fairly common.

def foo(n: int):
    """Multi-line docstring.

    Args:
        n (int):
    """
    return n

**Version ...

regal archBOT
#

Sort of a continuation to #546 to get feedback before getting to it.

Before (trying to) implementing #447, duplicate items will be needed to be removed from the inventories dict to get only the relevant results. These were mentioned in comments of the aforementioned issues.

That will drastically decrease the amount of items and their used space so I thought we can also up the cache max_size in here
https://github.com/python-discord/bot/blob/3d25c790a69421e0ed9c7c7a29ca1d5833322169/bo...

regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
#

@ks129 Can you please update this pull request with a proper description? It's not acceptable to just write "Closing #861" as your pull request description - the description is supposed to provide a high level overview over specifically what this pull request does.

I'd also like to suggest that this PR address two more related and fairly minor issues:

  • If the ban does fail, for some other reason, it would be nice if we could reset the state properly so we don't get an erroneous state. ...
regal archBOT
#

The current dormant message reads like this:

This help channel has been marked as dormant, and has been moved into the Help: Dormant category at the bottom of the channel list. It is no longer possible to send messages in this channel until it becomes available again.

Thus, there is no way of knowing whether it was manually made dormant, or automatically made dormant due to inactivity.
If a user mentions that a channel was mistakenly made dormant when they were not done with it, it...

#

@ks129 looks like you're right, I thought we had more tests for moderation. We do have the tests in here https://github.com/python-discord/bot/blob/master/tests/bot/cogs/moderation/test_silence.py but not for most of the other moderator commands.

It would still be nice to see a single test, specifically for this problem. Would you be able to write that? No need to write a complete suite of tests for the entire moderation cog, but we got to start somewhere, right?

#
[python-discord/bot] New branch created: help\-channels\-keep\-dormant\-invocation
#

Description

The current usage for the .issue command looks like this:

.issue  [repository=seasonalbot] [user=python-discord]

It would be useful to allow multiple issue numbers, resulting in one embed listing all of the issues.

Reasoning

Requesting multiple issues is a hassle, having to repeat the command for each issue. The resulting embed is also rather large and intrusive.
![image](https://user-images.githubusercontent.com/41782385/79207192-f7622f80-7e72-11ea-875d-...

#

Pull request #868 introduced the automatic deletion of the message in which the !dormant command was issued to close an occupied help channel. While this arguably removes some clutter from the channels, it also hides the reason for why a channel suddenly went dormant; other users have had to been actively watching the channel to have spotted the invocation. As the command can be issued at any time, this could lead to the user experience of thinking that a channel that still had an active, o...

ebon magnetBOT
#

Build 20200414.1 succeeded

Requested by

GitHub

Duration

00:01:36

Build pipeline

Bot

north knotBOT
ebon magnetBOT
#

Build 20200414.2 succeeded

Requested by

GitHub

Duration

00:03:19

Build pipeline

Bot

oak estuaryBOT
regal archBOT
native joltBOT
#
[python-discord/flake8-annotations] New branch created: dev\-next
regal archBOT
ebon magnetBOT
#

Build 20200414.3 succeeded

Requested by

GitHub

Duration

00:01:34

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200414.7 succeeded

Requested by

GitHub

Duration

00:01:19

Build pipeline

Bot

#

Build 20200414.6 succeeded

Requested by

GitHub

Duration

00:02:19

Build pipeline

Bot

regal archBOT
regal archBOT
regal archBOT
regal archBOT
native joltBOT
regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
#

How about extending this to all users? If their channel goes dormant and no one else has used it yet, they would be able to reclaim it. This may be useful if a channel is accidentally closed (even by the claimant). They may have unexpected follow up questions or find out shortly after their issue isn't solved after all.

This could be abused but it's no worse than users sending junk messages to keep their channel open. The amount of channels in the dormant pool shouldn't see a decrease sinc...

regal archBOT
#

I like the idea. We may see some people being frustrated by their old channel having gone back into circulation, but there are obviously limits to what we can do.

Since users don't have permissions to type in dormant channels, they'd have to do run the command in another channel like #bot-commands. Invoking it in a different channel is not the greatest experience but I think it's better than having nothing. I'm not that concerned that it makes the system more complicated as this won't be...

regal archBOT
#

Overwrites could work and we still have code that can be repurposed for it. It also has the advantage of being persistent. Sine categories aren't in the mix, it sounds more promising. However, I wouldn't be convinced and willing to invest in the approach without first testing to confirm it won't be buggy.

That being said, allowing them to type in a dormant channel introduces the problem of not wanting them to type anything besides the open command. It could delete messages like the verificat...

regal archBOT
regal archBOT
#

@MarkKoz
Okay, this does need figuring out I guess.

I think we should use mentions both on actor and on User, and that on User, we could probably include the display_name instead of the user ID. 99% of the time when you're viewing the result of an !infr search, you typed in the ID to get there, so I really don't think displaying the ID is that crucial.

It's also quite unlikely the actor won't be cached.

So, I think mentions on both and display_name (with descriminator) strikes a ni...

regal archBOT
oak estuaryBOT
regal archBOT
north knotBOT
#

Postgres backup completed!

ebon magnetBOT
#

Build 20200416.1 failed

Requested by

GitHub

Duration

00:00:51

Build pipeline

Bot

#

Build 20200416.2 succeeded

Requested by

GitHub

Duration

00:01:23

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200416.3 succeeded

Requested by

GitHub

Duration

00:01:25

Build pipeline

Bot

regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: Add\-free\.md\-tag
regal archBOT
#
[python-discord/bot] New branch created: free\-tag
ebon magnetBOT
#

Build 20200416.4 succeeded

Requested by

GitHub

Duration

00:01:44

Build pipeline

Bot

regal archBOT
#

I suggest changing the name to discord channel mention via id, that way if we ever decide to rename the channels, the content of the tag will be updated accordingly.

We recently moved to a new help channel system. There are always 2 available help channels waiting to be claimed in the **[#691405807388196926](/guild/267624335836053506/channel/691405807388196926/)**. In order to claim one, simply start typing your question into one of these channels. Once your question has been posted, you have claimed this channel, and the channel ...
#
**How to claim a channel**

We recently moved to a new help channel system. There are always 2 available help channels waiting to be claimed in the **Python Help: Available category**. In order to claim one, simply start typing your question into one of these channels. Once your question has been posted, you have claimed this channel, and the channel will be moved down to the **Python Help: Occupied category**.
#
[python-discord/bot] branch deleted: Add\-free\.md\-tag
ebon magnetBOT
north knotBOT
oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200416.7 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

regal archBOT
#
[python-discord/branding] branch deleted: sticker\_and\_banners
#

image

It's time to get our wonderful emojis merged to branding. Before we do that, we need to sort out some legal stuff on this branch. Here's what needs to be done:

  • [ ] We have remixed Twemoji's to make these, so we need to include attribution and explain which changes have been made. These are licensed under CC BY 4.0. Let's add thes...
regal archBOT
regal archBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200416.1 succeeded

Requested by

GitHub

Duration

00:01:04

Build pipeline

Seasonal Bot

regal archBOT
#
[python-discord/seasonalbot] branch deleted: wait\-until\-guild\-ready
ebon magnetBOT
#

Build 20200416.2 succeeded

Requested by

GitHub

Duration

00:02:37

Build pipeline

Seasonal Bot

regal archBOT
#
[python-discord/branding] branch deleted: lemojis
north knotBOT
night lilyBOT
#
SeasonalBot

Connected!

regal archBOT
#

The new version introduces support for assignment expressions (changelog).
Currently when lint is ran with the expression in the code, pyflakes will crash flake8.
Updating the version fixes this but a noqa ignore is still necessary because pycodestyle did not yet receive an update and does not recognize the new syntax with a colon.

The update will introduce these lint errors: https://paste.fuelrats.com/rotukasohe.txt
where `F9...

north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
regal archBOT
#
[python-discord/branding] branch deleted: game\_jam
#
[python-discord/branding] branch deleted: runner
#
[python-discord/branding] branch deleted: hacktober\-animated\-neon\-flicker\-icon
#
[python-discord/branding] branch deleted: \#29\-blank\-banner
#
[python-discord/branding] branch deleted: superstar\_icons
#
[python-discord/branding] branch deleted: seasonal\-structure
regal archBOT
ebon magnetBOT
#

Build 20200417.1 succeeded

Requested by

GitHub

Duration

00:01:34

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200417.2 succeeded

Requested by

GitHub

Duration

00:02:54

Build pipeline

Bot

north knotBOT
oak estuaryBOT
regal archBOT
#

Looks like the joined f-strings are taken care of, taking your snippet we only get an error about param

D:\pycon>pyflakes splitfstrings.py
splitfstrings.py:2:29 undefined name 'param'

I don't know about the walrus but it can be nice to use in some simple cases without sacrificing any readability.
The pyflakes update still brings useful things so if the walrus is decided against; a notice could be posted or the flake8-walrus package can be used which forbids them.

#

Looks like the joined f-strings are taken care of ...

That's good to hear, thanks for the clarification.

For the record, I'm not opposed to this. I'm just hoping to get a discussion started to see whether we're all collectively on board.

I like the walrus myself, and I recently bumped pyflakes to 2.2.0 in one of my projects. It is, however, disappointing that even then, the lines still need to be noqa to avoid the problems you mentioned.

regal archBOT
#

Already said by @ikuyarihS, but I think using a tag for this is a really good idea.

I think the tag is a little too long. It should mainly serve as a heads-up for users still trying to invoke the !free cmd - inform them that it's no longer necessary, and redirect them to an available channel. That is what they were used to invoking the command for, after all:

image

The tag shoul...

regal archBOT
#
[python-discord/bot] New branch created: feat/frontend/839/help\-channel\-role
#

Resolves #839

Using user overwrites on the category turned out to be flawed due to syncing issues. Channels would get out of sync with the category which would lead to users being able to claim multiple channels. Using a role should hopefully avoid sync issues since the bot will no longer be constantly adding/removing channel overwrites. Instead, it will be adding/removing roles from users.

For now, the roles aren't persisted. Once we have some better infrastructure for that (or we deci...

ebon magnetBOT
#

Build 20200417.3 succeeded

Requested by

GitHub

Duration

00:01:43

Build pipeline

Bot

ebon magnetBOT
#

Build 20200417.4 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200417.5 succeeded

Requested by

GitHub

Duration

00:01:43

Build pipeline

Bot

regal archBOT
#

100a903 HelpChannels: create a helper method for checki... - MarkKoz
8249ea4 HelpChannels: create helper method for checking... - MarkKoz
27ed536 HelpChannels: ensure is_in_category returns a... - MarkKoz
98726b3 Merge branch 'master' into bug/frontend/870/hel... - ikuyarihS
b7b48d0 Merge pull request #877 from python-discord/bug... - ikuyarihS

#
[python-discord/bot] branch deleted: bug/frontend/870/help\-channel\-dm\-category
north knotBOT
ebon magnetBOT
#

Build 20200417.6 succeeded

Requested by

GitHub

Duration

00:02:45

Build pipeline

Bot

oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200417.7 succeeded

Requested by

GitHub

Duration

00:01:22

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] New branch created: bug/utility/829/non\-py\-code\-detection
#

Fixes #829 by assuming a code block is highlighted if it has any word following the ticks and then a newline. This may incorrectly thing some are valid code blocks but I figured that is better than having false positives and showing the embed when it's not relevant.

This feature has been moved to its own cog/extension. I am refactoring its method to be narrower in scope and thus be more testable. I may end up writing unit tests too.

ebon magnetBOT
#

Build 20200417.8 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200418.1 succeeded

Requested by

GitHub

Duration

00:01:24

Build pipeline

Bot

regal archBOT
#

The minesweeper cog does not currently handle the situation where a user invokes the start command, but doesn't have DMs enabled. Discord will return a 403 and the command will fail on this line.

https://github.com/python-discord/seasonalbot/blob/c6c87378cd6dd65e2fac83b97d48430c3cb0917c/bot/exts/evergreen/minesweeper.py#L154-L158

The problem should be solved similarly to how the AoC cog handles it - by informing the user, in the channel where the command was invoked, that their DMs must...

regal archBOT
#

Ah, looks like flake8 is incompatible with the newest pyflakes and the above missing placeholder error codes are wrong because of that, the only thing incompatible changes are the error codes which were fixed in this merge commit thatfixes it by simply updating a dict https://github.com/PyCQA/flake8/commit/6efb15cecb5a53e4f605cb0639ddd7f6f33c4a41

Do we care about the error codes enough to delay this until a release? Couldn't find any hints on when that may be.

regal archBOT
ebon magnetBOT
#

Build 20200419.1 succeeded

Requested by

GitHub

Duration

00:01:35

Build pipeline

Bot

ebon magnetBOT
#

Build 20200419.2 failed

Requested by

GitHub

Duration

00:00:31

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!

regal archBOT
#

Problem

Right now, Discord have implemented a new feature where if a user pastes something over the 2000 character limit a text file is created and uploaded.
image

Solution

After a staff meeting, the consensus was that, for this special case ( when attachment is of type text in general ) we will add a bit in the message that gets posted by this filter about how text should be pos...

regal archBOT
#

We'd like to have a new announcement channel added to the Information category, called #python-news. In here, we'd like to have stuff like new PEPs, new Python releases, and major Python event announcements posted automatically.

This can be achieved through listening to various Python mailing lists, and possibly to the python/cpython releases.

What to do

  • The specific mailing lists we want are python-ideas and comp.lang.python.announce.
  • These can be handled via this API: ...
#

The PEP command uses the isdigit check for making sure the passed number is an int, this however is not always true; isdecimal or a try except should be used on the int conversion itself
https://github.com/python-discord/bot/blob/b7b48d0239afedbec31e8c05c90430a5b635cec0/bot/cogs/utils.py#L58-L60
PEP digit error

Furthermore the pep command gives no indication whether it was invoked correctly when making the time consuming web request to fetch data...

regal archBOT
#

Implementation details

New PEPs

For new PEP information, there is an RSS feed available at https://www.python.org/dev/peps/peps.rss/

Mailing list

Mailing list messages are a little less trivial but still relatively simple to implement.

Please note that while the mailman API suggests that you can get threads through it a 500 error is returned on big threads. Another approach (detailed below) must be used.

There is a URL returning recent threads in HTML format: htt...

ebon magnetBOT
#

Build 20200419.1 failed

Requested by

GitHub

Duration

00:01:01

Build pipeline

Seasonal Bot

#

Build 20200419.2 succeeded

Requested by

GitHub

Duration

00:00:45

Build pipeline

Seasonal Bot

regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200419.3 succeeded

Requested by

Joseph Banks

Duration

00:02:03

Build pipeline

Seasonal Bot

night lilyBOT
#
SeasonalBot

Connected!

regal archBOT
ebon magnetBOT
#

Build 20200419.3 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] branch deleted: bug/info/869/tag\-encoding
north knotBOT
ebon magnetBOT
#

Build 20200419.4 succeeded

Requested by

GitHub

Duration

00:03:05

Build pipeline

Bot

oak estuaryBOT
regal archBOT
#

With the new help channel in effect, we want to change the rules for where the !eval command is permitted to be used. However, because our help channels are dynamically created on demand and because we also need to allow it for a few non-help channels, and for certain roles, we need a new decorator and some new constant groups to handle this.

When should the command be allowed?

  • In all help channel categories, including Topical Help, Dormant, Available, and In Use.
    ...
regal archBOT
regal archBOT
#

With the 3.8 python update, the default event loop on windows is now the ProactorEventLoop; one of aiohttp's dependencies uses features which are not supported in this event loop leading to crashes on startup on windows with an undescriptive error

From cffi callback :
Traceback (most recent call last):
  File "C:\Users\Numerlor\.virtualenvs\bot-K_QdelnW\lib\site-packages\pycares\__init__.py", line 91, in _sock_state_cb
    so...
north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
regal archBOT
#

There's a slight drawback here because of the use of the discord.Object to represent the role: discord.NotFound will both be raised for the member not being found as well as the role not being found. It's (hopefully) not going to be a huge issue for us in production, but if someone forgot to set an ID for the role in a dev setting, the logger will give the misleading message that the member was not found, while it was actually the role:

2020-04-20 11:49:13 | bot.cogs.help_channels...
#

I agree about the API part and Mark's edit also plays into that:

As Mark's edit suggests, we'd still need to know if the ID passed relates to a channel itself or a category the channel could be in for the permissions check. This makes the implementation slightly less convenient. It means we'd have to "get" the channel object in the predicate from Context.guild to determine whether or not it belongs to a TextChannel or a CategoryChannel.

If we explicitly pass the IDs as separate kw...

regal archBOT
regal archBOT
#

26cc394 Replace in_channel decorator by in_whitelist... - SebastiaanZ [debb83e](https://github.com/python-discord/bot/commit/debb83ec90c433f8d42c346948f9234f94c5ca08) Remove vestigial kwargs from MockTextChannel.__... - SebastiaanZ [96e1b8f](https://github.com/python-discord/bot/commit/96e1b8f1f1059ac0aa9d4b43cba5e82205b35735) Add tests for in_whitelisted_context decorator - SebastiaanZ [86e2df8](https://github.com/python-discord/bot/commit/86e2df8ab84bc930c999b3a6273609fdde90e129) Allow !eval` in help channel categories - SebastiaanZ

#
[python-discord/bot] New branch created: broadening\-eval\-whitelist
regal archBOT
#

This PR implements the policy change we've agreed upon during the staff meeting: Allowing the !eval command to be used by regular members in help channels. However, as our help channels are dynamically generated up to a certain number of channels, using a simple whitelist based on channel IDs won't work. That's why this PR generalizes the in_channel decorator to be able to whitelist more aspects of the command's context, including the channel category. This means that we can whitelist cha...

ebon magnetBOT
#

Build 20200420.1 succeeded

Requested by

GitHub

Duration

00:01:28

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] New branch created: answered\-session\-stats
ebon magnetBOT
#

Build 20200420.3 succeeded

Requested by

GitHub

Duration

00:01:09

Build pipeline

Bot

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200420.4 succeeded

Requested by

GitHub

Duration

00:01:24

Build pipeline

Bot

regal archBOT
regal archBOT
#

The bot can detect when someone is in the middle of typing a message and prevent the channel from going dormant if it was otherwise about to become dormant. This may prevent situations in which a user was trying to answer a question but the channel goes dormant and their WIP message is lost.

The bot could extend the dormant timer by a few minutes. Of course, should a message get sent, that would extend it by the normal 30 minutes. The extension of a few minutes would just be to address sit...

regal archBOT
#

I like the suggestion, I'm less clear on what the proper way to implement this is. We can't "simply" check for an ongoing typing event when the timer runs out, as typing events time-out rather quickly and people tend to pause when typing longer replies; it would be rather easy to miss the typing event.

We could use an on_typing event listener and keep track of the most recent typing event for that channel happened. The event includes a timestamp by default (when), so it should not be t...

#

I like the generalised approach you went with. However, I do have complaints about how long the decorator call has become. I dislike splitting up decorator calls into multiple lines and the fact that it's practically impossible to use it as one line now, even for the simplest of calls, rubs me the wrong way. My ideas:

  1. Remove the whitelisted_ prefix from kwarg names. I think redundant given the decorator name.
  2. In most cases, there is a redirect channel and it's the same value for a...
ebon magnetBOT
#

Build 20200420.5 succeeded

Requested by

GitHub

Duration

00:01:08

Build pipeline

Bot

ebon magnetBOT
#

Build 20200420.6 succeeded

Requested by

GitHub

Duration

00:01:10

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200420.7 succeeded

Requested by

GitHub

Duration

00:01:15

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200420.8 succeeded

Requested by

GitHub

Duration

00:01:11

Build pipeline

Bot

regal archBOT
#

f48d32f Add statistics on whether a help session was cl... - jos-b
96ef7f7 Incorrect comparison, we need to check if we ar... - jos-b
d5aef24 Add different emoji for different channel statu... - jos-b
2b8bc72 Extra documentation + split out to separate fun... - jos-b
b842bfe HelpChannels: add logging to answered check - MarkKoz

#
[python-discord/bot] branch deleted: answered\-session\-stats
north knotBOT
ebon magnetBOT
#

Build 20200420.9 succeeded

Requested by

GitHub

Duration

00:02:49

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200421.2 failed

Requested by

GitHub

Duration

00:01:27

Build pipeline

Site

regal archBOT
ebon magnetBOT
#

Build 20200421.1 failed

Requested by

GitHub

Duration

00:01:41

Build pipeline

Site

regal archBOT
ebon magnetBOT
#

Build 20200421.3 failed

Requested by

GitHub

Duration

00:01:58

Build pipeline

Site

north knotBOT
#

Postgres backup completed!

regal archBOT
#

Closes #890
Site issue (stalled until it merged): python-discord/site#352

Summary of what is done

  • Added 2 new dependencies: feedparser (used in PEP news fetching) and beautifulsoup4 (used in maillist news fetching)
  • Set the log level of logger chardet to warning to avoid log spam.
  • bot.cogs.news extension loading added to __main__.py
  • Added news config entries + constants
  • Created News cog
    • Added fetching PEP news
    • Added fetching maillist news
    • Adde...
ebon magnetBOT
#

Build 20200421.1 succeeded

Requested by

GitHub

Duration

00:02:14

Build pipeline

Bot

regal archBOT
#

I dislike splitting up decorator calls into multiple lines and the fact that it's practically impossible to use it as one line now, even for the simplest of calls, rubs me the wrong way.
1. Remove the whitelisted_ prefix from kwarg names. I think redundant given the decorator name.

I don't mind that a decorator spans over multiple lines, as the kwarg names make explicit what each individual kwarg does and it's highly readable. From that perspective, I don't think they're necessa...

regal archBOT
ebon magnetBOT
#

Build 20200421.2 succeeded

Requested by

GitHub

Duration

00:01:13

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200421.4 succeeded

Requested by

GitHub

Duration

00:02:28

Build pipeline

Site

regal archBOT
#
[python-discord/bot] New branch created: fix\-category\-cache\-issue
#

After experiencing a reconnect from Discord, the channel cache we were using in the help cog began to fall apart and claimed there were 29 channels in the available category and no channels elsewhere.

(Blue line marks disconnect)

image

This PR forces retrieval of the channels in the guild from the bot cache in the get_category_channels method through the usage of bot.get_guild...

ebon magnetBOT
#

Build 20200421.3 succeeded

Requested by

GitHub

Duration

00:01:28

Build pipeline

Bot

regal archBOT
regal archBOT
#

Yes, looks good.

Just to add some context to those wondering what was going on: The channels cache we accessed through the guild attribute of a reference to the Available category was completely out of sync with actual channel lay-out of the guild. This started happening after a disconnect/restart of the shard's websocket/gateway connection:

2020-04-21 01:18:47 | discord.gateway | WARNING | Shard ID None has stopped responding to the gateway. Closing and restarting.

Som...

#
[python-discord/bot] branch deleted: fix\-category\-cache\-issue
north knotBOT
ebon magnetBOT
oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200421.6 succeeded

Requested by

GitHub

Duration

00:01:13

Build pipeline

Bot

regal archBOT
#
[python-discord/django-crispy-bulma] New branch created: actions\-release
regal archBOT
#

To simplify some of our processes, and to bring this project in line with the release methods used by flake8-annotations, I've added a Github action for releases.

The azure config that previously built assets and published the release has been removed.

The repository already has a new project-specific PyPI token added to secrets.

As a small adjustment, I've moved azure to use the ubuntu-18.04 environment, to bring it in line wi...

ebon magnetBOT
#

Build 20200421.1 succeeded

Requested by

GitHub

Duration

00:00:28

Build pipeline

Django Crispy Bulma

regal archBOT
#

If a user manages to take part of multiple filter violations, the cog will attempt to punish() them for each of those violations. While punish() does check for the muted role before applying the infraction, the asynchronous nature of the code can mean a second punish() is called and passes the role check before the first punish() has gotten a chance to apply the mute. This would result in an attempt to apply a second mute infraction, which will ultimately fail and display a message st...

#

How do we feel about caching the web responses to lower the load and response time with the async_cache decorator as talked about in the issue?

While not in the scope of what was talked about in the issue the code of the function can also be improved in some parts; the logging could use a bit of info on the PEPs it's working with, the found_pep variable seems to be redundant and probably could find a bit more with a more thorough read if you feel like doing that.

regal archBOT
regal archBOT
#

I don't mind that a decorator spans over multiple lines,

A difference of opinion, but I think it's quite unsightly.

the kwarg names make explicit what each individual kwarg does and

Being explicit is good but it can become overly verbose, like here.

it's highly readable

In terms of understanding what it does, I agree. However, I think it's length/size due to its verbosity makes it difficult to read as it really catches one's attention, whereas one could be focusing on mo...

regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
#

And if we make the first 3 not kwarg-only:

@in_whitelist(EVAL_CHANNELS, EVAL_CATEGORIES, EVAL_ROLES, redirect=Channels.bot_commands)

Now even the longest of invocations fits on one line, and it's still readable to me. I don't need kwargs because the constant names already tell me what the types are. Maybe if it was 3 tuple literals instead it'd be harder to look at (i.e. to visually spot the boundaries of the tuples). However, I think it should be up to the...

#

Okay, just to chime in here with some quick input:

  • Shortening the kwarg names to drop whitelisted prefix is nice.
  • in_whitelist is a good decorator name.
  • I agree with @SebastiaanZ about positional arguments being too error prone to be justified.

The reason I did not make bot-commands the defacto default is because a command may only be whitelisted by role (meaning that a member without that role should also be unable to use it in bot-commands) and/or to allow for a different ch...

#

maybe. with_role arguably has better readability for this case, and it sounds like handling this well introduces a little more complexity to the decorator.. but I'm not violently opposed to generalizing around this decorator, I guess.

Why would it add complexity?

The only reason I currently see that would warrant additional complexity is if we'd want to raise a specific exception so that our error handler could handle the check failure in a different. However, in that case, we could...

regal archBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: bug/backend/894/win\-selector\-loop
ebon magnetBOT
#

Build 20200422.1 succeeded

Requested by

GitHub

Duration

00:01:18

Build pipeline

Bot

regal archBOT
#

Copying https://github.com/python-discord/django-crispy-bulma/pull/32#issuecomment-617921850 to this issue

I just tried to use the module with Django 3.0 and I noticed that the email input is not working as expected. It gets rendered to

<input type="email" name="email" maxlength="254" class="emailinput" id="id_email">

Though on the bulma webpage the CSS-class is solely "input". Could someone please check this?

north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200423.1 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200423.2 succeeded

Requested by

GitHub

Duration

00:01:18

Build pipeline

Bot

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200423.3 succeeded

Requested by

GitHub

Duration

00:01:14

Build pipeline

Bot

ebon magnetBOT
#

Build 20200423.4 succeeded

Requested by

GitHub

Duration

00:01:17

Build pipeline

Bot

regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200423.5 succeeded

Requested by

GitHub

Duration

00:02:51

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200423.6 succeeded

Requested by

GitHub

Duration

00:01:57

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200423.7 succeeded

Requested by

GitHub

Duration

00:01:16

Build pipeline

Bot

regal archBOT
#

I realised the command doesn't account for a user having multiple channels claimed. Going to look into it, but at a glance there doesn't seem to be an simple way to address this currently.

Right, if a member claims two channels (respecting the 15-minute cooldown), they role they received after claiming the second channel will also be removed if the first channel was made dormant as it only does an "is_claimaint" check that has no knowledge of for which channel the role was assigned. I ...

regal archBOT
#

Should either all be using Azure or all be using GH Actions. I prefer Azure cause it's consistent with other projects. However, that isn't preference is not something I hold strongly. Either one is fine, as long as just one is used rather than both.

Furthermore, I liked the ability to trigger on version bump. I think that feature should stay. If not, then the files in the scripts folder are obsolete and can be removed. That being said, Azure (and possible GH Actions) has a GH release t...

regal archBOT
regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200424.1 succeeded

Requested by

GitHub

Duration

00:01:46

Build pipeline

Bot

regal archBOT
#

Sometimes discord.Forbidden errors are raised due to the bot being lower in the role hierarchy than the user they are trying to edit. An example of this is joe trying to superstarify himself (see BOT-3C).

Depending on which groups of users this affects, we should try to gracefully handle such error. If this only affects the server owner (as in, true ownership, not just the role we have), the...

regal archBOT
#

Sentry Issue: BOT-33

Strange issue that has happened 6 times in which a attachment fails to be uploaded due to a 415 (unsupported media type) error.

My suspicion is that it's not due to a misconfigured Content-Type header as one would expect but rather Discord's API using that error to reject certain files. I don't know how Content-Type could possibly be wrong.

This has happened for both `....

native joltBOT
regal archBOT
regal archBOT
north knotBOT
#

Postgres backup completed!

ebon magnetBOT
#

Build 20200425.1 succeeded

Requested by

GitHub

Duration

00:01:33

Build pipeline

Bot

regal archBOT
regal archBOT
#

Another problem is that the ManyToManyField does not seem to be rendered correctly. In the default rendering the layout breaks with following fields. Adding the is-multiple seems to fix the issue:

<div class="select"> โžž <div class="select is-multiple">

It gets even worse when enforcing a CheckboxSelectMultiple:

admins = forms.ModelMultipleChoiceField(
        queryset=User.objects.all(),
        widget=forms.CheckboxSelectMultiple(),
)

In this case nothing is...

regal archBOT
#
[python-discord/bot] New branch created: bug/backend/906/converter\-year\-range
ebon magnetBOT
#

Build 20200425.2 succeeded

Requested by

GitHub

Duration

00:01:22

Build pipeline

Bot

regal archBOT
regal archBOT
#

Since there seems to be two ways for the custom BadArgument exception to be raised from this method, I would recommend explicitly testing for each of them in test_converters.py with assertRaisesRegex() to ensure the correct one occurs. There seems to be an existing test for the former in:

https://github.com/python-discord/bot/blob/6e97a6af9a72286b9ec8102e1abd64f634fe8d92/tests/bot/test_converters.py#L193-L199.

(Note that the above msg kwarg in assertRaises() does not test the...

regal archBOT
#

If the user trying to start Minesweeper has DMs disabled
then warn him in the channel where the command was
invoked.

Relevant Issues

Closes #399

Description

To fix this we check for discord.errors.Forbidden after sending the DM and inform the user if he has DMs disabled.

Reasoning

Currently if user has DMs disabled the script fails silently without informing him of any issues.

Did you:

ebon magnetBOT
#

Build 20200426.1 succeeded

Requested by

GitHub

Duration

00:00:51

Build pipeline

Seasonal Bot

north knotBOT
#

Postgres backup completed!

native joltBOT
#

The ANN101 and ANN102 rules, have a footnote which says to see some other documentation about how to annotate self/cls. However, the very first sentence of the first link says:

In most cases the first argument of class and instance methods does not need to be annotated, and it is assumed to have the type of the containing class for instance methods, and a type object type corresponding to the containing class object for class methods.

It then only shows an example of annotating self, ...

regal archBOT
ebon magnetBOT
#

Build 20200427.1 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

regal archBOT
north knotBOT
#

Postgres backup completed!

ebon magnetBOT
#

Build 20200427.2 succeeded

Requested by

GitHub

Duration

00:01:16

Build pipeline

Bot

regal archBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200427.3 succeeded

Requested by

GitHub

Duration

00:01:40

Build pipeline

Bot

regal archBOT
#

5416280 Constants: add help channel cooldown role - MarkKoz
9e67ebe HelpChannels: remove ensure_permissions_synchro... - MarkKoz
06d12a0 HelpChannels: add helper function to check for ... - MarkKoz
427c954 HelpChannels: clear roles when resetting permis... - MarkKoz
efc778f HelpChannels: add/remove a cooldown role rather... - MarkKoz

#
[python-discord/bot] branch deleted: feat/frontend/839/help\-channel\-role
north knotBOT
ebon magnetBOT
oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200427.5 succeeded

Requested by

GitHub

Duration

00:01:26

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200427.6 succeeded

Requested by

GitHub

Duration

00:01:32

Build pipeline

Bot

regal archBOT
#

1140e96 Replace in_channel decorator by in_whitelist... - SebastiaanZ [00291d7](https://github.com/python-discord/bot/commit/00291d7d5f859e4131cb5c94541a90f80f358376) Remove vestigial kwargs from MockTextChannel.__... - SebastiaanZ [57e6992](https://github.com/python-discord/bot/commit/57e69925af9a941dfe32acc0431a9699eda027f5) Add tests for in_whitelisted_context decorator - SebastiaanZ [0924744](https://github.com/python-discord/bot/commit/092474487d75ef6430e533b85fe386d837fbf3a6) Allow !eval in help channel categories - SebastiaanZ [b20bb74](https://github.com/python-discord/bot/commit/b20bb7471b8d1d01f217f0620f8597bf1bae4456) Simplify in_whitelisted_context` decorator API - SebastiaanZ

#
[python-discord/bot] branch deleted: broadening\-eval\-whitelist
north knotBOT
ebon magnetBOT
#

Build 20200427.7 succeeded

Requested by

GitHub

Duration

00:02:50

Build pipeline

Bot

oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200427.9 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

#

Build 20200427.8 succeeded

Requested by

GitHub

Duration

00:01:26

Build pipeline

Bot

ebon magnetBOT
#

Build 20200427.11 succeeded

Requested by

GitHub

Duration

00:01:12

Build pipeline

Bot

regal archBOT
regal archBOT
#

Background

We've been seeing lots of KeyError exceptions occur in groups at intervals of 3-4 hours. A log sample can be found here: https://paste.pythondiscord.com/uzokiserux.py

These errors happen every time a new message is sent in an occupied channel. The on_message listener calls a function to check if a channel has been answered (i.e. someone other than the claimant has typed something).

Analysis

The check_for_answer only attempts to get the claimant if

  1. The ...
#
[python-discord/bot] New branch created: add\-bottom\-sorting\-to\-help\-channels
#

This PR reintroduces the bottom-sorting behavior that we tried before, but with a different strategy that is reliable in the way it sorts the channels and minimizes the number of glitches visible in the channel list. The strategy utilizes the same "bulk channels update" endpoint as discord.py uses to move channels, but builds the payload in a different that minimizes the number of required position integer changes. It does use the discord.py http methods to send the payload to ensure `dis...

ebon magnetBOT
#

Build 20200427.12 succeeded

Requested by

GitHub

Duration

00:01:16

Build pipeline

Bot

regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
#
[python-discord/bot] branch deleted: add\-bottom\-sorting\-to\-help\-channels
north knotBOT
ebon magnetBOT
oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200428.2 succeeded

Requested by

GitHub

Duration

00:01:18

Build pipeline

Bot

regal archBOT
regal archBOT
regal archBOT
#

That's a good question - I personally think that just trying to send the message is fine.

If we look at what the function is doing, it's roughly these steps:

1. Check if the user is playing, exit if so
2. Some initial setup
3. Dispatch guild message
4. Dispatch direct message
5. Start the actual game

The order of 3 and 4 seems to be fairly arbitrary - it's not a logical succession, just two things that need to be done. We could therefore switch their p...

regal archBOT
ebon magnetBOT
#

Build 20200428.3 succeeded

Requested by

GitHub

Duration

00:01:31

Build pipeline

Bot

ebon magnetBOT
#

Build 20200428.4 succeeded

Requested by

GitHub

Duration

00:01:14

Build pipeline

Bot

regal archBOT
#

Where the internal references don't show up as inline codeblock

Do inline codeblocks within embeds not work on mobile at all or what's the deal? I agree this should be fixed if possible.

we collect all the signatures of functions but some have aliases and others group them by category. How should this be handled if at all?

There isn't a reliable way to distinguish aliases, is there? I don't think having aliases shown is that bad of a thing anyway.

regal archBOT
ebon magnetBOT
#

Build 20200429.1 succeeded

Requested by

GitHub

Duration

00:00:55

Build pipeline

Seasonal Bot

regal archBOT
#

Do inline codeblocks within embeds not work on mobile at all or what's the deal? I agree this should be fixed if possible.

inline codeblocks alone are shown and work properly but the internal references are translated to (invalid) links through the converter and that is handled differently on the mobile client.
The secrets embed has this description

description: New in version 3.6.

             **Source code:**
             [Lib/secrets.py](https://github.com/python/cpython/...
regal archBOT
#

Good idea w/ using IsolatedAsyncioTestCase, I was actually just revisiting the PR and about to suggest using it instead of asyncio.run(). asyncio.run() has a fair bit of additional overhead that isn't needed for testing purposes, especially when you call it multiple times (it creates and closes a new event loop each time it's used, in addition to some other cleanup calls related to tasks, async generators, and in 3.9 the default executor).

regal archBOT
#

Encountered this locally and getting the error every time !close is invoked.
With trace logging the issue seems to be on_message for the invokation message being received and then the channel moved after that happens.
After adding a few additional logging points added the logs look like this
https://paste.fuelrats.com/ecekeratas.txt

With call order like this the channel gets removed from from help_channel_claimants but remains in unanswered. Then the category check passes beca...

#

Thanks for looking into it. That makes more sense than my conclusion. I think we should use proper locks for the command rather than relying on the claimant being deleted from the dict. I was already looking into using locks but haven't gotten too far. I was thinking each channel should have its own lock. I've already made a change locally to group channel data into a dataclass rather than many dictionaries, so the lock could be stored there too.

#

My idea for fixing the links is to parse them as markdown to find links and then check if they start with a valid schema (just http or https in this case). It could be taken a step further by trying to resolve the relative links and making them absolute. I don't know feasible this parsing is in practice.

For the dunders, in that specific case, I think they should all be included since they are all relevant to the documentation text, as you stated yourself.

#

@lemonsaurus To be clear, this change will apply to all mod logs, not just infraction searches. Infraction searches may not be common but infraction logs are relatively more common. Still, I think your point stands that they don't happen frequently enough for the API calls to be a huge hit. But on the other hand, it may not be as important to have logs with the most up to date name compared to when a staff member is explicitly trying to retrieve information like with !infr search. I rem...

north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
regal archBOT
#
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

When the snekbox output contains a pattern from the ESCAPE_REGEX [`\u202E\u200B]{3,}, the otput is not displayed (and unnecessary work is done)
https://github.com/python-discord/bot/blob/fe325adc66e9621ea970abd83db58df4b792caa5/bot/cogs/snekbox.py#L160-L161
The output can still be uploaded to the paste service, as the contents won't affect anything on there, to provide it in some form to the user.

The findall method used can also be changed to search since we don't care about the...

regal archBOT
#
[python-discord/bot] New branch created: bug/backend/911/log\-listener\-exceptions
ebon magnetBOT
#

Build 20200429.2 succeeded

Requested by

GitHub

Duration

00:01:14

Build pipeline

Bot

regal archBOT
north knotBOT
oak estuaryBOT
ebon magnetBOT
#

Build 20200430.1 succeeded

Requested by

Joseph Banks

Duration

00:02:55

Build pipeline

Bot

regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
regal archBOT
#

0c1c59c Added news to allowed bot setting names. - ks129
36f9f1f Created migration fo Python News feature on bot - ks129
0ab9761 Merge branch 'master' into news-bot-setting - ks129
86538bb Fixed migration 51 file end (create_news_setti... - ks129 [0dbc6e9](https://github.com/python-discord/site/commit/0dbc6e9165d188c55966eb267752eda42d274a0c) Fixed migration nr 51 down` function object ge... - ks129

north knotBOT
regal archBOT
ebon magnetBOT
#

Build 20200430.1 succeeded

Requested by

Joseph Banks

Duration

00:03:44

Build pipeline

Site

regal archBOT
#

I've got some concerns on how well this will scale. If we have 100 posts in the channel (not an unachievable number) and there are 10 new ones without any caches in the bot (not unlikely since we restart a lot) we will be making 1,000 API calls. A better way to do this is not use Discord for this and instead store the ID of the thread, using the thread_id property of the mailman API (see below) and compare against that.

regal archBOT
#

Another problem for BooleanFields: the input field for the checkbox seems to be rendered twice. For example:

<div id="div_id_is_active" class="field"> 
    <input type="checkbox" name="is_active" class="checkboxinput" id="id_is_active" checked="">
    <label for="" class="label">Is active</label>
    <p class="control">
        <input type="checkbox" name="is_active" class="checkboxinput" id="id_is_active" checked="">
    </p>
    <p id="hint_id_is_active" class="help">Only acti...
regal archBOT
#

We recently had some complains about people not managing to make their re-eval working because of the very short window for editing your code, which is set to 10 seconds right now. I think it wouldn't hurt to increase it to something like 30 seconds, as it has a very low footprint, and making substantial changes to the code in 10s is almost impossible.

Here is the line where it is hardcoded for now :
https://github.com/python-discord/bot/blob/cfc5720925b6bbc40c45507f8579145a0014a6eb/bot/...

regal archBOT
night lilyBOT
#
SeasonalBot

Connected!

#
SeasonalBot

Connected!

#
SeasonalBot

Connected!

oak estuaryBOT
ebon magnetBOT
#

Build 20200430.2 failed

Requested by

GitHub

Duration

00:00:43

Build pipeline

Bot

regal archBOT
regal archBOT
#

Putting the refresh on the output message would work (and removing it after 30 seconds), but we need to keep track of the invocation message in that case.

We already put the trashcan emoji on there so an additional 1 emote would not be disastrous.

To inform users we could put a little note at the end, like in the following mockup (we could remove the note from the end when we remove reactions):

<img width="845" alt="image" src="https://user-images.githubusercontent.com/20439493/80746...

regal archBOT
#

Currently, users need to either need to read the help description for the command or have the intuition to edit their message in order to discover the feature. It's a good idea to always react with the emoji since it will make the feature more prominent. However, I believe reacting on the user's message rather than the bot's output will be more intuitive.

Joe's suggestion of including a message at the end would be effective but I am concerned it may detract from the results so I am against...

#
[python-discord/bot] New branch created: bug/info/914/user\-animated\-avatar
ebon magnetBOT
#

Build 20200501.1 failed

Requested by

GitHub

Duration

00:01:02

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200501.2 succeeded

Requested by

GitHub

Duration

00:01:13

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200501.3 succeeded

Requested by

GitHub

Duration

00:01:18

Build pipeline

Bot

ebon magnetBOT
#

Build 20200501.4 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

ebon magnetBOT
#

Build 20200501.5 succeeded

Requested by

GitHub

Duration

00:01:09

Build pipeline

Bot

regal archBOT
regal archBOT
#

During testing the only way I was able to prevent my bot from sending me the DM was by blocking it, in which case I couldn't message it either. Disabling DMs from members of all guilds that I share with my bot wouldn't stop it - not sure whether this is because we already have a message history, or perhaps because it's my bot? Anyway, the reason why I mention this is that I was originally concerned about the case where a user will invoke the command in DMs (therefore ctx represents the `D...

regal archBOT
#
[python-discord/bot] branch deleted: bug/info/914/user\-animated\-avatar
north knotBOT
ebon magnetBOT
#

Build 20200501.6 succeeded

Requested by

GitHub

Duration

00:02:32

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: feat/util/remove\-mention\-cmd
ebon magnetBOT
#

Build 20200501.7 succeeded

Requested by

GitHub

Duration

00:01:31

Build pipeline

Bot

regal archBOT
#

Reproduced this locally with setting up Big Brother watch and sending text files.
The problem is with discord.py's handling of the use_cached=True kwarg here
https://github.com/python-discord/bot/blob/687f2c4c5875e9de2abeeb122eeee529816ee204/bot/utils/messages.py#L80
For getting cached, it uses the proxy_url of the attachment which in case of text (non media) files seems to be invalid as they are not processed on the media server to be shown to the user.

How should this be handled? ...

north knotBOT
#

Postgres backup completed!

ebon magnetBOT
#

Build 20200502.2 succeeded

Requested by

GitHub

Duration

00:01:18

Build pipeline

Bot

#

Build 20200502.1 succeeded

Requested by

GitHub

Duration

00:01:06

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200502.3 succeeded

Requested by

GitHub

Duration

00:01:27

Build pipeline

Bot

regal archBOT
#

Will address the stylistic comment later today.

-- Serban Constantin

On Fri, May 1, 2020, 14:33 kwzrd notifications@github.com wrote:

@kwzrd approved this pull request.

During testing the only way I was able to prevent my bot from sending me
the DM was by blocking it, in which case I couldn't message it either.
Disabling DMs from members of all guilds that I share with my bot wouldn't
stop it - not sure whether this is because we already have a message
history, or perhaps...

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200503.1 succeeded

Requested by

GitHub

Duration

00:01:17

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
regal archBOT
#

The halloweenify cog will generate a Halloween-themed nickname for the invoking user, and then attempt to set it as a guild nickname.

https://github.com/python-discord/seasonalbot/blob/b45272aa62859abedc1ccc1836f0a61935394e87/bot/exts/halloween/halloweenify.py#L44

It does not currently handle the following situations.

Lacking permissions

When invoked by a staff member, the bot lacks the required permissions, and a discord.Forbidden exception silently kills the command.

T...

regal archBOT
ebon magnetBOT
#

Build 20200504.1 succeeded

Requested by

GitHub

Duration

00:00:59

Build pipeline

Seasonal Bot

ebon magnetBOT
#

Build 20200504.2 succeeded

Requested by

GitHub

Duration

00:00:53

Build pipeline

Seasonal Bot

regal archBOT
#
[python-discord/bot] New branch created: feature/hemlock/perma\-ban\-override\-temp
ebon magnetBOT
#

Build 20200504.2 succeeded

Requested by

GitHub

Duration

00:01:16

Build pipeline

Bot

regal archBOT
regal archBOT
regal archBOT
#

Whatever would be less redundant. Keep in mind unhanded exceptions would cause the message with the eval results to not get sent. Exceptions would need to at least be handled by the callers rather than propagating all the way out to the generic error handlers. If the error handling is relatively complex then it's likely better to handle it locally rather than externally. It could return None in such case, which may be an easier value for callers to deal with than the exceptions.

regal archBOT
#

This was a debate not only on the issue page: (see https://github.com/python-discord/bot/issues/889) but also in #meta a few times, and the consensus seemed to be that the primary focus should be the .txt file extension as there was no reason to unblock .csv, .json, or like file types.

Also, as for the message to display, I wanted to cover both case scenarios (someone who uploaded code, and someone whose message was too long) and writing a longer embed was the least expensive way to do so ...

ebon magnetBOT
#

Build 20200504.3 succeeded

Requested by

GitHub

Duration

00:01:07

Build pipeline

Bot

regal archBOT
regal archBOT
#

With handling it locally we can also attempt multiple requests easily for timed out connections, but it does take away info of what kind of error is happening when one does happen. But all things considered it'll probably be better to do it in the function as the handling would be somewhat repetitive.
What do you think about returning the status code/error message if an error does happen? Not sure there as it would need to differentiate between a successful return and a failed one for the me...

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

One is due to Discord's limitations on embeds (no paginator involved). The other is due to our configured max length for an page in a paginated embed.

Ah, okay. It seems that I likely misunderstood the original issue; I had assumed the solution to that would also involve pagination. For simplicity, I'll just open a separate issue for the infraction message problem and work on that separately. That's the one I'm primarily concerned about and more motivated to fix since it has a direct imp...

#

I believe the preferred way of addressing this error would be via an improvement to the infraction message pagination. If the contents of a single message would exceed the character limit for a single page (998), it could be changed to overflow onto the second page. The boundaries of the infraction would be indicated by the existing separator ===============, and potentially with a new (Continued) line at the top of the overflow page to show that it's a continuation of the last message.
...

regal archBOT
regal archBOT
#

A general improvement to the paginator would be to move a line to a new page if it would cause the character limit for the page to be exceeded.

I feel splitting an infraction across two pages would be somewhat confusing to follow. How about we raise the character limit to the maximum (around 2000) for infraction search embeds? If it's still not enough, the infraction could be moved to its own page without any other infractions. If that's still not enough, then continue it on the following ...

north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200505.1 succeeded

Requested by

GitHub

Duration

00:01:15

Build pipeline

Bot

regal archBOT
#

bc47848 Update extension filter to distinguish .txt in ... - Savant-Dev
0ce4b2f Update extension filter to distinguish .txt in ... - Savant-Dev
b6ebfb7 Update antimalware to filter txt files in cases... - Savant-Dev
fdf2d71 Merge branch 'master' into antimalware - LordHemlock
3533b06 Merge pull request #925 from Savant-Dev/antimal... - LordHemlock

north knotBOT
oak estuaryBOT
ebon magnetBOT
#

Build 20200505.2 succeeded

Requested by

GitHub

Duration

00:02:57

Build pipeline

Bot

regal archBOT
regal archBOT
#

I feel splitting an infraction across two pages would be somewhat confusing to follow. How about we raise the character limit to the maximum (around 2000) for infraction search embeds? If it's still not enough, the infraction could be moved to its own page without any other infractions. If that's still not enough, then continue it on the following page.

That sounds reasonable to me. I agree that continuation onto the next page should probably be used as a last resort, so if we can increa...

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200505.3 succeeded

Requested by

GitHub

Duration

00:01:12

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] branch deleted: bug/backend/911/log\-listener\-exceptions
north knotBOT
ebon magnetBOT
oak estuaryBOT
regal archBOT
#

First, to answer your direct question: it's not worth the trouble worrying about it, so follow the path of least resistance. I outline below why I think it's useless to begin with.

I had to look at the code to understand what you mean. For anyone else reading, I will sum it up:

It looks for a variable named _ and returns it if it exists (after awaiting it if it's awaitable). When formatting the code block, it artificially appends <Embed> to the output if it detects the return value ...

regal archBOT
#

A general improvement to the paginator would be to move a line to a new page if it would cause the character limit for the page to be exceeded.

Based on my local experimentation so far and looking over the code, it looks like the paginator already does this in LinePaginator.add_line(). When attempting to add an additional line to the current page and it would exceed the the limit, it is closed, and the line is instead appended to a new page. See https://github.com/python-discord/bot/bl...

#

I've been thinking further about a reasonable character limit for the infraction messages. Although upping it to 2k would help to ensure it fits most messages, there is something to be said about having a condensed infraction paginator. Frequently in the #mods channel, we search for a user currently being discussed and then talk about it. I've found that the existing limit of 1k can already get in the way sometimes by taking up too much space, so a 2k one would be even worse (especially for...

#

Based on my local experimentation so far and looking over the code, it looks like the paginator already does this

Sorry, I missed that when looking over the code.

I also added a dashed line --- to more clearly separate the (Continuation) header from the actual content, which makes it significantly easier to read multi-page messages.

Good idea. I like the look of it.

I'm not sure what the upper bound limit as far as max continuation pages would realistically be

While it is...

#

there is something to be said about having a condensed infraction paginator

I considered this but didn't suggest a solution cause I felt it was getting a bit complex. My idea is to keep it at 1k but allow it to go to 2k if the message is already on its own page and still too long. I upping the limit to potentially preserve the infraction on a single page is preferred over splitting it to maintain the shorter char length limit.

ebon magnetBOT
#

Build 20200506.1 failed

Requested by

GitHub

Duration

00:01:04

Build pipeline

Bot

regal archBOT
#

I suggest moving the reason to the end. This way all other infraction fields can stay on the same page to maintain context for the reader.

Good idea, I think that will further improve readability by a significant amount. I'll work on it next.

My idea is to keep it at 1k but allow it to go to 2k if the infraction is already on its own page and still too long. I think upping the limit to potentially preserve the infraction on a single page is preferred over splitting it to maintain th...

north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

The ID of the webhook is not aligned with the other IDs in this section; it's missing one space character.

Also, for the other aliases/IDs, we typically align them on a tab stop (with the first character of the alias/ID starting at a column that's a multiple of 4). For these constants, this would mean this:

        talent_pool:                    569145364800602132
        big_brother:                    569133704568373283
        reddit:                         6354083...
#

I think there's already been some discussion about this, but personally I feel that names like News and news.py (bot.cogs.news) do not explicitly communicate the purpose of the cog or the extension. In our extension system, the extension is now just "news", which does not communicate that it's the Python News relay feature we have instead of, say, a file/extension/cog for posting server announcements.

ebon magnetBOT
#

Build 20200506.2 succeeded

Requested by

GitHub

Duration

00:01:13

Build pipeline

Bot

#

Build 20200506.3 succeeded

Requested by

GitHub

Duration

00:01:19

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200506.4 succeeded

Requested by

GitHub

Duration

00:01:13

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200506.5 succeeded

Requested by

GitHub

Duration

00:01:17

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200506.6 succeeded

Requested by

GitHub

Duration

00:01:26

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200506.7 succeeded

Requested by

GitHub

Duration

00:01:24

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200507.1 succeeded

Requested by

GitHub

Duration

00:01:22

Build pipeline

Bot

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200507.1 failed

Requested by

GitHub

Duration

00:01:15

Build pipeline

Snekbox

regal archBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200507.2 succeeded

Requested by

GitHub

Duration

00:01:15

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] branch deleted: bug/backend/894/win\-selector\-loop
north knotBOT
ebon magnetBOT
#

Build 20200507.3 succeeded

Requested by

GitHub

Duration

00:02:53

Build pipeline

Bot

oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200507.5 succeeded

Requested by

GitHub

Duration

00:01:12

Build pipeline

Bot

#

Build 20200507.4 succeeded

Requested by

GitHub

Duration

00:01:19

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200507.6 succeeded

Requested by

GitHub

Duration

00:01:24

Build pipeline

Bot

#

Build 20200507.7 succeeded

Requested by

GitHub

Duration

00:01:04

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200507.8 succeeded

Requested by

GitHub

Duration

00:01:03

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200507.9 succeeded

Requested by

GitHub

Duration

00:01:07

Build pipeline

Bot

regal archBOT
#

Looks excellent, but we'll need to resolve the conflict with the master branch. It's here because the seasons directory was renamed to exts. I believe that's the only thing that needs adjusting.

If you need help doing this, let me know.

Additionally, on line 948, I just noticed the link to gitlab is broken / outdated. I think it'd be great if we could adjust it to point to https://pythondiscord.com/pages/code-jams/code-jam-1-snakes-bot/. Thanks!

regal archBOT
ebon magnetBOT
#

Build 20200507.10 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

regal archBOT
regal archBOT
#

I'd prefer if only the line that we expect to raise was in the try block, e.g.:

if isinstance(...):
    try:
        await ctx.author.edit(...)
    except Forbidden:
        # append no permissions message
    else:
        # append success message
else:
    # append DM message

This way the logic for both cases (guild / DM) is clearly separated, and we see exactly which lines may raise.

I like the comment on line 49 - helps see why we're branching there.

regal archBOT
ebon magnetBOT
#

Build 20200507.11 failed

Requested by

GitHub

Duration

00:00:54

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200507.12 succeeded

Requested by

GitHub

Duration

00:01:30

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200507.13 succeeded

Requested by

GitHub

Duration

00:01:22

Build pipeline

Bot

ebon magnetBOT
#

Build 20200507.14 succeeded

Requested by

GitHub

Duration

00:01:17

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200508.1 succeeded

Requested by

GitHub

Duration

00:01:22

Build pipeline

Bot

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200508.1 failed

Requested by

GitHub

Duration

00:00:57

Build pipeline

Seasonal Bot

regal archBOT
#

Changed Prefix in .snakes about from ! to .
https://github.com/python-discord/seasonalbot/issues/374

Relevant Issues

Closes #374

Description

Changed prefix from ! to .

Reasoning

The prefix used to be ! but the commands were using a . prefix

Did you:

  • [x] Join the Python Discord Community?
  • [x] If dependencies have been added or updated, run pipenv lock?
  • [x] Lint your code (pipenv run lint)?
  • [x] Set th...
ebon magnetBOT
#

Build 20200508.2 failed

Requested by

GitHub

Duration

00:00:52

Build pipeline

Seasonal Bot

#

Build 20200508.3 succeeded

Requested by

GitHub

Duration

00:00:53

Build pipeline

Seasonal Bot

regal archBOT
ebon magnetBOT
#

Build 20200508.2 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200508.3 succeeded

Requested by

GitHub

Duration

00:01:19

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200508.4 succeeded

Requested by

GitHub

Duration

00:01:28

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200508.5 succeeded

Requested by

GitHub

Duration

00:01:29

Build pipeline

Bot

regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200508.6 succeeded

Requested by

GitHub

Duration

00:01:23

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] branch deleted: feat/util/remove\-mention\-cmd
north knotBOT
ebon magnetBOT
#

Build 20200508.7 succeeded

Requested by

GitHub

Duration

00:02:38

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
#
[python-discord/seasonalbot] New branch created: prefix\-rich\-presence
ebon magnetBOT
#

Build 20200508.4 succeeded

Requested by

GitHub

Duration

00:00:55

Build pipeline

Seasonal Bot

regal archBOT
#

You're not directly testing the following code works correctly. It may make sense to make it a separate function you can test.

file_extensions = {splitext(attachment.filename.lower())[1] for attachment in message.attachments}
extensions_blocked = file_extensions - set(AntiMalwareConfig.whitelist)

Also, note that the prevailing code style in our projects is to always put all items/arguments on separate lines when they're split into multiple lines. Parenthesis/brackets should a...

regal archBOT
#

I get an error testing it locally.

2020-05-08 12:59:35 | bot.utils | ERROR | An unexpected error has occurred during handling of the request, trying again (3/3).
Traceback (most recent call last):
  File "/home/mark/repos/python/bot-pydis/bot/utils/__init__.py", line 36, in send_to_paste_service
    response_json = await response.json()
  File "/home/mark/repos/python/bot-pydis/.venv/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1026, in json
    raise ContentTypeEr...
ebon magnetBOT
#

Build 20200508.8 succeeded

Requested by

GitHub

Duration

00:01:16

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200508.9 succeeded

Requested by

GitHub

Duration

00:01:10

Build pipeline

Bot

#

Build 20200508.5 succeeded

Requested by

GitHub

Duration

00:00:59

Build pipeline

Seasonal Bot

regal archBOT
ebon magnetBOT
#

Build 20200509.1 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200509.1 succeeded

Requested by

GitHub

Duration

00:00:56

Build pipeline

Seasonal Bot

ebon magnetBOT
#

Build 20200509.2 succeeded

Requested by

GitHub

Duration

00:00:54

Build pipeline

Seasonal Bot

regal archBOT
regal archBOT
#

Yet another embed that needs truncation

HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.description: Must be 2048 or fewer in length.
  File "discord/client.py", line 312, in _run_event
    await coro(*args, **kwargs)
  File "bot/cogs/moderation/modlog.py", line 720, in on_message_edit
    await self.send_log_message(
  File "bot/cogs/moderation/modlog.py", line 122, in send_log_message
    log_message = await channel.send(content=content, embed=embed, file...
#

At least one of the event handlers in the modlog do not properly account for messages being sent in DMs & attempt to perform a guild ID comparison, which doesn't exist in a DM. This should be guarded against across the cog.

AttributeError: 'NoneType' object has no attribute 'id'
  File "discord/client.py", line 312, in _run_event
    await coro(*args, **kwargs)
  File "bot/cogs/moderation/modlog.py", line 555, in on_message_delete
    if message.guild.id != GuildConstant.id or channel.id...
#

Filters that attempt to delete offending message(s) should check whether or not the message was sent in a DM, since the bot cannot delete others' DM messages.

Forbidden: 403 Forbidden (error code: 50003): Cannot execute action on a DM channel
  File "discord/client.py", line 312, in _run_event
    await coro(*args, **kwargs)
  File "bot/cogs/filtering.py", line 114, in on_message
    await self._filter_message(msg)
  File "bot/cogs/filtering.py", line 176, in _filter_message
    await ms...
north knotBOT
#

Postgres backup completed!

regal archBOT
#
[python-discord/bot] New branch created: bug/filters/933/dont\-delete\-in\-dms
ebon magnetBOT
#

Build 20200510.1 succeeded

Requested by

GitHub

Duration

00:01:19

Build pipeline

Bot

regal archBOT
native joltBOT
regal archBOT
#
[python-discord/bot] New branch created: bug/mod/932/modlog\-ignore\-dms
ebon magnetBOT
#

Build 20200510.2 succeeded

Requested by

GitHub

Duration

00:01:28

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] New branch created: bug/filters/929/invalid\-invites
ebon magnetBOT
#

Build 20200510.3 succeeded

Requested by

GitHub

Duration

00:01:26

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] New branch created: bug/filters/928/non\-ascii\-token
ebon magnetBOT
#

Build 20200510.4 succeeded

Requested by

GitHub

Duration

00:01:24

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200510.5 succeeded

Requested by

GitHub

Duration

00:01:12

Build pipeline

Bot

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200510.6 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

north knotBOT
ebon magnetBOT
#

Build 20200510.7 succeeded

Requested by

Leon Sandรธy

Duration

00:02:45

Build pipeline

Bot

oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200511.1 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

regal archBOT
#

The Utils cog feels a bit crowded with all the PEP methods around; I think they could be moved to a separate class, with only the command handled in the cog. Or at least grouped in the cog so they're not all over the place.

Is the periodic check on the inventories worth here? I don't think the command gets enough use to make it better over the two checks done previously, and the new caching helps a bit too. But would like some other opinions on that

The cache would also fit in the `ut...

north knotBOT
#

Postgres backup completed!

ebon magnetBOT
#

Build 20200511.1 succeeded

Requested by

GitHub

Duration

00:00:54

Build pipeline

Seasonal Bot

regal archBOT
#

Basically bot-settings is exactly this. This name don't refer to it, but this still is. Python News will use it to storage already sent news.

The long term solution for this will be persistent storage using Redis. I've setup Redis on our host server and I believe @lemonsaurus wanted to tackle the idea soon. In the meantime though, bot settings does work (however be careful of race conditions, it can easily overwrite itself)

regal archBOT
ebon magnetBOT
#

Build 20200511.3 succeeded

Requested by

GitHub

Duration

00:01:14

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] branch deleted: feature/hemlock/perma\-ban\-override\-temp
north knotBOT
ebon magnetBOT
#

Build 20200511.4 succeeded

Requested by

GitHub

Duration

00:02:45

Build pipeline

Bot

oak estuaryBOT
regal archBOT
#

Idea behind this issue is to lower the time until a channel becomes dormant/closed when original claimer deletes their messages if there are no replies to their question.
Currently channel will only go dormant after 30 mins of inactivity or when someone closes it manually.

There are cases in which some people will claim a channel and find a solution to their problem before anyone will even reply and due to not knowing they can close channel manually, they might delete their messages which...

ebon magnetBOT
#

Build 20200511.5 succeeded

Requested by

GitHub

Duration

00:01:18

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200511.6 succeeded

Requested by

GitHub

Duration

00:01:09

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200511.7 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200511.8 succeeded

Requested by

GitHub

Duration

00:01:33

Build pipeline

Bot

native joltBOT
regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
#
[python-discord/site] New branch created: post\-game\-jam
ebon magnetBOT
#

Build 20200512.1 succeeded

Requested by

GitHub

Duration

00:02:11

Build pipeline

Site

regal archBOT
#
[python-discord/site] branch deleted: post\-game\-jam
north knotBOT
regal archBOT
ebon magnetBOT
#

Build 20200512.2 succeeded

Requested by

Leon Sandรธy

Duration

00:03:44

Build pipeline

Site

oak estuaryBOT
native joltBOT
#

Partially related to #77, the logic used to identify the column location for the end of the function definition (aka the colon) is likely to fail in a number of cases.

The logic currently works by starting on the line where the function body begins & rewinding until a colon is found:

https://github.com/python-discord/flake8-annotations/blob/1fb0681c6960ada20ecc484a1e051fbbbb9c34a7/flake8_annotations/__init__.py#L193-L208

As illustrated by #77, this fails (with Python < 3.8) in the pr...

native joltBOT
regal archBOT
regal archBOT
north knotBOT
oak estuaryBOT
ebon magnetBOT
#

Build 20200513.1 succeeded

Requested by

GitHub

Duration

00:03:26

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!

ebon magnetBOT
#

Build 20200513.2 succeeded

Requested by

GitHub

Duration

00:02:06

Build pipeline

Bot

regal archBOT
#

ecb777b Created News cog - ks129
9e586ef Added #python-news channel ID to constants Cha... - ks129 [b99a767](https://github.com/python-discord/bot/commit/b99a767b8bde01c730fec0ceb1ddf6fdb31bb983) Added News cog loading - ks129 [bb48c5e](https://github.com/python-discord/bot/commit/bb48c5e6fea14bc8ec42b1188ceb5008fa259463) Added helper function News.sync_maillists - ks129 [b6450b5](https://github.com/python-discord/bot/commit/b6450b57207341d5cf9b581b0e56a579a154cae4) Added new dependency feedparser` - ks129

north knotBOT
oak estuaryBOT
ebon magnetBOT
regal archBOT
ebon magnetBOT
#

Build 20200513.4 succeeded

Requested by

GitHub

Duration

00:01:28

Build pipeline

Bot

regal archBOT
regal archBOT
regal archBOT
native joltBOT
#

Description

I have read several times documentation and PEP 484 and PEP 563 but did not get a clear idea how to get rid of these.

It would be very helpful to see any example of fixing this warning.

Please provide a clear & concise description of the proposed feature.

Rationale/Use Case

I've defined a model in Django:

from django.db import models

class Content(models.Model):
    name = models.CharField(max_length=255)

   def __str__(self) -> str:
  ...
native joltBOT
native joltBOT
regal archBOT
#

I'm not sure how the is_valid_timestamp works as I couldn't find anything about how the token structure works but it doesn't seem to be behaving as expected.

With the int struct unpacking, the resulting number can be negative which just seems invalid if it's a timestamp.
Then the "snowflake" + TOKEN_EPOCH gets passed to snowflake_time where the value gets right shifted into some small number and a datetime is returned from that, as that's supposed to work with the id that's in th...