Skip to content

Zeptaxis/bot-counter

Repository files navigation

bot-counter

A Discord bot that can count things.

Installation

  • Download Node.js Version 6.0.0 or more
  • Open a command prompt in the project folder and type :
    • npm install
  • Rename the settings-template.properties file to settings.properties.
  • Edit the settings.properties file and add your Discord API token. While you are at it, you can add your ID in the file so the bot know you are its owner. If you don't know how to get your ID, check next section.
  • You can get your Discord API token here. You need to create a new application, then create a bot user, then your token will be available in the APP BOT USER section.
  • To invite your bot to your server, copy the following link and replace the 12345678 with the Client ID you can find on your application's page. https://discordapp.com/oauth2/authorize?client_id=12345678&scope=bot&permissions=66186303
  • To run the bot, just open a command prompt in the bot folder and type node bot-counter.js
  • To stop the bot, type in any channel it has access either !stop or !exit. You can also press Ctrl + C.
How to get your ID
  • Run the bot and add it to your server
  • Type !uid in a channel that the bot can access
  • Copy your ID in the settings.properties file next to ownerID =
  • Restart the bot for changes to work.

Usage

Create counters with the !addcounter name command.
Show the counter's value with !name.
Interact with it with !name + or !name -.
Mathematics are supported : !name +5*2+3 will add 13 to name.

Leaderboards

Each counter has its own leaderboard. You can increase any user's point by mentioning it after the !counter + command. See examples if unclear.

Customization

You can customize each counter with !name edit property newValue, where property can be one of the following :

  • step : The step that is used when you type !counter +. Must be an integer or it will be reset to 1.
  • textView : The text displayed when you call !counter.
  • textPlus : The text displayed when you call !counter +....
  • textMinus : The text displayed when you call !counter -....
  • textReset : The text displayed when you call !counter reset.
  • textValue : The text displayed when you call !counter value ....
  • textLeaderboard : The text displayed when you call !counter leaderboard.

All the text properties can contain some variables that will be dynamically replaced. These are :

  • %value% : will be replaced by the counter's current value.
  • %name% : will be replaced by the counter's name.
Examples

Create a counter : !addcounter badjokes
Customize the counter : !badjokes edit textPlus He did it again. This is the %value% time.
Add to the counter : !badjokes + Which will output : He did it again. This is the 1 time.
Delete the counter : !delcounter badjokes
Add 5 points to John : !badjokes +5 @John
Add 3 points to Lynda : !badjokes +3 @Lynda
See the leaderboard : !badjokes leaderboard


Full documentation will come soon !

About

A Discord bot that can count things.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •