"Components" parameter for ".send" method
Summary
Add a components parameter for the send method
What is the feature request for?
The core library
The Problem
While discord.ui.View is pythonic, it often isn't the most convienient to use. That is why, as a backup / extra feature, add a components parameter to the send method. This will make sending components a bit more easy and convienient.
The Ideal Solution
Simply, add a "components" parameter to ".send" method
The Current Solution
No response
Additional Context
No response
The reason this was not the api for sending message components in the first place is because the view makes it easier for the developer. I don't find that it isn't convenient to use as well, adding a components kw/arg would serve to confuse, it is better to simply have 1 concrete way of doing something. Also this doesn't look very "convenient" to use
await something.send('Hello, world!', components=[
ActionRow(
Button(...)
)
])
The discord.ui.button decorator makes it very easy to add buttons to a view. (For selects you should probably subclass because it looks ugly otherwise).
In my opinion, the view api is simpler to as you don't have to worry about the boring code that happens behind the scenes.
(Also if you really want to have a components arg you could check out this)
https://github.com/Pycord-Development/pycord/blob/8aa1e90d83bbb9ce482e4a83843ad2a337fc0741/discord/http.py#L413-L457
On top of that, the interaction response is handled in the view.
Make a factory for yourself, that's what I'm doing.
The reason this was not the api for sending message components in the first place is because the view makes it easier for the developer. I don't find that it isn't convenient to use as well, adding a components kw/arg would serve to confuse, it is better to simply have 1 concrete way of doing something. Also this doesn't look very "convenient" to use
await something.send('Hello, world!', components=[ ActionRow( Button(...) ) ])The
discord.ui.buttondecorator makes it very easy to add buttons to a view. (For selects you should probably subclass because it looks ugly otherwise).In my opinion, the view api is simpler to as you don't have to worry about the boring code that happens behind the scenes.
(Also if you really want to have a components arg you could check out this)
https://github.com/Pycord-Development/pycord/blob/8aa1e90d83bbb9ce482e4a83843ad2a337fc0741/discord/http.py#L413-L457
I agree with this and will close this issue.