Below is the code I am writing The main work is to create a dropdown menu which proceed's with an option to show all the available commands in the bot.
#MODULES--------------------------------------------------------------------------------------------------------------------------------------------| import os import time import json import discord from discord.ui import Select, View from discord.ext import commands #GETTING DATA FROM CONFIG FILE----------------------------------------------------------------------------------------------------------------------| def load_data(file_path): with open(file_path, 'r') as file: return json.load(file) Config_Path = os.path.join(os.path.dirname(__file__), '..', 'Config', 'config.json') # File path. Config_Data = load_data(Config_Path) # Loading prefix. Prefix = Config_Data['PREFIX'] #MAIN-----------------------------------------------------------------------------------------------------------------------------------------------| class HelpMenu(View): @discord.ui.select( placeholder = "Please choose what you need help with", min_values = 1, max_values = 1, options = [ discord.SelectOption(label = 'Command Help', description = 'Show info on all the available commands.', emoji = '
async def select_callback(self, select, interaction): select.disabled = True This is the error i am geting
2024-03-02 18:19:54 ERROR discord.ui.view Ignoring exception in view for item Traceback (most recent call last): File "C:\Users\xesch\AppData\Local\Programs\Python\Python312\Lib\site-packages\discord\ui\view.py", line 427, in _scheduled_task await item.callback(interaction) File "c:\Users\xesch\OneDrive\Desktop\Spooks\Cogs\commands.py", line 32, in select_callback select.disabled = True ^^^^^^^^^^^^^^^ AttributeError: 'Interaction' object has no attribute 'disabled' I tried finding the solution on chatgpt or youtube but nothing is working. So I appreciate the help. Thank you.
Источник: https://stackoverflow.com/questions/780 ... iscord-bot