Commit graph

77 commits

Author SHA1 Message Date
Rens Rikkerink
ee16996490
Fixed err shadowing 2018-05-09 14:35:06 +02:00
Rens Rikkerink
4cc57c5070
Added copy of previous Message state to MessageUpdate 2018-05-09 14:18:30 +02:00
Carson Hoffman
293b41141d Fix for #532 (#533) 2018-04-12 20:40:50 -07:00
Carson Hoffman
964060f34c General documentation improvements 2018-03-14 14:57:40 -04:00
MrJohnCoder
294ab42061
Fix typo 2017-12-02 22:16:49 -05:00
Max Boße
28dc6f6f33 Add members from GuildMembersChunk to state (#456) 2017-10-10 10:35:07 -07:00
Bruce
06b35cfe24 Linting. 2017-09-03 20:01:46 +00:00
Jonas is my name
3f2c1311d5 Export State.OnInterface (#417) 2017-08-13 19:52:05 -07:00
Erik McClure
42d1f62e58 Add memberMap to State to speed up member queries (#411)
* Fix #406: reconnect() can be called while still connected

* Add memberMap to speed up member queries

* Fix error return value and remove deletion

* Fix GuildAdd member map initialization edge case
2017-07-29 08:09:06 -07:00
legolord208
7bb0965a6f Updated to v6 (fixes #408) (#410)
* Updated to v6

* Unified websocket and REST version
2017-07-22 06:17:39 -07:00
legolord208
aa3973f956 Made error constants (Fixed #315) (#377) 2017-05-08 06:48:19 -07:00
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