Just-Fans-Of / Impromp2

MIT License
17 stars 8 forks source link

Impromp2 Logo

Impromp2 : A Discord bot for making Temporary Channels

start with why start with why contributions welcome

But why?

Discord channels can get very messy very quickly. With the inability to categorize properly and with the vast amount of games out right now it is very easy to find yourself with 25 different channels that get used rarely.

Impromp2 allows you to type a simple chat command and instantly create a temporary channel that only exists as long as it has had recent activity. Feeling even lazier? Impromp2 will also automatically create a temporary voice channel when a certain amount of people are all playing the same game at the same time.

Who is it for?

How do I use it?

After first being invited to a server, Impromp2 will allow anyone with a role that grants them Administrative permission to run the /config command, which will let you setup all the configuration properties. The defaults are pretty good, but you may want to allow a few more roles to use the /create command by running /config add permission.create The Cool People Role

The /create command creates a temporary voice channel that will automatically be deleted after 30 seconds of being empty. The bot is also configured to automatically create channels when 4 people are playing the same game.

Installation

Click the banner below to install to your Discord server.

Discord Logo

To start your own instance of Impromp2

If you feel like hosting your own instance of this bot, running it requires only 3 things:

/**** keys.js ****/

module.exports = {
    discord: 'your discord bot user token',
    mongo: {
        url: 'localhost',
        port: 27017,
        db: 'database',
        user: 'username',
        pwd: 'password',
    }
};

Commands

Config

Usage: /config [action] [key] [value]
Actions:  get, set, add, remove
  * Array properties require add or remove
Keys:
  - commandPrefix [String]: The character used to denote a command. Typically /, !, or $. Default: /
  - autoCreateByGame [true/false]: Whether to create channels when enough people are playing the same game. Default: true
  - autoCreateByGameCommon [Integer]: Minimum # of people playing the same game before creating a channel. Default: 4
  - autoCreateByGameRoles [Array<Role Name>]: Limit the detected people for game-channel creation to specific roles
  - exemptAutoCreateGames [Array<String>]: List of game names that I won't create channels for automatically
  - tempChannelTimeout [Integer]: Number of seconds to wait before deleting an empty temporary channel. Default: 30
  - tempChannelNameFlag [String]: What to add to a temporary channel name to signify it is temporary. Default: :bomb:
  - tempChannelFlagLocation [String]: Where to put the flag, either start or end. Default: end
  - permission.create [Array<Role Name>]: Who can run the create command. Administrators always can.
  - permission.config [Array<Role Name>]: Who can run the config command. Administrators always can.
  - tempChannelPermissions [Name of another channel]: Copy the permissions of another channel for temporary channels. The channel can be deleted afterwards
Examples:
  - /config set autoCreateByGame false
  - /config get tempChannelNameFlag
  - /config add permission.create SuperAdministratorSquad
  - /config set tempChannelPermissions Temp permission channel

Create

Usage: /config [name]
Creates a temporary channel with the given name.
If no name is given, the channel's name will either be the title of the game you are playing, or your name if you are not.

Channel Permissions

To set the permissions for created temporary channels, create a dummy channel and set all the desired permissions on that. This will be used as a reference for future created temporary channels.
Then, to tell the bot which channel to copy the permissions from, enter the command /config set tempChannelPermissions Your Dummy Channel. From then on, all created temporary channels will have permissions equal to that dummy channel.
The dummy channel should then be deleted.