Compare commits

...

2 Commits

Author SHA1 Message Date
Chris Sexton b69990e10f fix gok error 2020-10-13 09:43:04 -04:00
Chris Sexton 021cbee40a meme: add extra split for discord 2020-10-13 09:43:04 -04:00
2 changed files with 8 additions and 4 deletions

View File

@ -509,7 +509,7 @@ func (s *Slack) buildMessage(m slackMessage) msg.Message {
Channel: m.Channel, Channel: m.Channel,
Command: isCmd, Command: isCmd,
Action: isAction, Action: isAction,
Host: string(m.ID), Host: fmt.Sprint(m.ID),
Time: tstamp, Time: tstamp,
AdditionalData: map[string]string{ AdditionalData: map[string]string{
"RAW_SLACK_TIMESTAMP": m.Ts, "RAW_SLACK_TIMESTAMP": m.Ts,
@ -543,7 +543,7 @@ func (s *Slack) buildLightReplyMessage(m slackMessage) msg.Message {
Channel: m.Channel, Channel: m.Channel,
Command: isCmd, Command: isCmd,
Action: isAction, Action: isAction,
Host: string(m.ID), Host: fmt.Sprint(m.ID),
Time: tstamp, Time: tstamp,
AdditionalData: map[string]string{ AdditionalData: map[string]string{
"RAW_SLACK_TIMESTAMP": m.Ts, "RAW_SLACK_TIMESTAMP": m.Ts,

View File

@ -91,7 +91,7 @@ func (p *MemePlugin) help(c bot.Connector, kind bot.Kind, message msg.Message, a
msg += "\n`[format]` can be a URL" msg += "\n`[format]` can be a URL"
msg += fmt.Sprintf("\nor a format from the list of %d pre-made memes listed on the website", len(formats)) msg += fmt.Sprintf("\nor a format from the list of %d pre-made memes listed on the website", len(formats))
msg += fmt.Sprintf("\nHead over to %s/meme to view and add new meme formats", webRoot) msg += fmt.Sprintf("\nHead over to %s/meme to view and add new meme formats", webRoot)
msg += "\nYou can use `_` as a placeholder for empty text and a newline to separate top vs bottom." msg += "\nYou can use `_` as a placeholder for empty text and a newline (|| on Discord) to separate top vs bottom."
p.bot.Send(c, bot.Message, message.Channel, msg) p.bot.Send(c, bot.Message, message.Channel, msg)
return true return true
} }
@ -263,7 +263,11 @@ func (p *MemePlugin) sendMeme(c bot.Connector, channel, channelName, msgID strin
go func() { go func() {
top, bottom := "", message top, bottom := "", message
parts = strings.Split(message, "\n") if strings.Contains(message, "||") {
parts = strings.Split(message, "||")
} else {
parts = strings.Split(message, "\n")
}
if len(parts) > 1 { if len(parts) > 1 {
top, bottom = parts[0], parts[1] top, bottom = parts[0], parts[1]
} }