diff --git a/discord/ctf.go b/discord/ctf.go index 0a5b797..b302a9c 100644 --- a/discord/ctf.go +++ b/discord/ctf.go @@ -507,7 +507,7 @@ func (s *Server) handleNewChal(event *handler.CommandEvent) error { // Create the channel with our custom permissions. // No one but the current role members should see the channel. - _, err = s.client.Rest().CreateGuildChannel(*event.GuildID(), discord.GuildTextChannelCreate{ + channel, err := s.client.Rest().CreateGuildChannel(*event.GuildID(), discord.GuildTextChannelCreate{ Name: chalName, ParentID: parentChannel.ID(), PermissionOverwrites: []discord.PermissionOverwrite{ @@ -525,6 +525,12 @@ func (s *Server) handleNewChal(event *handler.CommandEvent) error { return Error(event, err) } + _, err = s.client.Rest().CreateMessage(channel.ID(), discord.NewMessageCreateBuilder().SetEmbeds(messageEmbedSuccess( + "New challenge!", fmt.Sprintf("%s has created `%s`", event.User().String(), chalName))).Build()) + if err != nil { + return Error(event, err) + } + Respond(event, "New channel created", fmt.Sprintf("Successfully added channel `%s`.", chalName)) return err }