Skip to content

Advanced Chat Commands

Craig Edwards edited this page Jan 15, 2020 · 12 revisions
Table of Contents
Literal replies
Actions
Spoilers
Showing a raw reply
Random selection of multiple choices
Embeds
Aliases
Keywords which contain 'is', etc.

Literal replies

If you want Sporks to literally say some text, rather than reformatting it, you can for example type:

@Sporks, twitch is <reply> stop watching WoW streams and get back to work.

Actions

Actions are replies that the bot will do as if it was performing that action. This is a holdover from the bot's IRC days, where this would actually be the IRC /ME command. In Sporks on Discord, the bot will enclose these types of replies in "*" characters, causing the text to appear in italics. For example:

@Sporks, hug me is <action> hugs <who>

Spoilers

You can use the literal <s> to insert a | symbol, which can be used two in a row to insert a spoiler. For example:

A joke. Ha. Ha. Ha...

Showing a raw reply

If you want the bot to tell you what is literally defined in the database for a fact you can type

@Sporks literal <phrase-here>

You will be shown the definition of the phrase, as an embed if it is small enough, otherwise as text:

Random selection of multiple choices

Within any response, you can separate multiple responses with a pipe symbol "|" and the bot will pick one at random when responding. for example:

@Sporks, pick a city is <reply>London|<reply>Paris|<reply>New York|<reply>Sydney|<reply>Cape Town|<reply>Los Angeles

You can also use the <list> keyword to define multiple random choices in one response, for example:

@Sporks, fruit is <reply> I want a <list:red,blue,green,purple> <list:banana,aubergine,apple,strawberry>!

Embeds

It is possible to teach Sporks an embed, which is a rich format text block which is usually only available to bots. To create an embed, you should teach it sporks as JSON, prefixed with the <embed> keyword. For example:

Defining an embed fact

This will teach Sporks the embed:

Defining an embed fact

If there are errors in your embed, when you ask Sporks about the keyword, you will instead get an error report:

Defining an embed fact

There are many ways to create an embed as JSON easily and interactively, I recommend many of the free online builders such as this one, the leovoel embed visualiser.

Aliases

It is possible to make one response an alias of another response. If you do this, Sporks will use the value of the response as the keyword to find the actual value: For example:

@Sporks apple is <reply> a red fruit
@Sporks red fruit is <alias> apple

Note that it is not possible to chain aliases, or create loops. An alias may only directly reference another non-alias, if you reference an alias to another alias, the raw value will be shown instead, breaking the chain.

Separating Keywords And Response

Sometimes, you might want to teach Sporks a phrase that contains for example the word 'is' in the keyword part. If you want to do this you must make clear to Sporks where the keyword ends and the response begins. Do this by placing = symbols around the pivot word, for example, if you wanted Sporks to answer to the keyword "is is":

Pivot Point in Response