mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-09 20:50:23 +08:00
fix dms
This commit is contained in:
@@ -82,6 +82,9 @@ func (ctx *Ctx) Send(replytosender bool, post *MessagePost) (*Message, error) {
|
|||||||
MessageID: msg.ID,
|
MessageID: msg.ID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if msg.SrcGuildID != "" { // dms
|
||||||
|
return ctx.Caller.PostMessageToUser(msg.GuildID, post)
|
||||||
|
}
|
||||||
return ctx.Caller.PostMessageToChannel(msg.ChannelID, post)
|
return ctx.Caller.PostMessageToChannel(msg.ChannelID, post)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,6 +100,9 @@ func (ctx *Ctx) SendPlainMessage(replytosender bool, printable ...any) (*Message
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
post.Content = fmt.Sprint(printable...)
|
post.Content = fmt.Sprint(printable...)
|
||||||
|
if msg.SrcGuildID != "" { // dms
|
||||||
|
return ctx.Caller.PostMessageToUser(msg.GuildID, post)
|
||||||
|
}
|
||||||
return ctx.Caller.PostMessageToChannel(msg.ChannelID, post)
|
return ctx.Caller.PostMessageToChannel(msg.ChannelID, post)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,6 +123,9 @@ func (ctx *Ctx) SendImage(file string, replytosender bool, caption ...any) (*Mes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
post.Content = fmt.Sprint(caption...)
|
post.Content = fmt.Sprint(caption...)
|
||||||
|
if msg.SrcGuildID != "" { // dms
|
||||||
|
return ctx.Caller.PostMessageToUser(msg.GuildID, post)
|
||||||
|
}
|
||||||
return ctx.Caller.PostMessageToChannel(msg.ChannelID, post)
|
return ctx.Caller.PostMessageToChannel(msg.ChannelID, post)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ func (m *Message) String() string {
|
|||||||
sb.WriteByte('[')
|
sb.WriteByte('[')
|
||||||
sb.WriteString(m.SeqInChannel)
|
sb.WriteString(m.SeqInChannel)
|
||||||
sb.WriteByte(']')
|
sb.WriteByte(']')
|
||||||
|
sb.WriteString(m.ID)
|
||||||
sb.WriteString(" ギルド: ")
|
sb.WriteString(" ギルド: ")
|
||||||
sb.WriteString(m.GuildID)
|
sb.WriteString(m.GuildID)
|
||||||
if m.SrcGuildID != "" {
|
if m.SrcGuildID != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user