master
Marc 2021-05-28 16:40:51 +01:00
parent d6eb1c79dc
commit 0f312be4c1
No known key found for this signature in database
GPG Key ID: 0657563F705ACAAE
3 changed files with 46 additions and 14 deletions

View File

@ -101,17 +101,6 @@ func main() {
go func() {
usd := discordgo.UpdateStatusData{
IdleSince: nil,
Game: &discordgo.Game{
Name: Config.StatusText,
Type: 0,
URL: "",
Details: "",
State: "",
TimeStamps: discordgo.TimeStamps{},
Assets: discordgo.Assets{},
ApplicationID: "",
Instance: -1,
},
AFK: false,
Status: "online",
}

View File

@ -21,7 +21,7 @@ func (f *Features) handleSetStatus(s *discordgo.Session, m *discordgo.MessageCre
st := stSplit[1]
err := s.UpdateStatus(0, st)
err := s.UpdateGameStatus(0, st)
if err != nil {
return err
}

View File

@ -8,6 +8,49 @@ import (
"time"
)
func (f *Features) handleSetSlowmode(s *discordgo.Session, m *discordgo.MessageCreate) error {
if !f.Permissions.CheckAdminRole(m.Member) {
return errors.New("You do not have permissions to use that command.")
}
slowmodeSplit := strings.Split(m.Content, " ")
if len(slowmodeSplit) < 2 {
return errors.New("You must supply at least an amount of time")
}
// slowmodeTime = slowmodeSplit[1]
if len(slowmodeSplit) == 3 {
if slowmodeSplit[2] == "all" {
channels, err := s.GuildChannels(f.Config.GuildID)
if err != nil {
return err
}
for _, channel := range channels {
s.ChannelEditComplex(channel.ID, &discordgo.ChannelEdit{
RateLimitPerUser: 10,
})
}
}
}
_, err := s.ChannelEditComplex(m.ChannelID, &discordgo.ChannelEdit{
RateLimitPerUser: 10,
})
if err != nil {
return err
}
msg := f.CreateDefinedEmbed("Slow Mode", "Setting Slow Mode", "success", m.Author)
_, err = s.ChannelMessageSendEmbed(m.ChannelID, msg)
if err != nil {
return err
}
return nil
}
func (f *Features) handlePurgeChannel(s *discordgo.Session, m *discordgo.MessageCreate) error {
if !f.Permissions.CheckAdminRole(m.Member) {
return errors.New("You do not have permissions to use that command.")