add !pm signature option
This commit is contained in:
@@ -99,6 +99,12 @@ func (b *Bot) initCommands() commandList {
|
||||
allowed: b.allowOwner,
|
||||
},
|
||||
{allowed: b.allowOwner, description: "mailbox options"}, // delimiter
|
||||
{
|
||||
key: config.RoomSignature,
|
||||
description: "Get or set signature of the room (markdown supported)",
|
||||
sanitizer: func(s string) string { return s },
|
||||
allowed: b.allowOwner,
|
||||
},
|
||||
{
|
||||
key: config.RoomNoSend,
|
||||
description: fmt.Sprintf(
|
||||
@@ -523,6 +529,14 @@ func (b *Bot) runSend(ctx context.Context) {
|
||||
htmlBody = format.RenderMarkdown(body, true, true).FormattedBody
|
||||
}
|
||||
|
||||
signature := format.RenderMarkdown(cfg.Signature(), true, true)
|
||||
if signature.Body != "" {
|
||||
body += "\n\n---\n" + signature.Body
|
||||
if htmlBody != "" {
|
||||
htmlBody += "<br><hr><br>" + signature.FormattedBody
|
||||
}
|
||||
}
|
||||
|
||||
tos := strings.Split(to, ",")
|
||||
// validate first
|
||||
for _, to := range tos {
|
||||
|
||||
Reference in New Issue
Block a user