Add management command to set Telegram token
This commit is contained in:
parent
499c573890
commit
7d5513f149
1 changed files with 13 additions and 0 deletions
13
msgio/management/commands/telegram.py
Normal file
13
msgio/management/commands/telegram.py
Normal 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.'))
|
Loading…
Reference in a new issue