#problem

1 messages · Page 1 of 1 (latest)

opal apex
#

Hi

#

I have a problem

#

How to fix it?

river isle
#

I think your bot is missing access for register commands

#

You need to select "bot" and "applications.commands" and create link with these scopes

opal apex
#

How to create channel using bot?

#

@river isle

static radish
opal apex
#

I'm readed but i don't see it

#

@static radish

native questBOT
#
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.```
opal apex
#
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

static radish
#

code?

opal apex
#
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

static radish
#

its ok you dont have to ping me for everything

tender panther
static radish
#

but you need a guild object to use the create_text_channel method

opal apex
#
guild = interaction.guild```?
static radish
#

sure

opal apex
#
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```
plucky bone
#

you can get one from interaction.guild

#

so it should look like

await interaction.guild.create_text_channel("foo")
opal apex
#

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

static radish
opal apex
#

😦

static radish
#

make another post for this

opal apex
#

I makes