-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmd_jenna.go
34 lines (28 loc) · 1018 Bytes
/
cmd_jenna.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package bot
import (
"context"
"fmt"
"math/rand"
"github.com/diamondburned/arikawa/v3/api"
"github.com/diamondburned/arikawa/v3/api/cmdroute"
"github.com/zikaeroh/ctxlog"
"go.uber.org/zap"
)
func (b *Bot) cmdStfu(ctx context.Context, data cmdroute.CommandData) *api.InteractionResponseData {
var name string
me, err := b.state.Me()
if err != nil {
ctxlog.Error(ctx, "error fetching username", zap.Error(err))
name = "BOT"
} else {
name = me.Username
}
selfDestruct := rand.Intn(10000)
msg := fmt.Sprintf("[%s-GPT] %s has detected an argument in this channel. Please diverge into a thread as to not annoy those that aren't participating. Failure to comply will result in explosion. This message will self-destruct in %d seconds.", name, name, selfDestruct)
_, err = b.state.SendMessage(data.Event.ChannelID, msg)
if err != nil {
ctxlog.Error(ctx, "error sending message", zap.Error(err))
return respondError("Error sending message!")
}
return respondSilent("Told everyone to stfu.")
}