api_utils

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const RandomId = 0

Variables

This section is empty.

Functions

func CreateMessageSendBuilderByPost

func CreateMessageSendBuilderByPost(post object.WallWallpost) *params.MessagesSendBuilder

CreateMessageSendBuilderByPost prepares a message builder for sending messages, incorporating text and attachments based on a provided WallWallpost.

func CreateMessageSendBuilderText

func CreateMessageSendBuilderText(text string) *params.MessagesSendBuilder

CreateMessageSendBuilderText creates a simple message send builder with text content.

func GetFormattedCalendar added in v1.4.1

func GetFormattedCalendar(posts []object.WallWallpost, timezone string) (string, error)

GetFormattedCalendar groups wall posts by date and formats them into a readable calendar view. The formatting takes into account the timezone, sorting posts by date. Returns a formatted string representing the post calendar or an error if an issue occurs during formatting.

func GetGroupInfo

func GetGroupInfo(vkCommunity *api.VK) api.GroupsGetByIDResponse

GetGroupInfo retrieves information about the community/group page using a `*api.VK* instance with community access. It makes an API call to vkCommunity.GroupsGetByID and returns the group information. If an error occurs during the API call, the function logs the error and terminates execution.

func GetGroupManagerIDs added in v1.4.1

func GetGroupManagerIDs(vkUser *api.VK, domain string) []int

GetGroupManagerIDs retrieves the IDs of group managers with managerial permissions from VK. It uses the vkUser client to make an API call with the specified domain as the group_id. The function filters the members list to include only those with managerial rights. Returns a slice of IDs or logs a fatal error if the API call fails. It should be noted, that vkUser client should have sufficient permissions in given domain or else things go south.

func IsManagerWithRights added in v1.4.1

func IsManagerWithRights(role string) bool

IsManagerWithRights checks if a given role is associated with managerial rights. The function returns true for the roles "editor", "administrator", and "creator". It returns false for all other roles.

Types

This section is empty.

Jump to

Keyboard shortcuts

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