Bruce Marriner
a00f64aa86
Don't stomp on VoiceConnection if exists already
...
This allows you to enable voice debugging prior to joining a voice
channel.
2016-05-12 19:23:38 -05:00
Bruce Marriner
6a4b8bb287
Fixed it!
2016-05-01 19:55:57 -05:00
Bruce Marriner
cb9e30670f
no concurrent writes to voice ws, log cleanup
2016-05-01 19:54:28 -05:00
Bruce Marriner
5dc57e19c7
Display gateway url in error
2016-05-01 18:16:55 -05:00
Bruce Marriner
a9da8a5daf
Cleanup, Logging, Finished Resumed code.
2016-04-30 21:40:13 -05:00
Bruce Marriner
c65d5091ab
Fix resume bug! It's op not ip.
2016-04-30 20:29:27 -05:00
Bruce Marriner
9e8cd0a735
misc cleanup
2016-04-30 20:29:10 -05:00
Bruce Marriner
e9e9ef86b3
Prevent concurrent writes to gateway websocket.
2016-04-30 19:11:13 -05:00
Bruce Marriner
9bc6057ca7
partial support for gateway resume
2016-04-30 17:52:09 -05:00
Bruce Marriner
b09ed37294
reconenct with identify packet until resume is fixed.
2016-04-29 14:57:41 -05:00
Bruce Marriner
53a826dd0d
Send heartbeat in response to gateway Op 1 message
2016-04-28 22:30:42 -05:00
Bruce Marriner
d557bb24a5
Extra logging for non OP0 events, for now.
2016-04-28 21:50:57 -05:00
Bruce Marriner
f6de2b2c98
gateway, voice, & logging improvements
...
We now store teh sessionID of the gateway connection for later use. We
are now caching the gateway url and will use it until unable to connect
to that gateway. We're not longer smashing the VoiceConnections map
during reconnects which was causing Voice problems. Slight change to
log output format.
2016-04-28 21:15:32 -05:00
Bruce Marriner
94770635a9
Event handing improvements.
...
Corrected the Event struct to match it's new state based on Discord docs
and started tracking sequence number and sending it with heatbeats.
Also, move cleanup and comment improvements.
2016-04-28 16:59:45 -05:00
Bruce Marriner
2ac4665a4e
Clean up Gateway API Event handling.
2016-04-28 14:22:43 -05:00
Bruce Marriner
dd69a7e27f
Added logging statements
2016-04-28 09:27:57 -05:00
Bruce Marriner
250579eb3a
Fix incorrect handling of VOICE_SERVER_UPDATE
...
With this change, discordgo now properly supports
VOICE_SERVER_UPDATE events and will upon request
close existing connections and then re-open the
connection to the new voice endpoint. This allows
voice gateway redirects and voice region changes
to work even while a client is sending audio.
2016-04-28 07:43:31 -05:00
Bruce
5398a481cc
Merge pull request #167 from b1naryth1ef/feature/gateway-v4
...
Support Gateway v4
2016-04-26 20:15:02 -05:00
Bruce Marriner
4cac19c3f9
Do not start udp listener if deaf.
...
If you call VoiceChannelJoin and set deaf to true
then the library will not start a udp listener
2016-04-25 22:00:30 -05:00
Bruce Marriner
a258ec3011
Slight change to error message.
2016-04-25 15:33:40 -05:00
Bruce
cb6b3b956e
Revert "Add sharding support"
2016-04-25 13:24:00 -05:00
Bruce
b14a2ce8da
Merge pull request #171 from iopred/develop
...
Fix unmarshall error with Invite, improve error logging.
2016-04-23 22:35:51 -05:00
Chris Rhodes
bf9dda8404
Use json.Unmarshal in event handling so errors are better.
2016-04-23 11:58:19 -07:00
Chris Rhodes
8be21fb539
Fix unmarshall error with Invite, improve error logging.
2016-04-23 11:03:07 -07:00
andrei
92caf31b7f
Implement Guild Sharding
...
This implements the upcoming change (see hammerandchisel/discord-api-docs#17 )
to add guild-sharding support directly in the Discord Gateways.
2016-04-19 18:09:38 -07:00
andrei
ecc6e884c4
Support Gateway v4
...
This adds support for gateway v4 (which we're technically already
running; whoops). Really it just moves the version to the URL,
and explicitly uses JSON as the encoding. Everything should be supported
from previous commits.
2016-04-13 01:38:30 -07:00
Bruce Marriner
836e78d3d9
Pass struct along with OnEvent event.
2016-04-11 16:56:43 -05:00
Chris Rhodes
4d4f8f7741
Always handle the raw event.
2016-03-21 10:50:56 -07:00
jonas747
d1f25d8561
Changed fmt.Print to log.Print
2016-03-21 17:13:39 +01:00
Bruce Marriner
b1ac010731
Unexported WaitUntilConnected
...
This isn't needed now that the ChannelVoiceJoin waits
for the connection before returning, or returns an error.
2016-03-17 15:57:40 -05:00
Bruce Marriner
513facf391
More cleanup, moving things around..
2016-03-17 15:54:07 -05:00
Bruce Marriner
3ffbbdcc56
Unexport UDPConn as it is no longer needed externally.
2016-03-17 14:39:55 -05:00
Bruce Marriner
397d04b1ff
Fix a couple bugs I just created.
2016-03-17 14:02:19 -05:00
Bruce Marriner
c359bf8395
Cleanup
2016-03-17 13:33:57 -05:00
Bruce Marriner
383a3cf1e0
Delete voice connection from map on error
2016-03-16 22:48:48 -05:00
Bruce Marriner
ee07ed8afe
Only return valid existing voice connections
2016-03-16 22:47:53 -05:00
Bruce Marriner
7ec5304bc9
ChannelVoiceJoin now waits for the connection.
...
You can return to the previous behaviour just by calling
the function as a goroutine. However I feel most uses of it
require the connection to be ready before the next step.
2016-03-15 08:30:05 -05:00
Bruce Marriner
50cc4df965
Some, slightly messy, fixes to get voice -working-.
2016-03-11 23:19:35 -06:00
andrei
5dc0b9f2a1
Add connect timeout, fix ChannelVoiceJoin "leaking" connections
2016-03-08 02:36:00 -08:00
andrei
b48e8c992e
Track voice state changes, expose stuff, add channel changing
2016-03-07 15:41:02 -08:00
andrei
1fc0e2053b
Add support for multiple voice connections
...
With the upcoming API changes, Discord will be allowing bot users to be
onnected to more than one voice channel at a time. This commit is a
first stab at implementing that functionality in discordgo.
Voice works pretty good right now, ideally the next step is to cleanup
some of the channel-spam and weird blocking-spots.
2016-03-05 01:05:18 -08:00
Chris Rhodes
abc0e5b095
Work around a Discord server issue.
2016-02-22 00:11:39 -08:00
Bruce Marriner
94f0aacc0a
websocket heartbeat is now simplier. Closes #121
2016-02-20 15:19:55 -06:00
Chris Rhodes
457b03f66e
Fix deadlock because I'm dumb.
2016-02-19 23:00:41 -08:00
Chris Rhodes
79247272ff
Handler updates, no backwards incompatible API changes.
...
AddHandler now returns a func that can remove the handler.
The handlers map is now guarded by its own mutex.
Moved eventMap to events.go for readability.
Improved documentation.
2016-02-19 22:28:21 -08:00
Bruce Marriner
a5130cff51
Added large_threshold to connection and set to 250, closes #41
2016-02-18 22:18:03 -06:00
Bruce
296a118712
Merge pull request #113 from iopred/develop
...
Clean up mutexes around s.handlers so they exist only in discord.go
2016-02-18 21:48:31 -06:00
Bruce Marriner
eec0faa7b3
Handle VOICE_SERVER_UPDATE better, closes #115
2016-02-18 21:42:23 -06:00
Bruce Marriner
b38745945b
Added support for leaving voice channel, closes #118
2016-02-18 21:24:14 -06:00
Bruce Marriner
60149f70bb
Allow calling ChannelVoiceJoin even after connected to voice, closes
2016-02-18 02:24:29 -06:00