#dev-log

1 messages · Page 97 of 1

odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

What you say makes sense, but in practice from the way people use these guides I think mentioning the same thing in different places helps. Even if we don't explain how to use git all over again, saying that the repo should be cloned as the first step (with a link to ./contributing) makes sense to me here. It also makes sense in terms of continuity since later in the page it says "You now have both the bot's code and a server to run it on". A person going over this guide might think "wait, wh...

#
[python-discord/bot-core] New branch created: fix\-version\-number
#
[python-discord/site] New branch created: BIG\-SOLIDUS\-MAKETH
#
[python-discord/bot] New branch created: BIG\-SOLIDUS\-MAKETH2
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: slowmode/add\-better\-thread\-support
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot-core] branch deleted: fix\-version\-number
regal archBOT
#
[python-discord/bot] New branch created: mbaruh/ext\_fix
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: BIG\-SOLIDUS\-MAKETH2
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: mbaruh/modpings\-cache
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: BIG\-SOLIDUS
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/site] New branch created: order\-log\-messages
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Like this, split into multiple lines capped at ~120 characters:

- Heroku has minimal system dependency control. If any of your Python requirements need C bindings (such as PyNaCl
  binding to libsodium, or lxml binding to libxml), they are unlikely to function properly, if at all, in a native
  environment. As such, you often need to resort to adding third-party buildpacks to facilitate otherwise normal
  CPython extension functionality. (This is the reason why voice doesn'...
regal archBOT
regal archBOT
#

We already use them for <end timestamp>, so you mean for <time remaining> as well?

I feel that's less useful. In the beginning it will say "in 1 day" and then as time goes by it will say "in X hours" and then as more time goes on it will say "X [units] ago."

I like the duration being just normal static text, I just wish it reflected the actual duration written in the infraction by the moderator (or the bot), rather than a calculation of how much time is remaining (I assume that's what i...

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

To give some context, the duration in parentheses is calculated after the infraction is added to the database. In a very rare case we had some latency and a 10 minute mute was applied 6 minutes after it was added to the database. In that case we were told the mute will last 4 minutes, which is correct.

That said, it doesn't seem like a very compelling reason to keep this behavior. I'm ok with just using the supplied duration as-is, or maybe we could add a check to make sure the delta is no...

regal archBOT
#

The user syncer was blocking the startup of the sync cog due to having to perform thousands of pointless member fetch requests. This speeds up that process b:

  • Increasing the probability that the cache is up-to-date using Guild.chunked, and assuming that any found cache data is correct
  • Limiting the fetches to members who were in the guild during the previous sync only, meaning we don't fetch a bunch of outdated members
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Thank you for the PR!

We should add YAML frontmatter and I don't think we should use markdown headers for the text. As for frontmatter, see this PR for an example. How about we start with something like this:

---
title: Custom Help Command
description: "Overwrite discord.py's help command to implement custom functionality"
---

First,  a [basic walkthrough](https://gist.github.com/InterStella0/b78488fb28cadf279df...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Problem 1

Suggestion: A point-based system with milestone roles

This has been discussed a few times in the past, and the general consensus is that this comes with a few [issues](#community-meta message):

Ideas for gamifying the help system have been proposed before, but that's not something we're currently interested in. Making people rely on a points system for gratification, possibly making people pressure others to...

regal archBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/bot-core] New branch created: actually\-use\-statsd\_url
#
[python-discord/bot-core] branch deleted: actually\-use\-statsd\_url
#
[python-discord/bot] New branch created: bump\-bot\-base
odd spireBOT
regal archBOT
#

I think the big impact would primarily be on moderation tools. More specifically, the user embed would be off.

There are some other operations that would have problems if the cache was off (banning would raise an error for instance), but that is only in the case where the user is off the guild, but in the cache. I don't think that's an anticipated scenario, the opposite is more likely.

regal archBOT
#
[python-discord/bot] branch deleted: mbaruh/ext\_fix
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: speedup\-syncing
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot-core] New branch created: bump\-d\.py
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: bump\-bot\-base
oak estuaryBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: bookmarking\-enhancements
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: bookmark\-enhancements
#

Relevant Issues

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

Description

This simplifies the bookmark implementation, and adds the ability to delete bookmarks in DMs.

To reduce complexity, the delete bookmark functionality actually allows users to delete any sir-lancebot message within their own DMs, and is labeled as such.

Did you:

odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: chunnk\-guild\-if\-not\-chunked
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: rewrite
#
[python-discord/site] branch deleted: rewrite
#
[python-discord/site] New branch created: rewrite
#
[python-discord/site] branch deleted: rewrite
#
[python-discord/site] New branch created: rewrite
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: logs\-force\-word\-wrap
odd spireBOT
regal archBOT
#
[python-discord/branding] New branch created: allow\-more\-banners
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: logs\-force\-word\-wrap
#

This PR adds support for having multiple banners which rotate in a single event, much like icons currently do. See python-discord/branding#179 for the relevant changes there.

There are almost no code changes here as most of the required logic was already implemented, and was standardized to work for both icons and banners. A majority of the diff is renaming "icon" to "asset" and adding an asset type argument to the functions.

For testing purposes, make sure to create an API token as you...

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

Sentry Issue: BOT-33Z

AttributeError: __enter__
  File "discord/ext/commands/core.py", line 200, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot/utils/lock.py", line 108, in wrapper
    relative_url_path, _, symbol_id = relative_doc_url.partition("#")
  File "bot/exts/info/doc/_cog.py", line 434, in refresh_command
    with ctx.typing():

Error executing command invoked by joe#60...
#
[python-discord/bot] New branch created: use\-async\-with\-typing
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

What's the problem?

Some of the events we've got branding for, such as Eid al-Fitr and Holi, fall on different dates every year.

This means we manually update the start and end dates for these in order for the events to happen at the right time of year.

How can we solve that?

One approach is to leverage GitHub Actions to create an automatic pull request with the required changes every year.

For example, on January 1, a Python Discord GitHub App could open a pull request to th...

regal archBOT
#
[Eid al-Fitr](https://en.wikipedia.org/wiki/Eid_al-Fitr) is celebrated after a month-long dawn-to-sunset fasting of Ramadan. It falls on the first day of [Shawwal](https://en.wikipedia.org/wiki/Shawwal) in the Islamic calendar, which will change from year to year in the Gregorian calendar depending on when the new moon is sighted. The duration of this celebration also varies from culture to culture.

During Eid, Muslims will feast on delicious foods, perform special prayers, ...
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: json\-is\-not\-good\-database
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#

As someone who spends a decent amount of time helping in the help channels, I often find people running into the issue of installing x library using pip but when they run import x they get the error ModuleNotFoundError: No module named 'x' from my experiences this is 99.9% of the time caused by someone using a virtual environment, and installing the library to the wrong environment or not running their program in that environment.

I think that a command that either links them to a pa...

regal archBOT
#

I'm not completely against this, but I think there are a few fairly major issues, such as:

  • I'm not sure how accurate this could be. False positives would be pretty annoying and could just end up making the channel even more cluttered.
  • Sometimes pygen is a fine place to ask a question. It's not really clear what it's purpose would be otherwise (although yes, a topical channel would usually be preferred).
  • People will likely ignore it anyway - it's hard enough for a human to redirect ...
regal archBOT
#

I think the point griff made about getting your messages deleted is a dealbreaker, so I don't think this is something we'll want to do at the moment.

I don't think the opt-in proposal is great as it would not be clear who the message was initially from (we could add it in the message, but i'd imagine it would still confuse some people, and breaks some other things like being able to mention the user). I don't really see this going anywhere so i'll close this issue.

regal archBOT
#

This seems like a fair suggestion to me, although the bot should tell them why the message was deleted. I think in this case it might be best to just post a really short message where it happened, otherwise they might not see it. Something like:
@user You are not allowed to post discord cdn links in this channel

Thoughts?

Lol I completely forgot of this issue's existence, it's been 5 months 🤣

Yeah sending a message like that would be a good idea for sure.

Hmm, that sounds like...

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

I think this idea may be a bit too restrictive. While yes some users use cdn links to post inappropriate images, that isn't their only use case.

Though embed permissions are disabled in python-general, occasionally users will post links to images, which while not often ideal for getting code help, can be useful in sharing images of their IDE or visual output of their code. These are a few of the examples I observed after searching python-general for such messages.

I don't think there's...

regal archBOT
#

I think this idea may be a bit too restrictive. While yes some users use cdn links to post inappropriate images, that isn't their only use case.

Though embed permissions are disabled in python-general, occasionally users will post links to images, which while not often ideal for getting code help, can be useful in sharing images of their IDE or visual output of their code. These are a few of the examples I observed after searching python-general for such messages.

I don't think t...

regal archBOT
regal archBOT
regal archBOT
#

This will actually only sleep for 20s before attempting chunking. (there are 3 checks with 10s wait between then but the first one is at 0s).

Would it also be worth logging some sort of exception if the guild doesn't end up chunked? I don't think there is a reason it shouldn't eventually end up chunked, only that it might take a long time to do so. If it not chunking itself is a common occurence we'd probably want to know about it as it would cause problems elsewhere in the bot.

Also do...

regal archBOT
#

This seems alright but i'm not 100% sure on the changes to the set function. I may just be misunderstanding though.

If set was called after a bot restart with an hour until a key expired, the expiry would not be changed but the _set_expires value would be set to a week. If set was called a day later, after the key had expired, the key would be set but no expiry would be set. I'm not sure if this would happen with the current workings of doc but if it didn't i'm not sure how the c...

regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: id\-in\-delete\-logs
odd spireBOT
regal archBOT
regal archBOT
#

695e903 Output max 10 bumped threads on list - ChrisLovering
90d4f90 Use site api over redis for thread bumps - ChrisLovering
a196ec9 Only call unarchive threads if there are thread... - ChrisLovering
930bf0f Only suppress 404s from site when checking for ... - ChrisLovering
ce10a11 Merge branch 'main' into improve-thread-bump - wookie184

#
[python-discord/bot] branch deleted: improve\-thread\-bump
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: remove\-redis\-threadbumper
odd spireBOT
odd spireBOT
regal archBOT
#

@wookie184 I considered it, but after deliberating on the matter for a while, I didn't think the added complexity of trying to coordinate both was worth the payoff, especially considering the tight deadline we're trying to finish this in.

It can be added in the future, I imagine we can link them based off their name, but more logic would be necessary to properly handle rotating them at the same time (and certain edge cases such as having 2 banners, and 1 icon).

regal archBOT
#

Deleting bookmarks doesn't seem to work for me. When I try it in DMs I get told I can only use it in the bot-commands channel and when I try it in the bot-commands channel I get told i'm not authorised to use it. Could this be because there is a guild_only decorator on the bookmark group and a dm_only decorator on the delete command? Or do I have something set up wrong locally?

I get a similar thing with .help. Ideally I think help should be able to be used anywhere for all c...

regal archBOT
#
[python-discord/sir-lancebot] New branch created: bookmarking\-enhancements
#
[python-discord/sir-lancebot] branch deleted: bookmarking\-enhancements
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

This will actually only sleep for 20s before attempting chunking. (there are 3 checks with 10s wait between then but the first one is at 0s).

Ah good point, I'll update PR title, not a big issue though.

Would it also be worth logging some sort of exception if the guild doesn't end up chunked? I don't think there is a reason it shouldn't eventually end up chunked, only that it might take a long time to do so

Guild.chunk() is blocking until the guild is successfully chunked. I cann...

regal archBOT
#

Sentry Issue: BOT-343

ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('http://site.default.svc.cluster.local/api/bot/bumped-threads/960577148358381599')
  File "discord/client.py", line 375, in _run_event
    await coro(*args, **kwargs)
  File "bot/exts/utils/thread_bumper.py", line 141, in on_thread_update
    await self.bot.api_client.get(f"{THREAD_...
#
[python-discord/bot] New branch created: fix\-get\-single\-bumped\-thread
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: chunnk\-guild\-if\-not\-chunked
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: mbaruh/modpings\-cache
odd spireBOT
oak estuaryBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: improve\-pastebin\-error\-handling
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: update\-pep\-cog
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

I think it would make sense for the embed that is sent when you try to bookmark with DM's off to auto-delete, just like the one that says "React with 📌 to receive your own bookmark..."
image

Reasoning

It's kinda hard to explain, to me it just doesn't make sense for just the "React with 📌 to receive your own bookmark..." message to auto-delete when you run .bm...

#

Description

I think it would be nice to have some topics for the new #media-processing channel created 5/3/2022 for the .topic command.

Reasoning

Well, all the other topical channels have topics so it only makes sense to have some for this channel as well.

Proposed Implementation

Some topics I have in mind currently:

  • Which Python package is commonly used for image manipulation?
  • What is image processing how can Python be used for it?
  • What are some ways you co...
odd spireBOT
regal archBOT
#

I'm completely new to python and so far I've been enjoying my time with this bot in the discord server. But I have many things to do and if I send in the server it looks spammy. So I want to get a copy of this bot in my discord server(only me though) so I can use perfectly. Can I get help hosting the bot please

regal archBOT
regal archBOT
#

Follow up/re-run of that same query above as of today, May 4 2022:

for members joined in the last 30 days

no off topic activity: 17,676
ot0: 155
ot1: 28
ot2: 38

I've occasionally re-ran this query a few times throughout the year and if memory servers correctly, ot2 ranked consistently above ot1 for first off-topic channel, imo showing a slight but definitive effect of hard-coding the !ot embed to only show ot2.

regal archBOT
regal archBOT
regal archBOT
#

Relevant Issues

https://github.com/python-discord/sir-lancebot/issues/1050#issuecomment-1116368854

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

Description

replace image_url with source_image_url in spookygif.py

Did you:

Yes

  • [ 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 discus...
odd spireBOT
regal archBOT
#

The !clean command has multiple modes, and it can be confusing to use.

  • !clean bots mentions a traverse argument that doesn't exist.
  • !clean regex has an example of formatting the regex pattern that I think needs more escape characters.
  • Most of the commands can take either a message or a time limit. They should make it clear that providing a message limits the search to its channel, and to clean across channels you need to provide a time limit instead.
regal archBOT
#
[python-discord/forms-frontend] New branch created: backend\-command
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Tested and all seems good to go.

Was trying to think of a good way of handling matching banners and icons. Had one idea for a layout:

icons
  - icon_green.png
  - icon_red.png
banners
  - banner_green.png
  - banner_red.png

To get the assets to use, we'd select a random icon, and then select a random banner in the same group (group is what's after the _, or something like that). This would be pretty flexible as you can easily have one icon with many banners or vice...

#

@wookie184 That's a pretty good system provided you don't try to deal with combinations of groups, and no groups, such as:

icons:
icon_green.png
icon_red.png

banners:
banner_green.png
banner_red.png
banner_other.png

In this case, you have the following problem:

Day 1: Green icon, green banner
Day 2: Red icon, red banner
Day 3: Other banner, ?? icon.

You end up either having to repeat an icon two days in a row, cause a mismatch in the banners and icons, or ...

odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

We have events that don’t have as many banners as icons rather. This is the case with all events that have more than one icon currently, because nothing else is supported yet.

That wouldn't be an issue with what I am proposing. For example, if you had 2 icons and 1 banner, you'd just put them all in a single group. A random icon would be chosen, and a random banner from the corresponding group is chosen (in this case always the same one).

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

Connected!

odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: MrHemlock\-patch\-1
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: MrHemlock\-patch\-1
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

There are two issues here. Firstly, the reason the request fails is that the command fetches a random page up to the total number of pages
https://github.com/python-discord/sir-lancebot/blob/6609ceab1600ae5d08c2614f5a0f994b86f8ba5e/bot/exts/fun/movie.py#L88-L89
However the page parameter is documented as only allowing a maximum page numer of 1000 (https://developers.themoviedb.org/3/discover/movie-discover). You can replicate this by running .movies Drama (may need to run it a few times i...

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

Not sure if it helps, but here are a few additional ideas:

  • Any interesting progress to share?
  • Any cool trick or optimization you are proud of?
  • What is your favorite media processing related algorithm?
  • What is the worst outcome for your generation or processing?
  • What is the most surprising result you got?
  • What is your most advanced media processing related achievement?
  • Do you use a lot of math in your media processing related projects?
  • Can a computer truly generate ar...
regal archBOT
regal archBOT
regal archBOT
#

Hello!
Sorry I am having trouble getting the bot to start, I believe I followed all the instructions. Here is the traceback:

Found config.yml` file, loading constants from it.
2022-05-11 10:47:25 | botcore.utils._monkey_patches | DEBUG | Patching send_typing, which should fix things breaking when Discord disables typing events. Stay safe!
2022-05-11 10:47:25 | discord.client | WARNING | PyNaCl is not installed, voice will NOT be supported
Traceback (most recent call last):
File "/...

regal archBOT
#

Thanks for writing that up, I like the "Define each ext/cog" approach, although I'm not sure the precommand/postcommand hooks would add anything we can't do by overloading. Overloading would also give us more flexibility and let us reuse some of the existing code flow.

For example, to add the tag behaviour for bot, i'd propose that the subclass might look something like this. We'd overload each method that needs tag specific behaviour and implement the tag behaviour before delegating t...

regal archBOT
regal archBOT
#

Ah, so overriding works like that? I was writing both scenarios, where it doesn't correctly override and what solutions could be for that case.

Ooh, sorry, yeah. I didn't read what you wrote properly. I just tested and it seems to work how we'd want it to, i.e.

class A(Cog):
    @command()
    async def test(self, ctx):
        print("Test called")

class B(A):
    @command()
    async def test(self, ctx):
        print("Subclass test called")

bot.add_cog(B())
```...
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: fix\-multislash\-invites
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
#

The proposal is to add a plug-in with a command for searching snippets.

This would be a quality-of-life improvement, as currently you have to try different snippets manually to find the right one.

Example:

?snippetsearch appeal

Result: A paginated list of snippets containing the word "appeal" or a close match. The full raw snippet content would be included in the output.

regal archBOT
#
[python-discord/modmail-plugins] New branch created: snippet\-search
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

I think it would make sense to review the current questions we have in the py_topics.yaml file and make appropriate additions/corrections.

Reasoning

I think that the .topic command is really cool and engages members more in the topical channels as well as py-gen. I don't check those channels often, but from what I've seen, .topic is used quite frequently so I thi...

regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: id\-in\-delete\-logs
odd spireBOT
regal archBOT
regal archBOT
#

Let's start with the ones that don't already have topics.

For #algos-and-data-structs:

  • What is a good algorithm that you know in Python? (might need to be reworded, that sounds a bit weird)
  • What are some advantages of NumPy arrays over Python lists?
  • What do you know and/or understand about inheritance in Python?
  • What are some benefits of modules in Python?

For #c-extenstions:

  • What is a good C extension you would recommend?
  • How would you go about coding your own C exten...
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: fix\-get\-single\-bumped\-thread
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

40bb274 Preliminary structure - camcaswell
92b1f70 Move Contributors role info to the Roles page - camcaswell
0de454f Remove forking and cloning sections in set-up g... - camcaswell
36b43f9 Add guide for pull requests and reviews - camcaswell
d198b3e Split up Supplemental Info and touch up Contrib... - camcaswell

odd spireBOT
regal archBOT
#

Description

I'd like amsmath to be included in the LaTeX command for Sir Lancebot.

Reasoning

Amsmath is a widely used package for things such as including text in equations or aligning multiple equations. Its absence has long been a thorn in my side, and an extremely annoying one at times.

Proposed Implementation

The amsmath package should be included in the default template, so it gets imported for every LaTeX command run.

Would you like to implement this yourse...

regal archBOT
#

Relevant Issues

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

Description

This PR includes the amsmath in the default LaTeX template using \usepackage{amsmath} so that people can use Amsmath commands in the .latex command.

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

Also, maximum page number doesn't seem to be 1000 (though it is documented as such), but 500?

curl "https://api.themoviedb.org/3/discover/movie?api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&language=en-US&sort_by=popularity.desc&include_adult=false&include_video=false&page=999&with_genres=18"

Response
Status code: 422

{
  "errors": [
    "page must be less than or equal to 500"
  ]
}

I'm guessing this is because I'm a new user?

regal archBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: bump\-debug\-to\-error
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: correct\-exception
odd spireBOT
regal archBOT
#

Traced it back and the point it gets the wrong type seems to be here:
https://github.com/Rapptz/discord.py/blob/7905d63f7c988640a0848cb2a26c8dc3c3eaa862/discord/http.py#L100-L109

(called after the request sent here)
https://github.com/Rapptz/discord.py/blob/93e1ff5f074c4a2a65c48e7ca006d0f6b2eb4124/discord/http.py#L440-L444

What I can see seems to suggest discord is responding with a 2xx status code with no content (sentry shows data is an empty string), Guessing this may be an API e...

regal archBOT
regal archBOT
regal archBOT
#

In case this hasn't been considered already, I think it would also be nice to be able to delete the embed with the issues/PR's if you type the wrong number by mistake. Or possibly a better idea is to have an edit listener so if you typed sir-lancebot#654 but you meant to type sir-lancebot#653, you could edit the message to say sir-lancebot#653 and that would automatically edit the embed with the new issue number.

regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-tag\-stats
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

This should address the suggestions in issue #2170.

I have removed the obsolete description about the traverse argument in the clean bots subcommand and fixed as well as added to the description of the clean regex subcommand.

I also improved the explanations for the message or timelimit argument and their relation to the channel argument across all clean subcommands.

odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: Log\-more\-data\-on\-failed\-clean
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot-core] New branch created: bump\-d\.py
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: allow\-latex\-in\-data\-science
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: allow\-latex\-in\-data\-science
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

What I have currently, based on @Qwerty-133's idea. I think this probably the neatest way, given we already have some custom behaviour here.

--- a/bot/exts/backend/error_handler.py
+++ b/bot/exts/backend/error_handler.py
@@ -65,7 +65,11 @@ class ErrorHandler(Cog):
         if isinstance(e, errors.CommandNotFound) and not getattr(ctx, "invoked_from_error_handler", False):
             if await self.try_silence(ctx):
                 return
-            await self.try_get_tag(ct...
#

I think this bit is a bit wordier than it needs to be, I think something like this would suffice (note backticks can be escaped with \):

        The `regex` pattern must be enclosed in backticks (e.g. \`[0-9]\`). 
        If it contains a space it must also be enclosed in double quotes (e.g. "\`test [0-9]\`").

image

I'm not exactly sure what change the original issue was...

regal archBOT
#
[python-discord/bot] branch deleted: remove\-redis\-threadbumper
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: correct\-exception
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

The problem is that the intent seems to be to show how to write the regex part of the command, e.g. must be enclosed in backticks [0-9], but the problem is when it appears on discord it just turns into a code block due to the [0-9] being enclosed in ``, potentially making a less knowledgeable user confused.

When I tried escaping the standard backticks with backslash the linter didn't seem to like it, so I just chose to use special unicode characters that won't turn into a code block, eve...

regal archBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-eval\-backticks
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: clean\-\-\-works\-for\-active\-threads\-too
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: clean\-\-\-works\-for\-active\-threads\-too
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: Log\-more\-data\-on\-failed\-clean
#

67f88c7 Use existing ResponseCodeError attrs rather tha... - ChrisLovering
676844c Add request data as a sentry breadcrumb when cl... - ChrisLovering
2a8d5d0 Merge branch 'main' into Log-more-data-on-faile... - ChrisLovering
c29434b Merge pull request #2180 from python-discord/Lo... - ChrisLovering

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

There are currently a couple of bugs with our sending of deleted messages to site.

Race condition with antispam:

bot_1        | 2022-05-29 09:41:44 | bot.exts.backend.error_handler | ERROR | API responded with 400 for command clean until: {'deletedmessage_set': [{'id': ['deleted message with this ID already exists.']}, {'id': ['deleted message with this ID already exists.']}, {'id': ['deleted message with this ID already exists.']}, {'id': ['deleted message with this ID already e...
regal archBOT
#

67f88c7 Use existing ResponseCodeError attrs rather tha... - ChrisLovering
676844c Add request data as a sentry breadcrumb when cl... - ChrisLovering
c825718 Clean from public active threads when channels ... - ChrisLovering
94a5a87 Merge pull request #2182 from python-discord/cl... - ChrisLovering
2a8d5d0 Merge branch 'main' into Log-more-data-on-faile... - ChrisLovering

#
[python-discord/bot] branch deleted: fix\-eval\-backticks
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Hmmm. Given #2080 should have fixed the original issue, I'm not sure what the benefit of this retry approach is any more.

It fixed it by doing away with the author check. This means it still sends the reminder even if the user left the server.

Doesn't fetch_user still get the user if they're not on the server, so this would do the same? If we use get_or_fetch_member then it should only (and always as it isn't reliant on cache) return the member if they're on the server, so t...