from telegram.ext import Updater, CommandHandler
import logging
# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger(__name__)
# Your bot's token
TOKEN = 'YOUR_BOT_TOKEN'
# The chat id of the channel
CHAT_ID = 'YOUR_CHAT_ID'
# Create a TelegramBot object
bot = TelegramBot(TOKEN)
# Define a function that sends a message to the channel and deletes the previous message
def send_message(bot, update, message):
# Send the message
sent_message = bot.send_message(chat_id=CHAT_ID, text=message)
# Delete the previous message
bot.delete_message(chat_id=CHAT_ID, message_id=sent_message.message_id - 1)
# Create an Updater object
updater = Updater(TOKEN)
# Create a CommandHandler to handle the '/send' command
send_handler = CommandHandler('send', send_message)
# Add the send_handler to the dispatcher
updater.dispatcher.add_handler(send_handler)
# Start the bot
updater.start_polling()
add_filter( 'woocommerce_package_rates', 'bbloomer_unset_shipping_when_free_is_available_in_zone', 10, 2 );
function bbloomer_unset_shipping_when_free_is_available_in_zone( $rates, $package ) {
// Only unset rates if free_shipping is available
if ( isset( $rates['free_shipping:8'] ) ) {
unset( $rates['flat_rate:1'] );
}
return $rates;
}
document.querySelectorAll('.menu li').forEach(
(item)=>{
item.addEventListener('touchstart', (event)=> {
document.querySelector('.menu-item.active').classList.remove("active");
}, false);
}
);