1
mirror of git://git.acid.vegas/scroll.git synced 2024-11-25 17:46:38 +00:00

Added .ascii sync command to pull the latest art files

This commit is contained in:
Dionysus 2023-06-03 01:04:40 -04:00
parent f5e769ece1
commit 4725e6710b
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
2 changed files with 4 additions and 0 deletions

View File

@ -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 random [dir]` | play random art, optionally from the [dir] directory only |
| `.ascii search <query>` | search for art diles that match \<query> | | `.ascii search <query>` | search for art diles that match \<query> |
| `.ascii stop` | stop playing art | | `.ascii stop` | stop playing art |
| `.ascii sync` | sync the ascii database to pump the newest art |
## Preview ## Preview

View File

@ -127,6 +127,7 @@ class Bot():
self.db[dir] = self.db[dir]+[name,] if dir in self.db else [name,] self.db[dir] = self.db[dir]+[name,] if dir in self.db else [name,]
else: else:
self.db['root'] = self.db['root']+[item,] if 'root' in self.db else [item,] 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: except Exception as ex:
try: try:
await self.irc_error(connection.channel, 'failed to sync database', ex) await self.irc_error(connection.channel, 'failed to sync database', ex)
@ -245,6 +246,8 @@ class Bot():
await asyncio.sleep(throttle.message) await asyncio.sleep(throttle.message)
else: else:
await self.irc_error(chan, 'no results found', query) await self.irc_error(chan, 'no results found', query)
elif msg == '.ascii sync':
await self.sync()
elif len(args) == 2: elif len(args) == 2:
option = args[1] option = args[1]
if [x for x in ('..','?','%','\\') if x in option]: if [x for x in ('..','?','%','\\') if x in option]: