コード例 #1
0
        private async Task SetScreen(bool on, string ip)
        {
            var bot = GetBot(ip);

            if (bot == null)
            {
                await ReplyAsync($"No bot has that IP address ({ip}).").ConfigureAwait(false);

                return;
            }

            var b = bot.Bot;
            var crlf = b is SwitchRoutineExecutor <PokeBotState> {
                UseCRLF : true
            };
            await b.Connection.SendAsync(SwitchCommand.SetScreen(on ? ScreenState.On : ScreenState.Off, crlf), CancellationToken.None).ConfigureAwait(false);

            await ReplyAsync("Screen state set to: " + (on ? "On" : "Off")).ConfigureAwait(false);
        }
コード例 #2
0
 public void SetScreen(bool on)
 {
     CurrentConnection.SendBytes(SwitchCommand.SetScreen(on));
 }