A simple bot to help with repeating questions, tasks, and a bit of fun. This fork has a die rolling and tarot card drawing function as well.
This bot is a Nextcloud app-based bot โ it runs inside the PHP process and self-registers with Talk automatically when enabled. No external server or webhook configuration is needed.
Requirements: Nextcloud 31โ33 with the Talk app installed and enabled.
docker exec --user www-data nextcloud-aio-nextcloud php occ status
The destination folder name must be c0mmand_bot to match the app ID.
docker cp /path/to/die_roller_bot \
nextcloud-aio-nextcloud:/var/www/html/custom_apps/c0mmand_bot
docker exec --user root nextcloud-aio-nextcloud \
chown -R www-data:www-data /var/www/html/custom_apps/c0mmand_bot
This triggers the install repair step, which generates a shared secret and registers the bot with Talk automatically.
docker exec --user www-data nextcloud-aio-nextcloud \
php occ app:enable c0mmand_bot
Note the botโs ID from the output โ youโll need it in the next step.
docker exec --user www-data nextcloud-aio-nextcloud \
php occ talk:bot:list
You should see an entry named C0mmandBot with the URL nextcloudapp://c0mmand_bot.
Bots are registered server-wide but must be added to each conversation individually. The conversation token is the short alphanumeric string visible in the Talk URL when you open a conversation.
docker exec --user www-data nextcloud-aio-nextcloud \
php occ talk:bot:setup <bot-id> <conversation-token>
Alternatively, a conversation moderator can do this through the Talk UI: open the conversation โ โฎ menu โ Conversation settings โ Bots, then toggle C0mmandBot on.
Send !command in the conversation โ the bot should reply with its list of available commands.
Notes:
- The bot and its secret persist in Nextcloudโs app config and database across container restarts.
- After updating app files, run
php occ upgradeto apply any new database migrations.- To remove from a conversation: toggle it off in the Talk UI, or run
php occ talk:bot:unsetup <bot-id> <conversation-token>.- To uninstall entirely:
php occ app:disable c0mmand_bot.
Roll any combination of dice using standard RPG notation:
!roll 2d6
!roll 1d20+5
!roll 4d8-2
Returns each individual die result and the final total.
Add adv or dis to roll twice and automatically use the higher or lower result:
!roll 1d20 adv
!roll 1d20 dis
!roll 2d6+3 adv
Both rolls are shown, followed by the final result:
Roll 1: Rolled 12 + (5)
For a total of 17
Roll 2: Rolled 4 + (5)
For a total of 9
FINAL ROLL: 17
Draws a random tarot card (upright or reversed) and returns a short narrative interpretation. The response weaves together the card, its orientation, and a randomly chosen meaning into a single sentence:
!tarot
Example response:
#The Moon in shadow: Your hopes and fears is about being wary of self-deception and avoidance
Draws a random tarot card and returns the full general interpretation from an extended tarot guide, with no additional framing or narrative โ just the plain reading:
!ltarot
Cards drawn 1โ78 are upright (light) interpretations; 79โ156 are reversed (shadow) interpretations.
Example response:
The Moon reversed can indicate that you are getting the feeling that something is not right but are repressing those feelings or being untruthful with yourself about a situation...
Displays a random fortune pulled from the fortunes file:
!fortune
Example response:
๐ฎ Speaking the truth in times of universal deceit is a revolutionary act. - George Orwell
With no arguments, lists all available SRD spell lists by class name:
!spelllist
Response:
๐ Which spell list would you like?
- Bard
- Cleric
- Druid
- Paladin
- Ranger
- Sorcerer
- Warlock
- Wizard
To view the full spell list for a class, provide the class name (case-insensitive):
!spelllist Druid
!spelllist druid
!spelllist DRUID
All three return the contents of the Druid spell list.
Looks up a spell by name from the SRD spell library.
No argument โ prompts for input:
!spells
๐งPlease give at least the first letter of the spell.
Single letter โ returns all spells beginning with that letter:
!spells a
Exact or unique partial match โ returns the full spell description:
!spells Fireball
!spells fireb
Ambiguous partial match โ lists all matching spell names:
!spells fire
๐งChoose from these spells:
- Fire Bolt
- Fire Shield
- Fire Storm
- Fireball
No match โ reacts with ๐.
Spell data comes from the Systems Reference Document (SRD). Adding content is straightforward:
.txt file to lib/SRD/spells/. The filename (without extension) is the spell name used for lookups..txt file to lib/SRD/spell_lists/. The filename (without extension) is the class name shown in !spelllist.No code changes or restarts are needed โ the bot reads the directory contents at runtime.
Looks up a class description from the SRD.
No argument โ returns all available classes:
!class
Single letter โ returns all classes beginning with that letter:
!class b
Exact or unique partial match โ returns the full class description:
!class Druid
!class dru
Ambiguous partial match โ lists all matching class names:
!class r
โ๏ธChoose from these classes:
- Ranger
- Rogue
No match โ reacts with ๐.
Class data comes from the Systems Reference Document (SRD). To add a new class, add a .txt file to lib/SRD/class/. The filename (without extension) is the class name used for lookups. No code changes or restarts are needed.
Looks up a monster stat block or description from the SRD.
No argument โ prompts for input:
!monsters
๐งPlease give at least the first letter of the monster.
Single letter โ returns all monsters beginning with that letter:
!monsters d
Exact or unique partial match โ returns the full monster entry:
!monsters Beholder
!monsters beh
Ambiguous partial match โ lists all matching monster names:
!monsters dragon
๐งChoose from these monsters:
- Black Dragon
- Blue Dragon
- Brass Dragon
- ...
No match โ reacts with ๐.
Monster data comes from the Systems Reference Document (SRD). To add a new monster, add a .txt file to lib/SRD/monsters/. The filename (without extension) is the monster name used for lookups. No code changes or restarts are needed.
Looks up a magic item description from the SRD.
No argument โ prompts for input:
!magicitems
๐ชPlease give at least the first letter of the magic item.
Single letter โ returns all magic items beginning with that letter:
!magicitems b
Exact or unique partial match โ returns the full item description:
!magicitems Bag of Holding
!magicitems bag of hol
Ambiguous partial match โ lists all matching item names:
!magicitems bag
๐ชChoose from these magic items:
- Bag Of Beans
- Bag Of Devouring
- Bag Of Holding
- Bag Of Tricks
No match โ reacts with ๐.
Magic item data comes from the Systems Reference Document (SRD). To add a new magic item, add a .txt file to lib/SRD/magic_items/. The filename (without extension) is the item name used for lookups. No code changes or restarts are needed.
Looks up a rule entry from the Nimble ruleset.
No argument โ returns all available Nimble rule entries:
!nimble
Single letter โ returns all Nimble rules beginning with that letter:
!nimble c
Exact or unique partial match โ returns the full rule entry:
!nimble Conditions
!nimble cond
Ambiguous partial match โ lists all matching rule names:
!nimble s
๐Choose from these nimble rules:
- Spells
No match โ reacts with ๐.
To add a new Nimble rule entry, add a .md file to lib/SRD/nimble/. The filename (without extension) is the entry name used for lookups. No code changes or restarts are needed.
Looks up a rule entry from the SRD.
No argument โ returns all available rule entries:
!rules
Single letter โ returns all rules beginning with that letter:
!rules c
Exact or unique partial match โ returns the full rule entry:
!rules Combat
!rules comb
Ambiguous partial match โ lists all matching rule names:
!rules c
๐Choose from these rules:
- Combat
- Conditions
No match โ reacts with ๐.
Rule data comes from the Systems Reference Document (SRD). To add a new rule entry, add a .txt file to lib/SRD/rules/. The filename (without extension) is the entry name used for lookups. No code changes or restarts are needed.
Browses custom content stored in lib/Custom/. Collections are subdirectories; each file inside is an entry.
No argument โ lists all available collections:
!!
๐ Which collection would you like?
- speeches
- tables
One argument โ lists all entries in a collection:
!! speeches
๐ Choose from:
- Harvest Speech
- Opening Ceremony
- Victory Address
Two arguments (quoted) โ quoted second argument is treated as a single substring; returns the entry directly if exactly one match, or offers a choice if multiple:
!! speeches "Harvest Speech"
Returns the contents of Harvest Speech.md (or whichever file contains that substring in its name).
Two arguments (unquoted) โ each space-separated word is an independent search term; a file matches if its name contains any of the words:
!! speeches The Binding Of
๐ Choose from these:
- The Artifact Device
- The Binding Of The Dark
No match โ reacts with ๐.
lib/Custom/ โ its name is what you pass as the first argument..txt, .md, etc.) to the collection subdirectory. The filename without its extension is the display name used in listings and searches.No code changes or restarts are needed.
!set !counter The counter was used {count} times
!unset !counter

Simply post each command youโd like to add as a new message into your chat.
!set !hug {sender} shows {mention} some love! ๐
!set !praiseall {sender} praises the community! Thanks everyone for being awesome! We all have been praised already {count} times!
!set !english The prefered language is English. This allows more people to understand discussions and participate in them.
!set !cb Checkout the Nextcloud Talk **C0mmandBot**! Get it now from the [Nextcloud App store](https://apps.nextcloud.com/apps/c0mmand_bot) and checkout the documentation in the [Readme](https://github.com/nextcloud/c0mmand_bot)!
!set !userdocs Have a read through the [Nextcloud Talk User documentation](https://docs.nextcloud.com/server/latest/user_manual/en/talk/index.html) to learn more about most of the features.
!set !issue Please raise an issue in the GitHub repository: https://github.com/nextcloud/c0mmand_bot/issues/new/choose
!set !brb {sender} is right back! ๐
!set !afk {sender} went to see the world!๐ถโโก๏ธ
!set !re {sender} is back at the desk! ๐ป