Due to the migration of the TBGs, development of Nihonium has ceased permanently.
This page lists variables and functions used in Nihonium.
Last Updated: Aug. 3rd, 2021 (0.9.2)
(Note: this page is currently incomplete, and has only been uploaded due to the fact that the webpages and bot are in the same repository.)
main.py
logEntry(entry, timestamp)
datetime.datetime): The timestamp for the entry. Defaults to
datetime.datetime.now().
Creates an entry in the logfiles.
getReq(*args, **kwargs)
mainSession.get().
Makes a GET request, stores the received cookies, and makes a log entry.
postReq(*args, **kwargs)
mainSession.post().
Makes a POST request, stores the received cookies, and makes a log entry.
update_sig(_motd, xline, misc)
Updates the bot's signature. Uses the
siggyvariable to store inputs, in case they are ommited later.
motd()
Used in
update_sig().
moveCursor(x, y)
Moves the terminal cursor.
writeText(x, y, text, fcolor, bcolor)
Displays text on the terminal, in a specified location, with specified colors. Crucial for managing a text-based display.
async writeTextA(x, y, text, fcolor, bcolor)
A wrapper for
writeText()that allows you to
awaitit.
bell()
Makes an audible noise.
clearLine(line)
Clears the specified line.
async clock()
Runs a clock in the top-right corner of the terminal.
validCommand()
Increases the valid command count, and then writes
datato
data.json.
assemble_botdata()
Used by
parse_command()to generate data about the bot.
dictcontaining the following:
datetime.datetime): The time Nihonium was started.
data.json.
threadData.json.
requests.cookies.cookielib.CookieJar): The cookies used to keep Nihonium logged in.
requests.sessions.Session): A session used to assist with HTTP requests.
versions.Version): The current version of Nihonium.
assemble_threaddata(tID)
Used by
parse_command()to generate data about the thread the command was called in.
dictcontaining the contents of
post_ids[str(tID)], plus the following:
assemble_userdata(command)
Used by
parse_command()to generate data about the user who called the command.
dictcontaining the following:
parse_command(command, tID)
Parses the given command.
Returns a string which contains the output to be displayed. This string may be empty, in which case no output is displayed for that command.
main_loop(tID, row)
Scrapes commands from the thread given by
tID, passes them to
parse_command()to be parse, and takes the outputs and posts them to the thread.
async true_main_loop()
Manages several things, including the calling
main_loop()for each of the threads, keeping track of the sixty second and thity minute waits, and some of the terminal output.
async outerloop()
Starts both
true_main_loop()and
clock().
final()
Used when the bot is closed with Ctrl+C.
async exit_script()
Stops both
true_main_loop()and
clock().