goMuffin/main.go

35 lines
648 B
Go
Raw Permalink Normal View History

2024-08-01 11:37:18 +00:00
package main
import (
"fmt"
"log"
"os"
"os/signal"
"syscall"
"github.com/bwmarrin/discordgo"
2024-10-09 13:11:03 +00:00
"gitlab.wh64.net/muffin/goMuffin/configs"
"gitlab.wh64.net/muffin/goMuffin/handler"
2024-08-01 11:37:18 +00:00
)
func main() {
2024-10-09 12:08:17 +00:00
config := configs.Config
2024-08-01 11:37:18 +00:00
2024-10-09 12:08:17 +00:00
dg, err := discordgo.New("Bot " + config.Token)
2024-08-01 11:37:18 +00:00
if err != nil {
fmt.Println("[goMuffin] 봇의 세션을 만들수가 없어요.")
log.Fatalln(err)
}
dg.AddHandler(handler.MessageCreate)
dg.Open()
2024-10-09 12:08:17 +00:00
fmt.Println("[goMuffin] 봇이 실행되고 있어요. 버전:", configs.MUFFIN_VERSION)
2024-08-01 11:37:18 +00:00
sc := make(chan os.Signal, 1)
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
<-sc
dg.Close()
}