Skip to content

Commit

Permalink
src: Bot: Satisfy type checker
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimifr committed Mar 18, 2024
1 parent 6fbea30 commit 41b8fd9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
def main() -> None:
load_dotenv()

api_id = getenv("API_ID")
api_hash = getenv("API_HASH")
bot_token = getenv("BOT_TOKEN")
api_id = getenv("API_ID", 0)
api_hash = getenv("API_HASH", "")
bot_token = getenv("BOT_TOKEN", "")

if not all([api_id, api_hash, bot_token]):
raise ValueError("Could not get all required credentials from env!")

app = TelegramClient("app", api_id, api_hash).start(bot_token=bot_token)
app = TelegramClient("app", int(api_id), api_hash).start(bot_token=bot_token)

@app.on(events.NewMessage(incoming=True, pattern="/start"))
async def start(event):
Expand Down

0 comments on commit 41b8fd9

Please sign in to comment.