#development
1 messages · Page 512 of 1
my commands things at the top is just a command handler
so what message is it saying 30 times
my event listeners are at the bottom

when a user joins
or leaves
or channel created or deleted
basically just the event listeners
are those event listeners within on message
when a user joins the message it sends
i can't tell with the indents
Yeah, those are within on message
Which in theory, it will register the listener every message it receives
Creating duplicate listeners
idk how I can fix that
don't register events within another event

i recommend cleaning up that code, and use 4 space indent
omfg
@amber stone you are registering a new event for guilkd member add, remove and channel create/delete every message 
never do that pls
u should have got a warning that you have too many event listeners... jesus christ
i remember someone who made a client in their command when using a cmd handler
every message you send register a new webhook, send the message through that, then delete the webhook
Why delete it though
so you can make more webhooks
alternatively you can make a github repo, make a webhook for that repo on discord, push a commit with the message being what you want to send, then delete the repo and the webhook
Anyone know how to use glitch?
Ehh somewhat
$ node index.js
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3000
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at Function.listen (/rbd/pnpm-volume/c127384d-4c47-4f9b-b102-97459c96273a/node_modules/.registry.npmjs.org/express/4.16.3/node_modules/express/lib/application.
js:618:24)
at Object.<anonymous> (/app/index.js:12:5)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (modul``` This is the error
Lib?
discord.js
change your port your using
const http = require('http');
const express = require('express');
const Discord = require('discord.js'); //Discord Package
const bot = new Discord.Client(); // The Client
const PREFIX = "-";
const app = express();
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 280000);
bot.on("message", function(message) {
if(message.author.bot) return;
if(message.channel.type == 'dm') {
return message.channel.send(":smirk: | **You cannot do commands in PM's!**")
}
if(!message.content.startsWith(PREFIX)) return;
var args = message.content.substring(PREFIX.length).split(" ");
switch (args[0].toLowerCase()) {
case "test":
message.channel.send("hello")
break;
}
});
bot.login(process.env.TOKEN);``` This is my index.js
const express = require('express');
const app = express();
// we've started you off with Express,
// but feel free to use whatever libs or frameworks you'd like through `package.json`.
// http://expressjs.com/en/starter/static-files.html
app.use(express.static('public'));
// http://expressjs.com/en/starter/basic-routing.html
app.get('/', function(request, response) {
response.sendFile(__dirname + '/views/index.html');
});
// listen for requests :)
const listener = app.listen(process.env.PORT, function() {
console.log('Your app is listening on port ' + listener.address().port);
});
``` server.js
what's process.env.port
Not sure lol, I''m following the anidiots guide but it dosnt say what to fill it in as
Oh I used his guide to help me setup
lol
const listener = app.listen(301, function() {
console.log('Your app is listening on port ' + listener.address().port);
});
``` like that
# store your secrets and config variables in here
# only invited collaborators will be able to see your .env values
# reference these in your code with process.env.SECRET
SECRET=
MADE_WITH=
TOKEN=JzUzOHTxODYwOTA9OTY2NDY0.BI3K3w.NN1Gvsl7CSh2IYIEUJDJAFejH4w
# note: .env is a shell file so there can't be spaces around =
My current env above
a token
a fake one
I was bout to say, never seen a token look like that
its honestly so cool that I can ask a question about groovy lang and have one of the lead maintainers answer it 😍
What should i have run
do you need an express server? are you running a web dashboard or a website?
if not, just remove it
I have a really weird issue. I completely remade my bot, @icy lichen. It works perfectly well with the dev bot's token, but it breaks if I use the actual bot's token. It can read messages, but it can't see commands. How is that even possible?
It's here btw.
that code hurts my eyes, but check permissions
make sure nothing else changes, it's exactly set up the same
I found the issue. And it happened because of my stupidity.
The way I trimmed off the prefix was message.content.slice(1)
so it didn't work with a 1+ char prefix
so uhh fixed it lol
Also I'll try to clean up the code.
Probably only the join/leave messages and make the bot.on("message" thing look not horrible
You haven't seen the old bot.
https://gitlab.com/BarkingDog/barking-bot
This code will make you want to shoot me
Everything about this repository is wrong.
does it have semicolons
the old one - yes. And even in places where you don't need them. And the new one has 0 unless I accidentally put 1 or 2 somewhere.
The old bot was my first ever js (or even programming) project.
then put them in the new one pls
they're useful
if you're writing code in 1 line.
no

Why use semicolons when they do absolutely nothing?
Semicolons 
I know there are cases when you'd need a semicolon, but there are no such cases in my bot.
Not even 1.

consistent code style always
some people be like "well its just one line after my if, why add {}
but when you start mixing style ur code just turn into a clusterfuck
and js is already bad enough
the only style mixing i do is that i keep short ifs in one line, and long ifs in multiple lines xD
being consistent is key to good code
if(short) { dosomething(); return; }
if(long) {
dosomething();
dosomethingmore();
return;
}```
i follow a modified xo code linter
My code is consistent. It has exactly 0 semicolons in it.
if (short) {
return dosomething()
}
if (long) {
dosomething()
dosomethingmore()
return
}
@quartz kindle
i dont want to return dosomething(), i want to dosomething() then return nothing
but yeah, i prefer using semicolons
it has a semicolon 
foo()
const arr = [1, 2, 3]
arr.forEach(bar)
That's what I'd do.
the second option is absolutely disgusting hello yes
well, yeah, but why allocate a new variable if you dont need to?
To not use semicolons
Should you use semicolons when writing JavaScript? Explores why omitting semicolons can be bad and why I have chosen to not use semicolons when teaching Java...
“I put semicolons in my JavaScript because without semicolons, it’s not valid C/C++/Java/Whatever.” If you have to write a bunch of Java or C code in a project, and want your JavaScript to not look too different, then that is a valid concern. (Cassis takes this approach to its absurd end.)```
I used to think this way too @heady zinc . I've changed.
Semicolons are disgusting to me now.
im having a hard time seeing how you could not like them, they explicitely determine the end of a statement too, it's extremely useful
i write js and php, and in php if you forget a single semicolon it will throw a fatal exception lmao
php 
so im not gonna go around writing in different styles for different languages xd
why not, consistency is overrated anyway
how do I make my bot dm everyone?
I won't even bother with y'all. Semicolons are disgusting. eod.
you don't.
you dont,
in python
You don't.
thats api abuse and will get you banned

I bet they'll go look for ways to do it anyway
well, its not hard anyways
pie
reported
This might actually be grounds for account termination. Not like I'm dedicated enough to report someone
Possibly. As I said, I am not dedicated enough to report someone lol
if you're dming everyone announcements and such, why not do it in a channel? Bot updates? Also do it in a channel.
it was a joke, i don't actually dm everyone..
I knew that, just making sure.
I don't believe there are people retarded enough to do that.
But I do sometimes see people on r/discordapp asking others how to do it. So uhh, there are people like that.
lmao at the end of that semicolon video
if you dont write semicolons, try spending one month writing them
if you do write semicolons, try spending one month writing TWO of them
I won't survive a month
const foo = 'bar';;
so you know how it feels when you tell people they should be writing them
or something
lmfao
what.
he claims its less confusing to teach people who are new to programming
and as an example he asks you to try writing your code with an extra semicolon, so you know how students new to the language feel about it
const foo = 'bar';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
for(;;) { alert(1); }```
no
yes
const foo = "bar"
foo = "not bar"

const n = 'n';
const u = 'u';
const t = 't';
const nut = `${n}${u}${t}`;
console.log(nut);
// => 'nut'
semicolons useful
the whole thing would work without them
jesus christ
const n = 'n'
const u = 'u'
const t = 't'
const nut = n + u + t
console.log(nut)
// => 'nut'
bad
no u
that's so gross
whats gross
yes the semicolons are gross
the no semicolons or
no u
ok
const a = ["n","u","t"];
let i = 0;
for(;;){
i < a.length ? console.log(a[i]) : exit;
}```
lmao
no
lets see how complicated we can make this script
well that's easy. Make it download the characters from the internet
@carmine echo Python:
for some_shit in SOME_shit:
do_some_shit()
var result = "";
var i = 0;
for(;;) {
Number(i % 255).toString(36) === "n" && result.length === 0 ? result += Number(i % 255).toString(36) : null;
Number(i % 255).toString(36) === "u" && result.length === 1 ? result += Number(i % 255).toString(36) : null;
Number(i % 255).toString(36) === "t" && result.length === 2 ? result += Number(i % 255).toString(36) : null;
if(++i && result.length === 3) { console.log(result); break }
}
lmfao
delet this
(function(){
var a = [0,0,0];
for(;;) {
if(a[0]++ > 36) { a[0] = 0; continue; }
for(;;) {
if(a[1]++ > 36) { a[1] = 0; break; }
for(;;) {
if(a[2]++ > 36) { a[2] = 0; break; }
let string = Number(a[0]).toString(36) + Number(a[1]).toString(36) + Number(a[2]).toString(36);
if(string === "nut") { console.log("nut"); return "lol"; }
}
}
}
}())```
another one
@quartz kindle i switch pretty often between a lang that requires semicolons and a lang that doesn't. It messes me up everytime
Just ask ahead
have a popular discord and submit a perm invite link here using this tool: https://www.google.com/webmasters/tools/submit-url
Use Search Console to monitor Google Search results data for your properties.
fetch as google is your best bet
so
I'm using the bot called react-role
i mean reaction role
and idk if it has the ability to replace a role when you react to an emote
i know that it can give you a role,
but idk about replacing
if anybody knows how to do that please show me
@keen drift ^^
yeah I was watching his tutorials on yt
but he didnt have a video of what i was looking for
idek if what i want is possible 
i don't think it can but wait for fishy
can i get help?
i pressed fetch and render
and i got this
??
ok thank you!
do they make a different?
becauase google was only able to fetch and render one of them which had the www because my server forces https
should i remove the other one?
they tell google which one is the "real" address, and all others are just copies
google canonical tags
o
another option is to use htaccess rewrites
if you use a webserver like apache/nguinx
yeah
yup
alright what do you think i should do
for this
should i delete one of them or should i leave both of them
because one of them is getting indexed and the other isnt
its better to keep https://hqmusic.ga
with https and without www
if your server supports SSL its better to keep https always on
my server will only allow the user to connect if https
is used if not the website wouldnt load
yea
also TLS1.2 and above
supported
so they can only connect with tls1.2 and 1.3
1.1 or 1.0 will give them an error
the only possible problem with HSTS is that if for some reason your server's ssl fails, your server will be inaccessible
but that should never happen
ah
o
nice
is this an issue? google failed to load one image
how do you make a role assigned to newcomers automatically?
.aar using the nadeko bot right?
but what about changing it?
i accidentally assigned the wrong role
and 2 of them at that 
that's a bad idea, but ask the bots support server
the requirements from node or npm?
Npm
Can you not tag me plz
sorry
And why use io discord.js is better and what's the error
ill paste what command prompt is saying when i use the line: "node bot.js"
C:\Users\Ashton\Documents\Bot>node bot.js
internal/modules/cjs/loader.js:710
throw err;
^
SyntaxError: C:\Users\Ashton\Documents\Bot\auth.json: Unexpected token “ in JSON at position 3
at JSON.parse (<anonymous>)
at Object.Module._extensions..json (internal/modules/cjs/loader.js:707:27)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\Users\Ashton\Documents\Bot\bot.js:3:12)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
C:\Users\Ashton\Documents\Bot>
wrong quote char
^
all it has is:
{
“token”: "BOT-TOKEN"
}
but that is what it has is double quotes
Do not double quote it or change the double quate or something
Why do people mistake quotes 
I wonder how lavalink works 👀
Some of my dev friends used it they said its bad
so lets do this first. get me started with d.js
Only repeating what I been told
npm install discord.js
that okay?
I feel like I'm going to have to scrap everything I have. is this true?
@keen drift please ping me when you answer ok? thanks!
@sturdy verge some stuff might be the same some stuff wont
it's still better than using a library that doesn't get updated
yeah I see, it looks so easer and more comfortable
so I took the example code from the website and I fixed it to my liking. i put in my bot token as well as changing the tag
to actually turn my bot on how do i need to run that in cmd?
it doesn't use much memory if you actuall disable useless events like Typing_starts
wtf was that
advert
do i need to node my bot.js file again?
@earnest phoenix yes it can give and remove role
View the pinned in my support channel
It's quite hacky as of v1
I aim to improve that for v2
i got this as an error when i " node bot.js " my bot file with all my code
C:\Users\Ashton\Documents\Bot>node bot.js
(node:5200) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.
at WebSocketConnection.client.ws.connection.once.event (C:\Users\Ashton\Documents\Bot\node_modules\discord.js\src\client\ClientManager.js:48:41)
at Object.onceWrapper (events.js:273:13)
at WebSocketConnection.emit (events.js:182:13)
at WebSocketConnection.onClose (C:\Users\Ashton\Documents\Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:390:10)
at WebSocket.onClose (C:\Users\Ashton\Documents\Bot\node_modules\discord.js\node_modules\ws\lib\event-target.js:124:16)
at WebSocket.emit (events.js:182:13)
at _receiver.cleanup (C:\Users\Ashton\Documents\Bot\node_modules\discord.js\node_modules\ws\lib\websocket.js:220:12)
at Receiver.cleanup (C:\Users\Ashton\Documents\Bot\node_modules\discord.js\node_modules\ws\lib\receiver.js:535:15)
at WebSocket.finalize (C:\Users\Ashton\Documents\Bot\node_modules\discord.js\node_modules\ws\lib\websocket.js:206:20)
at TLSSocket.emit (events.js:187:15)
(node:5200) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:5200) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
C:\Users\Ashton\Documents\Bot>
wrong token
i got it from dicord/developers
you got it wrong
i regenerated my token and same error
May we see some login code redacted
would probably help if I was acually getting the Token
What were you getting before
client secret

if i change my bot.js file do i need to re node it?
oaky
well i got it on
he powered off
do i need to keep the cmd open after i node? im confused after this point
You can either keep cmd open or you can get a host
@keen drift can you show me your support channel please? I can't seem to find it
Anyone know how to make a welcome and leave command for MULTIPLE servers?
CatBot?
My bot
oh
It says Invalid Server Format
never had that error before so cant help im afraid
oof
I need some help
anywayssss from another person
It now says Unable to fetch application. Make sure you've provided the correct Client ID and that the application has a bot account.
we cant help you unless you post your code
Tim
?
has anyone ever had an opportunity to play around with enum flags?
so can yo change the color of these checkboxes in bootstrap or
i like the custom ones over default, but i wanna make it blurple to fit with my theme
You can use CSS
The CSS of the check box element 🙈
im trying to add divs to a div thru js and am confuse
someone halp
are you using jquery?
no
then you can use .innerHTML or .appendChild iirc
lmfao .appendChild moves it onto my navbar
ok
Why does the api keep on rejecting my POST request to the stats endpoint? My token is correct, and my bot's ID is correct.
It will not work!
If I try https://discordbots.org/api/bots/stats it gives a 400. If I try https://discordbots.org/api/bots/mybotid/stats it gives me a 403.
and yes I replaced mybotid with my bot's id.
I also made sure to include headers!
("Authorization","mytoken")
and yes, I read the docs.
Yes
yea
fetch.post(`https://discordbots.org/api/bots/stats`)
.set("Authorization", options.token)
.send({count: options.servercount})
.then(r => {
callback("Successfully posted your count to DBL.")
})
.catch(err => {
callback(console.log(err))
})```
I know 403 is forbidden
snekfetch
so it means incorrect data was sent
ez
node-fetch is gud
eh
*/ping
No it's not
wait
snekfetch is depreciated
yeah I figured it out
I was sending the JSON as json { count: servercount }
instead of ```json
{
server_count: servercount
}
It just worked.
lol
lmao
Oof
how to use .insertBefore
I thought botblock used a proxy
well it works on all lists apart from here now advaith
i need to make my own botblock lol
cmdsDiv.parentNode.insertBefore(div, cmdsDiv)
whytho
just do it with a few requests
wait thats wrong
@zealous veldt posting to like 14 lists every 15 minutes is a pain in the ass
creating your own botblock is going to make more work for you
Lol
so
Just ask the admins to unblock botblock
yeah
y is ipv4 banned?
But idk why the proxy isn't working
@bright spear yes i know thanks
Ok, so I need help
I just installed pycharm because I wanna start coding in python using discord.py but when I try to run the code inside pycharm, it says ModuleNotFoundError: No module named 'discord' but when doing it in cmd with py bot.py, it works like a charm. Any reason why it doesn't work in pycharm?
test
jsut making sure i know how to make my texxt like that lol
Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\soyou\AppData\Local\Programs\Python\python\lib\site-packages\discord.py-0.16.12-py3.6.egg\discord\client.py", line 307, in _run_event yield from getattr(self, event)(*args, **kwargs) File "C:\Users\soyou\Desktop\komaeda\bot.py", line 48, in on_message await client.send_message(message.channel, msg) File "C:\Users\soyou\AppData\Local\Programs\Python\python\lib\site-packages\discord.py-0.16.12-py3.6.egg\discord\client.py", line 1152, in send_message data = yield from self.http.send_message(channel_id, content, guild_id=guild_id, tts=tts, embed=embed) File "C:\Users\soyou\AppData\Local\Programs\Python\python\lib\site-packages\discord.py-0.16.12-py3.6.egg\discord\http.py", line 196, in request raise Forbidden(r, data) discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions
anyone know what the fuck this means? it didnt affect my bot's productivity at all, im just confused
doesnt have permission to do whatever
nvm, turns out pycharm was using a difference python.exe
I cant figure this out bot.registry.registerGroup('commands', 'Commands'); and the error says Cannot read property 'registerGroup' of undefined please help (.js)
?
cannot read X of undefined means whatever comes before X is either wrong, empty or doesnt exist
@earnest phoenix
in your case its registry
ok
Why does https://discordbots.org/api/users/id not work?
I replaced id with my id
and it keeps giving me Not Found
@frigid thistle https://killing-myself.is-my-life.style/ETeVNbqH.png
Code: js getUser(id, callback) { require('snekfetch').get(`https://discordbots.org/api/users/${id}`) .then(r => { const json = JSON.stringify(r.body) const body = JSON.parse(json) const data = { username: `${body.username}#${body.discriminator}` } callback(data.username) }) }
you sure the ID is right?
Yes
I call the function with the id 242734840829575169
So it should work, because I can open the same link in my browser, and it works fine.
kinda unrelated
Should I go to #topgg-api?
why are you stringifying json just so you can parse it again?
but why do you put username into an obj but then take it right back out 
Cuz directly parsing the body returns an error.
If I stringify it, then parse the stringified json, it works
I'm kinda a noob to node
i believe the body maybe already be parsed json
Hmm
So what would be a fix for my problem?
It works when I replace the id placeholder with my id
instead of js const json = JSON.stringify(r.body) const body = JSON.parse(json) const data = { username: `${body.username}#${body.discriminator}` } callback(data.username)
you could just do js callback(`${r.body.username}#${r.body.discriminator}`); lmao
but anyway, if it works with a fixed id, but not with ${id}
then you're not passing in the id to the function correctly
can you console.log(id) right before the snekfetch line?
maybe use node-fetch
i mean
what if you do ""+id instead of ${id}
could be a problem with snekfetch, since its deprecated and all
It didn't work
try with node's own http
also removes the need for dependencies if you're building a lib
hrm
i suggest node's http/https :3
axios gay tbh
weird
THAT'S what I missed.
I didn't think to put "s around the ID
ty for ur help.
you were passing it as an int?
yea
oh
xD
if i pass it as an int in runkit it gives me unhandled rejection lul
How would I change int to string so it would work as both int and string?
like .toString() or something?
why are you stringify then parse

you can literally get the request and return the request body
js usually differentiates between them automatically, but if you need to explicitly convert them, then use toString yeah
or you can use tricks like 8798+""
yeah node-fetch has res.json()
Is there any good way to run a certain line of code whenever Bitcoin is sent to a certain address?
NodeJS
!free
!wrong channel
please stop sending random stuff in development and api channels @dire fossil
or i will get a mod here
no
@bright spear oh no not a mod
oh yes, a mod
btw @queen sentinel
Thanks
So I am trying to get a users ID after running for r in cm.reactions: ru = await r.users().flatten()
I tried appending each user to my JSON by doingj["message"][mid]["users"].append(ru.id)but I am getting that the Member object does not have the id attribute
Now wait a minute
.flatten() returns a damn list
which is under your var ru
now let's see what you are doing right there
j["message"][mid]["users"].append(ru.id)
So you are .appending a list.id
o
Just iterate through r.users() and append every time the looping stuff begins 

is there a reason why client.users would be undefined on discord.js?
If the login failed?
it didnt
but its showing undefined
i know the login works
since it logs on ready
@late hill so no, the login isnt the issue
🤔
sure
is this not valid json?
I'm so confused and tired
I feel like I'm missing something obvious
lol

😂
I was receiving an object thinking it was json
then trying to parse it
then was like wtf why no work
xddd
PRENEW = PRENEWdict[str(message.guild.id)] returns 'str' object does not support item assignment
idk what im doing wrong
Anyone know which module I would need to get this function? .generateTimeString()
@coral trellis lol, how is anyone supposed to know this.
Because they are smarter
Shut
You may want to start off by explaining a bit more
how can i remove the white line from the bots page?
and also the shapes at the bottom?
what white line
one at the top
#bot-details-page .shapes-1 {
display: none;
}
``` shapes
ok thanks
pretty sure you cant remove that line
you can do anything with css
even make the entire page empty lul
if you're talking about this line
its a border-top css on .container
line not removed with this
#bot-details-page .shapes-1 {
display: none;
}```
thats not for the line
as i said, the line is a border-top propriety in the .container element
use the element inspector / dev tools
ok \👍
#border-top .container {
display: none;
}``` this?
its still appearing
How can I add text to my upvote button like 31 Upvotes instead of just 31
#bot-details-page
#details .container {
border-top: none;
}
This Works mental.
ok thanks
How can i remove the white lines from around the logo and what is the element for the prefix line?
what did you do
.bot-img img {
box-shadow: none;
}```
thats not the pfp
what is the pfp ?
#bot-details-page .bot-img {
box-shadow: none;
}
Inspect element, find the class name or identifier, edit it with css
whats an css
come sail Sally

not really

well learn
Lmgtfy
Brush up on css before you try to edit it

rather not learn css

we're not going to tell you how to edit it all
yes
seen multiple people say shit like that lmao
I just want an element 🤔
@ Tonkku c'mere
i can do the rest
im lazy
yes
im dumb
ik
this isnt anidiots.guide server
go there for support that caters to literally anyone
LMAO
inb4 help vampire
inb4 that isn't the real reason
shes not the nicest person
but they help anyone
ifu got banned
u must be like
on another level
The only thing I learned from there is async/await
And then I left the server
the only thing i learned from there is how toxic most of them are 
i got muted for reacting with OMEGALUL to a sad announcement
so i left
lmao
the only thing i learned from their support server was that i am super dumb and that my enmap system has crashed irreparably
I believe it
which part of that...
All of it
hi here is a shit gif https://skullbite.is-for.me/i/3zgzh43d.gif
xd
im having some trouble with a rock papper scissors command in discord.js. when it sends the embed the winner field doesn't change to who won. https://pastebin.com/HBA5tGxN
because when you make the winner field the value is 'winner'
always
because it's assigned before wrps is changed
Ok I’ll tinker with it when I get back
How can I trim the starting "0" off in NodeJS?
0100
is that in a string
Its in a variable.
you can just backspace
also that isn't what i asked
but thanks
Uh huh.
@earnest phoenix what is the type?
Type?
string
ok
@earnest phoenix variablename.slice(1)
how can i change upvote button text?
I made a DBL Api wrapper
You seem to have something leftover in it
https://github.com/FHGDev/dbl-js/blob/master/index.js
Ik
For testing.
I can't publish it to npm yet; the node.js installer is broken.
So I use heroku to test it
Latest
Try installing v10
@earnest phoenix don't ask moderators to review your bots
dont mention mods or anyone for no reason
but there was a reason 
@earnest phoenix Want a bot verification? Type dbl!verify (bot id in a mention) in #commands!
ads
dont troll people in #development
ok
how do i remove that line?
code ?
in css edit
box shadow none
box-shadow: none;
Thanks
#bot-details-page .bot-img {
box-shadow: none !important;
}```
nice spoonfeed
np
not a compliment
❤ ill take it as one
cert only for certified users?
oh ok \👍
👍
on discord.js or discord.py?
?
Im using discord.js
#bot-details-page
.page {
background: #011E30;
}
how to change background
this not works
background-color:rgb(64, 64, 64);
Thank you
no problem
#bot-details-page
.page {
background-color:rgb(64, 64, 64);
}```
..
nothing happen
DMed the message
just a quick question can we vote via command?
no
it´s posibble
k thx you for the confusing answer
So I made a file called config.json
Yea?
How do I make it have my token (I forgot JSON)
{"Name": "value"}```
.json file {
"token": "insert-bot-token-here",
}
const config = require("./config.json"); - client.login(config.token);

I didn't need to know that
yes
I personally use vscode
It's really nice looking
i like it :3
I hate the UI of it
how big is the entire vscode installation?
D A R K M O D E I S F O R P R O S
notepadd++ is 11mb total
and it has portable versions
plus very good plugin system
Uh lemme see
sublimetext3 is 32mb
its a bit more of a pain in the ass to install and set up, but it has god-send plugins for automation
Can someone help me
I'm trying to make my bot respond to being pinged but
client.on('message', msg => {
if (msg.content === '@<409069320480620554>') {
msg.reply("Hm?");
}
});
would this work for my token
Is not working
your mention is wrong
<@id>
its <@id> not @<id>
node js it's not my sorry domain
{"token": "not telling yall"}
Yes
i like json
I've done it a lot on roblox and I still can't remember the format lol
it makes it so easy to pass data around
Well in my hosting service I have it set to put it in when booting so I don't have a token laying around inside my github repo
@quartz kindle https://code.visualstudio.com/docs/supporting/requirements
For people to use their own code in my bot
yes
there is more option
wait aren't you able to put a name in front of the json code like ```json
alert
{
{"name": "text"}
}
Now anyone know how to fix the annoying EventEmitter memory leak?
thats wrong on so many levels
What do you advice me ?
python or nodejs?
(python I know)
nodejs
true
@last jacinth do you have multiple <bot>.on("message")?
Yes
yeah, but on("message")
meaning for each message that you receive, your bot will get two copies
because its listening for messages twice
or more times, idk how many times you have it
Will it still run the cmd without
client.on('message', msg => {
Just
SOmething like
you have to put all your commands inside one on("message") event
if (msg.content === '!test') {
msg.channel.send('Oh Ok');
}
});
yes
Ok one second
Does JSON have variables?
JSON no, js object yes
you advise me to do otherwise?
@client.event
async def on_command_error(error,ctx):
if isinstance(error, discord.ext.commands.CommandNotFound):
logs("[ ERROR ] : \"{}\" performed an unknown command".format(ctx.message.author))
if not isinstance(error, discord.ext.commands.CommandNotFound):
await client.send_message(ctx.message.channel, "oops an error has occurred")
object = running in a program
json = outside of a program, like a text file
and idk, i dont know python
idk ?
idk = i dont know
okay
I have been learning Java recently
Java is not too tough
learn jabba
lol
jabba the hutt
because you did it wrong
json always needs a key and a value
keys cannot be objects
only values can
this is valid {"key":{}} this is not {{"key":"value"}}
{"token": "not showing"}
{"test": "test"}
when I add another one it creates the error
that is incorrect
Yup
all contents of a json file must be inside a single {}
you cant do {}{}
but you can do mulitple keys and values
no need for multiple objects
{key1:value1,key2:value2}
etc
a json file is basically a list of keys and values
{
“Token”: “blah blah”,
“Other”: “blah blah”
}
Now I think I fully understand JSON
wait why do I get an error when I run node .
?
No idea
What’s your main file??
index.js
I seen it doesn’t work for a lot of people
I get a bunch of errors
Errors
probably no package.json
And they are?
invalid token lol
Your login











