-
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
{ | ||
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.
// Cancellation | ||
var cancellationTokenSource = new CancellationTokenSource(); | ||
var cancellationToken = cancellationTokenSource.Token; | ||
Console.CancelKeyPress += (sender, eventArgs) => |
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.
This code is already present above.
|
||
public class WacsdkCommandConfig | ||
{ | ||
public CancellationToken CancellationToken { get; set; } |
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 remove this-- cancellation was passed through here for cancelling via Console.CancelKeyPress
{ | ||
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:
waccli <entityType> <memberName> <operation> <params/values>
This should be on all three root entity types, not just this User file.
Implements discord compatible commands inspired from CommandLine for the following entities:
The commands include mainly Get/List/Create operation for the entities above