#Application commands won't show up/update

1 messages ยท Page 1 of 1 (latest)

desert socket
#

You use prefixes commands, not normal bot

#

Just use discord.Bot

#

And holy fuck

#

how much imports

boreal wharf
#

yea ik

#

lol

desert socket
#

wtf is that

boreal wharf
boreal wharf
desert socket
#

They are not even optimised

#

bro

boreal wharf
#

huh

#

didn't really cared

desert socket
#

get help please

boreal wharf
#

chill im new

desert socket
#

you imported whole internet bruh

#

You probably don't need discord_webhook, interactions (if it's discord interactions), dhooks and much other stuff

boreal wharf
#

alright

#

thanks ig lemme try it

desert socket
#

Do you use ide?

#

You have so much unnecessary imports

stark oyster
#

Wtf that's not even Py-cord

#

That's dpy

desert socket
#

WAIT

#

๐Ÿ’€

stark oyster
#

Also, don't use requests library

#

And don't use threading with asyncio (especially if you are a beginner)

#

Also, read the guide

desert socket
#

Is that the only thing that bothers you?

stark oyster
#

.tag guide

tawdry anvilBOT
boreal wharf
#

yea i imported it by a mistake

stark oyster
desert socket
#

You can also just delete

intents = discord.Intents.default()
intents.messages = True
intents.guilds = True

Because you already use intents=discord.Intents.all()

boreal wharf
#

ah alright

#

wait

#

im dumb asf rn

#

because im tried

#

tired

#

idk what do

boreal wharf
boreal wharf
desert socket
boreal wharf
#

ah alright

desert socket
boreal wharf
desert socket
boreal wharf
#

bot = Bot(command_prefix='/', intents=discord.Intents.all())

#

like this?

stark oyster
#

discord.Bot

#

oh wait

boreal wharf
#

ah

#

what

stark oyster
#

do you want prefix cmds too?

boreal wharf
#

nope only application

stark oyster
#

ah

boreal wharf
stark oyster
#

then remove this command_prefix='/'

boreal wharf
#

alright

desert socket
boreal wharf
#

man its all indentation too, are there any plugins to save my ass?

#

everythings red

boreal wharf
#

bot = Bot(intents=discord.Intents.all())

stark oyster
stark oyster
#

not just Bot

boreal wharf
#

ah

boreal wharf
#

my bad

#

now its gone wait let me try it

stark oyster
#

also, show your pip list. it will be fucked up

boreal wharf
#

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'```
stark oyster
#

yep

stark oyster
boreal wharf
#

yea wait the message is too long

stark oyster
boreal wharf
#

yes smart

stark oyster
boreal wharf
stark oyster
#

those are different

boreal wharf
#

ah

#

fuck

#

my bad

#

sorry

stark oyster
#

py-cord is a fork of dpy. both have different implementations for slash cmds

boreal wharf
#

ah okay

#

but how do I fix this?

#

it doesn't show any application command. it's not even registred on discord.

stark oyster
#

ill tell you for py-cord

boreal wharf
#

alright

#

how do I do this?

stark oyster
#

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

boreal wharf
#

alright

#

do I need to rewrite my whole code then?

stark oyster
#

uh parts of it. most of the code is same for both the libraries

#

the main difference is only of slash cmds

boreal wharf
#

uninstalled it wait I install this other thing again

#

installed

#

what should I do now?

stark oyster
boreal wharf
#

alright

stark oyster
#

also, check the guide

stark oyster
boreal wharf
boreal wharf
stark oyster
#

any errors?

boreal wharf
#

"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

stark oyster
#

yes so you need @bot.command()

boreal wharf
#

ah alright

#

with that: () too?

stark oyster
#

ye

boreal wharf
#

alright

stark oyster
stark oyster
boreal wharf
#

ah alright

#

lemme try the command wait a second

#

ah fuck wait what should I replace threw interactions?

stark oyster
#

๐Ÿ‘€

#

wdym?

boreal wharf
#

like here

#

async def auth(interaction: discord.Interaction,

stark oyster
#

that can stay

#

wait

boreal wharf
#

but it says

stark oyster
#

no

boreal wharf
#

ModuleNotFoundError: No module named 'interactions'

#

ah

#

wait

#

I didn't looked at the line

stark oyster
#

the cmd should be async def my_cmd(ctx: discord.ApplicationContext):

boreal wharf
boreal wharf
#

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)"

stark oyster
#

it should be ctx

stark oyster
boreal wharf
#

ah alright

stark oyster
#

ctx.respond will also factor in defer and followups for you, so you can use it multiple times

boreal wharf
#

alright

boreal wharf
#

hey

#

if I try to run it it just says nothing in the console

#

so its not running

#

and the bot is not on

jaunty bear
boreal wharf
#

yea

jaunty bear
#

And its still not working?

boreal wharf
boreal wharf
#
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

jaunty bear
#

But you know basic Python?

boreal wharf
#

ahhhh

#

wait

#

I might found the error

boreal wharf
jaunty bear
boreal wharf
#

nope didn't helped

boreal wharf
#

I forgot it all

jaunty bear
#

Its the first rule in #help-rules

boreal wharf
#

ok?

#

but I still need help

jaunty bear
#

Its really easy to see what the problem is

boreal wharf
#

then tell me it maybe?

boreal wharf
#

@stark oyster

boreal wharf
#

nvm

#

fixed

young goblet
#

.solved

tawdry anvilBOT
zenith hill