fix
This commit is contained in:
1 parent
a317b0a7e8
commit
77256f3881
1 file changed
+7
-9
@@ -14,18 +14,18 @@ intents.message_content = True
|
|||||||
|
|
||||||
bot = commands.Bot(command_prefix='!', intents=intents)
|
bot = commands.Bot(command_prefix='!', intents=intents)
|
||||||
|
|
||||||
|
forwarder = TelegramForwarder(
|
||||||
|
token=os.getenv('TELEGRAM_BOT_TOKEN'),
|
||||||
|
group_id=int(os.getenv('TELEGRAM_GROUP_ID')),
|
||||||
|
webhook_url=os.getenv('DISCORD_WEBHOOK_URL'),
|
||||||
|
)
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
print(f'✅ {bot.user} is online!')
|
print(f'✅ {bot.user} is online!')
|
||||||
|
asyncio.create_task(forwarder.start())
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
# ── telegram forwarder ───────────────────────────────────────────────
|
|
||||||
forwarder = TelegramForwarder(
|
|
||||||
token=os.getenv('TELEGRAM_BOT_TOKEN'),
|
|
||||||
group_id=int(os.getenv('TELEGRAM_GROUP_ID')),
|
|
||||||
webhook_url=os.getenv('DISCORD_WEBHOOK_URL'),
|
|
||||||
)
|
|
||||||
|
|
||||||
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:
|
||||||
|
|||||||
Reference in new issue
Block a user