SO-ChatBot icon indicating copy to clipboard operation
SO-ChatBot copied to clipboard

Export import

Open BobVul opened this issue 11 years ago • 7 comments

Add export and import commands using the GitHub Gist API for storage. Issue #158.

BobVul avatar Sep 10 '14 17:09 BobVul

import: http://chat.stackexchange.com/transcript/message/17606164#17606164

export: http://chat.stackexchange.com/transcript/118?m=17605797#17605797, http://chat.stackexchange.com/transcript/message/17606164#17606164

BobVul avatar Sep 10 '14 17:09 BobVul

+1

allquixotic avatar Sep 10 '14 17:09 allquixotic

+1

drpatil78 avatar Sep 10 '14 19:09 drpatil78

+1

SomeKittens avatar Sep 10 '14 19:09 SomeKittens

I think that clearing the memory should automatically back it up to a gist to prevent mishaps.

Other than that good commit, clean.

benjamingr avatar Sep 11 '14 05:09 benjamingr

@benjamingr I'm not sure what would be the best way to implement that. Extract export into a separate function, or chain the command?

var exportResult = bot.commands['export'].exec();

bot.memory.clear();

return exportResult + ' Bot memory cleared. Please restart the bot.';

Might also be a good idea to clear before importing new data, since the import .save() doesn't clear/overwrite bot_ localStorage entries that don't exist in the new data.

BobVul avatar Sep 11 '14 09:09 BobVul

Yeah, an import should probably clear old data On Sep 11, 2014 2:55 PM, "Bob" [email protected] wrote:

@benjamingr https://github.com/benjamingr I'm not sure what the best way to implement that is. Extract export into a separate function, or chain the command?

var exportResult = bot.commands['export'].exec(); return exportResult + ' Bot memory cleared. Please restart the bot.';

Might also be a good idea to clear before importing new data, since the import .save() doesn't clear/overwrite bot_ localStorage entries that don't exist in the new data.

— Reply to this email directly or view it on GitHub https://github.com/Zirak/SO-ChatBot/pull/215#issuecomment-55240302.

AmaanC avatar Sep 11 '14 09:09 AmaanC