Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterMessagesServer(s grpc.ServiceRegistrar, srv MessagesServer)
- type MessageRequest
- func (*MessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *MessageRequest) GetDisableNotification() bool
- func (x *MessageRequest) GetParseMode() string
- func (x *MessageRequest) GetProtectContent() bool
- func (x *MessageRequest) GetText() string
- func (*MessageRequest) ProtoMessage()
- func (x *MessageRequest) ProtoReflect() protoreflect.Message
- func (x *MessageRequest) Reset()
- func (x *MessageRequest) String() string
- type MessagesClient
- type MessagesServer
- type SendMessageRequest
- func (*SendMessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageRequest) GetBotName() string
- func (x *SendMessageRequest) GetChatName() string
- func (x *SendMessageRequest) GetMessage() *MessageRequest
- func (*SendMessageRequest) ProtoMessage()
- func (x *SendMessageRequest) ProtoReflect() protoreflect.Message
- func (x *SendMessageRequest) Reset()
- func (x *SendMessageRequest) String() string
- type SendMessageResponse
- func (*SendMessageResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SendMessageResponse) GetOk() bool
- func (x *SendMessageResponse) GetResult() *TgMessage
- func (*SendMessageResponse) ProtoMessage()
- func (x *SendMessageResponse) ProtoReflect() protoreflect.Message
- func (x *SendMessageResponse) Reset()
- func (x *SendMessageResponse) String() string
- type TgChat
- func (*TgChat) Descriptor() ([]byte, []int)deprecated
- func (x *TgChat) GetFirstName() string
- func (x *TgChat) GetId() int64
- func (x *TgChat) GetIsForum() bool
- func (x *TgChat) GetLastName() string
- func (x *TgChat) GetTitle() string
- func (x *TgChat) GetType() string
- func (*TgChat) ProtoMessage()
- func (x *TgChat) ProtoReflect() protoreflect.Message
- func (x *TgChat) Reset()
- func (x *TgChat) String() string
- type TgMessage
- func (*TgMessage) Descriptor() ([]byte, []int)deprecated
- func (x *TgMessage) GetChat() *TgChat
- func (x *TgMessage) GetDate() uint64
- func (x *TgMessage) GetFrom() *TgUser
- func (x *TgMessage) GetMessageId() int64
- func (x *TgMessage) GetMessageThreadId() int64
- func (*TgMessage) ProtoMessage()
- func (x *TgMessage) ProtoReflect() protoreflect.Message
- func (x *TgMessage) Reset()
- func (x *TgMessage) String() string
- type TgUser
- func (*TgUser) Descriptor() ([]byte, []int)deprecated
- func (x *TgUser) GetAddedToAttachmentMenu() bool
- func (x *TgUser) GetCanConnectToBusiness() bool
- func (x *TgUser) GetCanJoinGroups() bool
- func (x *TgUser) GetCanReadAllGroupMessages() bool
- func (x *TgUser) GetFirstName() string
- func (x *TgUser) GetId() int64
- func (x *TgUser) GetIsBot() bool
- func (x *TgUser) GetIsPremium() bool
- func (x *TgUser) GetLanguageCode() string
- func (x *TgUser) GetLastName() string
- func (x *TgUser) GetSupportsInlineQueries() bool
- func (x *TgUser) GetUsername() string
- func (*TgUser) ProtoMessage()
- func (x *TgUser) ProtoReflect() protoreflect.Message
- func (x *TgUser) Reset()
- func (x *TgUser) String() string
- type UnimplementedMessagesServer
- type UnsafeMessagesServer
Constants ¶
const (
Messages_Send_FullMethodName = "/tgnotifier.Messages/Send"
)
Variables ¶
var File_tgnotifier_proto protoreflect.FileDescriptor
var Messages_ServiceDesc = grpc.ServiceDesc{ ServiceName: "tgnotifier.Messages", HandlerType: (*MessagesServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Send", Handler: _Messages_Send_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "tgnotifier.proto", }
Messages_ServiceDesc is the grpc.ServiceDesc for Messages service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMessagesServer ¶
func RegisterMessagesServer(s grpc.ServiceRegistrar, srv MessagesServer)
Types ¶
type MessageRequest ¶
type MessageRequest struct { // Message text content. Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // Text parsing mode (MarkdownV2|HTML). // See API doc for more info: https://core.telegram.org/bots/api#formatting-options ParseMode string `protobuf:"bytes,2,opt,name=parse_mode,proto3" json:"parse_mode,omitempty"` // Send message without a notification. DisableNotification bool `protobuf:"varint,3,opt,name=disable_notification,proto3" json:"disable_notification,omitempty"` // Restrict message forwarding and copying. ProtectContent bool `protobuf:"varint,4,opt,name=protect_content,proto3" json:"protect_content,omitempty"` // contains filtered or unexported fields }
func (*MessageRequest) Descriptor
deprecated
func (*MessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use MessageRequest.ProtoReflect.Descriptor instead.
func (*MessageRequest) GetDisableNotification ¶
func (x *MessageRequest) GetDisableNotification() bool
func (*MessageRequest) GetParseMode ¶
func (x *MessageRequest) GetParseMode() string
func (*MessageRequest) GetProtectContent ¶
func (x *MessageRequest) GetProtectContent() bool
func (*MessageRequest) GetText ¶
func (x *MessageRequest) GetText() string
func (*MessageRequest) ProtoMessage ¶
func (*MessageRequest) ProtoMessage()
func (*MessageRequest) ProtoReflect ¶
func (x *MessageRequest) ProtoReflect() protoreflect.Message
func (*MessageRequest) Reset ¶
func (x *MessageRequest) Reset()
func (*MessageRequest) String ¶
func (x *MessageRequest) String() string
type MessagesClient ¶
type MessagesClient interface { // Send message via the Telegram API. Send(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*SendMessageResponse, error) }
MessagesClient is the client API for Messages service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
Messages is a service to handle the send messages requests.
func NewMessagesClient ¶
func NewMessagesClient(cc grpc.ClientConnInterface) MessagesClient
type MessagesServer ¶
type MessagesServer interface { // Send message via the Telegram API. Send(context.Context, *SendMessageRequest) (*SendMessageResponse, error) // contains filtered or unexported methods }
MessagesServer is the server API for Messages service. All implementations must embed UnimplementedMessagesServer for forward compatibility.
Messages is a service to handle the send messages requests.
type SendMessageRequest ¶
type SendMessageRequest struct { // bot_name is a name of the bot from the tgnotifier config; // could be omitted to send message from a bot, defined as a default. BotName string `protobuf:"bytes,1,opt,name=bot_name,proto3" json:"bot_name,omitempty"` // chat_name name of the chat from the tgnotifier config; // could be omitted to send message to a chat, defined as a default. ChatName string `protobuf:"bytes,2,opt,name=chat_name,proto3" json:"chat_name,omitempty"` Message *MessageRequest `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*SendMessageRequest) Descriptor
deprecated
func (*SendMessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageRequest.ProtoReflect.Descriptor instead.
func (*SendMessageRequest) GetBotName ¶
func (x *SendMessageRequest) GetBotName() string
func (*SendMessageRequest) GetChatName ¶
func (x *SendMessageRequest) GetChatName() string
func (*SendMessageRequest) GetMessage ¶
func (x *SendMessageRequest) GetMessage() *MessageRequest
func (*SendMessageRequest) ProtoMessage ¶
func (*SendMessageRequest) ProtoMessage()
func (*SendMessageRequest) ProtoReflect ¶
func (x *SendMessageRequest) ProtoReflect() protoreflect.Message
func (*SendMessageRequest) Reset ¶
func (x *SendMessageRequest) Reset()
func (*SendMessageRequest) String ¶
func (x *SendMessageRequest) String() string
type SendMessageResponse ¶
type SendMessageResponse struct { Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"` Result *TgMessage `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*SendMessageResponse) Descriptor
deprecated
func (*SendMessageResponse) Descriptor() ([]byte, []int)
Deprecated: Use SendMessageResponse.ProtoReflect.Descriptor instead.
func (*SendMessageResponse) GetOk ¶
func (x *SendMessageResponse) GetOk() bool
func (*SendMessageResponse) GetResult ¶
func (x *SendMessageResponse) GetResult() *TgMessage
func (*SendMessageResponse) ProtoMessage ¶
func (*SendMessageResponse) ProtoMessage()
func (*SendMessageResponse) ProtoReflect ¶
func (x *SendMessageResponse) ProtoReflect() protoreflect.Message
func (*SendMessageResponse) Reset ¶
func (x *SendMessageResponse) Reset()
func (*SendMessageResponse) String ¶
func (x *SendMessageResponse) String() string
type TgChat ¶ added in v1.0.1
type TgChat struct { // Unique identifier for this chat. // This number may have more than 32 significant bits and some programming languages // may have difficulty/silent defects in interpreting it. // But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type // are safe for storing this identifier. Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Type of the chat, can be either “private”, “group”, “supergroup” or “channel”. Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // Optional. Title, for supergroups, channels and group chats. Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` // Optional. First name of the other party in a private chat. FirstName string `protobuf:"bytes,4,opt,name=first_name,proto3" json:"first_name,omitempty"` // Optional. Last name of the other party in a private chat. LastName string `protobuf:"bytes,5,opt,name=last_name,proto3" json:"last_name,omitempty"` // Optional. True, if the supergroup chat is a forum (has topics enabled). IsForum bool `protobuf:"varint,6,opt,name=is_forum,proto3" json:"is_forum,omitempty"` // contains filtered or unexported fields }
TgChat is a model representing the Telegram API chat object. See: https://core.telegram.org/bots/api#chat
func (*TgChat) Descriptor
deprecated
added in
v1.0.1
func (*TgChat) GetFirstName ¶ added in v1.0.1
func (*TgChat) GetIsForum ¶ added in v1.0.1
func (*TgChat) GetLastName ¶ added in v1.0.1
func (*TgChat) ProtoMessage ¶ added in v1.0.1
func (*TgChat) ProtoMessage()
func (*TgChat) ProtoReflect ¶ added in v1.0.1
func (x *TgChat) ProtoReflect() protoreflect.Message
type TgMessage ¶
type TgMessage struct { MessageId int64 `protobuf:"varint,1,opt,name=message_id,proto3" json:"message_id,omitempty"` Date uint64 `protobuf:"varint,2,opt,name=date,proto3" json:"date,omitempty"` MessageThreadId int64 `protobuf:"varint,3,opt,name=message_thread_id,proto3" json:"message_thread_id,omitempty"` From *TgUser `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"` Chat *TgChat `protobuf:"bytes,5,opt,name=chat,proto3" json:"chat,omitempty"` // contains filtered or unexported fields }
TgMessage is a sent message object, returned from the Telegram API. See doc for fields reference: https://core.telegram.org/bots/api#message
func (*TgMessage) Descriptor
deprecated
func (*TgMessage) GetMessageId ¶
func (*TgMessage) GetMessageThreadId ¶
func (*TgMessage) ProtoMessage ¶
func (*TgMessage) ProtoMessage()
func (*TgMessage) ProtoReflect ¶
func (x *TgMessage) ProtoReflect() protoreflect.Message
type TgUser ¶
type TgUser struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` FirstName string `protobuf:"bytes,2,opt,name=first_name,proto3" json:"first_name,omitempty"` LastName string `protobuf:"bytes,3,opt,name=last_name,proto3" json:"last_name,omitempty"` Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` LanguageCode string `protobuf:"bytes,5,opt,name=language_code,proto3" json:"language_code,omitempty"` IsBot bool `protobuf:"varint,6,opt,name=is_bot,proto3" json:"is_bot,omitempty"` IsPremium bool `protobuf:"varint,7,opt,name=is_premium,proto3" json:"is_premium,omitempty"` AddedToAttachmentMenu bool `protobuf:"varint,8,opt,name=added_to_attachment_menu,proto3" json:"added_to_attachment_menu,omitempty"` CanJoinGroups bool `protobuf:"varint,9,opt,name=can_join_groups,proto3" json:"can_join_groups,omitempty"` CanReadAllGroupMessages bool `protobuf:"varint,10,opt,name=can_read_all_group_messages,proto3" json:"can_read_all_group_messages,omitempty"` SupportsInlineQueries bool `protobuf:"varint,11,opt,name=supports_inline_queries,proto3" json:"supports_inline_queries,omitempty"` CanConnectToBusiness bool `protobuf:"varint,12,opt,name=can_connect_to_business,proto3" json:"can_connect_to_business,omitempty"` // contains filtered or unexported fields }
TgUser is a model of the Telegram User. See https://core.telegram.org/bots/api#user
func (*TgUser) Descriptor
deprecated
func (*TgUser) GetAddedToAttachmentMenu ¶
func (*TgUser) GetCanConnectToBusiness ¶
func (*TgUser) GetCanJoinGroups ¶
func (*TgUser) GetCanReadAllGroupMessages ¶
func (*TgUser) GetFirstName ¶
func (*TgUser) GetIsPremium ¶
func (*TgUser) GetLanguageCode ¶
func (*TgUser) GetLastName ¶
func (*TgUser) GetSupportsInlineQueries ¶
func (*TgUser) GetUsername ¶
func (*TgUser) ProtoMessage ¶
func (*TgUser) ProtoMessage()
func (*TgUser) ProtoReflect ¶
func (x *TgUser) ProtoReflect() protoreflect.Message
type UnimplementedMessagesServer ¶
type UnimplementedMessagesServer struct{}
UnimplementedMessagesServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedMessagesServer) Send ¶
func (UnimplementedMessagesServer) Send(context.Context, *SendMessageRequest) (*SendMessageResponse, error)
type UnsafeMessagesServer ¶
type UnsafeMessagesServer interface {
// contains filtered or unexported methods
}
UnsafeMessagesServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MessagesServer will result in compilation errors.