Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add a move command #9

Open
JulianusIV opened this issue May 5, 2023 · 4 comments
Open

Feature Request: Add a move command #9

JulianusIV opened this issue May 5, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@JulianusIV
Copy link
Contributor

Describe the new functionality
Add a command to move a cookie (by means of a message link perhaps?) to a new channel, incase there is a server architecture redesign, and you dont want to loose any cookies

@JulianusIV JulianusIV added enhancement New feature or request help wanted Extra attention is needed labels May 5, 2023
@OoLunar
Copy link
Owner

OoLunar commented May 5, 2023

Assuming you meant something like /cookie move [button message] [new channel], I think there's a more intuitive way to go about it. Instead we could make use of message commands. Assuming the following scenario:

  • User: Right clicks on a message
  • Bot: Checks if it's a cookie. It is!
  • User: Is presented with a modal containing a list of channels to select from. They choose #cookie-channel.
  • Bot: Deletes the original message and posts a new message, retaining both previous formatting, text, and values into #cookie-channel. No information is lost and the cookie count remains the same as it was before.

Of course we would have to find a way to do error handling, which could be through either DM's or ephemeral messages. Lastly the Move Cookie message command is locked behind the MANAGE_MESSAGES permission, just as the /cookie create command is.

Does everything look correct?

@JulianusIV
Copy link
Contributor Author

Assuming you meant something like /cookie move [button message] [new channel], I think there's a more intuitive way to go about it. Instead we could make use of message commands. Assuming the following scenario:

* User: Right clicks on a message

* Bot: Checks if it's a cookie. It is!

* User: Is presented with a modal containing a list of channels to select from. They choose `#cookie-channel`.

* Bot: Deletes the original message and posts a new message, retaining both previous formatting, text, and values into `#cookie-channel`. No information is lost and the cookie count remains the same as it was before.

Of course we would have to find a way to do error handling, which could be through either DM's or ephemeral messages. Lastly the Move Cookie message command is locked behind the MANAGE_MESSAGES permission, just as the /cookie create command is.

Does everything look correct?

looks fine to me, as for error handling, a ephemeral probably makes the most sense here, considering thats just possible by responding to the interaction immediately, either ephemeral in an error case, or public in a success case

@OoLunar
Copy link
Owner

OoLunar commented May 5, 2023

Discord unfortunately does not have selects in modals yet. It is a planned feature that has been released off and on again, however it is not available to the general public (yet). As such, we'll instead choose to stick with ephemeral messages all the way for both error handling and user input.

@OoLunar
Copy link
Owner

OoLunar commented May 6, 2023

After further discussion on the Discord server, we've come to the conclusion that we should use a slash command with autocomplete.

{
  "type": 4,
  "data": {
    "id": "816437322781949972",
    "name": "move cookie",
    "type": 1,
    "version": "847194950382780532",
    "options": [
      {
        "type": 3,
        "name": "Clicks: 111799",
        "value": "0187e88d-f93f-5fc1-68e0-65b85f62c76d",
        "focused": true
      }
    ]
  }
}

The user would see the choice as "Clicks: 111799", while the bot would receive the button id.


We're choosing autocomplete over the message command due to the restrictions that interactions enforce. As it is now, the bot is added as an integration without the bot scope. Due to the lack of the bot scope, we cannot interact with anything outside of the interaction. This would include posting messages in a different channel, which is why message commands are no longer an option.

We want to refrain from adding the bot scope to our bot due to the complications it brings. Yes it allows our bot to have a lot more functionality, however it also introduces many safety checks that the server must verify and brings more work for the maintainers. Ultimately we believe the bot can be fully functional without the bot scope.

@OoLunar OoLunar self-assigned this May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants