Skip to content

Conversation

@sairam4123
Copy link

Summary

Rename Author to CurrentAuthor and while keeping Author referenced to CurrentAuthor.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

khazhyk and others added 3 commits September 5, 2020 20:50
Modeled slightly after Converters, allow specifying Converter-like class
for context-based default parameters. e.g.

```py
class Author(CustomDefault):
  async def default(self, ctx):
    return ctx.author

async def my_command(ctx, user: discord.Member=Author):
  ...
```

Also adds a few common cases (Author, Channel, Guild) for current
author, ...
With this change CustomDefaults display nicer in help commands and
in command.signature
Rename Author to CurrentAuthor and while keeping Author referenced to CurrentAuthor.
async def default(self, ctx, param):
return ctx.author

Author = CurrentAuthor
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this isn't merged into the lib yet, probably best not to introduce extra aliases. Anyone depending on this code in it's pre-submitted form should be prepared for it to break (e.g., I'll update my bot in case we do want this rename)

Moved discussion about the actual rename to Rapptz#1849 (comment)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I can't actually talk in there.

@khazhyk khazhyk force-pushed the rfc-param-default branch 2 times, most recently from 9677dcb to 40c234c Compare April 19, 2021 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants