Factoid
Configuring the Factoid Module
The Factoid module allows users to create, manage, and retrieve factoids in channels or servers. Factoids are short pieces of text that can be used as responses or information snippets.
Commands and Usage
-
List All Factoids
- Lists all available factoids in the current target (server or channel).
- Usage:
,factoid list
,cfactoid list
- Example:
,factoid list
-
Get a Factoid
- Retrieves the value of a specified factoid.
- Usage:
,factoid get <name>
,cfactoid get <name>
- Example:
,factoid get example_factoid
-
Add a Factoid
- Adds a new factoid with a specified name and value.
- Usage:
,factoid add <name> <value>
,cfactoid add <name> <value>
- Example:
,factoid add example_factoid This is an example factoid.
-
Remove a Factoid
- Removes a specified factoid.
- Usage:
,factoid remove <name>
,cfactoid remove <name>
- Example:
,factoid remove example_factoid
Examples
-
To list all factoids in a server:
,factoid list
- Response:
Available server factoids: example_factoid, another_factoid
- Response:
-
To get the value of a factoid:
,factoid get example_factoid
- Response:
example_factoid: This is an example factoid.
- Response:
-
To add a new factoid:
,factoid add example_factoid This is an example factoid.
- Response:
Set server factoid 'example_factoid'
- Response:
-
To remove a factoid:
,factoid remove example_factoid
- Response:
Removed server factoid 'example_factoid'
- Response:
Advanced Factoid Usage
Factoids can reference other factoids using the {!factoid_name}
syntax. This allows for dynamic and nested factoids.
- Example of a nested factoid:
- Add two factoids:
,factoid add first_factoid This is the first factoid.
,factoid add second_factoid The second factoid references {!first_factoid}
- Retrieve the second factoid:
,factoid get second_factoid
- Response:
second_factoid: The second factoid references This is the first factoid.
- Add two factoids:
Notes
- Factoids can be managed on both server and channel levels.
- Commands starting with
cfactoid
are for channel-specific factoids, whilefactoid
commands are for server-wide factoids. - Ensure the correct permissions are set for managing factoids.
- Factoid nesting depth is limited to avoid infinite loops (default depth is 8).