#dev-contrib
1 messages · Page 59 of 1
Ah nice
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
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
I made one lemoji.
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
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
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
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
The lint in CI is using the same config
I'm talking about this (wait a min)
okay, i am talking about this
flake8 didn't notify me that
Then you probably didn't set it up properly or used the wrong flake8
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
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
Unh
https://github.com/python-discord/site/issues/375
i wanna give this one a shot
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
thats a significant improvement
This was the view I used to improve performance, but it needs tying into DRF https://paste.pythondiscord.com/alebudovew.py
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
okay, I will look into the models and study the project a lil bit
👍
What that due to client timestamps? https://canary.discordapp.com/channels/267624335836053506/697134086614941706/747477163510595694
I think it’s time to update the member count on the bot repo
We’ve grown more than 50% since that
we should probably wait until after our future prune
which will be when #1077 gets merged
.issue 1077 bot
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?
exactly 21,524 members currently
this PR would kick about 11k people if it was merged right now
What about the other 10k?
Also, I think it sounds quite reasonable. Having dormant members doesn’t really add to the community
about 8k would be given the pinging role, and the rest would be left alone
Aah, alright
last 6 hours
hahahahaha
okay laughed there as well
lmfao
What is that number about, those 21,524?
that's the number of people who aren't verified
people who didn't !accept our rules and policies in #352442727016693763
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
yeah, it disables that when the ping is going to occur
actually i think it's just fully disabled in #352442727016693763
Is there a method of postponing the first mass kick?
Currently it would probably trigger a massive burst shared
And the burst shared is only disabled after the merge
it's going to ping core devs before it prunes the people
It will ask for confirmation that all those people should be kicked
since there's so many
if you deny, it will ask again in 30 minutes
Okay
alternatively we could cherry pick https://github.com/python-discord/bot/commit/b1c800c623f90f46c4ecaff8da2269efcd04ee05
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
mm the first @Unverified ping will happen before most people receive the role
Wouldn’t it be good to ping all people without roles beforehand, so people get a warning about what will happen?
yeah but when we do that it triggers our anti-spam rules
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?
because a lot of people start sending the !accept message
Oh. Okay
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
Sounds like a good option, if that works
But would enabling the tasks take another commit?
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
@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
when would this error appear?
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.
well thats a problem
its currently ignoring 403s from the DMs because it will get them for members with closed DMs
hmmm
so it will have to look at the error code too I guess
yeah
I dont think theres an easy way to do that currently
to stop the task, from within the request coro
hmmmmm
the requests are quite isolated
it looks to just be error.code
I would have to discuss with Mark
for reference this is what the "request" looks like: https://github.com/python-discord/bot/blob/ff91b76348d95e308589ac131898aba9f7cca986/bot/cogs/verification.py#L288
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
Yes that or reraise the exception
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
Doesn't have to be custom
You can check for that specific status and code instead of appending to bad statuses
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
for sure
thank you
Then return something instead
would you hate if I raised a custom exception?
Kind of
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
Yeah that would be nice, but whatever is convenient for you as anything will be better compared to going through the pages
Thanks
How py bot comment when someone propose pr ?
It uses Gitub action? Or something else?
GitHub webhooks our GitHub app which then sends an API request back to GitHub
Ok ty🙂 for explanation
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?
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
It's @patent pivot's stats bot that integrates with @stable mountain
Hm, are members automatically opted in unless stated otherwise?
I believe it's one of the things you agree to when you verify, the privacy policy
@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
the messages table is just:
no content or anything
and then per user we store:
okay
and soon:
- @viscid badge will be open source
- I'll be working on public datasets
I can already generate datasets
@neon phoenix take a look here: https://metabase.pythondiscord.com/public/question/3007e888-11cb-49cb-a896-13b0deb3ee25
you can also download this as CSV, JSON or XLSX
epic
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!
I think it's ready to open source
👀 let's see the sauce code
just doing some branding and docs stuff
\o/
owo
there could be more documentation, and I'll add that gradually
and also more could be split up
I like how you made that metaclass
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
I also added some custom DB stuff for bulk upsert, and that stuff is fast https://github.com/python-discord/metricity/blob/master/metricity/models.py#L50-L68
went from liiiike, minutes to minute
chunks of 2,500 users at a time
PRs welcome 
@patent pivot hm, about the coloredlogs
Windows users also should install colorama, right?
I don't see it on the toml
Yeah it isn't
I overlooked it because Mac and ANSI on windows 10
Official documentation of Poetry
ah okay
Metricity looks very interesting
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
if message.author.bot: return 
I'm curious, which cog is responsible for that? #algos-and-data-structs message
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
@patent pivot will more stats be available as well? I’d love to see more of the weird stats that you usually pull up
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
how much average time people are spending on python discord 
lol that's a pretty hard metric to measure
you could get data like how much time people are typing
and then do some maths
idk
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.
well, okay
I thought it was going to be a good metric
Well, it is, but it's hard to track
We do get a set of metrics from Discord already regarding activity in the server
You could scrap all that data, although I don't know if it's possible
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
So it can be public?
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.
That voice graph haha
my PR failed on Generate Coverage Reports step, can anyone explain what that is and how I will be able to solve the problem?
Coverage failure: total of 99 is less than fail-under=100
We enforce 100% coverage for code on site so everything must be tested
ooh so its saying that tests are missing?
yeah
it gives you a report if you click through to azure
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?
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
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
okay
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
i set the default to 10k
104,589 users in the users table right now
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
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
is anyone working on the bot side?
No one is assigned right now, no
will it be fine if I can work on that too? I might take a lil longer..prolly within a week or so
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
oh
Up to @crude gyro whether that is in scope or not for this PR, I think.
many to many is not in scope, and should be handled by a core dev since it's very sensitive.
gotcha
handling the bot side would be encouraged though.
@crude gyro okay, I will start on it once the site PR is in
okay. but keep us in the loop.
and expect a tough review. this needs to be done right.
yessir
and thanks 

Py bot got bugged while adding infranction in genral?
@crude gyro Tags cleanup PR conflicts resolved
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
How to fix conflicting migrations?
Yeah, that's a divergent history
You'd usually manually edit the migration dependency to make a linear history
🤯
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.
Should I edit these migration numbers too? There is currently migrations with same numbers.
in the same app?
Yeah, that'd be nice
!tempban 515208276217036813 14d your only messages seem to be trying to ping everybody with an attempt at a rickroll...
:ok_hand: applied ban to @wary pewter until 2020-09-10 10:52 (13 days and 23 hours).
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
They won’t
People will check the channel they were pinged in, an announcement would serve the same purpose
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
Things like that won’t stop happening. We just need a solid plan for how to handle it
Muting a channel just moves people into another one
Exactly why we should create a temporary duplicate of the channel
People don’t read pins, they don’t read announcements, they don’t read channel names, and they don’t read channel topics
You can't change how people act without muting everything
When #python-discussion was muted, #internals-and-peps was spammed
That sounds very pessimistic. Most people just want to have an answer (or troll)
It’s realistic
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
Most of the people that respond badly to pings are going to be people that don't spend that much time here
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
so it's unlikely they'd know where to look even if they cared that much
That’s why I think we should have the announcement in the channel where the ping was. That’s where they’ll be normally
- Silence #python-discussion and send compelling explanation there
- Change name of #python-discussion to something like we discussed earlier
- Create #python-discussion-t, which will act like #python-discussion in the mean time (with send message perms)
Hey @vocal wolf you might want to delete old revisions of #1130, they contain personal data 
Can you still see previous edits?

I have fixed the error in my ways.
@crude gyro made a comment regarding the drf-bulk package, I can make a commit if whatever I mentioned is satisfactory
https://github.com/python-discord/site/pull/378#issuecomment-681957772
@vocal wolf About 1130, private information pic is still available from Discord: https://canary.discordapp.com/channels/267624335836053506/622895325144940554/748521318365790279
@cold moon Thanks, it's been removed.
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'.
i did uninstall a package tho
Do you have a link to the PR?
Is pipenv run lint working locally?
Right
It seems like the precommit is pulled from the cache, and this cache might be broken
@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
@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?
Most if its features rely on the site
But it's pretty simple when you use Docker
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?
i created the env using python3.7, and i just did pipenv uninstall djangorestframework-bulk, so it would use 3.7 right?
Presumably
You could try pipenv run python --version
Can you lint locally or does it fail
linting locally passes
You could try
pipenv run python --version
@green oriole Python 3.7.9
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
oh, is there a way to fix it?
Try re-locking
can i specify a version while locking?
And look in the lock file to check that those two modules are present
Don't think so. It should just use the venv
which two? typed-ast?
and importlib_metadata
okay
pipenv --rm
pipenv lock --dev
pipenv sync --dev
Try that
Then make sure pipenv run lint works for you too
what does the first one do
Deletes the venv
kay
when locking after uninstalling a package, does it also include --dev by default?
I don't know
I never use the install/uninstall commands
I prefer to edit the Pipfile
i got You are attempting to remove a virtualenv that Pipenv did not create. Aborting.
Delete the directory yourself then
okay
i ran the above commands, changes were made to pipenv.lock and lint passed
should I commit the pipenv.lock file now?
Yes
done
this time the flake8 passed
but failed on coverage, gonna try to fix that
thanks for helping mark
the coverage report failed here
https://dev.azure.com/python-discord/Python Discord/_build/results?buildId=7839&view=logs&j=5264e576-3c6f-51f6-f055-fab409685f20&t=ba73fe70-97c4-5e2d-5cc4-47c0f87130c8&l=39
I added a print statement between those lines (line 295 and line 297), and when I run my tests, the print statement is actully executed.
Also I am confused of why it shows 297->295(maybe it should be 295->297 or just 295-297, not sure about the convention), what does this represent?
You never jumped from line 297 to 295
ik, thats what is confusing, lol
Maybe you have an if clause there, and it always executed
is the not user case covered?
To simplify setting up test servers, couldn't we create a server template?
fianlly \o/
To simplify setting up test servers, couldn't we create a server template?
@empty sluice read the latest pin
@neon phoenix Thank you for telling me about that template!
np
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
There were a couple people interested in doing that but I'm not sure if it went anywhere
The issue is still marked as "planning"
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
What does it crash on?
It won’t import a module
How did you run it?
The whole traceback would be useful fi you're having trouble with it
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'
Python Bot's filters don't get activated in DM's, right?
Like burst_shared or burst.
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)
@brazen charm I just run it in a python window like my other bots
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
Can you link me to the guide @brazen charm
https://pydis.com/pages/contributing/bot I believe
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
Damn I have a memory
in the instructions is says Set guild.id to your test servers's ID. but I don't see anything called guild.id
you need to create a config.yml file that follows the layout from config-default and replace the values there
You likely forgot to change the schema to http in the config
Yeah I forgot to change the schema to http
.
@tawdry vapor What is this error?
Wait i just forgot to sync the roles oops.
Whenever I start ‘main’ it just idles and the bot stays offline
You don't get any logs?
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
Sorry, I don't know what's wrong. Never experienced that before.
@tawdry vapor it went to crashing after I deleted and re did the process
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.
@tawdry vapor it complains about the module I am importing. And I host by starting it in a python window
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.
Issue: https://github.com/python-discord/bot/issues/1114
@stable mountain PR: https://github.com/python-discord/bot/pull/1134
@dusky shore PR: https://github.com/python-discord/seasonalbot/pull/429
To save a click, these are the Wolfram command PRs to migrate it from Python bot to Seasonalbot
@velvet ether hm, looks like maybe you didn't cherry pick it?
I thought you did, but it has a different sha
You get a new hash because of a different parent commit I believe
I had to google this because it also confused me
the hash is based on all sorts of stuff, like the parent
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
Ah, yeah, @velvet ether, here's a bit more info on what makes up the hash: https://blog.thoughtram.io/git/2014/11/18/the-anatomy-of-a-git-commit.html
So, yeah, the hash changes
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
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
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
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.
Yes, the no force pushes rule is there for open prs to avoid confusion for reviewer afaik
It will break the local copy of the reviewer
Well, I don't have a PR open yet, so can I force push @green oriole ?
Yeah sure
@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.
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.
@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.
@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
You need to have a checkbox ticked, I think it is on by default
@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
@green oriole I have it
So they should be able to do that
@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 The instructions for starting the bot are here https://pythondiscord.com/pages/contributing/bot/#run-the-project
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
Yes I read them and don’t understand
@tawdry vapor I addressed your reviews for site's non-random off-topic names selecting
Couldn't you edit the dependency of only your migration rather than editing every other migration?
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
Okay, that's fine
My PR got reverted, what I need to do now?
@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...
In other repos, rebase + force push should solution, but this is not allowed here...
okay
just revert the revert.
and then make the changes you need.
and merge the reverted revert.
@tawdry vapor @cold moon
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.
This is how it shows up in the server:
Also, would you recommend DMing this or sending it in the server?
@empty sluice For this server, that would display 95,000K, not 95K. Make sure that you don't forget about the conversion to thousands
@obsidian patio I know its janky, but:
Strange, but a bit cool. You could use an f-string as well
Strange, but a bit cool. You could use an f-string as well
@obsidian patio flake8 complained about mystring.format, so I had to use an f-string.
sounds good to me
I'm thinking maybe just doing Please don't try to ping 96723 people would be even better?
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)
can do! I'm having entirely too much fun with the emojis.... I might try and fix the beard not being symmetrical though
you're welcome to do that
it has been bothering me too, just a tiny bit
although not a lot
The last one is great haha
Yess!! MBSA (Make the Beard Symmetrical Again)
This channel is for discussion of Python Discord projects
as in, the projects on the python-discord github
You could post it in an off-topic channel or #303934982764625920 though
oh right, #303934982764625920 was deaded wasn't it
thanks
you can if you want to, but you're not required to.
Also, do you like the new message better?
@crude gyro Implemented your suggestions from the review. Using the bot.constants.NEGATIVE_REPLIES variable made the messages much better.
screenshot it?
Think I just saw #help-broccoli go to the top of the category after it was opened for whatever reason
Interesting. I'm not sure what happened.
Did it more there directly or was it moved by an admin on accident?
Maybe the original message got deleted and someone posted their question here?
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
@crude gyro Here is the bot response to an @everyone ping.
that looks weird. did you add the headline to the embed body?
I changed the headline to be the embed title, now it looks much better:
nice work
@crude gyro Thank you, the pull request has been updated too.
@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.
Theres more info in the pull request: https://github.com/python-discord/bot/pull/1135#issuecomment-683432899
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.
Last mass ping in this server was by exploiting the !raw command
@sonic tinsel it will delete any user-sent message that has @everyone in its content.
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 😦
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
@sonic tinsel @tawdry vapor This filter is for people typing in @everyone, like this: https://discordapp.com/channels/267624335836053506/267624335836053506/749780880595091646
Its not to stop people form !evaling the bot into sending an @everyone ping.
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?
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 meant user-sent messages.
@crude gyro I addressed kwzrd's concerns on the PR about punishing/temp-muting people who put @everyone in codeblocks.
@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?
There's an issue for it
@crude gyro What you mean? Model have default value False
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
Forget that, I updated lemon
@patent pivot the ultimate proof that lemon is an AI smh
lol
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?
@crude gyro This is ready. I just created new merge migration.
okay, good. link it?
<@&587606783669829632> since otname command is broken without this and our database is in a wonky state, we should prioritize getting it merged asap.
Yes
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
Worked fine on my end, but I didn't migrated the database for quite a long time
Oh man, we have changed a lot on how the site works, huh
haha, wiki too restrictive?
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
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
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
(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.
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
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.
That makes a lot of sense, yeah
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?
Here's the tldr page:
I guess just pipenv --rm/delete the venv and then install
pipenv --rm @mellow hare
You could just do pipenv --rm and pipenv --three.
then resync
sync or install
sync is from the lock file, and install is from the Pipfile
I thought the tldr page had something about removing environments. 
so your choice
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
lock is more consistent, yeah
and add --dev if you want to install the dev dependencies
nice
Yeah planning on being less of a lazy bum and trying to put in some work
hahah, i've mostly just been doing reviews here and there on our repos
We certainly need it.
@crude gyro The everyone ping filter should be done now.
Wait need to make one more change.
How is all of the !eval command output hidden for os.system?
what do you mean?
@brazen charm Forgot to say only for os.system.
It doesn't hide anything, the calls fail
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
@clever wraith I had to fix some regex, you can see what I changed.
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.
And, for some reason, if I exit with error code 255 it puts "A fatal NsJail error occurred"
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

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?
I reopened it
Thanks😄
My Autobiography
- The Red Ranger
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
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

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
@crude gyro Tags cleanup on site have now no conflicts https://github.com/python-discord/site/pull/349
merging
@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
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
Yeah, I thought that would be neater than setting them to None in all the other test cases.
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.
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
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
since over here in this bot, it is implemented @molten bough : https://github.com/engineer-man/felix/blob/master/python/cogs/snippet.py
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
i have one question can i work on any issue without getting assigned that work 🙂
I expect you'll be assigned so that nobody else also tries to work on it
Which issue is that again? Can you link it?
So why don't you want it assigned?
actually i am less confident
The reason they assign it is mostly so that someone else doesn't try to work on the same thing, iirc
ok then i will ask there to assign me 🙂
Yeah, leave an issue comment, someone will see it there
ok ty
Just good practice to be assigned when working on anything that has a non trivial implementation
ok
https://github.com/Shivansh-007/WebSearch/blob/master/Fetch_contents/wiki_topic_single_return.py I have somewhat already done that just not done it the discord.py way
so @green mesa you can use it if needed
it returns a few funfacts on the topic
which is scraped from wiki
ping me if help is needed
ok sure
we can even add a image searcher like the wiki one and one for defination
hmmm good idea
let's wait for lemon, Joe or Ves Zappa's yes and then we both can make if you have no problem
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
that's what i said we can use that logic, but use async to do it faster and better
the problem is that these two packages you're using are also not async
so we couldn't use either of them
something like https://pypi.org/project/async-mediawiki/
put it here if you get it, even i am searching but found nothing yet
sure
it is unspalsh images not wiki
oo
https://unsplash.com/s/photos/{topic} this for images
'https://dictionaryapi.com/api/v3/references/ for dictionary
ok
so he sent this
something like https://pypi.org/project/async-mediawiki/
it is somewhat similar
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
If there aren't issues with it, it may just be mature
I'd hope wikipedia's APIs don't change that much
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
but without async also the wiki api is quite fast, why is async needed then?
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.
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
but is it asynchronous?
i dont think its async 😅
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?
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)
wikipedia will have moderated and fitting images for any higher traffic pages
okay then, let me mess up with the library once and then me and Anubhav can put a PR on it
I am getting this but when I do git pull it says already updated,y so?😅
Sorry for noob question
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
here's the link to the guide on our website: https://pythondiscord.com/pages/contributing/working-with-git/cli/#only-done-once-per-project
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)
👍
What are these messages all about?
it's the status of our Azure Pipelines (https://github.com/apps/azure-pipelines) build, which triggers when a pull request is opened for example, you can see the status if you go to the relevent pull request (https://github.com/python-discord/site/pull/381) and scroll down to the bottom where it talks about successful/non-successful checks
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
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
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?
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
for wikipedia command i am thinking of directly scraping website but problem comes when website is of this type
https://en.wikipedia.org/wiki/Avenger
Avenger, Avengers, The Avenger or The Avengers may refer to:
these type can be scraped https://en.wikipedia.org/wiki/Avengers_(comics)
or can be sent directly as it is embeded already
but https://en.wikipedia.org/wiki/Avenger is causing problem
Avenger, Avengers, The Avenger or The Avengers may refer to:
do you want to return the link or the a text summary on that
Alright. I suppose that we’ll be seeing quite a few more failed azure pipeline builds in the future, then
i wnt to send proper link which has text+image both
but some links for example https://en.wikipedia.org/wiki/Avenger dont have
Avenger, Avengers, The Avenger or The Avengers may refer to:
image+text
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
@short snow this is not an async lib
links like https://en.wikipedia.org/wiki/COC is a problem
COC may refer to:
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 
@green mesa can you invite me to that, so i can help i fyou are fine
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
oh, if needed i can help
ok i will ping u here if i need
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
actually i am adding ⬇️ ⬆️ because it will look more appropriate
|---------|
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
ohk, are u tessting it on a server?
ohk
now logic part is only left
Is it specifically watching for input from the user that made the command?
put enter your choice inside the embed
Solid
It's an easy thing to miss, just figured I'd check
maybe have the enter number to choose as the embed footer?
just curious, are we limiting the possibilities to 9 or is it just the API?
okay
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
then we can add rections 1️⃣ to 9️⃣
@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
I think I like the numbers over reactions
a user needs to wait until all reactions have been added
asking for number will be fast then waiting for emoji to be added
yea
and command is working fine will i make an pr?
after cleaning code
or i need to edit embed or something
can you send me the url ur using to fetch data
yeh sure
its giving json output
everytime 9
top one is list
so i am skipping that incase it has list
ty
np buddy
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
oh u mean each wiki search result on 1 page @green oriole ?
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
should we restrict content to only below 18? like we did with the reddit command?
https://github.com/python-discord/seasonalbot/issues/267#issuecomment-526123210
this was for the reddit command
are there any parameters which can help us?
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
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
That could work yeah
@green oriole api only give links i guess so adding image will be difficult
but if i send link it has content + image
I dunno, it seems pretty hacky
😅
ping and grimace with the symmetrical beard. Not 100% of the beard shape yet. I think I have to adjust the middle section.
hello
The 4th is just 
@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
i will try to make one, but when i tested it i got the same problem as him
so didn't pr it
what this error wnt to say 
It changed a line ending somewhere. Just git add it's changes and you're good.
where is modmail repo which pydis uses like if anyone wnt to add any feature or add issue
where they can add
submitted a review @green mesa for very small changes, mainly variable names
@crude gyro Working on the error, did some testing, found the error happens with inline codeblocks with text before them, like this.
@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
@crude gyro I just quickly typed out that issue, I'll add more to it, but I already fixed the bot.
@exotic ember It caught that line as a ping.
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
@brazen charm that was what I was working on, (copied the code block regex from snekbox)
@exotic ember Where was that regex?
https://github.com/python-discord/bot/blob/master/bot/cogs/snekbox.py you'll have to modify it
@exotic ember https://github.com/python-discord/bot/pull/1143
I implemented it using the snekbox regex, what do you think?

one also to delete that msg