Merge branch 'better-introduction' into 'main'

Improve introduction and getters usability

See merge request etke.cc/postmoogle!26
This commit is contained in:
Aine
2022-08-31 07:40:25 +00:00
2 changed files with 9 additions and 3 deletions

View File

@@ -181,7 +181,7 @@ func (b *Bot) sendIntroduction(ctx context.Context, roomID id.RoomID) {
msg.WriteString(b.prefix)
msg.WriteString(" ")
msg.WriteString(roomOptionMailbox)
msg.WriteString("` command.\n")
msg.WriteString(" SOME_INBOX` command.\n")
msg.WriteString("You will then be able to send emails to `SOME_INBOX@")
msg.WriteString(b.domain)

View File

@@ -48,7 +48,10 @@ func (b *Bot) getOption(ctx context.Context, name string) {
value := cfg.Get(name)
if value == "" {
b.SendNotice(ctx, evt.RoomID, fmt.Sprintf("`%s` is not set, kupo.", name))
msg := fmt.Sprintf("`%s` is not set, kupo.\n"+
"To set it, send a `%s %s VALUE` command.",
name, b.prefix, name)
b.SendNotice(ctx, evt.RoomID, msg)
return
}
@@ -56,7 +59,10 @@ func (b *Bot) getOption(ctx context.Context, name string) {
value = value + "@" + b.domain
}
b.SendNotice(ctx, evt.RoomID, fmt.Sprintf("`%s` of this room is `%s`", name, value))
msg := fmt.Sprintf("`%s` of this room is `%s`\n"+
"To set it to a new value, send a `%s %s VALUE` command.",
name, value, b.prefix, name)
b.SendNotice(ctx, evt.RoomID, msg)
}
func (b *Bot) setOption(ctx context.Context, name, value string) {