#problem
1 messages · Page 1 of 1 (latest)
I think your bot is missing access for register commands
You need to select "bot" and "applications.commands" and create link with these scopes

The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Pycord Development
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.```
Ignoring exception in view <zamow timeout=180.0 children=1> for item <Button style=<ButtonStyle.primary: 1> url=None disabled=False label='Zamów' emoji=<PartialEmoji animated=False name='📥' id=None> row=None>:
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/discord/ui/view.py", line 396, in _scheduled_task
await item.callback(interaction)
File "<string>", line 16, in button_callback
NameError: name 'create_text_channel' is not defined```
@static radish
code?
class zamow(discord.ui.View):
@discord.ui.button(label="Zamów", style=discord.ButtonStyle.primary, emoji="📥")
async def button_callback(self, button, interaction):
user = interaction.user
await create_text_channel(f"zlecenie_od_{user}")
@bot.slash_command(guild_ids=[995718459516272800])
async def zamów(ctx):
await ctx.respond(view=zamow())```
@static radish
its ok you dont have to ping me for everything
Вместо мембера вставь юзера своего и укажи категорию
await member.guild.create_voice_channel(name = f'Канал {member.display_name}', category = maincategory, user_limit=2)
but you need a guild object to use the create_text_channel method
guild = interaction.guild```?
sure
Ignoring exception in view <zamow timeout=180.0 children=1> for item <Button style=<ButtonStyle.primary: 1> url=None disabled=False label='Zamów' emoji=<PartialEmoji animated=False name='📥' id=None> row=None>:
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/discord/ui/view.py", line 396, in _scheduled_task
await item.callback(interaction)
File "<string>", line 17, in button_callback
NameError: name 'create_text_channel' is not defined```
you need a guild object to run create_text_channel
you can get one from interaction.guild
so it should look like
await interaction.guild.create_text_channel("foo")
Hi
I have a problem
Error: Bot został pomyślnie uruchomiony! Ignoring exception in on_ready Traceback (most recent call last): File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/discord/client.py", line 382, in _run_event await coro(*args, **kwargs) File "<string>", line 13, in on_ready sqlite3.OperationalError: near "EXIST": syntax error
@bot.event
async def on_ready():
print("Bot został pomyślnie uruchomiony!")
connection = sqlite3.connect("ogloszenia.db")
cursor = connection.cursor()
cursor.execute("CREATE TABLE IF NOT EXIST ogloszenia(guild_id INT, ogloszenie STR)")
cursor.close()
connection.close()```
@static radish
what happened to this??
😦
make another post for this
I makes