#development

1 messages ยท Page 576 of 1

steel heath
#

replace YOUR_BOTS_ID with your bot's ID

uneven scarab
#

do i send them that link

steel heath
#

yep

uneven scarab
#

Client ID?

#

or Token

#

'

#

'

steel heath
#

so it's just like https://discordapp.com/oauth2/authorize?client_id=351611743018942464&scope=bot&permissions=-1

uneven scarab
#

okay

#

YEET

amber fractal
topaz fjord
#

@steel heath ads mmLol

steel heath
#

ikr

#

I thought I would use a wrong ID but I didn't give it cuz he'd say "oh why no work this"

lusty dew
#

Alright so, I am using eris and I am trying to figure out how I could do
gm!settins welcome_message Hello {user} please read {#rules}
and then it would put that in my Member add event

sick cloud
#

store it in your db, on join get it from the db

lusty dew
#

Hm

#

Is that really necessary?

#

I will do it if that is the only way

#

But if there are other options

sick cloud
#

thats the only way

quartz kindle
#

use caching for the member add event

#

save the message, guild id, channel, etc... in the db, and add the guild id to an array in memory, so you can quickly look up if the guild has welcome messages enabled or not without hitting your db

high lava
#

I have this in an external command and I thought that by putting a "this." there that it would refer to the original client object in the main file, but it doesn't seem to be the case. How would I do this properly?

formal agate
#

ok this error is driving me nuts and i need help on as to why this happens whenever i try and install things though npm

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
E:\PATH\node_modules\ref\build\binding.vcxproj(20,3): error MSB4019: The imported project "E:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.```
#

idk why it keeps saying it cannot find E:\Microsoft.Cpp.Default.props

amber fractal
#

@high lava Most people just pass the client as a parameter

magic smelt
high lava
#

@amber fractal When I require discord.js in an external command it doesn't add it for some reason

amber fractal
#

Just to be clear, I tend to mix stuff up, you mean a module.exports right?

#

I dont want to be on a seperate page

high lava
#

Oof. So you want me to use module exports to define Client

amber fractal
#

No

#

By a external command

#

is that what you mean

high lava
#

Yes module.exports

amber fractal
#

You should be able to pass it as a parameter like any function

high lava
#

you have no idea how dumb I feel now :P

#

Thanks

amber fractal
#

Lol

#

It's good

high lava
#

And just like that it works. Thank you

keen drift
#

steven the savior

amber fractal
#

my name is Tarpergon, thanks.

keen drift
#

so uh, Tarpergon, can u uh

#

help me w8th my problem

amber fractal
#

sure m8

#

it's not like you're more qualified

#

or anything

keen drift
bright spear
keen drift
#

tldr; should I enqueue to worker to run task and update db, or run task, then enqueue worker to do background runner only

bright spear
#

fishy are you the only one here who knows go

keen drift
#

turtle knows some

bright spear
#

o

#

is he here

keen drift
#

is he online? prob not

amber fractal
#

idk what that means

bright spear
#

lol

amber fractal
#

@bright spear You're putting letters in my name

#

and I resent you

bright spear
#

wot

#

i only zoomed in on that part

amber fractal
#

You're adding false letters to my name

keen drift
#

i think I'll just send the worker

#

and do another timer to pull background runners

#

i'll spawn 20 workers

#

should be good enough thonkang

amber fractal
#

What about the unemployed?

keen drift
#

what unemployed

#

oh

#

lmao

#

they just keep waiting for a job

#

unironically

#

I'll have one job channel

#

All 20 workers will be listening on that channel for new jobs

earnest phoenix
#

does anyone know a lyrics api? a song only no artist

earnest phoenix
#

Hello

#

hi

earnest phoenix
#

anyone help me?

#

with

#

@earnest phoenix what do you need

#

@earnest phoenix does it only use song name or does it need artist?

#

song name

#

@earnest phoenix if (msg.guild.id === '264445053596991498') return;

TypeError: Cannot read property 'id' of null

#

what is msg

#

show me some more code

#

why

#

because i dont know what msg is lmao

#

it could be some random variable

#

:/

harsh nova
#

My guess would be a message obj

inner jewel
#

it's a dm

#

dms have no guilds

earnest phoenix
#

i try message?

#

no

#

dms arent guilds

#

so that wont work

harsh nova
#

They still have a id

#

Or is that a channel Iโ€™d

#

Idk

earnest phoenix
#

-_-

#

thats a user id im p sure

harsh nova
#

No, dm channels have a Iโ€™d

earnest phoenix
#

ok?

#

they're not guilds

#

lmfao

#

@earnest phoenix what are u trying to do

#

i try sa as response this server return

#

ฤฐ try sa and bot as

#

:D

#

what

#

respons

#

Pfff nevermind.

#

you are making no sense

#

at all

earnest phoenix
#

How to give rol id?

trim saddle
#

@lime fiber posting to the api

lime fiber
#

Ok.

wide ruin
#
(node:1256) UnhandledPromiseRejectionWarning: TypeError: WebSocket is not a constructor
    at WebSocketConnection.connect (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:254:26)
    at new WebSocketConnection (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:89:10)
    at WebSocketManager.connect (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketManager.js:75:25)
    at client.rest.methods.getGateway.then.res (C:\Users\\node_modules\discord.js\src\client\ClientManager.js:45:22)
    at process._tickCallback (internal/process/next_tick.js:68:7)```
ruby dust
#

which json keyword is equivalent to python's None?

wide ruin
#

null

#

i think

ruby dust
#

oh yeah, thanks

wide ruin
#

so what caused js (node:1256) UnhandledPromiseRejectionWarning: TypeError: WebSocket is not a constructor at WebSocketConnection.connect (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:254:26) at new WebSocketConnection (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:89:10) at WebSocketManager.connect (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketManager.js:75:25) at client.rest.methods.getGateway.then.res (C:\Users\\node_modules\discord.js\src\client\ClientManager.js:45:22) at process._tickCallback (internal/process/next_tick.js:68:7)?

formal agate
#

ok this error is driving me nuts and i need help on as to why this happens whenever i try and install things though npm

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
E:\PATH\node_modules\ref\build\binding.vcxproj(20,3): error MSB4019: The imported project "E:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.```
idk why it keeps saying it cannot find `The imported project "E:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.`
mossy vine
#

@loud salmon might wanna delete that token leek

loud salmon
#

where

mossy vine
#

not anymore

loud salmon
#

kk

outer niche
amber fractal
#

Well

#

Dont code on mobile Thonk

mossy vine
#

you made a typo on line 5, that you wouldve easily noticed if you werent coding on mobile
command_prefix='D'
also if you want to learn more about coding on mobile: https://cyber28.xyz/codeonmobile

formal agate
#

nice site

mossy vine
#

thank you

formal agate
#

if only i could do css

mossy vine
#

i worked very hard on it, collecting points from reputable sources and stuff

#

modestacss exists

formal agate
#

LEAK

mossy vine
#

AAAAAND YOU LEAKED YOUR TOKEN AGAIN

#

๐Ÿ‘๐Ÿ‘

formal agate
#

ljhskdvnbzflkdc

mossy vine
#

reset your token

formal agate
amber fractal
#

again?

#

How do you leak your token more than 0 times?

formal agate
#

idfk

outer niche
formal agate
#

dude

#

just use more then 1 file

#

like a config file

#

well im gonna go back to trying to fix npm

#

its probaly your enviroment @outer niche

#

like it just runs it once

dusky steeple
#

could someone show me what I am doing wrong here. It is telling me then is Unresolved function or method.

let translation = toTranslate.slice(toTranslate.length - toTranslate.length, toTranslate.length - 2).join(' ');
    translate(translation, {to: language}).then(res => {```
amber fractal
#

is that all of it?

dusky steeple
#

well not the whole entire code.

amber fractal
#

Yes I know

dusky steeple
#

just the section it's getting the error from

mossy vine
#

because translate() isnt async? iirc .then() works only for async

amber fractal
#

Does it?

mossy vine
#

does it?

#

i dont know

amber fractal
#

I dont think so

mossy vine
#

huh okay

amber fractal
#

It might tho

mossy vine
#

oh wait no it needs to be a promise

#

maybe translate() is not a promise?

dusky steeple
#

this is the only other thing I have that uses translate javascript const translate = require('google-translate-api');

lusty dew
#

I am having trouble coming up with a way to toggle events on and off

#

I had the idea of just saving a toggle of false to my db for every event and allowing them to toggle it on and off that way with a cmd

#

but I was wondering if there was a cleaner way of doing this

mossy vine
#

im looking at the package/module/whatever you mentioned

#

this right?

#

@dusky steeple

dusky steeple
#

yes

mossy vine
#

yeah its just a function, not a promise

#

which returns the result i think

#

wait hold the fuck up

#

NEVERMIND

outer niche
#

so I have the code done on my bot on mobile just trying to see if mobile would work but I have run into a problem with the program to where the pot will not stay on

earnest phoenix
#

You need a host? @outer niche

outer niche
#

Possibly

earnest phoenix
#

Glitch, heroku (not ads)

formal agate
#

glitch is for js

outer niche
#

@earnest phoenix neither of those support my program

formal agate
#

you did it in python?

outer niche
#

No

formal agate
#

java?

outer niche
#

No

formal agate
#

idfk what you did it then

modern sable
#

which language then Thonk

formal agate
outer niche
#

You know I just scratch it I'll go try to learn another program

earnest phoenix
#

LOL XD

formal agate
#

lol

earnest phoenix
#

I need help with "Vote"

#

I wanna create webhook, but how?

#

What should I put there?

mossy vine
#

you create a webserver that accepts POST requests

#

(not) simple

earnest phoenix
#

okey

#

any other eay

#

way

#

to dm uses that voted?

mossy vine
#

no clue

#

probably

earnest phoenix
#

hm

#

can u make leaderboard with any database?

mossy vine
#

yes

earnest phoenix
#

global?

mossy vine
#

???

earnest phoenix
#

or guild

mossy vine
#

depends on how you write your code

earnest phoenix
#

like global eco or guild eco

#

ah

mossy vine
#

a database can be used for a shit ton of purposes

earnest phoenix
#

i tried wth really old db

#

xD

mossy vine
#

ok

earnest phoenix
#

and cant seem to make it work

#

:/

#

wondering if you could help

#
 const db = require('cookiesdb');
let money = db.fetchCookies(`globalCredits_${client.users.id}`, { sort: '.data'})
    let content = "";

    for (let i = 0; i < money.length; i++) {
        let user = client.users.get(money[i].ID.split('_')[2]).username

        content += `${i+1}. ${user} - ${money[i].data}$\n`
    }
                     const embed = new Discord.RichEmbed()
    .setAuthor(`Leaderboard!`, message.guild.iconURL)
    .setDescription(content)
    .setColor(0x51267)

    message.channel.send(embed)```
lusty dew
#

cookiesdb?

#

I suggest Mongodb

#

or a newer db

earnest phoenix
#

ah

lusty dew
#

easier to work with

#

and for sure will work

#

if you use them properly

mossy vine
#

mongodb requires for it to be hosted on local webserver, no?

lusty dew
#

It can be hosted on your pc

earnest phoenix
#

i wanna try old dbs

#

xD

lusty dew
#

or you can use Atlas

#

or many other Mongodb hosting services

earnest phoenix
#

i wanna try make this code work

#

try

lusty dew
#

Then try and make it work

earnest phoenix
#

xD

#

trying

lusty dew
#

Ok

opal copper
#

hey, i want to create a command who get the numbers of players in a other server, but that not work for me ( discord.js )

formal agate
#

wdym by players in other server?

opal copper
#

yes

late hill
#

is infojeux an ID

opal copper
#

yeah

#

infojeux is the id if the server

formal agate
#

so just get the total of all users serving

#

then sub the amount of the users in said guild

late hill
#

Does it give you any error..

opal copper
#

but the bot must be in the opposite server i guess

formal agate
#

??

opal copper
#

that mean infojeux

formal agate
#

what are you trying to build?

#

a game?

late hill
#

He/she/it just wants to check how many users are in a certain server

opal copper
#

yes

formal agate
#

omg

#

ok

opal copper
#

the bot must be in the server to know the total of players, no ?

formal agate
#

any specific server right?

#

yes it must be in it

opal copper
#

yeah

#

ok thx

#

thx that working, i'm just stupid

formal agate
#

ok

mossy vine
#

because you didnt commit/push

#

the M indicates that its Modified (not the same as the file uploaded on your git repository)

formal agate
#

i never linked to github yet i have that

mossy vine
#

link what to github

#

if you just do git clone blabla it will set up the folder you cloned it into as a git folder or whatever

#

so if you make changes, it will indicate it

formal agate
#

i cannot figure out why node-gyp will not install

#

i have spent way to many hours look up error codes, installing "build packs" reinstalling node, npm etc

#

and i really need help on why its so broken/won't work

split hazel
#

How do i get an ip of someone who visits my webpage?

earnest phoenix
#

Database @split hazel

split hazel
#

I know

#

simple

#

but how to get it

#

The ip in the first place

earnest phoenix
#

Why you need ip?

split hazel
#

I need it so i can make users submit a form only one time

earnest phoenix
#

Oh

#

So sql

sly wyvern
#

What tech stack?

split hazel
#

and compare it to the one in database

sly wyvern
#

Since that's definitely something you have to do server-side.

split hazel
#

Would that maybe be a get request when someone visits a site?

sly wyvern
#

Since you need access to the HTTP request headers.

#

(And in any case, if you're trying to defend against multiple submissions, you need to put that code somewhere where an attacker can't just delete it the way they can with client-side JS.)

#

@split hazel In any case though the exact way to do it depends on what you're actually using server-side.

#

Since the way you do it in PHP is different from the way you do it in Node which is different from Python which is different from ...

split hazel
#

I don't worry about that since i pass everything through my web server as soon as a request gets sent

#

oh wait nevermind

#

thats true

sly wyvern
#

Getting a visitor's IP address is something that only the actual server answering the request can do.

amber fractal
#

Why would you need a users ip?

earnest phoenix
#

is there a way to connect discord bot to phpmyadmin database?

harsh nova
#

yes

#

with code

earnest phoenix
#

well i'd imagine with code

#

im just strugglin on how ๐Ÿ˜ญ

harsh nova
#

what lang

sly wyvern
#

I'm guessing PHP since phpmyadmin...

harsh nova
#

im the big dumb

amber fractal
#

well the bot needs to connect to it Thonk

harsh nova
#

idk

#

oh wait

#

im so dumb

#

you want your bot to connect lol ahh

sly wyvern
#

phpmyadmin is a database dashboard, unless it has some kind of extra plugin API then basically you just have to put your data in the database.

#

And then you'll be able to view and edit the database with the database dashboard.

earnest phoenix
#

python

#

actually

#

cx

#

i have the database... i have the tables and everything.. im just struggling with connecting to it

#

i tried importing pymysql but it doesn't seem to connect to the database

sly wyvern
#

Ok, so is the issue is you can't connect phpmyadmin to the db, or you can't connect python to the db?

#

Have you tried following along with one of the pymysql examples? (assuming it's the latter issue)

earnest phoenix
#

what

#

phpmyadmin is where the database is stored

#

ive been going at this for a few hours, so yes

#

it seems i need to use MySQLdb? idk!

opal copper
#

I want to create a command who give the first role of a user in an other server, how should i do it ( discord.js )

quartz kindle
#

Phpmyadmin is an interface, not the actual database

earnest phoenix
#

;o

#

ok well i used phpmyadmin to create the database
and i have it lol now im just trying to figure out the correct command for the bot to connect to the database.

quartz kindle
#

Phpmyadmin supports mysql/mariadb

earnest phoenix
#

Cuz there's pymysql and MySQLdb

quartz kindle
#

So you need a mysql driver for your language

#

Either one of those should work

earnest phoenix
#

ok, now im just trying to connect to the database

#

but when i try to connect, it says "Access denied for user 'user@MYSERVERIP'

#

problem is, MYSERVERIP is the ip for my server, NOT the ip for the database.

#

(and yes................. i have the ip for my database in the settings file, so idk why it's trying to connect with my server's ip?)

quartz kindle
#

Whats the ip you put there?

earnest phoenix
#

im pretty sure it's my database's ip

quartz kindle
#

Is your database running on the same machine as your python bot?

earnest phoenix
#

no

#

if it was

#

then i'd just put localhost :p

quartz kindle
#

You're using mysqldb now?

earnest phoenix
#

i switched back

#

..<

#

using pymysql

quartz kindle
#

How are you connecting to it?

#

Did you copy their docs example?

earnest phoenix
#

db = pymysql.connect("IP","USERNAME","PASSWORD","DATABASE_NAME")

quartz kindle
#

I dont know python very well, but in their example they're using host=ip instead of just ip, same with other fields. Idk if that makes a difference though

earnest phoenix
#

yea, i'll have to try it.
my hosting provider just informed me they block connections on the server im using, so imma have to resolve this issue first lol

quartz kindle
#

Yeah firewall rules was my next suggestion xd

#

Im using google vps, and it blocks everything by default

earnest phoenix
#

oh that suckss ^

#

na, i got a bud who owns a hosting company, so he just helps me out ๐Ÿคท c:

quartz kindle
#

Well, firewalls exist for your protection, its good that it blocks everything by defauly

#

You just need to configure it

earnest phoenix
#

Hey I wanted to know how I could make a command that reads the args , and does something based on those specific words... so for example https://hastebin.com/jedupeyefa .. if the user puts in *rforum Announcements , i want section to equal "announcements.27"

sly wyvern
#

What have you tried?

earnest phoenix
#

i dont know how to start it up

#

im pretty sure its something really simple that im missing

sly wyvern
#

How to start what up? The bot?

earnest phoenix
#

no ROFL

#

its so hard to explain im sorry

#

so i want section to be a list of things basically

#

but like

#

fk its so hard to explain it

sly wyvern
#

Ok, so which API are you using?

earnest phoenix
#

cheerio? but its not rlly an API problem

sly wyvern
#

Ok, so you have an entry point somewhere that's in response to an event from the API right?

earnest phoenix
#

yes

#

basically i want section to vary depending one the users input

sly wyvern
#

Somewhere on that entry point you're receiving the text of the user's message as an argument or such.

earnest phoenix
#

is if they say " Off topic" then i want section to be off-topic.26.. if its announcements then section will be announcements.27

quartz kindle
#

So... Person types announcemets, first extract the word from the message using split and slice and join, or equivalent

#

Then have an object with keys and values containing the command words as keys

earnest phoenix
#

^^

#

is there an example anywhere that i can see how to use it

#

because ik what ur talking about but idk how to use it properly

sly wyvern
#

First off, what are you doing to recognise commands right now? You do have a working command that doesn't do anything with arguments right?

quartz kindle
#
Object = {
Announcements = "announcements.27"
}
earnest phoenix
#

see

#

thats perfect

quartz kindle
#

Then do Object[args]

earnest phoenix
#

so like would i do Section = { yatayatayata }

quartz kindle
#

Where args is the extracted word from the message

#

Im on the phone so i cant type a better example properly

earnest phoenix
#

its fine i got a good idea

#

thanks ๐Ÿ˜„

opal copper
#

I want to create a command who give the first role of a user in an other server, how should i do it ( discord.js )

earnest phoenix
#

is this right?

sly wyvern
#

That depends. Does it work?

#

Then it's right.

earnest phoenix
#

well no because = is an unexpected token

#

but am i going about this right?

lament meteor
#

try to change it to this

#
{"a": "b",
"c": "d"}```
earnest phoenix
#

o

#

good tip

lament meteor
#

@opal copper what do u mean?

#

@earnest phoenix i kinda suggest u to learn js

earnest phoenix
#

i learn as i go

lament meteor
#

not suggestable but ok

opal copper
#

i want to create a command that give the first role of a user ( for example : Luca (first role : special bot ))

lament meteor
#

oh

#

so like an info cmd?

opal copper
#

yes

lament meteor
#

what lib?

opal copper
#

discord js

lament meteor
#

stable i presume?

opal copper
#

yes

lament meteor
opal copper
#
bot.guilds.get(infojeux).roles.find(role => role.members.first).author)```
I've tried this but he give me 'undefined'
lament meteor
#

@opal copper are u getting a users or the guilds?

opal copper
#

a user of a guild

lament meteor
#

ok

earnest phoenix
#

so basically this is whats making my mind confused rn

lament meteor
#

how

#

thats because u dont understand js

#

you never mentioned sections in your code

steel heath
#

wow telk that was rude

earnest phoenix
#

ik i didnt

#

im not an idiot

#

as you can see sections isnt defined yet because im having trouble on how to define it

lament meteor
#

i presume u are taking it from input which means section[input] would give what u need

earnest phoenix
#

hmm

#

thank you

opal copper
#

I want to create a command who give the first role of a user in an other server, how should i do it ( discord.js )

sly wyvern
#

@opal copper Uhhh, not sure exactly what you're asking here...

#

You want a command that grants a particular role to the first person who uses it on a given server?

#

Aside from technical implementation, first off why do you want that?

opal copper
#

that for the staff server of a community, when that command will drop the role of the user that he have in the community server and will give it in the staff server

#

the hoist key will help me, but idk where should i put in

sly wyvern
#

Ok, so what you want is to synchronize roles between two different servers? So that when granted a role on one server, they're granted the same role on the other server?

opal copper
#

wtf idk what exactly you mean

sly wyvern
#

The problem isn't not knowing how to do things, the problem is that nobody understands what you're asking for through your broken English.

opal copper
#

that because i'm french

sly wyvern
#

I don't blame you for that, I'm just trying to understand what it is you actually want.

opal copper
soft plaza
#

Anyone know how to install mysql community server instead of Maria db?

opal copper
#

and i would like that when i put my command "i/uinfo" that give me the name of the role that i have in the community server

sly wyvern
#

Hmm, I think I understand what you're asking now.

opal copper
#

cool

soft plaza
#

apt install mysql-server installs Maria db

#

And I don't want that

sly wyvern
#

mariadb is the same as mysql

earnest phoenix
#

@sly wyvern

sly wyvern
#

just a different version

soft plaza
#

Yeah but it's not compatible with my code

earnest phoenix
#

so what he wants is , if we are in this server, he wants to be able to get his user info from his server and show it here

#

which is dumb

#

but hey

#

not my bot

sly wyvern
#

@soft plaza did you try it? The whole point of SQL is that code written for one database will work on another database, and that's doubly so for MariaDB and MySQL which are literally just different versions of the same database.

soft plaza
#

I know, the this is that I have to modify a lot code to make it compatible, il just looking for a way to get the old version

sly wyvern
#

Literally the only thing you should need to change is the database driver.

soft plaza
#

I got it on an other machine but on a new one, it installs mariadb

sly wyvern
#

If that.

#

Basically, you just need to figure out the guild id of the community server, then call client.guilds.get(<guild-id>).roles

opal copper
#

bot.guilds.get(infojeux).author.roles.find(role => role.name).author) is the command that i test

#

infojeux is a var

#

for the id of the server

sly wyvern
#

actually wait no wrong I misread the docs

opal copper
#

but the hoist key get the role that is separate in the user list

sly wyvern
#

Ok, I'd go with client.guilds.get(<guild-id>).members.get(<user-id>).roles to get a user's roles.

opal copper
#

for me <user-id> is replace by author

sly wyvern
#

Yeah of course, you pass in message.author.id there.

#

The key thing is that you're trying to get the Member object from the other guild, not the Member object for the guild you're currently in.

opal copper
#

yes now he give me [object Map]

sly wyvern
#

And that's the role list. I'm not sure how you want to process that, since a user can have more than one role, but you should be able to iterate over it and do what you need.

opal copper
#

i've tried this but he give me again [object Map]

bot.guilds.get("418898640942399509").members.get(message.author.id).roles.filter(role => role.hoist.name))
opaque eagle
#

Why do u have a second ) there, may I ask? (at the end)

sly wyvern
#

what's role.hoist supposed to refer to?

opal copper
sly wyvern
#

Oh wait sorry just read that.

#

Sorry I'm not that familiar with the js library, I mostly use the python one.

opal copper
#

oh ok

sly wyvern
#

I see what you're trying to do though.

opaque eagle
#

p.s. object map is what u want tho

#

it just says [object Map] becuz it doesn't wanna spit the whole map onto the console/message

sly wyvern
#

That last bit should probably be .filter(role => role.hoist).map(role => role.name)

opaque eagle
#

^

sly wyvern
#

or something to that effect

#

don't remember if .map is something that works on Map collections or if that only works on sets and lists.

opaque eagle
#

Probably... .filter(role => role.hoist).array().map(r => r.name).join(" ")

opal copper
#

that working but he give four other role that is not hoist

opaque eagle
#

What do u wanna do with the info?

#

Just display it?

opal copper
#

Its to recognize everyone and other but that will usable for other thing

dusky steeple
#

Can someone help me figure out what is wrong with this. I have no clue how to fix and the stuff I have been reading isn't helping me much lol. It is telling me that .then is a Unresoved Function or Method

let translation = toTranslate.slice(toTranslate.length - toTranslate.length, toTranslate.length - 2).join(' ');
    translate(translation, {to: language}).then(res => {``` And yes I know I asked this earlier.
opaque eagle
#

Does translate() return a promise?

sly wyvern
#

Clearly whatever translate() returns isn't something that has a then in it.

opaque eagle
#

then is just a function used to run code after a promise is resolved

#

it's a default on all functions that return a promise

sly wyvern
#

ok.

#

@opal copper did you try @opaque eagle's snippet?

opal copper
#

yes

dusky steeple
#

the only other line that has anything to do with translate is javascript const translate = require('google-translate-api');

sly wyvern
#

that's kinda critical to know...

opal copper
#

it just made me jumps between the 5 roles

opaque eagle
#

Where'd u define language?

sly wyvern
#

Are you sure they're not all set as hoisted?

dusky steeple
#

this is the whole code:

let toTranslate = msg.content.split(' ').slice(1);
    let language;
    language = toTranslate[toTranslate.length - 2] === 'to' ? toTranslate.slice(toTranslate.length - 2, toTranslate.length)[1].trim() : undefined;
    if(!language) {
        const embed = new discord.RichEmbed();
        embed.setColor('RED');
        embed.setTitle('An error has occurred');
        embed.setDescription(`Please supply a valid argument.\n**Example** \`${msg.settings.prefix}translate Hello world to english\``);
        return msg.channel.send({embed: embed});
    }
    let translation = toTranslate.slice(toTranslate.length - toTranslate.length, toTranslate.length - 2).join(' ');
    translate(translation, {to: language}).then(res => {
        const embed1 = new discord.RichEmbed();
        embed1.setAuthor(`${client.user.username} translation`, client.user.displayAvatarURL);
        embed1.setColor('RANDOM');
        embed1.addField('Translation', `**From:** ${res.from.language.iso}\n\`\`\`${translation}\`\`\`\n**To:** ${language}\n\`\`\`${res.text}\`\`\``);
        msg.channel.send({embed: embed1});
    }).catch(err => {
        msg.channel.send({
            embed: {
                description: 'โŒ We could not find the supplied language.',
                color: 0xE8642B
            }
        });
    });```
opal copper
#

yes

sly wyvern
#

Ok. Have you tried actually printing out the whole object before the filter to see exactly what's in it?

opaque eagle
#

console.log translation and translate for me before the translate line

opal copper
#

he give me object map

sly wyvern
#

Well yeah, you need to actually print out the map's contents.

#

If you want to see what's inside it.

opaque eagle
#

Are you console.log-ing to get [object Map] or is it smth else?

dusky steeple
#

you talking right here?

    console.log(translation);
    translate(translation, {to: language}).then(res => {```
opaque eagle
#

yep

dusky steeple
#

ok 1 sec

opaque eagle
#

both translation and language

#

So just do console.log({ translation, language });

dusky steeple
#

ok the log says this
{ translation: 'Hello world', language: 'french' }

opaque eagle
#

The npm package u use only seems to accept ISO 639-1 codes

dusky steeple
#

um ok lol

opaque eagle
sly wyvern
#

so instead of french you need fr

dusky steeple
#

tried that

#

does the same thing

opaque eagle
#

Show me what the console said

dusky steeple
#

{ translation: 'Hello world', language: 'fr' }

opaque eagle
#

And it's the same error? nothing in the message and the stack trace changed?

dusky steeple
#

it doesn't give me an error in the console. The code seems to skip this part and go to the .catch(err) part of the code.

translate(translation, {to: language}).then(res => {
        const embed1 = new discord.RichEmbed();
        embed1.setAuthor(`${client.user.username} translation`, client.user.displayAvatarURL);
        embed1.setColor('RANDOM');
        embed1.addField('Translation', `**From:** ${res.from.language.iso}\n\`\`\`${translation}\`\`\`\n**To:** ${language}\n\`\`\`${res.text}\`\`\``);
        msg.channel.send({embed: embed1});```
opaque eagle
#

Then how'd u handle the error?

gilded blaze
#

Log the error

opal copper
#

the problem now for me is why he gives me 5 roles while 4 are not hoist

sly wyvern
#

What does bot.guilds.get("418898640942399509").members.get(message.author.id).roles.filter(r => r.hoist).array() actually output though?

dusky steeple
#

this is what the console says when I log (err)

{ Error
    at /home/oem/Desktop/RedQueen/node_modules/google-translate-api/index.js:105:17
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7) code: 'BAD_REQUEST' }```
sly wyvern
#

Because if the roles are in that output, they have hoist set. That's how filter works.

opal copper
#

when i add map(e => e.name) he give me the same thing

opaque eagle
#

Where do u see [object Map]?

#

What's ur way to see what it outputs?

#

Do u make sure to console.log() and not do anything crazy like send it to a channel?

dusky steeple
#

me?

opaque eagle
#

No, Tsumiki

#

No, Tsumiki

bright spear
#

thats a bug with google-translate-api @dusky steeple

opal copper
#

oh me

opaque eagle
#

Most likely ^^

bright spear
#

its a working fork

opaque eagle
#

Or the actual api endpoint, just saying

opal copper
#

no @opaque eagle now i see the name of role but he give me 5 roles of which 4 are not hoist

sly wyvern
#

How did you verify that the four other roles are not hoist?

opal copper
#

yes

sly wyvern
#

Not "did", "how did".

#

What did you actually do to verify that?

dusky steeple
#

@bright spear TYVM that worked perfectly

bright spear
#

yw

opal copper
#

1 can be hoist and its crรฉateur

sly wyvern
#

And when you check the hoist on each of those roles, what does it say?

opal copper
#

hoist flag ?

sly wyvern
#

Not "what do you think it is", what actually is it?

amber fractal
#

Their highest role

#

Iirc

sly wyvern
#

Because I can pretty much guarantee it's true for all of them.

#

What you need to do is sort by the role position value and get the first one.

#

If you want to know which one you get displayed under.

opal copper
sly wyvern
#

But ALL of those five roles are hoist roles.'

#

By virtue of the fact they were returned by that filter expression.

opal copper
#

hoist define all the separating roles in the users list ?

#

because for me hoist is the role OF the user who is separated in user list

bright spear
#

no...

#

its the hoist setting

opal copper
#

yes that what i mean

sly wyvern
#

And all five of those roles have that setting switched on.

opal copper
#

oh ok, i'm just stupid

sly wyvern
#

What you can do though, is try sorting the role list based on role.position.

opal copper
#

is that possible to filter the highest role that the user have ?

#

with .position

sly wyvern
#

Sort based on role.position and then just take the first element of the array.

bright spear
#

actually

sly wyvern
#

bot.guilds.get("418898640942399509").members.get(message.author.id).roles.filter(r => r.hoist).array().sort(r=>r.position)[0]

bright spear
#

just check if the role is member.hoistRole

sly wyvern
#

Or is it last? I don't actually know.

opal copper
#

ok thx i will do that

bright spear
sly wyvern
#

So that'd be bot.guilds.get("418898640942399509").members.get(message.author.id).hoistRole?

bright spear
#

if you're starting with the message

#

just message.member.hoistRole

#

simple

sly wyvern
#

They're trying to get the hoist role of the user on a different guild than the one in which the command is being issued.

bright spear
#

ah

#

then yeah you're right

opal copper
#

ok now he give me 1role but not the right role

bright spear
sly wyvern
#

Doing the [0] thing or the .hoistRole thing?

vernal basin
#

I'm getting this really weird error every time I launch my bot.

    at errnoException (dns.js:50:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
(node:17228) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:17228) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

(library is node.js)

#

Any clue why?

opal copper
#

position give the role calculated in the api

#

so .calculatedPosition is the right to use

bright spear
#

@vernal basin ur network is screwed up

opal copper
#

no ?

vernal basin
#

oof

sly wyvern
#

Try the bot.guilds.get("418898640942399509").members.get(message.author.id).hoistRole one instead that @bright spear pointed out.

bright spear
#

^

opal copper
#

ok

vernal basin
#

well it just started doing it yesterday

#

and I haven't changed anything related to my network since like two weeks ago

bright spear
#

so it can't connect

opal copper
#

now he give the right role

vernal basin
#

oof

opal copper
#

i just add .name because he give me @deleted-role

vernal basin
#

feelsbadman

opal copper
#
bot.guilds.get("418898640942399509").members.get(message.author.id).hoistRole.name

is the right to use, thx for help guys. And sorry for my english

sly wyvern
#

Don't worry about it, we don't mind as long as you at least try.

opal copper
#

Understand me, I'm 15 years old and I'm french

#

but thx

sly wyvern
#

(Honestly it's better English than some of my clients at work ...)

bright spear
#

lol

opal copper
#

xD

#

thx you for the compliment

ocean vale
sly wyvern
#

have you tried removing the extra indentation?

#

Also, the dialog box is pretty useless, you should look at the actual console error since that'll tell you the line number of the issue.

ocean vale
sly wyvern
#

Yeah, you need to fix your indentation. In python every single line has to be indented correctly or the program either won't work or will do something else entirely.

slender thistle
#

Don't indent @client.event

sly wyvern
#

^

slender thistle
#

It must stay on the same column as async def

sly wyvern
#

Also, you need to indent the following line if message.content ... four spaces past the start if the previous line.

slender thistle
#

Does it matter

#

As long as it is indented

sly wyvern
#

sloppy code = sloppy thinking

slender thistle
#

C o n s i s t e n c y :^)

ocean vale
#

this is my first time coding by my self

sly wyvern
#

I wish you luck then.

#

But in python, indentation matters.

#

It's not like C or Java where you can put whatever you want wherever you want.

smoky mica
#

how to add a field with just the title?

#

discord.js

sly wyvern
#

And indenting things the same way, even in the rare cases where it doesn't matter, lets you avoid a whole class of weird issues where you thought it didn't matter but it actually does.

smoky mica
#

can anyone help?

sly wyvern
#

There's no penalty for indenting things correctly even when it's not strictly necessary.

#

Field with just the title?

#

Like, just don't set the description.

#

Which API are you using?

smoky mica
#

yeah but the description goes "undefined"

sly wyvern
#

Oh, didn't see your earlier post, discord.js.

smoky mica
#

yes.

sly wyvern
#

So, you're passing the embed dictionary to send, what about that doesn't let you omit the description?

#

What about message.channel.send({embed: { title: "My Title" }}); doesn't work for you?

#

Oh wait you're talking about fields?

#

Well same thing there, just pass the name attr and no value.

#

And if that doesn't work, pass an empty string.

smoky mica
#

No no, I just need to get rid of the description and only keep the title

sly wyvern
#

What have you tried?

slender thistle
#

Does description: "" work?

lament meteor
#

which is better? canvas or gm for img manipulation(node.js)

slender thistle
#

I've seen people here suggest canvas

lament meteor
#

idk i find canvas missing features

#

well not rlly missing but most of the stuff people prefer built in like greyscale

smoky mica
#

I tried to add a blank field thinking I could keep a title but nah ๐Ÿ˜‚

lament meteor
#

u could keep the title

smoky mica
#

nah

#

it must be true or false only

lament meteor
#

@smoky mica like this?

smoky mica
#

.addField automatically gives you title to keep and description i only kept title but description still appears and says undefined

#

wot

lament meteor
smoky mica
#

i'm talking about fields

lament meteor
#

oh

#

hmm

#

why do u want a field with an empty value

#

just use a description or title

amber fractal
#

zero width space

smoky mica
#

so i want like this a title for something below like
Main title
Sub Title

amber fractal
#

Zero width space in the field value

smoky mica
#

oh.

#

how.. do i do that?

amber fractal
#

โ€‹

#

Copy that

lament meteor
#

โ€‹

smoky mica
#

I was wondering that but it leaves a big gap ya know

amber fractal
#

You cant do it otherwise that I know of

smoky mica
#

nvm lol it counts as nothing written in quotation marks

#

I saw a guy do it with his bot

amber fractal
#

It does count as something

#

it's zero width

smoky mica
#

lemme try i think i messed up smth while writing

#

it worked but as i was correct its leaves a gap

bright spear
#

yes its supposed to

smoky mica
#

exactly but i just need rating (main title) there and no gap, my stupid dumb ass cant understand how to get this to work

amber fractal
#

You cant have just a title in a field

#

without the gap

smoky mica
#

you can somehow

#

saw a guy do it

worn hull
#

.addBlankField()

amber fractal
#

They want it to have a title

#

Just no value

worn hull
#

O

#

Couldnt u just do

#

.addField("title", "\n")

#

@smoky mica

amber fractal
#

He doesnt want a blank space

#

Thats the issue

bright spear
#

its not possible

#

each field has a space for title and content

#

you can make one blank but it'll still be a blank space

sick cloud
#

@smoky mica you could use bold

#
Title
**Sub title**
sub content
last lava
#

What is the best way to develop a balance/credits

#

I tried using better SQLite but it returned an error each time, and I had all prerequisites

sick cloud
#

use a database

#

any sql (mysql, postgre, etc), redis, rethink, mongo

#

theres a lot

last lava
#

Okay

#

Is there any reference i could use, or should I jump rt in and experiment?

sick cloud
#

just experiment

last lava
#

Okay

#

Thanks

sick cloud
#

the database work itself is basic, your setting and getting

#

the rest is upto your development experience

last lava
#

Would fast-csv work for this?

sick cloud
#

what?

last lava
#

Nvm

sick cloud
#

i mentioned all the databases above

amber fractal
#

But whats a good db for when you need to shard or how do you modify your code to work with it is the real question

sick cloud
#

rethink is the best for sharding

#

it supports connection pools and stuff, and its realtime

amber fractal
#

How would you even test sharding tbh

#

I feel like there isnt much you can do

#

I would say shard a bot and test it on 2 guilds, but they will probably have the same shard id

sinful lotus
#

MongoDB is fine

late hill
#

I use Mongo for my sharded bot

#

Depending on library you should be able to get 2 shards with 1 server on each @amber fractal ๐Ÿ‘€

#

Like Eris has options for amount of shards/amount of servers per shard

amber fractal
#

Doesnt discord decide which server goes where?

lethal plover
#

Can someone help me with a purge/clear command please. I am using discord.js-commando btw

#

DM me with the help plz

mossy vine
#

no
noone spoonfeeds here

#

we arent going to give you a complete command yo

lethal plover
#

I wanna be fork fed tho

mossy vine
#

just delete the ammount of messages from the channel

#

done

lethal plover
#

Nah i want my bot to do it ๐Ÿ˜Ÿ

#

all it can do atm is respond to ping, hey, r!help, r!flip, r!roll, r!ban, r!kick and thats it

#

and r!prefix

mossy vine
#

then add more commands

#

make your bot delete the ammount of messages from the channel by writing a command

lethal plover
#

Thats wat i want help w/

knotty steeple
mossy vine
#

if you have an actual script that doesnt work, we help. but noone will give you a complete code

knotty steeple
#

look above

mossy vine
#

and also that

lethal plover
#
channel.bulkDelete(5)
  .then(messages => console.log(`Bulk deleted ${messages.size} messages`))
  .catch(console.error);

How do i make this look for args that the user puts after r!purge thoughh

knotty steeple
#

idk

#

figure it out

#

replace the 5 with your args

mossy vine
#

you write a command parser that should already be done since youre using commando

knotty steeple
#

also dont just take the example and use it

#

write ur own code

mossy vine
#

yeah its bad idea

lethal plover
#

this si the template i have written for most of my commands

#
const commando = require('discord.js-commando');
const bot = new commando.Client({
    commandPrefix: "r!" 
    })
class CommandName extends commando.Command
{
    constructor(client)
    {
            super(client,{
                name: 'name'
                ,group: 'file'
                ,memberName: 'name'
                ,description: 'description of command'
            });
    }


    async run(bot, message, args)
    {
        //command goes here
    }
    
       
    
}

module.exports = CommandName
mossy vine
#

oh my fucking god dont tell me you are making a new client for every command

lethal plover
#

well thats what i was told to do.

#

am i not supposed to?

mossy vine
#

of course not

amber fractal
#

Wait

lethal plover
#

Doesnt the bot need to be defined again in a new file?

mossy vine
#

no.

amber fractal
#

No

mossy vine
#

why the hell would it have to be?

amber fractal
#

You pass the bot

#

As a parameter

lethal plover
#

o

amber fractal
lethal plover
#

well, ill fix that after i amke sure this is working, Will this work?

const commando = require('discord.js-commando');
const bot = new commando.Client({
    commandPrefix: "r!" 
    })
class PurgeCommand extends commando.Command
{
    constructor(client)
    {
            super(client,{
                name: 'purge'
                ,group: 'management'
                ,memberName: 'purge'
                ,description: 'Deletes a given amount of messages.'
            });
    }


    async run(bot, message, args) 
    {
        channel.bulkDelete(args)
  .then(messages => console.log(`Bulk deleted ${messages.size} messages`))
  .catch(console.error);

    }
       
    
}

module.exports = PurgeCommand
mossy vine
#

uhm

#

what is args

amber fractal
#

He may pass args

mossy vine
#

i mean

lethal plover
#

i got the error An error occurred while running the command: ReferenceError: channel is not defined

mossy vine
#

is it a number, the rest of the message, or whatever

lethal plover
#

is it a number

#

cuz

mossy vine
#

oh i wonder why you get that error

#

because the channel is not defined maybe?

#

this is why you dont copypaste examples

lethal plover
#

but where have i said channel in the command tho

#

im confudled

amber fractal
#

?

lethal plover
#

oh channel.bulkDelete

amber fractal
#

Literally what you sent.

lethal plover
#

How do i fix that how do i make it the channel that the command has been said in

amber fractal
#

You pass message

knotty steeple
#

god

#

what did i come back to

#

i told you write your own code dont just copy paste the example

lethal plover
#

i think i fixed it

#

TypeError: Cannot read property 'bulkDelete' of undefined

#

what does that mean

quartz kindle
#

That you didnt fix it

lethal plover
#

im confudled x 2

amber fractal
#

The part before bulkDelete isnt defined

knotty steeple
#

lmao

quartz kindle
#

Do npm install undefined

#

that was a joke

amber fractal
#

What does undefined even do? Thonk

knotty steeple
#

undefined is an actual module

lethal plover
amber fractal
#

I know

#

What doea ot do tho

lethal plover
#

why is module red squigly lined

knotty steeple
#

literally just Define your undefined yo!

dusky steeple
#

hold your mouse over it

lethal plover
#

How do i define bulkDelete

amber fractal
#

Do you still module.exports at the bottom?

lethal plover
#

ok audio

amber fractal
#

bulkDelete isnt the issue

lethal plover
knotty steeple
#

did you copy paste that also

lethal plover
#

no

#

Not this code

knotty steeple
#

totally

lethal plover
#

Which is why it has errors

#

cuz im a nub

#

what does this mean

#

Thats when i hover over the red squigly thing

knotty steeple
#

read the error

lethal plover
#

whats a token constructor method accessor or property

quartz kindle
#

Thats why you shouldnt use commando when youre a noob

lethal plover
#

:>

#

someone just tell me plz im confusedddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd

quartz kindle
#

You wont understand if we try to explain

mossy vine
#

dont use commando

knotty steeple
#

and learn js

quartz kindle
#

Its like explaining fractions to someone who oknly knows addition and subtraction

lethal plover
#

But commando makes it look neater and stuff cuz i can use different files

dusky steeple
#

I tried using commando once and made 1 line and said f*** this

knotty steeple
#

you can use different files in normal d.js

dusky steeple
#

um you can use different files with any language or am I wrong on that?

knotty steeple
#

someone tell me a decent sized bot made in d.js

lethal plover
#

Im following dapper dino's videos btw

knotty steeple
quartz kindle
#

You can do everhthing commando does wjthout it, plus you learn how commando itself works

dusky steeple
#

What do you consider "decent sized"?

earnest phoenix
#

@lethal plover lol you need to work on rexi properly

lethal plover
#

No

knotty steeple
#

eh

lethal plover
#

Fuck you

knotty steeple
#

more than 1k

earnest phoenix
#

...Faisal how dare u

lethal plover
#

@earnest phoenix stop u can code the bot urself then

dusky steeple
#

in more than 1k servers?

knotty steeple
#

dont follow a tutorial

dusky steeple
#

definetly not my bot lol

earnest phoenix
#

no thanks @lethal plover

lethal plover
#

ooooooo thanks @knotty steeple

knotty steeple
#

about

lethal plover
#

Imma do that now

knotty steeple
#

making a bot

dusky steeple
#

im only up to 20 servers lol

knotty steeple
lethal plover
#

I already have a codecademy account, but i forgot the password

#

so unless i make a new email i cant use that

quartz kindle
#

Just reset your password?

lethal plover
#

im stupid ok

quartz kindle
#

You dont know how to reset passwords and recover accounts?

lethal plover
#

I dont usually need to do it as im not normally a one to forget passwords

#

and the email isnt sending

#

this is slowwwwwwwwww

quartz kindle
#

Patience is a virtue

earnest phoenix
#

how often is it okay to update presence

slender thistle
#

2 mins at the very min, 5 average iirc

dusky steeple
#

How could I make this show up in a embed thumbnail?

const avatar = body.avatar || body.defAvatar;
mossy vine
#

.setThumbnail(avatar) assuming you use d.js

dusky steeple
#

hmm I tried that and it threw an error.

mossy vine
#

send code

#

and error

dusky steeple
#
embed.thumbnail.url: Not a well formed URL.```
mossy vine
#

then its obviously not a well formed url

dusky steeple
#

I am trying to pull the bots avatar from dbl site

mossy vine
#

your bots avatar

#

why not just client.user.avatar

earnest phoenix
#

bot.user.avatar

dusky steeple
#

no I have a command like Luca does

earnest phoenix
#

or client ^

dusky steeple
#

to search for a bot

earnest phoenix
#

oh

dusky steeple
#

I have the bot reading the information correctly just trying to figure out how to show the bot that was searched for avatar in a thumbnail in embed.

earnest phoenix
#

wait a sec I am going to api

#
dbl.getBot("id).then(botI => {
console.log(botI.username)
let avatar = botI.user.avatar

empty steppe
#

does anyone know how the 2000 char limit per message is calculated for embeds?

mossy vine
#

if field.length >= 2000

bright meadow
#

@bitter sundial when the webhook sends the POST request, what do I have to type in $_POST['here']

#

sry for ping

empty steppe
#

hm but there can be multiple fields and fields have a name and title, etc

hushed berry
#

@empty steppe the content length is separate from embeds

#

embeds have their own limits separate from 2000

bright meadow
#

nik can u help me too xd

empty steppe
#

oh interesting, where can i read up on that?

hushed berry
empty steppe
#

thanks nik

hushed berry
#

๐Ÿ˜„

#

@bright meadow whats up avo

bright meadow
#

did you make a webhook server with php

#

for dbl votes

hushed berry
#

no

bright meadow
#

cri

hushed berry
#

lel

bright meadow
#

They say that they send a POST request

#

but I need the POST field's name

hushed berry
#

what

#

post requests dont have field names

bright meadow
#

๐Ÿค”

hushed berry
#

like that dosent make sense

bright meadow
#

But $_POST is an array

hushed berry
#

what?

#

๐Ÿค”

#

that doesnt make sense friend

bright meadow
#

so I just retrieve the first index of the POST array?

hushed berry
#

"POST array" doesn't make sense friend

#

no i have no idea what you're talking about

#

it just makes a standard post request to the url you specify

bright meadow
#

in PHP, there is an array

#

for POST requests

earnest phoenix
#

I think no1 use pfp

#

here

bright meadow
#

what do you use then

earnest phoenix
#

js

hushed berry
#

any modern language

#

php is well known for its many faults

bright meadow
#

@hushed berry as before, I tried to run a server on java, but no requests are going in
Is it my vote server/vps or is it DBL

hushed berry
#

well i mean

bright meadow
#

alright umm a vote went in and worked but somehow when I press "Test" it doesn't

#

welp, weird

topaz fjord
#

That's because it doesn't just work magically

#

You usually need to do a reverse proxy

lucid yacht
#

I want to add an incentive for people to vote for my bot by giving them money in one of my bot's games after voting... I understand how to use the DBL API to check whether a user voted or not, but would anyone have any recommendations on how to only give them the money once? All I can think of right now is to set a 15-second timeout after they call the vote command to check again if they voted and add the money if they did, but then if they miss that timeout without knowing it and still vote, they won't get the money which seems really shoddy and jerry-rigged. Any recommendations? Using discord.js
This is a rough draft in notepad of what I was thinking of:

if (message.content === "botcall vote") {
    dbl.hasVoted("message.author.id").then(voted => {
        if (voted) {
            message.channel.send("You've already voted!")
        } else {
            message.channel.send("Here's a link to vote")
            setTimeout(() => {
                dbl.hasVoted("message.author.id").then(voted => {
                    if (voted) {
                        addMoney()
                    } else {return;}
                }
            }, 15000)
        }
    });
}
late hill
#

Don't use hasVoted for it

#

Preferably use webhooks

lucid yacht
#

hmm okay

late hill
#

If that seems to complicated for you, you can use getVotes() as long as you don't get more than 1000 votes a month

#

Check getVotes() every x amount of time and compare it to previous votes

#

New votes means those people voted in that bit of time

#

So reward those people

lucid yacht
#

Okay, I'll definitely look more into that, thank you!

#

honestly I should probably figure out the webhook eventually anyway

late hill
#

Yes

rocky mesa
#

yo is it possible to edit code with eval?

#

or atleast see it

split hazel
#

You can use FS if you're using node

rocky mesa
#

owo

#

ok can I have an example

split hazel
#

I'm not an fs pro myself since i dont use it often

rocky mesa
#

ok

#

thank you though

steel heath
#

can anyone just give me a code to change everyone's nickname (for an event) without getting ratelimited

mossy vine
#

just wait a second or two between changing nicks

steel heath
#

im on mobile pls

inner jewel
#

any lib that properly handles ratelimits should be able to run that

clear moth
#

Can i make a command in python which makes my bot's prefix switchable (like rythm or dyno)

inner jewel
#

yes

#

just use a database

clear moth
#

Ye ik but how can i do that?

ruby dust
clear moth