feat: Add method to send paginator to channel outside context of user interaction
Summary
Adds a method to the Paginator that allows sending a paginator to a specified channel, outside the context of a user interaction. This is useful for automation, in which the paginator wasn't explicitly invoked by some user action and thus a user context wouldn't be available.
Information
- [ ] This PR fixes an issue.
- [x] 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, typehinting, examples, ...).
Checklist
- [x] I have searched the open pull requests for duplicates.
- [x] If code changes were made then they have been tested.
- [ ] I have updated the documentation to reflect the changes.
- [ ] If
type: ignorecomments were used, a comment is also left explaining why. - [x] I have updated the changelog to include these changes.
I feel like a better solution is just adding a kwarg called author with type Union[discord.Member, discord.User] to .sendand making ctx optional as its only use is setting the user attribute to ctx.author (and sending but ctx = target when target is provided).
.channel_send sounds vague too, considering that .send already has a target kwarg that takes an abc.Messageable.
Making ctxoptional would be breaking. Instead, a new author (or whatever you wanna call it) kwarg could be added as Soheab suggests, and target could be deprecated. ctx would become Context | Messageable. And in a future breaking release, ctx could be renamed to target (maybe a todo should be added for that). This is my pov on this. Having two different methods, channel_send and sendwould not immediately make sense and might confuse some people too.
Making
ctxoptional would be breaking. Instead, a newauthor(or whatever you wanna call it) kwarg could be added as Soheab suggests, andtargetcould be deprecated.ctxwould becomeContext | Messageable. And in a future breaking release, ctx could be renamed totarget(maybe a todo should be added for that). This is my pov on this. Having two different methods,channel_sendandsendwould not immediately make sense and might confuse some people too.
Mind explaining how making ctx optional would be a breaking change here? I can see how changing a function's signature is considered breaking, but I don't see how this could break for a user, since they pass ctx now anyway. Not passing it errors now and will still error if the proposed author kwarg isn't passed (unless that's made optional as well; then it could just ignore or error if target isn't passed).
Also, see this message in the server.
Saw your message, right mb it's not breaking. The only thing I'd see that would seem weird to me is that if you pass positional params, it will assume it is sending to a Context, so it would require to always specify target as a kwarg. But other than that very similar to what I was thinking.
@Pycord-Development/contributors can we get some testing here :D
I'm gonna go ahead and close this since I agree that it probably shouldn't be implemented this way, and I don't really have the time to work on this.