discord

package
v1.2.1-0...-60470b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = core.Module{
	Name: "Discord",
	OnInit: func() {
		log.Println("Setting up Discord")

		var err error
		Discord, err = discordgo.New("Bot " + config.Discord.Token)
		Discord.Identify.Intents = 14219

		if err != nil {
			log.Fatalf("Invalid bot parameters: %v", err)
		}

		initSync()
	},
	OnBoot: func() {
		log.Println("Connecting to Discord")

		if err := Discord.Open(); err != nil {
			log.Fatalf("Failed to open Discord session: %v", err)
		}
	},
	OnDestroy: func() {
		Discord.Close()
	},
}

Functions

This section is empty.

Types

type ChannelRef

type ChannelRef struct {
	ID        string `gorm:"primaryKey"`
	GuildID   string `gorm:"primaryKey"`
	Available bool
	Guild     GuildRef `gorm:"constraint:OnDelete:CASCADE"`
}

type GuildRef

type GuildRef struct {
	ID            string `gorm:"primaryKey"`
	InactiveSince *time.Time
}

type RoleRef

type RoleRef struct {
	ID        string `gorm:"primaryKey"`
	GuildID   string `gorm:"primaryKey"`
	Available bool
	Guild     GuildRef `gorm:"constraint:OnDelete:CASCADE"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL