#dev-contrib
1 messages · Page 64 of 1
:p
actually i am importing datetime bcz of this
async def date_and_month(self, ctx: commands.Context, date: int, month: Union[int, str]) -> None:
i did notice that, date will be shadowed with the argument date in that function
zodiac_sign_based_on_month_and_date = self.zodiac_date_verifer(datetime(2020, month, date))
maybe u can rename date in the function signature and use datetime.date instead?
date and datetime work same unless u provide the time
calender is built in module?
@green mesa yep
lemme know if you have trouble understanding any of the implementation I have presented in the review
finally it worked
\o/
what happens to the PRs which are stale/author is not responding for a long time?
Our policy is after 30 days we send a message on the PR and on discord if possible, and if they don’t respond after 30 days again, we close/take over the PR
ohk
iceman pr ready for review 😄
oki
looks like u forgot to remove the unused variables
at the top of the file
and this typo
You should enable precommit
@green mesa please cross check if u have gone through all the requested changes, few of them are still left out
go through the requested changes again, u missed some of them
can u show code @green mesa ?
for this error
https://github.com/python-discord/seasonalbot/pull/455#discussion_r495029130
nvm, u fixed it
actaully this got messed up
zodiacs = load(json_data)
return zodiacs, zodiac_fact```
when i did this
``` with compatibility_file.open(encoding="utf8") as json_data:
zodiacs = load(json_data)
return zodiacs
return zodiac_fact```
and this caused that error
one thing to remember, nothing get executed after a return statement
or i should say from the next line onwords
hmmm
so after the 1st return, 2nd wont work
actually i think i understood this wrong https://github.com/python-discord/seasonalbot/pull/455#discussion_r494820854
oh she meant to have it outside the with block
ok
kinda confused with that too
also
here u can use zodiac_fact.values()
so it will be for zodiac_data in zodiac_fact.values()
Februhrary
now its op lol
i guess it doesn't hurt having it that way, what say ??
H should not be capital
oo lol
a colon would be good at the end of the sentence
ok
https://github.com/python-discord/bot/pull/836 How to resolve this conflict?
You should use your IDE to solve it
I can’t see it online sadly
But you should make sure to bring in both features, and test your merge before commiting
I don't know how to solve conflicts in CLI with merge. I have this only done with rebase, but because this already got review, I'm not allowed to force push. How to solve conflicts with CLI merge?
when u pull , the CLI will let u know that there are conflicts which will be then displayed in ur code
I mean this say Automatic merge failed; fix conflicts and then commit the result. and problem is cogs -> exts
I have a lot of PRs that have conflicts because this cogs structure update
I made the change @green oriole but it says piplock is still conflicting I think because the hash is different, is this normal ?
You should revert the change, hold on a second, I'll give you the git command to run
git reset master --hard -- Pipfile Pipfile.lock I believe
Yeah, you removed flake8
I was told to remove it
Not from the dev packages 
This is so confusing 😪
Well I ran the command
failed to resolve master as a valid tree
Yes
And give me the output
Well, it is just to see which branches do you have, no worries
I mean the git reset
minesweeper-contribution is the branch
Ran this now it says '''cannot do hard reset with paths'''> git reset master --hard -- Pipfile Pipfile.lock I believe
@green oriole
Uh, can you try without --hard then?
Good!
I don't like git merge anymore. Resolving conflicts with it is impossible.
Rebase is a lot better for conflicts solving
@green oriole When were you planing on taking a look at the permissions?
@cold moon Agreed for sure. The problem is just the git history being modified, if you don't keep it local
It was supposed to be, like, now, but I got stuck with something else, I'll do it tomorrow for sure
Hahah alright. No stress
Resolving conflicts with a merge is exactly the same process as with a rebase. You're just as likely to get conflicts with a merge as with a rebase.
It still isn't a replacement for a normal merge
It is just a tool to allow you to move work from a branch to another easily
Like, have you ever tried to rebase the same branch twice?
That's simply impossible
Because rebasing changes the freakin' hash
Are you talking about git rebase or git merge --rebase?
Some projects like PrestaShop force using rebase + force push for branch updating
git merge --rebase isn't an option as far as I can see
Why not?
I mean, according to the documentation, --rebase does not exist for git merge
👀
Yeah, I don't see it in the documentation
I use it a bit when working locally on something and need to pull the updates from remote before my own commits
Haven't you tried it?
Sublime Merge don't have interface to solve Merge conflicts, but very good interface for solving rebase conflicts
That isn't a reason though
But really, haven't you tried git merge --rebase?
There are other tools if sublime is insufficient, or the CLI
conflicts are conflicts, there's no special difference between a merge conflict and a rebase conflict
The process should be almost the same though
git merge --rebase seems like a deprecated thing. I don't see what it could possibly do differently than git rebase.
even i took it
(but doesn't look nice on me), i need to earn a role by hardworking
I try GitKraken
When I do git merge --rebase, it adds the remote commits before the local ones, on the same branch
@short snow Let's not make this a think 
Welp, you copied f1re as well hahah
what do you mean?
Adding \♦️ to the name
lol 🙂 \♦️
118 conflicts... GitKraken...
Shit. With merging I lost some changes!
Why git can't solve conflicts itself
It does, but it can't know which changes you want when they affect the same parts
I can solve these changes lost only with rebase
I really think starting again with multiple PRs. Creating same commits again. Just a lot easier...
okay
vsc handles conflict very easily
it gives u option to choose incoming change or ignore it
Force pushes is not allowed, merging is useless for such conflicts (GitHub should be enough smart to solve file moving conflicts), so only way is to do everything again.

It's not the only way. Not sure what you mean by a merge being useless. Again, if you rebased, you'd get the exact same conflicts.
which editor u use ks123?
A merge shouldn't be giving this much trouble. You may be doing something wrong, but I don't know what.
When I merged, I lost changes what I made to Tags cog.
Yes
git reflog
If you lost changes, then it's because you didn't select to keep those changes.
I resolved this locally with rebase, but I can't push it.
When there's a conflict, you can either keep the old changes, keep the new changes, or manually merge them to keep both/a mix
u forgot the else clause here or maybe removed by accident?
I will review it again tomorrow
@green mesa
@cold moon I tried the merge myself. There weren't even any conflicts really.
All that needed to be done was to move the test file into the new folder manually, and then replace bot.cogs with bot.exts
i.e. this was the only conflict ```
CONFLICT (directory rename split): Unclear where to place tests/bot/cogs/test_tags.py because directory tests/bot/cogs was renamed to multiple other directories, with no destination getting a majority of the files.
I don't know what gave you so much trouble
I discovered today that the discord.Message converter doesn't seem to handle <> and [] link escape codes, and since seasonalbot uses it that means that .bm <link> to suppress embeds fails out with a fairly unclear error message. I'm thinking of sending in a PR? or should I open an issue first?
(This example's actually not the best, but the <> are reproduced inside the embed, and thus are hidden)
Your input was invalid: Message "https://discordapp.com/channels/267624335836053506/635950537262759947/759110063553511435" not found.
Usage:
.bookmark <target_message> [title=Bookmark]
You can just PR it
👍
@eternal owl i removed else knowingly because I am using try except below
So i don't need else there
Right
I wnt to work on this
u are already assigned
kay
Can someone approve this if he/she like the idea of having this command😁
this part can be changed in ur partnerzodiac PR
use .values()
so -> for zodiac_data in zodiac_fact.values():
@green mesa There's still a few things being brushed up with the issue afaik
I can approve it myself but I wouldn't want to get ahead of the original posters in the thread
@green mesa just a few more changes buddy
I am happy that I get your valuable feedback everytime
It really helps me to code better
why did you add a check if the user has used backticks? just curious
Actually I added this cuz if user just check for ` it messes up the embed
U can try just remove the check in zodiac command and search for `
The embed will look weired
That's y I added check so embed don't get messed
On pc only, embed get messed this is weired😅
I doubt if anyone will do .zodiac libra
But people try to break command
That's y I added check in advance
So it don't break
You're passing the original text that the user sends to the embed?
Yeh
@eternal owl I am importing datetime becuase of this
If I import date directly it will mess the code
As I am taking date in param
I'm pretty sure that @dusky shore has a fuzzy matching library included in there, maybe what you could do is perform cleanup instead of sending an error message
Hmmm yeh seasonal bot has fuzzywuzzy module included in package
@eternal owl I am importing datetime becuase of this
@green mesa use date, rename the argument todate_
or query_date
i think date_ should do
One more question I am hardcoding 2020 when user enters date
Then I don't think he ever able to search in 2021😅 jan
doesn't matter cuz we anyway hardcoded the check for capricorn
So I need to change it or I can leave?
change it, cuz it doesn't make sense to start in 2020 december and end in 2020 jan
we need another reviwer 👀
as my reviews don't count for the magic button
also, i feel that there are wayy too many logging statements, we could cut a few of them
😔
this logging statement is not true
we are not returning none
instead, u can say invalid date or month given
Ok
new video https://www.youtube.com/watch?v=ZH26PuX3re0 👀
What is Python Discord?
We're a large Discord community focused around the Python programming language. We believe anyone can learn to code, and are very dedicated to helping novice developers take their first steps into the world of programming. We also attract a lot of expe...
@eternal owl can i get soem help smh
@wintry heath what u need help with if it's realted to contribution for @dusky shore or @stable mountain u can ask here
Reset your credentials @wintry heath
@patent pivot #help-avocado
You need to reset your credentials.
This channels is related to dev contribution buddy
Wow what a epic video absolutely mind-blowing , marvelous
https://github.com/python-discord/bot/blob/master/bot/exts/info/tags.py#L218-L224 Anyone have idea how to test this block, especially this loop part. This is my missing 1% for 100% coverage for file.
will i put this regex n r"[`*$^/'\\+%?:;&@!|=().,#]" in constant.py so others can also use to remove ` or special character from input by user?
What on earth is that
I don't know why
@patch("bot.exts.info.tags.Tags.check_accessibility")
async def test_tag_permission_check(self, check_accessibility_mock):
"""Should call check_accessibility for every tag that _get_tag returns."""
self.assertIsNone(await self.cog.get_command.callback(self.cog, self.ctx, tag_name="clas"))
calls = []
for tag in self.cog._get_tag("clas"):
calls.append(call(self.ctx.author, tag))
calls.append(call().__bool__())
check_accessibility_mock.assert_has_calls(calls)
don't cover this part.
import re
striing = "\\\hello\\\*$^/'+%?:;&@!|=().$"
match = re.sub(r"[`*$^/'\\+%?:;&@!|=().,#]", "",striing)
print(match)
I'm sure that you can use a special character for that
i am removing ` or any special character from input given by user
so embed dont break
let me show u ss whats happening
Constructing the regex dynamically using string.punctuation?
I think putting is not a valid... as header will fix this problem
actually i wnt to remove ` if user use
It looks like doing a simple .replace('', '')` when creating the error message should be enough
I think these error message embed colors should be red
Or just don't send the user input back in the embed and you don't have to worry about anything
Also that
or just put a slash \ before the `
But still, I think this should look better when is not a valid... string is in header.
Can anybody review https://github.com/python-discord/bot/pull/836 ? I try to get my old PRs merged to avoid more conflicts.
i tried replace but that didnt helped
i have added ** to highlight the user input this seems to fix the problem
Not sure if it does fix backticks
yeh it fixed
@cold moon
u can use vsc to handle merge conflict
it gives option like this which is very handy if u tackling merge conflict
@eternal owl new change pushed
Ok thanks
😄
small changes required and then we are good to go @green mesa
Well, yes
ok
BOT_API_KEY=badbot13m0n8f570f942013fc818f234916ca531
this is default API key?
I believe so
ok ty vester
Yes it is
wdym by bot api?
@late wolf The bot communicates with our site's API
Through a REST API built in Django
ohh
Sends out GET requests and what not
I don't mind. So whenever your computer tries to access a website, it sends out a GET request, asking the server for the web page.
what does it access from the website though
The bot does the same kind of stuff to our site, but it's wanting information rather than the website
An API is kind of like a menu at a restaurant. You have a menu of items you can choose from and customize how you want them
In our case it access all kinds of neat stuff. The !rules command directly gets the rules from the site, the moderators infraction commands access our database, etc
ohh i see so that's how it access the rules and does it acess the logs as well
@eternal owl again change pushed 😂
Yep!
It's really convenient. The data that we get back is in the form of a JSON, so it's easy to parse as well
is the API open source?
Yep, it's part of Django
@neon garnet i think now u can also check my pr
But pretty much all web frameworks have an API or one you can build
And there's also libraries that are made just to be an API
ohh, can u build an API with HTML and CSS only?
HTML is just for structuring the content on a website. It stands for HyperText Markup Language
thx I understand, btw HEM your elaboration is very intelligible
I appreciate it. I love explaining stuff to people
Makes me think I should have been a teacher
na, We trouble our teachers so much i cant handle that, being troubled
True, but a passionate teacher can make all the difference in someone's life.
In the root of the project you want to run, next to the docker compose yaml file
@green mesa Kinda busy until an hour, be right back
np u can take your time
Is there a reason that we include command processing time in !ping? Since it’s only used for processing the ping command, I’ve only seen it be 0.000ms so far
@green mesa you need to install docker-compose with pip, and run it in the project root
If we had !ping OTHER COMMAND WITH ARGUMENTS and returned the time it took, I wouldn’t mind keeping it there. If it just gets the processing time of ping, I don’t quite see the value of it
It is the time between when the message is send and when discord.py starts processing it
It can be very useful in the case of a raid to see if the bot is actually slowing down
Although, it is pretty weird that it is always 0ms, I have to admit
@green oriole iirc docker-compose should come with Docker Desktop on Windows shouldn't it?
Yeah, I wonder if the code isn't broken
@neon garnet honestly I haven't used docker on windows for a long time, but I think you still had to download it
i have github desktop
Have we tried it while putting heavy load on the bot, like during a raid?
Didn't have to install compose for docker desktop when I set it up recently
Nope, it is pretty recent iirc
We could “raid” the test server and see how it reacts tbh
We can put a heavy load on a test bot tbh
Yeah
Lol same idea
Hahah yep. Do you have a bot we can try it on there?
Although, it would mean that the send event took 0ms to reach the bot, which is quite surprising tbh
means i have to run pipenv direct as i have docker desktop
I can put some load on mine, hang on, I'm starting my computer
What is the most resource consuming command we have?
Alright. But do you mean that it’s actually measuring the time it takes from the exact second the message is registered by discord to the time d.py starts processing it?
Maybe eval?
I worded the issue this way, not sure if it is the actual implementation
Nah, eval is using an internal API
Hmm
You can create a load with internal eval
Let's compute prime numbers
Nice
finds the next, currently unknown, prime number while trying to overload the bot
@green mesa i feel this can be a lil bit more clear without a list comp and appending to embed.description directly
embed.description = f"**{zodiac}** is not a valid zodiac sign, here is the list of valid zodiac signs.\n"
for i, zod_name in enumerate(self.zodiac_fact.keys(), start=1):
embed.description += f"`{i}` {zod_name}\n"```
@eternal owl most of the people dont like string concatination
and list comp makes it easy
thats a lot of un-necessary variables too :/
i made there uncessary var because of flake8
what did flake8 do 
120 char limit
you can always make a string multiline using brackets
what is string comp
i meant list sorry
@green mesa yes
ok tnx
Guys, if you were stuck on an island contributing to our projects on the cloud, what kind of packages (pat and pip) would you like to have?
contributing to our projects on the cloud
What does this mean?
Using codespaces https://github.com/features/codespaces
Basically, VSC, but in your browser
okay, so we can pull the project and work on it there?
Yup, directly in the cloud
So far I selected
APT:
• git
• openssh-client
• htop
• curl
• wget
• nano
• vim
• locales
• sudo
• man-db
• httpie
PIP:
• black
• autopep8
• mypy```
Anything to add?
can we add vscode plugins?
Yup
to ur list i mean
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.
Yeah, sure, tell me iceman
In config.yml
emojies id are already filled
A few which I use are python, prettier, eslint, path intelligence,
You need to recreate them, actually, but this isn't really mandatory
@green oriole how about adding httpie
sure
Ty
The only emoji you need regularly is the deletion emoji
docker-machine ip default
this is throwing error -_-
this is a handy vscode plugin @green oriole
Mmh, I don't want to add too many plugins though
okay
how will i get my default docker ip?
the hosts file where you need to add the ip should have it
It's used by the site, which you need for most of the bot's functionalities
so where is host file located
@green oriole Is this possible to add django command line (django-admin) to codespaces for site?
should be in the guide
docker-machine ip default this is given in guide
will i need to pip install docker-compose first?
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.
django-admin should be included with django itself
docker-machine : The term 'docker-machine' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ docker-machine ip default
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (docker-machine:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException```
The ip should be in the file
url site schema is already set to site_schema: &SCHEMA "https://"
then what should i need to change mentioned in the guide
change it to http
and where is my host file
in bot repo
i tried to run with powershell docker-machine ip default but i got same error
tbh, u don't need all that if ur not using the website
but numerlor said bot interact to do most of the stuff by interacting with site only
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.
i already read that and i tried to run the command
its throwing error
PS C:\Users\HP\Desktop\bot> docker-machine ls
docker-machine : The term 'docker-machine' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ docker-machine ls
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (docker-machine:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
did u use docker desktop installer?
just gotta google that error
The hosts file has the ip inside of it, you don't need docker machine just for that
The path to it is in the guide
i need to fork site also?
u can just clone it
you can just clone it if you don't plan on doing anything inside of it
if ur not working on it
ok
then my docker-machine command will work right?
i wnt to run this docker-machine ip default
to get data of my ip
do u have wsl or git bash
yeh i have bash
what does cat C:\Windows\System32\Drivers\etc\hosts give
i need reddit api cred also in order to work with bot?
ok let me run ice
cat: 'C:WindowsSystem32Driversetchosts': No such file or directory
okay, its actully the other slash
or you can navigate to that file from ur file explorer
ok
i got something
19........... host.docker.internal
192...... gateway.docker.internal
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
i guess the first one is ur docker host ip
ok
in ur config file,set fakeredis to True
im not sure what exactly its called, just search for fakeredis
section = "bot"
subsection = "redis"
host: str
port: int
password: Optional[str]
use_fakeredis: bool # If this is True, Bot will use fakeredis.aioredis
ok
even i had that error a couple days ago, hemlock mentioned the fix
oo
AttributeError: 'NoneType' object has no attribute 'name'
new error lol
when i use !help
and i changed the devlog id but bot isnt sending anything when it gets connected
U need redirect channel ID I guess
In the pins
Yeh for bot
Ah, yeah. There are really a lot of channels
Yeh just noticed tomorrow I will try to start bot correctly
Setting up the bot is little bit pain if system is slow😅
And py bot has lots of cog file
Setting up the bot really isn't trivial — especially not if the system is slow, I guess
@green oriole and I are looking to simplify that process
We're looking into codespaces, bootstrapping and all sorts of fun
Yep. If you'd like any help with that as well, I could probably help
I suspect that as we make the plans concrete we'll make a repo and put issues on it
Yeh new repo😁
Alright. I'll probably see it then
Thanks github, I can easily fix the error if you don't tell me what it is
Do you know if ~/workspace/project is accessible when the container is built?
Because my best bet is that pipenv sync is failing because the directory is empty
I just had a bad idea
We could temporary bind mount the source code, in order to sync the pipenv and pull/build the images, and then discard that and replace it with github's copy
postCreateCommand would be perfect, but it isn't supported
The current setup is on feat/1169/codespaces
I'll have a bite, see you later
Lol, I didn't think about that
I have another idea, maybe that'd be better, we could make a startup script that checks if the container has already been initialized, and then open the shell
actually what can core devs access?
And a lot of work
yeah
the core devs are actually the most active devs
i always see them commenting, creating issues, commiting code, and merging prs
@neon phoenix seasonalbot and python bot use the same help function
yeah but
.help
ah now i remember what i was referring to #ot0-psvm’s-eternal-disapproval message
https://github.com/python-discord/bot/pull/1157
thoughts on this?
Should we allow posts from nsfw subreddits even tho they don't have nsfw content or just block the subreddit if even 1 post contains nsfw content?
more details in the comments of the PR
I don't think we should block a whole subreddit for just an NSFW post
yeah
by block, i mean not litrelly block, they can request again and if the newly requested posts don't contain any, they will get their response
I think we have had an NSFW post on r/python lol
wow thats a surprise
I don't know much about reddit, but, are posts on an NSFW subreddit marked as NSFW?
Yes
yeah
If so, as Numerlor commented, you could just skip the check if the subreddit is NSFW
oh that makes stuff even simpler, lol
ye i guess
@patent pivot is this issue still valid
cuz the help cmd has been updated
Yeah
@cold moon pls confirm
Well, for example, .space still uses the default help
yeah, I think it is the per-command help
When I opened the issue I thought all commands were like space help
ooh i get it
Hmm, i think help format depends on how help command is called
And current version of custom help don't support this way calling
🦀 🦀 Sync confirmation messages are gone 🦀 🦀
It doesn't have any custom events. It uses the ones provided by discord.py only.
no just examples
I'm not sure what you mean. All available events are documented by discord.py
I already listed 3 examples earlier
right, ok
.issue 1187 bot
@tawdry vapor If I understand your comment on ^ correctly, we should not update the Pipfile.
You can it's just not really gonna do much
Alright. I'll leave a comment and close the issue.
Doesn't seem like this version would do anything at all, I don't see any of the bug fixes having major improvements the bot (I haven't tested, I just don't see why there would be changes for the better).
I guess we'll leave the pipfile update to the next version that changes stuff that affects the bot.
So the data gets sent to the site itself
Yes
nope buddy ask in #data-science-and-ml only bcz that channel is made for data science question only
@green mesa can you also simplify ur error method in the partnerzodiac pr, then i will approve it
yeh doing that only
oki
def error(self, zodiac: str) -> discord.Embed:
"""Returns error embed."""
embed = discord.Embed()
embed.color = Colours.pink
error_comp = ("\n").join([f"`{i}` {zod_name}"
for i, zod_name in enumerate(self.zodiac_fact.keys(), start=1)])
embed.description = f"""**{zodiac}** is not a valid zodiac sign, here is the list of valid zodiac signs.
{error_comp}"""```
i have done this
i think u missed \n in embed desc before the error comp variable?
@eternal owl i have using triple quotes
so it already in new line
in description
is it looking nice or i need to change something
Uh, you could change some things to make it pretty
the list comp indent is off
i usually have the opening and close brackets on the same indent level or the closing one 1 indent back
i just pushed changes lol
For example
Don't do this
x = """a
docstring"""```
Do this
```py
x = (
"string1\n"
"string2"
)```
i usually have the opening and close brackets on the same indent level or the closing one 1 indent back
its raising error when i try
ok let me try
Another thing
Make the join method visually better
error = "\n".join(
your_things
)```
ok
There is no need for parentheses around the "\n" in the join, and the square brackets are not needed.
Yeah
Also, in my opinion it would be better if the color and description is specified inside of the embed constructor
embed = discord.Embed(
title="idk",
description="\n".join(
your_things
),
color=something
) ```
I don't really like defining stuff inside the embed constructor, but thts just me 
Now it's better, but I still recommend you to do this
embed.description = (
f"{zodiac} bla bla bla\n"
f"things"
)```
ok
also, as wookie said, you don't need the square brackets inside join
yeh i removed it buddy
already
@eternal owl @neon garnet now i have made changes now u can review the pr
square brackets are not required here @green mesa
also
bunch of ur logging statments dont end with a period
so you could also fix that
I'll do a final review in a couple of hours
ok
Does redis for the bot get backed up to normal storage?
I think there's a command replay save in the mix, although @patent pivot knows more about that
In principle, redis is used for things that should be cached and/or stored in the short term; it's not meant as a permanent storage back-end
Which means that we should not rely on it for things that need permanence.
Yeah, we use redis in append only mode which means that a replay file is saved so in the event of power loss we can replay the last commands https://redis.io/topics/persistence
Example: it's okay to lose the channel->claimant mappings (redis is fine for that); it's not okay to lose infraction history (redis is not okay)
default redis (rdb) just snapshots at intervals and saves to a rdb file, aof saves every op to a file to replay
so in powerloss we would lose maximum 1 second of data
Ah, that sounds good, was just wondering how the different systems that use it would behave with an old cache but it not much of an issue when it's relatively frequent
.issue 48 snekbox
Just curious, what's the current status on this feature?
not being worked on at all afaik
when the bot tests are running, does it run the website locally too?
i mean on github
Tests don't actually interact with the production database, right?
iirc it makes a different one
That's for site. Django creates a test database when running tests using the Django runner
site creates a test database; bot's tests are detached from it
The tests for bot shouldn't actually be trying to communicate with the actual API
Instead you patch and mock the API: You specify what the return of the API call is for your test without actually calling the API
This does not test the integration between bot and site, which is a limitation of these type of tests
what is that for
.issue 454
@eternal owl
with emoji command u can give name of emoji also and give actual emoji also from pydis server
bot will tell u the category and name along with count of emojies present in that category
That's a bit out of scope from what I intended imo
lol
Does anyone know about ROBLOX Coding Lua?
Anyone know ROBLOX Lua?
The intent of the issue was to solely create an .emojicount command as a rudimentary board for displaying the number of each prefixed emoji category, nothing more, nothing less
@clever wraith Not really the right place for asking about that. You can probably ask in one of the off-topic channels
@timid sentinel i am taking query_date bcz i am importing date from datetime
oopsy sorry for ping
just read what u meant
actually iceman asked to change
thats y i have changed to query_date
Looking at it I think RohanJnr was just suggesting that you used date instead of datetime (which is right as this wouldn't depend on time), they weren't commenting on import datetime vs from datetime import date. Both would be fine, but I think having to use query_date makes it look a little inconsistent in the help command
It's not a big thing, I just think it would be a little clearer if it was just date there
ok i will change 🙂
The intent of the issue was to solely create an .emojicount command as a rudimentary board for displaying the number of each prefixed emoji category, nothing more, nothing less
what will be the use of this then?
i believe it would be to do what was said right there in your message: to count each category of emoji's, based on their prefixes
Your command name, functionality and proposed format all don't really match the issue.
If you're stretching yourself thin across two different PRs to a point where you're getting a bit confused over the issue ticket, you should either ask for clarifications here beforehand, in the issue ticket's comments, or consider sticking to the single PR at a time until you can dedicate your full focus to the next one.
yes but the confusion seems to have occurred before you started
and you don't seem to have seeked any clarification
An .emojicount command can be invoked with zero or more categories. For every category requested, each line in the embed would consist of the following format:
the accepting of a single emoji could be a valid option perhaps, but the proposal states it should accept no arguments and show all categories with counts, a single argument of the prefix/category name, or multiple of that
i have just coded the command
i am making changes so command can accept multiple, single or no emoji
and show in that format
multiple, single or no emoji
what about the actual proposed arguments
the original never stated accepting emoji as arguments, but categories
Ok. In future, please ensure you fully understand the issue you've been assigned before attempting implementations though, to avoid this type of confusion. The issue author and many other people here are always able to assist where needed.
This Voice Gate project looks nice... I'm currently trying to figure out about this second DB thing solution..
hm?
Googling it currently
no i mean what's the confusion regarding it
I mean where is best place to put this script, what creates this DB. Also where this should create tables? Should this in migration?
don't create tables
there should be absolutely no ORM integration for this, in fact I've disallowed the prod user from writing to the metricity tables
huh
metricity creates and manages the tables, we'll use raw SQL to query that, no ORM.
what creates this DB
an sql script will on initial deployment
the rest is nothing to worry about as like joe said, it's not something orm has to care about
@obsidian patio helpers should now be able to use !role!
Where I can find the emoji category? Is it stored somewhere?
So in Python this is emojiname.split('_')[0], then you get category
where can I find extension whitelist the bot uses, I tried looking at constants but seems I'm blind
The whitelists have been moved to the site db, you should be able to find them in older revisions of the config file
@exotic ember @green oriole does it look good now?
I wanna clarify one thing regarding the smart syncing of users before I start writing tests for it,
My current implementation in the PR is handling the pagination(which is working great) and to update all users in one request.
The way I am doing it is a with a PATCH request instead of a PUT request. Which means, I am only sending the user ID and the fields that have changed. example: If the user has changed only his name, then the data sent in the request for that user will be
{
"id": 12232....,
"name": "MyNewName"
}```
I way I am doing this is, by setting all the unchanged values to None and then not including the None values when the namedtuple is converted to a dict
Just wanna confirm if this is what you actully wanted or if this is a fine approach
@crude gyro @mellow hare (tagging you too cuz you are about to reivew that PR).
https://github.com/python-discord/bot/pull/1165
I think tomorrow may be my partnerzodiac command can be merged 🙂
Perfect, akarys!
https://pythondiscord.com/pages/resources/guides/ I noticed that the guides section is WIP - which branch is the content being hosted? I can't find it in the master branch: https://github.com/python-discord/site/tree/master/pydis_site/apps/home/resources
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.
pythondiscord.com - A Django and Bulma web application. - python-discord/site
content for the wiki is stored in our database right now @orchid bone
we're planning on moving it to content hosted in a git repo
right now, only staff members can add and edit content on the wiki
(for clarification, any page under /pages/ is a wiki page)
@glass pecan @green mesa I'll try and create an implementation once I've uploaded the assets on my test server. Hopefully this should clear up any confusion.
Ok
What's saltstack?
A (broken) CD service
Broken😅
Nah, there are a lot of them
then why are you using saltstack?
¯_(ツ)_/¯

We will probably be moving away from it though
probably never™️
The devops team has a meeting.. today, I think
how do you know lol
Yup, today
Sneak me in @green oriole
#helpers 👀
That’s not even a link to a real channel
you don't have a helpers channel??
i thought you had a #helpers channel lol
We do hahah
ah
You technically could have made a real link using the id in the bot source code haha
It is working haha
True
from saltstack to #helpers channel™️
SaltStack may be less broken by the end of the day!
lol did I just not add a calendar event for the DevOps meeting
okay
SaltStack may be less broken by the end of the day!
Liar, that isn't possible
I knew I made an event!
current candidates are Kubernetes and something lemon has made bespoke which wraps docker compose
because we won't be using SaltStack lol
Okay, not a liar, but a cheater
k8s is great tbh
We considered Ansible as well but it wouldn't hook well into our autodeploy (Ansible themselves said use 2 servers for auto deploy lol)
k8s is great
you said saltstack is broken
what is more exactly broken on it?
well, it is a janky setup of webhooks which don't always work
And SaltStack had a vulnerability earlier this year which would have crippled us if I didn't update as fast as I did (it crippled one of my personal boxes)
ah okay
just all around spooky
well that sucks
LemonStack when
We have this about the emojis https://github.com/python-discord/seasonalbot/issues/454
yeah, but, that just returns all the emotes
what about a cog that shows more detailed info
like id, name, created_at, etc
.emojicount could be a sub command, then
The ID includes the date created
Just like with all snowflakes, the ID is easily retrieved
i think that the emoji info cog would be better suitable for @stable mountain
I think it’s more of a @dusky shore thing. Just like .issue
Hmm, they aren’t a lot of useful infos tbh, the only useful thing I can think of, is to have a link to the cdn image
yeah
sometimes people just want to get the image of an emote but they don't know how
that command could help
like
Information about :pithink:
**Name** **Created at**
pithink <insert human readable datetime here>
**ID** **CDN Link**
3298423497 <insert here cdn link>```
It would be really easy to access the date created, ID and probably source image
👀
we also need to think about input sanitation and validation
i don't know about a @Developers emote
What's that
(dear staff members, please don't quote my message)
Developer emote
I don’t think there should be much sanitation needed
i don’t know about a
@Developersemote
@neon phoenix here’s a staff member quoting the message.
We have clean_text (or something like that) anyway
It wouldn’t work, but I’m not taking any risks hahah
!emoji add lemon_idk https://link.to-lemon.emote/
It’s really easy to add emojis manually. Don’t think the extra work for the command is worth it
Yeah
evergreen, right?
Yep
Yeh we have issue for emotecount
We discussed that above
That would probably be turned into .emoji count or .emoji list
my pc just crashed, I am typing from my phone
use Mac instead
Hahaha
Well, so, how should I start?
Or we, idk?
What's the proper etiquette for adding features?
We generally open issues on the @dusky shore repo for new feature requests
okay
Yeah
i am opening it, i guess
There’s a template to follow as well that’ll be used automatically
Aah, okay
## Reasoning
<!-- Outline how the proposal would be useful to the community -->```
sweats intensively
i dunno man, probably is going to be helpful
Hahah just try to reason about it
Emoji.created_at is available
This should be a quite simple command to implement, I believe
Explain why and for who it will useful
done
i can do this on 10 minutes lol
btw, anyone who has perms to assign: can you assign me?
Sure, but this isn’t approved yet
Nothing to try to beat hahah
Does pushes to master count? 
no
idk
- this post was made by the default gang
I always use git in jedi mode when I push to master
Jedi mode?
Because https://github.com/python-discord/bot/issues/1173 was merged instantaneously
Don’t do it ves
do it
It’ll ruin the git history
!otn a git-jedi-mode
hm, about the emoji info subcommand
if we want it to be a subcommand of emoji, i need to talk with @green mesa to make .emojicount a subcommand of emoji
well, actually, ping pong anubhav
It can be refactored later, tbh, it wouldn’t be too hard
!otn a akarys-can-be-refactored-later
i (or he) needs to rewrite their code to adapt it
:ok_hand: Added akarys-can-be-refactored-later to the names list.
You’ll have to wait for their PR anyway
Wait what
Oh god, he saw it haha
Why should we refactor Akarys?
That's what akarys wrote
I missed the t while typing
Hahahahhhh
Guess i’ll edit it hack then haha
this:
It can be refactores later, tbh, it wouldn’t be too hard
was:
I can be refactores later, tbh, it wouldn’t be too hard
I ignored the s
let's call it artistic freedom
And I also missed the d, oh god
Hahah I love it
I wonder if it could be just .emoji :myemoji:?
@tough imp .emoji count it will be a thing too
@green oriole what does it feel to have an otname that has your name lol
It is the 2nd otn with my name 
I think I have 3...?
that's not necessarily mutually exclusive, although it's not "directly" supported by d.py I guess
<#dev-contrib message> @tough imp something like this?
sure, the question is more about what's the nicest way to have both .emoji :myemoji: as an invokeable that has .emoji count as a subcommand
it's definitely doable, I'm just wondering what the best way to do it would be
We could make count a subcommand and have a custom converter for emojis for the regular command
you could also always have them as parallel commands e.g. .emojicount unless you think that's ugly
probably making .emoji a command and then check if the second parameter is a command or emoji name?
like
@commands.command(name="count")
async def count(self, ctx, ...) -> None:
pass
@commands.command(name="emoji")
async def emoji(self, ctx, idk: Union[count, discord.Emoji]) -> None:
pass```
actually sorry if the code is dumb or incorrect but this is my solution to this problem
Ummm y not make count subcommand of emoji
because @tough imp thinks it's better if the emoji info is shown by simply doing .emoji :emoji: rather than .emoji info :emoji:
something like !d command does to get docs
groups can be invoked too
I don't necessarily think it's better, just wanted to mention the option in case you like it and want to develop it further
I think you could also have .emoji info :emoji: and .emoji count, and have the group try to invoke the info subcommand if the second param doesn't match any of the subcommands
Yeah. I think that’s the best way @tough imp
I am waiting for pure to show me the format😅,as she wnts to clarify something about command
@tough imp You don't have to do that, right?
I mean this would work:
class Emoji(Cog):
def __init__(self, bot):
self.bot = bot
@group(invoke_without_command=True)
async def emoji(self, ctx, emoji: str) -> None:
await ctx.send(f"Received {emoji}!")
@emoji.command(name="info")
async def count(self, ctx) -> None:
await ctx.send(f"emoji count")
It's just that emoji info would never trigger the first group-defined command, but an emoji can't simply be called info anyway
it's an approach, but I think there's some annoying caveat with invoke_without_command=True that I ran into