s2y

package module
v0.0.0-...-a3f153f Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: BSD-3-Clause Imports: 0 Imported by: 0

README

Spotify to Youtube discord bot

Blast your music all curated in your spotify playlists via the rythm bot in discord!

Setup

  1. Create a copy of config.json.example and rename the copy to config.json. Alternatively you can name it whatever and pass the absolute path via the config flag.
  2. Edit the config.json with your API tokens and keys.
  3. Change the mode so only the current user/group has read permission (i.e. 400/440).
  4. Compile with go build.
  5. Run with ./s2y and optionally provide the configuration file (if you have named it differently or it isn't located in the execution directory) with --config /absolute/path/to/config.json.

License

BSD-3-clause

Documentation

Index

Constants

View Source
const (
	CMD_TYPE_STR = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Options     []CommandOption `json:"options"`
}

Sent to the discord API as a created command.

func NewCommand

func NewCommand(name, desc string, options ...CommandOption) Command

type CommandData

type CommandData struct {
	ID      string
	Name    string
	Options []CommandDataOption
}

Data received as part of an interaction.

type CommandDataOption

type CommandDataOption struct {
	Name, Value string
}

Options for the received data.

type CommandOption

type CommandOption struct {
	Type        int    `json:"type"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Required    bool   `json:"required"`
}

Options for a command.

type Interaction

type Interaction struct {
	ID    string
	Type  int64
	Token string
	Data  CommandData
}

Represents a Discord interaction request.

func (Interaction) IsPing

func (i Interaction) IsPing() bool

Whether or not the interaction is a ping request.

type InteractionResponse

type InteractionResponse struct {
	Type int                     `json:"type"`
	Data InteractionResponseData `json:"data"`
}

Represents the response to a Discord interaction request.

func NewAckResponse

func NewAckResponse() InteractionResponse

func NewAckWithSrcResponse

func NewAckWithSrcResponse(i Interaction) InteractionResponse

func NewMsgResponse

func NewMsgResponse(content string) InteractionResponse

func NewMsgWithSrcResponse

func NewMsgWithSrcResponse(i Interaction) InteractionResponse

func NewPongResponse

func NewPongResponse() InteractionResponse

type InteractionResponseData

type InteractionResponseData struct {
	Tts     bool   `json:"tts"`
	Content string `json:"content"`
}

Directories

Path Synopsis
api
cmd
s2y command
s2y_register command

Jump to

Keyboard shortcuts

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