#dev-contrib
1 messages Β· Page 120 of 1
just put that at the start
Would that just send an embed to the chat?
yea, UserInputError is caught in the error handler afaik
yes
Your input was invalid: You must either provide a valid message to bookmark, or reply to one.
Usage:.bookmark [target_message] [title=Bookmark]
This is what it would look like
Ah
This is a bit confusing still, because in Dorsan's example they did provide a number
yea, the usage would show how to do it properly
and the text can be changed to make sense
The text you pass into the error is what is put into the error embed
Actually I just made an embed like here and put "Invalid Arguments" as an error message. But I guess using that command seems more convenient.
if len(numbers) > MAXIMUM_ISSUES:
embed = discord.Embed(
title=random.choice(ERROR_REPLIES),
color=Colours.soft_red,
description=f"Too many issues/PRs! (maximum of {MAXIMUM_ISSUES})"
)
await ctx.send(embed=embed)
await invoke_help_command(ctx)
Yeah the error handler does that for you
Yea, I'd rather use the error handler, so all our stuff is handled in a standard way
it's easier for you now, and it's easier to change it bot wide in future
Okay, thank you. So.. does that qualify as an issue?
Uuh.. you can just PR it in this case I think
feel free to raise another issue for it if you like, or you can PR it directly
or you can include it in what you're working on now,
lol yea what Zig said
Okay, thank you! π
Now I curious about those 179 child items
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
It's all of our services in a folder each
each with their own deployment manifests
EG pixels:
Oh ok π
Is there a designated place for images in sir lancebot?
or are they stored some other way?
bot/resources usually
just in that folder, or should I put it in evergreen?
preferably they're small images though, since everyone will need to download them if they're in git
I'm making this command as a joke anyways, so it probably won't matter a whole lot
Yea, put it in the same folder as the cog is in in exts/
okie thanks
!guild
Created: 4 years, 5 months and 21 days ago
Voice region: europe
Features: PARTNERED, NEWS, RELAY_ENABLED, THREE_DAY_THREAD_ARCHIVE, BANNER, COMMUNITY, WELCOME_SCREEN_ENABLED, ANIMATED_ICON, SEVEN_DAY_THREAD_ARCHIVE, VIP_REGIONS, DISCOVERABLE, INVITE_SPLASH, PRIVATE_THREADS, PREVIEW_ENABLED, MEMBER_VERIFICATION_GATE_ENABLED, VANITY_URL
Roles: 84
Member status:
36496
184473
Helpers: 117
Moderators: 30
Admins: 15
Owners: 3
Contributors: 39
Category: 29
News: 11
Staff: 65
Stage_Voice: 1
Text: 120
Voice: 8
!remind 2h complete thought related to bot assets
Your reminder will arrive in 2 hours!
how is colour stuff on lancebot @fallen patrol
Coming along
I've been working on it this week
My Lance enviroment hasn't been able to start
Will look into it friday but I've been just getting the basics done on a different bot of mine
Been busy graduating and doing a lot of other stuff I have neglected π
π, remember other folks are interested in contributing if you want to delegate
If there are errors being spat out, someone can certainly help here
@fallen patrol
Here's your reminder: complete thought related to bot assets.
[Jump back to when you created the reminder](#dev-contrib message)
Hey! I've been looking at the API code for a couple of hours now, and noticed that the ORM models are still missing, may I ask whether you have any plans on what ORM library you will use?
Looks like it's SQLAlchemy https://github.com/python-discord/api/blob/a882d0eed5478391ffbb9afca68cdafbba1ae947/pyproject.toml#L12
pyproject.toml line 12
SQLAlchemy = "^1.4.18"```
Yeah it is
Oh, I thought https://github.com/encode/databases combined with https://github.com/encode/orm , it has a similar syntax to Django, and was made by Encode.
Nice
Thank god
aha they also fixed the ephermal bug with this as well
@sharp timber π
yep just got discord developer confirmation
it was fixed
@green oriole are you planning to keep that PR until they roll out full support for timestamps, or are you looking to get it merged now?
I would like to merge it when every client can render timestamps
!server
Created: 4 years, 5 months and 23 days ago
Voice region: europe
Features: PRIVATE_THREADS, MEMBER_VERIFICATION_GATE_ENABLED, PARTNERED, SEVEN_DAY_THREAD_ARCHIVE, PREVIEW_ENABLED, COMMUNITY, WELCOME_SCREEN_ENABLED, RELAY_ENABLED, BANNER, NEWS, VANITY_URL, THREE_DAY_THREAD_ARCHIVE, ANIMATED_ICON, DISCOVERABLE, VIP_REGIONS, INVITE_SPLASH
Roles: 84
Member status:
39042
182917
Helpers: 118
Moderators: 30
Admins: 15
Owners: 3
Contributors: 39
Category: 29
News: 11
Staff: 65
Stage_Voice: 1
Text: 121
Voice: 8
220k holy
Should we add another role to the left list, so that it matches up with the right list
since we bumped to d.py 1.7 it shows stage voice channels automatically

would would be the role? voice verified?
Maybe project leads?
ohhh
voice verified could be good too
true
was about to suggest that ^
Would it?
I will create issue
@staticmethod
def get_member_counts(guild: Guild) -> Dict[str, int]:
"""Return the total number of members for certain roles in `guild`."""
roles = (
guild.get_role(role_id) for role_id in (
constants.Roles.helpers, constants.Roles.moderators, constants.Roles.admins,
constants.Roles.owners, constants.Roles.contributors,
)
)
return {role.name.title(): len(role.members) for role in roles}
atm is very much 1 role per line
so I say bigger, not too hard though
Nice
@staticmethod
def get_member_counts(guild: Guild) -> Dict[str, int]:
"""Return the total number of members for certain roles in `guild`."""
roles = (
[guild.get_role(role_id) for role_id in role_group] for role_group in (
(constants.Roles.helpers), (constants.Roles.moderators), (constants.Roles.admins),
(constants.Roles.owners), (constants.Roles.contributors), (constants.Roles.project_leads, constants.Roles.domain_leads)
)
)
return {" & ".join(role.name.title() for role in role_list): len(set(role.members for role in role_list)) for role_list in roles}
Some like that
but clearer
probably with an actual for loop instead of a dict-comp
Should I add that to the issue? 
that won't work actually
ehhh maybe pseudo code of it
we would definitely want to break that down more, so it's more readable
Yeah, nah, this is a bad implementation haha
Am I the only one to get a DataError: integer out of range when trying to sync roles on the test server?
I've never gotten that error
Make sure site is up to date
Yea, that was my bump to d.py 1.7
had to do a site migration, since the role integer now exceeds the max size of a psql int
Aha
Lmao I think this is part of the reason discord is running out of permission bits
I don't think it would be terribly difficult for them to do it
But all of the broken bots
And yes, they would probably bump api version
But regardless, bots would need to migrate
permissions use strings so they can easily have more bits than they already do
Right, they migrated that in v6 iirc
nah
the reason was because of javascript
a database schema change is fine, and most languages support large integers, but javascript cannot serialise a JSON integer into a large integer
How did u find out smh Joe always knowing
lol
common knowledge
several platforms have experienced this, have you ever wondered why IDs have always been strings with the Discord API?
it's because of this
So it is actually a backend problem?
nope, frontend
there is no backend problem
in fact with ETF, IDs are still sent as integers, because the erlang backend servers, python and clients can understand them
Ah
but javascript cannot
Iirc also permission bits are sent as a strings now
So it's not really limited on permission bits anymore?
nope, they can add freely now (and have β threads have a new permission bit, so did stages)
Or theres probably something else we don't know
3 for threads
yeah
> Number.MAX_SAFE_INTEGER
9007199254740991
> parseInt("9007199254740992")
9007199254740992
> parseInt("9007199254740993")
9007199254740992
> parseInt("9007199254740994")
9007199254740994
> parseInt("9007199254740995")
9007199254740996
you can see how javascript gets a bit iffy with those
>>> int("9007199254740992")
9007199254740992
>>> int("9007199254740993")
9007199254740993
>>> int("9007199254740994")
9007199254740994
>>> int("9007199254740995")
9007199254740995
whereas Python, handles it
Ah
JavaScript does have a type for it BigInt, but you can't deserialise straight from JSON into it
so you need to transmit as strings and then convert, so internally the clients still operate as if they are integers, it's just that in transit the client converts them to strings so there is no loss of precision
Hi! As for this issue: https://github.com/python-discord/bot/issues/1667 , is it an acceptable "solution" to create a helper class that basically "joins" the statistic of the given roles and ofc. set a name for them (in that case that would be: "leads") and later on add the "joined" roles to the list?
(I'm just curious, that was the first thing that came to my mind when I came across this issue, but I'm not sure whether it's acceptable or not)
Yea i think that would make sense, maybe a helper function in that class, rather than a class itself though
Yeah, the reason I said class, was because I wanted to somehow keep this syntax at the end of the code
return {role.name.title(): len(role.members) for role in roles}
Btw, I am getting back to my PRs, just been busy so haven't got time
Im new to web development
Hey! If someone has a Domain Leads and a Project Leads role, when showing the stats for "Leads" should it count as two? I mean after all, there are two roles regardless of the fact that on one single user.
(https://github.com/python-discord/bot/issues/1667)
hmmmm, I'm not sure if there'll be a situation where we have one person having both roles. It's feasible, I guess just very unlikely
Should I use a "unique" function, just to make sure? I've just added "more_itertools" to sir_lancebot's dependencies, it has a really useful function for that.
I don't think it really matters, but it should be pretty simple either way without any third party tools: throw them into a set
If that's all what you're using more_itertools for, I'd prefer it if you don't add extra dependencies. I feel particularly strongly about the matter as I was in dependency hell for quite a long while trying to bring sir-lance and python up to 3.9 because I had to deal with unmaintained projects. If we can avoid extra dependencies, that would be ideal
Oh, well. Here's the issue that I added "more_itertools" in regards:
https://github.com/python-discord/sir-lancebot/issues/743
I thought it was the prefered implementation.
I'm not sure if it's needed but if it improves the quality of the code in any way I'd say just add it, more_itertools is a tiny dependency that can be useful and practically can't break
Oh well. If it's really necessary more_itertools isn't particularly... what Numerlor said at the end
Okay, then. It won't be needed in the first issue I mentioned, but in case of the sir-lancebot issue, it's quite useful.
@sleek steppe fix tests 
yeah I'm trying to do that 
It's kinda hard to test tests because it takes forever to run all of them
are you on the latest main branch? We merged xdist which should cut down the time
But regardless
you shouldn't be running them all
Run the suites relevant to your code while you program
then run them all as one final check before you push
How do you do that?
Hey @sleek steppe, I'm currently going off to bed but I'd like to merge the PR tomorrow by the early morning, would you mind if I push changes to your branch if you aren't around, due to the time sensitive nature of this PR?
if it isn't merged by then
yeah, sure
I was going to ask that too since the PR is high priority
How are you running the tests currently?
poetry run task test
Alright, you can append the test suite/test name you want to run. For example:
poetry run task test tests.bot.exts.utils.test_jams.JamCreateTeamTests
additionally, you can get a smaller speed up by using test-nocov instead of test, but that doesn't matter on this scale
If you want to run a specific test, you can use the same format, just add the test name at the end
(sidenote: you're better off running these directly from your IDE if it has support for it. Pycharm has a run button on the left bar beside each test suite, and each test. VS has something similar iirc. I don't think editors like VSC have it though)
hmm that's interesting. pytest doesn't support specifying tests like that. I wasn't aware of that.
You can still invoke unittest though:
poetry run python -m unittest tests.bot.exts.utils.test_jams.JamCreateTeamTests
this works because I didn't pull yet
Alright, I checked it, and pytest does support specifying which tests to collect, you just have to pass in a file path, instead of the module. It's a bit more annoying when it comes to passing in specific tests or suites, but it's fine with files. It also doesn't work with the coverage version because of the order of the arguments π
I've opened a PR now to include what I just described in the README. I don't think many people see it honestly, but it's just a more concrete thing to point people towards, and some people might see it
Xith fastest triager in the world???
Damn y'all are quick
sweet lord
today is productive day.
I'll start at it today, but I may not finish it because it's already 2 in the morning :x
oh lol
finally.
poetry run task test tests.bot.exts.utils.test_jams.JamCreateTeamTests
........
----------------------------------------------------------------------
Ran 8 tests in 3.696s
OK
Hmm this PR implements it's own fuzzy matching instead of using difflib like the error handler. Not sure if I'm more impressed or horrified lol
The tag groups one?
ye
oh jeez lol
It's a pretty clean solution tho so /shrug
interesting, seems difflib doesn't take into account order of the letters
Is that the reason?
Hey @vocal wolf, you around?
Uh, well, actually technically I didn't do that, sorry π’
Time to close the PR

Question, I'd like to add Slash commands to either bot, but I wasn't sure what the process is for opening pull requests. Can someone let me know?
I don't know that we're ready to adopt slash commands on any of our bots right now. It'd certainly be Sir Lancebot before Python, but even then I'm not sure the tooling is there and that we've sufficiently discussed it internally.
Hmm
we wouldn't be using slash commands until discord.py 2.0 comes out
Also, what are the season labels on the github
It is from when sir lancebot was seasonalbot
Basically each of our extension is categorized per season
Morning sir @vocal wolf, what do you think about renaming season labels to area or category?
How do you know which category to update code into then?
I think you should lmao
What do you mean?
How do you know which categories are which when making a PR? And which command would go in which "season"
the evergreen folder is what is used for any code that doesn't fit into a specific season
Well most things go into evergreen
The other categories are things like "Halloween" and "Christmas", so you'll know when something fits in them
But unless told otherwise, assume everything goes into evergreen
So I don't really have to learn that yet? You guys do that for me?
I mean, there isn't much to learn, and we're considering doing away with the entire season system. They are just broad groupings like I said. We have a command that creates easter egg images, which then logically goes into the "easter" folder, not much to learn there
Having a look at some of the files may give you a better idea of what's going on. You'll see that a large majority of all features go into the "evergreen" folder, while very few, specific things go into the other seasons
Why isn't the pride Avatar in pride folder?
Because ???
The avatar cogs are a bit special in that they are all the same cog with slight modifications
It's grouped with all the other avatar commands
Don't we support defining avatar modification from other cogs?
I think it's possible, just copy the code elsewhere, but I think it makes more sense to have them grouped this way. Logically, they are more similar than not
But to go back to the original question, there are some exceptions, but usually those follow some discussion between the person making the changes, and the rest of the dev team
If you'd like to get yourself familiarized with the bot, I'd recommend you select one of the preexisting issues, or open a new issue with suggestions for what you want to change, instead of diving in head first. We can give you better pointers when we start from a well defined goal
Yeah I'm looking at the code and issues rn
@ionic turtle why must you do this
fk, now i lost too
I HAD A STREAK OF LIKE A YEAR
LMFAO
Hey! Do any of you happen to know when this PR might be accepted? https://github.com/python-discord/sir-lancebot/pull/778
I've made several changes to "issues", and wouldn't want to make a PR before that one is not accepted.
It appears that most of that PR is just moving stuff around, so reviewing it shouldn't take too long. The longest part usually is finding people who want to review it
I don't really understand how reviewing work(I mean not the process itself) . Can everyone review a PR or it must be either a Contributor or a Sir Lancebot developer, or both?
Anyone can, and is encouraged to review if they want to, but, for the PR to be merged it needs a review from one Core Developer, and one Contributor/Staff member (total of two reviewers minimum).
While your review may not count, it'll still help because it can get the PR to a more ready state to make future reviews quicker, and it can give more confidence in a PR the more people approve it. Most contributors started out submitting code and reviews before they got any real permissions, but that led to them getting the role.
Interesting.. thank you for the clarification.
Now, my next question.. what if I'd like to review this PR?
(I built the change on top of that branch, I'm very well confident that it works)
Your review would be much appreciated! Even saying whether something starts or not can still be helpful. Saying that you've played around with it, and know it works goes a long way.
hello :D it's been almost a month since the last message on sir-lancebot#756, it's a non-code pr and only needs one last core dev's approval. if anyone is available and would like to review it, it'd be amazing. thanks in advance! π
If you've never seen it, we have a guide on reviewing. It goes over what and why we review, explains what to look for, and explains how to give feedback.
https://pythondiscord.com/pages/guides/pydis-guides/code-reviews-primer/
Thank you! π
Are we supposed to follow pep8 too? I hear people keep on taking about it so
Soooort of. Following PEP8 will get you most of the way there. We also have flake8, with a bunch of plugins which will tell you if you have any mistakes in your formatting. There some rules that we couldn't enforce with flake, you can see a list here:
https://pythondiscord.com/pages/guides/pydis-guides/contributing/style-guide/
Generally, flake will get you most of the way there. The rules in the style guide you can get used to pretty quickly as well. The style guide isn't enforced too strongly (especially on sir-lancebot) unless it fails flake8, or is especially problematic, but someone will help point that out if that's the case.
If you haven't seen it, this page contains basically all the resources you'll ever need:
https://pythondiscord.com/pages/guides/pydis-guides/contributing/
From the two guides I've linked so far, to guides for setting up each of the major projects (you'll really want to read these!), to general info about contributing to these projects.
@dry folio I squash merged your PR because 15 commits fixing typos is a bit absurd haha. Should be good to go now
Yup, we're live
tΓΌrk yokmu bana yardΔ±m edecek
Hey @hasty totem I'm sorry, but this is a strictly English speaking server. Please use English to the best of your ability.
That's okay, but you have to use English as best as you can. If you can't write English at all, you can use something like https://translate.google.com.
Check out #βο½how-to-get-help to get a channel where you can ask your question. Please don't post it in multiple channels, or other people's channels.
Uhh, hey @vale ibex you're the one to talk to about the permission sync error, yeah?
What value am I meant to set lol
When starting the bot, it threw an error when trying to sync roles. The API returned a 400
ahhhh
{'permissions': ['Ensure this value is less than or equal to 8589934592.']}
you need to delete your site image and rebuild it
theres a migration to convert that column to a bigint
I've not been very active recently, so trying to catch up on some things
no worries π
We bumped the bot to d.py 1.7.X
which came with the new permission bits, which pushed it over the edge of a psql int
Do I follow the 12-13 migration guide in announcements?
sir-lancebot#781 tiny PR to fix an error being raised on startup since we deleted the hacktoberfest channel
only if you care about the data in your site db
if you dont, then you can trash it and rebuild
Sweet, thanks
Thank you so much! It's time to test it out!
I want to help contribute but idk what to suggest lmao
Check out the available issues! There are a bunch of great ideas there
Doesn't really matter if it's old, just need to make sure it's still relevant and you're fine
They're still the ones that the author wants to do
Should i just ask if the author is still up for them in the issues I'm interested in contributing to?
That's fine if there's hasn't been activity on the issue for a while.
I forgot how long it takes to build metricity :P. Pulling latest python, and installing gcc and git takes ages
I'm testing without them now, as I don't see where they are necessary
Everything seems to be working currently
if that turns out to be the case, I'll push fixes for these issues
Hey @patent pivot would you happen to know why we do ^
also it seems it doesn't want to start up because the table already exists
Ah I see
Yeah the site DB has metricity tables for testing. Just drop them
cool cool cool, things seem to be running smooth without git
gonna
push that I guess
Going to wait for an answer from joe before PRing. My best guess is it was added to help install packages that didn't have versions released for 3.9 yet, since the change was made end of 2020
hello yes
lol, yeah, it was probably that
d.py version bump iirc
uhhhhhhhhhhhh
let me check what it is now
Well, I guess that means we'll still need them for future proofing, but I was going to suggest locking to 3.9 as well
Thoughts? (we could also do <=3.9)
Probably start it from 6 to 9
lock to 3.9 is fine by me
@green oriole we should do category since area would conflict with labels such as area: backend
I'm just going to change that now
Hmm I'm trying to bump the version. Technically this is a breaking change since versions prior to this supported 3.8+, while now we support 3.8,3.9. Technically no other versions currently exist, so the support bracket hasn't changed, but even more technically, we dropped support for future versions.
Alternatively, we could always ignore semvar :x
The evils of running update. I really only changed 3 lines :P
lol
Alright I changed season to category labels in @dusky shore. Example: season: evergreen to category: evergreen.
cc @green oriole
That seems like a good idea
Still isn't descriptive to me lmao, but your choice
Kek
What's duck-pond?
There is a command in the main bot for it and I'm so confused
It's a starboard for staff
Oh
But with ducks
Kinda wanna see it now
Sweet, thanks!
Are they folks on Android and iOS stable who can tell me of they see this timestamp correctly? <t:0:R>
I'm on android beta but if it helps, I see 31 Dec. 1969
Wait, what
Oh, because it is localized
Makes sense haha
I just would like to make sure it is rolled on every stable platform before incorporating them to our bots
Thanks though!
π
github changed the skin color of emojis
is there a way i can change it to skin tone
Hmm, maybe quackstack can generate duck ponds for you containing x ducks in a pond which could be similar by colour/accessories or not same at all 
@fervent sage
FYI I'm looking through our deps to see if we have more GPL deps
Hey @glacial veldt @green oriole do either of you have a windows systems without build tools? The rapidfuzz page lists it as a requirement, since most of their code is C. They have wheels, so it hopefully shouldn't be a problem, but I'm also concerned about not having wheels for future versions slowing down upgrade processes
I can remove it from my path temporarily to test soemthing if you need scale
pip install rapidfuzz
I highly doubt it'll error out since I'm staring right at the wheels, but a sanity check would be appreciated
I use rapidfuzz at work and there's windows users
I've not tested it personally
they use cibuildwheel so it should be nice wheels
yea, pip found rapidfuzz-1.4.1-cp39-cp39-win_amd64.whl (430 kB)
Perf, thanks!
this page is so useful
It seems pretty well maintained, I don't think we'll run into problems
... don't quote me on that if we run into problems π
this page is AMAZING
I stumbled on it yesterday, quickest bookmark of my life
yeah and the person that runs came and fixed my pypi wheels for me
I want it for answering questions in #async-and-concurrency
If downloads fail, reload this page, enable JavaScript, disable download managers, disable proxies, clear cache, use Firefox, reduce number and frequency of downloads.
lmao
lol
Oh I thought it was in context of the ping command haha
it would be super cool if you could have a !mypy command too
I just want to use discord as a shared jupyter notebook really
lol
.bm
you might want to load those deps in with pip-compile or something so dependabot can update them
We could expose snekbox's -m interface through a shared command on the bot with some universal parsing of the args to get mypy and others without a separate command for everything
lol
btw there's liccheck
you might want to run that in CI
I wish poetry did it for you
like it could refuse to install stuff if your licence was incompatible
tfw all the projects that use aioping are pydis. (for reference, all but one of those bots is @stable mountain)
Hey @green oriole did you manage to check all the other dependencies?
I checked a few, I didn't see any other GPL dep
lmao
Using a library that uses LGPL wouldn't fall under the same problems, would it?
it's not so bad
it's got some problems with vendoring and making a docker image
but it's not been tested anywhere
Eh, I doubt we would get into issues for that
Our containers are public and their source code is available
Also Sir Lance will also need to have fuzzy removed
should I open an issue for a minor non-code correction for the site?
also this link is broken in the site README https://github.com/python-discord/site/blob/main/docs
It's it's small, then feel free to describe it here and a core dev can give approval in place of an issue
Just make sure to mention it in the PR though, in case another core dev sees the PR with no approval
If the candidate received enough votes unanimously, then we offer them the Helper role. This whole process takes place in channels only viewable to staff members.
This is incorrect, since helpers can't see the vote
The Python Discord FAQ.
Hmm Yea, maybe we should change that to say all staff can nominate, but only mods and admins have voting power
I guess it's correct for certain formalizations of "only", but it's at least misleading
Yea it's vaguely correct, but we can be more explicit for sure
permission π ?
Yea :+1:
I don't want to force you guys to rush or anything, but just wondering if anyone has looked at sir-lancebot#783
@green oriole So, sir-lancebot#784 is a WONTFIX?
Could you update the proposed implementation with how you plan to implement it at a high level?
Describe how you plan the command to work, and how you expect to produce the gif, you don't need to write the full code there.
I'm also not sure where we sit legally with that, since I believe the video is copyrighted
on further thought, I understand what it's saying and I don't think clearing up the possible minor confusion is that important
Hey @patent pivot, one for when you're free.
Are we able to do this without worry of copyright?
(shoving a snippet of Rick Astley's video after a user's avatar)
Gotcha, I tried a bit last night, but I couldn't finish. I'll try finishing later
I'll wait for Joe though
I haveeeee no idea I'm afraid. I guess it's parody? Not sure
Yea I'm not sure either, it seems like it should be covered under fair use
For me it is, although I'd like to hear the opinion of at least one other core dev
I think it would be too....
Also, I did post a comment with an example gif if that's what you wanted?
Iβm no copyright lawyer, but that does seem like fair use
I would at least not expect any legal issues with it
I'm trying to stop an ongoing quiz, bit it didn't stop
Were you the one who made the quiz?
Yes
If not, it won't work
So it's a bug?
I can post the gif here too if needed
Are you up to date?
I just pulled
And poetry install?
hmm I created an env via pycharm, but that might be it
Right, that was it, thanks
Oh wow, it runs much faster than with pipenv
I have a question about mocking:
I'm calling a function a from function b in module c. From inside module c, I just call a(...). I then mock the function c.a and am trying to check if it was called after calling c.b. It's telling me that it wasn't, because the function that was invoked in the code is a, and not the mocked c.a. Any way around this?
Wait.. do I like.. mock a instead?
That would make sense
That, or you use the same mock for both
What is mocking in programming lmao?
it is basically a fake function that won't do anything and will allow you to see if the function has been used correctly
It's also when you get frustrated with your code and you start calling it names /s
So it's used with pass??
It is an object with specific methods that allow you test things. For example you can count how many times the mocked function was called
That's whati thought at first
I think I got it now
hey wait that's not actually working
can you use the same mock for both module?
One module: c right?
yeah
Wait, can you give a small sample code?
Mcve
import unittest
from unittest import mock
import c
class Tests(unittest.TestCase):
def test_b(self):
with mock.patch.object(c, "a") as a_mock:
a_mock.return_value = "yeah"
c.b()
that's my test file, and my c file:
def a():
raise Exception("O fuck")
def b():
print(a())
Scale Zig's alt confirmed?
lmao
looks like you wanna patch c.a, yeah
Hmm what does that do?
It mocks the a function of main for that scope
I wonder if there's a more dynamic way of passing in the name. main.a.__name__ would probably work, but it's so much more ugly than just taking main.a as the only argument
o
tbf
my_a = Mock()
c.a = my_a```works as well
The key here is scoping
Doing that will make a a mock for all your unrelated tests
Which can cause unexpected behavior if you're not paying attention
isn't the context getting reset between each test
nah
class Tests(unittest.TestCase):
def test_1(self):
my_a = mock.Mock()
c.a = my_a
c.b()
def test_2(self):
c.a()
This won't throw an error
switching between the format above, and the format of ^ will show the difference
(to clarify, we want it to throw the error)
Hmm how do I make it run a specific test? it seems to be ignoring the path I give it
how are you running tests right now?
poetry run task test <path>
ah yeah. I updated the docs yesterday, make sure to use test-nocov instead of test
you can pass it the path to the file. To run a specific test in a suite, use the k option
The k option?
works, thanks
poetry run task test-nocov <optional/path/to/file.py> (-k "test_name or test_some_other_name")
Usually you won't need K since a file on it's own will only take a few seconds max
aha, I see
I won't paste the help message since it's quite long, but it's the first option in pytest --help
The test unfortunately still doesn't work
if you'd like, throw it in a pastebin and I can give it a look
outside
The test in the main branch works, as it uses self.cog and the functions are under the class
I'm not quite sure what's happening here. I've moved the functions outside the class, and added unimplemented ones for the other functions, but the mock seems to be set up correctly.
Is your branch pushed?
It isn't, as I'm trying to solve the tests before committing the changes
I can send you a copy of the folder
Working with docker just doing docker-compose up
Want to test modpings schedule redis cache scheduler
Tried down then up?
Yep, samething
nope
Could you compose down and then just compose up site
And see if the output looks correct
Maybe a --build too, to grab a new image
if you have everything else set up you could also just run redis in docker alone and connect to that
smart i will do that, I will figure the docker issue later
I really want to be able to demo use of concurrent.futures.ThreadPoolExecutor in #async-and-concurrency
I think bumping https://github.com/python-discord/snekbox/blob/5d7e7351639474d6e0b5bcb1fb56156a6a76e1e9/config/snekbox.cfg#L110 up a bit would do it
config/snekbox.cfg line 110
cgroup_pids_max: 1```
config/snekbox.cfg lines 12 to 16
envar: "OMP_NUM_THREADS=1"
envar: "OPENBLAS_NUM_THREADS=1"
envar: "MKL_NUM_THREADS=1"
envar: "VECLIB_MAXIMUM_THREADS=1"
envar: "NUMEXPR_NUM_THREADS=1"```
I don't think we should, being able to spawn new thread comes with major security concerns
If i have questions about contributing to the api, like about one issue specifcally then whom should i ask or jsut put it here?
You can ask here
But Sebastiaan is the lead of this project, so more important decisions should get his approval
So basically I am not really sure about how django works just basic knowledge, I am guessing that the main implementation of serializer is basically to check if the off topic name is valid, if it is then save else raise exception and send the same to the user right?
So in fastapi we can completely ignore that and just put a regex validator on the Query parameter right? similarly for maxkey and helptext which are the part of model
Secondly, fastapi doesn't support DRF view set, so should i just make the 4 query options optional and check which are not None. Butt fastapi_contrib another dep supports DRF based views so should I use that instead?
Also should make CRUD functions and then use them when communicating with the DB, or just use plainly in the route function
oh i forgot to tell that this is regarding api#11
It's a conscious decision not to allow process spawning, iirc it's because we can't guarantee death, but I don't think we've looked into it
@tawdry vapor might know more on it, but now that we SIGTERM nsjail instead of SIGKILL allowing for nsjail to clean up it might be more reliable
is that ready to be worked on?
iirc we're adding a compatibility layer to pass through unsupported endpoints, then we can cut over to that and gradually build in new endpoint support at fastapi
I believe sir Volcyy is working on it
yeah
What are the rate limits on channel deletions? should I add some sleeps in-between?
discord.py will handle it all
we don't have any commonplace features that delete channels, so we won't block other functionality by using our delete channel quota
Nope it needs alembic support
What sort?
There are a lot of concerns to take care of when dealing with kernel limits and many processes
Hmm could you try with a max of 3? So I can make a main thread and 2 concurrent workers?
I think multiprocessing.Pool needs a bunch more eg a pid for each worker and a tx/rx pair of threads to drive the stdio
subproc.cc lines 389 to 398
void killAndReapAll(nsjconf_t* nsjconf) {
while (!nsjconf->pids.empty()) {
pid_t pid = nsjconf->pids.begin()->first;
if (kill(pid, SIGKILL) == 0) {
reapProc(nsjconf, pid, true);
} else {
removeProc(nsjconf, pid);
}
}
}```
as per this we should be fine, since it'll SIGKILL all procs it's wrapping
hmm wait
nsjail.h line 167
std::map<pid_t, pids_t> pids;```
why is pids in the config struct
does it actually get populated?
as far as I can see it only gets populated in addProc in subproc.cc https://github.com/google/nsjail/blob/d1f332b911a97c91c20c280a0e9757ddba054920/subproc.cc#L214-L231
which in turn is called by runChild in the same file https://github.com/google/nsjail/blob/d1f332b911a97c91c20c280a0e9757ddba054920/subproc.cc#L484
subproc.cc line 484
addProc(nsjconf, pid, netfd);```
so, what this seems to suggest is that when we SIGTERM nsjail the children will not die and will be reparented to init
is init in this context nsjail? probably not, nsjail doesn't reap by default
actually, that's what kilAndReapAll is for right? but that only kills the procs in the nsjconf struct
I think it's something which requires some more testing, we did have this sort of thing in mind while looking at subreaping ourselves (https://github.com/python-discord/snekbox/pull/95)
I'll give stuff a test after I'm back from the gym, need to get a docker install for testing
How do I make this look not terrible
if isinstance(channel, discord.TextChannel):
if (
(
isinstance(criterion, str)
and (criterion == channel.name or criterion == CodeJams.team_name(channel))
)
or criterion in channel.overwrites
):
return channel
I went with
if isinstance(channel, discord.TextChannel):
if isinstance(criterion, str):
found = criterion == channel.name or criterion == CodeJams.team_name(channel)
else:
found = criterion in channel.overwrites
if found:
return channel
do you need the str isinstance?
Won't it yell at me if I try to compare between a string and a discord channel?
Sorry, between a member and a string
And if it silently converts the member it'll be a bug
In the overwrites mapping?
In the comparison
you're checking containment so it shouldn't matter afaik
I mean in found = criterion == channel.name or criterion == CodeJams.team_name(channel)
criterion can be a member
ah right, that should just return false if the behaviour is not implemented as it should delegate to its parent's eq
well it doesn't return notimplemented if it can't handle it but it does an isinstance for you https://github.com/Rapptz/discord.py/blob/462ba84809f43349296c44cbe6468f631a00edab/discord/member.py#L235-L236
discord/member.py lines 235 to 236
def __eq__(self, other):
return isinstance(other, _BaseUser) and other.id == self.id```
yeah seems to work
Thanks for looking into this
Is there a reason you didn't go for hypervisor based sandboxing?
I remember there was a conversation about it here several months ago
Hm weird, can't find it
There was definitely a lengthy convo from Mark in here
oh wait, I'm getting it mixed up with gvisor
Yeah same, just found the convo
Docker + nsjail slots into our existing infrastructure like the British fit with our tea
it's super low resource
I don't remember exactly anymore, but I think nsjail can handle killing children.
I'm not a security expert, but it doesn't sound so alarming to me to allow a few extra pids.
Worst case someone breaks the container and we have to restart it
sad π
Well, the actual worst case is someone finding a way to break out of both nsjail and docker, but that doesn't seem realistic by just adding more pids
We should confirm that children inherit the cgroup, and that there is no way to circumvent that.
yeah, that's what I'm going to try confirm tonight
just checking children inherit the groups and that we don't leave zombie procs
I'll be interested to see how child processes affects memory limits
do child procs get allocated their own memory limit? I forget if same cgroup is combined limits
@gritty wind I broke your PR.
https://github.com/python-discord/bot/pull/1676#pullrequestreview-702492594
nay
it is currently running yes
sweet, do you mind?
do what you must
are you testing it on your own bot? I'm not getting any errors
Yeah no idea how you found that. Glad you did
ah, just my luck. Ran the same exact thing twice without restarting my bot for two different outcomes
oh dear
I realize I snipped off the first command, but it's the same lol
hi guys
I'm looking at bot/constants.py in Sir-Lancebot right now and it's got:
MODERATION_ROLES = Roles.moderator, Roles.admin, Roles.owner
Should Moderation Team be included there?
Yeah probably
Moderation team is Roles.moderator
ohh that makes sense
To explain the naming, that was the original name before the new system
Then what is the plain moderation role?
it wasn't updated, because there wasn't a need for it
That doesn't exist in sir-lance's constants
It doesn't really need to know it
that'll teach me to rely on names
If you kill children, you go to nsjail.
First, let me provide some context. Nearly everything in our current API (django) is built using a package called Django REST Framework (DRF). Things like serializers are features that are part of DRF. This also means that if you want to look up something about the API, your best bet is are the DRF docs (e.g., https://www.django-rest-framework.org/api-guide/serializers/.
In DRF, serializers take care of serializing complex data (e.g., ORM model instances) into simpler native Python datatypes (such as dictionaries that map strings to strings) that can be easily rendered into JSON. They also work in the opposite direction: If you get some unvalidated date (e.g., from a request made to the API), they can take care of deserializing that data into a validated dictionary and/or "saving" it to an ORM model instance.
In your serializer, you specify the fields that the serializer expects either based on explicitly declared fields (like in a Django Form) or use a ModelSerializer that automatically determines the fields based on a Django ORM model (much like Django's ModelForm).
FastAPI works a little differently in that you typically use a pydantic model to specify the schema of an endpoint. You can use a pydantic model to define which "fields" (quoted to avoid confusion with DRF fields) an endpoint expects and FastAPI will use this pydantic model to deserialize the request data into a Python object (an instance of that pydantic model) (see https://fastapi.tiangolo.com/tutorial/body/). You can also return a Pydantic model instance in FastAPI, and FastAPI will automatically serialize it into data that can be sent along with the API response (see https://fastapi.tiangolo.com/tutorial/response-model/).
Pydantic provides features that allow you to add validators to your pydantic model (see <https://pydantic-docs.helpmanual.io/usage/validators/), although there is also some default data coercion and validation going on, as Pydantic will try to coerce the input data into the type specified for a field, raising an error when that fails. Depending on what kind of validation you need, this annotation-based coercion/validation may be enough.
For regex validation of a string, you can use a contrained string, which is a type provided by pydantic. There's an example here: https://pydantic-docs.helpmanual.io/usage/types/#constrained-types, which looks like this:
from pydantic import constr
class Model(BaseModel):
# other fields removed
regex_str: constr(regex=r'^apple (pie|tart|sandwich)$')
However, FastAPI/Pydantic does not take care of serializing such a model into a SQLAlchemy ORM model.
Yeah i understood the fastapi part (had a similar implementation in a personal proejct) had confusiong about the django implementation, but since we can add regex on the query parameter we get through post request do we really need to add regex to the model too?
We're not sending the data as query parameters, right?
We're sending them as part of the request body
(except for look-ups)
No, like when we create a new off topic name we first validate if it is agreeing with the regex right? if it agrees we add it and if itsn't we raise the exception i.e. https://github.com/python-discord/site/blob/main/pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py#L84..L86
pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py lines 84 to 86
serializer = OffTopicChannelNameSerializer(data=create_data)
serializer.is_valid(raise_exception=True)
serializer.save()```
Most of our API interactions are POST requests that send a request body
query parameters are things like url?a=b
We use that for getting off-topic names, probably
but probably not for creating new ones
oh, we do
alright, this is an exception then
Yeah, so lemme explain again, if we want to make a new off topic name then we make it like ?name=lemons-lemonade-shop right? and once the API gets it we use the serializer to validate it with the regex. But now in fastapi we can add the regex when getting the query parameter with Query() class. So i don't see a need to add the regex validator to model since we can already validate it when getting the query parameter
Yeah, I figured that we were using the same kind of POST flow as we use for nearly all other API endpoints, but I was mistaken
Normally, send along JSON-formatted data in the request body (and params for things like searches/lookup parameters)
Yep, but my question is whether we should validate it in the model too or not?
Probably not, since it's a param
Yep, and about the viewset in the original question
I'm not in favour of introducing DRF viewsets into our FastAPI project using some kind of tool
I don't think they bring us much
We were using them because we were using DRF, but we're migrating to FastAPI now
yeah, same here. Thanks i will go ahead and do it that way π
I was wondering what you were typing for such a long time
lol
Why is there a Bible up there
Because he is good at explaining things
he sure is
don't mind me
Have you seen? https://github.com/collerek/ormar
Seems like it handles sqlalchemy models from pydantic models
Although totally separate from sa.orm.declarative_base it's built on sa core with encode/databases
Hey !
Yeah I have worked with ormar before, but didn't really need it I mostly keep my fastapi project similar to tiangolo's postgres template
https://pythondiscord.com/events/ we need to change the UPCOMING EVENT to ONGOING EVENT
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.
https://pythondiscord.com/ same here, you can't sign up now 
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.
Yep yep
Would it be possible for !docs to be able to get numpy and pandas docs with np and pd as well?
Can you try to lookup anything with np?
!docs np.ndarray
should work now
how did you do it
Did you just add them as an another inventory?
yes
That won't really work as the module names are in most symbols parsed from the inventory itself, the ndarray probably worked because ndarray alone was a thing and the bot added the np name prefix to resolve the conflict
!d numpy.array
numpy.array(object, dtype=None, *, copy=True, order='K', subok=False, ndmin=0, like=None)```
Create an array.
it'll always be numpy.array, with a second symbol that'll either be np... or numpy... depending on which was loaded first.
We could try replacing numpy with np etc. if a lookup fails to accommodate this though
how did you guys rename your k8s nodes
we did that? π€¨
They aren't, they're just using the node names set by linode, with a set prefix
What are you referencing?
yea

i saw an image which had pydis-1, pydis-2, pydis-3 was that something else? 
if you show me the image I can tell you lol
ah, that's just a monitoring service that pings set hosts, a b & c correspond to the 3 hosts above, arbitrarily assigned
thanks 
Idea: make the user command (!u) display how many total points you have from .quiz
Wait nvm I just realized those are from different bots
We do have an issue for a global leaderboard for sir-lance games
let me uhh
sir-lancebot#627
It's approved, someone just needs to claim it it seems
looking into it, blip at linode I think
oh ok
!remind 2h bot#1643
Your reminder will arrive in 2 hours!
@fervent sage
Here's your reminder: bot#1643.
[Jump back to when you created the reminder](#dev-contrib message)

Can we contribute to the bot?
You sure can! How familiar are you with contributing to open source projects?
It's my first time..
But ik git and github fairly well
The bot use discord.py framework, if you know them pretty well then you should be good to go
i see
Cool! I'd recommend you to start with @dusky shore, I assume you know discord.py, right? (it would be a good learning opportunity either way)
In those issues, are they any that you'd like to work on? https://github.com/python-discord/sir-lancebot/issues
We used Azure Devops for CI/CD before, but after GitHub Actions release we use this instead.
ah
its actually amazing to see how little files are used in these projects
and the folder structure isnt massive either
Yeah ik discord.py i have made a bot I'll take a look at the issues thanks so much :)
Cool! Tell me if you find any!
Oki dokie ^^
You can look at issues on the bot of course, if it's more interesting to you
I havent used the bot but yeah will look into it thank u so much
@weary pumice @short snow @cold moon azure devops and github actions are basically the same thing
so most of the actions stuff look quite similar to devops
but yeah now we're fully on github actions for CI and Linode for hosting
we have used Azure in a couple of minor places though
i see
Same thing?
under the hood they work quite similarly
For site#494, could I use custom CSS or should I stick to Bulma? I think using some CSS grid with media queries would make it a lot more accessible (its practically unreadable more) then how I have it now
yes please, do what you need to do
No green check π
which branch should i push my code to in @dusky shore
a new one on the forked repo
ah okay thanks
And you need to get assigned to a issue before you work on one/ get a core dev approval on the issue befroe you start working on it
There is a problem with the bot?
technically..... github actions is still azure lol
sure its not the same thing but its still azure underneath
Wait, what? GHA is using Azure?
No, they are two different services but they work similarly
guys can i remove the time limit of the reactions in the help command embed cause its like we have so many commands and its like really frustating everytime we have to write help command when the time ends ?
I've put together a post-mortem for earlier outages for those interested.
The timer starts from the last reaction press, so if someone is still using it, it won't run out of time
but after we press it will go away and i dont want that
It has to expire eventually, we canβt wait forever
The timer is set so you can actively get to whatever you want while using it, afterwards itβll expire
so ill increase the time limit then is that okay?
CodeJams
!codejam
A Group of commands for managing Code Jams.
DMRelay
!dmrelay <user> [limit=100]
Relays the direct message history between the bot and given user.
Defcon
!defcon
Check the DEFCON status or run a subcommand.
DocCog
!docs [symbol_name]
Look up documentation for Python symbols.
DuckPond
!duckify <message>
Relay a message to the duckpond, no ducks required!
Extensions
!extensions
Load, unload, reload, and list loaded extensions.
!extensions reload [extensions...]
Reload extensions given their fully qualified or unqualified names.
.help
AdventOfCode
.adventofcode
All of the Advent of Code commands.
AprilFoolVideos
.fool
Get a random April Fools' video from Youtube.
AvatarModify
.8bitify
Pixelates your avatar and changes the palette to an 8bit one.
.avatar_modify
Groups all of the pfp modifying commands to allow a single concurrency limit.
.avatareasterify [colours...]
This "Easterifies" the user's avatar.
.mosaic [squares=16]
Splits your avatar into x squares, randomizes them and stitches them back into a new image!
.prideavatar [option=lgbt] [pixels=64]
This surrounds an avatar with a border of a specified LGBT flag.
.spookyavatar [member]
Spookify an user's avatar.
lol how long are we waiting in the bot for?
5 minutes on python
30 seconds on lance
5 minutes is way too long
30 seconds should be enough to read a page
Iβm not sure why youβd need more, what were you doing where you found this to be a problem?
Let's do 1 minute in both bots?
Ehh I donβt think it really matters
5 mins is long, but itβs whatever, it doesnβt pose a problem
If 30s is too short, we can raise it, but Iβm not convinced thereβs a need for it
idk i just thought that we have so many commands and then we have to first test first page commands then go to help command msg then react to go to next page then try that then do all that steps
instead of that just making it little longer
so we dont have to constantly type .helps
It feels a bit short sometimes, yeah
but 5 minutes is too much
We could make it 24h if we wished, it doesn't cost us anything
wouldn't it be easier to assign people their help channel role?
is there a limit on roles?
The role list can get slow when there are many roles
we currently have quite a lot, so adding another ~50 could make it a lot worse
Can we implement a ai bot in discord? (I did make one)
What would you have it do?
who's this jchristgit guy and why does he write half a book as his pull request description?
I'll find himand cyber bully him for making me feel bad with my two lines pull requests
excellent idea, get the heretic πͺ π‘οΈ
chatbot
5 minutes is common
what is dis channel for
@brazen charm Sorry for the delay, mentioned the changes in bot#1634
Hi
are yall using statuspage by atlassian for your status page?
and if so how has that experience been
They're using freshstatus
https://status.pythondiscord.com/ is Freshstatus, only component that we use Atlassian for is Paging (OpsGenie)
whats the costs like?
if you can divulge that
free
nah
well now im intrigued
Freshworks has more components in their stack that are paid for
ya i only need barebones stuff, preferably embeddable
you can embed stuff yeah
one sec
this looks very promising ty, id prefer to save the time and not roll my own π
when pydis has an incident the home page will have
but there are a few styles, I didn't want anything too invasive
Is pydis on the anyone can use everything pydis has for free stack?
(ex pydis isn't paying and isn't sponsored by then)
I was thinking about how someone suggested a !black command so I thought of something similar. Some people want to disassemble their code to see what instructions it is giving python, so I think a !dis command could be cool. python -m dis expects a file, but I think you can do something like echo {code} | python -m dis -
I don't think that'd be more useful than just running !e and doing it in there
I think for any of those things, showing people how they can do it themselves outside of this server has its value
Creating dedicated commands obscures that somewhat
we do not pay freshworks or have reduced rates, no
follow up on post-mortem, linode have replied and explained a bit, dropped their response in the post-mortem
In which place of the code on pixels do you check for the bearer token, I couldn't find it in the code, like how do you validate the user
pixels/utils/auth.py line 30
token_data = jwt.decode(credentials, Server.JWT_SECRET)```
pixels/endpoints/general.py line 10
router = APIRouter(tags=["Canvas Endpoints"], dependencies=[Depends(auth.JWTBearer())])```
Should there be a leveling system ?
In what way?
So the docs directory link here is broken: https://github.com/python-discord/site
Also, I want to make updates to the README to explain the structure of the site and where which changes should be made. Right now it's the opposite on intuitive
It was site#523
Ahh
in the basic way with some roles to give as we progress
My question is progress through what?
Is it based on message count, amount of help given, etc
hmm..i was initially thinking of message count but amount of help can do the trick too
Weβve looked at both those systems in the past
The thing is, they donβt incentivize the right type of engagement
You donβt want people just sending messages to reach some meaningless count, that leads to spam. We can see that with #voice-verification
The same goes for help in a slightly different way. Youβre incentivizing shorter questions only getting answers, and spoon feeding instead of taking time to explain.
well we can do like if the msg sent by first person != second person like we cant send two msges at a time
It isnβt a question of implementation
Itβs a question of why would we reward people sending messages in that fashion
What is gained by doing that
Thatβs fine, thanks for suggesting it. I think I can dig up some previous discussion of the matter in #community-meta if youβre interested
okay
u have been in the server since the start ?
I managed to dig this up, which is probably the most relevant, but there have been more discussions about this, and other leveling systems in that channel
Uhh
!user
2 years
i will once go and see the discussions thanks :)
cool
yup saw it.
btw where did u guys host sir lancebot?
Everything is hosted on a Linode Kubernetes cluster
We have an affiliate link at the bottom of our website
The manifest is publicly available, but it requires some knowledge of kubernetes
If youβre interested, Iβd start by looking at what docker is, and how it works
404 error
so kubernetes is like docker?
Hmm I thought we made it public
Yeah sort of. We turn our projects into βcontainersβ. Kubernetes deploys, manages, and connects all out containers
ah i see okay..i have to learn docker then
Yeah, thatβs a better starting point, and youβll probably find docker skills more useful than kubernetes, at least early on
I can share our docker config though, thatβs definitely in the sir-lance repo
i watched some enginner man videos talking about docker but thought wasnt helpful at that time but yeah will learn again
yup saw that but i just cant understand the way its set up..its way advance and i am just a 15yr kid..can u explain it pls
Yeah, sure. How familiar are you with docker in general?
0 exp in docker π but i dont need docker as of now..just need what does bot.py,commands.py , group.py do
nvm i got it
Oh, okay
Feel free to ask here about any of our infrastructure/projects, there are usually people around to answer
okay thank u so much for ur help π ..if i get any ideas i will share here before implementing it
btw the bot token must be in a environment variable right as per the code?
@gritty wind
Yeah, environment variable, or you can use the .env file
Have you had a look at the setup guides?
Oops no
It'll be difficult to set up the projects without them, I'd recommend you check them out:
@dusky shore: https://pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/
@stable mountain: https://pythondiscord.com/pages/guides/pydis-guides/contributing/bot/
Okay I will check it out thanks again
https://pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/docker/possible-issues/ why is this link showing 404?
The link moved at some point, which broke it a bit
It's meant to point at
https://pythondiscord.com/pages/guides/pydis-guides/contributing/docker/#possible-issues
I'll push a fix for it
Cool
ok i'm looking into this since I'm trying to tie up my unfinished projects
π€
i got @dusky shore 99% up and running
however i've come across an issue
future: <Task finished name='Task-49' coro=<Message.add_reaction() done, defined at /home/aru/.cache/pypoetry/virtualenvs/sir-lancebot-i7Z5VpzE-py3.9/lib/python3.9/site-packages/discord/message.py:1192> exception=HTTPException('400 Bad Request (error code: 10014): Unknown Emoji')>
Traceback (most recent call last):
File "/home/aru/.cache/pypoetry/virtualenvs/sir-lancebot-i7Z5VpzE-py3.9/lib/python3.9/site-packages/discord/message.py", line 1221, in add_reaction
await self._state.http.add_reaction(self.channel.id, self.id, emoji)
File "/home/aru/.cache/pypoetry/virtualenvs/sir-lancebot-i7Z5VpzE-py3.9/lib/python3.9/site-packages/discord/http.py", line 254, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 10014): Unknown Emoji
obviously, i'm missing the trashcan emote
TRASHCAN_EMOJI"834197531663007814"
β¦i fixed that typo but i still the error
o
It's usually not just the ID
yeah
looking to make a pr to the site since it needs the entire emoji
also,
@vocal wolf unrelated to the above but i noticed you're signing your commits, however your public key is not uploaded to github so they actually look as if you didn't sign them lol
oh yeah
so what happened
I nuked my computer and lost the key, so I removed it from my profile
π€¦ββοΈ
my recent commits are verified.
i have the site repo open, can i add the trashcan_emoji to the required env vars list on the site guide?
I don't follow, are you adding the emoji to the site itself?
no
Can you explain what you're doing then
new env var, TRASHCAN_EMOJI in the form of <>
It was a very deliberate decision not to include it in the "required" list
It's in the extended list
but the bot works fine without it, even if it raises an error
I don't think that's really all that important
Others may disagree, but I think the env list is already long and arduous enough
then
could i update the one at the bottom here to say "in the format :name:"
but without discord parsing that
That sounds fine
like this
Though, I'd probably actually say: "Output of \:emoji:"
man
i forgot that was why
i am tiiiiiired
i legit copied the emoji opened it in the browser saw the url copied the id and paired it with the name
oof
ikr
@gritty wind how's this
i think there's a few places where the trash can isn't just for the embeds but i'm not sure
might be confusing that for @stable mountain
@fallen patrol does the bot run without the emoji ?
it does but errors out during pagination
to note, it already exists in the code and everything
but i had a bigger issue with the emoji not being saved in the right format lol
just wanna fix that lol
going with this
Lol cool
Yeah
cool
iirc that's the error you get when docker isn't running
Just finished doing quote normalization on bot for the plugin
But then I committed all my changes to the wrong branch like a derp :P
Once I get them moved, I'll leave a comment on the issue
My docker just messed up
xD my screen is like ||idk what to say its starts flickering||
We need a .define command in sir lance hot



