#development

1 messages · Page 652 of 1

quartz kindle
#

for example commandcooldown.add("command5_"+message.author.id)

#

also, you have to first check what kind of command was executed

#

you cant check if cooldown for command 5 exists if you dont even know yet if its really command 5

#

so your structure should look like this on message -> check if its not a bot -> check if channel is correct -> check which command it is -> check cooldown according to which command it is -> do the command

#

you should not use ```on message
-> something

on message
-> something else```

#

checking of which command it is should always come after, because why bother checking if the channel is wrong anyway?

#

unless you have different channels for different commands

earnest phoenix
#

@earnest phoenix What exactly do you want?

wheat jolt
drowsy sentinel
#

cause msg.delete() targets the bot's message?

wheat jolt
#

no

earnest phoenix
#

in the () after msg.delete must specify which user

#

example

wheat jolt
#

what

earnest phoenix
#

msg.delete(message.author)

drowsy sentinel
#

I'm sorry, what are you trying to do?

earnest phoenix
#

or other

wheat jolt
#

that is for time

earnest phoenix
#

it's up to you

wheat jolt
#

msg.delete(5000) - it deletes the msg in 5 seconds

earnest phoenix
#

uh k

wheat jolt
#

msg is my message from bot.on('message...

earnest phoenix
#

.then

drowsy sentinel
#

Oh, I see what you're doing.

wheat jolt
#

I tried like this too

earnest phoenix
#

.then(del => del.delete(5000));

#

put her after the message to delete

wheat jolt
#

thx but it doesn't help

mossy vine
#

how would that help lol

wheat jolt
#

yes

mossy vine
#

what are you trying to do

wheat jolt
#

counting system

#

it reads the last message from the channel

#

then checks if the sent message is bigger than the last one with 1

#

if not, it deletes the sent message

quartz kindle
#

you need to put your entire logic into the promise response. lastNum is undefined outside of it

#

or use await instead of .then()

#

since you're using an async function

wheat jolt
#

ah

quartz kindle
#
let messages = await msg.channel.fetchMessages(...)
let lastNum = parseInt(messages.first().content) + 1```
wheat jolt
#

still doesn't work ablobthinking

quartz kindle
#

console.log(lastNum,msgNum)

#

also, channel checking should be done first, else you're doing unneeded operations when you get messages from other channels

wheat jolt
#

how I can get the second fetched message?

#

then

quartz kindle
#

increase the message limit to 2, then if you have only two, you can use .first and .last lul

wheat jolt
quartz kindle
#

unless you mean something else

wheat jolt
#

finally

#

thanks

sinful lotus
#

also last num will be null there

#

async execution

#

¯_(ツ)_/¯

lusty dew
#

How could I do something like

#

-help <commandname>

#

oof didn't mean for that to happen

#

-help <commandname>

twilit rapids
#

what lib

wheat flame
#

@spare goblet Okay, so let me explain the bot. When a command doesn't work, it's probably something to do with the arguments. Arguments can be seen with /help. The bot doesn't collect data anymore. Errors are not sent in chat, so you don't know when it breaks.

#

If something goes wrong, DM me.

spare goblet
#

@wheat flame This chat is for chatting about development and not bot declines, you can pop into my DMs if you want to discuss the decline

wheat flame
#

Okay.

#

Anyway keep that explanation in mind.

lusty dew
#

@twilit rapids JS

#
    client.loadCommands = (callback) => {
        client.commands = {};
        fs.readdir('./commands/', (err, files) => {
            if (err) {
                client.log(`Error loading commands : ${err}`);
                return;
            }
            files.forEach(file => {
                require(`../commands/${file}`).load(client);
            });
            // console.log(Object.values(client.commands))
            callback();
        });
    };
#

Just so you know

#

that is how I load commands

twilit rapids
#

You probably have args defined somewhere

lusty dew
#

Yea

#

Ofc I do

twilit rapids
#

then use those

lusty dew
#

How else would I get what the person says

#

👀

twilit rapids
#

use args

lusty dew
#

Lmao

#

Okay

gritty pike
#

any idea how to use multiple command prefix, like 'lr>' or 'LR>' or 'Lr>', using python 3.7

slender thistle
gritty pike
#

yes

slender thistle
#

commands extension?

gritty pike
#

how?

slender thistle
#

Are you using the commands extension or on_message for your commands?

gritty pike
#

command extention

#

*extension

slender thistle
#

commands.Bot has command_prefix kwarg that accepts either a string or an iterable (or list/set, not sure) object

gritty pike
#

ohk then I can pass a iterable?

#

thanks

slender thistle
#

pass a list of your prefixes and you good mmulu

slim heart
#
5|ti84  |     at resize (C:\Workspace\node_modules\vegaexp\node_modules\vega\build\vega.js:12884:26)
5|ti84  |     at CanvasRenderer.prototype$J.resize (C:\Workspace\node_modules\vegaexp\node_modules\vega\build\vega.js:12927:5)
5|ti84  |     at CanvasRenderer.prototype$H.initialize (C:\Workspace\node_modules\vegaexp\node_modules\vega\build\vega.js:12496:17)
5|ti84  |     at CanvasRenderer.prototype$J.initialize (C:\Workspace\node_modules\vegaexp\node_modules\vega\build\vega.js:12922:28)
5|ti84  |     at initializeRenderer (C:\Workspace\node_modules\vegaexp\node_modules\vega\build\vega.js:29994:8)
5|ti84  |     at C:\Workspace\node_modules\vegaexp\node_modules\vega\build\vega.js:30098:18                             
5|ti84  |     at processTicksAndRejections (internal/process/task_queues.js:86:5)
5|ti84  | (node:828) 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: 2)```
I keep getting this error, judging by the prototype runs, its from this bit of code
```js
new vega
                    .View(vega.parse(chart))
                    .renderer('none')
                    .initialize()
                    .toCanvas().then(canvas=>{
                        canvas.MoreData = valueForChart
                        resolve(canvas)
                    })```
this seems to have stopped working since I moved to a different machine, I looked it up, I installed `canvas` and thats all good but it just doesnt want to work?
#

getContext is NOWHERE in my code so

quartz kindle
#

did you install vega?

slim heart
#

yea

quartz kindle
#

vega seems to use canvas, it should install it automatically

slim heart
#

i reinstalled just in case but still no

quartz kindle
#

you can try npm rebuild vega

#

you can also check if there is any changes to vega since you installed it in your last machine, maybe there was an update with breaking changes

slim heart
#

the thing is it seems to be an error within the package so wth

quartz kindle
#

post an issue in their github

#

or try to install an older version

#

ie: the same version you had on the old machine

twilit rapids
#

fetch the message

#

then edit it

#

what lib

#

discord.js I see

#

what version

#

master?

#

or stable

#

Yeah .fetchMessage()

#

fetchMessage() resolves a promise

#

so either await or use .then()

#

and then edit the fetched message

quartz kindle
#

if you want to edit the message you just sent (not some message you sent earlier), you can use the promise returned from the .send() method

opaque eagle
earnest phoenix
#

How do I know in what servers my bot is?

pale marsh
#

Twemojies? Wut

#

What lib are you using?

sudden geyser
#

eslint some of those emojis may just not exist like the brain one. As for the gear, idk

loud salmon
#

@opaque eagle there is no twemoji for brain, maybe you got a funky gear?

opaque eagle
#

What about the gear tho

loud salmon
#

idk

native crown
opaque eagle
#

Settings

earnest phoenix
#

How do I know in what servers my bot is?

west spoke
#

^

native crown
#

What is the setting called

opaque eagle
#

Lib? @earnest phoenix

loud salmon
#

@native crown press f1 to be taken to the discord help desk

west spoke
#

Loop through all servers

native crown
#

@loud salmon im on a phone

opaque eagle
#

Never knew that was possible rofl @loud salmon

earnest phoenix
#

@opaque eagle I use dbd app so idk

opaque eagle
#

dbd?

loud salmon
#

oof

opaque eagle
#

whats dbd

#

can someone catch me up to speed

#

dbd app?

native crown
#

So how do i remove that?

earnest phoenix
#

@native crownSettings>Overview

#

@opaque eagle dbd app is an app that turns developing a bot easier

native crown
#

Ah i see thx m8

opaque eagle
#

easier?

earnest phoenix
#

Ye

opaque eagle
#

if by easier you mean you don't have to write code, then its not easier

loud salmon
#

well yes

#

but actually no

#

while it does make the simple stuff easy

earnest phoenix
#

Spider is righ ye

loud salmon
#

it just cant do stuff that should be super simple

earnest phoenix
loud salmon
#

the code to do what you want can be less than 5 lines of code

#

in any language

#

@earnest phoenix spoonfeed but also wrong lang

earnest phoenix
#

HAH

loud salmon
earnest phoenix
#

But

#

How can I now where my bot is?? Like the servers

loud salmon
#

No clue how to help you there

earnest phoenix
#

Hmmm

loud salmon
#

maybe ask the app support desk

earnest phoenix
#

Ok, thank u

loud salmon
#

if they have one

earnest phoenix
#

Ill ask them

quartz kindle
#

@earnest phoenix you want to see the servers your bot is in? which library are you using?

earnest phoenix
#

I am using the dbd app :/ @quartz kindle

#

What is this?

#

Is an app

#

To android

#

Can you send more details like how the app work?

#

It has its own code type, so per example if you want it to not ping people when the command is sent u do $nomention @earnest phoenix

quartz kindle
#

does it have documentation? is there a link?

earnest phoenix
#

What is a documentation?

quartz kindle
#

a website that teaches and shows all the possible commands

earnest phoenix
#

There is theyr discord

#

They have a wiki section

#

And the app

quartz kindle
#

do they have a website?

earnest phoenix
#

I dont think so

#

1 sec

quartz kindle
#

then we cant help, you have to ask them

earnest phoenix
#

They finnaly answered me. I know how to see servers. Thx to u bcs u tried to help

#

Really kind

indigo geyser
#
if message.content == 'Poll Test':
      await message.add_reaction('![wumpusplus](https://cdn.discordapp.com/emojis/578450352026812427.webp?size=128 "wumpusplus")')
#
File "/home/runner/.local/lib/python3.6/site-packages/discord/http.py", line 222, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 400 BAD REQUEST (error code: 10014): Unknown Emoji
#

that emoji exists

#

idk why it doesn't work

#

i try to use the same code with other bots and it works

west spoke
#

Remove the <>

indigo geyser
#

ok

#

nothing changed

west spoke
#

oof try just the id

#

?

indigo geyser
#

ok

#

thanks

#

nope

quartz kindle
#

is your bot in the server where that emoji comes from?

indigo geyser
#

thanks 😂

#

nope

quartz kindle
#

👍

indigo geyser
#

ok now it works

gritty pike
#

how to load database before on_ready() for discord.py?

west spoke
#

You... just put it above it

#

Or if it's one you constantly update you can define it and use a asyncio loop

gritty pike
#

ok trying

#

should I put the function under client.event()?

#
@client.event
async def loadData():
    data = connectdb.getData()
    print('collecting data...')
    
@client.event
async def on_ready():
    await client.change_presence(status=discord.Status.online,activity=discord.Game(name='RPG Help at >help'))
    print('Logged in')
    print('...')
#

I was trying like this,but not working

#

ohk, fixed. thanks

quartz kindle
#

return basically means stop/cancel

#

you have a condition, and if its true, you stop/cancel the code, and return something

#

so you need to change it to js if condition -> send to author -> send to channel -> return (if you need to cancel something that happens later)

west spoke
#

P much

quartz kindle
#
if(condition) {
    action1;
    action2;
}```
earnest phoenix
#

css*, and css is farily simple, it takes 3 minutes max of research to get how it works, basically you put every bit of css you want into a <style></style> in your big description

ionic kiln
#

Yeah, if you are familiar with html a bit this is no problem for you, https://www.w3schools.com is not 100% accurate but for what you are trying to achieve more than enough

quartz kindle
#

you dont "learn codes", you learn a language/environment/system

#

yeah, but "codes" suggests learning bits and pieces of a language, which can sometimes confuse you instead of pointing you in the right directions

ionic kiln
#

agree, but in this case a simple html code doesn't confuse anyone in my opinion

indigo geyser
#
@client.event
async def on_reaction_add(reaction, user):
  async for user in reaction.users():
        await message.channel.send('{0} has reacted with {1.emoji}!'.format(user, reaction))
``` how can the bot send the message if `message` can't be put?
#

plssssss help

sudden geyser
#

reaction has the message attribute

west spoke
#

uh

#

reaction.message.users?

humble gyro
west spoke
bright spear
#

LOL

humble gyro
#

ye im serious

#

how do i unlock my repo

halcyon nymph
#

Hi, can I get some help? I got my raspberry pi ordered in a week ago and I was setting up the discord.py module for my bot, but when I run it it says AtributeError: ‘Bot’ object has no attribute ‘send_message’ even though when I’d run this on my laptop it’d work just fine?

sudden geyser
#

That's from the old discord.py version which is no longer supported I think

halcyon nymph
#

Ok

#

Do you know how I can get the new one

#

I tried just using the one from my laptops libraries, but that gave me an error with create_task = asyncio.async

charred latch
#

does anyone know how much it costs to host a discord bot on aws?

sudden geyser
slender thistle
#

(rtfd.)

halcyon nymph
#

@sudden geyser I tried the command on the doc page, same error happening, is said requirement already satisfied, skipping upgrade:

#

When i tried to upgrade

bright spear
#

@earnest phoenix for your long description you can use html or markdown. but you should not use <head> or <body> tags

#

also the type="text/css" isnt needed

#

just use

<style>
put css here
</style>```
sudden geyser
#

Just_allex I think it just means you already installed it. Try uninstalling and re-installing maybe?

indigo geyser
#

Thanks to all

halcyon nymph
#

@sudden geyser I have been uninstalling it, but whenever I re-install it, it installs from a cache which means it’s not actually getting the upgraded version

#

I don’t know how to un-cache it

tulip solar
#

does a lot of user data inside a json file corrupt?

west spoke
#

@halcyon nymph pip?

bright spear
#

@tulip solar yes

#

use a database

tulip solar
#

I don't know how to set that shit up

#

😦

west spoke
#

json is a bad db but it works

tulip solar
#

how big would the json file have to be to corrupt

west spoke
#

I mean, I doubt one specific channel for my bot will get popular anytime soon

#

it can be 2 lines

#

It cant write/read twice at the same time

tulip solar
#

oh, so a big bot will kill it hard

west spoke
#

I make a random number generator to wait to write until all other things are done

tulip solar
#

if every time someone does a command an update is done to the file

west spoke
#

And store as a temporary string

#

Yeah

#

For example I did define[word],[def]

#

It would write "word":"def" to the json

#

But I have it wait until it's done to write the strings to it

#

So a RNG sleep string could work

#

If you want

tulip solar
#

oof alr

halcyon nymph
#

@west spoke yeah, I’m using pip

west spoke
#

@halcyon nymph pip uninstall <package>

#

Then reinstall

latent river
#

What permissions does my bot need to send PRIVATE messages? Send_Message does not seem to be enough, the error "missing permissions" appears

earnest phoenix
#

permissions don't exist in dms

#

criteria to message a user in dms is to have at least one shared guild with the bot and for the user to have their dms enabled

latent river
#

😮

#

Then I would like to hide that error message, how can I do it?

earnest phoenix
#

try catch it

mossy vine
#

discord.js, is there any way to react to a message with a unicode emoji without including the unicode in the code?

earnest phoenix
#

nope

mossy vine
#

crap

earnest phoenix
#

you have to send the unicode, the api doesn't map :emoji: to a unicode char like the client does

quartz kindle
#

you can use unicode code

#

ie \u7485

#

or something

bright spear
#

@mossy vine you can just send it like :emoji: and it works

mossy vine
#

hm lemme try that

bright spear
#

the client handles it the same as the unicode

mossy vine
#

nope

#

throws unkown emoji

earnest phoenix
#

that is for sending messages, not for adding reactions

mossy vine
#

and how would i get the unicode of the emoji?

earnest phoenix
#

the client formatted one?

#

or?

mossy vine
#

yeah

latent river
#

I can not do what I want, I would like to hide the error "missing permissions" from the console of my Bot.
Python3

earnest phoenix
#

put a backslash before sending it, e.g 😃 => \:smiley: => \😃

bright spear
#

oh yeah i was talking about sending messages

mossy vine
#

yeah but i need the unicode code/name

quartz kindle
#

which emoji are you trying to react with?

mossy vine
#

like \usomething

earnest phoenix
#

@latent river use try except

quartz kindle
#

for example, the emojis for the numbers are special cases: js reaction_numbers = ["\u0030\u20E3","\u0031\u20E3","\u0032\u20E3","\u0033\u20E3","\u0034\u20E3","\u0035\u20E3", "\u0036\u20E3","\u0037\u20E3","\u0038\u20E3","\u0039\u20E3"]

earnest phoenix
#

you can just google the escaped emoji and most search results will return the code

bright spear
#

look it up on emojipedia

earnest phoenix
mossy vine
#

oh an that would be \u1F603?

earnest phoenix
#

yup

mossy vine
#

ah okay, thanks

quartz kindle
#

without the 1 i think, unicode usually only has 4 digits

#

unless its like extended unicode or something

#

try both ways

bright spear
#

everything says unknown for me

mossy vine
#

same

bright spear
#

well the actual unicode emoji works

#

@mossy vine why cant u just use that ThinkEyes

mossy vine
#

my terminal really doesnt like that lol

quartz kindle
#

in what way? during logging?

mossy vine
#

no, it just cant render them properly and instad makes them semi-invisible, fucking up many things next to it

quartz kindle
#

yeah but why doesnt it need to work in your terminal?

mossy vine
#

vim mmLol

#

so basically

quartz kindle
#

oh

mossy vine
#

when i paste a unicode emoji

#

konsole gives me a warning that it doesnt like that

#

then renders as a ?

#

then breaks everything next to it

bright spear
#

use windows terminal

#

it supports emoji

mossy vine
#

on linux? sure

bright spear
#

lmao'rip

#

dont use vim?

mossy vine
#

i guess i could always just use vscode for this one project

bright spear
#

vscode's remote development is nice

#

it can connect to a server via ssh and u can directly edit

mossy vine
#

yeah

quartz kindle
#

i do that with sublime

topaz fjord
#

I just edit locally mmLol

#

with my trusty jetbrains products

#

wait

#

I didn't realize jetbrains products actually have remote editing

mossy vine
#

is it normal for vscode to render a unicode emoji as 2 characters

#

but only 1 way

inner jewel
#

@quartz kindle the 4 character escape codes aren't defined by unicode

#

they're just how you'd encode the characters in whatever encoding you use (eg js/java use utf16, so escape sequences are two bytes aka 4 hex digits)

quartz kindle
#

yeah i always forget that unicode and utf are not the same thing

mossy vine
#

can my bot get ratelimited in the process of adding 5 reactions to a message

inner jewel
#

yes

#

mostly because reaction ratelimits are a meme

#

it's 1/0.25

#

but ratelimit headers work in seconds so that breaks it

earnest phoenix
#

some libs hardcode the ratelimit and ignore the headers

#

(for reactions)

inner jewel
#

there's still a chance to get 429'd even with that

#

discord being discord

#

¯_(ツ)_/¯

slender thistle
#

So it's safe to put 2 reactions per second?

quartz kindle
#

most libs should handle it for you

slender thistle
pale glen
#

will dbl.hasVoted() return true if the user has voted within the last 12 hours or 24 hours?

slender thistle
#

12

pale glen
#

also why isnt it instant and people have to wait like minutes

#

ill vote, and it wont return true until maybe like 3-5 minutes after

slender thistle
#

API /shrug

#

You can use the webhook dblapi.js provides

pale glen
#

ok

scenic kelp
#

Anybody here know any bit of CSS cuz I've been trying to fix this for quite a while now

earnest phoenix
#

yo guys I have a question. My Discordbot is just crashing before playing something in voice

opaque eagle
#

Well ur connection timed out

earnest phoenix
#

yeah but why

opaque eagle
#

how's ur internet connection doing

earnest phoenix
#

it's a windows server with 1 gbit

#

so uhm

#

don't think that it makes problems xd

opaque eagle
#

ok

scenic kelp
#

firewall maybe?

earnest phoenix
#

hmm

#

gonna disable it and try again

scenic kelp
#

anywho I need help with my problem, I have a site that I want to look like this (background is an svg file)

#

but when I shrink the width the image goes small height wise too

earnest phoenix
#

well I disabled the firewall and tried again

#

but still same error

pale marsh
#

You're probably sending the channel object itself

topaz fjord
#

add media queries @scenic kelp

scenic kelp
#

I think most of the pain is working with SVG

#

I don't see how I would implement it since the svg is the background image @topaz fjord

quartz kindle
#

specify a fixed height?

topaz fjord
#

to resize it

#

media queries allow you to change an elements styling depending on screen width

scenic kelp
#

I know that

#

I don't know how to resize it vertically while keeping it 100% width

#

since it's a background image

quartz kindle
#

background-size: 100% 200px?

#

or the other way around, i dont remember

#

ie, fixed height and percentage width

topaz fjord
#

If it were me I would set it as a background image

scenic kelp
#

It is a bg image to the header div

quartz kindle
#

are you on localhost or could i take a look?

scenic kelp
#

It's entirely within a folder

earnest phoenix
#

@pale marsh I do not because it's working on my local pc

scenic kelp
#

i'll zip it 1 sec

#

Maybe I resize the svg and make multiple versions of it and use media queries?

latent river
#

I can not do what I want, I would like to hide the error "missing permissions" from the console of my Bot.
Python3

try except doesnt works for me

quartz kindle
#

yeah apparently svgs are not stretchable by default

#
I think you are asking if you can make the SVG to distort and stretch like a PNG would do. This is unfortunately not impossible unless your SVG codes themselves are set up that way (say if your SVG are generated by illustrator, they simply won't do it).```
#

Also for most modern browsers, you can simply add preserveAspectRatio="none" attribute to the svg tag.

#

@scenic kelp

scenic kelp
#

That's a bummer. Thanks for the help. I'm presuming some fancy css or a plain image are my options now?

#

Or the resize idea might still work

bright spear
#

it says you can just do preserveAspectRatio="none"

quartz kindle
#

also, if all you need is a green bar like that

#

you can simply use background-color with css clipping

#

or even transforms

scenic kelp
#

The preserveAspectRatio thing works good enough

#

thanks again

latent river
#

python

#

trying to send PM

bright spear
#

the user probably has dms disabled

latent river
#

Yes, I understand that, but is there any way to hide the error in the console when the bot can not send the private message?

scenic kelp
#

Catch it?

#
try:
  #code
except Exception:
  #code```
indigo geyser
#
await message.edit(??)
``` What I heve to put into () ?
dapper glade
#

“<Message>”

#

What ever you want your bot to say

#

Put it in “”

#

Example

#
await message.edit(“hi”)
earnest phoenix
#

is there a way to know exactly which file in incorrect?

west spoke
#

"Server.js"

earnest phoenix
#

read the stacktrace

west spoke
earnest phoenix
#

I've went through all my commands three times now, and I don't know what the problem is

#

props.help is undefined, just like the error says

#

uhh no that error comes up when the name of a command isn't listed

hollow saddle
#

Then you should check if the command exists or not before setting it as I assume you’re using a loop

#

That or log the file name before setting it

earnest phoenix
#

how i can sort a json file ?

#

define sort

#

I have tried that but only show one people ```const test = require('../test.json')
for(var i in test) {
var myArray = [test[i].points];

myArray.sort((a,b) => b.points - a.points).map((a, i) => "[" + (i+1) + "] - " + 'lol' + " (" + a + ")").join('\n')
}```

dapper glade
#

Can someone help

valid frigate
#

idk whats going on here but the first thing i see is that your myArray variable is assigning itself within the loop

#

basically it's not outside of the for loop block so it's running as many times "test" appears

#

what could make this a lot easier is if you stored data as an array of JSON objects, and that would look something like this:

var test = [{}, {}, ...];
var myArray = test.sort((a,b) => b.points - a.points).map((a, i) => "[" + (i+1) + "] - " + 'lol' + " (" + a + ")").join('\n');
}
inner jewel
#

also var myArray = [test[i].points];

#

sorting that has no effect

#

it has a single element

#

it's always sorted

jagged ether
#

still does not work

#

other person to help @earnest phoenix

#

?

earnest phoenix
#

@valid frigate i have that in my json file
{"id1": {" points ": 100}, "id2": { "points" : 104}}

#

Idk how i can sort that by point

vague chasm
#

everytime u .sort the array, it is replaced by the latest sorted array

#

so you need to .push the output to a
new array just after sorting it

earnest phoenix
#

wth

vague chasm
#

const test = require('../test.json')
let output = []
for(var i in test) {
   var myArray = [test[i].points];

output.push(myArray.sort((a,b) => b.points - a.points).map((a, i) => "[" + (i+1) + "] - " + 'lol' + " (" + a + ")").join('\n'))
}

inner jewel
#

you can use Object.entries and Array#sort

vague chasm
#

^

earnest phoenix
#

Ohh

vague chasm
#

Object.entries(obj).map(

inner jewel
#
> const data = {id1: {points: 100}, id2: {points: 200}}
undefined
> Object.entries(data).sort((a, b) => b[1].points - a[1].points)
[ [ 'id2', { points: 200 } ], [ 'id1', { points: 100 } ] ]```
jagged ether
#

@vague chasm

dapper glade
jagged ether
#

It sends 2, OK, but the thing we want is that it sends the level in a precise order, from the highest level to the smallest

#

People for us help?

dapper glade
#

At this moment I knew, I fu**ed up

vague chasm
#

um

#

This is exactly what I use for my leaderboard command too

earnest phoenix
#

ok hi

#

what u need help with

manic skiff
#

i need help making a bot called RadicalBot
it replies to any message containing the words (Rad, Radical, Awesome, Nice, Great) with "Totally Radical!"

earnest phoenix
#

which lib are you using

manic skiff
#

and randomly says not to do drugs

#

and

#

i have no clue

#

im

#

not really that far into the process

west spoke
bright spear
#

@manic skiff do you know a programming language?

manic skiff
#

ahaha no

coarse vapor
#

English

manic skiff
#

uh

coarse vapor
#

^not that

manic skiff
#

no habla engles?

#

i dont know

bright spear
#

ok so first, learn a programming language

#

like javascript

coarse vapor
#

I recommend Python because it is very friendly

manic skiff
#

how do i get

earnest phoenix
#

python is not good

manic skiff
#

python

earnest phoenix
#

for beginner

bright spear
#

javascript is better than python imo

coarse vapor
#

Nah

manic skiff
#

i request a VERY beginner friendly one

earnest phoenix
#

typescript > javascript

#

@manic skiff javascript

manic skiff
#

ok

earnest phoenix
#

wow

#

ok

#

introduce yourself with typed languages, you're probably going to be using them more often anyways

manic skiff
#

im not very quick to understand stuff so im sorry

#

but uh,

#

how do i get javascript

bright spear
#

@manic skiff try w3schools

manic skiff
#

ok

earnest phoenix
#

yes w3school is very good @bright spear

bright spear
#

what

slim heart
earnest phoenix
#

timestamps are always supposed to be utc

slim heart
#

doesnt matter it still says it sent tomorrow 👀

amber fractal
#

Well that happens idk why tho

slim heart
#

But theres no way of making it dependent on where the actual person is?

amber fractal
#

No idea

#

I've had the issue only once

#

Just ignored it

earnest phoenix
#

discord accepts timestamps in utc

#

then it's calculated locally

#

you're supposed to send the utc timestamp, not your local one

slim heart
#

(new Date().getTime() - (new Date().getTimezoneOffset() * 60000)) i gotta do this

amber fractal
ember atlas
#

for all the djs nerds whats wrong with this? client.user.setActivity('Boss and !help', { type: 2 })

bright spear
#

@ember atlas that code is correct and it works when i run it

ember atlas
#

then why are my logs being spammed?

bright spear
#

with?

amber fractal
#

That has nothing to do with logs

ember atlas
#
 /home/boss/assistant-2/events/ready.js:6
0|index  | });
0|index  |  ^
0|index  | SyntaxError: Unexpected token )
0|index  |     at createScript (vm.js:80:10)
0|index  |     at Object.runInThisContext (vm.js:139:10)
0|index  |     at Module._compile (module.js:617:28)
0|index  |     at Object.Module._extensions..js (module.js:664:10)
0|index  |     at Module.load (module.js:566:32)
0|index  |     at tryModuleLoad (module.js:506:12)
0|index  |     at Function.Module._load (module.js:498:3)
0|index  |     at Module.require (module.js:597:17)
0|index  |     at require (internal/module.js:11:18)
0|index  |     at files.forEach.file (/home/boss/assistant-2/index.js:13:19)
PM2      | App [index:0] exited with code [1] via signal [SIGINT]
PM2      | App [index:0] starting in -fork mode-
PM2      | App [index:0] online
#

Spans my console with this

warm marsh
#

I've got this error. My bot just sleeps all the time. Doesn't come online. Any reason?

ember atlas
#

error? @warm marsh

earnest phoenix
#

boy that's a syntax error

ember atlas
#

I think I can read

#

Which is why i am asking..

warm marsh
#
invalid token
#

Idk why

#

I've not slept in a while so probs doing something wrong.

amber fractal
#

@ember atlashas nothing to do with the line of code you provided

lusty dew
#
                if(client.commands[prop]){
                    let cmdHelpEmbed = new Discord.MessageEmbed()
                    .setTitle(`${client.commands[input].name}`)
                    .addField(`Description: ${client.commands[input].desc}`)
                    .addField(`Usage: ${client.commands[input].usage}`)
                    .setColor("BLURPLE")
                    .setTimestamp()
                    .setFooter(`Requested By: ${message.author.tag}`)
                    message.channel.send(cmdHelpEmbed)
                }

I have this so far but I can't figure out how to define prop or what to define it as more or less

#

Anyone got any ideas or hints as to the answer

ember atlas
#

@amber fractal then what does it have to do with

amber fractal
#

It says that you have an unexpected )

warm marsh
#

My code.

lusty dew
#

Delete that

warm marsh
#

Why?

amber fractal
#

Nice token

ember atlas
#

like now

#

it has your token

lusty dew
#

Your token

amber fractal
#

Regen it

ember atlas
#

delete asap

#

^

warm marsh
#

My token?

amber fractal
#

Doesnt matter if you delete

ember atlas
#

Dude i could run any code as your bot rn

warm marsh
#

wtf

devout snow
#

me too

ember atlas
#

So i suggest you delete it

amber fractal
bright spear
#

@warm marsh why tf did u post your token...

ember atlas
#

you need to delete that post, and regin your token

bright spear
#

yes

#

asap

warm marsh
#

I didn't realise

amber fractal
#

Delete that message and regen your token

devout snow
#

dothatthing

lusty dew
#

Lol

ember atlas
#

also please for the love of life

#

make a config

bright spear
#

yes

#

or like

#

use .env

warm marsh
#

How?

#

I use windows.

ember atlas
#
    "token:" "token" 
}

client.login(config.token)

lusty dew
#

🤦

ember atlas
#

are you following a tutorial?

lusty dew
#

This guy said he is using windows

#

big rip

warm marsh
#
#

Example

devout snow
lusty dew
#

Okay?

ember atlas
#

Ok, so if you can

lusty dew
#

What about this image is wrong

warm marsh
#

It works?

ember atlas
#

Make a new file called config.json @warm marsh

warm marsh
#

For me it says invalid token

#

ok

ember atlas
#

and we can store things in there that we can access later, token, prefix, etc

bright spear
#

first

#

did you regen your token yet

ember atlas
#

^

warm marsh
#

How?

bright spear
ember atlas
#

go to the app you are

#

woah!2

#

wtf

lusty dew
#

Bruh

amber fractal
#

Bruh

lusty dew
#

xD

ember atlas
#

delete it and regen

warm marsh
#

My bad

lusty dew
#

This guy

devout snow
#

quick, everyone zombify his bot.

lusty dew
#

He's basically asking for it

#

Dillion

warm marsh
#

Yeah?

#

I need sleep

lusty dew
#

Go to the developers site and regin your token

devout snow
#

I'm new, but really feel like i belong.

warm marsh
#

I've been awake for almost 3 days

#

my bad

lusty dew
#

then sleep

ember atlas
#

YOU ABSOLUTELY NEVER, EVER, POST YOUR TOKEN. I CAN LITERALLY RUN CODE VIA YOUR BOT, AND GET IT BANNED FROM DISCORD. NEVER POST THAT ANYWHERE EVER AGAIN PLS
@𝓓𝓲𝓵𝓵𝓸𝓷.#7249
Just a warning for the future

lusty dew
#

A sleepy programmer won't get much work done

warm marsh
#

Thanks

ember atlas
#

pls be careful

warm marsh
#

Will try.

#

Thanks!

lusty dew
#

Ez way to get someones bot banned

#

use glitch

ember atlas
#

Or use env or something

#

ok so why am i getting an invalid syntax error?

devout snow
lusty dew
#

Show error

bright spear
#

@ember atlas have you tried using eslint

lusty dew
#

Wait what am I doing

ember atlas
#
 SyntaxError: Unexpected token )
0|index  |     at createScript (vm.js:80:10)
0|index  |     at Object.runInThisContext (vm.js:139:10)
0|index  |     at Module._compile (module.js:617:28)
0|index  |     at Object.Module._extensions..js (module.js:664:10)
0|index  |     at Module.load (module.js:566:32)
0|index  |     at tryModuleLoad (module.js:506:12)
0|index  |     at Function.Module._load (module.js:498:3)
0|index  |     at Module.require (module.js:597:17)
0|index  |     at require (internal/module.js:11:18)
0|index  |     at files.forEach.file (/home/boss/assistant-2/index.js:13:19)
lusty dew
#

I need help as well

#

xD

ember atlas
#

and not really

lusty dew
#

You have a )

#

that shouldn't be where it is

ember atlas
#
module.exports = (client) => { 
    console.log(`Online!`)
    client.user.setActivity('Boss and !help', { type: 2 })
});
``` here is the code
lusty dew
#

});

#

pretty sure that )

#

is the problem

#

Shouldn't be there

bright spear
#

yes

ember atlas
#

the whole thing?

#

k

bright spear
#

no

lusty dew
#

No

bright spear
#

the ) shouldbt be there

ember atlas
#

oh

bright spear
#

just remove the )

ember atlas
#

i see

lusty dew
#

just the ) on that line

#

advaith boyo

#

wanna help me with something?

#

xD

#
                if(client.commands[prop]){
                    let cmdHelpEmbed = new Discord.MessageEmbed()
                    .setTitle(`${client.commands[input].name}`)
                    .addField(`Description: ${client.commands[input].desc}`)
                    .addField(`Usage: ${client.commands[input].usage}`)
                    .setColor("BLURPLE")
                    .setTimestamp()
                    .setFooter(`Requested By: ${message.author.tag}`)
                    message.channel.send(cmdHelpEmbed)
                }

I have this so far but I can't figure out how to define prop or what to define it as more or less

#
{ conf:
   { name: 'Cuddle',
     desc: 'Allows you to give cuddles!',
     usage: '-cuddle [@​user] or @​Clap Bot cuddle [@​user]',
     guildOnly: true },
  run: [AsyncFunction: run] }

this is how the commands are structured if this info is needed

#

but not all the commands use conf

#

some use music, mod, nsfw

ember atlas
#

How would I be able to make a exec command

earnest phoenix
#

what does that even mean

ember atlas
#

Well you cant help me if you dont know what it is so bloblul

#

Its executes commands in the terminal via your bot

earnest phoenix
#

which lang

ember atlas
#

djs

earnest phoenix
stray garnet
#

How to see how much Commands were ran?

earnest phoenix
#

you have to keep track of that when executing commands yourself

lusty dew
#
                if(client.commands[prop]){
                    let cmdHelpEmbed = new Discord.MessageEmbed()
                    .setTitle(`${client.commands[input].name}`)
                    .addField(`Description: ${client.commands[input].desc}`)
                    .addField(`Usage: ${client.commands[input].usage}`)
                    .setColor("BLURPLE")
                    .setTimestamp()
                    .setFooter(`Requested By: ${message.author.tag}`)
                    message.channel.send(cmdHelpEmbed)
                }

This isn't working, it doesn't send the embed and it doesn't error

#

it just does nothing

earnest phoenix
#

Discord.RichEmbed()¿

lusty dew
#

I am using Discord.js master

#

so it is MessageEmbed

earnest phoenix
#

No error?

stray garnet
#

@earnest phoenix r u joking?

earnest phoenix
#

i'm not

lusty dew
#

@earnest phoenix Nope no errors

sinful lotus
#

@lusty dew did you try console logging

#

and see if the code reach that?

#

no errors means its possible that code doesnt even execute

#

check your logic and put console.log on every if statements you can thiink of that might bug

lusty dew
#

It reaches all the way until the if statement

sinful lotus
#

the your problem most likely lies on client.commands[prop]

#

check if that is not outputtiing undefined or null or whatever falsy values

lusty dew
#

Okay

jagged ether
#

Help me plz

spare goblet
#

@jagged ether Just use JSON.stringify() to preview the object lol

lusty dew
#

@sinful lotus Nothing logs

sinful lotus
#

what nothing logs?

lusty dew
#

client.commands[prop]

sinful lotus
#

no undefined or null?

lusty dew
#

nope

sinful lotus
#

then your code doesnt reach that

#

that clearly states that you only thought it reaches the IF statement

#

but in reality it dont even execute there

#

I suggest to backtrack the code more

fading wigeon
#

gson

lusty dew
#

None of it is working now

#

tf

fading wigeon
#

@stray garnet does discord.js use restactions?

stray garnet
#

@lusty dew Wdym?

lusty dew
#

None of my code is working now

lusty dew
#
            switch(input){
                case "Mod":
                let modEmbed = new Discord.MessageEmbed()
            }

is is supposed to be like that or

            switch(input){
                case "Mod":
                    let modEmbed = new Discord.MessageEmbed()
            }

Like that?

late hill
#

Unless I'm not fully awake yet, the only difference in those 2 is indentation which shouldn't matter in js

#

But preferably the 2nd option as it'll allow you and other devs to easily see the different cases and their respective statements

lusty dew
#

Okay

#

@late hill Question though, how could I make it so they don't have to type something a specific way, cause not all mobile users type with a capital letter at the beggining

#

so the word isn't case sensitive

#

(also soz for ping)

twilit rapids
#

You can use .toLowerCase()

late hill
#

Put the word you check for in all lowercase or all uppercase

#

And then do the same to the input

#

^^

lusty dew
#

Ah

#

Ez fix

#

didn't think about that

#
let input = args[0].toLowerCase()
#

So like that basically

twilit rapids
#

yeah

#

then it will be "mod"

lusty dew
#

K thanks

#

I should have thought of that xD

earnest phoenix
#

@glass nova

lusty dew
#

How do I filter when using find again?

#

nvm

lusty dew
#

How do I add roles in d.js master

#

isn;t it like

#

mMember being guild member

mossy vine
#

read docs

lusty dew
#

Yea

#

I couldn't find it at first

#

then I found it

#

thanks !

gritty pike
#

I have AWS Educate account. Am I able to host my discord.py bot using AWS? if yes how?

lusty dew
#

I got it to add the roles

#

but now

#
            message.guild.channels.forEach((channel, id)=> {
                    channel.overwritePermissions(muterole, {
                    SEND_MESSAGES: false,
                    READ_MESSAGE_HISTORY: false
                })
            })
#

this part isn't working

#

and it throws no errors

vague chasm
#

.catch((error) =>

lusty dew
#

@vague chasm Nothing console logged

vague chasm
#

look at docs

#

I think 11.5.1 discord.js has changed the way it does it

somber verge
lusty dew
#

@vague chasm Still not working

#

and I looked at docs

#

I followed them

cursive dagger
#

@somber verge remember to convert it to an int (if you use rewrite)

somber verge
#

the problem is, that every other member works fine

cursive dagger
#

Hm

slender thistle
#

@somber verge Are you sure i is integer

somber verge
#

i is string

#

but it workef

#

worked*

slender thistle
#

How the f

frank dust
#

Would you not just use message.mentions?

#

instead of splitting the message to get the id and then getting the member from the id

slender thistle
slim heart
#

is there a way to do like a array.includes() to an array like [1,2].includes([1,3]) would still be true. obviously this doesnt work but is there a thing that would provide this functionality rather than having two of the same statement

lusty dew
#
            message.guild.channels.forEach((channel, id)=> {
                    channel.overwritePermissions(muterole,{
                        permissionOverwrites: [
                            {
                            deny: ["SEND_MESSAGES", "READ_MESSAGE_HISTORY"]
                            }
                        ]
                })
            }).catch(err => { console.log(err) })

This is not doing what it should be doing, channging the role perms for every channel in the server.

#

Not even erroring

earnest phoenix
#

How to make a bot hosted on a VPS online 24/7. I downloaded pm2 but apparently that didn't work, because my bot went down in less than 12 hours.

modern sable
#

make sure that you added your bot to pm2 and started it over that

#

pm2 should auto-restart your bot if it crashes

lusty dew
#

Please someone help me

#

I don't understand whyz this iz happening

earnest phoenix
#

Uh I did pm2 start server.js which is my main file, but today this morning the bot was offline, but in pm2 status it said online.

lusty dew
#

Have you checked logs?

mossy vine
#

pm2 logs <name> --lines=300

earnest phoenix
#

Ok

#

thats what I got in response to that

stray garnet
topaz fjord
#

wdym

stray garnet
#

I mean, display how much gulids the bot is in and the same with users

topaz fjord
#

what lib

stray garnet
#

d.js

earnest phoenix
#

Use the documentation

topaz fjord
#

<Client> has the property .guilds which returns all the guilds the bots in

#

<Client> also has the property .users which returns cached users only

#

To find all the users you will have to filter through all the guilds and add up their member count

earnest phoenix
#

Anyone know the answer to my question above?

night imp
#

uh that just means nothing printed if there's nothing under it

#

go to the error log file and see what's in there

topaz fjord
#

it's --lines 300

#

no --lines=300

tight heath
#

I don't think that makes a difference

topaz fjord
#

usually does for me

late hill
#

Shouldn't make a difference^^
It's probably because the name has a space which is messing up the args
Put quotes around the name or use the id instead and it should work
@earnest phoenix

opaque eagle
#

I'm trying to download a dependency for my go project and i keep getting this error: build RPCClient: cannot load github.com/ananagame/rich-go: cannot find module providing package github.com/ananagame/rich-go

earnest phoenix
#

whats a web server

#

a server for the web

#

whats a bot

#

witchcraft

west spoke
#

what's life

lusty dew
#

Okay two things

#

One both the Help menu and Module should not be sending at the same time

#

Two at the very bottom I have a check

#

These two lines of code are in it

#

and the way client.commands is structured is

#
   { name: 'Cuddle',
     desc: 'Allows you to give cuddles!',
     usage: '-cuddle [@​user] or @​Clap Bot cuddle [@​user]',
     guildOnly: true },
  run: [AsyncFunction: run] }```
#

Like this

#

but conf isn't the only tag the bot uses

#

it uses nsfw, mod, music, conf

#

but to get the name, desc, and usage i'd have to specify which tag I want to get it from but since there is multiple I can't just specify one tag or else it'd only get info about the commands using that tag

#

ping me with a response cause I may fall asleep soon

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

halcyon nymph
#

Okay, i installed the new discord but I’m still having problems, it’s having problems with create_task=asyncio.async

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

halcyon nymph
#

Apparently I was on an older version that didn’t have send_message

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

halcyon nymph
sage bobcat
#

One message removed from a suspended account.

west spoke
sage bobcat
#

One message removed from a suspended account.

west spoke
#

@halcyon nymph await client.send_message(channel, message, embed=None)

#

That's the synatax

sage bobcat
#

One message removed from a suspended account.

west spoke
#

Replace None with whatever embed you are using (optional)

halcyon nymph
#

Yeah, it’s having a problem with importing discord.py

#

It runs into an error where it wasn’t before

west spoke
#

What version are you using

halcyon nymph
west spoke
halcyon nymph
#

I got arsed with using pip so I just copied it off my computer with a USB stick

slender thistle
#

Post full traceback please

halcyon nymph
#

Idk how to screenshot the pi

slender thistle
#

You are trying to install a 0.16.12 version with python 3.7 installed

west spoke
#

@halcyon nymph pip install discord==0.16.12 if you are using CLIENT

#

Any version above it wont work.

slender thistle
#

What

halcyon nymph
#

Ok I’ll try that

slender thistle
#

The error is because they are trying to run a 0.16.12 version on python 3.7

west spoke
#

really

#

Downgrade to python 3.6.6

sage bobcat
#

One message removed from a suspended account.

halcyon nymph
#

How do I get python 3.6.6

west spoke
#

Anyways now to tear apart nintendo swi--

sage bobcat
#

One message removed from a suspended account.

west spoke
#

^

slender thistle
#

Let's not put anything that doesn't help

#

You aren't helping at all

sage bobcat
#

One message removed from a suspended account.

slender thistle
#

Then don't say anything

halcyon nymph
#

Same

sage bobcat
#

One message removed from a suspended account.

west spoke
#

what

sage bobcat
#

One message removed from a suspended account.

west spoke
#

what the fuck happened to the app

sage bobcat
#

One message removed from a suspended account.

halcyon nymph
#

I would use js, but my python code uses tuples and specifically the .update feature in python, and js doesn’t have that

#

Honest to god I would used js if I knew it was gonna be this much of an arse in python though

slender thistle
#
  1. DV, they reserve full rights to use whatever they want. If they want to use it, you should help if you can, and if you can't, remain silent, please.
  2. Neko, #memes-and-media, thank you.
  3. Allex, your best bet is to either use the latest (discord.py 1.2.3) and update your code to it or downgrade your Python version to 3.5+ (3.6+ include f-strings, if that might interest you).
west spoke
#

@slender thistle I was wanting to take apart a app but its gone

halcyon nymph
#

How do I downgrade my python, the python website is littered with downloads for windows but I can’t see anything for Linux

sage bobcat
#

One message removed from a suspended account.

halcyon nymph
#

My pi came with Python2IDE and python3.7

amber fractal
#

@halcyon nymph what version of python do you need?

slender thistle
#

What distro

amber fractal
#

And that

halcyon nymph
#

@amber fractal I used python 3.6.7 but I’m told python 3.6.6 will work fine, but honestly anything that can run discord.py

lusty dew
#

@sage bobcat YOu don't know what break is in switch statements

sage bobcat
#

One message removed from a suspended account.

slender thistle
#

3.5+ versions work with 0.16.12 version of discord.py

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

halcyon nymph
#

What’s distro?

sage bobcat
#

One message removed from a suspended account.

amber fractal
#

Linux distribution

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

halcyon nymph
#

I think debian

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

halcyon nymph
#

Then probably not that

sage bobcat
#

One message removed from a suspended account.

halcyon nymph
#

It only gave me one option when I installed it

#

I got one of the NOOBS sd cards

sage bobcat
#

One message removed from a suspended account.

amber fractal
#

He's prob on raspbian

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

amber fractal
#

I think that's the default rPi distro

sage bobcat
#

One message removed from a suspended account.

halcyon nymph
#

Raspian GNU

#

So yeah raspian

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

halcyon nymph
#

Ahh kill me

#

I got python3.6.8

#

And now I’ve got an import error, can’t import sysconfig even though when I open python3.6 import sysconfig works fine

near igloo
#

hi

opaque eagle
#

Semi-colon doesn't do the same thing as break, and break is a fundamental js thing... maybe you need to look into some basic JS @sage bobcat

floral bloom
#

How come .toLocaleString() won't work when I write to a JSON file?
I don't get an error, it just doesn't separate numbers with ,s.
Example: 1000 should be 1,000.

#

Ping with response please

#

Ok

#

Setting the user balance

game.user[memberID].money.cash = args[2];
fs.writeFile("./gameData.json", JSON.stringify(game), (err) => console.error);

Reading from the file

message.channel.send(game.user[memberID].money.cash.toString().toLocaleString())

Output:

1000

Wanted output:

1,000
stray garnet
#

Why does bot.guilds.size don't work in embeds?

floral bloom
#

Hmm

stray garnet
#

Well but not for me.

floral bloom
#

What language?

#

D.js?

stray garnet
#

module.exports.run = async (bot, message, args, options, client) => {
  new Discord.Client(options);
    let bicon = bot.user.displayAvatarURL;
    let embed = new Discord.RichEmbed()
    .setAuthor("Info", "https://cdn.discordapp.com/attachments/592578056166703104/598752176709435446/IMG_20190709_091228_344.jpg")
    .setColor("BLACK")
    .setThumbnail("https://cdn.discordapp.com/attachments/592578056166703104/598752176709435446/IMG_20190709_091228_344.jpg")
    .addField("Bot Name", bot.user.username)
    .addField("Created On", bot.user.createdAt)
    .addField("Gulids", bot.gulids.size)

    message.channel.send(embed)
}
module.exports.help = {
     name: "info",
     aliases: []
}```
#

Yes @floral bloom

floral bloom
#

Do client.guilds.size instead and see if it works

stray garnet
#

Nope dont works

floral bloom
#

What's the error?

stray garnet
#

No error, it just dont response

#

In an Embed?

#

look at my code up

topaz fjord
#

You spelled it wrong

stray garnet
#

wa, wait what?

halcyon nymph
#

gulids

topaz fjord
stray garnet
#

oh i see

amber fractal
#

Wait why do you pass so many things

#

More specifically

#

Bot and client

topaz fjord
#

Usually all you need is bot, message, and args

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

opaque eagle
#

Have fun

sage bobcat
#

One message removed from a suspended account.

opaque eagle
#

That doesn't deny the fact that break; is simple js logic

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

opaque eagle
#

Dude ur taking this to such an extreme lol... i just said maybe u should search up what it is

#

Also pls don't say you "know" a language... that's never true for any dev on any lang

sage bobcat
#

One message removed from a suspended account.

gentle niche
#

what’re you supposed to say? I’m experienced with js?

#

I wouldn’t say knowing a language is knowing every nook and cranny, but you know a majority of the language and it’s functions. There’s always libraries and stuff to discover and new things to learn.

earnest phoenix
#

imagine making a bot

west spoke
#

Actually coding a bot does mean you know the lang quite a bit

#

Http requests arent easy

earnest phoenix
#

not true at all :p

#

i coded a bot know shite when i started

somber verge
#

the first thing i coded in python was a discord bot

#

ngl wasnt too good

earnest phoenix
#

Hi guys

somber verge
#

its code is on github tho

gentle niche
#

I’ve only made one extensive bot so far, but I’m happy with the results. We won third place in discord hack week.

#

however, the mods here denied it, I need to fix the -help command lmao

#

It’s mostly used for music bots, you can get music from a call on youtube search Api.

#

I’ve only used it for testing, but I’m not sure if it’s practical for larger bots

#

It essentially is a download

#

Assuming so

warm marsh
#

Are raspberry pi good for discord bots?

bright spear
#

yeah but a server would be better

warm marsh
#

Alright, How come?

bright spear
#

well they'll have faster internet and itll be more reliable

#

i dont mean a server in your house

west spoke
#

^

warm marsh
#

Yeah I know.

west spoke
#

Check pins

bright spear
#

but yeah raspberry pis should work fine

west spoke
#

Pi 4 would be best

warm marsh
#

Thanks!

bright spear
#

yw

topaz fjord
#

Pi4 has faulty USB c but that's a minor thing

bright spear
#

its fine if you use the official cable

#

and its much more powerful than the old pis

sage bobcat
#

One message removed from a suspended account.

floral bloom
#

Discord.js and JSON
Why won't this split the output making it have a comma between 3 zeros?

Setting the user balance

game.user[memberID].money.cash = args[2];
fs.writeFile("./gameData.json", JSON.stringify(game), (err) => console.error);

Reading from the file

message.channel.send(game.user[memberID].money.cash.toString().toLocaleString())

Output:

1000000

Wanted output:

1,000,000
#

Ping with response please

earnest phoenix
#

use module format @floral bloom

#

I have that for my bot