Merge "Replace ~wipe by more selective ~reload"
This commit is contained in:
commit
e3944d3dcf
|
@ -127,8 +127,8 @@ You have to be a channel operator (+o) to use admin commands.
|
||||||
~newday
|
~newday
|
||||||
Removes now/next/location entries, to be run at the start of a new day
|
Removes now/next/location entries, to be run at the start of a new day
|
||||||
|
|
||||||
~wipe
|
~reload
|
||||||
Resets the database entirely (removes all defined tracks and topics)
|
Resets the database entirely (reloads from configuration)
|
||||||
|
|
||||||
|
|
||||||
Local testing
|
Local testing
|
||||||
|
|
|
@ -163,8 +163,8 @@ class PTGBot(irc.bot.SingleServerIRCBot):
|
||||||
return
|
return
|
||||||
words = msg.split()
|
words = msg.split()
|
||||||
command = words[0][1:].lower()
|
command = words[0][1:].lower()
|
||||||
if command == 'wipe':
|
if command == 'reload':
|
||||||
self.data.wipe()
|
self.data.reload()
|
||||||
elif command == 'newday':
|
elif command == 'newday':
|
||||||
self.data.new_day_cleanup()
|
self.data.new_day_cleanup()
|
||||||
elif command == 'list':
|
elif command == 'list':
|
||||||
|
|
|
@ -167,8 +167,9 @@ class PTGDataBase():
|
||||||
self.data['location'] = {}
|
self.data['location'] = {}
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def wipe(self):
|
def reload(self):
|
||||||
self.data = copy.deepcopy(self.BASE)
|
self.data = copy.deepcopy(self.BASE)
|
||||||
|
self.load_data_from_config()
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
|
|
Loading…
Reference in New Issue