Пример #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))
Пример #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))
Пример #3
0
def update_charter_of_alliance(shortname, charter):
    query = "UPDATE alliances SET charter=%s WHERE shortname = %s"
    db.execute(query, (charter, shortname))
Пример #4
0
def update_logo_of_alliance(shortname, logo):
    query = "UPDATE alliances SET logo=%s WHERE shortname = %s"
    db.execute(query, (logo, shortname))
Пример #5
0
def update_power_by_user_id(id, power):
    query = "UPDATE users SET power = %s WHERE id=%s"
    db.execute(query, (power, id))
Пример #6
0
def update_gcl_by_user_id(id, gcl):
    query = "UPDATE users SET gcl = %s WHERE id=%s"
    db.execute(query, (gcl, id))
Пример #7
0
def update_alliance_by_user_id(id, alliance):
    query = "UPDATE users SET alliance = %s WHERE id=%s"
    db.execute(query, (alliance, id))
Пример #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))
Пример #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))
Пример #10
0
def update_leader_of_alliance(shortname, leaders):
    query = "UPDATE alliances SET leaders=%s WHERE shortname = %s"
    db.execute(query, (leaders, shortname))