General Troubleshooting
Feature Request
Hello,
The MessageCreateAction interface does not provide a method to retrieve the MessageChannel used in the action. Likewise, there is no getter to access stickers or the MessageReference.
Perhaps this is intentional and actions are not meant to expose getters, but MessageCreateAction extends MessageCreateRequest, which does provide getters for attachments, mentions, embeds, components, etc.
It would be really useful to have a method to retrieve the channel, because in my case I’m working with a list of MessageCreateAction instances where I apply setMessageReference() on each one. The issue is that the actions don’t all use the same channel, and setMessageReference() requires the message history permission, which I cannot verify without access to the channel.
At the moment, the simplest workaround for me is to handle a wrapper object that stores both the action reference and the associated channel.
Example Use-Case
MessageCreateAction action = ...;
MessageChannel messageChannel = action.getChannel();
if (messageChannel instanceof GuildMessageChannel guildMessageChannel) {
if (!selfMember.hasPermission(guildMessageChannel, Permission.MESSAGE_HISTORY)) {
return;
}
}
action.setMessageReference(messageId);
General Troubleshooting
Feature Request
Hello,
The
MessageCreateActioninterface does not provide a method to retrieve theMessageChannelused in the action. Likewise, there is no getter to access stickers or theMessageReference.Perhaps this is intentional and actions are not meant to expose getters, but
MessageCreateActionextendsMessageCreateRequest, which does provide getters for attachments, mentions, embeds, components, etc.It would be really useful to have a method to retrieve the channel, because in my case I’m working with a list of
MessageCreateActioninstances where I applysetMessageReference()on each one. The issue is that the actions don’t all use the same channel, andsetMessageReference()requires the message history permission, which I cannot verify without access to the channel.At the moment, the simplest workaround for me is to handle a wrapper object that stores both the action reference and the associated channel.
Example Use-Case