mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
refactor!: remove deprecated CDN method overloads (#10649)
BREAKING CHANGE: Removed user avatar decoration overload from `CDN#avatarDecoration()` BREAKING CHANGE: Removed non-object options overload from `CDN#emoji()` Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
@@ -60,10 +60,3 @@ export const OverwrittenMimeTypes = {
|
||||
} as const satisfies Readonly<Record<string, string>>;
|
||||
|
||||
export const BurstHandlerMajorIdKey = 'burst';
|
||||
|
||||
/**
|
||||
* Prefix for deprecation warnings.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export const DEPRECATION_WARNING_PREFIX = 'DeprecationWarning' as const;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { RESTPatchAPIChannelJSONBody, Snowflake } from 'discord-api-types/v10';
|
||||
import type { REST } from '../REST.js';
|
||||
import { RateLimitError } from '../errors/RateLimitError.js';
|
||||
import { DEPRECATION_WARNING_PREFIX } from './constants.js';
|
||||
import { RequestMethod } from './types.js';
|
||||
import type { GetRateLimitOffsetFunction, RateLimitData, ResponseLike } from './types.js';
|
||||
|
||||
@@ -143,21 +142,6 @@ export function isBufferLike(value: unknown): value is ArrayBuffer | Buffer | Ui
|
||||
return value instanceof ArrayBuffer || value instanceof Uint8Array || value instanceof Uint8ClampedArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Irrespective environment warning.
|
||||
*
|
||||
* @remarks Only the message is needed. The deprecation prefix is handled already.
|
||||
* @param message - A string the warning will emit with
|
||||
* @internal
|
||||
*/
|
||||
export function deprecationWarning(message: string) {
|
||||
if (typeof globalThis.process === 'undefined') {
|
||||
console.warn(`${DEPRECATION_WARNING_PREFIX}: ${message}`);
|
||||
} else {
|
||||
process.emitWarning(message, DEPRECATION_WARNING_PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes the offset for rate limits. Applies a Math.max(0, N) to prevent negative offsets,
|
||||
* also deals with callbacks.
|
||||
|
||||
Reference in New Issue
Block a user