#huh?

1 messages · Page 1 of 1 (latest)

vast bronze
#

why doesnt this work

import discord
from discord import *
from settings import *
activity = discord.Activity(type=discord.ActivityType.watching, name="Hydra")

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

@bot.event
async def on_ready():
    print(f"Logged into discord bot as: {bot.user} ID : {bot.user.ID}")

@bot.slash_command(name="ping", description="Replies with the bots ping.")
async def ping(ctx):
    latency = round(bot.latency * 1000)
    await ctx.respond(f"Pong! {latency}ms :white_check_mark:")

bot.run(token)

im new to python bot coding as i usually use js.

noble gull
#

remove the prefix at it

vast bronze
#
Traceback (most recent call last):
  File "c:\Users\jarex\Downloads\TOOLS\Jarexs Tools\HYDRA\hydrabot\bot.py", line 6, in <module>
    bot = discord.Bot(intents = discord.Intents.all(), activity = activity)
          ^^^^^^^^^^^
AttributeError: module 'discord' has no attribute 'Bot'

same err

noble gull
#

can you show the pip list pls

vast bronze
#
aioconsole               0.6.2
aiofiles                 23.2.1
aiohttp                  3.8.6
aiohttp-socks            0.8.4
aiosignal                1.3.1
aiosocks                 0.2.6
aiosqlite                0.19.0
anyio                    4.0.0
async-timeout            4.0.3
asyncio                  3.4.3
attrs                    23.1.0
blinker                  1.7.0
capsolver                1.0.7
certifi                  2023.7.22
cffi                     1.16.0
chardet                  3.0.4
charset-normalizer       3.3.2
click                    8.1.7
colorama                 0.4.6
DateTime                 5.3
discord-ext-slash        0.9.2
discord-py-slash-command 4.2.1
discord-webhook          1.3.0
Discord-Webhooks         1.0.4
dotenv                   0.0.5
exceptiongroup           1.1.3
fade                     0.0.9
Faker                    20.1.0
ffmpeg-python            0.2.0
Flask                    3.0.0
frozenlist               1.4.0
future                   0.18.3
gevent                   23.9.1
googlemaps               4.10.0
greenlet                 3.0.1
h11                      0.14.0
httpcore                 1.0.2
httpx                    0.25.1
idna                     2.8
imageio                  2.33.0
imageio-ffmpeg           0.4.9
itsdangerous             2.1.2
Jinja2                   3.1.2
licensing                0.41
markdown-it-py           3.0.0
MarkupSafe               2.1.3
mdurl                    0.1.2
multidict                6.0.4
Nuitka                   1.9.1
numpy                    1.26.2
ordered-set              4.1.0
Pillow                   10.1.0
pip                      23.3.1
playwright               1.40.0
pycparser                2.21
pydotenv                 0.0.7
pydub                    0.25.1
pyee                     11.0.1
pyfiglet                 1.0.2
Pygments                 2.17.2
pypresence               4.3.0
PyQt5                    5.15.9
pyqt5-plugins            5.15.9.2.3
PyQt5-Qt5                5.15.2
PyQt5-sip                12.13.0
pyqt5-tools              5.15.9.3.3
pystyle                  2.9
python-dateutil          2.8.2
python-dotenv            1.0.0
python-socks             2.4.3
pytube                   15.0.0
pytz                     2023.3.post1
qt5-applications         5.15.2.2.3
qt5-tools                5.15.2.1.3
requests                 2.31.0
rich                     13.7.0
roblox                   2.0.0
sellpass                 1.0
setuptools               58.1.0
six                      1.16.0
sniffio                  1.3.0
socks                    0
stripe                   7.6.0
terminut                 0.0.0.940
tk                       0.1.0
tls-client               0.2.2
typing_extensions        4.8.0
urllib3                  1.24.3
Webshot                  0.6
websocket                0.2.1
Werkzeug                 3.0.1
yarl                     1.9.2
youtube-search           2.1.2
zope.event               5.0
zope.interface           6.1
zstandard                0.22.0
tribal trail
#

Next time you create a post. Give it a useful title and provide the error. We aren't mind readers.

vast bronze
#

yeah sorry

noble gull
vast bronze
#

pip uninstall discord-ext-slash
pip uninstall discord-py-slash-command

vast bronze
noble gull
#

uninstall all of that

vast bronze
#

ok

noble gull
#

after that install py-cord-dev

vast bronze
#

still same err lol

#

now when i run in terminal i get this

noble gull
#

enable intents at the website

vast bronze
#

fixed shot bro ❤️

noble gull
#

.close

drowsy hatchBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @quiet stream.

Backup bot: </solved:1109625445990793246> (or .solved) with @drowsy hatch.

vast bronze
#

print(f"Logged into discord bot as: {bot.user} ID : {bot.user.ID}")

this id part isnt workin?

noble gull
#

Error?

vast bronze
noble gull
#

oh

#

.id

#

lowercase

vast bronze
#

ok thanks ❤️