Answer the question
In order to leave comments, you need to log in
How to do antimate on command?
Code example:
@bot.message_handler(commands=['antimat'], content_types=["text"])
def any_msg(message):
keyboard1 = types.InlineKeyboardMarkup()
callback_button = types.InlineKeyboardButton(text="Disable?", callback_data="OFF")
keyboard1.add(callback_button)
keyboard2 = types.InlineKeyboardMarkup()
callback_button = types.InlineKeyboardButton(text="Enable?", callback_data="ON")
keyboard2.add(callback_button)
bot.send_message(message. chat.id, "Antimate", reply_markup=keyboard2)
bot.send_message(message.chat.id, "Antimate", reply_markup=keyboard1)
@bot.callback_query_handler(func=lambda call:True)
def callback_inline(call):
if call.data == "OFF":
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text="OK")
bot.send_message(message.chat.id, 'antim24355 ') and bot.delete_message(message.chat.id,
message.message_id)
elif call.data == "ON":
bot.edit_message_text(inline_message_id=call.inline_message_id, text="OK")
bot.send_message(message.chat .id, 'antim2435') and bot.delete_message(message.chat.id, message.message_id)
@bot.message_handler(content_types=['text'])
def antim2435(message):
if message.text.lower() == 'antim2435':
names = ['mats']
for name in names:
if name in message.text.lower():
bot.reply_to(message, ' Don't swear!')
@bot.message_handler(content_types=['text'])
def antim24355 (message):
if message.text.lower() == 'antim24355':
names = ['mats']
for name in names:
if name in message.text.lower():
None
how to fix this code so it can include and turn off anti-mat command?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question