Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
diff --git a/main.py b/main.py
index 0c91b7e..ee07045 100644
--- a/main.py
+++ b/main.py
@@ -1,53 +1,64 @@
import sys
import time
import telepot
import datetime
import commandhandler
import group_utilities
+import random
#Cooldown length in seconds
cooldown_sec = 10
#fetching our BOT_TOKEN
-#BOT_TOKEN = sys.argv[1]
-BOT_TOKEN = "258778063:AAHhupgWlFBhUWR1on4zNq0dqz8GFXtSATk"
+BOT_TOKEN = sys.argv[1]
+
def chat_handler(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
if content_type == 'text':
#If the message contains a bot command, go tell command_handler
try:
if msg['entities'][0]['type'] == 'bot_command':
commandhandler.handler(msg, cooldown_sec, bot)
#If the message contains Hendrik, send a complaint message to sender
except KeyError:
if "hendrik" in (msg['text'].lower()):
- bot.sendMessage(chat_id, 'Who the fuck is Hendrik?', reply_to_message_id=msg['message_id'])
+ bot.sendMessage(chat_id, 'THAT WITCH NAME IS NOT TO BE SPOKEN!', reply_to_message_id=msg['message_id'])
group_utilities.logger('hendrik', msg, False, 0, 0)
- #seth_is_a_faggot(msg)
+ if 'lumber' in (msg['text'].lower()):
+ if random.randint(0,1) == 1:
+ bot.sendMessage(chat_id, "LUMBER IS ETERNAL")
+ else:
+ bot.sendMessage(chat_id, 'THERE ARE NO BRAKES ON THE LUMBER TRAIN')
+
+ if 'apple' in (msg['text'].lower()):
+ bot.sendMessage(chat_id, "FUCK APPLE")
+
+ if 'kak dela' in (msg['text'].lower()):
+ bot.sendMessage(chat_id, "Harsho Spasiba", reply_to_message_id=msg['message_id'])
def edit_handler(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
try:
if msg['entities'][0]['type'] == 'bot_command':
bot.sendMessage(chat_id, "Voetsek, don't edit your commands.", reply_to_message_id=msg['message_id'])
except:
if content_type == 'text':
if "hendrik" in (msg['text'].lower()):
- bot.sendMessage(chat_id, 'Your sneaky edits do not work on me. Who the fuck is Hendrik?', reply_to_message_id=msg['message_id'])
+ bot.sendMessage(chat_id, 'THAT WITCH NAME IS NOT TO BE SPOKEN! DO NOT TRY EDIT YOUR WITCHCRAFT INTO YOUR MESSAGES IN AN ATTEMPT TO EVADE ME!', reply_to_message_id=msg['message_id'])
group_utilities.logger('hendrik', msg, True, 0, 0)
def callback_query_handler(msg):
pass
#make our bot and feed it the tokenhend
bot = telepot.Bot(BOT_TOKEN)
#fetch messages and keep script looped
while 1:
bot.message_loop({'chat' : chat_handler,
'edited_chat' : edit_handler,
'callback_query' : callback_query_handler},
run_forever="Bot Running...")

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jun 16, 1:47 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
71544
Default Alt Text
(2 KB)

Event Timeline