Commit ce1cb4f5 authored by JackV's avatar JackV

Use environment variables, cleanup

parent 4b53ce63
import websockets
import asyncio
from telegram import Bot
import json
import os
import websockets
from telegram import Bot
WS_URL = "wss://bits.poul.org/ws"
CHAT_ID = 123 #CHANGE ME
MESSAGE_ID = 123 #CHANGE ME
TOKEN = "KEK"
WS_URL = os.environ.get('WS_URL', "wss://bits.poul.org/ws")
CHAT_ID = int(os.environ.get('CHAT_ID'))
MESSAGE_ID = int(os.environ.get('MESSAGE_ID'))
TOKEN = os.environ.get('TOKEN')
bot = Bot(TOKEN)
def bits_handler(text):
meme = json.loads(text)
bot.edit_message_text("POuL HQ is now {}".format(meme["status"]["value"]), CHAT_ID, MESSAGE_ID)
msg = json.loads(text)
bot.edit_message_text("POuL HQ is now {}".format(msg["status"]["value"]), CHAT_ID, MESSAGE_ID)
return
class WebSocketClient:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment