#dev-log

1 messages ยท Page 71 of 1

regal archBOT
#
jb3
[python-discord/quackstack] New branch created: sane\-ci\-names
regal archBOT
#

I quite like this implementation from the staff PyWeek submission

def make_color(hue: float, dark_variant: bool) -> tuple[float, float, float]:
    saturation = 1
    lightness = random.uniform(.7, .85)

    # green and blue do not like high lightness, so we adjust this depending on how far from blue-green we are
    # hue_fix is the square of the distance between the hue and cyan (0.5 hue)
    hue_fix = (1 - abs(hue - 0.5))**2
    # magic fudge factors
    lightness -= hue_fi...
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: tp\-get\_review\-command
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: reject\-dms\-default\-check
odd spireBOT
odd spireBOT
regal archBOT
#

Might make sense for line 273 in _review.py, to be changed to use :eyes: instead of ๐Ÿ‘€ since you've changed the other ones, but this looks good to me, thanks!

To be honest, if we were to do that they should be Unicode points because Git messes up encoding sometimes. But we can't use the emoji names everwhere, it will fail in some places. I don't mind switching everything though.

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: stream\-and\-revokestream\-commands
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: reduce\-default\-stream\-duration
#
[python-discord/bot] branch deleted: reduce\-default\-stream\-duration
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
#

The YouTube Terms of Service have been updated a bit since March 14, 2020 when they were last edited in the ytdl tag. (They were last changed March 17, 2021 according to the site.)

Specifically, it looks like we need to fix the wording in restrictions 1 and 3.

https://github.com/python-discord/bot/blob/eeacceae01b95e39eaeecab2fd14f6edfb19b94b/bot/resources/tags/ytdl.md

I'm happy to tackle this one really quick once it's assigned to m...

regal archBOT
#
jb3
[python-discord/quackstack] branch deleted: sane\-ci\-names
odd spireBOT
regal archBOT
#

It's not clear that the referenced attribute need not exist in the config (in which case it'd use the default value of the class). Also, in this case, it should say overwritten not overwrote (though I find the entire "even if..." part to be confusing anyway).

We should try to come up with a way to explain it in terms of ConfigEntry attributes, since that is well documented above. If we just say it references the class's attribute, then they can refer to the above documentation for ho...

regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: vcokltfre\-avatar
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#

Since snekbox does not run with a tty, stdout is technically raw bytes, and thus incomplete surrogate pairs can be printed without the client application erroring, and instead fail within _consume_stdout when we attempt to decode it to a str.

This commit sets the PYTHONIOENCODING environment variable to inform python to open the pipe in utf-8 mode.

However, clever use of execl and os.unsetenv() can unset this environment variable, so we add a safety check to _consume_stdout to fail out ...

regal archBOT
#
[python-discord/quackstack] New branch created: time\-fix
#
[python-discord/quackstack] New branch created: slash\-duck\-fix
#
[python-discord/quackstack] New branch created: docker\-update
regal archBOT
#
[python-discord/bot] New branch created: decorator\-tag
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

Do note that some cog relies on other files like HelpChannel is actually made of four files. We need to find a way to detect those additional files and also change their logging level.

Setting the level on the parent logger of the package will make all the children inherit it so we don't need to discover those manually.

But I'm not sure how util logs should be handled with changing levels, for example the utils.lock will continue logging with the previous level even for informati...

#

Setting the level on the parent logger of the package will make all the children inherit it so we don't need to discover those manually.

Cool, that should work then.

But I'm not sure how util logs should be handled with changing levels, for example the utils.lock will continue logging with the previous level even for information that is relevant to the ext where the level was changed, but then changing it will also cause logs from locks from all the other exts to change.

I th...

oak estuaryBOT
oak estuaryBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

@Kronifer The default task system is meant to run python modules, such as the main bot for example, it doesn't seem able to run arbitrary commands like taskipy. Taskipy is closer in functionality to pipenv scripts, and scripts from other languages' package managers. This is needed for tasks such as linting with flake8. A possible alternative that uses the builtin system would be defining all of our tasks as python modules, but that seems a little pointless.

odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/quackstack] branch deleted: slash\-duck\-fix
#
[python-discord/quackstack] branch deleted: docker\-update
#
[python-discord/sir-lancebot] New branch created: issues\-more\-repos
#

Description

Currently repos such as quackstack don't work with the issues cog when typing, for example, quackstack#29 into discord, since by default GitHub paginates repos to 30 per page, and we only fetch one page.

Reasoning

Reasoning is to make the functionality work for repos beyond the 30 repo pagination limit, by adding a per_page query string to get 100 per page. This is not a permanent fix, but it should certainly suffice for a long time - another 64 repos.

Did you...

odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: issues\-more\-repos
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

It would be great to have Sir Lancebot spot latex syntax in messages and send an image rendering it.

Reasoning

There are math-related questions in the off-topic channels fairly frequently, and writing equations in plain text is quite, uh, painful.

Proposed Implementation

We could use matplotlib for rendering the latex, it seems to do the job pretty well.
Messages with text enclosed in $ symbols would be identified, said text would be rendered, and its image ...

oak estuaryBOT
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

On second thought, it's useful to assert the exit code to distinguish this case from the case of snekbox catching the error and handling it. Asserting the traceback is needed cause the exit code on its own would be too broad of an assertion. That being said, do you think simplifying it to assert "UnicodeEncodeError" in output would be sufficient?

regal archBOT
#

Relevant Issues

Closes #661

Description

In this PR, I changed the url for getting the pull info to https://api.github.com/repos/{user}/{repository}/pulls/{number}, and check if pull_data["draft"] is true, and if so, use the :PRDraft: emoji.

Reasoning

It makes more sense when the PR is a draft that the bot will show the draft PR icon/

Screenshots

![draft-pr-emoji](https://user-images.githubusercontent.com/78174417/114065539-c55a9200-9868-11eb-86dc-125d2...

odd spireBOT
regal archBOT
#

Removed the Name one thing you like about a person to your right. topic as it doesn't make sense in discord

Relevant Issues

Closes #664

Description

Removed the topic

Reasoning

Its not really answerable on discord.

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 the PR to **allow edits fro...
odd spireBOT
regal archBOT
#

Description

It'll just emulate the cowsay program.

Reasoning

This would be useful because it would be funny.

Proposed Implementation

It would have the flags of the original cowsay, such as tux, except maybe the head in ass one.

Would you like to implement this yourself?

  • [ ] I'd like to implement this feature myself
  • [x] Anyone can implement this feature
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: word\-boundaries\-in\-issues\-regex
#

Description

Add \b characters around the issues regex

Reasoning

So we only respond to issues if the regex fully matches a word.

EG sir-lancsdrbot#1 would match bot#1, whereas now it wouldn't match at all.## Did you:

  • [ ] Join the Python Discord Community?
  • [ ] If dependencies have been added or updated, run pipenv lock?
  • [ ] Lint your code (pipenv run lint)?
  • [ ] Set the PR to allow edits from contributors?
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: word\-boundaries\-in\-issues\-regex
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

Simple addition to remove the connect permission from the everyone role and restore it when done.

Reasoning

Keep people from joining voice channels during a raid, making the entire server as read only as it can get.

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 the PR to **allow edits from c...
odd spireBOT
regal archBOT
#

If we're going for shutting down voice channels, should we also set speak to False too?

No, because if you can't connect to a voice channel, you can't talk in them.

I'm referring to users who are already in voice channels.

If they're already in voice channel, permissions aren't applied until one leaves and rejoins. To fix this, the bot would need to recurse through everyone in the voice channels and disconnect them from the channels.

#

If we're going for shutting down voice channels, should we also set speak to False too?

No, because if you can't connect to a voice channel, you can't talk in them.

I'm referring to users who are already in voice channels.

If they're already in voice channel, permissions aren't applied until one leaves and rejoins. To fix this, the bot would need to recurse through everyone in the voice channels and disconnect them from the channels.
...

#

If we're going for shutting down voice channels, should we also set speak to False too?

No, because if you can't connect to a voice channel, you can't talk in them.

I'm referring to users who are already in voice channels.

If they're already in voice channel, permissions aren't applied until one leaves and rejoins. To fix this, the bot would need to recurse through everyone in the voice channels and disconnect them from the channels.
...

regal archBOT
oak estuaryBOT
regal archBOT
#

3072fff Use PYTHONIOENCODING to enable utf-8 stdout for... - bast0006
cf1cb44 Match new unicode eval tests and output to the ... - bast0006
802441b Note new return case in eval api file - bast0006
4b3a226 Clarify documentation of None return code - MarkKoz
93f99fb Merge PR #100 - avoid decoding of invalid Unico... - MarkKoz

#

Currently, only CPU and memory parent cgroups are created. While this works fine for the default config, it doesn't account for custom configs which may use additional cgroups. It should either create all possible parents or try to read the config and determine which cgroups are needed. If the latter is possible and not complicated to implement, then it would be preferable to the former.

Special cases, similar to disabling swap for the memory cgroup, should be investigated when creating th...

#

Currently, all output is interpreted as Unicode text. Supporting byte output would allow a much more diverse range of things that could be returned e.g. images and sound. I think it makes sense to maintain a single endpoint and simply add a parameter to change from text to byte mode, but I'm still open to discussion on making it a separate endpoint.

Since the API uses JSON, the bytes would have to be base64-encoded, unless someone has a better alternative (which could perhaps also be a goo...

oak estuaryBOT
regal archBOT
#

Custom arguments to the Python subprocess would enable execution of other modules e.g. timeit. These arguments should be appended after the arguments in the nsjail config. In other words, they should replace the implicit -c argument

The arguments should be supplied as an array of strings in the JSON body of the POST request.

For example, given the current default configuration, passing ["-m", "timeit"] should result in /usr/local/bin/python -Squ -m timeit "the code here". Notice...

#

A long time ago I made a rough draft of a filter:

seccomp_string: "KILL {"
seccomp_string: "   execve,"
seccomp_string: "   execveat,"
seccomp_string: "   shmget,"
seccomp_string: "   shmat,"
seccomp_string: "   shmdt,"
seccomp_string: "   shmctl,"
seccomp_string: "   fork,"
seccomp_string: "   clone"
seccomp_string: "}"
seccomp_string: "DEFAULT ALLOW"

However, because nsjail applies the filter to the forked process before it changes from nsjail to Python, blocking s...

oak estuaryBOT
regal archBOT
#
jb3

Re: gVisor.

The limitations for gVisor means that we would likely have to subject the entire snekbox deployment to gVisor filters, since the Kubernetes guide[1] is for placing entire pods into the gVisor realm.

As of now, they only provide instructions for running with containerd, and even then it's unclear whether this would be compatible with the managed Kubernetes instances hosted by Linode (as of now it's unclear whether Linode will switch to containerd or CRI-O for subsequent Kub...

regal archBOT
odd spireBOT
regal archBOT
#
jb3

This PR removes the opt out data from the database and the related opt out commands from the bot.

Data gathered from Metricity is used in various places around the community now, including but not limited to:

  • Voice verification
  • Nomination information
  • Channel usage measurements

The opt-out functionality is somewhat misleading since the only data it opts out from is from collection of message counters, all data collected prior is retained as well as user information. There is no ...

regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

Thanks for the PR! Just a small suggestion:
I think instead of returning a Union[BytesIO, str] after a try-except, it'd be better if we catch that error within latex instead. You could raise a commands.BadArgument instead of sending the exception message directly as well. So possibly something like:

    @commands.command()
    async def latex(self, ctx: commands.Context, *, text: str) -> None:
        """Renders the text in latex and sends the image."""
        async with ...
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: bug/backend/log\-event\-exc\-info
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: bug/filters/1469/invis\-chars
odd spireBOT
regal archBOT
#
FORMATTED_CODE_REGEX = re.compile(
    r"(?P<delim>(?P<block>```)|``?)"        # code delimiter: 1-3 backticks; (?P=block) only matches if it's a block
    r"(?(block)(?:(?P<lang>[a-z]+)\n)?)"    # if we're in a block, match optional language (only letters plus newline)
    r"(?:[ \t]*\n)*"                        # any blank (empty or tabs/spaces only) lines before the code
    r"(?P<code>.*?)"                        # extract all code inside the markup
    r"\s*"         ...
regal archBOT
#
[python-discord/bot] New branch created: bug/filters/902/antispam\-punish\-once
#

Fixes #902

A user may manage to send multiple message that violate filters before the mute is applied. Because of a race condition, subsequent punish attempts did not detect the mute role exists and therefore proceeded to apply another mute.

To avoid the race condition, abort any subsequent punish attempts while one is already ongoing for a given user. It could be possible to wait instead of abort, but the first attempt failing very likely means subsequent attempts would fail too.

odd spireBOT
regal archBOT
#

Description

Quite simply, the ability to use .timed (.t as an alias), to be able to time the execution time of a command.

Reasoning

Considering a conversation in dev-contrib about having time displayed in a latex rendering command, I figured why not have the best of both worlds; by default don't display the time since it can be considered bloat, but have the ability to time the execution of a command should you wish for the extra technical details, if it's of interest to you.
...

regal archBOT
#
[python-discord/sir-lancebot] New branch created: feature/timed\-execution
#

Relevant Issues

Implements and closes #671

Description

The changes have been implemented by creating a new execution context for the command by taking the message content, updating a copy of the message with that content, and using bot.get_context() to get a new context for execution. The invokation of that context is then timed by perf_counter() and displayed to the user upon the command finishing with the time in seconds to .4f precision.

Reasoning

It's been impleme...

odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

Context

The !superstar command currently requires a duration to be specified when invoked.

Often we want to change someone's nickname from something very noisy or that takes up a lot of room until the user can respond and change it themselves. The duration in these cases is not usually that important as we want it to be a quick change.

Proposal

It would be useful if there was a short default duration for this command. Something like 5 or 15 minutes. It would function similarl...

regal archBOT
#

Do we only want to handle the common chars here?

There's a bunch more of chars which don't render to anything noticeable, I haven't checked them all for how they look on discord but the tags for example don't show up as anything https://paste.fuelrats.com/oguvesutip.py

I'll try to make it more thorough. Thanks for the tip about the Unicode category. Only some Arabic characters at the start render, but I think it's fine to strip them out anyway cause it seems more likely th...

#

The problem pointed out by @Shivansh-007 (#672 (review)) should be fixed, although I disagree with the proposed solution. Using this wouldn't allow more than two users to use the command at the same time which doesn't make sense. The timed command should just make sure that it isn't executing itself.

I think that's only because it's using the [global bucket type](https://discordpy.readthedocs.io/en/l...

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3

This all looks fine and works great locally, however discussion in #dev-contrib pointed towards this task taking multiple seconds, so I'm wondering whether some sort of caching should be implemented.

My suggestion would be to generate a hash of some sort of the query and then store to a _latex_cache directory in the current folder or something (therefore allowing it to work in Docker & on Host). The directory would not be persistent at all and should of course be gitignored.

What's th...

odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

For something that may not be noticed in testing: poetry does not support automatic selection of python interpreter (even though it claims it does). This is something that has bitten us in the staff pyweek project for some people, and something I've dealt with on my own projects.

Poetry claims to be able to select the correct python version from your path, like pipenv does, but that doesn't seem to work (from my testing on windows, and...

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: tp\-get\_review\-command
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: trashcan\-can\-now\-be\-overwritten\-with\-an\-env\-var
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: fix/april\-fools\-video\-categories
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: feature/timed\-execution
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: dynamic\-available\-message\-patch
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

8f1294a Filtering: remove invisible characters before c... - MarkKoz
150713e Filtering: use a more thorough regex for zalgo ... - MarkKoz
a5b586e Merge branch 'main' into bug/filters/1469/invis... - ChrisLovering
51bc132 Merge pull request #1513 from python-discord/bu... - ChrisLovering

#
[python-discord/bot] branch deleted: bug/filters/1469/invis\-chars
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

This can possibly done with the help of Wolfram Alpha

1. The domain:
   ![image](https://user-images.githubusercontent.com/69356296/114325557-5625bc00-9b4e-11eb-9ff8-8eff6ae26a93.png)

2. In the 3rd section, click **Subdomains**
   ![image](https://user-images.githubusercontent.com/69356296/114325550-4ad29080-9b4e-11eb-9ad2-b8e1097af8fd.png)

This actually can be done with dns lookup on a domain to see all domains ...

regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

Its impossible to get the source for the HelpChannel cog.

Steps to Reproduce

!src HelpChannel
Due to the logic of the command, all that needs to be said is !src help followed by anything.

Expected Behaviour

Source link to the HelpChannel cog is shown.

Actual Behaviour

Help command source link is shown.

Known Impacted Platforms

  • [x] Web
  • [x] Desktop
  • [x] Android App
  • [x] iOS App

Possible Solutions

These lines are the ...

odd spireBOT
regal archBOT
#
jb3

b5af232 Resolve relative href urls in a html elements. - Numerlor
5dfbec9 Make doc get greedy. - Numerlor
39aa2fb Skip symbols with slashes in them. - Numerlor
41e906d Move symbol parsing into separate methods. - Numerlor
b0f46ac Make sure only class contents are included, wit... - Numerlor

oak estuaryBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: remove\-inappropriate\-riddle
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3

This all looks fine and works great locally, however discussion in #dev-contrib pointed towards this task taking multiple seconds, so I'm wondering whether some sort of caching should be implemented.

My suggestion would be to generate a hash of some sort of the query and then store to a _latex_cache directory in the current folder or something (therefore allowing it to work in Docker & on Host). The directory would not be persistent at all and should of course be gitignored.

What's th...

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#
[python-discord/sir-lancebot] branch deleted: akarys/630/automatic\-linking\-everywhere
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#
[python-discord/sir-lancebot] branch deleted: remove\-inappropriate\-riddle
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

We want deleted messages to remain in the cache so that the bot can account for them when applying spam rules.

One way of doing that is monkey-patching this part https://github.com/Rapptz/discord.py/blob/master/discord/state.py#L483-L504 but it should be accompanied by proper tests to prevent any funny business on version bumps.

Another way is to cache deleted messages in a separate cache, but well.. it was already cached.

night lilyBOT
#
Sir Lancebot

Connected!

night lilyBOT
#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#
[python-discord/sir-lancebot] New branch created: vcokltfre/fix/timed\-error\-help
#

Description

When a new execution context is created in the timed command it's now added as the subcontext attribute of the parent context. When the error handler deals with the error the context is set to the subcontext if available, else the normal context. This means the command displays correctly.

Reasoning

It's been implemented this way since I believe it to be the cleanest and simplest way to do this. If this turns out not to be the case I'm more than happy to change the i...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: fix/april\-fools\-video\-categories
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3

Overview

Here are some features we should include:

  • [ ] Colour information
  • [ ] Random RGB or HSV colours
  • [ ] Colour conversions
  • [ ] Colour naming

These should all be implemented in the same command, but can be implemented separately, the above order is my recommendation for tackling them one by one.

Details

Colour information

Given a colour in one of the supported colour models (RGB/HSV/HSL/CMYK) we should return an embed with information on that colour.
...

odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: laundmo\-regex\-isssue\-patch
#

fixes it being unable to get issue numbers larger than 9
limits it somewhat length-wise and character-wise to the actual github limits

Description

Changed the regex to match numbers at the end greedily
Changed the regex to only match allowed characters

Additional Details

regex used: https://regex101.com/r/V2ji8M/6

Did you:

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: vcokltfre/feat/ping
#

Relevant Issues

No github issues, but the relevant conversation in pydis/dev-contrib is around here #dev-contrib message

Description

A simple command that sends an embed showing the bot's websocket latency. It is simple as was discussed; it has no need to be complex, just provide basic information and more importantly show that the bot is online.

Screenshots

![image](https://user-images.githubusercontent.co...

odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

Switched from matplotlib.pyplot.figure to matplotlib.figure.Figure.
Memory cleared manually with del and gc.collect().
Cooldown added to the .latex command

Reasoning

matplotlib.pyplot.figure isn't properly reference counted.
With these changes in place, memory usage doesn't increase without bound, plateaus out at ~110MB.

Did you:

odd spireBOT
regal archBOT
regal archBOT
oak estuaryBOT
regal archBOT
regal archBOT
#

So when Phil Karlton said ~

There are only two hard things in Computer Science: cache invalidation and naming things.

~ I think he forgot about timezones.

Branding

The new branding manager [#1463] is storing UTC timestamps incorrectly, and this PR amends that. The bug isn't critical, in fact it doesn't even do anything, as I'll explain shortly, but it is still a bug. Additionally this PR adds a small cosmetic fix for 1 day events.

1. Datetime sucks

The branding manage...

odd spireBOT
oak estuaryBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: output\-snowflakes\-in\-one\-embed
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

regal archBOT
#
[python-discord/sir-lancebot] branch deleted: vcokltfre/feat/ping
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: vcokltfre/fix/timed\-error\-help
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

The cache is still something that needs to be looked into in the future. It seems safe to not delete dicts from the cache since _update_mapping is careful to actually update existing dicts rather than overwriting them. It's important that the cache does not end up out of sync with what's in the global config.

That being said, keeping values in cache means more memory is used. Keeping or deleting the cache is a matter of a time vs. space trade-off. Deleting manually wouldn't be straight f...

#

Except for the request change above, this looks complete to me. However, I'm not entirely confident all bugs have been found, as exemplified by the one above which I caught at the last minute. Furthermore, I'm not sure how the public API that's been set up will play out once we start using it to try to implement the Discord stuff; more access to internals may need to be provided.

Some things to address in the future:

  • Test suite
  • Set up pre-commit to lint this code (black? ๐Ÿค”)
  • Doc ...
#

Another possibly strange thing is something like this:

from smartconfig import ConfigEntry, load_stream

content = """
package_a:
  module_a:
    ref_2: !REF package_a.module_d.integer_8
"""

load_stream(content)


class A(ConfigEntry, path="package_a.module_a"):
    ref_2: int = 0


class D(ConfigEntry, path="package_a.module_d"):
    integer_8: int = 8888

This fails because A, which references D, is defined before D and D doesn't have any overwritte...

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: Add\-confusables\-for\-dealing\-with\-raids
#
[python-discord/bot] branch deleted: Add\-confusables\-for\-dealing\-with\-raids
#
[python-discord/bot] New branch created: catch\-invocation\-not\-found\-error
#
[python-discord/bot] branch deleted: catch\-invocation\-not\-found\-error
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

People deleting their first message is indeed an issue, but it's addressed by shortening the duration before the channel is automatically closed (from 30 minutes to 5 minutes). I don't see how knowing the person's name would be useful. If they deleted the message then they probably don't need help any more and don't want to be bothered. In fact, knowing the name may encourage others to send messages in the channel thus extending the duration before closing from 5 minutes back to 10 or even 30...

odd spireBOT
regal archBOT
#

475bd21 Use a paginated embed to output multiple snowfl... - ChrisLovering
f9fb863 Require at least one snowflake to be provided. - ChrisLovering
56ff78a Refactor embed to use just one line - ChrisLovering
056191d Merge branch 'main' into output-snowflakes-in-o... - ks129
a8daa2c Merge pull request #1524 from python-discord/ou... - ks129

#
[python-discord/bot] branch deleted: output\-snowflakes\-in\-one\-embed
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: mbaruh/offduty
odd spireBOT
regal archBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#
[python-discord/sir-lancebot] New branch created: latex\-limits
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Closes #549

This PR upgrades the Python version we use for the bot to Python 3.9.4. One of the major upgrades this offers for us is that we can now use list[dict[str, str]] rather than importing typing module and then doing those ugly typing.List[Typing.Dict[str, str]] annotations.

Changes to be aware of

  • Bumps Python to 3.9 in Pipfile & lock and Docker.
  • Bumps all dependencies to the latest version, which support python3.9 and solve the breaking changes only
  • Ad...
odd spireBOT
regal archBOT
#

b38e645 AntiSpam: prevent attempts to punish a user mul... - MarkKoz
73b49b5 AntiSpam: create tasks in a safer manner - MarkKoz
e2eb055 Merge branch 'main' into bug/filters/902/antisp... - Xithrius
a56ce95 Merge pull request #1514 from python-discord/bu... - Xithrius

#
[python-discord/bot] branch deleted: bug/filters/902/antispam\-punish\-once
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

First sentence is unnecessary. If someone wants to know how to create a check then they already have a reason for why they want to do it. In any case, the notion of having to create something because it doesn't already exist is pretty obvious and doesn't need to be explained.

I've elected to keep the sentence, but I've made it more matter of fact. The reasoning behind this is that I don't want it to sound too robotic or boring for those reading since this is a tag generally for beginners...