From 9c8bc711fbbfdfe395c7b7d4414cf433cf5e2bf3 Mon Sep 17 00:00:00 2001 From: Filip Hoffmann Date: Sun, 11 May 2025 17:39:46 +0200 Subject: [PATCH] add type annotations for invite functions --- src/flybycord/invite.gleam | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/flybycord/invite.gleam b/src/flybycord/invite.gleam index eb9e611..e1e7fd5 100644 --- a/src/flybycord/invite.gleam +++ b/src/flybycord/invite.gleam @@ -10,7 +10,6 @@ import flybycord/user.{type User} import gleam/dynamic/decode import gleam/http import gleam/http/request -import gleam/http/response import gleam/json.{type Json} import gleam/option.{type Option, None} import gleam/result @@ -286,7 +285,10 @@ pub fn create_encode(create: Create) -> Json { // PUBLIC API FUNCTIONS -------------------------------------------------------- -pub fn get_many(client: Client, for channel_id: String) { +pub fn get_many( + client: Client, + for channel_id: String, +) -> Result(List(WithMetadata), error.FlybycordError) { use response <- result.try( client |> rest.new_request(http.Get, "/channels/" <> channel_id <> "/invites") @@ -303,7 +305,7 @@ pub fn create( for channel_id: String, with create: Create, reason reason: Option(String), -) { +) -> Result(WithoutMetadata, error.FlybycordError) { let json = create |> create_encode use response <- result.try( -- 2.51.2