#dev-log

1 messages · Page 67 of 1

regal archBOT
#
[python-discord/bot] branch deleted: wookie184\-tag\-updates
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

Description

One of the biggest hurdles that people face when setting up the bot, is the lack of helpful information when things go wrong. From redis, to the API, plenty can go wrong, and it requires experience to read the traceback and figure out why.

Inspiration

This PR aims to take a step in fixing that, by offering more descriptive errors on startup. This is inspired by #1385, but only covers a portion of the proposed changes.

Implemntation

This PR does two things:

  1. It lo...
odd spireBOT
regal archBOT
#
[python-discord/snekbox] branch deleted: dynamic\-parent\-cgroups
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: modifying\-topics
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#
[python-discord/api] New branch created: add\-endpoint\-issue\-template
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: dependabot/pip/aiohttp\-3\.7\.4
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: startup\-errors
oak estuaryBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/snekbox] New branch created: recursive\-remove\-cgroups
#
jb3

After #91 was merged we starting seeing errors with large stdout causing errors like the following:

2021-02-26 16:02:56,706 |    14 |                 snekbox.nsjail |     INFO | Executing code...
2021-02-26 16:02:56,741 |    14 |                 snekbox.nsjail |     INFO | Output exceeded the output limit, sending SIGKILL to NsJail.
2021-02-26 16:02:56,743 |    14 |                 snekbox.nsjail |     INFO | nsjail return code: 137
2021-02-26 16:02:56,744 |    14 |     snekbox.api.r...
odd spireBOT
regal archBOT
#
[python-discord/snekbox] branch deleted: recursive\-remove\-cgroups
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: plural\-events
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

8db7495 Add pydantic and fastapi to the dependencies - Sebastiaan Zeeff
6f3eee9 Add uvicorn to the development dependencies - Sebastiaan Zeeff
a03c568 Add custom TokenAuthentication middleware - Sebastiaan Zeeff
668f5a4 Add minimal API with health check endpoint - Sebastiaan Zeeff

regal archBOT
regal archBOT
regal archBOT
#

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

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

#

b3ad47a Feature: suggest command usage for misspelt com... - F4zii
adfb87e Merge branch 'master' into feat/F4zi/CommandSug... - Akarys42
dfe9dd8 Seperated tags.get_command into a function and ... - F4zii
eb01f3f Feature: suggest command usage for misspelt com... - F4zii
777088b Merge branches 'feat/F4zi/CommandSuggestion' an... - F4zii

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

Yes. It may seem like it doesn't come up because exceptions are not caught anywhere and this is more of a proactive measure than a reactive one.

I made some progress by implementing this https://github.com/python-discord/bot/blob/master/bot/utils/scheduling.py#L160-L164

However, there is no support for scheduling on a loop (which is necessary to be able to schedule tasks before the loop starts) nor is there support for retrying upon failure. Still, logging exceptions is beneficial for a...

regal archBOT
#

ed9e1c8 Add package docstrings to init.py files - SebastiaanZ
7dd5168 Add docstrings to modules and functions - SebastiaanZ
9e01891 Configure Settings to automatically read from .env - SebastiaanZ
169354a Add commit sha to API health check response - SebastiaanZ
cb938a3 Add dependencies for async tests - SebastiaanZ

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

Remember to target the dewikification branch with this pull request

We should add functionality to group resources by experience level, for example some of our editors are really suited for beginner programmers and some for advanced, but we have no way of distinguishing that right now.

Each resource in our collection should have a difficulty rating which is one of:

  • Beginner
  • Intermediate
  • Advanced

This issue supersedes python-discord/meta#49.

regal archBOT
#
[python-discord/forms-backend] branch deleted: abouelela\-codeowners
#
[python-discord/forms-backend] branch deleted: feat/9/unittest\-validation
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/forms-backend] branch deleted: dependabot/pip/uvicorn\-0\.13\.4
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

For all infractions that remove the individual from the server, the infr_type argument that gets passed to this function is 'Ban' (upper-case B), as opposed to 'ban' or 'kick', which are the names for those infractions used elsewhere in the code base. I therefore decided on a string literal in the function so that we don't give the false impression that 'Ban' is used elsewhere.

odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: Add\-lancebot\-to\-staff\-channels
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: comparison\-tag
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: Add\-lancebot\-to\-staff\-channels
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#
[python-discord/branding] New branch created: banner\-pattern
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: modifying\-topics
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/branding] New branch created: fix\-pattern
#
jb3
[python-discord/branding] branch deleted: fix\-pattern
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: error\_pages
odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: license\-year
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/bot] branch deleted: license\-year
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/site] branch deleted: error\_pages
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
#

When users use the !pypi command with an invalid module, you currently get a response saying "Package could not be found.".

What I'm proposing it that after a delay (I believe we have bot.constants.RedirectOutput.delete_delay for this) the bot should delete both its response and the invocation message, like !d currently does.

This would help reduce channel flooding when someone is trying to reme...

regal archBOT
#

Relevant Issues

Closes #602

Description

Gets the fuzzy match of a search query, returns None if the ratio is below 90 else returns the fuzzy match. If the return is None, then we send our custom Error Message else it sends the link to the subsection of the WTF Python README.md.

Reasoning

Approved by a staff.

Screenshots

On Dark Theme

![Screenshot from 2021-03-02 15-22-56](https://user-images.githubusercontent.com/69356296/109631103-a67f2680-7b6b-11...

odd spireBOT
regal archBOT
#

Description

#482 Was merged a couple hours ago, and in it, the following change was introduced:
https://github.com/python-discord/sir-lancebot/blob/53af90f92258905c2bfc4c2db2341dfd1fdc0124/bot/bot.py#L74-L82

This logs an error for every single channel we have into sentry.

Steps to Reproduce

Startup the bot.

Expected Behaviour

It should only log missing channels.

Actual Behaviour

All channels are logged as missing.

Possible Solutions

So this bug ...

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

Connected!

oak estuaryBOT
#

According to the API, your request is malformed.

regal archBOT
regal archBOT
#

Holi, also known as the festival of colors, festival of love, or the festival of spring is March 28-29 this year. It'd be super chill if we had a logo for this since we had a logo for Diwali.

If anyone is interested in making a logo for this please comment here~

#
[python-discord/forms-frontend] New branch created: prism\-code\-demo
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: mbaruh/defcon
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
#

Description

The .http_status .status and .httpstatus commands do not recognize HTTP status code 418 (I am a Teapot) as described in RFC-2324 : Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)

2.3.2 418 I'm a teapot

Any attempt to brew coffee with a teapot should result in the error
code "418 I'm a teapot". The resulting entity body MAY be short and
stout.

Steps to Reproduce

Input any of the following commands in ...

#
[python-discord/bot] New branch created: mfa\-token\-filter
regal archBOT
#

I really like the idea of using the frontloaded YAML for the meta file. Assuming the #changelog notif will be sent as an embed, we will basically have a tag with some extra meta information (not to digress, but could Python's tag system also benefit from this?).

However, I think we need to decide on how to define the time periods. The proposed example is a little different to what I imagined, which was to have year-agnostic dates, e.g.:

period: 24/12  # Active on the 24th of Decemb...
#

Everything proposed in this issue sounds great to me. Provided we design the meta.md files well, none of this should be difficult to implement, though I'd still like to update the cog's internals a little bit, in particular:

  • Probably use d.py's tasks extension for the daemon
  • Use Redis to persist the last icon cycle date so that the cycle maintains a consistent n-day schedule even across restarts

Are there any commands that ...

regal archBOT
#

I have a quick suggestion. Maybe add a branding command (eg. !branding) that anyone would be able to use to see what the current branding is, what it means, and why it's there.

This could help with certain events like international holidays such as the Diwali ones where many people may not known what it means. This is just a rough idea, but maybe something like:

Branding
Right now, PyDis's current branding is for Saint Patrick's Day.

_Goes on to elaborate about the da...

regal archBOT
#

Added .earth_photos command

Closes issue #174

Description

Added a .earth_photos command by using the unsplash api

Reasoning

An approved issue I was assigned to.

Screenshots

image

Additional Details

Please add environment variable UNSPLASH_KEY and set it to the key for an unsplash app created on their API

Did you:

  • [x] Join the [**Python...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

Relevant Issues

Closes #428
Closes #500
Closes #608

Description

Removed HTTPStatus from the equation entirely in favor of just relying on the cat/dog servers to send us back errors if we get bad input.

Minor refactor to pull strings out of the executable code into variables at the top.

Reasoning

Implemented design and strategy suggested by staff in #608 discussion.

Screenshots

Did you:

  • [X] Join the [Python Discord Community](https://di...
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: ks123/talentpool/migrate
#

@kwzrd
I think your suggestion is fine, provided that we accept an optional years parameter for non-recurring events, like we discussed in the community.

@dawnofmidnight
I don't necessarily mind having a !branding command, but I'm not sure if it's necessary if that information is always going to be available in #changelog. Either way, it'd have to be implemented after we're done with these initial changes, as I'm hesitant to expand the scope of this task further.

If you're keen ...

#

Probably use d.py's tasks extension for the daemon
Use Redis to persist the last icon cycle date so that the cycle maintains a consistent n-day schedule even across restarts

Excellent ideas.

Are there any commands that the cog currently doesn't offer, that would be useful to have?

There was a suggestion in https://github.com/python-discord/branding/issues/123 to add a sort of branding info command that would just display the same as we're gonna put into #changelog. I'm not opp...

odd spireBOT
regal archBOT
#
jb3

We could also just validate that codes are below some sane value, like 999.

Convert to an integer and handle any failure there, then check the integer is greater than 0 and less than 999, we don’t need to bring textwrap into it.

On 3 Mar 2021, at 14:28, Shivansh-007 notifications@github.com wrote:

@Shivansh-007 https://github.com/Shivansh-007 Could you list some reproduction steps to help @sam-heller https://github.com/sam-heller with fixing it?

We can make use textwrap...

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

I've dismissed my review for now, as it seems we are now in compliance with the API's requirements. I tried to make sure we meet them to the best of my ability, but I am not a lawyer. If someone is more legally inclined, or if someone has time to sort through a bunch of requirements, I'd appreciate a second set of eyes looking over: https://help.unsplash.com/en/articles/2511245-unsplash-api-guidelines.

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

Description

Similar to the issue open for supporting GitHub CodeSpaces. When you try to use Gitpod for sir-lancebot, you have to install lots of things manually.

Reasoning

Quicker development times online as there is no need to manually install dependencies.

Proposed Implementation

Creating a .gitpod.yml file, described here

Would you like to implement this yourself?

  • [ ] I'd like to implement this feature myself
    ...
#

Okay, sounds like I can start moving things around. It quickly became apparent to me that I will be writing some sort of validation script for my own self anyway, to be safe that all event directories are setup correctly. So we'll see, maybe I'll include it in the PR.

I'm interested what kind of CI setup we'd come up with. Since it'll depend on something (python-frontmatter works well, although it hasn't had a commit since late 2019, but it...

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

Using this event here doesn't prevent such situation: as soon as an item is fetched from redis (or not found), the event will be set and the refresh will finally be allowed to continue. It will end up clearing everything potentially before get_markdown is called.

To avoid crashes in get_markdown, store the relevant future as a local variable rather than always accessing it through the dict.

regal archBOT
#

Relevant Issues

Closes #1226

Description

Whenever a staff member would post a message in #incidents channel, it would be searched through a regex and all the message links in it would be extracted.

Then the bot would send this the messages the link point towards in embeds.

The Embed would contain the following information -->
        Author: @Jason Terror ♦ (736234578745884682)
        Channel: Special/#bot-commands (814190307980607493)
        Content: This is a...
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

Connected!

odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
#

I've removed it in fbe52273 and replaced it with a simpler system. A future is created either when an user requests it or the parsing of its associated doc item begins, then it is kept in the dict until its result is set.
I've replaced the redis set task with a normal await to prevent a potential race condition when the cache wouldn't be set before the item deletion and an another request for the item came in from an user.
I believe it didn't introduce any race conditions or logic errors bu...

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

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

@MarkKoz It does not kick them out. We would have to boot them from the voice channel. Currently, I'd prefer if we don't implement anything for it at the moment, as Mods+ do have permissions to boot someone from VC manually.

Typically if it came down to that, either they'd be receiving a voice ban or some other full infraction, which would bump them off call anyway. Even a regular server mute does so.

regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

When a user joins the voice chat for the first time, they receive a ping in the #voice-verification channel. This was done in an attempt to solve new users' confusion as to why they couldn't talk when joining the chat. However, it does not seem to be having the desired effect, as there are still quite a few users still confused.

The proposal now is to send a DM to the user with a link and explanation so that they have a lasting link and reminder on how to get verified. Message requir...

regal archBOT
#

We usually recommend that you raise issues before raising a PR directly to the repo, as it's possible the core dev team will have opinions.

As far this change, we are currently porting this over to Sir Lancebot with https://github.com/python-discord/sir-lancebot/issues/530 and https://github.com/python-discord/sir-lancebot/pull/569

If we decide that we want these changes in the meantime, my comments are below.

regal archBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
jb3
[python-discord/bot] New branch created: json\-logging
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT