RestClient
import { RestClient } from "https://raw.githubusercontent.com/denosaurs/denord/26ae2cc4c0f8c03b14d2b36eaa74b9e6d49665ed/mod.ts";
a client to make HTTP requests to Discord NOTE: there are no explanations what each of the methods do as they are identical to Discord's endpoints
class RestClient { }
constructor(token?: string);
token: string;
private async request(
endpoint: string,
method: (),
| "GET"
| "POST"
| "PUT"
| "PATCH"
| "DELETE"
data?: any,
): Promise<unknown>;async addGuildMember(
guildId: Discord.Snowflake,
userId: Discord.Snowflake,
data: Discord.guildMember.Add,
);async addGuildMemberRole(
guildId: Discord.Snowflake,
userId: Discord.Snowflake,
roleId: Discord.Snowflake,
);async addPinnedChannelMessage(channelId: Discord.Snowflake, messageId: Discord.Snowflake);
async beginGuildPrune(guildId: Discord.Snowflake, params: Discord.guild.BeginPruneParams);
async bulkDeleteMessages(channelId: Discord.Snowflake, data: Discord.channel.BulkDelete);
async createChannelInvite(channelId: Discord.Snowflake, data: Discord.invite.Create);
async createDM(data: Discord.channel.CreateDM);
async createGroupDM(data: Discord.channel.CreateGroupDM);
async createGuild(data: Discord.guild.Create);
async createGuildBan(
guildId: Discord.Snowflake,
userId: Discord.Snowflake,
params: Discord.guild.CreateBan,
);async createGuildChannel(guildId: Discord.Snowflake, data: Discord.channel.CreateGuildChannel);
async createGuildEmoji(guildId: Discord.Snowflake, data: Discord.emoji.Create);
async createGuildIntegration(guildId: Discord.Snowflake, data: Discord.integration.Create);
async createGuildRole(guildId: Discord.Snowflake, data: Discord.role.Create);
async createMessage(channelId: Discord.Snowflake, data: Discord.message.Create);
async createReaction(
channelId: Discord.Snowflake,
messageId: Discord.Snowflake,
emoji: string,
);async createWebhook(channelId: Discord.Snowflake, data: Discord.webhook.Create);
async deleteAllReactions(channelId: Discord.Snowflake, messageId: Discord.Snowflake);
async deleteAllReactionsForEmoji(
channelId: Discord.Snowflake,
messageId: Discord.Snowflake,
emoji: string,
);async deleteChannel(channelId: Discord.Snowflake);
async deleteChannelPermission(channelId: Discord.Snowflake, overwriteId: Discord.Snowflake);
async deleteGuild(guildId: Discord.Snowflake);
async deleteGuildEmoji(guildId: Discord.Snowflake, emojiId: Discord.Snowflake);
async deleteGuildIntegration(guildId: Discord.Snowflake, integrationId: Discord.Snowflake);
async deleteGuildRole(guildId: Discord.Snowflake, roleId: Discord.Snowflake);
async deleteInvite(inviteCode: string);
async deleteMessage(channelId: Discord.Snowflake, messageId: Discord.Snowflake);
async deleteOwnReaction(
channelId: Discord.Snowflake,
messageId: Discord.Snowflake,
emoji: string,
);async deletePinnedChannelMessage(channelId: Discord.Snowflake, messageId: Discord.Snowflake);
async deleteUserReaction(
channelId: Discord.Snowflake,
messageId: Discord.Snowflake,
emoji: string,
userId: Discord.Snowflake,
);async deleteWebhook(webhookId: Discord.Snowflake);
async deleteWebhookWithToken(webhookId: Discord.Snowflake, webhookToken: string);
async editChannelPermissions(
channelId: Discord.Snowflake,
overwriteId: Discord.Snowflake,
data: Omit<Discord.channel.Overwrite, "id">,
);async editMessage(
channelId: Discord.Snowflake,
messageId: Discord.Snowflake,
data: Discord.message.Edit,
);async executeGitHubCompatibleWebhook(
webhookId: Discord.Snowflake,
webhookToken: string,
data: any,
params: Discord.webhook.ExecuteParams,
);async executeSlackCompatibleWebhook(
webhookId: Discord.Snowflake,
webhookToken: string,
data: any,
params: Discord.webhook.ExecuteParams,
);async executeWebhook(
webhookId: Discord.Snowflake,
webhookToken: string,
data: Discord.webhook.ExecuteBody,
params: Discord.webhook.ExecuteParams,
);async getChannel(channelId: Discord.Snowflake);
async getChannelInvites(channelId: Discord.Snowflake);
async getChannelMessage(channelId: Discord.Snowflake, messageId: Discord.Snowflake);
async getChannelMessages(channelId: Discord.Snowflake, params: Discord.channel.GetMessages);
async getChannelWebhooks(channelId: Discord.Snowflake);
async getCurrentUser();
async getCurrentUserGuilds(params: Discord.user.GetGuilds);
async getGateway();
async getGatewayBot();
async getGuild(guildId: Discord.Snowflake);
async getGuildAuditLog(guildId: Discord.Snowflake);
async getGuildBan(guildId: Discord.Snowflake, userId: Discord.Snowflake);
async getGuildBans(guildId: Discord.Snowflake);
async getGuildChannels(guildId: Discord.Snowflake);
async getGuildEmbed(guildId: Discord.Snowflake);
async getGuildEmbedImage(guildId: Discord.Snowflake, params: Discord.guild.WidgetEmbedStyle);
async getGuildEmoji(guildId: Discord.Snowflake, emojiId: Discord.Snowflake);
async getGuildIntegrations(guildId: Discord.Snowflake);
async getGuildInvites(guildId: Discord.Snowflake);
async getGuildMember(guildId: Discord.Snowflake, userId: Discord.Snowflake);
async getGuildPruneCount(guildId: Discord.Snowflake, params: Discord.guild.PruneCount);
async getGuildRoles(guildId: Discord.Snowflake);
async getGuildVanityURL(guildId: Discord.Snowflake);
async getGuildVoiceRegions(guildId: Discord.Snowflake);
async getGuildWebhooks(guildId: Discord.Snowflake);
async getGuildWidgetImage(guildId: Discord.Snowflake, params: Discord.guild.WidgetEmbedStyle);
async getInvite(inviteCode: string);
async getPinnedMessages(channelId: Discord.Snowflake);
async getReactions(
channelId: Discord.Snowflake,
messageId: Discord.Snowflake,
emoji: string,
params: Discord.channel.GetReactions,
);async getUser(userId: Discord.Snowflake);
async getUserConnections();
async getUserDMs();
async getWebhook(webhookId: Discord.Snowflake);
async getWebhookWithToken(webhookId: Discord.Snowflake, webhookToken: string);
async groupDMAddRecipient(
channelId: Discord.Snowflake,
userId: Discord.Snowflake,
data: Discord.channel.GroupDMAddRecipient,
);async groupDMRemoveRecipient(channelId: Discord.Snowflake, userId: Discord.Snowflake);
async leaveGuild(guildId: Discord.Snowflake);
async listGuildEmojis(guildId: Discord.Snowflake);
async listGuildMembers(guildId: Discord.Snowflake, params: Discord.guildMember.List);
async listVoiceRegions();
async modifyChannel(channelId: Discord.Snowflake, data: Discord.channel.Modify);
async modifyCurrentUser(data: Discord.user.Modify);
async modifyCurrentUserNick(
guildId: Discord.Snowflake,
userId: Discord.Snowflake,
data: Discord.guildMember.ModifyCurrentNick,
);async modifyGuild(guildId: Discord.Snowflake, data: Discord.guild.Modify);
async modifyGuildChannelPositions(guildId: Discord.Snowflake, data: Discord.channel.GuildPosition);
async modifyGuildEmbed(guildId: Discord.Snowflake, data: Discord.guild.EmbedModify);
async modifyGuildEmoji(
guildId: Discord.Snowflake,
emojiId: Discord.Snowflake,
data: Discord.emoji.Modify,
);async modifyGuildIntegration(
guildId: Discord.Snowflake,
integrationId: Discord.Snowflake,
data: Discord.integration.Modify,
);async modifyGuildMember(
guildId: Discord.Snowflake,
userId: Discord.Snowflake,
data: Discord.guildMember.Modify,
);async modifyGuildRole(guildId: Discord.Snowflake, data: Discord.role.Modify);
async modifyGuildRolePositions(guildId: Discord.Snowflake, data: Discord.role.ModifyPosition);
async modifyWebhook(webhookId: Discord.Snowflake, data: Discord.webhook.Modify);
async modifyWebhookWithToken(
webhookId: Discord.Snowflake,
webhookToken: string,
data: Discord.webhook.Modify,
);async removeGuildBan(guildId: Discord.Snowflake, userId: Discord.Snowflake);
async removeGuildMember(guildId: Discord.Snowflake, userId: Discord.Snowflake);
async removeGuildMemberRole(
guildId: Discord.Snowflake,
userId: Discord.Snowflake,
roleId: Discord.Snowflake,
);async syncGuildIntegration(guildId: Discord.Snowflake, integrationId: Discord.Snowflake);
async triggerTypingIndicator(channelId: Discord.Snowflake);
§Properties
§Methods
§
request(endpoint: string, method: (), data?: any): Promise<unknown> private
[src] | "GET"
| "POST"
| "PUT"
| "PATCH"
| "DELETE"
§
addGuildMember(guildId: Discord.Snowflake, userId: Discord.Snowflake, data: Discord.guildMember.Add)
[src]§
addGuildMemberRole(guildId: Discord.Snowflake, userId: Discord.Snowflake, roleId: Discord.Snowflake)
[src]§
createGuildBan(guildId: Discord.Snowflake, userId: Discord.Snowflake, params: Discord.guild.CreateBan)
[src]§
deleteAllReactionsForEmoji(channelId: Discord.Snowflake, messageId: Discord.Snowflake, emoji: string)
[src]§
deleteUserReaction(channelId: Discord.Snowflake, messageId: Discord.Snowflake, emoji: string, userId: Discord.Snowflake)
[src]§
editChannelPermissions(channelId: Discord.Snowflake, overwriteId: Discord.Snowflake, data: Omit<Discord.channel.Overwrite, "id">)
[src]§
editMessage(channelId: Discord.Snowflake, messageId: Discord.Snowflake, data: Discord.message.Edit)
[src]§
executeGitHubCompatibleWebhook(webhookId: Discord.Snowflake, webhookToken: string, data: any, params: Discord.webhook.ExecuteParams)
[src]§
executeSlackCompatibleWebhook(webhookId: Discord.Snowflake, webhookToken: string, data: any, params: Discord.webhook.ExecuteParams)
[src]§
executeWebhook(webhookId: Discord.Snowflake, webhookToken: string, data: Discord.webhook.ExecuteBody, params: Discord.webhook.ExecuteParams)
[src]§
getReactions(channelId: Discord.Snowflake, messageId: Discord.Snowflake, emoji: string, params: Discord.channel.GetReactions)
[src]§
groupDMAddRecipient(channelId: Discord.Snowflake, userId: Discord.Snowflake, data: Discord.channel.GroupDMAddRecipient)
[src]§
modifyCurrentUserNick(guildId: Discord.Snowflake, userId: Discord.Snowflake, data: Discord.guildMember.ModifyCurrentNick)
[src]§
modifyGuildEmoji(guildId: Discord.Snowflake, emojiId: Discord.Snowflake, data: Discord.emoji.Modify)
[src]§
modifyGuildIntegration(guildId: Discord.Snowflake, integrationId: Discord.Snowflake, data: Discord.integration.Modify)
[src]§
modifyGuildMember(guildId: Discord.Snowflake, userId: Discord.Snowflake, data: Discord.guildMember.Modify)
[src]§
modifyWebhookWithToken(webhookId: Discord.Snowflake, webhookToken: string, data: Discord.webhook.Modify)
[src]