Skip to content

Commit

Permalink
fix: Relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
kkrypt0nn committed Dec 25, 2022
1 parent 9997176 commit 3b8a2e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion helpers/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import json
import os
from typing import Callable, TypeVar

from discord.ext import commands
Expand All @@ -22,7 +23,7 @@ def is_owner() -> Callable[[T], T]:
This is a custom check to see if the user executing the command is an owner of the bot.
"""
async def predicate(context: commands.Context) -> bool:
with open("config.json") as file:
with open(f"{os.path.realpath(os.path.dirname(__file__))}/../config.json") as file:
data = json.load(file)
if context.author.id not in data["owners"]:
raise UserNotOwner
Expand Down
2 changes: 1 addition & 1 deletion helpers/db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import aiosqlite

DATABASE_PATH = f"{os.path.realpath(os.path.dirname(__file__))}/database/database.db"
DATABASE_PATH = f"{os.path.realpath(os.path.dirname(__file__))}/../database/database.db"


async def is_blacklisted(user_id: int) -> bool:
Expand Down

0 comments on commit 3b8a2e3

Please sign in to comment.