Skip to content

Commit

Permalink
Update SDK with new /v1/users/me endpoint (#204)
Browse files Browse the repository at this point in the history
* Update SDK with new /v1/users/me endpoint

* update Client.ts with getSelf

* prettier
  • Loading branch information
cwang314 committed Oct 4, 2021
1 parent b80b73c commit 5db0ddc
Show file tree
Hide file tree
Showing 2 changed files with 25,511 additions and 10,865 deletions.
16 changes: 16 additions & 0 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ import {
SearchParameters,
SearchResponse,
search,
GetSelfParameters,
GetSelfResponse,
getSelf,
} from "./api-endpoints"
import nodeFetch from "node-fetch"
import {
Expand Down Expand Up @@ -429,6 +432,19 @@ export default class Client {
auth: args?.auth,
})
},

/**
* Get details about bot
*/
me: (args: WithAuth<GetSelfParameters>): Promise<GetSelfResponse> => {
return this.request<GetSelfResponse>({
path: getSelf.path(),
method: getSelf.method,
query: pick(args, getSelf.queryParams),
body: pick(args, getSelf.bodyParams),
auth: args?.auth,
})
},
}

/**
Expand Down
Loading

0 comments on commit 5db0ddc

Please sign in to comment.