Pages

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

7 comments:

  1. This is absolutely fantastic work, looking forward to breaking it :D

    ReplyDelete
    Replies
    1. Thank you, I'm looking forward to it as well hehe!

      Delete
  2. I've been looking forward to this for a while! You should put the code in a GitHub repo if you have not done so already.

    ReplyDelete
  3. Nice project! Is it possible to import tables as a json? I'm working on similar projects. How are you storing the tables? In a database?

    ReplyDelete
    Replies
    1. Thank you! I hadn't thought about that functionality, there might be some security concerns about evaluating json data from discord input, so I think if json import were to be included it would have to be outside of discord itself!

      Delete
  4. This sounds absolutely brilliant, good work!

    I have toyed around with Twitter bots and JS random rollers, never imagined anything like this however.

    ReplyDelete