-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
42 lines (32 loc) · 601 Bytes
/
main.go
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
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"log"
"os"
"strings"
godotenv "github.com/joho/godotenv"
)
type Mode string
const (
CLI Mode = "CLI"
TUI Mode = "TUI"
)
var mode Mode
func main() {
godotenv.Load(".env")
token := os.Getenv("CLYDE_DISCORD_USER_TOKEN")
if token == "" {
log.Fatalln("No $CLYDE_DISCORD_USER_TOKEN given.")
} else if os.Getenv("CLYDE_CHANNEL_ID") == "" {
log.Fatalln("No $CLYDE_CHANNEL_ID given.")
}
go InitClipboard()
go RunDiscordSession(token)
args := os.Args[1:]
if len(args) > 0 {
mode = CLI
RunCLI(strings.Join(args, " "))
} else {
mode = TUI
RunTUI()
}
}