refactor(Constants): Remove leftover code (#8156)

* refactor(Constants): tidy up file

* docs(Constants): add type definition
This commit is contained in:
Jiralite
2022-06-22 19:36:58 +01:00
committed by GitHub
parent ee36d60dc6
commit cd17aad720
2 changed files with 9 additions and 28 deletions

View File

@@ -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
*/

View File

@@ -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;