diff --git a/.gitignore b/.gitignore index 2fa7ce7..948a4f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ config.ini +__pycache__ diff --git a/chatbot b/chatbot index 6021d93..4bccffb 100755 --- a/chatbot +++ b/chatbot @@ -3,17 +3,12 @@ import argparse import slixmpp import configparser +from functions import * CONFIG_PATH = "./config.ini" VERSION='0.1.0' -def processmsg(msg, rcpt): - if msg.startswith("!"): - return "" - elif "youtube.com/watch" in msg: - return msg.replace("youtube.com", "iv.datura.network") - def show_version(): print("chatbot " + VERSION) print("License AGPLv3+: GNU AGPL version 3 or later ") diff --git a/config.ini b/config.ini index e4315bd..5cd15b7 100644 --- a/config.ini +++ b/config.ini @@ -1,5 +1,5 @@ [credentials] JID = botusername@example.org PASSWORD = bot_password -NICK = mirrorbot +NICK = chatbot ROOM = room_jid@example.org diff --git a/functions.py b/functions.py new file mode 100644 index 0000000..1631ce8 --- /dev/null +++ b/functions.py @@ -0,0 +1,5 @@ +def processmsg(msg, rcpt): + if msg.startswith("!"): + return "" + elif "youtube.com/watch" in msg: + return msg.replace("youtube.com", "iv.datura.network")