botrest

package
v1.24.11 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: MIT Imports: 17 Imported by: 0

README

Provides access to bot state using a rest api to be accessed from e.g scripts or the webserver

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBotMember

func GetBotMember(guildID int64) (m *discordgo.Member, err error)

func GetChannelPermissions

func GetChannelPermissions(guildID, channelID int64) (perms int64, err error)

func GetGuild

func GetGuild(guildID int64) (g *discordgo.Guild, err error)

func GetMemberColors added in v1.6.0

func GetMemberColors(guildID int64, members ...int64) (m map[string]int, err error)

func GetMemberMultiGuild added in v1.17.0

func GetMemberMultiGuild(userID int64, guilds ...int64) (members []*discordgo.Member, err error)

func GetMembers

func GetMembers(guildID int64, members ...int64) (m []*discordgo.Member, err error)

func GetOnlineCount added in v1.4.1

func GetOnlineCount(guildID int64) (c int64, err error)

func GetSessionInfo added in v1.24.6

func GetSessionInfo(addr string) (st []*shardSessionInfo, err error)

func HandleBotMember

func HandleBotMember(w http.ResponseWriter, r *http.Request)

func HandleChannelPermissions

func HandleChannelPermissions(w http.ResponseWriter, r *http.Request)

func HandleGetMemberColors added in v1.6.0

func HandleGetMemberColors(w http.ResponseWriter, r *http.Request)

func HandleGetMembers

func HandleGetMembers(w http.ResponseWriter, r *http.Request)

func HandleGetOnlineCount added in v1.4.1

func HandleGetOnlineCount(w http.ResponseWriter, r *http.Request)

func HandleGetShardSessions added in v1.24.6

func HandleGetShardSessions(w http.ResponseWriter, r *http.Request)

func HandleGuild

func HandleGuild(w http.ResponseWriter, r *http.Request)

func HandleNodeStatus added in v1.24.6

func HandleNodeStatus(w http.ResponseWriter, r *http.Request)

func HandlePing

func HandlePing(w http.ResponseWriter, r *http.Request)

func HandleReconnectShard

func HandleReconnectShard(w http.ResponseWriter, r *http.Request)

func RegisterPlugin added in v1.4.1

func RegisterPlugin()

func RestartAll added in v1.4.1

func RestartAll(reidentify bool)

func SendReconnectAll added in v1.4.1

func SendReconnectAll(reidentify bool) (err error)

func SendReconnectShard

func SendReconnectShard(shardID int, reidentify bool) (err error)

Types

type NodeStatus added in v1.11.0

type NodeStatus struct {
	ID     string         `json:"id"`
	Shards []*ShardStatus `json:"shards"`
	Host   string         `json:"host"`
	Uptime time.Duration  `json:"uptime"`
}

type NodeStatusesResponse added in v1.24.6

type NodeStatusesResponse struct {
	Nodes         []*NodeStatus `json:"nodes"`
	MissingShards []int         `json:"missing_shards"`
	TotalShards   int           `json:"total_shards"`
}

func GetNodeStatuses added in v1.11.0

func GetNodeStatuses() (st *NodeStatusesResponse, err error)

type Plugin added in v1.4.1

type Plugin struct {
}

func (*Plugin) InitInternalAPIRoutes added in v1.24.6

func (p *Plugin) InitInternalAPIRoutes(muxer *goji.Mux)

func (*Plugin) PluginInfo added in v1.17.0

func (p *Plugin) PluginInfo() *common.PluginInfo

type ShardStatus

type ShardStatus struct {
	ShardID         int     `json:"shard_id"`
	TotalEvents     int64   `json:"total_events"`
	EventsPerSecond float64 `json:"events_per_second"`

	ConnStatus discordgo.GatewayStatus `json:"conn_status"`

	LastHeartbeatSend time.Time `json:"last_heartbeat_send"`
	LastHeartbeatAck  time.Time `json:"last_heartbeat_ack"`

	NumGuilds         int
	UnavailableGuilds int
}

Jump to

Keyboard shortcuts

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