mirror of
https://github.com/tucnak/telebot
synced 2024-11-12 19:10:26 +00:00
context: args used to return [""] of length 1
This commit is contained in:
parent
83bd8dd89d
commit
7e3a68249a
@ -261,7 +261,11 @@ func (c *nativeContext) Data() string {
|
||||
|
||||
func (c *nativeContext) Args() []string {
|
||||
if c.message != nil {
|
||||
return strings.Split(c.message.Payload, " ")
|
||||
message := strings.Trim(c.message.Payload, " ")
|
||||
if message == "" {
|
||||
return nil
|
||||
}
|
||||
return strings.Split(message, " ")
|
||||
}
|
||||
if c.callback != nil {
|
||||
return strings.Split(c.callback.Data, "|")
|
||||
|
Loading…
Reference in New Issue
Block a user