Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Get bot token and add it to a server

Anders Øen Fylling edited this page Aug 7, 2021 · 7 revisions

To get your bot up and running you must create a Discord application and retrieve your Client ID and Token. This tutorial will guide you through the mentioned Discord process.

1. Log into discordapp.com and navigate to developers => Developer Portal

Imgur

2. Click the "New Application" button to the right

Imgur

3. Name you application/bot whatever you'd like and click Create

Imgur

4. Navigate to the "bot" section, in the menu to the left

Imgur

5. Click the "add bot" button to the right and agree to whatever comes up

Imgur

6. Now you can click "Copy" which will add the bot token to your clip board (which means you can hit Ctrl+v to paste it somewhere) or click "Reveal token" to manually copy it

Imgur

7. Add it to your Disgord config and print out the invite link

func main() {
  client := disgord.New(disgord.Config{
    BotToken: "NjMwNTc0ODM5NTU5ODgwNzI1.XZqVmg.BxkYm3Rr1If02-n9kJL6svAHTyA", // <= paste token here
  })
  // connect, and stay connected until a system interrupt takes place
  defer client.Gateway().Connect()
    
  inviteURL, err := client.CreateBotURL()
  if err != nil {
    panic(err)
  }
  fmt.Println(inviteURL)

  setupBot(client)
}

8. Run your bot and you will get a link that you can click or send to other which will add the bot to your or their server!

Clone this wiki locally