Compare commits

..

8 commits

Author SHA1 Message Date
c0re100
c9c7701a0d
Change example photo
before GitHub kill me :')
2026-02-13 03:55:26 +08:00
c0re100
0f088c4101
Update to TDLib 1.8.61 2026-02-09 22:29:28 +08:00
c0re100
c1bd67f199
Update to TDLib 1.8.60 2026-01-08 03:52:10 +08:00
c0re100
4597e26403
Update to TDLib 1.8.56 2025-10-16 00:27:32 +08:00
c0re100
926224f707
Update to TDLib 1.8.55 2025-09-28 17:55:16 +08:00
c0re100
9b94728dda
Update to TDLib 1.8.54 2025-09-19 19:09:58 +08:00
c0re100
14418433a4
Update to TDLib 1.8.52 2025-09-02 19:11:19 +08:00
c0re100
5c5078ec42
Fix command parser 2025-09-02 18:58:30 +08:00
10 changed files with 15829 additions and 1751 deletions

View file

@ -23,22 +23,18 @@ func IsCommand(text string) bool {
func CheckCommand(text string, entities []*TextEntity) string { func CheckCommand(text string, entities []*TextEntity) string {
if IsCommand(text) { if IsCommand(text) {
var cmd string cmd := text
// e.g. ["/hello 123", "/hell o 123"] // e.g. ["/hello 123", "/hell o 123"]
// Result: "/hello", "/hell" // Result: "/hello", "/hell"
if i := strings.Index(text, " "); i != -1 { if i := strings.Index(cmd, " "); i != -1 {
cmd = text[:i] cmd = cmd[:i]
} }
// e.g.: ["/hello@world_bot", "/hello@", "/hello@123"] // e.g.: ["/hello@world_bot", "/hello@", "/hello@123"]
// Result: "/hello" // Result: "/hello"
if i := strings.Index(text, "@"); i != -1 { if i := strings.Index(cmd, "@"); i != -1 {
cmd = text[:i] cmd = cmd[:i]
}
if cmd == "" {
return text
} }
return cmd return cmd

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

BIN
example/media/Meru_01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 KiB

BIN
example/media/Meru_02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 KiB

View file

@ -101,7 +101,7 @@ func main() {
}, },
InputMessageContent: &tdlib.InputMessagePhoto{ InputMessageContent: &tdlib.InputMessagePhoto{
Photo: &tdlib.InputFileLocal{ Photo: &tdlib.InputFileLocal{
Path: "./myht9-1486821485193084928.jpg", Path: "./Meru_01.png",
}, },
Caption: text, Caption: text,
}, },
@ -123,13 +123,13 @@ func main() {
InputMessageContents: []tdlib.InputMessageContent{ InputMessageContents: []tdlib.InputMessageContent{
&tdlib.InputMessagePhoto{ &tdlib.InputMessagePhoto{
Photo: &tdlib.InputFileLocal{ Photo: &tdlib.InputFileLocal{
Path: "./myht9-1486821485193084928.jpg", Path: "./Meru_01.png",
}, },
Caption: text, Caption: text,
}, },
&tdlib.InputMessagePhoto{ &tdlib.InputMessagePhoto{
Photo: &tdlib.InputFileLocal{ Photo: &tdlib.InputFileLocal{
Path: "./hisagi_02-1486983199280738309.jpg", Path: "./Meru_02.png",
}, },
}, },
}, },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB