#dev-log

1 messages ยท Page 1 of 1 (latest)

regal archBOT
#

ce8e838 Add cj add command and add_flow to the CJ e... - D0rs4n
e38d433 Update move flow to add user to the database if... - D0rs4n
0a4b9f3 Prevent adding team leader role to members if s... - D0rs4n
9bed4c5 Adjust the comment wording in the CJ extension - D0rs4n
e1a3856 Make is_leader an optional parameter in cj add - D0rs4n

#
[python-discord/sir-robin] branch deleted: add\-cj\-add
thin oysterBOT
#
Sir Robin

Connected!

regal archBOT
#
[python-discord/site] branch deleted: clarify\-websocketrule
#

0ed9322 Clarify WebSocket restriction rule's impact on ... - Bluenix2
1d0b576 Remove unnecessary "also" in new exception to c... - Bluenix2
b1d9468 Strike out beginning of code jam date - Bluenix2
fadda91 Update codejams sidebar about cj9 theme announc... - Bluenix2
1e7756c Merge pull request #748 from python-discord/cla... - ChrisLovering

odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: relax\-websocket\-rule
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot-core] New branch created: better\-development
#

This PR works on the developer experience for bot-core by adding better infrastructure and boilerplate to help developers test out their changes. This is achieved by adding prominent documentation which explains how to test features in sample and real projects, adding a sample project which contains all the boilerplate for rapid prototyping, and a fixed docker configuration which should work better for this project.

I also added aiodns as an explicit dependency. Our downstream projects alr...

regal archBOT
regal archBOT
#
[python-discord/bot-core] branch deleted: better\-development
regal archBOT
#

cd5d5cf Relax rule about usage of non-WebSocket communi... - Bluenix2
a796945 Fix past-tense "exempt" typo - Bluenix2
bf753d1 Rework sentence urging reaching out to the even... - Bluenix2
0a46210 Be explicit about example in rule being an allo... - Bluenix2
e60a684 Merge pull request #750 from python-discord/rel... - wookie184

#
[python-discord/site] branch deleted: relax\-websocket\-rule
#
[python-discord/bot] branch deleted: fix\-bot\-2168
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot-core] New branch created: py3\.10\-rediscache
#
[python-discord/bot-core] New tag created: v8\.0\.0\-beta\.1
regal archBOT
regal archBOT
#
[python-discord/bot-core] New tag created: v8\.0\.0\-beta\.2
regal archBOT
#
[python-discord/bot] New branch created: py3\.10\-rediscache
#

This PR does the following things related to the PR description:

  1. Bumps the Python version up to 3.10, ensuring CI is updated too.
  2. Bumps the version of bot-core used to v8.0.0 and removes pinned dependencies that are now pinned within bot-core
  3. Fixes breaking changes from the aioredis bump in async...
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
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: sid/feature/tags/print\-return
#

25675a1 feat(tags): add print-return tag - sid-maddy
b1313b6 style(tags/print-return): set the title prope... - sid-maddy
9ac1bda chore(tags/print-return): add the GIF to the repo - sid-maddy
41f6e4d fix(tags/print-return): use the raw GitHub URL ... - sid-maddy
4d68f4b Merge branch 'main' into sid/feature/tags/print... - ChrisLovering

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

Further to discussion with @HassanAbouelela in #dev-contrib, I'm creating this issue to outline some potential changes to the !remind command that can be made.

Bugs:

  • !remind edit doesn't validate that the reminder was actually changed before sending the API call and sending success message.
    Resolving this would mean having to GET the reminder being edited so that the appropriate fields can be compared.
  • !remind edit content doesn't support using a referenced message, b...
#

Doing the enhancements together sounds fine ๐Ÿ‘

I have a couple concerns wrt the implementation of the other two.

Bug 1. I don't know if it's worth it to do a second API call, when the current behavior doesn't seem to be a problem. I don't mind either way though

Bug 2. Not sure this is a bug, more of a new feature. Off the top of my head, I don't believe there's a one-to-one relationship between a message and a reminder. You can create multiple reminders to one message, and you can ha...

#

Bug 1. I don't know if it's worth it to do a second API call, when the current behavior doesn't seem to be a problem. I don't mind either way though

It's not really a "problem", more a QOL thing. It just seems weird to have an edit command that doesn't actually verify if it was edited. If we decide it's not worth due to the API call then that's fine with me.

How would replying to a message tie it to the reminder?
The same way it does for !remind new, i.e. use the referenced messa...

regal archBOT
#
[python-discord/bot-core] New branch created: 8\.0\.0\-beta
#
[python-discord/bot-core] branch deleted: py3\.10\-rediscache
regal archBOT
#
[python-discord/bot] New branch created: bot\-2231\-enhancements
#

Delete Multiple Reminders
This has been tested with the help of @ichard26 (thanks!).

The behaviour behind the deletion is still the exact same (you can't delete others' reminders unless you're an admin), just has been reformatted to account for the fact that a lock needs to be applied to each individual id.

There's also some changes to prevent a message being sent for each deletion fail -- we instead send one message after processing all ids.

_All reminders successfully deleted...

odd spireBOT
regal archBOT
#
[python-discord/bot-core] New branch created: async\-rediscache\-bump
odd spireBOT
regal archBOT
#
[python-discord/bot-core] branch deleted: async\-rediscache\-bump
#
[python-discord/bot-core] New tag created: v8\.0\.0\-beta\.3
#
[python-discord/bot] New branch created: bot\-2231\-bug
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot-core] New branch created: remove\-redis\-cleanup
odd spireBOT
regal archBOT
#
[python-discord/bot-core] branch deleted: remove\-redis\-cleanup
#
[python-discord/bot-core] New tag created: v8\.0\.0\-beta\.4
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

Description

Add a command to play a number guessing game (a random number is generated and the user guesses it, the bot says whether it's higher or lower or if they won.

Reasoning

It can be a fun game to play, perhaps more if there are different modes: easy, medium, hard.

Proposed Implementation

A game where the user can input easy, medium, or hard to increase the range of which the random number is generated from. They have 5 tries to guess the number, if they fail to do ...

night lilyBOT
#
Sir Lancebot

Connected!

night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#
[python-discord/bot-core] New branch created: release\-8\.0\.0
#
[python-discord/bot-core] branch deleted: release\-8\.0\.0
#
[python-discord/bot-core] branch deleted: 8\.0\.0\-beta
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: add\-infraction\-last\-applied
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: infraction\-durations
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

Current problems

The current design has some limitations. It cannot store a separate actor, timestamp, or reason for pardoning infractions. For the reason field, the current workaround used by Big Brother is to prepend the reason with 'Watched: ' or 'Unwatched: ' to distinguish them. Furthermore, the design cannot keep track of edits made to infractions.

New Design

Action table

Create a new table to store "action" records. Actions can include making an infraction act...

#

Sometimes an infraction may need to be voided due to a mistake. A good example would be if the infraction was mistakenly added to the wrong member (Discord's mentions aren't exactly dependable). The infraction should not be kept on the member's history in this case, but we only currently have the ability to make an infraction inactive.

This would also allow us to be able to easily undo an infraction, supporting the features mentioned here:
https://github.com/python-discord/bot/issues/240

regal archBOT
#

I think the API may support it, but we never added bot support for it. It comes up every now and then, but Iโ€™ve generally been against it, and I think a few other dev ops members have been too.

The reason is I think thereโ€™s the potential for a lot more harm from removing infractions, than there is in keeping one marked as invalid. This is already implemented so Iโ€™ll close the issue, but we can still discuss it here or open a bot issue.

regal archBOT
oak estuaryBOT
#

Doc item doc_item.symbol_id='disnake.on_group_join' present in loaded documentation inventories not found on site, inventories may need to be refreshed.

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/site] branch deleted: add\-infraction\-last\-applied
odd spireBOT
regal archBOT
#

The issue was discussed in dev-contrib. The current suggestion is to add another field to mark issues as invalid. There are multiple opinions on the exact implementation on the bot side, but generally it's viewed as acceptable to have another Boolean field here.

Due to the contention on the bot side, it's not clear if this is something that will be pursued, so I'll leave this issue closed. If we decided to do it, we can reopen it.

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

Lots of users have issues with installing python, sometimes not checking correct options or installing from correct sources. A tag would be simple and fix this issue. It could, for example say ```
Install python for your OS at https://python.org (installing from other sources such as Microsoft store is not recommended.)
Select the "Install for all users" and "add python to PATH" options.
If you installed python without adding it to PATH, you will have to reinstall your version and select "...

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

I have a couple suggested changes but no blockers.

Tested the following things:

  • Starting and stopping event
  • Permission role lock
  • Force-posting a question
  • Setting a custom scheduled post-time other than UTC midnight

screenshots

Forced post

Scheduled post at 3AM UTC (11PM my time)

logs if you are interested

sir-robin              | 2022-08-02 02:46:52,538 | async_rediscache.types.base | DEBUG | Released  for RedisCache.update
sir-r...
regal archBOT
regal archBOT
#

I don't understand the warnings fix here. setup is a coroutine function rather than a coroutine itself, so there should be no warnings from it just being imported, only if it is called and the coroutine returned not awaited (which doesn't seem to happen).

Changing the cog to be shared across different tests in ErrorHandlerTests doesn't seem ideal, as some of the tests patch methods meaning they could affect each other. I cant see any obvious places it would actually make a difference h...

regal archBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Two big things:

  1. Required change in pyproject.toml so this doesn't break locally and we can test it. We'll have to take a look into our redis cache code to adopt to the the async_rediscache breaking changes when it was migrated to aioredis v2.

  2. There's a bug I can't quite hunt down but it might be in utils/next_time_occurrence(), but if I start RoC there's an issue with the timestamp generation for when the next puzzle will be posted. It'll say the next puzzle will be posted at th...

regal archBOT
#
[python-discord/bot] New branch created: 2238\-purge\-cmd
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

I don't understand the warnings fix here. setup is a coroutine function rather than a coroutine itself, so there should be no warnings from it just being imported, only if it is called and the coroutine returned not awaited (which doesn't seem to happen).

By importing the coro directly, the below warnings are raised (malloc enabled to see object allocation)```
tests/bot/exts/backend/test_error_handler.py::ErrorHandlerTests::test_error_handler_already_handled
tests/bot/exts/backend/te...

regal archBOT
#
[python-discord/bot] branch deleted: 2238\-purge\-cmd
oak estuaryBOT
odd spireBOT
regal archBOT
#

I don't understand the warnings fix here. setup is a coroutine function rather than a coroutine itself, so there should be no warnings from it just being imported, only if it is called and the coroutine returned not awaited (which doesn't seem to happen).

By importing the coro directly, the below warnings are raised (malloc enabled to see object allocation)

tests/bot/exts/backend/test_error_handler.py::ErrorHandlerTests::test_error_handler_already_handled
tests/bot/exts/b...
#
[python-discord/site] New branch created: api\-last\_applied
#

The check for setup seems to be behind a check for the nose plugin in pytest (https://github.com/pytest-dev/pytest/blob/f43ddd8acd74a2c3242a3874420072836e0614aa/src/_pytest/python.py#L881), so the only thing I'm not sure about is why that would trigger since we don't use nose.

You aren't quite looking at the right line:
https://github.com/pytest-dev/pytest/blob/7.1.x/src/_pytest/python.py#L561-L568

This doesn't use nose, and it's what's called for us. Refer to TB:

    Fil...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/forms-frontend] New branch created: bump\-dependencies
#

This PR bumps all dependencies up to latest versions, with no noteworthy changes.

It also makes some metadata changes to our package.json. The first change is making the package private, since this is not intended to be used by other projects, and there are no intentions to publish it.

The second is explicitly defining the node versions. The project currently doesn't use any special features which limit us too much. Our dependencies are only compatible with the 16 LTS and the latest 18 ...

#
[python-discord/forms-frontend] branch deleted: bump\-dependencies
#
[python-discord/forms-frontend] New branch created: update\-codeowners
#
[python-discord/forms-frontend] branch deleted: update\-codeowners
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: speedup\-tests
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: disable\-pytest\-nose\-plugin
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-not\-awaited\-coroutine\-warning
#

Fixes this warning in the tests:

tests/bot/exts/moderation/infraction/test_infractions.py::VoiceMuteTests::test_voice_mute_truncate_reason
  c:\users\wookie\appdata\local\programs\python\python39\lib\enum.py:384: RuntimeWarning: coroutine 'Infractions.apply_voice_mute..action' was never awaited
  Coroutine created at (most recent call last)
    File "c:\users\wookie\appdata\local\programs\python\python39\lib\unittest\async_case.py", line 87, in _callMaybeAsync
      return self._asy...
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

Currently the code evaluation suffers from possible exploits. These stem from how code evaluation currently works on the forms app:

  1. The user's code, as well as the pre-supplied unit tests, are sent to snekbox.
  2. The unit tests are run on the user's code inside snekbox.
  3. The result of the tests are supplied back from snekbox through stdout.

This means that if the user manages to control the stdout, they are able to control the output of the tests, as far as the forms app can unders...

odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#

Adding a Rickroll Detection command

Possible forms:

1. Command

Syntax: .rolldet

  • Can also reply to a link instead of providing as argument

2. Continuous link monitoring

  • Monitors all links posted in public channels
  • Replies with a warning message when a rickroll link is detected

Reasoning

Would be fun for rickroll attempts to be detected

Proposed Implementation

It is quite straightforward to accurately support the detection of all links hosted on yo...

odd spireBOT
regal archBOT
#

I propose a slight modification to Solution 1.

To make Forms's unittesting as general as possible, the API could accept python code in a setup field for each unittest form field. Forms evaluates<sup>[1]</sup> this setup code with the form submitter's response, and then sends this result to snekbox. snekbox sends back stdout, forms matches it with some output field.

The test template currently in forms is then moved to Code Jam backend, which sends a request like

{
   ...
regal archBOT
#

This is incorrect. Merely implementing __iter__ does not create a Generator, you can test it as such:

import typing

class Foo:
    def __iter__(self):
        return self

print(isinstance(Foo(), typing.Generator))
>> False

All Generators are Iterators, the abstract base class for a Generator actually inherits Iterator. Generator actually requires 2 methods to be implemented over an Iterator's __next__ and __iter__, which are send, throw, and the ...

#

Running any user code directly on the backend is a no-go. The part I donโ€™t understand about your proposal is what it ends up achieving. You still canโ€™t check state the way you described because the same issue of not being able to safely communicate between the unit test suite and the backend remains.

Also to touch on Zigโ€™s last point: the discussion yesterday was that this issue is currently sitting on low priority, and adding support for things that arenโ€™t the code jam isnโ€™t something weโ€™...

regal archBOT
#

what it ends up achieving
It removes the possibility of exploiting stdout in tests where we directly match the user's prints, while letting you keep the current behaviour of code jams where you check prints by unittest

That is to say, you can decide on a per-event (or even per-test) basis whether you want (unexploitable stdout + no unittests) or (exploitable eval + unittests)

regal archBOT
regal archBOT
#

Tags should be concise and answer a common question. If someone wants to know what a generator is, at a high-enough level that it can be answered concisely, I don't think many of the details here are relevant.

I would rather see a tag that gives an example of a generator created through a function, and an explanation of how the generator maintains its own state between yields (but preferably without the word "state").

regal archBOT
regal archBOT
regal archBOT
#

Current Auth System

Currently, the authorization system on forms is broken into two portions, Discord OAuth, and a stateless JWT user token. The log-in process starts on the frontend, where:

  1. Users click login
  2. They get sent to discord to authenticate
  3. The frontend callback URL is called with a discord access token, which is
  4. Sent to the backend, to fetch discord data, and create the JWT.
  5. The JWT is returned to the frontend, in a Set-Cookie header, which creates a cookie th...
regal archBOT
odd spireBOT
regal archBOT
#

This tag feels like it's trying to compare generators and iterators, which I don't think makes sense. Since a generator (function) returns an iterator, this feels a bit like comparing e.g. a BMW to a Car. Would two separate tags on the topics make more sense?

Well, maybe the wording in the file may lead you to think that its trying to compare an iterator and a generator, im not aiming to, im aiming to explain both concepts, if you have any suggestions especially about the wording, plea...

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

Summary

This is a proposal to extend the AntiMalware cog to submit file links and attachments to the VirusTotal API for testing.

https://developers.virustotal.com/reference/overview

The public API allows up to 500 requests per day, which, after excluding image links and possibly some additional whitelisted domains, would be fairly sufficient for use.

A new command could possibly also be implemented for directed scanning of URLs / file attachments.

Rationale

On more t...

regal archBOT
regal archBOT
#

I think a few previous incidents involved Mediafire / custom file hosts. Which were removed after some users submitted virus total results. I'm not sure how much additional coverage there would be but it would at least offer some additional protection.

In addition, this addresses the binary/text dual format preview vulnerability, as discord CDN files offer a direct link that Virus Total is able to download and analyze.

regal archBOT
#
[python-discord/site] branch deleted: api\-last\_applied
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Currently, the site is setting inserted_at when the entry is inserted. The goal of the new attribute last_applied is to provide a datetime that is calculated on command run at the bot side, which should remove some of the server / network latency issues. In addition, the last_applied time is actually calculated together with the delta, meaning that the absolute delta of last_applied and expires_at is exactly equal to the infraction (for example 1 hour) down to the microsecond.

#

So that was the rationale for this change, since the minimum accuracy of our humanize_delta is 1 second, the rounding will trim off microseconds via rounding.

The original issue was that the humanize_delta call matches time units until the last unit is exhausted, which, in the case of infractions, due to code and network latency, the delta between inserted_at (calculated at entry insertion server side) and expires_at (calculated at original command invocation) will at least be so...

regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
**Generator Expressions**

Generators can also be created by `for` clauses inside [expressions](https://docs.python.org/3/glossary.html#term-generator-expression). This is similar to creating a list comprehension but using `()` instead of `[]`. You can use `if` `else` ternary operators as you would in other comprehension forms.

I feel it's slightly out of scope to give examples of implementing Iterators as beginners are unlikely to need this level of extensions. Expla...

#
**More Information**

โ€ข Generators and Iterators can also be created as custom classes by implementing their required [methods](https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes-1). The preferred way to do this is by extending the respective Abstract Base Classes within `collections.abc`.

โ€ข Check out the [Real python article](https://realpython.com/introduction-to-python-generators/) for a more in-depth view of Generators and their us...
odd spireBOT
regal archBOT
#

Your understanding of Python's internals is impressive, but I feel that this tag focuses on the wrong details, and tags of this length are not likely to be read in their entirety. Consider the target audience (novice Python developers) and the context in which this is intended to be read (likely during a help session where said novice is focused mainly on solving a specific problem). As insightful as it is, I would like to see all discussion of classes and dunder methods removed.

Perhaps y...

regal archBOT
#

Well, our target should be intermediate and beginners. I wouldnt really remove the examples as its better to have more information about such a topic so users dont need to search e.g on Google on how a to make a generator or how yield works, yes i do agree its allot of info but its better to have info in depth over explaining concepts and not their implementation.I would agree the tag is long, but @ionite34 did a good job explaining and wording it better than i did and in my eyes nothing real...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-issue\-2015
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: fix\-issue\-2015
regal archBOT
#
[python-discord/bot] New branch created: update\-autoreview\-system
odd spireBOT
regal archBOT
#

The discord.py tasks module provides a special task for a recurring wait task, which is what we use to wait between posts during the event. To get allow the command to be used before the post-time, a normal async wait is used before the loop starts. So a running event can either be in a state of waiting to make the first post or waiting between posts (wait_task or loop_task).

Ideally the user wouldn't have to know any of that, but I included them in the info embed out of an abundance of ca...

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

We discussed during today's staff meeting, we would like to see this tag revamped/pivoted to a narrower scope, which also leverages and links to the Real Python article on generators.

Please let us know if you'd be interested in doing that @Okimii.

We will also work on better defining what criteria we feel a tag should meet to best serve as a teaching tool for a real-time communication platform such as Discord, and also make it a bit clearer that a PR for a tag should not be opened wit...

#

netlify is not a trusted environment. If someone wanted to be malicious, they can print out environment vars and get the key.

Great! That sounds very sane and secure.

I suppose we could still do auth and accept that it can be leaked and we'll have to regenerate it sometimes. How would rate limiting look?

Hm, not much value in case it can be leaked. Rate limiting - Maybe this? https://www.django-rest-framework.org/api-guide/throttling/ It's overkill though. We don't need it.

regal archBOT
#

@minalike I wouldn't mind revamping the tag, I would love for the staff of pydis to make it better and more defined in the context of details for a better tag for beginners, I can also help with the structure of the tag but im not quite good with wording so I would really need help on that part, either way there's allot of talented people in pydis staff, e.g @ionite34 which has helped allot especially wording wise and the tags structure, so even if my wording isn't the best it can also be cor...

regal archBOT
#

I'd like to see this shortened down dramatically.

  • I don't think we should explain iterators and generators in the same tag. Let's make this one solely about generators.
  • Tags should not be articles, and generators is a big topic which will not be sufficiently explained in a tag. In this case, it would be better to explain (in only a handful of words) what it is, how it's commonly used, and then link to a good resource for learning about it.
  • The RealPython article is a fantastic resou...
oak estuaryBOT
odd spireBOT
regal archBOT
#

Currently, automutes by the bot ping the Moderators role in a mod-alerts channel, and also sends a public message indicating the user has been muted:
image

Well-meaning bystanders then ping moderators to have them unmuted, which is usually redundant. (If the user wasn't already unmuted, then that means either a moderator decided to leave the mute, extend it, or, there is no moderator ...

regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#
        # Grabs the text from the embed for uwuification
        if embeds:
            embed = messages.convert_embed(self._uwuify, embeds[0])
        else:
            # Parse potential message links in text
            text, embed = await messages.get_text_and_embed(ctx, text)

            # If an embed is found, grab and uwuify its text
            if embed:
                embed = messages.convert_embed(self._uwuify, embed)

We no longer need fun_cog and re...

odd spireBOT
regal archBOT
oak estuaryBOT
#

Doc item doc_item.symbol_id='nextcord.AuditLogAction.auto_moderation_rule_deleted' present in loaded documentation inventories not found on site, inventories may need to be refreshed.

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
thin oysterBOT
#
Sir Robin

Connected!

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

If someone claims a help channel but then deletes the message that claimed the channel the help channel stays claimed but there isn't anything useful going on, the bot should detect when this happens and automatically make the channel dormant.

The message(embed) saying that the channel is dormant can also be changed to tell users to edit the message instead if the message was deleted to fix a typo or otherwise change it instead.

This should only happen within a short period of time afte...

oak estuaryBOT
#

Doc item doc_item.symbol_id='discord.app_commands.TranslationContext.choice_name' present in loaded documentation inventories not found on site, inventories may need to be refreshed.

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot-core] New branch created: update\-static
regal archBOT
#
[python-discord/site] New branch created: raise\-static\-builds
odd spireBOT
regal archBOT
#

This is failing because the multiversion build takes more than 3 minutes currently. There are a few options:

  1. Limit the number of versions built. This is possible, but making it dynamic is hard since we can only specify a regex to match each tag name against. One way to make it work is to grab all tag names ourselves and combine all the allowed ones in a simple regex. Besides technical challenges, it's also an arbitrary limitation that reduces the benefit of having access to historical doc...
regal archBOT
odd spireBOT
regal archBOT
#

Well, I've stumbled upon an interesting discovery. Each build contains metadata used to speed-up rebuilds, but it contains a bunch of binary data that increases the build size. Deleting those files from 75 MB to 22MB, which had the added benefit of reducing the upload time from 1m19s to 40s (total 2:51 to 2:11). There's further possible gain from removing the duplicated _static folder (~700Kb/version), but I'm not sure how that'll work between different versions, and it would require rewritin...

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

Closes #687.

I implemented this feature in the most efficient way (in terms of network requests) possible. We download the entire bot project as a tarfile, extract all the tags from it, and cache them to the database.

Ideally, I'd also like to add a bit more flavor-info to the pages, such as when they were last updated, and the authors that have worked on them, but the only way to get that data from the API is to request data for a specific commit, which means making ~100 requ...

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

@Numerlor I was not aware of the tag groups, is there an example of them currently?

I don't think any are currently used or that there are any real examples, but they're created through the directories I mentioned:

tags/
โ”œโ”€โ”€ tag_group1/
โ”‚   โ””โ”€โ”€ tag.md
โ”œโ”€โ”€ tag_group2/
โ”‚   โ””โ”€โ”€ another_tag.md
โ””โ”€โ”€ plain_tag_without_group.md

this structure would create two tag groups tag_group1 and tag_group2 with tag.md and another_tag.md in them respectively

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: fix\-infraction\-tests
#

The infraction tests checked that the route returned infractions in the correct order, which is based on insertion time. This can be fragile however since the insertion time can be very close (or identical) during the tests. I had this scenario happen to me 13 times in a row (before I gave up and investigated ๐Ÿ˜›). The issue became especially prevalent with PR #741 (commit 149e67b4) which improved database access speed.

This is fixed by explicitly specifying the insertion time, and spacing t...

odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/snekbox] New branch created: bump\-deps
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: py3\.10\-rediscache
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

The latex preamble determines which packages/commands are available to the user when writing .tex input for .latex command. The proposal is to include more packages in the preamble, which appears to be in sir-lancebot/bot/resources/fun/latex_template.txt. In particular, the proposed libraries extend the user-friendliness when writing maths by allowing bold symbols, calligraphic numbers, and creation of TikZ figures.

Reasoning

This update would put more of the commonly...

odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: redis\-fix
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: automute\-message
regal archBOT
#
[python-discord/bot] New branch created: dawnofmidnight/compban
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: Resolve\-silence\-test\-failures
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

As part of the migration of the #discord-bots pinned content from discord to the site, this PR migrates the pin regarding on_command_error of the discord.py library "eating" (silencing) unhandled errors.

This PR also adds a few extra items, including:

  • General markdown improvements, formatting
  • Fixing a few inaccuracies (e.g generic commands.BagArgument has been changed to commands.MemberNotFound
  • An elif statement handling another error, showing users that they can handle an...
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: Resolve\-silence\-test\-failures
oak estuaryBOT
odd spireBOT
regal archBOT
#

Thanks for taking this over and fixing it up ๐Ÿ‘

I have one comment, other than that seems alright, although I do think there is room for refactoring that could make it a bit cleaner. Given this is quite an old PR now i'd be happy if you'd prefer to leave it as is, although these are my thoughts:

It would be clearer to just have a loop that does all the checks necessary before incrementing the total. The logic to get the replied to message is also quite involved, so could be moved to a s...

regal archBOT
#

Ideally, I'd also like to add a bit more flavor-info to the pages, such as when they were last updated, and the authors that have worked on them, but the only way to get that data from the API is to request data for a specific commit, which means making ~100 requests in total. We can't do that without being rate-limited, but it could be something to consider. I also considered downloading the git repo (as opposed to the content only), but it doesn't seem the API returns that, we'd need to c...

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

The cache solution sounds smart, I'll look into that. In terms of downloading, I'm not sure there's a good way to bulk download files without downloading the entire repo, did you have a solution in mind?

I think the best solution is to just use the raw download urls from the contents api call. I don't believe count into the rate limits either so the only disadvantage is that is needs to be individual requests instead of bulk for the changed files, but that should only be a disadvantage w...

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

The syntax highlighting is done by Discord, rather than this bot.

It is also platform specific, with some platforms behaving weirdly as you describe. For example, here is what it looks like on my Windows machine:
image

Unfortunately, there isn't anything we can do ourselves, other than remove the syntax highlighting entirely, which we don't want to do.

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: invites\-validator\-url
#

Closes #1948

Summary

This adds support for normalizing discord server invite links starting with combinations of http:// https:// or www

invalid

Implementation

+ RE_STRIP_HTTP = re.compile(r"https?://(www\.)?")

class ValidDiscordServerInvite(Converter):
	async def convert(self, ctx: Context, server_invite: str) -> dict:
+		server_invite = RE_STRIP_HTTP.sub("", server_invite)
		...

Demo

![valid1](http...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

I think this is better solved by updating the base guild invite regex in bot-core, so that other bots that need to use it can also benefit from this fix.

https://github.com/python-discord/bot-core/blob/main/botcore/utils/regex.py#L5

Yeah, I eventually traced it to botcore so I couldn't change it without going upstream. Should we move the issue and close this PR ...

#

I think this is better solved by updating the base guild invite regex in bot-core, so that other bots that need to use it can also benefit from this fix.
https://github.com/python-discord/bot-core/blob/main/botcore/utils/regex.py#L5

Yeah, I eventually traced it to botcore so I couldn't change it without going upstream. Should we move the issue and close this...

#

Currently, when you try to add an invite link to the invites whitelist, it is rejected if the given link begins with https://, http://, etc.

For example:

!whitelist add guild_invite https://discord.gg/aMZJ7NAr R Programming language

This results in a BadArgument error.

Fixing this should just be a matter of adding the prefix to the regex pattern.

Relevant parts of the code:

#
[python-discord/bot] branch deleted: invites\-validator\-url
#
[python-discord/bot-core] New branch created: invite\-regex
#

We could check if EOFError is in the result (as well as maybe checking that "input" is on their code and the status code indicated an error), and if so add a message after the codeblock saying that input doesn't work with the bot.

Making input work would be more difficult, it would require changes to snekbox (the service used to run the code), and it's also not obvious how passing the input in discord would work.