✅ Discord Bot / Commands dosent work
Hello everyone who reads this, i am a newbie with programming (i only know the basics) and i started to program a discord bot 2-3 days ago, with the help of an older guide, the bot goes online but the test command dosent work, could someone help me? (and sorry for my bad english its not my native language)
34 Replies
That
GetAwaiter().GetResult()
seems sus
That said, which Discord library are you using?wait a sec
Discord.Net
It seems like you're adding some async methods as event handlers
Async and events don't mix
You should consider using the Interaction framework for slash commands
Doesn't seem like you're really following the docs either
Message commands are deprecated pretty much
Try following the docs exactly before you try straying
This is also pretty easy to do after the step of adding the interaction handler
Its just [SlashCommand("")] instead of [Command("")]
But do as @/angius said and follow the docs otherwise it'll be hell to implement anything
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
it may looks dumb now, but what are these docs? the guide was a video and i followed every step
Here
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
thx
Discord.Net Docs
Home | Discord.Net Documentation
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
thank you very much (again)
Also remember.
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
But first go back to the "getting started" section
And get rid of this
this issue was most likely due to missing the Message Content intent
completly?
No, just make it according to the docs
okay 👍
The issue with the current code? Most likely this
BotReadyGame
is an async
method
Events can't really handle async methods, so it's probably just being fired and forgotteni will give you guys so fast as possible an update later
so i started a new programm and followed the steps from the docs, but now the bot dosent even come on, and i got an error who saids, it dosent find an entry point for the main static mathode and i have no idea why
$mains
The possible signatures for
Main
are public
is not required (can be any accessibility).
Top-level statements are compiled into a Main
method and will use an appropriate signature depending on the body.
https://docs.microsoft.com/en-US/dotnet/csharp/fundamentals/program-structure/main-command-lineMain() and command-line arguments - C#
Learn about Main() and command-line arguments. The 'Main' method is the entry point of an executable program.
Your Main method signature has to be one of those
(i.e. you're missing
static
)thanks it worked
Use the /close command to mark a forum thread as answered
sorry it probably cowardly from mine side, but i will switch to dsharp, it looks easier for me