(channelInvites)
import { Discord } from "@speakeasy-sdks/discord";
const discord = new Discord({
botToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await discord.channelInvites.list({
channelId: "<value>",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { DiscordCore } from "@speakeasy-sdks/discord/core.js";
import { channelInvitesList } from "@speakeasy-sdks/discord/funcs/channelInvitesList.js";
// Use `DiscordCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const discord = new DiscordCore({
botToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await channelInvitesList(discord, {
channelId: "<value>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ListChannelInvitesRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ResponseBody[]>
Error Object | Status Code | Content Type |
---|---|---|
errors.ErrorResponse | 4XX | application/json |
errors.SDKError | 4xx-5xx | / |
import { Discord } from "@speakeasy-sdks/discord";
const discord = new Discord({
botToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await discord.channelInvites.create({
channelId: "<value>",
requestBody: {},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { DiscordCore } from "@speakeasy-sdks/discord/core.js";
import { channelInvitesCreate } from "@speakeasy-sdks/discord/funcs/channelInvitesCreate.js";
// Use `DiscordCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const discord = new DiscordCore({
botToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await channelInvitesCreate(discord, {
channelId: "<value>",
requestBody: {},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreateChannelInviteRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CreateChannelInviteResponseBody>
Error Object | Status Code | Content Type |
---|---|---|
errors.ErrorResponse | 4XX | application/json |
errors.SDKError | 4xx-5xx | / |