diff --git a/commands/enabled.go b/commands/enabled.go index 54bbeb0..af720fd 100644 --- a/commands/enabled.go +++ b/commands/enabled.go @@ -34,7 +34,6 @@ func populateSlashCommands(ctx ddtrace.SpanContext) { SlashCommands["birthday"] = slash.Birthday SlashCommands["dquery"] = slash.DQuery SlashCommands["attendance"] = slash.Attendance - SlashCommands["attendanceof"] = slash.Attendanceof } // populateHandlers populates the Handlers map with all of the handlers diff --git a/commands/slash/attendanceof.go b/commands/slash/attendanceof.go deleted file mode 100644 index a318457..0000000 --- a/commands/slash/attendanceof.go +++ /dev/null @@ -1,52 +0,0 @@ -package slash - -import ( - "github.com/bwmarrin/discordgo" - "github.com/ritsec/ops-bot-iii/commands/slash/permission" - "github.com/ritsec/ops-bot-iii/logging" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" -) - -//Attendanceof slash command -func Attendanceof() (*discordgo.ApplicationCommand, func(s *discordgo.Session, i *discordgo.InteractionCreate)) { - return &discordgo.ApplicationCommand { - Name: "attendanceof", - Description: "Get signin history of a user", - DefaultMemberPermissions: &permission.IGLead, - Options: []*discordgo.ApplicationCommandOption { - { - Type: discordgo.ApplicationCommandOptionUser, - Name: "user", - Description: "The user whose signin history you want to check", - Required: true, - }, - }, - }, - func(s *discordgo.Session, i *discordgo.InteractionCreate) { - span := tracer.StartSpan( - "commands.slash.attendanceof:Attendanceof", - tracer.ResourceName("/attendanceof"), - ) - defer span.Finish() - - u := i.ApplicationCommandData().Options[0].UserValue(s) - - logging.Debug(s, "Attendanceof command received for " + u.Username, i.Member.User, span) - - err := s.InteractionRespond( - i.Interaction, - &discordgo.InteractionResponse { - Type: discordgo.InteractionResponseChannelMessageWithSource, - Data: &discordgo.InteractionResponseData { - Content: attendanceMessage(u.ID, span.Context()), - Flags: discordgo.MessageFlagsEphemeral, - }, - }, - ) - if err != nil { - logging.Error(s, err.Error(), i.Member.User, span) - } else { - logging.Debug(s, "Signin History Given for " + u.Username, i.Member.User, span) - } - } -}