refractor lib code

This commit is contained in:
2022-08-22 01:17:27 +03:00
parent ea3e9dd105
commit e1b782c2cb
5 changed files with 34 additions and 47 deletions

15
test.py
View File

@@ -1,18 +1,19 @@
import logging
import sys
from os import path
import disnake
from disnake import OptionChoice, OptionType, Option
from disnake.ext import commands
from lib.CogsPrepare import cog_list, work_with_cogs
from lib.Comands import check_json, determine_prefix
from lib.Comands import determine_prefix
bot_owner = 386629192743256065
check_json()
intents = disnake.Intents(messages=True, guilds=True, message_content=True)
intents.members = True
intents.voice_states = True
if not path.isfile('prefix.json'):
with open('prefix.json', 'w+', encoding='utf-8') as f:
f.write("")
intents = disnake.Intents(messages=True, guilds=True, message_content=True, voice_states=True, members=True)
bot = commands.Bot(command_prefix=determine_prefix,
intents=intents,
@@ -62,7 +63,7 @@ async def on_ready():
]
)
async def slash_cogs(inter, what_do):
if inter.author.id == bot_owner:
if inter.author.id == bot.owner_id:
await work_with_cogs(what_do, bot)
await inter.response.send_message(f'Cogs are {what_do}ed', ephemeral=True)