-
Hello, (Sry for my bad english) thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello, that is possible with the endpoint DeleteBulkMessage (https://discord.com/developers/docs/resources/channel#bulk-delete-messages) session.ChannelMessagesBulkDelete(channelID string, messages []string) But limited to 100 messages per request. If this is a big channel (basically messages > 100), the best solution is to duplicate channel and delete the full channel. Example: s, _ := discordgo.New()
s.Open()
ch, err := s.Channel(channelID)
if err != nil {
panic(err)
}
if _, err = s.ChannelDelete(channelID); err != nil {
panic(err)
}
s.GuildChannelCreateComplex(guildID, discordgo.GuildChannelCreateData{
Name: ch.Name,
Type: ch.Type,
Topic: ch.Topic,
Bitrate: ch.Bitrate,
UserLimit: ch.UserLimit,
RateLimitPerUser: ch.RateLimitPerUser,
Position: ch.Position,
PermissionOverwrites: ch.PermissionOverwrites,
ParentID: ch.ParentID,
NSFW: ch.NSFW,
}) |
Beta Was this translation helpful? Give feedback.
Hello, that is possible with the endpoint DeleteBulkMessage (https://discord.com/developers/docs/resources/channel#bulk-delete-messages)
But limited to 100 messages per request. If this is a big channel (basically messages > 100), the best solution is to duplicate channel and delete the full channel.
Example: