mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
refactor(.github,README,gateway,plugins/fileloader,tests,types)!: make intent calculation manual
This changes the calculation of intents to be manual to the dev. This is to improve overall consistency of our code base, also it is not a big drawback for users since intents are usually done once and then never (seldom) touched again.
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@ startGateway({
|
||||
/** Whether or not to use compression for gateway payloads. */
|
||||
compress: true,
|
||||
/** The intents you would like to enable. */
|
||||
intents: ["GUILDS", "GUILD_MESSAGES"],
|
||||
intents: Intents.Guilds | Intents.GuildMessages,
|
||||
/** The max amount of shards used for identifying. This can be useful for zero-downtime updates or resharding. */
|
||||
maxShards: 885,
|
||||
/** The first shard Id for this group of shards. */
|
||||
|
||||
@@ -59,10 +59,7 @@ export function createGatewayManager(
|
||||
$os: options.$os ?? "linux",
|
||||
$browser: options.$browser ?? "Discordeno",
|
||||
$device: options.$device ?? "Discordeno",
|
||||
intents:
|
||||
(Array.isArray(options.intents)
|
||||
? options.intents.reduce((bits, next) => (bits |= GatewayIntents[next]), 0)
|
||||
: options.intents) ?? 0,
|
||||
intents: options.intents ?? 0,
|
||||
shard: options.shard ?? [0, options.shardsRecommended ?? 1],
|
||||
presence: options.presence,
|
||||
urlWSS: options.urlWSS ?? "wss://gateway.discord.gg/?v=9&encoding=json",
|
||||
@@ -131,7 +128,7 @@ export interface GatewayManager {
|
||||
$os: string;
|
||||
$browser: string;
|
||||
$device: string;
|
||||
intents: number | (keyof typeof GatewayIntents)[];
|
||||
intents: GatewayIntents;
|
||||
shard: [number, number];
|
||||
presence?: Omit<StatusUpdate, "afk" | "since">;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user