[How To] Building a Simple Discord Bot using DiscordGo

Опубликовано: 19 Октябрь 2022
на канале: 0x2142 - Networking Nonsense
2,872
60

In this video, we'll show an example of how to get started with Discord bot development in Golang. We'll use a module called DiscordGo to help us get started & quickly begin responding to chat messages. Then we'll show an example use case by enabling the bot to query an external weather service & provide current weather information.

Additional details in the blog: https://0x2142.com/how-to-discordgo-b...

Example code from the demo: https://github.com/0x2142/example-scr...

Links / Follow me elsewhere:
Blog: https://0x2142.com
Twitter:   / 0x2142  
Mastodon/Fediverse: @[email protected]
GitHub: https://github.com/0x2142

If this video was helpful to you, please consider subscribing & sharing! Please leave a comment if you would like similar content! Thank you!!!

Want to support this channel? Buy me a coffee: https://www.buymeacoffee.com/0x2142

Thanks for watching!
Matt

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Chapters:
0:00 - Intro
1:51 - Getting OpenWeather API keys
2:46 - Setting up a Discord Application & Getting Keys
9:18 - Golang Project Setup
11:17 - Collecting API Keys from Environment Variables
17:01 - Connecting to Discord
21:05 - Processing Incoming Messages
25:35 - Adding Basic Chat Commands
27:32 - Querying Weather Data
36:27 - Generating a Discord Embed Message
38:10 - Testing the Bot

Standard Disclaimer: Any comments / opinions here are my own, and do not represent my current or former employers.