Commit graph

33 commits

Author SHA1 Message Date
Rareș Nagy
2c9c884e4f
chore(tests): fix typo (#1520) 2024-05-14 15:33:16 +03:00
42Atomys
9448b0eb96
Add Guild Scheduled Event Support (#1032)
* Add Guild Scheduled Events support

* Add missing Indents for Guild Scheduled Events

* fix: Do update from new schedules updates and repository updates

* doc: Add missing documentation on const

* doc: Add missing documentation on events struct

* tests: Add a Skip condition when dgBot is not set to prevent segfault

* fix: Somes changes following the last review steps

* docs: Add an example to manipulate GuildScheduledEvent

* clean: Remove useless pointers on struct used to retrieve data

* tests: Test extra query params on GuildScheduledEventUsers requests

* clean: Remove unused variables

* feat: Add nullable types to provide null value to Discord API when is necessary

* feat: Use NullableString in ScheduledEvents

* docs: Add example for usage of NullableString

* Update structs.go

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

* Update restapi.go

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

* fix: Review changes to move back nullable string into a simple MarshalJSON

* fix: Remove NullString on tests and examples

* doc: Add missing doc

* Update structs.go

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

* fix: misunderstood MarhsalJSON

* fix: Follow the convention of discordgo on url.Values

* Update examples/scheduled_events/main.go

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

* changes: use conditional instead on Sprintf

* fix: Add missing status on Params

* Update structs.go

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

* Update structs.go

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

* changes: Move flag.Parse inside the init function

* fix: remove null statement of test suite

* fix: Rewrite Marshal of GuildScheduledEventParams to prevent a stack overflow on marshall same type

* clean: Remove unused Intents

* Update restapi.go

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

* Update restapi.go

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

* Update restapi.go

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

* doc: polish the documentation

* clean: Final polish code

* doc: Add information about 1:1 usage

* Update discord_test.go

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

* doc: remove unnecessary additional infos

* Update structs.go

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

* Update discord_test.go

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

* Update restapi.go

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

* chore(examples/scheduled_events): removed NullString comment

* fix(structs): grammar in comment to EntityType

* fix: run gofmt

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-02-27 18:22:31 +03:00
nitroflap
d8f15b1bc6
feat(discord_test): check for DGU_TOKEN for compatibility 2022-02-16 16:41:37 +03:00
nitroflap
12b412a989
feat(discord_test): rewrote init as TestMain 2022-02-16 16:39:50 +03:00
nitroflap
3d0ad546d1
feat(discord_test#init): check for oauth2 token 2022-02-16 16:38:21 +03:00
nitroflap
5bf32ec183
feat: dropped unnecessary tests for New function 2022-02-08 17:15:51 +03:00
Carson Hoffman
c41dc15a10
Add changes to presences, remove Game type 2021-01-20 18:54:38 -05:00
Bruce Marriner
0d2878bac4 Remove tests against email/password. 2017-12-27 20:03:15 +00:00
jonas747
389ba8760d Add bot account to testing 2017-07-08 15:38:34 +02:00
Chris Rhodes
36601253a4 Remove use of reflect.
This introduces gogenerate'ed EventHandlers from the files in events.go

This also adds support for AddHandlerOnce.
2016-12-03 23:31:07 -08:00
Bruce Marriner
9d715837f6 Rewrite test to avoid data race 2016-06-17 14:23:40 -05:00
Bruce Marriner
6c4d9f0ad7 Removed unused func 2016-06-17 13:56:01 -05:00
Bruce Marriner
5322552229 Fix data race in tests 2016-06-17 13:12:42 -05:00
Chris Rhodes
84d430918b Fix handler tests. 2016-06-04 18:13:46 -07:00
Bruce Marriner
862c3ebeb1 Removed debug setting 2016-04-25 13:32:31 -05:00
Bruce Marriner
2aa94c20ae Added test back. 2016-04-25 13:27:34 -05:00
Bruce Marriner
b3fcbe7e4f Removed test causing odd problems.
Will debug and re-eval.
2016-04-25 12:14:27 -05:00
Chris Rhodes
2b4b19cfd8 Fixed some test comment wording. 2016-02-19 22:44:06 -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
Chris Rhodes
88335b6f54 Small performance improvement. Added tests. 2016-02-14 19:01:45 -08:00
Bruce Marriner
ec52ad0a8d Commented out two unused envars 2016-01-28 11:12:07 -06:00
Bruce Marriner
edc09778a7 Linting. 2016-01-28 08:36:09 -06:00
Bruce Marriner
ad1d0fac60 Tiny bit more test. 2016-01-22 17:17:06 -06:00
Chris Rhodes
8b39278c3e Get rid of Listen. 2016-01-21 10:58:13 -08:00
Chris Rhodes
7d984e7df6 Add test for u/p/token login. 2016-01-20 23:48:30 -08:00
Chris Rhodes
2cbd402bae Make InvalidToken test useful again. 2016-01-20 23:45:36 -08:00
Chris Rhodes
5f9326d165 Clean up tests further. 2016-01-20 23:38:17 -08:00
Chris Rhodes
13086b8da3 Fix tests. 👌 2016-01-20 23:14:42 -08:00
Bruce Marriner
591162a2ff Don't close what doesn't exist. 2016-01-11 14:59:24 -06:00
Bruce Marriner
367594be1f Testing Close(), store token from Email/Pass New if ran. 2016-01-11 14:33:50 -06:00
Bruce Marriner
1da7bf090b Changed envars from USERNAME to EMAIL 2016-01-11 13:02:16 -06:00
Bruce Marriner
dc9357f61d Changes to make these work in same folder. 2016-01-11 12:06:06 -06:00
Bruce Marriner
d71a43192f Renamed to match source 2016-01-11 12:04:42 -06:00
Renamed from discordgo_test.go (Browse further)