compactdisc

package module
v0.0.0-...-02c3adc Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 5 Imported by: 2

README

CompactDisc

Discord Integration for 7TV

Documentation

Index

Constants

View Source
const (
	OperationNameSyncUser    = "SYNC_USER"
	OperationNameSendMessage = "SEND_MESSAGE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance interface {
	SyncUser(userID primitive.ObjectID) (*http.Response, error)
	RevokeUser(userID primitive.ObjectID) (*http.Response, error)
	SendMessage(channel string, message MessageSend, webhook bool) (*http.Response, error)
}

func New

func New(addr string) Instance

type MessageSend

type MessageSend = discordgo.MessageSend

type OperationName

type OperationName string

type Request

type Request[T RequestPayload] struct {
	Operation string `json:"op"`
	Data      T      `json:"data"`
}

func ConvertRequest

func ConvertRequest[T RequestPayload](req Request[json.RawMessage]) Request[T]

func (Request[T]) ToRaw

func (req Request[T]) ToRaw() Request[json.RawMessage]

type RequestPayloadSendMessage

type RequestPayloadSendMessage struct {
	Channel string      `json:"channel"`
	Message MessageSend `json:"message"`
	Webhook bool        `json:"webhook"`
}

type RequestPayloadSyncUser

type RequestPayloadSyncUser struct {
	UserID primitive.ObjectID `json:"user_id"`
	Revoke bool               `json:"revoke"`
}

Directories

Path Synopsis
internal
api

Jump to

Keyboard shortcuts

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