Skip to content
Snippets Groups Projects
Commit ca1d2adc authored by Janssen, D.D. (Dylan, Student M-CS)'s avatar Janssen, D.D. (Dylan, Student M-CS)
Browse files

INITIAL COMMIT

parent 74b9b951
No related branches found
No related tags found
No related merge requests found
Pipeline #30567 failed
TOKEN=
RIOT_TOKEN=
\ No newline at end of file
.env
FROM python:3.10.0
WORKDIR /usr/src/app
COPY requirements.txt .
RUN apt-get -y update
RUN pip3 install -r requirements.txt
RUN apt-get autoremove -y && apt-get -y clean
COPY . .
CMD ["python3", "-u", "main.py"]
\ No newline at end of file
from telegram import Update
from telegram.ext import CallbackContext
def start(update: Update, context: CallbackContext):
context.bot.send_message(chat_id=update.effective_chat.id, text="I'm a bot, please talk to me!")
version: '2'
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: bitcoin-telegram-bot
volumes:
- ./:/usr/util/app
env_file: .env
links:
- mysql
mysql:
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: test
MYSQL_DATABASE: app
ports:
- 3307:3306
volumes:
- db-data:/var/lib/postgresql/data
volumes:
db-data:
\ No newline at end of file
main.py 0 → 100644
import os
from dotenv import load_dotenv
from telegram.ext import Updater, CommandHandler
from bitcoinlib.wallets import Wallet
import commands
load_dotenv()
class TelegramWrapper:
def __init__(self, token):
self._token = token
self._updater = Updater(token=token)
self._dispatcher = self._updater.dispatcher
self.registerCommands()
def registerCommands(self):
self._dispatcher.add_handler(CommandHandler('start', commands.start))
def start_polling(self):
self._updater.start_polling()
if __name__ == "__main__":
telegramWrapper = TelegramWrapper(os.getenv("TOKEN"))
telegramWrapper.start_polling()
python-dotenv~=0.19.2
telegram~=0.0.1
bitcoinlib~=0.6.4
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment