Compare commits
1 Commits
v1.0.0-bet
...
v1.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
| 7101aba548 |
@@ -88,10 +88,15 @@ func (d *Draft) Push(newText string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
func (d *Draft) Flush() error {
|
func (d *Draft) Flush() error {
|
||||||
|
if d.Message == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
params := tgapi.SendMessageP{
|
params := tgapi.SendMessageP{
|
||||||
ChatID: d.chatID,
|
ChatID: d.chatID,
|
||||||
ParseMode: d.parseMode,
|
ParseMode: d.parseMode,
|
||||||
Entities: d.entities,
|
Entities: d.entities,
|
||||||
|
Text: d.Message,
|
||||||
}
|
}
|
||||||
if d.messageThreadID > 0 {
|
if d.messageThreadID > 0 {
|
||||||
params.MessageThreadID = d.messageThreadID
|
params.MessageThreadID = d.messageThreadID
|
||||||
|
|||||||
@@ -110,6 +110,9 @@ func (ctx *MsgContext) answer(text string, keyboard *InlineKeyboard) *AnswerMess
|
|||||||
if ctx.Msg.MessageThreadID > 0 {
|
if ctx.Msg.MessageThreadID > 0 {
|
||||||
params.MessageThreadID = ctx.Msg.MessageThreadID
|
params.MessageThreadID = ctx.Msg.MessageThreadID
|
||||||
}
|
}
|
||||||
|
if ctx.Msg.DirectMessageTopic != nil {
|
||||||
|
params.DirectMessagesTopicID = ctx.Msg.DirectMessageTopic.TopicID
|
||||||
|
}
|
||||||
|
|
||||||
msg, err := ctx.Api.SendMessage(params)
|
msg, err := ctx.Api.SendMessage(params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ type SendMessageP struct {
|
|||||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||||
ChatID int `json:"chat_id"`
|
ChatID int `json:"chat_id"`
|
||||||
MessageThreadID int `json:"message_thread_id,omitempty"`
|
MessageThreadID int `json:"message_thread_id,omitempty"`
|
||||||
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
|
||||||
|
|
||||||
Text string `json:"text"`
|
Text string `json:"text"`
|
||||||
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
||||||
|
|||||||
@@ -6,11 +6,17 @@ type MessageReplyMarkup struct {
|
|||||||
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
|
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DirectMessageTopic struct {
|
||||||
|
TopicID int64 `json:"topic_id"`
|
||||||
|
User *User `json:"user,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type Message struct {
|
type Message struct {
|
||||||
MessageID int `json:"message_id"`
|
MessageID int `json:"message_id"`
|
||||||
MessageThreadID int `json:"message_thread_id,omitempty"`
|
MessageThreadID int `json:"message_thread_id,omitempty"`
|
||||||
BusinessConnectionId string `json:"business_connection_id,omitempty"`
|
DirectMessageTopic *DirectMessageTopic `json:"direct_message_topic,omitempty"`
|
||||||
From *User `json:"from,omitempty"`
|
BusinessConnectionId string `json:"business_connection_id,omitempty"`
|
||||||
|
From *User `json:"from,omitempty"`
|
||||||
|
|
||||||
SenderChat *Chat `json:"sender_chat,omitempty"`
|
SenderChat *Chat `json:"sender_chat,omitempty"`
|
||||||
SenderBoostCount int `json:"sender_boost_count,omitempty"`
|
SenderBoostCount int `json:"sender_boost_count,omitempty"`
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
const (
|
const (
|
||||||
VersionString = "1.0.0-beta.5"
|
VersionString = "1.0.0-beta.6"
|
||||||
VersionMajor = 1
|
VersionMajor = 1
|
||||||
VersionMinor = 0
|
VersionMinor = 0
|
||||||
VersionPatch = 0
|
VersionPatch = 0
|
||||||
Beta = 5
|
Beta = 6
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user