npm.io
1.0.1 • Published 6d ago

@pairlypacks/suggestions

Licence
SEE LICENSE IN LICENSE
Version
1.0.1
Deps
0
Size
26 kB
Vulns
0
Weekly
59

@pairlypacks/suggestions

Pairly Packs suggestions system for Discord.js.

It includes:

  • sticky suggestion message
  • suggestion modal
  • suggestion posts
  • vote up/down buttons
  • implemented button protected by role
  • Pairly Packs license validation

Install

npm install @pairlypacks/suggestions

Usage

Call this after your Discord client is ready:

const { initSuggestions } = require('@pairlypacks/suggestions');

try {
  await initSuggestions(client, {
    licenseKey: 'PAIRLY-SUGGESTIONS-XXXXX-XXXXX-XXXXX-XXXXX',
    CHANNEL_SUGGESTIONS: 'SUGGESTIONS_CHANNEL_ID',
    ROLE_IMPLEMENTED: 'ROLE_ALLOWED_TO_MARK_IMPLEMENTED',
    guildId: 'GUILD_ID',
    sideImageUrl: 'https://example.com/side-image.png',

    emojis: {
      suggestion: '💡',
    },
  });

  console.log('\x1b[32m@pairlypacks/suggestions initialized.\x1b[0m');
} catch (error) {
  console.error(`\x1b[31mFailed to initialize @pairlypacks/suggestions: ${error.message || error}\x1b[0m`);
  process.exit(1);
}

Required Options

{
  licenseKey: 'PAIRLY-SUGGESTIONS-XXXXX-XXXXX-XXXXX-XXXXX',
  CHANNEL_SUGGESTIONS: 'channel id',
  ROLE_IMPLEMENTED: 'role id',
  sideImageUrl: 'https://example.com/side-image.png',
  emojis: {
    suggestion: '💡'
  }
}

There are no default emojis. You must configure them.

You can use Unicode emoji:

emojis: {
  suggestion: '💡'
}

Or server custom emoji:

emojis: {
  suggestion: '<:Suggestion:123456789012345678>'
}

Custom emoji only work if the bot can use those emoji.

License Core Product

Create the product:

/product create code:SUGGESTIONS name:Pairly Suggestions npm_package:@pairlypacks/suggestions

Generate a license:

/license create product:SUGGESTIONS buyer:@Customer

Publish

npm login
npm install
npm run test:load
npm pack --dry-run
npm publish --access public

For updates:

npm version patch
npm publish --access public

Keywords