Showing posts with label bots. Show all posts
Showing posts with label bots. Show all posts

Monday, January 11, 2021

Random Tables Discord Bot: Tags Update

An update to the Random Tables Bot

Tags
 

Tags allow you to add properties to entries and table. This could be used to, say, add stats to an entry, identify tables for easy referencing (see ".viewall by" under bonus features below).

Rules of tags

-A tag is made up of two parts: the tag name, and the tag content.

-The bot doesn't look at tag content, even for Tags of Power (see below), the bot only checks if the tag name is present. You can leave the tag content field blank if you so choose, it is not required to process the command.

-If a table/entry already has a tag, and you apply a tag with the same name, the tag's content will be replaced with the new content. Additionally, if you replace a tag using this method but have the content = "delete", the tag will be removed.

-Only a entry/table's creator or a server mod can apply/replace/remove tags to said entry/table.

Tag Commands

.tagtable: applies a tag to a table or replace an existing tag. syntax: ".tagtable [tableid] [tag name] [tag content]"

.tagentry: applies a tag to an entry or replace an existing tag. syntax: ".tagentry [tableid] [entrynumber] [tag name] [tag content]"

.tagall: applies/replaces tags for every entry in a table. syntax: ".tagall [tableid] [tag name] [tag content]"

Tags of Power

The following tags will change how the bot functions regarding the tagged entry.

nocaps: if an entry contains this tag, any other table entries this table references will not contain capitalizations.

nopunct: if an entry contains this tag, any other table entries this table references will not contain punctuation.

Bonus Features 

Following the .viewall command with "by [tagname]" will bring up a list of all tables that contain this specific tag. .syntax ".viewall by [tagname]"

Using "random" as the table in the .roll command will roll a randomly selected result from a randomly selected table. syntax: ".roll random"

Tuesday, January 5, 2021

Random Tables Bot

Tags Update

My first foray into the world of Discord bots is now ready to deploy! It's designed to help with crowdsourcing random tables.

Benefits:

-Build multiple random tables at the same time.

-Roll results from generated tables, or view entire tables as lists.

-Tables are able to reference other tables, using them to build their results.

-Simple tables (those without references) can be exported as HTML snippets (can be dropped into web pages) or JSON objects (to feed advanced data projects).

Full list of available commands!
Most of the bugs and errors have been tested out, and I'm now feeling good about letting it spread to new servers. If you would like an invite to your server, send a DM to Saker Tarsos#7223! Also, if you find a bug, please let me know and you will receive my heartfelt thanks!

Start Guide (quotes are used to signify commands, and brackets are to signify input content, do not include the brackets or quotes):

-Create a table by typing in ".table [tablename]" (ex: ".table food")

-View the table in the table list by typing in ".viewall"

-Add an entry to the table by typing in ".entry [tablename] [entry content]" (ex: ".entry food A delicious casserole.")

-View the entries of a table by typing in ".view [tablename]"

-Once you have multiple entries in a table, roll a random result from the table by typing in ".roll [tablename]"

Advanced (references):

-Create a table (we'll use the "food" table from the above examples) and populate it with entries.

-Create a second table (we'll call it "events"), and add an entry that references the name of the first table between "^"s. (ex: ".entry events There was a great feast that featured ^food^.")

-Roll a random result from the second table, and it will pull a result from the first table and incorporate it into its own result. (result: "There was a great feast that featured a delicious casserole.")

-Note: the bot will automatically format referenced content to remove capitalizations and punctuation. This is why the above result was not "There was a great feast that featured A delicious casserole.."

 Github Link: https://github.com/sakertarsos/Random-Tables-Bot

 Server Invite Link: https://discord.com/api/oauth2/authorize?client_id=792517743059402812&permissions=0&scope=bot