actions

package
v0.0.0-...-870ec01 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Bans *bans = &bans{
	BannedUsers: map[primitive.ObjectID]*datastructure.Ban{},
	Mtx:         &sync.Mutex{},
}
View Source
var Emotes emotes = emotes{}
View Source
var Entitlements = entitlements{}
View Source
var Notifications notifications = notifications{}
View Source
var Users users = users{}

Functions

This section is empty.

Types

type EntitlementBuilder

type EntitlementBuilder struct {
	Entitlement datastructure.Entitlement

	User *datastructure.User
	// contains filtered or unexported fields
}

func (EntitlementBuilder) GetUser

func (b EntitlementBuilder) GetUser() (*UserBuilder, error)

GetUser: Fetch the user data from the user ID assigned to the entitlement

func (EntitlementBuilder) Log

func (b EntitlementBuilder) Log(str string)

func (EntitlementBuilder) LogError

func (b EntitlementBuilder) LogError(str string)

func (EntitlementBuilder) ReadBadgeData

ReadBadgeData: Read the data as an Entitled Badge

func (EntitlementBuilder) ReadEmoteSetData

func (b EntitlementBuilder) ReadEmoteSetData() datastructure.EntitledEmoteSet

ReadEmoteSetData: Read the data as an Entitled Emote Set

func (EntitlementBuilder) ReadPaintData

ReadPaintData: Read the data as an Entitled Paint

func (EntitlementBuilder) ReadRoleData

ReadRoleData: Read the data as an Entitled Role

func (EntitlementBuilder) ReadSubscriptionData

func (b EntitlementBuilder) ReadSubscriptionData() datastructure.EntitledSubscription

ReadSubscriptionData: Read the data as an Entitled Subscription

func (EntitlementBuilder) SetBadgeData

SetBadgeData: Add a badge reference to the entitlement

func (EntitlementBuilder) SetEmoteSetData

SetEmoteSetData: Add an emote set reference to the entitlement

func (EntitlementBuilder) SetKind

SetKind: Change the entitlement's kind

func (EntitlementBuilder) SetPaintData

SetPainteData: Add a paint reference to the entitlement

func (EntitlementBuilder) SetRoleData

SetRoleData: Add a role reference to the entitlement

func (EntitlementBuilder) SetSubscriptionData

SetSubscriptionData: Add a subscription reference to the entitlement

func (EntitlementBuilder) SetUserID

SetUserID: Change the entitlement's assigned user

func (EntitlementBuilder) Write

Write: Save this Entitlement to persistence

type MergeEmoteOptions

type MergeEmoteOptions struct {
	Actor  *datastructure.User
	OldID  primitive.ObjectID
	NewID  primitive.ObjectID
	Reason string
}

type NotificationBuilder

type NotificationBuilder struct {
	Notification    datastructure.Notification
	MentionedUsers  []primitive.ObjectID
	MentionedEmotes []primitive.ObjectID
	MentionedRoles  []primitive.ObjectID
	TargetUsers     []primitive.ObjectID
}

func (NotificationBuilder) AddEmoteMentionPart

func (b NotificationBuilder) AddEmoteMentionPart(emote primitive.ObjectID) NotificationBuilder

AddEmoteMentionPart: Append a Emote Mention to the notification

func (NotificationBuilder) AddRoleMentionPart

func (b NotificationBuilder) AddRoleMentionPart(role primitive.ObjectID) NotificationBuilder

AddRoleMentionPart: Append a Role Mention to the notification

func (NotificationBuilder) AddTargetUsers

func (b NotificationBuilder) AddTargetUsers(userIDs ...primitive.ObjectID) NotificationBuilder

AddTargetUsers(u): Add one or more users who may read this notification

func (NotificationBuilder) AddTextMessagePart

func (b NotificationBuilder) AddTextMessagePart(text string) NotificationBuilder

AddTextMessagePart: Append a Text part to the notification

func (NotificationBuilder) AddUserMentionPart

func (b NotificationBuilder) AddUserMentionPart(user primitive.ObjectID) NotificationBuilder

AddUserMentionPart: Append a User Mention to the notification

func (NotificationBuilder) GetMentionedEmotes

GetMentionedEmotes: Get the data of mentioned emotes in the notification's message parts

func (NotificationBuilder) GetMentionedUsers

GetMentionedUsers: Get the data of mentioned users in the notification's message parts

func (NotificationBuilder) MarkAsAnnouncement

func (b NotificationBuilder) MarkAsAnnouncement() NotificationBuilder

MarkAsAnnouncement: Mark this notification as an announcement, meaning all users will be able to read it regardless of the selected targets

func (NotificationBuilder) SetTitle

SetTitle: Set the Notification's Title

func (NotificationBuilder) Write

Write: Write the notification to database, creating it if it doesn't exist, or updating the existing one

type UserBuilder

type UserBuilder struct {
	User datastructure.User

	Entitlements []EntitlementBuilder
	// contains filtered or unexported fields
}

func (UserBuilder) FetchEntitlements

func (b UserBuilder) FetchEntitlements(kind *datastructure.EntitlementKind) ([]EntitlementBuilder, error)

AssignEntitlements: adds entitlements to the user object

func (UserBuilder) GetRole

func (b UserBuilder) GetRole() datastructure.Role

GetRole: Returns the user's current role

func (UserBuilder) IsBanned

func (b UserBuilder) IsBanned() bool

Jump to

Keyboard shortcuts

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