about summary refs log tree commit diff
path: root/pkg/bot/bot.go
blob: 71eb0e9cf03b5cf69b0ba6ef951a116b33596a7a (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
package bot

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

func Start(token string) 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
}