#development
1 messages · Page 631 of 1
When i'm trying to install better-sqlite-pool npm package, i have this error:
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:165:21)
gyp ERR! System Linux 4.15.18-11-pve
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/Bot/node_modules/integer
gyp ERR! node -v v12.4.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN discord.js@11.5.1 requires a peer of @discordjs/uws@^10.149.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of bufferutil@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN enmap@4.8.7 requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN zebra@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! integer@2.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the integer@2.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-06-08T22_27_57_995Z-debug.log
Someone can help me ?
Debian 9
okay
is make installed
After ?
then try to install better-sqlite-pools
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:200:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.15.18-11-pve
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/Bot/node_modules/integer
gyp ERR! node -v v12.4.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN discord.js@11.5.1 requires a peer of @discordjs/uws@^10.149.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of bufferutil@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN enmap@4.8.7 requires a peer of better-sqlite-pool@github:eslachance/better-sqlite-pool but none is installed. You must install peer dependencies yourself.
npm WARN zebra@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! integer@2.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the integer@2.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-06-08T22_32_02_095Z-debug.log
I have this error now
err hold on
^ make is erroring, the dependencies dont mean shit
Hum, i can't install better-sqlite-pool so ?
I have the same error
Okey, thanks for help me c:
no worries
I resolve my error
I enter this commands:
- sudo apt-get update
- sudo apt-get install build-essential checkinstall
- sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
- cd /usr/src
- sudo wget https://www.python.org/ftp/python/2.7.16/Python-2.7.16.tgz
- sudo tar xzf Python-2.7.16.tgz
- cd Python-2.7.16
- sudo ./configure --enable-optimizations
- sudo make altinstall
And now, it work
Ok, so I'm sorry, But something in this isn't working. I'm not getting ANY errors at all.
const Discord = require("discord.js");
const FactsAmount = factArr.length;
module.exports.run = async(bot, message, args) => {
var funFact = factArr[Math.floor(Math.random()*(FactsAmount - 1))]
let factEmbed = new Discord.RichEmbed()
.setTitle("Fun Fact!")
.setColor("#" + (Math.random().toString(16) + "000000").slice(2, 8))
.addField(funFact.slice(0,1), funFact.slice(1))
.addField("More fun facts coming soon!", "We still have quite a lot, though!")
.addField("Credit:", "Most funfacts from www.thefactsite.com")
.setFooter("NerdBot | By Wolfalamew#7784", "https://imgur.com/a/VB6UoR5");
}
module.exports.help = {
name: "funfact"
}
are you sending the embed? I know in py you have to send it separately for embeds
Yeah he’s not sending the embed rofl
just ask
@olive path Everything works perfectly, except the part you're not sending the embed.
use message.channel.send({factEmbed}); after .setFooter("NerdBot | By Wolfalamew#7784", "https://imgur.com/a/VB6UoR5");
or ^
yah mine won't work, I don't code like that
the only API I ever used was Discord lol
I
Am an idiot
😂 I'm sorry
Oof so I have one last issue I would like some help on if possible
(I'm going to use a pastebin link gimme a sec)
Thanks for the help by the way 😃
What's the issue then?
The uptime always returns 0 Hours, 0 Minutes, and 0 Seconds
Move line 6 to 10 right under line 24
Not really experienced with js but give it a try
I see the issue, but I want you to figure it out. Have you debugged the code?
Relatively
I honestly have no clue
Gimme a sec to see what it says and read it over more thouroughly
Nope I don't get an error
It thinks the values are 0
But why?
WAIT
I put it before the event is called
OHHHHHHHH
Thank you
I know you really just made me think, but it was helpful lol
Nope still doesn't work
lmao
I'm sure it was necessary, but wasn't the whole issue
This time i think it was a stupid mistake lemme try again
Sorry for spam
Nope still not working
Ok let's try this again
Here's my new paste
When is run() called?
k so I believe the issue was you're creating a new client in this module
since it's not the one processing the events, the uptime will be 0
oh
that makes a lot of sense
Ohhhhhhhh I see
I added the new
so do I just take out new for it to read the current or do I have to change something else to get it to read the one from NerdBot.js (the main file)
you need to change stuff around to get the one from the main file
Oh wait, I see how to do it
Gimme a sec to try this
Nope, it reads NerdBot.bot.uptime as undefined
bot is what I set Cliennt to in the main
Client*
(node:14968) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'uptime' of undefined
if you're not returning anything or w/e, then the module will have nothing
look up how node.js modules work
afk
Sorry I was afk I'll look it up
Ohh that's what you mean
No, I have that and everything else in it works
It just returns values of 0
Anyways, It is nearly 1AM here, so for now good night!
how can i achieve something like this ?
https://i.imgur.com/IwL4OC4.png
Use an image processing library
any recommendation ?
js, ok, thnks for help i will start digging now
Here's what i found if anybody needs it
https://discordjs.guide/popular-topics/canvas.html
A guide made by the community of discord.js for its users.
How do I see if my bot has the privileges(authority) I want?
]]moreinfo
If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.
nodejs
guild.me.hasPermissions(['array', 'of', 'perms'])
channel.permissionsFor(guild.me)
guild.me.permissionsIn(channel)
just check the docs its all there
very thx
wait so if I
!help
Oh help me
--help
-help
lmao this is great
?help
I have cursed myself
How I can I help you sir
Sir I think you are looking for #265156361791209475 channel
Tfw no mods online smh
hi
Why people make bot without prefix
@near igloo if you are trying to get into the Desktop directory do cd Desktop
I have to do it str?
What is content
Is there any integer involved
Will you people ever fucking use commands extension
... If I want use this don't fucking insult me, shit
(Is this one of those "It's good if it works" cases)
('people' is an insult now?)
Back to the original question
... people use discord.py-rewrite and don't use await client.process_commands(message)?
I don't either
Oh man
Big thonk
Trust me, many people still use the old version
I started discord.py using @client.command() for all my commands
There is a shitton of poorly made bots out there
bleh
my bot is probably still poorly made, nonetheless
:akkoderp
wh--
my emoji disappearedd
Hi
Hi
Hi how is your day
Hi don't casually chat in #development
Is there any way to receive messages when someone votes
yes, use webhooks
any documentation?
You're asking in the wrong channel, and leave it empty for now
@balmy rover the owner of the bot
And the invite url you dont need if you doesn't have a server
I would want to make a system to manage some bot's settings online (probably using js) but how can I make it dynamic like when I press a "Save" button, it updates something like a redis cache AND display something in the webpage?
reload the page or ajax?
nah i don't realy want to reload so I can display a NOICE toast to confirm save
I don't know if a framework like vuejs or something may do the trick 
just use ajax lol
I made a setting command in java for my bot but a nice dashboard would be nice so I want to manage to make it
i'm gonna think about it thank dude
👍

We have developed a giveaway bot, one which has multiple requirement settings for giveaway entry.
Users have been experiencing issues with the server requirement setting; this setting requires all giveaway entrants to join a specific server before they can react to enter the giveaway. Should they not be in the server, the bot will remove their reaction and send them a DM to tell them to join the server then try again. Once they have joined the server, they will be able to react. An additional feature to this setting is that if they leave the required server, the bot will remove their reaction and send them a DM to tell them that their giveaway entry has been revoked and they need to re-join the server to re-enter the giveaway.
The issue which SOMETIMES occurs is that even though the user has joined the required server, the bot will remove their reaction and send them a DM to tell them that their entry has been revoked, even though they did not leave the required server. Additionally, it sometimes spams the revoked message instead of just sending it once.
Any help to try and fix this issue would be appreciated.
we are using discord.js
lemme guess, you are requiring to join the bot's support server just to use it normally
No, we have a giveaway requirement setting that requires users to join a specific server before they can react and their reactions will get revoked if they leave
how are you checking if said user is in the server?
Basically, we have a 30 second interval that goes over all active giveaways in an array of giveaway message ids and then go over every entered members ids using foreach. We then get the required guild id from the giveaway database json, and run
await client.guilds.get(requiredserverid).members.get(memberid)
and if the if(! statement gets passed, remove their ID from the entered members array & remove the reaction.
you could just check it when it draws and continue drawing until their in the guild
because if there is a big guild you could get rate limited if a lot of people leave at once or maybe there's an outage or something
unless you also check for outages
draws?
Would there be any possible fix for the issue other than doing it right when the giveaway ends?
@split hazel do you have any code to account for offline/uncached members?
we dont, we used to have the bot fetch all users though
we're able to do it though, we have plenty memory
18 gigs
you dont use fetch all anymore?
nope, we used to
then that might be the issue, or part of the issue
you can try using guild.fetchMember() instead of members.get()
would fetchAll compensate for this?
i believe so, but its pretty resource intensive
Alright, thanks for the help
you can also use guild.fetchMembers()
its the same as fetchAll just per guild instead of all guilds
I

How do you make that animated profile picture?
the server icon you mean?
np
I wish nitro wasn't as expensive lmao
I mean they need money for their shit servers
Ok ik that question old but that’s a shitty idea
Why would you want people to join “a specific server”, which we all know would be yours, just to use your bot?
It’s an unnecessary requirement which would just deter users away from your bot.
uh
How would I make a starboard function thing
I dont think you understand it tho
Mine isn’t working
Oh k
the users decide the server it seems
idk maybe I have it wrong
I just dont think requiring people to be in a server to use a bot entirely is just a dumb idea
Anyone know how to make the bot do skemthng with a message if it gets reacted 5 times with a reaction, like a starboard
What lib
Discord.js
Listen to messageReactionAdd
If the message has more than 5 of those reactions, post it to the starboard channel
you may also want to use raw events for uncached messages
but that's a little more advanced
^
Well
K
"advanced" 
Imo raw events r beyond the scope of most who use discord.js
What raw events?
And just for the information, the guild requirement is a feature which anyone can use that requires the user to join a specific member to join the specific server if they want to join the giveaway. We do not limit features if they do not join the dev server
Wouldn’t the giveaway take place in the server where the command is called?
im guessing it works on concept of gleam, require for the user to be in x amount of servers to enter giveaway
its dumb considering a user can only be in 100 guilds max
No.
X server hosts the giveaway and can require users to join Y server before being able to enter. It is effective for servers that host "you must join this server to win" giveaways (usually done for paid advertising). Also, server requirement is not the only setting, it has role and message requirement as well.
People should just grow brains and let those kind of giveaways die out 
You'll only get dumb kids to join your server, hoping to get a reward
Most people who do them are literally just doing it because they want more members so they can look cool
Anyone with a functioning brain doesn't give a single fuck about how many ~dead members your server has
So what's the point
I hate "dead members" to the point when I'm hesitant to start pruning them all
do it
how to like
make global variable
so like
the variable/array is valid in all commands
anyone?
plz
i am using discord.js commando
Bot variable?
pass the variable through the function
ok
how?
there is discordjscommando docs
the docs are trash
A guide made by the community of discord.js for its users.
a little info
xD
//index.js
module.exports.coolVariable = "hey im cool"
//command.js
const { coolVariable } = require("index.js")
console.log(coolVariable) //"hey im cool"```
oh wait
commando has that
oh
well in that case you could likely do
//index.js
client.coolVariable = "hey im cool"```
```js
//command.js
console.log(client.coolVariable)```
just make sure the variable name doesnt onflict with any other client variables / functions
yaas
Yay thanks
Yes
yes
Ok
Hm
i got my bot back up and running im so glad.
Hi
With this example of code in dbl documentation
const express = require('express');
const http = require('http');
const app = express();
const server = http.createServer(app);
const dbl = new DBL(yourDBLTokenHere, { webhookAuth: 'password', webhookServer: server });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running with path ${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
app.get('/', (req, res) => {
// ...
});
server.listen(5000, () => {
console.log('Listening');
});```
I do just replace password and yourDBLTokenHere
What is server and password
password is authorization ?
And what is URL ?
url is the url to your webserver
password is a form of authentication that verifies the request comes from dbl
as anyone can send a webhook
In this example of code i do replace password by the authorization ?
yea
url is the url to your webserver```
const express = require('express');
const http = require('http');
const app = express();
const server = http.createServer(app);
const dbl = new DBL(yourDBLTokenHere, { webhookAuth: 'password', webhookServer: server });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running with path ${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});
app.get('/', (req, res) => {
// ...
});
server.listen(5000, () => {
console.log('Listening');
});```
Yes but
In this example what is url
none
yourpublicip:5000
you seem to be misunderstanding how webhooks work
Yes
server.listen should handle that
you need an active server which exposes it's ip, then you need an app which listens to a specific port
when an action is done on dbl, dbl will attempt to send a request to your webserver with specific data
🤔
webhooks are done from the api to your server, normal api requests are done from your server to the api
there wouldn't be a need for webhooks if dbl had a websocket server, but it doesn't so it has to be done via webhooks
the webhook request doesnt expect any content back
I just do not comoris what URL and server
you normally wouldn't run a webhook server on a personal computer
rather, you would run it on a proper vps
const http = require('http')
const server = http.createServer(app)
const app = express()
const bot = new Discord.Client()
const dbl = new DBL('MYTOKEN', { webhookAuth: 'MYPASSWORDAUTHORIZATION', webhookServer: server })
dbl.webhook.on('vote', vote => {
console.log("Vote")
})
server.listen(5000, () => {
console.log('Listening');
});```
stop copy pasting the same code
My system of vote work but i want make a system with whebooks
No this is an other code
This is my actuial code
jesus christ
the url is the url to your server which accepts webhook requests
stop having a low iq
DBL will send a request to your Server
yea
an extra tip; protect your server with an ssl cert and cloudflare
it's going to be harder to knock your server down if someone is going to ddos it
There is a test button
Ok i test
Hum does not work 🤔
When i go to the link of my server he say in the page : Cannot GET /
🤔
?????
When i make :
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
})```
He say my whebhook is : http://0.0.0.0:0/dblwebhook
you know what
it would be wonderful if we only had a website
where we could search stuff
i know it sounds weird but bear with me
Guys is there a way that i can convert snowflake into date time
so i can pick the time the last message sent
@Nebulus#8919 serverip:5000/dblhook
@lofty hamlet then press the trst btn
But it isnt working
ayyy hi?
Ok i go test
`ERROR Unhandled rejection: DiscordAPIError: Invalid Form Body
content: Must be 2000 or fewer in length. `
exports.run = (client, message, args, level) => {
const canvas = createCanvas(200, 200);
const ctx = canvas.getContext("2d");
ctx.font = "30px Impact";
ctx.rotate(0.1);
ctx.fillText("Awesome!", 50, 100);
var text = ctx.measureText("Awesome!");
ctx.strokeStyle = "rgba(0,0,0,0.5)";
ctx.beginPath();
ctx.lineTo(50, 102);
ctx.lineTo(50 + text.width, 102);
ctx.stroke();
loadImage("https://cdn.glitch.com/b2838ab8-1d50-4644-b583-c093a6be8b39%2Fimageedit_1_9745658379.jpeg?v=1549225671662").then((image) => {
ctx.drawImage(image, 50, 0, 70, 70);
message.channel.send(canvas.toDataURL());
});
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User"
};
exports.help = {
name: "profile",
category: "Fun",
description: "Gives some useful user statistics",
usage: "profile"
};
help pls
that returns a data uri
data:image/
it won't embed and it's in base 64
it's too long to be sent in chat
ummm ik but how do i send canvas?
i think im retarded i cant use .deconstruct()
Hello, I’m new to dev. I want to add a bot to my server, but I’m having difficulty.anyone available?
@earnest phoenix how do i send embed?
@merry remnant go to O2AUTH
convert the canvas to an image
Thx Sax
@fiery stream you need to send it as a buffer
SaxToday at 12:05 AM
i think im retarded i cant use .deconstruct()
you can easily convert the snowflake into a date yourself, skip 22 bits* in the snowflake and add discord's epoch to it, it will give you a unix timestamp which you can then convert to a date
What is O2Auth?
as an attachment yes, in the files field
@earnest phoenix so basically shifting
yes
.send({files: new Discord.attachment(imageAsBuffer,imagename)}) or Discord.messageAttachment depending on your d.js version
didnt I send that earlier?
thanks
@tidal oar what is O2Auth?
@split lantern Cannot GET /dblhook
Its this
@tidal oar Discord.SnowflakeUtil.deconstruct('id')
Why would you do that tho
@lofty hamlet /dblwebhook
@Sax what is O2Auth?```
it's OAuth2, what do you want to do again
Work thx
i need the timestamp which returns a snowflake
@earnest phoenix I’m trying to add a bot called smoogle to my server
@_@
😂
god...
I’m confused
could have looked at the docs lol
this returns a Date am i right
ye
so i can convert it into miliseconds
For whebhook vote.user say id of user but vote.user.username does not work 🤔
or you can use createdTimestamp directly
@lofty hamlet vote.user returns the id of user
Yes but i want the username
you need to use client.users.get(vote.user).username
^
Ok thx
ok, let’s try this again, I’m trying to add a bot to my server, smoogle, but it’s not connecting to discord
I cut and pasted the web addy to the channel, the link goes up, I click the link, I get the bot app, it asks me to select the server but none are listed.
In app website
you're logged in with the wrong account
Are you sure you have permissions
no
My system is dbl.hasVoted(message.author.id).then(async voted => {
With webhook i do not change ?
????
on webhook vote save it locally that the user voted
My voting system worked but I changed it with the webhook because it was not instantaneous to recover the lot
Basically it's an order and when you voted you must redo the order
You wanna get a database
and store the last voted in it
Wich you just update on the webhook event
But I do not want to change anything my system is very good I want to set up the webhook just because when we voted it did not give instant rewards
@split lantern
Well change it or live with it
in the webhook event you wanna do your stuff
?
anyone know currently dealing with a influx of self bots on my server so was denying channels so they wouldnt see members list and be able to send dm ads
but self bots can just go get members list regardless if they have a common channel right? 
discord really needs a better way to defend against self bots....
I dont think discord intended for people to list servers publicly outside of yt channels, games, etc tho either
But yeah, they do
guess by doing channel lock down at least stop the people spamming junk via a client
including dm
but moment self bot its...
can confirm https://oh-mah.ga/ORCu7gJY.png
@tidal oar @split lantern @quartz kindle I’m at a loss. I only have one discord account, but when I log out and in on the website, it shows my nick with a different number
Might have two
Ok, I need to delete one
ERROR Unhandled rejection: TypeError: The resource must be a string or Buffer. canvas help
code
^
@split lantern thanks for your help, got it straightened out!
np
mmm
i got my bot started from scratch without help but i need one thing of note
how would i do a leveling sytem?
Detect when a user sends a message and give them a random xp value within a certain range, and set level tiers according to the total xp
The numbers and stuff are up to you. Every bot is different
so set like...
Hi everyone, I am trying to learn C++ (after learning Java in college) and decided to undertake a project of making a Discord Bot with CPP. Can anyone recommend me good libraries?
heyo
go to a app or website called "sololearn"
@mighty verge
it can teach all of the major languages
do you know any other code besides c++ though @mighty verge
I haven't heard of any c++ libraries for discord tbh, nor would I recommend making one in c++
you're better off coding a discord bot in js or python @mighty verge
I already programmed discord bot in Java tbh, I just wanted to challenge myself with something more complex
Learn C#. It's similar to C++
mhm
then try python
im using c# for my game
You can make complex bots in java as well. Nothing can stop you
(I hate python lmao)
misses an indent
such as var for example is variable
reconize things in a code
again ... go use sololearn
its very easy to use and easy way to gain information on what you need and can use to create your projects
I never like Python tbh, I don't like the structure of the language and the only times I use it is when needing to write simple scrips that are simply too complex for bash (mostly for CI/CD at work)
python isnt complex
And I mostly dislike most language that are not type-safe
but you want to go for a complex one when not knowing or even liking simple language first?
thats the first i ever heard that out of anyone
I already know Java from a college course
college courses teach you up to 4-5 codes
Nice, but I never said that I don't know any complex languages
this is kinda starting to get to a general type discussion
SpringBoot is a java library to (mostly) create web services, split them easily into micro-services and also do load balancing if you know how the use the api well
cool
anyways
@pale marsh doesnt it start with "addFeild" for making list of xp
thus would be a body though
not the head of the set of comands
wait
Wdym addField?
hi
Can someone explain the discord.state output lines in this? Me and my partner suspect something is causing massive slowdowns post-integration with the dbl api.
P1: https://pastebin.com/6Q6S7SG3
P2: https://pastebin.com/5Fx3L1rZ
P3:
discord.client - INFO - 2019-06-09 22:43:38,878 - Got a request to RESUME the websocket.
discord.gateway - INFO - 2019-06-09 22:43:39,347 - Created websocket connected to wss://gateway.discord.gg?encoding=json&v=6&compress=zlib-stream
discord.gateway - INFO - 2019-06-09 22:43:39,366 - Shard ID None has sent the RESUME payload.
discord.gateway - INFO - 2019-06-09 22:43:43,466 - Shard ID None session has been invalidated.
discord.gateway - INFO - 2019-06-09 22:43:43,473 - Shard ID None has sent the IDENTIFY payload.
discord.gateway - INFO - 2019-06-09 22:43:43,541 - Shard ID None has connected to Gateway: ["gateway-prd-main-cq5j",{"micros":29968,"calls":["discord-sessions-prd-1-27",{"micros":26247,"calls":["start_session",{"micros":20557,"calls":[]},"guilds_connect",{"micros":4,"calls":[]},"presence_connect",{"micros":1,"calls":[]}]}]}] (Session ID: 9e2e90b9f48aec641f1e2fc6574ab5c0).```
^
(its usually 2%)
And it seems to run like this on a constant loop
I would hope someone helps us soon too
Looks like you might have something locking the thread. Not sure though tbh
How would anyone give you a solution without even looking at your code? lol
well we have reason to believe its because of the dbl api
so we though looking at the logging info, you could tell us how we were implimenting the bot wrong
the dbl handling is done in system.py
@pale marsh
cant really read python
How can I be helpful if I cant read python lmao, its not like I'm the only dev here can help you just wait
How long does it take for my bot to be reviewed
well @sinful lotus then you dont reply at all
Roughly a week, perhaps longer @earnest phoenix
its like those amazon answers that go "dont know, havent arrived yet" like why reply then at all
^
Im just stating I cannot read python
you guys are overreacting over a simple matter
Its my opinion, am I not allowed to voice what I think of?
no point
You should have done that before you even pinged me
lmfao
yeah true
You can ask somewhere else at this point tbh
@sinful lotus how to turn on bot, yardim botun pls
I should have known it was no point
jk
It annoys me ping me just to say that when I'm busy recoding something
sry
not you zee dont worry
lmfao
ok, @earnest phoenix, that's enough.
We came to get an issue fixed.
This tangent is irrelevant.
So me and @versed fern have this bot running, and once we put the dbl api on, odd stuff happened:
Output of bot: (before killing process) https://pastebin.com/vQuzhrq6
Source code of bot: https://github.com/DrBluefall/ProjectPrismarine
The issue is that it runs at a constant 100% CPU on my pi, when beforehand it was running at around 2%, the bot also has a crazy 50s of delay at one point, as well as writing tons of logging information. I would like for someone who can actually help to help us figure this out.
I am no brainer in python but simple troubleshooting tips will include.
Can it still be possible to run in a pi?
if your bot has grown pretty big, I doubt a pi can handle that
we released it just now
It's not all that complex, and it's not big at all.
and it isnt very complex, added notes to the normal cpu usage
when that 100% is happening, when it loads the members?
constant
like I said, it usually runs at 2% cpu
Wow.
discord.gateway - WARNING - 2019-06-09 22:40:17,918 - Heartbeat blocked for more than 5 seconds.
This log says that something is blocking the thread
I didn't know an api would be this heavy
2% on testing server?
on server that has less 50 members?
this server got like more than 10k members
It gets invited on approval.
yes thats what I see on your logs
🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔
God
jesus that MIGHT BE A FACTOR
the ID of this server is 264445053596991498
and the logs process the members in 264445053596991498
@versed fern you know you could have TOLD ME IT WAS ON A SERVER WITH 50,000 MEMBERS
and thats a pi, I dont expect that to handle this big server
I guess it's entirely possible that the pi just couldn't handle it.
this server has 50K members
@earnest phoenix I DIDN'T REALIZE THIS WOULD BE AN ISSUE
you can probably rent a cheap server
SUE ME
lol
could we not have it on the server?
yeah
but still have it function as normal?
Or just make the bot leave
ye
<@&304313580025544704> Mind kicking @smoky radish?
it will not show the online status on dbl webpage
Oof
thats a bad idea but ok
Pinging all mods smh
i am fuming.
🔇
but you can still acess the dbl api
Bot can't seem to handle being on the server
Several people are typing
just ping one mod
yeah ^
why ping all of them
YEAH ^
...
lol
🙄
no.
unu
no
even after pinging all mods
I'll see what I can do in terms of hosting.
I'll likely be moving to get a job.
i didnt want to be useful anyway
So once that happens, I can find some online hosting
use GCP
you're totally useful ❤
they give you a year for free
Google Cloud Platform?
aws is a buffer
until I can find some source of income
ew 24hr clock
lmao
lol why
@versed fern You can also checkout Contabo
I recommend them because their plans are cheap and legit
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.
ah
Duly noted, and much appreciated.
aws is hella expensive than contabo
oh nv
contabo is the cheapest I have found up to date
looks like you have been doing serious digging
since thats a website from the corner of the internet
I dont have supporters to back the bot before so I was in need to find cheap hosts
amazon lightsail: Plans starting at $3.50 per month
contabo: 3.99 EUR or $4.52 per month
yeah amazon is cheaper i think
unless im not taking into account something
look on specs contabo give you
5 euro = 4 cores, 8gb ram, and 200gb ssd w/ 200mbits port no capping
oh damn
much better than:
512 MB Memory
1 Core Processor
20 GB SSD Disk
1 TB Transfer*
yikes
512mb memory
wtf
thats like
1/4 of my pi
which was 10$ done deal
I have better option
4 core,
1tb space,```
In just 1 $
Wat
EXPLAIN
Wat to explain
where to find it im assuming

...
What
hey guys! I got my bot on a remote host site (deploys.io) but It keeps deleting one of the NPMS it needs, any ideas why?
which token?
Check with the host?
i uploaded the files using filezilla (like all other npms ive added) and it gets deleted as soon as i turn the bot on
I did, havent got a resonse, just asking here in the meantime
its all working on my local pc
Try to see if it has an option on the website where you could install packages there
they dont
Seems like a problem with your host tbh. Don't know if anyone can help with that in here 
ok, thanks for the ffort though! Ill wait ona response from them, it just sucks ive spent a few hours getting a whole system in place but it wont work because the npm wont stay installed 😦
HI
hello
you get the devloper tag when a bot you make gets accepted onto the site
yeah 😃
lol, dont rush it, take your time and make it work right
ok thx fot the supporting me
i will really woek hard
sry for spelling mistake
lol
my bot client id is
you dont wanna make that public
can igive the client id?
keep as much as you can private
people can mess with your bot with that
when my bot is ready i will make it public
so my bot can help them
my bot
i cant authoriz idk y?e
plz help me
with this problrm
thats not how you add it to this server
you have to go on the website and follow the instructions there
i wanna add to my server
U>you have to go on the website and follow the instructions there(ME)>WHATS the website called i forgot
im on my pc
Wth dude
This is on tablet
Just scroll down here, and select your server
@near igloo
would streaming pre-downloaded sound files have a better performance than a music bot, which has 2 streams, 1 for downloading and 1 for uploading?
i dont mean uploading
i meant like
music bots
1 stream for downloading
1 stream for sending that to discord
--
yes
and im asking
if only sending to discord would have a signifcantly better performance
Yes, because of decoding when downloading the sound file
But that doesn't mean you should do it
Predownloading can cause immense loading times and doesn't support streams
so having the sound files directly is better than getting them from a seperate storage server
You shouldn't even store it in a file
Just save the buffer in memory until you use it
but assuming im dealing with up to 100 audio files, would that still be efficient?
@near igloo u can give the client id BUT DON'T GIVE ANYONE THE TOKEN. if u give client id they can invite the bot BUT THEY CAN DO AYTHNIG WITH UR BOT IF U GIVE TOKEN
If you ever spoil your bot token, just reset the token from applications
Anyone knows of any good free voice recogntion service?
There's google cloud speech I think
Cost money 😦
iirc the Discord API doesnt ofically support receiving audio by bots
I want my bot to respond if it get mentioned but idk how I searched a lot on internet but me no found lol (Using Python Rewrite btw)
I'm thinking about saving some common discord server data (ID, name) and common user (ID, name, discriminator) data into my local database. But after some reflection, I think it would be pointless and a pain to keep in sync.
What do you think ?
if (message.content.startsWith('<@'+client.user.id+'>')) @earnest phoenix
you only generally keep the ids in the database, the data from discord is fetched via the id when needed @terse path
storing the username in the db could even be against data policy @terse path
i wish you could setnote to users with a bot account so you wouldn't have to waste your disk space
Today I learned. This was only a reflection, I wasn't actually putting that into practice because, as I said, it's pointless and would be a pain to keep in sync
@earnest phoenix Discord wouldnt like to waste its disk space for your bot tho
users still can note "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" on people
{
"bot_name": " <NODATA>",
"bot_owner_tag": "<NODATA>",
"bot_owner_id": "<NODATA>",
"bot_invite": "<NODATA>",
"bot_support_invite": "<NODATA>"
};
One message removed from a suspended account.
One message removed from a suspended account.
no

So my bots name and avi spontaneously changed and I got sent a link to a mysterious server.
Reset your token
Anybody know why/how that might have happened?
That's pretty worrying.
Instead of talking here, you should reset your token first.
I already did.
Ok
What would be the best language to go about learning how to make an actual like Desktop app with a GUI and stuff? I tried C++ but I can't find much
@abstract crow if you already have experience with building websites and javascript, i would definitely reccommend electron
I mean I have experience with JS
Wait, Discord... Is that Electron like?
I could have sworn I heard it was something like that
the discord desktop versions were made with electron as well
Right
Build cross platform desktop apps with JavaScript, HTML, and CSS.
Take this
Anyone here, who know PHP and ready to help me?
Ok, I'll give it a shot. If you had a suggestion though for a specific language for making desktop applications what would you think?
I unfortunately don't know any PHP.. Sorry
i know a bit of php
Isn't PHP web development though?
@earnest phoenix You can help me?
@earnest phoenix I don't need make bot
@abstract crow Yes, i need make script to website
@pliant siren just post your question
then put it in a pastebin and post your error
Try
Translate my comments if need
in other version i put json with php://input
I mean like actual programs though. Like for an example Spotify. That is a Desktop Application. I want to make a very basic game as that is my end goal. I just don't know what is easier and widely used to do applications
@abstract crow
Students use DevelNext to make simple programs
If you don't know any language (PHP or C++) i can help you with Lazarus
Lazarus is a professional open-source cross platform IDE powered by Free Pascal
Ok well preferably a US/English language
@abstract crow for game development you should instead use a game engine instead
lazarus is an ide anyways wtf
Like Unity?
What language are those in?
@abstract crow Try Unreal Engine (Have templates) or Unity (Free projects on internet)
And also is Java good to make games in or no since the engines are smoother
unity - C#
unreal engine - C++
godot - GDScript (similar to python), C#, C++
java game development is outdated
And, who can help me?
Unreal it is!
wonder why bedrock edition doesnt use java
i reccommend you read about unreal engine tho and make sure it fits your purposes before jumping into it
What's bedrock edition
that goes for literally everything you want to use
So does the Unreal Engine modify C++ a little bit or can I just "copy" my code over
dunno, never used it
Guys, i have troubles with PHP script.
Anyone here know PHP and ready to help me?
My code on Pastebin: https://pastebin.com/CHdfhAk5
Forgot that Unreal was ran by Epic Games
@abstract crow that's bad?
Uhm, how long i must wait help? 😅


