#development
1 messages · Page 1188 of 1
like it explained in the docs
it's not our job to help man
the application has a generate oauth for you
you only need to do this once, you dont need code to fetch it everytime
Is it possible for someone to see my databases if I leak the URL?
News: A lot of people's mongodb databases got leaked
the application has a generate oauth for you
@opal plank how exactly
it says in the docs
i cant hold your hand for every step my dude
its way too much spoonfeeding
in your developer dashboard you have a generate token option
step one
you already skipping it
whitename
read whats literally below

im not gonna hold hands along the way dude
its explained in it
xD
you just not reading it
ive given you a guide on how to get your token, the user endpoint with the parameter and headers needed, and the endpoint to get your follows. Last thing left for me to do is code for you
¯_(ツ)_/¯
Really? Lol
yeah
i didnt thought it will work
how does this remind me function works, how to know which user selected to remind?
even though twitch api is notorious for having some random shit that dont work and i have to do open requests to get them to fix, its usualy retarded to assume 'i thought the docs wouldnt work'
well, i am new to this thing~
how can you change the background color of a server in top.gg server list?
how to do "live stream notifications on Twitch"
how to i put header on axios?
well, i am new to this thing~
how can you change the background color of a server in top.gg server list?
@earnest phoenix css
use CSS in the long description
should i store OAuth tokens on mongodb atlas

is it encrypted?
not sure
no
then no*
storing sensitive data without encryption, bad bad bad bad
i'll slap another bad just in case
bad
bad
Imagine not encrypting your data... totally not relatable
you should store the entirety of topgg in a quick db and make it openly available

just store the rows that has sensitive data
or collums
well, im assuming the schemas works similarly to what postgres has
tuples/rows/columns
i store my password in an env file
not password
don't yoi need the password to see the databases
alrighty
|username|oauth token|
|erwin | 126792148|
downloading cryptojs
your database should likely alreayd have encryption
in postgres once you request that data, you need a token to decrypt the oauth token field
should i use sha256 or aes wtf sha256 is a hash function not an encryption one
its been a while ive set it up
on postgres theres a whole deal around it
i also use ssh tunneling, so its even harder to grab something on my end
ssh tunneling???
yeah the database is local and cant be cnnected from the outside
you need to ssh tunnel inside first and query locally to grab the stuff
thats one step more in security
does mongo have built in encryption
How do I use header on axios
@opal plank how do I do step 2?
curl -H "Authorization: OAuth <access token>" https://id.twitch.tv/oauth2/validate
how do i do this with axios?
check axios documentation dude
i told you i cant hold your hand all that way
you need to learn how to properly read the docs
How to set bot have 2 prefix, like default prefix and general prefix
database + cache
cache the prefix and dump it into a database for persistent
on every message just check if message starts with (fetch guild prefix)
hmm
i know that
i need to give my bot a multiple prefix
if (message.content.startsWith(prefix) || message.content.startsWith("hey")
thats literally what i told you
on every message just check if message starts with (fetch guild prefix)
then just check for both prefixes
ive read it and I saw nothing about header
its error
if (!(message.content.startsWith('a') || message.content.startsWith('b')) return;```
¯_(ツ)_/¯
@carmine summit you havent read it then, cuz the whole point of axios is http request with headers and parameters
hmm
baseURL: 'https://some-domain.com/api/',
timeout: 1000,
headers: {'X-Custom-Header': 'foobar'}
});```
Thx

curl, axios, winget, fetch, nuget, request, cheerio, snakefetch
dealing with api's isnt for anyone
uh
you need to have a basic knowledge of http requests
I dont know
how to i get my oauth2 token?
please help me my brain already spinning
i dont wanna die early
how can i get the information of an invite by using the invite code
like uses, creator and stuff
how do i make a loop for an array?
Is there a thing in javascript that you can like await a message sent in CONSOLE, the like visual studio console if you are running a node app. like if i sent: consoleTest it will reply with: "yES"
if there is a function send me how to use it (can be a video or website that explains it)
@fossil oxide I need help
TF
pls help me
why do you need oliy
You are not supposed to ping him lul
ok
Hi
https://github.com/GagePielsticker/Express-API-Boilerplate any advice on things to add/security concerns much appreciated
do I need to set up dbl api before approval
no
can I?
oh ok thanks Jly
Hello
I need help with smth
I make a Streaming Status
Wait...
function randomStatus() {
let status = ["Discord Bot", "Youtube", "Discord", "Glitch", "Node.js"]
let rstatus = Math.floor(Math.random() * status.length);
client.user.setActivity(Status[rstatus], {type: "STREAMING", url: "https://www.twitch.tv/bogscam"});
}; setInterval(randomStatus, 30000)
console.log('Logged in as BOGSCAM!');
})```
This is my code terminal says that it is online it is online but it has no status
@earnest phoenix the let rstatus = math.floor
the math.floor has to be status
So what should I fix?
and the brackets or so ()
have to be []
change Math.floor to status
just replace it
Pls send the code with the coreect code
no
ReferenceError: Test is not defined
at Timeout.randomStatus [as _onTimeout] (C:\Users\User\Desktop\BOGSCAMs Ultities\index.js:9:21)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
Read pins
cough no spoon feeding
we won't spoon feed you, we're giving you good advice
This is the error
it says what is the problem lol
read
and the problem isnt even in your status stuff
I want to build a CLI system but i want it to work while running like Inquirer.js
Is there anything in vanilla javascript for that too?
or (node.js)
I mean I doubt many people tried building a cli in raw js
don't know if you even get access to props like console.stdin
hmmm
you could try i guess but without packages it might be a hassle since read line isn't in js
readline aint files?
you can use readline (native nodejs module) to read the next line in the terminal and return it to you
though I'd promisify it before use to avoid callback hell
k
Is there a thing in javascript that you can like await a message sent in CONSOLE, the like visual studio console if you are running a node app. like if i sent: consoleTest it will reply with: "yES"
@surreal sage process.stdin
Bruh There are people in my dms asking to make bot for them for free
should i report them in #support
can bots publish messages?
To announcement channels you mean?
i dont know bout that one
can someone please help me?
To announcement channels you mean?
@earnest phoenix yes.
Not yet
@waxen cloak What's the issue
How to know if user has opted to remind for vote after voting
That's not possible to know
Setup a webhook that emits when a user votes as it has a vote event and set a timeout to remind that user on that time
ok but if user selects not to remind ?
That's not possible to know
discord.js?
yes
You can set them up in the clientOptions of the client
ok
oh
yeah
ok
if (verifyPlayer == toVerify) {
message.channel.send("verified")
const role = guild.roles.cache.find(role => role.name === 'Guild Member');
const member = message.mentions.members.first();
member.roles.add(role);
return
}```How do I define "guild"?
message.guild?
what guild do you want to get? message's?
message.guild in place of guild .. []
depends
message.guildin place ofguild .. []
@orchid vortex depeneds on what he wants
umm
in this case up there at guild.roles he means message.guild.roles
just replace this line
const role = guild.roles.cache.find(role => role.name === 'Guild Member');
with
const role = message.guild.roles.cache.find(role => role.name === 'Guild Member');
if (verifyPlayer == toVerify) {
message.channel.send("verified")
const role = guild.roles.cache.find(role => role.name === 'Guild Member');
const member = message.mentions.members.first();
member.roles.add(role);
return
}```How do I define "guild"?
@carmine summit
And. u should add verified message at the end in try catch block
bruh you sent the whole line of code lmao
did you replace guild with message.guild?
bots can now mention all roles with that permission?
idk yes most likely
yep
ok, thanks
if (verifyPlayer == toVerify) {
message.channel.send("verified")
const role = message.guild.roles.cache.find(role => role.name === 'Guild Member');
console.log(role)
const member = message.mentions.members.first();
console.log("success")
member.roles.add(role);
return
}```
if the role exists and they mentioned a member that is
huh
I have a problem with my yunite, someone can help me ?
TypeError: Cannot read property 'roles' of undefined
@orchid vortex
oh waitttttttttttttttttt
i should change to autho
im coding a bot for myself with discord.py
a simple bot
for example giving avatar or user info and ...
can you guys give me the code for getting avatar from bot and getting users info?
Thanks 😄
@carmine summit
if it doesnt find a mention, then just return a message saying
"give me a mention, idiot"
yeah but you cant just verify yourself if youre verified
and have perms to use the bot
yeah but like
make it so it requires a mention
ah so you want it to verify the author
yes indeed message.author
how
ok ok lemme try
should work
because author returns User
and member returns GuildMember
@carmine summit
you cant assign roles to a User
only to GuildMember
what is the code to make the bot status and game in discord.js bots
Is that right?
client.on('ready', () => {
console.log(`----------------`);
console.log(`Desert Bot- Script By : Salah_Ken`);
console.log(`----------------`);
console.log(`ON ${client.guilds.size} Servers ' Script By : Salah_Ken ' `);
console.log(`----------------`);
console.log(`Logged in as ${client.user.tag}!`);
client.user.setGame(`Hello Word!`)
client.user.setStatus("online")
}); ```
Is this right code?
the S and the K and the I and the D
if its right or no
Alr
depends on discordjs version yknow
Ok didnt think of that, but he should use discord.js v12 anyway 👀
k
Is this practical enough?
// Creating array variables so it doesn't return undefined when we try to `.concat()` it.
let sentences = [];
let temp = [];
// Loops every args
for(l=0;l<args.length;l++) {
// Adding the args as an array to the `temp` variable.
temp = temp.concat(argss[l])
// If we meet `|` which is a sentence separator.
if (args[l] === "|") {
// Join the `temp` array, making it a sentence while removing the `|` operator.
sentences = sentences.concat(temp.join(' ').slice(0, -2));
// Resetting `temp` to reset the saved sentence and start a new one.
temp = [];
}
}
Owh, I can do that? Wow I'm so dumb
Thx btw
I had no experience so I do things the hard way xd
The code you provided is also valid!
Thx
I take that back
Still, the results kind of have spaces along them @cinder patio
[
'Say hi ',
' Sp ',
' say ',
' ajfse s fse fs ef se f ',
' sjnfjwbfiesfnsd'
]
add .map(x => x.trim())
a loop for that is a bit too much
join(" ").split("|").map(x => x.trim())
you might want to filter blank ones too by using filter()
My .env file randomly decided to stop working
This is the content of the file:
TOKEN=botTokenNoSpaceAround=
MONGODBPASS=myMongoDBPasswordForTheUser
It was working fine yesterday, today it ain't working but returning undefined whenever I put process.env.smth in my code. HELLLLLLLLP
I declare it like so:
DISCORD_TOKEN = 'mytokenhere'
And use it like that:
client.login(process.env.DISCORD_TOKEN).catch(console.error);
Declaration:
const dotenv = require('dotenv').config();
I declare it like so:
DISCORD_TOKEN = 'mytokenhere'And use it like that:
client.login(process.env.DISCORD_TOKEN).catch(console.error);
@nimble kiln wtf glitch said no spaces around=
lemme try
Works on every config entry ¯_(ツ)_/¯
spaces shouldn't matter
dotenv installed?
Uh no that stuff has to go in .env
and allow anyone to peak at my tokens
@earnest phoenix O yes good idea 😄
I mean, if you publish your code on github then discord will yeet your active token the second you commit/push/whatever i dont use git
When you spend ten hours trying to figure out why your .env isn't working and then you find this in your expressjs code:
please don't star me
i'm not dumb enough
That prevents dotenv from working? 
I mean, if you publish your code on github then discord will yeet your active token the second you commit/push/whatever i dont use git
@nimble kiln then make sure you put your .env or something in the .gitignore
@nimble kiln then make sure you put your .env or something in the .gitignore
@faint prism yeee I know, was referring to code913's statement about peaking his tokens
actually that wasn't the error
hello
does anyone know where I can get some links like AlexFlipnotes API stuff? https://api.alexflipnote.dev/scroll?text=yeet
this stuff^?
like not specifically Alex flipnote any like that would be fine
Hi, my server shows that the bot is not on the network, what should I do?
TypeError: message.guild.members.filter is not a function
ummm
message.guild.members.filter(m => !m.user.bot).forEach(member => member.addRole(role))
ohhhhhhhhh
@hollow stratus what happened
tysm
tysm
@carmine summit welcome also cache is considered common sense in d.js v12 soooo
you don't have common sense lol
@earnest phoenix I invited the bot to the server and he is not on the network
why don't people have common sense
dudddde
it is offline
because
the process is not running
stop pinging me asking to explain common sense
Start your process
^
wait, which issue we fixing here? the code or the english?
What language do you use for coding?
Yes @opal plank
@hollow stratus what coding Language do you use?
code
assembly?
haskell?
kotlin?
go?
damn i can't make it
binary?
C++?
whatsup gamers
C?
portuguese?
lmao
Russian?
we gooing for a while
i'm about to press alt + f4
Russian?
@golden condor +
what language do you use to code your bot?
no i was pointing out that i said shot lmao
boop closes Discord tab
oh i see
This is translator(
what language you speak?
kore wa translator?
looks russian os lovak
so what should I do about it?
Install it
@hollow stratus Na kakom yazyke govorish'?
на каком языке вы кодируете своего бота?
@opal plank Русском
???????????????????? what are you all doing

@opal plank Russkom
and why speak russian here
idk, i dont know russian either
Какой язык программирования вы используете?
o
just tryna help
callum bruh
Idfk
what code for java script changes the bots status
fyi russian isnt 1 -1 with english
ik
@golden condor я добавил через интернет этого бота а он не работает
oof I have a problem on the god damn status and activity
setAcitivty() @tropic gulch
@Callum I added this bot via the Internet and it does not work
@golden condor я не програмист
k
when I go to the code
@tropic gulch 
dude go to #memes-and-media
@Callum I am not a programmer
3 minutes it goes
can
you
not
talk
like
this
uh
we
lie
stop
like
please
this
okay, for real, cease
please kill me
aaaaaa
hey hey dont touch me there this is my no no square
ehhh problem on the status and act, when I go to the code and do a new status, it shows, but like 3 minutes ago it goes, how to fix?
Set an interval?
this is my no no square
@orchid vortex @earnest phoenix shitpost in #memes-and-media
Set an interval
that isnt a shitpost
this is development related
its about development
my bot suddenly started showing these
'dont touch my nono square'
and that only happens when something is "undefined"

nvm fixed it
bismillah, what a mess
just stop
Here is the code
a
the problem on it like i said
none of my concern but you can do multiple lines when console logging marcsus
"Y O U R C O M M A N D S"
also why multiple ready events?
when I do like a new status or act, it shows in the bot's, but like 3 minutes ago it goes
also why "Your Commands" up there
upgrade to v12
and try setActivity()
at this point you shouldnt be running v11 anymore, its deprecated
problem is I don't know how to upgrade on glitch website
my project is all on glitch website
@earnest phoenix https://discordjs.guide/additional-info/changes-in-v12.html
just change your code and reupload
¯_(ツ)_/¯
anyhow, back to minecraft
But how do I upgrade it and the coding is generaly from a website
@earnest phoenix im assuming you CODED your bot and didnt copy it from somewhere
problem is I don't know how to upgrade on glitch website
@earnest phoenix go to package.json and send pic
@earnest phoenix no code, no help
¯_(ツ)_/¯
i cant guess what you are doing on your code
my future sight is only limited to lottos
lines = require('lines-js');
format = lines()
//horizontal
.line({
from: [0, 5],
to: [30, 5],
style: 'bold'
})
.line({
from: [0, 10],
to: [30, 10],
style: 'bold'
})
//vertical
.line({
from: [10, 0],
to: [10, 15],
style: 'bold'
})
.line({
from: [20, 0],
to: [20, 15],
style: 'bold'
})
let embed = new MessageEmbed()
.addField("Tictactoe", `
\`\`\`
${format.toString()}
\`\`\`
`)
message.reply(embed);
@opal plank just the first line in the embed
before reply
huh ?
add console.log(format)
i did
and run command again
it is good
show me console
actually i think it might be toString() thats formatting it
do console.log(typeof(format))
@earnest phoenix that's discord.js v11
why is that an object though?
but this is the problwem
well yeah, thats what i meant
dont think so
why not just slice if it's only the first row
work around but definetly not the solution
wondering how ppl make tic tac toe game : /
canvas would make it a lot simplier i assume
no
what will happen if I do?
You could do tic tac toe with emojis
you can't
not now
no
on my bot
Guess what?
wut
that totally helped [@delicate shore]
ikr
@pale vessel can u give a example to make a line with canvas
then i figure out how to another lines
There's the lineTo method
on the context object
Maybe you should you know do some research before asking someone to teach you
then i figure out how to another lines
@earnest phoenix moveTo(x1,y1)
lineTo(x2,y2)
Can someone help me
How to change role name in discord.js v12
Do anyone know how can I make my discord bot send a message when I am live on Twitch?

no one answered my question 😔
someone knows how can i make that when i create a channel its will link the channel i made? (like the picture)
events
@pale vessel but how can I make an event to announce it?
😩
only way i can think is either check your twitch often(which is what i would go for) or use guild presence updates
¯_(ツ)_/¯
@earnest phoenix that's discord.js v11
@delicate shore ikr
regarding the twitch api, erwin
you sure you don't need oauth?
i needed client credentials flow
where do you get the bearer token then
thats your token
🥳 🥳 🥳 🥳 🥳 🥳
My bot got verified today
Also it hit 700 guilds
@pale vessel
is there a way to make my bot status dnd?
look at my configs
d.js
you should only need token for most things that you'll likely be doing
yeah
there are some api endpoints that require it
but the common ones only need token and id
twitch api is janky af
why do they use query parameters for oauth
wanna see something else thats hella good?
yes
LMAO
nice docs
guess what?
the snippets dont work either
cuz they dont have token
will return 401
unauthorized
that announcement broke my command
glitch is bad
but at least it was an easy fix
read docs
oh
can u link one as i can't find em
@sharp thicket what's the launguage that your using
discord.js
amazing
thats the main reason i disencourage people from using twitch api
use setActivity or setPresence in v12. client options work too
this shit is a minefield
is there anything better anyway
do as little requests as possible
Damn
i have two requests per command, one for user, one for followers
im doing a bit more complicated stuff and even after working with that api for almost a year im still getting hiccups here and then
im implementing a library cache for the channels
indeed
Anyone know how to let glitch website into the new version? cuz i have discord.js vs11
what category is setActivity in?
npm upgrade?
update*
I can update it Into glitch.com?
ik but in the docs
The site glitch let us update the version?
ty
doesnt upgrade upgrade npm?
it's an alias iirc
:/
so like
dnd
DO_NOT_DISTURB
not DND
oh
dnd
why am i dumb ;c
no your not
we all are
lol
welcome to programming 101
👀
where we create problems, get frustrated at them, try to fix them, cry, fix them, and then create more problems. #DevLife
my bot still says online e.e
const { Message, send } = require("discord.js");
let config = require('../../config.json')
module.exports = (bot) => {
console.log(`${bot.user.username} is now online!`);
bot.user.setActivity(`With Avio Developers | ${config.prefix}help`,type: 'dnd' })
};
wait letmee check
k
12.2.0
it removed the text too e.e
what text?
Umm
bot.user.setActivity(`With Avio Developers | ${config.prefix}help`, { type: 'dnd' })```
thats my code..
The thing is Im using discord.js version 1.0.0
what
what 2
bot status
version 1.0.0
discord.js version 1.0.0
@sharp thicket where did you put that
in my event file
ready event?
it worked before
yes
const { Message, send } = require("discord.js");
let config = require('../../config.json')
module.exports = (bot) => {
console.log(`${bot.user.username} is now online!`);
bot.user.setActivity(`With Avio Developers | ${config.prefix}help`, { type: 'dnd' })
};```
what do i do e.e
"name": "simple-music",
"version": "1.0.0",
"description": "Simple shitty music",
"main": "server.js",```
that's my version
1.0.0
yikes
ikr
any help?
@sharp thicket
elaborate
ehhhhh ooff
const { Message, send } = require("discord.js");
let config = require('../../config.json')
module.exports = (bot) => {
console.log(`${bot.user.username} is now online!`);
bot.user.setActivity(`With Avio Developers | ${config.prefix}help`, { type: 'dnd' })
};```
@sharp thicket
thats not d.js version
damn
so? @sharp thicket
my mistake
to check discord.js version, run: npm ls discord.js
12.2.0
Hello I want to ask how i have to make roles underline
is killing me
@summer torrent so?
im telling to Marcsus
you can underline stuff by adding underscores around it: __like this__
test
whats wrong with this code tho?
bot.user.setActivity(`With Avio Developers | ${config.prefix}help`, { type: 'dnd' })```
hm
so how do i set it
these are activity types
oh
tim did you used grafana before
how do i set it to dnd then?
status: 'dnd'
so insted of type
@summer torrent no i havent
does this serv have no owner?
it does
wtf
guild owners are not guaranteed to be cached
bot.user.setStatus(Playing With my devs, {status: 'dnd'})
ah
it is uncached @violet haven
would that work?
bot.user.setStatus(
Playing With my devs, {status: 'dnd'})
would this work?
how to show it then
you need to fetch it
no no
use .ownerID to fetch
.fetch()?
@sharp thicket setStatus doesnt accept text, only status
oh
bot.user.setStatus("dnd")
oh
client.user.setStatus("dnd");
no no
that's mine
so can i set the activity first?
if its client then its client
if its bot its bot
how did you define your "new Discord.Client()"
mine is client so client
setStatus and setActivity are separate, so either you use both or use setPresence
can u hellp me about the fetch?
bot.user.setActivity(`With Avio Developers | ${config.prefix}help`)
bot.user.setStatus("dnd");```
setPresence supports all of them at once
bot.user.setGame(`Whatever you want`);
@violet haven ```js
let owner = await guild.members.fetch(guild.ownerID);
const DBL = require("dblapi.js");
const dbl = new DBL('my_token', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});```
thx
TypeError: Cannot read property 'on' of undefined```
@glacial sun check the webhook example
dbl.webhook requires a webhookPort or a webhookServer to be defined in the dbl options
my bot still has no stattus
and it isn't on dnd
bot.user.setActivity(With Avio Developers | ${config.prefix}help)
bot.user.setStatus("dnd");
thats my code e.e
As he said
What these errors mean? And how can I fix it? I am making the prune command
That's the Activity type
im not using activity for the dnd
bot.user.setActivity(`With Avio Developers | ${config.prefix}help`)
bot.user.setStatus("dnd");```
@glacial sun Did you post your dbl token? #development message
bot.user.setPresence
@earnest phoenix you have discord on your PC. To take a screenshot, click bottom right square of screen, click on "snip", draw a square for the picture, and paste in discord
or windows + shift + S
if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have the permissions to do this!")
if (isNaN(args[0])) return message.channel.send("Please input a valid number!")
if (args[0]> 100) return message.channel.send("Insert the number less than 100!")
if (args[0] < 2) return message.channel.send("Insert the number more than 1")
message.channel.bu1kDelete(args[0])
.then(message => message.channel.send(`Deleted ${message.size}/${args[0]} messages!`)).then(d => d.delete({timeout: 10000}))
.catch(() => message.channel.send("Something went wrong, while deleting messages!")
}```
This is my code
at wrapSafe (internal/modules/cjs/loader.js:1053:16)
at Module._compile (internal/modules/cjs/loader.js:1101:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47```
And this is the error
how do i show flags
@earnest phoenix
Thnx
@violet haven user.flags
Still no
Now there are 2 errors
SyntaxError: missing ) after argument list
at wrapSafe (internal/modules/cjs/loader.js:1053:16)
at Module._compile (internal/modules/cjs/loader.js:1101:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
anyone good at writing secure express api's?
if so dm me
ReferenceError: message is not defined
at Object.<anonymous> (C:\Users\User\Desktop\BOGSCAMs Ultities\index.js:28:1)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
@quartz kindle what does this mean?
message is not defined
You probably defined it as msg.
Show us your message event and we can see.
@quartz kindle do i need to delete the fetch?
it means the name message doesnt exist because it has never been created
^
how can I create it?
you already created it
Message = "message"
is not = is not.
defined = not created, it doesn't know what "message" is.
Show us your message event @earnest phoenix and then we can see what you defined it as.
@glacial sun Did you post your dbl token? #development message
@faint prism Yeah
@violet haven wdym delete the fetch?
const client = new Discord.Client();
const PREFIX = "b!"
client.once('ready', () => {
function randomstatus() {
bot.user.setStatus("dnd");
let status = ["BOGSCAM", "Prefix = b!", "Golf Blitz", "BOGSCAM's Cave"]
let rstatus = Math.floor(Math.random() * status.length);
client.user.setActivity(status[rstatus], {type: "STREAMING", url: "https://www.twitch.tv/bogscam"});
}; setInterval(randomstatus, 600000)
console.log('Logged in as BOGSCAM!');
})
let memberlog = "737658405296144510"
client.on("guildMemberAdd", member => {
if (member.guild.id !== "737658404868194365") return;
client.channels.cache.get(memberlog).send(`Hello and welcome to the **${member.guild.name}**, <@!${member.user.id}> !!!`);
member.roles.add("737658404868194366");
})
if (message.startsWith(prefix + prune) || message.startsWith(prefix + purge)) {
if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have the permissions to do this!")
if (isNaN(args[0])) return message.channel.send("Please input a valid number!")
if (args[0]> 100) return message.channel.send("Insert the number less than 100!")
if (args[0] < 2) return message.channel.send("Insert the number more than 1")
message.channel.bu1kDelete(args[0])
.then(message => message.channel.send(`Deleted ${message.size}/${args[0]} messages!`)).then(d => d.delete({timeout: 10000}))
.catch(() => message.channel.send("Something went wrong, while deleting messages!"))
}```
the toARRAY sry
This is my code
you dont even have a message event wtf
How do I reward someone for voting?
@earnest phoenix You don't have a message event.
client.on("message" you need
(don't copy and paste the code, I just started off the line so you know where to check in the documentation)
@violet haven what you have is correct, no need to delete anything
Where should I add it?
but its not showing what i want @quartz kindle
what do you want?
That means Im using package.json not discord.js right?
anyone have a better command system than
const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
? I only realised now that if my prefix was dbr!, then even aaaa would register...
Above this: if (mes.........
This is basic stuff, you need to research and use docs if you aren't sure. @earnest phoenix
@earnest phoenix package.json is the package manager file, it contains a list of packages that your project needs. discord.js is one of the packages that your project needs, it will be listed in the dependencies section of your package.json
The message event is well documented.
@violet haven discord doesnt give you the icons
if (message.startsWith(prefix + prune) || message.startsWith(prefix + purge)) {
if (!message.member.hasPermission("MANAGE_MESSAGES") || !message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You don't have the permissions to do this!")
if (isNaN(args[0])) return message.channel.send("Please input a valid number!")
if (args[0]> 100) return message.channel.send("Insert the number less than 100!")
if (args[0] < 2) return message.channel.send("Insert the number more than 1")
message.channel.bu1kDelete(args[0])
.then(message => message.channel.send(`Deleted ${message.size}/${args[0]} messages!`)).then(d => d.delete({timeout: 10000}))
.catch(() => message.channel.send("Something went wrong, while deleting messages!"))```
}
Like this?
No,
so how
Hey, someone knows how to code bot with python?
Once again, use the docs to help you @earnest phoenix
i saw many bots displaying em
discord gives you which flags the user has, up to you to decide what to do with them, for example map them into custom images or custom emojis
```js
code
```
ok?
@earnest phoenix package.json is the package manager file, it contains a list of packages that your project needs. discord.js is one of the packages that your project needs, it will be listed in the
dependenciessection of your package.json
@quartz kindle
This is my dependencies in package.json
ah yes ur right
I am invisible!!
i'll do that
Pls tell me cause I must eat now and I wanna finish the command before eat
@earnest phoenix yes, and there is your discord.js
You know events anyway, @earnest phoenix unless you copy and pasted code, if so then you know nothing.
client.on("guildMemberAdd", member => {
//event on guild member add
})
so just replace it with message.
oh right
We aren't going to spoonfeed you,
you need to also learn yourself, else you can't improve.
a l l t h e ba dges
I am finally invisible because of my hardwork!!
?



