diff --git a/src/fanbox_api.rs b/src/fanbox_api.rs index 8ae9836..54ea143 100644 --- a/src/fanbox_api.rs +++ b/src/fanbox_api.rs @@ -145,6 +145,21 @@ impl FanboxClient { } } + /// Get creator's info + /// * `creator_id` - The id of the creator + pub async fn get_creator + ?Sized>(&self, creator_id: &S) -> Option { + self.auto_init(); + handle_data!( + self.client.get_with_param( + "https://api.fanbox.cc/creator.get", + json::object! {"creatorId": creator_id.as_ref()}, + None, + ), + gettext("Failed to get creator's info:"), + gettext("Creator's info:") + ) + } + /// List home page's post list. All supported and followed creators' posts are included. /// * `limit` - The max count. 10 is used on Fanbox website. pub async fn list_home_post(&self, limit: u64) -> Option { @@ -281,3 +296,9 @@ quick_test!( TEST_CLIENT.list_supporting_plan(), "Failed to list all supporting plans." ); +#[cfg(test)] +quick_test!( + test_get_creator, + TEST_CLIENT.get_creator("mozukun43"), + "Failed to list all supporting plans." +);