Files
Codex 2b0da9f508 Support Codex 0.134 approvals
Use available approval decisions from the app-server schema, preserve structured policy decisions in callbacks, and keep approval rendering aligned with normal tool-call output.

Also simplify thread commands, clear stale active turns more carefully, and update command/help docs.
2026-05-28 09:39:40 +00:00

82 lines
2.2 KiB
Go

package telegram
type Update struct {
UpdateID int `json:"update_id"`
Message *Message `json:"message,omitempty"`
CallbackQuery *CallbackQuery `json:"callback_query,omitempty"`
}
type User struct {
ID int64 `json:"id"`
IsBot bool `json:"is_bot"`
FirstName string `json:"first_name,omitempty"`
Username string `json:"username,omitempty"`
}
type Chat struct {
ID int64 `json:"id"`
Type string `json:"type"`
}
type Message struct {
MessageID int `json:"message_id"`
From *User `json:"from,omitempty"`
Chat Chat `json:"chat"`
Text string `json:"text,omitempty"`
Caption string `json:"caption,omitempty"`
Document *Document `json:"document,omitempty"`
Photo []PhotoSize `json:"photo,omitempty"`
PinnedMessage *Message `json:"pinned_message,omitempty"`
}
type Document struct {
FileID string `json:"file_id"`
FileName string `json:"file_name,omitempty"`
MimeType string `json:"mime_type,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
}
type PhotoSize struct {
FileID string `json:"file_id"`
FileSize int64 `json:"file_size,omitempty"`
Width int `json:"width"`
Height int `json:"height"`
}
type CallbackQuery struct {
ID string `json:"id"`
From User `json:"from"`
Message *Message `json:"message,omitempty"`
Data string `json:"data,omitempty"`
}
type File struct {
FileID string `json:"file_id"`
FilePath string `json:"file_path,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
}
type InlineKeyboardMarkup struct {
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
}
type InlineKeyboardButton struct {
Text string `json:"text"`
CallbackData string `json:"callback_data,omitempty"`
}
type SendMessageOptions struct {
ParseMode string `json:"parse_mode,omitempty"`
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
type EditMessageTextOptions struct {
ParseMode string `json:"parse_mode,omitempty"`
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
type BotCommand struct {
Command string `json:"command"`
Description string `json:"description"`
}