'I want to make separated file for telegram bot every commands in python
pytelegrambotapii am making a telegram bot and i want to make every command in separated files i tried to do with this code
from run_start import *
@bot.message_handler(commands=['cmds'])
async def semd_command(message):
await bot.reply_to(message,"Commands\n\nComing Soon")
how to attach 2 files pytelegrambotapi
in 1st line import is main file whare bot running
When i put that code in main file its working but when i put separated its not working please give me solution
This is my first code
import cmds
bot = AsyncTeleBot('token')
@bot.message_handler(commands=['help', 'start'])
async def send_welcome(message):
await bot.reply_to(message,"__Heya__!! boiiiii How was your day???")
await bot.reply_to(message,"Now Send /cmds to check my commands")
asyncio.run(bot.polling())
Solution 1:[1]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | hoosnick |
