Commit graph

47 commits

Author SHA1 Message Date
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
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
Chris Rhodes
6fa99712ef Finish converting large switch statement into a map of functions. 2016-02-14 18:48:37 -08:00
Chris Rhodes
8ffaa85b0b Thread safety and more events. 2016-02-14 13:41:56 -08:00
Chris Rhodes
fb6ae92555 Add basic support for mapped event handlers. 2016-02-14 13:17:20 -08:00
Bruce Marriner
edc09778a7 Linting. 2016-01-28 08:36:09 -06:00
Chris Rhodes
ccb504b129 Fix missing lock 2016-01-16 01:25:44 -08:00
Chris Rhodes
6b73b588ba Message tracking. 2016-01-16 01:13:40 -08:00
Chris Rhodes
0f38b22ca1 Message state tracking. 2016-01-16 00:20:41 -08:00
Chris Rhodes
0d7b6f7e76 Convert structs and api to use pointers. 2016-01-08 09:37:34 -08:00
Bruce Marriner
7ad8d52369 Contributions will be listed elsewhere. 2016-01-07 16:53:54 -06:00
Bruce Marriner
301fb980d3 Updated copyright year, cleaned up some comments. 2016-01-07 13:50:44 -06:00
Chris Rhodes
cd01a34cdb Handle GUILD_EMOJI_UPDATE and track Emoji in state. 2016-01-03 11:56:46 -08:00
Chris Rhodes
aa4d42199a Add and Parse Emojis struct. 2016-01-03 00:38:34 -08:00
Chris Rhodes
66052d0a9c Rename methods. 2016-01-02 13:09:20 -08:00
Chris Rhodes
14c18b2286 Add generic Channel method which is slower. 2016-01-02 12:32:18 -08:00
Chris Rhodes
9ba6d5b7c1 Make state tracking optional. 2016-01-02 12:01:03 -08:00
Chris Rhodes
4e23e5fc35 Implement state tracking.
Currently maintains a list of Guilds (Members/Channels) and PrivateChannels.
2016-01-01 22:47:19 -08:00