public override async Task CustomRun(CommandParametersModel parameters) { string gameName = null; if (parameters.Arguments.Count() > 0) { gameName = string.Join(" ", parameters.Arguments); } else { await ChannelSession.RefreshChannel(); if (ChannelSession.TwitchChannelV5 != null) { gameName = ChannelSession.TwitchChannelV5.game; } } GameInformation details = await XboxGamePreMadeChatCommandModel.GetXboxGameInfo(gameName); if (details != null) { await ChannelSession.Services.Chat.SendMessage(details.ToString()); } else { await ChannelSession.Services.Chat.SendMessage(string.Format("Could not find the game \"{0}\" on Xbox", gameName)); } }
public override async Task CustomRun(CommandParametersModel parameters) { await ChannelSession.RefreshChannel(); if (ChannelSession.TwitchChannelV5 != null) { GameInformation details = await XboxGamePreMadeChatCommandModel.GetXboxGameInfo(ChannelSession.TwitchChannelV5.game); if (details == null) { details = await SteamGamePreMadeChatCommandModel.GetSteamGameInfo(ChannelSession.TwitchChannelV5.game); } if (details != null) { await ChannelSession.Services.Chat.SendMessage(details.ToString()); } else { await ChannelSession.Services.Chat.SendMessage("Game: " + ChannelSession.TwitchChannelV5.game); } } }