channels

package
v0.0.0-...-0648364 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddChatMembers

func AddChatMembers(ctx context.Context, client *telegram.Client, chatPeer tg.InputPeerClass, users []tg.InputUserClass, forwardLimit int) (bool, error)

func AddReaction

func AddReaction(ctx context.Context, client *telegram.Client, link string, emojiChar string) error

AddReaction adds a reaction as well as a view to the current post. It accepts a message deep link, such as: https://t.me/channel_username/<message_id: number>

func AddView

func AddView(ctx context.Context, client *telegram.Client, link string) error

AddView increments the number of view of a channel post. It accepts a message deep link, such as: https://t.me/channel_username/<message_id: number>

func CreateChannel

func CreateChannel(ctx context.Context, client *telegram.Client, title string, about string, broadcast bool) (*tg.Channel, error)

func CreateChat

func CreateChat(ctx context.Context, client *telegram.Client, title string, users []tg.InputUserClass) (*tg.Chat, error)

func DemoteChatMember

func DemoteChatMember(ctx context.Context, client *telegram.Client, chat *tg.InputChannel, user *tg.InputUser, rights tg.ChatAdminRights, title string) (bool, error)

func ForwardMessageFromPublicChannel

func ForwardMessageFromPublicChannel(ctx context.Context, client *telegram.Client, deepLink string, destinationChannelUsername string) error

ForwardMessageFromPublicChannel forwards a message from a public channel thanks to the message deep link

func GetSimilarChannels

func GetSimilarChannels(ctx context.Context, client *telegram.Client, channelUsername string) ([]*tg.Channel, error)

func GetUpdateFromUpdates

func GetUpdateFromUpdates(updates tg.UpdatesClass) ([]tg.UpdateClass, []tg.ChatClass, []tg.UserClass)

func JoinChannel

func JoinChannel(ctx context.Context, client *telegram.Client, username string) error

JoinChannel joins a public channel / group chat, that has an username.

func JoinPrivateChannel

func JoinPrivateChannel(ctx context.Context, client *telegram.Client, hash string) error

func PromoteChatMember

func PromoteChatMember(ctx context.Context, client *telegram.Client, chat *tg.InputChannel, user *tg.InputUser, rights tg.ChatAdminRights, title string) (bool, error)

Types

type ChannelMonitoring

type ChannelMonitoring struct {
	*messages.Monitoring
}

func NewChannelMonitoring

func NewChannelMonitoring(ctx context.Context, client *telegram.Client, username string, dispatcher tg.UpdateDispatcher, strip bool) (*ChannelMonitoring, error)

NewChannelMonitoring creates a new `ChannelMonitoring` struct. NOTE: If the channel is private, activate the parameters to show ID of entities you're interacting with on Telegram Desktop, or use an alternative client like NekoGram on Android, or NiceGram on iOS. You should be subscribed to the channel to do so. NOTE: The strip parameter means that you want to remove special characters and spaces from messages you will be parsing, because you don't need them, and, its easier to make regular expressions this way.

Jump to

Keyboard shortcuts

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