#Application commands won't show up/update
1 messages ยท Page 1 of 1 (latest)
wtf is that
alright
bot for something...
get help please
chill im new
you imported whole internet bruh
You probably don't need discord_webhook, interactions (if it's discord interactions), dhooks and much other stuff
Also, don't use requests library
And don't use threading with asyncio (especially if you are a beginner)
Also, read the guide
Is that the only thing that bothers you?
.tag guide
yea i imported it by a mistake
I gave up on the rest ๐
You can also just delete
intents = discord.Intents.default()
intents.messages = True
intents.guilds = True
Because you already use intents=discord.Intents.all()
whats that again
how do I make it I forgot how to do this all stuff learned it weeks ago
Program that helps you to write code
VS code is also good, but install extensions like pylint and other
ah alright
delete unnecessary import and then replace commands.Bot with just Bot
whats pylint do?
aight
did it now this error came: "Bot" is not defined
google python linting
do you want prefix cmds too?
nope only application
ah
oh boy
then remove this command_prefix='/'
alright

it still says then: "Bot" is not defined
bot = Bot(intents=discord.Intents.all())
use black formatter
ah
thank you
my bad
now its gone wait let me try it
also, show your pip list. it will be fucked up
alright
File "c:\Users\******\Desktop\*******\shinetest v3.4.py", line 19, in <module>
bot = discord.Bot(intents=discord.Intents.all())
^^^^^^^^^^^
AttributeError: module 'discord' has no attribute 'Bot'```
yep
this is the cause
how do u use that, also pylints organising of imports dont work
yea wait the message is too long
just black .
also, create a new post? or maybe #998272089343668364
yes smart
uh. you want to use py-cord right
yea discord.py
those are different
py-cord is a fork of dpy. both have different implementations for slash cmds
ah okay
but how do I fix this?
it doesn't show any application command. it's not even registred on discord.
Well you need to choose which library you want to use. you can only install one of them, as they conflict with each other, causing that error
ill tell you for py-cord
pip uninstall dhooks discord discord.py discord-py-interactions discord-py-slash-command discord-typings discord-webhook discordwebhook
followed by pip install -U py-cord
uh parts of it. most of the code is same for both the libraries
the main difference is only of slash cmds
uninstalled it wait I install this other thing again
installed
what should I do now?
remove any imports you had from here
alright
also, check the guide
^
I don't understand it so I need help from someone
removed, what now
any errors?
"app_commands" is not defined
tree = app_commands.CommandTree(client)
before I used "@tree.command"
It showed these commands up but when I tried adding new ones it didn't showed up
yes so you need @bot.command()
ye
alright
see this example https://github.com/Pycord-Development/pycord/blob/master/examples/app_commands/slash_basic.py
Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API - pycord/examples/app_commands/slash_basic.py at master ยท Pycord-Development/pycord
when using discord.Bot, @bot.command() and @bot.slash_command() are the samee
ah alright
lemme try the command wait a second
ah fuck wait what should I replace threw interactions?
but it says
no
ModuleNotFoundError: No module named 'interactions'
ah
wait
I didn't looked at the line
the cmd should be async def my_cmd(ctx: discord.ApplicationContext):
from interactions import User
ah alright
I replace it wait
should it be ctx or can I leave it with interactions?
Because this uses interactions: "await interaction.response.send_message(embed=response_embed)"
it should be ctx
you can do ctx.interaction.response.send_message, or use the shortcut ctx.respond
ah alright
ctx.respond will also factor in defer and followups for you, so you can use it multiple times
alright
hey
if I try to run it it just says nothing in the console
so its not running
and the bot is not on
Did you update your code?
yea
And its still not working?
nope
import discord
import time
import random
import datetime
from random import randint
import requests
import random
import datetime
import random
import sys
import cloudscraper
from time import sleep
import requests
import json
import requests
from xgboost import XGBClassifier
import cloudscraper as cs
import json
import random
from xgboost import XGBClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
s = requests.Session()
intents = discord.Intents.default()
intents.members = True
bot = discord.Bot(intents=intents)
bot = discord.Bot(command_prefix='/', intents=intents)
scraper = cloudscraper.create_scraper()
intents = discord.Intents.default()
intents.typing = False
intents.presences = False
class AClient(discord.Client):
def __init__(self):
super().__init__(intents=discord.Intents.all())
self.synced = False
client = AClient()```
Did I maybe made something wrong
But you know basic Python?
yea halfways
Pls learn basic Python first
nope didn't helped
When I was younger I knew more
I forgot it all
Its the first rule in #help-rules
Its really easy to see what the problem is
then tell me it maybe?
@stark oyster
.solved
This thread was archived and locked by a staff member.
u have no idea how much uve helped me rn, take this - ๐น , tysm