2 Commitit efbf1299f8 ... 8b91520652

Tekijä SHA1 Viesti Päivämäärä
  Julian Marcos 8b91520652 [Run] For running the bot 3 vuotta sitten
  Julian Marcos 150ca60dcf [Logger] If another IRC server is used also change the LogLevel of that server 3 vuotta sitten
3 muutettua tiedostoa jossa 10 lisäystä ja 3 poistoa
  1. 1 0
      .gitignore
  2. 3 3
      bot.py
  3. 6 0
      run.sh

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
 __pycache__
 .*un~
 *un~
+env

+ 3 - 3
bot.py

@@ -17,12 +17,12 @@ class bot:
                 else:
                     print(msg);
         async def handle(line):
-            if (line[0] == ':team.tilde.chat' and (line[1] == 'NOTICE' or line[1] == '001' or line[1] == '002' or line[1] == '003' or line[1] == '004' or line[1] == '005' or line[1] == '372' or line[1] == '251' or line[1] == '252' or line[1] == '253' or line[1] == '254' or line[1] == '255' or line[1] == '265' or line[1] == '266' or line[1] == '375' or line[1] == '376' or line[1] == '396') ):
+            if (line[0].endswith('.tilde.chat') and (line[1] == 'NOTICE' or line[1] == '001' or line[1] == '002' or line[1] == '003' or line[1] == '004' or line[1] == '005' or line[1] == '372' or line[1] == '251' or line[1] == '252' or line[1] == '253' or line[1] == '254' or line[1] == '255' or line[1] == '265' or line[1] == '266' or line[1] == '375' or line[1] == '376' or line[1] == '396') ):
                 loglevel = 450
-            elif line[0] == ':team.tilde.chat':
+            elif line[0].endswith('.tilde.chat'):
                 loglevel = 441
             elif line[0] == ':NickServ!services@services.tilde.chat':
-                if (line[3] == ':This' or line[3] == ':nick,' or line[3] == ':please' or line[3] == ':If' or line[3] == ':Password'):
+                if (line[3] == ':This' or line[3] == ':nick,' or line[2] == ':please' or line[3] == ':If' or line[3] == ':Password'):
                     loglevel = 450
                 else:
                     loglevel = 441

+ 6 - 0
run.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+cd "$(dirname "$0")"
+setup_bot() { python3 -m venv "$PWD/env" && "$PWD"/env/bin/pip install -r requirements.txt; };
+[ ! -d "$PWD/env" ] && setup_bot
+exec "$PWD"/env/bin/python "$PWD"/bot.py