Pinsir is a Discord bot for pin management. Given Discord's 50-message cap on the pins in any channel, Pinsir can migrate old/new pins to a specific channel to work around this limitation.
This bot was originally forked from somedumbfox/passel-js, but I have since modified it to overhaul embed quality and build it around my own purposes.
Note: The way Pinsir is currently written does not support multiple servers. One instance of the bot must be run for each server that you want to add it to.
-
You'll need to first create an application at the Discord developer portal. Use the following settings:
- Under Bot -> Privileged Gateway Intents, ensure
PRESENCE INTENT
,SERVER MEMBERS INTENT
, andMESSAGE CONTENT INTENT
are all enabled. - If using OAuth2 -> URL Generator, select the scopes
bot
andapplications.commands
, and then justAdministrator
for permissions. - (Recommended) Under Bot -> Authorization Flow, disable
Public Bot
andRequires OAuth2 Code Grant
.
- Under Bot -> Privileged Gateway Intents, ensure
-
Ensure that Node.js >=16.17.0 is installed on your system, along with
npm
>=8.15.0.
- Clone this repo, then run
npm install
to install dependencies. - Create a
.env
file with the following information:
TOKEN = yourDiscord.bot_Token
CLIENT_ID = botApplicationID
GUILD_ID = discordServerID
PINS_CHANNEL = serverPinsChannelID
where TOKEN
is your private alphanumeric bot token, CLIENT_ID
is the Application ID for your bot, GUILD_ID
is the ID number of your Discord server, and PINS_CHANNEL
is the ID of the text channel where you want your pins to be stored.
-
Run the command deployment script with
npm run register
. If you modify the functionality of src/deploy-commands.js, this will need to be run again. -
Run
npm start
to start the bot. The terminal should displayReady!
. You can check the bot's responsiveness using the command/settings
in the Discord server in which the bot is.
/settings
: Returns the current archive channel, any blacklisted channels, the archive mode, and the date of this build of the bot. This is an excellent way to ensure that your settings are correct.
pins
: Returns the number of pinned messages in the channel in which the command is run.
There are a few variables inside app.js that can be used to add to the bot's functionality.
BLACKLISTED_CHANNELS
: If there are channels that you don't want Pinsir to manage, specify the channel ID's in this array as strings. For example, if I don't want channels 991835081243111464
or 991834994110627902
to be managed, I would write this:
const BLACKLISTED_CHANNELS = ["881235081243111699", "881234994110627548"]
LAST_PIN_ARCHIVE
: When this boolean is set to true, the oldest pinned message in a channel is sent to the archive. When false, the newest pin is archived.
SEND_ALL
: When this boolean is set to true, all fifty pins will be sent to the archive when the limit is reached. When false, only one pin is archived.
My bot doesn't seem to work, I made a pin but discord tells me I reached my max.
You'll need to unpin your most recent pin and repin it for it to take effect.