mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Remove hardcoded tokens, opt for environment variable
This commit is contained in:
parent
879b333a11
commit
6b2b3f48a7
7 changed files with 11 additions and 21 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import asyncio
|
||||
import logging
|
||||
import sys
|
||||
from os import getenv
|
||||
|
||||
from aiogram import Bot, Dispatcher, Router, types
|
||||
from aiogram.enums import ParseMode
|
||||
|
|
@ -9,9 +10,7 @@ from aiogram.types import Message
|
|||
from aiogram.utils.markdown import hbold
|
||||
|
||||
# Bot token can be obtained via https://t.me/BotFather
|
||||
TOKEN = "42:TOKEN"
|
||||
# However, is recommended to get the token from environment variable:
|
||||
# TOKEN = getenv("BOT_TOKEN")
|
||||
TOKEN = getenv("BOT_TOKEN")
|
||||
|
||||
# All handlers should be attached to the Router (or Dispatcher)
|
||||
router = Router()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue