Skip to content

Commit

Permalink
add optional guild-audit-id flag to admin tools
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-ignacio committed Mar 1, 2021
1 parent 45e96ca commit fec9a82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
21 changes: 13 additions & 8 deletions tools/cmd/set.go
Expand Up @@ -14,14 +14,15 @@ import (
)

var (
flagSetChannel bool
flagSetChannelSlug string
flagSetChannelID string
flagSetChannelVideoID string
flagSetLinkGuild bool
flagSetLinkGuildID string
flagSetLinkGuildRoleID string
flagSetLinkGuildBCP47 string
flagSetChannel bool
flagSetChannelSlug string
flagSetChannelID string
flagSetChannelVideoID string
flagSetLinkGuild bool
flagSetLinkGuildID string
flagSetLinkGuildAuditID string
flagSetLinkGuildRoleID string
flagSetLinkGuildBCP47 string
)

// setCmd represents the set command
Expand Down Expand Up @@ -88,6 +89,9 @@ var setCmd = &cobra.Command{
// set
guild.ID = flagSetLinkGuildID
guild.BCP47 = flagSetLinkGuildBCP47
if flagSetLinkGuildAuditID != "" {
guild.AuditLogChannelID = flagSetLinkGuildAuditID
}
guild.MembershipRoles[flagSetChannelSlug] = flagSetLinkGuildRoleID
_, err = fs.Collection(common.DiscordGuildCollection).Doc(flagSetLinkGuildID).Set(ctx, guild)
if err != nil {
Expand Down Expand Up @@ -135,6 +139,7 @@ func init() {
flags.StringVar(&flagSetChannelVideoID, "channel-video-id", "", "membership video ID")
flags.BoolVar(&flagSetLinkGuild, "link-guild", false, "link Discord guild to channel")
flags.StringVar(&flagSetLinkGuildID, "guild-id", "", "Discord guild")
flags.StringVar(&flagSetLinkGuildAuditID, "guild-audit-id", "", "Discord guild audit channel ID (optional)")
flags.StringVar(&flagSetLinkGuildRoleID, "guild-role-id", "", "Discord guild member role ID")
flags.StringVar(&flagSetLinkGuildBCP47, "guild-bcp47", "en-US", "Discord guild BCP47 string")
setCmd.RegisterFlagCompletionFunc("channel-slug", completeChannelSlug)
Expand Down
1 change: 1 addition & 0 deletions tools/go.mod
Expand Up @@ -3,6 +3,7 @@ module github.com/member-gentei/member-gentei/tools
go 1.14

require (
cloud.google.com/go/firestore v1.3.0
cloud.google.com/go/pubsub v1.3.1
firebase.google.com/go v3.13.0+incompatible
github.com/member-gentei/member-gentei/pkg v0.0.0-20201115025050-759c1329cf82
Expand Down

0 comments on commit fec9a82

Please sign in to comment.