#development
1 messages ยท Page 356 of 1
can't see what type of error tho
hello
Just put input() at the end of your code
Then it waits for you to press enter to exit
I just have my ide setup to do a press any key to exit whenever i run python with it
also whats an f string
I feel like im behind on python versions
still closes instantly
Also, whats the error?
still closes instantly so i cant read the error
Open with cmd
oh
nonetype has no attribute id
LMFAO
Co away clumsy
lol
This is development not shitpost
ughhh
It's user.id
Can you show the whole python code?
Especially the top
There should be something like
wdym
client = Discord.Client
What do you use instead?
commands is from discord.ext
Hes not using rewrite
i am using rewrite
Clumsy it's a bool in the channel object
thx failed
lowercase d
ahhhhh
Did it work?
no
Show us the line
Discord.py or the other one?
Which one are you using
@agile basalt commands.Bot(command_prefix='str') show us that line
The whole line
https://i.imgur.com/8M2C6Kk.png someone is hacking my bot pls send help 
bot = commands.Bot(command_prefix='c.') @strange lintel
i reverted my changes so at least the bot is online, but no dbl temperarily is better than the whole bot down
Hugop hes using discord.py
i'll ask again tomorrow
And its bot.user.id
discord.Client.user.id should also work tho, something seems strange
i gtg
Oh ok bye
thx tho
o/ just use my code
for trying
Yeah hugops code should work
All you have to do is put the token in
Then just paste it into your code
how can i make a command only be able to be used once per day?
I fucking love ruby http://0x0.st/sPrZ.png
@blissful reef with an if statement and unix timestamp

I'd use moment for dealing with dates/times
thanks man
How do I use filter and map
Help, i've uploaded my bot to discordbots.org but i cant seem to see the server count. it only gives me errors
Js
discord js
and node.js
when i add the api it gives me error that it doesnt exist
ill reinstall it
ok
no need to install it using npm
THX
oof time to script it.
Like
To keep my bot running
ok
hope it doesnt kill my bot lol
ok
ill test it
thx it worked like a charm
For server count examples, check #312614469819826177
ook
me
kinda
@thorny hinge
lemme open my code
db.get(`SELECT * FROM economy `, function(err, row) {
console.log(row)
})```
that should work
@thorny hinge ^
WHERE row = text
?
you can't
@shrewd field is the bot running on linux?
How to search users by a discriminator. d.js
How can I sandbox eval in python?
@worn ridge http://lmgtfy.com/?q=python+sandbox+eval
๐
use filter if you want multiple results
there is also findAll
https://gyazo.com/944eb2fec7154273a373cb01483daa45.png
Did markdown mess up on me?
(This is asciidoc)
It fucks with _
Same with mine, looks for a couple tags, follows a link, and just stores some of the text in the DB
I have a feeling he doesn't know how to loop lol
d.js
like this
.addField(`Role Names: ` ,
`${message.guild.roles.map(r => r.name)}\n`, true)```
this is what i have and it prints it next to each other sperated by commas
which I don't want
I want it like the picture
this is what I have
I want it like this
I don't understand, how do I add user id as an filter in awaitMessages?
.then(() => {
message.channel.awaitMessages(response => response.content === '1' || '2', {
max: 1,
time: 30000,
errors: ['time'],
})
if(!message.author.id == "idhere") return
But that cancels out the whole command
hm
@shrewd field this might help you see how to build inline fields in your embedded content https://leovoel.github.io/embed-visualizer/
@quiet bobcat What I mean by that is if someone else writes for example 1 in this case, the command ends there
?
Like.. if you do the command and I'd write 1 and then you'd write it after, it wouldn't register anymore. You'd have to start the command all over again
@next bluff didn't help
Anyone?
@shrewd field Is that the roles thing from my bot ๐
cause if so your like the 20th person trying to make it
Doesn't seem that hard 
const { RichEmbed } = require("discord.js")
const embed = new RichEmbed ()
message.guild.roles.forEach (role => {
embed.addField (role.name, role.id, true)
});
message.channel.send ({embed})
@shrewd field
Spoooooonfeeeeeed

Bad
no u
I don't know why you would want to do such a thing anyway lol
d.js errors if you try to add more than 25 fields

How do I filter user ids in awaitMessages
add a check to the filter options
smth like response.author.id === message.author.id
I don't know how 
@unique star everything errors above 25 bc that's the limit lol
ik
but other libs just ignore it and send the embed with only 25
d.js sends nothing but the error
i have a code in discord.js that will find out if the message author upvoted the bot
if (votes.body.includes(msg.author.id)) {
votes being the website thing votes from the api thing yes
and when i try to run it it says "cannot read .includes of undefined"
but if i remove the ".body" it works, but not correctly
heelp
i got this code from a friend
Stuff are missing
oh ok
i have no idea what im doing
theres more to the code i just posted the part that highlighted the error
@earnest phoenix you might need to send the entire code that checks the votes
lmao
- You'd need a database to;
- Store all namechanges
- You'd only be able to get the namechanges where your bot was present
Also something to add to that,
4. You wouldn't be able to see previous name changes before you had the database and change logging present
and a bot that runs 24/7 to catch all the name changes
^
CODE : ```js
const snekfetch = require('snekfetch');
const key = 'HIDDEN FOR ME';
snekfetch.post(https://discordbots.org/api/bots/393359617310195713/stats)
.set('Authorization', key)
.send({ server_count: client.guilds.size,
shard_count: client.shard.count,
shard_id: client.shard.id })
.then(() => console.log(Posted to dbl.))
.catch((e) => console.error(e));
and?
im a lazy fuck so i just use litedb
Are you sharding?
either "shard" doesn't exist or is not defined
i want only server count
If you're not sharding that is the incorrect way
erm
Err
LMFAOOO
KEN
I SAID NOTHING
SHHH
have u slept today? ;]
Barely
tsk tsk
If you're not sharded you need client.guilds.size
how many guilds do you actually have
oi same here m8
Then you have no need to shard
well you dont need to shard yet
sad that 4 of em are mine
You can just use client.guilds.size
if i do this?
Yes
oh
my terminal is full
ive never sharded 
and up and down
You put your key in the variable?
-bots AndrewKit_221
@crude bone
I've never used Snekfetch
ye
its straightforward asf
if you comment out the shard_count
The data might not be in correctly, I cannor remember if snekfetch will auto put type as json
dont forget to remove the ,
that could cause issues, it has done for me in the past
Try it now?
show the code and error again pls
this is the same error
It might be the fact that it's not in JSON format
1 sec
In your send it is, but I mean it may not be sending as json format
I hate xml (Only beacuse i never botherd looking into it)
-bots @ebon apex
@celest yarrow
snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
.set('Authorization', 'bot_api_key')
.send({ server_count: client.guilds.size }) //
.then(() => /* do whatever here COMPLETE_EVENT */)
.catch((e) => /* do whatever here ERROR_EVENT */)
Remove the global part
yeah
-bots @rose briar
my globals
http://lizardsuc.cf/7a30โ1207?!?!?!
@undone wraith
@languid dragon no
no?
the same error
snekfetch.post(`https://discordbots.org/api/bots/393359617310195713/stats`)
.set('Authorization', key)
.send({ server_count: client.guilds.size }) //
.then(() => console.log("TADA!"))
.catch((e) => console.log(e))
Is ffmpeg the only video convertion lib that is good? or is there somthing simpler (I only need webm -> gif convert)
Yeah this works
snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
.set('Authorization', config.api.discordBots)
.send({ server_count: client.guilds.size })
.then(() => {})
.catch((e) => {})
Change the key spot obviously
Wait do you do the same to shard count?
wait what was the recommended server count to get shards?
1,500 is recommended. but 2,500 is required
๐
CODE:
if (message.content === (prefix1 + "rlist")) {
const { RichEmbed } = require("discord.js")
const embed = new RichEmbed ()
message.guild.roles.forEach(role => {
embed.addField("roles" ,
`${role.name} , ${role.id}`, true)
});
message.channel.send ({embed})
}```
ERROR:
```css
/app/node_modules/discord.js/src/structures/RichEmbed.js:152
if (this.fields.length >= 25) throw new RangeError('RichEmbeds may not exceed 25 fields.');
RangeError: RichEmbeds may not exceed 25 fields.
The embed is too big.
how Can i put this line
message.guild.roles.forEach(role => {
embed.addField("roles" ,
`${role.name} , ${role.id}`, true)
});```
I want to put this line in something that is more than 2048 chachters
other than description
It's not possible using an embed
then how is this possible
When you have 25+ roles it won't work
Because the embed is too large
It's not possible to change the limit
with embedded fields
It has 25 feilds
if it has 1 extra field what to do
ok so fields no
make another embed I guess
then what are other options
Not sure how you would do that though
{embed: {
fields: [
{title: 'Field Title Here', value: 'Field Content here'},
{title: 'another field', value: 'blah blah', inline: true}
]
}}
ooh good idea Tetra
huh?
having pages
links
no
I don't know any open source bots with pages
what about JSON
its how you'd add fields to an embed
the embed object
aka json
channel.send({embed: {}})
Is that how you add embeds in v 12?
look
That's sending the embed raw
Ok
Which is amazing
I do message.channel.send(new RichEmbed() blah ...
this is a screen shot from dyno
Ew
bot
Using an embed builder
it has roles
Ken with that does it work in v12?
yeah
tis should work with all of them
That is v9+
jon
Sending raw
jon
Because the way I'm using cant be done
yeet
@shrewd field That's not an embed
what is this
That's a code block
Its not fields
thats not an embed
Its a code block
`
CODE BOCK
`
{embed: {
author: {
icon_url: 'yes.png',
url: 'yes.html',
name: 'Yeet'
},
description: 'a description',
fields: [
{title: 'Field Title Here', value: 'Field Content here'},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true}
]
}}
ok
{embed: {
fields: [
{title: 'Field Title Here', value: 'Field Content here'},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
]
}}```
in the fields I will put this
What he sent you cannot use an embed builder
uh
What he sent is sending an embed raw
msg.channel.send({embed: {
fields: [
{title: 'Field Title Here', value: 'Field Content here'},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
{title: 'another field', value: 'blah blah', inline: true},
]
}});
push to the array
But for the fields
ok
let embed = {embed: { fields: [] }}
embed.embed.fields.push({title: 'another field', value: 'blah blah', inline: true})
If you define the embed as an array
so i put the roles stuff in the field value
Like that
what is push
or use something like this if you are a real noob
http://nadekobot.me/embedbuilder/
Then send the embed variable instead of doing {embed: { ECT... }}
i remember doing that
ok
that embed visualizer is gud asf
its how i learnt to do things raw
i genuinely always use raw
lemme show u my this.Embed()
its neat
in field value
< almost always uses a db 
do i use this
nice id 


class > function
db > json
i use mongodb
because i can easily get to it via a magic link on my website 
and see all data
what's the link 
Do you get something like this with mongo? https://discord.is-down.party/CvC1pAu8.png
i had to make it myself lel
@fathom pebble can't show because it is a tab for vpns too 
don't wanna get hackled you know
wtf is a nonce http://lizardsuc.cf/7b06โ1214?!?!?!
if (typeof options.nonce !== 'undefined') {
options.nonce = parseInt(options.nonce);
if (isNaN(options.nonce) || options.nonce < 0) throw new RangeError('MESSAGE_NONCE_TYPE');
}```
๐ค
@bitter sundial I got a question about the detailed description of the DBL bot profiles.
Is it necessary to make the description, when made with HTML and CSS, responsive? And if yes, can we do that with CSS media queries?
not necessary, its up to you and yes you can
Alright, thanks
Me I use a run.bat
with auto-restart
@ECHO OFF
goto start
:start
cls
python bot.py
ping -n 2 127.0.0.1 >nul
goto start
i can't use that
js?
Install forever
k
and then do like reboot command and do proccess.exit();
how do i use it?
forever start thingy.js
that's it
mhm
How to check if a user already used a command, and if the user did then send a message.
discord.js
- you have ping command
- you have a "user used this object,array or map"
- user uses ping command
adds to map - user uses ping command again
ping command checks to see if exists in map - profit
The thing:
let pingCommand = require('commands/ping.js')
global.usedPingCommand = []
client.on('message', (message) => {
return pingCommand.func(message)
})
The command:
module.exports = {
func: function(message){
if (usedPingCommand.includes(message.author.id) {
// the user already used this
return message.channel.send('You already used this command!')
} else {
// adds to the array, the user used ping
global.usedPingCommand.push(message.author.id)
}
return message.channel.send('Pong!')
}
}
thats the idea of it
hope this helps
If two people use a discord.js command that reads a json file, will it corrupt the file? Or is it when it is trying to write to the file while also reading it
If it's just reading, it will not corrupt, race conditions cannot occur on JSON without data being written
kk thanks
@languid dragon ty
So uh
I got my bot to rename itself during December as a joke
Am currently unable to get it to change back for some reason
It runs the code to get the name changed back
but as soon as it changes, the name immediately changes back to the December name somehow
I know that Discord throttles username changes to two per hour, which is why I've been trying to reset it periodically every few hours
but still a no-go 
code?
if (month == "12") { // Could probably do one-line statements for this but I want to be safe
//bot.user.setUsername("LarryButzBot");
console.log("Larry!!!!");
} if (month != "12") {
bot.user.setUsername("WrightBot");
} ```
Made that cringy af console output line just to make sure that it's not accidentally running the code to set it to the December name
@shrewd field "you don't have pm2" Oh yes you can
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
why would that change anything?
he uses electron on d.js
@i cant spell your name because you used inaccessible characters
i see the reason
You never built the app object
this has nothing to do with bots rn
and its the constructur
nvm i realised my mistake kthx
ah
HELP!
I am currently creating a cool command that allows you to communicate across servers, however. I have problem! Once connected to the guild, I cant seem to make messages send to the other guild!
Please halp!
let messagesent = message.content.split(/\s+/g).slice(0).join(" ");
message.channel.awaitMessages(response => response.content)
.then((collected) => {
if(collected.first().content.guild.id===message.guild.id) {
callChannel.send(messagesent)
}
if(collected.first().content===callChannel.guild.id) {
message.channel.send(messagesent)
}
JavaScript btw
Does anyone how to embed links in embeds or normal messages? (Im using Python)
Oh ok, Thank You ๐
@earnest phoenix Communicate across servers? 
Yes
Good idea.
Anybody care to look at this channel and help people? Ive been waiting for almost 6 hours for a response... Still been trying to figure it out!
@earnest phoenix i could ask in another server for you
please do ๐
whats your error @earnest phoenix
there is no error lol, Just it wont post to either of the chat channels when call is accepted and they start talking
the awaitMessage's messages will always match the same guild as they were sent in
because you are only collecting the messages in that channel
How would I set it so that it will not go past that code until the user $hangup
what is content.guild?
^^
Uhhhh not sure lmao
that could be your problem
I think it is to make sure that no other Guild that the bot is in is able to see their convfersation and have it post in all servers
did you c&p this?
Yep
Need whole code?
you on master or stable?
stable
so your getting no errors when running?
can you console log it?
correct
up to what line?
consoleloghere
let messagesent = message.content.split(/\s+/g).slice(0).join(" ");
message.channel.awaitMessages(response => response.content)
.then((collected) => {
if(collected.first().content.guild.id===message.guild.id) {
callChannel.send(messagesent)
}
if(collected.first().content===callChannel.guild.id) {
message.channel.send(messagesent)
}
i think
@earnest phoenix I can call this server and show you what happens
go for it
im not too sure on your error, il take a closer look, and put it into my ide, but im not promising a fix
Hmm, bot didnt even seem to call that channel lol lemme try testing-1
How can I delete a row in a SQLite Database?
var id = 1;
db.run(`DELETE FROM profile WHERE ID=${message.author.id}`, id, function(err) {
if (err) {
return console.error(err.message);
}
console.log(`Row(s) deleted ${this.changes}`);
})```
I'm using that code but it keeps giving me this error:
```SQLITE_RANGE: bind or column index out of range```
Do NOT make queries like that...
Use prepared statements please
Change db.run to this
db.run("DELETE FROM profile WHERE ID IS $1",{$1:msg.author.id},function(err) { yourCode });
Thanks! Works perfectly!
Am I a scrub for using LiteDB?
๐
@lethal sun FIX IT, you're doing SQL injections
db.run('DELETE FROM profile WHERE ID = ?', message.author.id)
ok
Can someone help me with somethig
sure
So I have a form that takes in 2 values separated by a comma
It insert into the db as ['waaaa, waaaaaa']
show code
Give me a couple mins
and do ya use mongoose?
Yes
i can show you the code for the form
ANybody able to help me with my bot please?
I asked for help yesterday
HELP!
I am currently creating a cool command that allows you to communicate across servers, however. I have problem! Once connected to the guild, I cant seem to make messages send to the other guild!
Please halp!
let messagesent = message.content.split(/\s+/g).slice(0).join(" ");
message.channel.awaitMessages(response => response.content)
.then((collected) => {
if(collected.first().content.guild.id===message.guild.id) {
callChannel.send(messagesent)
}
if(collected.first().content===callChannel.guild.id) {
message.channel.send(messagesent)
}
I can quite clearly see you are looking for help with your own bot list in this bot list
@topaz fjord
do not do that
oke
Can someone give me an example how to post my stats with python?
@bitter sundial sorry tonks
o
open in browser
I combined screenshots
o
How do I use the widget in an embed?
in a discord embed?
thats not gonna work for discord embeds
But Embeds support markdown doesnt they?
Limited markdown
Oh ok ๐
you can set the image in the embed's image section
Yeah but not a svg ๐
use the png version 
that would be too easy
๐
The problem is discord saves the image only one time. So when im sending the same link again but the image behind is different, the shown image will not change ...
true
is it just ?sort and ?fields that isn't documented
lol
Can someone tell me how to set presense to "Watching" just like @gilded plank has
precense type 3
My bot is allowed to log what commands on my bot people use right? I have a log channel on my support server for GameBot, was just wondering if the bot is allowed to do that
@umbral pelican
uh, yeah sure
Is it normal to do that or not lol
How can I change the size of an image in markdown?
@earnest phoenix if the channel is public you can't iirc
iirc?
If I recall correctly
oh, lol thanks
@inner jewel Sorry for the tag but just wanting to know. Am I able to create a Level System for @broken zenith, However, I will disable it in this Server. Is that okay?
yes
Alrighty, thanks ๐
can someone mind helping me
for the pinned message i tryed to get my bot to say "Watching for emoji-help" and it just says playing
code is
bot.user.setPresence({ status: 'online', game: {
name: "for emoji-help",
type: 3,
} });
ยฏ_(ใ)_/ยฏ
rip
Lew'
Oh no it's bad.
I got streaming to work but not watching / listening
First command
that emoji looks like ascii lenny 
lol
can some1 help me with adding bots to my server?
Lmao
Hello
I am getting this as unexpected token
exports.run = async (client, message, args) => the unexpected token is the bracket before client.
make sure you're actually running a version of node that supports async/await
^
~~or you can be a scrub and get this https://www.npmjs.com/package/asyncawait ~~
@shrewd field or you learn how to use async await
Where could I learn that
Ok
Logs just keep saying no such table: eco
JavaScript
SQLite
//Money Daily System Test!
if(command==="cash") {
sql.get(`SELECT * FROM eco WHERE userID = "${message.author.id}"`).then(row => {
if(!row) {
sql.run("INSERT INTO eco (userID, cash) VALUES (?), (?)", [message.author.id, "$50"])
} else {
sql.run(`UPDATE eco SET cash = ${row.cash + 1} WHERE userID = ${message.author.id}`);
console.log(row.cash)
}
}).catch(() => {
console.error;
sql.run("CREATE TABLE IF NOT EXISTS eco (userId TEXT, cash INTEGER)").then(() => {
sql.run("INSERT INTO eco (userID, cash) VALUES (?, ?)", [message.author.id, 50]);
});
});
}
Nevermind, Got it working lol
So i have made my first bot, questioning my life now, how to start scripting, if anyone is up for help DM me, thanks (i need help in general :3)
I got no time for dms so here's a fast quick tutorial: 1) Learn a codign languag (I suggest javascript to begin), 2) Get a Library (Eris or Discord.js are best for javascript), 3) learn how to use the library, 4) Good to go, be cwieatve
kk
python is also pretty neat for starters
tbh im too stupid for this if someone could run me through the entire process it might help but alone? i highly doubt that i just keep getting errors
nobody will teach you everything from scratch, you might wanna learn a lot of stuff by yourself or you give up on making a Discord Bot
guess what im trying
@rose briar banne
fuck
Im a c# guy
its like an abusive relationship
bitch hits you
but you love her for her potential XD
I do use that yes
Check out the docs
kbye
docs mb
thats wrong doc
ok mb
cur ver is 1.0.2?
events.js:72
throw err;
^
Error: read ECONNRESET
every 5 hours
on a VPS
where my other bot, running alongside it, is not affected
lol k
i had to type it out because i clicked off of the console lol
rip
you have any idea why?
discord.js server says bad internet but no. it's on a vps and the other bot on that same vps is not affected
No clue tbh 
it's just from a connection error
i don't get it though
catch and ignore
how
^^^^ lmao
how is it getting a connection error when my other bot is fine
Both bots are being run on the same computer, right?
or maybe my VPS is shit
@rose briar actually current version is 2.0.0 but the current stable release is 1.0.2
Yeah? the official version is 1.0.2
and the test build is 2.0.0
@earnest phoenix What is the point of correcting a 2 hour old post that was correct?
a) wasnt correct
b) what's the point of pinging me to go back on alerady resolved situation
and c) because i don't pay attention to time
How is me stating that the current version(Entails the one used by the masses) is 1.0.2
Then you going well its actually 1.0.2
Actually happening?
How is me stating that the current version(Entails the one used by the masses) is 1.0.2
Then you going well its actually 1.0.2

Essentialy why did you correct me stating the stable builds as 1.0.2
current version != stable version
With "actually current version is 2.0.0 but the current stable release is 1.0.2"
It so does.
anywa
y
im gonna drop this because i dont have the nerve to deal with people who want to argue constantly
ยฏ_(ใ)_/ยฏ
No im just wondering if you smoked somthing before posting.
What does me having dyslexia and not being a native english speaker have to do with anything?
Also if you are in the dev team fix docs
what...wh.. who... who mentioned anything about dsylexia
Yes, okay you have a disability but you're not on a time limit, you can read over what you wrote once again...?
You're trying to pull the 'oh he is harassing me' card on me, just drop it, because you know god damn well that that's not the right way to play.
"beats me if you can't spell something properly" Basicly insulting my ability to type, personal attacks...
Also get of your high horse
you fucked up stop trying to do whatever you are trying to do...
both of you need to calm the hell down
XD why tell us to calm down when we have not posted for 20 mins?
because no other moderator has told you yet and you both should know better than to argue over such a petty thing
what i mean is, consider it a warning not to do it again
So how do I go about getting my bot added to the list? Do the admins appreciate funny bots like one that posts random facts when certain strings are typed?
Okay, so I have been trying to create an economy for my bot. However, I'm not too sure why everything else comes up fine except from the row.farms. It returns as null.
JavaScript, SQLite
if(command==="cash") {
sql.run("CREATE TABLE IF NOT EXISTS eco (userId TEXT, cash INTEGER, farms INTEGER)").then(() => {
sql.run("INSERT INTO eco (userId, cash, farms) VALUES (?, ?, ?)", [message.author.id, 50, 1]);
});
sql.get(`SELECT * FROM eco WHERE userId ="${message.author.id}"`).then(row => {
if (!row) { // Can't find the row.
sql.run("INSERT INTO eco (userId, cash, farms) VALUES (?, ?, ?)", [message.author.id, 50, 1]);
} else {
let amount = [row.cash + 1 * row.farms]
sql.run(`UPDATE eco SET cash = ${amount} WHERE userId = ${message.author.id}`).catch(console.error);
sql.get(`SELECT * FROM eco WHERE userId ="${message.author.id}"`).then(row => {
message.channel.send({embed: { color: green, description: `**Information:**\n\n**Cash:** :tickets:${row.cash} Game Bucks!\n**Farms:** ${row.farms} `}})
})
}
})
}
This is what it Returns:
Say this is an embed for example:
**Cash:** :tickets: Game Bucks
**Farms:** null
@umbral pelican Do you use SQLite?
Simple
retthink plz
Don't use SQLite
Hi
Does anyone know how to merge 2 images together then sending it through Discord without having to save it
with node js
what do you mean by "merge"
Like adding user's avatar to an image then sending the image into the chat
Can you delete the image after saving it?
Why couldn't you?
But if you are developing things like profiles you might consider saving them
It'll save you on processing power
Hey
When I do if (message.content.toLowercase(). startsWith(prefix) return message.reply("There is no prefix the command is starting with.")) I get an error unexpected token return.
Can someone help me here.
if (message.content.toLowercase().startsWith(prefix))
use message.channel.send insteed
Anyone knows how to teach LUA to a noob?
Hello i have a question
if i add a new command like ban kick ETC will the permissions for the bot in discord update if i update the invite link on the bot list website
no
Trying to understand the question
Like, the bot's auth link?
if you change it on the website 1) discord won't know 2) discord doesn't care
Oh I just got it
Yeah basically what Hoister said
Editing the permissions in a bot's auth link only affects what permissions will be given to the role automatically created and assigned to the bot on the server the bot is being added to
so therefore the link isn't in any way related to the bot's permissions after it's been added to a given server
The only way for the bot to get new permissions is for the server admins to update the bot's role to give it the perms it needs
anyone know how to fix [object Jimp]? Please tag me
@undone plover can u put this at the bottom of your code ```js
process.on('unhandledRejection', error => console.log(unhandledRejection:\n${error.stack}))
.on('uncaughtException', error => {
console.log(uncaughtException:\n${error.stack})
process.exit() //better to exit here.
})
.on('error', error => console.log(Error:\n${error.stack}))
.on('warn', error => console.log(Warning:\n${error.stack}));
wut
idfk
@uncut slate
client.channels.get(idcanal).send(args);
^
TypeError: Cannot read property 'send' of undefined```
Please don't mention me (or anyone for that matter) for specific questions, anyone who knows will answer
chances are your bot doesn't have that channel
How do I get if an user ID is a bot or not?
Im using discord.py
DM or mention me if you can answer my question.. XD
..
This is a pretty simple question but how do I make embed fields inline with discord.js?
inline:true
ok
Do I do the same for footers and thumbnails? Like js footer: "footer text here", thumbnail: message.author.displayAvatarURL
ok
Just wondering how do I get the current time? I've tried Date.now() which is the only way I can currently think of
@quiet bobcat try new Date()
XD
Do you mind helping me again?
sure
It's not sending the message I want it to send to the channel I want. I want it to send to a channel for when the bot joins and leaves but I get this error: ```js
bot.channels.get("391715001612377856").send({embed: {
^
TypeError: Cannot read property 'send' of undefined``` And the code for it is up there
it can't find the channel
But it could before
I just changed the way I send embeds
Because the way I'm using appearently doesn't work in v12
r u sure u got the right snowflake?
also @quiet bobcat you might want to have a look at the RichEmbed Builder
raw is better 
const embed = new Discord.RichEmbed()
.setTitle("This is your title, it can hold 256 characters")
.setAuthor("Author Name", "https://i.imgur.com/lm8s41J.png")
/*
* Alternatively, use "#00AE86", [0, 174, 134] or an integer number.
*/
.setColor(0x00AE86)
.setDescription("This is the main body of text, it can hold 2048 characters.")
.setFooter("This is the footer text, it can hold 2048 characters", "http://i.imgur.com/w1vhFSR.png")
.setImage("http://i.imgur.com/yVpymuV.png")
.setThumbnail("http://i.imgur.com/p2qNFag.png")
/*
* Takes a Date object, defaults to current date.
*/
.setTimestamp()
.setURL("https://discord.js.org/#/docs/main/indev/class/RichEmbed")
.addField("This is a field title, it can hold 256 characters",
"This is a field value, it can hold 2048 characters.")
/*
* Inline fields may not display as inline if the thumbnail and/or image is too big.
*/
.addField("Inline Field", "They can also be inline.", true)
/*
* Blank field, useful to create some space.
*/
.addBlankField(true)
.addField("Inline Field 3", "You can have a maximum of 25 fields.", true);
message.channel.send({embed});```
this looks nicer
Couldn't send the messages
ew
Also i'm a java dev that knows a bit of js XD
.send({embed:{
title: "ya",
description: "yep",
url: "yes/yes.html",
color: 0x36393E,
timestamp: "2018-01-06T11:22:22.125Z",
footer: {
icon_url: "yes.png",
text: "some footer text"
},
thumbnail: {
url: "obvious.png"
},
image: {
url: "anotherObvious.png"
},
author: {
name: "yes",
url: "yes",
icon_url: "yes"
},
fields: [
{name: "name of field", value: "the content", inline: true},
{name "another", value: "more lel", inline: false}
]
}})
I know how to send embeds
But it cant send to that channel
It's in the guild and it's the right snowflake. I'm sure about that 
double check a few times
bot.channels.get("391715001612377856") is clearly undefined
its probably outside of the client ready event lul
It is
you created a new event?
Who can help me with page's in discord.js
wdym @steel shoal
we have an realy long command but we wanna split it in a few things
so like a book if you type 3 it will show you the 3 message
lol
ok




