#development

1 messages · Page 587 of 1

earnest phoenix
#

In ms

smoky mica
#

yes

amber fractal
#

that's what I gave

#

except it's the average of that meaning it's the ping

#

average ping*

pseudo scroll
#

Does anyone know if there is a quiz bot that uses reactions to submit answers?

#

I would really love to honestly see how it works so I can fix up my own bot

earnest phoenix
#

#

also does anyone know how to not send bot tokens

#

jk lol

amber fractal
earnest phoenix
#

ye my boy andy posted his bot token by accident bc it was on his clipboard 😂

#

it's fine tho it wasn't anything big luckily

pseudo scroll
#

He knows that

#

He's literally the guy we were talking to yesterday

pallid zinc
#

Bot not working

#

Anyone

earnest phoenix
#

1)glitch
2)phone
3)tiny text
Three things you can't use to code

alpine cave
#

i can

#

i use glitch for codng my bot

earnest phoenix
#

ew

alpine cave
#

whay ¿

#

i user Android

earnest phoenix
#

free vps are bad

#

you need jesus

alpine cave
#

XD

earnest phoenix
#

people will more than likely not offer help with free hosting

#

get a proper vps and the issue would probably go away, which at this point isnt even expensive, 2 euros a month on scaleway

pallid zinc
#

@earnest phoenix no
I just click pic in my phone

earnest phoenix
#

we can't even read it it's so small dudw

#

And get a vps

pallid zinc
#

Lol

earnest phoenix
#

We ain't helping

#

How old are you?

pallid zinc
#

Me

earnest phoenix
#

Yea

pallid zinc
#

WhyGWqlabsWtf

earnest phoenix
#

just wondering you seem a bit childish

#

dear God wix isn't even a vps

pallid zinc
#

Can you suggest me 2-5 euros vps

earnest phoenix
#

Scaleway

pine leaf
#

cough cough AWS EC2 cough cough

#

I'll just leave that there

sterile hedge
#

free for a year

earnest phoenix
#

@pine leaf you're a mad man if you suggest that to a new person in server development.

#

@pallid zinc if you're a student you can get the student github package and claim 100 dollars on DigitalOcean

pine leaf
#

@earnest phoenix ?

earnest phoenix
#

DigitalOcean unlike AWS EC2 has a 100% guarrantee that you pay the exact number you see

#

Yugnut, EC2 has hundreds of settings

#

It can go from being 5 euros to several hundred

pine leaf
#

I suppose, if you just read the docs/ forum posts/ the vast wealth of knowledge online concerning EC2 then even a new dev shouldn’t have any issues

earnest phoenix
#

Have you ever used it?

pine leaf
#

I currently use it

earnest phoenix
#

For the purpose of a bot?

pine leaf
#

Yes

earnest phoenix
#

I also use it daily and I don't see how AWS EC2 > Ubuntu Scaleway/DO server

#

Less configs, easier to start

#

Search "Amazon AWS overcharge"

pine leaf
#

To be fair I haven’t used those, I was just suggesting based off of what I use.

#

I’m pretty sure you can setup billing alarms for that though

earnest phoenix
#

Well the best option is to havr all the settings right

#

But digitalocean requires 0 settings

#

For enterprise level Amazon EC2 is AMAZING

#

I work as a software developer and I love EC2, S3, cloudwatch, ES and so on at worn

#

Work*

#

But using it at home I don't reccomend

#

(Afk)

pine leaf
#

Hey man, like I said I was making recommendations on what I was familiar with, I’ll know better than to do that in the future I guess

amber fractal
#

Or literally check pins, use any search bar or consult my grandmother to do a simole google search for you.

sinful lotus
#

if you want a nice cheap server

#

I can recommend Contabo to you

earnest phoenix
#

@pine leaf no no, I'm not trying to tell you did something wrong. I'm just trying to be informative.

pine leaf
#

@earnest phoenix I’m so bad at reading people, sorry about that, I’m sure it being 1:30am where I’m at has something to do with it as well.

#

At any rate I’m off to dream land, sleep tight fellas

earnest phoenix
#

Haha good night man

oblique gulch
#

I know my doubt might be silly, but could anyone help me to make an "entry order" in javascript? The same as the Vortex bot ... Who can help me, please, mark me.

bright spear
#

Uh what

earnest phoenix
#

there is a boxshadow that boxshadow wont remove >:c

#

dm me

bright spear
#

@earnest phoenix css #bot-details-page .bot-img { box-shadow: none !important }

earnest phoenix
#

i have that and it still appears

bright spear
#

That works for me

#

Is it exactly the same

earnest phoenix
#

not bot details page

bright spear
#

Add that

earnest phoenix
#

nope

#

sitll

bright spear
earnest phoenix
#

hrm

#

i dont have anything

#

that would controdict it

#

but it still happens thonk

bright spear
#

Inspect it in devtools

earnest phoenix
#

those are the only two classes

#

or ids

#

that are involved

#

both of which i remove box shadows

bright spear
#

I mean look at the css

#

See what's overriding it

earnest phoenix
#

right here

#

but i over ride that in my inline thonk

#

maybe its on .columns

bright spear
#

Did you use the id and the class together or separately

earnest phoenix
#

seperately

bright spear
#

It needs to be together like I sent

#

That makes it more specific

earnest phoenix
#

oh wait

#

i see

#

ok

#

i thought i saw a ,

#

after the id

#

gotcha

bright spear
#

Lol k

earnest phoenix
#

byotiful

bright spear
earnest phoenix
amber gorge
#

Hello everyone
A lot of bot websites offers a way to connect via the bot to discord to access the user’s username, guilds etc
Can you explain to me how to do that ?

dusky marsh
#

It's a discord application

#

You know how you access the application panel to access your bots? It's that same process I'm pretty sure, you just don't make it into a boy

#

Bot*

amber gorge
#

Oh ok

#

So it’s not something I add to the bot

#

Ok thank you

earnest phoenix
#

How would you set up voting rewards 🤔

pallid zinc
#

I also want to now

slender thistle
#

Set a webserver up running and put its public IP in the webhook URL field on your bot's Edit page

coral trellis
#

Have you read the error?

chrome olive
#

it's the correct directory

earnest phoenix
#

hello, who have discord control panel for bots?

#

@earnest phoenix what do you mean?

#

Web based?

#

And is it for users or for the developer itself?

chrome olive
#

How can i import a custom font?
like Lobster


const applyText = (canvas, text) => {
    const ctx = canvas.getContext('2d');
    let fontSize = 70;
    do {
        ctx.font = `${fontSize -= 10}px font`;
    } while (ctx.measureText(text).width > canvas.width - 300);
    return ctx.font;
};
earnest phoenix
#

@chrome olive I'm not quite sure what lobster is but I usually include a ttf file

#

If I want Arial in Linux for my C# code I include the file name of the font

chrome olive
#

a font

#

yes

earnest phoenix
#

Yes. TTF file

chrome olive
#

no

earnest phoenix
#

What's lobster?

chrome olive
#

a font

#

but i don't have the file

earnest phoenix
#

There's usually in a font list

#

Maybe lobster-regular?

chrome olive
#

ye

earnest phoenix
#

Yeah you can download that

#

Here you go if youd want the git for it

chrome olive
#

and how i can import it?

earnest phoenix
#

What language are you using?

chrome olive
#

discord.js

#
  • javascript *
earnest phoenix
#

Are you applying the text to an image?

chrome olive
#

yes

earnest phoenix
#

So image manipulation. Okay.

#

ctx.fonttype or smth? I'm not sure what image manipulation library you'e using

#

I do for example

#

ctx.font = "Arial";

chrome olive
#

yes that works

#

60px Arial

earnest phoenix
#

Wher you choose the font type, just put Lobster in the directory

loud tinsel
#

I want to unban (banned) user with Discord.py. I can ban mentioned user with this code.
await client.ban(message.server.get_member(message.mentions[0].id),delete_message_days=0)
However i can't unban (banned) mentioned user. Because message.mentions returns empty.
await client.unban(server, client.get_user_info(message.mentions[0].id))

#

How can I solve this problem?

earnest phoenix
#

@loud tinsel use discord id?

#

I mean you can't really mention someone who is banned

loud tinsel
#

Yes

earnest phoenix
#

But they still keep the same discord id

#

Obviously

slender thistle
#

That is correct because message.mentions returns cached Member/User object

#

And since the bot shares no server with the mentioned user, .mention is an empty list

loud tinsel
#

Ok, thanks.

slender thistle
#

You should either be getting an ID from the mention or entering ID directly

#

As far as I remember, you could make that API request a discord.Object instance instead because get_user_info afaik is heavily rate-limited

loud tinsel
#

i'll do as you said

slender thistle
#

(When creating an instance of discord.Object, the only argument (probably kwarg in this case) you will need is an ID)

loud tinsel
#

I have another question.

#

I want to delete messages. I'm using this code. But I think this isn't a good way. Is there another better way?

async for msg in client.logs_from(message.channel,limit=90):
    await client.delete_message(msg)
amber fractal
loud tinsel
#

Can I use without commands?

#

with on_message function

earnest phoenix
#

guys

amber fractal
#

Purging on message would run you into rate limits

earnest phoenix
#

how do i get bot developer

quartz barn
#

@earnest phoenix Make a bot and submit it on the site + get thru the verify stage

earnest phoenix
#

oh ok

#

I just made a private bot btw

quartz barn
#

Hello,

I've added a ticket bot, but for keeping it on I need to reconnect to the MySQL database if the connection has been closed. Does anyone have an idea?

earnest phoenix
#

re open the file

quartz barn
#

The language is: Java
Library: JDA (Java Discord API)

earnest phoenix
#

oh

#

i only know python

#

@quartz barn you want to keep a mysql connection alive?

#

I'm confused

loud tinsel
#

@amber fractal I coded my bot with on_message function. Are the commands better?

quartz barn
#

Yeah, without changing the wait_timeout in the my.cnf

earnest phoenix
#

@spark comet.command()
async def a():

pallid zinc
#

Can anyone help

earnest phoenix
#

@quartz barn you should only keep it open till the query is done

pallid zinc
#

I need help

earnest phoenix
#

Have a connection string, execute the query with the string and close the connection

pallid zinc
#

My bot crashes when I use results command

earnest phoenix
#

What?

#

Result command?

pallid zinc
#

Ya

#

I will send pic

earnest phoenix
#

How in earth am i supposed to know what you mean

pallid zinc
#

Wait

earnest phoenix
#

Yeah that's a start

pallid zinc
#

Sorry for perfect English

earnest phoenix
#

Please show a picture

pallid zinc
#

I am on mobile so wait

valid linden
#

how can i get ram usage of my bot (not pc) in python?

earnest phoenix
#

why people use python

#

@valid linden what do you mean ram usage of the bot (not pc) the amount of ram used by the bot

valid linden
#

yeah ram used by bot

earnest phoenix
#
def memory_usage_psutil():
    import psutil, os
    pid = os.getpid()
    ps = psutil.Process(pid=pid)
    return (ps.memory_info().vms)```
valid linden
#

let me try

earnest phoenix
#

It doesn't return it in mb or kb, but in bits, If i'm right

#

It utilizes psutil

#

If you want it to return in kilobytes you will have to divide it by 8000

#

In mb it will be 8,000,000

#

Hope I helped 😃

valid linden
#

i divided it to 8000000 but it returned a different value than task manager if i didnt do anything wrong

earnest phoenix
#

Try by 8000 so it will be in kb

hushed berry
#

I doubt it returns in bits

earnest phoenix
#

Same. It should though

#

It wouldn't return in in kb

hushed berry
#

Bytes is usually what those kind of things return

earnest phoenix
#

Makes more sense ^^^

#

then divide it by 1,000 (kb) or 1,000,000 (mb)

valid linden
#

yeah it was byte

#

now it returns correct value

#

thanks

earnest phoenix
#

np

hushed berry
#

or just bitshift left 3

#

😎

earnest phoenix
#

discordjs is better

hushed berry
#

what

earnest phoenix
#

Hell nah

hushed berry
#

how is that relevant

earnest phoenix
#

Ye ^^

amber fractal
#

People use pythong because it's a preference

#

Stop bashing other langs

#

Kthx

earnest phoenix
#

Yeah but discordjs is easy

hushed berry
#

Wtf

#

Seriously why are you shilling for discordjs

#

How is that relevant here at all

amber fractal
#

Easy isn't always best, they can basically do the same thing with a different syntax

hushed zodiac
#

Can you tell me how to program an autorole in the jda? And if someone wants to help me with @hushed zodiac:)

hushed berry
#

Break down the problem into the 3 parts -- listen for member joins, determine which role to add, and add the role to the member

#

I'm sure you're able to fgiure out how to listen for member joins -- it's the same logic as listening for new messages

#

@hushed zodiac

junior summit
#

is this a good example of a ping command

#
if (message.author.bot) return;
if (!message.content.startsWith(prefix)) return;
if (message.content.startsWith(prefix + 'ping')) {
    message.channel.send({embed: {
        color: 0x2ed32e,
        fields: [{
            name: "Pong",
            value: "My Ping: " + Math.round(client.ping) + ' ms'
      }
     ],
}
})
}})```
restive halo
#

So I've been trying to get a purge command to work, that allowas you to filter by attachments, users or both, if that makes sense. But so far the logs I've taken have come back with collection as empty after the filters

#
} else if (!type && user){

    message.channel.fetchMessages({limit:amount}).then(messages => {
      const userMessages = messages.filter(m => m.author.id === user)

      callback(userMessages)
    })

  } else if (type && !user){

    message.channel.fetchMessages({limit:amount}).then(messages => {
      let typeMessages
      if (type == 'image' || type == 'img'){
        typeMessages = messages.filter(m => m.attachments > 0)
      } else if (type == 'bot'){
        typeMessages = messages.filter(m => m.author.bot)
      }
      console.log(typeMessages)
      callback(typeMessages)
    })

  } else if (type && user){

    message.channel.fetchMessages({limit:amount}).then(messages => {
      let specMessages

      if (type == 'image' || type == 'img'){
        specMessages = messages.filter(m => m.attachments.size > 0)
        specMessages = specMessages.filter(m => m.author.id === user)

      } else if (type == 'bot'){
        specMessages = messages.filter(m => m.author.bot)
        specMessages = specMessages.filter(m => m.author.id === user)
      }

      callback(specMessages)
    })
  }```
Sorry for the length, but thats the important part of the function
#

Been testing on just the type or user section seperately so far

edgy pulsar
restive halo
#

Haven't been able to find anything for the right thing to use for filtering the messages that contain attachments

junior summit
#

i cant find a good ping command\

#

or make one

restive halo
#

The one you're using only checks for api ping

#
else if (command == 'ping') {
    // Finds ping by checking when the 'Ping?' message is sent against when the command message was sent
    const m = await message.channel.send('Ping?');
    m.edit(`Pong! Latency is ${m.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(bot.ping)}ms`);
  }```
This is what I'm using for mine, found it on stackoverflow I believe
junior summit
#

k

#

it gives me an error

#

idk why

mossy vine
#

whats the error

zenith sentinel
#

.

junior summit
#
    at new Script (vm.js:80:7)
    at createScript (vm.js:274:10)
    at Object.runInThisContext (vm.js:326:10)
    at Module._compile (internal/modules/cjs/loader.js:664:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
mossy vine
#

oh god dont tell me you tried to just copypaste that code

junior summit
#

i didnt

#

i already has something like that

#

but i changed it

#
    message.channel.send({embed: {
        color: 0x2ed32e,
        fields: [{
            name: "Pong",
            value:  Math.round(client.ping) + ' ms'
      }
     ],
}
})
}})```
#

is this good?

restive halo
#

better to use == instead of ===

marble needle
#

whats your reasoning for that

restive halo
#

== actually worked for one

mossy vine
#

lack of javascript knowledge

marble needle
#

message.content is a string, nothing wrong with comparing types aswell

#

if you're suggesting code changes based on "it having worked somewhere else before" you should read into what you are suggesting and reconsider

restive halo
#

Well I know the difference between them, == has worked though, when I tried it with strict comp it wouldn't reply, and haven't found a use for it since

junior summit
#

i use === and it works

amber fractal
#

== is not strict, === is

restive halo
#

Yeah thats what I was saying

#

Probablt badly worded but :p

harsh nova
#

use a switch / break for better looking code

#

instead of a bunch of ifs

marble needle
#

how about writing a command handler and doing it properly instead of doing the same garbage with a different syntax thinknow

earnest phoenix
#

@restive halo === means equal to + type to

restive halo
#

Ik

earnest phoenix
#

If "command" is a string

#

It should work

#

And since it's being compared as a string I don't see a reason for it to not work

restive halo
#

Neither did I but for some reason it wouldn't

#

Got the purge command almost fully working woo

earnest phoenix
#

I mean then you did something wrong. This is coding basics. === doesn't have errors

earnest phoenix
#

hi

#

how do u do a webhook for get votes ?

#

@earnest phoenix a webhook works the way that instead of you asking the server

"Anything new?" Constantly, it will just inform you when it has something new

#

You need a web server for this

#

If you have a web server you can make something like a PHP code to get the body of each request sent to that link and handle it.

#
  • User votes
  • Website sends request to your link with nessecary information
  • Your server handles the information
#

In the case of PHP, you could use php://input which gets all the input of the request in JSON format, possibly needed for encoding (correct me if I'm wrong)

knotty steeple
#

@restive halo dont spoonfeed

#

@junior summit dont ask for code and expect to be spoonfed

restive halo
#

Aight sorry, little tired after today

knotty steeple
#

rule 7

zealous veldt
#

Neat

pseudo scroll
#

ok

#

I'm trying to use message.awaitReactions

#

for some reason it gives me the error message UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): ReferenceError: collected is not defined

#

I am trying to do it as an async function but is it normal for collected to not be defined?

blazing star
#

define collected then

pseudo scroll
#

the thing is that it is supposed to be defined already

blazing star
#

no

#

but the only way i can help you is to see your code

pseudo scroll
#
const awaitReactions = async (msg, m, options, filter) => {
    const {min, max, page, limit} = options;
    
    m.awaitReactions(filter, {max: 1, time: limit, errors: ['time'] })
    .then(async(collected => {
    const reaction = collected.first();
    console.log(reaction);
    if (reaction.emoji.name == '🇦') {
    await removeReaction(m, msg, '🇦');
        // change the page
        page = page + 1;
        await m.edit({ embed: pages[page] });
        console.log("Going 1");
    };
   
    // restart the listener 
    awaitReactions(msg, m, options, filter);
    }).catch(() => {
        console.log("OOPSIE-DAISIE, SOMETHING WENT WRONG, ", collected);
    }));
};
#

That's the part which is not getting the collected parameter

blazing star
#

hmm

pseudo scroll
#

as much as I can understand from the discord.js documentation, awaitReactions is the lite version of ReactionCollector

#

which has a parameter of collected

blazing star
#

all the await reactions function does it wait for a said amount of reactions then stop when the max limit was reached and i’m pretty sure that’s the same way the reaction collector works. that said try indenting the code inside the then function callback

#

oh

#

ic now

pseudo scroll
#

what's happening there?

blazing star
#

you have a unnecessary (

pseudo scroll
#

oh

#

Ok that's just embarassing

blazing star
#

it’s fine, i’ve been there before

pseudo scroll
#

That's what I get for coding in notepad++ GWcorbinHolyFuck

blazing star
#

I use a actual ide

pseudo scroll
#

But alright, thank you for your help!

blazing star
#

np

earnest phoenix
#

can someone here help me with eris-lavalink
i got this error

Cannot read property 'guildid' of undefined
#

dm if you can help so i can show you the code

earnest phoenix
#

Hey

zealous veldt
#

I would recommend you posting your question, with adaquete details and descriptions of what you want and what's currently happening on StackOverflow

#

or maybe just ask the creator of the article

earnest phoenix
#

Does anyone know how I can recreate a amazon alexa device that can listen for a keyword, then if the message gets executed

#

Using rapsberry pi 3 b+ headphone jack

zealous veldt
#

This is not stack overflow

earnest phoenix
#

turns out its output only

#

oh well

plain timber
#

So.. on the Discordbots.org, How do I get my bot to show how many servers are using it?

zealous veldt
plain timber
#

thanks you and my bad

zealous veldt
#

No problem :)

sharp sky
#

I have created a bot 100% dedicated to the news, any suggestions of what I could add? The news is divided into categories and regions. Is with Discord.js

earnest phoenix
#

Can it play instruments?

earnest phoenix
#

@sharp sky fortnite

delicate kettle
#

Hey

pallid zinc
#

hey

quartz barn
#

Opinion?

amber fractal
#

spammable

quartz barn
#

wdym?

amber fractal
#

what if someone does new a bunch of times and spams it

quartz barn
#

He get's spammed in his DM 😂

amber fractal
#

But wont that also spam you?

#

or wherever the ticket goes

#

wait

#

I think I dont understand

#

what it does

#

lmao

quartz barn
#

xD

#

-help -> PM's you with the commands

#

^ I should not have done that

earnest phoenix
#

a question urbansearch should be in NSFW channel?

quartz barn
amber fractal
#

@earnest phoenix urban is a nsfw command yes

earnest phoenix
#

ok thx

quartz barn
#

@amber fractal

-blacklist is also a thing 😂

#

But yeah, I'm tring to replace Tickety (Because it has been offline for a few times now)

dusky marsh
#

Hello, how host to discord bot???

west skiff
#

sell your soul

#

to a hosting company and put it up there

#

or you can run it locally really just whatever you want to do

quartz barn
#

@dusky marsh

  1. Get a hosting company that support hosting in your coding language
  2. Buy a raspberry pi or a mini computer and connect it to your internet. Then set it up so the bot works & is online.
  3. Try getting a sponser for your bot (Like have with RoyaleTickets)
dusky marsh
#

Oi I know I was hoping someone who has seen me before would get a laugh outta my question lmao, thanks for attempting to help though clapperboi

earnest phoenix
#

I use heroku

dusky marsh
#

Oof

#

Heroku is alright till you need to do something useful with your bot pepeOK

amber fractal
#

Hosting company Thonk A vps would support it in practically any language, "discord bot hosters" are a joke

dusky marsh
#

Yeye

#

I saw one yesterday and asked them about their services and they were like "yeah actually we don't host discord bots", when they were advertising it like okay buddy, I'll just stick with ovh

#

The shit is joke101

amber fractal
#

I use ovh aswell

dusky marsh
#

Yeh, they're pretty reliable as far as I'm concerned, I wanna check out digital ocean tho

#

Maybe I'll use one to host my website and then compare em that way Soundsgood

amber fractal
earnest phoenix
#

someone here was paying for 13€ "discord bot hosting" a month but it was infact a 512mb shared vps lol

#

@dusky marsh I used both

#

DO > OVH

#

And DO has AMAZING support

#

They refunded me for like 6 months of hosting service because I didnt understand something

#

(It still charges while its offline without me noticing)

queen violet
#

Finna make my own discord bot hosting service and overcharge for it

#

Ovh is probably better if you're on a budget

#

Do has better support and reliability

quartz kindle
#

Remember jonhosting?

#

Or whatever the name was

queen violet
#

Nolol

#

Sounds hq

quartz kindle
#

A while ago it was memed to death

#

Apparently its owned by someone here or a friend of someone here

candid oak
#

Discord issues anyone?

#

im getting a lot of connection reset

amber fractal
#

Who needs support if you know what you're doing tho mmLol

#

I've used ovh support once asking how I could upgrade because I couldnt see a button right in front of me

dusky marsh
#

Lmao

#

I had to ask glitch way back when how to private my project cause I couldn't use common sense and click a button

#

Smh how far we've come,,,not very far

silk creek
#

what do you think?

pallid zinc
#

Hey

sharp star
loud salmon
#

@sharp star sorry i thought it was a dev question. dm the mod that declined your bot, its in #mod-logs

sharp star
#

Ok

dusky steeple
#

can someone show me why this is return undefined with eris?

const modlog = message.channel.guild.channels.find(channel => channel.name === guildEntry.logchannel.channel);
        console.log('LOG CHANNEL: ' + modlog);```
junior summit
#

it gives me this error

#
    at Client.<anonymous> (C:\Users\chill\Desktop\chill\discord-bot\bot.js:109:44)
    at Client.emit (events.js:189:13)
    at MessageCreateHandler.handle (C:\Users\chill\Desktop\chill\discord-bot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\chill\Desktop\chill\discord-bot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (C:\Users\chill\Desktop\chill\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (C:\Users\chill\Desktop\chill\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
    at WebSocket.onMessage (C:\Users\chill\Desktop\chill\discord-bot\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:189:13)
    at Receiver._receiver.onmessage (C:\Users\chill\Desktop\chill\discord-bot\node_modules\ws\lib\websocket.js:137:47)
    at Receiver.dataMessage (C:\Users\chill\Desktop\chill\discord-bot\node_modules\ws\lib\receiver.js:409:14)
(node:6052) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6052) [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.
#

😦

arctic mountain
#

Hey I made my bot run on Heroku now to be online 24/7, do I really need to write the whole bot metadata again?

#

After it was declined

amber fractal
#

Tip save your long description.

#

@junior summit you need to tell us what you're trying to do, just the error isnt enough in your case

#

But with what I have, the thing before a user property is undefined

vapid rune
#

man like @sharp star coding on mobile

#

android too nice

#

@arctic mountain yes cause i did

jaunty stump
#

I could use some help

#

Does my bot have to be in this DBL server in order for it to show how many servers it's in?
I have added the

client.on('ready', () => {
        setInterval(() => {
            dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
        }, 1800000);```

code and it still doesn't show how many servers it is in on the DBL website like the other bots I see on there

(Yes I have installed the dblapi.js npm stuff and put the my bots dbl token in my code aswell and const DBL = require("dblapi.js"); into my code aswell...I am confused
dusky marsh
#

Your bot being in this server just shows whether or not it's online I think

lofty hamlet
#

Hello, I have a problem my lag music feature on my bot, sometimes the music stops and lag for a few tens seconds

#

Do you have a solution ?

marble needle
#

if you define the module as DBL you're supposed to access it with DBL aswell instead of dbl

dusky marsh
#

How are ya hosting @lofty hamlet

lofty hamlet
#

On my VPS

dusky marsh
#

Is it a decent one

#

Music hosting can be intensive

lofty hamlet
#

I have been there for 2 years

dusky marsh
#

Ihhh the basic plan looks like it could support a music bot in at least a few servers

#

Tho I can't guage just how intensive music bot hosting is as I've not done it yet, I've just heard it is

#

Compared to other things at least

lofty hamlet
#

Ok ok beecause i have 600 servers ^^'

#

Thanks you

dusky marsh
#

Oh yeah yeah yeah if you have that many you need more than the basic plan for a music bot

vapid rune
#

imagine if every music bot was on heroku

#

would be rip heroku

dusky marsh
#

Heroku is too aids for that lmao

#

It can handle like

lofty hamlet
#

I have a vps 20 dollars

#

...

#

:/

#

It's strange

#

Heroku 😂

vapid rune
#

im using it cause its free

lofty hamlet
#

Hu ok ok

#

RIP you ❤

vapid rune
#

is it bad in any way?

lofty hamlet
#

Heroku is so bad

dusky marsh
#

It just isn't good for anything other than a barebones bot

vapid rune
#

not even currency dbs?

dusky marsh
#

If your bot has to do much more than just responding, you're better off paying like 2 bucks for a cheap vps

#

No

vapid rune
#

wtf thats weak

#

but its free so i guess that's what i get

dusky marsh
#

Their persistent db in the free tier can only use 10000 rows

#

Which is nothing

vapid rune
#

oof

dusky marsh
#

Ye

jaunty stump
#

@marble needle that didn't work either

dusky marsh
#

What does your entire code look like now

#

Well the code for the stat posting I mean

jaunty stump
#

@dusky marsh

const DBL = require("dblapi.js");
const dbl = new DBL('My DBL Token Here', client);

dbl.getStats("537126219095736351").then(stats => {
    console.log(stats) // {"server_count":2,"shards":[]}
});

dbl.getBot("537126219095736351").then(bot => {
    console.log(bot.username) // "RaidX"
});

dbl.getUser("254148960510279683").then(user => {
    console.log(user.username) // "Ori"
});

// Optional events
dbl.on('posted', () => {
    console.log('Server count posted!');
  })
  
  dbl.on('error', e => {
   console.log(`Oops! ${e}`);
  });

client.on("error", () => {});
console.log(' Bot Is Online')
console.log('╚[════════════]╝')
console.log('')
client.on('ready', () => {
        setInterval(() => {
            DBL.postStats(client.guilds.size, client.shards.Id, client.shards.total);
        }, 1800000);
  console.log('Logged in as: ' + client.user.username + ' - (' + client.user.id + ')');
  client.user.setPresence({ game: {name: "-vote | -help | -invite", type: 0 } });
  client.user.setStatus("Online");
});```
#

My DBL token is there in the code, just not here in the post

dusky marsh
#

So it's just not posting?

jaunty stump
#

No, My bot comes online and works fine. I go to the DBL website and refresh the page over and over again but still nothing

dusky marsh
#

Ah I see, I think it's limited to update every fifteen minutes or something

#

Then again

#

That's what you got your time at yeh?

jaunty stump
#

It should be that, yea

#

probably 30 min

dusky marsh
#

I don't remember, but does setInterval run the first time? Or does it do the time the first time as well and then run

marble needle
#

nvm seeing your code you should change it back to dbl.postStats since you defined the dbl client itself as dbl

dusky marsh
#

I haven't been coding for like a week so I'm forgetting a tad lmao

jaunty stump
#

I don't know as I am still new to this kind of stuff

#

and I did @marble needle

#

I will wait like 15 min, refresh and see what happens

dusky marsh
#

Try putting the code outside of the jnterval and rjn

#

Run it*

marble needle
#

setInterval doesnt execute until the timer ran through once

dusky marsh
#

Yup

jaunty stump
#

ok, I'll wait and let you guys know if something happened

dusky marsh
#

Kk

jaunty stump
#

thanks

junior summit
#

is there a way to see when people add your bot to there server in cosole?

jaunty stump
#

yes

junior summit
#

and to list all the servers it is in when u first open it up

#

how

jaunty stump
#

that second part idk

junior summit
#

like with what library

marble needle
#

there's an event for your client joining a server

junior summit
#

and also voting

dusky marsh
#

The dbl API has documentation on the website

#

It has all the events listed there

lofty hamlet
#

Hi i have an other problem why this line does not work ? : if (achievement1.includes(".")) return message.channel.send("Erreur :Croix: : `Vous devez rentrer des chiffres ou un nombre entiés`")

achievement1 is equal:

            var achievement1 = Number(args.join(""))```
dusky marsh
#

What's the number function

quartz kindle
#

.includes() does work on numbers

#

Its for strings and arrays

lofty hamlet
#

@quartz kindle How can I do ?

#

Or canadaro

dusky marsh
#

you have to use the includes method on a string or an array

#

and you are using it on an integer

amber fractal
#

You could just round it, or convert it to a string, which may not be good practice

lofty hamlet
#

Hum ok

#

Canarado i have don't understand '-'

quartz kindle
#

First say what do you want to do

#

You want to find if the number has decimals?

lofty hamlet
#

Yep

jaunty stump
#
    ^

TypeError: DBL.postStats is not a function
    at Timeout.setInterval [as _onTimeout] (C:\Users\Ori\OneDrive\Desktop\RaidX\RaidX.js:72:17)
    at ontimeout (timers.js:424:11)
    at tryOnTimeout (timers.js:288:5)
    at listOnTimeout (timers.js:251:5)
    at Timer.processTimers (timers.js:211:10)

C:\Users\Ori\OneDrive\Desktop\RaidX>pause
Press any key to continue . . .```

This is what I am getting now
lofty hamlet
#

dbl.postStats @jaunty stump

jaunty stump
#

Ah

#

I feel dumb now

#

thanks

#

this never happened x3

lofty hamlet
#

😉

#

I have find tim the function is isInteger

quartz kindle
#

Yes, you can use that

jaunty stump
#
C:\Users\Ori\OneDrive\Desktop\RaidX\RaidX.js:72            dbl.postStats(client.guilds.size, client.shards.id, client.shards.total);
                                                            ^

TypeError: Cannot read property 'id' of undefined    at Timeout.setInterval [as _onTimeout] (C:\Users\Ori\OneDrive\Desktop\RaidX\RaidX.js:72:61)
    at ontimeout (timers.js:424:11)
    at tryOnTimeout (timers.js:288:5)
    at listOnTimeout (timers.js:251:5)
    at Timer.processTimers (timers.js:211:10)

C:\Users\Ori\OneDrive\Desktop\RaidX>pause
Press any key to continue . . .```
#

This upsets me. I will try just the client.guilds.size this time

hushed berry
#

wut

#

thats not where the error is

jaunty stump
#

the spacing on discord is bad

hushed berry
#

It says it can't read property "id" of undefined

inner jewel
#

yes, that's why This upsets me. I will try just the client.guilds.size this time

hushed berry
#

oh isee

inner jewel
#

which would fix

hushed berry
#

my bad

#

i see now

jaunty stump
#

Now to wait 15min again

jaunty stump
#

oh wow, 117 servers it is in

#

nice

haughty jewel
#

is the ready event dispatched after all guilds have loaded?

#

or is there a way to check if all the guilds have loaded

amber fractal
#

It's safe to say that if the bot is ready, then you can do what you want with the client

quartz kindle
#

The ready event is fird after all guilds are loaded

#

But guilds also have an individual availability check, that you can use to see if a guild is available, in case of outages for example

restive halo
#

So like the amount of servers it's in?

#

Also what language

#

Ah, will have to wait for someone who's used that before :p

ruby dust
#

im here, what's up

#

what's your code

#

len(bot.guilds) is what will get an int value representing the length of the list

#

is that what you need?

#

hm

#

np

#

that was also basic python

#

maybe read up the docs a bit

junior summit
#

message.guild.me.voiceChannel.connect();

#

should i use that to connect

#

to a channe;

jagged birch
#

Yes

junior summit
#

k

earnest phoenix
#

HOW DARE YOU

#

PING

#

UBER

junior summit
#

lol

bright spear
junior summit
#

imma call uber

#

jk

#

also thanks

bright spear
#

lol

#

that happens (in js too)

amber fractal
#

@earnest phoenix get ponged nerd

#

Wait

#

Wrong chat rip mmLol

earnest phoenix
pallid zinc
#

HeyGWqlabsWtf

pallid zinc
#

I need a 10$ vps

#

Any suggestion

earnest phoenix
#

If u dont care about locatiob

#

Pulseheberg offers cheapest price to pefformance i know of

#

Ovh if u want a na host

pallid zinc
#

I want to host my bot

#

I think I should buy a Raspberry Pi instead of VPS

earnest phoenix
#

Only thing is just make sure ur internet speeds

#

Can handle it

pallid zinc
#

Yup

#

My internet speed is 50mbps

#

Is it enough

stable tide
#

live*

#

More than enough @pallid zinc

pallid zinc
#

Ok

stable tide
#

Unless tu koi music features

#

Nai daalya

#

off english

pallid zinc
#

Ok

#

Bhai

stable tide
#

Until You add some music features*

pallid zinc
#

No music

stable tide
#

Then its ok

#

I host my bot on ma raspberry pi, 15mbps

jagged birch
#

YouTube

sinful lotus
#

if your code is copy paste

#

and you dont understand why it doesnt work

#

thats a first blobstop because you cant create a bot if you dont know how to debug basic issues

boreal crane
#

I already have my own bot in my server

sinful lotus
#

yes but do it have any code in it?

#

running a simple bot is the most basic

#

and you said you are in iphone

#

so it means your bot has no server

#

you need to pay monthly for a server or use glitch but I dont recommend glitch or any other free hosting service because in my opinion, why even bother to create a bot that you cant sustain

#

but if you want to push through despite of my warnings you can either use python or javascript

#

both are easy for beginners

pallid zinc
#

having isuses with sqlite

jagged birch
#

You do realise we can’t help you if you don’t tell us what the issue is

pallid zinc
#

I don't want to install

jagged birch
#

?

bright spear
#

@pallid zinc thats not really helping...

#

send detailed information, your code, and the error message if there is one

merry ore
bright spear
#

what did you run?

whole harness
#

p tags and h1 tags are highlighted, but h2 aren't

At least not the first one
Just the first headline tag is higlighted

Could someone help me?

#

On the website

#
<style>
    h1 {
          color: 0x4C4A48
      }
    h2 {
          color: 0x4C4A48
      }
      p {
          color: 0x4C4A48
      }
      li {
          color: 0x4C4A48
      }
</style>
<html>
<h1>MemberCounter</h1>

<p>MemberCounter is a simple Discord Bot that shows the current amount of members on a guild as its nickname on this guild.</p>

<h2>Best way to use it</h2>

<p>The best way to use it is to set MemberCounters role at top of all roles or at least over the Member role or whatever you have. Then set it as hoisted an you will right away see how many members your server has.</p>

<h1>Commands</h2>

<ul>
<li><code>%help</code>: Shows a help how to correctly set MemberCounter up and a list of all commands.</li>

<li><code>%update</code>: When you believe MemberCounters nickname isn't showing the correct amount of member because of a downtime or whatever, use this command to update its nickname.</li>

<li><code>%invite</code>: Shows the link to invite me to your server and the invite link to my support server.</li>

<li><code>%stats</code>: Shows the bots stats on discordbots.org.</li>

<li><code>%config</code>: Configure the bot to your wishes.</li>
</ul>

<h2>Links</h2>

<ul>
<li>MemberCounters invite: https://discordapp.com/api/oauth2/authorize?client_id=448845486515027970&amp;permissions=67110912&amp;scope=bot</li>

<li>MemberCounters official support discord server: bla bla</li>
</ul>
</html>```
jagged birch
#

Should still work I remember it happening on my bots desc too @whole harness

trim saddle
#

@ruby dust c'mere

ruby dust
#

hm?

trim saddle
jagged birch
#

Read it

#

u can’t .lower it

ruby dust
#

you are trying to .lower the command object?

trim saddle
#

i never tried to .lower() any commands

#

lemme get the full error

#
  File "/home/skullbite/.local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 64, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/skullbite/yoshi/cogs/owner.py", line 79, in reload
    self.yosh.load_extension("cogs." + cog_name)
  File "/home/skullbite/.local/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 618, in load_extension
    lib.setup(self)
  File "/home/skullbite/yoshi/cogs/info.py", line 100, in setup
    yosh.add_cog(Info(yosh))
  File "/home/skullbite/.local/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 545, in add_cog
    cog = cog._inject(self)
  File "/home/skullbite/.local/lib/python3.6/site-packages/discord/ext/commands/cog.py", line 330, in _inject
    bot.remove_command(to_undo)
  File "/home/skullbite/.local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 986, in remove_command
    command = self.all_commands.pop(name, None)
  File "/home/skullbite/.local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 102, in pop
    return super().pop(k.lower(), default)
AttributeError: 'Command' object has no attribute 'lower'
ruby dust
#

bot.remove_command(to_undo) what's this?

trim saddle
#

something in the d.py module

ruby dust
#

is to_undo a command?

trim saddle
#

i don't control its argument

ruby dust
#

the only things I see here are either reload or setup

slender thistle
#

Using .lower() on Command won't cast that method on Command.name magically

trim saddle
#

except if i had did that

#

it would be refering to a line

#

i never did it

slender thistle
#

Send your reload command please?

trim saddle
#
@commands.command(aliases=["re"])
    @commands.check(checks.is_owner)
    async def reload(self, ctx, cog_name):

        try:
            loaded = discord.Embed(color=0x3bc600)
            loaded.set_author(name=f"Successfully reloaded {cog_name}", icon_url="https://cdn.discordapp.com/emojis/488791107170205707.png?v=1")
            self.yosh.unload_extension("cogs." + cog_name)
            self.yosh.load_extension("cogs." + cog_name)
            await ctx.send(embed=loaded)
        except Exception as e:
            failed = discord.Embed(description=f"**Reason:**\n\`\`\`diff\n- {e}\`\`\`", color=0xc61e00)
            failed.set_author(name=f"Failed to reload {cog_name}", icon_url="https://cdn.discordapp.com/emojis/488791367590608915.png?v=1")
            await ctx.send(embed=failed)
#

wew

#

jesus

#

i give up

slender thistle
#

Well, that's a shame

trim saddle
#

theres the code

#

i think i should rewrite my info cog

slender thistle
#

concat + formatting not_ok_hand

trim saddle
#

so

#

after removing the custom help

#

thinking that was the issue

#
ClientException
Command info is already registered.

Couldn't load info
#

i think im being toyed with.

slender thistle
#

Btw it's supposed to be is_owner() in the check

#

Unless you actually made it a property instead

trim saddle
#

it checks for 2 owners

#

so i made my own

slender thistle
#

Is it a method/function in checks file

trim saddle
#

yes

slender thistle
#

()

#

Apart from that, I can't see anything wrong

trim saddle
#

turns out theres two info commands thonkku

#

one in my music cog..

#

maybe if i remove it it'll load properly

slender thistle
#

Maybe

trim saddle
#

mmmmmaaaybe.

#

well

#

my info cog loaded

#

but my lavalink refuses to connect

#

i'll deal with that later

coral trellis
rugged linden
#

Is there a way to get rid of this message? I've hooked up the commands to some big function, but it still says this if you ping it or do it in dm even if the command is correct. Unknown command. Use keplerbot! help or @The Kepler Bot#1179 help to view the list of all commands.

#

I had to change the commandPrefix to something else but the default was kb!

#

Thanks for helping if you do

quartz kindle
#

Didnt see it in that file, perhaps its in another file?

rugged linden
#

I've checked everywhere

quartz kindle
#

Its a commando thing

#

Check the commando docs, there should be an option somewhere to disable default command and unknown command warnings

#

But from what i can see, youre not even using commando

#

So just remove it lul

rugged linden
#

Okay

#

Oh wow it worked

#

I'm a dummy :D

#

Also the part where the bot could trigger the kepler bot has been fixed! :D

whole harness
mossy vine
#

maybe because you dont have a <body> tag?

#

or do you not need that on the site?

whole harness
#

Oh thats right

#

I'll try that

#

Nope

#

Still the same

rugged linden
#

Maybe you have to have a head and body tag in the rightful positions

#

I'll try and test out your code

#

Works fine as far as I know

#

It's probably just a glitch

#

However I'd use the <a href="link here">text goes in here</a> tag so people can just click the link and go there.

naive gull
#

Can’t some give the code for discord.py for server count thing?

arctic mountain
#

@vapid rune why you pinged me

#

len(self.bot.guilds) @naive gull

naive gull
#

Ik how get server count lol

arctic mountain
#

Oh what

naive gull
#

But how on the page

slender thistle
#

HTTP request with aiohttp to an API endpoint with Authorization and Content-Type headers

#

I would've suggested dblpy if it hadn't been outdated

naive gull
#

Ooh it’s outdated?

#

Thanks!

slender thistle
#

Yeah, it kinda is

rugged linden
#

Oof

slender thistle
#

It works, though

naive gull
rugged linden
#

Hey is it possible I could get what he asked but its in discord.js? (not on the website)

#

Like it would display the amount of servers The Kepler Bot is in.

slender thistle
naive gull
arctic mountain
#

Lol

#

you need wait_until_ready yes

naive gull
#

I think it is is_ready()

slender thistle
#

is_ready() only returns the bot's state

#

aka if it's ready, returns True, else False

#

It doesn't wait until all of your guilds are loaded

naive gull
#

Ye on_ready()

#

Oh

rugged linden
#

I think it worked

#

I didn't know The Kepler Bot was on ten servers

#

Lemme count

naive gull
#

Lmao

#

Maybe make a count command

rugged linden
#

Seems like the bot is on four other servers that I am not on :D

naive gull
#

Oof

rugged linden
#

Oof

#

Sorry

naive gull
#

Wut

rugged linden
#

Were you talking to me?

naive gull
#

I think

rugged linden
#

I have one more question

#

Is there a way to get the user that votes for my bot?

slender thistle
#

Webhooks

#

js has that thing in the docs somewhere

rugged linden
#

I'll take a look

slender thistle
rugged linden
#

thanks

whole harness
#

I don't have one

quartz kindle
#

@whole harness what problem are you having?

#

It doesnt matter if its highlighted or not, if it works it works. Also, remove the <html> tags

whole harness
#

It isn't working at all

#

Should bot tags also be removed?

#

@quartz kindle

quartz kindle
#

Its the long description in the website, right?

whole harness
#

Yes

quartz kindle
#

The html tag is useless there because this is not a new page, its injected into an existing page

rugged linden
quartz kindle
#

Same with your css, you have to adapt it to dbls existing css

#

Your bots public url/ip address

whole harness
#

Is that correct?

#
<style>
    h1 {
          color: 0x4C4A48
      }
    h2 {
          color: 0x4C4A48
      }
      p {
          color: 0x4C4A48
      }
      li {
          color: 0x4C4A48
      }
</style>
<h1>MemberCounter</h1>

<p>MemberCounter is a simple Discord Bot that shows the current amount of members on a guild as its nickname on this guild.</p>

<h2>Best way to use it</h2>

<p>The best way to use it is to set MemberCounters role at top of all roles or at least over the Member role or whatever you have. Then set it as hoisted an you will right away see how many members your server has.</p>

<h1>Commands</h2>

<ul>
<li><code>%help</code>: Shows a help how to correctly set MemberCounter up and a list of all commands.</li>

<li><code>%update</code>: When you believe MemberCounters nickname isn't showing the correct amount of member because of a downtime or whatever, use this command to update its nickname.</li>

<li><code>%invite</code>: Shows the link to invite MemberCounter to your server and the invite link to MemberCounters support server.</li>

<li><code>%stats</code>: Shows the bots stats on discordbots.org.</li>

<li><code>%config</code>: Configure the bot to your wishes.</li>
</ul>

<h2>Links</h2>

<ul>
<li>MemberCounters invite: https://discordapp.com/api/oauth2/authorize?client_id=blaBla&amp;permissions=67110912&amp;scope=bot</li>

<li>MemberCounters official support discord server: https://discord.gg/blaBla</li>
</ul>```
quartz kindle
#

I dont know if css supports 0x color codes. Css uses hexadecimal colors like this: #4c4a48

whole harness
#

Oh okay

#

I'll try hat

quartz kindle
#

Also, as i said, your css should be adapted to dbls page

whole harness
#

How to do that?

quartz kindle
#

Google css specificity

#

And use the element inspector / F12 tools

whole harness
#

It is in a div

#

So basically div in div in div and so on

#

I just wanted to change that because h2 headers are as white as the bg

quartz kindle
#

Exactly

#

So your css should respect the existing structure

whole harness
#

I put #content in front of it but still no success

quartz kindle
#

Whats the existing css as it appears in the inspector?

#

The css that makes it white

whole harness
#

It actually has my style in it

quartz kindle
#

The css part, not the html part

#

Select an h2 line, and check the right side

whole harness
#

Okay

#

These two

quartz kindle
#

Nope, the previous one

whole harness
#

Huh?

quartz kindle
#

.content h2

#

Coming from darktheme.css

whole harness
#

Oh

#

Can I change that?

quartz kindle
#

Its using an !important

whole harness
#

Oh when I change to white theme everything is alright

quartz kindle
#

Then only way to change it is to equalize its specificity

#

So you should use .content h2

#

And use !important

#

I g2g bye

whole harness
#

I don't know how xD

#

Bye 👋

#

And thanks for your help

lofty hamlet
#

Hello, how can I rank this? : I can not do it:

#

{"488467274878156831":{"XP":640,"Level":9,"Dresseurs":6},"484463405961314308":{"XP":0,"Level":1,"Dresseurs":0},"493025435769372682":{"XP":970,"Level":16,"Dresseurs":174},"486217297162141697":{"XP":20,"Level":1,"Dresseurs":1},"467020854673408030":{"XP":30,"Level":1,"Dresseurs":0},"410799046957989888":{"XP":0,"Level":1,"Dresseurs":1},"110373943822540800":{"XP":0,"Level":1,"Dresseurs":3},"455334173906042896":{"XP":0,"Level":1,"Dresseurs":0},"454933217666007052":{"XP":0,"Level":1,"Dresseurs":0},"465658764838699024":{"XP":0,"Level":1,"Dresseurs":0},"478933804313083905":{"XP":0,"Level":1,"Dresseurs":0},"493431224308858910":{"XP":0,"Level":1,"Dresseurs":0},"385843081280225292":{"XP":0,"Level":1,"Dresseurs":0},"434377041832443915":{"XP":0,"Level":1,"Dresseurs":0},"487935513861292033":{"XP":0,"Level":1,"Dresseurs":0},"416387066201374722":{"XP":0,"Level":1,"Dresseurs":0},"480808248879087657":{"XP":0,"Level":1,"Dresseurs":0},"333949691962195969":{"XP":0,"Level":1,"Dresseurs":0},"394164554847748096":{"XP":0,"Level":1,"Dresseurs":0},"463739847765524491":{"XP":0,"Level":1,"Dresseurs":1},"264445053596991498":{"XP":0,"Level":1,"Dresseurs":0},"478359319864410123":{"XP":30,"Level":1,"Dresseurs":2},"481017497009520670":{"XP":0,"Level":1,"Dresseurs":0},"465919746567700481":{"XP":0,"Level":1,"Dresseurs":1},"480384189900783616":{"XP":0,"Level":1,"Dresseurs":0},"493509406567432202":{"XP":0,"Level":1,"Dresseurs":0},"455828803499851799":{"XP":0,"Level":1,"Dresseurs":0},"387304030390583296":{"XP":0,"Level":1,"Dresseurs":0},"427409812112932864":{"XP":0,"Level":1,"Dresseurs":0},"493558216051916810":{"XP":0,"Level":1,"Dresseurs":0},"493185545783214081":{"XP":0,"Level":1,"Dresseurs":0}}

quartz kindle
#

Objects cant be sorted, you have to create an array from it

#

You can use Object.keys() or Object.entries() for example

earnest phoenix
#
botumus.autheniticatus()
botumus.onlinus()
lofty hamlet
#

Hum '-'

#

Just make a rank of level @quartz kindle

amber fractal
#

Google "How to sort objects javascript"

lofty hamlet
#

Yep yep

abstract quarry
#

how to make a prefix

#

for your discord bot

#

im using the embed and commando

#

in nodejs

#

i have like this

#

How do I make database I have no clue. Im using visual studio code and programming in nodejs

unreal rampart
#

You can use a google spreadsheet as a simple database

#

here is a simple tutorial on how to make one yourself

dusky marsh
#

Pls for the love of God no

#

Use something like sqlite

amber fractal
#

Wait wtf

grim aspen
#

that's python, no. he said he was using nodejs

earnest phoenix
#

using spreadsheets as a database bloblul

dusky marsh
#

I can't wait for the day that someone comes in here asking for help on an Excel spreadsheet db

#

I would be able to die without regrets if I saw that

quartz kindle
#

excel db lmfao

#

i mean... it works

#

but performance is probably terrible

dusky marsh
#

I can't find anything on the interaction limit or anything in a Excel spreadsheet, but definitely gotta imagine it runs like shit

#

I just noticed the person who asked a question was using commando smh we should've been suggesting the spreadsheets this whole time pepeOK

earnest phoenix
#

i meane

#

if you store to cache and write every so often

#

it would run fine until you got a bigger data set

#

it would slowly get slower and slower to write

quartz kindle
#

what about read speed though?

earnest phoenix
#

i mean you read once on startup

#

and store to cache

#

and thats it

#

i would imagine

quartz kindle
#

ah, if you use it like that yeah

earnest phoenix
#

thats like

#

the only viable

#

way

#

to do spreadsheet database xD

quartz kindle
#

then it wont matter much, since you can always offset writes to background, since you dont need to wait for them in most cases

#

its the same way i use json

earnest phoenix
#

i never write to json anymore

#

before i knew about databases i sed json files as database

#

and oh my god

#

the stability and such

#

bad choice

#

now if i have anything that changes i store on mongodb

#

and static values like settings tokens etc etc

#

i store in json

quartz kindle
#

my bot still runs on json, and its stable as a rock

#

but im gonna switch to sqlite when i can

rugged linden
#

I have no idea why but my bot is restarting every 15-30 minutes

earnest phoenix
#

are you using free hosting

rugged linden
earnest phoenix
#

there's your problem

rugged linden
#

And using pingerbot to ping it every 5 minutes

earnest phoenix
#

don't use free hosting and the problem'll go away

mossy vine
#

"pingerbot"

earnest phoenix
#

i dont expect much from cheapskaters lol

rugged linden
#

Wait not pingerbot

#

uptimerobot

#

It's done that for a while even without Glitch.com hosting

earnest phoenix
#

i told you, don't use free hosting, it's probably the root of your problem

rugged linden
#

It's even done that when I selfhosted it

earnest phoenix
#

unstable connection

unreal rampart
#

I need some help with something

earnest phoenix
#

usually means your internet is not strong enough to handle the websocket connection so it breaks

rugged linden
#

Ouch

#

Hmm

#

I'll get someone else to host it then perhaps

unique nimbus
unreal rampart
#

i converted my bot to work in cogs, but now when i run commands, i get an error saying that ctx is required argument that is missing

#

here is my code

unique nimbus
#
class AdminCog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
#

Have you classed it

#

(commands.Cog) is new in the recent update

unreal rampart
#

i have classed it yeah

#

but i dont have commands.Cog in

unique nimbus
#

add that in

#

and try again

unreal rampart
#

i get an error

unique nimbus
#

what errpr

#

error

unreal rampart
#

['chat', 'music', 'channel', 'member'] cannot be loaded. [module 'discord.ext.commands' has no attribute 'Cog']

unique nimbus
#

have you done it to the other cogs also?

unreal rampart
#

good idea

#

lmao

unique nimbus
#

yes

unreal rampart
#

just did, now i get the error 4 times

unique nimbus
unreal rampart
#

with pip?

unique nimbus
#

ye

unreal rampart
#

do you know the command?

unique nimbus
#

gimme a sec

#

Computer just had a stroke

quartz kindle
#

@rugged linden add a handler to the error event

#

client.on("error", do something)

unique nimbus
#

pip install -U https://github.com/Rapptz/discord.py/archive/rewrite.zip#egg=discord.py[voice]
@unreal rampart

unreal rampart
#

Thanks

unique nimbus
#

tell me if it updated

unreal rampart
#

it is updating rn

unique nimbus
#

okay dokie

rugged linden
#

Hmm I'll try that

unreal rampart
#

wait

rugged linden
#

Like what Tim said

unique nimbus
#

what

unreal rampart
#

no access to c:\

unique nimbus
#

wat

unreal rampart
#

Could not install packages due to an EnvironmentError

unique nimbus
#

run cmd as administrator

#

command prompt

unreal rampart
#

its all good

#

i just added --user to the command

unique nimbus
#

Try to run it now

#

ok

unreal rampart
#

same

unique nimbus
#

same

unreal rampart
#

['chat', 'music', 'channel', 'member'] cannot be loaded. [module 'discord' has no attribute 'Channel']

#

but now only twice

unique nimbus
#

what

#

wait was you originally on rewrite

#

or whatever 0.16.4 was called

unreal rampart
#

i was not on rewrite i think

unique nimbus
#

oof

#

have you imported everything correctly

unreal rampart
#

believe i have

unique nimbus
#
class AdminCog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        bot.remove_command("help")

    @commands.command()
    @commands.has_permissions(kick_members=True)
    async def kick(self, ctx, userName: discord.User):
        await ctx.guild.kick(userName)
        embed = discord.Embed(title= "Kicked Successfully!", description= f'{userName.mention} was kicked successfully!'
                              , color = 0xFFFFF)
        await ctx.send(embed = embed)
#

This is an example

#

is yours like this

#

this is in a cog called "admin"

unreal rampart
#

i found the problem i think

#

now discord.Server

#

and discord.Channel doesnt work

unique nimbus
#

ye

#

does it work now?

unreal rampart
#

no, cause i need discrod.Server and discord.Channel for some commands

#

bot.add_roles doesnt work either

unreal rampart
#

beofre when i would do (ctx, channel: discord.Channel) f.ex what would i have to do now?

dusky marsh
#

Does anyone know if the sqlite3 node module has support for row_number? Im finna be pissed if it dont

#

cause if it does, i sure cant figure it out

eager rivet
#

my daily command isnt working =[

#
@client.command(pass_context=True)
@commands.cooldown(1, 86400, BucketType.user)
async def daily(ctx):
    users = json.load(open('currency.json', 'r'))
    users[ctx.message.author.id]['money'] += 100
    with open('currency.json', 'w') as f:
        json.dump(users, f)
    await client.say("You recived 100 E-Coins :ECoin:")```
#

anyone know why?

jolly ridge
#

Hi

#

What kind of code is this?

amber fractal
#

That's python

jolly ridge
#

oh...

#

Then nvm.

eager rivet
#

...

slender thistle
#

Why are you opening a file twice

eager rivet
#

what are you suggesting

#

./..

slender thistle
#

Try json.loads instead

eager rivet
#

ok

slender thistle
#

I also suggest doing your stuff under that context manager instead

#

r+ will be read and write mode

eager rivet
#

@slender thistle what do you want me to replace it with