mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-07-14 17:36:13 +00:00
discord: Rename IntentGuildBans; add GuildAuditLogEntryCreateEvent (#370)
* Rename GuildBans intent & add GUILD_AUDIT_LOG_ENTRY_CREATE event * Add IntentGuildBans constant for backward compatibility
This commit is contained in:
parent
05dbf0e2b4
commit
55d19000a1
|
@ -31,6 +31,7 @@ func init() {
|
||||||
func() ws.Event { return new(GuildCreateEvent) },
|
func() ws.Event { return new(GuildCreateEvent) },
|
||||||
func() ws.Event { return new(GuildUpdateEvent) },
|
func() ws.Event { return new(GuildUpdateEvent) },
|
||||||
func() ws.Event { return new(GuildDeleteEvent) },
|
func() ws.Event { return new(GuildDeleteEvent) },
|
||||||
|
func() ws.Event { return new(GuildAuditLogEntryCreateEvent) },
|
||||||
func() ws.Event { return new(GuildBanAddEvent) },
|
func() ws.Event { return new(GuildBanAddEvent) },
|
||||||
func() ws.Event { return new(GuildBanRemoveEvent) },
|
func() ws.Event { return new(GuildBanRemoveEvent) },
|
||||||
func() ws.Event { return new(GuildEmojisUpdateEvent) },
|
func() ws.Event { return new(GuildEmojisUpdateEvent) },
|
||||||
|
@ -228,6 +229,12 @@ func (*GuildDeleteEvent) Op() ws.OpCode { return dispatchOp }
|
||||||
// EventType implements Event.
|
// EventType implements Event.
|
||||||
func (*GuildDeleteEvent) EventType() ws.EventType { return "GUILD_DELETE" }
|
func (*GuildDeleteEvent) EventType() ws.EventType { return "GUILD_DELETE" }
|
||||||
|
|
||||||
|
// Op implements Event. It always returns 0.
|
||||||
|
func (*GuildAuditLogEntryCreateEvent) Op() ws.OpCode { return dispatchOp }
|
||||||
|
|
||||||
|
// EventType implements Event.
|
||||||
|
func (*GuildAuditLogEntryCreateEvent) EventType() ws.EventType { return "GUILD_AUDIT_LOG_ENTRY_CREATE" }
|
||||||
|
|
||||||
// Op implements Event. It always returns 0.
|
// Op implements Event. It always returns 0.
|
||||||
func (*GuildBanAddEvent) Op() ws.OpCode { return dispatchOp }
|
func (*GuildBanAddEvent) Op() ws.OpCode { return dispatchOp }
|
||||||
|
|
||||||
|
|
|
@ -294,6 +294,13 @@ type GuildDeleteEvent struct {
|
||||||
Unavailable bool `json:"unavailable"`
|
Unavailable bool `json:"unavailable"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GuildAuditLogEntryCreateEvent is a dispatch event.
|
||||||
|
|
||||||
|
// https://discord.com/developers/docs/topics/gateway#guilds
|
||||||
|
type GuildAuditLogEntryCreateEvent struct {
|
||||||
|
discord.AuditLogEntry
|
||||||
|
}
|
||||||
|
|
||||||
// GuildBanAddEvent is a dispatch event.
|
// GuildBanAddEvent is a dispatch event.
|
||||||
//
|
//
|
||||||
// https://discord.com/developers/docs/topics/gateway#guilds
|
// https://discord.com/developers/docs/topics/gateway#guilds
|
||||||
|
|
|
@ -12,7 +12,7 @@ type Intents uint32
|
||||||
const (
|
const (
|
||||||
IntentGuilds Intents = 1 << iota
|
IntentGuilds Intents = 1 << iota
|
||||||
IntentGuildMembers
|
IntentGuildMembers
|
||||||
IntentGuildBans
|
IntentGuildModeration
|
||||||
IntentGuildEmojis
|
IntentGuildEmojis
|
||||||
IntentGuildIntegrations
|
IntentGuildIntegrations
|
||||||
IntentGuildWebhooks
|
IntentGuildWebhooks
|
||||||
|
@ -29,6 +29,11 @@ const (
|
||||||
IntentGuildScheduledEvents
|
IntentGuildScheduledEvents
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// IntentGuildBans is an alias to IntentGuildModeration.
|
||||||
|
//
|
||||||
|
// Deprecated: IntentGuildModeration is the more correct constant to use.
|
||||||
|
const IntentGuildBans = IntentGuildModeration
|
||||||
|
|
||||||
// PrivilegedIntents contains a list of privileged intents that Discord requires
|
// PrivilegedIntents contains a list of privileged intents that Discord requires
|
||||||
// bots to have these intents explicitly enabled in the Developer Portal.
|
// bots to have these intents explicitly enabled in the Developer Portal.
|
||||||
var PrivilegedIntents = []Intents{
|
var PrivilegedIntents = []Intents{
|
||||||
|
@ -65,8 +70,9 @@ var EventIntents = map[ws.EventType]Intents{
|
||||||
"GUILD_MEMBER_REMOVE": IntentGuildMembers,
|
"GUILD_MEMBER_REMOVE": IntentGuildMembers,
|
||||||
"GUILD_MEMBER_UPDATE": IntentGuildMembers,
|
"GUILD_MEMBER_UPDATE": IntentGuildMembers,
|
||||||
|
|
||||||
"GUILD_BAN_ADD": IntentGuildBans,
|
"GUILD_AUDIT_LOG_ENTRY_CREATE": IntentGuildModeration,
|
||||||
"GUILD_BAN_REMOVE": IntentGuildBans,
|
"GUILD_BAN_ADD": IntentGuildModeration,
|
||||||
|
"GUILD_BAN_REMOVE": IntentGuildModeration,
|
||||||
|
|
||||||
"GUILD_EMOJIS_UPDATE": IntentGuildEmojis,
|
"GUILD_EMOJIS_UPDATE": IntentGuildEmojis,
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue