npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

clattr-bot

v0.1.0

Published

An experimental dice bot for discord.

Downloads

29

Readme

Clattr Bot Build Status Coverage Status

An experimental dice bot for Discord.

Features

Multiple Rolls: make multiple rolls on a single line, separated by a comma

Math: add, subtract, multiply and divide dice results and modifiers

Tag Your Rolls: label your rolls with tags, so the results will be marked

Keeping & Discarding Rolls: roll multiple dice and keep the lowest or highest

Exploding Dice: with optional target numbers for explosions

Wild Dice: supports Savage Worlds-style wild dice natively

Dice Pools: Clattr supports game systems that use dice pools with target numbers

Fate Dice: You can use fate dice too

Cleans Up its Mess: Clattr removes your roll message and tags you with the result - clattr, but no cluttr!

Nicely Formatted: Clattr puts its results first, roll details later for easy reading

Better Randomness: Clattr will give more 'random-feeling' results than some dice rollers, no streaks or runs (it uses the mersenne-twister PRNG algorithm, if you're curious)

Playing Cards: fully simulated playing card decks, for use in Savage Worlds initiative, your Deck of Many Things, or any other card-based game mechanic

Supported Games

D20/D&D: dice rolls, modifiers, rolling with advantage and disadvantage - everything you need for 2nd - 5th edition, Pathfinder, and other D20 games

WoD, nWoD, Exalted: and other Storyteller-based games, with clean easy syntax

Shadowrun: supports exploding dice

Fate: has special rules for fate dice

Savage Worlds: wild dice and playing card support, plus all the other dice features

Almost Everything Else: but if you can't use it with your favorite game, or it's kinda clunky, let me know

Quick Examples:

| Example | result | |------------------|--------| | !r d20 #hit | roll 1d20, with the tag 'hit' | | !r 2d20k1+3 | roll 2 d20s, keep the highest, and add 3 | | !r 4d20l2-1 | roll 4 d20s, keep the lowest 2, and subtract 3 | | !r 3d6! | roll 3 exploding d6s | | !r 3d6!5 | roll 3 exploding d6s that explode on 5 or 6 | | !r 3d6!m1 | roll 3 exploding d6s, but they only explode once | | !r 3d6!5m1 | roll 3 exploding d6s that explode once on 5 or 6 | | !r 3d6!5m1k2 | roll 3 exploding d6s that explode once on 5 or 6, keep the highest 2 | | !r 3p6t4 | roll a pool of 3d6, counting 4 or higher as a hit | | !r 3p6t4! | roll a pool of 3d6, counting 4 or higher as a hit, exploding on 6 | | !r 4f+3 | roll 4 fate dice, add 3 to the result | | !r w8+2 | roll a d8 with a d6 wild die, add 2 to the greater of the two | | !c 2 | draw 2 cards from the guild deck | | !c 2 foo | draw 2 cards from the deck named 'foo' | | !c shuffle | shuffle the guild deck | | !c shuffle foo | shuffle the guild deck | | !c list | list all decks in play | | !c remove foo | remove the deck named 'foo' from play |

Check out the wiki for full documentation, and the examples section for more usage examples.

Setup

Clattr is currently in testing and you probably shouldn't even be reading this. You can't install the "official" version because it's not hosted online. You'll have to run it on your own computer for now, or know someone who does. Will set up a server after completing the rest of its needed features.

  1. download the source code: git clone https://github.com/nphyx/clattr-bot
  2. change to the clattr-bot directory: cd clattr-bot
  3. install packages: npm install .
  4. follow standard Discord bot setup procedure [https://discordjs.guide/#/preparations/setting-up-a-bot-application]
  5. get your bot token (use the guide above, and note that Clattr requires the 'manage messages' permission)
  6. copy .env.example to .env and fill out the environment variables
  7. run the bot, in Linux: npm start
  8. start playing!

Roadmap

  • coin tosses: you can simulate coin tosses with 1d2, but there's some code supporting coins specifically that just needs user interface and formatting
  • advanced playing card rules: support for dealers, player hands, managed discard piles, and multi-pack decks is planned but unimplemented
  • other cards: a lot of the playing cards code is reusable, but need to create lists of face cards, suits, etc. for other card systems (Tarot, etc)
  • saving rolls for reuse (macros): planned, but needs lots of work

License

GPL 3.0 - see LICENSE.txt

Yes you're welcome to clone this, modify it, contribute changes, etc. If you're a random passer-by. If you choose to contribute, please write unit tests. Also, sorry for the mess, it's a WIP.