misc: code consistency and bot instance creation

This commit is contained in:
sdmway 2024-05-07 20:14:38 -06:00
parent a7d3e9a720
commit df1ab06762
11 changed files with 32 additions and 20 deletions

View file

@ -4,6 +4,7 @@ import sys
from os import getenv
from aiogram import Bot, Dispatcher, Router
from aiogram.client.default import DefaultBotProperties
from aiogram.enums import ParseMode
from aiogram.filters import LEAVE_TRANSITION, ChatMemberUpdatedFilter, CommandStart
from aiogram.types import (
@ -79,7 +80,7 @@ async def my_chat_member_change(chat_member: ChatMemberUpdated, bot: Bot) -> Non
async def main() -> None:
# Initialize Bot instance with a default parse mode which will be passed to all API calls
bot = Bot(TOKEN, parse_mode=ParseMode.HTML)
bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML))
dp = Dispatcher()