sudo rm -f /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
sudo rm -f /Library/Preferences/SystemConfiguration/preferences.plist
sudo rm -f /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
sudo ifconfig en0 down
sudo ifconfig en0 up
sudo route flush
sudo ifconfig en0 down
sudo ifconfig en0 up
from aiogram import Dispatcher
def get_handled_updates_list(dp: Dispatcher) -> list:
"""
Here we collect only the needed updates for bot based on already registered handlers types.
This way Telegram doesn't send unwanted updates and bot doesn't have to proceed them.
:param dp: Dispatcher
:return: a list of registered handlers types
"""
available_updates = (
"callback_query_handlers", "channel_post_handlers", "chat_member_handlers",
"chosen_inline_result_handlers", "edited_channel_post_handlers", "edited_message_handlers",
"inline_query_handlers", "message_handlers", "my_chat_member_handlers", "poll_answer_handlers",
"poll_handlers", "pre_checkout_query_handlers", "shipping_query_handlers"
)
return [item.replace("_handlers", "") for item in available_updates
if len(dp.__getattribute__(item).handlers) > 0]
executor.start_polling(dp,allowed_updates=get_handled_updates_list(dp), on_startup=on_startup)
@bot.message_handler(content_types=['text'])
def lmdbot(message):
if message.text == 'Рухати мишкою':
bot.register_next_step_handler(bot.send_message(message.from_user.id, 'Скільки разів?'), mousemove)
else:
markup = telebot.types.ReplyKeyboardMarkup(row_width=2)
markup.add(telebot.types.KeyboardButton("Рухати мишкою"))
bot.send_message(message.from_user.id, "Що робити?", reply_markup=markup)
def mousemove(message):
times = int(message.text)
try:
for a in range(times):
rh=random.randint(0, 1080)
rw=random.randint(0, 1920)
mouse.move(rw, rh, duration=1)
except:
lmdbot(message)
@dp.message_handler(commands=['r'])
async def random(message: types.Message):
await message.reply()
arg_ = message.text.split()
x, y = int(arg_[1]), int(arg_[2]