#dev-log

1 messages ยท Page 90 of 1

regal archBOT
#
[python-discord/snekbox] New branch created: cgroupsv2
regal archBOT
#
[python-discord/bot] New branch created: snekbox\-api\-url\-env\-var
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: snekbox\-api\-url\-env\-var
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

05fbc0a Add modpings schedule feature - Shivansh-007
a97f068 (modpings): Cancel the task before scheduling i... - Shivansh-007
547f883 (modpings): Use separate scheduler for modpings... - Shivansh-007
f8fa9ba (modpings): Make flake8 happy! - Shivansh-007
9f53142 Merge branch 'main' into modpings-schedule - Shivansh-007

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

The participants channel stays public, just not writeable. If we get to the point of cleaning a user from the team leaders channel, I think a more focused action will be made anyway, likely including the disqualification of the participant. Specifying such a channel explicitly in that case seems like an acceptable edge case. And if it stops being acceptable we can consider adding another shortcut for actually-all channels.

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

c72d494 Move the rules command to the Information cog - Numerlor
aa5485b Remove the site help command - Numerlor
fc84bcf Move static content site commands to tags and r... - Numerlor
1f2b603 Use hardcoded rules url instead of constructing... - Numerlor
eb9e312 Merge pull request #1539 from Numerlor/site-tags - ChrisLovering

oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: reduce\-fuzzy\-match\-len
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: new\-filters
#
[python-discord/bot] New branch created: new\-filters
regal archBOT
regal archBOT
regal archBOT
#

Hmm, that sounds like a good idea, @Shom770 . But I feel like anyone could post images via CDN discord links in any channel, so I think it might be a good idea to not allow CDN Discord links at all. What do you think?

I don't like that idea personally, since that makes it harder to copy an image from one server to another (especially on mobile), which does happen rather often. Imo, this is really only a problem in channels where embedding permissions are not enabled.

Also, as far as...

#

Hmm, that sounds like a good idea, @Shom770 . But I feel like anyone could post images via CDN discord links in any channel, so I think it might be a good idea to not allow CDN Discord links at all. What do you think?

I don't like that idea personally, since that makes it harder to copy an image from one server to another (especially on mobile), which does happen rather often. Imo, this is really only a problem in channels where embedding permissions are not enabled.

I'm not for...

regal archBOT
regal archBOT
#

Description

2048 is a single-player game in which you must slide around tiles labelled with powers of 2 in four directions. When two tiles of the same value combine, they get added together, creating a new tile with double the value. After each successful move, a random tile either 2 or 4 is generated. The goal, as one might guess, is to reach a tile with a value of 2048. If at any point the user is unable to slide any tiles (the board ...

#

Description

Since we have migrated to discord v2.0a we have the new button interactions support, and since they allow making a 3*3 block (3 buttons per row in 3 rows) they would be a perfect fit in the tic toe game, using buttons would not only enrich the user experience, but it would also make them more efficient, currently, we need to wait for the emojis to be slowly added :(

Contributor Reference: https://www.reddit.com/r/discordapp/comments/nn733r/tic_tac_toe_using_discords_new_com...

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

This pull request adds a strip-gotcha tag, which represents the "gotcha" that a lot of people face with strip where they might expect it to remove a suffix/prefix and that it interprets its argument like a substring when it interprets it like a set of characters.

An example:

>>> "Monty Python".strip(" Python")
"M"
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#

Changes:

  • Add a better datetime converter that allows passing time in 12/24 hour format, the previous method of parsing start and end time is removed (8h, 16h, etc).
  • If your modpings schedule is over and you even had a modpings off which got over in modpings off time period, the role won't be added to you as your schedule is over.
  • Make modpings schedule message more verbose.

Fixes:

  • Make 16 hours as the max off time i.e. make 8 hours the minimum on time....
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#

Sentry Issue: BOT-1RD

TypeError: can't subtract offset-naive and offset-aware datetimes
  File "arrow/arrow.py", line 1576, in __rsub__
    return other - self._datetime
  File "bot/utils/time.py", line 71, in discord_timestamp
    timestamp = (timestamp - arrow.get(0)).total_seconds()
  File "bot/exts/moderation/modpings.py", line 236, in schedule_modpings
    f"{discord_timestamp(start, Tim...
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

Relevant Issues

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

Description

Added user's score to Candy command by adding one additional function/variable, and including verbose to the candy commands message. Invoker of candy command will now see their candy score.

Did you:

regal archBOT
#

Can someone supply more details about this? I don't have authorization to view the issue in Sentry. It would be helpful to have a steps-to-reproduce or something similar. Thanks!

Looking at the error, it mentions File "bot/exts/utilities/issues.py", line 142, in fetch_issues.

That leads me to this line
https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/utilities/issues.py#L142

So it seems pull_data here is the response from GitHub converted to a dict using `.jso...

regal archBOT
#

Relevant Issues

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

Description

Added a key check to the if statement in L142 so that pull_data["draft"] will only be checked if the key exists in the parsed json

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?
    -...
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/workers] branch deleted: feature/9/hastebin\-filter
#
jb3
[python-discord/workers] branch deleted: experiments/akarys/robots\.txt
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/site] New branch created: use\-new\-message\-view
odd spireBOT
regal archBOT
#

0150b4b Bump django from 3.0.14 to 3.1.13 - dependabot[bot]
3f4adf3 Migrate to generic JSONField - jchristgit
73bbd79 Update django-filter for new Django version - jchristgit
22f7e88 Merge branch 'main' into dependabot/pip/django-... - ChrisLovering
63c6c45 Merge pull request #630 from python-discord/dep... - jchristgit

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

@RohanJnr thanks for the docstring update.

There's currently an error in CI due to conflicting migrations:

CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0070_auto_20210519_0545, 0071_increase_message_content_4000 in api).
20
To fix them run 'python manage.py makemigrations --merge'

Could you look into fixing this?

It also seems the branch needs to be updated.

The fix for this was the 0072_merge migration I see co...

odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: use\-new\-message\-view
odd spireBOT
regal archBOT
#

That's not a big concern on this end (maybe that's what you were trying to state with "not related to NsJail"). Files would be sent by adding a list of key-value pairs to the request format, where the key is the file path and the value is the content. Since the request is in JSON, I suppose file content has to be encoded e.g. in base64. If anyone has better ideas, feel free to share.

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

Approval: #dev-contrib message

Enhances the regex of the token remover to use the same regex that discord itself uses, with a slight modification. The mfa section was removed, but depending on an updated #1421, may be implemented. Additionally, the sections were grouped to keep working with the current code.

I kept the existing validation to keep false positives at a minimum. The current code checks the user resol...

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

When running python -m snekbox 'print("hello world!")' --time_limit 0 (documented here) I get this error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/snekbox/snekbox/__main__.py", line 28, ...
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: fix\-message\-converter
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#

do we want to try and handle setting py_args from the command line too?

I'd like to, but I cannot think of a good way to do it. The only options I can think of are:

  1. Specify all the arguments as a quoted string
  2. Have some delimiter word/character between the nsjail and py arguments, then use that to split the unknown arguments list.

I think 1 seems a bit more intuitive and would be alright. We could add --time_limit as a separate shorthand argument if it's used most com...

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

I don't know if this issue is still relevant, when was the last time the API went down without the entire server going down? Regardless, the best solution today would probably be something to do with redis, Maybe a redis queue that we try to keep empty and add to if API requests fail. I don't think bypassing the API and going straight for the DB is very wise.

What happens when Redis goes down? Well first contact DevOps because something has gone horribly wrong if both site and redis ...

regal archBOT
#

Currently, the newlines rule triggers a ping to Moderators, deletes the offending message and also mutes the offending user.

This is commonly triggered by people seeking help, often in help channels or topical channels.

Let's discuss whether we can:

  • prevent bot from muting the user, instead have it reply with a reason for message deletion and a link to our pastebin service
  • not have the user muted
  • not ping Moderators
  • not relay to #mod-alerts
  • possibly still mute ...
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Sentry Issue: BOT-9M

AttributeError: 'NoneType' object has no attribute 'fetch_message'
  File "discord/client.py", line 351, in _run_event
    await coro(*args, **kwargs)
  File "bot/exts/moderation/modlog.py", line 732, in on_raw_message_edit
    message = await channel.fetch_message(event.message_id)

Unhandled exception in on_raw_message_edit.

This is caused by the on_raw_message_edi...

odd spireBOT
regal archBOT
#

Usually those updates happen for short durations, usually during times that aren't very high activity.

I'm not sure if the solution you're suggesting is different from the one I am or not. I'm not sure what "send what infractions it's taken" means in this context.

Ah, I was thinking about an edge case where the bot is rebooted while the database is unreachable, meaning that if a moderator used a tempban, the user would not have it scheduled anywhere to unban, for example.

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

Our !user command currently supports a messageID arg, and returns the user embed for that message's author. This can lead to some confusion when the user running the command doesn't know about this feature, and then tries to use that ID with another command that doesn't support it.

The proposed solution for this is to highlight when the user command is using a messageID, as this goes against expectations, in the embed title.

EG for this embed, the title would be **Chrisjl#2655 (From M...

oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: user\-improvement
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: revert\-metricity\-change
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: bsoyka/discordpy\-bots
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

Connected!

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#

From what I have collected, draft should always be returned in a valid response from the API. Therefore if draft was missing, it likely means the entire response was something unexpected (perhaps empty). So we could expect each one of these elifs to fail as well. It may be prudent to utilize a try-except here, or explicitly catch a missing key from any if-elif block. From what I can see, the current will just cause the error to occur on the first elif, since that key would probably be m...

oak estuaryBOT
regal archBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
oak estuaryBOT
regal archBOT
regal archBOT
#

If its malformed, we shouldn't be doing anything with the pull data. A solution would be to use a helper method to get the data, deal with possible ratelimits, and check for a 200 status code.

Most of the calls are deferred to a helper method with #778, but not all of them, unfortunately.

Additionally, this particular call to the api affecting this bug will be removed as a result of #968, as the data is already there with the initial issues api request.

The solution, if we are to im...

#

If its malformed, we shouldn't be doing anything with the pull data. A solution would be to use a helper method to get the data, deal with possible ratelimits, and check for a 200 status code.

Most of the calls are deferred to a helper method with #778, but not all of them, unfortunately.

Additionally, this particular call to the api affecting this bug will be removed as a result of #968, as the data is already there with the initial issues api request.

The solution, if we are to im...

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#

solves issue with adding decorator to the parent
which wouldn't apply to the children

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

Connected!

odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: include\-message\-in\-user\-embed
#

The purpose of the mentions rule is to catch people spamming user mentions, but message.mentions shows the user being replied to, if the reply is pinging, which is out of scope for what the rule is trying to catch.

The replies should be subtracted when counting the number of mentions, and messages with only a reply but no mentions should be removed from the logging.

odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: clean\_improvements
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/site] New branch created: revert\-metricity\-change
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

TBH We can have issue templates and still allow a user to not use the templates, so its very easy to have the best of both worlds.
https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser

You can encourage contributors to use issue templates by setting blank_issues_enabled to false. If you set blank_issues_enabled to true, people will have the option to open a blan...

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

I am extremely sorry to say but I currently have exams for a month due to which I will not be able to work on this. I had posted this sometime back when I had time but currently, my exams are right around the corner which is why I will not be able to work on this right now.

This can either be assigned to someone else or I can work on it from the 7th of January - whichever works (my exams end on the Jan 7th)

night lilyBOT
#
Sir Lancebot

Connected!

oak estuaryBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: better\-off\-topic\-tags
regal archBOT
odd spireBOT
regal archBOT
#

Amendment type

Content Update

Content type

Tag

Please provide the location of the content

!ot

What amendment do you think should be made to this content, and why?

!ot is very often used to re-direct users to off-topic channels when their discussions are out of scope for whatever channel they are in. Currently the channels in the embed are listed in numerical order: 0, 1, 2.

Users then head over to #ot0 and continue their conversation, often while there are exist...

#

Closes #2018

As [discussed](#organisation message) in staff channels, we are modifying the original !ot embed to only list #ot2, since the tag's primary use is to redirect users to an off-topic channel. By only listing #ot2 the hope is that there will be less interruptions to the very traffic-heavy #ot0 channel.

![image](https://user-images.githubusercontent.com/75038675/146618062-3ffaa9e5-50c0-4f3c-8d72-681ca2e55801.png...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

to quote kat:

I think it's shown a beneficial change, even from the perspective of people new to our server and off topics. Rather than posting in a busy channel and getting quickly drowned out, their message is now given more space and isn't likely to interrupt and ongoing convo.
Looking at percentages of where users will post first messages in off-topic:
ot0: 76% -> 71%
ot1: 13.5% -> 14.22%
ot2: 10.22% -> 14.67%
ot2 even had more messages posted it than ot1 for this latest stat pu...

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

Looks good! I would suggest committing Dawn's suggestion because I like the wording of "often", but it's not a blocker so I'm going to go ahead an approve this.

Otherwise, as a note, this does mean that !off-topic will fuzzy-match to the longer embed and not !ot, which may at first seem like inconsistent behavior. But actually, no one really uses the full !off-topic tag invocation. The usage for the past month is almost entirely !ot, so I'm fully onboard with changing the tag nam...

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

Relevant Issues

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

Description

Created an "epoch" command which allows you to convert a word date and time to an epoch (Unix timestamp). The parsing for relative dates is done with arrow.dehumanize, absolute dates are parsed with dateutil.parser.

If the entered string is parsed successfully, the epoch is sent to chat along with a drop-down interaction which allows you to...

odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: better\-off\-topic\-tags
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

Currently, a tag is directly returned when it has an exact match even when there are matched fuzzy alternatives, but this does not attempt the exact match on only the name if the tag has a group. This causes issues if the user invokes a tag with some text after it which is considered as the tag's name.

The PR adds an additional search with only the tag's name without a group when the first lookup of the original identifier fails

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

A command that will fetch information about a certain day (can be filtered by the year too) for AOC puzzles.

Reasoning

I've seen a lot of people including myself have trouble remembering what day had what. Especially with puzzles from past years when people didn't participate, you have to look up the day every time to see what happened on that day.

In addition, being able to pull up the day from Discord rather than exiting into your browser to search up the day every...

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

Connected!

regal archBOT
#

I just started getting the same error about type descriptors in my local branch which is based off master. I'm not sure what triggered it. It seems to only happen when I run it through docker-compose up. If I use pipenv run devshand thenpython -m snekbox`, it works.

Will you be able to finish the PR soon? Let's just agree to not bother renaming the file since it breaks things.


Also, please target the current ref in the master branch rather than 3.0. Since 3.0, a feature has...

regal archBOT
#

By default, Docker uses a private cgroup namespace when the host system uses cgroupv2. This results in the root cgroup within the container having an empty cgroup.subtree_control, which means the child cgroups NsJail creates will not have any controllers enabled. Attempting to write to the root cgroup.subtree_control results in a "device or resource busy" error, which seems to be because the cgroup already has processes in it (it's the root cgroup, after all). However, the exact cause for...

regal archBOT
#

Description

I would like to make a Sudoku game command for Lancebot. Here are the rules for playing Sudoku, in case you don't know: https://sudoku.com/how-to-play/sudoku-rules-for-complete-beginners/

Reasoning

Sudoku is one of the most popular puzzle games in the world currently and it provides a good challenge for your brain.

Proposed Implementation

  • The bot will print an embed with a code block in it that has the Sudoku board, like so:
    ![image](https://user-images....
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

As we were talking about on discord, by reducing the size to a 4x4, we could use buttons for the user interface instead Although, a 4x4 seems kind of small for a sudoku game, it should be fun enough.

However, if using buttons, it would not be possible to expand it any larger, so it would be a tradeoff that we would need to make.

I think 4x4 should be fine with buttons. Not sure what you mean by "tradeoff" @onerandomusername

odd spireBOT
regal archBOT
#

Looks like this is caused by how we're loading extensions, if the source cog is loaded before the tags cog, then the TagIdentifier class used by source is different to the one in the tags cog because the tag module is reloaded when the extension is loaded.

Although when it does work it uses the wrong path so that should be fixed in the source cog at L68

Yeah, I moved TagIdentifier to a separate file, and that it solves the problem.

#

Looks like this is caused by how we're loading extensions, if the source cog is loaded before the tags cog, then the TagIdentifier class used by source is different to the one in the tags cog because the tag module is reloaded when the extension is loaded.
Although when it does work it uses the wrong path so that should be fixed in the source cog at L68

Yeah, I moved TagIdentifier to a separate file, and that it solves the problem.

While that does solve the problem, I fee...

#

While that does solve the problem, I feel like it's more of a bandaid solution.
A similar error is likely to occur for other extensions if they end up depending on each other so I think something more robust like making loading extensions respect already imported modules instead of overwiting them would be better here. Or at least making the extensions order deterministic so the errors caused by it are not intermittent.

We shouldn't be importing from extensions since reload and loadin...

#

Given we can only have 5x5 buttons in total as discord limitation, if we use buttons we cannot ever grow beyond that size.

Ah, I see. To be honest, now that I think about this, I feel like 4x4 would a bit too easy. Another thought I had was to make this game thread based so it's not taking up the entire channel but they haven't been enabled on PyDis yet, so I'm not sure if that's possible, at least without making this issue stalled.

regal archBOT
#

UPDATE: after futher invesigation, most of the above imports are being used for type hinting, and the cogs do use get_cog

There's a few cases where I found the bot imports cogs from other modules and using them, which should be updated to use get_cog
https://github.com/python-discord/bot/blob/c4837978399ce42b7073e17bae7e30b7a43d088d/bot/exts/moderation/watchchannels/_watchchannel.py#L16

Most of the above imports could be done up like the below:
https://github.com/python-discord/bot/...

regal archBOT
regal archBOT
#
jb3
[python-discord/snekbox] branch deleted: fix\-tests\-protobuf
regal archBOT
regal archBOT
#

Description

This issue proposes to add more topics (number currently undecided, perhaps a few dozen) to our two .yaml files containing topic starters.

Reasoning

I've seen quite some people complaining about how the topics aren't fresh anymore and have appeared several times already. This is due to our limited quantity of them. I believe adding more topics can benefit the community, especially when sometimes we need to get a derailed conversation back on topic.

Proposed Impl...

regal archBOT
#
jb3
[python-discord/site] branch deleted: revert\-metricity\-change
odd spireBOT
regal archBOT
#

Its not possible right now to use threads, no. I do know that you would be able to get some nice colours out of the codeblock by setting the codeblock language.

The main reason I was on buttons is because the suggested input does not seem the most user-friendly--but only if there's a better option.

r[insert row #]c[insert column #]v[insert # (value)]

This looks complicated to me, although its probably the best way to input a number. We maybe could try something with selects and but...

#

About the random titles, that was something that Shom770 pointed out in a review so I added that. It sounds like this is a standard convention for similar projects so I decided to commit that suggestion. If you think I should not have it, I think it's fine either way.

Well, we should keep them then, but I think that message should mention the user at minimum, and remove the please try again later :D

odd spireBOT
regal archBOT
#

About the random titles, that was something that Shom770 pointed out in a review so I added that. It sounds like this is a standard convention for similar projects so I decided to commit that suggestion. If you think I should not have it, I think it's fine either way.

Well, we should keep them then, but I think that message should mention the user at minimum, and remove the please try again later :D

...

regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/snekbox] New branch created: feat/nsjail/102/cgroupv2
regal archBOT
#

Its not possible right now to use threads, no. I do know that you would be able to get some nice colours out of the codeblock by setting the codeblock language.

The main reason I was on buttons is because the suggested input does not seem the most user-friendly--but only if there's a better option.

r[insert row #]c[insert column #]v[insert # (value)]

This looks complicated to me, although its probably the best way to input a number. We maybe could try something with s...

odd spireBOT
regal archBOT
#

We do go through the topic suggestions that are linked when you fire the command every once in a while.

I believe that it's time I should go through them again. Thank you for bringing this up.

After I'm done going through the suggested topics, I'll create a PR for the new listing. I'll leave it up for a bit so I can get a good amount of suggestions.

If you have a bunch of topics in mind, feel free to put them in a comment within this issue.

There was a discussion on ...

odd spireBOT
regal archBOT
#

This issue proposes the addition of a .twemoji command. This will be useful for viewing and downloading Twemojis (the default emojis on Discord, which we base a lot of our branding on).

Proposed Implementation

Invocation

An invocation of the command could look something like this. These are all common formats for specifying an emoji. However, I might limit the available formats, in order to make things simpler.

.twemoji ๐Ÿ˜
.twemoji \U0001f9d0
.twemoji 1f9d0
.twemoji...
regal archBOT
#
[python-discord/metricity] New branch created: message\-sync\-command
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

Sentry Issue: BOT-2JN

TypeError: delete() missing 1 required positional argument: 'package'
  File "discord/ext/commands/core.py", line 167, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot/exts/info/doc/_cog.py", line 467, in clear_cache_command
    await self.item_fetcher.stale_inventory_notifier.symbol_counter.delete()
  File "async_rediscache/types/base.py", line 243, in wrapp...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/metricity] New branch created: fix\-thread\-update\-event
#
[python-discord/metricity] branch deleted: fix\-thread\-update\-event
regal archBOT
oak estuaryBOT
odd spireBOT
oak estuaryBOT
regal archBOT
regal archBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

https://github.com/python-discord/snekbox-deploy has scripts to deploy Snekbox onto a Debian VM. It was originally created because we thought that #126 could only be fixed by using --cgroupns host, which is not configurable on our managed k8s cluster. While a proper fix has been found for that issue, there may still be merit to using this scripts to move away from k8s. It could let us finally use gVisor.

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

I'm thinking that's the input style we should use for now unless someone has a really really really great fantastic user input idea

Alright, sounds good. I mean, the only other thing I can think of (and you mentioned this yourself I believe) is that I could use dropdowns. Do you think I should do that or just stick with the original proposal? @onerandomusername

regal archBOT
#

Its not possible right now to use threads, no. I do know that you would be able to get some nice colours out of the codeblock by setting the codeblock language.
The main reason I was on buttons is because the suggested input does not seem the most user-friendly--but only if there's a better option.

r[insert row #]c[insert column #]v[insert # (value)]

This looks complicated to me, although its probably the best way to input a number. We maybe could try somethin...

regal archBOT
#
[python-discord/sir-lancebot] New branch created: twemoji
regal archBOT
#

Relevant Issues

Closes #987.

Description

Please refer to #987 for a more detailed explanation of the command.

Example usage

The following screenshots showcase different formats that can be used to indicate what twemoji should be displayed.

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] Re...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

I edited your description so you can see what I meant.

Anyway, notice that at the bottom it says one of the checks failed. Let me give you a run down of how to diagnose this. If you click on "Details" to the left of "Lint, Test, Build, Push / lint-test-build-push (pull_request)", it'll take you to some logs which explain why the check failed.

bild

Once there, expand the "Run pre-c...

night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Are you sure persistence is useful here? the bot restarts once or twice a day on average anyway. You could just use an LRU cache instead (we have a utility LRU cache for async functions).

Furthermore, I might be missing something, but I don't see where you're clearing the cache of old domains. I only see deletions when you hit an expired URL (for which I'd argue that you actually want to keep it since the URL is relevant again).

Also, are you sure this should be a screaming snake case? ๐Ÿ˜…

#

At the moment certain URL shorteners are filtered, deleted, and cause an alert regardless of where they lead. We might not have blacklisted the destination, but that doesn't mean an alert shouldn't be made for the domain (with a ping). I think it will also be useful to show the destination as above even when we don't blacklist it. We already did the work of getting that information at this point.

#

Any blacklisted redirect domains will send an alert no matter what. The only thing that changes is the mod ping, because I don't think we need to alert whenever someone uses a link shortener.

The reason the link isn't there is to avoid making the embed larger than needed, and let mods run the unfurl command if they want that info. If we want to add it, it'll be pretty easy.

regal archBOT
#

I donโ€™t think thereโ€™s much harm to doing it in redis

The harm is that I think it doesn't help much while complicating the code. When you need to manually manage insertions and deletions, make sure it's occasionally vacuumed, and write separate tests for it, just slapping an LRU cache decorator on unfurl_url seems appealing to me.

regal archBOT
regal archBOT
#

Bunch of suggestions for doctsrings, comments, and log messages. Tried to make it easy for you by including the actual diff, so you can easily commit them.

I think returning None when something fails isn't good design for this. It would make more sense to raise an exception and let it propagate to the caller of unfurl_url. An exception is more explicit and in some sense less error-prone than returning None (since one can forget to check for None and get a TypeError/AttributeError). Inste...

regal archBOT
#

It's actually possible to make the distinction. When the unfurl succeeds or when there are too many redirects, return as normal. When there is an error, raise an actual error and the LRU cache won't be able to cache the result.

That said one can argue that we actually do want to cache failures because if we're bombarded with a redirect in a short amount of time, and the first try fails, it's reasonable to assume the rest will too. It's an unlikely scenario, but then again that's one of the...

#

I'm looking at unfurl_url and I'm not sure what you mean. The only scenario I see where we might want to not cache is for a 400. For other cases I think it can be assumed that the redirect chain is unlikely to change in the near future (in which the cached result will be relevant). And in any case, the failure reason can be the exception message and retrieved in the except clause of the caller.

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

Ok, so based off [this discussion](#dev-contrib message) (starts there), I have made my final (hopefully) decisions as to how I (and others) want this implemented.

  • Instead of a 4x4 (or 9x9 for that matter), I will be making a 6x6 grid generator instead
  • I will not be adding the embed that says whether a user's input is right or wrong
  • I will also be alphabetizing each column and numbering each row as shown in the attach...
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
jb3
[python-discord/forms-frontend] New branch created: jb3/block\-submit\-missing\-oauth2
#
jb3
[python-discord/forms-frontend] branch deleted: jb3/block\-submit\-missing\-oauth2
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

The behaviour of the PATCH/PUT method is a little unexpected. You can send a request to /api/bot/off-topic-channel-names/existing-name with the body {"name": "another-one"}... which causes another off-topic name to be created.

That said when using PATCH correctly it worked nicely and made the names no longer show up when specifying ?active=true (as expected from the changes by this PR).