interactions.py
interactions.py copied to clipboard
feat: Add `__str__` to `Application`
About
This pull request is about (X), which does (Y).
Checklist
- [x] I've ran
pre-committo format and lint the change(s) made. - [x] I've checked to make sure the change(s) work on
3.8.6and higher. - [ ] This fixes/solves an Issue (If existent):.
- resolves #
- I've made this pull request for/as: (check all that apply)
- [ ] Documentation
- [ ] Breaking change
- [x] New feature/enhancement
- [ ] Bugfix
Please make sure to track the unstable branch, currently it is the stable one.
This pull request is about (X), which does (Y).
Also please explain why you want this change since I don't know anything about the intentions of this PR/why the change should be implemented/...
Also, as already mentioned, please target the
unstablebranch for your pr
When printing client.me, a user is left with an unfriendly Application instance, this would mean that it prints the username.
A better way to give more information about it would be to add a __repr__ to the class, or to the user field. Using __str__ to give information when printing data usually isn't the best way to do it
A better way to give more information about it would be to add a
__repr__to the class, or to the user field. Using__str__to give information when printing data usually isn't the best way to do it
attr_utils.field has a repr param, if you set that to True it'll show up when you print it out. When I add id and name to the repr, it prints (in my case) as Application(id=Snowflake(835925027337273354), name='CataBot 2.0'), which is more descriptive without tricking the user into thinking it's a string
Closing in favour of #1026