#development

1 messages Β· Page 1246 of 1

tidal marlin
#

πŸ€”

opal plank
#

users want your pretty embed

#

not the one from system

#

isnt that the wholepoint of your welcomer?

tidal marlin
#

No?

opal plank
#

then why have a welcomer in the first place

tidal marlin
#

I don't even think I put it in embed

opal plank
#

then whats the purpose of it?

#

repeating messages?

tidal marlin
#

To say the stuff admin/mod wants

#

To like remind the user that joins

ashen mulch
#

How do i make the server bot work?

opal plank
#

well,you do you, i explained what you should do, if you dont want to,your choice mate

ashen mulch
#

Its not working on my own server

tidal marlin
#

What I'm doing is working fine, why change

#

πŸ€”

opal plank
#

then why ask for help in the first palce?

pale vessel
#

lol

tidal marlin
#

I asked for systemChannel help

pale vessel
#

systemChannel isn't always available

opal plank
#

which we answered and said why its bad to it that way

tidal marlin
#

Yes, got that

pale vessel
#

so uh

tidal marlin
#

But I also received 'db 101'

ashen mulch
#

?

pale vessel
#

lul

opal plank
#

next time i'll just answer 'you doing bad stuff'

pale vessel
#

it was a good lesson

opal plank
#

without a proper explanation of why after

tidal marlin
#

@pale vessel not much

#

I'll just change the schematics

ashen mulch
#

How do I ask for support with the bots?

tidal marlin
#

In anyway, when I asked month ago about DB, nobody really could help me, so idc that much now when you say that my DB is working bad, it's working that way cause I didn't have any help to work with it pepowot

opal plank
#

its part of the struggle of coding, you wont always have someone readily available when you get stuck. Its try and error

charred kindle
#

Oh

#

You are sending a type array but it needs to recieve a string @earnest phoenix

#

Its trying to parse the array into a url but it cant

#

You need to be sending a string

carmine magnet
#

A fake oliy

#

Lol no

opal plank
#

next time should read the error msg

livid sentinel
opal plank
#

check topic

silk chasm
#

and i run the following

#

py -3 -m pip install -U discord.py

#

still it showed error

#

it showed this

#
             ^
SyntaxError: invalid syntax```
misty sigil
silk chasm
#

try pip install -U discord.py
@misty sigil it showed

#
        ^
SyntaxError: invalid syntax```
misty sigil
silk chasm
faint prism
silk chasm
rough harbor
#

Is there a possibility to make the discord.py[voice] bot to send a message to all servers it is in with my specifi message? like for example i want mine to respond to (prefix) shutdown to announce it is shutting down.

#

with an arguement like a reason for example

faint prism
silk chasm
#

yea i am on one of this site only

main chasm
#

mongo DB ExcusemeWtf

#

@silk chasm do u know aka ayush ?

silk chasm
#

@faint prism @misty sigil i am running the statement plain do i need to add anything??

#

@silk chasm do u know aka ayush ?
@main chasm ?

main chasm
#

ohh sorry

silk chasm
#

@faint prism @misty sigil i am running the statement plain do i need to add anything??
@silk chasm r u both there?

placid iron
#

LMAO

#

@silk chasm type it into the command line

#

Not the python idle lmao

charred kindle
#

Wait

main chasm
charred kindle
#

He was putting it in IDLE?

faint prism
#

oof

placid iron
#

Yeah that is how he got syntax error

silk chasm
#

wth is idle?

charred kindle
#

wth is idle?
@silk chasm Python's built in super sucky IDE

placid iron
#

Or python interpreter

faint prism
#

type quit() then try the pip install

main chasm
slender thistle
#

man fuck

rough harbor
#

if you want to install it on windows do windowskey +r then type cmd, hit enter, now type py -3 -m pip install -U discord.py in the black box. and hit enter again. then wait for it to install.@silk chasm

silk chasm
#

type quit() then try the pip install
@faint prism nothing happened

slender thistle
#

Use your built-in command prompt

main chasm
#

lol

slender thistle
#

not Python IDLE or files

placid iron
#

Gotta learn python first at this point

charred kindle
#

@silk chasm u on windows?

silk chasm
#

yep

main chasm
#

shivaco

silk chasm
#

Use your built-in command prompt
@slender thistle can u elaborate?

charred kindle
#

ok

#

@silk chasm

#

WIN + R

#

type in CMD.EXE

#

click OK

#

then pip install discord.py

faint prism
#

unless you're in a linux dist

silk chasm
#

click OK
@charred kindle what do i type in open?

placid iron
#

I have a feeling this dude didn't install to path either

charred kindle
#

cmd.exe

main chasm
#

cmd.exe

#

press enter

faint prism
#

oml

charred kindle
#

then from cmd

silk chasm
#

black box opened

charred kindle
#

good

silk chasm
#

now

charred kindle
#

type in pip install discord.py

#

and hit enter

main chasm
#

type in pip install discord.py

slender thistle
#

So zypher, let me ask this. Are you willing to create a Discord bot without any knowledge of Python?

charred kindle
#

Are you willing to create a discord bot without any knowledge of command line?

forest drift
#

how do i add an async function to a module.export?

main chasm
#

shivaco how time long my bot approved blobsipfast

slender thistle
#

me.see(DBL.guild.members[Dedo])?.redirect_to(DBL.guild.channels[support].pins)

faint prism
#

+5 wks

main chasm
#

5 weeks test all bot now stoped ?

#

@slender thistle ok lol

faint prism
#

#support might be more relevant for your question

pure lion
#

Yeah

main chasm
#

done

pure lion
#

@mystic ice what errors pop up or something idk I didn't read the manual

mystic ice
#

my server was dead (vps where i host my bot) so i needed to download the folder and get a new server install
now ive put the files back and installed nodejs, forever and nodemon (which i used to use) it wont start

#

ehh leme see

#

/node_modules/discord.js/src/client/Client.js:41
} catch {
^

SyntaxError: Unexpected token {

quartz kindle
#

Update node

mystic ice
#

how do i do that lol

#

its been a while

charred kindle
#

npm

earnest phoenix
#

djs v12 requires Node.js v12 or higher

charred kindle
#

i think

earnest phoenix
#
apt upgrade node.js -y```
quartz kindle
#

Check the nodejs official website, they have instructions for installing on libux machines

charred kindle
quartz kindle
#

You likely wont find an updated version with apt

silk chasm
#

and hit enter
@charred kindle installed and updated what's next?

mystic ice
#

how i check the version?

#

cuz i think its up to date

slender thistle
#

Brutally ignores my question, nice

mystic ice
#

who

quartz kindle
#

node -v

charred kindle
#

@charred kindle installed and updated what's next?
@silk chasm Create a bot

slender thistle
#

zypher

mystic ice
#

lol

slender thistle
#

Not like this is the first time this shit happened already

mystic ice
#

8.10 it says

#

nice

quartz kindle
#

Youre just too quiet shiv, people dont notice you :^)

charred kindle
main chasm
#

i created code message collector and i connected Mongo DB but idk how to save blobsipfast

earnest phoenix
#

Save?

faint prism
#

upsert a record to mongodb

earnest phoenix
#

Save a wot

main chasm
#

save date

earnest phoenix
#

Create a Collection and insert a document

#

Resolve promise and do save

silk chasm
#

@silk chasm I'm not going to spoonfeed you anymore. Try reading this: https://realpython.com/how-to-make-a-discord-bot-python/
@charred kindle hmmm....ok.... but if i didn't understood u need to "spoonfeed meh"

In this step-by-step tutorial, you'll learn how to make a Discord bot in Python and interact with several APIs. You'll learn how to handle events, accept commands, validate and verify input, and all the basics that can help you create useful and exciting automations!

main chasm
#

wait

#
client.on('message', async message => {
    if(message.channel.name == "suggestions"){ 
        if(message.author.bot) return
        message.delete()

if(message.content.toLowerCase() === '?start') {
      
message.channel.send(' started successfuly :man_biking:')
      
        let filter = m => !m.author.bot;
        let collector = new Discord.MessageCollector(message.channel, filter);   
     
          
        collector.on('collect', (m, col) => {
            
            
                if(m.content.toLowerCase() === '?stop' && (message.author.id === m.author.id)) {
                    console.log("Stopped.");
                    collector.stop();
                }
                else {
                    let embed = new Discord.MessageEmbed()
                        
                        .setDescription(m.content)
                        
                        .setTimestamp()
                        .setTitle("Suggestion")
                        .setAuthor(m.author.tag,m.author.avatarURL({format: "gif"}))
                        .setColor('#4f65ff')
                        message.channel.send({embed}).then(embedMessage => {
                            embedMessage.react("751137346422046738")
                            embedMessage.react("751137346585493536")
                            
                            
                    })
                
                }
                
                        
        
            
        });
    }
    i connected but removed mongoose.connect but tell me when i used ?start after restart bot i want when bot restarded no need again use ?start  ! in
quartz kindle
#

Wat

earnest phoenix
#

E n g l i s h please

main chasm
#

thats arabic?

earnest phoenix
#

No that's enchantment table

main chasm
#

when i typed ?start

#

in channel

#

work code right?

#

but if restarded bot not work need ?start again right?

silk chasm
#

@main chasm restarted...

main chasm
#

i want if restarted no need again type ?start auto save in mongo db

#

how

#

?

earnest phoenix
#

It's extremely hard to understand you but i get what you mean

quartz kindle
#

you need to save a status in the database

main chasm
#

i need save channel message collector

#

in datebase

earnest phoenix
#

Channel process inactive before ?start
Restarting it reverts back the process

main chasm
#

yes

earnest phoenix
#

Once the ?start is used, save a document with status property of inactive or not and the channel id

#

But, first of all, do you use a mongodb client or mongoose client, both are MongoDB Driver's API wrapper

main chasm
#

mongoose

earnest phoenix
#

Do you know how to make a document schema?

#

On mongoose

main chasm
#

no but i know how setup

#

do u can edit my code ?

earnest phoenix
#

Well you can seperate your schema models on a folder and export it through the main command file

mystic ice
#

@quartz kindle thanks for the help

#

also ehm

#

before i used to be able to connect to mongodb via compass

#

idk if someone else here uses mongodb

#

sudo mongod --auth --bind_ip MYIP --fork --logpath /var/log/mongodb.log

earnest phoenix
#

@main chasm For example, create a models folder, and create a new file called ChannelStatus.js

mystic ice
#

i ran that not sure if that makes it available

main chasm
#

@earnest phoenix ok bro thank u so much i work it now

pliant iron
#

You likely wont find an updated version with apt
I'm pretty sure there is

earnest phoenix
#
const mongoose = require("mongoose");

let channelSchema = new mongoose.Schema({
channelID: String,
active: Boolean
});

module.exports = mongoose.model("ChannelStatus", channelSchema);``` @main chasm in that file
mystic ice
#

@pliant iron dw i got it

pliant iron
mystic ice
#

@earnest phoenix can u help me after u helped dedo?

earnest phoenix
#

Sure, what did you need help with again

mystic ice
#

well i had to reinstall my server so need to setup everything again

#

i need my mongodb to be available to be called by my bot

main chasm
#

@earnest phoenix in channelStatus.js ?

earnest phoenix
#

Yes

mystic ice
#

mongoose.connect('mongodb://USER:PW@MYIP:27017/discord', { useNewUrlParser: true });
think i need a connection open for this

#

sudo mongod --auth --bind_ip MYIP --fork --logpath /var/log/mongodb.log

#

this is already running

earnest phoenix
#

You host your own mongo db client?

mystic ice
#

think so lol

quartz kindle
#

if you have mongod then yes

mystic ice
#

yes i do

#

for some reason i cant connect in compass with my credentials

earnest phoenix
#

Does it give any kind of errors while trying to connect

mystic ice
#

'authentication failed'

#

im pretty sure its the right user/pw

earnest phoenix
#

Hmm was whatever you're trying working before you reinstalled your server?

mystic ice
#

well it has been 1.5 years since ive installed it lol

#

the only thing i remember is running
sudo mongod --auth --bind_ip MYIP --fork --logpath /var/log/mongodb.log
then everything used to work

charred kindle
#

then run it

mystic ice
#

its running

charred kindle
#

jk, i dont know what im talking abt

mystic ice
#

lol

charred kindle
mystic ice
#

OOF

earnest phoenix
#

Well that's suspicious to not work, it's like you got a bot with the token you always used but one day you try to restart it without regenerating the token, it says An invalid token was provided

#

These kind of things are annoying to happen, that you got no clue of why they happen

mystic ice
#

ikr

#

lol

#

wait maybe its the version...

earnest phoenix
#

Version?

mystic ice
#

mongod version?

#

4.4.1

#

nope

#

last one

#

what ports need to be open?

#

27017 only right?

#

@earnest phoenix still there ? xD

#
        2020-09-15T16:46:37.184+02:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
main chasm
#

@earnest phoenix but i not use command handler !

earnest phoenix
#

Doesn't matter if you use one or not

mystic ice
#

fkn mongo lol

#

almost no one uses it

#

main problem right there

#

@earnest phoenix u have an admin acc too right?

#

mongo tells you to make an admin acc, should be in admin database if im right

#

if u know what i mean:

        "db" : "admin",
        "roles" : [
                {
                        "role" : "userAdminAnyDatabase",
                        "db" : "admin"
                },
                {
                        "role" : "readWriteAnyDatabase",
                        "db" : "admin"
                }
        ],```
faint prism
mystic ice
#

i pay 3 a month for my hosting

#

lol

#

aka my vps

charred kindle
#

wow

#

free hosting

#

on a broken i1

faint prism
#

Asus Zenfone 3

charred kindle
#

lol

mystic ice
#

voltrex u ok there? xD

#

looks like ur rewriting the bible

#

twice

faint prism
#

Tbh, it was one of my favorite phones I've ever owned

sick fable
#

@client.event
async def kick(ctx, member : discord.Member, *, reason=None):
await member.kick(reason=reason)

earnest phoenix
#
client.on('message', async message => {
    if (message.channel.name == "suggestions") { 
        if (message.author.bot) return;
        message.delete();
let getHandler = require("./models/channelStatus.js");

let getStatus = await getHandler.findOne({ channelID: message.channel.id });
if (message.content.toLowerCase() === '?start') {
if (!getStatus || !getStatus.active) {
 if (!getStatus) {
await getHandler.create({
channelID: message.channel.id,
active: true
});
} else if (!getStatus.active) {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: true } });
}
message.channel.send("started successfuly πŸš΄β€β™‚οΈ");
} else {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: false } });
message.channel.send("Stopped.");
}
}

if (!getStatus || !getStatus.active) return;
        let filter = m => !m.author.bot;
        let collector = new Discord.MessageCollector(message.channel, filter);   
     
          
        collector.on('collect', (m, col) => {
                    let embed = new Discord.MessageEmbed()
                        
                        .setDescription(m.content)
                        
                        .setTimestamp()
                        .setTitle("Suggestion")
                        .setAuthor(m.author.tag,m.author.avatarURL({format: "gif"}))
                        .setColor('#4f65ff');
                        message.channel.send(embed).then(async embedMessage => {
                            await embedMessage.react("751137346422046738");
                            embedMessage.react("751137346585493536");
                    });
                
                }
        });
    }``` @main chasm
#

My head hurts

sick fable
#

Whenever I type the command

#

It crashes

#

Kick command

#
async def kick(ctx,  member : discord.Member,  *, reason=None):
	await member.kick(reason=reason)```
#

What's the problem with it?

#

If yes, then tell it please

misty sigil
#

that’s an event not a command?

sick fable
#

Bro. It's an event.

#

It's not full command

#

I mean. I didn't sent the full Code of the bot

#

Only sent this as it's showing an error

#

@misty sigil

misty sigil
#

and you didn’t send the error

sick fable
#

It's showing

#

Wait

#

Lemme send it

#

It showed something like Error kick command.

#

The kick command

eternal osprey
#

Hey why is my discord webhook not displaying the actual link? Eventhough it is scraping the new restocks and shoes

honest perch
#

what

eternal osprey
#

Page not found

honest perch
#

because it doesnt exist

eternal osprey
#

well why tho

sick fable
#

xD

honest perch
#

because it doesnt exist

eternal osprey
#

cuz it does scrape the new shoes

honest perch
#

ask nike

eternal osprey
#

So the actual link page should be good too

sick fable
#

Yaa

#

Ask nike

#

G

#

Ig*

eternal osprey
#

misly I might have not given enough information

#

But your help was as good as my fucking math tests

honest perch
#

i mean if the page doesnt exist

#

thats on nike

sick fable
#

Ight, I am going to sleep. Let me know the error in this code before I wake up

#
async def kick(ctx,  member : discord.Member,  *, reason=None):
	await member.kick(reason=reason)```
eternal osprey
#

I will check my source code again

#

Maybe I am referring to a wrong page

sick fable
#

It's my first time bot developing so I am making many errors

thick gull
#

everyone starts somewhere

mystic ice
#

@earnest phoenix should i put my server ip in bindip in mongod.conf?

#

or u never did this?

misty sigil
#

Put 0.0.0.0 in

mystic ice
#

u able to use compass?

#

and it used to be localhost ip

misty sigil
#

no cuz I bind to 127.0.0.1 but 0.0.0.0 works

main chasm
#

@earnest phoenix Error: Cannot find module './models/channelStatus.js'

earnest phoenix
#

Show me an screenshot of your bot's main folder

main chasm
#

ok

mystic ice
#

@misty sigil how do u let it run on ur server?

misty sigil
#

I use systemctl

mystic ice
#

says i cant start bc its not localhost ip lol

#

yeah but what line u use?

#

like i use ehm

misty sigil
#

I just use systemctl start mongod

mystic ice
#

sudo mongod --auth --bind_ip MYIP --fork --logpath /var/log/mongodb.log

misty sigil
#

Main folder

#

also nice mongodb url leak

honest perch
#

@main chasm delete that

#

man

main chasm
#

no problem

#

thats just test

mystic ice
#

oh well u dont know my ip dont think it matters then does it :P

#

@misty sigil

#

also i cant start it unless bind ip is 127.0.0.1

north rose
#

wtf

#

is

#

this

mystic ice
#

what?

main chasm
#

now?

misty sigil
#

no

main chasm
#

fine?

misty sigil
#

we need folder

main chasm
#

folder or screenshot?

misty sigil
#

screenshot of the file structure

mystic ice
#

matt do u know why my compass says authentication failure when i use the admin db with admin/ right pw

main chasm
#

i have 3 file bro

#

index.js , config.json ,channeStatus/js

misty sigil
#

matt do u know why my compass says authentication failure when i use the admin db with admin/ right pw
@mystic ice are you bound to 0.0.0.0

faint prism
#

what's a popular npm paginator?

mystic ice
#

sudo mongod --auth --bind_ip MYIP --fork --logpath /var/log/mongodb.log
or mongod.conf?

misty sigil
#

both

mystic ice
#

oh

#

so i should stop the process then use 0.0.0.0 as bind?

misty sigil
#

Ye

mystic ice
#

why cant i use my own tho

#

i did before

misty sigil
#

I don’t know but

#

It’s better to use 0.0.0.0

earnest phoenix
#

index.js , config.json ,channeStatus/js
@main chasm then just change
"./modules/channelStatus.js" to js "./channelStatus.js"

mystic ice
#

also, if i use 0.0.0.0 it wont start the process at all

#

in the file

earnest phoenix
#

Also re copy the code i sent

#

I edited it

main chasm
#

ok

misty sigil
#

@mystic ice try using it in β€”bind_ip

mystic ice
#

aight

north bobcat
#

Wahit title me?? Title Development

#

@fossil oxide

quartz kindle
#

???

mystic ice
#

@misty sigil the db wont start at all

#

when i try sudo systemctl restart mongod it says it wont start

misty sigil
#

just ping oliy

#

that’s 5 head isn’t it

mystic ice
#

who that

north bobcat
mystic ice
#

lol

misty sigil
#

mongoDB is

quartz kindle
#

test tube? what...

misty sigil
#

it’s very touchy

north bobcat
#

@quartz kindle πŸ˜’

mystic ice
#

yeahh ik

quartz kindle
#

english pls

mystic ice
#

@fossil oxide this one?

quartz kindle
#

dude...

opal plank
#

Lol

misty sigil
#

oh for the love of god

mystic ice
#

LOL

misty sigil
north bobcat
#

Iam kurdish

quartz kindle
#

ok, use google translate, otherwise i dont understand what you want

north bobcat
main chasm
#

@earnest phoenix now not any errror but bot not send embed message

opal plank
#

Need to be approved

#

@north bobcat

mystic ice
#

in the meantime

#

i still dont know why tf my process wont start lol

main chasm
#

lol thats suggestion channel

mystic ice
#

so 0.0.0.0 in conf and in the --bind @misty sigil

opal plank
#

seems like someone is properly checking states

mystic ice
#

what if the process wont start at all πŸ‘€

main chasm
#

@north bobcat chawareka ta 5 hafta labar corona drang wallamt adanawa

opal plank
#

@main chasm english

main chasm
north bobcat
#

@main chasm kurdi

opal plank
#

english here

main chasm
#

ok

north bobcat
#

Bzhii

main chasm
#

dont worry

north bobcat
#

Shukr kurdekm dozeo

main chasm
#

please english

north bobcat
#

@main chasm

main chasm
north bobcat
#

E bo titleakam warnagrtua

mystic ice
#

anyone pro at mongodb here?

#

if so

earnest phoenix
#

@main chasm Show your new code

mystic ice
#

please @ me

main chasm
#

me lol

mystic ice
#

lol

main chasm
#

@earnest phoenix ok

mystic ice
#

selftag nice

north bobcat
#

Bo mn nima @main chasm

main chasm
#

@north bobcat wait 1m

opal plank
#

imagine reading rules

mystic ice
#

lol erwin

#

i dont think he can

north bobcat
#

@main chasm bika kurdi

summer torrent
#

@north bobcat please speak english

north bobcat
#

@summer torrent iam kurdishhh

main chasm
opal plank
summer torrent
#

doesn't matter

opal plank
#

@north bobcat

summer torrent
#

rules are rules

north bobcat
#

@opal plank yes

earnest phoenix
#

@main chasm I said re copy the code i sent

opal plank
#

nice censoring

#

2 thin blue strokes

earnest phoenix
#

I edited it

quartz kindle
#

@main chasm ping him in general-2, you can speak all languages there

main chasm
#

@quartz kindle ok

opal plank
#

if they allow any languages here this would start becoming a HueHue fest

main chasm
#

@earnest phoenix i copy code but when i type ?start message embed not response me

mystic ice
#

@earnest phoenix can u tell me when u have time lol

main chasm
#

before work

north bobcat
#

@main chasm bash

earnest phoenix
#

@main chasm Just copy and paste this

client.on('message', async message => {
    if (message.channel.name == "suggestions") { 
        if (message.author.bot) return;
        message.delete();
let getHandler = require("./models/channelStatus.js");

let getStatus = await getHandler.findOne({ channelID: message.channel.id });
if (message.content.toLowerCase() === '?start') {
if (!getStatus || !getStatus.active) {
 if (!getStatus) {
await getHandler.create({
channelID: message.channel.id,
active: true
});
} else if (!getStatus.active) {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: true } });
}
message.channel.send("started successfuly πŸš΄β€β™‚οΈ");
} else {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: false } });
message.channel.send("Stopped.");
}
}

if (!getStatus || !getStatus.active) return;
        let filter = m => !m.author.bot;
        let collector = new Discord.MessageCollector(message.channel, filter);   
     
          
        collector.on('collect', (m, col) => {
                    let embed = new Discord.MessageEmbed()
                        
                        .setDescription(m.content)
                        
                        .setTimestamp()
                        .setTitle("Suggestion")
                        .setAuthor(m.author.tag,m.author.avatarURL({format: "gif"}))
                        .setColor('#4f65ff');
                        message.channel.send(embed).then(async embedMessage => {
                            await embedMessage.react("751137346422046738");
                            embedMessage.react("751137346585493536");
                    });
                
                }
        });
}```
misty sigil
main chasm
#

ok

earnest phoenix
#

Me telling him to re copy it for the third time

#

Lmao

mystic ice
#

big ignore :(

earnest phoenix
#

@earnest phoenix spoonfeeding

#

B r u v, i just edited his code, a few lines add, E

summer torrent
#

still

earnest phoenix
#

big ignore :(
@mystic ice You're not ignored, i don't have a solution for your issue

main chasm
#

@earnest phoenix come to my server lmao KEKW

#

when i send one message

#

bot response me 4 message

#

lol

earnest phoenix
#

Bot ception moment

main chasm
#

i send you my project

#

fix it

#

if u can

restive furnace
earnest phoenix
#

Can you record a video of what's happening

#

Like you did a few minutes ago

misty sigil
#

"Fix it" sure I’ll break it

main chasm
#

ok

#

my english bad

#

sorry

#

guys

#

don't joke me

#

lol

opal plank
#

at this point it might be worthwhile using google translate than freely doing it yourself

restive furnace
#

or take a english course :)

opal plank
#

an*

main chasm
restive furnace
#

yes yes, i didn't take any english courses and i learnt english almost on my own so my grammar aint the best. [@opal plank]

main chasm
#

@earnest phoenix

#

πŸ‘†

opal plank
#

@restive furnace #general , but me neither ASakashrug

restive furnace
#

ok

opal plank
#

@main chasm likely cuz you started 4 collectors

#

how many times did you type ?start

main chasm
#

one

opal plank
#

restart bot

#

and retry

main chasm
#

no forever

restive furnace
#

ya should try learn basic fundamentals of JS and whole programming

opal plank
#

im fairly certain you ran your collector 4 times

main chasm
#

i know

#

js

opal plank
#

idk if d.js adds a collector.stopAll() method or something

main chasm
#

πŸ˜’

restive furnace
#

doesn't seem so but ok (knowing good practices and bad practices, standard functions of JS etc.)

main chasm
#

but idk mongodb

opal plank
#

then learn or use something else

main chasm
#

just seup

silk chasm
#

@main chasm ok i dedo i understood

main chasm
#

thank u for your understand thanks for god

silk chasm
#

ur bot got DID

#

thank u for your understand thanks for god
@main chasm talking about ur bot

main chasm
#

i want connect mongo db when restarted bot save channel id or name channel

silk chasm
#

ur bot replied u 5 times , right?

stark abyss
#

How to use awaitMessages. in djs

opal plank
#

start with the docs

main chasm
#

yes i know change to 1 time but this is brother changes code

stark abyss
#

I read the docs

opal plank
#

and whats your question?

stark abyss
#

.awaitMessages(filteroptions)

restive furnace
sudden geyser
#

Look at the example on the link above.

stark abyss
#

i was looking for an example

opal plank
#
// Await !vote messages
const filter = m => m.content.startsWith('!vote');
// Errors: ['time'] treats ending because of the time limit as an error
channel.awaitMessages(filter, { max: 4, time: 60000, errors: ['time'] })
  .then(collected => console.log(collected.size))
  .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));
stark abyss
#

oh okay thx

silk chasm
#

i was looking for an example
@stark abyss u need help in any api

opal plank
#

here

#

example above

stark abyss
#

no

silk chasm
#

oh he's asking for js...

main chasm
#

my question is when bkt resatrted bot process

opal plank
#

WHAT

#

google translate my dude

silk chasm
#

my question is when bkt resatrted bot process
@main chasm umm is that eng... cuz i only know eng...

main chasm
#

wait

silk chasm
#

wth

restive furnace
#

i think it's inglish

main chasm
#
const mongoose = require("mongoose");


let channelSchema = new mongoose.Schema({
channelID: String,
active: Boolean
});

module.exports = mongoose.model("ChannelStatus", channelSchema);
#

i want connect mongodb

thick gull
#

ok

#

what have you tried

silk chasm
#

i don't think that is python...it if would python i can help ya... so i can't...

thick gull
#

thats js

main chasm
#

yes

#

bro look my code

silk chasm
#

thats js
@thick gull ikr

thick gull
#

@main chasm in the file you're using it are you requiring the module

#

like

#

const channelStatus = require('path/to/your/schema')

main chasm
#

let getHandler = require("./ChannelStatus.js");

thick gull
#

what is your error

main chasm
#

not any error

#

but

#

my code suugestion

#

look

#
client.on('message', async message => {
    if (message.channel.name == "suggestions") { 
        if (message.author.bot) return;
        message.delete();
let getHandler = require("./ChannelStatus.js");

let getStatus = await getHandler.findOne({ channelID: message.channel.id });
if (message.content.toLowerCase() === '?start') {
if (!getStatus || !getStatus.active) {
 if (!getStatus) {
await getHandler.create({
channelID: message.channel.id,
active: true
});
} else if (!getStatus.active) {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: true } });
}
message.channel.send("started successfuly :man_biking:");
} else {
await getHandler.findOneAndUpdate({ channelID: message.channel.id }, { $set: { active: false } });
message.channel.send("Stopped.");
}
}

if (!getStatus || !getStatus.active) return;
        let filter = m => !m.author.bot;
        let collector = new Discord.MessageCollector(message.channel, filter);   
     
          
        collector.on('collect', (m, col) => {
                    let embed = new Discord.MessageEmbed()
                        
                        .setDescription(m.content)
                        
                        .setTimestamp()
                        .setTitle("Suggestion")
                        .setAuthor(m.author.tag,m.author.avatarURL({format: "gif"}))
                        .setColor('#4f65ff');
                        message.channel.send(embed).then(async embedMessage => {
                            await embedMessage.react("751137346422046738");
                            embedMessage.react("751137346585493536");
                    });
                
                
            })
        }
        })
thick gull
#

???

#

whats the problem then

main chasm
#

can u test code?

thick gull
#

no

main chasm
#

when i send the message to channel suggestion

#

bot send message 4 msg

#

repeat

#

and i want connect mongo db save channel id

#

mongoose.connect(private ,
{ useNewUrlParser: true , useUnifiedTopology: true})

#

@earnest phoenix come back

#

i need u

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

main chasm
#

thank u for all not one can fix my problem

sage bobcat
#

One message removed from a suspended account.

misty karma
#

πŸ‘ πŸ‘

misty sigil
#

Marco come

modern sable
#

@misty karma no spam

radiant owl
#

hello friends. basically i'm trying to set a up a channel in my server where my bot puts every dm it receives, but my code that checks the guild id keeps making it crash and i was wondering if any of y'all knew how to fix this lol ```//dm shit
if(message.guild.id == undefined)
{
message.channel.send("pog")
client.channels.get('736744738933440552').send("<@"+ message.author.id + ">: "+ message.content)
};

//bad words
if (message.guild.id == (icarlypit))
{
if (message.includes("swear word") || (message.includes("bad word")))
{
message.delete(1);
message.channel.send("sire, i am calling the police on you for your potty mouth")
}
};``` (i'm still a beginner at this so uhhhhhhhhh don't judge me too hard lol)

#

this is discord js btw

misty sigil
#

Just check for channel type

earnest phoenix
#

@main chasm K I'm back, just went somewhere, did you send your new code

misty sigil
#

message.channel.type == "dm"

main chasm
#

@earnest phoenix just look dm i send u new code all file

radiant owl
#

i've tried that, and it's still not working

silk chasm
#

class MyClient(discord.Client):
    async def on_ready(self):
        print('Logged on as', self.user)

    async def on_message(self, message):
        # don't respond to ourselves
        if message.author == self.user:
            return

        if message.content == 'ping':
            await message.channel.send('pong')

client = MyClient()
client.run('Here was the token i can't show it to y'all')```
#

is there anything wrong with it

main chasm
#

@earnest phoenix come i open live

silk chasm
#

cuz i am getting tons of errors

radiant owl
#

both codes work when the other is gone so i'm :-|

    if(message.channel.type == "dm")
    {
      message.channel.send("pog")
      client.channels.get('736744738933440552').send("<@"+ message.author.id + ">: "+ message.content)
    };
      
//bad words
    if (message.guild.id == (icarlypit))
    {
      if (message.includes("swear word") || (message.includes("bad word")))
      {
        message.delete(1);
        message.channel.send("sire, i am calling the police on you for your potty mouth")
      }
    };```
misty sigil
#

client.channels.cache.get

radiant owl
#

i will try, thank you!

earnest phoenix
#

@main chasm I sent you a fixed version, check your dm

prime glacier
#

can someone help me in alarm/remind me command

leaden rover
#

Would Client.logout then Client.login work for a task to auto change the bot status? This is discord.py btw

sonic lodge
#

don't log out and log back in to just change the status

earnest phoenix
#

^

#

bot.change_presence exists

rare plume
#

Hey guys, whats the correct way to get the currently showing activity from a member?

charred kindle
rare plume
#

presence.activities[0] will just give the first in the map array thinkeyes

main chasm
#

@earnest phoenix thank uuuuuu so muchhh you helped me full thank u so much again

opal plank
#

activities is array, no?

earnest phoenix
main chasm
#

really master

rare plume
#

Hmm?

main chasm
earnest phoenix
#

@opal plank It's an array

opal plank
#

then it aint a map

rare plume
#

Oh sorry

opal plank
#

presence.activities[0] will just give the first in the map :thinkeyes:

rare plume
#

My bad

#

Yeah sure its a array

opal plank
#

rip pc

#

goddamit

#

-.-

rare plume
#

But .activites[0] will not always display the right activity :/

charred kindle
rare plume
#

I use JS

charred kindle
#

Oh

#

Woops

rare plume
#

But thank you still πŸ˜„

earnest phoenix
#

Which activity are you trying to show

rare plume
#

The one which is also showed in discord

earnest phoenix
#

If you're trying to show a specific one
Arrays have a find() method, use it to iterate through to find the right one that includes the correct type

#

The one which is also showed in discord
@rare plume I mean, you can map that

#

Wait you mean the custom status? Or all activities

rare plume
#

Wait, i try to get a screenshot that shows the problem better

earnest phoenix
#

K

rare plume
#

I try to explain as best i can lmao

#

How can i detect what activity discord is currently displaying that what i am trying to do

#

Hope its understandable xd

valid frigate
#

if i remember correctly spotify has priority over other activities?

#

are you looking for one specific activity

#

because this user might be doing both

earnest phoenix
#

You mean, show what activity shows up on their profile

rare plume
#

Excatly!

earnest phoenix
#

That's impossible to know

rare plume
#

Okey, thought that :/

valid frigate
#

wait what

#

it was literally right there

#

dawg

rare plume
#

Yeah, thank you both hahaha

earnest phoenix
#

Np

quartz kindle
#

what? why is it impossible?

valid frigate
#

bruv what

#

you literally posted an array of activities

#

then deleted it

green kestrel
#

I'm looking at translating my bot into various languages.
As I see it there are three ways it's mostly done, either if, then, else with different hard coded strings (really bad), a JSON or XML external file containing translation strings that can be modified by third parties e.g. volunteers, or finally full on .po files and gettext.
How have you approached this or how would you approach it, did I miss anything? Also translation of everything on demand using a cloud service wouldn't be feasible as it won't scale to the number of servers I'm on.
I'm purely wanting to discuss the technicals of how everyone else approached it.

valid frigate
#

in javascript users sometimes use string interpolation like

#

a json file full of strings to translate to like this

#
en: {
  HELLO: "hello, {0}"
}
#

discord also takes a similar approach

green kestrel
#

Like: You have {} points of a possible {}?

earnest phoenix
#

what? why is it impossible?
@quartz kindle He means,
For example if the user has more than one activity, show the one that appears on the user's profile, not all of them

valid frigate
#

yes

green kestrel
#

Yeah that's the format my strings will take however I store them, fmt::format and python style

valid frigate
#

hmm

quartz kindle
#

@earnest phoenix ah, cant you just assume its the last activity in the array? since activities are added on top of each other

valid frigate
#

i never fully understood how it could be displayed

#

perhaps a function like translate("HELLO", "en", ["value 1", ...])

earnest phoenix
#

I don't think that would always come out as true, might be falsy but i have no idea if it would be the last or just random elements in the activities array

green kestrel
#

Well fmt::format does interpolation for me already:

string s = fmt::format("one {} and another {}", var1, var2);
earnest phoenix
#

How to make a bot dashboard

faint prism
#

How to make a bot dashboard
@earnest phoenix Learn full-stack development

valid frigate
#

yes but i mean when you have multiple strings like x {} y {} or a {} b {} you probably want to use a function for that

green kestrel
#

So it's just a matter of how to store the translation array and where

valid frigate
#

tbh

earnest phoenix
#

What is full stack development

green kestrel
#

@earnest phoenix best way for that depends on your language

quartz kindle
#

i'd store multilingual strings as an object with some number/id as keys

faint prism
valid frigate
#

how to store the translation array might be something along the lines of defining an enum or key-value store

quartz kindle
#

so you can pull it by lang and string id

valid frigate
#

for a typed language you might be able to define a vector/array of similar structs

#

idk

#

[{lang: "en", HELLO: "hello, {}"}, {lang: "es", HELLO: "hola, {}"}]

#

really though idfk how to do it either

#

in theory this approach should work but maybe theres a better way

quartz kindle
#

there's too many ways to do it

#

i'd do it like this

cinder patio
#

I think I'd store it like this:

{ // Object, containing all messages that can be translated by the bot
  ERROR: {
   "en": "Error {}",
   "rs: "...",
   ...
},
  SUCCESS: {
  ...
}
...
}  

And would access it like this: send(MESSAGES.ERROR[user.language],

quartz kindle
#
{
  en: {
    1: "hello",
    2: "idiot"
  },
  pt: {
    1: "olΓ‘",
    2: "idiota"
  }
}
valid frigate
#

hmm

#

well using numbers as keys can reduce readability

earnest phoenix
#

How to make PokΓ©cord?

valid frigate
#

hoo boy

quartz kindle
#

yeah, its less readable, but it follows the same style as error codes

#

so its a bit more portable and smaller

earnest phoenix
#

Please help

valid frigate
#

realistically though numbers is one approach

summer torrent
#

@earnest phoenix do you know any programming language

#

your username is "pokemon dev" but you don't know how to make "pokecord"

green kestrel
#
{
  en: {
    1: "hello",
    2: "idiot"
  },
  pt: {
    1: "olΓ‘",
    2: "idiota"
  }
}

@quartz kindle I think this is most elegant, I can send that separate struct in a file to a non technical translator

thick gull
#

haven't you asked this before

green kestrel
#

Lol

quartz kindle
#

"there's an api for that"

green kestrel
#

Yeah you have to use the pokecord api

thick gull
#

bdfd api

earnest phoenix
#

Bruh moment

quartz kindle
#

welcome to 2020, the age of apis

thick gull
#

tim api

green kestrel
quartz kindle
#

pizza api

olive rune
#

bruh

green kestrel
#

@quartz kindle smush APIs together until it works right?

thick gull
#

tim api just scrapes stack overflow djs questions

earnest phoenix
#

Just loop every API that exists until it works

thick gull
#

how to make nadeko bot

#

loop all api

#

😎

green kestrel
#

Just loop every API that exists until it works
@earnest phoenix AHH infinite monkey api

silk chasm
#
import random
import time
import asyncio

TOKEN = "Her was the token..."

client = discord.Client()


@client.event
async def on_message(message):
    if message.author == client.user:
        return

    if message.content.startswith(".ping"):
        await message.channel.send("pong")


@client.event
async def on_ready():
    print("RUNNING")

client.run(TOKEN)
print(client.user.name)```
#

here's my code

#

when i run it

#

it shows bunch of errors

earnest phoenix
#

What are the errors

#

What is Poke'cord api

thick gull
#

there is no single api to make a bot

#

you have to make the code yourself

#

you can use an API to get information

earnest phoenix
#

Which api

thick gull
#

but you have to create something to be able to use it

silk chasm
#

What are the errors
@earnest phoenix see this

earnest phoenix
#

4.20KB

#

Nice

thick gull
#

What is pokeapi.co
it is an api that gives you information on pokemon

#

like ditto

#

or pikachu

#

you create the code that can read that

silk chasm
#

it has errors of lines 1000

#

and my code is of 25 lines

thick gull
#

1000 lines? blobsweat

silk chasm
#

yeah

earnest phoenix
#

Over 500 lines of error

silk chasm
#

dude

#

no

#

i have 25 lines in my code

quartz kindle
#

certificate verify failed: certificate has expired

silk chasm
#

and when i run it

quartz kindle
#

thats your error

silk chasm
#

@earnest phoenix can u come in for vc for 2 min i will screen share

earnest phoenix
#

I saw, I'm not into python so idk about your error

silk chasm
#

cuz anyone of u won't understand

#

I saw, I'm not into python so idk about your error
@earnest phoenix ok.

green kestrel
#

What is Poke'cord api
@earnest phoenix pokecord api is an API that doesn't exist yet that you'll create

#

Your response is classic

#

Love it. No really the point I was making is you must make it

#

And you're in the right place to learn how

earnest phoenix
#

I love watching whitenames get confused asf

fair quartz
#

anyone have any tips on adding reaction roles (like when someone reacts they get a role) on discord.py?

quartz kindle
#

@silk chasm that error means your ssl certificate is expired. this can happen if your date and time is wrong in your computer, and also if your certificates are missing or corrupted somehow. you will need to reinstall them. google the error and you will find plenty of answers telling you what to do and how

green kestrel
#

My fault I should have ended it with /s

opal plank
#

what is this channel? what is life? whatis love?

green kestrel
#

whatis love?
@opal plank baby don't hurt me. Don't hurt me. No more.

opal plank
earnest phoenix
opal plank
#

time to push non tested features into production

quartz kindle
#

yes

opal plank
#

what could go wrong

green kestrel
#

Test it test it

fair quartz
#

anyone have any tips on adding reaction roles (like when someone reacts they get a role) on discord.py?

green kestrel
opal plank
#

cant even

#

too much power for normal pc to handle

earnest phoenix
#

Test it test it
@green kestrel What's test

quartz kindle
#

@fair quartz use raw reaction events

fair quartz
#

ok thank you

green kestrel
#

@earnest phoenix test is where you stare hard at the code after 6 hours of non stop dev and say "meh looks fine to me" and click Deploy

earnest phoenix
#

Nah, testing is like looking at the code once, trying to change something then deploy

#

Doesn't work? Repeat

opal plank
green kestrel
#

Irony is the one thing you change introducing the bug

opal plank
#

@quartz kindle

quartz kindle
#

lmao

opal plank
#

things might start going on fire

earnest phoenix
#

15 Errors
Intense look at the code
Attemps to change one line of code
75 errors

opal plank
#

i removed the rate-limiter again

quartz kindle
#

nothing beats releasing an infinite loop to npm

#

:^)

earnest phoenix
#

The moment when the error you get is longer than your entire code

#
(node:58404) UnhandledPromiseRejectionWarning: AbortError: The user aborted a request.
    at RequestHandler.execute (/home/thinh/judger-djs/node_modules/discord.js/src/rest/RequestHandler.js:107:21)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:58404) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:58404) [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.

What the FUCK is this

#

Discord.js suck

opal plank
#

well its properlylogging the rates now

#

so thats good

#

it ran

earnest phoenix
#
(node:58404) UnhandledPromiseRejectionWarning: AbortError: The user aborted a request.
    at RequestHandler.execute (/home/thinh/judger-djs/node_modules/discord.js/src/rest/RequestHandler.js:107:21)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:58404) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:58404) [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.

What the FUCK is this
@earnest phoenix Your request took longer than 15 seconds to be completed, then it gives that error

#

Discord server suck

opal plank
#

i fucking knew it

#

there is a hidden rate limit for this shit

earnest phoenix
#

What the heck

#

why it is rate limit ?

opal plank
#

its when i hit 200 joined streams in too short of a time

earnest phoenix
#

oh u mean about twitch api

opal plank
#

yeah

earnest phoenix
#

Finnaly i restart the vps and it works now πŸ₯°

#

GCP SUCK

#

Disconnect when i update my sysyem

opal plank
#

AHA!

#

FOUND THE CHEEKY BASTARD

#

neither of the libs covered this

#

mofos

charred kindle
#

rip

opal plank
cinder patio
#

Well can the libs know that your bot is verified

opal plank
#

good question, doubt it

#

since it simply says 'join timeout'

#

means they dont have a rate handler

charred kindle
#

maybe?

eternal osprey
#

hey

opal plank
#

git mods gonna love to see this

eternal osprey
#

how do i specify my mongodb adtabase? {
"host": "HOSTNAME",
"user": "USERNAME",
"pass": "PASSWORD",
"dbname": "DATABASE",
"port": "PORT"
}

green kestrel
#

If anyone's interested here's a hacky script I used to make Google translate go brrrrr and translate 90,000 question database for free without triggering their rate limits

https://hatebin.com/tuluiethpd

#

It's such a kludge it hurts, but as a one off it worked very well

pliant iron
#

Interesting

outer wing
pliant iron
#

it can't connect

opal plank
#

eeeey working fine now

earnest phoenix
#

If anyone's interested here's a hacky script I used to make Google translate go brrrrr and translate 90,000 question database for free without triggering their rate limits

https://hatebin.com/tuluiethpd
@green kestrel bruh PHP like who uses browser code instead of node.js
i don't
because I'm not a web developer

opal plank
#

php aint bad

green kestrel
#

What's "browser code"???

#

Like uh, JavaScript you mean?

opal plank
#

what could go wrong?

#

lets loop the non tested code every hour

outer wing
opal plank
#

on the production server

earnest phoenix
#

Imagine mentioning PHP and forgetting that browser code usually refers to JavaScript

honest perch
#

@quartz kindle is actually a bot powered by the stack overflow api and an ai force

quartz kindle
#

@_@

honest perch
#

idk

quartz kindle
#

definitely wrong

honest perch
#

looks ok

#

whats wrong

opal plank
#

thats not 10% fam

quartz kindle
#

^

opal plank
#

more like 35 ish

earnest phoenix
#

@swift umbra Use rounded rectangles
And a gradient instead of that damn green rectangle overlay

honest perch
#

ah maths

opal plank
#

maffs

honest perch
#

pretty bad at that

ancient nova
opal plank
#

just divide the current b total

#

and multiple by 100

#

that'll give u %

stark abyss
#
      const isClaim = m => m.content === message.embeds[0].description.includes("got the card!") ```
is this workable
earnest phoenix
#

Would suggest storing the gradient as an actual image instead of generating it when needed

opal plank
#

math.round if you need round numbers

stark abyss
#

is it

opal plank
#

still off

honest perch
#

@ancient nova hmmmmmmmmmmmmmmmmmmmm

earnest phoenix
#

just divide the current b total
and multiple by 100
that'll give u %
@opal plank sorry but you can't replace my Math teacher

opal plank
#

middle line is 50

#

actually wtf

#

it didnt save

#

sharex

#

now it did

#

mid way arrow is 50%

ancient nova
#

@honest perch they're 1$ nitros from xbox promo

opal plank
#

between 50% and start is 25%

#

the first one should roughly be 10%

outer wing
#

Hi i have a question?

opal plank
#

dont ask to ask

cinder patio
#

Is that your question?

quartz kindle
#

i dont now, do you have a question?

earnest phoenix
#

Hi i have a question?
@outer wing Yes you do (only true programmers will get this)

outer wing
earnest phoenix
#

Code?

outer wing
#

idkΓΉ

faint prism
#

Unhandled 'error' event

opal plank
#

wtf

#

on startup/

#

?

outer wing
#

yes

opal plank
#

twitch legit taking a piss at me

outer wing
#

on startup

earnest phoenix
#

GIT IS TOO FRIGGING WEIRD

quartz kindle
#

yassuo wind walled your bot

faint prism
#

your redis connection failed

earnest phoenix
#

Should I use pogeyress bars?

faint prism
#

@outer wing ECONNREFUSED probably passed it incorrect creds or it isn't running. Not sure how Redis works, but you didn't set it up right.

quartz kindle
#

still looks wrong lol

#

3% xp is not 1 pixel

opal plank
#

EEEEEEY

#

no errors

#

i didnt kill the production server(today, again)

quartz kindle
#

if the line is 500px, then 3% should be around 20px

sonic lodge
#

3% of that is 15

#

welcome to algebra

earnest phoenix
#

Need help with percentages ping me
I'll happily send you a link of my Adobe Document Cloud PDF scan of my Math book

opal plank
#

huh

#

10% of 500 is 50
5% is half of 50, 25

earnest phoenix
#

Lemme tyoe

opal plank
#

that should get you an idea of how wrong ur maffs are

sonic lodge
#

(current xp / total xp to next level) * width of bar = width of green bar

opal plank
#

question rq

#

can i do execute(chat, undefined, 1) ?

#

to skip args that i dont necessarily need

quartz kindle
#

in js yes

#

idk in ts

opal plank
#

prob can i think

#

? should already say its optional

quartz kindle
#

should also be able to pass null

opal plank
#

true that

quartz kindle
#

hence why prop? is called "nullable"

opal plank
#

sankyu tim

earnest phoenix
#

Do them in order:

  1. Get the user xp.
  2. Get the user xp needed to level up (the total amount till next level up).
  3. Subtract the user xp from the total xp till next level up.
  4. Do the following meth to get the percentage:
(Current user XP / Total XP till next level up) * 100
  1. HOPE I REMEMBERED MY PERCENTAGE SHIT FROM LAST YEAR KTHNXBAI
sonic lodge
#

is the width of the outline circle actually 700 or am i tripping

quartz kindle
#

^

#

its starting at 30

earnest phoenix
#

@quartz kindle is my meth correct

#

how do i get the appid number of the test name from json format

{
    "appid": 1023270,
    "name": "Test"
},
sonic lodge
#

name_of_obj.appid

pliant iron
#

Is anyone here familiar with creating npm packages?

earnest phoenix
#

@pliant iron just ask the question

#

The guys who are experienced will answer

opal plank
#

no errors

#

fast and no errors

#

thank fucking god

quartz kindle
#

go fast

opal plank
#

API abuse goes BBRRRR

#

i could actually put 10500 and 0 tbh

#

i wanna give a bit of leeway before re-attempting

earnest phoenix
#

@flint yew has a &wiki command which searches the question on Wikipedia and sends the entire page in an embed

flint yew
#

@earnest phoenix yes

earnest phoenix
#

Lmao

flint yew
#

Why bullying :/

#

It only need to add a small code and done but I fix it when have time

earnest phoenix
#

Why bullying :/
@flint yew wut

opal plank
#

bruh

#

the stress query finished in 20 minutes

#

wtf

faint prism
#

l0l

opal plank
#

used to be one hour to finish

#

now down to 20m

#

using ratelimits smort

#

and not a single error in console

#

pretty sure someone asked the same thing 5mins ago

#

if request took 15 seconds or longer it fails

vocal mortar
#

bjr je suis un nouveau developper independant de bot et je voudrais vous demander une ide de commande je n'ai que celle ci:&help,&ping,&salut,&ban,&kick,&tg,&rip

opal plank
#

@vocal mortar english only

vocal mortar
#

oh sorry

earnest phoenix
#

@earnest phoenix why name

vocal mortar
#

just im difficukt speak english

#

difficult*

earnest phoenix
#

Im making a dashboard for my bot and there are role rewards, i did like mee6 , whenever you changing a role level it will sort the roles's list, but if i will change something , other roles will move, for example if i change the "supervisor" role from level 2 to level 3, the roles "prison" and "muted" will change their places even they with the same value (1)

#

@earnest phoenix yeah so?

#

you need help with anything?

#

I want them to stay in the place and not to change their places..

#

but why

#

oh wait

#

its like this,
supervisor: level 3
prison: level 1
muted: level 1

after changing supervisor to level 4 its:
supervisor: level 4
muted: level 1
prison: level 1

#

I thought it will sort the list again when you change the role HEIRARCHY ORDER within discord themselves not when you cchang the level in the bot

#

prison and muted got their places replaced

#
     Containers = Containers.sort((a, b) => {
          let rewardA = a.getElementsByClassName("RoleReward").item(0);
          let selectLevelsA = rewardA.getElementsByTagName("select").item(0);
          let rewardB = b.getElementsByClassName("RoleReward").item(0);
          let selectLevelsB = rewardB.getElementsByTagName("select").item(0);
          let A = Number(selectLevelsA.options[selectLevelsA.selectedIndex].value);
          let B = Number(selectLevelsB.options[selectLevelsB.selectedIndex].value);
          if(A > B) return 1;
          if(A < B) return -1;
          return 0;
        }).reverse()
#

this is the code

#

sigron

#

@earnest phoenix wuts Containers

quartz kindle
#

why sort then reverse? why not just sort the other way around?

earnest phoenix
#
Containers = Containers.sort((a, b) => {
          let selectLevelsA = a.getElementsByClassName("RoleReward").item(0).getElementsByTagName("select").item(0);
//          let selectLevelsA = rewardA.getElementsByTagName("select").item(0);
          let selectLevelsB = b.getElementsByClassName("RoleReward").item(0).getElementsByTagName("select").item(0);
//          let selectLevelsB = rewardB.getElementsByTagName("select").item(0);
          let A = Number(selectLevelsA.options[selectLevelsA.selectedIndex].value);
          let B = Number(selectLevelsB.options[selectLevelsB.selectedIndex].value);
          return B-A;
        })
#

un-noodleified

opal plank
earnest phoenix
#

Containers = all role rewards in array

@quartz kindle because I want it reversed