#dev-log

1 messages ยท Page 3 of 1

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

Connected!

#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
regal archBOT
#

In the giphy api docs The url key on the original object isn't documented.

I am not sure if this is a documentation mistake on giphy's part, or if we're using an undocumented key that's likely to cause issues again in future.

To avoid all doubt, it might be better if we use data["data"]["images"]["downsized"]["url"], as that's documented and also has the benefit of guaranteeing that the image is <2MB.

#

This doesn't raise an error, so if this block was hit, code execution would continue and try to access result further down.

To aid with this, you could raise a bot.utils.exceptions.APIError with this message, and the bot's error handler will handle the sending of the error for you.

See the wikipedia cog for how this is used if needed.

Also, we should move this error handling into get_movies_data function, as this removes both code duplication and the need to pass around the sta...

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

I've started having a look into whether this would be an improvement. So far it's seeming pretty good IMO. Some things I've looked into:

Custom converters

Custom converters don't represent the actual type passed to the function

async def my_command(self, ctx: Context, argument: URLConverter) -> None:
    reveal_type(argument)  # URLConverter. uh oh

We can fix these using typing.Annotated

async def my_command(self, ctx: Context, argument: Annotated[str, ...
odd spireBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

Am I correct that Annotated in this case isn't actually "type safe"? As in, I can just do Annotated[int, URLConverter]
Or is that going to be mostly solved with defining type aliases for Annotated in one place?

Yeah.

I just realised we currently use the hacky solution of redefining the converters as the types they convert to under a TYPE_CHECKING condition. Pyright doesn't seem to like that (keeps using the original class type), not sure about mypy.

regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

I have successfully tested running the image on my system, and I observe builds in CI are indeed passing. There should be discussion on whether Poetry's virtual environment should be cached. However, thanks to the forethought and ingenuity of the brilliant engineers at Python Discord DevOps, the caching is centralised at HassanAbouelela/actions, and we can have the discussion there.

I would like to extend my gratitude to @ChrisLovering and his ...

#
[python-discord/site] branch deleted: poetry\-1\.2
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#

Is there any accepted workaround for when annotations are used for something other than annotating types (such as for us with converters)? Or do type checkers work on the assumption that annotations always correspond to types?

That's what typing.Annotated is for.

There is also the typing.no_type_check decorator, but that would ignore all annotations on the function. (in practice, it seems mypy ignores the whole function, contrary to the typing docs? Pyright also doesn't seem to suppo...

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

c082323 add collection of keywords per rule - Amrou Bellalouna
a75ba77 add docstrings explaining the values that the R... - Amrou Bellalouna
672ba65 add suggested keywords - Amrou Bellalouna
f07f03a make docstring more explicit about the returned... - Amrou Bellalouna
c5fe65c Merge branch 'main' into map-rules-to-keywords - Amrou Bellalouna

odd spireBOT
regal archBOT
#

79ee2b0 fix "isistance" typo - Amrou Bellalouna
ddd829f add support for keywords when using the "rules"... - Amrou Bellalouna
357ed80 send the list of pre-defined keywords along wit... - Amrou Bellalouna
f924dd2 send the "no-match" error message in pure text ... - Amrou Bellalouna
c1ce683 accept keywords and rule numbers in any order - Amrou Bellalouna

odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

Since we have a Who are we section in the landing page, why not have a Join us one as well ?
That's pretty straightforward IMO, if someone likes who we are, then they'd want to join us for sure ( because we're the hottest python community, of course ), so I think it makes sense to have it as a "follow-up" link.

This section would then where people can find and join us pretty easily.

regal archBOT
#
[python-discord/bot] branch deleted: bot\-2231\-enhancements
#

a6ae842 Add ability to delete multiple reminders - TizzySaurus
f7bff3d Display mentions instead of name attribute in ... - TizzySaurus [1a9e4c0](https://github.com/python-discord/bot/commit/1a9e4c0c2a840635475ee0481b0d59528eeb9982) Merge branch 'main' into bot-2231-enhancements - TizzySaurus [11f3693](https://github.com/python-discord/bot/commit/11f369307cf4423458c7ce60aeda7637f35bef8e) Address Review - TizzySaurus [2930799`](https://github.com/python-discord/bot/commit/2930799460d8bc65c242b2f06426453304b6ed82) Merge remote-tracking branch 'origin/bot-2231-e... - TizzySaurus

odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/quackstack] New branch created: allow\-request\-bodies
#
[python-discord/sir-lancebot] New branch created: update\-quackstack\-integration
#

Description

With https://github.com/python-discord/quackstack/pull/74 the location for the generated duck as been moved to the Location header, as a full URL.

This should be merged at the same time, or shortly after the above PR.

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 [contrib...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: bot\-core\-migration
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#
[python-discord/quackstack] branch deleted: allow\-request\-bodies
#
[python-discord/sir-lancebot] branch deleted: update\-quackstack\-integration
night lilyBOT
#
Sir Lancebot

Connected!

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

Connected!

odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

As the title says, with approval from @ChrisLovering in dev-contrib.

This migration does contain a few changes, as per the following:

Constants

Since some of bot's message utils used constants, which don't exist on botcore, these had to be changed as follows:

regal archBOT
regal archBOT
regal archBOT
#

I donโ€™t think we should implement constants this way. How would someone test bot features which rely on these constants? To be clear, this is not your fault, nor something that can be fixed in this PR, as it requires serious work on how we approach constants in bot-core in general. Work that we have so far failed to do.

When bot-core was first starting, this topic came up, and I fought to try and get what I think is the best compromise implemented, however I met great resistance. Iโ€™ll star...

regal archBOT
#

I agree that hardcoding these constants is the least preferable way to handle it. I still don't like the suggestion though.

If we pass constants to functions, we'd still have to change them in whichever project uses them

Yes, once. In this PR there is only one usage for these constants, and they could be easily passed as a bypass_roles argument or any other name you want.

I'd prefer bot-core to stay a generic library for bots. If we start tying it to specific projects I can onl...

regal archBOT
#

It is only one PR in some scenarios, but from my experience trying to migrate some of the utils, you'll still end up in a scenario having to change both. One example from here would be modifying the moderator role ID, and modifying the list of roles considered "mod roles" (like we did when we split the mod role in two).

In the provided example, you can work around that by passing the set of IDs directly, and despite being a cumbersome and repetitive API, will work. This is not true for all t...

regal archBOT
#

I like Hassan's suggestion here.

My understanding on roughly how it could work:

  1. The project using bot-core defines the constants needed (e.g. with a pydantic config class). These would be based on it's own constants
  2. This constants object is passed to the botcore Bot class on initialisation somehow.
  3. The botcore Bot object sets these as global variables on a constants.py in bot-core (would need to be careful in exactly how this is done).
  4. These constants can now be imported an...
regal archBOT
#

@HassanAbouelela

It is only one PR in some scenarios, but from my experience trying to migrate some of the utils, you'll still end up in a scenario having to change both. One example from here would be modifying the moderator role ID, and modifying the list of roles considered "mod roles" (like we did when we split the mod role in two).

I said in the previous comment I agree hardocoding is not a good solution, so I'm not sure what this is aimed at.

In the provided example, you can...

regal archBOT
#
[python-discord/site] New branch created: add\-windows\-guide
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

@bast0006 Can you please provide the examples you've tried ?
Because I'm not sure I understand correctly here since you said

and thus a message with mobile.twitter.com in it is falsely detected as a rich embed for the watchlist.

When I use this link https://twitter.com/Nadallica86/status/1574145915048398854 or https://mobile.twitter.com/nedbat/status/1504062673809338370, _has_rich_embed works just fine.

But as soon as I use twitter's Lite version (with the 'mobile' prefix),...

odd spireBOT
regal archBOT
#

I don't think discoverability is too important because the primary way to use the command is
with rule numbers, which are already discoverable. The keyword support is there for those that happen to remember them or pick them up from seeing other users invoking the command. Furthermore, the keywords are intuitive enough that one is likely to correctly guess a keyword.

Having that info in a new command would not help discoverability much โ€” it seems unlikely someone would figure out that co...

odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

Then I don't quite get the whole point of adding the feature in the first place if the rules are always discoverable and displayed in !help rules.

Numbers are more difficult to remember than keywords. For example, I remember there is an "ad" keyword just from my quick testing session, but I still have no idea what the rule number for that is off the top of my head.

Can you explain more what you mean by

The help command displays what's in a command's docstring. If the keywords wer...

regal archBOT
#

https://mobile.twitter.com/nedbat/status/1504062673809338370 is rendered as the following:

== Raw embeds (1/1) ==

{'author': {'icon_url': 'https://pbs.twimg.com/profile_images/1559004270170628096/AaSLxb_F_400x400.jpg',
            'name': 'Ned Batchelder (@nedbat)',
            'proxy_icon_url': 'https://images-ext-1.discordapp.net/external/KcDnbosWojYPkPQ4Ummp1Ad-f2wJ8Ukq3PXnU7IK-ZU/https/pbs.twimg.com/profile_images/1559004270170628096/AaSLxb_F_400x400.jpg',
            ...
#

There are three twitter embed cases here.

The first is https://twitter.com/nedbat/status/1504062673809338370, which embeds as type: rich with a 'url' of https://twitter.com/nedbat/status/1504062673809338370, which works as expected.

The second is https://m.twitter.com/nedbat/status/1504062673809338370, which embeds as type: link and thus is ignored appropriately.

The third is https://mobile.twitter.com/nedbat/status/1504062673809338370, which does embed as type: rich, but...

regal archBOT
#

Thanks for the explanation, I turned out that I understood something else before, but I do see what you meant now.

I was thinking maybe we can eliminate the subdomain and only keep the 2nd level domain & TLD along with the same path & query parameters of course for comparison, but I'm wondering what could the edge cases be here.

The path would be the same and the domain as well (eventually), what's making me wonder if whether query parameters can be altered upon rendering that URL. ( on...

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

Sentry Issue: BOT-38K

Summary

Discord must have recently added a new feature which rejects channel names if they contain certain words they don't like. This is a problem for our automated renaming of off-topic channels, which has some names with words that are no longer allowed. The first event of the Sentry issue above was caused by the name "ot0-welcome-and-fuck-you", for example.

#...

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

Connected!

odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

Just feels like more maintenance to have to have to add and potentially remove in future.

Being concerned about complexity is valid. With that in mind, we could do one of the following (assuming we go with solution 1):

  1. Only retry. Don't delete invalid names and don't notify about invalid names.
  2. Just catch the error and do nothing. Downside: one of the channel names won't change.

In both cases, there is the additional downside of not knowing that some names are never being us...

regal archBOT
#
[python-discord/branding] branch deleted: ducky\-sphere
odd spireBOT
regal archBOT
#

That's the whole suggestion though, storing the common constants in bot-core.
Isn't this the whole purpose of bot-core (to remove duplicate code between the bots)?

I personally would be for a constants.py file on bot-core, that has all the constants that are required on both bot and lancebot. Other constants can stay within their respective repo (as they already are).

Yes, this means 2 PRs when moving constants to bot-core (1 on bot-core and one on the repo it used to be on for mig...

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/site] branch deleted: fix\-warnings
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: extend\-download\-timeout
odd spireBOT
regal archBOT
#

I've gone ahead and cleaned history, merged the main branch, and updated all dependencies again (including both dependencies which were waiting on fixes upstream).

This also means @jchristgit review should count since I snapped your changes out of existence ๐Ÿ˜€, or you can review again if you like

I've noticed that flake is failing locally when run through pre-commit (something we wouldn't see in CI), so I'm working on finding a fix for that now

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

I wonder how good this is, since there's a potential starvation here for nominees with only one nomination. What I would do is take both parameters and give each of them a weight to create a total score. It would then review the nominee with the highest score.

Just off the top of my head, we could do something like:
number_of_nominations / number_for_currently_most_nominated + age / age_of_currently_oldest

This could be weighted for example to give the number of nominations more impo...

regal archBOT
#

I'm struggling to picture how such a weighting would act in practice.

If the talentpool is constantly growing, then so will the age of the oldest nomination in it. If the weighting of the next user picked is dependant on the age and number of nomination, then I don't know how you'd avoid the number of nominations required to be picked would also constantly growing.

I'd sort of accepted the starvation as a trade of between having a system that whilst isn't perfect, at least isn't broken....

regal archBOT
#

If the talentpool is constantly growing, then so will the age of the oldest nomination in it. If the weighting of the next user picked is dependant on the age and number of nomination, then I don't know how you'd avoid the number of nominations required to be picked would also constantly growing

That's why I normalized the age by the age of the oldest vote. The contribution is capped at 1, and the older the oldest vote, the less of an effect its aging will have on the score.

Meaning, ...

regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

Sentry Issue: SIR-LANCEBOT-8M

TypeError: Client.wait_for() got some positional-only arguments passed as keyword arguments: 'event'
  File "discord/ext/commands/core.py", line 190, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot/exts/fun/hangman.py", line 112, in hangman
    message = await self.bot.wait_for(

Unhandled command error: Client.wait_for() got some positional-only arg...
#

Sentry Issue: SIR-LANCEBOT-8Q

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

Sentry Issue: SIR-LANCEBOT-8P

AttributeError: 'Select' object has no attribute 'data'
  File "discord/ui/view.py", line 425, in _scheduled_task
    await item.callback(interaction)
  File "bot/exts/utilities/epoch.py", line 124, in select_format
    selected = interaction.data["values"][0]

Ignoring exception in view "" for item "<Select placeholder='Select the format of your timestamp' min_v...
#

Sentry Issue: SIR-LANCEBOT-8K

HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embeds: Embed size exceeds maximum size of 6000
(1 additional frame(s) were not displayed)
...
  File "bot/exts/utilities/wolfram.py", line 288, in wolfram_short_command
    await send_embed(ctx, message, color)
  File "bot/exts/utilities/wolfram.py", line 54, in send_embed
    await ctx.sen...
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: fix\-issue\-1106
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Hello @Rohith0009, thanks for your PR!

Unfortunately, we do not accept pull requests not accompanied by issues, as outlined in our contribution guides. We also do not usually accept grammar fix PRs like this since they create a lot of conflicts propagated throughout our entire project, with usually minimal benefit.

If you'd like to have a go at one of our other issues, check out the issues tab for issues without the Planning or WIP ta...

#
[python-discord/sir-lancebot] New branch created: fix\-GH\-1108
#

Relevant Issues

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

Description

During development of dpy 2.0, the order of the interaction and select swapped, but this wasn't updated in the codebase. This PR fixes that in the 3 use-cases of the @discord.ui.select decorator.

Did you:

odd spireBOT
regal archBOT
#

One more thing to consider if we're going to allow automatically starting votes again: We could query metricity to check when the last message sent by the user is. If it's too old the vote won't fare well.

Yeah, that was part of the original specification in the issue. I still plan on adding that at some point, but I wanted to try and limit the scope for this PR so didn't do it here.

#
[python-discord/sir-lancebot] branch deleted: fix\-issue\-1106
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: fix\-issue\-1107
#

Relevant Issues

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

Description

As described in the issue, the value of the body key returned by the API can be a literal null value, meaning dict.get("body", "") won't substitute as the key does exist. Instead, we now use dict.get("body") or "".

Did you:

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

Connected!

odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

True.

But you know what, we can leave this part as it is so that we can identify if an autoban is added to an allow-list.
It might be better to add a check to not allow autoban to be added to an allow-list in the first place but after a quick glance I don't think the bot will autoban based on allow list.
It is possible that a mod might accidentally add a filter to the allow list instead of blacklist and the report will help identify such cases (assuming we miss the original plain message...

regal archBOT
#
[python-discord/bot] branch deleted: move\-filter\-alerts
#

4697076 Send filter alerts to #filter-log instead of #m... - ChrisLovering
fe86fb9 Namespace discord import in filter_lists - ChrisLovering
4f56106 Report on all autoban filters added in the last... - ChrisLovering
f2d05d5 Send weekly_autoban_report to ctx channel when ... - ChrisLovering
2142d82 Make autoban report silently fail if output wil... - ChrisLovering

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

Connected!

odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

Description

Proposing to add a spooky reaction with the bat emoji to any message that has bat in it.

Reasoning

It's October, and currently there are only 4 emojis that are the result of a few key words. Maybe it's time to add a little more?

Proposed Implementation

Add a new entry to the SPOOKY_TRIGGERS dictionary in bot/exts/holidays/halloween/spookyreact.py. Unicode for bat emoji is \U0001F987.

Would you like to implement this yourself?

  • [x] I'd li...
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/modmail-plugins] New branch created: poetry\-1\.2
#
[python-discord/modmail-plugins] branch deleted: poetry\-1\.2
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/branding] New branch created: swoopy\-logo
odd spireBOT
regal archBOT
#
[python-discord/branding] branch deleted: swoopy\-logo
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/king-arthur] branch deleted: devops\-rukes
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: snekbox\-311\-and\-metricity
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: bump\-bot\-core
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#

Relevant Issues

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

Description

Added new entry in SPOOKY_TRIGGERS. Use a bit more regex to match all the words specified in the issue.

Did you:

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

Connected!

odd spireBOT
regal archBOT
#

is there any chance eval output could be allowed in pygen? or at least stop the bot from deleting the message?

itโ€™s really annoying trying to give examples or test something when the bot is deleting the message and/or you have to go to another channel to see the output

if spam is your worry it shouldnโ€™t be all that hard to have a cooldown and line limit right?

regal archBOT
#
[python-discord/infra] New branch created: remove\-unused\-roles
odd spireBOT
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

Joe has concluded his research and after a lengthy research paper was published
and after even receiving a $250,000 grant from Leon "Lemon" Sandรธy himself, his
research concluded that whilst driving a Ferrari is truly enjoyable, the
correct way to solve this matter of allocating IP addresses is to self-host the
most complicated cluster scheduling software known to man, Kubernetes. We are
excited to announce that as a result to this research, the general public had
the ability to for onc...

regal archBOT
#
[python-discord/bot] New branch created: repo\-token\-remove
#
[python-discord/site] New branch created: repo\-token\-remove
#
[python-discord/quackstack] New branch created: repo\-token\-remove
#
[python-discord/patsy] New branch created: repo\-token\-remove
odd spireBOT
regal archBOT
vague sphinx
#

๐Ÿ

odd spireBOT
regal archBOT
#
[python-discord/quackstack] branch deleted: repo\-token\-remove
#
[python-discord/sir-robin] branch deleted: repo\-token\-remove
#
[python-discord/sir-lancebot] branch deleted: repo\-token\-remove
#
[python-discord/site] branch deleted: repo\-token\-remove
#
[python-discord/bot] branch deleted: repo\-token\-remove
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
thin oysterBOT
#
Sir Robin

Connected!

odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/patsy] branch deleted: repo\-token\-remove
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/branding] New branch created: lemoji/partying
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

224a05b Bump bot-core to 8.2.1 - ChrisLovering
bcd7051 Bump all deps to latest - ChrisLovering
3582ff5 noqa an abstract class with no abstract methods - ChrisLovering
a1f4f60 Use explicit mock channels in tests to remove w... - ChrisLovering
67333f9 Merge branch 'main' into bump-bot-core - mbaruh

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

Sentry Issue: SIR-LANCEBOT-8S

AttributeError: 'async_generator' object has no attribute 'flatten'
  File "discord/client.py", line 409, in _run_event
    await coro(*args, **kwargs)
  File "bot/utils/decorators.py", line 81, in guarded_listener
    return await listener(*args, **kwargs)
  File "bot/exts/holidays/halloween/candy_collection.py", line 93, in on_reaction_add
    await self.hackto...
#

Sentry Issue: SIR-LANCEBOT-8R

TypeError: object of type 'NoneType' has no len()
  File "discord/ext/commands/core.py", line 190, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot/exts/holidays/halloween/scarymovie.py", line 23, in random_movie
    selection = await self.select_movie()
  File "bot/exts/holidays/halloween/scarymovie.py", line 50, in select_movie
    selection_id = ra...
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: blurple\_color\_fix
#

Relevant Issues

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

Description

Added an entry for blurple.

Did you:

odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: brad90four\-patch\-1
#

Relevant Issues

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

Description

Added an entry for blurple.

Did you:

#
[python-discord/sir-lancebot] branch deleted: blurple\_color\_fix
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Sentry Issue: BOT-398

TypeError: unsupported operand type(s) for +: 'SequenceProxy' and 'SequenceProxy'
  File "discord/ext/commands/core.py", line 190, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot/exts/moderation/clean.py", line 514, in clean_users
    await self._clean_messages(ctx, users=users, channels=channels, first_limit=message_or_time)
  File "bot/exts/moderation/clea...
#
[python-discord/bot] New branch created: fix\-sequency\-proxy\-breaking\-change
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: fix\-issue\-1120
#

Relevant Issues

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

Description

Replaces .flatten() calls with an async for loop (the easterquiz ones had to be expanded due to a constraint with having an async comprehension within a non-async comprehension).

Did you:

odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: brad90four\-patch\-1
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#

I assume it's self.message that is None, as reaction.message should never be None. It seems like this is a race condition, a reaction is added (probably to a different message) before self.message is set.

I believe this should be fixed by moving the listener adding to after update_message is called: https://github.com/python-discord/sir-lancebot/blob/f9cc77f55a7bac9cff1f5674b36b3f17560f6bfe/bot/exts/core/help.py#L220-L228

regal archBOT
regal archBOT
#

b7a468d add remove_subdomain_from_url in bot util helpers - Amrou Bellalouna
6a0da9a transform urls matched in messages - Amrou Bellalouna
ce16838 collect all urls in a set to avoid duplicates - Amrou Bellalouna
caa2698 check for the url existence in the final_urls set - Amrou Bellalouna
0bf93eb use tldextract for a correct url decomposition - Amrou Bellalouna

odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

c8eb0ab Check for commands being None in try_get_tag an... - wookie184
b6c2054 Return None instead of False in try_get_tag - wookie184
6be1686 Merge branch 'main' into fix-silence-and-tags-w... - mbaruh
4a3321b Merge pull request #2274 from python-discord/fi... - mbaruh

#
[python-discord/bot] branch deleted: fix\-silence\-and\-tags\-when\-unloaded
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: lemon/resolve\-serious\-grammatical\-problem
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: lemon/resolve\-serious\-grammatical\-problem
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: parallel\-fetch\-user\-bb
#
[python-discord/bot] branch deleted: see\-what\-black\-would\-change
#
[python-discord/bot] branch deleted: ChrisLovering\-patch\-2
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: update\-autoreview\-system
oak estuaryBOT
odd spireBOT
regal archBOT
#

a title of 256 characters is far too long. I know discord allows it to be this long, but that doesn't mean it would be a good title.

        embed = Embed(
            colour=Colour.red(),
            title=textwrap.shorten(error, width=150, placeholder="โ€ฆ"),
        )

Doing something like this, where we limit to 150 characters, and also append an ellipses would be better IMO.

This suggestion will also require an import textwrap at the top of the file.

#
[python-discord/branding] branch deleted: lemoji/partying
odd spireBOT
regal archBOT
regal archBOT
#

People tend to just send in help channels or similar such messages

Hey, can you help me? My code doesn't work.

Although we may have a code snippet from them, which may not be the source of the issue, there is a lot of valuable information that is lost. Useful information would contain things like

  • What is the user's end goal?
  • What is the current behaviour of the code? Is it working until some point or not starting at all?
  • What are some solutions the user has tried?
  • What is th...
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

I believe this should be fixed by moving the listener adding to after update_page is called.

Looking through the code I don't see an issue with moving the listeners to below the update_page, and update_page defines self.message if it's not already defined meaning it'd no longer be None.

TL;DR; I agree with your assessment.

If no one else picks this up in the next fews days then I will.

regal archBOT
odd spireBOT
regal archBOT
#

Time complexity in this part seems like it can be better, currently iterates for 2N times for N total users reacted. For 2 reactions, each with 500 users, currently, we iterate a constant of 2000 times (for loop that builds list + list.count) on each new reaction.

Suggest this as an alternative:
In the same case of 1000 users, this would iterate a best case of 1 time and a worst case of 500 times.

@staticmethod
async def already_reacted(new_reaction: discord.Reaction, user: Union...
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

random.choice will error on an empty sequence, so we should handle it being None/an empty array before trying to do that.
Right, that makes sense.

What do we actually want to do in the event that .get("results") or selection_id ends up being None?

I don't think there's any reason it should be None so probably send a message to the user saying no results were found and maybe log a warning so we can look into it.

In fact, reading through [the code](https://...

odd spireBOT
regal archBOT
#

e57c6aa change the signature to include a "zen_rule_index" - Amrou Bellalouna
05b636e update doc strings to reflect the usage of the ... - Amrou Bellalouna
c5aaccb apply style guidelines to signature - Amrou Bellalouna
5556a60 remove int from search_value's type union - Amrou Bellalouna
1e18187 Merge pull request #2298 from shtlrs/issue-2294... - wookie184

odd spireBOT
oak estuaryBOT
regal archBOT
#
#

@wookie184 For the first part I think these lines are concerned
* https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/utilities/githubinfo.py#L350-L351
* https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/utilities/githubinfo.py#L264

We could use either dd/mm/yyyy or mm/dd/yyyy for both.

I would be happy with using dd/mm/yyyy for both although others may prefer using timestamps not in the footer so it's localised (CC @minalike?), i'...

odd spireBOT
regal archBOT
regal archBOT
#

I tried all of them , none helped !
also I reinstalled all the modules required for the execution with the supported versions .

`Traceback (most recent call last):
File "c:\Users\aayus\Downloads\bot-main\bot_main_.py", line 3, in <module>
import aiohttp
File "C:\Users\aayus\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp_init_.py", line 6, in <module>
from .client import (
File "C:\Users\aayus\AppData\Local\Programs\Python\Python39\lib\site-packa...

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

Thanks for this! A few immediate comments:

  • Should we maybe have a subdirectory for all of this? an issue might encompass several of those articles, and they're relativeley scattered in the currently resulting list of guides..
  • Is "Don't use the py installer" a stance we want to take? I'm not a fan of it myself, but maybe it would be wiser to have a general page about it, with a section about caveats to watch out for.
  • In the PATH section, I think it's worth noting that if it contains...
regal archBOT
#
* Should we maybe have a subdirectory for all of this? an issue might encompass several of those articles, and they're relatively scattered in the currently resulting list of guides..

Yeah, that would probably make sense

* Is "Don't use the py installer" a stance we want to take? I'm not a fan of it myself, but maybe it would be wiser to have a general page about it, with a section about caveats to watch out for.

WDYM by "py installer"?

* In the PATH section, I thi...
regal archBOT
#

We should check that a user has been active in the past 7 days before choosing them to review.

This will require an endpoint on site that queries metricity for a user's message count.

I don't think we need to worry about clearing out users that stop being active completely in this issue, it might be better to update the !tp list command to display activity information somehow so they can be cleared out every now and again.

#

This would allow queueing a user to be reviewed next rather than using the autoreviewer. A mod could run !tp q 493839819168808962 and that user would be reviewed when the reviewer is next ready, returning to the autoreviewer after the queue is empty.

We should also have a !tp queue clear command to clear the queue, and a !tp queue list command to show the current queue members.

#

WDYM by "py installer"?

Oh sorry I meant the microsoft store page.

Well, I don't think we should recommend that people use it (due to said caveats), so i'm not sure what else would be on such a page (maybe how to uninstall it lol).

maybe it should be moved to another point on that page or made more obvious?

Ah I missed that. yeah maybe it should be in the form of "this is what you need to make sure of to make it work"

๐Ÿ‘

regal archBOT
#

@MarkKoz I think that changing that dynamically is going to be a PITA concerning how simple this should be.
The doc dunder attribute is not writable, which throws an AttributeError upon trying to modify/write to it.

So we could go with @wookie184's approach here, and we have a static command that fetches the rules & kws & maybe even cache them per rule number ?

No need to make the http request each & every time, WDYT?

regal archBOT
#

I think that changing that dynamically is going to be a PITA concerning how simple this should be.
The doc dunder attribute is not writable, which throws an AttributeError upon trying to modify/write to it.

Seems pretty straight forward. I don't know why you'd get an error.

>>> def foo():
...     """hello world"""
>>> foo.__doc__
'hello world'
>>> foo.__doc__ = "1"
>>> foo.__doc__
'1'
>>>

we have a static command that fetches the rules & kws & maybe even cache...

regal archBOT
#

Thanks for writing this, the structure of this tag is good, although I think some of the information isn't necessary. It's best to keep tags short and snappy, otherwise people wont read them.

I've tried condensing the tag down a bit, could you take a look and see what you think and maybe merge both our versions togther?

Yes, I consider that feasible, but keep in mind that sentences must start with a capital letter. In line 6:

- *slicing* is a way of accessing a part of a...
odd spireBOT
regal archBOT
#

This issue is required for bot#2302

The endpoint should take a list of user IDs and a number of days (or just a timestamp?), and return the number of messages sent by each user from now up to the date/interval provided. This data is available through metricity.

The reason I suggest an endpoint taking multiple user IDs at once is that I assume it would be more efficient as a single query, as we may want to use this endpoint on all nominated users at once (e.g. to check for users in the tale...

regal archBOT
regal archBOT
#

It would be nice if we could add links to previous nomination threads to both !tp history and newly created nomination threads. As it stands, we have to search for the username in the discord thread history (and this isn't particularly great UX nor reliable).

Storing the thread ID for a nomination sounds like a good first step (and probably worth committing immediately even before other features are complete?), then searching through threads by username to attempt to rediscover old thread...

odd spireBOT
regal archBOT
#

I don't think there's any reason it should be None so probably send a message to the user saying no results were found and maybe log a warning so we can look into it.

Yep, that sounds good.

If we used the results from the first request we'd be much more limited in the results we got.

Right, I see. For some reason I was thinking that the initial response would include all entries, which isn't actually the case as you stated (it seems to return 20).

Side note: we may ...

regal archBOT
#
[python-discord/bot] New branch created: 2301\-fix\-voting\-conditions
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: fix\-issue\-1120
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#

I'd like to:

  • Remove the cache of nominations, as we refresh it almost every time before using it anyway so it's pretty useless. It's also a potential for bugs in places we forget to keep it updated.
  • Convert the site response of nominations into dataclasses or pydantic models. This means we don't have to use dictionary accessing everywhere and makes my IDE happy because it knows the types. (I think pydantic would probably be easiest as it handles dictionary->model conversion automaticall...
regal archBOT
#
[python-discord/bot] New branch created: 2306\-nominations\-cleanup
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: move\_security\_cog
odd spireBOT
regal archBOT
#

My bad, what I meant is, we have another callback that fetches & composes the rules, and then the help argument in the command decorator will take that callback.

And what I also meant is that this callback will cache the results so that we don't have to get them over & over again.
But it'll require an instance of the API client to do that, is there a global instance we could use ? (from bot core maybe ?)

What do you think ?

regal archBOT
#

@bast0006 IF you could explain what nominations are & how they work in a Nutshell, I'll gladly take this on once we finish planning it up

The talentpool is our system for getting new helpers (users with the "helper" role), and nominations are a part of this. The overview of how it works is:

  1. Any helper can run the !nominate command (in a staff channel), to nominate someone they think could be a good helper
  2. When a user is nominated they are put in a "pool" of users waiting to be ...
regal archBOT
#

My bad, what I meant is, we have another callback that fetches & composes the rules, and then the help argument in the command decorator will take that callback.

Keep in mind discord.py expects a string value, not a function. It looks like @command(help=myfunc()) may work since this gets executed as the cog loads, and extensions are loaded after the Bot has already been created and has an APIClient.

But it'll require an instance of the API client to do that, is there a global inst...

regal archBOT
#
[python-discord/sir-lancebot] New branch created: randomcase\-reply\-enhancement
#

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

Description

As per title.

Users can now reply to a message to its contents as the text argument, thanks to a call to botcore.utils.commands.clean_text_or_reply.

image
![image](https://user-images.githubusercontent.com/47674925/197385559-bc08af46-37ba-463d-90ba-2b8b2af...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT