scene

package
v0.0.4-dev Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 4 Imported by: 0

README

Сцены (события ВКонтакте)

Сцены необходимы для описания того, как бот будет обрабатывать входящее событие. Список событий можно посмотреть здесь. Для обработки необходимо включить их в Callback/LongPoll API:

Events

Наша библиотека вводит немного другие названия событий, но это не значит, что нельзя использовать обычные вроде «message_new» и т.д, если Вам они удобнее - используйте их. Посмотреть изменённые типы событий можно здесь.

Чтобы обрабатывать сцену можно пойти несколькими путями:

scenes := scene.Create()

// Methods
scenes.OnMessage(events.Message)
scenes.Message(events.Message) // Shorten

Здесь events - директория с функциями событий, которые принимают в качестве аргумента указатель на бота и событие:


func Message(bot *API.Bot, message update.Message) {
	if message.Text == "ping" {
		bot.SendMessage(message.ChatID, bot.GetUser(message.UserID).Name + ", pong!")	
	}
}

Подобные функции можно описать и для других событий.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Use

func Use(bot *API.Bot, message update.Update, scenes Scenes)

Types

type AppNotification

type AppNotification func(*API.Bot, update.AppNotification)

type Audio

type Audio func(*API.Bot, update.Audio)

type BlockUser

type BlockUser func(*API.Bot, update.BlockUser)

type BoardComment

type BoardComment func(*API.Bot, update.BoardComment)

type Callback

type Callback func(*API.Bot, update.Callback)

type CancelDonate

type CancelDonate func(*API.Bot, update.CancelDonate)

type ChangeDonatePrice

type ChangeDonatePrice func(*API.Bot, update.ChangeDonatePrice)

type ChangeGroupPhoto

type ChangeGroupPhoto func(*API.Bot, update.ChangeGroupPhoto)

type ControlGroup

type ControlGroup func(*API.Bot, update.ControlGroup)

type DeleteBoardComment

type DeleteBoardComment func(*API.Bot, update.DeleteBoardComment)

type DeleteMarketComment

type DeleteMarketComment func(*API.Bot, update.DeleteMarketComment)

type DeletePhotoComment

type DeletePhotoComment PhotoComment

type DeletePostComment

type DeletePostComment func(*API.Bot, update.DeletePostComment)

type DeleteVideoComment

type DeleteVideoComment func(*API.Bot, update.DeleteVideoComment)

type DisableMessage

type DisableMessage func(*API.Bot, update.DisableMessage)
type Donate func(*API.Bot, update.Donate)

type EditBoardComment

type EditBoardComment BoardComment

type EditMarketComment

type EditMarketComment MarketComment

type EditMessage

type EditMessage func(*API.Bot, update.Message)

type EditOrderMarket

type EditOrderMarket OrderMarket

type EditOwners

type EditOwners func(*API.Bot, update.EditOwners)

type EditPhotoComment

type EditPhotoComment PhotoComment

type EditPostComment

type EditPostComment PostComment

type EditVideoComment

type EditVideoComment VideoComment

type EnableMessage

type EnableMessage func(*API.Bot, update.EnableMessage)

type ExpiredDonate

type ExpiredDonate func(*API.Bot, update.ExpiredDonate)

type JoinGroup

type JoinGroup func(*API.Bot, update.JoinGroup)

type LeaveGroup

type LeaveGroup func(*API.Bot, update.LeaveGroup)

type Like

type Like func(*API.Bot, update.Like)

type MarketComment

type MarketComment func(*API.Bot, update.MarketComment)

type Message

type Message func(*API.Bot, update.Object)

type OrderMarket

type OrderMarket func(*API.Bot, update.OrderMarket)

type Photo

type Photo func(*API.Bot, update.Photo)

type PhotoComment

type PhotoComment func(*API.Bot, update.PhotoComment)

type Post

type Post func(*API.Bot, update.Post)

type PostComment

type PostComment func(*API.Bot, update.PostComment)

type ProlongedDonate

type ProlongedDonate func(*API.Bot, update.ProlongedDonate)

type ReplyMessage

type ReplyMessage func(*API.Bot, update.Message)

type Repost

type Repost Post

type RestoreBoardComment

type RestoreBoardComment BoardComment

type RestoreMarketComment

type RestoreMarketComment MarketComment

type RestorePhotoComment

type RestorePhotoComment PhotoComment

type RestorePostComment

type RestorePostComment PostComment

type RestoreVideoComment

type RestoreVideoComment VideoComment

type Scenes

type Scenes struct {
	Message_        Message
	ReplyMessage_   ReplyMessage
	EditMessage_    EditMessage
	EnableMessage_  EnableMessage
	DisableMessage_ DisableMessage
	Typing_         Typing
	Callback_       Callback

	Photo_               Photo
	PhotoComment_        PhotoComment
	EditPhotoComment_    EditPhotoComment
	RestorePhotoComment_ RestorePhotoComment
	DeletePhotoComment_  DeletePhotoComment

	Audio_ Audio

	Video_               Video
	VideoComment_        VideoComment
	EditVideoComment_    EditVideoComment
	RestoreVideoComment_ RestoreVideoComment
	DeleteVideoComment_  DeleteVideoComment

	Post_               Post
	Repost_             Repost
	PostComment_        PostComment
	EditPostComment_    EditPostComment
	RestorePostComment_ RestorePostComment
	DeletePostComment_  DeletePostComment

	Like_   Like
	Unlike_ Unlike

	BoardComment_        BoardComment
	EditBoardComment_    EditBoardComment
	RestoreBoardComment_ RestoreBoardComment
	DeleteBoardComment_  DeleteBoardComment

	MarketComment_        MarketComment
	EditMarketComment_    EditMarketComment
	RestoreMarketComment_ RestoreMarketComment
	DeleteMarketComment_  DeleteMarketComment

	OrderMarket_     OrderMarket
	EditOrderMarket_ EditOrderMarket

	JoinGroup_  JoinGroup
	LeaveGroup_ LeaveGroup

	BlockUser_   BlockUser
	UnblockUser_ UnblockUser

	Vote_             Vote
	EditOwners_       EditOwners
	ControlGroup_     ControlGroup
	ChangeGroupPhoto_ ChangeGroupPhoto
	VKPayTransaction_ VKPayTransaction
	AppNotification_  AppNotification

	Donate_             Donate
	ProlongedDonate_    ProlongedDonate
	ExpiredDonate_      ExpiredDonate
	CancelDonate_       CancelDonate
	ChangeDonatePrice_  ChangeDonatePrice
	WithdrawMoney_      WithdrawMoney
	WithdrawMoneyError_ WithdrawMoneyError
}

func Create

func Create() Scenes

func (Scenes) AppNotification

func (scenes Scenes) AppNotification(appNotification AppNotification) Scenes

func (Scenes) ApplicationNotification

func (scenes Scenes) ApplicationNotification(appNotification AppNotification) Scenes

func (Scenes) Audio

func (scenes Scenes) Audio(audio Audio) Scenes

func (Scenes) BlockUser

func (scenes Scenes) BlockUser(blockUser BlockUser) Scenes

func (Scenes) BoardComment

func (scenes Scenes) BoardComment(boardComment BoardComment) Scenes

func (Scenes) Callback

func (scenes Scenes) Callback(callback Callback) Scenes

func (Scenes) CancelDonate

func (scenes Scenes) CancelDonate(cancelDonate CancelDonate) Scenes

func (Scenes) ChangeDonatePrice

func (scenes Scenes) ChangeDonatePrice(changeDonatePrice ChangeDonatePrice) Scenes

func (Scenes) ChangeGroupPhoto

func (scenes Scenes) ChangeGroupPhoto(changeGroupPhoto ChangeGroupPhoto) Scenes

func (Scenes) ControlGroup

func (scenes Scenes) ControlGroup(controlGroup ControlGroup) Scenes

func (Scenes) DeleteBoardComment

func (scenes Scenes) DeleteBoardComment(deleteBoardComment DeleteBoardComment) Scenes

func (Scenes) DeleteMarketComment

func (scenes Scenes) DeleteMarketComment(deleteMarketComment DeleteMarketComment) Scenes

func (Scenes) DeletePhotoComment

func (scenes Scenes) DeletePhotoComment(deletePhotoComment DeletePhotoComment) Scenes

func (Scenes) DeletePostComment

func (scenes Scenes) DeletePostComment(deletePostComment DeletePostComment) Scenes

func (Scenes) DeleteVideoComment

func (scenes Scenes) DeleteVideoComment(deleteVideoComment DeleteVideoComment) Scenes

func (Scenes) DisableMessage

func (scenes Scenes) DisableMessage(disableMessage DisableMessage) Scenes

func (Scenes) Donate

func (scenes Scenes) Donate(donate Donate) Scenes

func (Scenes) EditBoardComment

func (scenes Scenes) EditBoardComment(editBoardComment EditBoardComment) Scenes

func (Scenes) EditMarketComment

func (scenes Scenes) EditMarketComment(editMarketComment EditMarketComment) Scenes

func (Scenes) EditMessage

func (scenes Scenes) EditMessage(editMessage EditMessage) Scenes

func (Scenes) EditOrder

func (scenes Scenes) EditOrder(editOrderMarket EditOrderMarket) Scenes

func (Scenes) EditOrderMarket

func (scenes Scenes) EditOrderMarket(editOrderMarket EditOrderMarket) Scenes

func (Scenes) EditOwners

func (scenes Scenes) EditOwners(editOwners EditOwners) Scenes

func (Scenes) EditPhotoComment

func (scenes Scenes) EditPhotoComment(editPhotoComment EditPhotoComment) Scenes

func (Scenes) EditPostComment

func (scenes Scenes) EditPostComment(editPostComment EditPostComment) Scenes

func (Scenes) EditVideoComment

func (scenes Scenes) EditVideoComment(editVideoComment EditVideoComment) Scenes

func (Scenes) EnableMessage

func (scenes Scenes) EnableMessage(enableMessage EnableMessage) Scenes

func (Scenes) ExpiredDonate

func (scenes Scenes) ExpiredDonate(expiredDonate ExpiredDonate) Scenes

func (Scenes) JoinGroup

func (scenes Scenes) JoinGroup(joinGroup JoinGroup) Scenes

func (Scenes) LeaveGroup

func (scenes Scenes) LeaveGroup(leaveGroup LeaveGroup) Scenes

func (Scenes) Like

func (scenes Scenes) Like(like Like) Scenes

func (Scenes) MarketComment

func (scenes Scenes) MarketComment(marketComment MarketComment) Scenes

func (Scenes) Message

func (scenes Scenes) Message(message Message) Scenes

func (Scenes) OnAppNotification

func (scenes Scenes) OnAppNotification(appNotification AppNotification) Scenes

func (Scenes) OnApplicationNotification

func (scenes Scenes) OnApplicationNotification(appNotification AppNotification) Scenes

func (Scenes) OnAudio

func (scenes Scenes) OnAudio(audio Audio) Scenes

func (Scenes) OnBlockUser

func (scenes Scenes) OnBlockUser(blockUser BlockUser) Scenes

func (Scenes) OnBoardComment

func (scenes Scenes) OnBoardComment(boardComment BoardComment) Scenes

func (Scenes) OnCallback

func (scenes Scenes) OnCallback(callback Callback) Scenes

func (Scenes) OnCancelDonate

func (scenes Scenes) OnCancelDonate(cancelDonate CancelDonate) Scenes

func (Scenes) OnChangeDonatePrice

func (scenes Scenes) OnChangeDonatePrice(changeDonatePrice ChangeDonatePrice) Scenes

func (Scenes) OnChangeGroupPhoto

func (scenes Scenes) OnChangeGroupPhoto(changeGroupPhoto ChangeGroupPhoto) Scenes

func (Scenes) OnControlGroup

func (scenes Scenes) OnControlGroup(controlGroup ControlGroup) Scenes

func (Scenes) OnDeleteBoardComment

func (scenes Scenes) OnDeleteBoardComment(deleteBoardComment DeleteBoardComment) Scenes

func (Scenes) OnDeleteMarketComment

func (scenes Scenes) OnDeleteMarketComment(deleteMarketComment DeleteMarketComment) Scenes

func (Scenes) OnDeletePhotoComment

func (scenes Scenes) OnDeletePhotoComment(deletePhotoComment DeletePhotoComment) Scenes

func (Scenes) OnDeletePostComment

func (scenes Scenes) OnDeletePostComment(deletePostComment DeletePostComment) Scenes

func (Scenes) OnDeleteVideoComment

func (scenes Scenes) OnDeleteVideoComment(deleteVideoComment DeleteVideoComment) Scenes

func (Scenes) OnDisableMessage

func (scenes Scenes) OnDisableMessage(disableMessage DisableMessage) Scenes

func (Scenes) OnDonate

func (scenes Scenes) OnDonate(donate Donate) Scenes

func (Scenes) OnEditBoardComment

func (scenes Scenes) OnEditBoardComment(editBoardComment EditBoardComment) Scenes

func (Scenes) OnEditMarketComment

func (scenes Scenes) OnEditMarketComment(editMarketComment EditMarketComment) Scenes

func (Scenes) OnEditMessage

func (scenes Scenes) OnEditMessage(editMessage EditMessage) Scenes

func (Scenes) OnEditOrder

func (scenes Scenes) OnEditOrder(editOrderMarket EditOrderMarket) Scenes

func (Scenes) OnEditOrderMarket

func (scenes Scenes) OnEditOrderMarket(editOrderMarket EditOrderMarket) Scenes

func (Scenes) OnEditOwners

func (scenes Scenes) OnEditOwners(editOwners EditOwners) Scenes

func (Scenes) OnEditPhotoComment

func (scenes Scenes) OnEditPhotoComment(editPhotoComment EditPhotoComment) Scenes

func (Scenes) OnEditPostComment

func (scenes Scenes) OnEditPostComment(editPostComment EditPostComment) Scenes

func (Scenes) OnEditVideoComment

func (scenes Scenes) OnEditVideoComment(editVideoComment EditVideoComment) Scenes

func (Scenes) OnEnableMessage

func (scenes Scenes) OnEnableMessage(enableMessage EnableMessage) Scenes

func (Scenes) OnExpiredDonate

func (scenes Scenes) OnExpiredDonate(expiredDonate ExpiredDonate) Scenes

func (Scenes) OnJoinGroup

func (scenes Scenes) OnJoinGroup(joinGroup JoinGroup) Scenes

func (Scenes) OnLeaveGroup

func (scenes Scenes) OnLeaveGroup(leaveGroup LeaveGroup) Scenes

func (Scenes) OnLike

func (scenes Scenes) OnLike(like Like) Scenes

func (Scenes) OnMarketComment

func (scenes Scenes) OnMarketComment(marketComment MarketComment) Scenes

func (Scenes) OnMessage

func (scenes Scenes) OnMessage(message Message) Scenes

func (Scenes) OnOrder

func (scenes Scenes) OnOrder(orderMarket OrderMarket) Scenes

func (Scenes) OnOrderMarket

func (scenes Scenes) OnOrderMarket(orderMarket OrderMarket) Scenes

func (Scenes) OnPhoto

func (scenes Scenes) OnPhoto(photo Photo) Scenes

func (Scenes) OnPhotoComment

func (scenes Scenes) OnPhotoComment(photoComment PhotoComment) Scenes

func (Scenes) OnPost

func (scenes Scenes) OnPost(post Post) Scenes

func (Scenes) OnPostComment

func (scenes Scenes) OnPostComment(postComment PostComment) Scenes

func (Scenes) OnProlongedDonate

func (scenes Scenes) OnProlongedDonate(prolongedDonate ProlongedDonate) Scenes

func (Scenes) OnReplyMessage

func (scenes Scenes) OnReplyMessage(replyMessage ReplyMessage) Scenes

func (Scenes) OnRepost

func (scenes Scenes) OnRepost(repost Repost) Scenes

func (Scenes) OnRestoreBoardComment

func (scenes Scenes) OnRestoreBoardComment(restoreBoardComment RestoreBoardComment) Scenes

func (Scenes) OnRestoreMarketComment

func (scenes Scenes) OnRestoreMarketComment(restoreMarketComment RestoreMarketComment) Scenes

func (Scenes) OnRestorePhotoComment

func (scenes Scenes) OnRestorePhotoComment(restorePhotoComment RestorePhotoComment) Scenes

func (Scenes) OnRestorePostComment

func (scenes Scenes) OnRestorePostComment(restorePostComment RestorePostComment) Scenes

func (Scenes) OnRestoreVideoComment

func (scenes Scenes) OnRestoreVideoComment(restoreVideoComment RestoreVideoComment) Scenes

func (Scenes) OnTyping

func (scenes Scenes) OnTyping(typing Typing) Scenes

func (Scenes) OnUnblockUser

func (scenes Scenes) OnUnblockUser(unblockUser UnblockUser) Scenes

func (Scenes) OnUnlike

func (scenes Scenes) OnUnlike(unlike Unlike) Scenes

func (Scenes) OnVKPayTransaction

func (scenes Scenes) OnVKPayTransaction(transaction VKPayTransaction) Scenes

func (Scenes) OnVideo

func (scenes Scenes) OnVideo(video Video) Scenes

func (Scenes) OnVideoComment

func (scenes Scenes) OnVideoComment(videoComment VideoComment) Scenes

func (Scenes) OnVote

func (scenes Scenes) OnVote(vote Vote) Scenes

func (Scenes) OnWithdrawMoney

func (scenes Scenes) OnWithdrawMoney(withdrawMoney WithdrawMoney) Scenes

func (Scenes) OnWithdrawMoneyError

func (scenes Scenes) OnWithdrawMoneyError(withdrawMoneyError WithdrawMoneyError) Scenes

func (Scenes) Order

func (scenes Scenes) Order(orderMarket OrderMarket) Scenes

func (Scenes) OrderMarket

func (scenes Scenes) OrderMarket(orderMarket OrderMarket) Scenes

func (Scenes) Photo

func (scenes Scenes) Photo(photo Photo) Scenes

func (Scenes) PhotoComment

func (scenes Scenes) PhotoComment(photoComment PhotoComment) Scenes

func (Scenes) Post

func (scenes Scenes) Post(post Post) Scenes

func (Scenes) PostComment

func (scenes Scenes) PostComment(postComment PostComment) Scenes

func (Scenes) ProlongedDonate

func (scenes Scenes) ProlongedDonate(prolongedDonate ProlongedDonate) Scenes

func (Scenes) ReplyMessage

func (scenes Scenes) ReplyMessage(replyMessage ReplyMessage) Scenes

func (Scenes) Repost

func (scenes Scenes) Repost(repost Repost) Scenes

func (Scenes) RestoreBoardComment

func (scenes Scenes) RestoreBoardComment(restoreBoardComment RestoreBoardComment) Scenes

func (Scenes) RestoreMarketComment

func (scenes Scenes) RestoreMarketComment(restoreMarketComment RestoreMarketComment) Scenes

func (Scenes) RestorePhotoComment

func (scenes Scenes) RestorePhotoComment(restorePhotoComment RestorePhotoComment) Scenes

func (Scenes) RestorePostComment

func (scenes Scenes) RestorePostComment(restorePostComment RestorePostComment) Scenes

func (Scenes) RestoreVideoComment

func (scenes Scenes) RestoreVideoComment(restoreVideoComment RestoreVideoComment) Scenes

func (Scenes) Typing

func (scenes Scenes) Typing(typing Typing) Scenes

func (Scenes) UnblockUser

func (scenes Scenes) UnblockUser(unblockUser UnblockUser) Scenes

func (Scenes) Unlike

func (scenes Scenes) Unlike(unlike Unlike) Scenes

func (Scenes) VKPayTransaction

func (scenes Scenes) VKPayTransaction(transaction VKPayTransaction) Scenes

func (Scenes) Video

func (scenes Scenes) Video(video Video) Scenes

func (Scenes) VideoComment

func (scenes Scenes) VideoComment(videoComment VideoComment) Scenes

func (Scenes) Vote

func (scenes Scenes) Vote(vote Vote) Scenes

func (Scenes) WithdrawMoney

func (scenes Scenes) WithdrawMoney(withdrawMoney WithdrawMoney) Scenes

func (Scenes) WithdrawMoneyError

func (scenes Scenes) WithdrawMoneyError(withdrawMoneyError WithdrawMoneyError) Scenes

type Typing

type Typing func(*API.Bot, update.Typing)

type UnblockUser

type UnblockUser func(*API.Bot, update.UnblockUser)

type Unlike

type Unlike func(*API.Bot, update.Unlike)

type VKPayTransaction

type VKPayTransaction func(*API.Bot, update.VKPayTransaction)

type Video

type Video func(*API.Bot, update.Video)

type VideoComment

type VideoComment func(*API.Bot, update.VideoComment)

type Vote

type Vote func(*API.Bot, update.Vote)

type WithdrawMoney

type WithdrawMoney func(*API.Bot, update.WithdrawMoney)

type WithdrawMoneyError

type WithdrawMoneyError func(*API.Bot, update.WithdrawMoneyError)

Jump to

Keyboard shortcuts

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