A discord bot for getting passwords with https://onetimesecret.com/ if having a certain role
This bot can run the following commands:
help
: Shows all commands or more information about a specific commandpw
: Without args: List of all passwords; With args: Get password when you have a whitelisted discord role!
- You need node.js (v16.14.0 or higher) installed.
- You need a Discord API Bot with it's token.
- You need a Discord server on which you can set permissions, so you can invite the bot and give it the following permissions:
- View Channels
- Send Messages
- Send Messages in Threads
- Rename the configuration file (/config/config-template.json) from
config-template.json
toconfig.json
- Open and set the configuration file (now
config.json
) (see Config-Table below) - Run
npm install
.
Key | Description | Value-Type | Must be set |
---|---|---|---|
prefix | The bot's prefix | String | yes |
token | The bot's token | String | yes |
api_user | The User-Name (E-Mail) of personal onetimesecret-Account | String | yes |
api_key | The API-Key of personal onetimesecret-Account | String | yes |
pw | The saved passwords. Fill with Password-Objects | Array of Object | yes |
"<PW_NAME_1>": { // the label for the password! It will be accessable via pw command (pw <PW_NAME>)
"user": "<USERNAME>", // The username to for your application (this will send via plain text)
"password": "<PASSWORD>", // The secret password for your application (this will send via onetimesecret)
"role_ids_with_access": [ "<ROLE-ID_1>", "<ROLE-ID_2>", "<ROLE-ID_3>" ] // only if a member has one of this roles, he/she has access to get this password via pw <PW_NAME>
}
Run index.js
with npm start
or node index.js
.
Alternative you can use npm run pm
, npm run pm-restart
and npm run pm-stop
.
This will use pm2 for executing