This commit is contained in:
Remy Moll 2020-08-15 15:46:35 +02:00
parent b2bb728c09
commit 1d958a5b09
4 changed files with 8 additions and 3 deletions

View File

@ -10,7 +10,7 @@ def query(params):
try:
res = googlesearch.search(param_string.replace("+"," ") ,num=5,start=0,stop=5)
send_string = "Google search for <b>" + param_string.replace("+"," ") + "</b>:\n"
send_string = "Results for <b>" + param_string.replace("+"," ") + "</b>:\n\n"
for url in res:
send_string += url + "\n\n"
send_string += "Search url:\n" + search_url

View File

@ -136,6 +136,7 @@ class TelegramIO():
self.persistence.increment("messages_sent")
def send_photo(self, url, caption):
print("SENDING PHOTO: " + url)
data = {

View File

@ -126,7 +126,10 @@ class ChatBot():
def bot_print_status(self, params):
"""Prints the bots current status and relevant information"""
delta = str(datetime.datetime.now() - self.start_time)
try:
ip = requests.get('https://api.ipify.org').text
except:
ip = "not fetchable"
message = "<pre>Status: Running :green_circle:\n"
message += "Uptime: " + delta[:delta.rfind(".")] + "\n"
message += "Reboots: " + str(self.persistence.read("reboots")) + "\n"
@ -311,4 +314,5 @@ class ChatBot():
self.telegram.send_message("Meme won't yeet")
#######################################################################
bot = ChatBot("ChatterBot", version="1.03")

View File

@ -1 +1 @@
{"messages_read": 56, "messages_sent": 34, "commands_executed": 21, "photos_sent": 4, "log": [], "chat_members": {"364520272": "Remy Moll"}, "reboots": 49}
{"messages_read": 66, "messages_sent": 41, "commands_executed": 31, "photos_sent": 6, "log": [], "chat_members": {"364520272": "Remy Moll"}, "reboots": 57}