Telegram Desktop was updated to version 1.1.23 — Bug fixes and other minor improvements Full version history is available here: https://desktop.telegram.org/changelog
import random, os
class PyEasy:
def randomNum():
return(random.randint(1,32768))
def clear():
if os.name == 'nt': os.system('cls')
else: os.system('clear')
class Bat2Py:
def copy(old, new):
if os.name == 'nt':
os.system('xcopy ' + old + ' ' + new)
else: return('Your system cant support Bat2Py Module')
def delete(filename):
if os.name == 'nt':
os.system('del /f /q ' + filename)
else: return('Your system cant support Bat2Py Module')
PyEasy.Bat2Py.copy('hello_world.pgb', 'hello_world.pgb2')
PyEasy.Bat2Py.delete('hello_world.pgb')复制文件:
shutil.copyfile("oldfile","newfile") oldfile和newfile都只能是文件
shutil.copy("oldfile","newfile") oldfile只能是文件夹,newfile可以是文件,也可以是目标目录from telegram.ext import Updater
updater = Updater(token='281982543:AAEKqlx9YCaxh0xJvKTwE5UCCP7m8ExY910')
def start(bot, update):
bot.send_message(chat_id=update.message.chat_id, text="welcome:)")
def ping(bot, update):
bot.send_message(chat_id=update.message.chat_id, text="PONG")
def author(bot, update):
bot.send_message(chat_id=update.message.chat_id, text="author: BYSTARTW")
from telegram.ext import CommandHandler
dispatcher = updater.dispatcher
start_handler = CommandHandler('start', start)
dispatcher.add_handler(start_handler)
ping_handler = CommandHandler('ping', ping)
dispatcher.add_handler(start_handler)
dispatcher.add_handler(CommandHandler('author', author))
updater.start_polling()from telegram.ext import Updater updater = Updater(token='MyToken') dispatcher = updater.dispatcher
def say(bot, update):
msg = str(update[4:])
bot.send_message(chat_id=update.message.chat_id, text=msg)
from telegram.ext import CommandHandler
dispatcher = updater.dispatcher
dispatcher.add_handler(CommandHandler('say', say))