kumify/msgio/management/commands/telegram.py

13 lines
422 B
Python
Raw Normal View History

from django.core.management.base import BaseCommand, CommandError
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.'))