xkcd_bot package¶
Subpackages¶
Submodules¶
xkcd_bot.XkcdBot module¶
-
class
xkcd_bot.XkcdBot.
XkcdBot
(connection: bokkichat.connection.Connection.Connection, location: str, db_uri: Optional[str] = None)¶ Bases:
kudubot.Bot.Bot
The Xkcd Bot class that defines the bot’s functionality
-
bg_iteration
(_: int, db_session: sqlalchemy.orm.session.Session)¶ Periodically checks for new notifications and sends them out :param _: The iteration count :param db_session: The database session to use :return: None
-
classmethod
name
() → str¶ - Returns
The name of the bot
-
on_new
(address: kudubot.db.Address.Address, _: Dict[str, Any], db_session: sqlalchemy.orm.session.Session)¶ Sends the newest XKCD comic :param address: The user’s address :param _: The arguments for the command :param db_session: The database session to use :return: None
-
on_show
(address: kudubot.db.Address.Address, args: Dict[str, Any], db_session: sqlalchemy.orm.session.Session)¶ Sends a specific XKCD comic :param address: The user’s address :param args: The arguments for the command :param db_session: The database session to use :return: None
-
on_subscribe
(address: kudubot.db.Address.Address, _: Dict[str, Any], db_session: sqlalchemy.orm.session.Session)¶ Creates a new subscription for the user :param address: The user’s address :param _: The arguments for the command :param db_session: The database session to use :return: None
-
on_unsubscribe
(address: kudubot.db.Address.Address, _: Dict[str, Any], db_session: sqlalchemy.orm.session.Session)¶ Unsubscribes a user :param address: The user’s address :param _: The arguments for the command :param db_session: The database session to use :return: None
-
classmethod
parsers
() → List[kudubot.parsing.CommandParser.CommandParser]¶ - Returns
A list of parser the bot supports for commands
-
classmethod
version
() → str¶ - Returns
The current version of the bot
-
xkcd_bot.XkcdCommandParser module¶
-
class
xkcd_bot.XkcdCommandParser.
XkcdCommandParser
¶ Bases:
kudubot.parsing.CommandParser.CommandParser
Parser for the xkcd-bot bot
-
classmethod
commands
() → List[kudubot.parsing.Command.Command]¶ Defines the commands the parser supports :return: The list of commands
-
classmethod
name
() → str¶ - Returns
The name of the parser
-
classmethod