#development

1 messages Β· Page 503 of 1

earnest phoenix
#

ITS CALLED BOOLEAN

sinful lotus
#

Im getting pissed

earnest phoenix
#

NOT BOOLIN

#

LOL

sinful lotus
#

LMAO

earnest phoenix
#

well hey,. the bot comes online but since thats not how args are defined for that part, it did nothing

sinful lotus
#

fix the damn args

#

you can do that much

earnest phoenix
#

i dunno how to fix the damn args

#

xd

quartz kindle
#

damn args pls fix kthx

sinful lotus
#

how did you code that bot

earnest phoenix
#

xD

#

with my brain

#

and other devs

sinful lotus
#

then you can fix the damn args

earnest phoenix
#

πŸ”₯

#

ffs, ill go look for it somewhere in my code and steal it

quartz kindle
#

if (message.content == (args.join(" ") !== "--verify") ) still makes no sense

earnest phoenix
#

^

#

https://gyazo.com/1dbc580bc476e412474df361c68931db we put our last 3 in codes
and it does that
it registers all the codes
and puts it into a file like that
and if we do !qs
it queues a snipe
where it says
5....4....3....2...1...Go
we click ready on go
and when we load into our games
we see our last 3 codes and as u see in the picture
after someone puts their code in

​

#

I need that

#

mostly

quartz kindle
#

remember how math works? math inside parentheses is always done first

earnest phoenix
#

const Discord = require ('discord.js') 
const load = require ('./config/fileload.js')
const eload = require ('./config/eload.js')
const bot = new Discord.Client();
 
//data ======================================================================================================================================================================= 

bot.commands = new Discord.Collection();
bot.aliases = new Discord.Collection();


load('cmds', bot.commands, bot.aliases)
eload('events', bot)


bot.login(process.env.TOKEN);
``` is it possible to make it shorter?
sinful lotus
#

thats already short

#

unless you one to put it oneliner

earnest phoenix
#

xD

#

was tryna find out if i can make it shorter

#

oh well

#

huge else if command handler MonkaS
array operations in every if monkaMEGA
code doesnt make sense anyway monkaOMEGA

sinful lotus
#

Meme code

earnest phoenix
#

how does my cmd not make sence, its just saying, if args are not just that, then return whatever

sinful lotus
#

I can code the same code in much more cleaner way ^

earnest phoenix
#

xD

quartz kindle
#

let me explain

#

if (message.content == (args.join(" ") !== "--verify") ) {

#

this

earnest phoenix
#

if (message.content

quartz kindle
#

the paretheses is always done first

#

so this (args.join(" ") !== "--verify")

#

will be executed first

#

which will return true if it not equals, or false if it equals

#

then

#

the if(message.content == is executed

#

which will try to compare the message to the result of whats inside the parentheses

#

does that make sense?

earnest phoenix
#

could you give me that, but stuck together in code

#

xd

sinful lotus
#
if (message.content == async(args)(args.join(" ") !== "--verify") )

also why is there async

earnest phoenix
#

thats gone

sinful lotus
#

also pls rewrite that already

#

that code will just cause you issues

earnest phoenix
#
@bot.command(name = "eval")
@commands.is_owner()
async def _eval(ctx, *, code: str):
    try:
        exec(code);
    except Exception as e:
        await ctx.send("`" + str(e) + "`");
        print(str(e));

Hey so I have the suckest eval command that's plain garbage, can someone help me out?
discord.py rewrite

quartz kindle
#

you want to check if a message.content equals something. what exactly is that something?

earnest phoenix
#
    var args = message.content.slice(config.prefix.length).trim().split(/ +/g);

that way, is looking for messages that have the prefix at the start of args, but i want it to be that, withour prefix part

quartz kindle
#

because args.join would make it match whatever the person decides to write

#

meaning the command would always run

sinful lotus
#

a simple args command will be like this

#
const args = msg.content.split(' ');
quartz kindle
#

well i g2g, good luck to you guys

sinful lotus
#

this code will split the message of the author into array
so for example I typed
<prefix>stuff pls learnjs

it will output
["<prefix>stuff", "pls", "learnjs"]

so if you want to get the learnjs part

args[2] //since array starts at 0
console.log(args[2]) // prints learnjs
earnest phoenix
#

i have args and all defined, and i know what i want, but how do i just make it so, if a message does not start with blabla, ==> return whatever

#

else whatever

sinful lotus
#

if msg.content.startsWith

#

you have that on your prefix checker

#

Β―_(ツ)_/Β―

#

you should have known that already

earnest phoenix
#

lol
if message.content.doesNotStartWith
was a thing, that be handly

sinful lotus
#

you can just freaking put a single ! in front of that

earnest phoenix
#

o ye

#

discord.js commando is beautiful lul

sinful lotus
#

do the code reaches that even?

earnest phoenix
#

only if those roles exist

#

they do

#

double checked

#

const ownerID in every command GWfroggyBlobSweat

#

not using config file MonkaS

#

no, i dont have that in every command

#

and i am

#

just in every command that needs it OMEGALUL

sinful lotus
#

and says its best bot mmLol

#

anyways

earnest phoenix
#

best bot? where

sinful lotus
#

check if it do reach that

earnest phoenix
sinful lotus
earnest phoenix
#

"will this work guys?"

#

try it mmLol

#

no im saying it should, but doesnt

#

config btw^^

#

proof i have one

sinful lotus
#

then why put const ownerid

earnest phoenix
#

it was before config

#

prefix

#

was setup

#

PREFIX

#

selfbot token

#

owner

#

ownerid

#

im dying saya pls

#

hold me

#

GUYS

#

ayy

#

help

sinful lotus
#

Lmao

earnest phoenix
#

the command i have above, works pn my other bot, and doesnt on @heavy thistle

#

why

#

is

#

that

sinful lotus
#

did you save it

earnest phoenix
#

yes

#

i did

sinful lotus
#

maybe you dont

earnest phoenix
#

is there an error

#

are you running the command

#

do the roles exist

#

etc

#

yes

#

etc

#

give info

#

yes to what

#

that was abc

#

in multiple choice at school do u put yes

#

no error, bot above roles, has perms, roles exist

#

ok ok

#

all check

#

oo

#

oo

#

and

#

if roles didnt exist

#

it say, thing given is not a role nor a snowflake

sinful lotus
#

do the bot return if it doesnt exist

earnest phoenix
#

no

sinful lotus
#

then good luck with that

earnest phoenix
#

^

#

wow

#

thx guys

sinful lotus
#

its a simple
if (!role) return

#

I dont think we even need to spoon feed that

#

do we?

earnest phoenix
#

dude

#

its setup correctky

sinful lotus
#

its a public bot

#

you dont expect every server will have those role

earnest phoenix
#

ye, it is

sinful lotus
#

^

earnest phoenix
#

at least he returns when its not the right channel peepoKek

#

i have it so only for my server

#
exports.run = async (client, message, args) => {
    if (message.channel.id !== "500639631558311940") return;

    let role = message.guild.roles.find(r => r.name === "Member!"); 
    let role2 = message.guild.roles.find(r => r.name === "ToBeVerified")
    await message.member.addRole(role);
    await message.member.removeRole(role2);
    await message.author.send("Welcome To The Server!");

}
sinful lotus
#

so it doesnt work, but do the code reaches that

#

do it even run that

earnest phoenix
#

console.log to the rescue Pog

sinful lotus
#

if something doesnt work without any errors

earnest phoenix
sinful lotus
#

then you have problems like you are returning on some bizarre way

earnest phoenix
#

its literally the same as my other bot and works fine for the other bot

sinful lotus
#

did you make sure? did you restart?

#

did you even uploaded it right

earnest phoenix
#

yo

#

yes

#

yes

#

damn

#

u guys are still at it

#

lawl

#

bt

#

btw

sinful lotus
#

5x double check would be ok

earnest phoenix
#

how do I invite someone

sinful lotus
#

if it works on other and not on production

earnest phoenix
#

i did quintuple check

sinful lotus
#

you did something wrong

earnest phoenix
#

do u know what

sinful lotus
#

no ofc

#

it isnt my code

earnest phoenix
#

its done correctly

#

try it for yourself

sinful lotus
#

why would I

earnest phoenix
#

to prove iom right

#

im*

sinful lotus
#

or just double check your code

earnest phoenix
#

i did

sinful lotus
#

we are not magical elves

earnest phoenix
#

i made progress

#

it removes not verified role

#

but still doesnt add role

sinful lotus
#

fix it

#

as I said we are not magical elves

earnest phoenix
#

is there some way to get a role id

sinful lotus
#

mention the role then copu id

earnest phoenix
#

ok

#

aayyy

#

or not

#

When will the certified bot certificate thing be up?

sinful lotus
#

@earnest phoenix no definite time

earnest phoenix
#

Will it come back?

sinful lotus
#

Pretty much

earnest phoenix
#

finally i can sleep

#

im finished

#

and its 5am

#

I regret asking

#

i get 2 hour sleep 😒

#

uHey

#

I was wondering

#

how do I make it

#

so If someone messages the support bot

#

it sends a dm to a staff member

#

and that staff member can reply using the bot

#

that would be a pain in the ass once you shard

lament meteor
#

^

earnest phoenix
#

just have support server

lament meteor
#

and if u make it with case numbers u will have a big db

earnest phoenix
#

wdym

#

just use user id????

#

nvm

#

but still dont do it lo

#

I dont know

#

I need someone to code a bot for me

#

and i cant find anyone

#

I even said I'll pay but no one wants to

#

and I am trying to learn how to code

#

but its gonna take too long

#

is fun to learn to code

#

no not rlly

#

I want to code a discord bot

#

but now that I see

#

how long and how many lines of code it takes

#

its gonna be hard asf

#

@earnest phoenix if u like coding u should code the bot for me πŸ˜„

kind nexus
#

Yo dudes, I'm trying to get my discord bot to go to a specific github repo and update the current bot files with the ones in the github repo every minute. I don't know how I would do that. Please help!!

#

I code in C#

glacial kestrel
#

works fine for me

loud salmon
#

Β―_(ツ)_/Β―

glacial kestrel
#

odd

loud salmon
#

it had an admin role

#

i also had one

glacial kestrel
#

no you need to have admin

#

hm

loud salmon
#

did any errors come up?

glacial kestrel
#

ah i see why, it checks hoistrole

loud salmon
#

lol

glacial kestrel
#

should change it to highestrole prob

#

let me do that rq

loud salmon
#

or just change it to has permission

#

or does discord.js not have that ability

glacial kestrel
#

for member? i think it does, i'll check

loud salmon
#

yea thats how I personally check for perms

glacial kestrel
#

yeh it does

loud salmon
#

idk if its the best way, but I use it and it hasnt backfired

glacial kestrel
#

aight fixed, didnt know that existed for some reason

loud salmon
#

kk

glacial kestrel
#

should i resubmit or?

loud salmon
#

sure, but i need to go to sleep

glacial kestrel
#

aight

steel heath
#

why am i getting emitter warnings always, i have 11 shards and isn't that ok to bot tries to emit 11 events? do i have to set those emitters in sharded-bot.js (sharding manager) possible memory leak detected, 11 guildmemberupdate listeners added...?

timber olive
#

I'm using a mysql database to store stats about members on my server. Can i simply increase a number in the database by 1 instead of having to read it, change it and write it again?

gritty granite
#

Yes

#

I also use mysql

#

I will get my script now

late hill
#

@earnest phoenix i will make u the most epic bot if u pay

#

πŸ‘Œ

bitter sundial
#

@steel heath it seems like you're adding 11 guildmemberupdate events in the same place instead of individual shards?

steel heath
#

Well they are in my index.js and sharding manager shards index.js

lament meteor
#

why so many guildmemberupdate?

earnest phoenix
#

My thoughts exactly.

#

That's going to sap so much memory

steel heath
#

There's only one ffs not only guildmemberupdate, all of events AND EVEN READY

#

why'd i create 11 ready events

#

there's only one

lament meteor
#

but emit will only run one of them

steel heath
#

Yeah that's why I am asking this for months

#

Am i supposed to set events on sharding file or in bot.js which is the file that gets sharded

lament meteor
#

never sharded so never rlly tested

#

i should try maybe

#

u using stable right @steel heath ?

steel heath
#

yh this is why i was asking this to you today

#

still 11.3

earnest phoenix
#

You're supposed to set your event listeners wherever your client logs in.

steel heath
#

yeah that's why i exactly do rn

sinful lotus
#

never got problem with those

#

I just leave the sharding file 4 lines

#

then handle everything on the client

steel heath
#

mhm

#

im using an eventloader to load events and then that loader sets events is that the problem idk

#
// index.js
...
require("./eventloader/loader").run(client, mongoose, cooldown);
...```
```js
// /eventloader/loader.js
...
run: (Client, mongoose, cooldown) {
client.on("guildMemberAdd", { require("../events/guildmemberupdate") });
...
// /events/guildmemberupdate.js
...
run ...
member...
...```
topaz fjord
#

@earnest phoenix yes sir

earnest phoenix
#

requiring every time blobsweat

#

yes i know is cached but still dumb

steel heath
#

hard to write all those on mobile

topaz fjord
#

You can clear the require cache

steel heath
#

also, what can i do except require mhm, i have 500 lined guildmemberadd js

earnest phoenix
#

or just reload the module, remove listener and re-add

topaz fjord
#

^

earnest phoenix
#

don make it require every time

steel heath
#

i cant copy whole code into there lol

earnest phoenix
#

i mean like

steel heath
#

i can load events in index.js but wont change a lot

earnest phoenix
#
const event = require('something.js')
client.on("guildMemberAdd", event);
topaz fjord
#

I have a mem leak, I'm just too lazy to fix it

steel heath
#

thats basically same thing

earnest phoenix
#

no its not

steel heath
#

u sure

topaz fjord
#

But mine is from lavaloink listeners

steel heath
#

ah uhm, will try tonight @earnest phoenix thanks

earnest phoenix
#

thats not about event listener leaks, just a general thing to change @steel heath

steel heath
#

uhm, do you have a minute to explain me the meaning of doing that? dont mind if you cant

#

i just want to make sure

earnest phoenix
#

well if you require every time

#

it is cached so it wont read the file again from disk

#

but it does some other unnecessary work

topaz fjord
#

Is it stupid to delete the cache after you require it

#

bc that's what I do

earnest phoenix
#

to reload it, no

#

otherwise yes

steel heath
#

what kinda unnecessary things

earnest phoenix
#

iirc it goes through modules filenames before returning even if its in the cache

steel heath
#

is that the memory leak reason lol

earnest phoenix
#

no

#

im just saying to change this

steel heath
#

agh, then tf is the reason of these warnings haha

earnest phoenix
steel heath
#

im going to move loader into index file and wont require it and use variables like u said up there

earnest phoenix
#

look at all the extra crap it does lmao

topaz fjord
#

Too many listeners of the same thing πŸ‘€

earnest phoenix
#

yeah probably setting listeners inside eachother

steel heath
#

@topaz fjord whyd i need fucking 11 ready listeners tho

#

READY

topaz fjord
#

you don't

steel heath
#

yes but im getting errors of it

topaz fjord
#

your doing something that's creating more of the same thing

steel heath
#

and thats what i want to find

earnest phoenix
#

can ready fire more than once? idek

steel heath
#

i dont think so

#

only in different shards

topaz fjord
#

My mem leak is the cause of me doing recursive calls of a function with event listeners

earnest phoenix
#

memory leaks peepoHappier

topaz fjord
#

yes sir

steel heath
#

well at least you know the reason, i cant see a reason of mine

#

am very dum

glacial sentinel
#
    at IncomingMessage.res.on (/root/bot/node_modules/dblapi.js/src/index.js:115:25)
    at IncomingMessage.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1092:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
#

Did I get rate limited or something

#

Every time I try to make a call to the website

earnest phoenix
lament meteor
#

@glacial sentinel might be ratelimited or u didnt supply your key

glacial sentinel
#

I guess I got rate limited then lol

#

Am I like banned for a hour now

#

@bitter sundial Can I get some help here please

#

Access denied
The owner of this website (discordbots.org) has banned your IP address

torpid frost
#

well that's explicative πŸ˜…

bitter sundial
#

send IP

shrewd lintel
#

1.1.1.1

glacial sentinel
#

Solved already, and that's shitposting ^

earnest phoenix
#

What’s
\* @param*\ lOL

split lantern
#

Jsdocs

earnest phoenix
#

A comment

mint cradle
#

Discord.py
Hello everyone,

I am making a module where I send a file (from my computer) and let ppl rate this using on_reaction_add.

Now I wonder, how do I get the name of the file sended in on_message or on_reaction_add? Or the message content when I use send_file?

Because it just returns nothing if I use file.content.

file = await gopbot.send_file(message.channel, meme)

in

#On a message (command)
@gopbot.event
async def on_message(message):
    global SlavMemeCounter
    
    # GOPBOT MEME
    if message.content.upper().startswith('GOPBOT MEME'):
        if SlavMemeCounter >= SlavMemeCount:
            SlavMemeCounter = 0
        SlavMemeCounter += 1

        doc_ref = memes_ref.document(u'Number')
        doc_ref.set({
            u'Number': SlavMemeCounter  
        })

        location = str(SlavMemeLocation) + str(SlavMemeList[SlavMemeCounter])
        with open(str(SlavMemeLocation) + str(SlavMemeList[SlavMemeCounter]),'rb') as meme:
            file = await gopbot.send_file(message.channel, meme)
abstract crystal
mint cradle
#

Thnx!!!!

waxen quest
#

How can I make this case insensitive?

I tried this but I get this error

if(message.content.toLowerCase().startsWith(Prefix + "set Automatic Reactions ").toLowerCase()) { ...

earnest phoenix
#

well

waxen quest
#

wait I may have messed up a bit

earnest phoenix
#

it does it to small letters but u use big? :o

#

oof idk

#

nvm

waxen quest
#

It works normally like this but when I need to use the startsWith it won't cooperate

if(message.content.toLowerCase() == Prefix + "help".toLowerCase())

earnest phoenix
#

thats because you are lowercasing their input

#

then comparing to mixed case

#

then converting the result needlessly to lowercase

#

message.content.toLowerCase().startsWith(Prefix + "set Automatic Reactions ").toLowerCase()

#

"make the message lowercase, now check if it matches (Prefix + "set Automatic Reactions ") which will NEVER hapen because that has capital letters"

#

i dont even think that would work

#

because .toLowerCase() isnt for bool

#

so u will just get toLowerCase is not a functon

waxen quest
#

Alright thank you

earnest phoenix
#

also if your command handler is an if-else chain, you should not do toLowerCase and compare every time

late hill
#
if(message.content.toLowerCase().startsWith(Prefix + "set automatic reactions "))
#

Should be fine

#

But yes what Tom said

#

Don't do this like ten times

low rivet
#

unless your prefix has an upper case

late hill
#

oh

#

then put Prefix.toLowerCase() snfsnfnsef

#

My prefix is always put to lowercase

#

Because why the fuck would you have a case sensitive prefix

waxen quest
#

Thank you, partner 🀠

wary aspen
glacial sentinel
#

.help is not a thing

#

omg I just got dmed by like 10 bots

#

never do .help again GWqlabsYaoLUL

#

if you go to the related server like if it's Discord.JS I can dm you an invite to that, there will be many more people to help you

#

I suggest to post your code too :P

still cave
#

Dors discordbots allow for bot frameworks too?

smoky spire
#

What do you mean "allow for"?

ruby talon
#

Votes: (pbotinfo)
80

Upvotes (@gilded plank botinfo @rocky oak)
126

Anyone knows why it doesn't register all my votes in my bot?

loud salmon
#

@still cave what do you mean by bot framework

still cave
#

I have a network that takes a config file that creates and hosts a bot basic off of it’s settings. So it isn’t just one bot it can be many bots. And I add different features as services (which are selected with the config file)

loud salmon
#

hmm

#

so it starts off as a basic bot and you can load commands based on a config that a server admin edits? @still cave

#

wrong channel @earnest phoenix

topaz fjord
#

Arthur it probably is because of monthly votes

still cave
#

@loud salmon yes sorry went afk for a moment

loud salmon
#

Then you should be good

#

Submit it for review and it may get accepted

wheat marten
#

How do I make my bot say an emoji?

earnest phoenix
#

No idea since you haven't given any specific details about the lib.

wheat marten
#

My lib is discord.js

glacial sentinel
#

a custom emoji or a default discord emoji? @wheat marten

#

and that's not related to the library

wheat marten
#

a custom emohi

glacial sentinel
#

put a \ at the start of the emoji

#

copy the code it gives you and put it in the bot's send message text thing

wheat marten
#

ok

flat grove
#

what is the var of Manage_server on discord.js ?

#

sorry ... i found it now

glacial sentinel
earnest phoenix
#

hmmmm

steel heath
#

@earnest phoenix still same shit btw:(node:23544) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added. Use emitter.setMaxListeners() to increase limit

#

I'm starting with forever is that the problem

night imp
#

Well forever auto restarts

#

try destroying listeners on the bot load

earnest phoenix
#

same

#

i thought it was normal

#

why wont this work

const discord = require('discord.js');
const {prefix, PREFIX, footer, owner, ownerID} = require('../../settings/config.json')
const talked = new Set()

exports.run = async(client, message) => {
if(message.author.id !== ownerID) return message.channel.send("You Have Not Unlocked This Easter Egg!");

        if (talked.has(message.author.id)) {
            let embed1 = new Discord.RichEmbed()
                .setAuthor("Hold up!")
                .setColor("RANDOM")
                .setDescription("Command Can Only Be Used Once Every Twenty-Four Hours, Please Try Again Soon!")
                .setFooter(footer);
            message.channel.send(embed1)
            message.delete(2000);
    
        } else {
            message.channel.send("Look At Bots Status Colour!")
            setInterval(() => {
                RepeatDelay(client)}, 20000)
                        function RepeatDelay(client){
            
              setInterval(() => {
                onlineDelay(client)}, 2000)
              setInterval(() => {
                dndDelay(client)}, 7000)
              setInterval(() => {
                idleDelay(client)}, 12000)
                        function dndDelay(client){
                            client.user.setStatus("dnd")
                        }
                        function idleDelay(client){
                            client.user.setStatus("idle")
                        }
                        function onlineDelay(client){
                            client.user.setStatus("dnd")
                        }
                    }
    if(message.author.id !== ownerID) return message.channel.send("24-hr Cooldown Enabled!");

            talked.add(message.author.id);
            setTimeout(() => {
                talked.delete(message.author.id);
            }, 86400000);
    }
}
steel heath
#

@night imp how do I do that

bitter sundial
#

does d.js MessageStore.fetch get the message from cache if it exists or always use rest api

steel heath
#

.fetchMessage func is always getting from rest afaik

#

cuz my bot can quote the first message in a channel

bitter sundial
#

idk how that means its always rest

steel heath
#

i dont cache any messages but last 200

#

nor my bot

bitter sundial
#

but those last 200
are they from cache or fetched

steel heath
#

oh

pale marsh
#

Anyone got a good idea on how to track how many times a command was executed in the past 24 hours? πŸ€”

#

I have a couple of ideas but they either seem inefficient or utterly stupid

quartz kindle
#

do you need persistence?

#

or can you get by without a database?

topaz fjord
#

or you can just log in a text file mmLol

#

and search within a timestamp

night imp
#

yeah like

pale marsh
#

@quartz kindle define persistence?

night imp
#

var used = 1
commandused:
used++

topaz fjord
night imp
#

then save date in text

quartz kindle
#

persistence = data is stored on disk and remembered between bot restarts

pale marsh
#

Yeah I was thinking of using a db instead because this can get messy, considering my bot's files conditions

#

I was thinking of tracking them on 5 mins basis

#

Like posting data every 5 mins

#

So I was gonna create a table with 24*12 rows and a number of columns = number of my bot's commands

#

And go through the rows one by one on every 5 min mark and updated it, and if I need data for the past 24 hours I can just sum them

#

But seems really stupid and inefficient to me GWcmeisterPeepoShrug

quartz kindle
#

you can go the nosql route instead of an rmdb

topaz fjord
#

yes

quartz kindle
#

you could for example create keys based on dates

#

each day generates a new key

#

key contains an object which contains commands and times executed

#

and everytime a command is run, you increment it

celest prawn
#

can someone help

quartz kindle
#

like database[todaysDay][command]++

#

and your database looks like ```
{
"day1":{
"command1":5,
"command2":9
}
"day2":{
"command1":45,
"command2":29
}
}

pale marsh
#

I think I got you

#

That sounds good to me tbh

#

I think I can only see one downside of this. I wouldn't be able to know when peach usage was across the day I guess

#

Peak*

celest prawn
#

@quartz kindle can u help me

topaz fjord
#

ask your question and someone will help

quartz kindle
#

another route, albeit a more complex one, would be to create an object of commands, where each command has an array of dates

celest prawn
#

Where do you put ure commands for a bot

quartz kindle
#

so for example ```js
{
"command1":[date1,date2,date3],
"command2":[date1,date2,date3,date4]
}

#

and each time a command is run, you do database[command].push(date)

celest prawn
#

where though

quartz kindle
#

then you can search the array in order to group commands by time frame

pale marsh
#

In that case that array would be huge

quartz kindle
#

@celest prawn have you created a bot? do you know any programming language?

celest prawn
#

no this is my first time

quartz kindle
#

you need to learn a programming language

#

i recommend javascript or python for beginners

#

you can look up some javascript courses and tutorials online

celest prawn
#

no i just need to know where and how to put in commands

pale marsh
#

What language are you using?

quartz kindle
#

and yeah, the array would be huge @pale marsh , but thats the price of indexing all the dates xD

celest prawn
#

wtfym

quartz kindle
#

or you can group by day, and push hours instead of full dates

pale marsh
quartz kindle
#

@celest prawn you cannot make a discord bot without knowing a programming language

earnest phoenix
#

you can

quartz kindle
#

unless you use something like discord bot maker

earnest phoenix
#

Discord Bot Maker

#

yeah

#

Steam

pale marsh
#

Don't though

earnest phoenix
#

kek

quartz kindle
#

discord bot maker is for noobs :^)

pale marsh
#

Not only that

#

If you want to make a bot that does complex stuff you'll suffer more than just learning a language and using it

earnest phoenix
#

lmao

#

ive never even thought of buying

pale marsh
#

@quartz kindle thanks for the advice btw. I appreciate it ❀

quartz kindle
#

np :3

celest prawn
#

omfg u useless pieces of shits

quartz kindle
#

@celest prawn you will not be able to make a bot without knowing how to code. period

celest prawn
#

ik how to code

quartz kindle
#

in which language?

celest prawn
#

idk

quartz kindle
#

then you dont know

celest prawn
#

i hack

pale marsh
#

...

quartz kindle
#

hacking is not coding

celest prawn
#

u r useless

pale marsh
#

Sure

quartz kindle
#

im useless because you dont know how to code? ok lol

celest prawn
#

no

#

because u gay

quartz kindle
#

lmao

#

im not though?

celest prawn
#

lmao ure fucking forehead

quartz kindle
#

how old are you btw?

topaz fjord
#

ur a forehead

#

weeb

pale marsh
#

@hushed berry a bit rood and offtopic mmLol

topaz fjord
#

stop coming at my boye Tim

quartz kindle
#

"you are fucking forehead", that doesnt even make any sense

hushed berry
#

@celest prawn chill out my dude

topaz fjord
#

hacking is not coding tho

#

he is right

#

hacking involves coding

#

well

#

some times

#

smfh people these days

#

@earnest phoenix amirite mmLol

celest prawn
#

@quartz kindle i don't need to tell u anything so u will never know my age bitch

quartz kindle
#

lmao

hushed berry
#

didnt i JUST tell you to chill out

celest prawn
#

im not mad my dude

topaz fjord
#

not mad

#

proceeds to call people bitch

celest prawn
#

ya ok

earnest phoenix
celest prawn
#

that doesn't make u mad

topaz fjord
#

totally

celest prawn
#

u r a retard

quartz kindle
#

why are you mad though? we're genuinely trying to help you by telling you what to do, but you refuse our help

topaz fjord
#

retard means slow

celest prawn
#

im not

#

mad

topaz fjord
#

since retard means slow, your sentence technically says "u r a slow"

#

and he's gone

glacial sentinel
#

oh god

#

Discord Bot Maker

#

is my worst nightmare

topaz fjord
#

I've had my daily dose

quartz kindle
#

lmao

topaz fjord
#

adios πŸ‘‹

glacial sentinel
#

I remember trying to make a complex bot with it

hushed berry
#

hi jet

#

bye jet

alpine plover
#

I wrote a review about that once.

#

Hi Nik

quartz kindle
#

question: thoughts about javascript auth vs session/cookie auth?

#

for example, a page loads, then javascript logs in by sending a post request containing a token saved in the browser

#

vs page loads and logs in via cookie token

bitter sundial
#

so, static frontend with javascript authentication or dynamic frontend with templating and backend authentication?

topaz fjord
#

dynamic

alpine plover
#

dynamic

bitter sundial
#

I like both

#

I guess it depends on what you wanna build

alpine plover
#

dynamic is always the way to go unless price matters

bitter sundial
#

can bots add a video object to embeds Thonk

alpine plover
#

yes?

#

I thought so

#

that might be one of those things I just imagined and realized they couldn't a few months ago.

bitter sundial
#

gonna have to investigate further

#

to testing I go

alpine plover
#

I think the API ended up not having documentation for it, unless they updated it recently.

quartz kindle
#

i have a dynamic front end with php, but my concern is that cookie-based authentication doesnt work in certain browsers that have cookies disabled

#

there are a few privacy-oriented browsers in which my website completely broke

#

maybe im not using sessions properly though

#

javascript just feels like it would be easier to track a user's machine than php which only offers ip address and user agent, both of which are easily spoofable

earnest phoenix
#

What does this snippet of code do in Python?

__import__("ctypes").string_at(0)
lunar relic
#

Hi! How would I composite one image over another using JIMP and an image address? I have tried:

Jimp.read("urltoimage").then(image => {
    image.composite( "urltoanotherimage", x, y);
    //more code below that isn't relevant
});```

However, I get an error which tells me that src ("urltoanotherimage") must be a Jimp image. I have tried downloading the image to disk with Jimp and then compositing the images, but that doesn't work well because my files refresh every 10 seconds and so there is either a 10 second delay (made by setTimeout()) before it can composite the images or it doesn't find the image at all (without setTimeout()).
earnest phoenix
#

You need to read the image first

#
var a = await Jimp.read("image url");
var b = await Jimp.read("another image url");
var c = await a.composite(b, 0, 0);```
lunar relic
#

Ahh, I see, alright, thanks!

earnest phoenix
#

np

lunar relic
#
var img = Jimp.read(message.author.avatarURL).then(image => {
      image.resize(128, 128);
    });
    var img2 = Jimp.read('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSwPbKnk2lK1IjS0fvMaZMzVbVfQdUG6lR9gkXWKwPC-VJqlgjbLQ').then(image => {
      image.resize(500, 168);
      image.quality(100);
    });
    var img3 = img2.composite(img, 100, 100).then(image => {
      let outputfile = `./output/${message.author.username}${message.author.id}.${image.getExtension()}`;
      image.write(outputfile, function () {
        message.channel.send("Test Successful!", {files: [outputfile]}).then(function () {
          fs.unlink(outputfile);
        });
      });
    });```

This is my current code for it and it doesn't seem to be working 😦
earnest phoenix
#

uh

#

Why are you writing the file

lunar relic
#

I couldn't figure out another way to send the message to discord πŸ€”

earnest phoenix
#

There is also image.getBuffer()

#

fs.unlink without linking anything

lunar relic
#

That deletes the outputfile after the message is sent

earnest phoenix
#

you should use async

#

makes the code more cleaner imo

lunar relic
#

Alright, disregarding that, I am still getting the error that img needs to be a jimp image.

earnest phoenix
#

try this

var img = await Jimp.read(message.author.avatarURL);
img = await img.resize(128, 128)
var img2 = await Jimp.read('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSwPbKnk2lK1IjS0fvMaZMzVbVfQdUG6lR9gkXWKwPC-VJqlgjbLQ');
img2 = await img2.resize(500, 168)
img2 = await img2.quality(10)
img2 = await img2.composite(img, 100, 100);
img2.getBuffer("image/png", function (err, buffer) {
    const file = new Discord.Attachment(buffer, "image.png");
    message.channel.send("Test Successful!", {file});
});```
lunar relic
#

That worked perfectly. Hmm, would it be possible to just use .then() instead of declaring img2 repeatedly?

earnest phoenix
#

well, yeah, but it would be the same thing

lunar relic
#

OK. Makes sense.

#

Thanks!

earnest phoenix
#

np!

quartz kindle
#

doesnt jimp chain methods?

#

img2.resize().quality().composite().getBuffer()

earnest phoenix
#

how do i see who voted for my bot?

idle mountain
#

the best way is to use webhooks

#

you should keep in mind that even if you don't get a lot of votes, you should try to stick to webhooks because DBL will ratelimit you if you keep sending requests to see if someone has voted

earnest phoenix
#

thx

idle mountain
#

sorry

earnest phoenix
#

oki

idle mountain
#

go down to "Get Bot's Last 1000 Votes"

earnest phoenix
#

thx

idle mountain
#

np Yee

late hill
#

If you get under 1000 votes you can just loop the getvotes

#

You don't have to send requests when users use the command

earnest phoenix
#

how

#

do

#

i

#

stop this from happening

#

every time i resize the window

#

it touchs the blue thing

#

see

shadow python
#

are you using fixed numbers?

earnest phoenix
#

yea

shadow python
#

use non fixed numbers like 25%

earnest phoenix
#

actually

#

me

#

is no use numbers at all

#

lol

shadow python
#

lol

earnest phoenix
#

how do i

#

like

#

tell it

#

5% from the bottom

#

in html

stone scroll
#

how do you make a command handler so I don't have a 171 line one file bot?

earnest phoenix
#

Theres alot of yt vids about cmd handling

#

You can watch one and edit it to ur liking.

stone scroll
#

klol

bright spear
#

@earnest phoenix 1. use css
2. this channel is for bot development as the channel topic says

earnest phoenix
#

@bright spear for one no this channel is for general development

#

an admin had said that already

#

and dw i figured it out

mystic tapir
#

Setup of new welcomer bot

earnest phoenix
#

Does anyone know why discord's members api endpoint only returns a single result?

unborn nova
#

Dear Masters

earnest phoenix
#

@topaz fjord shoot me

unborn nova
#

for using quick.db xd? @earnest phoenix

#

oh c'mon

earnest phoenix
#

how

#

do i make my website show a preview on discord?

unborn nova
#

HTML

earnest phoenix
#

yeah

#

well

#

i need help

#

because i dont know how to do it

unborn nova
#

...

earnest phoenix
#

........

#

dude

#

can you help me instead of

unborn nova
#

just kidding

earnest phoenix
#

dotting me

unborn nova
#

give me a min

earnest phoenix
#

i think i got it

#

is this right?

unborn nova
#

@earnest phoenix

#

if you do not know HTML, you should look at these courses

earnest phoenix
#

all good

#

thanks

unborn nova
earnest phoenix
#

i know

#

dude

#

i already have a website

unborn nova
#

so

earnest phoenix
#

so

#

they will not work alone

unborn nova
#

that was perefctly ignored

earnest phoenix
#

wanna check it?

unborn nova
#

sure

#

send in pm

earnest phoenix
#

self hosted self created

#

self everything

#

its hosted on a powerfulll vps

unborn nova
#

not bad

#

Actuly I'm a Front-End Web Dev But I'm Too Layz XD

earnest phoenix
#

what do you mean

glacial kestrel
#

oof

earnest phoenix
#

guys

#

i need help

#

<meta property="og:image" content="https://imgur.com/lr1bCmW" />

#

the preview doesnt work

#

i have tried putting the directory

#

and still no luck

#

well if you tested with discord with the direct link it should work but probably it was cached without the direct linkl

#

you can try adding a query string to the url maybe discord will fetch it again

topaz fjord
#

Ok tom

#

When are u free mmLol

#

Tom this seems like a good neural network project

#

amirite @earnest phoenix

earnest phoenix
#

πŸ˜‚

#

i just couldnt believe that person didnt know what was wrong

#

blew my mind

topaz fjord
#

which person

earnest phoenix
#

still no

#

that was the MOST friendly helpful error

#

luck

topaz fjord
#

The one I pinged you at?

earnest phoenix
#

no the one i pinged lol

topaz fjord
#

oh

#

It's not even an error

earnest phoenix
#

πŸ˜‚

topaz fjord
#

It just tells them they can install the types for it

#

smfh

earnest phoenix
#

i have tried it on messanger

#

it worked

#

there ya go πŸ‘Œ

#

but it doesnt work on discord

#

or twitter

#

just cached

#

ah

#

twitter needs a different one actually i think

#

1 sec

#

ill send

#

@earnest phoenix i have it

#

yeah i did put that in

#

the twitter:card, etc ones?

#

yea

#

ok cool

#

πŸ€”

#

still not working

#

:C

#

one of them has value=

#

i think it should be content

#

YEA

#

Nope

#

because discord bot list done the same thing

#

kk

#

i will try the link on my brothers

#

computer

#

lets hope it works

#

nope

#

still no picture

#

it could be cached on the server

#

its not about your pc discord caches it

#

if the direct link is there it will work dont worry

#

just wait till tomorrow

#

probably will update

#

i hope but why when i updated the text it updated but not the image?

#

πŸ€” good point actually πŸ˜‚ i didnt notice

#

yea

#

send image link

#

link? mm i am not using a link any more

#

i am use the path

#

OH use absolute path

#

yea

#

oh

#

wait

#

huh?

#

im guessing blobshrug

#

oh

#

doesnt link it properly

#

add ur url in front

#

the website url?

#

oooh

#

:(((((

#

still the same

#

rippers

#

:C

#

its sad because i spent like an hour on this

#

ayyyyyyy

#

no way

#

ayyyyyyyyyy

#

woah

#

what was it

#

i added in <meta name="theme-color" content="#222">

#

and

#

i checked

#

and it worked

#

lmao nice

#

yea

wary aspen
#

Please help me

earnest phoenix
#

What?

glacial kestrel
#

wut

frigid juniper
#

πŸ€”

earnest phoenix
#

πŸ€” Thonk

amber junco
#

Hello? We are looking for a bot developer for our bot!

zenith moss
#

Dat name lol

amber junco
#

Its a nick name

#

So are you in?

zenith moss
#

No

amber junco
#

oh

earnest phoenix
#

Xx

zenith moss
#

I just like the nick

amber junco
earnest phoenix
#

Prob provkde some info on what's the idea of it etc..

amber junco
#

what?

earnest phoenix
#

And maybe some1 will help

amber junco
#

oh

#

ok

#

Our bot is very new... We are concentrating on moderation along with some utility....
Looking for a person who can help... dblSmile

earnest phoenix
#

P aid ye or nae

amber junco
#

What

earnest phoenix
#

Are u gonna pay, yes or no

amber junco
#

No, But you can get to be part for our team...

earnest phoenix
#

Ok now just wait some1 will prob dm u

amber junco
#

No one will do it

#

I bet you

earnest phoenix
#

Have a little faith.

amber junco
#

I bet you...

earnest phoenix
#

wat

amber junco
#

We are looking for a bot developer for our bot

#

Our bot is very new... We are concentrating on moderation along with some utility....
Looking for a person who can help... dblSmile

earnest phoenix
#

What language and library

uncut delta
#

@amber junco be more clear about this

amber junco
#

@uncut delta Yes, See your bot is still very new... and we need a good bot developer (Because our currebt one is very rude) Unfortunately we are not offering a pay. But if the bot grows you can have a decent title... Dm me for more info.mmLol

#

@earnest phoenix We are running discord.js

uncut delta
frank dust
#

you don't need to tag people when your responding to a message they sent a few minutes ago

amber junco
#

sorry

quartz kindle
#

no money no bot :^)

uncut delta
#

Yeah

amber junco
#

lmao

earnest phoenix
#

hey guys can anybody make me a generic bot that there are already so many of

#

oh btw i wont pay you

quartz kindle
#

we pay with exposure

earnest phoenix
turbid gale
#

a bot developer which isn't the developer mmlol

amber junco
#

yes but i succ

#

very much

quartz kindle
#

we all do at some point in time

mint cradle
#

PYTHON
Hey,

I want to round numbers to 0 decimals but if you round 2.5 to 0 decimals, it would be 3 right?

print(round(2.5))
>>> 2

How can I let 2.5 be rounded to 3?

(yes it's in a bot program, but like this it's easier to understand the problem)

inner jewel
#

floor(x + 0.5)

earnest phoenix
#

ceil(x)...

earnest phoenix
#

because its not in this server awesmart

#

How add him?

#

Bots kicked

#

Please go moderator

alpine plover
#

Nice.

amber junco
#

Ummm.. Hello My bot isnt working

#

When I type node index it sends out an error message

uncut delta
#

use node index.js

astral quail
#

send the error message then..

earnest phoenix
#

Shouldn't matter if the command was ran in the right directory

#

node index or node .

earnest phoenix
#

t!i

waxen quest
#

How can I know the lastest server my bot has joined?

ruby dust
#

you don't

waxen quest
#

mmLoln't

glacial sentinel
#

when your bot is added to a server save that somewhere and that will be the last server Think @waxen quest

waxen quest
#

smart 🀠

earnest phoenix
#

how can I change the perms for @everyone and set it so only one person can view it

earnest phoenix
#
            VIEW_CHANNEL: true,
            SEND_MESSAGES: true,
            ADD_REACTIONS: false
        })
        msg.guild.channels.forEach(async (chat, id) => {
            await chat.overwritePermissions(member, {
              VIEW_CHANNEL: false,
              SEND_MESSAGES: false,
              ADD_REACTIONS: false
            });
          });```
Cannot read property 'overwritePermissions' of undefined?
idle mountain
#

Means chat is undefined, make sure its defined before the usage and it’s defined in the right scope

queen sentinel
#

QUANTUM

#

HELLO

idle mountain
earnest phoenix
#

@idle mountain how can I change the perms for @everyone

smoky spire
#

Use guild id

pliant mortar
#

There's no guild.default_role for the lib their using?

smoky spire
#

There is, guild.defaultRole, but guild id also works and is less letters to type

earnest phoenix
#

if(response.toLowerCase!=='yes') return msg.channel.send("Canceled!")

#

why does that say cancelled to everything

#

what is response

west raptor
#

toLowerCase is a function?

#

i think

earnest phoenix
#

also i need to know what is response

west raptor
earnest phoenix
#
            var response = await msg.channel.awaitMessages(msg2 => msg2.author.id === msg.author.id,  {
              
              maxMatches: 1,
              time: 15000,
              errors: ['time']
            }); 
            embed.setTitle("Done!").setColor("GREEN").setDescription("Selection canceled!")
          }```
#

yeah

#

thats why

west raptor
#

its the toLowerCase

#

it should be toLowerCase()

smoky spire
#

Also, response is a collection

west raptor
#

yea that too

#

almost spoonfeed

earnest phoenix
#

also by your if statement if the message is unequal to "yes", it'll just say that

#

TypeError: response.toLowerCase is not a function

smoky spire
#

Again, response is a collection

west raptor
#

^

#

toLowerCase only works on string type iirc

#

going by your code it would be js if (response.first().content.toLowerCase() !== 'yes') { ... }

earnest phoenix
#

hello I need help it keeps saying invalid server format what dose that mean

glacial sentinel
#

told u 3 things u did only 1

#

what library do you use

#

and whats the code that has the error

earnest phoenix
#

what do you mean library

glacial sentinel
#

just post your code then

earnest phoenix
#

bfwxgRv

#

it's a perm code

glacial sentinel
#

not for your server πŸ˜‚

earnest phoenix
#

for my bot?

#

@glacial sentinel dose it need the code for my bot

quartz kindle
#

where does it say invalid server format?

earnest phoenix
#

were it says what server is this bot in

quartz kindle
#

in the website?

earnest phoenix
#

no

#

below that

quartz kindle
#

but in the discordbots website?

earnest phoenix
#

no leme

#

send screnshot

#

that

quartz kindle
#

so yes, in the website

glacial sentinel
#

u need the server's id not invite

#

after u turn on dev mode

#

and the server has to be on the website

earnest phoenix
#

idk if it is

quartz kindle
glacial sentinel
earnest phoenix
glacial sentinel
#

wrong bot client id

#

it tells you exactly what the issue is

earnest phoenix
#

were do I get that

glacial sentinel
#

are you even trying

quartz kindle
#

did you create a bot account in the discord developer website?

earnest phoenix
#

a liitle

quartz kindle
#

.>

glacial sentinel
earnest phoenix
coral trellis
#

You put your bots client Id not it’s token

earnest phoenix
#

how do I get the id

#

also what is the site were you need to make the bot account

coral trellis
#

Two ways you can right click your bot and copy id or on discord developers page it displays your bots client id

#

Oh on Discord applications

earnest phoenix
#

were that

coral trellis
earnest phoenix
#

thank you

#

now all I got to do is make the account

quartz kindle
#

by the way @earnest phoenix

#

your bot will probably be rejected if you apply it like that

#

to apply a bot to the website, it needs to at least be functioning

earnest phoenix
#

I'm not applying it like that lamo

#

@coral trellis from that were do I go to create the account

quartz kindle
#

well, you're trying to add a bot that doesnt even exist yet, let alone work

coral trellis
#

There is a tab on the left and you go down to bot

earnest phoenix
#

k

#

@quartz kindle it dose work not that well but the owner knows what he is doing

quartz kindle
#

im confused

#

do you already have a working bot?

#

if so, why are you trying to add a new, non-existing bot, instead of adding the one that exists and works?

earnest phoenix
#

idk what the hell the owner is trying to do

quartz kindle
#

lmao okay

#

but if you're trying to add his bot, tell him to send you the bot's client ID then

earnest phoenix
#

he did

#

also @quartz kindle how do I make the bot online

quartz kindle
#

you have to code it

earnest phoenix
#

k

quartz kindle
#

or he has to, if he's working on it

earnest phoenix
#

I will tell him that also were dose he do that

quartz kindle
#

he has to learn a programming language

#

and create a program

earnest phoenix
#

k

#

but were on the bot

quartz kindle
#

you know the bot account in the discord developer website? there is a "bot token" somewhere in there

#

a bot token is the bot's login password, basically

#

you have to create a program that connects to discord and uses that token to login.

#

then the bot will become online

earnest phoenix
#

k

wicked summit
#

Hi

#

Are someone know how to make when user update their avatar i can logs it ? In discord.js

quartz kindle
#

something like client.on("userUpdate") i think. is there any list of client events? i only found websocket events