token

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = &bot.Module{
	Name:        "token",
	Description: "Manage Guild Wars 2 API tokens",
	GuildOnly:   false,
	Commands: map[string]*bot.Command{
		"add": {
			Name:        "add",
			Description: "Add a new API token to your account.",
			Usage:       "<API Token>",
			Example:     "564F181A-F0FC-114A-A55D-3C1DCD45F3767AF3848F-AB29-4EBF-9594-F91E6A75E015",
			Execute:     add,
		},
		"list": {
			Name:        "list",
			Description: "List all your API tokens (as DM).",
			Usage:       "",
			Example:     "",
			Execute:     list,
		},
		"remove": {
			Name:        "remove",
			Description: "Remove an API token from your account.",
			Usage:       "<Token-ID>",
			Example:     "1",
			Execute:     remove,
		},
	},
	Store: &store.Store{
		Tables: []*store.Table{
			{
				Name: "token",
				Columns: []*store.Column{
					{
						Name:  "id",
						Type:  "INT",
						Flags: []store.SQLFlag{store.SQLFlagAutoIncrement, store.SQLFlagNotNull, store.SQLFlagPrimaryKey, store.SQLFlagUnsigned},
					},
					{
						Name:  "owner",
						Type:  "VARCHAR",
						Len:   32,
						Flags: []store.SQLFlag{store.SQLFlagNotNull},
					},
					{
						Name:  "token",
						Type:  "VARCHAR",
						Len:   128,
						Flags: []store.SQLFlag{store.SQLFlagNotNull},
					},
				},
			},
		},
	},
}

Module token manages apikeys for users

Functions

This section is empty.

Types

type Token

type Token struct {
	ID    int
	Owner string
	Token string
	Flags uint64 // Permissions flags
}

Token contains a gw2 token and the discord owner

func UserTokens

func UserTokens(userID string) ([]*Token, error)

UserTokens returns all tokens of a user

Jump to

Keyboard shortcuts

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