#๐Ÿ”’ Does anyone have some youtube toturials or just an example I can use to make commands for my disco

46 messages ยท Page 1 of 1 (latest)

noble breach
#

Hey I just statret python and made a bot and am wondering if anyone has an example of how to make the commands becuase I am clueless

alpine basaltBOT
#

@noble breach

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.

torpid bronze
#

How do u define ur bot also do u want prefix or / command

noble breach
#

i dont really know the diffrence sorry I just started im just trying to make a simple bot like !ping and it responds pong

torpid bronze
#

Aka prefix command

noble breach
#

yes

tame ruin
#

don't watch tutorials on making discord bot

torpid bronze
#

Bot=discord.bot(intents=discord.intents.all(),command_prefix="!")

tame ruin
#

theyre often bad with bad approach, bad habit, bad advice

#

that's not python naming convention, nor any language i know

torpid bronze
#

@bot.command()
def ping(ctx):
ctx.send_message("pong")

tame ruin
#

that is totally wrong

noble breach
#

said bot is not defined

tame ruin
#

from naming convention to method

#

first, how much python knowledge do you have

noble breach
#

i started yesterday

tame ruin
#

almost every api wrapper library require you to have some level of python knowledge

#

like the most used library discord.py will require this:

  • Primitive data types
  • Operators
  • Data structures
  • Importing
  • Variables, namespace and scope
  • String formatting
  • Object-Oriented Programming (OOP)
  • Control flow
  • Exception handling
  • Function definitions
  • Classes, objects, attributes and methods
  • Console usage, interpreters and environments
  • Decorators

Useful to know:

  • Asyncio basics
  • What is blocking?
  • Logging
  • How to read docs properly
noble breach
#

well ima try my best

noble breach
tame ruin
#

because their naming is wrong idk

torpid bronze
tame ruin
#

what?

#

do you know python is an OOP language?

torpid bronze
tame ruin
#

you need to know what are these doing when you code, you don't code just to run it

torpid bronze
torpid bronze
tame ruin
#

discord.py uses OOP, it's base on classes, you don't only call function when using discord.py, bot = commands.Bot(...) is already OOP

#

you dont create a bot using only functions, you don't do bot = create_a_bot(...)

torpid bronze
tame ruin
#

you would still need it to be a developer

#

then why arent you learn it on the way

torpid bronze
torpid bronze
#

But u could reach ur first goal earlyer makeing it feel better to code

tame ruin
#

i can just give them the link to example code but they will not learn anything and will just blindly copy paste, they need to be able to read the example code to make their own

torpid bronze
noble breach
tame ruin
#

i suggest you start by making terminal app first then discord bot can be later tho

torpid bronze
tame ruin
#

it will be hard if it's your first time coding

alpine basaltBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.