formatted with black
authorGeorgios Atheridis <georgios@atheridis.org>
Tue, 17 Jan 2023 09:26:26 +0000 (09:26 +0000)
committerGeorgios Atheridis <georgios@atheridis.org>
Tue, 17 Jan 2023 09:26:26 +0000 (09:26 +0000)
31 files changed:
.flake8 [new file with mode: 0644]
ihaspeks/auto_messages/.jokes.py
ihaspeks/auto_messages/give_permission.py
ihaspeks/auto_messages/update_queue.py
ihaspeks/commands/.info.py
ihaspeks/commands/9ball.py
ihaspeks/commands/Q.py
ihaspeks/commands/accept_share.py
ihaspeks/commands/cannon.py
ihaspeks/commands/cleanqueue.py
ihaspeks/commands/deadge.py
ihaspeks/commands/forcehere.py
ihaspeks/commands/forcejoin.py
ihaspeks/commands/forceleave.py
ihaspeks/commands/forcenothere.py
ihaspeks/commands/here.py
ihaspeks/commands/join.py
ihaspeks/commands/leave.py
ihaspeks/commands/movedown.py
ihaspeks/commands/moveup.py
ihaspeks/commands/newteams.py
ihaspeks/commands/nothere.py
ihaspeks/commands/opgg.py
ihaspeks/commands/penta.py
ihaspeks/commands/quadra.py
ihaspeks/commands/teams.py
ihaspeks/commands/teamsize.py
ihaspeks/database_manager.py
ihaspeks/scripts/chat.py
ihaspeks/scripts/clip_server.py
ihaspeks/scripts/crylaugh.py

diff --git a/.flake8 b/.flake8
new file mode 100644 (file)
index 0000000..541e00a
--- /dev/null
+++ b/.flake8
@@ -0,0 +1,3 @@
+[flake8]
+ignore = E203, W503
+max-line-length = 88
index a972958e3d2c03ff121f6101a84fd28b84fd54c8..0646ab0bc0b6024660cad2acdb13959e11022202 100644 (file)
@@ -21,6 +21,4 @@ def main(bot: Bot, message: Message):
 
     data = json.loads(r.data.decode("utf-8"))
     joke = data["joke"].replace("\r\n", " ")
-    tools.smart_privmsg.send(
-        bot, message, f"{joke} ||| Get more jokes by typing ?joke"
-    )
+    tools.smart_privmsg.send(bot, message, f"{joke} ||| Get more jokes by typing ?joke")
index 23478764666b6c36461f85ed0fa9159a20e9af89..ed37c80a0c9664df7bc0d74c8e4f7824ddf1838c 100644 (file)
@@ -5,7 +5,9 @@ END_TIME = 0
 
 
 def main(bot: Bot, message: Message):
-    msg = "I collect data and occasionally post interesting statistics on peks' discord. "
+    msg = (
+        "I collect data and occasionally post interesting statistics on peks' discord. "
+    )
     msg += "The type of data you should expect to see is 'Chat frequency', 'Most used emotes', "
     msg += "'Most active time and day', 'Reply graphs', etc. "
     bot.send_privmsg(message.channel, msg)
index e7da3f9e15ef6ad6cee09ecdde82e3ac78e87669..59525c5646723d12c357fedc1977e806f3b92b17 100644 (file)
@@ -34,7 +34,10 @@ def main(bot: Bot, message: Message):
         )
         c.execute(f"DELETE FROM {table} WHERE time_remaining < 0;")
         if c.rowcount:
-            bot.send_privmsg(message.channel, f"/announce {c.rowcount} user{'s were' if c.rowcount > 1 else ' was'} just removed from {table if table != 'lol_queue' else 'lol'} queue.")
+            bot.send_privmsg(
+                message.channel,
+                f"/announce {c.rowcount} user{'s were' if c.rowcount > 1 else ' was'} just removed from {table if table != 'lol_queue' else 'lol'} queue.",
+            )
 
     conn.commit()
 
index 516d02df65598dfd1a4eca17dd5121644adae44f..20c6f48e1e1a32999ca9fdc1fca409341d31d751 100644 (file)
@@ -15,4 +15,3 @@ def main(bot: Bot, message: Message):
     else:
         msg = r"Peks is live so he can awnser that KEKW but here is the link just in case BASED https://strms.net/warships_ihaspeks"
     tools.smart_privmsg.send_safe(bot, message.channel, msg)
-
index cc8d056784953cc94351acf2689f7698771962ba..3e8132484a3c77acab3c4ca496c107b28b57f9af 100644 (file)
@@ -12,6 +12,7 @@ GLOBAL_COOLDOWN = 20
 
 openai.api_key = os.getenv("OPENAI_API")
 
+
 def main(bot: Bot, message: Message):
     replied_message = message.tags.get("reply-parent-msg-body", None)
     if replied_message:
@@ -19,8 +20,7 @@ def main(bot: Bot, message: Message):
         replied_msg_id = message.tags["reply-parent-msg-id"]
     else:
         msg = " ".join(message.value.split(" ")[1:])
-        replied_msg_id = message.tags['id']
-
+        replied_msg_id = message.tags["id"]
 
     try:
         response = openai.Completion.create(
@@ -35,7 +35,12 @@ def main(bot: Bot, message: Message):
             stop=[" END"],
         )
     except RateLimitError:
-        tools.smart_privmsg.send_safe(bot, message.channel, "UwU Sowwy. The sevwews awe ovewloaded :( Twy again in a few minutes OwO", reply=replied_msg_id)
+        tools.smart_privmsg.send_safe(
+            bot,
+            message.channel,
+            "UwU Sowwy. The sevwews awe ovewloaded :( Twy again in a few minutes OwO",
+            reply=replied_msg_id,
+        )
 
     print(response)
     if response:
index 897c07e8e045cbd613b7f1b19872ddb1a666c22b..52bc20df34c0996bfd56e97ef93aa555db71e835 100644 (file)
@@ -18,6 +18,7 @@ GLOBAL_COOLDOWN = 15
 PATH = os.path.dirname(os.path.realpath(__file__))
 PATH = os.path.join(PATH, "..")
 
+
 def check_queue(bot: Bot, message: Message, table: str):
     if random.random() < 0.02:
         q = [
@@ -149,14 +150,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index 80a7f6ee14cb9339391f4306c8b279d18b894645..526c130edea70e45676908d4da33f1f73ac0c55a 100644 (file)
@@ -25,4 +25,3 @@ def main(bot: Bot, message: Message):
     with open(accepted_path, "a") as f:
         f.write(f"{message.tags['user-id']}\n")
     tools.smart_privmsg.send(bot, message, "Thank you for giving permission")
-
index da342b6eab0a0efb4088219ccc16086fa433e49d..b1e01e854d6a9d0cb69ce3577a66c5d5789388c6 100644 (file)
@@ -18,6 +18,7 @@ GLOBAL_COOLDOWN = 5
 PATH = os.path.dirname(os.path.realpath(__file__))
 PATH = os.path.join(PATH, "..")
 
+
 def check_queue(bot: Bot, message: Message, table: str):
     conn = sqlite3.connect(os.path.join(PATH, "database.db"))
     c = conn.cursor()
@@ -47,7 +48,7 @@ def check_queue(bot: Bot, message: Message, table: str):
             f"""
             UPDATE varvalues SET val = ? WHERE id = 'cannon';
             """,
-            (val,)
+            (val,),
         )
 
         msg = f"Peks is at cannon {val % 1000} of prestige {val // 1000}"
@@ -67,7 +68,7 @@ def check_queue(bot: Bot, message: Message, table: str):
             f"""
             UPDATE varvalues SET val = ? WHERE id = 'cannon';
             """,
-            (val,)
+            (val,),
         )
 
         msg = f"Peks is at cannon {val % 1000} of prestige {val // 1000}"
@@ -96,14 +97,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index ed3d4478e803df52b05e762a0646cf928bae6c77..9ab1910b18aa39ce8194dc8102832dc57abb1842 100644 (file)
@@ -75,14 +75,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index 3c165385b0a48f84d8f46ce00a8aa675c3ee1056..035021cd199b650327e8be0bd327529a89e0d4b5 100644 (file)
@@ -18,6 +18,7 @@ GLOBAL_COOLDOWN = 5
 PATH = os.path.dirname(os.path.realpath(__file__))
 PATH = os.path.join(PATH, "..")
 
+
 def check_queue(bot: Bot, message: Message, table: str):
     conn = sqlite3.connect(os.path.join(PATH, "database.db"))
     c = conn.cursor()
@@ -47,7 +48,7 @@ def check_queue(bot: Bot, message: Message, table: str):
             f"""
             UPDATE varvalues SET val = ? WHERE id = 'deadge_sekiro';
             """,
-            (val,)
+            (val,),
         )
 
         msg = f"Peks has currently died {val} times"
@@ -67,7 +68,7 @@ def check_queue(bot: Bot, message: Message, table: str):
             f"""
             UPDATE varvalues SET val = ? WHERE id = 'deadge_sekiro';
             """,
-            (val,)
+            (val,),
         )
 
         msg = f"Peks has currently died {val} times"
@@ -96,14 +97,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index 0c27769022b7ca8a71932ab50d50fd0810ff09be..fff23526cc736906d255341ef43c2ca256efa809 100644 (file)
@@ -266,14 +266,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index df60a98ff728521c7b65575577a943c223daeb5e..1647dc84d98e35962535bbfaf40e6b41a942bbce 100644 (file)
@@ -93,14 +93,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index 62cce6523f31b9e39692ff00ee284952f2ad3b7e..2e9b7883217a991ad084244253679da0fd9009c9 100644 (file)
@@ -67,14 +67,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index 4944b664141e499fd6abcee63856502d2106b258..558e4ef07f0ab4082fce128391a9ed3f49b5027f 100644 (file)
@@ -71,14 +71,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index 2002cb559b47d7aefb6d0395e98358fd7d37c718..b11073b4df100270ef8a2bebc282714ca217eda8 100644 (file)
@@ -263,14 +263,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index 8484186ba4dc51932cddc2b3bffea6e51dde2c9c..62e5876320e3ad55828121820ee61a064cb1aff6 100644 (file)
@@ -90,14 +90,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index ac7fefece12efed4de1e50995b7b9232e1c1672b..3f94afbce1753eb5f12dc077dd82990dc7a8d34b 100644 (file)
@@ -66,14 +66,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index e64d3ed6774867e50ab372849d3f50406ce7caef..baa12fad1cc718f29a52a00e8173627a73a8be98 100644 (file)
@@ -115,14 +115,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index 42b7f12252fd98a1eae532d6795092d2e3818fd8..9ce90c908f17fa986fdb88120a6a2a2dcb918ff3 100644 (file)
@@ -115,14 +115,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index a7a3c64d6a6af46f335e150eba22a06540b2f6e0..934545479f853e65fa357053bfe26e9c19ddc1d2 100644 (file)
@@ -108,14 +108,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index f82bb6890745dd2fd213e78a1cfdd96624abacab..26d26dffefa054cdcb1e8f0dfb133d8af1a89303 100644 (file)
@@ -68,14 +68,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index aabf5c2949df6024a950235ef545e7945b6b0578..c6fd15ec5c0318c2f467cec5c74e38c31863848e 100644 (file)
@@ -21,6 +21,7 @@ GLOBAL_COOLDOWN = 15
 PATH = os.path.dirname(os.path.realpath(__file__))
 PATH = os.path.join(PATH, "..")
 
+
 def find_champion(champ_id: int) -> str:
     with open(os.path.join(PATH, "data/champion.json"), "r") as f:
         champion_data = json.load(f)
@@ -31,6 +32,7 @@ def find_champion(champ_id: int) -> str:
             return champion_data[champion]["name"]
     return "404"
 
+
 def main(bot: Bot, message: Message):
     index_skip = 0
     if message.tags.get("reply-parent-user-id", None):
@@ -40,19 +42,19 @@ def main(bot: Bot, message: Message):
     except IndexError:
         twitch_user = message.tags.get("reply-parent-display-name", message.channel)
         twitch_id = message.tags.get(
-                "reply-parent-user-id",
-                ttv_api.users.get_users(user_logins=[message.channel]),
-                )
+            "reply-parent-user-id",
+            ttv_api.users.get_users(user_logins=[message.channel]),
+        )
     else:
         twitch_id = ttv_api.users.get_users(user_logins=[twitch_user])
 
     if not twitch_id:
         logger.warning(
-                f"There was an issue getting twitch data for user {twitch_id}; message id was: {message.tags['id']}"
-                )
+            f"There was an issue getting twitch data for user {twitch_id}; message id was: {message.tags['id']}"
+        )
         smart_privmsg.send(
-                bot, message, "Couldn't retrieve data", reply=message.tags["id"]
-                )
+            bot, message, "Couldn't retrieve data", reply=message.tags["id"]
+        )
         return
 
     if not isinstance(twitch_id, str):
@@ -64,26 +66,26 @@ def main(bot: Bot, message: Message):
     c = conn.cursor()
 
     c.execute(
-            """
+        """
         SELECT summoner_id, puuid FROM accounts WHERE twitch_id = ?;
         """,
         (twitch_id,),
-        )
+    )
     fetched = c.fetchall()
     c.execute(
-            """
+        """
         SELECT twitch_id, summoner_id FROM accounts;
         """,
-        )
+    )
     fetched_all = c.fetchall()
 
     if not fetched:
         smart_privmsg.send(
-                bot,
-                message,
-                f"No summoners added for {twitch_user}",
-                reply=message.tags["id"],
-                )
+            bot,
+            message,
+            f"No summoners added for {twitch_user}",
+            reply=message.tags["id"],
+        )
         conn.close()
         return
 
@@ -97,11 +99,11 @@ def main(bot: Bot, message: Message):
             break
     else:
         smart_privmsg.send(
-                bot,
-                message,
-                f"{twitch_user} is currently not in game. These are all of their summoners: {summoner_names}",
-                reply=message.tags["id"],
-                )
+            bot,
+            message,
+            f"{twitch_user} is currently not in game. These are all of their summoners: {summoner_names}",
+            reply=message.tags["id"],
+        )
         conn.close()
         return
 
@@ -111,7 +113,9 @@ def main(bot: Bot, message: Message):
             if summoner.summoner_id == f[1] and summoner.summoner_id != fetched[0][0]:
                 play_with.append(
                     {
-                        "name": ttv_api.users.get_users(user_ids=[f[0]])[0].display_name,
+                        "name": ttv_api.users.get_users(user_ids=[f[0]])[
+                            0
+                        ].display_name,
                         "champion": find_champion(summoner.champion_id),
                     },
                 )
@@ -122,11 +126,11 @@ def main(bot: Bot, message: Message):
         for player in play_with:
             msg += f" {player['name']} on {player['champion']} |"
         msg = msg[:-1] + "."
-        
+
     smart_privmsg.send(
-            bot,
-            message,
-            msg,
-            reply=message.tags["id"],
-            )
+        bot,
+        message,
+        msg,
+        reply=message.tags["id"],
+    )
     conn.close()
index 01f421906eeeb2fab991cbacab376328f8f12acb..13be4e98398e4f960d169c1e60a59f2edc9f3235 100644 (file)
@@ -18,6 +18,7 @@ GLOBAL_COOLDOWN = 5
 PATH = os.path.dirname(os.path.realpath(__file__))
 PATH = os.path.join(PATH, "..")
 
+
 def check_queue(bot: Bot, message: Message, table: str):
     conn = sqlite3.connect(os.path.join(PATH, "database.db"))
     c = conn.cursor()
@@ -47,7 +48,7 @@ def check_queue(bot: Bot, message: Message, table: str):
             f"""
             UPDATE varvalues SET val = ? WHERE id = 'cannon';
             """,
-            (val,)
+            (val,),
         )
 
         msg = f"Peks has gotten {val} pentas!"
@@ -67,7 +68,7 @@ def check_queue(bot: Bot, message: Message, table: str):
             f"""
             UPDATE varvalues SET val = ? WHERE id = 'cannon';
             """,
-            (val,)
+            (val,),
         )
 
         msg = f"Peks has gotten {val} pentas!"
@@ -96,14 +97,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index ede98b1069249ecb2c95e0e833bfa7800c793b37..4f473c9c97bcc58cf310a44f7580e099da49978c 100644 (file)
@@ -18,6 +18,7 @@ GLOBAL_COOLDOWN = 5
 PATH = os.path.dirname(os.path.realpath(__file__))
 PATH = os.path.join(PATH, "..")
 
+
 def check_queue(bot: Bot, message: Message, table: str):
     conn = sqlite3.connect(os.path.join(PATH, "database.db"))
     c = conn.cursor()
@@ -47,7 +48,7 @@ def check_queue(bot: Bot, message: Message, table: str):
             f"""
             UPDATE varvalues SET val = ? WHERE id = 'cannon';
             """,
-            (val,)
+            (val,),
         )
 
         msg = f"Peks has missed out on {val} pentas!"
@@ -67,7 +68,7 @@ def check_queue(bot: Bot, message: Message, table: str):
             f"""
             UPDATE varvalues SET val = ? WHERE id = 'cannon';
             """,
-            (val,)
+            (val,),
         )
 
         msg = f"Peks has missed out on {val} pentas!"
@@ -96,14 +97,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index c35e65b0cc044dc6b0233484b8d8f41c3d487650..9b88e160343e36e09da1b0cd9afdbf6f33485bb2 100644 (file)
@@ -95,14 +95,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index ce910c5730d7a25c78f3062821cd7873e1d47d8d..6839c86be19eca865ec4736d617ca7357f50c93d 100644 (file)
@@ -63,14 +63,14 @@ def parse(query):
     d = dict()
     for i in shlex.split(query):
         try:
-            d[i.split('=')[0]] = i.split('=')[1]
+            d[i.split("=")[0]] = i.split("=")[1]
         except:
             pass
     return d
 
 
 def scrub(table_name):
-    return ''.join(chr for chr in table_name if chr.isalnum() or chr == '_')
+    return "".join(chr for chr in table_name if chr.isalnum() or chr == "_")
 
 
 def main(bot: Bot, message: Message):
index ee653c3482ee468d5a99672f29cc7dc3d090cac8..ebc7bbf513bc6d26b93bf2c594ed811d3035b836 100644 (file)
@@ -173,7 +173,6 @@ def create_database():
     )
     logger.info(f"created table varvalues")
 
-
     c.execute(
         """
         CREATE TABLE IF NOT EXISTS clips (
index 26dbd193449218ad2fb3e7d67cb2901006317c9c..f01edee219a8a19ccf29c2a941213d6e98d942ed 100644 (file)
@@ -5,8 +5,9 @@ import os
 
 openai.api_key = os.getenv("OPENAI_API")
 
+
 def chat(bot: Bot, message: Message):
-    if not message.nick in {'skgyorugo', 'ihaspeks'}:
+    if not message.nick in {"skgyorugo", "ihaspeks"}:
         return
     if not message.value.startswith("# "):
         return
@@ -17,7 +18,7 @@ def chat(bot: Bot, message: Message):
         replied_msg_id = message.tags["reply-parent-msg-id"]
     else:
         msg = " ".join(message.value.split(" ")[1:])
-        replied_msg_id = message.tags['id']
+        replied_msg_id = message.tags["id"]
 
     response = openai.Completion.create(
         model="text-davinci-003",
index 57d521b38c4387990b6d262417f4399b4a2ee48a..fb51cd32fd1b52742fc8ed4474004f95d7ccce10 100644 (file)
@@ -17,6 +17,7 @@ app.add_middleware(
     allow_headers=["*"],
 )
 
+
 @app.get("/clip")
 async def root():
     clips = [
@@ -25,6 +26,7 @@ async def root():
     ]
     return random.choice(clips)
 
+
 # logger = logging.getLogger(__name__)
 
 # PATH = os.path.dirname(os.path.realpath(__file__))
index a6e265877fde76b035f1d7946f23cf1175adb767..343ca7a8ef9587ccf7dabdfca12f11a76ee78ebf 100644 (file)
@@ -12,5 +12,7 @@ def crylaugh(bot: Bot, message: Message):
         replied_msg_id = message.tags["id"]
     except KeyError:
         replied_msg_id = None
-    msg = "Oh ðŸ˜‚ look ðŸ˜‚ at ðŸ˜‚ me ðŸ˜‚ I ðŸ˜‚ use ðŸ˜‚ this ðŸ˜‚ funny ðŸ˜‚ emoji ðŸ˜‚ hahahaha ðŸ˜‚😂😂😂😂 lit ðŸ’¯ ðŸ‘Œ"
+    msg = (
+        "Oh ðŸ˜‚ look ðŸ˜‚ at ðŸ˜‚ me ðŸ˜‚ I ðŸ˜‚ use ðŸ˜‚ this ðŸ˜‚ funny ðŸ˜‚ emoji ðŸ˜‚ hahahaha ðŸ˜‚😂😂😂😂 lit ðŸ’¯ ðŸ‘Œ"
+    )
     tools.smart_privmsg.send(bot, message, msg, reply=replied_msg_id)