diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e604266 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "YumeChan PluginBase"] + path = Nodsoft.YumeChan.PluginBase + url = https://github.com/YumeChan-DT/YumeChan-PluginBase \ No newline at end of file diff --git a/Nodsoft.YumeChan.PluginBase b/Nodsoft.YumeChan.PluginBase new file mode 160000 index 0000000..609281c --- /dev/null +++ b/Nodsoft.YumeChan.PluginBase @@ -0,0 +1 @@ +Subproject commit 609281cde0911eaa00ad8b9669ef63cbf6e96d02 diff --git a/Nodsoft.YumeChan.PluginSample-VB.sln b/Nodsoft.YumeChan.PluginSample-VB.sln new file mode 100644 index 0000000..1bfbe0e --- /dev/null +++ b/Nodsoft.YumeChan.PluginSample-VB.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29505.145 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Nodsoft.YumeChan.PluginSample-VB", "Nodsoft.YumeChan.PluginSample-VB\Nodsoft.YumeChan.PluginSample-VB.vbproj", "{E47E77E8-D586-461D-B16D-1B26C2AC1F41}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nodsoft.YumeChan.PluginBase", "Nodsoft.YumeChan.PluginBase\Nodsoft.YumeChan.PluginBase.csproj", "{BF0352BC-CDD6-4CCE-899D-5A0D42390782}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E47E77E8-D586-461D-B16D-1B26C2AC1F41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E47E77E8-D586-461D-B16D-1B26C2AC1F41}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E47E77E8-D586-461D-B16D-1B26C2AC1F41}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E47E77E8-D586-461D-B16D-1B26C2AC1F41}.Release|Any CPU.Build.0 = Release|Any CPU + {BF0352BC-CDD6-4CCE-899D-5A0D42390782}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF0352BC-CDD6-4CCE-899D-5A0D42390782}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF0352BC-CDD6-4CCE-899D-5A0D42390782}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF0352BC-CDD6-4CCE-899D-5A0D42390782}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {18A0E7B0-F7A3-4679-A166-F9689CF85B67} + EndGlobalSection +EndGlobal diff --git a/Nodsoft.YumeChan.PluginSample-VB/Nodsoft.YumeChan.PluginSample-VB.vbproj b/Nodsoft.YumeChan.PluginSample-VB/Nodsoft.YumeChan.PluginSample-VB.vbproj new file mode 100644 index 0000000..6bb6aac --- /dev/null +++ b/Nodsoft.YumeChan.PluginSample-VB/Nodsoft.YumeChan.PluginSample-VB.vbproj @@ -0,0 +1,32 @@ + + + + Nodsoft.YumeChan.PluginSample_VB + netstandard2.1 + 1.0.0 + DJ Daemonix + YumeChan-DT + YumeChan : PluginSampleVB + MIT License + LICENSE + https://github.com/YumeChan-DT/SamplePlugin-VB + Git + en + + + + + True + + + + + + + + + + + + + diff --git a/Nodsoft.YumeChan.PluginSample-VB/PingModule.vb b/Nodsoft.YumeChan.PluginSample-VB/PingModule.vb new file mode 100644 index 0000000..c6fd04d --- /dev/null +++ b/Nodsoft.YumeChan.PluginSample-VB/PingModule.vb @@ -0,0 +1,22 @@ +Imports Discord.Commands + + +' Classes can here act as a bundle of Commands. The only limitation is one Class per Group Name. +' +' A few Rules : +' - Class MUST inherit ModuleBase to get flagged as a Module containing commands. +' - Class MUST be set as public to get picked up by the Loader. +' +' /!\ DO NOT USE THESE CLASSES TO STORE PERSISTENT DATA. /!\ +' Each "Command Group" Class is Instantiated when a Command from its group is called. +' The instance immediately vanishes after finishing command execution. + +Public Class PingModule + Inherits ModuleBase(Of SocketCommandContext) + + + Public Async Function PingHelloVisualBasicCommandAsync() As Task + Await ReplyAsync("Hello from YumeChan's Visual Basic Sample Plugin !") + End Function + +End Class diff --git a/Nodsoft.YumeChan.PluginSample-VB/PluginManifest.vb b/Nodsoft.YumeChan.PluginSample-VB/PluginManifest.vb new file mode 100644 index 0000000..1be459b --- /dev/null +++ b/Nodsoft.YumeChan.PluginSample-VB/PluginManifest.vb @@ -0,0 +1,55 @@ +Imports Nodsoft.YumeChan.PluginBase + + +' This Class defines the Plugin, and makes it visible to the Loader. +Public Class PluginManifest ' Class MUST be set as Public to get picked up by the Loader. + Implements IPlugin + + ' For Good principle, do not change a thing here, unless your Versionning has to be different from that of the Assembly. + ' Consider changing your Version within the Assembly instead. + Public ReadOnly Property PluginVersion As Version Implements IPlugin.PluginVersion + Get + Return [GetType].Assembly.GetName.Version + End Get + End Property + + Public ReadOnly Property PluginDisplayName As String Implements IPlugin.PluginDisplayName + Get + Return "YumeChan : Sample Plugin" + End Get + End Property + + Public ReadOnly Property PluginStealth As Boolean Implements IPlugin.PluginStealth + Get + Return False + End Get + End Property + + ' This is handled solely by the LoadPlugin() and UnloadPlugin() Functions below. + Public Property PluginLoaded As Boolean Implements IPlugin.PluginLoaded + Get + Return _PluginLoaded + End Get + Private Set + _PluginLoaded = Value + End Set + End Property + Private _PluginLoaded As Boolean + + Public Function LoadPlugin() As Task Implements IPlugin.LoadPlugin + ' Here goes the Loading Logic, if some loading procedure is needed. Treat it as a Ctor. + + PluginLoaded = True + Return Task.CompletedTask + End Function + + Public Function UnloadPlugin() As Task Implements IPlugin.UnloadPlugin + ' Here goes the Unloading Logic, if some unloading (e.g: Disposal) is needed. Treat it as a Dtor. + + PluginLoaded = False + Return Task.CompletedTask + End Function +End Class + +' For more info, check Discord.NET's guide on Commands : https://discord.foxbot.me/docs/guides/commands/intro.html#modules +' A good knowledge of C# and CLR Aspects will be necessary, to translate Examples from C# to VB. \ No newline at end of file