discordchess

package module
v0.0.0-...-7b7c58d Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

discordchess

Simple straight forward discord chess bot using https://github.com/notnil/chess.

Usage

# With proper env variables
$ go run github.com/DiscordGophers/discordchess/cmd/discordchess

Environment variables

(automatically loads .env file)

key value
DISCORD_API_KEY discord bot token
CMD_PREFIX bot command prefix i.e: '!'
ROOM_MATCH regexp to only allow in certain room names
ADMIN_ROLES comma separated "[guildId]:[roleId]" i.e: "123123:123123,123123:123123"

Optionals

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoGame = GameError("No game in progress")

Functions

This section is empty.

Types

type ChessHandler

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

func New

func New(cmdPrefix, channelRe string, adminRoles []string) (*ChessHandler, error)

func (*ChessHandler) GameOver

func (c *ChessHandler) GameOver(g *game, s *discordgo.Session, channelID string) error

GameOver sends game finish Card.

func (*ChessHandler) MessageCreateHandler

func (c *ChessHandler) MessageCreateHandler(s *discordgo.Session, m *discordgo.MessageCreate)

type GameError

type GameError string

func (GameError) Error

func (e GameError) Error() string

Directories

Path Synopsis
cmd
discordchess command

Jump to

Keyboard shortcuts

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