diff --git a/djpianalto.com/goff/exts/init.go b/djpianalto.com/goff/exts/init.go index 2032cab..e72affe 100644 --- a/djpianalto.com/goff/exts/init.go +++ b/djpianalto.com/goff/exts/init.go @@ -14,4 +14,5 @@ func AddCommandHandlers(h *anpan.CommandHandler) { h.AddCommand("ping", "Check the bot's ping", false, false, 0, anpan.CommandTypeEverywhere, pingCommand) h.AddCommand("say", "Repeat a message", false, false, 0, anpan.CommandTypeEverywhere, sayCommand) h.AddCommand("user", "Show info about a user", false, false, 0, anpan.CommandTypeEverywhere, userCommand) + h.AddCommand("git", "Show my github link", false, false, 0, anpan.CommandTypeEverywhere, gitCommand) } diff --git a/djpianalto.com/goff/exts/utils.go b/djpianalto.com/goff/exts/utils.go index 1639714..0a865ac 100644 --- a/djpianalto.com/goff/exts/utils.go +++ b/djpianalto.com/goff/exts/utils.go @@ -19,6 +19,16 @@ func pingCommand(ctx anpan.Context, _ []string) error { return err } +func gitCommand(ctx anpan.Context, _ []string) error { + embed := &discordgo.MessageEmbed{ + Title: "Hi there, My code is on Github", + Color: 0, + URL: "https://github.com/dustinpianalto/Goff", + } + _, err := ctx.Session.ChannelMessageSendEmbed(ctx.Channel.ID, embed) + return err +} + func sayCommand(ctx anpan.Context, args []string) error { resp := strings.Join(args, " ") resp = strings.ReplaceAll(resp, "@everyone", "@\ufff0everyone")