#dev-log

1 messages ยท Page 81 of 1

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

@MarkKoz Would this check also have to be implemented for the kick command? I assume this would have the same issue (although granted less often).

Also, do we want to do this check before the apply_x function is called (directly inside the command command) or within the apply_x function? I'm thinking of something along the lines of`

if user.top_role >= guild.get_role(constants.mod_role):
    await ctx.send("You cannot use this command on mods+")
    return

I'd be inte...

regal archBOT
regal archBOT
#

We're thinking of slimming down the stackoverflow command because it looks like a dumpster fire on mobile, so I'm going to mark this as stalled until we fix that up.

Is there an issue for that? I think it would make sense to move the hyperlink for each question to the title of each answer rather than the stats of the answer. Not sure if you meant that as I think that would make it render better on mobile, or if you meant actually reducing the size

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

Thanks for the contribution, although i'm not sure the purpose of this tag is quite clear to me yet.

Saying bot is a new type of global variable makes it sound like bot is a "magic" variable that behaves in a special way and is available in all of your files automatically, but I don't think that is quite right.

To make it accessible you need to pass it in when you create the instance of the cog

class MyCog(commands.Cog):
    def __init__(self, bot):
        self.bot = ...
regal archBOT
#
[python-discord/sir-lancebot] New branch created: int\-eval\-owner\-check
#

Relevant Issues

Closes #817

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

Description

Limited int eval commands to the bot owner if in debug mode. Set debug mode to be the default

Did you:

  • [x] Join the Python Discord Community?
  • [x] Read all the comments in this template?
  • [x] Ensure there is an issue open, or link relevant discord discussions?
  • [x] Read and agree to the [contribut...
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: int\-eval\-owner\-check
night lilyBOT
#
Sir Lancebot

Connected!

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

Description

I propose that we change the error message given to users when they run the bookmark command and it fails to find the message they specified.

Reasoning

Users sometimes assume that just giving a message ID to the bookmark command is enough to bookmark a message, even if it's in another channel.

However, if the message they are trying to bookmark is in another channel the command will fail since it cannot find the message they are referring to.

See [here](https:...

regal archBOT
#
[python-discord/bot] New branch created: Output\-public\-url\-when\-sharing
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: Output\-public\-url\-when\-sharing
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Instead of having normal commands and cogs, have one example that works for both.

@bot.command()
async def foo(ctx: commands.Context):
    """A command to demonstrate how to use a bot variable"""
    await ctx.send(ctx.bot.test) # This will send the text, I am accessible everywhere!

@bot.command()
async def bar(ctx: commands.Context, *, new_text: str):
    """A command to demonstrate, how to change the value of a bot variable"""
    bot.test = new_text
    print(bot....
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

If someone pastes this code and tries to run it, and tries to create a set it will call the command. We shouldn't recommend someone to shadow types/variables/functions.

I don't really like complicating things by doing this though (someone might thinkthey need to set a name to do this), do you perhaps know a better name for the function that ignores this situation completely?

odd spireBOT
regal archBOT
#

Hmmm, I know I said this originally but reading it out more and more there's always stuff to improve.

Python allows you to set custom attributes to class instances, like your bot! By adding variables as attributes to your bot you can access them anywhere you access you bot. In the discord.py library, these custom attributes are commonly known as `Bot Variables` and these can be a lifesaver if your bot is divided into many different files. An example on how to make a bot variab...
odd spireBOT
regal archBOT
#
Python allows you to set custom attributes to class instances, like your bot! By adding variables as attributes to your bot you can access them anywhere you access you bot. In the discord.py library, these custom attributes are commonly known as `Bot Variables` and can be a lifesaver if your bot is divided into many different files. An example on how to use custom attributes on your bot is shown below:
odd spireBOT
regal archBOT
#
Python allows you to set custom attributes to class instances, like your bot! By adding variables as attributes to your bot you can access them anywhere you access your bot. In the discord.py library, these custom attributes are commonly known as `Bot Variables` and can be a lifesaver if your bot is divided into many different files. An example on how to use custom attributes on your bot is shown below:
odd spireBOT
regal archBOT
#

these are probably meant to be used as code, can we use quotes instead maybe? I don't have a strong preference.

Python allows you to set custom attributes to class instances, like your bot! By adding variables as attributes to your bot you can access them anywhere you access your bot. In the discord.py library, these custom attributes are commonly known as "bot variables" and can be a lifesaver if your bot is divided into many different files. An example on how to use custom...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: update\-remind\-help
#

506f1d2 Add time units and example to docstring of !re... - TizzySaurus [fe840ca](https://github.com/python-discord/bot/commit/fe840ca63647d6d6e92760cb4f0f49ac67926954) Add time units to the !remind editand!remi... - TizzySaurus
e92d87d Merge branch 'main' into update-remind-help - Xithrius
1c822e1 Merge pull request #1778 from python-discord/up... - Xithrius

odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: escape\-reddit\-posts
#

Relevant Issues

Closes #746

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

Description

Some of the results from the command aren't that beautiful, but I think any other changes aren't really within the scope of this PR and are difficult to do anyway because of how unreliable discord markdown rendering is.

Did you:

odd spireBOT
regal archBOT
#

Description

Since python, the language is named after a snake and anaconda, a very famous data science platform for python also goes by the name of a snake, my idea was to implement an anaconda snake to the .snake hatch command

Reasoning

The extra snake gives a more possible or a rarer chance to own the snake in the discord server and people hatch snakes all the time in #sir-lancebot-playground

Proposed Implementation

Using the same egg hatching format, i would want to a...

regal archBOT
#

@gitautas can you present your implementation here so we can see it in action without having to study the source code or run it? Maybe with some GIFs? Maybe in the original post?

I'm a little on the fence here, mostly because I don't understand precisely how this will change the .uwu feature from how it works today. I don't think this PR description accurately explains what changes you want to make, and I don't have the time to sit down and play with your implementation.

regal archBOT
#

@lemonsaurus So the current uwufication in Sir Lancebot is a very simple wepwacement, just replaces Rs and Ls to Ws.
This was okay for a quick joke, but the state of uwufication has progressed to have a lot more features, such as:

  • Word replacement from an extensible lookup table: I am a small bean. -> i am a smol bean.
  • Nyaification: The winner is China. -> "the winner is chinya~`
  • More advanced, context aware wepwacement based on Pydis community created regexes.
  • RNG we...
regal archBOT
odd spireBOT
oak estuaryBOT
#

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

regal archBOT
#

I decided I'd like to implement this, and after getting approval, I spoke to @mbaruh about this in #mod-tools.

It was decided that the implementation would be as follows:

  • A !infraction search id {id} command will be added to the infraction search group (the {id} being infraction id)
  • This will have a shortcut of !infraction search {id}, again with {id} as infraction id. We can distinguish between whether it's a user id or infraction id by the length (if it's >=15digi...
#

Details : https://github.com/python-discord/sir-lancebot/issues/821

Relevant Issues

Closes #821

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

Description

The snake was added in the _utils file and is implemented through a linking of a igmur image

Did you:

  • [x] Join the Python Discord Community?
  • [x] Read all the comments in this template?
  • [x] Ensure there is an issue open, or ...
regal archBOT
#
[python-discord/bot] New branch created: support\-infraction\-id\-search
odd spireBOT
regal archBOT
regal archBOT
#

Description

For those who don't know what Mastermind is, it is a 2 player game, where 1 of the players is the "codemaker" and the other is the "codebreaker". The codemaker thinks of a combination (code) that consists of 4 different colors. Then, the codebreaker tries to guess the codemaker's code.
Here is a complete list of rules: https://magisterrex.files.wordpress.com/2014/07/mastermindrules.pdf
The bot will be the codemaker.

Reasoning

I think it is a very fun game that many commu...

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

I appreciate your response, which is very thorough and now I understand the changes.

The changes are, of course, like something out of a nightmarish fever dream and I hate them with every fiber of my being, but that doesn't mean I'm opposed to them. I'm sure some of our users would have a lot of fun with some of them.

You said the user can control the "intensity", please explain by which mechanism the user would control this?

odd spireBOT
regal archBOT
#
jb3
[python-discord/site] branch deleted: jb3/collectstatic\-build
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

506f1d2 Add time units and example to docstring of !re... - TizzySaurus [fe840ca](https://github.com/python-discord/bot/commit/fe840ca63647d6d6e92760cb4f0f49ac67926954) Add time units to the !remind editand!remi... - TizzySaurus
52bed3d Add message link support to !user command - TizzySaurus
da3a75b Merge pull request #1783 from python-discord/us... - Akarys42
78d8bde Use publically available URL when outputting me... - ChrisLovering

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

Connected!

sullen whaleBOT
#
Thread Bot

Connected!

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

Description

Citing the rules of the game

Rules: You have 4 ingredients for each antidote, you only have 10 attempts
Once you synthesize the antidote, you will be presented with 4 markers
Tick: This means you have a CORRECT ingredient in the CORRECT position
Circle: This means you have a CORRECT ingredient in the WRONG position
Cross: This means you have a WRONG ingredient in the WRONG position

Info: The game automatically ends after 5 minutes inactivity.
You should only use...

regal archBOT
regal archBOT
#

Description

On running the bookmark command, the bot asks the user to react if they want the bookmark to be sent but the bot sends the bookmark to the user even if the user doesn't react

Steps to Reproduce

  1. Go to #sir-lancebot-playground
  2. Bookmark any message with the .bm command
  3. DO not react with the push pin
  4. Observe how the bot sends the message to you regardless

Expected Behaviour

The bot should send the message only when the user reacts with the push pin ...

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: Only\-check\-domain\-filters\-against\-URL\-like\-parts\-of\-a\-message
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

I believe this is intended behaviour. The tick means you have a correct ingredient in it's correct position, but the position of the tick doesn't indicate anything, so you don't know which ingredient you have in the correct position. This makes the game more interesting, as the strategy for it is less simple.

You can see that the position of the result emojis (white circle, tick, cross) is sorted in the code (guess_result.sort()) in order to not give the position away, hence you get ...

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: swfarnsworth/smarter\_resources
odd spireBOT
regal archBOT
#

Description

This issue has 2 parts:

  1. Since users may try to react to the pin message after they have ran the bookmark command, making a feature to disable the
  2. When a user has already bookmarked a message, we check if the same message is already bookmarked and warn the user regarding the same

Reasoning

This feature can prevent confusion of the pin message in the first part and it would help detect duplicate bookmarks

Proposed Implementation

For the first part of...

#

I'm not quite following what it is you're trying to describe here.

If you're referring to someone book marking a message, then removing their reaction and reacting again, we already check for this, and it does not re-send the bookmark.

https://github.com/python-discord/sir-lancebot/blob/0da256ca8986700e9c288f26b9db9c8e0f842465/bot/exts/evergreen/bookmark.py#L121-L122

regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

@MarkKoz my understanding here is we are only a consumer of the original library and never modify it, meaning it isn't a derived work and aren't subject to those rules. Although I'm honestly not sure, should we ask anyone about this?

It is a combined work. What I've heard is importing a library is considered to be linking to it. So, see the licence's definition of a combined work:

A โ€œCombined Workโ€ is a work produced by combining or linking an Application with the Library. T...

regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: restrictive\-infra\-commands
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

This PR is on top of https://github.com/python-discord/thread-bot/pull/3 for ease of merging, and is in draft until forms has a way to generate long-lasting app tokens.

This cog listens for embeds to be sent by the forms webhook for user's submitting ban appeals. When one is detected it fetches extra info from the forms API and starts a thread, ready for mods to deliberate.

When a decision is made, it allows for the generation of a response to the ban appeal, using canned responses and ...

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

@MarkKoz alright, so we have two packages that uses LGPL. One of them is flake8-import-order which is quite easy to swap for Isort and would be quite an improvement.

The other is chardet, a dependency of aiohttp. It is a bit more problematic, but we could dodge it using the accelator lib instead cChardet, which is under the Mozilla license.

Maybe we could explore that if we want to get rid of them? Another solution would be to simply include a LICENSE-THIRD-PARTY file. I honestly su...

regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

I was able to simplify this code a bit considering there's 3 cases:

  • One has a group and the other doesn't (XOR)
  • Identical groups (potentially both None)
  • Different strings and should be fuzzy searched
        if self.group is None != fuzzy_tag_identifier.group is None:
            # Ignore tags without groups if the identifier has a group and vice versa
            return .0

        if self.group == fuzzy_tag_identifier.group:
            # Completely identical...
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

The self.group is None != fuzzy_tag_identifier.group is None: comparison won't work. we'd need to do something like (not sure if there's any nicer way to check that either of them is None and they aren't equal)

        if (self.group is None or fuzz_tag_identifier.group is None) and self.group != fuzz_tag_identifier.group:
            # Ignore tags without groups if the identifier has a group and vice versa.
            return .0
        if self.group == fuzz_tag_identi...
odd spireBOT
regal archBOT
#

No self.group is None != fuzzy_tag_identifier.group is None: will work, because they become bools. Bools only have 2 states, True or False. So we have 4 cases:

  • both self.group and fuzzy_tag_identifier.group are None (True != True False)
  • self.group is None and fuzzy_tag_identifer.group is set (True != False True)
  • self.group is set and fuzzy_tag_identifier.group is None (False != True True)
  • both self.group and fuzzy_tag_identifier.group are set (`False ...
#

With how it's chained, it impossible for the condition to be True self.group is None != fuzzy_tag_identifier.group is None creates a != comparison between None and fuzzy_tag_identifier.group which is then compared to be equal to None. The long equivalent (and how python handles it) would be
self_group is None and None != fuzzy_tag_identifier_group and fuzzy_tag_identifier_group is None

In [149]: for self_group, fuzzy_tag_identifier_group in itertools.product((None, "ba...
regal archBOT
#
[python-discord/bot] New branch created: dmrelay\-mod\-channel
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: raw\-api\-improvements
#
    async def raw(self, ctx: Context, *, message: Message, json: bool = False) -> None:

This is the current interface, which doesn't allow you to use !raw msg-link foo because of the existence of the json parameter which is used by raw json. The json parameter is also included in the help text by default which isn't ideal.

This PR abstracts raws logic away into a helper function to get the better interface.

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
sullen whaleBOT
#
Thread Bot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
sullen whaleBOT
#
Thread Bot

Connected!

odd spireBOT
regal archBOT
#

This pull request restructures the clean cog and adds additional features to it.

Changes

  • !clean message renamed to !clean until
  • Added !clean between which accepts to limits to clean between.
  • The limits are now exclusive. Meaning, unlike now where !clean message deletes the message specified, !clean until will delete the messages and stop at the message specified without deleting it. Same way with between.
  • The limits can now be specified not just via messages, but...
odd spireBOT
regal archBOT
#

Hmm, I see now. What about this instead?

We're removing a level of nesting in the if-statements introducing several dimensions to keep track, by flattening them we get a clear case of when to do what

        if len(tag_identifier.name) < 3:
            return []
        elif tag_identifier.group is None:
            return self._get_suggestions(tag_identifier)

        if len(tag_identifier.group) < 3:
            # No point in fuzzy matching if the group is less than 3 cha...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
sullen whaleBOT
#
Thread Bot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
sullen whaleBOT
#
Sir Threadevere

Connected!

odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: restrictive\-infra\-commands
#

570490f Replace UserMentionOrID with UnambiguousUser - Qwerty-133
70ac959 Add the UnambiguousMember converter - Qwerty-133
1ffe27a Fix mismatches in parameter names and docstrings - Qwerty-133
8b1108d Use unambiguous converters for infraction commands - Qwerty-133
1dea763 Make the helper function more readable - Qwerty-133

oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: raw\-api\-improvements
odd spireBOT
oak estuaryBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

Connected!

regal archBOT
#

Description

As discussed in https://github.com/python-discord/sir-lancebot/pull/816 we should allow the bookmark command to be allowed in every channel.

Reasoning

Bookmarking messages is very useful for people who want to remember things, and the command itself doesn't use up much screen real-estate, so it shouldn't cause an issue

Proposed Implementation

Possibly add the everyone role to the whitelist_override but I'll leave the details up to the developer.

Add...

odd spireBOT
regal archBOT
#

@brad90four Hello! Sorry for the late reply. I'll assign this to you. In the meantime if you need help with conflicting files, I'd go into the #dev-contrib channel so people are able to get the most amount of information into your brain about how to deal with them. You can see conflicting files at near the end of this PR. In this case, it should show up as such:

<img width="266" alt="image" src="https://user-images.githubusercontent.com/15021300/131314850-36c39a37-0597-4999-9061-cc1f6d8917...

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

Connected!

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

Connected!

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
sullen whaleBOT
#
Sir Threadevere

Connected!

odd spireBOT
regal archBOT
odd spireBOT
sullen whaleBOT
#
Sir Threadevere

Connected!

odd spireBOT
regal archBOT
odd spireBOT
sullen whaleBOT
#
Sir Threadevere

Connected!

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
oak estuaryBOT
#

Doc item doc_item.symbol_id='environment-variables' present in loaded documentation inventories not found on site, inventories may need to be refreshed.

mint goblet
#

!docs refreshdoc

oak estuaryBOT
#
Inventories refreshed
regal archBOT
regal archBOT
#

Description

When using the Real Python command and inspecting the links, you'll find that some links are courses, lessons, or quizes.

Steps to Reproduce

Use the .rp command with concurrency as search words.

Expected Behaviour

The point of the Real Python command is to provide articles, it should only bring up articles per its purpose.

Actual Behaviour

Currently you may receive other medias that Real Python produces, which is unwanted.

Possible Solutions

The...

#

Description

Real Python search command returning courses, lessons and quizzes.

The intent of the search command is to return only articles based on the user's input.
Based on this discussion: [discord message link]( #dev-contrib message)

Steps to Reproduce

.realpython concurrency returned this list during a discussion:

Sir Lancebot
โ€” Today at 11:02 AM
Search results - Real Python
Here are the top 5 ...

#

Nice stuff, I think the gameplay with these changes is much more fun, better than i'd expected. Just a few things i've commented and things from other reviews (mainly fuzzywuzzy -> rapidfuzz, should just be just a drop in replacement) and i'll be ready to approve.

Also, on the line with self.question_limit = DEFAULT_QUESTION_LIMIT, this is not necessarily correct with the wikipedia cog as there may not be as many questions as DEFAULT_QUESTION_LIMIT. I think this line should be ch...

#

Relevant Issues

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

Description

Added "kind": "article" parameter to API request. Also added a check to handle cases where less than 5 articles are found.

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

Added the "kind": "article" parameter to the API request. This should
only return articles to the user instead of courses, lessons
or quizzes.

Also updated the "Here are the top x results" message to handle a
variable amount of articles.
[Ticket: python-discord#828]

Relevant Issues

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

Description

Did you:

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

This was just a suggestion ๐Ÿ‘
You can also do something similar to the following code.

        if len(articles) == 1:
            description="Here is the result:"
        else:
            description=f"Here are the top {len(articles)} results:"
            
        article_embed = Embed(
            title="Search results - Real Python",
            url=SEARCH_URL.format(user_search=quote_plus(user_search)),
            description=description,
            color=Colours.o...
oak estuaryBOT
#

Doc item doc_item.symbol_id='arcade-api' present in loaded documentation inventories not found on site, inventories may need to be refreshed.

regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: dmrelay\-mod\-channel
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: Add\-concurrency\-to\-all\-workflows
odd spireBOT
regal archBOT
#

This concurrency rule means that workflow actions will be cancelled if a new set of actions are triggered on the same ref. A ref is either a PR or a branch itself.

Doing this means that if someone pushes to a PR multiple times in quick succession, workflows won't get queued up. Instead, only the workflows from the most recent changes will run, as this is all we really care about anyway.

I see the benefits of this as twofold.

  1. The author gets faster feedback about the most recent chan...
odd spireBOT
regal archBOT
#

Some symbols always generate stale inventory warnings because some of the symbols they list are not present on the linked page, presumably because the formatting of the rst file or some other part of the doc build process is wrong. (for example the environment-variables symbol on https://www.pygame.org/docs/ref/pygame.html)

This PR adds a counter that's kept in redis and is incremented every time a warning is attempted to be raised for an item, its expire is also set to 3 weeks in the fu...

odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

There have been instances of a doc inventory not working because of the base URL being misconfigured, this PR makes the URL optional to prevent issues like this from occurring.

For every inventory currently added on the bot, the method of extracting the base URL from the inventory URL by removing the last path segment holds true (the only package where it wasn't true from a recent dump had an invalid base URL to begin with).

At first I thought of making the inventory URL optional and d...

odd spireBOT
regal archBOT
regal archBOT
#

Relevant Issues

<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->
Issues:
Closes #428
Closes #500
Closes #608
PR:
Closes #610

Description

Initial commit, looks like all of my previous commits are included in this PR by accident. ยฏ\_(ใƒ„)_/ยฏ

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

Can you elaborate here what was discussed?

@mbaruh We talked about whether the editing things were necessary given that we already have edit logs which not only show edited message but all iterations of edits.

The changes mean that the message will be relayed as-is at time of reporting (which in my mind at least makes more sense), it will still be cleaned up once the incident is actioned.

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: time
umbral grove
#

^ @ocean rock told me to

odd spireBOT
regal archBOT
#

I've noticed we didn't raise for status when requesting the html of the page to parse which caused some invalid pages like 404s attempted to be parsed, I set it to true in 23a3e5e.
This should also prevent the cog from trying to parse invalid pages because of misconfigured inventories or completely wrong symbols. They won't hit the the stale warning handler now and will instead be logged as a normal network warning with a full traceback

#

Relevant Issues

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

PR
Closes #610

Description

Initial commit, starting PR from original forked branch.

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

Description

Add a .gitmessage file to have the same message come up for running the command line git commit command. There are templates that exist and can be modified to match the communities needs. Users will have to configure their .gitconfig (or this can be pushed as well) to use the .gitmessage as the template for their commit messages. The command line command to configure this is:

git config --global commit.template ~/.gitmessage
Users may need to change the relative path...

regal archBOT
#

Many a times when users ask for resources, the !resources command comes handy
However when a user asks for a specific resource like, where can i find a good python book , using the !resources command is out of context even though it has a section for books

My idea is to implement a specific resource command, like !books or !resources books which links to https://pythondiscord.com/resources/reading/

This feature is not just for books but for all categories which is part of the r...

regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: ignore\-infra\-mods\-errors
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

@magicandcode will you eventually be resolving the reviews in this PR?

Hi, I'm so sorry for not responding, had no idea I was being pinged on GitHub, still new to the whole collab part. The e-mail notification today is the first I've seen on this.
I should never have made this PR, I didn't want any reviews or comments (yet, as I said in the PR), just made a draft to see how things worked and to set it up. I've been working on this issue but it seems neither I nor my collaborator has a ...

regal archBOT
regal archBOT
#

This still doesn't protect against the infinite loop, seemingly because of an off-by-one bug throughout this cog. A simple fix for this would probably be just to use min(DEFAULT_QUESTION_LIMIT, topic_length-1), or you could look into this further and try and fix this off-by-one in the rest of the cog (I think the root cause is line 389 if len(done_questions) > self.question_limit and hint_no == 0: which should instead be >=, as if the number of completed questions is greater than the li...

#

I'm not sure this was resolved. If we think it's hard to guess because of the punctuation we could give the punctuation with the words redacted before the description, this would also help people know the order/length of words, could maybe do that the same as how we do it from the extract

cleaned_title = title
for word in re.split("[\s-]", title):
    word = word.strip(string.punctuation)
    secret_word = "\*"*len(word)
    cleaned_title = re.sub(rf'\b{word}\b', f"**{secret_w...
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: discord\-2\.0
#

Since the Discord.py repository has been archived, we can switch to the latest commit of 2.0a0, knowing no breaking change will occur (still pinned to the commit just in case).

This commit also solves two small problems due to that fix, the avatar interface changing and Embed.name disappearing. Quite a painless migration.

I took the liberty of adding two QoL things:

  • Adding mentions as a valid trigger for the bot
  • Making the bot automatically join new threads
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

Copying the docstring from Discord.py could be good too.

    The lookup strategy for message ID is as follows (in order):

    1. Lookup by "{channel ID}-{message ID}" (retrieved by shift-clicking on "Copy ID")
    2. Lookup by message ID (the message **must** be in the context channel)
    3. Lookup by message URL
``` I suggested opening a PR and getting feedback during review :)
#

As wookie said, we already have this game in the bot, just under a different theme.

Please feel free to take a look at the snake antidote game source and see how it compares to your planned implementation. You could always see if you'd do it differently or if there are improvements to be made.

Alternatively, you can wait a few days for the discord.py 2.0 PR to be merged, and re-write snake antidote with buttons!

#
[python-discord/bot] branch deleted: experiments/akarys/check\-licenses
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: discord\-2\.0
night lilyBOT
#
Sir Lancebot

Connected!

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

Description

I created a Hangman game in Python and would like to add it to Sir Lancebot via a new cog.

Reasoning

I think Hangman is a game I am sure many people will want to play!

Proposed Implementation

I would like to add a new cog to Sir Lancebot with the command .hangman

Would you like to implement this yourself?

  • [x] I'd like to implement this feature myself
  • [ ] Anyone can implement this feature
odd spireBOT
regal archBOT
#

Good stuff, just small things.

Btw, this is extremely picky so I wouldn't ask you to change it, but as python's range ends are exclusive, if for example you were looking for 2xx response codes you would check in range(200, 300) rather than range(200, 299). That said, 299 isn't a valid status code, so in practice this would make no difference at all!

I went ahead and changed it, doesn't hurt to keep things proper (and I am already making changes, so what's one more smal...

#
jb3
[python-discord/site] New branch created: jb3/update\-gunicorn\-prefs
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

I do not personally see any reason behind the dormant phase of a help channel. Once a question is answered, or the channel is closed, why should that help channel not then return to being available? Currently as of writing this there are only three available help channels with twenty-seven channels waiting an arbitrary amount of time to be re-opened.

Maybe I am missing the purpose behind the phase, but to me it just limits the available channels, requires more help channels as most are sit...

#
jb3

Currently there are only so many to account for the large amount in the dormant category.

We don't want to delete help channels because of the archival benefits, so at peak we have seen every channel you see today in use at once.

Without the dormant category significantly less channels would actually be needed.

This isn't so, no matter where the channels are at peak times all will be in use or all will be in available.

it just limits the available channels

This isn't how...

regal archBOT
#

This doesn't seem quite right at the moment, the .Embed shouldn't be that, and ERR_UNKNOWN.format(code=code) needs to be passed in as a keyword argument, so set_footer(text=ERR_UNKNOWN.format(code=code)).

What I noticed to get this result is that instead of returning 404 when the image isn't foundlike the cat url, httpstatusdogs.com seems to return a 302, meaning it isn't caught in the elif and gets to the else. We could probably change line 64 to check for 302 first, `elif respons...

odd spireBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: support\-infraction\-id\-search
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Sentry Issue: BOT-Z0

This may be related to #905 and #1780. If it's a role hierarchy issue and an expected failure, then let's suppress the exception.

Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
  File "discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot/exts/moderation/modpings.py", line 98, in off_command
    await mod....
regal archBOT
#

Will this put the main branch into its own concurrency group? Cause that may not be a good idea. The cancellation is premature โ€” it can't actually know if the newer workflow will even succeed. Imagine two different features are pushed to main at around the same time. If the newer workflow cancels the older one, and then the newer one fails, then neither change will get deployed. The older workflow could have succeeded and at least that change could have been deployed rather than nothing at al...

regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

Not suggesting it should be changed in this PR, but do we actually need a form of cache at all for this? All the cases it is used it seems to be refreshed before use (unless i'm missing something), which seems to sort of defeats the point of caching it.

There also seem to be quite a few validation requests before making the site request (often meaning extra api requests are required). As the site already does validation it would probably be much easier just to handle those failures (althou...

#

At the moment, posting a link to github causes the bot to respond with a manually performed codeblock snippet of the contents linked. However, if the user edits their message to change the link, the contents of the embed do not change, and the user has to re-send their message to get updated contents.

We've previously implemented similar behavior for the Eval cog, with a refresh icon. However, in this case, because the response is automatic and not derived directly from user interaction, I...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: Use\-permissions\_for\-over\-permissions\_in
#

Sentry Issue: SIR-LANCEBOT-65

AttributeError: 'Member' object has no attribute 'permissions_in'
  File "discord/ext/commands/core.py", line 167, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot/exts/evergreen/bookmark.py", line 106, in bookmark
    permissions = ctx.author.permissions_in(target_message.channel)

Unhandled command error: 'Member' object has no attribute 'permission...
#

Relevant Issues

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

Description

discord.Member.permissions_in() was removed in d.py 2.0 in favour of using discord.Channel.permissions_for everywhere.

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

After a long discussion on discord it was decided to simply just catch the error raised by using !starify on members above the bot in the role hierarchy.

A summary of reason is basically that in the other cases we want to know something went wrong, because there shouldn't be an error in any other infractions due to the user being staff (we can successfully ban/kick/mute/etc. staff, including Moderators+, it's only starify we can't as it changes nickname which is hierarchy dependant.)

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

Relevant Issues

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

Description

Added newlines before and after codeblocks that didn't have them already. From testing it seems they're only technically required before to fix the android rendering issue, but I added them afterwards as well for consistency.

Did you:

odd spireBOT
regal archBOT
#

Sentry Issue: SIR-LANCEBOT-66

AttributeError: 'Member' object has no attribute 'permissions_in'
  File "discord/ext/commands/core.py", line 167, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot/exts/evergreen/fun.py", line 82, in uwu_command
    text, embed = await Fun._get_text_and_embed(ctx, text)
  File "bot/exts/evergreen/fun.py", line 200, in _get_text_and_embed
    if isinst...
#
[python-discord/bot] New branch created: infraction\-last\-support
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

Description

Sir-Lancebot, way back in the day, was created around seasons. We'd have things associated with Christmas, Easter, Valentine's Day, and then year-round things that we put under the "Evergreen" folder. With the growth of our community, Sir Lancebot has since outgrown this structure.

I'd like to re-organize Lancebot to be more general and less revolving around seasons.

Reasoning

I think restructuring it to not be focused around seasons will make Lance's structure eas...

regal archBOT
regal archBOT
regal archBOT
regal archBOT