godiscordbot

command module
v0.0.0-...-7a505e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

README

How to create a Discord bot

Go Report Card Go

Requirements

  1. Install required software
    1. Git
    2. Go
    3. Visual Studio Code
      1. Go for Visual Studio Code
  2. Create a new repository on GitHub
    • Please refer to package-names to name the repository
    • Add .gitignore: Go
  3. Connect to GitHub with SSH by reading the following documents
  4. Understand the GitHub flow
  5. Learn Go by reading the following documents
  6. Discord
    1. Read the introduction to the Discord Developer Portal
    2. Create an application
      • Add a bot user

Setup the repository

  1. Download the newly created GitHub repository using git clone via SSH
  2. Open the folder with VSCode
  3. Create a file named main.go

In main.go, paste the following.

package main

func main() {

}

In the following commands, you'll need to use the URL of the GitHub repository you've just created in the format github.com/NatoBoram/godiscordbot.

go mod init github.com/NatoBoram/godiscordbot
go get -u -v github.com/bwmarrin/discordgo

Once you have something in the repository, commit it and send it to the GitHub repository. Use VSCode's Source Control tab to help you out.

Coding something

Use discordgo to get started. The full documentation is at pkg.go.dev/github.com/bwmarrin/discordgo.

Remember that your token should not be stored inside your source code, but instead be in a configuration file.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL