diff --git a/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot.sln b/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot.sln new file mode 100644 index 0000000..49f1265 --- /dev/null +++ b/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2041 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaDOSE.DiscordBot", "LaDOSE.DiscordBot\LaDOSE.DiscordBot.csproj", "{C1E8FAF6-3A75-44AC-938D-CA56A5322D1C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C1E8FAF6-3A75-44AC-938D-CA56A5322D1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1E8FAF6-3A75-44AC-938D-CA56A5322D1C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1E8FAF6-3A75-44AC-938D-CA56A5322D1C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1E8FAF6-3A75-44AC-938D-CA56A5322D1C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D47DEDD0-C906-439D-81E4-D86BBE723B8C} + EndGlobalSection +EndGlobal diff --git a/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot.csproj b/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot.csproj new file mode 100644 index 0000000..3e667bb --- /dev/null +++ b/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot.csproj @@ -0,0 +1,20 @@ + + + + Exe + netcoreapp2.1 + + + + + + + + + + + PreserveNewest + + + + diff --git a/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot/Program.cs b/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot/Program.cs new file mode 100644 index 0000000..7e77612 --- /dev/null +++ b/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot/Program.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using DSharpPlus; +using Microsoft.Extensions.Configuration; + +namespace LaDOSE.DiscordBot +{ + class Program + { + + static DiscordClient discord; + + static void Main(string[] args) + { + + + MainAsync(args).ConfigureAwait(false).GetAwaiter().GetResult(); + } + + static async Task MainAsync(string[] args) + { + + var builder = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("settings.json", optional: true, reloadOnChange: true).Build(); + + var discordToken = builder["Discord:Token"].ToString(); + + + Console.WriteLine($"LaDOSE.Net Discord Bot"); + + discord = new DiscordClient(new DiscordConfiguration + { + Token = discordToken, + TokenType = TokenType.Bot + }); + + discord.MessageCreated += async e => + { + if (e.Message.Content.ToLower().StartsWith("ping")) + await e.Message.RespondAsync("pong!"); + }; + + await discord.ConnectAsync(); + await Task.Delay(-1); + } + + } + +} + + + + diff --git a/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot/settings.json b/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot/settings.json new file mode 100644 index 0000000..126d385 --- /dev/null +++ b/LaDOSE.DiscordBot/LaDOSE.DiscordBot/LaDOSE.DiscordBot/settings.json @@ -0,0 +1,5 @@ +{ + "Discord": { + "Token" : "APITOKEN Here" + } +} \ No newline at end of file