Fix rate limiter for bots.

Use local-request state to cache User object.
This commit is contained in:
Paul
2021-09-18 20:06:00 +01:00
parent 0dcf8cb281
commit e5e0031cad
5 changed files with 60 additions and 78 deletions

View File

@@ -35,7 +35,7 @@ lazy_static! {
}
#[post("/<target>/messages", data = "<message>")]
pub async fn message_send(_r: Ratelimiter, user: User, target: Ref, message: Json<Data>) -> Result<RatelimitResponse<Value>> {
pub async fn message_send(user: User, _r: Ratelimiter, target: Ref, message: Json<Data>) -> Result<RatelimitResponse<Value>> {
let message = message.into_inner();
message
.validate()