#dev-log

1 messages ยท Page 91 of 1

regal archBOT
#

Add a comment here describing the intended behavior?

Unfurl links only if the message containing the link:

  • isn't in dms
  • is not within the python discord
  • is not within the incidents channel (handled in the incidents cog)
  • and the message is in a staff channel

Also missing from here is the ability to configure other channels (which isn't required but would be amazing if we could get a channel whitelist and add staff channels to it rather than need to edit the code each time)

#

This also fails to account for nonstandard or newline delimited content. Example:

123456789012345678901234567890
123456789012345678901234567890
123456789012345678901234567890

is 60 characters, but this filter will truncate it to 50. I don't think we should do anything fancy here--it's very unlikely someone will link a message with nonbreaking spaces in it--but I think we should account for the newline case.

regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/forms-backend] New branch created: jb3/store\-correct\-ip
#
jb3

We store IP hash for anti-spam, however we've so far only being hashing the IPs of our NGINX proxy nodes, meaning the data cannot be used to prevent form abuse. This PR corrects that by instead inspecting the Cf-Connecting-IP header and if set hashing that, otherwise falling back to the remote host.

odd spireBOT
regal archBOT
#
jb3
[python-discord/forms-backend] branch deleted: jb3/store\-correct\-ip
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Can anyone think of a better name?

Also, putting the underscore prefix is unnecessary in cogs. We can work under the assumption that cogs generally will not have their methods accessed externally because the classes aren't meant to be instantiated directly, and there are very few exceptions where get_cog is used to get to a method. I realise the underscore is prefix is used inconsistently in cogs, but I suppose if that is to be changed then it needs to start being brought up in reviews.

regal archBOT
#

Practically, The PATCH method allows modification of all fields on the model. We could leave it as it is as we will only be patching the active field. If we really want to restrict the PATCH to 1 field only, i.e, the active field, we can add a check to make sure the request body only contains the active field. But, I am not sure if we should have this check or leave it as it is?

#

Practically, The PATCH method allows modification of all fields on the model. We could leave it as it is as we will only be patching the active field. If we really want to restrict the PATCH to 1 field only, i.e, the active field, we can add a check to make sure the request body only contains the active field. But, I am not sure if we should have this check or leave it as it is?

What is unexpected is the fact that you can create a new off-topic-name by PUTting (this is primarily ...

regal archBOT
#

My comment above applies to PUT also. The reason for the creation of a new
object is django behaviour towards primary keys. This is from the docs
The primary key field is read-only. If you change the value of the primary key on an existing object and then save it, a new object will be created alongside the old one.
https://docs.djangoproject.com/en/4.0/ref/models/fields/#primary-key

On Sun, Dec 26, 2021 at 1:42 AM Bluenix @.***> wrote:

Practically, The PATCH method allows modifica...

regal archBOT
regal archBOT
#

Sentry Issue: SIR-LANCEBOT-7F

Relevant lines: https://github.com/python-discord/sir-lancebot/blob/ec6eb2e3ce4d2f0a4c3917f9eff00266a6ecf894/bot/exts/core/internal_eval/_internal_eval.py#L96-L98

Our paste service currently has a length limit of 100000. The payload should be truncated before sending it (though probably to something more reasonable than 100000). You can use the other bot's interval ...

regal archBOT
#
[python-discord/sir-lancebot] New branch created: aoc\-completer\-role
#

Description

This PR adds an hourly task to give a specific role to users who have completed all 50 stars and linked their Discord accounts.

This also adds the ability for members to be blocked from getting this role, where we have believe that the user in question didn't complete the stars themselves (such as copying answers from the internet).

Did you:

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/forms-frontend] New branch created: janine9vn\-allow\-issues
#

Description

The backend currently treats IDs with different cases as separate entities. This is not the standard though and can be unexpected behavior for some folks.

Lowercase and uppercase IDs should be treated as the same.

Reproduction Steps

  1. Create a form with an upper case ID.
  2. Try to perform different operations on the form with IDs that have different cases.

For example: try accessing it from the frontend, updating it's content using the api, or deleting it using ...

#
jb3
[python-discord/forms-frontend] branch deleted: janine9vn\-allow\-issues
#

Description

Submitting a non mapping response to a form, such as a list, returns a 500 error. It should return a 4xx error.

Reproduction Steps

  1. Create a form with no required questions
  2. Submit an empty response to that form on the /forms/submit/ endpoint. See request body below.
  3. The server should return a 500 error, and should generate a traceback on the backend (see below).

Request body:

{
    "response": []
}

Traceback:

File ".\backen...
#

Description

We should look into how to test our backend Starlette code to ensure that changes do not invalidate existing validations, features or other components in the application.

Justification

We want to notice when things go awry before we deploy them to production, so we should aim to validate our model code to ensure we don't end up with dodgy data in our database.

Implementation

We'll need to pick a testing framework, Starlette also provides a testing client for autom...

#

Description

Send a DM to a user after they have submitted a form. This may, or may not, include snekbox results if there is a code evaluation component.

Justification

Sometimes it is nice if users get notified about their submission. Code Jam participants and Esoteric Challenge participants should also get notified/a role added if snekbox evaluation goes correctly.

Implementation

This should be implemented as a Starlette background task. This has to ignore/handle all errors (...

#
[python-discord/bot] branch deleted: add\-dm\_sent\-field
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: incident\-archive\-msg\-improvements
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-dm\-sent\-feature
#
jb3
[python-discord/bot] branch deleted: fix\-dm\-sent\-feature
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-dm\-sent\-feature
#
[python-discord/bot] New branch created: fix\-dm\-sent
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

So my idea is for helpees (channel claimer) and helpers (role: helper+) to be able to tag a help channel with the helpee's needed topic/s of help. An example would be if a user had a question about pandas, they could tag it "pandas" using "!tag pandas".

To link the tag system with the help channels, we could have a help summary channel above all the help channels that displays all open channels (with #links) with their help tags or an unknown tag if no tags have been added. The channel cou...

regal archBOT
#

Description

Show an error message on the form if the server responds with an unhandled error code during submission.

Handling of common errors such as malformed or missing input is already covered, but other unexpeted errors should be accounted for, as the forms currently load forever with no indication of error to the end-user.

Implementation

Add a check for the result of the submission post on the form page, and handle it as needed. There should be enough details for the user to...

#

Description

We should render a hcaptcha form on any form page unless the DISABLE_ANTISPAM feature is enabled. We should block submission on completion of these captchas and then send the captcha result to the backend.

Implementation

We should collect a captcha token and pass it on to the backend as a captcha field at the root of the submission object.

This issue is currently being implemented by #162

#

Description

A user can currently accidentally close a form in-progress, losing everything they have so far typed out. We should do our best to ensure that this doesn't happen.

Implementation

The browser provides an API for prompting a user before they close the tab. You may have seen on different websites.

Refer to this Stackoverflow question as well as the [MDN docs for this](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandl...

regal archBOT
#

This should use interaction.response.edit_message() as that acks the response and edits the message in one request.

interaction.message.edit is a normal edit request, over the normal route.
Currently, discord.py views check if the interaction was responded after the callback returns, and send a deferred response if it wasn't acked.This ends up being two api requests.

However, if we use interaction.response.edit_message, that will only be one api request.

regal archBOT
regal archBOT
#

So when a link is sent in the server, the link can be used with a command to run it with rendertron, a headless chrome rendering service written in javascript, with a little tinkering it works with Python too, (tried and tested), for example, if a grabify link is sent, the IP registered is that of the rendertron link(tried and tested again)

If I get an approval from maintainers I could start working on it :D

regal archBOT
#

If we were to implement this, I donโ€™t think we should do it from the bot, but rather from a worker (doing it from the bot leaves us open to any vulnerabilities presented by the app). That means itโ€™ll most likely be JavaScript anyways.

Why rendertron? I see it uses puppeteer, whatโ€™s the benefit of using it over puppeteer directly? If we do this in python, why not a python specific library?

Finally, whatโ€™s the motivation behind this command, aka, what use cases are you envisioning for this.

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

As for rendertron, calling the api is super easy and can be done in few lines of code, I tried doing the same in various other libraries but to no avail, it needs selenium webdriver

Use cases are plenty, for starters, when someone posts a link in the server to check the contents of the website we could use this command and then it sends us the screenshot, and verify if the link is safe, and as for grabify links and other malicious links of the sorts could be verified using this.

regal archBOT
regal archBOT
#

That benefit youโ€™re explaining comes at a pretty hefty cost for devs, since youโ€™re trading install difficulty (itโ€™ll still be difficult because we need to add npm), with storage (puppeteer on its own is 300mb on average?).

As for grabify links, theyโ€™re outright banned from being posted on the server, so it wonโ€™t serve that use case. If youโ€™re looking for a general utility to do this, one of the existing websites that do this seem a better fit.

night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
oak estuaryBOT
regal archBOT
regal archBOT
#
[python-discord/snekbox] New branch created: bug/dev/124/cli\-args
regal archBOT
#

Description

Snekbox hangs while reading stdout from the NsJail processes. This is handled by NsJail._consume_stdout(). The specific line it hangs on is https://github.com/python-discord/snekbox/blob/94627e22c118060bdec1676f9dca16691617fa7d/snekbox/nsjail.py#L120

I believe this happens because the amount of bytes being read is larger than the amount that's in stdout. Hence, the read() call waits until enough bytes become available to satisfy the requested amount.

Reproductio...

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/snekbox] New branch created: ci\-refactor
regal archBOT
regal archBOT
regal archBOT
#

Well, this isnโ€™t running on python, the api is hosted by someone, and theyโ€™re running it via JavaScript. We wouldnโ€™t use it in our bot, as they ask people not to. If we were to use it weโ€™d host our own, which is what I was alluding to with CF workers.

Regardless, I donโ€™t think this is something that will be worth pursuing with the limitations listed above. If a demand for it presents itself in the future, itโ€™ll most likely be from the mod team, and we can reconsider then.

regal archBOT
regal archBOT
oak estuaryBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

Each job in the test matrix has a different environment and thus covers different parts of the code. To get complete coverage reports, the coverage data from these jobs needs to be combined. There are two approaches:

  1. Upload each coverage file as an artefact and have another job download all artefacts and coverage combine before publishing to coveralls.
  2. Run coveralls in each job and have another job run coveralls --finish, as shown [here](https://coveralls-python.readthedocs.io/e...
#

Currently, coverage data is generated with absolute paths. This means that if the coverage file is moved across machines, the source code must be in the exact same location. The current workaround is to configure Docker to mount the host's code to the same exact directory within the container. However, this doesn't work for Windows machines since the host's path is not compatible on the Linux container.

The relative_files = true setting can be added to .coveragerc to fix this.

Note ...

regal archBOT
#

Oh I would absolutely love to but I have no idea where to even begin

-Dylan Nelson


From: Mark @.>
Sent: Monday, December 27, 2021 10:27:03 PM
To: python-discord/bot @.
>
Cc: NelsonBlvd @.>; Mention @.>
Subject: Re: [python-discord/bot] Support Anti-Spam Checks Across Channels (#665)

@NelsonBlvd<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FNelsonBlvd&data=04|01||4183777a7f2e4a13e40108d...

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#

d061ab1 Add active field to OffTopicChannelName model. - RohanJnr
8232b11 Serialize name and active attribute. - RohanJnr
b2819a4 Use ModelViewSet to add support for PUT and PAT... - RohanJnr
28de14b Return a list of ot-names only for GET request ... - RohanJnr
69f4dc1 Return a list of ot-names only for GET request ... - RohanJnr

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: include\-message\-in\-user\-embed
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: remove\-matplotlib
#

Description

matplotlib, and its sub dependencies, caused a fresh install of an environment to take multiple minutes. As the latex cog is the only one that used it, and that is currently disabled, we have decided to remove it entirely.

Git gives us the benefit of being able to see deleted files. So whoever decides to implement latex again can use that for reference.

Did you:

odd spireBOT
regal archBOT
#
sir-lancebot          | 2021-12-28 20:14:11 | root | DEBUG | Error Encountered: TypeError - RedisObject._to_typestring only supports the following: (('f|', <class 'float'>), ('i|', <class 'int'>), ('s|', <class 'str'>), ('b|', <class 'bool'>))., Command: adventofcode block, Author: Mark#3118, Channel: general-meta-voice
sir-lancebot          | 2021-12-28 20:14:11 | bot.exts.core.error_handler | ERROR | Unhandled command error: RedisObject._to_typestring only supports the following: (('f...
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: remove\-matplotlib
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/snekbox] New branch created: feat/tests/135/rel\-path\-coverage
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: aoc\-completer\-role
night lilyBOT
#
Sir Lancebot

Connected!

#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: logging\-in\-AoC\-completer\-task
#

Description

This adds some logging to AoC role task to help with debugging issues, along with raising error when bot can't modify the given role in member helper util, rather than silencing it.

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 agree to the [contributing guidelines](https://pythondiscord.c...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: logging\-in\-AoC\-completer\-task
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: user\-improvement
odd spireBOT
regal archBOT
#

I checked /proc/mounts for read-only mounts and /app was listed in there:

root@70b6714b9032:/app# grep "\sro[\s,]" /proc/mounts
sysfs /sys sysfs ro,nosuid,nodev,noexec,relatime 0 0
cgroup /sys/fs/cgroup cgroup2 ro,nosuid,nodev,noexec,relatime 0 0
/dev/sda3 /app ext4 ro,relatime,discard 0 0
proc /proc/bus proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/fs proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/irq proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/sys proc ...
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
Python 3.9.9 (main, Nov 23 2021, 11:52:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import annotations
>>> import typing
>>> def meth(foo: str | None):
...   pass
...
>>> typing.get_type_hints(meth)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/.../.pyenv/versions/3.9.9/lib/python3.9/typing.py", line 1496, in get_type_hints
    value = _eval_type(value, globalns, ...
regal archBOT
regal archBOT
#

67650b6 Check for wrong token before all other checks - Bluenix2
a4ec55f Fix wrong grant types used when generating tokens - Bluenix2
745c06c Touch up api_token.html template after access t... - Bluenix2
f113b9e Correctly send enum value to HTTPException detail - Bluenix2
d10564c Validate that an access token isn't used to gen... - Bluenix2

odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Unable to fetch AoC leaderboard during role sync.

None

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: mbaruh\-patch\-1
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: purge\-to\-clean
#

This PR migrates our purgeban command away from Discord's native purgeban in favour of our custom logic.

Discord's native purgeban does not leave us with any evidence or context of what messages were deleted. So when mods reference the infraction at a later date, as example for an appeal, they are lacking required information.

Instead, we can use our custom clean cog to delete all messages from the user in question for the last hour, and automatically append the link to that clean log t...

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

Since this changeset introduces additional cross-cog dependencies, that could be unintentionally broken, I'm planning on writing some tests for this new behaviour. Will get around to it later this evening/tomorrow.

There are some aditional bugs with undefined behavior related to this, depending on how they are implemented.

Please check https://github.com/python-discord/bot/issues/2022#issuecomment-997541569 for more information.
(Also, Happy new year!)

#

Since this changeset introduces additional cross-cog dependencies, that could be unintentionally broken, I'm planning on writing some tests for this new behaviour. Will get around to it later this evening/tomorrow.

There are some aditional bugs with undefined behavior related to this, depending on how they are implemented.

Please check https://github.com/python-discord/bot/issues/2022#issuecomment-997541569 for more information.
(Also, Happy new year!)

I'm only importing f...

regal archBOT
#
[python-discord/branding] New branch created: filter\-pfp
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/branding] branch deleted: filter\-pfp
regal archBOT
#

Some of the current logic in events/validation.py doesn't allow for the end date of an event to be "before" the start date. This means we can't easily have New Year's branding start in December and end a few days into January.

This requires some changes to the validation here, and I imagine it might take some changes in the bot's branding daemon.

regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

#
Unable to fetch AoC leaderboard during role sync.

None

#
Sir Lancebot

Connected!

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

Description

This allows AoC commands to be ran in January, along with limiting AoC join to only be ran in Nov, Dec and Jan.

This also removes the aoc subscribe command, since Python has a replacement for it now.

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

Feel free to open an issue. Don't want to delay this PR though.

Everything else works, this will just cause a sentry error in February as the code isn't made for that. (Tried it with month override to February.)

If I don't open an issue sentry will

"the code isn't made for that". Yes it is, you just need to set the AOC_YEAR env var, otherwise it will try to get next year's leaderboard.

Please don't make assumptions about the code and then say there are a "few bugs".

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

Closes #2034.

Improvements:

  • Infraction edit mod-logs now display the infraction id
  • Infraction applied mod-logs now have the previously missing colon (:)
  • Edited some code to use the defined infraction id variables, rather than re-indexing the dictionary.

The below image shows the mod-logs for applying a mute, editing the mute reason & duration, and finally removing the mute:
![image.png](https://user-images.githubusercontent.com/47674925/147856285-295a35ae-3f92-4b94-9a21-f0...

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

So, there's actually a bug with the current implementation of how leaderboard_fetched_at is created, impacting this change.

If the bot doesn't run in UTC timezone, then the timestamp returned will be incorrect and X hours (where X is the utc offset) off from whatever timezone the bot is currently being run in. It's so far been unnoticed because in production it does run in UTC. However, this is still a bug as it's dependent on which timezone the bot runs in and impacts local development ...

regal archBOT
#
[python-discord/sir-lancebot] branch deleted: aoc\-changes
#

fun fact about this, if it's a relative/humanized date_time passed in (i.e. "in 30 minutes") then the await ctx.send(f"Date and time parsed as...") won't send, as the type of that is arrow.arrow.Arrow and not tuple.

If that ctx.send(...) was un-indented one more level then it would always fire, which I would like if possible. But I also don't think it needs to be changed, so feel free to ignore.

night lilyBOT
#
Sir Lancebot

Connected!

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

Connected!

odd spireBOT
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

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

Connected!

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

I was thinking moreso because the thing you're summing is not user.bot and msg.author != user, and so should go all on one line. The "extra" lines in sum are for what you're iterating over; not for expanding the condition.

Also, if you do move to one line, then not (user.bot or msg.author == user) is better in terms of efficiency, but it's arguably not worth the readability downgrade so will leave up to you.

#

Another missed point in my review:

This can be made tidier (and more efficient) by moving outside of the loop and then doing an early return, so that we aren't running the if statement every iteration. Something like:

total_recent_mentions = sum(...)

if not total_recent_mentions:  # no mentions so definitely haven't gone over max mentions
    return None  # I personally prefer just `return` when breaking early

for msg in relevant_messages:
    # ...
    # ...
    if msg...
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
#

Description

We are opening our forms project to outside contributors. This entails moving our Quick Start Guide off of Notion and onto site.

This would mean adding a Project Widget Box Thing for forms on this page: https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/ and migrating the information currently in Notion over to forms.

We also need to make sure we include information for how to access the auto-genned documentation when people run it locally. A lot of the...

regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

Whitelist override (the one below that) is what we actually use. On second thought, it might be best to hide the other function, but thatโ€™s a problem for later.

Because it can be confusing, what you need to do is set the role override to the everyone role. You can see an example of that here:

https://github.com/python-discord/sir-lancebot/blob/c7b93780e509e05121ce1c3deacc38c6f884a6c9/bot/exts/utilities/bookmark.py#L90

#
[python-discord/sir-lancebot] New branch created: new\-issue\-closed\-emoji
odd spireBOT
regal archBOT
#

Relative action time in footer (per @MarkKoz here)

I discussed this with one of the core devs (I believe in a mod channel) and we decided we don't want this statistic, as it's often not particularly accurate - people forgetting to action etc.

Absolute action time as footer timestamp

For this I refer back to this PR description: "no longer displays when the incident was actioned as it's the same as the message timestamp." This isn't needed.

Simplified time of report (less...

#

we decided we don't want this statistic

Sure, makes sense.

when multiple reports by the same user are actioned.

In compact mode, if I want to see the date an incident was actioned, I would have to scroll to the first incident of that day, so adding the timestamp to the footer helps. Although, in practice the action time shouldn't be too distant from the report time, so the information is technically in the embed already.

#

Although, in practice the action time shouldn't be too distant from the report time, so the information is technically in the embed already.

I mean there are multiple instances where it's several hours after, simply because we're unfortunately not a 24/7 taskforce. Then there's the odd case of it being days later (due to being delayed by a ModMail thread etc.).

I think supported with the beginning of your message, that's enough rationale for re-adding the timestamp.

regal archBOT
#
[python-discord/sir-lancebot] branch deleted: new\-issue\-closed\-emoji
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

When users link to a github issue on discord via repo#num (e.g. sir-lancebot#999), we currently (as of #998) display a purple tick all the time if it's a closed issue.

Instead, we should display a purple tick only when it has a linked PR which has been merged, and otherwise a red tick (the tick from before #998).

Reasoning

This change will allow users to easily see whether an issue was closed due to "not going to be implemented" / "duplicate" etc. or whether ...

regal archBOT
#

GitHub itself doesn't provide this distinction (a closed issue is just a closed issue), so I'm not how this would be implemented in a practically useful way.

For example, one way of doing it would be checking for linked pull requests as you say. However, that brings the question: should we also check if the linked pull requests was merged or closed without merging? This also doesn't take into account issues closed by just a commit, or issues closed without any PRs needed (e.g. actioned ite...

#

GitHub itself doesn't provide this distinction (a closed issue is just a closed issue), so I'm not how this would be implemented in a practically useful way.

For example, one way of doing it would be checking for linked pull requests as you say. However, that brings the question: should we also check if the linked pull requests was merged or closed without merging? This also doesn't take into account issues closed by just a commit, or issues closed without any PRs needed (e.g. action...

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

Description

After #901 was merged, I thought of 2 more ideas that I think might be cool to add to the Madlibs game.

  1. Add an "end game" button to end the game in case a user decides not to play after starting a game.
  2. Add an "add word" button that randomly chooses a word from a list of words and adds it to the game in case the user can't think of a good word to use for the game.

Reasoning

I think these features will enhance how this game works and I'm sure it will make the...

odd spireBOT
regal archBOT
#

I discussed this a little more with other core devs, and we settled somewhere on trying to get TTL working with redis. SebastiaanZ/async-rediscache#17 came as a result of that, but after some more discussion with Sebastiaan, it's unlikely to be implemented in rediscache. Regardless, we have a backup plan that'll come as a result of some planned changes which are not yet public. Seeing as I can not currently work on this, either way, I'm going to be holding off until that change is ready.

regal archBOT
#

Notice that datetime.utcnow() is actually timezone unaware (yeah, I know), which could become a problem since you wouldn't be able to compare the timezone-unaware now_datetime to the timezone-aware duration. In practice this will never happen since duration should always have timezone information.

Furthermore, even if duration's timezone could be something other than UTC, there's no need to take it into account when creating now_datetime, since comparing two datetimes in differ...

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Description

When no input is used in the command, the embed sent should have the url to the website.

Reasoning

Currently a blank .realpython command raises an error, but it could be helpful to have a link to the Real Python homepage instead.

Proposed Implementation

I have an idea for how this could work, but this can be a good first issue for someone starting out.

Additional Details

Would you like to implement this yourself?

  • [ ] I'd like to...
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

Hi everyone i just sported a bug in your documentation

https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/setting-test-server-and-bot-account/#setting-up-a-bot-account

in this documentation
under the section " Setting up a Bot Account "
point no. 6 " In the General Information tab, grab the Client ID. "
instead of " General Information tab " it should be " OAuth2 tab "
if i can improvise it do let me know i / community can create an issue and i ...

#

Documentation

Hi everyone i just sported a bug in your documentation

https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/setting-test-server-and-bot-account/#setting-up-a-bot-account

in this documentation
under the section " Setting up a Bot Account "
point no. 6 " In the General Information tab, grab the Client ID. "
instead of " General Information tab " it should be " OAuth2 tab "
if i can improvise it do let me know i / community can create an issue and i...

odd spireBOT
regal archBOT
#

Bemyvalentine secret was already transferred to server only, aoc already runs in the server, and battleship is already guild only. I'd have to check minesweeper, but I don't see a reason for it to not be on the server.

minesweeper works only in dms atm, which with dms not being allowed breaks it currently, but I see no reason to not allow it on the server (I dont remember the orginal reason I made it dm only)

https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/fun/m...

regal archBOT
#

I had forgotten about the existence of this issue till now, but it was more or less resolved with #953.

Allowing a command in DMs needs to be done explicitly now, and we have not done that. Iโ€™ll be closing this issue.

We did kind of break minesweeper because it uses a command in DMs instead of just a message like battleship. We could either do what we do in battleship and have it listen to messages not commands, or we move it onto the server and delete the invocation to reduce spam.

#

Description

PR #953 explicitly blocked all commands which run in DMs, but minesweeper was missed in testing. Minesweeper commands only work in DMs, which makes the game unplayable.

Steps to Reproduce

Try to play the minesweeper game using minesweeper start.

Expected Behaviour

You should be able to respond to the bot.

Actual Behaviour

The bot will tell you you lack permissions to use the game commands.

Known Impacted Platforms

  • [x] Web
  • [x] De...
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

Currently, when someone has already nominated the user, it simply says that the nomination already exists, but doesn't mention the user.
The same goes for when someone edits the nomination reason for a user, it doesn't mention the user itself just the fact that the nomination reason changed.

It's helpful to know who the user is because most of the time you won't know the user by their ID which most people use for nominating.

Permission to open a PR directly:
https://discord.com/channe...

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

Connected!

odd spireBOT
regal archBOT
#

When target is an int, it is a nomination_id, not a user_id, so this will never work.
it might be easier to do this using the nomination variable, that is the response from await self.bot.api_client.get(f"bot/nominations/{nomination_id}"). Since that returns a nomination object, which contains a [User object](https://github.com/python-discord/site/blob/ecf794b87a5fa8026e5cfd2f996a4ad...

regal archBOT
#
[python-discord/bot] New branch created: eval\-mentions
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

Relevant Issues

Closes #1004

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

Description

Ignore OverflowError when parsing relative times. BadArgument is raised in the absolute time part of the converter if it cannot be converted there

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 discor...
#

I grabbed nomination['user'] and then ran await self.bot.fetch_user given the ID, and it seems to work well now.

One quick question - I know that fetch_user launches an API request so would we want to pull the user from the cache first and if that fails, run an API request on the ID? or is the user object already existing within the nomination object, specifically nomination['user']

#
jb3
[python-discord/bot] branch deleted: eval\-mentions
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: fix\-single\-quotes
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: single\-quotes
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: add\-bot\-core
#

This PR adds bot-core as a dependency, using a commit hash to pin to a specific version.

While it is still quite rudimentary in what it is doing, adding it in early allows us to start adding features and actually using them within the bot.

Currently bot-core only has the invite regex in it, so this PR migrates all call to the internal regex.py file to the bot-core regex instead.

This also moves the message ID regex, that's only used once, to inside file that uses it. This moves the r...

odd spireBOT
regal archBOT
#
[python-discord/bot-core] New branch created: add\-code\-block\-regex
regal archBOT
#
[python-discord/bot-core] branch deleted: add\-code\-block\-regex
odd spireBOT
regal archBOT
#

Description

The following quiz question is missing "substitution" as a valid answer:

A ____________ reaction is the one wherein an atom or a set of atoms is/are replaced by another atom or a set of atoms

The accepted answers are "displacement" and "exchange" according to the bot, but "substitution" is also a correct answer. See this excerpt from Wikipedia:

"A substitution reaction (also known as single displacement reaction or single substitution reaction) is a chemical reactio...

night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#
[python-discord/sir-lancebot] New branch created: fix\-aoc\-join\-logic
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

I'm not sure I follow, this if block is to determine if it's not current AoC, if it's not, then we send the error and return.

Current AoC is defined by the AOC_YEAR var, which we set in the env. So currently, it's set to 2021.

Both parts would fail right now, so the user invoking can join the 2021 board. Come Feb, neither of the conditionals will pass, so the error comes up and the command returns early.

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

Connected!

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

Updated the PR with changes from main since @HassanAbouelela kindly expressed interest in reviewing this. I'd still like to test things by running the bot (which the reviewer will hopefully be doing regardless). I did do that originally, but it'd be good to do it again since the "merge" operation was complicated. Anyway, will get around to testing it myself soon.

regal archBOT
#

Description

A slightly different implementation of the .latex command, hopefully with no memory leaks this time.
see also: #663 #668

Proposed Implementation

Previously, we were using matplotlib to render the latex, which seemed to hold references to the data even after we were done with it if the input contained invalid latex. This led to an increase in memory usage every time there was malformed input, and ultimately the bot would come crashing down because of memory limits on th...

regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: netcup\-sponser
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Unable to fetch AoC leaderboard during role sync.

None

#
Unable to fetch AoC leaderboard during role sync.

None

#
Unable to fetch AoC leaderboard during role sync.

None

#
Unable to fetch AoC leaderboard during role sync.

None

#
Unable to fetch AoC leaderboard during role sync.

None

#
Unable to fetch AoC leaderboard during role sync.

None

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

I like the code!

I have a few suggestions.

Firstly, you could delete the file immediately after it gets rendered for memory purposes or we would run into a similar problem as before.

Secondly, on line 56 of bot/exts/fun/latex/_latex_cog.py, it seems that you are dividing CACHE_DIRECTORY by {query_hash}.png. This will raise an exception.

Other than that, I like the code so far.

regal archBOT
odd spireBOT
regal archBOT
oak estuaryBOT
#

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

regal archBOT
#
jb3
[python-discord/infra] New branch created: jb3/auto\-issue\-workflow
#
jb3
[python-discord/infra] branch deleted: jb3/auto\-issue\-workflow
regal archBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#
jb3
[python-discord/infra] branch deleted: jb3/wireguard
regal archBOT
#
jb3
[python-discord/infra] New branch created: jb3/wireguard\-devops\-team
#
jb3

This PR adds a variables file to the wireguard role and injects the keys as extra peers to the servers generated wireguard configurations.

This means that with a config file locally that includes all servers you can access the internal 10.0.0.0/8 ranges that services will be hosted on.

We could add a script for generating private wireguard configurations by automatically fetching the keys of the production servers.

#
jb3
[python-discord/infra] branch deleted: jb3/wireguard\-devops\-team
#
jb3
[python-discord/infra] New branch created: jb3/readme\-updates
#
jb3
[python-discord/infra] branch deleted: jb3/readme\-updates
regal archBOT
#
jb3

We've decided to centralise the UFW rules within a single UFW role.

We need to be able to support:

  • Default policy (deny all)
  • Allow by port
  • Allow setting comment
  • Filtering by hosts (not all firewall rules make sense for every host)
  • Some non-configurable sane defaults (e.g. allowing SSH)
regal archBOT
regal archBOT
#

Quite often users setup a reminder, and when it gets to that time set another reminder for the same reason. This is usually because the reminder is to get them to do some task, and the user doesn't have time to do that task, so delays it.

We should support this workflow natively within the reminders, rather than having the user create a new reminder.

I propose that when the bot sends the notification for the reminder, the reminder includes some buttons that allows the user to re-schedul...

#

Sort of, but that requires you to type out the command again, this proposal would just be a quick and easy button. Therefore actually supporting this common workflow within the command.

Agreed, but according to your proposal, this only supports a definite set of possible re-scheduling times, in most of the cases one would need to rewrite the command to have their remind time, say 4hrs (example).

Also, for your second comment, I would love to see something like that even if this doesn...

regal archBOT
regal archBOT
#
[python-discord/infra] New branch created: service/9/ufw
regal archBOT
regal archBOT
#
jb3
[python-discord/infra] branch deleted: service/9/ufw
regal archBOT