Compare commits

..

No commits in common. "d83463d27a030607401808d51a810a90cb633889" and "cd181af11d5e59e86c1e8b685407ccddd7f8dcce" have entirely different histories.

2 changed files with 14 additions and 41 deletions

28
bot.py
View file

@ -2,7 +2,7 @@ import simplematrixbotlib as botLibrary
import json
import fetch
version = "0.1.5"
version = "0.1.0"
print("Imag/quotes bot version " + version)
print("Loading config…")
@ -15,11 +15,6 @@ except FileNotFoundError:
except:
print("Something bad and unforseen happened, please report the bug to @n:everypizza.im")
if config['bot']['debugMode'] == True:
debugMode = True
else:
debugMode = False
print("Logging in…")
credentials = botLibrary.Creds(config['matrix']['server'], config['matrix']['userid'], config['matrix']['password'])
bot = botLibrary.Bot(credentials)
@ -32,7 +27,7 @@ async def help_message(room, message):
if not (match.is_not_from_this_bot() and match.prefix()
and match.command("help")):
return
if debugMode == False:
message = (f"""
Help
============================
@ -42,21 +37,6 @@ async def help_message(room, message):
{PREFIX} source - send a link to the source code
{PREFIX} version - show the bot version
""")
else:
message = (f"""
Help
============================
A work-in-progress Python rewrite of the original quotes bot, aiming for a mostly complete remake.
{PREFIX} help - show this message
{PREFIX} get - fetch a image from the defined instance
{PREFIX} source - send a link to the source code
{PREFIX} version - show the bot version
---
NOTE: Debug mode is on. Output will be more verbose.
""")
await bot.api.send_text_message(room.room_id, message)
@ -73,10 +53,6 @@ async def make_choice(room, message):
id = match.args()
id = str(id[1])
quoteImage = fetch.fetchQuote(id)
if debugMode == False:
pass
else:
message = (f"""
Command recived (DEBUG).
(We're supposed to fetch quote number {id} now.)

View file

@ -7,8 +7,5 @@
"imag":{
"_comment": "Don't put a slash at an end of this. That took quite a bit of running around in circles to fix.",
"server": "https://quotes.example.com"
},
"bot": {
"debugMode": true
}
}