cc

package
v0.0.0-...-0abf00b Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

SPDX-License-Identifier: AGPL-3.0-only

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScheduledCC

type ScheduledCC struct {
	ID         int64           `json:"id"`
	Guild      discord.Guild   `json:"guild"`
	Channel    discord.Channel `json:"channel"`
	Message    discord.Message `json:"message"`
	Member     discord.Member  `json:"member"`
	Parameters string          `json:"parameters"`
}

func (*ScheduledCC) Execute

func (dat *ScheduledCC) Execute(cctx context.Context, id int64, bot *bot.Bot) error

func (*ScheduledCC) Offset

func (dat *ScheduledCC) Offset() time.Duration

type State

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

State is a Lua state. It is *not* thread safe and should be discarded once a command has been run.

func NewState

func NewState(bot *bot.Bot, ctx *bcr.Context, params *parameters.Parameters) *State

NewState creates a new Lua state.

func (*State) Close

func (s *State) Close()

func (*State) Do

func (s *State) Do(ctx context.Context, id int64, source string) error

Do executes the given Lua source with the given timeout. The Lua state is closed once this function returns and should not be reused. The timeout must be between 1ns and 5m inclusive.

func (*State) FilterErrors

func (s *State) FilterErrors(err error) bool

If err is a user error (such as one raised from the require. functions), pretty-print that error and return true.

func (*State) Load

func (s *State) Load(source string) error

Load loads the given string and compiles it. It is not stored; this is to be used for giving code a cursory check before saving it.

Jump to

Keyboard shortcuts

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