[discontinued] An irc bot with the aleph library, heavily inspired by #xkcd's Bucket
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


tactics - A simple irc bot.

Samuel Clements [ziaix] (c) 2010

	- Restricted commands may only be done by admins, on quotes that belong to the user or on quotes about the user
	- Phrases
		- Create: add a phrase to the database [done]
			- 'Phrase "{phrase}" added to my collection [#{id}].'
		- Delete: remove the phrase from the db (Restricted)
			- !notfound, !locked
		- Edit:	edit the phrase by applying a regex to the text (Restricted)
			- "apply s/(.+)/(.+)/ to #(?P<id>)"
			- "I have edited that phrase. #{id}"
			- !notfound, !locked
		- Lock, Unlock: only users can edit the phrase if this is set
			- "lock #(?P<id>) user"
			- "I have locked phrase #{id} to users only.", "I have unlocked phrase #{id}"
			- !locked
	- Aliases
		- Set an alias
			- """["'](?P<x>.+)["'] means ["'](?P<y>.+)["']"""
			- "{x} now means {y}."
			- "{x} already means something else."
		- Remove an alias
			- "Remove alias (?P<id>.+)"
			- "{x} has been removed."
	- Gender
		- Set gender: Set the users gender in the database
			- "(?=I am|My gender is) (male|female|androgynous)", "Refer to me (by name|randomly)", "Refer to me with <list of five pronouns>"
			- "I am now refering to you with the pronouns <list of five pronouns>"
		- Get gender: Ask the bot if the user has set a gender
			- "What is my gender?", "What gender is (?P<person>.+)?
			- "You are {gender}", "Person is {gender}"
	- Admin
		- Set and remove flags on users
			- "set flag (?P<flag>) on (?P<user>)"
			- "{user} is now {flag}."
			- 'admin': The user may use admin functions
			- 'banned': User may not interact with the bot
			- 'restricted': User may not use instructions
		- Create/delete users
			- "add user (?P<user>)"
			- "delete user (?P<user>)"

	- Return quote from message
	- Assemble quote
	- Format quote with variables
		- People
			- {user} - Nick that triggered the phrase
			- {person} - Person that is the subject of the quote
			- {someone} - Random person in the channel
			- {admin} - One of the bot admins
		- Gender - if a person variable is in the quote, look up genders (and other info?) for them
			- {gender.<type>}
				- subjective
				- objective
				- reflexive
				- possessive
				- determiner

Static data
	- links
		- type: (input, output)
		- data = dict(
			'is': ("(?P<subject>.+) is (?P<phrase>.+)", "{subject} is {phrase}"),
			'are': ("(?P<subject>.+) are (?P<phrase>.+)", "{subject} are {phrase}"),
			'owns': ("(?P<subject>.+)'s (?P<phrase>.+)", "{subject}'s {phrase}"),
			'verb': ("(?P<subject>.+) *(?P<verb>.+)* (?P<phrase>.+)", "{subject} {verb} {phrase}"),
			'reply': ("(?P<subject>.+) <reply> (?P<phrase>.+)", "{phrase}"),
			'error': ("(?P<subject>.+) <error> (?P<phrase>.+)", "{phrase}"),
			'special': ("(?P<subject>.+) <special> (?P<phrase>.+)", "\001ACTION{phrase}\001"),
	- locked
		- 'admin': Can only be edited by an admin
		- 'owner': Can only be edited by the owner
		- None: Can be edited by all
	- gender
		- Contains information on genders and their pronouns
		- (name, subjective, objective, reflexive, possessive, determiner)
		- data
			       male: he, him, himself, his, his
			     female: she, her, herself, hers, her
			androgynous: they, them, themself, theirs, their
			 non-binary: zie, hir, hirself, hirs, hir
			  inanimate: it, it, itself, its, its
			       name: {name}, {name}, {name}, {name}'s, {name}'s
			     random: refer to user using the pronouns a gender randomly selected from (male, female, non-binary)

	- aliases
		- Contains aliases for phrases, genders and people. 'x means y'
		- "_id" is indexed, unique
		- {"_id": x, "y": y, "lock": ~locked}
	- phrases
		- Contains phrases
		- indexed by 'lc_subject'
		- {"_id": subject.lower(), subject, link: ~link, phrase[, verb [, meta: {author: hostmask, time-created, [time-edited[, "lock": ~locked]]}]]}
	- people
		- {"_id": nickname, (gender: ~gender) || pronouns: {}), "flags": ~flags}
		- "_id" is indexed, unique