#dev-contrib

1 messages · Page 59 of 1

neon phoenix
#

@green oriole you can do

@bot.event
async def on_message_edit(before: discord.Message, after: discord.Message) -> None:
    await bot.process_commands(after) ```
green oriole
#

Ah nice

patent pivot
#

I mean

#

not really

#

I think that could get spammy

#

I think it would be cool if it like, edited the bot response as well

cold moon
#

Maybe this should check does this triggered command in original message. When it does, then this shouldn't run command, but when not, then this should run.

#

Like for typos

cold moon
green oriole
#

It is pretty good, although maybe it should be oriented the other way, I dunno

neon phoenix
#

One question

#

If I open an issue that suggests some code changes, should I start working on the code immediately?

#

Or there is need to wait for approval?

#

I found an inconsistency on the code and I'd like to fix it

crude gyro
#

@cold moon I like it! I think the orientation is perfect.

#

can you make a PR for it?

brazen charm
#

Making sure it's not intentional, needs fixing and that nobody else is doing it in an another pr would be best before you start doing something

neon phoenix
#

Well, it's about the help_cleanup on bot/cogs/help.py

#

Why use that instead of wait_for_deletion from bot/utils/messages.py

neon phoenix
#

It seems that you ignore some flake8 lint errors that are actually errors when you use Azure pipelines' linter

#

For example, the flake8 import in not alphabetical order is ignored but in the Azure pipelines' linter is not

#

That caused me to fail a test, like, 1 week ago

tough imp
#

The lint in CI is using the same config

patent pivot
#

the failure just now in #dev-log was not a linting failure

brazen charm
#

Then you probably didn't set it up properly or used the wrong flake8

tough imp
#

We're not ignoring those yeah

#

This is the config that is used both locally when you do pipenv run lint and in the pipeline

#

I'm not sure how flake8 chooses config but afaik it's also possible to have a global config file in your user folder, maybe you're ignoring them there? maybe that wouln't even work, not sure

neon phoenix
#

I used pipenv run lint

#

Well...

#

Then you probably didn't set it up properly or used the wrong flake8
@brazen charm oh right

#

I forgot to install the dev packages

#

But somehow I got precommit and flake8

green oriole
#

Unh

eternal owl
patent pivot
#

I made some progress towards it but still found DRF was not performing brilliantly during the serialisation stage

#

I was not trying to solve the issue bear in mind, just improve performance

#

Took the request from like 30s to 9s or something

eternal owl
#

thats a significant improvement

patent pivot
#

and I was aiming for speed there, it has many shortcomings

#

I queried the api_user_roles table directly because Django prefetch is not very performant

#

we had a pretty long chat about it in the devops channel, lemon summarised our ideas into the two issues

eternal owl
#

okay, I will look into the models and study the project a lil bit

patent pivot
#

👍

green oriole
obsidian patio
#

I think it’s time to update the member count on the bot repo

#

We’ve grown more than 50% since that

sullen phoenix
#

we should probably wait until after our future prune

#

which will be when #1077 gets merged

#

.issue 1077 bot

dusky shoreBOT
obsidian patio
#

Prune? Are you gonna get rid of a lot of members by then?

#

Aah, I read the issue now. Looks promising, but a bit scary

#

How many members do you recon don’t have the developer role?

sullen phoenix
#

exactly 21,524 members currently

#

this PR would kick about 11k people if it was merged right now

obsidian patio
#

What about the other 10k?

#

Also, I think it sounds quite reasonable. Having dormant members doesn’t really add to the community

sullen phoenix
#

about 8k would be given the pinging role, and the rest would be left alone

obsidian patio
#

Aah, alright

sullen phoenix
patent pivot
#

hahahahaha

sullen phoenix
#

wait this is the wrong channel lol

patent pivot
#

okay laughed there as well

sullen phoenix
#

lmfao

clever wraith
#

What is that number about, those 21,524?

sullen phoenix
#

that's the number of people who aren't verified

hardy gorge
#

Hmm, this PR is the one that disables burst shared in verification, right?

#

Would be nice if we actually could do a single ping before kicking the masses

sullen phoenix
#

yeah, it disables that when the ping is going to occur

hardy gorge
#

Is there a method of postponing the first mass kick?

tough imp
#

You can do an @everyone right?

#

before the merge

hardy gorge
#

Currently it would probably trigger a massive burst shared

#

And the burst shared is only disabled after the merge

sullen phoenix
#

it's going to ping core devs before it prunes the people

tough imp
#

It will ask for confirmation that all those people should be kicked

sullen phoenix
#

since there's so many

tough imp
#

if you deny, it will ask again in 30 minutes

hardy gorge
#

Okay

tough imp
hardy gorge
#

Sounds reasonable normally, although I'd rather give them a day or so before we enable the exterminator

#

I have no qualms kicking them proactively after they've received the ping treatment

tough imp
#

mm the first @Unverified ping will happen before most people receive the role

obsidian patio
#

Wouldn’t it be good to ping all people without roles beforehand, so people get a warning about what will happen?

tough imp
#

yeah but when we do that it triggers our anti-spam rules

obsidian patio
#

Pinging everyone in the verification channel or one restricted to only people without roles could be an option to only ping those people

#

Really? Why?

tough imp
#

because a lot of people start sending the !accept message

obsidian patio
#

Oh. Okay

tough imp
#

we can talk about how to ease this feature in. I think cherry picking that commit and doing an @everyone in the verification channel sounds like the easiest option

#

then after a day or so, we can merge the full feature

#

the role assignent and the kicking are done as part of one task, so we cannot enable just one

#

it's that way because the sets of people for the role and for the kick should be disjoint, so they need to be aware of each other during construction

#

actually no, a cherry pick is not even necessary

#

we can just merge it and not enable the tasks, the setting defaults to disabled

#

since we don't need the @Unverified role to be assigned for the @everyone ping, that would be fine, I believe

hardy gorge
#

Sounds like a good option, if that works

#

But would enabling the tasks take another commit?

tough imp
#

yes, nothing will happen after the merge, not until !verification start, which should cause a prompt to appear in #dev-core for the 10k kick

#

there's a command interface

#

start stop status

patent pivot
#

@tough imp for reference can you make sure that if it receives discord.errors.Forbidden: 403 Forbidden while it stops the task immediately and pings everyone in deve-core

#

because if anti-spam kicks in that is the error that will be received

tough imp
#

when would this error appear?

patent pivot
#

ah, on DMing users

#

it would look like ```
discord.errors.Forbidden: 403 Forbidden (error code: 20026): Your bot has been flagged by our anti-spam system for abusive behavior. Please reach out to our team by going to https://dis.gd/report and selecting "Appeal an Action Trust and Safety took on my bot" as the Report Type.

tough imp
#

well thats a problem

#

its currently ignoring 403s from the DMs because it will get them for members with closed DMs

patent pivot
#

hmmm

tough imp
#

so it will have to look at the error code too I guess

patent pivot
#

yeah

tough imp
#

I dont think theres an easy way to do that currently

#

to stop the task, from within the request coro

patent pivot
#

hmmmmm

tough imp
#

the requests are quite isolated

patent pivot
#

it looks to just be error.code

tough imp
#

I would have to discuss with Mark

patent pivot
#

right

#

that's fine

#

@tawdry vapor 😃

tough imp
#

this gets passed to a function which executes this on all members in the given member set

#

there's no way for the request coro to communicate to the executor that it should stop

#

it could return some sort of signal

tawdry vapor
#

Yes that or reraise the exception

tough imp
#

if its a subclass of discord.HTTPException that would just get collected into bad_statuses

#

but I guess it could raise a custom exception?

#

for this kind of signaling I think raising makes more sense then returning

#

it'd also lead to much nicer code

#

just another except clause

tawdry vapor
#

Doesn't have to be custom

#

You can check for that specific status and code instead of appending to bad statuses

tough imp
#

right but then we'd be checking for the error code in two places

#

in the coro and outside too

#

because inside it still has to ignore 403 if they aren't 20026

#

so whether it lets the 403 propagate out must be conditional

#

@patent pivot could you please leave a comment on the PR requesting this to be added, just to make sure we don't forget

patent pivot
#

for sure

tough imp
#

thank you

tawdry vapor
#

Then return something instead

tough imp
#

would you hate if I raised a custom exception?

tawdry vapor
#

Kind of

brazen charm
#

Could someone create a dump of the doc inventories in !d for me? Had to recreate the environment and doing it manually is a bit of a pita

patent pivot
#

sure one sec

#

what format do you want it in, SQL inserts?

brazen charm
#

Yeah that would be nice, but whatever is convenient for you as anything will be better compared to going through the pages

patent pivot
#

I can pull SQL inserts straight out with datagrip

brazen charm
#

Thanks

green mesa
#

How py bot comment when someone propose pr ?

#

It uses Gitub action? Or something else?

patent pivot
#

GitHub webhooks our GitHub app which then sends an API request back to GitHub

green mesa
#

Ok ty🙂 for explanation

eternal owl
#

https://github.com/python-discord/site/issues/375
I have a question regarding the batch updates.
This is how I understand it:

send a POST request to bot/users end point -> the request contains a list of objects(dicts) of each user and assuming that the ID of the user is also provided. If the ID is present in the db, then update the instance according to the details provided in the request else create a new User```
#

is this the right interpretation?

#

or is it send PATCH request to bulk update(assuming that ID of each user provided in the request)? and do not create new users?

tawdry vapor
#

It basically means that instead of sending one request per user, we put all those payloads into a list and send the list as a payload.

#

Creating and updating users should still be separate.

#

That being said, I'm not sure if they should be separate endpoints or replace the existing ones.

#

Maybe DRF supports both in a single endpoint? I dunno

neon phoenix
#

metricity's going crazy with the auto-deployments

#

btw, what's metricity?

molten bough
#

It's @patent pivot's stats bot that integrates with @stable mountain

patent pivot
#

yep

#

open source soon™️

molten bough
#

Haah

#

Well I can't say I'm surprised with my typing style

neon phoenix
#

Hm, are members automatically opted in unless stated otherwise?

molten bough
#

I believe it's one of the things you agree to when you verify, the privacy policy

patent pivot
#

@neon phoenix yeah, it's covered by our privacy policy (I have updated it today to make things a little more clear)

#

It tracks barely any information though

#

no content or anything

neon phoenix
#

okay

patent pivot
#

and soon:

  1. @viscid badge will be open source
  2. I'll be working on public datasets
#

I can already generate datasets

neon phoenix
#

epic

patent pivot
#

I'm trying to make it as open as possible to convince people that we really aren't big brother, but we just want cool graphs to show people things!

patent pivot
#

I think it's ready to open source

neon phoenix
#

👀 let's see the sauce code

patent pivot
#

just doing some branding and docs stuff

patent pivot
molten bough
#

\o/

neon phoenix
#

owo

patent pivot
#

there could be more documentation, and I'll add that gradually

#

and also more could be split up

neon phoenix
#

I like how you made that metaclass

patent pivot
#

yeah I took inspiration from Python for the config loading

#

except I used toml, since the section stuff made more sense imo

#

I found a nice deepmerge library which handled all the overriding for me

#

and added some custom stuff for env var loading

#

went from liiiike, minutes to minute

#

chunks of 2,500 users at a time

#

PRs welcome sunglas

neon phoenix
#

@patent pivot hm, about the coloredlogs

#

Windows users also should install colorama, right?

patent pivot
#

yeeeees

#

ooooo

#

is that an additional dep

neon phoenix
#

I don't see it on the toml

patent pivot
#

Yeah it isn't

#

I overlooked it because Mac and ANSI on windows 10

neon phoenix
#

ah okay

green oriole
#

Metricity looks very interesting

patent pivot
#

I'm observing how it performs in prod now, metricity is metricising itself lul, and I'll see where I can take it from there

neon phoenix
#

if message.author.bot: return lemon_infant

green oriole
subtle kraken
gritty ocean
#

yo

#

how to contribute?

crude gyro
obsidian patio
#

@patent pivot will more stats be available as well? I’d love to see more of the weird stats that you usually pull up

patent pivot
#

For now metricity will take over messages and maybe commands in future. It isn't exactly time series so it's more just logging when events happened. We still have the existing stats stack which can always have more stats added. I forget how many individual metrics we have but I know that statsd processes about 10 million metric updates per week

neon phoenix
#

how much average time people are spending on python discord lemon_pleased

patent pivot
#

lol that's a pretty hard metric to measure

neon phoenix
#

you could get data like how much time people are typing

#

and then do some maths

#

idk

crude gyro
#

between me and joe alone, we have nearly 400,000 messages

#

but we spend a lot of time on stuff that doesn't require sending that many messages here

#

we're in voice chats, we're writing code, we're working on spreadsheets..

#

so it still wouldn't be a very good metric.

neon phoenix
#

well, okay

crude gyro
#

we spend a lot of time on python discord

#

almost all my free time

neon phoenix
#

I thought it was going to be a good metric
Well, it is, but it's hard to track

patent pivot
neon phoenix
#

You could scrap all that data, although I don't know if it's possible

patent pivot
#

I built the stats stack before Discord released insights, so I wasn't sure what was on there. Now that we have that information I will look into what metrics we can discontinue or tone down since they are provided by Discord. Our stats stack is meant to compliment server insights, not be a clone.

#

Eh, not sure why we need to clone it

neon phoenix
#

So it can be public?

patent pivot
#

I mean, the entire moderation staff has access to both server insights and grafana

#

Right, but I'd probably rather we manually process data we are making public

#

because if we combine Discord data with our own (for example, I generated some comparisons of server discovery growth with member retention & users passing our role gate) we get much more powerful datasets.

molten bough
#

That voice graph haha

obsidian patio
#

Yeahh hahah

#

It just skyrocketed

eternal owl
#

my PR failed on Generate Coverage Reports step, can anyone explain what that is and how I will be able to solve the problem?

tough imp
#

Coverage failure: total of 99 is less than fail-under=100

patent pivot
#

We enforce 100% coverage for code on site so everything must be tested

eternal owl
#

ooh so its saying that tests are missing?

patent pivot
#

yeah

tough imp
eternal owl
#

ohk, I asked if I should be writting tests for the features implemented in the issue, should I? or will it be done in another PR?

patent pivot
#
Name                                                           Stmts   Miss Branch BrPart  Cover 
-------------------------------------------------------------------------------------------------
pydis_site/apps/api/serializers.py                               141     16     28      4    83% 
pydis_site/apps/api/viewsets/bot/user.py                          30     12      4      0    53% 
#

In general you should be writing the tests for your features

eternal owl
#

those are the 2 files i changed

#

okay

#

I will write em by tmw

patent pivot
#

You need to keep in mind that this cannot be merged until the bot feature is also ready, and this should be backwards compatible to avoid unnecessary downtime

eternal owl
#

okay

patent pivot
#

That may mean we should set a high default paginated value right now, depending on how configurable through code you could check the size of the users table and set that as the default on the endpoint call

#

then once the bot has integrated with the site we can lower that default and have the bot handle it

eternal owl
#

i set the default to 10k

patent pivot
#

104,589 users in the users table right now

eternal owl
#
class UserListPagination(PageNumberPagination):
    """Custom pagination class for the User Model."""

    page_size = 10000
    page_size_query_param = "page_size"```
#

also providing a optional page_size query param

patent pivot
#

right, that will most likely need adjusting to encompass the whole user table until the respective bot PR is also made and merged

#

this endpoint should be able to act exactly like the current one does in terms of response data

eternal owl
#

is anyone working on the bot side?

patent pivot
#

No one is assigned right now, no

eternal owl
#

will it be fine if I can work on that too? I might take a lil longer..prolly within a week or so

patent pivot
#

you should probably ask lemon that one, since he opened both issues

#

I also know that Mark wanted to bring back a many-to-many relationship for users to roles to restore referential integrity

#

I think that's in scope for the site PR

eternal owl
#

oh

patent pivot
#

Up to @crude gyro whether that is in scope or not for this PR, I think.

crude gyro
#

many to many is not in scope, and should be handled by a core dev since it's very sensitive.

patent pivot
#

gotcha

crude gyro
#

handling the bot side would be encouraged though.

#

this is very much a full stack job

eternal owl
#

handling the bot side would be encouraged though.
@crude gyro okay, I will start on it once the site PR is in

crude gyro
#

okay. but keep us in the loop.

#

and expect a tough review. this needs to be done right.

eternal owl
#

yessir

crude gyro
#

and thanks lemon_fingerguns_shades

eternal owl
green mesa
#

Py bot got bugged while adding infranction in genral?

cold moon
#

@crude gyro Tags cleanup PR conflicts resolved

obsidian patio
#

Looks like the stats (set to one year timeframe) have a bit of a bug. It looks like messages went to 0 (~1300) for the last week

#

It just makes it look like the server kind of died the last week hahah

cold moon
#

How to fix conflicting migrations?

green oriole
#

What's the conflict?

#

Divergent history?

cold moon
#

See my site repo tags cleanup

#

Tests is failing

#

Reason is there

green oriole
#

Yeah, that's a divergent history

#

You'd usually manually edit the migration dependency to make a linear history

cold moon
#

🤯

crude gyro
#

Akarys is right, just edit it back so it only has a single head

#

it's also possible to make a merge migration

#

but editing it back to linear is more like a rebase

#

and that's cleaner. and still very easy.

cold moon
#

Should I edit these migration numbers too? There is currently migrations with same numbers.

hardy gorge
#

in the same app?

cold moon
#

Yes

#

in API

green oriole
#

Yeah, that'd be nice

crude gyro
#

yeah, I'd love if you did that

#

it'd been bugging me

timid sentinel
#

!tempban 515208276217036813 14d your only messages seem to be trying to ping everybody with an attempt at a rickroll...

stable mountainBOT
#

failmail :ok_hand: applied ban to @wary pewter until 2020-09-10 10:52 (13 days and 23 hours).

obsidian patio
#

When things like accidental mass pings happen (they will probably happen again), I think we all get tired of hearing “who ping” and “why was I pinged” and seeing #python-discussion become this really off-topic and flooded channel.

Maybe something like a channel called "🔴 Ping: information 🔴", where “ping” changes depending on what’s ongoing. If we’re, for example, experiencing a raid, that gets changed to “raid: information”. This channel would like right above #python-discussion.

Hopefully, most people will click that channel (since it includes their question — “ping?”) and won’t have to resort to asking in #python-discussion

woeful thorn
#

They won’t

brazen charm
#

People will check the channel they were pinged in, an announcement would serve the same purpose

obsidian patio
#

Yeah

#

Maybe changing the name of #python-discussion (or whatever channel it was in) to something like that, muting the channel and creating a channel like “python-general-t” that works like normal could help. That way, they’ll be presented with the message straight away

#

I personally feel like we should have a method that serves this purpose, so we have a good way to manage the “who pinged?” Messages. Right now, the server has been flooded with such messages for a day

woeful thorn
#

There isn’t a good way

#

Besides not pinging everyone by accident

obsidian patio
#

Things like that won’t stop happening. We just need a solid plan for how to handle it

woeful thorn
#

Muting a channel just moves people into another one

obsidian patio
#

Exactly why we should create a temporary duplicate of the channel

woeful thorn
#

People don’t read pins, they don’t read announcements, they don’t read channel names, and they don’t read channel topics

brazen charm
#

You can't change how people act without muting everything

woeful thorn
obsidian patio
#

That sounds very pessimistic. Most people just want to have an answer (or troll)

woeful thorn
#

It’s realistic

molten bough
#

ELA's right, unfortunately, that's been my experience too

#

even on other servers

obsidian patio
#

Exactly why we should create a temporary duplicate of the channel
This is to let the potential flood go to that channel, but have announcements in a freezed one (the original)

#

If we just have a compelling message in the channel that they go to by default (where the ping was), I think we could cut the number of people saying “who pinged?” By quite a lot

molten bough
#

Most of the people that respond badly to pings are going to be people that don't spend that much time here

obsidian patio
#

Same @molten bough. That’s why I think that we should create a duplicate of the original channel, so the potential traffic doesn’t spread

molten bough
#

so it's unlikely they'd know where to look even if they cared that much

obsidian patio
#

That’s why I think we should have the announcement in the channel where the ping was. That’s where they’ll be normally

green oriole
#

Hey @vocal wolf you might want to delete old revisions of #1130, they contain personal data lemon_pleased

vocal wolf
#

Can you still see previous edits?

green oriole
#

Yup

#

You have to delete them

vocal wolf
#

Crap mb

#

Forgot that's a thing lol

#

Ty for heads up

green oriole
vocal wolf
#

I have fixed the error in my ways.

eternal owl
cold moon
vocal wolf
#

@cold moon Thanks, it's been removed.

eternal owl
#

my PR failed on run pre-commit hooks step

#

error: flake8.exceptions.FailedToLoadPlugin: Flake8 failed to load plugin "ANN" due to No module named 'typed_ast'.

green oriole
#

You need to sync your environment

#

Oh wait

eternal owl
#

i did uninstall a package tho

green oriole
#

Do you have a link to the PR?

eternal owl
green oriole
#

Is pipenv run lint working locally?

eternal owl
#

yep

#

it wouldn't let me commit unless it passes

green oriole
#

Right

#

It seems like the precommit is pulled from the cache, and this cache might be broken

crude gyro
#

@empty sluice feel free to ask questions in here as you contribute. I saw your comment on github but I honestly am not sure without looking into it myself. it looks correct.

#

but I'm having a very busy week so don't expect an answer today

#

someone in this channel may be able to provide a quicker answer

empty sluice
#

@crude gyro Thanks for letting me know about this channel, I'll try what I commented and see if it works.

#

Do I have to set up the site to run the bot?

brazen charm
#

Most if its features rely on the site

cold moon
#

But it's pretty simple when you use Docker

tawdry vapor
#

That was a flake8 failure. It's not related to the pre-commit cache because pre-commit uses the flake8 that pipenv installs

#

Earlier versions required typed_ast

#

I'm not sure why CI failed here

#

The logs don't show which version of flake8-annotations it tried to install

#

It's locked to 2.3 so it should be 2.3

#

It's typed-ast = {version="^1.4,<2.0", python="<3.8"}

#

So did you lock using Python 3.8 instead of 3.7, which is what the CI uses?

eternal owl
#

i created the env using python3.7, and i just did pipenv uninstall djangorestframework-bulk, so it would use 3.7 right?

tawdry vapor
#

Presumably

green oriole
#

You could try pipenv run python --version

tawdry vapor
#

Can you lint locally or does it fail

eternal owl
#

linting locally passes

#

You could try pipenv run python --version
@green oriole Python 3.7.9

tawdry vapor
#

I checked out the branch and created a new environment

#

It fails here

#
Loading .env environment variables…
Traceback (most recent call last):
  File "/home/mark/repos/python/site-pydis/.venv/bin/pre-commit", line 5, in <module>
    from pre_commit.main import main
  File "/home/mark/repos/python/site-pydis/.venv/lib/python3.7/site-packages/pre_commit/main.py", line 10, in <module>
    import pre_commit.constants as C
  File "/home/mark/repos/python/site-pydis/.venv/lib/python3.7/site-packages/pre_commit/constants.py", line 4, in <module>
    import importlib_metadata
ModuleNotFoundError: No module named 'importlib_metadata'
#

You can see it used to be installed at some point, but got removed when I cleaned the env of unused packages

❯ pipenv clean
Uninstalling djangorestframework-bulk…
Uninstalling importlib-metadata…
Uninstalling zipp…
Uninstalling typed-ast…
Uninstalling django-crispy-bulma…
Uninstalling django-crispy-forms…
#

Same for typed-ast

#

Since importlib_metadata was removed, this strongly suggests you did somehow lock using 3.8 Cause it's only needed below Python 3.8

#

The same goes for typed-ast

eternal owl
#

oh, is there a way to fix it?

tawdry vapor
#

Try re-locking

eternal owl
#

can i specify a version while locking?

tawdry vapor
#

And look in the lock file to check that those two modules are present

#

Don't think so. It should just use the venv

eternal owl
#

which two? typed-ast?

tawdry vapor
#

and importlib_metadata

eternal owl
#

okay

tawdry vapor
#
pipenv --rm
pipenv lock --dev
pipenv sync --dev
#

Try that

#

Then make sure pipenv run lint works for you too

eternal owl
#

what does the first one do

tawdry vapor
#

Deletes the venv

eternal owl
#

kay

#

when locking after uninstalling a package, does it also include --dev by default?

tawdry vapor
#

I don't know

#

I never use the install/uninstall commands

#

I prefer to edit the Pipfile

eternal owl
#

i got You are attempting to remove a virtualenv that Pipenv did not create. Aborting.

tawdry vapor
#

Delete the directory yourself then

eternal owl
#

okay

#

i ran the above commands, changes were made to pipenv.lock and lint passed

#

should I commit the pipenv.lock file now?

tawdry vapor
#

Yes

eternal owl
#

done

#

this time the flake8 passed

#

but failed on coverage, gonna try to fix that

#

thanks for helping mark

eternal owl
green oriole
#

You never jumped from line 297 to 295

eternal owl
#

ik, thats what is confusing, lol

green oriole
#

Maybe you have an if clause there, and it always executed

eternal owl
#

yes there is an if

brazen charm
#

is the not user case covered?

eternal owl
#

right

#

the if is actully not required

empty sluice
#

To simplify setting up test servers, couldn't we create a server template?

eternal owl
neon phoenix
#

To simplify setting up test servers, couldn't we create a server template?
@empty sluice read the latest pin

empty sluice
#

@neon phoenix Thank you for telling me about that template!

neon phoenix
#

np

obsidian patio
#

To simplify setting up test servers, couldn't we create a server template?
@empty sluice The channel, role and webhook IDs will still be unique to that server and will have to be added to the config file. However, there may be a way to do that automatically, if a program for it is created. Not entirely sure

brazen charm
#

There were a couple people interested in doing that but I'm not sure if it went anywhere

green oriole
#

The issue is still marked as "planning"

floral venture
#

I am trying to implement the bot on a template of this server and nothing is working. The bot crashes on start. the server is identical to this one and it still crashes on launch

brazen charm
#

What does it crash on?

floral venture
#

It won’t import a module

brazen charm
#

How did you run it?

#

The whole traceback would be useful fi you're having trouble with it

floral venture
#

I go into bot master then bot then start __main__.py

#

it says File "C:\Users\Loser\Desktop\bot-master\bot\__main__.py", line 4, in <module> import sentry_sdk ModuleNotFoundError: No module named 'sentry_sdk'

empty sluice
#

Python Bot's filters don't get activated in DM's, right?

#

Like burst_shared or burst.

brazen charm
#

The bot should be ran as a module with python -m; if it can't find a dependency then you just need to get it (or avoid the code that uses it and remove the imports)

floral venture
#

@brazen charm I just run it in a python window like my other bots

brazen charm
#

You need to follow the guide at the site to set it up properly. It uses pipenv for dependency management or can be run through docker

floral venture
#

Can you link me to the guide @brazen charm

green oriole
#

Damn I have a memory

floral venture
#

in the instructions is says Set guild.id to your test servers's ID. but I don't see anything called guild.id

brazen charm
#

you need to create a config.yml file that follows the layout from config-default and replace the values there

empty sluice
#

Why am I getting this error while running Python bot?

tawdry vapor
#

You likely forgot to change the schema to http in the config

empty sluice
#

Yeah I forgot to change the schema to http lemon_pleased .

#

Wait i just forgot to sync the roles oops.

floral venture
#

Whenever I start ‘main’ it just idles and the bot stays offline

tawdry vapor
#

You don't get any logs?

floral venture
#

Nothing just a blank nothing @tawdry vapor

#

Also do I need to put my ID in and replace the one in the file for every single one?

#

Also where do I put the URL

#

Okay now its back to crashing

tawdry vapor
#

Sorry, I don't know what's wrong. Never experienced that before.

floral venture
#

@tawdry vapor it went to crashing after I deleted and re did the process

tawdry vapor
#

Are you running it on your host or through Docker?

#

You may have not properly configured something. Though it'd be strange for nothing to appear.

#

Do you at least get an output when it crashes? If so, you should be sharing it.

floral venture
#

@tawdry vapor it complains about the module I am importing. And I host by starting it in a python window

tawdry vapor
#

I don't know what you mean by python window

#

If you want to run it successfully,I strongly suggest against deviating from the instructions on our website.

glass pecan
#

To save a click, these are the Wolfram command PRs to migrate it from Python bot to Seasonalbot

crude gyro
#

@velvet ether hm, looks like maybe you didn't cherry pick it?

#

I thought you did, but it has a different sha

brazen charm
#

You get a new hash because of a different parent commit I believe

velvet ether
#

I had to google this because it also confused me

#

the hash is based on all sorts of stuff, like the parent

hardy gorge
#

The hash changes with a regular cherry pick, I think

#

If you specify the -x option, it will add a reference back to the original commit that you cherry-picked

#

So, yeah, the hash changes

brazen charm
#

Would it then merge those commits when they are in the same tree using -x, or just keep the reference in the message or something like that?

#

i was looking into bringing a commit over from an another branch like this with a cherry pick a while ago, but decided to just wait for the branch to get merged to master when I realized it'd be an another commit and would be better modified since it also introduced other things

velvet ether
#

Would it then merge those commits when they are in the same tree using -x, or just keep the reference in the message or something like that?
@brazen charm the only reference -x adds is one for convenience in the commit message

floral venture
#

If you want to run it successfully,I strongly suggest against deviating from the instructions on our website.
@tawdry vapor they are very unclear and hard to follow I understand them up to the part where you put your guild code and channel code and replace them but the URL part I don’t understand. And when I replace the only URL in the code with what it says and try to start main.py like I should to start the program in a python.exe command window to host the bot it crashes because it has an error

empty sluice
#

I'm doing some work on the bot, and I have a question: Can I force-push to my branch of my forked bot repository? I need to fix a couple of my commit messages.

#

I would only push to my branch.

brazen charm
#

Yes, the no force pushes rule is there for open prs to avoid confusion for reviewer afaik

green oriole
#

It will break the local copy of the reviewer

empty sluice
#

Well, I don't have a PR open yet, so can I force push @green oriole ?

green oriole
#

Yeah sure

tawdry vapor
#

@floral venture What about the URL is confusing to you? You don't know which one to put? It depends on whether or not you're using Docker.

crude gyro
#

yes, force pushing is always okay to branches that you either haven't created a pull request for yet, or which nobody has reviewed yet, @empty sluice

#

but don't force push to a branch where you have received review comments, cause this will mess up the PR and disassociate comments.

tawdry vapor
#

@floral venture You're not supposed to replace URLs in code, only in the config file you make. And it doesn't say to start main.py It say to either use Docker or pipenv run start.

neon phoenix
#

@tawdry vapor can you please remove the log message on the help cog on my pr? I'd like to do it but I'm on my phone :/

#

IIRC organization members can edit files but I'm not sure

green oriole
#

You need to have a checkbox ticked, I think it is on by default

floral venture
#

@tawdry vapor I insert the URL into the spot inside the file I copied and then place ids and then what do I do to host

neon phoenix
#

@green oriole I have it

green oriole
#

So they should be able to do that

tawdry vapor
#

@neon phoenix Why the rush? Just do it when you have the time. And if you don't get to it, then it's not a big deal.

floral venture
#

Yes I read them and don’t understand

tawdry vapor
#

Can you elaborate

#

Where do you get confused

cold moon
#

@tawdry vapor I addressed your reviews for site's non-random off-topic names selecting

tawdry vapor
#

Couldn't you edit the dependency of only your migration rather than editing every other migration?

cold moon
#

There was so much migrations with duplicate names and also 2 merge migrations, I think this is better to have every migration with unique number

tawdry vapor
#

Okay, that's fine

neon phoenix
#

Well, okay

#

Sorry for the ping

cold moon
#

My PR got reverted, what I need to do now?

tawdry vapor
#

@cold moon Renaming migrations causes problems. Django thinks they're new and tries to apply them, even though they are actually already applied.

#

Please open a new PR from the same branch. Drop the migration cleanup commit you have and create a new commit that only fixes the merge conflict by changing your migration's dependency.

#

Hmm no

#

Not sure what a clean way to do this is

#

Cause we don't want duplicate commits

#

Find a way to reverse the reverse, except for the migration stuff, and create a new commit to fix the merge conflict without the extra cleanup? That sounds good, I think...

cold moon
#

In other repos, rebase + force push should solution, but this is not allowed here...

crude gyro
#

okay

#

just revert the revert.

#

and then make the changes you need.

#

and merge the reverted revert.

#

@tawdry vapor @cold moon

empty sluice
#

I'm making a everyone ping anti-spam rule, and it sends a message to explain more. This is what I have currently:

f"""
Please don't try to ping {member_count}K people.
**It will not have good results.**
"""
#

Any suggestions? I just typed this out quickly.

#

Also, member_count is updated to the server's member count.

empty sluice
#

Also, would you recommend DMing this or sending it in the server?

obsidian patio
#

@empty sluice For this server, that would display 95,000K, not 95K. Make sure that you don't forget about the conversion to thousands

empty sluice
obsidian patio
#

Strange, but a bit cool. You could use an f-string as well

empty sluice
#

Strange, but a bit cool. You could use an f-string as well
@obsidian patio flake8 complained about my string.format, so I had to use an f-string.

obsidian patio
#

sounds good to me

tawdry vapor
#

That seems overcomplicated

#

Just divide it by 1000

crude gyro
#

I'm thinking maybe just doing Please don't try to ping 96723 people would be even better?

obsidian patio
#

Yeah, probably

#

And it wouldn't give us issues once we reach 1,000,000 members ;)

thorny obsidian
#

I was playing around with the branding assets and want to make a lemon_ping emoji. Was curious about y'all's thoughts (ignore the pika, I was just playing around with that one)

crude gyro
#

hahaha, I love the grimace one

#

I kinda want the grimace one without the ping, too

thorny obsidian
#

can do! I'm having entirely too much fun with the emojis.... I might try and fix the beard not being symmetrical though

crude gyro
#

you're welcome to do that

#

it has been bothering me too, just a tiny bit

#

although not a lot

green oriole
#

The last one is great haha

obsidian patio
#

Yess!! MBSA (Make the Beard Symmetrical Again)

outer breach
#

hello

#

can i post a vide on a game im working on here or ....

#

im using Godot btw

molten bough
#

This channel is for discussion of Python Discord projects

#

as in, the projects on the python-discord github

outer breach
#

thanks

empty sluice
#

Should I write a unit test for my rule?

crude gyro
#

you can if you want to, but you're not required to.

empty sluice
#

Also, do you like the new message better?

crude gyro
#

yes, but I'm still not happy with it.

#

left you a review.

empty sluice
#

@crude gyro Implemented your suggestions from the review. Using the bot.constants.NEGATIVE_REPLIES variable made the messages much better.

crude gyro
#

screenshot it?

brazen charm
#

Think I just saw #help-broccoli go to the top of the category after it was opened for whatever reason

hardy gorge
#

Interesting. I'm not sure what happened.

#

Did it more there directly or was it moved by an admin on accident?

green oriole
#

Maybe the original message got deleted and someone posted their question here?

brazen charm
#

may have been an accidental move, didn't consider that; wasn't looking at it directly but think it was at the bottom and then immediately moved to the top

empty sluice
crude gyro
#

that looks weird. did you add the headline to the embed body?

empty sluice
#

I changed the headline to be the embed title, now it looks much better:

crude gyro
#

yes that looks better

#

that could probably work.

#

nice work.

empty sluice
#

nice work
@crude gyro Thank you, the pull request has been updated too.

empty sluice
#

@crude gyro You need the interval setting in Python Bot's config file because its how often the bot checks messages.

#

That's why I have the everyone ping rule implemented as a frequency filter.

sonic tinsel
#

Is it also able to detect corner cases? I have heard of Discord letting the corner cases through their API and that's how people were able to ping @everyone the time before the last one.

#

I'll brb for a bit and look through it.

obsidian patio
#

Last mass ping in this server was by exploiting the !raw command

empty sluice
#

@sonic tinsel it will delete any user-sent message that has @everyone in its content.

sonic tinsel
#

https://github.com/discord/discord-api-docs/issues/1189 I'm concerned about this mainly. Here's a reference regex to guide other advanced programmers. I need to take care of myself before I do corner case checking.

^\@[^e]*e[^ev]*v[^ev]*e[^er]*r[^ry]*y[^yo]*o[^on]*n[^ne]*e$
#

I am bad at regex 😦

tawdry vapor
#

The issue says it's stripped at the API layer

#

I take that to mean that once a message is sent and our bot reads its contents, those extra characters have already been stripped

#

Furthermore, if you're sanitizing text before it hits the API, shouldn't consumers of the API receive the text with that sanitization already done?

#

Maybe not

empty sluice
#

Its not to stop people form !evaling the bot into sending an @everyone ping.

tawdry vapor
#

I know

#

If someone sends everyone with other Unicode characters in between, will the message's contents still contain those other characters, or does Discord strip them away?

brazen charm
#

The last comment for the issue seems to say that they'll be stripped out when the api receives it and then are sent everywhere with those contents

tawdry vapor
#

I missed that

#

His previous comment was misleading then

empty sluice
#

@tawdry vapor I meant user-sent messages.

#

@crude gyro I addressed kwzrd's concerns on the PR about punishing/temp-muting people who put @everyone in codeblocks.

tawdry vapor
#

I know you mean user-sent messages.

#

It doesn't matter, so never mind

crude gyro
#

@cold moon

The random off-topic name PR we merged recently has broken !ot add, because we don't have a default value for used. When we try to add an otname now, it tries to add it with a default value of None, which fails.

Could you include a default value of False when you open the PR to fix the revert we did?

green mesa
#

near await delete

#

i meant it should make hyperlink

#

but 😅

brazen charm
#

There's an issue for it

cold moon
#

@crude gyro What you mean? Model have default value False

patent pivot
#

Forget that, I updated lemon

#

Basically because right now the database is migrated to have the used column even though our prod Django model doesn't

#

and Django defaults aren't server defaults so it is not set to insert anything so it violated the not null constraint

#

Correct procedure is just to get that used PR ready without the migration changes and then the database just won't need to migrate when we merge and everyone will be happy

#

It just means that for now we can only insert off topic names directly into the database, not through the site API

green oriole
#

Forget that, I updated lemon
@patent pivot the ultimate proof that lemon is an AI smh lemon_thinking

patent pivot
#

lol

crude gyro
#

hahahaa

#

oh okay. yeah I guess I misunderstood the problem.

#

wonky migrations are hard to wrap your head around.

#

@cold moon how's progress on that fix PR?

cold moon
#

@crude gyro This is ready. I just created new merge migration.

crude gyro
#

okay, good. link it?

cold moon
crude gyro
#

<@&587606783669829632> since otname command is broken without this and our database is in a wonky state, we should prioritize getting it merged asap.

green oriole
#

@crude gyro can I leave a review too?

#

Well I mean, will it count for something?

woeful thorn
#

Yes

green oriole
#

Okay done

#

Almost the same message lol

hardy gorge
#

I'm currently installing WSL 2 and the Docker back-end for it to test it

#

We had an issue with the database/migration with the previous attempt

green oriole
#

Worked fine on my end, but I didn't migrated the database for quite a long time

mellow hare
#

Oh man, we have changed a lot on how the site works, huh

crude gyro
#

it changes all the time

#

and after we ditch the wiki, it'll change even more!

molten bough
#

haha, wiki too restrictive?

mellow hare
#

Oh no, I think I see the problem. Stupid Microsoft IIS

#

Forgot I hadn't futzed with the site stuff since the Excel addin project

hardy gorge
#

haha, wiki too restrictive?
@molten bough

Not restrictive necessarily; just not made for the job we want to do with it

#

When you start fighting the framework too much it becomes a frustration

#

Basically, we want to be able to have simple templates for, say, a sidebar that could be applied to multiple pages, among other things (like a better reviewing system for content)

#

By the way, I'm not home and tried Docker Desktop with a WSL 2 back-end for the first time

#

It's really easy now, even on Windows 10 Home

green oriole
#

One thing that'd be nice with the new system (I admit that I haven't looked into it at all, if there's a public issue) would be to allow non-staff to suggest edits to the page

hardy gorge
#

(As long as your version of Win 10 is up to date.)

#

One thing that'd be nice with the new system (I admit that I haven't looked into it at all, if there's a public issue) would be to allow non-staff to suggest edits to the page
@green oriole

Or write a page entirely and open a PR, yeah.

green oriole
#

Oh, it will be GitHub based?

#

Well, that's pretty cool then

molten bough
#

Basically, we want to be able to have simple templates for, say, a sidebar that could be applied to multiple pages, among other things (like a better reviewing system for content)

Fair, that does make sense. Almost sounds like you just want a bunch of templates and then to render markdown files into them or something

crude gyro
#

that's more or less the idea.

#

I mean, right now half the wiki pages are written in html

#

because markdown doesn't cut it.

#

and so we're writing raw html into a fucking text box on our website with no reviews

#

a bad idea and a terrible way to work.

#

much better that we keep the content itself (like guides or whatever) in markdown files and then all the rest can make use of the awesome power of Django templating.

molten bough
#

That makes a lot of sense, yeah

mellow hare
#

Is there a way to have pipenv wipe the current env you have and make a new one in its place?

#

Like a simple command or two to do so?

empty sluice
brazen charm
#

I guess just pipenv --rm/delete the venv and then install

sullen phoenix
#

pipenv --rm @mellow hare

empty sluice
#

You could just do pipenv --rm and pipenv --three.

sullen phoenix
#

then resync

mellow hare
#

sync or install

sullen phoenix
#

sync is from the lock file, and install is from the Pipfile

empty sluice
#

I thought the tldr page had something about removing environments. lemon_grumpy

sullen phoenix
#

so your choice

mellow hare
#

Gotcha

#

Lock would be more consistent across envs I think

#

And I do have to add the --dev flag right?

#

Sorry, been a hot minute since I've done all this

sullen phoenix
#

lock is more consistent, yeah

#

and add --dev if you want to install the dev dependencies

mellow hare
#

Sure sure

#

Cheers

#

Got my work one set up, now getting my home one set up

sullen phoenix
#

nice

mellow hare
#

Yeah planning on being less of a lazy bum and trying to put in some work

sullen phoenix
#

hahah, i've mostly just been doing reviews here and there on our repos

mellow hare
#

We certainly need it.

empty sluice
#

@crude gyro The everyone ping filter should be done now.

#

Wait need to make one more change.

empty sluice
#

How is all of the !eval command output hidden for os.system?

brazen charm
#

what do you mean?

empty sluice
#

@brazen charm Forgot to say only for os.system.

brazen charm
#

It doesn't hide anything, the calls fail

empty sluice
#

Well, how is that implemented then? Is it through NsJail?

#

@brazen charm

brazen charm
#

I'm not very familiar with snekbox beyond its public api, but I believe it does run the processes through nsjail; the readme probably knows more than I do

empty sluice
#

@clever wraith I had to fix some regex, you can see what I changed.

green oriole
#

NsJail uses the kernel RLIMIT_NPROC limit set 0 to make the python process not being able to create child processes
From the man page :

RLIMIT_NPROC The maximum number of processes (or, more precisely on Linux, threads) that can be created for the real user ID of the calling process. Upon encountering this limit, fork(2) fails with the error EAGAIN.

neon phoenix
#

And, for some reason, if I exit with error code 255 it puts "A fatal NsJail error occurred"

green oriole
#

Hmm

#

Well, if NsJail exits with 255 it means that it failed, but I though NsJail offsets the exit code to avoid collision with its own exit code

#

I might have dreamed about that tbh

neon phoenix
obsidian patio
#

I accidentally closed the issue that I had opened. On mobile rn, so don’t know if there’s a way to reopen

#

Could anyone help out?

tough imp
#

I reopened it

obsidian patio
#

Thanks😄

timid sentinel
#

Seems I messed up...

#

Ok yeah

#

I'm an idiot, sorry

hardy gorge
#

My Autobiography

  • The Red Ranger
timid sentinel
#

lol

#

At least I remembered to lint - not that there was much there to lint anyway

#

Hokay, fixed the old tests, time to put in some new ones

#

I'm new to testing, but I think what i've done is ok, I could pretty much copy it across from the other tests and only tweak it slightly. One thing, is it ok to hard code in random numbers for example for the bot ID, so my test looks like this

    async def test_bot_message_with_illegal_extension(self):
        """A bot message containing an illegal extension should be ignored."""
        attachment = MockAttachment(filename="python.disallowed")
        self.message.author.bot = 409107086526644234
        self.message.attachments = [attachment]

        await self.cog.on_message(self.message)

        self.message.delete.assert_not_called()

Does that look good?

#

To fix the other tests I just put

self.message.webhook_id = None
self.message.author.bot = None```in the `setUp` function
#

I think that's fine

mellow hare
#

For the record, I'm a moron. I forgot I could just delete the pipenv venv using Pycharm and just make a fresh one that way. And pipenv will actually pitch a fit if you try to delete a venv it didn't create

neon phoenix
crude gyro
#

@mellow hare this sounds familiar..

#

pretty sure I've done the same thing.

mellow hare
#

My bot was still on 3.8.1 which is what prompted me to try and figure it out

#

Almost back up and running, just doing some work stuff currently

cold moon
crude gyro
#

merging

hardy gorge
#

@timid sentinel Why would you have to put those None assignments in the setUp method?

#

If you create a new MockMessage instance in the setUp method, it means that there should be no carry-over between testing methods, as the setUp method will be run before each test method

tawdry vapor
#

Because they need to be None

#

The mocks returned for those attributes by default would be truthy

#

So they need to be falsy for most cases, so that it wont exit early. But for the two new cases, they have truthy values to ensure the function exits early

timid sentinel
#

Yeah, I thought that would be neater than setting them to None in all the other test cases.

hardy gorge
#

Yeah, that's true. I just did not think properly about what the attributes were.

#

I guess the bot attribute is normally False when it's not a bot account, but I guess that doesn't matter as long as we follow PEP8 and don't check of equality/identity with a bool within the code.

short snow
#

can we have feature like this if we say !snippet msg_id (if that msg contains a .txt file, then it will change that file to a code snippet, this will help ppl alot , since many don't know about !paste

#

i can try to work that

molten bough
#

Discord doesn't send those unless you directly paste more text into the input than will fit in a message

#

So that wouldn't fit in a code snippet either

#

You could upload them to a paste service, but for the sake of data privacy, that's probably a bad idea to do automatically

short snow
#

since over here in this bot, it is implemented @molten bough : https://github.com/engineer-man/felix/blob/master/python/cogs/snippet.py

molten bough
#

Can you make that a link? I'm on mobile

#

Wrap with <> if you don't want it to embed

short snow
#

it is some other server's i thought it would be against rules that's why i did that

molten bough
#

That's an automated upload to a paste service.

#

It's been floated before and staff said no back then, but the situation may have changed since

green mesa
#

i have one question can i work on any issue without getting assigned that work 🙂

molten bough
#

I expect you'll be assigned so that nobody else also tries to work on it

green mesa
#

i wnt to work on wiki command

#

for seasonal bot

molten bough
#

Which issue is that again? Can you link it?

green mesa
molten bough
#

So why don't you want it assigned?

green mesa
#

actually i am less confident

molten bough
#

The reason they assign it is mostly so that someone else doesn't try to work on the same thing, iirc

green mesa
#

ok then i will ask there to assign me 🙂

molten bough
#

Yeah, leave an issue comment, someone will see it there

green mesa
#

ok ty

brazen charm
#

Just good practice to be assigned when working on anything that has a non trivial implementation

green mesa
#

ok

short snow
#

so @green mesa you can use it if needed

#

it returns a few funfacts on the topic

#

which is scraped from wiki

green mesa
#

oo nice

#

i will love to look at

short snow
#

ping me if help is needed

green mesa
#

ok sure

short snow
#

we can even add a image searcher like the wiki one and one for defination

green mesa
#

hmmm good idea

short snow
#

let's wait for lemon, Joe or Ves Zappa's yes and then we both can make if you have no problem

crude gyro
#

uh. we couldn't use this.

#

first of all it's not async

#

secondly it's too messy. You're using two different wikipedia packages off PyPI that kind of do the same thing, and the code is not very idiomatic

short snow
#

that's what i said we can use that logic, but use async to do it faster and better

crude gyro
#

the problem is that these two packages you're using are also not async

#

so we couldn't use either of them

short snow
#

oh, something new

#

then what can be used?

crude gyro
short snow
#

sure,

#

for images and dictionary?

#

is there something same

green mesa
#

yes i am also searching for wiki image

#

😅

short snow
#

put it here if you get it, even i am searching but found nothing yet

green mesa
#

sure

short snow
#

it is unspalsh images not wiki

green mesa
#

oo

short snow
#

https://unsplash.com/s/photos/{topic} this for images

#

'https://dictionaryapi.com/api/v3/references/ for dictionary

green mesa
#

this can work?

short snow
#

this is not async which i used

#

but lemon said it is not allowed

green mesa
#

ok

short snow
#

it is somewhat similar

crude gyro
#

it's quite outdated, though

#

maybe there's a better one out there that's actually maintained?

#

this one hasn't got a commit for a whole year

short snow
#

is there one?

#

can you share the link

molten bough
#

If there aren't issues with it, it may just be mature

#

I'd hope wikipedia's APIs don't change that much

crude gyro
#

I don't know, Jason

#

honestly it might be easier to just use aiohttp, which we already have, and make restful API requests to wikipedia.

#

instead of looking for some wrapper

short snow
#

but without async also the wiki api is quite fast, why is async needed then?

crude gyro
#

async isn't a magic bullet for speed.

#

our bot is already asynchronous. Introducing features that are synchronous will block other features from working.

#

that's not acceptable.

#

so we don't accept synchronous solutions in our async projects.

short snow
#

oh, thanks letting me know

#

i will try messing around with the async-wiki

#

but let me know if oyu find one for images and dicr

green mesa
#

for images unsplash is best i guess

#

or u can use tenor also

short snow
#

but is it asynchronous?

green mesa
#

i dont think its async 😅

molten bough
#

I think you two are getting your wires crossed

#

If a wikipedia article has an image, surely then you'll display the image in the article?

short snow
#

it will but unsplash images are better, from my view

#

i don't like the wiki ones much

exotic ember
#

if it's a wikipedia command I'd expect the images to be from wikipedia, which is curated (ie. I know the image on a wikipedia article is related to the article, it'd be impossible to know that if you scrape from unsplash or any related image dump site)

brazen charm
#

wikipedia will have moderated and fitting images for any higher traffic pages

short snow
#

okay then, let me mess up with the library once and then me and Anubhav can put a PR on it

green mesa
#

I am getting this but when I do git pull it says already updated,y so?😅

#

Sorry for noob question

exotic ember
#

git pull gets the changes from your fork, since it's the repository you cloned

#

to get changes from our repository, you'll have to add what's called an upstream remote

green mesa
#

Ty

#

And then I need to push changes immediately?

exotic ember
#

to elaborate, if you then want to get changes from the master branch on our repository to your local copy, you have to git pull upstream master (assuming you named the remote repository upstream)

green mesa
#

👍

obsidian patio
patent pivot
#

CI either passing or failing

#

stuff like linting, tests, so on

exotic ember
#

to be specific, the check failed due to the azure pipeline check failing, but I think the message is a general CI failed one, as we do run multiple separate checks

green oriole
#

On an individual commit, you have a green check or red cross at the left of the commit name, and you can click it to get the CI results

obsidian patio
#

Aah, alright. I’ll check out what azure pipelines really are. How could it even fail though? Doesn’t everyone automatically check linting before committing?

exotic ember
#

well, we don't just check linting. in the specific case you linked, the build failed because we have it setup to fail if test coverage is not 100% (for site)

#

which is not a problem at all since the PR is just a draft

green mesa
#

The Avengers are a fictional team of superheroes appearing in American comic books published by Marvel Comics. The team made its debut in The Avengers #1 (cover-dated Sept. 1963), created by writer-editor Stan Lee and artist/co-plotter Jack Kirby. The Avengers is Lee and Kirby...

#

or can be sent directly as it is embeded already

short snow
#

do you want to return the link or the a text summary on that

obsidian patio
#

Alright. I suppose that we’ll be seeing quite a few more failed azure pipeline builds in the future, then

green mesa
#

i wnt to send proper link which has text+image both

#

image+text

short snow
#

hmmm, why not just return a summary like ```py

importing the module

import wikipedia

finding result for the search

sentences = 2 refers to numbers of line

result = wikipedia.summary("India", sentences = 2)

printing the result

print(result) ``` (just with async python lib) and add a image to it

green mesa
#

@short snow this is not an async lib

short snow
#

ya, that's what i said

#

with async lib

green mesa
green mesa
#

i am thinking of adding pagintor emoji of ⬆️ ⬇️ ✅ ❎

#

so user can select and they can choose by pressing ✅

#

do i need to change something in embed lemon_sweat

short snow
#

@green mesa can you invite me to that, so i can help i fyou are fine

green mesa
#

i havent pushed code to github yet

#

and i am modifying existing code😅 of pr

#

i am modifying vivax3794 code

#

as he is not working anymore on issue

short snow
#

oh, if needed i can help

green mesa
#

ok i will ping u here if i need

short snow
#

react messages 1 to 9 and ⏭️ ◀️ on that msg

#

1 to 9 to select

#

and ⏭️ to go to the next page

#

and ⏮️ to go to the previous page

green mesa
#

actually i am adding ⬇️ ⬆️ because it will look more appropriate

short snow
#

ohk

#

but how will they select?

#

and a trash one also to delete that msg

green mesa
#

|---------|
Avenger
|---------|
these type of box will come over when anyone will react to emoji

#

and they can choose with this

#

and when they will react to ✅ it will be selected

short snow
#

ohk, are u tessting it on a server?

green mesa
#

na writing code

#

for paginator

short snow
#

ohk

green mesa
short snow
#

i guess putting asking the user for input is better

#

like 1, 2, 3

green mesa
#

hmmm

#

lemon what u suggest

green mesa
mellow hare
#

Is it specifically watching for input from the user that made the command?

short snow
#

put enter your choice inside the embed

green mesa
#

ok

#

@mellow hare yes

mellow hare
#

Solid

green mesa
#

i have added one check

#

ty

mellow hare
#

It's an easy thing to miss, just figured I'd check

green mesa
#

now

#

or more editing needed

eternal owl
#

maybe have the enter number to choose as the embed footer?

green mesa
#

ok then i will remove timestamp

#

let me try once

eternal owl
#

just curious, are we limiting the possibilities to 9 or is it just the API?

short snow
#

he is limiting to that, i think

#

the api doesn't do that

eternal owl
#

okay

green oriole
#

Why not using reactions instead?

#

We have no cogs that does that at the moment, waiting for a user message

#

To keep the UI consistent, we should use reactions

short snow
#

then we can add rections 1️⃣ to 9️⃣

green mesa
#

@green oriole Replying with a number would be better than spamming an emoji . Rate limits and latency make emojis not the best user experience for navigation.

#

api is only giving 9 response

#

if one get removed it adds new one

#

i have cheked with 2-3 search result each time i get 9 response only

eternal owl
#

I think I like the numbers over reactions

#

a user needs to wait until all reactions have been added

green mesa
#

asking for number will be fast then waiting for emoji to be added

eternal owl
#

yea

green mesa
#

and command is working fine will i make an pr?

#

after cleaning code

#

or i need to edit embed or something

eternal owl
#

can you send me the url ur using to fetch data

green mesa
#

yeh sure

#

its giving json output

#

everytime 9

#

top one is list

#

so i am skipping that incase it has list

eternal owl
#

ty

green mesa
#

np buddy

green oriole
#

You could use a paginator kind of thing instead, like with 4 options and reactions to turn pages, it would be only 6 reactions, that's pretty fast

green mesa
#

i thought for this

#

but its tricky to implement

#

for me 😅

eternal owl
#

oh u mean each wiki search result on 1 page @green oriole ?

green mesa
#

i have only issue with this wiki api

#

like if u search for clash of clans it will send some weired result also

#

clash of clans is made by supercell

eternal owl
#

should we restrict content to only below 18? like we did with the reddit command?

green mesa
#

i havent restricted anything yet

#

but i should i guess

eternal owl
#

are there any parameters which can help us?

green mesa
#

¯_(ツ)_/¯

#

.issue 267

dusky shoreBOT
green oriole
#

Nah not only one, you could have like 3 or 4 results per page, but just so you use reactions and not messages to interact with it

eternal owl
#

so the first page will list all the wikipedia titles and the next pages will be in detail for each title?

#

just like the reddit command

green oriole
#

That could work yeah

green mesa
#

@green oriole api only give links i guess so adding image will be difficult

#

but if i send link it has content + image

green oriole
#

I dunno, it seems pretty hacky

green mesa
#

😅

thorny obsidian
stone socket
#

hello

green oriole
#

The 4th is just lemon_hyperpleased

crude gyro
#

@MrAwesomeRocks looks like there are bugs in that everyone ping feature, some members in #community-meta are reporting that they get muted even though the ping is in a code block

Do you have time to address this? my suggestion is that you write some unit tests to test all the different cases and fix the cases that don't work.

#

hmmmm.

#

can someone ping that user? mobile isn't agreeing with me.

#

or maybe

#

@empty sluice

short snow
#

i will try to make one, but when i tested it i got the same problem as him

#

so didn't pr it

green mesa
velvet ether
#

It changed a line ending somewhere. Just git add it's changes and you're good.

green mesa
#

ok

#

wiki command is ready 🙂

#

all check passed

green mesa
#

first pr pushed 🙂

#

hope u all like

green mesa
#

where is modmail repo which pydis uses like if anyone wnt to add any feature or add issue

#

where they can add

patent pivot
eternal owl
#

submitted a review @green mesa for very small changes, mainly variable names

empty sluice
#

@crude gyro Working on the error, did some testing, found the error happens with inline codeblocks with text before them, like this.

crude gyro
#

@empty sluice one of our core devs is also looking at this. also, that issue isn't very descriptive.

#

might be best if you just leave it to @exotic ember, since they've already gotten started and because a fresh pair of eyes usually is a good thing anyway

empty sluice
#

@crude gyro I just quickly typed out that issue, I'll add more to it, but I already fixed the bot.

exotic ember
#

does your fix catch this next line? ->
codeblock !everyone ping

#

replace ! with @

empty sluice
#

@exotic ember It caught that line as a ping.

brazen charm
#

The current regexes feel complicated and error prone to me, wouldn't just removing all `` and``` pairs including their content work? Or are there cases where something takes over those

exotic ember
#

@brazen charm that was what I was working on, (copied the code block regex from snekbox)

empty sluice
#

@exotic ember Where was that regex?

exotic ember
empty sluice
#

I implemented it using the snekbox regex, what do you think?