#development

1 messages · Page 631 of 1

unique nimbus
#

idfk

earnest phoenix
#

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 ?

fluid sphinx
#

what OS are you running?

#

well, distro

earnest phoenix
#

Debian 9

fluid sphinx
#

okay

hushed quarry
#

is make installed

fluid sphinx
#

sudo apt install make -y

#

run that command

earnest phoenix
#

After ?

fluid sphinx
#

then try to install better-sqlite-pools

earnest phoenix
#
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

fluid sphinx
#

err hold on

hushed quarry
#

the error explains what is wrong

#

you don't have the proper dependencies installed

bright spear
#

no, ignore the peer dependencies stuff

#

looks like an error in integer?

fluid sphinx
#

^ make is erroring, the dependencies dont mean shit

earnest phoenix
#

Hum, i can't install better-sqlite-pool so ?

fluid sphinx
#

okay, try sudo npm i node-gyp

#

then try the other command

earnest phoenix
#

I have the same error

fluid sphinx
#

wtf

#

you might need someone else to help you, im out of ideas

earnest phoenix
#

Okey, thanks for help me c:

fluid sphinx
#

no worries

earnest phoenix
#

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

olive path
#

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"
}
west spoke
#

are you sending the embed? I know in py you have to send it separately for embeds

opaque eagle
#

Yeah he’s not sending the embed rofl

idle basalt
#

just ask

shy turret
#

@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");

inner jewel
#

that won't work

#

remove the {}

#

send(factEmbed)

shy turret
#

or ^

#

yah mine won't work, I don't code like that

#

the only API I ever used was Discord lol

olive path
#

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 😃

pale marsh
#

What's the issue then?

olive path
#

The uptime always returns 0 Hours, 0 Minutes, and 0 Seconds

pale marsh
#

Move line 6 to 10 right under line 24

#

Not really experienced with js but give it a try

hushed quarry
#

I see the issue, but I want you to figure it out. Have you debugged the code?

olive path
#

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

pale marsh
#

When is run() called?

olive path
#

run()? do you mean module.exports.run?

#

Just before setting the uptime

hushed quarry
#

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

olive path
#

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)

hushed quarry
#

you need to change stuff around to get the one from the main file

olive path
#

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

hushed quarry
#

if you're not returning anything or w/e, then the module will have nothing

#

look up how node.js modules work

#

afk

olive path
#

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!

queen bone
pale marsh
#

Use an image processing library

queen bone
#

any recommendation ?

pale marsh
#

Depends on the language

#

And I don't know any tbh

queen bone
#

js, ok, thnks for help i will start digging now

pale marsh
#

Right, heard about that one

#

Should do the trick

quartz hill
#

How do I see if my bot has the privileges(authority) I want?

zealous veldt
#

]]moreinfo

covert turtleBOT
#

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.

quartz hill
#

nodejs

idle basalt
#

guild.me.hasPermissions(['array', 'of', 'perms'])

quartz hill
#

thx

#

Bot privileges on the channel where the bot is?

idle basalt
#

guild.me.permissionsIn(channel)

#

just check the docs its all there

quartz hill
#

very thx

raw isle
#

wait so if I

#

!help

#

Oh help me

#

--help

#

-help

#

lmao this is great

#

?help

#

I have cursed myself

pallid zinc
#

How I can I help you sir

mossy vine
#

Tfw no mods online smh

near igloo
#

WAT (!INTRO ) dus?

#

i cant create a json file with this error

pallid zinc
#

How to shutdown the bot ??

#

I got it

#

client.destroy()

junior thicket
#

hi

pallid zinc
#

Why people make bot without prefix

unique nimbus
#

@near igloo if you are trying to get into the Desktop directory do cd Desktop

indigo geyser
slender thistle
#

What is content

#

Is there any integer involved

#

Will you people ever fucking use commands extension

indigo geyser
#

... If I want use this don't fucking insult me, shit

slender thistle
#

(Is this one of those "It's good if it works" cases)
('people' is an insult now?)
Back to the original question

slender thistle
#

parameter in get_channel must be int

#

You're passing str

indigo geyser
#

Ok

#

Tnks

jolly sentinel
#

... people use discord.py-rewrite and don't use await client.process_commands(message)?

unique nimbus
#

I don't either

slender thistle
#

Oh man

unique nimbus
#

Big thonk

slender thistle
#

Trust me, many people still use the old version

jolly sentinel
#

I started discord.py using @client.command() for all my commands

slender thistle
#

There is a shitton of poorly made bots out there

jolly sentinel
#

bleh

slender thistle
#

I started using d.py in Red dogeKek

jolly sentinel
#

my bot is probably still poorly made, nonetheless

#

:akkoderp

#

wh--

#

my emoji disappearedd

unique nimbus
#

I used d.py by stealing code then fixing it then breaking and fixing it again

pale drum
#

Hi

unique nimbus
#

Hi

pale drum
#

Hi how is your day

slender thistle
unique nimbus
#

I am fine, this is not the right place for casual

pale drum
#

Om soorrrrryyy

#

Om by

unique mauve
#

Is there any way to receive messages when someone votes

mossy vine
#

yes, use webhooks

unique mauve
#

any documentation?

mossy vine
balmy rover
#

Hello what must I put here?

#

In servers this bot is in

pale marsh
#

You're asking in the wrong channel, and leave it empty for now

earnest phoenix
#

@balmy rover the owner of the bot

#

And the invite url you dont need if you doesn't have a server

frozen tiger
#

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?

quartz kindle
#

reload the page or ajax?

frozen tiger
#

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 Thonk

quartz kindle
#

just use ajax lol

frozen tiger
#

there is no framework to do it nicely?

#

so baaaad in web dev

quartz kindle
#

its not hard at all

#

using a framework would be more complex

frozen tiger
#

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

quartz kindle
#

👍

frozen tiger
split hazel
#

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

ruby dust
#

lemme guess, you are requiring to join the bot's support server just to use it normally

split hazel
#

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

quartz kindle
#

how are you checking if said user is in the server?

split hazel
#

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.

amber fractal
#

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

split hazel
#

draws?

amber fractal
#

it's a giveaway bot right?

#

you need to draw a winner sooner or later

split hazel
#

Would there be any possible fix for the issue other than doing it right when the giveaway ends?

quartz kindle
#

@split hazel do you have any code to account for offline/uncached members?

split hazel
#

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

quartz kindle
#

you dont use fetch all anymore?

split hazel
#

nope, we used to

quartz kindle
#

then that might be the issue, or part of the issue

#

you can try using guild.fetchMember() instead of members.get()

split hazel
#

would fetchAll compensate for this?

quartz kindle
#

i believe so, but its pretty resource intensive

split hazel
#

Alright, thanks for the help

quartz kindle
#

you can also use guild.fetchMembers()

#

its the same as fetchAll just per guild instead of all guilds

earnest phoenix
#

I

unique nimbus
earnest phoenix
#

How do you make that animated profile picture?

mossy vine
#

the server icon you mean?

unique nimbus
#

You need Nitro for your own pfp

#

Servers need to be boosted

#

by Nitro users

earnest phoenix
#

Ok

#

Thanks

unique nimbus
#

np

olive path
#

I wish nitro wasn't as expensive lmao

unique nimbus
#

I mean they need money for their shit servers

opaque eagle
#

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.

amber fractal
#

uh

earnest phoenix
#

How would I make a starboard function thing

amber fractal
#

I dont think you understand it tho

earnest phoenix
#

Mine isn’t working

opaque eagle
#

Wdym

#

Steven

#

Not meow

earnest phoenix
#

Oh k

amber fractal
#

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

earnest phoenix
#

Anyone know how to make the bot do skemthng with a message if it gets reacted 5 times with a reaction, like a starboard

opaque eagle
#

What lib

earnest phoenix
#

Discord.js

opaque eagle
#

Listen to messageReactionAdd

#

If the message has more than 5 of those reactions, post it to the starboard channel

amber fractal
#

you may also want to use raw events for uncached messages

#

but that's a little more advanced

opaque eagle
#

^

amber fractal
#

Well

earnest phoenix
#

K

amber fractal
#

"advanced" mmLol

opaque eagle
#

Imo raw events r beyond the scope of most who use discord.js

amber fractal
#

What raw events?

split hazel
#

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

opaque eagle
#

Wouldn’t the giveaway take place in the server where the command is called?

earnest phoenix
#

im guessing it works on concept of gleam, require for the user to be in x amount of servers to enter giveaway

opaque eagle
#

Oh

#

Still don’t get it but whatever floats ur boat I guess

earnest phoenix
#

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.

late hill
#

People should just grow brains and let those kind of giveaways die out WHEEZE

#

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

ruby dust
#

I hate "dead members" to the point when I'm hesitant to start pruning them all

copper cradle
#

do it

ruby dust
#

15 members for 30 days

#

31 for 1 day

#

hm

gaunt blade
#

how to like
make global variable
so like
the variable/array is valid in all commands
anyone?
plz

#

i am using discord.js commando

slender thistle
#

Bot variable?

mossy vine
#

pass the variable through the function

gaunt blade
#

it is discord.js commando

#
  • Idk how
#

xD

mossy vine
#

never used commando

#

gimme a sec

gaunt blade
#

ok

mossy vine
#

yeah no clue

#

you could like

gaunt blade
#

Yeah..

#

¯_(ツ)_/¯

mossy vine
#

export it from the main file

#

and import the variable at the top of the command file

gaunt blade
#

how?

earnest phoenix
#

there is discordjscommando docs

gaunt blade
#

the docs are trash

#

a little info

#

xD

mossy vine
#
//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

gaunt blade
#

oh

mossy vine
#

well in that case you could likely do

gaunt blade
#

cooool

#

oh ok thank you

earnest phoenix
mossy vine
#
//index.js
client.coolVariable = "hey im cool"```
```js
//command.js
console.log(client.coolVariable)```
gaunt blade
#

ohhhh

#

thanks

mossy vine
#

just make sure the variable name doesnt onflict with any other client variables / functions

earnest phoenix
#

yaas

gaunt blade
#

Yay thanks

cyan goblet
#

*help

#

*invitebot

unique nimbus
#

@cyan goblet #commands and don't use common prefixes

cyan goblet
#

Yes

ruby dust
#

yes

rustic obsidian
#

Ok

uneven lark
#

Hm

thorny hamlet
#

i got my bot back up and running im so glad.

lofty hamlet
#

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 ?

earnest phoenix
#

url is the url to your webserver

#

password is a form of authentication that verifies the request comes from dbl

split lantern
#

as anyone can send a webhook

lofty hamlet
#

In this example of code i do replace password by the authorization ?

split lantern
#

yea

lofty hamlet
#

And url ?

#

With this example of code

earnest phoenix
#
url is the url to your webserver```
lofty hamlet
#
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

earnest phoenix
#

none

lofty hamlet
#

const server = http.createServer(app);

#

No ?

split lantern
#

yourpublicip:5000

earnest phoenix
#

you seem to be misunderstanding how webhooks work

lofty hamlet
#

Yes

split lantern
#

server.listen should handle that

earnest phoenix
#

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

lofty hamlet
#

🤔

earnest phoenix
#

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

split lantern
#

the webhook request doesnt expect any content back

lofty hamlet
#

I just do not comoris what URL and server

split lantern
#

you need your public ip adress

#

and port forwarding

earnest phoenix
#

you normally wouldn't run a webhook server on a personal computer

#

rather, you would run it on a proper vps

lofty hamlet
#
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');
});```
earnest phoenix
#

stop copy pasting the same code

lofty hamlet
#

My system of vote work but i want make a system with whebooks

#

No this is an other code

#

This is my actuial code

earnest phoenix
#

...and?

#

,

lofty hamlet
#

What should I change here?

#

And what must be URL ?

earnest phoenix
#

jesus christ

#

the url is the url to your server which accepts webhook requests

#

stop having a low iq

split lantern
#

DBL will send a request to your Server

lofty hamlet
#

What server ?

split lantern
#

yea

earnest phoenix
#

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

lofty hamlet
#

I can make a fake vote ?

#

For test my whebooks

split lantern
#

There is a test button

lofty hamlet
#

Ok i test

#

Hum does not work 🤔

#

When i go to the link of my server he say in the page : Cannot GET /

#

🤔

earnest phoenix
#

because you aren't listening to /

#

or in fact, anything

lofty hamlet
#

?????

#

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

fading wigeon
#

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

tidal oar
#

Guys is there a way that i can convert snowflake into date time

#

so i can pick the time the last message sent

amber fractal
#

yes

#

it's straight in the dev docs

split lantern
#

@Nebulus#8919 serverip:5000/dblhook

lofty hamlet
#

@split lantern hum

#

In url i set : http://ip:port/dblhook

tidal oar
#

yeah got it

#

deconstruct()

split lantern
#

@lofty hamlet then press the trst btn

tidal oar
#

But it isnt working

fiery stream
#

ayyy hi?

lofty hamlet
#

Ok i go test

fiery stream
#

`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

earnest phoenix
#

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

fiery stream
#

ummm ik but how do i send canvas?

tidal oar
#

i think im retarded i cant use .deconstruct()

merry remnant
#

Hello, I’m new to dev. I want to add a bot to my server, but I’m having difficulty.anyone available?

fiery stream
#

@earnest phoenix how do i send embed?

tidal oar
#

@merry remnant go to O2AUTH

amber fractal
#

convert the canvas to an image

fiery stream
#

i mean the canvas

#

meant

merry remnant
#

Thx Sax

quartz kindle
#

@fiery stream you need to send it as a buffer

fiery stream
#

uhh oh

#

.attachment?

earnest phoenix
#
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

merry remnant
#

What is O2Auth?

quartz kindle
#

as an attachment yes, in the files field

tidal oar
#

@earnest phoenix so basically shifting

earnest phoenix
#

yes

quartz kindle
#

.send({files: new Discord.attachment(imageAsBuffer,imagename)}) or Discord.messageAttachment depending on your d.js version

amber fractal
#

didnt I send that earlier?

tidal oar
#

thanks

merry remnant
#

@tidal oar what is O2Auth?

lofty hamlet
#

@split lantern Cannot GET /dblhook

tidal oar
#

Its this

split lantern
#

@tidal oar Discord.SnowflakeUtil.deconstruct('id')

amber fractal
#

Why would you do that tho

split lantern
#

@lofty hamlet /dblwebhook

tidal oar
earnest phoenix
#
@Sax what is O2Auth?```

it's OAuth2, what do you want to do again
tidal oar
#

oauth2

#

im sorry

#

he needs invite

#

you generate a one from there

lofty hamlet
#

Work thx

tidal oar
#

@split lantern thank you

#

@split lantern

split lantern
#

createdTimestamp returns a Timestamp

tidal oar
#

i need the timestamp which returns a snowflake

merry remnant
#

@earnest phoenix I’m trying to add a bot called smoogle to my server

quartz kindle
#

an ID is a snowflake, a timestamp is a timestamp

#

what do you need?

tidal oar
#

ARE YOU SERIOUD

#

LMAO

#

I WAS SEARCHING FOR THIS

quartz kindle
#

@_@

tidal oar
#

LIKE STRAIGHT AN HOUR

#

🤦

bright meadow
#

😂

tidal oar
#

god...

merry remnant
#

I’m confused

quartz kindle
#

could have looked at the docs lol

tidal oar
#

this returns a Date am i right

split lantern
#

ye

tidal oar
#

so i can convert it into miliseconds

lofty hamlet
#

For whebhook vote.user say id of user but vote.user.username does not work 🤔

quartz kindle
#

or you can use createdTimestamp directly

tidal oar
#

@lofty hamlet vote.user returns the id of user

lofty hamlet
#

Yes but i want the username

split lantern
#

you need to use client.users.get(vote.user).username

tidal oar
#

^

quartz kindle
#

if you had checked the docs you would see it pretty much right away

lofty hamlet
#

Ok thx

tidal oar
#

@quartz kindle i was looking at the wrong place

#

dont yell at me

merry remnant
#

ok, let’s try this again, I’m trying to add a bot to my server, smoogle, but it’s not connecting to discord

quartz kindle
#

im not yelling lmao

#

explain

#

what do you mean "its not connecting to discord"

merry remnant
#

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

quartz kindle
#

you're logged in with the wrong account

split lantern
#

Are you sure you have permissions

quartz kindle
#

go to the discord website and logout

#

then login again with your correct account

merry remnant
#

Ok

#

Thank you

#

I may be back!

lofty hamlet
#

I can use dbl.webhook.hasVoted ?

#

@split lantern

split lantern
#

no

lofty hamlet
#

Hu

#

?

#

Just dbl.hasVoted ?

split lantern
#

yea

#

but that defeats the purpose

lofty hamlet
#

My system is dbl.hasVoted(message.author.id).then(async voted => {

#

With webhook i do not change ?

split lantern
#

No

#

But you shoukd

lofty hamlet
#

????

split lantern
#

on webhook vote save it locally that the user voted

lofty hamlet
#

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

split lantern
#

You wanna get a database

#

and store the last voted in it

#

Wich you just update on the webhook event

lofty hamlet
#

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

split lantern
#

Well change it or live with it

lofty hamlet
#

Hu change what ?

#

Ok what should I change?

split lantern
#

in the webhook event you wanna do your stuff

lofty hamlet
#

?

split lantern
#

You have the webhook voted event

#

in that you do the stuff that should happen

lofty hamlet
#

Ok

#

And ?

#

Ican do not just dbl.webhook.hasVoted lmao

shy rose
#

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? GWspenderLemon

amber fractal
#

bots can see see all users iirc

#

but user bots

shy rose
#

yeah thought so :/

#

its just the client visually hiding them

amber fractal
#

idk how the api does stuff when it comes to them

#

I think that's how it is ye

shy rose
#

discord really needs a better way to defend against self bots....

amber fractal
#

I dont think discord intended for people to list servers publicly outside of yt channels, games, etc tho either

#

But yeah, they do

shy rose
#

guess by doing channel lock down at least stop the people spamming junk via a client

#

including dm

#

but moment self bot its...

merry remnant
#

@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

split lantern
#

Might have two

merry remnant
#

Ok, I need to delete one

fiery stream
#

ERROR Unhandled rejection: TypeError: The resource must be a string or Buffer. canvas help

split lantern
#

code

opaque eagle
#

^

merry remnant
#

@split lantern thanks for your help, got it straightened out!

split lantern
#

np

thorny hamlet
#

mmm

#

i got my bot started from scratch without help but i need one thing of note

#

how would i do a leveling sytem?

pale marsh
#

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

thorny hamlet
#

so set like...

mighty verge
#

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?

thorny hamlet
#

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

pale marsh
#

I haven't heard of any c++ libraries for discord tbh, nor would I recommend making one in c++

thorny hamlet
#

im not go start with the more simple ones

#

true

grim aspen
#

you're better off coding a discord bot in js or python @mighty verge

thorny hamlet
#

discord bots mostly run of py, c#, and js

#

im using js for my bot

mighty verge
#

I already programmed discord bot in Java tbh, I just wanted to challenge myself with something more complex

pale marsh
#

Learn C#. It's similar to C++

thorny hamlet
#

mhm

grim aspen
#

then try python

thorny hamlet
#

im using c# for my game

pale marsh
#

You can make complex bots in java as well. Nothing can stop you

mighty verge
#

(I hate python lmao)

thorny hamlet
#

python is the easiest

#

you have to understand every thing

mighty verge
#

misses an indent

thorny hamlet
#

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

mighty verge
#

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)

thorny hamlet
#

python isnt complex

mighty verge
#

And I mostly dislike most language that are not type-safe

thorny hamlet
#

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

mighty verge
#

I already know Java from a college course

thorny hamlet
#

college courses teach you up to 4-5 codes

mighty verge
#

And well I work at a company that uses Spring Boot mostly

#

So I use Java a lot

thorny hamlet
#

my college course im taking rn is teaching me 6

#

never heard of spring boot

mighty verge
#

Nice, but I never said that I don't know any complex languages

thorny hamlet
#

this is kinda starting to get to a general type discussion

mighty verge
#

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

thorny hamlet
#

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

pale marsh
#

Wdym addField?

thorny hamlet
#

nvm

#

fixed it all

fiery stream
#

hi

versed fern
#

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).```
earnest phoenix
#

We got 50s delays

#

my raspberry pi's cpu load was 100% all the time

versed fern
#

^

earnest phoenix
#

(its usually 2%)

#

And it seems to run like this on a constant loop

#

I would hope someone helps us soon too

pale marsh
#

Looks like you might have something locking the thread. Not sure though tbh

versed fern
#

?

#

Locking the thread?

earnest phoenix
#

I would like a solution too lmao

#

shit that sounded passive agressive af

pale marsh
#

How would anyone give you a solution without even looking at your code? lol

earnest phoenix
#

well we have reason to believe its because of the dbl api

versed fern
#

well

#

the bot is open source

earnest phoenix
#

so we though looking at the logging info, you could tell us how we were implimenting the bot wrong

versed fern
#

@pale marsh

sinful lotus
#

cant really read python

versed fern
#

...

#

That's not very helpful...

sinful lotus
#

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

earnest phoenix
#

How long does it take for my bot to be reviewed

#

well @sinful lotus then you dont reply at all

versed fern
#

Roughly a week, perhaps longer @earnest phoenix

earnest phoenix
#

its like those amazon answers that go "dont know, havent arrived yet" like why reply then at all

versed fern
#

^

sinful lotus
#

Im just stating I cannot read python

#

you guys are overreacting over a simple matter

earnest phoenix
#

you dont need to state that...

#

ok you know what

#

im done

sinful lotus
#

Its my opinion, am I not allowed to voice what I think of?

earnest phoenix
#

no point

sinful lotus
#

You should have done that before you even pinged me

copper cradle
#

lmfao

earnest phoenix
#

yeah true

pale marsh
#

You can ask somewhere else at this point tbh

copper cradle
#

@sinful lotus how to turn on bot, yardim botun pls

earnest phoenix
#

I should have known it was no point

copper cradle
#

jk

sinful lotus
#

It annoys me ping me just to say that when I'm busy recoding something

copper cradle
#

sry

sinful lotus
#

not you zee dont worry

copper cradle
#

lmfao

versed fern
#

ok, @earnest phoenix, that's enough.

#

We came to get an issue fixed.

#

This tangent is irrelevant.

earnest phoenix
#

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.

sinful lotus
#

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

earnest phoenix
#

we released it just now

versed fern
#

It's not all that complex, and it's not big at all.

earnest phoenix
#

and it isnt very complex, added notes to the normal cpu usage

sinful lotus
#

when that 100% is happening, when it loads the members?

earnest phoenix
#

constant

sinful lotus
#

as far as I can see on your logs

#

seems your pi is having trouble keeping up

earnest phoenix
#

like I said, it usually runs at 2% cpu

versed fern
#

Wow.

sinful lotus
#

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

earnest phoenix
#

I didn't know an api would be this heavy

sinful lotus
#

2% on testing server?

#

on server that has less 50 members?

#

this server got like more than 10k members

earnest phoenix
#

is it on this server?

#

you never told me that @versed fern

versed fern
#

It gets invited on approval.

sinful lotus
#

yes thats what I see on your logs

earnest phoenix
#

🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔 🤔

pale marsh
#

God

earnest phoenix
#

jesus that MIGHT BE A FACTOR

sinful lotus
#

the ID of this server is 264445053596991498
and the logs process the members in 264445053596991498

earnest phoenix
#

@versed fern you know you could have TOLD ME IT WAS ON A SERVER WITH 50,000 MEMBERS

sinful lotus
#

and thats a pi, I dont expect that to handle this big server

versed fern
#

I guess it's entirely possible that the pi just couldn't handle it.

copper cradle
#

this server has 50K members

versed fern
#

@earnest phoenix I DIDN'T REALIZE THIS WOULD BE AN ISSUE

sinful lotus
#

you can probably rent a cheap server

versed fern
#

SUE ME

copper cradle
#

lol

earnest phoenix
#

could we not have it on the server?

copper cradle
#

yeah

earnest phoenix
#

but still have it function as normal?

sinful lotus
#

ask a moderator

#

they can kick your bot out here

copper cradle
#

Or just make the bot leave

sinful lotus
#

just state your reason

#

or that

earnest phoenix
#

does it still function normally

#

connecting to the api and everything?

copper cradle
#

ye

versed fern
#

<@&304313580025544704> Mind kicking @smoky radish?

sinful lotus
#

it will not show the online status on dbl webpage

copper cradle
#

Oof

earnest phoenix
#

thats a bad idea but ok

pale marsh
#

Pinging all mods smh

fiery birch
#

i am fuming.

copper cradle
#

🔇

sinful lotus
#

but you can still acess the dbl api

versed fern
#

Bot can't seem to handle being on the server

earnest phoenix
#

Several people are typing

sinful lotus
#

just ping one mod

earnest phoenix
#

yeah ^

sinful lotus
#

why ping all of them

earnest phoenix
#

YEAH ^

versed fern
#

...

earnest phoenix
#

thats like

#

discord ettiute 101

copper cradle
#

lol

versed fern
#

🙄

copper cradle
#

anyone, wanna uwu with me?

#

uwu

versed fern
#

no.

copper cradle
#

unu

earnest phoenix
#

no

#

please

#

@smoky radish <- bot still on the server wow

copper cradle
#

no

earnest phoenix
#

even after pinging all mods

copper cradle
#

Just make it leave smh

#

@earnest phoenix Kastel kicked it

versed fern
#

^

earnest phoenix
#

alright nicei ts gone now

#

lets see if it makes my pi have a DDos again

versed fern
#

I'll see what I can do in terms of hosting.

earnest phoenix
#

ayy

#

2%

versed fern
#

I'll likely be moving to get a job.

earnest phoenix
#

i didnt want to be useful anyway

versed fern
#

So once that happens, I can find some online hosting

copper cradle
#

use GCP

versed fern
#

you're totally useful ❤

copper cradle
#

they give you a year for free

versed fern
#

Google Cloud Platform?

copper cradle
#

and $300

#

ye

versed fern
#

rly?

#

huh.

earnest phoenix
#

aws is better imo

#

only pay for what you need

versed fern
#

well

#

gcp can give us a buffer

earnest phoenix
#

aws is a buffer

versed fern
#

until I can find some source of income

earnest phoenix
#

that you dont pay for

#

until you actually use

versed fern
#

We can discuss hosting later.

#

For now, it's late as fuck.

earnest phoenix
#

nah

#

only 23:33

versed fern
#

ew 24hr clock

earnest phoenix
#

programmers dont see the day

#

its better for them

#

to use military

versed fern
#

lmao

earnest phoenix
#

also i just want to get familiar with military lmao

#

anyywayysss

versed fern
#

lol why

earnest phoenix
#

we done now

#

Thanks for your help!

versed fern
#

^

#

many thanks.

sinful lotus
#

@versed fern You can also checkout Contabo

#

I recommend them because their plans are cheap and legit

earnest phoenix
#

will do ^-^

#

ooh linux

#

the website looks dated

versed fern
#

ah

sinful lotus
#

I used their services back then

#

so I can say its not a scam

versed fern
#

Duly noted, and much appreciated.

earnest phoenix
#

I think its more expensive than aws

#

if im not mistaken

sinful lotus
#

aws is hella expensive than contabo

earnest phoenix
#

oh nv

sinful lotus
#

contabo is the cheapest I have found up to date

earnest phoenix
#

looks like you have been doing serious digging

#

since thats a website from the corner of the internet

sinful lotus
#

I dont have supporters to back the bot before so I was in need to find cheap hosts

earnest phoenix
#

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

sinful lotus
#

look on specs contabo give you

#

5 euro = 4 cores, 8gb ram, and 200gb ssd w/ 200mbits port no capping

earnest phoenix
#

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

pallid zinc
#

I have better option

4 core,
1tb space,```
In just 1 $
pallid zinc
#

Wat

versed fern
#

EXPLAIN

pallid zinc
#

Wat to explain

earnest phoenix
#

where to find it im assuming

pallid zinc
#

The vps

#

??

earnest phoenix
#

like

#

did you make it up?

#

or is it real?

pallid zinc
#

Talking about vps

#

??

earnest phoenix
versed fern
#

...

unique nimbus
#

What

vital nest
#

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?

earnest phoenix
#

?

#

Change your token

vital nest
#

which token?

pale marsh
#

Check with the host?

vital nest
#

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

pale marsh
#

Try to see if it has an option on the website where you could install packages there

vital nest
#

they dont

pale marsh
#

Seems like a problem with your host tbh. Don't know if anyone can help with that in here GWcmeisterPeepoShrug

vital nest
#

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 😦

near igloo
#

HI

vital nest
#

hello

near igloo
#

WHI R U DEVELOPERS?

#

sry for caps

vital nest
#

you get the devloper tag when a bot you make gets accepted onto the site

near igloo
#

oh

#

relly?

vital nest
#

yeah 😃

near igloo
#

but my coding is not compleat

#

i need to hurry up

vital nest
#

lol, dont rush it, take your time and make it work right

near igloo
#

ok thx fot the supporting me

#

i will really woek hard

#

sry for spelling mistake

#

lol

#

my bot client id is

vital nest
#

you dont wanna make that public

near igloo
#

can igive the client id?

vital nest
#

keep as much as you can private

near igloo
#

i want to make it public

#

ok

vital nest
#

people can mess with your bot with that

near igloo
#

when my bot is ready i will make it public

#

so my bot can help them

#

i cant authoriz idk y?e

#

plz help me

#

with this problrm

vital nest
#

thats not how you add it to this server

#

you have to go on the website and follow the instructions there

near igloo
#

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

earnest phoenix
#

@near igloo

#

Whats your phone

near igloo
#

im on my pc

earnest phoenix
#

Wth dude

#

@near igloo

mossy vine
#

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?

spring ember
#

I usually see buffering as a better solution

#

Also what are you even uploading?

mossy vine
#

i dont mean uploading

#

i meant like

#

music bots

#

1 stream for downloading

#

1 stream for sending that to discord

hallow vortex
#

--

spring ember
#

Oh

#

That's how it should go

#

See how lavaplayer does that

mossy vine
#

yes

#

and im asking

#

if only sending to discord would have a signifcantly better performance

spring ember
#

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

mossy vine
#

so having the sound files directly is better than getting them from a seperate storage server

spring ember
#

You shouldn't even store it in a file

mossy vine
#

?

#

then how do i store audio Thonk

spring ember
#

Just save the buffer in memory until you use it

mossy vine
#

but assuming im dealing with up to 100 audio files, would that still be efficient?

spring ember
#

Yes

#

It barely takes memory

earnest phoenix
#

@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

tidal oar
#

If you ever spoil your bot token, just reset the token from applications

cursive dagger
#

Anyone knows of any good free voice recogntion service?

pale marsh
#

There's google cloud speech I think

cursive dagger
#

Cost money 😦

split lantern
#

iirc the Discord API doesnt ofically support receiving audio by bots

earnest phoenix
#

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)

terse path
#

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 ?

earnest phoenix
#

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

split lantern
#

storing the username in the db could even be against data policy @terse path

earnest phoenix
#

i wish you could setnote to users with a bot account so you wouldn't have to waste your disk space

terse path
#

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

split lantern
#

@earnest phoenix Discord wouldnt like to waste its disk space for your bot tho

earnest phoenix
#

users still can note "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" on people

earnest phoenix
#
{
    "bot_name": " <NODATA>",
    "bot_owner_tag": "<NODATA>",
    "bot_owner_id": "<NODATA>",
    "bot_invite": "<NODATA>",
    "bot_support_invite": "<NODATA>"
};
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

no

agile vine
storm nest
#

So my bots name and avi spontaneously changed and I got sent a link to a mysterious server.

opaque eagle
#

Reset your token

storm nest
#

Anybody know why/how that might have happened?

opaque eagle
#

You leaked your token, Sherlock

#

Go reset it before smth bad happens

storm nest
#

That's pretty worrying.

opaque eagle
#

Instead of talking here, you should reset your token first.

storm nest
#

I already did.

opaque eagle
#

Ok

pliant siren
#

Hello everyone

#

Anyone know PHP?

abstract crow
#

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

pliant siren
#

I need help

#

@abstract crow Try DevelNext

mossy vine
#

@abstract crow if you already have experience with building websites and javascript, i would definitely reccommend electron

abstract crow
#

I mean I have experience with JS

#

Wait, Discord... Is that Electron like?

#

I could have sworn I heard it was something like that

mossy vine
#

the discord desktop versions were made with electron as well

abstract crow
#

Right

pliant siren
#

Take this

#

Anyone here, who know PHP and ready to help me?

abstract crow
#

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

pliant siren
#

@abstract crow Try DevelNext or PHP Devel Studio

#

So easy program constructor

earnest phoenix
#

i know a bit of php

abstract crow
#

Isn't PHP web development though?

pliant siren
#

@earnest phoenix You can help me?

earnest phoenix
#

not really u can make discord bots with php

#

i will try

pliant siren
#

@earnest phoenix I don't need make bot

#

@abstract crow Yes, i need make script to website

mossy vine
#

@pliant siren just post your question

pliant siren
#

@mossy vine My "code" so long

#

And does not work pandasad

mossy vine
#

then put it in a pastebin and post your error

pliant siren
#

Try

#

Translate my comments if need

#

in other version i put json with php://input

abstract crow
#

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

pliant siren
#

@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

abstract crow
#

Ok well preferably a US/English language

mossy vine
#

@abstract crow for game development you should instead use a game engine instead

#

lazarus is an ide anyways wtf

abstract crow
#

Like Unity?

mossy vine
#

yeah

#

or godot

#

or unreal engine

#

or whatever floats your boat

abstract crow
#

What language are those in?

pliant siren
#

@abstract crow Try Unreal Engine (Have templates) or Unity (Free projects on internet)

abstract crow
#

And also is Java good to make games in or no since the engines are smoother

mossy vine
#

unity - C#
unreal engine - C++
godot - GDScript (similar to python), C#, C++

#

java game development is outdated

pliant siren
#

And, who can help me?

short siren
#

@mossy vine Minecraft ttt

#

Java edition is hot

abstract crow
#

Unreal it is!

mossy vine
#

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

short siren
#

What's bedrock edition

mossy vine
#

that goes for literally everything you want to use

abstract crow
#

So does the Unreal Engine modify C++ a little bit or can I just "copy" my code over

mossy vine
#

dunno, never used it

pliant siren
abstract crow
#

Forgot that Unreal was ran by Epic Games

pliant siren
#

@abstract crow that's bad?

abstract crow
#

No, didn't mean to imply that if it came out like that

#

I just forgot lul

pliant siren
#

Uhm, how long i must wait help? 😅