konfachcloud-discord-bot/cmd/bot/main.go
royalcat 70b506036a
All checks were successful
docker / build-docker (linux/amd64) (push) Successful in 1m9s
docker / build-docker (linux/arm64) (push) Successful in 2m55s
init
2024-06-27 16:45:32 +03:00

30 lines
545 B
Go

package main
import (
"context"
"os"
"os/signal"
"syscall"
"git.kmsign.ru/royalcat/konfachcloud-discord-bot/src/bot"
)
func main() {
botToken, ok := os.LookupEnv("DISCORD_BOT_TOKEN")
if !ok {
panic("DISCORD_BOT_TOKEN env var is not set")
}
b, err := bot.Run(bot.Settings{
BotToken: botToken,
HashLength: 1,
DistanceThreshold: 4,
})
if err != nil {
panic(err)
}
defer b.Close(context.Background())
sc := make(chan os.Signal, 1)
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
<-sc
}