about summary refs log tree commit diff
path: root/pkg/bot/bot.go
blob: a0c08086010460f1ce20a467213d00be8f9e517b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package bot

import (
	"context"
	"fmt"
	"jinx/pkg/discord"
)

const TOKEN = "123567890123456789012345678901234567890"

func Start() error {
	fmt.Println("hi..!")

	client := discord.NewClient(TOKEN)

	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	fmt.Println("connecting..")
	if err := client.Connect(ctx); err != nil {
		return err
	}

	fmt.Println("connected..")

	if err := client.Disconnect(); err != nil {
		return err
	}

	return nil
}