renamed command variables and added autopublishing

This commit is contained in:
2024-03-05 14:05:17 +01:00
parent 4d02026f25
commit c90e2d59fc
11 changed files with 90 additions and 10 deletions

View File

@@ -20,7 +20,7 @@ type Command struct {
ModalIDs []string
}
var commands []Command = []Command{form_command, tag_command, short_get_tag_command, dadjoke_command, ping_command, ask_command, sticky_command, cat_command, autojoinroles_command}
var commands []Command = []Command{cmd_form, cmd_tag, cmd_tag_short, cmd_dadjoke, cmd_ping, cmd_ask, cmd_sticky, cmd_cat, cmd_autojoinroles, cmd_autopublish}
func ready(s *discordgo.Session, event *discordgo.Ready) {
fmt.Print("\nStarting up...")
@@ -123,6 +123,12 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
updateStickyMessageID(m.GuildID, m.ChannelID, stickyMessage.ID)
}
}
channel, _ := s.Channel(m.ChannelID)
if channel.Type == discordgo.ChannelTypeGuildNews {
if isAutopublishEnabled(m.GuildID, m.ChannelID) {
s.ChannelMessageCrosspost(m.ChannelID, m.ID)
}
}
}
func guildMemberJoin(s *discordgo.Session, m *discordgo.GuildMemberAdd) {