Пример #1
0
        public async Task <RuntimeResult> RandomKeys(int rotorCount = 3)
        {
            if (rotorCount < 1)
            {
                return(EmoteResults.FromInvalidArgument());
            }
            await enigma.RandomKeysAsync(Context, rotorCount).ConfigureAwait(false);

            return(NormalResult.FromSuccess());
        }
Пример #2
0
        public async Task <RuntimeResult> EncipherKeys([Remainder] string text)
        {
            try {
                await enigma.EncipherAsync(Context, text, true).ConfigureAwait(false);

                return(NormalResult.FromSuccess());
            } catch (Exception ex) {
                await ReplyAsync($"**Error:** {ex.Message}").ConfigureAwait(false);

                return(EmoteResults.FromInvalidArgument());
            }
        }
Пример #3
0
        public async Task <RuntimeResult> Decipher([Remainder] string text = null)
        {
            try {
                if (text == null && !Context.Message.Attachments.Any())
                {
                    return(EmoteResults.FromInvalidArgument());
                }
                await enigma.DecipherAsync(Context, text, false).ConfigureAwait(false);

                return(NormalResult.FromSuccess());
            } catch (Exception ex) {
                await ReplyAsync($"**Error:** {ex.Message}").ConfigureAwait(false);

                return(EmoteResults.FromInvalidArgument());
            }
        }