#๐Ÿ”’ bot python

120 messages ยท Page 1 of 1 (latest)

placid drum
#

pls help me

ivory willowBOT
#

@placid drum

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

vivid nest
placid drum
#

okay

ivory willowBOT
vivid nest
# placid drum okay

The problem I believe is in async with self.bot.db.cursor() as cursor:

You need to first connect to a datatbase like async with aiosqlite.connect() as db

placid drum
#

look this

vivid nest
#

wdym?

placid drum
#

?

#

and for this error ?

vivid nest
#

It's a typo:
async def create_ticket(seld, button: nextcord.ui.Button, interaction: nextcord.Interaction):

vivid nest
#

Do you see where you went wrong?

placid drum
vivid nest
placid drum
vivid nest
placid drum
vivid nest
#

What I gave you was an example, you need to connect to a database

placid drum
vivid nest
#

async with aiosqlite.connect("example.db") as db:

placid drum
vivid nest
#

where did you get the tutorial from?

placid drum
#

this

#

look

#

5:50

#

@vivid nest ?

vivid nest
placid drum
#

wow im really stupid

vivid nest
#

Also, I just realised db was defined in on_ready, so yes you can follow him

forest wind
forest wind
vivid nest
forest wind
placid drum
forest wind
vivid nest
#

this is using nextcord tho (I'm not sure how different it is)

forest wind
#

me neither

placid drum
#

look

vivid nest
#

you're putting seld

placid drum
#

it doesn't work

forest wind
#
-seld.db.cursor()
+self.db.cursor()
placid drum
vivid nest
#

what's the error?

placid drum
forest wind
placid drum
forest wind
forest wind
vivid nest
forest wind
#

Show your latest please

vivid nest
#

Change it to async(self...)

placid drum
vivid nest
#

what's the error then

placid drum
vivid nest
#

๐Ÿ˜ญ

forest wind
placid drum
ivory willowBOT
forest wind
placid drum
forest wind
#

Change these two to self please

vivid nest
#

In a class, you always have to put self first

forest wind
#

not really...

placid drum
forest wind
#

You can use anything in the first param

vivid nest
#

it's not args?

forest wind
#

!e

class Dog:
  def __init__(bla, name):
    bla.name = name

fido = Dog("Fido")
print(fido.name)
ivory willowBOT
forest wind
#

The thing is, it has to be consistent

placid drum
#

?

placid drum
vivid nest
vivid nest
forest wind
placid drum
forest wind
#

terrible tut

forest wind
vivid nest
#

Tuts don't explain anything

placid drum
forest wind
placid drum
#

no

forest wind
#

There's no self

forest wind
placid drum
#

no self

forest wind
#

Looks like you didn't follow the tutorial properly

placid drum
#

So what do I do?

vivid nest
#

learn it properly

#

actually understand what you are doing before moving onto stuff like that

civic glade
placid drum
#

what is docs nextcord pls

#

@civic glade

placid drum
civic glade
civic glade
placid drum
civic glade
placid drum
obtuse linden
#

you won't be able to create anything that functions well without understanding the fundamentals

#

you should start by just getting the hang out of python before starting to use these third party libraries

shy cobalt
ivory willowBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.