kumify/msgio/management/commands/telegram.py

13 lines
408 B
Python
Raw Normal View History

from django.core.management.base import BaseCommand
from dbsettings.functions import dbsettings
class Command(BaseCommand):
help = 'Set your Telegram token'
def handle(self, *args, **options):
token = input("Enter the token you received from the @BotFather: ")
dbsettings["TELEGRAM_TOKEN"] = token
self.stdout.write(self.style.SUCCESS('Telegram token set successfully.'))