INNER CODE UNIT · Go

main

instead-hub/instead · src/tiny/ifbot/discord-bot/main.go:29

func main() {
	ChannelsList = strings.Split(Channels, ",")

	ifbot.SaveDir = "discord-saves/"
	// Create a new Discord session using the provided bot token.
	dg, err := discordgo.New("Bot " + Token)
	if err != nil {
		fmt.Println("error creating Discord session,", err)
		return
	}

	// Register the messageCreate func as a callback for MessageCreate events.
	dg.AddHandler(messageCreate)

	// Open a websocket connection to Discord and begin listening.
	err = dg.Open()
	if err != nil {
		fmt.Println("error opening connection,", err)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…