scroll

- irc bot to play ascii art
git clone git://git.acid.vegas/scroll.git
Log | Files | Refs | Archive | README | LICENSE

commit 4725e6710bd9e78355cbc3a30e1f94c175931bdf
parent f5e769ece12b1aec117d07fcba41de61d74f8364
Author: acidvegas <acid.vegas@acid.vegas>
Date: Sat, 3 Jun 2023 01:04:40 -0400

Added .ascii sync command to pull the latest art files

Diffstat:
MREADME.md | 1+
Mscroll.py | 3+++

2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md
@@ -18,6 +18,7 @@ All of the IRC art is loaded directly from the [@ircart/ircart](https://github.c
 | `.ascii random [dir]`             | play random art, optionally from the [dir] directory only  |
 | `.ascii search <query>`           | search for art diles that match \<query>                   |
 | `.ascii stop`                     | stop playing art                                           |
+| `.ascii sync`                     | sync the ascii database to pump the newest art             |
 
 ## Preview
 
diff --git a/scroll.py b/scroll.py
@@ -127,6 +127,7 @@ class Bot():
 					self.db[dir] = self.db[dir]+[name,] if dir in self.db else [name,]
 				else:
 					self.db['root'] = self.db['root']+[item,] if 'root' in self.db else [item,]
+			await self.sendmsg(connection.channel, bold + color('database synced', light_green))
 		except Exception as ex:
 			try:
 				await self.irc_error(connection.channel, 'failed to sync database', ex)
@@ -245,6 +246,8 @@ class Bot():
 											await asyncio.sleep(throttle.message)
 									else:
 										await self.irc_error(chan, 'no results found', query)
+								elif msg == '.ascii sync':
+									await self.sync()
 								elif len(args) == 2:
 									option = args[1]
 									if [x for x in ('..','?','%','\\') if x in option]: