public SteamGameChatCommand() : base(MixItUp.Base.Resources.SteamGame, new List <string>() { "steamgame", "steam" }, 5, UserRoleEnum.User) { this.Actions.Add(new CustomAction(async(UserViewModel user, IEnumerable <string> arguments) => { if (ChannelSession.Services.Chat != null) { string gameName = null; if (arguments.Count() > 0) { gameName = string.Join(" ", arguments); } else { await ChannelSession.RefreshChannel(); if (ChannelSession.TwitchChannelV5 != null) { gameName = ChannelSession.TwitchChannelV5.game; } } GameInformation details = await SteamGameChatCommand.GetSteamGameInfo(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 Steam", gameName)); } } })); }
public SteamGameChatCommand() : base("Steam Game", new List <string>() { "steamgame", "steam" }, UserRole.User, 30) { this.Actions.Add(new CustomAction(async(UserViewModel user, IEnumerable <string> arguments) => { if (ChannelSession.Chat != null) { string gameName; if (arguments.Count() > 0) { gameName = string.Join(" ", arguments); } else { await ChannelSession.RefreshChannel(); gameName = ChannelSession.Channel.type.name; } string details = await SteamGameChatCommand.GetSteamGameInfo(gameName); if (!string.IsNullOrEmpty(details)) { await ChannelSession.Chat.SendMessage(details); } else { await ChannelSession.Chat.SendMessage(string.Format("Could not find the game \"{0}\" on Steam", gameName)); } } })); }
public GameChatCommand() : base(MixItUp.Base.Resources.Game, new List <string>() { "game" }, 5, UserRoleEnum.User) { this.Actions.Add(new CustomAction(async(UserViewModel user, IEnumerable <string> arguments) => { if (ChannelSession.Services.Chat != null) { await ChannelSession.RefreshChannel(); if (ChannelSession.TwitchChannelV5 != null) { GameInformation details = await XboxGameChatCommand.GetXboxGameInfo(ChannelSession.TwitchChannelV5.game); if (details == null) { details = await SteamGameChatCommand.GetSteamGameInfo(ChannelSession.TwitchChannelV5.game); } if (details != null) { await ChannelSession.Services.Chat.SendMessage(details.ToString()); } else { await ChannelSession.Services.Chat.SendMessage("Game: " + ChannelSession.TwitchChannelV5.game); } } } })); }
public GameChatCommand() : base("Game", new List <string>() { "game" }, UserRole.User, 5) { this.Actions.Add(new CustomAction(async(UserViewModel user, IEnumerable <string> arguments) => { if (ChannelSession.Chat != null) { await ChannelSession.RefreshChannel(); string details = await SteamGameChatCommand.GetSteamGameInfo(ChannelSession.Channel.type.name); if (!string.IsNullOrEmpty(details)) { await ChannelSession.Chat.SendMessage(details); } else { await ChannelSession.Chat.SendMessage("Game: " + ChannelSession.Channel.type.name); } } })); }