How To Code Your Own Discord Bot | Discord.net C# Programming Tutorial From A Big Bot Dev | EP1

preview_player
Показать описание
Ever want to learn how to make your own Discord bot. How about being taught by the developer of a bot with over 100,000 servers?

0:00 Intro
0:40 Bot Setup
2:18 Software Setup
3:39 Required Code
6:00 Token Safety and Setup
7:30 Turning On The Bot
7:55 Inviting The Bot To Your server
9:06 Creating the Command Handler
15:00 Your First Commands
19:50 Summary
Рекомендации по теме
Комментарии
Автор

You should probably zoom in when doing stuff like this, kinda hard to read with how small the coding text is.

Icu
Автор

As someone who already uses c# this was just what I needed to get started!!

thespartan
Автор

Oh my goodness, thank you so much! I had a very great idea for a Discord bot and now i can finally make it! I have experience with C# but I have never worked with the Discord WebSocket before.

Nooby
Автор

Tysm, it was very helpful! I hope you will make another episode.

t.aljamri
Автор

For the people wondering right now with his code you can use any prefix and it will work
for example
>ping
;ping
?ping
all of these work but if you want to limit it you can replace the line
command = message.Content.Substring(1, lengthOfCommand - 1);
with
command = message.Content.ToString().Replace("prefix", "");


and delete all of this
if (message.Content.Contains(' ')) //removes prefix in command
{
lengthOfCommand = message.Content.IndexOf(' ');
}
else
{
lengthOfCommand = message.Content.Length;
}

or at least it worked for me

EmperorEmmit
Автор

Heads up this code doesn't work anymore. Don't know why. Even tried just copying and pasting his git hub code and the bot doesn't read messages in discord

frozenmaw
Автор

Will there be an episode 2 please? Its so hard to find clear and concise tutorials like this

tavishsweeney
Автор

I have gone through quite a few C# discord bot tutorials, with many of them being outdated and no longer working. Even though you are only going through the basics (and I will have to do more research to fully flesh out everything I want to do), this was by far the best tutorial for setting up a bot.

Thank you for the great work you did on this video, I would love to see more tutorials about discord bots! For context I am looking to create a bot with a working economy system, player inventories as well as real time events across different channels (the last one being the most difficult).

trevorveenstra
Автор

I am getting a problem when I try running the bot. it says the application has been exited with code 0, I'm not sure why that is happening

Pepsnepis
Автор

Dang, I was really hoping for a follow up video, thanks for the code!

TheFeesher
Автор

I wrote hello in general in the Member server and then I got ban. why do I get ban?

superpanter
Автор

This is so awesome, and got me up to speed really fast as someone who already does C#. Thanks!

VirtualTurtleGames
Автор

i also did evrything on the video but when i added my bot to the server and i tried to to type down !hello or !age there was no response from the bot

trieuminhnguyen
Автор

Quick tip: I recommend using a ".json" file instead of the ".txt" one. They are easier to work with, and, you can add multiple 'things' into it. For Example: my json file right now has "token" and a "prefix"

originalnick
Автор

since this video is a bit outdated if anyone isn't able to get a value from the 'SocketMessage message.Content' write the following in the 'MainAsync()' function
```
var config = new DiscordSocketConfig
{
GatewayIntents = | GatewayIntents.MessageContent
};

_client = new DiscordSocketClient(config);

```

doongie
Автор

Yes, he finally made a video about this!

Chris-srib
Автор

Thanks for the video! An EP2 would be very nice to dig a littler deeper into the discord API

herrdingenz
Автор

yeah guys so welcome to my discord bot video tutorial
lemme just copy paste this code and throw out some words here and there and end the video.

mb
Автор

Do you have a new version with the screen a little closer. It is too big for my eyes

yazuki
Автор

I'm not well-skilled at all with C# and more unfamiliar with discord bots. I have been experiencing null reference exceptions when I pin messages in Discord with an existing bot I have up and running. I was told to 1. enable the message intent in your bots discord dev panel and 2. set my intents in the client config. I'm trying to figure this out so any help would be great, please.

TopLobster