Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Export import #215

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Export import #215

wants to merge 4 commits into from

Conversation

BobVul
Copy link
Contributor

@BobVul BobVul commented Sep 10, 2014

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

@allquixotic
Copy link

+1

2 similar comments
@drpatil78
Copy link

+1

@SomeKittens
Copy link
Contributor

+1

@benjamingr
Copy link
Contributor

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

Other than that good commit, clean.

@BobVul
Copy link
Contributor Author

BobVul commented Sep 11, 2014

@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.

@AmaanC
Copy link
Contributor

AmaanC commented Sep 11, 2014

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
#215 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants