コード例 #1
0
ファイル: Help.cs プロジェクト: zerratar/RavenBot
        public override Task HandleAsync(IBotServer game, ITwitchCommandClient twitch, ICommand cmd)
        {
            var channel = cmd.Channel;

            twitch.SendChatMessage(channel, "No help available at this time.");
            return(Task.CompletedTask);
        }
コード例 #2
0
ファイル: Help.cs プロジェクト: zerratar/Ravenfall-Bot
        public override Task HandleAsync(ITwitchCommandClient client, ChatCommand cmd)
        {
            var channel = cmd.ChatMessage.Channel;

            client.SendChatMessage(channel, "No help available at this time.");

            return(Task.CompletedTask);
        }
コード例 #3
0
        public override Task HandleAsync(IRavenfallServerConnection game, ITwitchCommandClient twitch, ChatCommand cmd)
        {
            var channel = cmd.ChatMessage.Channel;
            var session = game.GetSession(channel);
            var userId  = cmd.ChatMessage.UserId;

            if (session.Contains(userId))
            {
                session.Leave(userId);
                twitch.SendChatMessage(channel, $"@{cmd.ChatMessage.Username}, leaving game...");
            }
            else
            {
                twitch.SendChatMessage(channel, $"@{cmd.ChatMessage.Username}, you're not currently playing. Use !join to start playing.");
            }

            return(Task.CompletedTask);
        }
コード例 #4
0
ファイル: Join.cs プロジェクト: zerratar/Ravenfall-Server
        public override Task HandleAsync(IRavenfallServerConnection game, ITwitchCommandClient twitch, ChatCommand cmd)
        {
            var channel = cmd.ChatMessage.Channel;
            var session = game.GetSession(channel);
            var userId  = cmd.ChatMessage.UserId;

            if (session.Contains(userId))
            {
                twitch.SendChatMessage(channel, $"@{cmd.ChatMessage.Username}, you're already playing.");
            }
            else
            {
                session.Join(cmd.ChatMessage.Username, cmd.ChatMessage.UserId, null);
                twitch.SendChatMessage(channel, $"@{cmd.ChatMessage.Username}, joining game...");
            }

            return(Task.CompletedTask);
        }
コード例 #5
0
 public void OnPlayerAdd(BotPlayerAdd data)
 {
     twitch.SendChatMessage(data.Session, data.Username + " joined the game.");
 }