#dev-contrib
1 messages · Page 66 of 1
I might ask a lot but can you format the dates?
To just something like 20. Jan - 18. Feb etc
Or rather January 20 - February 18 maybe
¯_(ツ)_/¯
Ok let me try😅😂
Probably worth making a static helper function for that if you dont already have it, that takes the zodiac object, and created the from - to string
Hmmm
Do you have an idea how to approach it?
Yes
First I will break the str with -
Or I will do %d-%m-%y
And then I will convert that to string
Yeh
Ok
@obsidian patio
Here's your reminder: Review PR above /\.
[Jump back to when you created the reminder](#dev-contrib message)
Might need to make an edge case for the dec to jan one?
Your reminder will arrive in 2 hours and will mention 0 other(s)!
wait, will it?
Let me try
Yeh this only
!e py from datetime import datetime print(f"{datetime(2020,12,22):%B %d} - {datetime(2021,1,19):%B %d}")
@nocturne hare :white_check_mark: Your eval job has completed with return code 0.
December 22 - January 19
May i also suggest making the numbers same size? either by 0 prefixing or doing `{i:>2}`
That looks a bit messy
tbh
What about py f"`{i:>2}` **{name}**: {zodiac['start_at']:%B %d} - {zodiac['end_at']:%B %d}"
Maybe italic the dates
@green mesa
I don't really like the codeblocked dates
Makes my eyes jump around the embed instead of going left to right, or down with the names
hmm
Since they're not aligned, and they should'n't be, it's hard to make black boxes in text look good
is my opinion. Just hvave it be either normal text, or all of the from-to dates be italic to draw less attention to it
idk what would look best as i can't visualize it
The names is the main focus, to show what you can use. The dates is like a bonus & filler for the embed to not look huge and still empty.
Ok let me try something different
what about just f"`{i:>2}` **{name}**: {zodiac['start_at']:%B %d} - {zodiac['end_at']:%B %d}" ..?
Else you could just shorten the whole thing by doing py these are available: + ", ".join(names)
Is that bold: normal?
!embed 1 Text hello world
2 Text hello world
1 Text hello world
2 Text hello world
Else you could just shorten the whole thing by doing
these are available: + ", ".join(names)
I think I like this idea
Try it
Ok
imma switch pc, so i can give it a core dev review as well
Ty
@obsidian patio
Here's your reminder: Review PR /\.
[Jump back to when you created the reminder](#dev-contrib message)
I am working on a command for the easter @dusky shore. Should I add a file to https://github.com/python-discord/seasonalbot/tree/master/bot/exts/easter and put my command there?
can you line break it after leo?
let me try
@surreal gulch Seems good to me? If not you can just move it afterwards in review
ok
Does someone need to take a look at my pull req? https://github.com/python-discord/seasonalbot/pull/465
@obsidian patio
Here's your reminder: Review PR.
[Jump back to when you created the reminder](#dev-contrib message)
@green mesa looks alright imo
Changing code rn😅
@green mesa Commiting suggestions in general is kinda bad practice. Just as a headsup
You wont see the syntax highlighting, be able to run it, test it, or run it through any local pipelines
I'm unfamiliar with that seasonalbot has, but in general you should see the code in your editor, and preferable run it as well before commit it
Just like you've been doing outside of commiting github suggestions before
Ok
@nocturne hare now u can check the pr
I'm bissi till tomorrow, sorry
Where am I supposed to run pipenv lock and pipenv run lint?
iirc, you dont have to use lock unless you have changed the dependencies, lint should be used before you commit/pr anything @surreal gulch
Np take your time Chibli
When I try to run pipenv run lint I get 'pre-commit' is not recognized as an internal or external command, operable program or batch file.
have you ran pipenv run precommit?
which repo are you trying to run?
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
aiodns = "~=2.0"
arrow = "~=0.14"
beautifulsoup4 = "~=4.8"
fuzzywuzzy = "~=0.17"
pillow = "~=7.2"
pytz = "~=2019.2"
sentry-sdk = "~=0.14.2"
PyYAML = "~=5.3.1"
"discord.py" = {extras = ["voice"], version = "~=1.4.1"}
[dev-packages]
flake8 = "~=3.8"
flake8-annotations = "~=2.3"
flake8-bugbear = "~=20.1"
flake8-docstrings = "~=1.5"
flake8-import-order = "~=0.18"
flake8-string-format = "~=0.3"
flake8-tidy-imports = "~=4.1"
flake8-todo = "~=0.7"
pep8-naming = "~=0.11"
pre-commit = "~=2.1"
[requires]
python_version = "3.8"
[scripts]
start = "python -m bot"
lint = "pre-commit run --all-files"
precommit = "pre-commit install"
I don't think so
All dependencies are now up-to-date!
pre-commit installed at .git\hooks\pre-commit
im running pipenv run lint now
I think it's wokring
this is for the checks?
ye
yeah make the linting changes and then when it doesn't error out at all you're good to go
np
If anyone's free this'll be up for review
Do you guys think I should keep this comment?
@obsidian patio what do you think? I saw comments like this on a few other commands so I added it too, but my thing already has quite a few comments like you pointed out 😅
well it is nice if you add comments
it lets others know about the code, and makes it easy to understand the code
From the next lines, it’s obvious that you’re building an embed
According to PEP 8, you should try to use inline comments sparingly
They clutter things up when they explain the obvious
well that comment isn;t necessary tho, since it is clear from the next line
Okay then, thanks!
@ruby pulsar have a look through the code and see where you’re explaining the obvious. More often then not in these scenarios, it’s better to improve variable names and similar, though
Ahh alright
Perfect
Hey @cold moon, it seems like you aren't assigned on the issues linked in https://github.com/python-discord/bot/pull/1016, although I can't assign you because you apparently never interacted with those, can you add a comment on them please?
.pr 414
@neon garnet UwU
Looks nice!
now only one condition i need to handle for none
Thinking about it, what would it look like if the emojis are on the left hand side?
I feel like it'd look more symmetrical that way
Cool cool, maybe you could reword it to "There are 2 emoji in the et category"
Right, you could also remove the code block for the number I guess
async def ec(self, ctx, *emoji: str = None):
y this is invalid syntax
@green mesa the star
if you want it to be a list or none use emoji: typing.Optional[typing.Sequence[str]]
yeah of course
<class 'NoneType'>
huh
async def ec(self, ctx, *emoji: str = None):
y this is invalid syntax
he wanted it to be also none if nothing is specified, and that's why I told him to use optional
So the emoji is passed in ctx because it isn't typehinted, isn't it?
but now emoji is just a string, ignoring the whitespace :|
you'd want to split it later
@green mesa i think there are x emoji in the **x** category (with the) might make it more grammatically correct
ok
@neon phoenix i use to think same
but thats not happening
if i give multiple category it splits automatically
@green oriole i have installed pre-commit but pre-commit didnt told me anything
but when i pushed my changes it failed
then it lint the all folder not just which i updated
but when i commit it runs the pre-commit hook
but dont know how it passed
now i have pushed the changes and pr is ready for review
I think the returned reminders embed makes it a bit hard to read the message
Your reminder will arrive in 1 second and will mention 0 other(s)!
@obsidian patio
Here's your reminder: Here's some sample text to remember!.
[Jump back to when you created the reminder](#dev-contrib message)
Especially on mobile
discord mobile is buggy lol
It is
and specially android
I guess
🕐 It has arrived!
Here's your reminder: ```
Here's some sample text to remember!.
I think doing it like this, with it in a multi line code block may make a bit more sense
hmm 👍
locally i get this earlier
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Mixed line ending........................................................Passed
Trim Trailing Whitespace.................................................Passed
check blanket noqa.......................................................Passed
Flake8...................................................................Passed
when my hook failed before i pushed lol
Have you set up a precommit hook?
yup
it popped error for annotation missing at class method
but didnt raise error for ctx
Did you install all the dev packages?
yeh
do flake8 --version
@obsidian patio sounds good to me
Try again with pipenv run flake8 --version
You are hitting your global install, most probably
I'll open a PR about it. Minor enough that it probably doesn't even need an issue
Yeah, no needs for one
3.8.3 (flake8-annotations: 2.3.0, flake8-bugbear: 20.1.4, flake8-docstrings: 1.5.0, pydocstyle: 5.0.2, flake8-string-format: 0.3.0, flake8-tidy-imports:
4.1.0, flake8-todo: 0.7, import-order: 0.18.1, mccabe: 0.6.1, naming: 0.11.1, pycodestyle: 2.6.0, pyflakes: 2.2.0) CPython 3.8.0 on Windows```
this i got
yeh
What does it contains?
#!/usr/bin/env python.exe
# File generated by pre-commit: https://pre-commit.com
# ID: 138fd403232d2ddd5efb44317e38bf03
import os
import sys
# we try our best, but the shebang of this script is difficult to determine:
# - macos doesn't ship with python3
# - windows executables are almost always `python.exe`
# therefore we continue to support python2 for this small script
if sys.version_info < (3, 3):
from distutils.spawn import find_executable as which
else:
from shutil import which
# work around https://github.com/Homebrew/homebrew-core/issues/30445
os.environ.pop('__PYVENV_LAUNCHER__', None)
# start templated
INSTALL_PYTHON = 'c:\\users\\hp\\.virtualenvs\\seasonalbot-d0oxspsl\\scripts\\python.exe'
ARGS = ['hook-impl', '--config=.pre-commit-config.yaml', '--hook-type=pre-commit']
# end templated
ARGS.extend(('--hook-dir', os.path.realpath(os.path.dirname(__file__))))
ARGS.append('--')
ARGS.extend(sys.argv[1:])
DNE = '`pre-commit` not found. Did you forget to activate your virtualenv?'
if os.access(INSTALL_PYTHON, os.X_OK):
CMD = [INSTALL_PYTHON, '-mpre_commit']
elif which('pre-commit'):
CMD = ['pre-commit']
else:
raise SystemExit(DNE)
CMD.extend(ARGS)
if sys.platform == 'win32': # https://bugs.python.org/issue19124
import subprocess
if sys.version_info < (3, 7): # https://bugs.python.org/issue25942
raise SystemExit(subprocess.Popen(CMD).wait())
else:
raise SystemExit(subprocess.call(CMD))
else:
os.execvp(CMD[0], CMD)
@green mesa i meant that link aswell
everything github would be constants/variables
Sorry anubhav I forgot to anwser, yes, the precommit is now installed
What Chibs meant is to use variable for the link instead of hardcoding it
E.g. of what you do
foo = "abcd/efgh"
bar = "abcd/11000"
baz = "abcd/39iik"
Meaning if we ever wanted to change the abcd to something else, we'd have to change it 3 times in 3 different places as opposed to
base = "abcd"
foo = f"{base}/efgh"
...```
In the 2nd case you'd only change the `abcd` once in one place and it would take the effect in all places it is used
ohk
i have made var of github_avatar_url and github_url
changes pushed senjan now u can review pr
Hey @surreal gulch, can you try to commit from this command line just this time to see if github desktop is faulty or not?
@surreal gulch you dont need to put the embeds in a list, unless you dont care about searching for some.
for the json i mean
yeah I working on some of the reviews thomaspet left me
actually he is thomaspet
that would be me
haha
You need a shell in the bot folder, and enter git commit -am "<commit message goes here>"
am?
Your real name isn’t “floppy”, family name “fish sauce”? 😮
am?
@green mesaais stage all files,msupply the commit message with the next argument
Also, -a -m can just be -am
ok tnx btw can u review my pr 😄
it told me flake8 failed again
i wouldn't recommend suggesting -a to people who aren't sure about git yet
even though pipenv run lint works
instead i'd suggest using the staging workflow
Yeah, I expected it to fail anyway
Should I do something about Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning. 'flake8' is not recognized as an internal or external command, operable program or batch file.
You need PIPENV_IGNORE_VIRTUALENVS=1 I think
I’m not sure about the proper way to set it on windows though, if anyone here knows
As an environment variable
oh I can do environ vars
ok
@ruby pulsar after you’ve marked my comments as resolved, I’ll go over it for a second review
You don't need to set that environment variable
It's just to suppress that warning
Basically, this happens when you use a pipenv run command, which you'd normally use when you've not activated the venv
However, if you have an activated venv, pipenv detects that and will respect that (not try to active its own venv)
It would probably be a good idea to look at the linked PR and review the comments there
a good solution will take all that feedback into account
also please make sure that you're familiar with what a Markov chain is
Ok
I'd also recommend finishing the PR's you already have started rather than taking issue after issue while PR's still require changes
I have to find issues for Hacktoberfest
I hoped I can do Dewikification, but my 2 current dewikification PRs block my work
are they ready to be reviewed?
Yes
I can look into them over the weekend
OK
!remind 18h ^
Your reminder will arrive in 18 hours and will mention 0 other(s)!
Just my idea for one issue is displaying resources
But I need YAML dependency from guides PR and resources app from resources home PR
I'd also recommend finishing the PR's you already have started rather than taking issue after issue while PR's still require changes
Waiting for review 😔
@cold moon could you maybe resolve the conflict on 860 (bot) ?
I'd like to review it and merge it soon~ish
I'm just gonna fix it myself
suppose this can do
think it looks good
These changes are pushed to GitHub already
thanks @green mesa
🙂 happy to contribute
Shouldn't the thumbnail be the white on black logo?
Unable to convert 'wolfram' to valid command, tag, or Cog.
!source [source_item]
Can also use: src
Display information and a GitHub link to the source code of a command, tag, or cog.
!src ban
Permanently ban a user for the given reason and stop watching them with Big Brother.
Oops
its not here
!source
Only this shows the thumbnail
might want to change it I suppose
Will I change thumbnail?
white does seem bit out of place
Ok
other than that it looks good for me

@subtle kraken Sorry, I was walking with my dog.
no worries, mark got it
it all looks solid
just waiting if someone also can look at it had I missed something, but I doubt anything is wrong with it
I should also review 836 this week if I don't forget @cold moon
OK, just I'm unable to get this 1 percent. There is one loop that I don't know how to cover.
unit tests for things that aren't very important (core/api/moderation) don't matter too much so while unit tests are welcome, we won't require them
.issue 397 site
So this should just ensure in /docker-entrypoint-initdb.d that database and table exists?
This PR
https://github.com/python-discord/bot/pull/1165
Is ready for review
Thanks to lemon and hemlock for helping me fix the broken tests.
@ruby pulsar after you’ve marked my comments as resolved, I’ll go over it for a second review
@obsidian patio I've already marked them
Perfect
@nocturne hare when you said convert to embed on the fly does that mean also load the json then too, or keep that in memory?
Keep that in memory
and i mean.. you can keep the embeds in memory too
I just didn't like the kind of parses it did by converting json to some other json just to use Embed.From_dict
Embeds have more readable methods to build embeds, or have the finished json format already written in the file
so in the json have them ready to be put into Embed.from_dict?
Yeh
got it
json_embeds = json.load(file)
for key, embed_json in embeds.items():
self.embeds[key] = Embed.from_dict(embed_json)```
That way you can create a look up function as well, if we want to show off a specific save the world embed
@ruby pulsar something to keep in mind in the future: try to make commits “atomic”. Here’s a message from Ves about what that really means
TIL, noted!
There’s also the art of writing great commit messages. “Fix a bug” or “Add stuff” aren’t really good messages. “Fix issue where user ID wasn’t shown” and “add user class” are generally better and more specific messages. This also has to do with making the commits atomic, so message will have a single, clear focus
This just takes time and practice
is it okay to ask about the bot here? more specifically how does the !docs command work? does it read the docstring of the item?
!source docs
Lookup documentation for Python symbols.
This is exactly what how the docs command works
I don’t know how it works myself
oh okayy
The docs use inventory files provided by libraries to map symbols to their places in the documentation pages, the relevant part of the page is then parsed and sent as the result
okay, which docs are included in it?
You can check the current inventories with !d
ohh okay
okay I was trying Django docs specifically
!docs django.contrib.humanize.intcomma
returns nothing 🤔
They named the symbol intcomma, probably because it's not a direct python name
There’s also the art of writing great commit messages. “Fix a bug” or “Add stuff” aren’t really good messages. “Fix issue where user ID wasn’t shown” and “add user class” are generally better and more specific messages. This also has to do with making the commits atomic, so message will have a single, clear focus
@obsidian patio okay, be more specific, got it!
Yep! Or be more “atomic” hahah
@ruby pulsar I think this is my last review before I approve 😄 It's looking good
!d aiohttp
When I search !d django it retruns none?
But other works
Same for discordpy also
I think it will be great if we add something like if anyone searches for discordpy only it should return https://discordpy.readthedocs.io/en/latest/
And same for others
Doesn't really seem to be worth the special case to me, maybe more info in the listing
Django should be a symbol so not sure what's going on there, maybe loaded behind something else; or a bug
Hmmm
Re: infraction append @tawdry vapor
I guess I could also change the parameter name although I'm not quite sure what to do about changing the publicly available interface
Yeah it's weird in the code if it's named infraction_id but is a dictionary
Renaming it to infraction is the best move IMO
Still fairly clear what the argument should be to users
If you want to be safe you can amend the docstring slightly to clarify it should be an ID
e.g. "Append text and/or edit the duration of an infraction given its ID"
Alright, will push changes later
.issue 455 Got two review approved
[404] #455 Issue/pull request not located! Please enter a valid number!
.issue 455
Need review on this
hi im currently setting up my test server for seasonal bot and i used the template link from the pins. in the tutorial it says it needs the channel dev-log ID, i could only find a channel dev-logs under development category. Is the channel supposed to be that, or do I create a new one called dev-log?
nvm i made my own
You could have used dev-logs, that's not an issue
@green oriole partnerzodiac and source command have 2 successful check ,can u have a look at it too ,if it looks ok can u press the magic button 😄
I'm not home, but I'll have a look later, sure
!remind 6h30M anub's PRs
Your reminder will arrive in 6 hours and 30 minutes!
@cold moon i have pushed the changes, i am pinging u here bcz i am not able to request review at github
bro wrong channel
@subtle kraken
Here's your reminder: ^.
[Jump back to when you created the reminder](#dev-contrib message)
ayo which contribs want to leave a review https://github.com/python-discord/bot/pull/1210
About this logging cleanup PR, is possible to get this merged before end of October because I hope this can be part of Hacktoberfest
@cold moon yep, I can get that done for you
if we don't get it merged I'll add the label for you 👍
it shouldn't be a huge review anyway
just validate that the things that need to go are gone
Damn this merge ninja
!relay when joe
Lol
Thanks
Seasonal bot pr will be counted for hactoberfest?
Yes, all PRs opened in October, that get approved and is in not blacklisted repo count
Ok tnx
@cold moon they changed it slightly
however, I have added hacktoberfest to bot, site and seasonalbot (while we are not encouraging contribution en masse, since that burns out our reviewers, we do want to reward contribs)
and if you want your PR to count and it doesn't get merged or approved then ping me and I will add the accepted label
.issue 473
done @green mesa
Tnx joe😁
however, I have added hacktoberfest to bot, site and seasonalbot (while we are not encouraging contribution en masse, since that burns out our reviewers, we do want to reward contribs)
i have 3 PRs open, but none of them opened in october, lol
@patent pivot About this Machine Learning what we talked yesterday, maybe you can submit this to other staff too in next staff meeting, because I really think analysing moderators actions and then later AI that suggest actions to moderators should be nice. And maybe even make this learning from help channels. But I think biggest thing on it is how to make this data so anonymous how is possible, but how this still have good data to analyse.
lol i forgot to reply to this i had thought about it and everything
sooooo
I think it's a very long-term project
Anyone changed the docs for django? The base url is missing a trailing slash and linked to 3.1 instead of https://docs.djangoproject.com/en/stable/
anonymity is not my top concern providing we have very easy methods to opt out and we open source as much as we can (generated models probably won't be open sourced because message contents n' shtuff)
I'll have a think about it, but it is a very long-term thing
@brazen charm Not that I know of, I'll have a look
@brazen charm I've changed it, but it appears that it has been this way for a while
It's now using the stable links, which will currently autoredirect to 3.1
Was just confused why looking up django didn't work and the link seemed to be the missing slash
Does it work now?
yep
My local db that I built from a dump that joe gave me a while ago had the stable link
Alright. It's now picking the "stable" version automatically, so that's better as well
Interesting
Not sure when or how that got changed then
It must have happened manually, because I did use the "stable" one when I set up django
fire did it yesterday i think
because it wasn't working previously either
#bot-commands message
I tried today it was not working 6-7 hrs before
right, he used the shortcut commands
I think something went wrong with fetching the inventory when the bot started
and it was not necessarily related to having the wrong settings
👍
That's just how it works
It tries to look for the "django" symbol and finds an install page within the django docs
!docs flask
This does more or less the same
Afaik it's just the missing trailing slash, the bot just does concat for urls
So missing slash means invalid urls
Yeah, but it was also changed to 3.1 urls directly. I've changed it back to "stable" with a trailing slash now.
It will fetch the exact same inventory object (as Django redirects)
So I'm wondering what this change @sullen phoenix made fixed
What is the supposed problem?
The commands you issued in #bot-commands above your change return the same as they do now
Which makes me want to know the behavior you think is wrong
!d django.db.models.Model
class Model(**kwargs)```
hmm yeah, that didn’t work yesterday
and the docs command auto deletes the invocation message if not found #message-change-log message
I think it was a fluke then, because it appeared to be working just before that
and after that before you changed the url as well
maybe a temporary connectivity issue?
i’m not sure
would it work better if we used readthedocs version of django docs instead
connectivity issues would propagate up to the error handler
The html should be the same between them so it wouldn't help with the parsing
@green oriole
Here's your reminder: anub's PRs.
[Jump back to when you created the reminder](#dev-contrib message)
👀
Run the bot in test server and look at code and try to understand
U will understand it eventually
i dont think we understand like that, we understand by doing it ourself
I answered this already
i think open source is for reviewing others stuff
ik i just wanted to bring it up again
lol

well i just need the logic for how the antispam works
i think I can work out the code myself
👍
Oook
alt account?
Our real joe did it
no me
where did all your roles go?
i'm feeling blue
This color suits your name
fair enough
@patent pivot when did ur color change?
i can still see blue when u have not blue high role 
when i was playing with roles
cache update
Unless they are merged, they are not done
Well, the successful checks are just the CI
There's only one approval though
Iceman and Chibli both approved
Oh sorry, my bad, I didn't notice it github isn't rending it the same way
I guess it is a merge then 
Ty🙂
make him do it
@patent pivot i need to figure out a betterrrr solution
unless you just want me to PR the bad one
lol okay
.pr 473
Can someone plz check this out
someone will review it when they have time
I have 2 pr done for hacktoberfest need 2 more
Wnt to complete by contributing to seasonal bot only 🙂
yeah man it's only 3rd Oct lmao
@surreal gulch That's me
Perfect!
I hope I have enough time tomorrow to start with Voice Gate project.
@surreal gulch FYI, I may not be able to have a second look at it today
@cold moon you have some pretty old open PRs with requested changes, that'd be great if you can address them first
I'm gonna close this issue, the feature already exist
@green oriole It doesn't use the API though, I think that would make it better
.pr 1196 bot
Why aren't we using the presence intent here, even if it's just for the member count?
Presence takes a lot of power of the bot
It eats through CPU like strong acid through metal
Since the bot was online we have received almost 700k presence updates
How long has the bot been online?
In comparison on 2nd place is message create at below 7k
Oh
.
Almost 4 hours now
Presence is just pure useless spam
What we lose? Some stats
What we gain? Less spam, less strain
The member count is really not important to anything

Created: 2 years, 5 months and 27 days ago
Profile: @subtle kraken
ID: 431861021968302108
Joined: 1 year, 4 months and 24 days ago
Roles: <@&352427296948486144>, <@&267630620367257601>, <@&587606783669829632>, <@&267629731250176001>
Desktop
Web
Mobile
Total: 4
Active: 0
The desktop/web/mobile status is from presences?
Yes
Presence tells you activity and status of a member
So you'd imagine why we get a lot of those events
People go online and offline all the time
Yeah I guess we aren't losing much with the presence intent.
I'm reviewing that PR now, I know I can't really approve it, but why not take a look at it.
Feel free to approve it I suppose
It doesnt really hurt much
And its nice if someone can spot some tiny mistake that others missed
Fwiw if you wonder about other things beind disabled
@subtle kraken Why did you completely remove the test for the server info command?
Tests for that cog arent particulary useful
Couldn't you mock an Invite and use it to test the server info command?
Tests for that cog arent particulary useful
@subtle kraken But 100% coverage is cool.
It ties down to why I closed so many unittest issues as well
It isnt feasable on d.py bots
At least without pain
The bot won't ever have 100% coverage with that many api interactions
I dont see gains of having such command tested
And I'd much rather see mod stuff tested
If we have all important stuff tested then sure
If we have all important stuff tested then sure
@subtle kraken Yeah I know we don't really have to test the!servercommand, I was kinda making a joke with the "100% coverage is cool" statement.
I also should have added the :lemon_swag: emoji earlier
.
@subtle kraken Why did you put discord.py in quotes in the Pipfile?
I didn't touch pipfiles at all
But afaik pipenv had some issues with the fact that there is dot in name
Kwzrd was testing smth else as well and pipfile was later attempting to lock file as
discord = {py ~=1.4.0} due to lack of quotes iirc
I think quotes were required
Notice how first commit in pr was done by kwzrd
Oh I didn't realize kwzrd did the first commit.
You guys both have cats as your PFPs.
Oh Pipenv messed up discord.py because of the dot.
Pipenv actually added quotes @empty sluice
I'm okay with it being like that
It works
It doesnt break
As long as it works, I guess having discord.py in quotes doesn't matter.
Seems like it matters for pipenv so theres that
@subtle kraken What I meant was that if "discord.py" works always, but discord.py may break, lets keep it at "discord.py".
Ahh okay
@subtle kraken Do we use the guild_typing intent?
We will
As in we will use the event
Im sure we actually do for moderation already
@subtle kraken I approved your PR (not that it matters, I'm not a member of the repo).
It matters dont worry
I'm trying to set up the Python bot locally, and I'm getting an exception connecting to redis. What have I likely missed?
Whats the error?
Are you using Docker?
Fake redis setup?
the bot is pretty difficult to setup without docker
I don't know what you're asking.
I would like to be able to debug.
Which is why I chose not to.
Do you need redis?
I don't know what it's used for.
It enables persistence for some parts of the bot
Redis is a cache for the bot so it can cache certain information between restarts.
it doesn't really matter most of the time, even for things that use it
What does it cache, by the way?
I see. I don't have any particular goal in mind right now, so I guess it's probably not a priority.
You can set fakeredis to true in the config file so you don't have to install Redis.
Ok, cool.
help channels claimants, verification status, silences, and a few other things i believe
.pr 1202 bot
unless that silence PR hasn’t been merged yet
This looks ready to merge, if anyone wants to merge it.
It hasn't
it’s awaiting kosa’s response
Oh, about the simplified word matching?
and the sets vs lists
Now I'm getting an invalid token error from what I assume is the site API.
I've set the BOT_API_KEY variable with the default value specified in the setup guide.
And the site is running locally.
How are you running the site?
May need to set the debug flag
try true, or ... run --debug
DEBUG=1 was from the setup guide. run --debug also.
So I'm already doing that. But I can try DEBUG=true as well.
Did you set your hosts file to allow pythondiscord.local:8000 or some other site URL?
The former.
not sure then, I guess recheck the everything and if it's correct then check on the site if debug is on, or can go check the token from the site side
Where do I check the token on the site side?
It would fail before rejecting the token if the problem was with the hostname
I know this probably isn't the cause of the issue, but did you install Postgres?
With the Windows installer.
Ah, you asked "did you", not "how did you", sorry.
Yes, I installed it.
I just followed the instructions, but it would be nice if I could check that the token I'm supplying matches what the site expects, but I have no idea how that is stored on the site.
Try opening a shell to the site and doing
from rest_framework.authtoken.models import Token
print(Token.objects.get_or_create()```
@brazen charm You missed a parentheses.
@brazen charm It printed out the same token as in the bot setup guide. However, even if I copy and paste it into my environment variable, it still fails with invalid token.
So that's weird.
Are you using environment variables or a .env file?
I'm using environment variables on a Pycharm run configuration.
I debugged the bot and it is loaded properly.
It is populated on the auth header in the API client instance.
The site logs out the token it's going to use when it starts up
Something like this. ```
web_1 | Creating a superuser.
web_1 | Admin superuser already exists.
web_1 | Existing bot token found: badbot13m0n8f570f942013fc818f234916ca531
web_1 | Starting server.
web_1 | Watching for file changes with StatReloader
web_1 | Performing system checks...
web_1 |
web_1 | System check identified no issues (0 silenced).
web_1 | October 03, 2020 - 23:01:38
web_1 | Django version 3.0.9, using settings 'pydis_site.settings'
web_1 | Starting development server at http://0.0.0.0:8000/
web_1 | Quit the server with CONTROL-C.
May be a slightly different log message if it's creating the token for the first time
Can you try to make a request to the api with curl or postman?
Sure, give me a sec.
This doesn't make sense
Looks in order
I have a hunch the bot may be trying to connect to our production API rather than your test site
You are correct.
I guess I missed some flag or setting or something on the bot.
Ah, I see now.
Sorry for the bother.
Educational though.
Hi @tranquil topaz could you resolve conflicts on your PR & do the changed f1re requested? It'd be nice to merge it
Cool, I got it up and running it seems. Thanks.
@surreal gulch do you know about list comprehensions?
I just looked at your review, I didn't know about them
Aah, alright
pretty useful
!listcomp
Do you ever find yourself writing something like:
even_numbers = []
for n in range(20):
if n % 2 == 0:
even_numbers.append(n)
Using list comprehensions can simplify this significantly, and greatly improve code readability. If we rewrite the example above to use list comprehensions, it would look like this:
even_numbers = [n for n in range(20) if n % 2 == 0]
This also works for generators, dicts and sets by using () or {} instead of [].
For more info, see this pythonforbeginners.com post or PEP 202.
It’s really convenient. There are also dict and tuple comprehensions, if you ever need them
Dictionary Comprehensions
Like lists, there is a convenient way of creating dictionaries:
>>> ftoc = {f: round((5/9)*(f-32)) for f in range(-40,101,20)}
>>> print(ftoc)
{-40: -40, -20: -29, 0: -18, 20: -7, 40: 4, 60: 16, 80: 27, 100: 38}
In the example above, I created a dictionary of temperatures in Fahrenheit, that are mapped to (roughly) their Celsius counterpart within a small range. These comprehensions are useful for succinctly creating dictionaries from some other sequence.
They are also very useful for inverting the key value pairs of a dictionary that already exists, such that the value in the old dictionary is now the key, and the corresponding key is now its value:
>>> ctof = {v:k for k, v in ftoc.items()}
>>> print(ctof)
{-40: -40, -29: -20, -18: 0, -7: 20, 4: 40, 16: 60, 27: 80, 38: 100}
Also like list comprehensions, you can add a conditional to it in order to filter out items you don't want.
For more information and examples, check PEP 274
Tuples don't have comprehensions, just generator expressions that you can pass into the tuple constructor
Yes
Just don't overdo it with comprehensions, sometimes they can be replaced with a simpler construct like calling list on an iterable directly, or are better off using the more verbose, but cleaner syntax of an append in a normal for loop
Yeah
@brazen charm ugh, I assume this would be better off using list(): ```py
[embed for embed in json.load(f)]
What's in the json? If it's an array the load returns a list already and if it's a dict it may be better off with .keys() unless indexing is needed
Right, yeah
it's an array
It would probably work to just do json.load(f), then
https://github.com/python-discord/site/issues/397 Do only thing that init SQL have to do is ensure that DB + table inside exists and when this don't exist, then this create it?
.pr 469
got two approval on this one also from akrays and ks
is it possible to have a voice channel just for contributors or a channel that is meant for discussion about the pydis projects?
like if we need any help with something, then we can use that instead of #code/help voice channel
guild.webhooks is referring to channel in which webhook has to be sent?
@green oriole one more https://github.com/python-discord/seasonalbot/pull/469
Done
You didnt setup website properly
but i wnt to run bot only
Bot is tied to site
so i need to run both?
For majority of stuff, yes
Yes
ok
@cold moon
Hey, I've left you a review for the dewikification guide system on site, it'll require some changes before we can get it merged but you did a great job getting started on it.
AttributeError: 'Bot' object has no attribute 'http_session'``` getting this on reddit comand
on seasonal bot
https://github.com/python-discord/seasonalbot/blob/master/bot/exts/evergreen/reddit.py no imports for that @green mesa
'Bot' object
wat
you shouldn't be using Bot
it should be SeasonalBot
either you're showing us a linting error which is due to bad typehints, or you're showing an error that shouldn't exist and there's no actual useful info in what you posted if so, as there's no traceback
anub, there's no need to do that, he already sent the source link
??, if you mean the above image thumb, that's the pic of our org icon
@crude gyro About guides app:
- Name should stay guides, I think, because changing it now may create confusion for some users
python-markdown2metadataextension don't allow passing list, so I have to remove contributors anyway- I think current way for getting last modification of file works, because like when you clone from Git, this last modified time is same than in Git.
- So this should automatically attach IDs to headers? There is extension for it, but still users have manually put links to there.
Oh, everything will be there?
the "guides" system will just be any static content which cannot be dynamically generated
e.g. rules, faq, privacy, data reviews, code of conduct
I thought that we get another pages app too
I think we are redirecting /pages/ to the guides/content app
I really don't know how we will be able to migrate contribution guides to this app. This design is just so different
What is this channel abt?
📌 check the channel description, Python Discord Project discussions. (https://github.com/python-discord)
Here’s a message from Ves explaining it:
#dev-contrib message
@patent pivot @cold moon
the dewikified site will have three kinds of pages
- content pages, which will be rendered from markdown. This is for all the simple stuff that doesn't need fancy bulma features.
- template pages, which will use Django Templating Language to allow you to add anything you want. This will be used for the front page, probably for event pages, and for contributing pages.
- list pages, which is stuff like the resources. These will probably be automatically populated by yaml.
we'll still refer to some of those content pages as guides, but I think the system itself should maybe just be called content
yep, this is what I thought
or we could go ahead and name them something even more obvious, like markdown pages
But contribution pages need Bulma stuff I think
yes, so they'll be template pages
we're not trying to make everything markdown.
just the simple stuff
Okay, then I have to start renaming one-by-one everything from guide(s) to content?
📌 check the channel description, Python Discord Project discussions. (https://github.com/python-discord)
@short snow so you guys are working on site?
Right now, a feature on the site is being discussed, yeah
Ok
But what about naming this app content, but individual former guides to articles?
articles is a nice word
yeah that works for me, ks123
but with that said, I still want the resources section to be called guides
These can be in category named guides
talking about this screen
we're still keeping this
so when you click this, we should get a list of these content pages that we consider to be guides
but there isn't a one to one relationship between Guides and these content pages
we're gonna use this content app for making all sorts of stuff
including data review
that's not a guide
the issue spec you're working on is really just to create the system that will be able to render a content page
from markdown
Ok, I'll apply this to my second PR too then later. Next thing I have to now figure out is how to provide functionality for multiple category levels
sorry, this is a bit complicated. I hope you follow.
in line paginator can we keep lines = None
whats the context anub?
@green mesa do you have any pending PRs or assigned tickets atm
nope
alright
i will propose one bug pr
you can propose it in an issue, sure
not personally, no
i'm just going through github emails and seen your comment on claiming the pride leaders command
good good. that means your workflow has been smoothed out now, right?
no linting/testing issues?
assigned
now, what was your original question about re: line paginator?
@green mesa
actually what is happening is embed description is exceeding the limit thats y its erroring out
yeh
msg = ''
for key, value in emoji.items():
emoj = random.choice(value)
e_info = f'There are **{len(value)}** emojis in the **{key}** category\n'
if emoj.animated:
msg += f'<a:{emoj.name}:{emoj.id}> {e_info}'
else:
msg += f'<:{emoj.name}:{emoj.id}> {e_info}'
embed.description = msg
is there an issue ticket about the bug
Alright, good. Can be an opportunity to make a really top quality issue ticket since it's relatively straight forward, since you haven't had a lot of chances to make bugfix tickets yet iirc.
Once you open it, we can go through it.
ok sure
Hello <@&295488872404484098>!
We have important news for those of you contributing to @stable mountain.
The master branch now uses discord.py v1.5, so please make sure to merge this change into your feature branches and update your environments and containers.
Additionally, running the bot locally will now require enabling the Server Members privileged intent in the developer portal.
We have extended the contributing docs to include this information: https://pythondiscord.com/pages/contributing/bot/#privileged-intents
P.S. @dusky shore may be soon to follow, so keep an eye out.
For every ping emoji, a pair of kneecaps will be claimed
challenge accepted
Lets hope ak has 2 pairs of kneecaps
3*
does it count if i wait until he heals
Sure does
convenient
On the matter of emojis in categories with only 1 emoji, I think sorting all of those into one category (Uncategorized) would be nice. Right now, .ec yert will think that "yert" is a category
we have paginator which take embed as input?
line?
doesn't matter anyway, you only need to make an issue ticket atm lol
you have a different PR to work on after that
yeh
who knows, I might be able to squeeze in the new paginators by the time you come back around to it too
¯_(ツ)_/¯
What do you mean @glass pecan? Do you think that yert should be an entire category?
/s
Almost thought you'd gone insane
definitely have, just for other reasons
Fair enough
Do you have any invalid and spam PRs from hacktober?
Aka if you know of any. Not that you have invalid ones yourself
i haven't seen any invalids yet personally
Me neither
@green mesa if you mean the bugfix, you should have made the issue first before fixing it lol
is that not what i said
"make the issue first before fixing it"
so yes, issue is required before make a PR
ok let me make
its too late now
if you have a PR of a bugfix, don't bother with an Issue, but please don't skip to the fixing first in future
I found some invalid ones on the CPython repo. When checking for the author on this server, I get that no contributions were found. When checking on my locally hosted SeasonalBot, I get that 4 PRs were made 
Odd
hmm not sure vest, wonder if there's caching at play somehow
so will i introduce my pr directly? for this time
I'm trying out a PR, but can't see why it wouldn't work. Probably, there's some bug with the implementation of the feature
Odd
since it should be a simple fix and you've already destroyed the entire typical document -> discuss -> assign process, sure, but in return for skipping it this once, you better put together the highest quality, cleanest PR you possibly can so it doesn't result in a back-and-forth of fix commits that could have been avoided during the discuss step
ok i will take care from nxt time
Issue is not thing that is always required, some small things maybe approved here, but mostly it's better to have issue opened
it's required for newer contribs and when someone has explicitly asked for an issue ticket, ks
@crude gyro But when I move to markdown2, then I have to remove relevant links too from content app.
.issue 208
@patent pivot can u add hacktoberfest accepted label on this also 
@green mesa That's not an approved PR?
PR
ok
Hacktoberfest isn't about opening issues
i am trying to give my best
make .game only the msg owner react
like if i called it then only it will count it in my reactions
@short snow atm this is a limitation of all our paginators
it'll be updated in the coming weeks though
When u guys work on @stable mountain ,u run site also?
we do, yep
You have to for almost everything, not much of a choice
the compose has one ready to deploy
our contrib guide should go through all that stuff though, so read it over
@crude gyro But when I move to markdown2, then I have to remove relevant links too from content app.
@cold moon
hmm. it doesn't support this metadata stuff then I guess? okay.
well, I think good GitHub Markdown compliance is more important than the markdown metadata, which is a fun idea but not really part of the spec.
After making some more contribution to seasonal bot I will try to contribute to main bot also🙂
actually @cold moon it looks like markdown2 does support metadata as one of its extras
so it seems like we can still do related links
it also solves the IDs in the headers problem
with another extra
and supports various github flavored markdown, like tables and code fences
why does seasonal bot's hacktstats command say Top 5 Repositories?
I know that previous hacktoberfests used to need 5 PRs
alright I think I get it
It fetches top 5 repo where u contributed in hacktoberseason of current year

