some minor changes

This commit is contained in:
bacon
2024-03-07 22:07:06 +03:00
parent 73cf9f3c6e
commit 84f4491861
7 changed files with 11 additions and 11 deletions

View File

@@ -39,7 +39,7 @@ async def read_json(guild: int, _param: str):
:return: value of parameter.
"""
parameter = None
with open(os.getenv('CONF_FILE'), 'r', encoding='utf-8') as f: # Open the JSON
with open(os.getenv('CONF_FILE'), encoding='utf-8') as f: # Open the JSON
try:
_json = json.load(f) # Load the custom prefixes
except json.decoder.JSONDecodeError:
@@ -57,7 +57,7 @@ async def read_json(guild: int, _param: str):
async def write_json(guild: int, param_name: str, param: str or int):
with open(os.getenv('CONF_FILE'), 'r', encoding='utf-8') as f:
with open(os.getenv('CONF_FILE'), encoding='utf-8') as f:
try:
_json = json.load(f)
except json.decoder.JSONDecodeError:
@@ -80,7 +80,7 @@ def determine_prefix(bot, msg):
:return: prefix for server, default is $
"""
parameter = '$'
with open(os.getenv('CONF_FILE'), 'r', encoding='utf-8') as f: # Open the JSON
with open(os.getenv('CONF_FILE'), encoding='utf-8') as f: # Open the JSON
try:
_json = json.load(f) # Load the custom prefixes
except json.JSONDecodeError:
@@ -100,7 +100,7 @@ def determine_time(msg):
:return: prefix for server, default is $
"""
parameter = 15
with open(os.getenv('CONF_FILE'), 'r', encoding='utf-8') as f: # Open the JSON
with open(os.getenv('CONF_FILE'), encoding='utf-8') as f: # Open the JSON
try:
_json = json.load(f) # Load the custom prefixes
except json.JSONDecodeError:

View File

@@ -7,7 +7,7 @@ class _CustomFormatter(logging.Formatter):
red = "\x1b[31;20m"
bold_red = "\x1b[31;1m"
reset = "\x1b[0m"
format = f"%(asctime)s - [%(levelname)s] -%(module)s- %(message)s"
format = "%(asctime)s - [%(levelname)s] -%(module)s- %(message)s"
FORMATS = {
logging.DEBUG: grey + format + reset,

View File

@@ -10,7 +10,7 @@ async def play_audio(audio, bot, vc):
await sleep(1)
vp = await vc.connect()
if not vp.is_playing():
vp.play(FFmpegOpusAudio(f'{audio}', executable='ffmpeg'), after=lambda e: print('done', e))
vp.play(FFmpegOpusAudio(f'{audio}'), after=lambda e: print('done', e))
while vp.is_playing():
await sleep(0.5)
await sleep(1)

View File

@@ -1,7 +1,7 @@
"""
lib
~~~~~~~~~~~~~
Some libs for the bot whitch help him
Some libs for the bot which help him
"""
from .ListGenerator import *
from .Logger import *