@pairlypacks/say
v1.0.1
Published
Reusable Discord.js /say command package with role permission and Pairly license validation.
Maintainers
Readme
@pairlypacks/say
Reusable Discord.js package that adds a protected /say command.
The command sends a normal bot message in a selected channel:
/say channel:#announcements content:Hello worldThis package does not use modals or Components V2. It sends normal Discord messages with channel.send({ content }).
Install
npm install @pairlypacks/sayUsage
const { Client, GatewayIntentBits } = require('discord.js');
const { initSayPairly } = require('@pairlypacks/say');
const client = new Client({
intents: [GatewayIntentBits.Guilds],
});
client.once('ready', async () => {
await initSayPairly(client, {
sayPermRoleID: 'ROLE_ID_ALLOWED_TO_USE_SAY',
licenseKey: 'PAIRLY-SAY-XXXXX-XXXXX-XXXXX-XXXXX',
guildId: 'GUILD_ID_FOR_FAST_COMMAND_REGISTRATION',
});
console.log(`Logged in as ${client.user.tag}`);
});
client.login(process.env.TOKEN);Options
await initSayPairly(client, {
sayPermRoleID: '123456789012345678',
licenseKey: 'PAIRLY-SAY-XXXXX-XXXXX-XXXXX-XXXXX',
guildId: '123456789012345678',
productCode: 'SAY',
autoRegister: true,
allowedMentions: { parse: [] },
});sayPermRoleID is required. Only members with that role can use /say.
licenseKey is required. Pairly generates a different license key for every purchase from the license core Discord commands.
No API URL is required in the customer bot code. The package talks to the Pairly license API internally.
For local development only, you can bypass license validation:
skipLicenseValidation: trueUse skipLicenseValidation only for local development or plain-code delivery.
Publishing
Login to npm:
npm loginCheck the package:
npm run test:load
npm pack --dry-runPublish:
npm publish --access publicFor updates:
npm version patch
npm publish --access publicPairly License Core Product
Create this product in your license core:
/product create code:SAY name:Pairly Say npm_package:@pairlypacks/sayGenerate a license:
/license create product:SAY buyer:@Customer