Commit Graph

37 Commits

Author SHA1 Message Date
kozabrada123 905b7af618 Add content type specification 2023-08-18 11:41:06 +02:00
bitfl0wer 0396e318d3 Change bearer_auth to header("Authorization" 2023-08-17 22:26:07 +02:00
kozabrada123 e0d7df417c Fix trailing /s (#180) 2023-08-12 16:48:33 +02:00
kozabrada123 60393a5686 Docs 2023-07-31 10:01:25 +02:00
kozabrada123 590afc8c9d Permissions with code blocks 2023-07-29 18:12:57 +02:00
kozabrada123 d0547cb1f0 Better docs 2023-07-28 18:45:40 +02:00
kozabrada123 18ac7b5708 Rustdoc warnings + misc changes 2023-07-10 18:06:45 +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
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
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 55b0f268e2 more consistent use of snowflakes 2023-06-20 22:03:29 +02:00
kozabrada123 cd98de286f Change Option<ChorusLibError> to Result<(), ChorusLibError> 2023-06-20 18:26:30 +02:00
Vincent Junge 9c7031abde UrlBundle remove getters 2023-06-20 12:29:52 +02:00
Vincent Junge c06778fc71 Fix clippy::await_holding_refcell_ref false positives 2023-06-19 16:46:58 +02:00
Flori Weber c8e4268638 Use handle_request_as_option instead 2023-06-11 19:22:28 +02:00
Flori Weber 8d6fab0858 Refactor reactions to use api::options 2023-06-11 19:13:38 +02:00
Flori Weber f641dbb14f Reformat entire project, optimize imports 2023-06-11 13:52:31 +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 15a122d719 cargo fix 2023-06-07 23:06:52 +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
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
bitfl0wer be512504c5 Add reactions: get 2023-06-03 18:53:53 +02:00
bitfl0wer da0726c538 Implement reactions: delete all 2023-06-03 18:46:36 +02:00
bitfl0wer df6fcbd5ee Add ReactionMeta struct 2023-06-03 15:21:49 +02:00
bitfl0wer e9d5384f02 Create reactions.rs 2023-06-01 21:14:11 +02:00