#dev-log

1 messages ยท Page 85 of 1

regal archBOT
#
[python-discord/bot] branch deleted: catch\-403\-from\-Typing\-calls
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

As for now, it wouldn't make sense to add Postgres to the CI, since we don't have any relating tests. As a possible solution, maybe I could make "database_url" Optional for now?

Could we get away with setting that to some bogus value for now? I don't think making it optional makes sense from a deployment nor testing perspective. 99% of what the API does needs the database.

Also, am I also supposed to fix linting as well? I've added a new configuration that is similar to the ones use...

odd spireBOT
regal archBOT
#

As for now, it wouldn't make sense to add Postgres to the CI, since we don't have any relating tests. As a possible solution, maybe I could make "database_url" Optional for now?

Could we get away with setting that to some bogus value for now? I don't think making it optional makes sense from a deployment nor testing perspective. 99% of what the API does needs the database.

Also, am I also supposed to fix linting as well? I've added a new configuration that is similar to th...

#
[python-discord/modmail-plugins] New branch created: fix\-type\-alias
#
[python-discord/modmail-plugins] branch deleted: fix\-type\-alias
regal archBOT
#
[python-discord/sir-lancebot] New branch created: catch\-403\-from\-Typing\-calls
#

Relevant Issues

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

Description

Sometimes discord turns off typing events by throwing 403's, so we should catch those

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 agree to the [contributing guidelines](ht...
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: fix\-tests\-on\-windows
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: antispam\-log\-improvements
regal archBOT
#

Closes #566.

Fixes a test that fails on Windows due to differing path separators. This is currently the only failing test on windows.

Of note is that this doesn't implement all of 566, as I haven't included windows in the CI. Regardless, I'm pushing this now because I don't know when I'll get around to getting the CI working, and that doesn't need to block this specific bug. This will also give more time for discussion around whether Windows in CI is desirable in the first place.

odd spireBOT
regal archBOT
regal archBOT
#

Discord voice-chat room visitors seeking help frequently post screenshots of their code.

My experience helping people in chat, Stack Overflow, and in real life (Python meetup group office hours, teaching students, etc...) is that getting screenshots instead of copy-pastable code slows the process greatly while I explain that I can't execute their pic, and what to do instead.

It would be great to have something to point them to before they start asking. Here's a part of the revision I am...

regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: defcon\-redirect\-fix
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

self.messages is a dictionary mapping message IDs to message objects, so this doesn't work.
I get this error:

bot_1        | 2021-10-05 12:13:33 | bot.utils.scheduling | ERROR | Error in task AntiSpam._process_deletion_context(frozenset({<Member id=493839819168808962 name='wookie' discriminator='4017' bot=False nick=None guild=<Guild id=813116921646022716 name="wookie's test server" shard_id=None chunked=True member_count=4>>})) 139705866738800!
bot_1        | Traceback (most recent...
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

Alrighty I am trying to gather my thoughts on how this would work.

There is a main entry point with

@commands.command()
async def color(self, ctx: commands.Context, *, user_input: str) -> None:

We will use regex to try to match for the modes rgb, hsv, hsl, hex, cmyk, a name or random color type. (We will still need to be able to parse out a tuple of values from the regex) This would be opposed to the "mode" method currently.

if rgb_regex_match:
    self.rgb_to_all...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

13e5379 Raise InvalidHeaderError if inventory has inval... - Numerlor
ba33608 Display BadArgument to user when invalid header... - Numerlor
8e2dca8 Merge branch 'main' into doc-fetch_inventory-er... - wookie184
e45aa66 Merge pull request #1824 from Numerlor/doc-fetc... - wookie184

odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: antispam\-log\-improvements
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
#

If you run, for example

!doc setdoc pygame https://www.pygame.org/docs/objects.inv

twice, you'll get a message saying According to the API, your request is malformed. and this error:

bot_1        | 2021-10-05 18:04:59 | bot.exts.backend.error_handler | DEBUG | API responded with 400 for command docs setdoc: {'package': ['documentation link with this package already exists.']}.

We should handle this and give the user a better error message

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Can we have the command have some minimum threshold?

I tried it with the start of the Bee Movie script, first few seconds of Nicki Minaj's superbass, first page of the Bible, the first sentence of the FitnessGram PACER Test, a paragraph about the MRSA bacteria, the MIT license and your name....

but it wasn't until I brought out the morse code of "Hello World" and Never Gonna Give You Up music video link that I got a failure.

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

Have fixed the root issue of the circular imports, so now all files should be using bot.log.get_logger instead of logging.getLogger.

Also added any missing migrations from PRs made after I started this and squashed, fixed the conflicts (all 25), and did a commit for making newlines after imports consistent (part of PyCharm's "Optimize Imports" feature).

This should now be fully read for review @kosayoda @wookie184 :+1:

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Switches the protocol for external sites where possible. Some sites don't have secure versions, and were skipped.

The skipped sites are:

The motivation for this PR is that there is no reason to use insecure links on our site (and more accurately, I needed to fix them for something I'm working on), and it's easy enough to switch them out and review.

I'...

odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: minor\-changes\-to\-typing\-patch
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

I'm kind of 50 / 50 on overriding this to add our own arguments, because this
is also called by REST Framework from what I know. That said, we also have
other places where this method is called, and .filter() is called again on it
right after. Would it make more sense to stick with the definition as-is
(without the changes from all) and update the get_queryset(**params) call
from below to perform the filter itself?

#
jb3

13e5379 Raise InvalidHeaderError if inventory has inval... - Numerlor
ba33608 Display BadArgument to user when invalid header... - Numerlor
6fb6967 Use scheduling create_task util instead of crea... - Numerlor
f6a02d8 Use create_task util instead of asyncio.create_... - Numerlor
71ce990 Adds Core Dev Voting To Changelog Blacklist - HassanAbouelela

#
[python-discord/bot] branch deleted: infract\-then\-dm
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: ignore\-infra\-mods\-errors
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] New branch created: jb3/yes\-to\-www
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] New branch created: jb3/yes\-to\-www\-take\-two
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: jb3/yes\-to\-www\-take\-two
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] branch deleted: netlify\-logo
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: catch\-403\-from\-Typing\-calls
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: revert\-1806\-infract\-then\-dm
#
[python-discord/bot] branch deleted: revert\-1806\-infract\-then\-dm
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-infract\-then\-dm
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

You'll still keep the context with a raise KeyError("message") so have gone for that.

>>> try:
	1 / 0
except ZeroDivisionError:
	raise ZeroDivisionError("hello")

Traceback (most recent call last):
  File "<pyshell#4>", line 2, in <module>
    1 / 0
ZeroDivisionError: division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<pyshell#4>", line 4, in <module>
    raise ZeroDivisionError("hello")
Ze...
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: solve\-bot\-1852
odd spireBOT
regal archBOT
regal archBOT
#

In theory, this could lead to an inconsistent state between the database and the cached ping_tasks list if the database operation fails for some reason (e.g., network issues). Would that cause issues? Handling that situation also requires a bit of messy logic, so if it's not needed, I wouldn't add it.

Another option here would be to create a layer of abstraction (e.g., using a repository pattern) that manages both the local cache and the remote database, keeping them in sync and failing ...

regal archBOT
#

I am currently getting an error when trying to run this. It seems to be here:

 first_kata_div = await to_thread(soup.find_all("div", class_="item-title px-0"))

to_thread takes a function as the argument for what to run, this is instead running soup.find_all and passing the result to to_thread, which causes an error. Looking at the docs, https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread,
it seems something like

first_kata_div = await ...
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: fix\-http\-links
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: decrease\-batch\-size\-for\-user\-list\-endpoint
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: add\-appeals\-categories
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: add\-appeals\-categories
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3

c998d47 Move subdomains to query paths. - jchristgit
fa4a8dd Merge branch 'master' into subdomains-to-query-... - jchristgit
3699245 Merge branch 'main' into subdomains-to-query-paths - jb3
ce75197 Merge branch 'master' into subdomains-to-query-... - jchristgit
3c2fcb8 Merge pull request #526 from python-discord/sub... - jb3

#
jb3
[python-discord/site] branch deleted: subdomains\-to\-query\-paths
#
jb3
[python-discord/bot] branch deleted: kill\-subdomains
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] New branch created: jb3/add\-site\-local\-svc
#
[python-discord/site] branch deleted: jb3/add\-site\-local\-svc
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

Connected!

odd spireBOT
regal archBOT
#

Huh I'm not too sure, this code, along with the helper util were pulled directly from the bot.

We add tasks in this way in cog init's all the time in the bot, so it must be something d.py is doing under the hood.

I'm not too familiar with the internal to say why it's working, only that it seems to be.

We do make sure to add the bot loop to this call when creating a task after running the bot though.

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

bb23a46 Add a pull request template - doublevcodes
3d97138 chore: Add comments to instruct users - doublevcodes
1bb70f3 chore: Replace examples with comments - doublevcodes
b57c7e8 fix: clarify descirption of changes section - doublevcodes
5985beb Merge pull request #606 from doublevcodes/patch-1 - jb3

odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: bug/candy\-collection/fix\-typeerror\-id
#

This caused a TypeError to be raised, as the id argument could only be used as a positional argument and not by keyword.

Relevant Issues

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

Description

Did you:

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

Description

When bot adds reaction to .topic , and then user tries reacting happens on it. If moderator reacts to reaction, then it works.

Steps to Reproduce

  1. Use .topic without any mod role
  2. Click the reaction
  3. Nothing happens

Expected Behaviour

On reaction bot should refresh the topic.

Actual Behaviour

When non moderator reacts to message the bot does not refresh anything.

Known Impacted Platforms

  • [ ] Web
  • [x] Desktop
  • [x] A...
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: topic\-improvements
#
  • Fix bug where command author couldn't re-roll
  • Now removes user's reaction up re-roll
  • Added a missing break statement

Relevant Issues

Closes #894.
Extension of #880.

Description

  • Fixed a bug where command author couldn't re-roll (the if statement was checking against message.author which is the bot, instead of the command invoker)
  • Now removes user's reaction up re-roll (as requested by @ChrisLovering)
  • Added a missing break statement (now breaks when the `w...
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: bug/candy\-collection/fix\-typeerror\-id
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: update\-role\-constants
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: lancebot\-env\-changes
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: topic\-improvements
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#

Thanks for making this banner. It looks great!

I just have a few comments/questions about this:

  • Why was the logo.svg file deleted?
  • Is a vector (.svg) version of the banner available? It's good to have the source files available in the branding repo.

I'd also like to note that there's a (very minor) imperfection where you edited the "Y", shown below, but it's unnoticeable enough that I'll let it pass.
![image](https://user-images.githubusercontent.com/65498475/136613773-85443daf-3f...

regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

Admin should be the only role needed to test sir-lancebot features, so I think that's the only role we should mention on the main page (it makes sense to list the others on the reference page though).

I'd even say Helpers is stretching it a bit as what is necessary, although probably fair to mention so one can differentiate between MODERATION_ROLES and STAFF_ROLES in testing.

regal archBOT
#
[python-discord/sir-lancebot] New branch created: command\-prefix\-fix
#

Relevant Issues

Fixes an issue where you got messages like Game is already running... do <function when_mentioned_or..inner at 0x7fe4412a8ee0>quiz stop because command_prefix isn't always a string https://discordpy.readthedocs.io/en/stable/ext/commands/api.html?highlight=bot command_prefix#discord.ext.commands.Bot.command_prefix

Description

Did you:

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

Connected!

odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/site] branch deleted: decrease\-batch\-size\-for\-user\-list\-endpoint
odd spireBOT
odd spireBOT
regal archBOT
#

c4d7ad1 Generate SQLAlchemy models based on the current... - D0rs4n
0706001 Make model class naming more consistent, add mo... - D0rs4n
3ed24c4 Remove 'api' prefix from model tablenames - D0rs4n
aaf362c Add new NominationEntry model, Validations and ... - D0rs4n
04c9e86 Implement futher validations in models - D0rs4n

odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-delayed\-logs
odd spireBOT
regal archBOT
#

I don't like this repeating log.debug. Maybe this could be solved by running coroutine in the background and waiting after log instead?

All this really does is change the code from indicating conditions that shouldn't be logged, to conditions that should be logged. Rather than repeating return # Exit early to avoid logging. we are repeating log.debug. I think this is a more readable way of doing things, and makes it clear that the logs will run without being delayed by any...

regal archBOT
#
[python-discord/site] New branch created: voicemute
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#

It's finally here! Static previews on the site.

This PR uses django-distill to build a static version of the site, which is then deployed and hosted on netlify. Netlify will give us a static preview of the main branch, and it'll also give us previews on PRs. You can find examples of what that'll look like on my fork here:

https://github.com/HassanAbouelela/site-1/pull/8
This is a static preview of the changes made in #591.

Important!

1...

odd spireBOT
regal archBOT
regal archBOT
#

I've done some more work on the redirects. The latest changes on the branch I linked in my previous comment are deployed here.

Now, while my changes do work, they still feel sloppy. I did a bit more digging though, and I found a lot of guides and articles still using old links, so I'm not sure what the right call is here.

There's also a question of cost, since we generate ~40 extra HTML files for redirects alone. It's probab...

regal archBOT
regal archBOT
#

I've set up an instance of the bot earlier today and I've found setting urls.site to "web:8000" broke it:

bot_1        | Traceback (most recent call last):
bot_1        |   File "/bot/bot/api.py", line 66, in maybe_raise_for_status
bot_1        |     response_json = await response.json()
bot_1        |   File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1097, in json
bot_1        |     raise ContentTypeError(
bot_1        | aiohttp.client_exceptions.Con...
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

@kwzrd jesus christ, what the hell did I just read. Thanks for the heads up. Apparently I have been wrongfully suggesting this at work and elsewhere for years. What the hell. Jesus Christ. What the fuck.

Okay, apart from the fact that I have some cleaning to do at work tomorrow, with an aware instance, it seems to do the correct thing. I always thought time.time() isn't UTC... jesus christ, can we deprecate timezones ?? What the hell.

>>> datetime.datetime.now(tz=datetime.timez...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-bot\-1858
#

If you run, for example:

!doc setdoc black https://black.readthedocs/en/stable/objects.inv

twice over. You'll get an unhelpful "According to the API, your request
is malformed." error message back. This commit adds an error handler
to catch the HTTP 400 and tell the user the package already exists.


Fixes #1858

FYI this is my first proper contribution to the project so have fun requesting changes :wink:

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

This is coming from python-discord/meta#150.

Context

For recurring events where users might want to be notified about happenings, I'd like to add roles where we can ping people about information. The most notable application here is for PyWeek! Considering this functionality is very similar to the !subscribe command, we've determined the best UX would be to utilize the Discord Button Components and change how the !subscribe command works.

Details

This should have a button...

odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/.github] New branch created: review\-policies/do\-not\-merge\-tag
regal archBOT
regal archBOT
regal archBOT
#

WIth the latest changes, some infraction types will send messages twice. Warns, for instance, get sent in the original block, then get sent again in the modified block.

We can get around this by adding a conditional opoosite to the not in (ban, kick) from the new block, but perhaps we should instead rework this so it's a little less confusing?

For some reason the second part of the if statement was missing. if not infraction["hidden"]: should be `if not infraction["hidden"] an...

odd spireBOT
regal archBOT
#
[python-discord/.github] branch deleted: review\-policies/do\-not\-merge\-tag
#
[python-discord/bot] branch deleted: tags\-revision
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Admin should be the only role needed to test sir-lancebot features, so I think that's the only role we should mention on the main page (it makes sense to list the others on the reference page though).

I'd even say Helpers is stretching it a bit as what is necessary, although probably fair to mention so one can differentiate between MODERATION_ROLES and STAFF_ROLES in testing.

How exactly do you define "needed"? All of these roles are used within different checks etc. so to...

#

Most of these roles are not needed to test the functionality of something. Yes they may be used in checks, but do you for instance need to test with mod,admin,etc or, would just admin suffice. Same sort of philosophy as the test server. You don't need all channels, to use the bot, so here is a shorter list of ones you do need. I think that's even more important here since we already have problems with the guides.

Unless you are adding a feature that needs that role specifically, we probabl...

regal archBOT
#

Sentry Issue: SIR-LANCEBOT-6M

AttributeError: 'AI' object has no attribute 'user'
(8 additional frame(s) were not displayed)
...
  File "discord/ext/commands/core.py", line 1124, in can_run
    return await discord.utils.async_all(predicate(ctx) for predicate in predicates)  # type: ignore
  File "discord/utils.py", line 522, in async_all
    elem = await elem
  File "bot/exts/fun/tic_tac_toe...
#
[python-discord/sir-lancebot] New branch created: fix\-issue\-898
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: lancebot\-env\-changes
#
[python-discord/sir-lancebot] branch deleted: update\-role\-constants
regal archBOT
#

11d00e7 Rename Roles.moderator to Roles.moderation_t... - TizzySaurus [71d800a](https://github.com/python-discord/sir-lancebot/commit/71d800add94df3d678786ab482747ae904290129) Rename Roles.admintoRoles.admins - TizzySaurus [dc5f73b](https://github.com/python-discord/sir-lancebot/commit/dc5f73be8c18ef11c701822e8c600c8fca7b149c) Rename Roles.ownertoRoles.owners - TizzySaurus [e2da188](https://github.com/python-discord/sir-lancebot/commit/e2da188b554aba07b6c5a7a25b8af0baa74973cb) Check role id in MODERATION_ROLES instead of co... - TizzySaurus [aa272db`](https://github.com/python-discord/sir-lancebot/commit/aa272dbe789e86013969bc6f4e506d70ddfc63be) Check role id in STAFF_ROLES instead of compari... - TizzySaurus

#
[python-discord/sir-lancebot] New branch created: update\-role\-constants
#

Relevant Issues

N/A; this is a refined version of #896

Description

  • Renamed some role constants to reflect their in-server name
  • Added some safeguarding for .roles attribute
  • Corrected some typehints from Member to Union[User, Member]
  • Made some AOC commands guild-only since they require Member attributes (e.g. .aoc subscribe which updates the invoker's roles)

Did you:

odd spireBOT
regal archBOT
regal archBOT
#

@InvisibleOS design wise, this is excellent! The only real issue now is the SVG itself.

There's currently text for "Python" and "Discord". When submitting source files (like SVGs), I'd recommend converting the text objects into paths (curves). Otherwise, anyone who doesn't have the font installed can't view the SVG correctly.

I'm far from an Inkscape expert, but I'll try to help you with this if you don't know (or can't figure out) how to do this ๐Ÿ˜„

odd spireBOT
regal archBOT
#

I'll leave this here as a historical footnote:

The latest 5.x version of coverage.py seems to have changed/broken something that meant we ended up with a lower coverage % than we did on main when it was last published. Version 6.x fixes that problem, but does not appear to be compatible with coveralls.

With no clear fix available, Mark suggested we remove the failure on coverage decreases, which is exactly what was done through the coveralls site. The coverage will technically be incorr...

regal archBOT
#
[python-discord/snekbox] branch deleted: bump\-310
odd spireBOT
regal archBOT
#

Relevant Issues

Closes #847

Description

This PR is designed to add a fun Madlibs game to Sir Lancebot.

When the command, .madlibs, is run, the bot will ask the user to enter a word that fits a random part of speech (e.g. noun, adjective, verb, plural noun, etc.). The user will simply send a message with any word that fits the given part of speech.

The bot chooses a random number of user inputs to use for the game and a random story.

Once the user has finished entering...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/workers] New branch created: experiments/akarys/robots\.txt
#

This worker will be used to serve robots.txt files across our infrastructure.

The worker should be set on *.pythondiscord.com/robots.txt and pythondiscord.com/robots.txt. Each robot file is defined in the robots/ directory, the file name being the domain the rule should be served on.

The rules will be defined in a later PR, right now only the main site is set up.

regal archBOT
#
[python-discord/workers] New branch created: feature/9/hastebin\-filter
regal archBOT
#
[python-discord/bot] New branch created: watch\-output
odd spireBOT
regal archBOT
regal archBOT
#

At this point, I believe it's time we started migrating a few of the endpoints, there is an issue regarding the off-topic names endpoint, however I think we can also migrate the reminders endpoint, to see a more complicated one in this new environment as well.
(Although, the Alembic migration environment hasn't been set up just yet, a PR should come up anytime now.)
I would be glad If I could implement( or more like migrate) this one myself. (If it's possible, of course)

regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: subscribe\-with\-buttons
odd spireBOT
regal archBOT
regal archBOT
#

Helpers (and partners/python community) should be able to mention other users, but not roles, in reminders. In late June, this was still possible, but it currently isn't.

While looking through the source code and git blame (looks calmly at @TizzySaurus), I think I managed to locate the issue to the Reminders._check_mentions method. For a non-mod helper, the error message when mentioning another user in a reminder (should be allowed), is the error message that should be used when trying t...

#

Looking through the code, the _check_mentions method seems to do exactly what it should. The MODERATIONS_ROLES check is for mentioning roles.

elif await has_no_roles_check(ctx, *MODERATION_ROLES):
    return all(isinstance(mention, discord.Member) for mention in mentions), "roles"

This essentially says "if the user isn't a moderator, and they mentioned a role, return False -- since only mods can mention roles". To me that's exactly what should happen.

odd spireBOT
regal archBOT
#

I'm a bit confused. I think you might be misunderstanding the point of this game. I want the exact opposite of what you said - I do not, under any circumstances, want the bot to use the same template every time. That would make the game very boring because the point of the game is that the player does not know what the template is. That's what makes this game more interesting. However, it is using the same JSON file with the templates, but the templates used in the game should not be the same.

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

The templates are really long, so I'm not sure whether or not it makes sense to store them in a variable. My knowledge of JSON is currently very limited, so I'm not even sure how variables work in JSON (if that even is a thing). Unless you were talking about the Python program itself?

Ok. This is starting to make a little more sense. But as I said above, the templates are really long, so I don't know how I would save them to a variable like you suggested. Is there anything else you could s...

regal archBOT
#

Relevant Issues

Closes #667

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

Description

Added a cowsay command that emulates the classic CLI tool.

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 agree to the [contributing guidelines](https://pythond...
odd spireBOT
regal archBOT
#

Actually, there is one thing I can think of, but I'm not sure if it's very efficient. What do you think about this? @Bluenix2
`madlibs_stories = Path("bot/exts/fun/madlibs/madlibs_templates.json")

with madlibs_stories as file:
templates = [
file["templates"][0],
file["templates"][1],
file["templates"][2],
file["templates"][3],
file["templates"][4],
file["templates"][5],
file["templates"][6],
file["templates"][7],
...

regal archBOT
#

Why not use a list comprehension? Something like

with madlibs_stories as file:
    templates = [template for template in file["templates"]]

Although I can't help but feel like this isn't valid syntax. You probably need with open(madlibs_stories) and then files aren't subscriptable, so file["templates"] isn't valid.

If you're trying to load JSON, I'd recommend reading this RealPython tutorial on how to do so.

regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/workers] branch deleted: label\-webhooks
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Description

One of the events I'm planning to host in 2022 is a Python Trivia Night! People will gather in a stage channel and we'll be asking Python Trivia questions for people to answer. To help with participation and running the event, I'd like to have a cog/extension with a set of commands to help facilitate this.

Proposed Implementation

I'd like a new set of commands under .trivianight or .triviaevent.

.trivianight load will accept a json file of appropriately f...

odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: update\-advent\-of\-code\-channel\-ids
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: update\-advent\-of\-code\-channel\-ids
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#

Sentry Issue: SIR-LANCEBOT-6R

TypeError: object of type 'NoneType' has no len()
  File "discord/ext/commands/core.py", line 167, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot/exts/events/hacktoberfest/hacktober-issue-finder.py", line 49, in hacktoberissues
    embed = self.format_embed(issue)
  File "bot/exts/events/hacktoberfest/hacktober-issue-finder.py", line 107, in format_...
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT