def set_email(self): delete = Mail.delete() delete.execute() for pseudo, mail in self.bot.conf.get("mails", {}).iteritems(): user = self.get_user(pseudo) Mail.create(user=user, mail=mail) return
def get_email(self, user, chan): try: res = Mail.get(schema.Mail.user == user) return res.mail except schema.Mail.DoesNotExist: return None