From 000bf54038354c86d040c4853a7ca52eec8f61d4 Mon Sep 17 00:00:00 2001 From: beacon Date: Sat, 2 Jul 2022 20:15:43 +0300 Subject: [PATCH] Try to move to disnake --- test.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test.py b/test.py index 3491259..741285a 100644 --- a/test.py +++ b/test.py @@ -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"),