- Fixed a Nil Pointer Bug

pull/216/head
AliMVP 7 years ago
parent 82ebc38734
commit 789767cb14
  1. 6
      types.go

@ -178,7 +178,11 @@ func (m *Message) Time() time.Time {
// IsCommand returns true if message starts with a "bot_command" entity.
func (m *Message) IsCommand() bool {
if m.Entities == nil || len(*m.Entities) == 0 {
lenEntities := 0
if m.Entities != nil {
lenEntities = len(*m.Entities)
}
if m.Entities == nil || lenEntities == 0 {
return false
}