mirror of
https://github.com/c0re100/gotdlib.git
synced 2026-02-22 20:50:16 +01:00
Compare commits
No commits in common. "master" and "v1.6.0" have entirely different histories.
10 changed files with 1775 additions and 16990 deletions
|
|
@ -23,18 +23,22 @@ 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) {
|
||||||
cmd := text
|
var cmd string
|
||||||
|
|
||||||
// e.g. ["/hello 123", "/hell o 123"]
|
// e.g. ["/hello 123", "/hell o 123"]
|
||||||
// Result: "/hello", "/hell"
|
// Result: "/hello", "/hell"
|
||||||
if i := strings.Index(cmd, " "); i != -1 {
|
if i := strings.Index(text, " "); i != -1 {
|
||||||
cmd = cmd[:i]
|
cmd = text[: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(cmd, "@"); i != -1 {
|
if i := strings.Index(text, "@"); i != -1 {
|
||||||
cmd = cmd[:i]
|
cmd = text[:i]
|
||||||
|
}
|
||||||
|
|
||||||
|
if cmd == "" {
|
||||||
|
return text
|
||||||
}
|
}
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
|
|
|
||||||
3511
client/function.go
3511
client/function.go
File diff suppressed because it is too large
Load diff
8755
client/type.go
8755
client/type.go
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
2732
data/td_api.tl
2732
data/td_api.tl
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
Before Width: | Height: | Size: 794 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 900 KiB |
|
|
@ -101,7 +101,7 @@ func main() {
|
||||||
},
|
},
|
||||||
InputMessageContent: &tdlib.InputMessagePhoto{
|
InputMessageContent: &tdlib.InputMessagePhoto{
|
||||||
Photo: &tdlib.InputFileLocal{
|
Photo: &tdlib.InputFileLocal{
|
||||||
Path: "./Meru_01.png",
|
Path: "./myht9-1486821485193084928.jpg",
|
||||||
},
|
},
|
||||||
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: "./Meru_01.png",
|
Path: "./myht9-1486821485193084928.jpg",
|
||||||
},
|
},
|
||||||
Caption: text,
|
Caption: text,
|
||||||
},
|
},
|
||||||
&tdlib.InputMessagePhoto{
|
&tdlib.InputMessagePhoto{
|
||||||
Photo: &tdlib.InputFileLocal{
|
Photo: &tdlib.InputFileLocal{
|
||||||
Path: "./Meru_02.png",
|
Path: "./hisagi_02-1486983199280738309.jpg",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
BIN
example/media/hisagi_02-1486983199280738309.jpg
Normal file
BIN
example/media/hisagi_02-1486983199280738309.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 153 KiB |
BIN
example/media/myht9-1486821485193084928.jpg
Normal file
BIN
example/media/myht9-1486821485193084928.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 116 KiB |
Loading…
Add table
Add a link
Reference in a new issue