Quoting now escapes and to avoid pissing everyone off
MODIFY
discordutil/message.go
discordutil/message.go
@@ -232,3 +232,16 @@ func ResolveFilePathAndSendFile(session *discordgo.Session, message, targetChann
_, sendError := session.ChannelFileSend(targetChannelID, filepath.Base(message), reader)
return sendError
}
+
+// ReplaceMentions replaces both user mentions and global mentions like @here
+// and @everyone.
+func ReplaceMentions(message *discordgo.Message) string {
+ replaceInstructions := make([]string, 0, len(message.Mentions)+4)
+ replaceInstructions = append(replaceInstructions, "@here", "@\u200Bhere", "@everyone", "@\u200Beveryone")
+ for _, user := range message.Mentions {
+ replaceInstructions = append(replaceInstructions,
+ "<@"+user.ID+">", "@"+user.Username,
+ "<@!"+user.ID+">", "@"+user.Username)
+ }
+ return strings.NewReplacer(replaceInstructions...).Replace(message.Content)
+}

MODIFY
ui/window.go
ui/window.go
@@ -1194,7 +1194,9 @@ func getUsernameForQuote(state *discordgo.State, message *discordgo.Message) str
func (window *Window) insertQuoteOfMessage(message *discordgo.Message) {
username := getUsernameForQuote(window.session.State, message)
- quotedMessage, generateError := discordutil.GenerateQuote(message.ContentWithMentionsReplaced(), username, message.Timestamp, message.Attachments, window.messageInput.GetText())
+ quotedMessage, generateError := discordutil.GenerateQuote(
+ discordutil.ReplaceMentions(message), username, message.Timestamp,
+ message.Attachments, window.messageInput.GetText())
if generateError == nil {
window.messageInput.SetText(quotedMessage)
window.app.SetFocus(window.messageInput.GetPrimitive())

Quoting now escapes @here and @everyone to avoid pissing everyone off