Add management command to set Telegram token

This commit is contained in:
Kumi 2020-12-31 22:29:26 +01:00
parent 499c573890
commit 7d5513f149

View file

@ -0,0 +1,13 @@
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.'))