move functions to seperate file

This commit is contained in:
fram3d 2024-02-06 00:40:23 +01:00
parent 8fd5a05eda
commit dc1e0d42af
Signed by: fram3d
GPG Key ID: 938920E709EEA32A
4 changed files with 8 additions and 7 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
config.ini
__pycache__

View File

@ -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 <https://gnu.org/licenses/gpl.html>")

View File

@ -1,5 +1,5 @@
[credentials]
JID = botusername@example.org
PASSWORD = bot_password
NICK = mirrorbot
NICK = chatbot
ROOM = room_jid@example.org

5
functions.py Normal file
View File

@ -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")