Skip to content

Commit

Permalink
Increase bot security using .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
shahriaarrr committed Aug 29, 2022
1 parent 7d34e69 commit de37e8d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/bot.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import discord
from discord.ext import commands
from asyncio import *
from dotenv import load_dotenv
import os
from random import randint,choice

#get data from .env file
load_dotenv()


#create your bot class
class CONFING:
TOKEN = 'BOT TOKEN'
TOKEN = os.getenv('TOKEN')
PREFIX = '-'

client = commands.Bot(command_prefix = CONFING.PREFIX)
Expand Down
1 change: 1 addition & 0 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
discord.py==1.6.0
python-dotenv==0.20.0
1 change: 1 addition & 0 deletions src/simple_.env_file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TOKEN=place_bot_token_here

0 comments on commit de37e8d

Please sign in to comment.