Delete FreeGames directory
This commit is contained in:
@@ -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 <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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Server\**" />
|
||||
<EmbeddedResource Remove="Server\**" />
|
||||
<None Remove="Server\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PluginManager\PluginManager.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,24 +0,0 @@
|
||||
using PluginManager.Online;
|
||||
namespace Games.Objects;
|
||||
|
||||
public class GameData
|
||||
{
|
||||
internal async static Task<string> GetSteamLinkFromGame(string GameName)
|
||||
{
|
||||
string URL = $"https://store.steampowered.com/search?term={GameName.Replace(" ", "+")}";
|
||||
List<string> 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;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user