#🔒 I need help with my code

34 messages · Page 1 of 1 (latest)

abstract comet
#

I am trying to make a / command for my discord bot i need a name but the problem is it doesnt let me use a space between 2 words only answer i know is using a _ but i dont whant that because it wont look good.

finite ventureBOT
#

@abstract comet

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.

cloud hatch
abstract comet
#

sorry i am relative new to coding so i do not really understand what you mean.

finite ventureBOT
#
class discord.app_commands.Group(*, name=..., description=..., parent=None, guild_ids=None, guild_only=..., allowed_contexts=..., allowed_installs=..., nsfw=..., ...)```
A class that implements an application command group.

These are usually inherited rather than created manually.

Decorators such as [`guild_only()`](https://discordpy.readthedocs.io/en/stable/interactions/api.html#discord.app_commands.guild_only), [`guilds()`](https://discordpy.readthedocs.io/en/stable/interactions/api.html#discord.app_commands.guilds), and [`default_permissions()`](https://discordpy.readthedocs.io/en/stable/interactions/api.html#discord.app_commands.default_permissions) will apply to the group if used on top of a subclass. For example...
slim fog
#

make a group called warnings and add a command on it called check

cedar cave
#

You are making the bot with py right ?

abstract comet
cedar cave
#

I think you should focus on creating a good bot rather than focusing on name.
But if you want you can add a class called warnings and then add a subcommand named check in it.

#

@app_commands.command

slim fog
#

thats not how you make a subcommand

#

thats how you make a regular command

abstract comet
slim fog
abstract comet
#

ValueError: 'remove warnings' must be between 1-32 characters and contain only lower-case letters, numbers, hyphens, or underscores.

#

the name in the code

abstract comet
#

i did

#

but igot very confused

slim fog
abstract comet
#

everything

#

only thing i understood was the from discord import app_commands

slim fog
#

if these are unfamiliar, you should probably learn more about python before stepping up to something like this

cedar cave
cedar cave
#

lol, im in trouble pithink

slim fog
#

you can inline it: ```py
timetables = Group(name = "timetable", description = "...")

@timetables.command()
async def show(self, ...):
...

finite ventureBOT
#
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.