Commit graph

231 commits

Author SHA1 Message Date
Kedas
dec4d43ba0
feat(Session): Add GatewayWriteStruct function (#1409)
---------

Signed-off-by: Mia <m@yarn.network>
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2024-07-07 22:20:55 +03:00
Fedor Lapshin
b51655404a
feat: add UpdateCustomStatus (#1425)
Add Session.UpdateCustomStatus, which allows to set and reset the custom status of a bot.
2023-09-02 01:38:18 +03:00
Loghin Alexandru
a90485df0c
feat(ws): add toggle for voice reconnects on session reconnect (#1350)
* Add flag for voice reconnect on session reconnect

* Rename ShouldReconnectVoiceConnOnError toggle as suggested

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Fix indentaion for discord.go

* Change wording in docs

---------

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2023-06-05 16:21:06 +03:00
Rick Staa
2998b2c67d
feat: add UpdateWatchStatus function (#1291)
This commit adds the UpdateWatchStatus method
2022-12-03 01:31:02 +03:00
Andrew Garvin
f36b5430a8
docs(UpdateStatusData): fix a typo (#1276) 2022-11-08 23:20:35 +03:00
Wynell
262e8ba52b
Add dialer property in config (#1179)
Co-authored-by: eeWynell <eewynell@gmail.com>
2022-08-13 23:42:42 +03:00
Pancake-e
6f6516bf79
Updated RequestGuildMembers method and GuildMembersChunk event struct (#1156)
* Updated RequestGuildMembers method and GuildMembersChunk event struct

* Added nonce support to RequestGuildMembersBatch and code refactoring

* Minor change to RequestGuildMembersBatchList

* Removed usage of []json.Number in RequestGuildMembersBatchList

* Minor update to GuildMembersChunk struct and comments
2022-04-15 21:20:02 +03:00
nitroflap
5056d53d17 Revert "feat(structs#Session): made sessionID and sequence fields public"
This reverts commit 4390b565fa.
2022-02-27 18:11:50 +03:00
nitroflap
4390b565fa
feat(structs#Session): made sessionID and sequence fields public 2022-02-27 17:46:03 +03:00
Han Seung Min - 한승민
9f89234f3f
Update invalid link to docs (#1010) 2021-10-10 11:02:24 -04:00
courtier
3fcad20924 Fix all the typos that goreportcard detected. 2021-05-06 01:06:45 +02:00
Carson Hoffman
37088aefec
Send [] rather than null on empty activities slice 2021-03-06 12:06:38 -05:00
Carson Hoffman
9548146f69
Fix comment on UpdateGameStatus 2021-01-20 19:34:05 -05:00
Carson Hoffman
c41dc15a10
Add changes to presences, remove Game type 2021-01-20 18:54:38 -05:00
Carson Hoffman
cead8c70f6
Fix double commit on merge 2020-06-20 22:51:20 -04:00
Carson Hoffman
1294b313b9
Release version v0.21.0 2020-06-20 20:58:22 -04:00
Carson Hoffman
103055d2be
Add presences field to RequestGuildMembers 2020-06-20 19:55:19 -04:00
Noah Santschi-Cooney
69edfdf4ac
discordapp.com -> discord.com (#772)
Change API URL from discordapp.com to discord.com
2020-05-08 21:26:13 -04:00
Carson Hoffman
45124d8303 Revert "Changed domain from discordapp.com to discord.com (#769)"
This reverts commit f4ca8874a3.
2020-05-07 12:27:07 -04:00
Hunter Paulson
f4ca8874a3
Changed domain from discordapp.com to discord.com (#769)
* Allow resume on reconnect

* Version 0.20.3: allow resume on reconnect

* Update index.md

* Update README.md

* Update GettingStarted.md

* Update endpoints.go

* Update README.md

* Update event.go

* Update wsapi.go

* Update restapi.go

* Resolved spelling issue

Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
2020-05-04 21:13:28 -07:00
Eric Wohltman
44c2b25369 Fix godoc style exported function comments 2020-04-21 08:16:51 -04:00
Carson Hoffman
84ad2a796d
Merge pull request #760 from ewohltman/websocket-error-log-level
Change log level for websocket connection failure from warning to error
2020-04-12 23:13:52 -04:00
Carson Hoffman
aba3c0c056
Allow resume on reconnect 2020-04-11 23:07:03 -04:00
Carson Hoffman
1789227299
Allow resume on reconnect 2020-04-11 22:34:49 -04:00
Eric Wohltman
3fa12df9f0 Change log level for websocket connection failure from warning to error 2020-04-07 14:00:36 -04:00
Bruce Marriner
973580a2ba Initial commit of ExposeIdentify feature 2020-01-20 12:01:58 -06:00
MistahJ
49f3160ac4 clean up returns 2019-12-27 17:50:21 -07:00
MistahJ
c3e4a2dea8 fix typo 2019-12-27 17:44:20 -07:00
MistahJ
cc90f690b3 go fmt 2019-10-27 20:41:12 -07:00
MistahJ
f4d9341a31 Improvements 2019-10-26 14:09:55 -07:00
MistahJ
7057551cd0 go fmt file 2019-10-25 01:53:26 -07:00
MistahJ
0219fb9901 Support for Batch Request Guild Members
This is supported by the Discord API and will save requests.
2019-10-25 01:31:19 -07:00
Simon
e405cbd54c handle empty channel id in ChannelVoiceJoinManual (#672) 2019-07-21 21:02:54 -07:00
Christopher Felegy
60dbc5557c fix: remove _trace from helloOp
As per discordapp/discord-api-docs#967, _trace in OP10 HELLO is no
longer an array of strings, but rather an undefined glob of data that
presently contains a mixed bag of strings and objects.

type helloOp does not seem to be exposed outside of the library, so this
is not a breaking change; furthermore, the Trace field of helloOp was
not used anywhere within the library. It seems like it would be safer to
just remove the field outright, rather than accept it as an interface{}
and waste cycles unmarshaling data that is never used.

This is a critically breaking bug, as if the upstream change is merged,
bots using DiscordGo prior to this patch will be unable to connect; an
error would occur when trying to unmarshal the new data glob into a
[]string, causing (*Session).Open() to prematurely return.
2019-05-29 13:54:56 -04:00
robbix1206
aca3f3898c Remove code duplication in ChannelVoiceJoin (#611) 2018-11-05 17:37:18 -08:00
Connor Wright
c8554477e4 Add HeartbeatLatency method (#593)
* Latency method

* fixed typo

* fixed linter error

* Renamed Latency to HeartbeatLatency

* HeartbeatLatency now returns time.Time

* return time.Duration instead, since .Sub() returns that

* Add full-stops to end of comments
2018-09-26 13:22:21 -07:00
Bruce Marriner
8dc444f78a Moved noisy heartbeat logs to Debug 2018-08-31 14:26:02 +00:00
Skippy
c53a1b54c9
Merge pull request #578 from foxbot/feature/manual-voice-connection
feature: add ChannelVoiceJoinManual
2018-08-27 11:19:19 -05:00
Skippy
70fa40c872
Merge pull request #491 from cookkkie/patch-1
Drop the default gorilla websocket close handler
2018-08-27 10:33:16 -05:00
Christopher F
a089b52f64 feature: add ChannelVoiceJoinManual
This resolves #577.

ChannelVoiceJoinManual is a wrapper over sending an OP4 to Discord, for
initiating a voice server connection. The library's builtin voice
connection management locks/maps are skipped, and the library will not
attempt to manage this voice connection.

Users are expected to hook the VoiceServerUpdate event and forward the
data to an outside voice manager, such as Lavalink.
2018-08-22 21:04:44 -04:00
Chris Rhodes
7f8369a45f Clean up status methods. 2018-02-08 21:00:24 -08:00
Daniel Thorpe
e8cd93cf15 Add a listening status method (#508)
* Bump to v0.17.0

* Add members from GuildMembersChunk to state (#454)

* Revert "Add members from GuildMembersChunk to state (#454)" (#455)

This reverts commit e4487b30d4.

* travis: update go versions

* Allowed setting the game to null.

* Allowed for setting status to listening.

* Changed variable names for better consistency

* Reverted updateStatus to maintain API compatibility, instead added now
UpdateListeningStatus method which directly calls UpdateStatusComplex.

* Fix version to 0.18.0-alpha

* Make the new UpdateListeningStatus read a bit better.

* Updated setting game to nil for better compatibility.

* Remove the explicit nil check, as no longer seems to be needed.

* Fix comment styling.

* Remove idle as unused.
2018-02-08 20:50:07 -08:00
Carson Hoffman
a0faf9a0d0 Removed unnecessary error check (#505) 2018-01-22 14:32:00 -08:00
Anis B
4523c46927
Drop the default websocket close handler 2017-12-09 16:23:21 +01:00
vim2meta
1033558fcf
Update wsapi.go 2017-11-19 10:15:13 -05:00
Bruce Marriner
9e1220d82b Lint :) 2017-11-11 15:18:37 +00:00
Bruce Marriner
7d1657e59b Open() func now validates connection, fixed #198
Now the open function will follow through a bit more and insure that the
proper sequence of events happens during the Open call.  This required
some refactoring and a few mild changes in the onEvent func.
2017-11-11 15:04:56 +00:00
Bruce Marriner
a948670657 Add comments 2017-11-08 19:59:54 +00:00
Cory Ory
8737777ce7 Implement Raw sending of status (Rich Presence and Online Status) (#462)
* Added ability to change the online status

* Add structs for rick presence implementation

* Refractor and publicise UpdateStatusData

* Add UpdateStatusComplex for raw status data sending

* Case gameType to int, stopped it compiling

* Might want to gofmt.

Doesn't do it on save because Gogland removed it and their new thing I
can't make sense of.

* Revert "Added ability to change the online status"

This reverts commit 235cd15a8eebbec070cb95a5853295387bceae1c.

* Change gametypeto match

* Move RLock to UpdateStatusComplex
2017-10-22 14:08:08 -07:00
jD91mZM2
9da2c9e76a Added GameType (#435)
* Added GameType

* Delete useless function
2017-10-07 10:54:04 -07:00