def commandSetTipAmount(self, command): """ set the current tip amount save to the settings table """ if not util.checkLogin(self): return if len(command) < 2: self.writeConsole('You need to supply the new tip amount in ' + str(self.unit)) return self.tipAmount = command[1] db.setSetting(self, 'tipAmount', self.tipAmount) self.writeConsole('Tip amount has been set to ' + str(self.tipAmount) + ' ' + str(self.unit)) return
def commandSetUnit(self, command): """ set the current display unit save to the settings table """ if not util.checkLogin(self): return if len(command) < 2: self.writeConsole('You need to supply the new display unit.') return availableUnits = ['btc', 'mbit', 'ubit', 'satoshi', 'msat', 'usat'] if command[1].lower() not in availableUnits: self.writeConsole('The unit you entered is not known.\nAcceptable values are ' + str(availableUnits)) return self.unit = command[1].lower() db.setSetting(self, 'unit', self.unit) self.writeConsole('Display unit has been set to ' + str(self.unit)) return