bot = commands.Bot(command_prefix=config.get_prefix(), intents=discord.Intents.all())
slash = SlashClient(bot)
bot.remove_command('help')
bot.add_cog(Main(bot))
bot.add_cog(Music(bot))
bot.add_cog(Utilits(bot))
bot.add_cog(Moderation(bot))
def bot_guild_count():
return len(bot.guilds)
def bot_guilds():
return "\n\n".join(bot.guilds)
def bot_name():
return bot.user.name
def bot_prefix():
return config.get_prefix()
Ignoring exception in on_socket_response
Traceback (most recent call last):
File "/home/container/.local/lib/python3.10/site-packages/discord/client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "/home/container/.local/lib/python3.10/site-packages/dislash/application_commands/slash_client.py", line 1229, in _on_socket_response
await self._process_interaction(payload["d"])
File "/home/container/.local/lib/python3.10/site-packages/dislash/application_commands/slash_client.py", line 1387, in _process_interaction
await self._on_slash_command(inter)
File "/home/container/.local/lib/python3.10/site-packages/dislash/application_commands/slash_client.py", line 1287, in _on_slash_command
raise err
File "/home/container/.local/lib/python3.10/site-packages/dislash/application_commands/slash_client.py", line 1282, in _on_slash_command
await app_command.invoke(inter)
File "/home/container/.local/lib/python3.10/site-packages/dislash/application_commands/slash_core.py", line 216, in invoke
raise err
File "/home/container/.local/lib/python3.10/site-packages/dislash/application_commands/slash_core.py", line 212, in invoke
await self._maybe_cog_call(self._cog, interaction, interaction.data)
File "/home/container/.local/lib/python3.10/site-packages/dislash/application_commands/slash_core.py", line 35, in _maybe_cog_call
return await self(cog, inter, **params)
File "/home/container/.local/lib/python3.10/site-packages/dislash/application_commands/core.py", line 72, in __call__
return await self.func(*args, **kwargs)
File "/home/container/main.py", line 526, in _play
await ctx.reply(..., type=ResponseType.DeferredUpdateMessage)
File "/home/container/.local/lib/python3.10/site-packages/dislash/interactions/interaction.py", line 196, in reply
await self.create_response(
File "/home/container/.local/lib/python3.10/site-packages/dislash/interactions/interaction.py", line 320, in create_response
await self.bot.http.request(
File "/home/container/.local/lib/python3.10/site-packages/discord/http.py", line 254, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In type: Value must be one of {9, 4, 5}.
from dislash import SlashClient, slash_command, Option, OptionType, ResponseType
@slash_command(name="play",description="Начать воспроизведение.",options=[Option("search", "А что искать то?", required=True)])
async def _play(self, ctx: commands.Context, *, search: str = None):
await ctx.reply(..., type=ResponseType.DeferredUpdateMessage)
ctx.voice_state = self.get_voice_state(ctx)
if not ctx.voice_state.voice:
await ctx.invoke(self._join)
try:
source = await YTDLSource.create_source(ctx,
search,
loop=self.bot.loop)
except YTDLError as e:
await ctx.send('Ошибка: {}'.format(str(e)))
else:
song = Song(source)
await ctx.voice_state.songs.put(song)
# row_of_buttons = ActionRow(
# Button(style=ButtonStyle.red, label="Replay", custom_id="re"))
await ctx.reply(f'Добавлено {source}')
И у хостинга начинаются непонятно что:
А если добавлю перед poster_publ() await, то бот снова начинает просто ожидать завершение функции. Скажу, то что я впервые слышу про create_task(), так что могу допустить даже самую тупую ошибку