Hack Forums
[.NET] discord.net discord command services - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] discord.net discord command services (/showthread.php?tid=5943603)



discord.net discord command services - System[X] - Feb 21, 2019

Anyone here know a bit about discord.net command services ?

Ok i need help adding commands at runtime dynamically.

Code
Imports Discord
Imports Discord.Commands
Imports Discord.WebSocket

Public Class TestCommands : Inherits ModuleBase(Of SocketCommandContext)

    <Command("test1")>
    <Remarks("User")>
    Public Async Function Test1() As Task
        Await ReplyAsync("this is test1")
    End Function

    <Command("test2")>
    <Remarks("User")>
    Public Async Function Test2() As Task
        Await ReplyAsync("this is test2")
    End Function

    <Command("test3")>
        <Remarks("User")>
        Public Async Function Test3() As Task
            Await ReplyAsync("this is test3")
        End Function

    End Class

How would i add these commands at runtime, either single, a file or a .dll file.

I have been trying this for a coupe of weeks now with no success. If you have an example file that would be great.

Thanks for any help


RE: discord.net discord command services - The Social Engineer - Feb 21, 2019

(Feb 21, 2019 02:30 PM)System[X] Wrote:  Anyone here know a bit about discord.net command services ?

Ok i need help adding commands at runtime dynamically.

Code
Imports Discord
Imports Discord.Commands
Imports Discord.WebSocket

Public Class TestCommands : Inherits ModuleBase(Of SocketCommandContext)

   <Command("test1")>
   <Remarks("User")>
   Public Async Function Test1() As Task
       Await ReplyAsync("this is test1")
   End Function

   <Command("test2")>
   <Remarks("User")>
   Public Async Function Test2() As Task
       Await ReplyAsync("this is test2")
   End Function

   <Command("test3")>
       <Remarks("User")>
       Public Async Function Test3() As Task
           Await ReplyAsync("this is test3")
       End Function

   End Class

How would i add these commands at runtime, either single, a file or a .dll file.

I have been trying this for a coupe of weeks now with no success. If you have an example file that would be great.

Thanks for any help

Take a look through this help site regarding the topic:

https://discord.foxbot.me/latest/guides/commands/intro.html


RE: discord.net discord command services - System[X] - Feb 21, 2019

(Feb 21, 2019 02:37 PM)The Social Engineer Wrote:  Take a look through this help site regarding the topic:

https://discord.foxbot.me/latest/guides/commands/intro.html

I have a fully working bot, but i am wanting to extend the commands without having to open the source, add the new commands then re compile. this is why im asking how to add them dynamically, I have read a lot of Help Docs for this but can not put the code together to do it.

Thanks