コード例 #1
0
ファイル: TimeoutCmd.cs プロジェクト: Faded/TwitchBot
        public async Task <string> DeleteUserTimeout(string recipient, int broadcasterId, string twitchBotApiLink)
        {
            UserBotTimeout removedTimeout = await ApiBotRequest.DeleteExecuteTaskAsync <UserBotTimeout>(twitchBotApiLink + $"userbottimeouts/delete/{broadcasterId}?username={recipient}");

            if (removedTimeout == null)
            {
                return("");
            }

            string name = removedTimeout.Username;

            TimedoutUsers.RemoveAll(r => r.Username == name);
            return(name);
        }
コード例 #2
0
        public async Task <string> DeleteModerator(string recipient, int broadcasterId, string twitchBotApiLink)
        {
            Moderators removedModerator = await ApiBotRequest.DeleteExecuteTaskAsync <Moderators>(twitchBotApiLink + $"moderators/delete/{broadcasterId}?username={recipient}");

            if (removedModerator == null)
            {
                return("");
            }

            string name = removedModerator.Username;

            Moderators.Remove(name);
            return(name);
        }
コード例 #3
0
ファイル: TimeoutCmd.cs プロジェクト: Faded/TwitchBot
 public async Task <List <UserBotTimeout> > DeleteTimeouts(int broadcasterId, string twitchBotApiLink)
 {
     return(await ApiBotRequest.DeleteExecuteTaskAsync <List <UserBotTimeout> >(twitchBotApiLink + $"userbottimeouts/delete/{broadcasterId}"));
 }
コード例 #4
0
        public async Task DeleteCustomCommand(string twitchBotApiLink, int broadcasterId, string username)
        {
            CustomCommand customCommand = await ApiBotRequest.DeleteExecuteTaskAsync <CustomCommand>(twitchBotApiLink + $"customcommands/delete/{broadcasterId}?name={username}");

            _customCommands.Remove(customCommand);
        }
コード例 #5
0
        public async Task DeleteModerator(string twitchBotApiLink, int broadcasterId, string username)
        {
            BotModerator botModerator = await ApiBotRequest.DeleteExecuteTaskAsync <BotModerator>(twitchBotApiLink + $"botmoderators/delete/{broadcasterId}?username={username}");

            _botModerators.Remove(botModerator);
        }