made the prefix an env variable

This commit is contained in:
SeaswimmerTheFsh 2023-06-19 16:47:48 -04:00
parent 02b6b7cfaa
commit 85cbc6fb01
2 changed files with 3 additions and 1 deletions

View file

@ -1,3 +1,4 @@
TOKEN=token-goes-here TOKEN=token-goes-here
PREFIX=!
# Only change the API URL if you're using a selfhosted Revolt instance. # Only change the API URL if you're using a selfhosted Revolt instance.
API_URL=https://api.revolt.chat API_URL=https://api.revolt.chat

View file

@ -8,10 +8,11 @@ from revolt.ext import commands
load_dotenv() load_dotenv()
token = os.getenv('TOKEN') token = os.getenv('TOKEN')
api_url = os.getenv('API_URL') api_url = os.getenv('API_URL')
prefix = os.getenv('PREFIX')
class Client(commands.CommandsClient): class Client(commands.CommandsClient):
async def get_prefix(self, message: revolt.Message): async def get_prefix(self, message: revolt.Message):
return "." return prefix
@commands.command() @commands.command()
async def ping(self, ctx: commands.Context): async def ping(self, ctx: commands.Context):