Documentation ¶
Overview ¶
Package participants contains channel participants iteration helper.
Index ¶
- type Elem
- type GetParticipantsQueryBuilder
- func (b *GetParticipantsQueryBuilder) Admins() *GetParticipantsQueryBuilder
- func (b *GetParticipantsQueryBuilder) Banned(paramQ string) *GetParticipantsQueryBuilder
- func (b *GetParticipantsQueryBuilder) BatchSize(batchSize int) *GetParticipantsQueryBuilder
- func (b *GetParticipantsQueryBuilder) Bots() *GetParticipantsQueryBuilder
- func (b *GetParticipantsQueryBuilder) Channel(paramChannel tg.InputChannelClass) *GetParticipantsQueryBuilder
- func (b *GetParticipantsQueryBuilder) Collect(ctx context.Context) ([]Elem, error)
- func (b *GetParticipantsQueryBuilder) Contacts(paramQ string) *GetParticipantsQueryBuilder
- func (b *GetParticipantsQueryBuilder) Count(ctx context.Context) (int, error)
- func (b *GetParticipantsQueryBuilder) Filter(paramFilter tg.ChannelParticipantsFilterClass) *GetParticipantsQueryBuilder
- func (b *GetParticipantsQueryBuilder) ForEach(ctx context.Context, cb func(context.Context, Elem) error) error
- func (b *GetParticipantsQueryBuilder) Iter() *Iterator
- func (b *GetParticipantsQueryBuilder) Kicked(paramQ string) *GetParticipantsQueryBuilder
- func (b *GetParticipantsQueryBuilder) Mentions(paramQ string, paramTopMsgID int) *GetParticipantsQueryBuilder
- func (b *GetParticipantsQueryBuilder) Query(ctx context.Context, req Request) (tg.ChannelsChannelParticipantsClass, error)
- func (b *GetParticipantsQueryBuilder) Recent() *GetParticipantsQueryBuilder
- func (b *GetParticipantsQueryBuilder) Search(paramQ string) *GetParticipantsQueryBuilder
- type Iterator
- type Query
- type QueryBuilder
- type QueryFunc
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Elem ¶
type Elem struct { Participant tg.ChannelParticipantClass Entities peer.Entities }
Elem is a channel participants iterator element.
func (Elem) Admin ¶
Admin returns participant user object and meta info if participant is admin of channel.
func (Elem) Creator ¶
Creator returns participant user object and meta info if participant is a creator of channel.
func (Elem) UserPhotos ¶
UserPhotos returns new user photo query builder for participant.
type GetParticipantsQueryBuilder ¶
type GetParticipantsQueryBuilder struct {
// contains filtered or unexported fields
}
GetParticipantsQueryBuilder is query builder of ChannelsGetParticipants.
func (*GetParticipantsQueryBuilder) Admins ¶
func (b *GetParticipantsQueryBuilder) Admins() *GetParticipantsQueryBuilder
Admins sets Filter field of GetParticipants query.
func (*GetParticipantsQueryBuilder) Banned ¶
func (b *GetParticipantsQueryBuilder) Banned(paramQ string) *GetParticipantsQueryBuilder
Banned sets Filter field of GetParticipants query.
func (*GetParticipantsQueryBuilder) BatchSize ¶
func (b *GetParticipantsQueryBuilder) BatchSize(batchSize int) *GetParticipantsQueryBuilder
BatchSize sets buffer of message loaded from one request. Be carefully, when set this limit, because Telegram does not return error if limit is too big, so results can be incorrect.
func (*GetParticipantsQueryBuilder) Bots ¶
func (b *GetParticipantsQueryBuilder) Bots() *GetParticipantsQueryBuilder
Bots sets Filter field of GetParticipants query.
func (*GetParticipantsQueryBuilder) Channel ¶
func (b *GetParticipantsQueryBuilder) Channel(paramChannel tg.InputChannelClass) *GetParticipantsQueryBuilder
Channel sets Channel field of GetParticipants query.
func (*GetParticipantsQueryBuilder) Collect ¶
func (b *GetParticipantsQueryBuilder) Collect(ctx context.Context) ([]Elem, error)
Collect creates iterator and collects all elements to slice.
func (*GetParticipantsQueryBuilder) Contacts ¶
func (b *GetParticipantsQueryBuilder) Contacts(paramQ string) *GetParticipantsQueryBuilder
Contacts sets Filter field of GetParticipants query.
func (*GetParticipantsQueryBuilder) Count ¶
func (b *GetParticipantsQueryBuilder) Count(ctx context.Context) (int, error)
Count fetches remote state to get number of elements.
func (*GetParticipantsQueryBuilder) Filter ¶
func (b *GetParticipantsQueryBuilder) Filter(paramFilter tg.ChannelParticipantsFilterClass) *GetParticipantsQueryBuilder
Filter sets Filter field of GetParticipants query.
func (*GetParticipantsQueryBuilder) ForEach ¶
func (b *GetParticipantsQueryBuilder) ForEach(ctx context.Context, cb func(context.Context, Elem) error) error
ForEach calls given callback on each iterator element.
func (*GetParticipantsQueryBuilder) Iter ¶
func (b *GetParticipantsQueryBuilder) Iter() *Iterator
Iter returns iterator using built query.
func (*GetParticipantsQueryBuilder) Kicked ¶
func (b *GetParticipantsQueryBuilder) Kicked(paramQ string) *GetParticipantsQueryBuilder
Kicked sets Filter field of GetParticipants query.
func (*GetParticipantsQueryBuilder) Mentions ¶
func (b *GetParticipantsQueryBuilder) Mentions(paramQ string, paramTopMsgID int) *GetParticipantsQueryBuilder
Mentions sets Filter field of GetParticipants query.
func (*GetParticipantsQueryBuilder) Query ¶
func (b *GetParticipantsQueryBuilder) Query(ctx context.Context, req Request) (tg.ChannelsChannelParticipantsClass, error)
Query implements Query interface.
func (*GetParticipantsQueryBuilder) Recent ¶
func (b *GetParticipantsQueryBuilder) Recent() *GetParticipantsQueryBuilder
Recent sets Filter field of GetParticipants query.
func (*GetParticipantsQueryBuilder) Search ¶
func (b *GetParticipantsQueryBuilder) Search(paramQ string) *GetParticipantsQueryBuilder
Search sets Filter field of GetParticipants query.
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator is a channel participants stream iterator.
func NewIterator ¶
NewIterator creates new iterator.
func (*Iterator) FetchTotal ¶
FetchTotal fetches and returns count of elements.
func (*Iterator) Next ¶
Next prepares the next message for reading with the Value method.
Returns true on success, or false if there is no next message or an error happened while preparing it. Err should be consulted to distinguish between the two cases.
type Query ¶
type Query interface {
Query(ctx context.Context, req Request) (tg.ChannelsChannelParticipantsClass, error)
}
Query is an abstraction for participants request. NB: iterator mutates returned data (sorts, at least).
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
QueryBuilder is a helper to create message queries.
func NewQueryBuilder ¶
func NewQueryBuilder(raw *tg.Client) *QueryBuilder
NewQueryBuilder creates new QueryBuilder.
func (*QueryBuilder) GetParticipants ¶
func (q *QueryBuilder) GetParticipants(paramChannel tg.InputChannelClass) *GetParticipantsQueryBuilder
GetParticipants creates query builder of ChannelsGetParticipants.