diff --git a/FreeGames/Game.cs b/FreeGames/Game.cs deleted file mode 100644 index 40753fd..0000000 --- a/FreeGames/Game.cs +++ /dev/null @@ -1,28 +0,0 @@ -using PluginManager.Interfaces; -using Games.Objects; -namespace Games; - -public class Game : DBCommand -{ - public string Command => "game"; - public string Description => "Display info about the specified game"; - public string Usage => "game "; - - public bool canUseDM => false; - public bool canUseServer => true; - public bool requireAdmin => false; - - public async void Execute(Discord.Commands.SocketCommandContext context, Discord.WebSocket.SocketMessage message, - Discord.WebSocket.DiscordSocketClient client, bool isDM) - { - string game_name = PluginManager.Others.Functions.MergeStrings(message.Content.Split(' '), 1); - string game_url = await GameData.GetSteamLinkFromGame(game_name); - if (game_url is null || game_url == null) - { - await message.Channel.SendMessageAsync("Could not find the game. Try to be more specific or check for spelling errors."); - return; - } - await context.Channel.SendMessageAsync(game_url); - } - -} diff --git a/FreeGames/Games.csproj b/FreeGames/Games.csproj deleted file mode 100644 index 7afa3af..0000000 --- a/FreeGames/Games.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/FreeGames/Objects/GameData.cs b/FreeGames/Objects/GameData.cs deleted file mode 100644 index 1156127..0000000 --- a/FreeGames/Objects/GameData.cs +++ /dev/null @@ -1,24 +0,0 @@ -using PluginManager.Online; -namespace Games.Objects; - -public class GameData -{ - internal async static Task GetSteamLinkFromGame(string GameName) - { - string URL = $"https://store.steampowered.com/search?term={GameName.Replace(" ", "+")}"; - List lines = await ServerCom.ReadTextFromFile(URL); - - string? gameData = ( - from s in lines - where s.Contains(GameName.Replace(" ", "_"), StringComparison.OrdinalIgnoreCase) - select s).FirstOrDefault(); - if (gameData is null) return null; - string GameURL = gameData.Split('\"')[1].Split('?')[0]; - - if (GameURL == "menuitem") - return null; - - return GameURL; - - } -}