1
Fork 0
mirror of https://github.com/RYGhub/royal-mifia.git synced 2024-11-21 13:34:17 +00:00

Aggiunta inizializzazione bot

This commit is contained in:
Steffo 2016-04-21 18:27:53 +02:00
parent 2d728acefa
commit ffd2d5c365
3 changed files with 27 additions and 0 deletions

1
.gitignore vendored
View file

@ -85,6 +85,7 @@ target/
Network Trash Folder
Temporary Items
.apdisk
/telegramapi.txt
# Windows
# =========================

21
filemanager.py Normal file
View file

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
def readfile(name):
"""Leggi i contenuti di un file.
:param name: Nome del file
"""
file = open(name, 'r')
content = file.read()
file.close()
return content
def writefile(name, content):
"""Scrivi qualcosa su un file, sovrascrivendo qualsiasi cosa ci sia al suo interno.
:param name: Nome del file
:param content: Contenuto del file
"""
file = open(name, 'w')
file.write(content)
file.close()

5
mifia.py Normal file
View file

@ -0,0 +1,5 @@
import telegram
import filemanager
token = filemanager.readfile('telegramapi.txt')
bot = telegram.Bot(token)