#dev-contrib
1 messages ยท Page 37 of 1
That's mainly because some of the packages we use have dependencies of their own.
I thought they were way more tbh
Oh lol
Now i have a piece of code
that i want to add as a command
now how to do that ?
guess you should take a look at how the other commands work and model that approach
Not too complicated, just try to understand what piece of code do what
just give me one hint where is the code of .uwu .random , i will find my way from there
roll not random
pycharm has a project search feature when you do ctrl shift f
Go inside the cogs/ folder and work your way in it
where is cogs
let me try it with pycharm wait
so evergreen season stays online forever with other season ?
?
what class does it belongs to ? !bookmark thing
Evergreen
how to stop the bot if i closed the CMD ?
I couldn't complete it cuz its already 12 here and school tomorrow
How do I access the staff logs?
is it just staff.pythondiscord.local?
cause I get a 404 for it
figured it out
have to add bot/logs/ with the deletion context id at the end
ye
What's wrong with the url constant here? https://discordapp.com/channels/267624335836053506/303934982764625920/651584901044502538
Was it just not meant to be used there?
Yeah, it's meant to be used with format() when making an API call
Made a quick PR to fix that by the way https://github.com/python-discord/bot/pull/678
@tawdry vapor just out of curiosity, why have you pushed 10 commits on my PR https://github.com/python-discord/bot/pull/630, does they came from another PR or something?
No, they were my improvements to the PR
I was testing it and figured I'd just make the changes myself while I have the code checked out
Instead of like, writing paragraphs about it and going back and forth
Sorry, but you may only use this command within #bot-commands, #sir-lancebot-playground, #ot0-psvmโs-eternal-disapproval, #ot1-perplexing-regexing, #ot2-never-nesterโs-nightmare, #414574275865870337.
remove that #deleted-channel BTW
Gonna go to eat, I'll be there in 1h or 2
ok will wait
Stupid as F question still
So i added a bookmark.py with similar syntax of uptime.py , but its not loading , how to make it to load
seasonalbot BTW
@clever wraith have you pushed your changes to your fork yet?
So I can check it out
After you commit you will have to push
Do you have any GUI like github desktop?
Otherwise CLI is fine, you will need to set branch then do a push
why github so confusing
Git can be quite confusing at first, but once you know it it is considered essential when developing
source control is very veyr important
Github has an app - Github desktop, that you can download
It eases the commit push branch switching thingy
It is a better practice to do smaller single-responsibility, well documented commits instead of a big one, so if you need to you can revert to any one of them
Commit more frequently!
If i get a way to submit it ,
its a very small commit
just a bookmark.py file and done
If you want to learn more about git, I can't recommend you enough the pro git book, I read it to learn more about it, and it was crazy simple!
I also find commit etiquette way more complex than actually using git most of the time
heh, commit etiquette
committiquette
Commit etiquette?
Learning when and why to commit, when to bunch commits or push them, how to write commit messages
learning to never force push (to master)
Oh yeah that kind of etiquette
Force pushing can be useful
But yeah, not to master
Just. please no
stash
stash pop
omg where's my precious commits pls giv back
Arg you use jetbrains features?
Command line is great!
can you give me that guide @green oriole
also I find that PyCharm is way better at automatically resolving merge conflicts than git itself is
right here is where i want the bookmark to be used
I hate pycharm's way to handle merge conficts: do nothing
LOL
there's nothing better than a nice 3-way mergetool
that at least is something the community can agree on
haha
Yes I agree
But if I start resolving a merge conflit from the command line, PyCharm just don't care and doesn't open a solver or something
also by the time pycharm has prompted you to handle a merge conflict, it's already tried to merge automatically
well yeah, you need to use the git tools built in for those git tools to work
it's not going to try to interfere with your manual workflow if you use it
But I don't want to use them! 
well then you clearly don't need the mergetool either
The commands can only be used in #seasonalbot-commands and #bot-commands channels
as said in issue comment
It is a decorator
I think
But I prefer using a mergetool than just manually resolving the conflicts
Why do you prefer the commandline to clicking a button and having PyCharm fetch, stash any changes as needed, pull, unstash, and try to merge conflicts?
you find what easier?
no need to go in a submenu of a submenu of a submenu of a submenu
git pll no wait gt pull argh
there is no submenu?
it's right there in the toolbar
hey hey @green oriole listen
the code for 8bitify is
@commands.command(name="8bitify")
async def eightbit_command(self, ctx: commands.Context) -> None:
"""Pixelates your avatar and changes the palette to an 8bit one."""
async with ctx.typing():
image_bytes = await ctx.author.avatar_url.read()
avatar = Image.open(BytesIO(image_bytes))
avatar = avatar.convert("RGBA").resize((1024, 1024))
eightbit = self.pixelate(avatar)
eightbit = self.quantize(eightbit)
bufferedio = BytesIO()
eightbit.save(bufferedio, format="PNG")
bufferedio.seek(0)
file = discord.File(bufferedio, filename="8bitavatar.png")
embed = discord.Embed(
title="Your 8-bit avatar",
description='Here is your avatar. I think it looks all cool and "retro"'
)
embed.set_image(url="attachment://8bitavatar.png")
embed.set_footer(text=f"Made by {ctx.author.display_name}", icon_url=ctx.author.avatar_url)
await ctx.send(file=file, embed=embed)
where is the line which triggers that it is wrong channel ?
seasonalbot does it by default, yeah, afaik
I dunno what submenu you're talking about akarys
I only ever go into the VCS menu if I need to manually push a commit or I need to edit the remotes or something
Like, if I want to amend the last commit, use all unstashed files and do not change the commit message commit -a --amend --no-edit I don't need to search for the option
here it is
yeah, you don't need to search for the option in pycharm
hit version control at the bottom, find the commit in the log, right-click, rewrite
Please, give it a better commit message AG
find the commit in the log
I can just do--amendinstead
i will post the one i am sending here before sending it
well if it's the latest commit then it's the top commit in the list, isn't it
toolbar buttons
pull, commit, compare, history, rollback
wrong emoji
I learned git with the command line anyway, I don't see the point of re-learning everything
the point is that it's faster
โ
you remind me of those 60 year old linux kernel developers
I WILL USE SVN UNTIL I DIE
it is
clicking a single button is definitely faster than opening a terminal, fetching, stashing, pulling, unstashing, and resolving conflicts
even if your fingers are robotic
I always have a terminal open ๐
your point? haha
I mean hey, it's up to you to use the tools the way you prefer, but they are more efficient when used this way
until you actually start trying to use them, you'll never know.
I tried them tbh, and I didn't liked
I mean, if you think you need to go through submenus to pull, I'm not sure you tried it for long
haha
but you know, I agree with you
it's much more efficient to have all of the tools in one place
that place for me happens to be pycharm
Okay, it wasn't in a submenu, but I'm sure some options of git are hidden
Nothing you'll be using on a regular basis
Yeah, you're right, like I run all my code from command line not from pycharm
yeah, I have run configs
although you can't use pycharm's debugger without run configs either
so do you never use the debugger?
Does print() count as a debugger?
womp womp
I202 Additional newline in a group of imports. 'from discord.ext import commands' is identified as Third Party and 'import discord' is identified as Third Party
while i lint it
I use logs and stuff, but never actual debuggers
AG, well, what do you think the problem is?
You need to add a line break between them
no, wrong
*a blank line
Neither of you read the error haha
it says third party
You put too much blank lines ๐
there we go
haha
you have a blank line where there shouldn't be one
I201 Missing newline between import groups. 'import discord' is identified as Third Party and 'import logging' is identified as Stdlib.
I mean, I don't have the code in front of me soo..
Missing
why its so tricky
it's not tricky
linters..
No okay linters are fine
Rules are sometimes weird
just need to get used to them
there are three separate groups of imports and they should be separated by a blank line
D415 First line should end with a period, question mark, or exclamation point
"""A cog for Bookmark command"""
Really
standard library, first party (as in, from the current project), and third party
yes, really
Oh yeah, add a dot at the end
Yes
docstring linting, I must say, I fully support
TYP001 Missing type annotation for function argument 'ctx'
now what does that mean ,
:int
got it
The first line of a docstring should be a summary line summing up the class/method/function. As it needs to be a single, contained sentence, requiring a ., ! or ? at the end more or less guarantees people actually do that.
that's for sure
You know what typehints are?
i know just a type
commands.Context
well, just Context, and import it from discord.commands
I don't really see a case where you would put ? at the end of your docstring, like This function might do something?
long type hints are not friendly
def freeze():
""""
Do you want to build a snowman?
This function freezes ...
"""
D102 Missing docstring in public method
i really don't understand this one
Oh yeah!!
what is a docstring
the error didn't say docstring
yeah, that's a docstring
you should document every public method or function with a docstring.
yes, that's a docstring. Triple-quoted string.
bot\seasons\evergreen\bookmark.py:16:28: TYP201 Missing return type annotation for public function
why so strict
Yep, you haven't type hinted a return type
Because consistency is important and type hints are useful
Because typehints are great!
You'll get used to it.
async def bm(self, ctx: commands.Context, hypelink: str =None, *args):
now what is wrong i don't get what you mean by typehints
also call it bookmark instead
yeah hyperlink ;-; it uses that
your default type has incorrect syntax also
anyway, return types are ```py
def function() -> Type:
But the lint should tell it
Try to name it meaningful, you can add command name / alias in later
yeah
Done
bookmark instead of bm, add bm alias later
async def bookmark(self, ctx: commands.Context, hypelink: str =None, *args)-> None:
that link argument should have spaces around the = as well
now its that
About the function name: https://media.discordapp.net/attachments/267624335836053506/448648499446284308/unknown.png
Well, you'll get a review for sure if you call it hypelink
its catchy so i am using hypelink
It is pinned in #python-discussion
it needs to be descriptive
It should be named jump_url or message_jump_url or message_link
a hyperlink is too generic
async def bookmark(self, ctx: commands.Context, hyperlink: str =None, *args)-> None:
ok now ?
jump_url is used in the reminder cog, so you maybe should use it
happy now
Also hyperlink is used to refer to clickable text that has url
yeah jump_url is probably better for consistency then
BC
also that = needs a space on the right side of it
jump_url: str = None
PyCharm should have an extension for auto formatting code, right?
I mean that type hint is technically incorrect
for VSCode I have one that auto format accordingly to PEP8
but I'm not sure discord.py will put up with Optional[str]
It does
aha, then yeah
But it should be required anyway
async def bookmark(self, ctx: commands.Context, jump_url: str = None, *args) -> None:
fine ?
What does the command do if no jump URL is given?
Hmm, the jump url will never be None in that case
it checks for the message above the .bm
Like if you do !bm hello no link provided
It does correct it
Ah right
I planeed that
hello will be the jump_url
Then it should be type hinted Optional[str]
So it will never be None
if jump_url is None or jump_url == "*":
channel = ctx.channel
async for x in channel.history(limit=2):
message_id = x.id
try:
message = await channel.fetch_message(message_id)
except discord.NotFound:
await ctx.send(">>> Message not in this"
" channel\nOr\nYou are trying to Pin"
" your own message,\nPlease use the channel"
" where message is.")
return
hyperlink = f"https://discordapp.com/channels/" \
f"{ctx.guild.id}/{channel.id}/{message.id}"
I'm not sure it needs to take * as an argument in that case
What if you do !bm bookmark this message, this is a command with no link
It just takes a url right now
if "discordapp.com/channels" not in jump_url:
await ctx.send("INVALID URL")
await ctx.send("An example of the command can be \n"
"!bm https://discordapp.com/channels"
"/267624335836053506/267631170882240512/"
"554639398130548746"
" Some of the hints here")
return
It's not
In that case yeah it should be just py jump_url: str
Well, it can be
Adding = None to it is redundant
I mean for the hyperlink
It's not redundant
Yeah, which is a supported operation
In that case I'd say do a py @bookmark_error async def bookmark_error_handler(self, ctx, error): await ctx.send('You have to give me a link!')
that's not
hyperlink = f"https://discordapp.com/channels/" \
f"{ctx.guild.id}/{channel.id}/{message.id}"```-->
```py
hyperlink = message.jump_url```too
however
the fact that the command can only be run in #bot-commands or #sir-lancebot-playground
kind of makes that feature useless
yeah i also said that
It was discussed by the staff apparently
Well, it has been
It was discussed internally, the main concern is that it can be spammy in regular help channels interrupting conversations
In general it should be avoided
Couldn't it just immediately remove the command message?
^
yeah
And then only reply in DM
thats what i said
I mean, they may have discussed that, but that's what I'd do, haha
I don't think they discussed about that cuz the handler of that issue scragly went offline as soon as i commented that , and never came back , i don't think someone actually opened the issue and proceed to read even though they can see scragly reported it
Yes, we did
ELA is sneaky, he set his status to idle so he can burst in the conversation at any moment haha
just remember that passed linting doesn't mean there won't be more reviewing :>
..Add files via upload?
Your commit messages aren't really great
what kind of commit message is that
frankly, those commit messages aren't good enough.
So just use them as the main message, not the descriptions
โ
Did you deleted the old commits?
there are only 3 commits total ;-; it don't need anything else
@clever wraith Please read through the following articles.
https://chris.beams.io/posts/git-commit/
https://thoughtbot.com/blog/5-useful-tips-for-a-better-commit-message
http://ablogaboutcode.com/2011/03/23/proper-git-commit-messages-and-an-elegant-git-history
https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
I mean, how does your commit history looks like right now?
Aaaand you are on master
Why you didn't commited from the command line or pycharm?
i am not confident with that yet
You know what? Delete your repo, re-fork it, and then switch to a new branch, and upload your files with a nice commit message
We can help you if you want
I think using the web interface is okay, as long as you write nice commit messages and you don't delete a file just to edit it
I'm sorry, but you need to reset the history of your branch
We can't merge that
No, we can't leave that in the history
I can do it for you if you want
But the commit author will be me then, if you really really can't do it @clever wraith
No no if you have checked the allow edits from maintainers box, it is good
yeah i did
Okay
Now what ?
I'm squashing them
RIP
I mean, time for humans to review it
Oh so i now need 2 people
ofc not you cuz you are not human ofc
you can't approve it right
Tbh, you can expect some changes
In order for a PR to be merged, you need 2 approves and at least one of them has to be from a core dev
lets see
I can't start the bot
discord.ext.commands.errors.ExtensionFailed: Extension 'bot.seasons.evergreen.bookmark' raised an error: ClientException: The alias bookmark is already an existing command or alias.```
I did it
You called the command bookmark and you want to add an alias bookmark
So d.py doesn't like it
Can you correct that quickly from the web edit please
doing
Well, you were supposed to test it again
Just delete the alias bookmark
THE COMMIT MESSAGE!!
its good enough
Not update bookmark.py
And fixed a bug isn't enough
Have you read the links lemon sent you?
You could do something like
Delete alias bookmark
Caused an error because the same alias was used twice```
i don't have time , i have ton of homework to do
Fix error caused by command alias conflict or something
Then do it later
I prefer to test it in my own environment so we can be sure it can work outside of the machine on which the code was written ๐
Ok
So, the commit message?
ahhhhhhhh
I can rollback for you, and you re-commit it with a meaningful message, is it good for you?
Because when you browse though more than a thousand commits, the commit message is important
I think i found another bug lol
I guess that's too late
...
LOL
Please this time make a new branch too
Do not work on master
Bad things could happen
Here is what happen if you do not informative commit messages https://imgs.xkcd.com/comics/git_commit.png
It's probably worth pointing out that development is a team effort, here
It's not about being picky, or having a linter that's too strict
We have a set of standards, and everyone has to follow them - it keeps the code readable, and it makes sure everyone knows exactly what's going on and why changes were made
A PR is often presented in isolation, but it's going to be a smaller piece of a larger project, and it's important that it also meets the standards everyone else adheres to
that said, we're not making updates for pacemaker software here, if you don't have time to read the literature that people are giving you, then your PR can wait
I get that this is your first PR, AG, but I know you're capable of this :>
Also, don't stress out about rushing
If you need to do homework, do homework
Real life takes priority, yeah?
you don't wanna know how much time I lost when I was staff over burning myself out :>
You should ^^
haha, I just mean, don't overdo it
it'll be fine if you need to something else
if you just keep beating your head off a wall, eventually you'll get a headache
what was the command to lint
nvm got it
no linting issue
working fine
looks like
@green oriole
i am uploading bookmark.py now OK ?
And you write a meaningful commit message, not Added file via upload (delete it)
it is the default line
It can be as short as Introduced `!bm` command for personal bookmarking message via message jump url
ok suggest me
It just needs to be descriptive, that's all
You also want to create a branch first
Then commit to that branch instead of master
ok
In case things go wrong / when the master repo on the main repo updates
lets do that first
Yep, it is a nightmare <_< (I did that for my first contrib)
how to push a branch ?
You can type a name for the new branch, then hit enter
Afterward, you can change the branch to push for in the CLI
Actually I don't think you need the extended description, but you written it, and there is never too much!
ok ?
just a bit of pickiness: can you delete the space before the comma ๐
next step add a pr ?
Yep!
this is ok right
The message body is weird, but it is fine
It can still be edited later and doesn't go in the history
---
name: .bookmarks
about: helps to bookmark something useful along hint(s) to find in future.
issue: Issue #323
---
Provide a simple description of what the PR achieves.
## Pull Request Details
Please ensure your PR fulfills the following criteria:
[ โ] Have you joined the PythonDiscord Community?
[ โ] Were your changes made in a Pipenv environment?
[โ ] Does flake8 pass (pipenv run lint)
## Additional information
There is no check whether if the call is in the right channel or not , because seasonalbot do it itself.
๐
DONE
Hmm, I'm writing unit tests for bot.utils.time but somehow it is not being discovered, anyone knows why might be the case?
I created a tests.bot.utils.test_time.py
from unittest import TestCase
class TimeTests(TestCase):
"""Test helper functions in bot.utils.time."""
def test_humanize_delta(self):
...```
It is not being discovered at all
@clever wraith reviewed!
OMG
@green oriole putting an entire pull request in a single commit isn't really that much better, but at least the commit message is marginally better.
I kinda feel like you should read those links I posted earlier, too.
I mean, he don't know how to use the command line, at least it is a meaningful commit message
I know, split commits in case you need to revert them
@gusty sonnet Interesting and odd. I'll check it out later. Did you push that branch to the remote?
I thought that was because he deleted his old PR and branch
I created the branch, didnt push my commits yet since I cant even discover all the tests on my vscode
This is everything it managed to find
Does VSCode use a different test runner?
I'm discovering via unittest in it, not sure if it's different
I guess I can try via CLI
@green oriole so you're not gonna read those articles? they really might be helpful. you've made several cardinal sins here in this commit message:
I mean, the current tests we have a definitely discovered by unittest when we run them, so if it's not recognizing other tests as well, it may be something local
I mean, I didn't wrote the message
and I thing i might have already read them
@green oriole now how to edit the .py file that i submitted ?
I thought you were helping @clever wraith solve the problem, my mistake.
Interesting, I see the new stuff in settings.json now, I will fiddle with it
enough to fix all the issues tho
some silly things
Can it be with it doesn't detect it?
@clever wraith you should better do it from command line now, since all changes need to be tested
from which directory did you run the command, Akarys?
you should do it from the main directory of the repository
Done fixed all the grammatical issues . also simplified the code a bit .
Okay, so VSCode cannot discover the tests, the unittest command can
Guess I have to rely on it then
Is there something we can change to make it work?
I hope now it passes @green oriole take a look
Not at my computer right now, I will check it later ^^
I will have to look deeper into vscode, since unittest in cmd works just fine
self.assertIsInstance(error, ValueError)
self.assertEqual(str(error), 'max_units must be positive')
```is there a nicer way to do this lol
Thank you
with self.assertRaises(ValueError) as error:
time.humanize_delta(relativedelta(days=2, hours=2), 'hours', max_units)
self.assertEqual(str(error), 'max_units must be positive')
```like this, yes?
Should I include tests for the new functions in bot.utils.time? I should wait for the PR to be approved right?
Or should I just open a PR for the current functions, and open another later?
the current util functions have tests?
in that case, yes.
otherwise, well, it's your call.
ideally tests should be part of the same PR as the features.
Hmm, that's actually a better idea
I'll open a PR for the current functions then
Thanks lemon
np
with a lot of if statements
Add a delta of one second ๐
From my testing for the reminder cog, it is reliable
@crude gyro what is K&R ?
I explained it in one of the other comments.
it's an indentation style where the braces are like this:
things = (
"stuff"
)
why its called K&R
Brian Kernighan and Dennis Ritchie
?
yeah, kernighan and ritchie
basically they wrote this https://en.wikipedia.org/wiki/The_C_Programming_Language
If you have some time left over: https://www.youtube.com/watch?v=zmYhR8cUX90
Hear Brian Kernighan on how he got into programming, the successors of C and the biggest challenges... Watch Part 2 before it's live!: https://youtu.be/VVpRj...
Those guys are legends, I haven't written a single line of C and I've heard of them
lemon will squeeze me now see.
In this world, it's squeeze or be squeezed.
Yes, but if you squeeze lemon you end up with a lemonade, and I'm not sure this is what you want
Requesting reviews on https://github.com/python-discord/bot/pull/680 - if this is approved, then I can put in the test for #679 too
what is the purpose of def setUp(self): pass?
Mostly to setup variables for the class, right now it is not doing anything, I can remove it
In fact, yeah, I will remove it
@clever wraith before I go, I resolved all conversation that you addressed, but there is still the ones that left. Just two small thing, can you please not comment "Agreed" on all comments and can you also press the apply suggestion button when avaliable, so it dismiss the comment, make sure you have commuted the good changes and gave credits to the reviewer please
yeah i really didnt knew that agree were gonna look like that mess
i thought it will bundle up everything
Why he is doing this? https://github.com/python-discord/site/pull/315
This is a bot that we're using; it notifies us of updates in dependencies that fix security vulnerabilities and creates an automated PR for that
I know, but there isn't a security report or something linked everytime?
Yeah, but I don't think we're severly affected. Still, there's not reason for us not to update soon, but we'll need to test it. The reason we're not that affected is that the privilege escalation is restricted to users who are already logged into the admin interface, meaning that the user should already have admin access. I'm also don't think we're affected, as I don't think we implement the functionality that triggers this specific thing. Still, better safe than sorry, so obviously we're going update.
@crude gyro just to be clear all you wanted me to change
from
embed.set_thumbnail(url="https://emojipedia-us.s3."
"dualstack.us-west-1.amazonaws.com"
"/thumbs/240/twitter/"
"233/incoming-envelope_1f4e8.png")
to
embed.set_thumbnail(url="https://emojipedia-us.s3."
"dualstack.us-west-1.amazonaws.com"
"/thumbs/240/twitter/"
"233/incoming-envelope_1f4e8.png"
)
thats it ?
this comment
No you need to a line break after the first parenthesis
pycharm not giving any errors , should be fine
Anyway, why PyCharm is coloring the text in gray?
cuz thats a hyperlink
there is also a underline there
I am resolving this comment
whatever
Refresh the page, I thought it will leave a comment of the review
I see you two are having fun again
Yep.
Anything I can help with?
I think we can redo the 100 comment PR haha
Could just squash it
Not sure, maybe you just can review it?
Solid advice, that
If you use parens you don't need to escape the newline with a backslash
what is parenthesis . ;-;
(
"text"
"more text"
)
You probably called it a bracket
Anyway, doesn't matter, you still gotta address the review
Yes, and add parens
Put parenthesis around it
Are you reading what we type?
Like, I left three example about it in the review
Should be pretty self explanatory
Yeah, you'll need to line up that second line
K&R lemon said :)
isn't that K&R
It is
I'm not sure it needs the newlines in the actual message text, but sure
See my latest comment, use an embed instead
I'd probably indent the strings too
The closing parenthesis needs to be at the same level of await
Or, yeah
not gonna make a embed for this little thing
Error messages are all embeds, you should use one
I should say, you seem to be responding that way to a lot of reviews
Don't forget to put your rationale in the comments
removing that actually
as @green oriole suggested
it never get triggered anyways
lemon also said that
And it also doesn't make sense based on the command only working in a commands channel
Well, if you can provide a message ID, that's not a problem
I mean, just use the d.py message converter and you can use the command in a different channel from where I was sent plus you can use a message ID
Yeah that's a windows problem
If you use the converter you can
You can provide the channelid
so you mean doing .bm message_id channel_id *hints
it just create a messy command , breaking the simplicty
Yes, but it makes it useful
.bm link *hints does all that
Or allow the user to pass the channel then
Anyway, using the converter is better, it avoid to repeat the code of the library, plus if the API changes, we don't need to make the changes ourselves and let d.py handle it
as far i know people uses copy id . they can do copy link and everything will be fine
also if people self host the bot it will make issues , cuz we are not defining server.id anywhere in .bm message_id channel_id *hints
You can get it from the config
you mean those environmental variables ?
why is this making a issue ?
it work regardless
of the error
It is a warning not an error
Imagine that it doesn't find the message, what is going to happen?
yeah thats why there was that
but thats not happening
right ?
you said that in the comment
That could happen if you provide a fake link
u sure link
But anyway, let the converter search for the message
but that if only triggers if the jump_url is none or *
so its not getting any kind of link anyways
So why are you looping over it?
it skips the .bm message , and take one over it
Pretty sure there is a better way to do it
Plus, what why do you take only the id to re-fetch the message later?
yeah
only the message id , cuz ofcourse channel id will be same as ctx.channel.id
same with guild.id
You can just do message = x inside your loop
i only need id , i never needed the message itself
Or use the message directly with the loop doing nothing else if you're just assigning directly
So just directly use the jump_url of the message inside the loop
Change it to
async for message in channel.history(limit=2):
jump_url = message.jump_url```
no
whats message.jump_url
what the fuck no. if you're not gonna listen to the reviewers when they make suggestions, just save yourself the trouble and close the PR right away.
it's never gonna get merged if you're not willing to work with us.
his saying not work with my code , like he thinks
we are just looping around.
for 30 mins straight
No, the converter is handled by the typehint https://github.com/python-discord/seasonalbot/pull/327#discussion_r353792944
The converter will work on messages in other channels as long as it is in the bot's cache
The raw command words like that
F i forgot to change color of embed
(The converter first tries to get the message out of the cache based on the message ID, regardless of channel)
It won't work if the message is not longer in the cache, which is pretty soon, since we have a large message volume
It calls the api if it is not in the cache right?
Yes, but that needs the correct channel id
will add that next commit
Now, I'm not up to date on the review comments, so that's what you should go by for the feature
Just clarifying a few things said above
Your cog docstring is still not very descriptive
lint force me to not go any further
You can make longer docstrings for something if it needs clarification (I haven't seen the docstring in question); it's just that the first line needs to be a summary line.
It is the docstring of the cogs
def something():
"""
Do something and return nothing.
This function is absolutely useless. It does something, I don't know what and
returns nothing, that is, `None`. However, I'm just faking a longer, multi-line
docstring as an example, so it's still useful in its own way.
"""
do_something()
if you want i can write a 2 paragraph on this
It doesn't describe how the cog works at all
Okay, so, what's important for our docstrings is that it's going to be used for two things:
- Developers trying to read the code
- The help menu (I'm not entirely sure about Seasonalbot's help)
Plus A cog for bookmarking message doesn't seems to help a lot
Now, you don't have to put a description of the entire API in the class docstring, since you have individual methods with docstrings for that.
that doesn't do that also
I mean, this cog isn't used by the average user
A summary line and a quick description of what it does and why is still a good thing
I think that Uptime docstring is pretty clear, it summarizes exactly what the cog is for
Just checked, it doesn't affect the help page
For further information on the exact API of the cog, you can read the docstrings of the individual commands
But the docstring of the command does
can you suggest me some cog description
The docstring of your command is Bookmark a message which isn't very useful too
Don't have time, I'm going to got and look for food haha
Not sure mine is better than yours
I don't know, Use this cog to bookmark the message to get a link to that message in dm
I don't have the other docstring I don't know how to write it exactly
And do not use this docstring, that's just an example, it is pretty poorly written
let me try the one ```py
async for message in channel.history(limit=2):
jump_url = message.jump_url
it surprisingly worked
I wouldn't have gave you if it didn't worked :p
Also Fixed some things isn't a good commit message
You should do one commit per fix, and write comprehensive commits
last commit , its done then
fixed no . after No hint provided
used that way of yours
fixed color scheming of embed
Have you used the converter and used embeds for error messages?
using Colours.soft_green
there is no error message except the usage one
that doesn't require a embed
from bot.constants import Colours right
why its not Colors ?
Because it has been written by someone from the UK
?
colour change
either i am now f uped cuz @hardy gorge is writing for so long , its freaking me out 
can someone give me perfect cog string pleaseeeee
i changed it , no one liked it
@clever wraith
[11:53 AM] AG: CMON
[11:54 AM] AG: just give me a cog string
These things are important to us. It may feel like overly bureaucratic to you as, in your mind, it's just quickly hacking a feature together, but we have other concerns. The features we have need to be maintained and the code needs to be reliable. Our bots are important tools in our community and we rely heavily on them; we simply can't have them break on us. (When they do, it's always a major crisis and people literally drop their regular work to fix it.)
That means that we set fairly high standards that help us make sure that maintaining features doesn't become a pain (because of bad readability) and features don't break the bot (because of badly tested code). That's why we have such a strict review process. In addition, each feature we add to the bot increases the amount of effort needed to maintain the bot. That's why we feel it's important to seriously consider features in conversations in Issues even if the change seems small and especially if the change comes from a non-core developer. In addition, each feature the bot has, has an effect of the community: More bot commands in channels, even if they're deleted, means more (temporary) bot responses, more noise, and more disruption. That's why we keep it to the essentials and that's why we discuss everything, either in the issue or internally in the core developer group.

Just wanna say, nice punctuations skills.
I want to bookmark this
Well, that's a season specific cog
But it shouldn't be that way
Are you going to change it, yes or no?
No
Did you listened what gdude and ves said?
First line is a short description, then a blank line, then the extended description
If we ignore the docstring itself for a minute, what would you like to include in it?
Actually writing down a docstring can be quite difficult; it needs to be short and readable, but at the same time still capture the essence of the cog.
What do you think should be in it so someone unfamiliar with your function knows what this class is about when reading the code?
Remember: very specific details of individual commands are already captured by the docstrings of those methods, so you don't have to include those in the class docstring
Okay, so, it's a cog that creates personal bookmarks. How does it do that?
looks fine
you said you wanted it to include how it works
so i did that
if no jump_url is given it fetch the id of
last message in ctx channel and sending it to user's DM . ```
how you would like to see it ?
Okay, the first two things are more or less details, but the very last part seems important: A "bookmark" is a bit of a vague term as it can mean anything. It's also important to note that these are personal bookmarks, not public bookmarks for everyone
yeah
So, what I'd do (although I usually think a bit longer about the exact wording) is write a docstring that captures that essence. Something like this:
class Name:
"""A cog that creates personal bookmarks by relaying a message to the user's DMs."""
Now, this is not yet perfect, normally I think this over for quite some time if it's a difficult case, but it captures the essentials: We want to establish the term bookmarks, we want to convey that they're personal, and we highlight that it works by relaying messages to DMs.
I think that is fine
The details of how the interface works (jump links, message id) can be described in the actual bookmark command method
TBH the command itself is a very basic, it don't need any sort of explaination
I am pushing it
that's it
You.. Need a docstring for the cog
I know
finally done
added all the changes requested by @crude gyro and @green oriole i can now go and take some rest i think
You still don't use the converter, I suggested two changes and lemon asked you to delete the embed footer
he never asked to delete the footer
its cool
i used the convertor
that you gave
applied suggestion of that description ^^
He did asked to remove it (https://github.com/python-discord/seasonalbot/pull/327/files#r353825376)
I left other comments
But of course you can take a break if you want
i wanna complete it
Taking a break is also important to still be productive
What is Error:-?
no title then
How does other cogs implement it?
doesn't work
You can just set the embed's description.
Just use the random message, and the error message
Embed title/header, embed description
Perfect
Well, I'd put the spaces at the end of the strings, not the start of the next one
done both error , embeds on baby
Also, "this" needs a capital T
Yup
Space before the : ?
Well, the error is that the message can't be found, right?
Yep
So why do we have command syntax here?
Oh yeah
I'd have thought just a simple That message could not be found, please try another. would suffice
But a syntax error could lead to that error
If we need to display the syntax then perhaps we should show the actual command help
But I don't think so
You could be more verbose
Yeah not sure that's a good idea
Like, for example, Message URL invalid: Unable to find message
Okay, but there's no reason you couldn't have handling for that too
That one should really just be the actual help message
You have *args at the end of your function arguments?
That's not necessarily the right way to do that
Oh, it is? Okay