Try to move to disnake

This commit is contained in:
2022-07-02 20:15:43 +03:00
parent bab5d68a88
commit 000bf54038

View File

@@ -3,11 +3,13 @@ import logging
import sys
import threading
import discord
import disnake
from disnake import OptionChoice, OptionType, Option
import lib
from os import path
from discord.ext import commands
from dislash import InteractionClient, Option, OptionType, OptionChoice
bot_owner = 386629192743256065
@@ -15,7 +17,6 @@ lib.Commands.chech_json()
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix=lib.Commands.determine_prefix, guild_subscriptions=True, intents=intents)
inter_client = InteractionClient(bot, sync_commands=True)
threading.current_thread().name = "main"
logging.basicConfig(stream=sys.stdout, filemode='w', level='INFO',
format='%(asctime)s - %(levelname)s - %(threadName)s - %(message)s')
@@ -42,14 +43,14 @@ async def on_ready():
logging.info('We have logged in as {0.user}'.format(bot))
@inter_client.slash_command(
@bot.slash_command(
name="cog",
description="Work with cogs",
options=[
Option(
"what_do",
description="Specify what do with cogs",
type=OptionType.STRING,
type=OptionType.string,
required=True,
choices=[
OptionChoice("load", "load"),