npm.io
0.1.88-beta.2 • Published 20h ago

@orbynnew/compat

Licence
Version
0.1.88-beta.2
Deps
1
Size
44 kB
Vulns
0
Weekly
0

@orbynnew/compat — Public Beta 0.1.88-beta.2

Compatibility package for migrating bot code to orbynnew. orbynnew is an independent product and this package does not copy or provide the Discord service/protocol.

npm install @orbynnew/compat@beta

Starting in v0.1.88 this is a real compatibility facade, not a simple re-export of @orbynnew/sdk.

It translates common bot contracts such as:

  • numeric GatewayIntentBits;
  • IntentsBitField;
  • numeric ChannelType, ActivityType and Partials;
  • PermissionsBitField/PermissionFlagsBits with BigInt values;
  • message flag bitfields;
  • Application Command builders/options;
  • select-menu and modern component builders;
  • familiar event names;
  • public snowflake handling.

Example:

const {
  Client,
  GatewayIntentBits,
  Events,
  SlashCommandBuilder
} = require('@orbynnew/compat');

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.GuildVoiceStates,
    GatewayIntentBits.MessageContent
  ]
});

client.once(Events.ClientReady, readyClient => {
  console.log(`Online: ${readyClient.user.tag}`);
});

client.on(Events.InteractionCreate, async interaction => {
  if (!interaction.isChatInputCommand()) return;
  if (interaction.commandName === 'ping') await interaction.reply('pong');
});

client.login(process.env.ORBYNNEW_BOT_TOKEN);

There is no orbynnew-only interaction intent requirement. Application interactions are routed by installation/permissions.

For native orbynnew code, prefer @orbynnew/sdk. For voice transport use @orbynnew/voice; for the orbynnew music abstraction use @orbynnew/music.

Scope of v0.1.88

This beta targets the core used by most migrated bots. It is not a claim that every current discord.js manager/resource has an orbynnew equivalent. The compatibility matrix in the full source release lists long-tail resources reserved for the next parity pass.

Keywords