Reorganized solution projects
Clear separation between what features will be available in the public instance and additional features available for a self-hosted instance.
This commit is contained in:
parent
f20a17e914
commit
2e178a2f2d
5 changed files with 94 additions and 19 deletions
16
Kerobot.sln
16
Kerobot.sln
|
@ -5,7 +5,9 @@ VisualStudioVersion = 15.0.27428.2005
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kerobot", "Kerobot\Kerobot.csproj", "{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kerobot", "Kerobot\Kerobot.csproj", "{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kerobot-Modules", "Kerobot-Modules\Kerobot-Modules.csproj", "{B33E57B4-2918-4552-8489-E0DB8BCE3126}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Modules-PublicInstance", "Modules-PublicInstance\Modules-PublicInstance.csproj", "{E06B76BE-E6F5-4803-BA02-DA8AF2A9705E}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Modules-SelfHosted", "Modules-SelfHosted\Modules-SelfHosted.csproj", "{84390AD6-6906-4BD9-A948-578C21037D6C}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
@ -17,10 +19,14 @@ Global
|
||||||
{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}.Release|Any CPU.Build.0 = Release|Any CPU
|
{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{B33E57B4-2918-4552-8489-E0DB8BCE3126}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{E06B76BE-E6F5-4803-BA02-DA8AF2A9705E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{B33E57B4-2918-4552-8489-E0DB8BCE3126}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{E06B76BE-E6F5-4803-BA02-DA8AF2A9705E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{B33E57B4-2918-4552-8489-E0DB8BCE3126}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{E06B76BE-E6F5-4803-BA02-DA8AF2A9705E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{B33E57B4-2918-4552-8489-E0DB8BCE3126}.Release|Any CPU.Build.0 = Release|Any CPU
|
{E06B76BE-E6F5-4803-BA02-DA8AF2A9705E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{84390AD6-6906-4BD9-A948-578C21037D6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{84390AD6-6906-4BD9-A948-578C21037D6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{84390AD6-6906-4BD9-A948-578C21037D6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{84390AD6-6906-4BD9-A948-578C21037D6C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
@ -2,26 +2,20 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<Product>Kerobot</Product>
|
|
||||||
<Company />
|
|
||||||
<Authors>Noikoio</Authors>
|
<Authors>Noikoio</Authors>
|
||||||
<AssemblyVersion>0.0.1</AssemblyVersion>
|
<Company>Noikoio</Company>
|
||||||
<Description>User-facing portions of Kerobot</Description>
|
<Product>Kerobot</Product>
|
||||||
<FileVersion>0.0.1</FileVersion>
|
|
||||||
<Version>0.0.1</Version>
|
<Version>0.0.1</Version>
|
||||||
|
<Description>Essential functions for Kerobot which are available in the public bot instance.</Description>
|
||||||
|
<RootNamespace>Kerobot.Modules</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Discord.Net" Version="2.0.0-beta" />
|
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Kerobot\Kerobot.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
<Exec Command="copy /Y "$(TargetDir)$(ProjectName).*" "$(SolutionDir)Kerobot\bin\$(ConfigurationName)\netcoreapp2.0\"" />
|
<Exec Command="copy /Y "$(TargetDir)$(ProjectName).*" "$(SolutionDir)Kerobot\bin\$(ConfigurationName)\netcoreapp2.0\"" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Kerobot\Kerobot.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
27
Modules-PublicInstance/TestMod.cs
Normal file
27
Modules-PublicInstance/TestMod.cs
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Discord.WebSocket;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Kerobot.Modules
|
||||||
|
{
|
||||||
|
[KerobotModule]
|
||||||
|
class TestMod : ModuleBase
|
||||||
|
{
|
||||||
|
public TestMod(Kerobot kb) : base(kb)
|
||||||
|
{
|
||||||
|
kb.DiscordClient.MessageReceived += DiscordClient_MessageReceived;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task DiscordClient_MessageReceived(SocketMessage arg)
|
||||||
|
{
|
||||||
|
if (arg.Content.ToLower() == ".test")
|
||||||
|
{
|
||||||
|
await arg.Channel.SendMessageAsync("I respond to your test.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Task<object> CreateGuildStateAsync(JToken config)
|
||||||
|
=> Task.FromResult<object>(new Dictionary<ulong, string>());
|
||||||
|
}
|
||||||
|
}
|
20
Modules-SelfHosted/Modules-SelfHosted.csproj
Normal file
20
Modules-SelfHosted/Modules-SelfHosted.csproj
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
|
<Authors>Noikoio</Authors>
|
||||||
|
<Product>Kerobot</Product>
|
||||||
|
<Version>0.0.1</Version>
|
||||||
|
<Description>Kerobot modules with more specific purposes that may not work well in a public instance, but are manageable in self-hosted bot instances.</Description>
|
||||||
|
<RootNamespace>Kerobot.Modules</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Command="copy /Y "$(TargetDir)$(ProjectName).*" "$(SolutionDir)Kerobot\bin\$(ConfigurationName)\netcoreapp2.0\"" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Kerobot\Kerobot.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
28
Modules-SelfHosted/TestMod2.cs
Normal file
28
Modules-SelfHosted/TestMod2.cs
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Discord.WebSocket;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Kerobot.Modules
|
||||||
|
{
|
||||||
|
[KerobotModule]
|
||||||
|
class TestMod2 : ModuleBase
|
||||||
|
{
|
||||||
|
public TestMod2(Kerobot kb) : base(kb)
|
||||||
|
{
|
||||||
|
kb.DiscordClient.MessageReceived += DiscordClient_MessageReceived;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task DiscordClient_MessageReceived(SocketMessage arg)
|
||||||
|
{
|
||||||
|
if (arg.Content.ToLower() == ".test2")
|
||||||
|
{
|
||||||
|
await arg.Channel.SendMessageAsync("I respond to your test too.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Task<object> CreateGuildStateAsync(JToken config)
|
||||||
|
=> Task.FromResult<object>(new Dictionary<ulong, string>());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue