bot won't get on and connect to discord.
hi, my bot won't turn on. i've coded a lot of bots before with sapphire and they worked just fine, decided to make a new project, coded the structure and everything good but when i run my
"yarn watch:start"
- "watch:start": "tsc-watch --onSuccess \"node ./dist/index.js\""
it just won't turn on.31 Replies
@Favna should i show you my extended client's code or?
sure more info is always better
When asking for help, make sure to provide as much detail as possible. What have you tried so far? Do you have stacktraces that you can show us? What are you trying to achieve? Try to answer these questions and others, so we do not have to ask for them afterwards.
❯ For a good guide on how to ask questions, see the instructions that StackOverflow gives. You should try to always follow these guidelines. ❯ For an excellent video that shows how not to ask technical questions is this, watch this YouTube video by LiveOverflow. ❯ Asking technical questions (Clarkson) ❯ How to ask questions the smart way (Raymond)
Bot.ts
this.login()
cause i use .env
which is inside the src
folderyou don't have any
super.login()
and having env in src is not a reason to have any of that. Look at some of the example bots:
@Dragonite, @Gemboard for example
in fact I see no reason at all to have a custom client there
Exact same code, but without completely unnecessary extended client
Also it should be noted that you didn't add the Message Content
intent... so yaknow... before you write message commands and you need to make another post saying they dont work.@Favna what do you mean lol, i want to build a bot with custom stuff, that's why i extended
SapphireClient
you dont have custom stuff there
and any custom properties you need can be defined outside of the client scope
i.e. on the container scope
i've got
./lib/setup.ts
filewhy would you subject yourself to
container.client.customProperty
instead of container.customProperty
well not yet
my
setup.ts
file is this @Favna :
i prefer creating my own extended client, it's not about thatwell then you also fix your own issues :) :) :)
i've got
this.login()
last I checked
this
is not the same as super
but maybe my dictionary is wronguh
should i change
this
to super
?sorry to be a bit of an asshole about it but if you want to ignore my recommendations then I don't see much reason to provide proper help either
no i am not ignoring
yo again, it does log into discord bot seems like my
ready.ts
isn't loading
nor any of my listeners
don't know what i doing wrong tbhdid you read the big red block at the start of the guide: https://www.sapphirejs.dev/docs/Guide/getting-started/getting-started-with-sapphire
Sapphire Framework
Getting started with Sapphire | Sapphire
To install Sapphire, you need to install both discord.js and
cool, it works
thanks man!
got question
what are
interaction-handlers
and how can i use those?Sapphire Framework
What are they? | Sapphire
These are interaction handlers! A simple class you can extend to handle almost all the interactions you may receive in
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
do i still have to use eg:
@Favna ?
and
chatInputRun()
?
or there are any other methods?read our guide
okay
this 1?
we didnt write it for it to be ignored smh
yep i know
How about you try to find it yourself for ac hange
instead of asking to be spoonfed links
there are many guides, just asked if you could point out which one to read lol
there aren't many guides. There is one guide. With pages that you can navigate by clicking on them with your mouse cursor.
I assume you have a mouse cursor
it was invented in 1967 after all
dude it's fine, i'll just go through it
rofl