1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-08-20 15:24:37 +00:00
Commit graph

8 commits

Author SHA1 Message Date
ayn2op 55d19000a1
discord: Rename IntentGuildBans; add GuildAuditLogEntryCreateEvent (#370)
* Rename GuildBans intent & add GUILD_AUDIT_LOG_ENTRY_CREATE event

* Add IntentGuildBans constant for backward compatibility
2023-01-27 01:34:50 -08:00
ItsLychee 92897b4fc3
discord: Support guild Scheduled Events (#319)
* implement the gateway side of guild scheduled event
* Add proper punctuation to each docstring
* Fix UserAdd and UserRemove events
* Add MANAGE_EVENTS permission
* Implement the API-side of scheduled events
* Add ScheduledEvent method
* Cleanup
2022-04-02 22:36:45 -07:00
diamondburned 54cadd2f45 gateway: Refactor for a better concurrent API
This commit refactors the whole package gateway as well as utils/ws
(formerly utils/wsutil) and voice/voicegateway. The new refactor
utilizes a design pattern involving a concurrent loop and an arriving
event channel.

An additional change was made to the way gateway events are typed.
Before, pretty much any type will satisfy a gateway event type, since
the actual type was just interface{}. The new refactor defines a
concrete interface that events can implement:

    type Event interface {
        Op() OpCode
        EventType() EventType
    }

Using this interface, the user can easily add custom gateway events
independently of the library without relying on string maps. This adds a
lot of type safety into the library and makes type-switching on Event
types much more reasonable.

Gateway error callbacks are also almost entirely removed in favor of
custom gateway events. A catch-all can easily be added like this:

    s.AddHandler(func(err error) {
        log.Println("gateway error:, err")
    })
2021-12-14 13:49:34 -08:00
diamondburned 5b328bdab0 shard: Remake shard manager (#226) 2021-06-14 15:22:55 -07:00
Samuel Hernandez 40e1a3757d *: Migrated Go Modules to v3 2021-06-01 19:59:01 -07:00
mavolin 88258b51c2 replace usage of discordapp.com with discord.com in docs 2020-11-03 10:14:53 -08:00
diamondburned 9899f6073b Bot: Added automatic Intents detection from handlers
This commit adds automatic Intents detection into package bot. When the
Start function is used, the intents will be OR'd after running the
options callback.

This commit also breaks the old "AddIntent" methods to rename them to
"AddIntents" for correctness.
2020-10-28 22:49:18 -07:00
diamondburned b8e4b2cf56 Gateway: Added an Event to Intents map for convenience 2020-10-28 19:44:04 -07:00