I write the code by telegrambotAPI, but when i write in telegram these commands and messages bot do nothing
import random
import webbrowser
import telebot
from telebot import types
mytoken = 'here is token'
bot = telebot.Telebot(mytoken)
@bot.message_handler(commands=\['start'\])
def welcome(message):
bot.send_message(message.chat.id, f'Привет, {message.from_user.first_name}')
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
button1 = types.KeyboardButton(' Инвестиции')
button2 = types.KeyboardButton(' Контакты')
button3 = types.KeyboardButton(' Кошелёк')
button4 = types.KeyboardButton(' Калькулятор')
button5 = types.KeyboardButton('⚙️ Настройки')
markup.row(button1, button2)
markup.row(button3, button4)
markup.row(button5)
@bot.message_handler()
def info(message):
if message.text == ' Инвестиции':
investMessage(message)
elif message.text == ' Контакты':
contactMessage(message)
elif message.text == ' Кошелёк':
walletMessage(message)
elif message.text == ' Калькулятор':
calculatorMessage(message)
elif message.text == '⚙️ Настройки':
optionsMessage(message)
def investMessage(message):
bot.send_message(message.chat.id, f'▪️ Открывай инвестиции и получай стабильную прибыль в данном разделе, после собирай доход:
Процент прибыли: 6%
⏱️ Время доходности: 24 часа
Срок вклада: Пожизненно
Ваш вклад: 0₽
Ваши накопления: 0₽')
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
button1 = types.KeyboardButton('➕ Инвестировать')
button2 = types.KeyboardButton('➖ Собрать')
markup.row(button1, button2)
def contactMessage(message):
bot.send_message(message.chat.id, f'▪️ Наша партнерская программа считается самой эффективной, приглашай друзей и получай деньги
За каждого друга по 1₽
Партнеров: 0 чел.
Ваша реф-ссылка:http://t.me/Invest_zaranotok_bot?start=5148159118
Внешняя реф-ссылка https://teleg.run/Invest_zaranotok_bot?start=5148159118')
def walletMessage(message):
bot.send_message(message.chat.id, f'Тут Вы можете пополнить и вывести накопленые средства
Ваш ID: 5148159118
Ваш баланс: 0₽
Баланс для вывода: 0₽
Партнеров: 0 чел.
Пополнил: 0₽
Вывел: 0₽')
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
button1 = types.MenuButton('➕ Пополнить')
button2 = types.MenuButton('➖ Вывести')
markup.row(button1, button2)
def calculatorMessage(message):
bot.send_message(message.chat.id, f' Введите сумму которую хотите расчитать:')
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
button1 = types.MenuButton(' Отмена')
markup.row(button1)
def optionsMessage(message):
bot.send_message(message.chat.id, f'▪ Вы попали в раздел настройки бота, здесь вы можете посмотреть статистику, а также узнать информацию или отключить уведомления.
Дней работаем: 16 дней
▪️ Всего инвесторов: 1898
▪️ Новых за 24 часа: 17')
bot.polling(none_stop=True)
I want to do bot about investments, like when you send money, you can every 24 hours collect %
................................................................................................................................................................................................................................................................................................................................................................................................................