This is the glacier Reference Manual, version 0.4, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:17:40 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
glacier
lightweight mastodon bot framework
ava fox
BSD 3-Clause
0.4
dexador
(system).
bordeaux-threads
(system).
str
(system).
websocket-driver
(system).
simple-config
(system).
cl-json
(system).
tooter
(system).
cl-ppcre
(system).
alexandria
(system).
package.lisp
(file).
variables.lisp
(file).
util.lisp
(file).
mappings.lisp
(file).
bot.lisp
(file).
extensions.lisp
(file).
glacier.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
glacier/glacier.asd
glacier/package.lisp
glacier/variables.lisp
glacier/util.lisp
glacier/mappings.lisp
glacier/bot.lisp
glacier/extensions.lisp
glacier/glacier.lisp
glacier/variables.lisp
package.lisp
(file).
glacier
(system).
*command-prefix*
(special variable).
*bot*
(special variable).
*commands*
(special variable).
*cw-mappings*
(special variable).
*mappings-write-date*
(special variable).
*privileged-commands*
(special variable).
glacier/util.lisp
variables.lisp
(file).
glacier
(system).
add-command
(function).
after
(macro).
after-every
(macro).
agetf
(function).
boost-p
(function).
bot-post-p
(function).
delete-parent
(function).
fave-p
(function).
follow-p
(function).
follow-request-p
(function).
mention-p
(function).
on
(macro).
poll-ended-p
(function).
time-to-seconds
(function).
add-scheme
(function).
commandp
(function).
current-day
(function).
dow-for
(function).
ensure-list
(function).
get-mastodon-streaming-url
(function).
parse-time
(function).
print-close
(function).
print-open
(function).
privileged-reply-p
(function).
seconds-until
(function).
seconds-until-midnight
(function).
seconds-until-timestring
(function).
glacier/mappings.lisp
util.lisp
(file).
glacier
(system).
generate-cw
(function).
load-mapping-files
(function).
mappings-updated-p
(function).
parse-mapping-file
(function).
glacier/bot.lisp
mappings.lisp
(file).
glacier
(system).
bot-client
(reader method).
bot-client
(class).
bot-on-delete
(reader method).
(setf bot-on-delete)
(writer method).
bot-on-notification
(reader method).
(setf bot-on-notification)
(writer method).
bot-on-update
(reader method).
(setf bot-on-update)
(writer method).
bot-username
(reader method).
initialize-instance
(method).
make-bot
(function).
mastodon-bot
(class).
bot-account-id
(reader method).
glacier/extensions.lisp
bot.lisp
(file).
glacier
(system).
*no-bot-regex*
(special variable).
api-request
(function).
upload-media
(function).
glacier/glacier.lisp
extensions.lisp
(file).
glacier
(system).
run-bot
(macro).
terminate-connection
(function).
*websocket-client*
(special variable).
command-dispatch
(function).
dispatch
(function).
Packages are listed by definition order.
glacier
common-lisp
.
*command-prefix*
(special variable).
add-command
(function).
after
(macro).
after-every
(macro).
agetf
(function).
boost-p
(function).
bot-client
(generic reader).
bot-client
(class).
bot-on-delete
(generic reader).
(setf bot-on-delete)
(generic writer).
bot-on-notification
(generic reader).
(setf bot-on-notification)
(generic writer).
bot-on-update
(generic reader).
(setf bot-on-update)
(generic writer).
bot-post-p
(function).
bot-username
(generic reader).
delete-parent
(function).
fave-p
(function).
follow-p
(function).
follow-request-p
(function).
make-bot
(function).
mastodon-bot
(class).
mention-p
(function).
no-bot-p
(generic function).
on
(macro).
poll-ended-p
(function).
post
(function).
reply
(generic function).
run-bot
(macro).
terminate-connection
(function).
time-to-seconds
(function).
*bot*
(special variable).
*commands*
(special variable).
*cw-mappings*
(special variable).
*mappings-write-date*
(special variable).
*no-bot-regex*
(special variable).
*privileged-commands*
(special variable).
*websocket-client*
(special variable).
add-scheme
(function).
api-request
(function).
bot-account-id
(generic reader).
command-dispatch
(function).
commandp
(function).
current-day
(function).
dispatch
(function).
dow-for
(function).
ensure-list
(function).
generate-cw
(function).
get-mastodon-streaming-url
(function).
load-mapping-files
(function).
mappings-updated-p
(function).
parse-mapping-file
(function).
parse-time
(function).
print-close
(function).
print-open
(function).
privileged-reply-p
(function).
seconds-until
(function).
seconds-until-midnight
(function).
seconds-until-timestring
(function).
upload-media
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
character or string that prefixes a command
runs BODY after AMOUNT of DURATION
if ASYNC is non-nil, runs asynchronously
runs BODY after every AMOUNT of DURATION
if ASYNC is non-nil, runs asynchronously
if RUN-IMMEDIATELY is non-nil, runs BODY once before waiting for next invocation
runs BODY on DAY, optionally AT a time
DAY is a keyword with the day of the week (e.g., :sunday, :monday, etc)
AT is a string denoting a time (e.g., ’13:20’, ’4:20PM’, ’23:00’)
if ASYNC is non-nil code is executed asynchronously
if AT is nil, code is ran at midnight on DAY
runs BOT, setting up websocket handlers and starting the streaming connection before executing BODY
if DELETE-COMMAND is non-nil, automatically adds a delete command
if WITH-WEBSOCKET is non-nil (default), automatically starts up a websocket listener for realtime updates
NOTE: DELETE-COMMAND is ignored used if WITH-WEBSOCKET is nil
if BODY is not provided drops into a loop where we sleep until the user quits us, or our connection closes. this functionality does not happen if WITH-WEBSOCKET is nil.
adds a command into our hash
CMD should be a string
FUNCTION should be a function that accepts a single parameter (a tooter:status object)
if PRIVILEGED is non-nil, command will only be triggered if mention is sent by an account the bot is following if ADD-PREFIX is non-nil, adds *COMMAND-PREFIX* to the front of CMD (defaults to t)
getf but for alists
checks if NOTIFICATION is a boost
checks if STATUS was posted by the bot
deletes the parent post of STATUS if it was posted by the bot
checks if NOTIFICATION is a favourite
checks if NOTIFICATION is a follow
checks if NOTIFICATION is a follow request
makes a bot and returns it.
INSTANCE, ACCESS-TOKEN, STRIP-HTML, STRIP-USERNAME, TIMELINE are all options that are typically in a config file
passing these values in allows the developer to skip specifying a config file and can pull values in from other places
e.g., command line arguments
CONFIG-FILE is a string or a path that denotes a glacier config file
INSTANCE is a mastodon instance domain name, with or without http scheme
ACCESS-TOKEN is an access token for a mastodon account on INSTANCE
STRIP-HTML if non-nil incoming posts will have their html stripped from them. defaults to T
STRIP-USERNAME if non-nil strips the bot’s username from incoming posts. defaults to NIL
TIMELINE string denoting which timeline should be used for the streaming websocket. can be one of ’user’, ’public’, ’direct’. defaults to ’user’
ON-UPDATE a function that accepts a single mastodon status. gets ran for every new post that streams in from TIMELINE
ON-DELETE a function that accepts a single status id. gets ran for every deleted status that streams in from TIMELINE
ON-NOTIFICATION a function that accepts a single mastodon notification. gets ran for every notification that streams in from TIMELINE
CW-MAPPINGS a pathname or list of files that contain mappings specially formatted for the bot to automatically provide content warnings for generated posts. please see provided content-warning.map.example for examples of the formatting
checks if NOTIFICATION is a mention
checks if NOTIFICATION is a poll
a thin wrapper around tooter:make-status
will automatically generate a content warning if cw-mappings was provided when the bot was created
Note: POLL-TIMEOUT is the number of seconds until the poll ends
see documentation for that function
closes the websocket connection and clears the variable from memory
takes all values passed as REST, converts the time into seconds, and returns the total
REST should be arguments compatible with PARSE-TIME
example usage: (time-to-seconds 1 :day 2 :hours 30 :minutes)
mastodon-bot
)) ¶automatically generated reader method
mastodon-bot
)) ¶automatically generated reader method
mastodon-bot
)) ¶automatically generated writer method
mastodon-bot
)) ¶automatically generated reader method
mastodon-bot
)) ¶automatically generated writer method
mastodon-bot
)) ¶automatically generated reader method
mastodon-bot
)) ¶automatically generated writer method
mastodon-bot
)) ¶automatically generated reader method
mention
)) ¶checks account found in MENTION to see if they have NoBot set
account
)) ¶checks an account’s bio and profile fields to see if they contain a NoBot tag
string
)) ¶checks an account’s bio and profile fields to see if they contain a NoBot tag
status
) text &key include-mentions media cw sensitive visibility) ¶replies to a STATUS with TEXT. copies the visibility and content warning as the post it’s replying to
if INCLUDE-MENTIONS is non-nil, include mentions besides the primary account being replied to
mastodon-bot
) &rest initargs &key config-file instance token strip-html strip-username timeline cw-mappings &allow-other-keys) ¶bot superclass
:on-update
:on-delete
:on-notification
This slot is read-only.
This slot is read-only.
This slot is read-only.
global bot object
hash table containing the bot’s commands
KEY is the command as a string
VALUE is a function that accepts a tooter:status object as a parameter
regex to check for the NoBot tag
hash table containing commands that will only be ran if the mention
is from an account the bot follows
KEY is the command as a string
VALUE is a function that accepts a tooter:status object as a parameter
global websocket client
adds https scheme to DOMAIN if it isnt already there
perform an API request
FRAGMENT is the fragment of the url that goes AFTER api/v1/
RESULT-TYPE (if provided) is the object type that we should use when parsing the response
can be either a symbol (’account) or list ’(:list account)
if it is a list then we decode the response and collect and return them as a list
parses STATUS content for a command word, and runs any function it has in *commands* with it as the argument
if STATUS comes from an account the bot is following, also checks for any command in *privileged-commands*
gets the type of MESSAGE we received and calls the appropriate functions on our bot with the proper tooter object
returns a content warning based off of our cw-mappings and the STATUS-TEXT
gets the websocket url for the mastodon instance
loads the content warning mappings from FILES
returns an alist containing all mappings
checks to see if any mapping FILES has been updated since our last check
parses mapping FILE, returning an alist of the mappings of the from (CW (words))
parses AMOUNT of DURATION into seconds
prints a message when the websocket is closed
prints a message when the websocket is connected
returns T if STATUS is from an account that the bot follows
determines how many seconds until HOURS MINUTES and SECONDS
if the time has already passed it returns 0 instead of a negative time
returns how many seconds until it’s midnight
parses TIME-STRING and returns how long until the time specified TIME-STRING is of the form ’12:04’, ’18:30’, ’1:10PM’, etc
uploads MEDIA to the defined mastodon server.
returns a list that can be passed into POST or REPLY
MEDIA may be a list containing pathnames, or lists of the form (PATH-TO-FILE IMAGE-DESCRIPTION)
if it is like the latter, the description will be applied to the image upon uploading
mastodon-bot
)) ¶automatically generated reader method
Jump to: | (
A B C D E F G I L M N O P R S T U |
---|
Jump to: | (
A B C D E F G I L M N O P R S T U |
---|
Jump to: | *
A C O S |
---|
Jump to: | *
A C O S |
---|
Jump to: | B C E F G M P S U V |
---|
Jump to: | B C E F G M P S U V |
---|