Exemple #1
0
 async def setmile(cls, user, guild_id: int, time: str):
     session = Session()
     fitness = await cls.get_user(user.lower(), guild_id)
     fitness.mile = time
     session.add(fitness)
     session.commit()
     session.close()
Exemple #2
0
 async def setohp(cls, user, guild_id: int, weight: float):
     session = Session()
     fitness = await cls.get_user(user.lower(), guild_id)
     fitness.ohp = weight
     session.add(fitness)
     session.commit()
     session.close()
Exemple #3
0
 async def setgender(cls, user, guild_id: int, gender: str):
     session = Session()
     fitness = await cls.get_user(user.lower(), guild_id)
     fitness.gender = gender.lower()
     session.add(fitness)
     session.commit()
     session.close()
Exemple #4
0
 async def setburpees(cls, user, guild_id: int, count: int):
     session = Session()
     fitness = await cls.get_user(user.lower(), guild_id)
     fitness.burpess_1m = count
     session.add(fitness)
     session.commit()
     session.close()
Exemple #5
0
 async def add_event(cls, guild_id: int, event_name: str, event_date: date):
     session = Session()
     event = CountdownEvents()
     event.guild_id = guild_id
     event.event_name = event_name
     event.event_date = event_date
     session.add(event)
     session.commit()
     session.close()
Exemple #6
0
 async def add_reminder(cls, guild_id, user, reminder_msg, channel,
                        reminder_time):
     session = Session()
     reminder = Reminders()
     reminder.guild_id = guild_id
     reminder.user = user
     reminder.message = reminder_msg
     reminder.channel = channel
     reminder.when = reminder_time
     session.add(reminder)
     session.commit()
     session.close()
Exemple #7
0
 async def ban_user(cls, user: str, banned_by: str, ban_reason, ban_time):
     session = Session()
     ban = session.query(Bans).filter_by(user=user).first()
     if ban is None:
         ban = Bans()
     ban.user = user
     ban.banned_by = banned_by.lower()
     ban.ban_reason = ban_reason
     ban.banned_on = datetime.datetime.now()
     ban.ban_time = ban_time
     session.add(ban)
     session.commit()
     return
Exemple #8
0
 async def get_progress(cls, user, guild_id: int):
     session = Session()
     fitness = await cls.get_user(user.lower(), guild_id)
     session.add(fitness)
     session.commit()
     return fitness