mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
refactor(Constants): Remove leftover code (#8156)
* refactor(Constants): tidy up file * docs(Constants): add type definition
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const process = require('node:process');
|
||||
const { ChannelType, MessageType } = require('discord-api-types/v10');
|
||||
const Package = (exports.Package = require('../../package.json'));
|
||||
|
||||
exports.UserAgent = `DiscordBot (${Package.homepage}, ${Package.version}) Node.js/${process.version}`;
|
||||
|
||||
/**
|
||||
* The name of an item to be swept in Sweepers
|
||||
@@ -115,9 +111,11 @@ exports.ThreadChannelTypes = [
|
||||
*/
|
||||
exports.VoiceBasedChannelTypes = [ChannelType.GuildVoice, ChannelType.GuildStageVoice];
|
||||
|
||||
/* eslint-enable max-len */
|
||||
|
||||
/**
|
||||
* @typedef {Object} Constants Constants that can be used in an enum or object-like way.
|
||||
* @property {Status} Status The available statuses of the client.
|
||||
* @property {SweeperKey} SweeperKey The possible names of items that can be swept in sweepers
|
||||
* @property {NonSystemMessageTypes} NonSystemMessageTypes The types of messages that are not deemed a system type
|
||||
* @property {TextBasedChannelTypes} TextBasedChannelTypes The types of channels that are text-based
|
||||
* @property {ThreadChannelTypes} ThreadChannelTypes The types of channels that are threads
|
||||
* @property {VoiceBasedChannelTypes} VoiceBasedChannelTypes The types of channels that are voice-based
|
||||
*/
|
||||
|
||||
25
packages/discord.js/typings/index.d.ts
vendored
25
packages/discord.js/typings/index.d.ts
vendored
@@ -2969,28 +2969,11 @@ export type NonSystemMessageType =
|
||||
| MessageType.ContextMenuCommand;
|
||||
|
||||
export const Constants: {
|
||||
Package: {
|
||||
name: string;
|
||||
version: string;
|
||||
description: string;
|
||||
license: string;
|
||||
main: string;
|
||||
types: string;
|
||||
homepage: string;
|
||||
keywords: string[];
|
||||
bugs: { url: string };
|
||||
repository: { type: string; url: string };
|
||||
scripts: Record<string, string>;
|
||||
engines: Record<string, string>;
|
||||
dependencies: Record<string, string>;
|
||||
devDependencies: Record<string, string>;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
UserAgent: string;
|
||||
ThreadChannelTypes: ThreadChannelType[];
|
||||
TextBasedChannelTypes: TextBasedChannelTypes[];
|
||||
VoiceBasedChannelTypes: VoiceBasedChannelTypes[];
|
||||
SweeperKeys: SweeperKey;
|
||||
NonSystemMessageTypes: NonSystemMessageType[];
|
||||
TextBasedChannelTypes: TextBasedChannelTypes[];
|
||||
ThreadChannelTypes: ThreadChannelType[];
|
||||
VoiceBasedChannelTypes: VoiceBasedChannelTypes[];
|
||||
};
|
||||
|
||||
export const version: string;
|
||||
|
||||
Reference in New Issue
Block a user