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

Add Discord Plugin that uses Interaction API #168

Merged
merged 82 commits into from
Dec 15, 2021

Conversation

gigxz
Copy link
Collaborator

@gigxz gigxz commented Dec 9, 2021

Create a Discord Plugin

  • One Plugin instance is connected to one Guild. The community_platform_id is the guild ID.
  • Supports OAuth install and OAuth user login.
    • User IDs in discord are unique across discord, so its possible that User 1234 belongs to multiple Discord guilds, several of which could have the Metagov bot installed. Unlike Slack, when a user logs in with Discord Oauth they just log in as themselves, the don't select a guild to "log in with." That means during user login, there could be multiple Discord Plugin instances that the user "belongs" to. We return the guild IDs of all metagov-enabled guilds back to the Driver after oauth. In the PolicyKit case, if there are multiple PolciyKit-enabled guilds, it displays a guild selection screen before logging in to PolicyKit.
  • Supported actions
    • register-guild-command to create a slash command (aka CHAT_INPUT Application Command) in the guild. Later on, we might want to support global commands.
    • method to invoke any discord API method
    • post-message to post a message in a channel
    • get-guild to get guild info
  • "listens" for Slash command input from users, and passes it along to the driver.
  • vote process supports boolean and choice voting, with eligible voter restrictions. Voting occurs through interactive message components. Most of this code is copy-pasted from the Slack plugin, so there is room to DRY this code up later.

@gigxz gigxz merged commit 2c0496d into master Dec 15, 2021
@gigxz gigxz deleted the discord_plugin_using_interaction_api branch December 15, 2021 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants