This commit is contained in:
esef committed 2026-06-22 22:15:45 +03:00
1 parent a317b0a7e8
commit 77256f3881
1 file changed
+8 -10
+8 -10
View File
@@ -14,18 +14,18 @@ intents.message_content = True
bot = commands.Bot(command_prefix='!', intents=intents) bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event forwarder = TelegramForwarder(
async def on_ready():
print(f'✅ {bot.user} is online!')
async def main():
# ── telegram forwarder ───────────────────────────────────────────────
forwarder = TelegramForwarder(
token=os.getenv('TELEGRAM_BOT_TOKEN'), token=os.getenv('TELEGRAM_BOT_TOKEN'),
group_id=int(os.getenv('TELEGRAM_GROUP_ID')), group_id=int(os.getenv('TELEGRAM_GROUP_ID')),
webhook_url=os.getenv('DISCORD_WEBHOOK_URL'), webhook_url=os.getenv('DISCORD_WEBHOOK_URL'),
) )
@bot.event
async def on_ready():
print(f'✅ {bot.user} is online!')
asyncio.create_task(forwarder.start())
async def main():
async with bot: async with bot:
await bot.load_extension('cogs.general') await bot.load_extension('cogs.general')
await bot.load_extension('cogs.chance') await bot.load_extension('cogs.chance')
@@ -34,8 +34,6 @@ async def main():
await bot.load_extension('cogs.sysinfo') await bot.load_extension('cogs.sysinfo')
await bot.load_extension('music.music') await bot.load_extension('music.music')
await forwarder.start()
try: try:
await bot.start(os.getenv('DISCORD_TOKEN')) await bot.start(os.getenv('DISCORD_TOKEN'))
finally: finally: