edditing code
This commit is contained in:
@@ -17,7 +17,7 @@ async def list_files(fold: str = 'audio'):
|
||||
return fl[2]
|
||||
|
||||
|
||||
async def read_json(guild: int, _param: str) -> int or str:
|
||||
async def read_json(guild: int, _param: str):
|
||||
"""
|
||||
Reads Json file to determite config strings
|
||||
:param guild: ID of Guild
|
||||
@@ -25,6 +25,7 @@ async def read_json(guild: int, _param: str) -> int or str:
|
||||
:return: value of parameter
|
||||
"""
|
||||
with open('prefix.json', 'r', encoding='utf-8') as fp: # Open the JSON
|
||||
parameter = None
|
||||
try:
|
||||
_json = json.load(fp) # Load the custom prefixes
|
||||
except TypeError:
|
||||
@@ -35,10 +36,9 @@ async def read_json(guild: int, _param: str) -> int or str:
|
||||
try:
|
||||
parameter = guild_conf[f"{_param}"]
|
||||
except:
|
||||
parameter = None
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
|
||||
return parameter
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import logging
|
||||
import random
|
||||
from asyncio import sleep
|
||||
|
||||
from disnake import FFmpegPCMAudio
|
||||
|
||||
|
||||
async def play_audio(full_audio, bot, vc):
|
||||
async def play_audio(audio, bot, vc):
|
||||
if not bot.voice_clients:
|
||||
audio = random.choice(full_audio)
|
||||
logging.info(audio)
|
||||
logging.error(f'Playing: {audio}')
|
||||
await sleep(1)
|
||||
vp = await vc.connect()
|
||||
|
||||
Reference in New Issue
Block a user