rpc

package
v0.0.0-...-1757c10 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseGuildUserInfo

func BaseGuildUserInfo(
	ctx context.Context,
	guildID string,
	userID string,
) (res *rpc_messages.BaseGuildUserInfo, err error)

Calls the BaseGuildUserInfo method to get basic user + guild info (base-guild-user-info/:guild_id/:user_id)

func BotState

func BotState(ctx context.Context) (*rpc_messages.BotState, error)

func CalcBotAddr

func CalcBotAddr() string

func CalcBotPort

func CalcBotPort() int

func CalcJobserverAddr

func CalcJobserverAddr() string

func CalcJobserverPort

func CalcJobserverPort() int

func CheckCommandPermission

func CheckCommandPermission(
	ctx context.Context,
	guildID string,
	userID string,
	command string,
) (res *rpc_messages.CheckCommandPermission, err error)

Calls the CheckCommandPermission method to check whether or not a user has permission to run a command

func CheckUserHasPermission

func CheckUserHasPermission(
	ctx context.Context,
	guildID string,
	userID string,
	perm string,
) (res *rpc_messages.CheckCommandPermission, err error)

check_user_has_permission /check-user-has-permission/:guild_id/:user_id

func ExecuteTemplate

func ExecuteTemplate(
	ctx context.Context,
	guildID string,
	userID string,
	req *rpc_messages.ExecuteTemplateRequest,
) (res *rpc_messages.ExecuteTemplateResponse, err error)

Calls the BaseGuildUserInfo method to get basic user + guild info (template-exec/:guild_id/:user_id)

func GuildsExist

func GuildsExist(
	ctx context.Context,
	guildIds []string,
) (res *[]uint16, err error)

Calls the GuildsExist method to find out if the bot is in the specified list of guilds

func JobserverSpawnTask

func JobserverSpawnTask(
	ctx context.Context,
	spawnTask *rpc_messages.JobserverSpawn,
) (res *rpc_messages.JobserverSpawnResponse, err error)

Calls the CheckCommandPermission method to check whether or not a command is runnable

func RpcQuery

func RpcQuery[T any](
	ctx context.Context,
	client http.Client,
	method string,
	url string,
	body any,
	sendJsonHeader bool,
) (res *T, err error)

Calls a route using the RPC protocol

func SettingsOperation

func SettingsOperation(
	ctx context.Context,
	guildID string,
	userID string,
	settingsOpReq *rpc_messages.SettingsOperationRequest,
) (res *rpc_messages.CanonicalSettingsResult, err error)

Calls the SettingsOperation method to execute a settings operation (settings-operation/:guild_id/:user_id)

Types

This section is empty.

Jump to

Keyboard shortcuts

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