common

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatSyncModule

type ChatSyncModule interface {
	SendMessage(user string, message string)
	RecieveMessage(user User, message string)
}

type Event

type Event struct {
	Name             string
	ID               string
	Location         string
	Completed        bool
	DateTime         time.Time
	CompleteDateTime time.Time
	Description      string
	ImageURL         string

	Organizer User
}

Event represents a calendar event

type Module

type Module interface {
	Initialize(birdbot ModuleManager) error
}

type ModuleManager

type ModuleManager interface {
	OnReady(func() error) error

	OnNotify(func(string) error) error

	// Event events
	OnEventCreate(func(Event) error) error
	OnEventDelete(func(Event) error) error
	OnEventUpdate(func(Event) error) error
	OnEventComplete(func(Event) error) error

	// Actions
	CreateEvent(event Event) error
	Notify(message string) error

	RegisterChatSyncModule(ID string, plugin ChatSyncModule) error
}

ModuleManager is the primary way for a module to interact with BirdBot by listening to events and committing actions

type User

type User struct {
	ID          string
	AvatarURL   string
	DisplayName string
}

User represents a user within BirdBot

func (*User) DiscordMention

func (user *User) DiscordMention() string

DiscordMention generated a Discord mention string for the user

Jump to

Keyboard shortcuts

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