Пример #1
0
        /// <summary>
        /// Determines whether the application's commands support being bound to Discord slash commands.
        /// </summary>
        /// <returns>true if slash commands are supported; otherwise, false.</returns>
        public Result SupportsSlashCommands()
        {
            // TODO: Improve
            // Yes, this is inefficient. Generally, this method is only expected to be called once on startup.
            var couldCreate = _commandTree.CreateApplicationCommands();

            return(couldCreate.IsSuccess
                ? Result.FromSuccess()
                : Result.FromError(couldCreate));
        }
Пример #2
0
 /// <summary>
 /// Determines whether the application's commands support being bound to Discord slash commands.
 /// </summary>
 /// <returns>true if slash commands are supported; otherwise, false.</returns>
 public bool SupportsSlashCommands()
 {
     // TODO: Improve
     // Yes, this is inefficient. Generally, this method is only expected to be called once on startup.
     return _commandTree.CreateApplicationCommands(out _).IsSuccess;
 }