pairly-say
v1.0.0
Published
Reusable Discord.js /say command package with role permission and Pairly license validation.
Maintainers
Readme
pairly-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 pairly-sayUsage
const { Client, GatewayIntentBits } = require('discord.js');
const { initSayPairly } = require('pairly-say');
const client = new Client({
intents: [GatewayIntentBits.Guilds],
});
client.once('ready', async () => {
await initSayPairly(client, {
sayPermRoleID: 'ROLE_ID_ALLOWED_TO_USE_SAY',
guildId: 'GUILD_ID_FOR_FAST_COMMAND_REGISTRATION',
licenseApiUrl: 'https://your-license-core.vercel.app',
licenseKey: 'PAIRLY-SAY-XXXXX-XXXXX-XXXXX-XXXXX',
});
console.log(`Logged in as ${client.user.tag}`);
});
client.login(process.env.TOKEN);Options
await initSayPairly(client, {
sayPermRoleID: '123456789012345678',
guildId: '123456789012345678',
licenseApiUrl: 'https://your-license-core.vercel.app',
licenseKey: 'PAIRLY-SAY-XXXXX-XXXXX-XXXXX-XXXXX',
productCode: 'SAY',
autoRegister: true,
allowedMentions: { parse: [] },
});sayPermRoleID is required. Only members with that role can use /say.
licenseApiUrl and licenseKey are required unless you set:
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:pairly-sayGenerate a license:
/license create product:SAY buyer:@Customer max_servers:1