-
Notifications
You must be signed in to change notification settings - Fork 0
Cli command mapping to discord #28
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
base: main
Are you sure you want to change the base?
Conversation
src/Services/INomadRepoService.cs
Outdated
| { | ||
| public interface INomadRepoService | ||
| { | ||
| public Task<(RepositoryContainer, WacsdkCommandConfig, WacsdkNomadSettings)> GetNomadRepoAsync(string repoId, string knownId, CancellationToken token); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to remove WacsdkCommandConfig from this interface. It's a high-level object that encodes runtime options, not specific to any one repo or operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also don't need the knownId to get the repo itself. Known IDs are used within a repo to locate registered data, it's not used to get the repo itself.
| { | ||
| public class UserCommandGroup(INomadRepoService nomadRepoService, IInteractionContext interactionContext, IFeedbackService feedbackService, IDiscordRestInteractionAPI interactionAPI, IDiscordRestChannelAPI channelApi, IDiscordRestGuildAPI guildApi, ICommandContext context) : Remora.Commands.Groups.CommandGroup | ||
| { | ||
| [Command("createUser")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Command groups should follow this structure, as shown to the end user:
/<entityType> <memberName> <operation> <params/values>
This should be on all three root entity types, not just this User file.
| var initialMessage = await channelApi.CreateMessageAsync(channelId, $"Getting project {projectId}"); | ||
|
|
||
| var project = await repositoryContainer.ProjectRepository.GetAsync(projectId, Config.CancellationToken); | ||
| var responseBuilder = new StringBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use Embeds instead of StringBuilder, see https://github.com/WindowsAppCommunity/WindowsAppCommunity.Discord.ServerCompanion/pull/29/files#diff-be8b811a78c6f6c3eae395e49c3573e6dc2bd287d5e2e53db1f8e0c3a41a9535R201
Implements discord compatible commands inspired from CommandLine for the following entities:
The commands include mainly Get/List/Create operation for the entities above