This commit is contained in:
2022-08-24 08:40:31 +03:00
parent ca9787fcf2
commit a6eaec4190
3 changed files with 4 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ async def read_json(guild: int, _param: str):
Reads Json file to determite config strings Reads Json file to determite config strings
:param guild: ID of Guild :param guild: ID of Guild
:param _param: Parameter in json file :param _param: Parameter in json file
:return: value of parameter :return: value of parameter.
""" """
with open('prefix.json', 'r', encoding='utf-8') as fp: # Open the JSON with open('prefix.json', 'r', encoding='utf-8') as fp: # Open the JSON
parameter = None parameter = None

View File

@@ -39,11 +39,11 @@ async def fill_bd(name: str, userid: int, isbot: bool, nick: str, guild: int):
async def add_audio(guild: int, user: int, audio: str, track: str = 'usertracks'): async def add_audio(guild: int, user: int, audio: str, track: str = 'usertracks'):
""" """
Adding audio into folder and DB Adding audio into а folder and DB
:param guild: Guild id :param guild: Guild id
:param user: :param user:
:param audio: :param audio:
:param track: usertracks or defaulttracks :param track: usertracks or defaulttracks.
""" """
# audio = f'{DB.read_db(guild, user, track)}, {audio}' # audio = f'{DB.read_db(guild, user, track)}, {audio}'
sql_update_query = f"""UPDATE "{guild}" set {track} = ? where userid = ?""" sql_update_query = f"""UPDATE "{guild}" set {track} = ? where userid = ?"""

View File

@@ -13,9 +13,7 @@ threading.current_thread().name = "main"
logging.basicConfig(stream=sys.stdout, filemode='w', level='INFO', logging.basicConfig(stream=sys.stdout, filemode='w', level='INFO',
format='%(asctime)s - %(levelname)s - %(threadName)s - %(message)s') format='%(asctime)s - %(levelname)s - %(threadName)s - %(message)s')
intents = disnake.Intents(members=True)
intents = disnake.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix='$', guild_subscriptions=True, intents=intents) bot = commands.Bot(command_prefix='$', guild_subscriptions=True, intents=intents)
f = [] f = []
for filenames in walk('audio'): for filenames in walk('audio'):