move functions to seperate file
This commit is contained in:
parent
8fd5a05eda
commit
dc1e0d42af
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
config.ini
|
config.ini
|
||||||
|
__pycache__
|
||||||
|
7
chatbot
7
chatbot
@ -3,17 +3,12 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import slixmpp
|
import slixmpp
|
||||||
import configparser
|
import configparser
|
||||||
|
from functions import *
|
||||||
|
|
||||||
CONFIG_PATH = "./config.ini"
|
CONFIG_PATH = "./config.ini"
|
||||||
|
|
||||||
VERSION='0.1.0'
|
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():
|
def show_version():
|
||||||
print("chatbot " + VERSION)
|
print("chatbot " + VERSION)
|
||||||
print("License AGPLv3+: GNU AGPL version 3 or later <https://gnu.org/licenses/gpl.html>")
|
print("License AGPLv3+: GNU AGPL version 3 or later <https://gnu.org/licenses/gpl.html>")
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[credentials]
|
[credentials]
|
||||||
JID = botusername@example.org
|
JID = botusername@example.org
|
||||||
PASSWORD = bot_password
|
PASSWORD = bot_password
|
||||||
NICK = mirrorbot
|
NICK = chatbot
|
||||||
ROOM = room_jid@example.org
|
ROOM = room_jid@example.org
|
||||||
|
5
functions.py
Normal file
5
functions.py
Normal 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")
|
Loading…
Reference in New Issue
Block a user