コード例 #1
0
ファイル: Hardware.cs プロジェクト: mrousavy/Cirilla
        public async Task SetHardware([Summary("The hardware title")][Remainder]
                                      string title)
        {
            if (string.IsNullOrWhiteSpace(title))
            {
                await ReplyAsync(
                    $"Please enter a valid hardware title! Usage: `{Information.Prefix}sethw <HardwareProfileName>`");

                return;
            }

            var listener = new HardwareListener(Context.Channel as ITextChannel, Context.User);

            Cirilla.Client.MessageReceived += listener.HardwareReceived;
            HardwareManager.UpdateHardware(Context.Guild, Context.User.Id, title, null);

            ConsoleHelper.Log($"{Context.User} is creating a new hardware profile (\"{title}\")",
                              LogSeverity.Info);

            await ReplyAsync(
                $"What text do you want to display on the hardware profile _{title}_? (Hint: Use `Shift` + `Enter` for new lines)");
        }