#dev-log

1 messages · Page 83 of 1

regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: init\-metricity\-at\-runtime
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: remove\-port\-check\-as\-it's\-optional
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Sentry Issue: SIR-LANCEBOT-6C

ValueError: dictionary update sequence element #0 has length 3; 2 is required
(1 additional frame(s) were not displayed)
...
  File "bot/exts/core/help.py", line 511, in new_help
    await HelpSession.start(ctx, *commands)
  File "bot/exts/core/help.py", line 452, in start
    session = cls(ctx, *command, **options)
  File "bot/exts/core/help.py", line 97, in __i...
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/site] New branch created: update\_length\_validation
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

I would love to do the PR, tho I am not good with github so I am afraid I might be doing it wrong or it might take too much time.

There's no rush at all for this to be done (still two months until November, and even then it wouldn't be urgent...), and there's no need to worry about doing something wrong- everything is fixable and you can ask on the server if you have any questions.

This is a pretty good issue for a first PR if you haven't done one before, so I'd say you should give it a g...

odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: infraction\-last\-support
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
#

No, I think we found an issue with The Kubernetes Cluster Manager killing site instances, and we ended up wanting to debug it, but ended up not figuring out which „requests per second“ metric is the correct one

Am 08.09.2021 um 11:02 schrieb Xithrius @.***>:

@jchristgit @jb3 Were you able to come to a solution?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with G...

odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: robots\.txt
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: filters/dotgg\-boundary
odd spireBOT
regal archBOT
#

This is a solution for the #862 issue, which says the Hanukka holiday can also be in November and not only in December.

Relevant Issues

<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #862

Description

I added the Hanukka command in November month, by adding Month.NOVEMBER to the in_month decorator.

Did you:

odd spireBOT
regal archBOT
#

Hello all,

Just clarifying something for this command and the implementation of it. Is the goal to send all of the text from the Markdown or just a link to that section?

The way the command is now, it is only the link. In #dev-contrib I had a short [conversation](#dev-contrib message) with Jason Terror that the intention was to parse the README.md file and send the text of the section back to the user.

With the si...

#

If we are going FastAPI, there's also SQLModel to consider, just something to think about

I believe SQLAlchemy is the one that is specified in the pyproject file. But that issue meant to solve something different. As of now, the Database models are in Django. However, if we were to use SQLAlchemy (or SQLModel if you will) we'll need to migrate those models to SQLAlchemy. SQLAcodegen, grabs the current Database Schema and generates SQLAlchemy models accordingly.

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

To be honest, I am not sure. I inherited this PR btw.

But in the raw .md file, the table of contents has that string at the end of the table of contents:

# Table of Contents

<!-- Generated using "markdown-toc -i README.md --maxdepth 3"-->

<!-- toc -->

- [Structure of the Examples](#structure-of-the-examples)
    + [▶ Some fancy Title](#-some-fancy-title)
- [Usage](#usage)
- [👀 Examples](#-examples)
  * [Section: Strain your brain!](#section-strain-your-brain)
    + [▶...
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#
jb3

No-return is used when the function will never return (e.g. an infinite loop), typehints should be for success cases, you do not generally typehint exceptions.

This should be raised either as an issue or in the #dev-contrib channel where a core developer can approve it. I'm not a huge fan of "shit code" as a PR title and an empty PR body, it's not in line with our contribution guidelines.

regal archBOT
odd spireBOT
regal archBOT
#

6bb0dba Declare and refresh TalentPool.cache on init of... - ChrisLovering
b412451 Wait until login before trying to use the bot a... - ChrisLovering
2a2b0cd Remove previous nominations output - ChrisLovering
f699c56 Use - rather than 0 for number of nominees when... - ChrisLovering
4529559 Merge branch 'main' into declare-talentpool-cac... - ChrisLovering

#
[python-discord/bot] branch deleted: declare\-talentpool\-cache\-on\-startup
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

Consider switching to a discord.py fork, such as nextcord, which will be maintained for the foreseeable future.

Reasoning

We won't miss out on new features of discords API, and therell be more support in the long term.

Proposed Implementation

Switch to nextcord. It's more or less a drop in replacement. Switch up a few imports and we're good.

Would you like to implement this yourself?

  • [x] I'd like to implement this feature myself
  • [ ] Anyone can implement th...
odd spireBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/site] New branch created: fix\-database\-switch
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: update\_length\_validation
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: string\-formatting\-tag
#

Adds a tag to show the string formatting mini language.

To keep this tag on the shorter side, I'm aiming for a "look at how cool this is!" vs a "let me explain how this works."
So the examples aren't explained in depth, but hopefully it's enticing enough to click on the links and provide an entry point to a larger conversation.

This is how the tag looks:
image

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Having to jump between the two code blocks is a bit confusing. Maybe the result can be shown as a comment near the line as in other tags?

So I did try it and it ended up looking cluttered and confusing to me. At least for me, I don't necessarily expect the answer to be provided as a comment, so I don't pay that much attention to it. Let me see if I can make the change and illustrate.

![image](https://user-images.githubusercontent.com/20641196/132713929-5c1d20f7-3486-445b-9285-...

regal archBOT
#
[python-discord/metricity] New branch created: metricity\-creates\-own\-database
#

@Bluenix2 I'm not sure what you're referencing with this statement:

I disagree with these, it means that we show no examples without it and now someone might think you have to do it.

Also, I almost exclusively prefer the use of f-strings vs .format() with the exception of handling newlines in str.join(). This tag isn't meant to be a "here's all the ways it could work" but covering the most common use cases/illustrative examples and having people explore for themselves.

#

@Bluenix2 I'm not sure what you're referencing with this statement:

I disagree with these, it means that we show no examples without it and now someone might think you have to do it.

Also, I almost exclusively prefer the use of f-strings vs .format() with the exception of handling newlines in str.join(). This tag isn't meant to be a "here's all the ways it could work" but covering the most common use cases/illustrative examples and having people explore for thems...

#

@Bluenix2 I'm not sure what you're referencing with this statement:

I disagree with these, it means that we show no examples without it and now someone might think you have to do it.

That was in response to @brad90four's comments where they suggested adding = to all examples.

Also, I almost exclusively prefer the use of f-strings vs .format() with the exception of handling newlines in str.join(). This tag isn't meant to be a "here's all the ways it could work" but c...

odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: string\-formatting\-tag
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: revert\-metricity\-init\-changes
#
[python-discord/bot] New branch created: add\-metricity\-to\-compose
#

By adding metricity to the compose, we allow it to migrate itself, rather than needing the site to do it.

Defaulting 'skip_metricity' to true means that it will run migrations, but not actually start the bot. This means we don't add another service that needs to run all the time, which could impact some contribs on lower powered hardware.

This needs to be merged at the same time as https://github.com/python-discord/site/pull/588

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

I realized that the infractions viewset allows filtering by fields.

Adding:

filter_backends = (DjangoFilterBackend,)
filter_fields = ('name', 'discriminator')

To UserViewSet and then calling

await ctx.bot.api_client.get("bot/users", params=dict(name="Qwerty", discriminator=1))

Allowed fetching the user data by name and discriminator.

I think the implementation of this is simpler, but it returns a nested dictionary with a list of user dictionaries under "re...

odd spireBOT
regal archBOT
#

2a83c5f Only check URL-like objects against domain filters - ChrisLovering
fddd341 Refactor & simplifiy domain filter check - ChrisLovering
9b094f6 Merge branch 'main' into Only-check-domain-filt... - ChrisLovering
14e910e Merge pull request #1788 from python-discord/On... - ChrisLovering

#
[python-discord/bot] branch deleted: Only\-check\-domain\-filters\-against\-URL\-like\-parts\-of\-a\-message
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

How does this sound

"""
Cog for a challenge command.

The challenge command pulls a random kata from codewars.com. A kata is the name for a challenge, specific to `codewars.com`

The challenge command also has filters to customize the kata that is given. You can specify the language the kata should be from, the difficulty of the kata (1 is the hardest, 8 is the easiest, on a scale from 1-8), and lastly you can customize the topic you want the kata to be about
"""
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#

The regex (if possible) should be updated not to insert \ inside codelines or codeblocks

It should just be a matter of update the regex here.

>>> string = "Hello world `__repr__` how are _you_? I'm good _today_, but __tomorrow__ may be different, `_User`."
>>> reg = r'(?:`[^`\\]*(?:\\.[^`\\]*)*`)|([_|])'  # will get underscores and pipes that aren't in backquotes
>>> to_escape = [m.span()[0] f...
regal archBOT
#
[python-discord/site] branch deleted: fix\-database\-switch
#
[python-discord/bot] New branch created: fix\-pynews\-markdown
#

Closes #1821.

No longer escapes markdown inside of codeblocks for python news posts.

Haven't been able to test in the context of python-news but have done simulated tests locally which work:

>>> string = "Hello world `__repr__` how are \_you_? I'm ||good|| _today_, but __tomorrow__ may be different, `_User|123`."
>>> reg = r"(?:`[^`\\]*(?:\\.[^`\\]*)*`)|([_|])"
>>> to_escape = [m.span()[0] for m in re.finditer(reg, string) if m.group(1)]
>>> to_escape
[32, 36, 43, 44, 49, 50...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Would it really be so hard to just hard-code the numbers?

IMAGES = {
    6: "https://cdn.discordapp.com/attachments/859123972884922418/883472355056295946/hangman0.png",
    5: "https://cdn.discordapp.com/attachments/859123972884922418/883472756744814613/hangman1.png",
    4: "https://cdn.discordapp.com/attachments/859123972884922418/883472808699629578/hangman2.png",
    3: "https://cdn.discordapp.com/attachments/859123972884922418/883472862441267230/hangman3.png",
    2: ...
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3

14468af Add a docker compose for local dev - ChrisLovering
9942e15 Add a script to create metricity db if it doesn... - ChrisLovering
803d19f Create database before migrating and running - ChrisLovering
a5a397d Use case-insentivite compare to true to determi... - ChrisLovering
1786859 Capitalise SKIP_METRICITY env var name - ChrisLovering

#
jb3
[python-discord/metricity] branch deleted: metricity\-creates\-own\-database
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#

Sentry Issue: BOT-1MX

ValueError: invalid literal for int() with base 10: ''
  File "bot/exts/info/doc/_inventory_parser.py", line 107, in fetch_inventory
    inventory = await _fetch_inventory(url)
  File "bot/exts/info/doc/_inventory_parser.py", line 83, in _fetch_inventory
    inventory_version = int(inventory_header[-1:])

An unexpected error has occurred during fetching of https://ipytho...
regal archBOT
#
jb3
[python-discord/site] New branch created: jb3/repos\-update
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

We should catch for re.error here in case the regex is invalid.


Example: !clean regex [

Traceback (most recent call last):
  File "/home/shivansh/.cache/pypoetry/virtualenvs/bot-5X3Lakqr-py3.9/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/shivansh/Programming/pydis_projects/bot/bot/exts/moderation/clean.py", line 521, in clean_regex
    await self._clean_messages(ctx, traverse, reg...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

The way the program is currently written, the parse_readme function creates a dictionary of the Table of Content's headers, as well as the hyperlink to them. This gets called wtih fetch_readme, which is called in the __init__.

Once this dictionary is created, the fuzzy_match_header function uses the rapidfuzz.process.extractOne method with the user search term and this created dictionary.

If I change that to re.search, then I probably wouldn't be leveraging the fuzzy matching ...

#

To check that I'm following you here:
From this:

        table_of_contents = re.findall(
            r"\[👀 Examples\]\(#-examples\)\n([\w\W]*)<!-- tocstop -->", data
        )[0].split("\n")
        table_of_contents = list(map(str.strip, table_of_contents))
        log.debug(f"{table_of_contents = }")

        for header in table_of_contents:

to this:

        table_of_contents = re.findall(
            r"\[👀 Examples\]\(#-examples\)\n([\w\W]*)<!-- tocstop -->...
odd spireBOT
odd spireBOT
regal archBOT
#

closes #1823
instead of letting the decoding errors go to the generic exception handler, the inventory header is now validated at multiple points and an InvalidHeaderError is raised if it is invalid.
The error is handled in the converter and converted to a clearer bad argument that's displayed to the user. In case of automatic inventory loading, the error is logged as a warning so the inventory can be fixed in case it was moved or some other reason for the convent to be invalid

odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/metricity] New branch created: remove\-double\-negative\-from\-env\-var
odd spireBOT
regal archBOT
#

For context, what was the original reasoning for doing the init outside of the compose? can you link the PR?

The original reason was because when we included site in the bot's compose file, we used the image directly, so it did not have metricity initialised. This wasn't much of an issue until recently, when we added django-prometheus which requires those relations exist at run time.

However, this wasn't a great solution, since users who actually want to run metricity needed to delete...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/metricity] branch deleted: remove\-double\-negative\-from\-env\-var
regal archBOT
#

Description

Editing an embed with an image causes the image to appear in the message as well. The original DDDG implementation used a workaround that immediately broke when we moved to discord.py 2.0. J9 then put in a temporary fix in the re-organization PR by editing the message text instead of the embed text. This fixes the image bug but places the text over the board, doesn't look as good, and is currently overwriting old text.

Proposed Solution

As far as I can tell, there is no...

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

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

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

@Xithrius This looks interesting to implement, do you mind assigning me this issue.

My approach so far
Create a list of all anagrams which can be made (JSON file maybe)
Select a word which has anagrams from JSON at random and scramble the word so its letters are jumbled
Users will suggest words which are anagrams, check in JSON if they are valid anagrams if yes award points (still figuring out how to do that)

#
jb3
[python-discord/site] branch deleted: jb3/repos\-update
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Sending a reminder about [these messages from the Discord server](#dev-contrib message) so that it is also on record in the PR.

Cleaned it up a bit in https://github.com/python-discord/bot/pull/1663/files/e07febdbde4815466b161b535f4a5eaf3593f755..3edce6120b48cf83f8a87f34da1007221967232c after I realized the TagIdentifier.from_string handles part of the logic and can be used instead. I've also moved all the paginating into...

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

When implementing this, I realised that this kind of day-and-star "formula" might not be the most convenient if someone wants to check multiple stars,days. So I went ahead an implemented a small panel, so that after invoking the command with something like: "1-1" you can step the day and star parameters and get new results accordingly. Also, I think it should be included in this PR that's what I proposed my idea here.
![PReview](https://cdn.discordapp.com/attachments/857588537845874689/88706...

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

Relevant Issues

Closes #611

<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->

Description

Adds a .gitpod.yml file that automatically installs Python 3.9.6, poetry and installs poetry dependencies.

Did you:

  • [x] Join the Python Discord Community?
  • [x] Read all the comments in this template?
  • [x] Ensure there is an issue open, or link relevant discord discussions?
  • [x] Read and agr...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
jb3

Hey!

There is no way to blacklist specific modules, you'll find that a lot of things use the modules you've cited as well which could cause a few problems.

Due to the isolation that snekbox provides there is little risk with any of the mentioned modules, for example you can only do limited spawning with os.system (the container doesn't have a lot of tools inside it).

I'd be interested to hear the use case for a blacklist of modules, but you can rest easy that using all of these with snekbo...

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

No it won't potentially do so. Threading will not block the event loop.

The thing with threading is that it won't go faster, because it is not run in parallel and even when it is ran concurrently Python has the GIL which means that even concurrently only one thread can run at a time.. so half concurrently!

But that doesn't matter and we don't care, this is not a high priority calculation that we need to speed up with parallelism. The objective is to just not make it not block the event loop.

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

Description & Reasoning

The .topic command provides conversation starters for our channels. It's very useful for getting things back on topic or to bring up a new thing to talk about. However, I've noticed that some people will just use this command as a rapid-fire answer mechanism, so they end up using .topic several times in as many minutes.

That's not really the intent of this command and is quite spammy, especially in already fast moving channels like python-general. I propose...

regal archBOT
#
[python-discord/sir-lancebot] New branch created: sim\_matches
#

People have brought up the issue of if the users don't like the current topic, how can they get a new one?

The proposed solution there is to add a reaction to re-run the topic to pick a new one.

It could also be solved, by adding a countdown button, and when it reaches the desired amount of votes it picks new one.(Timeout should be configured accordingly)
(Just to make use of the new dpy. 2 features 👍 )

#

Description

About one year ago, I created a pull request (#590) that closed issue #277, a relatively simple game called the Spooky Name Rate game where people try to spookify a name announced everyday and compete for the spookiest name. Since October is arriving again, this cog is soon going to be in use, but now I realise that not only can this be improved using the new discord features such as threads and replies, but it might also break because of some recent changes, and some informat...

#

Description

The bot sometimes sends you error messages when you type invalid commands.

Steps to Reproduce

Type ...and or .cand or so on in a channel, and you'll be met with an embed by the bot saying "Command can only be used in October." This happens because the command handler tries suggesting the candy command but its checks raise a check failure, and the check failure is passed to the error handler again which is handled by it by posting that october embed.

Expect...

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

Connected!

odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: custom\-logger\-class
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: revert\-metricity\-init\-changes
#
[python-discord/bot] branch deleted: add\-metricity\-to\-compose
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
#

I ran the model generation, surprisingly it did not end up generating Table definitions at all.
It still lacks of some Validation (However in some places it managed to generate those checks) however some of the checks defined on the Django side still need to be implemented. (Most of them are fairly easy though). Although, I believe opening a Draft Pull Request to discuss further things to do/implement is vital.
Originally, everything was in one file, so I took the liberty and split them in...

regal archBOT
#

Just had an idea @CyberCitizen01

With your get_color_fields function, we can take any input mode and change that to rgb before passing it to the function. We could define individual <mode>_to rgb functions above the class and use them in the big if /elif loop when checking the mode.

From there we would call your overall function to create the individual color types and send that to the embed.

One thing I think we need to decide is whether to force the user to pass in tuples o...

regal archBOT
#

First of all, sorry that I haven't been able to produce any updates lately. School just started for me two weeks ago, and I have some things to sort out, so it's going to take me some time to get my developing and studying schedule back on track. And also, @ChrisLovering, I just realized: the everyone role didn't work for me before because I placed the decorators in the wrong order - and I assumed that it was the role's fault. Now, looking at the logic, you're correct. I will update this PR s...

#

Changing this to class CustomLogger(logging.getLoggerClass()) results in PyCharm giving a warning stating Unresolved attribute reference 'isEnabledFor' for class 'CustomLogger' and Unresolved attribute reference '_log' for class 'CustomLogger' (same happens for log instead of _log).

Even casting doesn't fix this (cast(Logger, logging.getLoggerClass()))

regal archBOT
regal archBOT
#

Unresolved attribute reference 'isEnabledFor' for class 'CustomLogger'

This seems to be a PyCharm bug, as both mypy and pyright correctly infers the correct type.

However, mypy (but not pyright) returns a different error relating to dynamic base classes. The workaround for that is


if typing.TYPE_CHECKING:
    LoggerClass = Logger
else:
    LoggerClass = logging.getLoggerClass()

class CustomLogger(LoggerClass):

A nice explanation of why casting and eve...

regal archBOT
odd spireBOT
regal archBOT
#

With your get_color_fields function, we can take any input mode and change that to rgb before passing it to the function. We could define individual <mode>_to rgb functions above the class and use them in the big if /elif loop when checking the mode.

From there we would call your overall function to create the individual color types and send that to the embed.

Yes I totally agree.


One thing I think we need to decide is whether to force the user to pass in tuples or not...

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

One thing I think we need to decide is whether to force the user to pass in tuples or not:
.color rgb (100, 100, 100)
or should we be flexible enough to accept these forms as well:
.color rgb 100, 100, 100
.color rgb 100 100 100
.color rgb 100,100,100

I think that all of the above user input examples can be handled with a regex match, so if possible I'd say go for flexibility. If you want a single format I'd suggest "100 100 100" over "(100, 100, 100)".

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

I don't think we should extend the windows path tag as it's already quite long. We could add a separate tag to explain how to modify the PATH, although that differs depending on OS so we could end up with quite a long tag, and i'm not sure how useful it would actually be.

One option would be to have:

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#
            mode: Literal["s", "m", "S", "M"] = "s",
    ) -> None:
        """
        Play hangman against the bot, where you have to guess the word it has provided!

        The arguments for this command mean:
        - min_length: the minimum length you want the word to be (i.e. 2)
        - max_length: the maximum length you want the word to be (i.e. 5)
        - min_unique_letters: the minimum unique letters you want the word to have (i.e. 4)
        - max_uniqu...
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: cj\-wrapup
#

This updates the website now that the code jam is wrapped up.

It corrects wording and sidebars to show that the code jam is no longer currently on going. This happens primarily on the main page, the events page, and the code jam page.

Additionally this PR adds some information about the Code Jam winners with links to their projects.

This PR also goes a bit out scope and edits the contents on the main Events page, namely removing Hacktoberfest, updating the 2021 events calendar, and r...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: contributing\-tag
#

Closes python-discord/meta#109

This adds a contributing tag, providing a quick explanation of how to contribute to some of Python Discord's projects.
The tag currently looks like this:
image

I'm still not certain if this is something we want or what the exact wording should be. But I figured a quick explanation and links to where to get started is a good base.

odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#

Description

When using Hangman multiplayer Sir Lancebot will respond to every message sent in the whole server.

Steps to Reproduce

Play a hangman game and send messages in other channels.

Expected Behaviour

It should actually just listen to messages in the current channel.

Actual Behaviour

Sir Lancelot intercepts every single message as one directed to the game and most commonly responds with an error message saying only 1 letter should be used.

Known Impacted Platforms

-...

#

Description

Following the removal in #871, hangman should be re-added again.

Reasoning

Quickly following its introduction it become apparent that hangman's multiplayer mode had some flaws. Most importantly, it meant that a whole channel was occupied.

Proposed Implementation

Multiplayer mode should be reintroduced using threads, this is also the reason that the issues are separated. As the Python bot doesn't quite yet receive messages in threads so threads have not yet been en...

regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: no\-hangman\-multiplayer
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Added 2 files
anagram.py - Has the code for anagram command
anagram.json - Contains all the words for anagram command

Relevant Issues

<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Closes #730 , creation of Anagram minigame

Description

Added 2 files for anagrams game command

anagram.py - It has code for anagram game command. Users can play the game by using ".anagram" command, it will show an embed with scrambled letters whic...

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

Looks great, love the new interface and look forward to this being merged 👌, just a couple of comments.

I managed to get this error

bot_1        | 2021-09-19 15:44:56 | bot.exts.backend.error_handler | DEBUG | API responded with 400 for command clean bots: {'deletedmessage_set': [{'author': ['Invalid pk "814417186864496711" - object does not exist.']}, {'author': ['Invalid pk "814417186864496711" - object does not exist.']}, {'author': ['Invalid pk "814417186864496711" - object does ...
#

Looks great, love the new interface and look forward to this being merged 👌, just a couple of comments.

I managed to get this error

bot_1        | 2021-09-19 15:44:56 | bot.exts.backend.error_handler | DEBUG | API responded with 400 for command clean bots: {'deletedmessage_set': [{'author': ['Invalid pk "814417186864496711" - object does not exist.']}, {'author': ['Invalid pk "814417186864496711" - object does not exist.']}, {'author': ['Invalid pk "814417186864...
#

Looking into it i'm guessing this was caused by the switch from fuzzywuzzy to rapidfuzz, https://github.com/python-discord/sir-lancebot/pull/799/files, process.extract returns tuples with 3 elements, while creating a dictionary only accepts 2.

We can fix this the same way as Python bot does it, https://github.com/python-discord/bot/blob/ec8e3e3f69e9c9b938929efece487b229fc1dd9c/bot/exts/info/help.py#L130

...

#

I see two possible avenues to handle these errors:

  • Hold a cache in the modlog to store deleted message ID's. Before relaying messages to the API it will filter out messages already cached. This has the issue of storing another cache which is meh, and also I'm not sure that the messages are deleted correctly when this error occurs.
  • Change the API to ignore duplicate keys. This has the issue that we need to scope all of the places in our code where we use this API endpoint to understand w...
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#

Should we remove the Api prefix from models, and add uppercase letters where reasonable? Such as ApiOfftopicchannelname -> OffTopicChannelName?

I think multiple modules is fine, but we should have an __init__.py in there importing them so we can import the models from a single import.

I've added the changes mentioned, however I'm not sure I understand why the max line length is 88.

#

In our resources folder we have 3 yaml/toml files (https://github.com/search?q=repo%3Apython-discord%2Fsir-lancebot+extension%3Ayaml+extension%3Atoml+path%3Abot%2Fresources) and 43 json files (https://github.com/search?q=repo%3Apython-discord%2Fsir-lancebot+extension%3Ajson+path%3Abot%2Fresources), so a change to all JSON would be much easier.

I prefer JSON for this sort of use case, as it's more similar to Python's syntax so it's more clear how it will translate into a Python object once ...

regal archBOT
odd spireBOT
regal archBOT
#

I was thinking in the case of something like !clean <user_id> 5M * (I think that's how the arguments would work...) if somebody was spamming over a bunch of channels you'd delete messages from them in the past couple of minutes.

Just choosing a number of messages to traverse would work fine for this scenario, so this isn't especially important, just wondering if there was a reason not to allow it.

#

I see two possible avenues to handle these errors:

* Hold a cache in the modlog to store deleted message ID's. Before relaying messages to the API it will filter out messages already cached. This has the issue of storing another cache which is meh, and also I'm not sure that the messages are deleted correctly when this error occurs.

* Change the site to ignore duplicate keys. This has the issue that we need to scope all of the places in our code where we use th...
regal archBOT