Ejemplo n.º 1
0
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))
Ejemplo n.º 2
0
 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))
Ejemplo n.º 3
0
def update_charter_of_alliance(shortname, charter):
    query = "UPDATE alliances SET charter=%s WHERE shortname = %s"
    db.execute(query, (charter, shortname))
Ejemplo n.º 4
0
def update_logo_of_alliance(shortname, logo):
    query = "UPDATE alliances SET logo=%s WHERE shortname = %s"
    db.execute(query, (logo, shortname))
Ejemplo n.º 5
0
def update_power_by_user_id(id, power):
    query = "UPDATE users SET power = %s WHERE id=%s"
    db.execute(query, (power, id))
Ejemplo n.º 6
0
def update_gcl_by_user_id(id, gcl):
    query = "UPDATE users SET gcl = %s WHERE id=%s"
    db.execute(query, (gcl, id))
Ejemplo n.º 7
0
def update_alliance_by_user_id(id, alliance):
    query = "UPDATE users SET alliance = %s WHERE id=%s"
    db.execute(query, (alliance, id))
Ejemplo n.º 8
0
 def update_alliance_by_screeps_id(self, id, alliance):
     query = "UPDATE users SET alliance = %s WHERE screeps_id=%s"
     db.execute(query, (alliance, id))
Ejemplo n.º 9
0
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))
Ejemplo n.º 10
0
def update_leader_of_alliance(shortname, leaders):
    query = "UPDATE alliances SET leaders=%s WHERE shortname = %s"
    db.execute(query, (leaders, shortname))