Flori
6f3bd04963
Enable saving and loading LimitsConfiguration ( #152 )
...
Impl Serialize, Deserialize for LimitsConfiguration and children
2023-07-14 17:38:54 +02:00
SpecificProtagonist
db0b1131ed
Deduplicate gateway dispatch event handling ( #148 )
...
deduplicate gateway dispatch event handling
2023-07-11 20:11:13 +02:00
kozabrada123
a0d2fc8213
Add some docs
2023-07-11 19:54:04 +02:00
kozabrada123
3b35f03993
Merge branch 'main' into fix/doc-improvements
2023-07-11 19:24:37 +02:00
Zert3x
0d6d705e46
Async Observer Trait ( #147 )
2023-07-11 19:20:27 +02:00
kozabrada123
18ac7b5708
Rustdoc warnings + misc changes
2023-07-10 18:06:45 +02:00
kozabrada123
322894e4e9
UrlBundle slightly better docs
2023-07-10 17:22:31 +02:00
kozabrada123
192f12d892
/* -> ///
2023-07-10 16:59:00 +02:00
Flori
69b7c2445c
Ratelimiter overhaul ( #144 )
...
* Rename limits and limit to have better names
* Remove empty lines
* Remove handle_request (moved to requestlimiter)
* Start working on new ratelimiter
* Make limits Option, add "limited?" to constructor
* Add missing logic to send_request
* Rename Limits
* Create Ratelimits and Limit Struct
* Define Limit
* Import Ratelimits
* Define get_rate_limits
* Remove unused import
* + check_rate_limits & limits_config_to_ratelimits
* Remove Absolute Limits
These limits are not meant to be tracked anyways.
* add ratelimits is_exhausted
* Add error handling and send request checking
* change limits to option ratelimits
* Add strum
* Change Ratelimits to Hashmap
* Remove ratelimits in favor of hashmap
* Change code from struct to hashmap
* start working on update rate limits
* Remove wrong import
* Rename ChorusLibError to ChorusError
* Documented the chorus errors
* Made error documentation docstring
* Make ReceivedErrorCodeError have error string
* Remove unneeded import
* Match changes in errors.rs
* Improve update_rate_limits and can_send_request
* add ratelimits.to_hash_map()
* use instances' client instead of new client
* add LimitsConfiguration to instance
* improve update_limits, change a method name
* Fix un-updated errors
* Get LimitConfiguration in a sane way
* Move common.rs into ratelimiter::ChorusRequest
* Delete common.rs
* Make instance.rs use overhauled errors
* Refactor to use new Rate limiting implementation
* Refactor to use new Rate limiting implementation
* Refactor to use new Rate limiting implementation
* Refactor to use new Rate limiting implementation
* Refactor to use new Rate limiting implementation
* Refactor to use new Rate limiting implementation
* update ratelimiter implementation across all files
* Fix remaining errors post-refactor
* Changed Enum case to be correct
* Use result
* Re-add missing body to request
* Remove unneeded late initalization
* Change visibility from pub to pub(crate)
I feel like these core methods don't need to be exposed as public API.
* Remove unnecessary import
* Fix clippy warnings
* Add docstring
* Change Error names across all files
* Update Cargo.toml
Strum is not needed
* Update ratelimits.rs
* Update ratelimits.rs
* Bug/discord instance info unavailable (#146 )
* Change text to be more ambigous
* Use default Configuration instead of erroring out
* Emit warning log if instance config cant be gotten
* Remove import
* Update src/instance.rs
Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
* Add missing closing bracket
* Put limits and limits_configuration as one struct
* Derive Hash
* remove import
* rename limits and limits_configuration
* Save clone call
* Change LimitsConfiguration to RateLimits
`LimitsConfiguration` is in no way related to whether the instance has API rate limits enabled or not. Therefore, it has been replaced with what it should have been all along.
* Add ensure_limit_in_map(), add `window` to `Limit`
* Remove unneeded var
* Remove import
* Clean up unneeded things
Dead code warnings have been supressed, but flagged as FIXME so they don't get forgotten. Anyone using tools like TODO Tree in VSCode can still see that they are there, however, they will not be shown as warnings anymore
* Remove nested submodule `limit`
* Add doc comments
* Add more doc comments
* Add some log messages to some methods
---------
Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
2023-07-09 18:38:02 +02:00
kozabrada123
3f6d0e2d9d
Use log instead of prints
2023-07-01 19:29:50 +02:00
Vincent Junge
94a051631f
require password to log in
2023-06-25 22:34:05 +02:00
Vincent Junge
8b0f41fad3
remove client side validation
2023-06-25 11:36:37 +02:00
Flori Weber
c25795ab4d
Make ReactionMeta::get() return Vec<PublicUser>
2023-06-23 12:54:08 +02:00
Flori Weber
6c9df9508e
Fix stupid multi line comments
2023-06-23 12:18:22 +02:00
Flori
8fdbd7d84f
Merge pull request #130 from polyphony-chat/refactor/change-channel-modify
...
Refactor/change channel modify
2023-06-22 20:05:15 +02:00
Flori Weber
c00cc215fe
Remove wrongful match statement
2023-06-22 19:54:39 +02:00
Flori
6c0faa29f3
Update src/api/channels/channels.rs
...
Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
2023-06-22 19:42:07 +02:00
Flori Weber
7fb37ff204
Make Channel::modify() take &mut self
2023-06-22 18:56:16 +02:00
Vincent Junge
d52acd9093
always use Snowflakes in args
2023-06-22 18:55:19 +02:00
Vincent Junge
f98180cd03
ChorusResult type alias
2023-06-21 21:39:22 +02:00
Vincent Junge
709ef11f2c
get channel messages
2023-06-21 14:46:45 +02:00
Flori Weber
62f6bfa363
Change send_request() calls to pass &mut Instance
2023-06-20 22:42:42 +02:00
Flori Weber
6650bcf1df
Use Instance.client instead of creating a new one.
2023-06-20 22:42:08 +02:00
Flori Weber
6542a7a362
Add reqwest::Client to chorus::Instance.
2023-06-20 22:41:31 +02:00
Flori Weber
6eb3cf65d1
Change to single-line docstring
2023-06-20 22:36:39 +02:00
Flori Weber
20f39a409d
Multiline docstring to single line docstring
2023-06-20 22:30:42 +02:00
Flori Weber
0f085491a0
Merge branch 'main' into refactor/reuse-reqwest-client
2023-06-20 22:21:08 +02:00
Flori Weber
c08ec54f92
Change docstring from multi- to singleline
2023-06-20 22:20:06 +02:00
Flori
a9dbde4122
Merge pull request #122 from SpecificProtagonist/winter
...
More consistent use of snowflakes
2023-06-20 22:16:54 +02:00
Vincent Junge
55b0f268e2
more consistent use of snowflakes
2023-06-20 22:03:29 +02:00
Flori
2c6becb361
Merge pull request #121 from polyphony-chat/fix/cannot-connect-to-discord
...
Remove unnecessary things
2023-06-20 21:54:53 +02:00
Flori
03df0ae9cf
Merge pull request #114 from SpecificProtagonist/snowflake
...
Simplify Snowflake
2023-06-20 18:57:25 +02:00
Flori
225b6e4798
Merge pull request #117 from SpecificProtagonist/gateway-event
...
Simplify GatewayEvent
2023-06-20 18:57:13 +02:00
kozabrada123
cd98de286f
Change Option<ChorusLibError> to Result<(), ChorusLibError>
2023-06-20 18:26:30 +02:00
Vincent Junge
1df01512d7
simplify GatewayEvent
2023-06-20 16:12:13 +02:00
Vincent Junge
9c7031abde
UrlBundle remove getters
2023-06-20 12:29:52 +02:00
Vincent Junge
f9619dde8d
simplyfy Snowflake
2023-06-20 12:21:22 +02:00
Flori Weber
a5afada13f
Remove unnecessary things
2023-06-20 00:35:46 +02:00
Flori Weber
ec3a531f48
apply clippy suggestions
2023-06-19 19:01:18 +02:00
Flori Weber
5dbb627322
change post to delete
2023-06-19 18:12:09 +02:00
Flori Weber
51e7cc003a
Add Eq, PartialEq derives
2023-06-19 18:12:01 +02:00
Vincent Junge
c06778fc71
Fix clippy::await_holding_refcell_ref false positives
2023-06-19 16:46:58 +02:00
Flori Weber
cac12decad
Fix build failing
2023-06-19 16:11:53 +02:00
Vincent Junge
f0241e0756
Make MessageSendSchema fields public
2023-06-19 14:21:27 +02:00
Vincent Junge
208eeac536
Fix various Clippy lints
2023-06-19 12:35:07 +02:00
Flori Weber
1cb672faa6
Add remove_relationship
2023-06-18 23:10:29 +02:00
Flori Weber
f658f3fe61
Remove unneccessary imports
2023-06-18 23:04:25 +02:00
Flori Weber
8c68e8bd77
Add modify_user_relationship
2023-06-18 23:02:49 +02:00
Flori Weber
fa524b1791
Fix errors not displayed, add InvalidArgumentsErr
2023-06-18 23:01:38 +02:00
Flori Weber
3aa162cfc7
Move FriendRequestSchema to schemas
2023-06-18 19:05:09 +02:00
Flori Weber
3102ea8057
Create relationship schemes
2023-06-18 19:04:55 +02:00
Flori Weber
9b52ceab4b
Change returns, add documentation
2023-06-18 15:39:52 +02:00
Flori Weber
94ae449f7d
Start implementing get_relationship
2023-06-18 14:00:12 +02:00
Flori Weber
2e6e9ad59d
Add FriendRequestSendSchema
2023-06-15 19:01:01 +02:00
Flori Weber
c2d46196c8
Implement send_friend_request
2023-06-15 19:00:47 +02:00
Flori Weber
28881276e0
Add get_mutual_relationships
2023-06-14 22:54:14 +02:00
Flori Weber
7e4b4269b6
Change belongs_to to be borrowed non-mutably
2023-06-14 22:53:56 +02:00
Flori Weber
e14a21f814
Format relationships.rs
2023-06-14 22:14:56 +02:00
Flori Weber
7202722eb1
Add relationships.rs
2023-06-14 22:14:48 +02:00
Flori Weber
57fc5ba860
Update link reference
2023-06-13 15:23:39 +02:00
Flori Weber
cefc522e2f
Update relationship.rs types
2023-06-13 15:23:06 +02:00
Flori Weber
2e84385007
Create relationships.rs
2023-06-13 14:04:58 +02:00
Flori Weber
616d8a1bf0
Create relationships.rs
2023-06-13 14:04:39 +02:00
bitfl0wer
7a3524a1ab
run cargo fix
2023-06-12 18:59:06 +02:00
bitfl0wer
9bbe9fc470
run cargo fix
2023-06-12 18:58:53 +02:00
bitfl0wer
c97fa7bc48
Remove unneccessary variable
2023-06-12 18:55:27 +02:00
bitfl0wer
44224cb478
Refactor limited requester
...
The requester does not need to be instantiated anymore, which makes things easier to read imo.
2023-06-12 18:51:54 +02:00
Flori Weber
057e8e552f
Refactor users.rs to use api::common
2023-06-11 21:40:03 +02:00
Flori Weber
6db823cb48
Refactor roles.rs to use api::common
2023-06-11 20:04:40 +02:00
Flori Weber
893d1be98a
Refactor member.rs to use api::common
2023-06-11 19:30:15 +02:00
Flori Weber
d10f268ae5
Refactor guilds.rs to use api:common
2023-06-11 19:26:34 +02:00
Flori Weber
c8e4268638
Use handle_request_as_option instead
2023-06-11 19:22:28 +02:00
Flori Weber
e0a6b37a94
Introduce handle_request_as_option
2023-06-11 19:22:10 +02:00
Flori Weber
8d6fab0858
Refactor reactions to use api::options
2023-06-11 19:13:38 +02:00
Flori Weber
876cbd319d
Refactor permissions.rs to use api::common
2023-06-11 17:56:29 +02:00
Flori Weber
96b82377d8
Remove import
2023-06-11 17:51:26 +02:00
Flori Weber
06e27e816c
Refactor Message::send()
2023-06-11 17:49:42 +02:00
Flori Weber
5a0bf4b570
Make some fields Option enum
2023-06-11 17:49:30 +02:00
Flori Weber
99aa44daa8
Refactor to use api common, return Message instead
2023-06-11 17:40:44 +02:00
Flori Weber
0d8505121d
Refactor channels.rs to use api::common
2023-06-11 17:36:04 +02:00
Flori Weber
120469453b
Add argument to specify which LimitType to use
2023-06-11 17:35:47 +02:00
Flori Weber
4305f035f0
Move common request code into common.rs
2023-06-11 17:21:09 +02:00
Flori Weber
9b6a3c2fa6
Merge branch 'main' into feature/permissions-and-roles
2023-06-11 15:34:43 +02:00
Flori Weber
1dbc05d48c
create common.rs
2023-06-11 15:34:05 +02:00
kozabrada123
3237e7b7b7
Reformat and cargo fix
2023-06-11 14:32:37 +02:00
Flori Weber
a5a596fb4b
Cargo fix
2023-06-11 13:55:00 +02:00
Flori Weber
63f09e51d8
Cargo fix
2023-06-11 13:54:54 +02:00
Flori Weber
c745861592
Reformat entire project, optimize imports
2023-06-11 13:52:53 +02:00
Flori Weber
f641dbb14f
Reformat entire project, optimize imports
2023-06-11 13:52:31 +02:00
kozabrada123
b61bc573b7
Merge branch 'main' into perpetual/gateway-dev
2023-06-11 09:10:03 +02:00
bitfl0wer
9940394f20
Implement delete_permission
2023-06-10 22:16:53 +02:00
bitfl0wer
b20fc61aea
impl Channel::edit_permissions()
2023-06-10 22:09:53 +02:00
bitfl0wer
6b1dd90355
Create permissions.rs
2023-06-10 21:51:45 +02:00
Flori Weber
7d321798ee
"Normalize" RolePositionUpdateSchema
2023-06-10 19:35:57 +02:00
Flori Weber
f5fba7c34a
Better error handling in get methods.
2023-06-10 18:50:49 +02:00
Flori Weber
f0e3933419
Implement RoleObject::get()
2023-06-10 18:48:37 +02:00
Flori Weber
2652ae68e0
Add RoleObject::update()
2023-06-10 18:42:37 +02:00
kozabrada123
17194a2fcc
Implement display for UserStatus
2023-06-10 16:56:50 +02:00
kozabrada123
3db9114ecf
turns out UpdatePresence and PresenceUpdate are different events
2023-06-10 16:32:42 +02:00
kozabrada123
78e63657c8
Change observer update ref to &mut from &
2023-06-10 15:37:02 +02:00
Flori Weber
6070ad8e0a
Implement GuildMember::get()
2023-06-10 15:16:45 +02:00
kozabrada123
d5b883a088
Refactor, better deserialization error handling
2023-06-10 12:43:07 +02:00
kozabrada123
ecc6fc9424
Merge branch 'main' into perpetual/gateway-dev
2023-06-10 10:30:54 +02:00
bitfl0wer
972100af65
Change UserMeta: User instead of Option<User>
...
I do not know why I have made it optional in the first place. hm
2023-06-10 00:35:51 +02:00
bitfl0wer
9fb6c8c6f9
implement GuildMember::remove_role()
2023-06-10 00:10:12 +02:00
bitfl0wer
e4fb36d914
Implement GuildMember::add_role()
2023-06-10 00:03:31 +02:00
bitfl0wer
ce59beab3a
create member.rs
2023-06-09 23:41:40 +02:00
bitfl0wer
777746bc00
Add from_vec()
...
Calculates a PermissionFlags Stirng from a Vec<PermissionFlags>.
2023-06-09 21:34:54 +02:00
bitfl0wer
76e038b103
Remove unused import
2023-06-09 20:49:02 +02:00
bitfl0wer
2d828f2fdb
Move role schemas to own file
2023-06-09 20:47:45 +02:00
kozabrada123
a278b63ecb
Docs + unneeded &mut
2023-06-09 20:22:59 +02:00
kozabrada123
dc2fc90414
Discord.com sends premissions as an integer
2023-06-09 18:38:36 +02:00
kozabrada123
10617ca85c
Rebase
2023-06-09 18:14:20 +02:00
bitfl0wer
6ed9eaf2fc
Implement RoleObject::position_update()
2023-06-09 16:50:03 +02:00
bitfl0wer
2c153259b3
Change Role to have String over PermissionFlags
...
PermissionFlags implementation needs to be figured out a bit better before we can use it here.
2023-06-09 12:04:49 +02:00
bitfl0wer
47f8b131a3
Add documentation
2023-06-08 22:39:06 +02:00
bitfl0wer
f41312d430
Implement RoleObject::create()
2023-06-08 22:26:24 +02:00
bitfl0wer
951e41db4b
Add FormCreationError
2023-06-08 22:26:08 +02:00
bitfl0wer
b0a19faa48
Change InstanceServerError to ChorusLibError
...
The name InstanceServerError was chosen without thinking about it too much, very early in development. The new name suits this custom Error type way better, in my opinion.
2023-06-08 22:16:23 +02:00
bitfl0wer
8b35c5948d
Add RolePositionUpdateSchema
2023-06-08 20:45:56 +02:00
bitfl0wer
925165aba2
Change struct name
...
This schema is being used as a RoleModifySchema AND as a RoleCreationSchema.
2023-06-08 20:43:29 +02:00
bitfl0wer
4547e8b2d6
Add misssing attribute
2023-06-08 20:42:40 +02:00
bitfl0wer
46fac4b132
Add RoleCreateSchema
2023-06-08 20:40:36 +02:00
kozabrada123
88d571486b
Basic tests
2023-06-08 19:51:32 +02:00
kozabrada123
da98f3c581
Refactor
2023-06-08 18:24:11 +02:00
kozabrada123
74785b4b2b
Merge branch 'main' into perpetual/gateway-dev
2023-06-08 17:35:17 +02:00
kozabrada123
a0629bf198
Gateway basic error handling
2023-06-08 17:34:52 +02:00
bitfl0wer
15a122d719
cargo fix
2023-06-07 23:06:52 +02:00
bitfl0wer
1381bbfcbf
Remove unnecessary imports
2023-06-07 23:03:37 +02:00
bitfl0wer
acbbc88e84
Implement RoleObject::get_all()
2023-06-07 23:03:24 +02:00
bitfl0wer
990f9eb4e2
Create roles.rs
2023-06-07 23:03:07 +02:00
bitfl0wer
91ede88140
Try making permissions to PermissionFlags
2023-06-07 22:44:16 +02:00
bitfl0wer
1d701c185f
Sort fields on Guild alphabetically
2023-06-07 22:40:48 +02:00
bitfl0wer
cf74d0e618
Make enum into bitflags struct
2023-06-07 10:39:05 +02:00
bitfl0wer
e65aa964f0
Fix enum, add has_permission() for RoleObject
2023-06-06 21:38:28 +02:00
bitfl0wer
3cd633f7ad
Make enum pub
2023-06-06 20:10:50 +02:00
bitfl0wer
e07387fc77
Add PermissionFlags
2023-06-06 20:05:34 +02:00
bitfl0wer
3692f15f0f
Add reference to docs
2023-06-04 14:41:24 +02:00
bitfl0wer
0a106d2e1d
Add method to remove own reaction
2023-06-04 14:39:22 +02:00
bitfl0wer
7a811e1792
improve existing documentation
2023-06-04 14:32:57 +02:00
bitfl0wer
359bfc7b8b
Add delete_user method
2023-06-04 14:29:43 +02:00
bitfl0wer
92e768d5a6
Change file structure
2023-06-04 14:20:06 +02:00
kozabrada123
8f6c533e50
Implement Clone for all events
2023-06-04 13:49:35 +02:00
kozabrada123
9bad8ab4fa
Merge branch 'main' into perpetual/gateway-dev
2023-06-04 10:18:16 +02:00
bitfl0wer
5dd9d095cf
Move some pieces of documentation to where they make the most sense
2023-06-03 22:34:03 +02:00
bitfl0wer
9918b9a71d
Make reference links clickable in cargo doc
2023-06-03 22:15:03 +02:00
bitfl0wer
b5de178a91
Add references
2023-06-03 22:08:56 +02:00
bitfl0wer
065bb28c96
Add create reaction with documentation
2023-06-03 22:07:37 +02:00
bitfl0wer
33e0f75772
Add delete_emoji method with documentation
2023-06-03 20:17:21 +02:00
bitfl0wer
4d6ad1cd7b
Add documentation
2023-06-03 18:59:13 +02:00