def update_all_alliances_info(shortname, new_shortname, fullname, slack_channel, color='#000000'): color = str(color) query = "UPDATE alliances SET color = %s, shortname = %s, fullname = %s, slack_channel = %s WHERE shortname = %s" db.execute(query, (color, new_shortname, fullname, slack_channel, shortname))
def insert_alliance(self, shortname, fullname, color='#000000', slack_channel=None): query = """INSERT INTO alliances(shortname, fullname, color, slack_channel) \ VALUES(%s, %s, %s, %s)""" result = db.execute(query, (shortname, fullname, color, slack_channel))
def update_charter_of_alliance(shortname, charter): query = "UPDATE alliances SET charter=%s WHERE shortname = %s" db.execute(query, (charter, shortname))
def update_logo_of_alliance(shortname, logo): query = "UPDATE alliances SET logo=%s WHERE shortname = %s" db.execute(query, (logo, shortname))
def update_power_by_user_id(id, power): query = "UPDATE users SET power = %s WHERE id=%s" db.execute(query, (power, id))
def update_gcl_by_user_id(id, gcl): query = "UPDATE users SET gcl = %s WHERE id=%s" db.execute(query, (gcl, id))
def update_alliance_by_user_id(id, alliance): query = "UPDATE users SET alliance = %s WHERE id=%s" db.execute(query, (alliance, id))
def update_alliance_by_screeps_id(self, id, alliance): query = "UPDATE users SET alliance = %s WHERE screeps_id=%s" db.execute(query, (alliance, id))
def add_invite(user, alliance, sender): query = 'INSERT INTO alliance_invites(alliance, user_id, sender) VALUES (%s, %s, %s)' db.execute(query, (alliance, user, sender))
def update_leader_of_alliance(shortname, leaders): query = "UPDATE alliances SET leaders=%s WHERE shortname = %s" db.execute(query, (leaders, shortname))