|
@@ -316,7 +316,7 @@ func (mi *messageInput) expandMentions(c *discord.Channel, src []byte) []byte {
|
|
|
}
|
|
}
|
|
|
// self ping
|
|
// self ping
|
|
|
me, _ := state.Cabinet.Me()
|
|
me, _ := state.Cabinet.Me()
|
|
|
- if strings.EqualFold(me.Username, name) {
|
|
|
|
|
|
|
+ if me != nil && strings.EqualFold(me.Username, name) {
|
|
|
return []byte(me.ID.Mention())
|
|
return []byte(me.ID.Mention())
|
|
|
}
|
|
}
|
|
|
return output
|
|
return output
|
|
@@ -408,7 +408,9 @@ func (mi *messageInput) tabSuggestion() {
|
|
|
shown = make(map[string]struct{})
|
|
shown = make(map[string]struct{})
|
|
|
// Don't show @me in the list of recent authors
|
|
// Don't show @me in the list of recent authors
|
|
|
me, _ := mi.chat.state.Cabinet.Me()
|
|
me, _ := mi.chat.state.Cabinet.Me()
|
|
|
- shown[me.Username] = userDone
|
|
|
|
|
|
|
+ if me != nil {
|
|
|
|
|
+ shown[me.Username] = userDone
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// DMs have recipients, not members
|
|
// DMs have recipients, not members
|
|
@@ -428,7 +430,9 @@ func (mi *messageInput) tabSuggestion() {
|
|
|
} else {
|
|
} else {
|
|
|
users := selected.DMRecipients
|
|
users := selected.DMRecipients
|
|
|
me, _ := mi.chat.state.Cabinet.Me()
|
|
me, _ := mi.chat.state.Cabinet.Me()
|
|
|
- users = append(users, *me)
|
|
|
|
|
|
|
+ if me != nil {
|
|
|
|
|
+ users = append(users, *me)
|
|
|
|
|
+ }
|
|
|
res := fuzzy.FindFrom(name, userList(users))
|
|
res := fuzzy.FindFrom(name, userList(users))
|
|
|
for _, r := range res {
|
|
for _, r := range res {
|
|
|
mi.addMentionUser(&users[r.Index])
|
|
mi.addMentionUser(&users[r.Index])
|