public static void updateIDDB(shocky3.Plugin plugin) { DBCollection dbc = plugin.botApp.collection(String.format("%s.Settings", plugin.pinfo.internalName())); dbc.update( JSONUtil.toDBObject(new JSONObject()), JSONUtil.toDBObject(JSONObject.make("nextID", nextID)), true, false); }
public static void removeDB(shocky3.Plugin plugin, Tell tell) { DBCollection dbc = plugin.botApp.collection(plugin.pinfo.internalName()); dbc.remove(JSONUtil.toDBObject(JSONObject.make("tellid", tell.id))); }
public static void writeDB(shocky3.Plugin plugin, Tell tell) { DBCollection dbc = plugin.botApp.collection(plugin.pinfo.internalName()); removeDB(plugin, tell); dbc.insert(JSONUtil.toDBObject(write(tell))); }