Search code examples
vb.netdiscord.net

Discord.NET sending messages to one specific channel in one specific server


So I'm trying to send a message to a specific channel, but I've been looking and found I can't see any way I can do that. I might be doing something wrong or I'm looking in the wrong area, I've looked on Google and couldn't find an answer. This is my code when trying to find it.

     discord.GetGuild("serverid").GetChannel("Channelid")

As far as I can see, this is not the way to do it, but I don't know where else to check :\


Solution

  • Actually, I kinda feel stupid after realizing this, In my code previously, I was making the program try and find a channel, when what I actually needed to do was find a text channel, like so:

        discord.GetGuild("serverid").GetTextChannel("Channelid").SendMessageAsync(
        "Message")
    

    So sorry for asking for help when the answer was really simple. :/