becca-lyria icon indicating copy to clipboard operation
becca-lyria copied to clipboard

[FEAT] - Add `post` commands

Open naomi-lgbt opened this issue 3 years ago • 9 comments

What feature would you like to see?

We want to add a couple of commands that allow server managers to create a post (such as a rules post) through Becca.

The purpose of this is to allow server managers to edit that post, rather than having a user post it and have the user be the only one who can edit it.

We'll need a /post create command, which takes a channel parameter and the message to post, and a /post edit command which takes the message link to edit and the new content.

This is unfortunately blocked, until Discord completes the slate2 update and allows multi-line inputs in slash commands.

Additional information

No response

naomi-lgbt avatar Jan 10 '22 01:01 naomi-lgbt

I am unblocking this to take a new approach - rather than waiting for multi-line inputs, these commands should respond with a modal to take the content of the message.

The /post create command should generate a new message in the provided channel, using the modal response as the content.

The /post edit command should take a message link argument, confirm that link resolves to a message authored by Becca, then update the message content with the modal response.

Permission Validation: The permission validation should confirm that the user has the Manage Guild permission.


This is quite large in scope, as Becca doesn't have an event listener for modals yet - I'm going to open it up for contribution, but feel free to ask questions here or in our Discord server if you get stuck!

naomi-lgbt avatar Aug 09 '22 04:08 naomi-lgbt

I'd like to work on this(haven't worked with a modal yet so this would be kinda fun)

Vyvy-vi avatar Oct 03 '22 13:10 Vyvy-vi

All yours!

naomi-lgbt avatar Oct 03 '22 14:10 naomi-lgbt

For permission validation, would the use of the .setDefaultMemberPermissions() method in the SlashCommandBuilder constructor be less preferred to doing a permission check while executing the command and returning an appropriate response from the becca?

Vyvy-vi avatar Oct 07 '22 05:10 Vyvy-vi

We should definitely not set permissions on the command. These can be changed by a server, so we want to validate in the command execution.

naomi-lgbt avatar Oct 07 '22 05:10 naomi-lgbt

I'm having some issues working on the /edit command. Should the bot store a link to the message that needs editing inside the modal it sends to the user for the updated content input?

Vyvy-vi avatar Oct 08 '22 14:10 Vyvy-vi

Or is there a way to listen for the modal response inside the same control flow as the /post edit command handler?

Vyvy-vi avatar Oct 08 '22 14:10 Vyvy-vi

Or maybe it can be stored in the customId for that modal? Like: edit-content-<MESSAGE-ID>

Vyvy-vi avatar Oct 08 '22 14:10 Vyvy-vi

Yeah - we could shorten the customId to something like pe-12234567687

naomi-lgbt avatar Oct 08 '22 20:10 naomi-lgbt