@bot.message_handler(commands=['start'])
def start(message):
tasklist = os.popen('tasklist').read()
qs0 = tasklist.replace('', '')
qs1 = qs0.replace('Console', '')
qs2 = qs1.replace('Ќ/„', '')
q1 = qs2.replace('‘«г¦Ўл:', '')
q2 = q1.replace('PID:', '')
q3 = q2.replace('€¬п ®Ўа § :', '')
q4 = q3.replace('‘«г¦Ўл: Ќ/„', '')
q5 = q4.replace('1', '')
q6 = q5.replace('2', '')
q7 = q6.replace('3', '')
q8 = q7.replace('4', '')
q9 = q8.replace('5', '')
q01 = q9.replace('6', '')
q02 = q01.replace('7', '')
q03 = q02.replace('8', '')
q04 = q03.replace('9', '')
q05 = q04.replace('0', '')
q06 = q05.replace(' ', '')
q07 = q06.replace('\n', '')
qs00 = q07.replace('яЉЃ', '')
logs = qs00.replace('.exe', '.exe\n\n')
bot.send_message(message.chat.id, log)
import os
import telebot
from telebot import types
bot = telebot.TeleBot('1305386246:AAFexp1CBt8VcgfEUX9La9riP1g2DAjarv0')
@bot.message_handler(commands=['start'])
def opens_files(message):
with open("tasklim", "r") as file:
for line in file:
qs = line.replace('Ќ/„', '')
q1 = qs.replace('‘«г¦Ўл:', '')
q2 = q1.replace('PID:', '')
q3 = q2.replace('€¬п ®Ўа § :', '')
q4 = q3.replace('‘«г¦Ўл: Ќ/„', '')
q5 = q4.replace('1', '')
q6 = q5.replace('2', '')
q7 = q6.replace('3', '')
q8 = q7.replace('4', '')
q9 = q8.replace('5', '')
q01 = q9.replace('6', '')
q02 = q01.replace('7', '')
q03 = q02.replace('8', '')
q04 = q03.replace('9', '')
q05 = q04.replace('0', '')
q06 = q05.replace(' ', '')
q07 = q06.replace('\n', '')
logs = q07.replace('.exe', '.exe\n\n')
print(logs)
bot.send_message(chat_id='1234567890', text=logs)
if __name__ == '__main__':
bot.polling(none_stop=True)
TypeError: opens_files() takes 0 positional arguments but 1 was given
bot.send_message(message.chat.id, text=logs)
def opens_files(message):
with open("tasklim", "r") as file:
for line in file:
qs = line.replace('Ќ/„', '')
q1 = qs.replace('‘«г¦Ўл:', '')
q2 = q1.replace('PID:', '')
q3 = q2.replace('€¬п ®Ўа § :', '')
q4 = q3.replace('‘«г¦Ўл: Ќ/„', '')
q5 = q4.replace('1', '')
q6 = q5.replace('2', '')
q7 = q6.replace('3', '')
q8 = q7.replace('4', '')
q9 = q8.replace('5', '')
q01 = q9.replace('6', '')
q02 = q01.replace('7', '')
q03 = q02.replace('8', '')
q04 = q03.replace('9', '')
q05 = q04.replace('0', '')
q06 = q05.replace(' ', '')
q07 = q06.replace('\n', '')
logs = q07.replace('.exe', '.exe\n\n')
#clop = logs, end=""
bot.send_message(message.chat.id, text=logs)
C:\Users\User\Desktop>blocked.py
2020-08-24 16:41:19,062 (util.py:68 WorkerThread1) ERROR - TeleBot: "ApiException occurred, args=('A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body:\n[b\'{"ok":false,"error_code":400,"description":"Bad Request: message text is empty"}\']',)
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\telebot\util.py", line 62, in run
task(*args, **kwargs)
File "C:\Users\User\Desktop\blocked.py", line 33, in opens_files
bot.send_message(message.chat.id, text=logs)
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\telebot\__init__.py", line 641, in send_message
reply_markup, parse_mode, disable_notification, timeout))
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\telebot\apihelper.py", line 166, in send_message
return _make_request(token, method_url, params=payload, method='post')
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\telebot\apihelper.py", line 69, in _make_request
return _check_result(method_name, result)['result']
File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\telebot\apihelper.py", line 88, in _check_result
raise ApiException(msg, method_name, result)
telebot.apihelper.ApiException: A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body:
[b'{"ok":false,"error_code":400,"description":"Bad Request: message text is empty"}']
"
2020-08-24 16:41:19,064 (__init__.py:455 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body:
[b'{"ok":false,"error_code":400,"description":"Bad Request: message text is empty"}']"