mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
feat: Add @discordjs/core (#8736)
* feat: add @discordjs/core * chore: lint * chore: add all gateway events * chore: add the rest of the rest routes * chore: cleanup gateway * chore: rename gateway to client * chore: rename gateway to client * fix: don't spread unless we need to * refactor: use classes and make requested changes * chore: show shardId on emit * chore: add interface for intrinsic props * refactor: scope dispatch data instead of spreading * chore: add utility for uploading files for messages and interactions * feat: finish up form data handling * chore: add readme * chore: update api-extractor stuff * chore: bump deps * chore: make requested changes * chore: make requested changes * Update package.json * chore: make requested changes * fix: add missing interaction responses * chore: make some requested changes * chore: remove `return await` * chore: use autoModeration instead of automod * refactor: use snowflakes and -types results * chore: sort imports, fix return type on editUserVoiceState * chore: rename bots to users * feat: add automod dispatch events * refactor: move templates and members into guild * fix: use users instead of bots in api class * chore: imports * chore: make requested changes * fix: don't make files required on interaction replies * fix: rename sendMessage to createMessage * feat: add application command routes * feat: add webhook.execute overloads and options to invites.get * chore: use create prefixes * chore: seperate interaction params * chore: use Id * chore: make requested changes * chore: make requested changes * chore: make requested changes * chore: for -> from * Apply suggestions from code review Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> * Update packages/core/README.md Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> * chore: make requested changes * chore: update -types * chore: bump vitest * fix: sticker uploading * fix: lockfile * chore: make requested changes * chore: make requested changes * Update packages/core/src/api/applicationCommands.ts Co-authored-by: Almeida <almeidx@pm.me> * Apply suggestions from code review Co-authored-by: Aura Román <kyradiscord@gmail.com> * Update packages/core/README.md Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: almeidx <almeidx@pm.me> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: Aura Román <kyradiscord@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
57
packages/core/src/api/index.ts
Normal file
57
packages/core/src/api/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { REST } from '@discordjs/rest';
|
||||
import { ApplicationCommandsAPI } from './applicationCommands.js';
|
||||
import { ChannelsAPI } from './channel.js';
|
||||
import { GuildsAPI } from './guild.js';
|
||||
import { InteractionsAPI } from './interactions.js';
|
||||
import { InvitesAPI } from './invite.js';
|
||||
import { StickersAPI } from './sticker.js';
|
||||
import { ThreadsAPI } from './thread.js';
|
||||
import { UsersAPI } from './user.js';
|
||||
import { VoiceAPI } from './voice.js';
|
||||
import { WebhooksAPI } from './webhook.js';
|
||||
|
||||
export * from './applicationCommands.js';
|
||||
export * from './channel.js';
|
||||
export * from './guild.js';
|
||||
export * from './interactions.js';
|
||||
export * from './invite.js';
|
||||
export * from './sticker.js';
|
||||
export * from './thread.js';
|
||||
export * from './user.js';
|
||||
export * from './voice.js';
|
||||
export * from './webhook.js';
|
||||
|
||||
export class API {
|
||||
public readonly applicationCommands: ApplicationCommandsAPI;
|
||||
|
||||
public readonly channels: ChannelsAPI;
|
||||
|
||||
public readonly guilds: GuildsAPI;
|
||||
|
||||
public readonly interactions: InteractionsAPI;
|
||||
|
||||
public readonly invites: InvitesAPI;
|
||||
|
||||
public readonly stickers: StickersAPI;
|
||||
|
||||
public readonly threads: ThreadsAPI;
|
||||
|
||||
public readonly users: UsersAPI;
|
||||
|
||||
public readonly voice: VoiceAPI;
|
||||
|
||||
public readonly webhooks: WebhooksAPI;
|
||||
|
||||
public constructor(public readonly rest: REST) {
|
||||
this.applicationCommands = new ApplicationCommandsAPI(rest);
|
||||
this.channels = new ChannelsAPI(rest);
|
||||
this.guilds = new GuildsAPI(rest);
|
||||
this.invites = new InvitesAPI(rest);
|
||||
this.stickers = new StickersAPI(rest);
|
||||
this.threads = new ThreadsAPI(rest);
|
||||
this.users = new UsersAPI(rest);
|
||||
this.voice = new VoiceAPI(rest);
|
||||
this.webhooks = new WebhooksAPI(rest);
|
||||
this.interactions = new InteractionsAPI(rest, this.webhooks);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user