discord

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMMAND_TYPE_HELP           = "help"
	COMMAND_TYPE_ADD_SUBJECT    = "add"
	COMMAND_TYPE_REMOVE_SUBJECT = "remove"
	COMMAND_TYPE_LIST_SUBJECT   = "list"
)

Variables

View Source
var ErrorEmbed = discordgo.MessageEmbed{
	URL:         "https://github.com/notarock/technews-bot",
	Title:       "Invalid command",
	Description: "Error occured... let us know.",
	Fields:      []*discordgo.MessageEmbedField{},
}
View Source
var HelpEmbed = discordgo.MessageEmbed{
	URL:   "https://github.com/notarock/technews-bot",
	Type:  "link",
	Title: "Technews-bot Help",
	Fields: []*discordgo.MessageEmbedField{
		{
			Name:   "`help`",
			Value:  "Print this help man-page.",
			Inline: true,
		},
		{
			Name:   "`list`",
			Value:  "Print all bound channels and their related subjects.",
			Inline: true,
		},
		{
			Name:   "`add`",
			Value:  "Add a technews subject to a bound channel.",
			Inline: true,
		},
		{
			Name:   "`remove`",
			Value:  "Remove a technews subject from a bound channel.",
			Inline: true,
		},
	},
}

Functions

This section is empty.

Types

type Command added in v0.1.0

type Command struct {
	Action    string
	Arguments []string
}

func (Command) Execute added in v0.1.0

type DiscordClient

type DiscordClient struct {
	// contains filtered or unexported fields
}

func Init

func Init(config DiscordConfig) (DiscordClient, error)

func (DiscordClient) SendArticle

func (dc DiscordClient) SendArticle(a articles.Article, channel string)

func (DiscordClient) Wait

func (dc DiscordClient) Wait() error

type DiscordConfig

type DiscordConfig struct {
	Token string
}

Jump to

Keyboard shortcuts

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