Commit graph

259 commits

Author SHA1 Message Date
Szymon Uglis 41a0c3d272 Add docs to shutdown hooks typedefs
Exit when provided number of shards is lower than 1
Renamed _WS to _ConnectionManager
[ci skip]
2020-08-11 12:38:58 +02:00
Szymon Uglis 619c694dc6 Add shutdown hooks for client and shard. Updated to sdk 2.9.0
[ci skip]
2020-08-07 16:10:08 +02:00
Szymon Uglis aa882ae42e Add missing VoiceState fields
[ci skip]
2020-08-02 10:51:57 +02:00
Szymon Uglis 98c805ee8b Cache mention users 2020-07-29 23:38:18 +02:00
Szymon Uglis c9ed30c040 Cache user in dm channel
[ci skip]
2020-07-28 22:21:32 +02:00
Szymon Uglis 51ad8c7428 Fix typo, dont compile regex every time and add shard getter for CommandContext, rename library names
[ci skip]
2020-07-26 23:38:53 +02:00
One-Nub 51601f247c Patch parsing snowflake from map 2020-07-21 19:11:47 -05:00
Szymon Uglis 4a79615bc1 Fix RoleTags serialization error
[ci skip]
2020-07-21 19:31:26 +02:00
Szymon Uglis b9f4278b0e Fix errors on windows
[ci skip]
2020-07-21 18:56:37 +02:00
Szymon Uglis 0bb20c29a3 Add roleTags property. discord/discord-api-docs#1537
[ci skip]
2020-07-20 18:40:49 +02:00
Szymon Uglis 17c8221bc2 Remove polling method. Moved setupDefaultLogging to Nyxx constructor with ability to disable default logger. Logger output is without colors.
[ci skip]
2020-07-15 23:51:54 +02:00
Szymon Uglis bbcd6eefe8 Overhaul pagination module. Make it customizable and modular.
[ci skip]
2020-07-13 22:00:13 +02:00
Szymon Uglis 4bd7845cea Merge remote-tracking branch 'origin/rewrite_modular_nocache' into rewrite_modular_nocache 2020-07-11 16:57:18 +02:00
Szymon Uglis edd34d3e58 nyxx.modules first draft
[ci skip]
2020-07-11 16:57:09 +02:00
Szymon Uglis 7d66fae22c Merge branch 'rewrite_modular' into rewrite_modular_nocache 2020-07-08 22:26:39 +02:00
One-Nub 43a85e4f60 Resolve type confliction for pinned message channel 2020-07-05 15:45:27 -05:00
Szymon Uglis 069f41a964 Fix docs
[ci skip]
2020-07-04 13:19:36 +02:00
Szymon Uglis 25768ec391 Fix broken createInvite method
[ci skip]
2020-07-04 13:15:45 +02:00
Szymon Uglis 0a44ed0fa6 Fix doc typos, fix return type and examples, add of and default constructor to PermissionOverrideBuilder
[ci skip]
2020-07-03 21:39:03 +02:00
Szymon Uglis baca2853a6 Added replaceField method and exposed field list in EmbedBuilder
[ci skip]
2020-07-03 20:14:31 +02:00
Szymon Uglis f5cb6112a0 Added InvalidSnowflakeException.
[ci skip]
2020-07-02 17:37:43 +02:00
Szymon Uglis df19a08639 Added minor docs.
[ci skip]
2020-07-02 17:24:59 +02:00
Szymon Uglis c33fc68dab Bring back searchMembersGateway method. Cache user if cache not missing in cache. Added minor docs.
[ci skip]
2020-07-02 16:54:28 +02:00
Szymon Uglis cce2ca3423 Sending SIGTERM OR SIGINT is closing websockets connections properly. #67
[ci skip]
2020-06-29 21:25:16 +02:00
Szymon Uglis 7d75e84428 Replace filtering functions with generic one
[ci skip]
2020-06-28 19:15:05 +02:00
Szymon Uglis 6a0e2b8c22 Fix import style
[ci skip]
2020-06-28 18:50:37 +02:00
Szymon Uglis 9ecda16b73 Fix AllowedMentions error types
[ci skip]
2020-06-28 00:35:25 +02:00
Szymon Uglis 1123727cb8 Fix prune method
[ci skip]
2020-06-28 00:25:05 +02:00
Szymon Uglis 3f4679764b Return Exception instead of plain error string
[ci skip]
2020-06-27 23:21:13 +02:00
Szymon Uglis 4606f45a66 Added private constructors to internal erros. Added documentation
[ci skip]
2020-06-27 11:59:22 +02:00
Szymon Uglis bad4bdfb45 Support message suppressing
[ci skip]
2020-06-26 21:48:56 +02:00
Szymon Uglis 8df0f9db90 Switch to interface
[ci skip]
2020-06-26 21:12:05 +02:00
Szymon Uglis b81fc735be Added clear character
[ci skip]
2020-06-26 00:43:35 +02:00
Szymon Uglis a976e63cc1 Moved notice in DiscordColor
[ci skip]
2020-06-25 19:41:48 +02:00
Szymon Uglis 00eeebdb88 Added GuildFeature wrapper
[ci skip]
2020-06-25 19:41:31 +02:00
Szymon Uglis cc49a9e111 Doc fixes, message == fix,
[ci skip]
2020-06-24 23:26:23 +02:00
Szymon Uglis 7bb4f6a987 Small doc fixes
[ci skip]
2020-06-24 13:47:33 +02:00
Szymon Uglis 065a9bba7c Fix doc strings
[ci skip]
2020-06-23 23:39:22 +02:00
Szymon Uglis 91c42084b7 Added 2 new examples.
[ci skip]
2020-06-23 21:04:01 +02:00
Szymon Uglis 4bc15e7172 Added execute method to webhook.
[ci skip]
2020-06-23 13:29:36 +02:00
Szymon Uglis 685c09364b Improved permission handling. Added ability to edit permission overrides in place.
[ci skip]
2020-06-21 19:31:05 +02:00
Szymon Uglis ab840a42a0 Fix typo
[ci skip]
2020-06-21 12:08:37 +02:00
Szymon Uglis 19652b11d5 Add examples
[ci skip]
2020-06-19 14:29:02 +02:00
Szymon Uglis f5f199a615 Removed AbstractPermissions class. Created CacheTextChannel and GuildTextChannel mixin.
Added toSnowflakeEntity extensions to int and String.
Changed api in Guild ban and kick methods to accept SnowflakeEntities.
[ci skip]
2020-06-19 14:28:47 +02:00
Szymon Uglis 329800df29 Fix error messages. Move CONNECT_ACK command at the end of callback
[ci skip]
2020-06-19 02:29:34 +02:00
Szymon Uglis 1d0fb1141b Added docs, properties to Shard, small typos
[ci skip]
2020-06-18 14:59:23 +02:00
Szymon Uglis fca76754f0 Shared zlib context for connection
[ci skip]
2020-06-18 01:16:51 +02:00
Szymon Uglis fefc197428 Docs fixes
[ci skip]
2020-06-17 23:40:13 +02:00
Szymon Uglis 30c030d174 Created more descriptive errors and exceptions
#84
[ci skip]
2020-06-16 23:12:28 +02:00
Szymon Uglis 0a39738544 Move shard file to separated package and split its contents into multiple files.
Added comments and docs. ShardManager and Shard constructors are now private.
[ci skip]
2020-06-16 00:56:07 +02:00
Szymon Uglis 9338a091fb Add dot.
[ci skip]
2020-06-15 22:14:10 +02:00
Szymon Uglis f7dc1a9b01 Moved events handling to different method. Created helper methods for connecting and disconnecting.
Shard now dont send if connection is resumed just to send it back.
[ci skip]
2020-06-15 22:13:59 +02:00
Szymon Uglis 3202ea46c5 Implement subCommands
[ci skip]
2020-06-11 19:46:57 +02:00
Szymon Uglis 61429ebf1e Give more descriptive error
[ci skip]
2020-06-11 19:46:19 +02:00
Szymon Uglis 84db7f9516 Remove unnecessary try catch 2020-06-11 13:39:17 +02:00
Szymon Uglis dcee9a27f0 Fix examples. Add and update documentation of examples.
[ci skip]
2020-06-09 21:37:59 +02:00
Szymon Uglis a8168591b3 Fix #81
[ci skip]
2020-06-07 21:17:59 +02:00
Szymon Uglis 1f803fbf6a Change from return to await. 2020-06-07 21:16:00 +02:00
Szymon Uglis f4c2d61ee8 Listen for SIGTERM and SIGINT signals. Dont send terminate command to shard. #67
[ci skip]
2020-06-06 21:00:30 +02:00
Szymon Uglis bcd0c4179b Added gateway latency getter to Shard
[ci skip]
2020-06-05 16:11:25 +02:00
Szymon Uglis 76d8f2ae82 Added support for initial presence
[ci skip]
2020-06-05 13:25:09 +02:00
Szymon Uglis aea584cea9 Remove http dependency. Add client and shardId to CommandContext 2020-06-05 12:22:42 +02:00
Szymon Uglis bc6520d483 [WIP] Added voice connection methods to VoiceChannel.dart
Ready event wont be triggered until all shards connected.
Fixed websocket connection and reconnection problems
[ci skip]
2020-06-05 00:43:33 +02:00
Szymon Uglis 6a400b5f07 [WIP] Added customizable gateway payload compression and added guild subscriptions option to identify
[ci skip]
2020-06-04 14:04:40 +02:00
Szymon Uglis db111932ae Merge remote-tracking branch 'origin/rewrite_modular' into rewrite_modular 2020-06-04 11:04:16 +02:00
Szymon Uglis c0455ade87 Change on Exception to on Error
[ci skip]
2020-06-04 11:04:07 +02:00
Szymon Uglis 70c3d585d5 [WIP] Added error handling, fixed connection problems fix channel update event deserialization
[ci skip]
2020-06-04 11:01:49 +02:00
Szymon Uglis 472e65d8d4 [WIP] Added missing methods to shard manager, redone emojis, code formatting
[ci skip]
2020-06-03 00:15:17 +02:00
Szymon Uglis a628903f43 [WIP] Proper handling for connecting shards
fixed client deserialization in channel create event
adjust shard count in nyxx and client options,
[ci skip]
2020-06-02 00:11:02 +02:00
Szymon Uglis d745c5e65f [WIP] Initial draft of sharding
[ci skip]
2020-06-01 14:22:12 +02:00
Szymon Uglis 0787f051ab Add extensions on String and int for converting them into Snowflake
[ci skip]

Add docs to extensions
[ci skip]
2020-06-01 00:23:04 +02:00
Szymon Uglis ea111117fb Fix last commit. Remove unused package, catch Error properly
[ci skip]
2020-05-31 23:28:15 +02:00
Szymon Uglis c60864fab4 Docs fixes and additions. Code structure fixes, optimizations
[ci skip]
2020-05-28 22:08:05 +02:00
One-Nub 9ebbd95595 Adding documentation to ActivityType constants 2020-05-23 22:40:44 -05:00
One-Nub 7e558a249b Changing custom presence value to 4 instead of 3 2020-05-23 22:28:10 -05:00
Szymon Uglis b7b8f6167e Cacheless Guild, Emoji, Reaction, Role
[ci skip]
2020-05-21 00:55:14 +02:00
Szymon Uglis e120c92314 Cacheless Message
[ci skip]
2020-05-21 00:22:49 +02:00
Szymon Uglis f741fe1752 Type fixes on Channels
[ci skip]
2020-05-21 00:04:01 +02:00
Szymon Uglis aff150cc40 Dont require cache - channels
[ci skip]
2020-05-20 22:35:48 +02:00
Szymon Uglis b6afeb4891 Analyzer fixes
[ci skip]
2020-05-18 15:18:37 +02:00
Szymon Uglis 781bfbb38e Rewritten analyzer rules. First docs and style changes. #73
[ci skip]
2020-05-17 21:59:52 +02:00
Szymon Uglis 019a9e74d9 Implemented searching members via websocket - #72.
Added handler in case if internal http error occurs.
Made Constants and OPCodes public. Removed and fixed redundant code in OPCodes.
NNBD minor fixes. When shard resumes after disconnection no lomger ready event is emmited.
[ci skip]
2020-05-16 23:56:45 +02:00
Szymon Uglis 08ac7fe6ee Added support for include_roles in guild pruning. Further fixes for dart dev 2.9
[ci skip]
2020-05-15 23:18:26 +02:00
Szymon Uglis 3828994631 Support for sdk 2.9.0-9.0.dev
[ci skip]
2020-05-14 21:06:44 +02:00
Szymon Uglis beb62733c2 Fix examples to be less confusing for new users
[ci skip]
2020-05-14 21:05:59 +02:00
Szymon Uglis c911a941bb Added MessageChunkEvent. Fixes for latest dart sdk.
[ci skip]
2020-05-14 01:19:00 +02:00
Szymon Uglis 94f0082c18 Merge branch 'rewrite_modular' of github.com:l7ssha/nyxx into rewrite_modular 2020-05-14 00:35:46 +02:00
Szymon Uglis 126fb42551 Added support for news channels crossposts.
discord/discord-api-docs#1510
2020-05-14 00:33:19 +02:00
One-Nub 1cd179c150 Have a DMChannel be recognized properly.
Before it would be recognized and sent to the user as a "GUILD_CATEGORY".
2020-05-10 12:49:24 -05:00
Szymon Uglis 8b774fe899 Merge branch 'rewrite_modular' of github.com:l7ssha/nyxx into rewrite_modular 2020-05-08 16:06:44 +02:00
Szymon Uglis 996e6ee877 Merge branch 'rewrite_modular' of github.com:l7ssha/nyxx into rewrite_modular 2020-05-08 16:03:20 +02:00
Szymon Uglis da8d966d16 Added IEnum class [ci skip] 2020-05-08 16:03:16 +02:00
One-Nub eff8ae2722 Removing private access where currently feasible 2020-05-07 17:12:20 -05:00
One-Nub 06f688e5ce Updating == operator 2020-05-07 15:59:55 -05:00
One-Nub fbb9c3933a Fixing setPresence method 2020-05-07 14:38:19 -05:00
Szymon Uglis e75c492823 Added List Members endpoint 2020-05-07 00:06:13 +02:00
Szymon Uglis 26bad5c29e Add search members api endpoint
[ci skip]
2020-05-04 23:58:11 +02:00
Szymon Uglis bc9df945af Change api host to discord.com
[ci skip]
2020-05-04 22:27:51 +02:00
Szymon Uglis 2efcdef9dc Renamed JsonRequest to BasicRequest. Removed Downloadable interface.
[ci skip]
2020-05-02 22:26:52 +02:00
Szymon Uglis abfd68baee objects package remved to core. Moved several files to more logical locations
[ci skip]
2020-04-29 02:02:41 +02:00
Szymon Uglis e95713530f Removed support for browser, once again.
[ci skip]
2020-04-29 01:49:20 +02:00
Szymon Uglis 197d87c763 Renamed internal import, NyxxVM and NyxxBrowser are now methods instead of classes, HttpHandler is now private, added formattedDiscriminator property to User
[ci skip]
2020-04-29 01:05:10 +02:00
Szymon Uglis 6c8f607356 Added guild getter to Nyxx, added parameters to specify if you want to use cache
[ci skip]
2020-04-28 19:00:09 +02:00
Szymon Uglis cd2c149a08 Implemented guild preview
[ci skip]
2020-04-28 01:33:30 +02:00
Szymon Uglis 45eceeaf57 Improved cache handling. Removed raw event. Removed BeforeHttpRequestSendEvent.
Divided Message into 2 other classes. Rewritten most events handling. Added ids of object besides objects alone to events.
Code cleanup. Removed onMessage, onRaw, onGuildUnavailable events. Dart 2.9.0-dev support.
#61 #35
[ci skip]
2020-04-25 00:45:11 +02:00
Szymon Uglis 8090674c22 Typo
[ci skip]
2020-04-21 12:14:45 +02:00
Szymon Uglis d69c2341e7 Implement webhook edit method
[ci skip]
2020-04-21 12:07:45 +02:00
Szymon Uglis d316c44f5e Implement webhook type
[ci skip]
2020-04-21 00:40:30 +02:00
Szymon Uglis 456123ec91 Add default avatar for webhook, removed send function from webhook
[ci skip]
2020-04-21 00:22:52 +02:00
Szymon Uglis bb255e325c Change fields to final
[ci skip]
2020-04-20 17:07:02 +02:00
Szymon Uglis f4f1c6096a Fixes to rate limiting
[ci skip]
2020-04-20 14:30:33 +02:00
Szymon Uglis 4bc01863c6 Shard fixes - removed unnecessary fields, tweaked emitting readyEvent, changed naming of events, removed dead code; #59
[ci skip]
2020-04-17 15:57:49 +02:00
Szymon Uglis 821cca0cc5 Rewrite of Http backend; #62
[ci skip]
2020-04-17 15:55:31 +02:00
Szymon Uglis 57fbf1b013 Migrate code to spread collections syntax, add new channel types, NNBD fixes, added and fixes few docstrings
[ci skip]
2020-04-15 23:24:53 +02:00
Szymon Uglis eb0a3398fd Move function to generate attachment url to AttachmentBuilder class
[ci skip]
2020-04-14 23:19:42 +02:00
Szymon Uglis b6f6b2d802 Implement allowedMentions
[ci skip]
2020-04-14 20:42:13 +02:00
Szymon Uglis 90e05f3e98 Re-do Member class constructors
[ci skip]
2020-04-13 17:45:14 +02:00
Szymon Uglis 9f0efd8deb Initial improvements to handling attachments
[ci skip]
2020-04-13 14:45:55 +02:00
Szymon Uglis 614362bfcc Implement changes from 2.8.0-dev.20.0 sdk
[ci skip]
2020-04-12 20:06:13 +02:00
Szymon Uglis 5f366edb7f Fix VoiceState and MessageEvent nullable fields 2020-04-12 18:51:36 +02:00
Szymon Uglis f800e88139 Reorder fields 2020-04-12 18:31:25 +02:00
Szymon Uglis c77ede5aaf NNBD small fixes
[ci skip]
2020-04-12 18:28:48 +02:00
Szymon Uglis e850dba100 Snowflake now hold data in int
[ci skip]
2020-04-12 18:28:27 +02:00
Szymon Uglis 053d6086c0 Implement hoisted_role field in Member; discord/discord-api-docs#1378
[ci skip]
2020-04-11 00:17:40 +02:00
Szymon Uglis 1592931b4e Add 4014 close code; discord/discord-api-docs#1495
[ci skip]
2020-04-10 20:45:30 +02:00
Szymon Uglis 798db2151b Fix discriminator parsing
[ci skip]
2020-04-09 21:23:41 +02:00
Szymon Uglis 5380c4e75f Implement gateway intents; discord/discord-api-docs#1307
[ci skip]
2020-04-09 18:56:09 +02:00
Szymon Uglis e88fdfe4fd Implement undocumented user flags; discord/discord-api-docs#1493
[ci skip]
2020-04-09 18:04:14 +02:00
Szymon Uglis 93849145aa Implement undocumented MessageType; discord/discord-api-docs#1265
[ci skip]
2020-04-09 18:00:51 +02:00
Szymon Uglis 6db7599d56 Fix webhook getters and remove unnecessary late final keywords from variable declaration in Embed class
[ci skip]
2020-04-09 17:55:19 +02:00
Szymon Uglis cd1beb1fab Fixed webhook send endpoint, added ability to set webhook avatar. Changed discriminator data type to int from string. Fixed few doc strings.
[ci skip]
2020-04-09 13:57:17 +02:00
Szymon Uglis 4587042f76 Fix errors messages
[ci skip]
2020-04-09 12:12:39 +02:00
Szymon Uglis 54af480fec Implemented new message features
[ci skip]
2020-04-09 02:03:06 +02:00
Szymon Uglis f1813a703e Implemented new permissions
[ci skip]
2020-04-08 23:44:35 +02:00
Szymon Uglis 1dea45f372 Implement new Invite event and new fields in User object.
discord/discord-api-docs#1309
[ci skip]
2020-04-08 23:28:14 +02:00
Szymon Uglis 3eda48c532 Fixed spelling
[ci skip]
2020-04-07 12:58:23 +02:00
Szymon Uglis e5b1ef9388 Use constant instead of hardcoded url
[ci skip]
2020-04-07 12:36:43 +02:00
Szymon Uglis d3edf56519 Implement avatar url getter
[ci skip]
2020-04-07 12:36:25 +02:00
Szymon Uglis bb0c54aa39 Renamed oauth directory to application, added discriminator and tag to IMessageAuthor, GuildChannel uses now mixin keyword, added iconUrl method for ApplicationGuild
[ci skip]
2020-04-07 12:33:53 +02:00
Szymon Uglis 4fb5509d6a Remove close() function
[ci skip]
2020-04-05 21:21:40 +02:00
Szymon Uglis 47a6516996 NNBD optimizations and bu fixes
[ci skip]
2020-04-05 00:08:50 +02:00
Szymon Uglis 00fbfff98c Revert Logger.detached to Logger
[ci skip]
2020-04-05 00:07:58 +02:00
Szymon Uglis a632fb5249 Do not create new streams, reuse clients ones. Affects #52
[ci skip]
2020-04-04 20:18:15 +02:00
Szymon Uglis 294385a30d NNBD part 7 - Commands [ci skip] 2020-04-02 19:08:49 +02:00
Szymon Uglis 367c20b182 NNBD part 6 [ci skip] 2020-04-01 18:53:29 +02:00
Szymon Uglis a9a66b9bad NNBD part 5 [ci skip] 2020-03-24 17:16:04 +01:00
Szymon Uglis 29aa0dae40 NNBD part 4 [ci skip] 2020-03-23 18:25:40 +01:00
Szymon Uglis 18671c0cca NNBD part 3 [ci skip] 2020-03-22 22:45:20 +01:00
Szymon Uglis 8048d8d60d NNBD part 2 [ci skip] 2020-03-22 14:35:22 +01:00
Szymon Uglis f55e375a2e Merge remote-tracking branch 'origin/rewrite_modular' into rewrite_modular 2020-03-21 23:19:25 +01:00