~aleteoryx/ntalk

7a54772906afb70bbee00b280f10b4a8fdb8e381 — Aleteoryx a month ago 32c9d4b
deemanic influence
1 files changed, 11 insertions(+), 2 deletions(-)

M dee.py
M dee.py => dee.py +11 -2
@@ 19,17 19,26 @@ def act(what):
	botlib.send(f'{NAME} {msg}')

def help(nick):
	send(f'{nick}, my commands are: "dee, roll <dice>", "dee, shuf[fle] <A>, <B>, and <C>", and "dee, pick <A>, <B>, or <C>"')
	send(f'{nick}, my help is at https://aleteoryx.me/deeman.md')

last_cmd = ('dee, roll d6', ['dee,', 'roll', 'd6'], ['dee', 'roll', 'd6'])

def handle_msg(nick, line, words, pwords):
	global NAME
	global NAME, last_cmd

	print(nick, line, words, pwords)
	og_data = copy(line), copy(words), copy(pwords)

	if not botlib.strip_direct_address(NAME, [], words, pwords):
		return
	
	cmd = pwords[0]

	if cmd == 'again':
		return handle_msg(nick, *map(copy, last_cmd))
	else:
		last_cmd = og_data

	pwords.pop(0)
	words.pop(0)