Commit graph

66 commits

Author SHA1 Message Date
Rinzen Necroforger
f539136306 Add Presence Tracking to State (#371)
* Add Presence tracking to the state

* Do not need to check if Roles and Game is nil

* Append presence to guild.Presences if not found
2017-05-04 07:00:59 -07:00
Alexander
57c2762b53 Fixed a bad documentation comment for State.ChannelAdd (#338) 2017-03-16 07:04:58 -10:00
jonas747
6fd80199bf Handle MessageDeleteBulk event (#304)
* Handle MessageDeleteBulk event

* Changed State.MessageRemove to use id's

* Revert State.MessageRemove change and add State.messageRemoveById

* Fix linting
2016-12-28 12:29:36 -08:00
Kristian Klausen
b377944b97 Switch to V5 gateway (#300)
This switch the gateway to V5, and change the heartbeat logic to
get the heartbeat_interval from the new Hello opcode instant of
READY/RESUME event.
See: https://github.com/hammerandchisel/discord-api-docs/issues/18

Fix: #220
2016-12-25 16:22:14 -08:00
Bruce Marriner
9e777a083b Linting. 2016-12-11 12:45:34 -06:00
Chris Rhodes
db2f9eb29b Support getting the color of a user. (#299) 2016-12-10 21:37:11 -08:00
Chris Rhodes
fb346787be Improve permissions. (#298)
* Fix permissions to take into account @everyone override in channels.

* Keep early exit for channel owner.
2016-12-10 20:31:16 -08:00
Chris Rhodes
24a51f654f 👌 2016-11-30 18:02:13 -08:00
Chris Rhodes
9f7a7c9352 Don't stomp on messages or permission overrides on ChannelUpdate. 2016-11-30 17:59:17 -08:00
Chris Rhodes
315ae45231 Set GuildID on all members in discordgo land not in state. 2016-11-29 20:23:10 -08:00
Chris Rhodes
20d230cd04 Update GuildID's on GuildAdd 2016-11-29 19:17:03 -08:00
Chris Rhodes
54e0bd6087 Fix Admin permission calculations. 2016-11-29 19:09:01 -08:00
Chris Rhodes
1bc3fb9cd7 Set the GuildID for Members and VoiceStates on ready. 2016-11-29 19:05:09 -08:00
Chris Rhodes
c352d7016c Clean up ordering of internal handlers. (#285) 2016-11-12 11:50:06 -08:00
Chris Rhodes
ee3e500749 Add webhook support. 2016-11-03 19:41:57 -07:00
Chris Rhodes
6c53613186 Thanks govet. 2016-09-27 22:02:28 -07:00
Chris Rhodes
8164119cac Support a very light state in all cases to support b1nzy's upcoming PR 2016-09-27 21:44:16 -07:00
Chris Rhodes
910b864864 Merge pull request #255 from jonas747/msg-timestamps-missing
Apply more fields to existing message in message update
2016-09-27 21:15:14 -07:00
Chris Rhodes
9b6b657083 Merge pull request #249 from iopred/develop
Correctly merge GUILD_UPDATE events. Closes #242
2016-09-27 21:15:03 -07:00
jonas747
f01c5a3344 Apply more fields to message in message update
In case update was handled before create
2016-09-25 20:16:28 +02:00
Chris Rhodes
003454345b Use the everyone role to initialise the permission flags. 2016-09-15 18:51:09 -07:00
Chris Rhodes
42cef0c0d0 Remove unavailable goop, b1nzy says it'd never happen. 2016-09-08 20:06:24 -07:00
Chris Rhodes
678756c9a9 Simplify Guild.Unavailable and correctly merge GUILD_UPDATE events. 2016-09-08 19:39:29 -07:00
Bruce Marriner
ea72e85416 Deprecated Session.UserChannelPermissions
Created new UserChannelPermissions in State.
2016-07-18 17:04:00 -05:00
Bruce
1d2d93a7b5 Merge pull request #196 from iopred/stateroles
Add Role tracking. Support disabling individual features in state. Closes #195.
2016-05-08 19:34:26 -04:00
Chris Rhodes
95f0d584d6 Add Role tracking. Support disabling individual features in state. 2016-05-07 19:43:53 -07:00
Chris Rhodes
0c7562440e Merge message contents in state. Fixes #192 2016-05-05 19:13:15 -07:00
Chris Rhodes
7efe4ccfee 👌 2016-04-27 14:43:43 -07:00
Chris Rhodes
84f0b5d41a Add missing RLock in State.Channel 2016-04-27 14:38:29 -07:00
Bruce Marriner
bcc42e8211 Don't forget GoImports... 2016-04-23 22:35:12 -05:00
Bruce Marriner
bda7434f18 Moved State struct to state.go 2016-04-22 16:53:57 -05:00
Chris Rhodes
a9bed749a1 Fix potential threading issue. 2016-04-19 16:00:12 -07:00
Chris Rhodes
a8afd3eb81 Remove items from the map before returning 👌 2016-04-19 12:45:16 -07:00
andrei
34f83532dd Fix channelMap not being filled for bot users/>100 guilds
Previously we only filled the channelMap inside of READY. Because of
lazy guild loading, this was not valid for the majority of users (e.g.
bot users and users with more than 100 guilds). We now properly handle
both cases, by filling in the channelMap on GUILD_CREATE.

This commit also refactors the way we do locking inside of GUILD_CREATE
and CHANNEL_CREATE to be a bit cleaner.
2016-04-13 01:41:18 -07:00
Chris Rhodes
4609c31a72 Prime the channel map correctly. 2016-04-12 08:44:01 -07:00
Chris Rhodes
408bbb54b6 Don't undo b1nzy's work. 2016-04-11 22:21:26 -07:00
Chris Rhodes
87b2daa832 Merge remote-tracking branch 'bwmarrin/develop' into develop 2016-04-11 22:17:26 -07:00
Chris Rhodes
4e16cfef0e Update some comments. 2016-04-10 16:20:14 -07:00
Chris Rhodes
fa63c00fa2 Add fast lookups for guilds and channels in state. 2016-04-10 16:18:29 -07:00
Bruce Marriner
92c27c7712 Because binzy was too lazy.
No seriously, this allows us see if a guild is actually being created
or just being lazy-loaded.
2016-04-08 11:51:58 -05:00
andrei
019d0fe9af Fix lazy-loading of guilds not working
We're moving to lazy-loading guilds, meaning bots now recieve a READY
packet with guilds that only have 'id' and 'unavailable' fields. Post
READY, the client then lazyily recieves GUILD_CREATE's for the rest of
the guilds it's in. Previously we assumed the first instance of the
guild we got (from ready) had all the required information, now we need
to use the GUILD_CREATE if the guild was marked as unavailable.
2016-04-04 13:45:41 -07:00
Chris Rhodes
8ae2adfb01 Don't perform guild lookups if message tracking is not enabled. 2016-04-01 18:22:18 -07:00
Chris Rhodes
99a1f5665a Fix potential infinite loop on state. 2016-04-01 11:31:10 -07:00
jonas747
d1f25d8561 Changed fmt.Print to log.Print 2016-03-21 17:13:39 +01:00
andrei
7e7887a936 Fix channels inside a guild from GUILD_CREATE having a null GuildID 2016-03-19 18:58:47 -07:00
Chris Rhodes
6ec1c07300 Clean up voice state updates, make them goroutine safe. 2016-03-10 19:15:30 -08:00
Bruce
0dac7777c1 Merge pull request #141 from b1naryth1ef/feature/multiple-voice-connection
Add the ability to have multiple cross-guild voice connections open.
2016-03-09 21:14:43 -06:00
andrei
b48e8c992e Track voice state changes, expose stuff, add channel changing 2016-03-07 15:41:02 -08:00
Chris Rhodes
7eb0bd2aed Set GuildID on all Channels in READY. 2016-03-05 20:18:18 -08:00
Chris Rhodes
4895ace11d Return state errors. Because we're good citizens. 2016-02-15 20:07:01 -08:00