#development
1 messages · Page 1049 of 1
do not use heroku nor glitch
@earnest phoenix they work so there is no problem
how do you know if you didnt log it
I'm using Heroku though @earnest phoenix
no they do not
but i've done it before and it did work
@slender wagon I guess that you use your token with config variables on Heroku
how do you know if you didnt log it
@earnest phoenix i do log in if i just put the token in there
Like using process.env
they both made statements they're going to start removing projects using uptimer bots to keep the project alive
If so, configuration variables are only accessible when on Heroku
Heroku is not meant for hosting Discord bots. It's meant for websites, similar to Glitch.
umm i'll give it a try but i remember it working very well on my pc
So if you don't have your keys in process.env, it won't retrieve them
@earnest phoenix i do log in if i just put the token in there
@slender wagon
how do you not understand that all you need to do is log the token variable
@sudden geyser But at least it is free
free is cool but not always
@slender wagon Yea because you had your token written in the code
no i didn't
Weird
im really wondering how are these people making bots and getting bot dev roles without knowing language fundamentals 💀
@earnest phoenix wdym
im really wondering how are these people making bots and getting bot dev roles without knowing language fundamentals 💀
@earnest phoenix go wonder somewhere else
stop being toxic
Anyone can make whatever he wants
Grainger did you try logging your .TOKEN property/variable to see if the token actually exists
You make a bot using a programming language = you're the dev of the bot
Grainger did you try logging your
.TOKENproperty/variable to see if the token actually exists
@sudden geyser that's all i needed thank you gonna try that out
yes that's what cry has been telling you
not like i told you to do that 3 times
yeah didn't understand it in the first place
which means you lack knowledge of language fundamentals
we love seeing a good help vampire
which means you lack knowledge of language fundamentals
@earnest phoenix https://discordapp.com/channels/264445053596991498/272764566411149314/670727029540519937
i am well aware
do not throw rules at me when you yourself do not know your language basics and then you're getting passive agressive because someone wants you to do a bit of logical thinking
but you do you
Btw is there python developers here?
yea but online rn
sup so how do i make a message reaction edit a message? it updates when the collector closes (using awaitReactions)
do not throw rules at me when you yourself do not know your language basics and then you're getting passive agressive because someone wants you to do a bit of logical thinking
@earnest phoenix not understanding what u said doesn't mean i don't know the "basics" now stop the "you are dumb" thingy
Which language? @pure lion
Token comes out as undefined
Yea so that's why @slender wagon
im telling them to log their token in order to see if it exists in the first place
@earnest phoenix
you don't have your token in process.env for now
if it does then you know the file is being read properly and you can progress onto comparing the token to the actual token on the developers page
@earnest phoenix
If you had put them in config variables on Heroku you should deploy to Heroku and see if it works
Or put the token in the code while you're developing it
help.awaitReactions((reaction, user) => user.id == msg.author.id && (reaction.emoji.name == '👈' || reaction.emoji.name == '👉'),
{ max: 5, time: 30000 }).then(collected => {
if (collected.first().emoji.name == '👉') {
help.edit(helpembedPG2)
console.log('working')
} else if (collected.first().emoji.name == '👈') {
help.edit(helpembedPG1)
console.log('works')
}
})
this boi
it works only when the collector closes
Sorry don't know about discord.js
fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
chill budy
doesn't the collector have events
uhhh
They're probably looking for .createReactionCollector
and yes events for that thing
im gonna go docs
Btw is there python developers here?
@crimson jetty what's up
@slender thistle Can we run our bot in another thread?
Like I wrap all of my bot in a function and I do threading.Thread(targer=the_bot)
bs guess from someone who never played with threading, I'd say yes you can
Hmmm
But I mean, https://tryitands.ee
Or if there is another way of running two bot at the same time?
Last time I tried it worked fine (which was 3 years ago)
login isn't blocking, run is
Ok nice
Lemme try and I'll come back
(In fact I was looking for dark multiprocessing stuff to make it run so if I just need to change client.run to client.login it would be great)
Yep that's exactly what I'm trying
Well I have my two bots wrapped (in two separate files) in a function
In the first one I have client.login()
The second one client.run()
And I'm running them both from an external script
@marble juniper there should be
ok basic rundown:
mongoose xp system
schema: (per user)
const userSchema = mongoose.Schema({
_id: mongoose.Schema.Types.ObjectId,
guildID: {type: String, unique: true, index: true},
userID: String,
xp: Number,
level: Number,
enabled: Boolean
})
what i want:
to be able to derive an xp/levelling system with a leaderboard BUT im not sure of how i would get that kind of info using that^
@marble juniper works for me, what version and what client options?
if (message.content === `${prefix}start`) {
const channel = client.channels.cache.get("731314888835727490");
if (!channel) return console.error("The channel does not exist!");
channel.join().then(connection => {
// Yay, it worked!
console.log("Successfully connected.");
}).catch(e => {
// Oh no, it errored! Let's log it to console :)
console.error(e);
});
is there a way it could join by channel name? not id?
:d
what is the context of this
do you have a db?
ok?
You don’t need a db if you aren’t storing any data
It is VERY good to have one but it’s unnecessary
better do it now than later
True
ik
not gonna use it for the command x)
just filter by name == messsage content
eg aa!start testing-2
Is Tim still here?
tim has ascended
Damnit I wanted to show his boss I made 😦
what
I'm working on an RPG Game Bot Thing and I made a boss out of some discord members here
And Tim is one of them
Well I'm trying to
But the thing is
My bot requires you to party up with at least 1 user
And the other user is not accepting
So if he accepts I'll show
The project is still "secret" like in only a select few are allowed to test
I'm sorry 😦
its fine i understand :D
We are going into closed beta soon tho so if ur interested DM me 😉
:o
So um
ok basic rundown:
mongoose xp system
schema: (per user)
const userSchema = mongoose.Schema({
_id: mongoose.Schema.Types.ObjectId,
guildID: {type: String, unique: true, index: true},
userID: String,
xp: Number,
level: Number,
enabled: Boolean
})
what i want:
to be able to derive an xp/levelling system with a leaderboard BUT im not sure of how i would get that kind of info using that^
He finally accepted
LMAO THATS PERFECT
it's kinda messed up it should say Tim Big Brain lost 500 HP
No pls dont
Dont starboard it
I told u it was a "secret" project
o ye sorry
I deleted it
<><><><
u should do nothing
in that section
you can ignore OAuth2
as well as Rich Presence and App Whitelist
Just ignore those
@earnest phoenix no to add the bot to your server you don't need OAuth2
A small calculator that generates Discord OAuth invite links
use this
Rip free hosting
you will need the client id
@celest schooner just buy a vps the cheapest ones are mostly 4.99 or 3.99
OmAr GooD GaMe❤#0323
Requested By : @marble juniper
OmAr GooD GaMe❤#0323
you can try using contabo as thier offers are pretty good
Ik but I’m just saying
Requested By : @iron tendon
OmAr GooD GaMe❤#0323
Requested By : @iron tendon
lol
I’m just running my computer 24/7 rn
@flat pelican we have a selfbot
marco has sbeed
Ok it didn't work
@crimson jetty what didn't work
@slender thistle
I’m gonna probably get digital ocean
No talking about something else @marble juniper
can you just give context then we help idk
so why did you ping
no
uh that’s why you don’t copy code
@marble juniper Was talking about putting a bot in another thread
@earnest phoenix no nobody will code it for you you just gotta learn
uh that’s why you don’t copy code
@celest schooner ^
link you fucker
So that I can run two bots at the same time
@earnest phoenix what the fuck do you want
yes
rem and ram
@earnest phoenix Then learn
@earnest phoenix try this before you do anything stupid or ask someone to code the bot for you https://discordjs.guide
dude
Use the one I sent you since it eplains everything and is up to date @earnest phoenix
Code ur own commands
@celest schooner Yea you right
ig but copy and pasting not gonna help
ok basic rundown:
mongoose xp system
schema: (per user)
const userSchema = mongoose.Schema({
_id: mongoose.Schema.Types.ObjectId,
guildID: {type: String, unique: true, index: true},
userID: String,
xp: Number,
level: Number,
enabled: Boolean
})
what i want:
to be able to derive an xp/levelling system with a leaderboard BUT im not sure of how i would get that kind of info using that^
yea bruh
h e p l
if he wants to have someone code it for him he can pay money if he wants to
incase he has a lot
ok basic rundown:
mongoose xp system
schema: (per user)const userSchema = mongoose.Schema({ _id: mongoose.Schema.Types.ObjectId, guildID: {type: String, unique: true, index: true}, userID: String, xp: Number, level: Number, enabled: Boolean })what i want:
to be able to derive an xp/levelling system with a leaderboard BUT im not sure of how i would get that kind of info using that^
@pure lion Try first?
.
Wait nvm
@celest schooner i know its not going to work-
fuck
@crimson jetty what's up
the sky
i want to learn mongodb because """""reasons""""" (aka nosql so i understand data structures)
I want to learn MongoDB so I can stop using enmap
whats the best way to somehow implement premium to a bot?
as in a subscription?
ok basic rundown:
mongoose xp system
schema: (per user)
const userSchema = mongoose.Schema({
_id: mongoose.Schema.Types.ObjectId,
guildID: {type: String, unique: true, index: true},
userID: String,
xp: Number,
level: Number,
enabled: Boolean
})
what i want:
to be able to derive an xp/levelling system with a leaderboard BUT im not sure of how i would get that kind of info using that^
@pale vessel
okay i need to go to mobile rn brb
just use updateOne with the upsert option
I know how to implement the xp
mkay
I'm just confused as to how I would get a leaderboard
Select all the users from that guild and order by xp ascending
use find(filter)
something like find({ guild: guildID })
that would return an array of members from that guild
you can then map them
So I create a "profile" for each user that holds exp, levels, the user ID and guild ID
yeah
So document for each user?
mhmm
And the data structure looks good enough?
yep
Because I'm not sure if I had to use the user ID as a second index when I wanted to add exp to the user
Ok thanks flaz
@slender thistle Succeeded by running them asynchronously (I tried before but definitely didn't do the right things) as suggested on a GitHub Issue
I'm dumb I kept searching 'discord.py on another thread' on Google instead of simply 'running two bots with discord.py'

@pure lion yes, you need to have user id as second index so that you can find it
find({ guild: "264445053596991498", member: "590455379931037697" })
unless your leaderboard is global
Na it's not
then you would only need user id
Yeah I got that
you're set then
So I just make both guild ID and user ID the unique and index thing?
yeah
Okokokok
If it's unique wouldn't I lose the ability to add the same member to multiple guilds?
I’m not sure exactly what you are talking about but I assume since you are using guild and user ids, you wouldn’t lose the ability
Okay, thanks
@tight plinth if ur still trying to figure it out, use stripe
stripe?
yeah
does it work without any cc tho
im not sure if they take a percentage or anything, but i've heard its good and companies use it
not sure
companies like discord i believe
Hey lost, just wanna say thank you for your contributions to this server, it's really helped me become a better developer in the long run :>
:D
:D
@digital ibex k so i created my stripe acc & stuff (created a product) but i dont see any button for api docs 
Complete reference documentation for the Stripe API. Includes representative code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET client libraries.
and i dont get how should people actually pay
1 sec, i've never used it so i'll have a look into it
ok im back, @tight plinth you're using js right?
what in particular u tryna do?
When someone donate, I store their discord data into a db and then do things with it
I mean, like every bot premium function does
oh alright
maybe these could help with that?
object: https://stripe.com/docs/api/payment_methods/object
add premium: https://stripe.com/docs/api/payment_methods/create
add month/whatever: https://stripe.com/docs/api/payment_methods/update
premium ends: https://stripe.com/docs/api/payment_methods/detach>
if you need help with any of these, lmk
@tight plinth ^^
I want list of all bots to join them into my server <@&304313580025544704>
Disgrace
ty for muting
Ty Parm for the great mute
when our bots are approved are they automatically added to this discord server?
Yes, also that question would best go in #support
anyone else use Google cloud to host by chance and would happen to know how to get FFmpeg onto it? 😂 it wont run ! 
hi, my bot has a command that takes a few seconds to run because of a lot of processing behind the scenes
unfortunately while this is happening, my bot ignores any other commands you enter until the first command has finished, which i think will get a lot worse when my bot joins more and more serverso
what do i do to fix this?
if the language you're using is multithreaded - offload it to another thread
its possible but a pain
oh lords
yeah node is singlethreaded
are there any other options i have?
other than using another language which takes use of multithreading, i suggest doing research on worker threads
Im tryint to do a dashboard.
Using passport express discordjs
How can I get the user profile avatar in ejs
so i have this div here that i push content into
when it hits the end and has to scroll, how do i force it to stay in the div and make the div have a scrollbar, instead of the actual entire page having to scroll
Hi I am juice wrld
hello
Hello
ok so basically guys i am making a bot in rust and i am trying to figure out how to iterate over commands in an array and call a function from it
this is my main.rs
fn message(&self, ctx: Context, msg: Message) {
let cmd_text = match remove_first(&msg.content) {
Some(t) => t,
_ => {
return
}
};
match cmd_text {
"ping" => {
PingCommand::r(&ctx, &msg)
},
"bruh" => {
BruhCommand::r(&ctx, &msg)
},
_ => {
return
}
}
}
and this is one of the commands
pub struct PingCommand;
impl CommandRun for PingCommand {
fn return_details() -> Command {
Command {
name: String::from("ping"),
description: String::from("Ping the bot")
}
}
fn r(ctx: &Context, msg: &Message) {
if let Err(why) = msg.channel_id.say(&ctx.http, "Pong! (from ping.rs)") {
println!("Problem sending ping command: {:?}", why);
}
}
}
this is the definitions for Command and CommandRun
pub struct Command {
pub name: String,
pub description: String
}
pub trait CommandRun {
fn return_details() -> Command;
fn r(ctx: &Context, msg: &Message);
}
only problem is when i try to do this something weird happens
actully same goes for ::
so question is how can i make return_details and r available in this for loop
So
@earnest phoenix No the files aren't visible to the owner. but if they were previously comitted. they need to be deleted. as I'm pretty sure git will still pay attention to them
well i made a .gitignore file
didnt hide the files
and discord went all crazy on me
say I comitted the file index.js right. But later on add it to gitignore that index.js would stil be tracked
i see
You have to delete it. commit the change. then you can create the file again, and it wont be tracked
the gitignore right? I cant update it?
No, You can update that all you wanna
im confused then, why isnt my files being hidden
config.json
src/lib.js
src/Constants.js
src/Helper.js
commands/owner/*
node_modules/*
src/*
this is whats inside it
added src/* for gitignore to update, didnt work
It should be. weird
Try deleting src. comitting it. then add it back
ill first delete gitignore since i created it first then added the files
if not, ill do your method
imma eat so brb
if you use node.js Math.random() is maybe then thing you look for
Math.floor(Math.random() * maxNumber)
You can make a notepad and type this:
echo off
cls
echo Starting Bot
node .
pause
Then rename the notepad file to whatever you want and add .bat
No
You got an error
Show me the code your error come from
That's not how to make a random int.
What are you trying to do with {{ randint 8 }}
Learn JS?
I am the one and only Lite.
we gave him Math.floor(Math.random() * 100000) in testing 1
Learn how to actually code before coming here looking for free handouts. You obviously don't know what you are doing. Can't help copy pasters
Then learn else where, we are not teachers, we are merely support. There a multitude of places to learn on the internet
No here is gonna hold your hand, it's against the rules to spoon-feed :)
It's not hard to find resources to learn the programming language you're using. For example, https://learnjavascript.online.
uuuuh
i have some dumb code at the moment (see below)
are there any good modules for random id gen that aren't huge and poorly made
isn't uuid a fairly big library
i used random id before which is this
but i was wondering if there's anything smaller
i use crypto for generating random IDs
nanoid is another.
Well, there’s a few simple ways, lower the amount of devices and intensity of those devices using the connection, it’ll help when your bot is peaking and to place it on an optimal server setup, a good computer that can dedicate an appropriate amount of resources to decrease its own time in the equation.
However, I’m not professional and I’m sure someone can provide a much better explanation
what ping did you currently have?
@viral nimbus thanks, but my bot haves a good VPS with good RAM and space
its not really hardware bound, its location bound
I have 72.3
I saw some bots with 23
to get it lower you need to know where the nearest Discord API server is
then try and get a VPS in a nearby datacenter in best case in the same
so you can get a lower ping to the API
Where are the servers located?
idk
Thanks
How to make command but only owner
compare author id
can someone help me
Why did you ping me of literally everyone in the server
No?
@pure lion
OrientedCub#5181
Ohh
How does one make a setchannel command on PY so that if the user sets the says !setchannel #development then it can only be used in that specific channel
Do you have a database
Yes
Is it sql or nosql?
sqllite
Okay all you wanna do is store the command name and a channel ID, and maybe a true/false value checking if it's only enabled in that channel.
How to send an http request?
use http client
like axios, get, http(s), request (deprecated) or any other. (i assune you're using node)
just use other client
I bet dice gets the most pings lmao
Args[0] = command name
oh i need use 1
Yeah
why quick.db not work in heroku its not possible to edit db file from github ?
can sumone help me with discord py
@earnest phoenix i can
quick.db is a sqlite Database and it stores everything in a sql file. If you restart heroku iirc everything gets deleted and pulled from github again @blazing ravine
How do I get the custom status of a user reply with mention kk thanks
I use json as database lmao
buy a vps lol
i guess you need to download the sql file every time before your stop or restart
or use a Proper database like MongoDB or mysql
wdym by proper
no
yes yes ;d
i dont consider SQLite Databases as a fully usable database solution its just a more stable Json DB
k
@marble juniper expensive
@blazing ravine you can get a Free MongoDB database
how
How do I get the custom status of a user reply with mention kk thanks
@glossy elk
google it
but i dont know how to use
well you can learn it
@lusty quest wdym google it
not you
this channel here also has to follow some rules
No
@marble juniper can u send me link for vps
We have to follow the rules
check the pins
Not the channel
also wait gimne a sec @blazing ravine
oki
Powerful VPS hosting – SSD storage, snapshots, virtual machines equipped with brand new hardware, 100 mbit/s unlimited traffic, starting at just 3,99 EUR/month.
I suggest this
There is a free VPS with 350 MB
for people who are broke this is good
If you want
lol
Library of code
If he is break af then he should use the free one
k
still I suggest buying one if ya got the chance
thanks
@lusty quest 👍
@blazing ravine just say the problem bruh
ads links xd
i cant buy bcs minimum 5$ for withdraw

i see
Developing into a retard
the braincell thing is normal in this channel here
Don’t
Yeah I'm developing 8)
Just don't
M e n e
Did you just become my auto correct
Yes
kek
Cum ping
Dum oing
Fuck
kek
cum
Please keep this channel on-topic.
read up
xp systems
No

Which
off
I wouldn't
No but fr I use it for levels
Ok
I only want one dB for my project 😄
JsonDB is bad for level systems bcs of the on of Writes and reads
Hello yes
sqlite is fine but gets annoying on larger servers
No
It’s super simple and easy
And
You can't change my mind
Holds tight for once you get larger
Is this gonna be a conversation about which db to use again
Yes
k
LALALAALALAL NOSQL IS THE BEST (imo)
anything is fine as long as it isn't a file collation
im excited for the heat

firebase is NOSQL btw @pure lion
Idc
Okay
yes smh
im just waiting for a package to install it's been like 5 minutes
Either way
That's why nosql sux
You do you 😄
...
what I have done is put my levels to SQLite and I’ve mapped each user and ordered it from uh higher to lower

did you order it from iq
🤔
Can I invite my bot here???
Do you have 4 weeks to spare?
??
@clever vector yes you can but what he is trying to say that the process will take a bit
Short answer: yes
-faq 1 -c if you wanna know how to add it
But you should probably ask this in #support as this is a channel for developers to discuss development
and keep this channel on topic
@glossy elk what
Hi, I want to delete a value from json. But it doesn't work. I using:
let json = require('./json.json')
let data = "hello"
delete json[data]```
and json is:
```json
{
"hello": {
"world": "hello"
},
"hi": {
"world": "world"
}
}```
re-save the file after you delete the value
Let me try, thanks
Also why am I the person that gets randomly pinged now :/
it's better to use fs to read the file and JSON.parse() to parse it rather than requiring it since requiring caches the file, even if you require it again (you'd have to clear the require cache)
@earnest phoenix are you using json as your database?
You really don't wanna do that, it's slow and corruptible
I'll give you the benifit of the doubt but you should consider switching to a proper db
😄
Hi, I'm tryna use my rpi for hosting something, but it keeps closing the ssh connection. Any idea why this might be?
botu nasıl 24 saat çevrimiçi yapabilirim ben denedim olmadı siz nasıl yaptınız
Burada Türkçe yok.
ok
case 'addsong':
async function execute(message, addsong) {
const args = message.content.split(" ");
const voiceChannel = message.member.voiceChannel;
if (!voiceChannel)
return message.channel.send(
"You need to be in a voice channel to play music!"
);
const permissions = voiceChannel.permissionsFor(message.client.user);
if (!permissions.has("CONNECT") || !permissions.has("SPEAK")) {
return message.channel.send(
"I need the permissions to join and speak in your voice channel!"
);
}
}
Version: Visual Studio Code v12
Error: Not responding
Belli :p
@fathom peak aga #memes-and-media gel
@fringe axle why are you doing a fucntion
Don't use a function
Np
supppppppppp
function xp(msg) {
const Gdata = await Guild.findOne({guildID:msg.guild.id})
if (Gdata.XP == false) return
var prefixes;
if (Gdata == null) {
prefixes = 'aa!'
} else {
prefixes = Gdata.prefix
}
const newUser = {
_id: mongoose.Types.ObjectId(),
guildID: msg.guild.id,
userID: msg.author.id,
xp: 0,
level: 1,
enabled: false
}
const Mdata = await GuildMember.findOne({guildID:msg.guild.id, userID:msg.author.id})
const newLevel = Mdata.level * 500
if (msg.content.startsWith(prefixes)) {
return
} else {
var randomInt = Math.floor(Math.random() * 10) + 15
if (!Mdata) {
const db = new GuildMember(newUser)
db.save()
console.log(db)
} else if (Mdata) {
Mdata.updateOne({xp: Mdata.xp + randomInt})
} else if (Mdata.xp > newLevel) {
Mdata.updateOne({level: Mdata.level + 1})
}
}
}
this is what i have for my xp func so far, is it condensable in any way?
const prefixes = Gdata ? Gdata.prefix : "aa!";
if(msg.content.startsWith(prefixes)) return;
const Mdata = await ....findOne(...);
if(!Mdata) {
const newUser = {...}
const db = new GuildMember(newUser)
db.save()
return;
}
...
``` id do it more like this
Thanks Tim I'll blindly copy that and not edit anything and then come here to complain that it doesn't work
Shiv are you trying to predict what I'd do because it's definitely not that 
Also thanks tim
You get used to it
is this normal ?
looks normal
xd
Lol I'm procrastinating launching the xp system because I'm worried
actually my bot detects the channel name how can i set it to detect channel topic?
const data = await Guild.findOne({ guildID:msg.guild.id });
^^^^^
SyntaxError: Unexpected token 'const'
DAFAQ
client.commands = new Discord.Collection()
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command)
}
AAAAAAAAAAAAAAAAAAAAAAAAAA
show the code where you have const data
i fixed it
just forgot to include the contents of an if statement
shard 0 connected... wish me luck
if (!args[1] || args[1] !== 'enable' || args[1] !== 'disable') {
msg.channel.send('Please choose wether to `enable` or `disable` `messages` or `xp`')
} else if (args[1] === 'enable' && args[2] === 'xp') {
data.updateOne({XP: true})
} else if (args[1] === 'disable' && args[2] === 'xp') {
data.updateOne({XP: false})
} else if (args[1] === 'enable' && args[2] === 'messages') {
data.updateOne({XPmsg: true})
} else if (args[1] === 'disable' && args[2] === 'messages') {
data.updateOne({XPmsg: false})
}
this is NOT working do not stack else ifs like this its stupid please help
<Model>.updateOne({find query}, {update query})```
yes please i want to do that
if(args[1] === "enable") {
if(args[2] === "xp") { update xp }
else if(args[2] === "messages") { update messages }
} else if(args[1] === "disable") {
if(args[2] === "xp") { update xp }
else if(args[2] === "messages") { update messages }
} else {
please chose one
}
args btw
[ 'xpconfig', 'enable', 'xp' ]
you could also use switch cases, or you can also setup some smart object relational map
also why didnt i think of that
wtf has happened to quick.db npm install quick.dbis giving a heckload of errors
show full logs
one sec
including what comes before the errors
python is not installed
climax
npm install -g windows-build-tools
what is the best way to measure cpu usage in js? because mine is pretty broken https://lumap.is-inside.me/eanTTYr9.png
i wrote this a while ago to explain it```js
// get approximate CPU usage of the current proccess over a given amount of time in milliseconds
async function cpuUsage(time) {
// store current cpu timings
let startTime = process.hrtime();
let startCPU = process.cpuUsage();
// wait for a defined time in ms
await new Promise(r => setTimeout(r,time));
// get timings difference
let elapsedTime = process.hrtime(startTime);
let elapsedCPU = process.cpuUsage(startCPU);
// calculate high resolution milliseconds from process.hrtime()
let milliseconds = elapsedTime[0] * 1000 + elapsedTime[1] / 1000000;
// calculate high resolution milliseconds of CPU activity
let timings = elapsedCPU.user / 1000 + elapsedCPU.system / 1000;
// calculate percentage from cpu time and total time
let percentage = 100 * timings / milliseconds;
// return approcimate percentage of cpu used by this process
return percentage;
}
if you add toFixed(2) to the return percentage you get only the first 2 decimals
python is not installed
@quartz kindle it is now
and npm i quick.db is taking forver
it depends on your hardware and your network speed
smh python and stuff wasn't on glitch and still worked fine
but i am temporarily self hostign the bot
they have a different way to install the needed packages
with my better than glitch non-boosted apps pc
they have a different way to install the needed packages
@lusty quest they linux me windows 7
?
my glitch project is using ubuntu
and my pc is windows 7
don't wanna upgrade to windows 10
wtf i needed to press enter and that's why it was stuck
and now more errrrrrrrrrrorrrrrrrrrs
F quick.db
show errors
closed console
cloning the package.json from my github
and then running npm i
you want screenshots of those?
@quartz kindlep i n g o
does findMany mean i can get all the documents that pass the test (aka i wanna make a leaderboard/rank system)
i installed python twice but it still says python isn't there
also i like how ive been here for like 4 months and have a just under third of the amount of pings tim has
findMany({'id': 'mylovelystring'}) should return an array of all documents found with id key and mylovelystring value
sickkkk thanks shiv
i installed python twice but it still says python isn't there
where are you installing Python
the windows installer
Are you adding Python to PATH
lemme screenshot my console
Are you adding Python to PATH
@slender thistle no
lemme resintall
There you go
and i also ran npm i python
... python isn't an npm package, is it?
YOOOOOOOOOOOOO MY XP SYSTEM DOES||NT|| WORK
it installed
YOOOOOOOOOOOOO MY XP SYSTEM DOES||NT|| WORK
@pure lion YOOOOOOOOOOOOOOOOO MY ECONOMY SYSTEM WORKS BUT QUICK.DB DIES EVERY FIVE SECONDS
removing the entire python installation and i swear i will kill myself if i forget to add it to PATH
@slender thistle am i doing this right
wtf
is it the same python not found error?
i haven't reinstalled yet
i don't get this why does a javascript library quick.db require python
i am scared of snake languages
pretty_sure_everybody_writes_python_like_this
I mean, it's down to preferences
you want the screenshot
but for consistency, I use snake case
i uninstalled then i'm halfway through installing with adding to PATH
and what is PATh ❓
Why if i run the prefix command the bot don't respond but data is being created everytime in db?
Code :
allow me to fix dis
path to system variables so if you do python, the command prompt will search for python.exe somewhere
if you write non-english sorry but i can't help
instead of you having to run C:\Users\Program Files\xxxxxxxxxx\python.exe
quick.db requires better-sqlite3, which is built on top of the SQLite3 database. SQLite is made in the C language, so it requires a compiler, to be built specifically for compatibility with your machine
node.js uses node-gyp as the compiler, to build these programs that are made in C and C++
and node-gyp is built on python
specific commands
thats why installing quick.db requires python and windows build tools
python is a snek vibe
your message is split in three
i wanna allow few commands
in only the servers
which i set
thats why installing quick.db requires python and windows build tools
@quartz kindle wait windows build tools
in commands, use if message.guild.id === "ID OF YOUR GUILD"
why
a global array to use .includes(message.guild.id) on
no spoonfeeding
//You run npm i quick.db in the console before hand
const db = require("quick.db");
//when something happens
db.push("premiumGuilds.guilds",GUILD ID THAT YOU GOTTA FIGURE OUT BOY);
if (db.has("premiumGuilds.guilds",message.guild.id) {
//smth
} else {message.reply("you need premium buddy")}
no spoonfeed i did
only explained what you asked
o
ok
so
i wanna make a command that creates data in that
it will be like this
?
deleted
also no spoonfeed
just ask for methods of doing stuff not "hey can you do this"
show me your code
if(command === "activate"){
const owners_id = ["587663056046391302"];
if (!owners_id.includes(msg.author.id))
return msg.channel.send("You not owner boi");
let premium = db.get(`premium_${msg.guild.id}`)
db.set(`premium_${msg.guild.id}`, args[1])
await msg.channel.send(`This Server id is now has access to premium features : ${args[1]}`)
}
}```
i will do server id
like
s!activate server id
const owners_id will stay only till your bot is on. PS you are resetting it to ["587663056046391302"] every time someone runs it
const owners_id will stay only till your bot is on. PS you are resetting it to ["587663056046391302"] every time someone runs it
@earnest phoenix what?
wtf why are you using variables for quick.db
you can straight do db.get
hmmm
explain me what you're trying to say lol
ok
so
i am saying like u pay me 3 dollars for premium
i go to your server
and then copy your server id
then do s!activate server_id
wtf why are you using array for const owners_id you are the bot owner
ys
@delicate shore there's a much better and easier way to do this
then do s!activate server_id
@delicate shore basically you die in dms if your bot blows up in popularity i hope so
lemme tell you a better method
ok
what the...?
//You run npm i quick.db in the console before hand
const db = require("quick.db");
//when something happens
db.push("premiumGuilds.guilds",GUILD ID THAT YOU GOTTA FIGURE OUT BOY);
if (db.has("premiumGuilds.guilds",message.guild.id) {
//smth
} else {message.reply("you need premium buddy")}
@earnest phoenix what???
what the...?
@earnest phoenix IM NOT SPOONFEEDING
I don't know...
I mean I do know but w h y
your code is wrong
lemme make it easier to understand
no
i explained it wrong
yes
lemme tell you a better method
@earnest phoenix ok?
=> //when something happens
is supposed to be
//when someone buys premium
It's literally two lines :/
@earnest phoenix ok?
@delicate shore one sec
ok
Youre storing a guild ID?
accidental shift + enter
2 lines
im just gonna check for a role in my discord server on a premium role 
ok
anyone know what to do when a company doesnt reply to an api request ?
anyone know what to do when a company doesnt reply to an api request ?
@spare mirage Murder them
as simple as that
whats the best way to murder ubisoft? or Blue Mammoth Games
let guildID = args[1]
db.set(premium, guildID)
O
I dont think that will work
it should
aight imma try
i need music commands -_-
noice
-_-
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
nop didnt work... Should I just nuke ubisoft
what api should I use for a music bot?
@delicate shore wats that?
whats better
You need to first install quick.db through npm i quick.db in the console
const db = require('quick.db`);
//SOme code that runs when someone buys premium that you gotta figure out. It needs to run this next:
db.push("premiumGuildsArray.theArray",whateverTheGuildIDWasThatYouNeededToSToreINtoAVariableAndReplaceThisWIthIt);
if (command === "poopimages") {
if (db.has("premiumGuildsArray.theArray",message.guild.id) {
message.channel.send(":poop:");
} else {
message.reply("YOU NEED TO BUY PREMIUM!!! SO YOU CAN YELL IN CAPS");
}
}
i don't use it anymore
typed it all out
anyone here trying to help me in discord.js?
I want to make my bot to send message when a certain member comes online
lmao why
Thanks
lmAO WHY
yall taking to me?
yes
yes
const db = require('quick.db");
let premiumservergay = //code here
db.push("premiumGuildsArray.theArray",${premiumservergay});
if (command === "poopimages") {
if (db.has("premiumGuildsArray.theArray",message.guild.id) {
message.channel.send(":poop:");
} else {
message.reply("YOU NEED TO BUY PREMIUM!!! SO YOU CAN YELL IN CAPS");
}
}```
@earnest phoenix will this work?
no
Yea
GUILD_MEMBER_UPDATE should be the event you want, Nuvin
It will work
no for one key reason
what?
anyone here trying to help me in discord.js?
I want to make my bot to send message when a certain member comes online
its a just funny thing i want my bot to do
the ' doesn't end
ohsorry
GUILD_MEMBER_UPDATE should be the event you want, Nuvin
one sec
GUILD_MEMBER_UPDATE should be the event you want, Nuvin
@slender thistle
like when the person comes online on DC the bot has to send a message
You need to first install quick.db through npm i quick.db in the console
const db = require('quick.db');
//SOme code that runs when someone buys premium that you gotta figure out. It needs to run this next:
db.push("premiumGuildsArray.theArray",whateverTheGuildIDWasThatYouNeededToSToreINtoAVariableAndReplaceThisWIthIt);
if (command === "poopimages") {
if (db.has("premiumGuildsArray.theArray",message.guild.id) {
message.channel.send(":poop:");
} else {
message.reply("YOU NEED TO BUY PREMIUM!!! SO YOU CAN YELL IN CAPS");
}
}
this is correct now
Yes, when that event is fired, check if the member's status changed from offline to online
ok
@delicate shore how do u play the music in the bot?
How do i make my bot wait for me to reply with SMTH and it stores it into let userInput? Basically replicate process.stdin
help
me
die
@delicate shore how do u play the music in the bot?
@spare mirage YT_Search
how do I make the music play in the voice channels xD
I GIVE UP I WILL JUST WAIT A DECADE FOR GLITCH TO FIX MY BOT INSTEAD OF SELF HOST IT TEMPORARILY
how do I make the music play in the voice channels xD
@spare mirage ok
I GIVE UP I WILL JUST WAIT A DECADE FOR GLITCH TO FIX MY BOT INSTEAD OF SELF HOST IT TEMPORARILY
@earnest phoenix i also use glitch
i have bought the premim
my bot included
discord blocked a hell lot of their servers from using the APi
npm is killing my pc
How
i have to shift to vps as soon as my premium membership finishes
of glitch
can anyone recommend fun commands???
meme 8ball blackjack coinflip dice roll dog pics (i have a lot of em) cat pics (them too)
Alexflipnote api
why is YT_SEARCH so damn complicated
it is easy
It's not hard
add me to your server PGamerX
meme 8ball blackjack coinflip dice roll dog pics (i have a lot of em) cat pics (them too)
@earnest phoenix i am unbale to add
the
Also why not use an api
super simple
how


