#development

1 messages · Page 1226 of 1

earnest phoenix
#

not msg

#

._.

#
  const snipes = db.get(message.channel.id) || [];
        const msg = snipes[args[0]-1||0]```
#

bruh

#

hmm

#

no idea

#

but u should save in cache

#

cuz that makes ur database bigger

#

and those delete message are useless to save in database

#

I saved it in the cache, but the snipes are deleted when the bot is closed.

sonic lodge
#

save them in a database

earnest phoenix
#

I do not know how to do it

sonic lodge
#

they're built to hold large amounts of data

#

there's tons of guides online on how to set one up

earnest phoenix
#

@earnest phoenix Why u have to save those delete message

#

it is useless

torn ravine
#

is there an event that emits when a user mutes/unmutes their mic

earnest phoenix
#

just make a command that it saves all cache when u going to turn off ur bot

ancient nova
#

I made a lyrics command

#

any one know how to snipe titles for lyrics-finder npm package

#

??

sinful belfry
torn ravine
#

thank you

ancient nova
#

any one know how to snipe titles for lyrics-finder npm package
@ancient nova

earnest phoenix
misty sigil
#

i use layout 2

earnest phoenix
#

alright thank you

sweet ruin
#

layout two def!

earnest phoenix
#

layout 2

#

forever

#

but i prefere website

#

xD

frozen crest
#

Hello

#

I would like some help

sweet ruin
#

what can I help you with?

frozen crest
#

I have a question

misty sigil
frozen crest
#

Ok

#

What means program

misty sigil
#

the auctions program

sweet ruin
#

it appears

#

you have applied for the auctions program?

frozen crest
#

Ye

sweet ruin
#

then that's that?

frozen crest
#

Ye

sweet ruin
#

theres your answer xD

misty sigil
#

shiv u seen nothing

frozen crest
#

I thought I needed to join a program xD

slender thistle
#

You applied for our auctions feature and will get a message if your application is approved

frozen crest
#

Ok

#

How long will it take tho

#

.-.

slender thistle
#

But it's completely optional so if you don't want to bid, don't sweat it

frozen crest
#

Mk

slender thistle
#

There's NO ETA ON AUCTION APP

frozen crest
#

Cy

slender thistle
#

Ss

#

Fuck

frozen crest
#

;-;

slender thistle
#

Forgot to change casing

frozen crest
#

Ok.....

heavy anchor
#

I sent an application probably more than three months ago and I never heard anything LOL

misty sigil
#

argh fucking keyboard is longer than usual

slender thistle
#

It was probably denied then @heavy anchor

frozen crest
#

...

#

Bye -.-

slender thistle
#

You don't get a message if it's denied

frozen crest
#

Oh ok

heavy anchor
#

oh ok I probably didn't put enough money LOL

slender thistle
#

In any case, let's all throw ourselves at #general

sweet ruin
#

i had a question

#

and i know im probably stup-id or something

slender thistle
#

What's the question

sweet ruin
earnest phoenix
#

hello

sweet ruin
#

I want to delete Woof Woof as it is a loading message whilst the bot is getting the avatar

earnest phoenix
#

uhmm

sweet ruin
#

but i dont believe that is working. is there any way to do it?

slender thistle
#

When do you want to delete it?

sweet ruin
#

after the embed is sent

#

which is the bottom line

#

where I have the .then

earnest phoenix
#
message.channel.send("woof woof").then((m) => {
  //embed
  m.delete()
}
#

@sweet ruin ^^

slender thistle
#

then(_ => woof.delete())

#

callbacks :wesmart:

earnest phoenix
#

does PY and JS look same

#

i think not

slender thistle
#

Not really

misty sigil
#

no

#

py and js are entirely different

earnest phoenix
#

jk

misty sigil
#

py has a more strict syntax than js imo

earnest phoenix
#

i dont understand why ppl use _

tall mist
#

js is nothing like py

earnest phoenix
#

yes

#

no but somewhere they are same

#

10%

#

maybe

slender thistle
#

Because it says "I don't want to use this var"

earnest phoenix
#

all things ik about Py is print()

#

for exmaple the for() loop is same same somewhere

slender thistle
#

I don't remember the exact name for it but _ is used as function argument whenever you get something you don't want

earnest phoenix
#

and the if()

slender thistle
#

In Python you have to create an iterable object and iterate over it

earnest phoenix
#

hmmm

#

how u declare variable

slender thistle
#

range() does that

earnest phoenix
#

a = 10 ?

slender thistle
#

literally just-yeah

earnest phoenix
#

just simple

#

that

#

wut

#

the heck

slender thistle
#

Yes, Python is weak/dynamic typing

#

So it doesn't have types attached to variables

earnest phoenix
#

but it is simple

#

:))

slender thistle
#

Yeah

earnest phoenix
#
//C++
int a = 0;
float b = 0.1;
//Js
var a = 0, b = 0.1;
//Py
a = 0;
b = 0.1;

xD

sudden geyser
#
let num: i32 = 5;```
earnest phoenix
#

is that PY ?

sudden geyser
#

no

earnest phoenix
#

jaca

#

java ?

sudden geyser
#

rust

earnest phoenix
#

uhh

#

ive been looking into learning rust recently

misty sigil
#

hey cry

earnest phoenix
#

is it actually worth it? in terms of demand on the market

#

hi

sudden geyser
#

I'd say it's definitely worth it.

#

I haven't used it for anything major yet, but when I do, I'd like to write it in Rust. It's not very much in demand though as it's quite a young language, but it's growing quickly.

drifting wedge
#

how do i load cogs in folders in d.py?

slender thistle
#

folder.filename

drifting wedge
#

like my code is hella buggt

#

any ideas why?

#

it like takes long to send messages

#

client.load_extension('cogs.music')

slender thistle
#

Blocking functions

quick lily
#

How do I search for my BOT to search for songs to play

drifting wedge
#

something like this for example?

quick lily
#

Instead of being by URL

drifting wedge
#

Blocking functions
@slender thistle maybe...

#

what are blocking things?

#

bytesio?

slender thistle
#

Non-async

#

I mean, it could be BytesIO or anything else that's not async

drifting wedge
#

wut does bytesIO do?

#

also, im doing a level up card

earnest phoenix
#
"https://api.spotify.com/v1/tracks/19jWzFkYj7g5dKEKpdm2eM" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer [TOKEN]"
let spotifyapi = `https://api.spotify.com/v1/tracks/${activity.syncID}`;

How can I connect the upper one with the one below?

#

to get oauth

analog walrus
#

I'm having an issue where I keep getting the handle promise rejection because I don't have perms, the perms isn't the issue, I just need help on how to catch the warning, any help would be great

drifting wedge
#
.avatar_url)```
karmic compass
#
client.on('message', async (message) => {
  if(message.content == "kickme") {
    try {
      await message.member.kick()
    } catch (err) {
      message.reply("ERROR")
    }
  }
})
``` is a bad example :)
drifting wedge
#
.avatar_url)```

@drifting wedge its giving me erros

sudden geyser
#

I'm having an issue where I keep getting the handle promise rejection because I don't have perms, the perms isn't the issue, I just need help on how to catch the warning, any help would be great
@analog walrus you need to handle the promise. You usually handle them with .catch(...) or try & catch with async/await.

slender thistle
#

@drifting wedge USE AIOHTTP INSTEAD OF REQUESTS

drifting wedge
#

@drifting wedge USE AIOHTTP INSTEAD OF REQUESTS
@slender thistle ok and what else?

slender thistle
#

send request to str(member.avatar_url)

drifting wedge
#

url = requests.get(member.avatar_url)

#

thats the code

#

send request wdym?

slender thistle
#

Stop using requests

#

Start using aiohttp

#

When sending a GET request, the URL will be str(member.avatar_url)

analog walrus
#

@sudden geyser if would catch still function properly if I left it empty?

sudden geyser
#

wdym

analog walrus
#

does there need to be something in .catch( "here" ) or can it be empty?

sudden geyser
#

ah, yes

#

It takes a function with a parameter that'll be the error.

#

So for example:

drifting wedge
#

url = requests.get.str(member.avatar_url)

#

so like this?

sudden geyser
#
reject(new Error("This is an error")).catch((err) => console.log(err)) // "This is an error"```
analog walrus
#

okay sweet, thanks

sudden geyser
#

0Exe do you know what aiohttp is

drifting wedge
#

no actually

#

lol i do

#

it gets like stuff from the itnerwebs

sudden geyser
#

Yes, and it's recommended because requests is sync while aiohttp is async I believe.

#

But for your problem

#

member.avatar_url returns an Asset

#

You need to get the URL to the image.

#

If you use the str() constructor on it, you'll get the URL representation.

#

So, str(member.avatar_url)

drifting wedge
#

im doing cards with pillow

#

btw

#

but ok

#

url = str(member.avatar_url)?

sudden geyser
#

try it and see

drifting wedge
#

is bytesIO blocking?

#

or no?

sudden geyser
#

I don't know what that is.

drifting wedge
#

@sudden geyser

#

member not defined

sudden geyser
#

so you didn't define it.

#

define member as what it should be or use what's appropriate, as it looks like it should be a guild member.

drifting wedge
#

message author

#

but ok

#

requests not defined

#

should I add request =?

#

or aiohttp

dreamy thistle
#

how do i change node-cron hour zone?

#

if someone knows <33

drifting wedge
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Guild' object has no attribute 'member'

earnest phoenix
#
fetch(`https://api.spotify.com/v1/tracks/${activity.syncID}`, {
        headers: {
            'Accept': `application/json`,
            'Content-Type': `application/json`,
            'Authorization': `Bearer TOKEN-HERE`
         }
         }).then(body => {
            if(body.error.status === 400) return message.channel.send(`**${message.author.tag}**: Şarkı bulunamadı..`);

is not it right?

drifting wedge
#

@sudden geyser can u help me?

#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Guild' object has no attribute 'member'

#

thats the rror im getting

#

url = str(ctx.guild.member.avatar_url)

earnest phoenix
#

not working.

#

I can not get a body

#

if I think everything is true.

#
fetch(`https://api.spotify.com/v1/tracks/${activity.syncID}`, {
        headers: {
            'Accept': `application/json`,
            'Content-Type': `application/json`,
            'Authorization': `Bearer TOKEN-HERE`
         }
         }).then(body => {
            if(body.error.status === 400) return message.channel.send(`**${message.author.tag}**: Şarkı bulunamadı..`);

is not it right?
@earnest phoenix

#

TypeError: Cannot read property 'status' of undefined

#

body.error.status === 400

#

How can I combine the spotify api address with auth.

#

my code is correct

#

to take auth

drifting wedge
#

wut does blocking mean?

gentle talon
earnest phoenix
#

yes

gentle talon
#

hmm

#

but it says it doesnt define that

earnest phoenix
#

@gentle talon oh wait u mean .includes

gentle talon
#

yes

earnest phoenix
#

it shuld work

#

also may wana include:

message.delete();
gentle talon
#

ah ok

earnest phoenix
#

to delete the message

#

(bot needs perms tho)

gentle talon
#

ye i know

dreamy thistle
#

Hey guys, im working on a command that mutes all users in the chat you are, but im missing some code that idk how to make, may someone help me with it?

            var user = message.member.voice.channel

            if (message.member.voice.channel) {
                (here is the missing code)

            } else { message.reply('You need to join a voice channel first!'); }

            break; ```

i tried things like ```user.voice.serverMute(true)```
didnt made it work
earnest phoenix
#

@dreamy thistle try user.voice.serverMute = true

#

it may work

quartz kindle
#

No it wont lol

thick gull
#

Check the docs..?

earnest phoenix
#

idk how to mute people via bots

pure lion
#

It's probably on the docs

thick gull
#

yea

earnest phoenix
#

^

pure lion
#

Check voice.channel

dreamy thistle
#

i tried docs but i didnt found anything usefull

earnest phoenix
#

channel.voice

pure lion
earnest phoenix
#

i know channel is a feature of user

quartz kindle
#

Its VoiceState.setMute()

earnest phoenix
#

nice

pure lion
#

Tim with the accurate Google

dreamy thistle
#

pog

quartz kindle
#

Literally just checked the docs lol

dreamy thistle
#

will try it, if i make it work u will know

thick gull
#

Tim the DJS doc

pure lion
#

No

#

Tim uses Google Sniper

quartz kindle
#

Lul

dreamy thistle
#

and how do i detect all users in a channel?

#

instead of only the message author

quartz kindle
#

Voice channels have a members property

gentle talon
thick gull
#

wtf

#

ok

gentle talon
#

lol

dreamy thistle
#

wait what

earnest phoenix
#
fetch(`https://api.spotify.com/v1/tracks/${activity.syncID}?market=ES`, {
        headers: {
            'Accept': `application/json`,
            'Content-Type': `application/json`,
            'Authorization': `Bearer BQBbGJRYRhrerjRvZlpwg9B71QZEBI-OlFvHgvhkwRnIbemG3eyG25JtzKR6nCBU1RKQLejnZBjVoWtQcP_XPFdU5Ya4bRIoL9ghmk7y9bZ0jeJXlDHiHO1a985Z2DEKjHjluaYWyNeWChwSxDjERsJJvJWydfRHZfvI98EP3nySYYxg8DhlT9riuGsq6kYyDZJBk95lzG1POo1j5SXD7acWjcFj1SoqlmfgGRoMqr3oRhFp1s9KGP7SCNkbA2Qbx91GMai62GP2sNy3tLeTpicrtiIKkFkW`
         }
         }).then(body => {
            //if(body.response.error.status === 400) return message.channel.send(`**${message.author.tag}**: Şarkı bulunamadı..`);

guys what's wrong here.
body should be like this: https://hastebin.com/uqirimidib.json

#

but such

thick gull
#

is that a free api key

midnight blaze
#
// ==UserScript==
// @name       Phishing Blockz
// @namespace  http://use.i.E.your.homepage/
// @version    0.1
// @description Phishing block based on hyperlinks
// @include     *
// @run-at     document-end
// ==/UserScript==
// ==UserScript==
// @name         Discord Custom CSS
// @version      1.4
// @author       OleVik
// @match https://*/*



(function name() {
    'use strict';

    setTimeout(() => {
        let test = Array.from(document.querySelectorAll('span'));
        test.map(m => (m.textContent=="davon")?m.setAttribute("style" "background-color: gold"):null);

    }, 5000);
window.onload = setTimeout(name, 5000);
})();

Can I replace style with an extern file, where my css goes?

pure lion
#

Is that

quartz kindle
#

@earnest phoenix if youre expecting a json response, you need to tell fetch to return json data

pure lion
#

🤢

#

Electron

#

Jk I use it I don't see the problem with it uwu

quartz kindle
#

result = await fetch(url).then(response => response.json())

pure lion
#

What does a .json() function even do

#

And why not asynchronous

quartz kindle
#

It is async

#

It reads the stream and json parses it

earnest phoenix
#

wait my bad

#

😄

pure lion
#

But .then() as well ehHGgH I mean uHhHHH I mean sUuuURE

earnest phoenix
#

Look at what I haven't seen in 10 minutes KEKW

ancient nova
#

{ errors: [ { domain: 'youtube.quota', reason: 'quotaExceeded', message: 'The request cannot be completed because you have exceeded your quota.' } ], code: 403, message: 'The request cannot be completed because you have exceeded your quota.' }

#

help

quartz kindle
#

it doesnt matter, you can do .then().then() or a = await fetch(); b = await a.json()

pure lion
#

Tim, can't tell but is that ratelimited?

quartz kindle
#

That is youtube rate limits yes

pure lion
#

Also ik I just don't like mixing .then() and async stuff for some reason, it feels clunk

ancient nova
#

{ errors: [ { domain: 'youtube.quota', reason: 'quotaExceeded', message: 'The request cannot be completed because you have exceeded your quota.' } ], code: 403, message: 'The request cannot be completed because you have exceeded your quota.' }

#

pls

pure lion
#

Ratelimited

#

Please stop spam

ancient nova
#

will it last or do I have to make new api key?

pure lion
#

Just wait

ancient nova
#

alright

quartz kindle
#

I get you, but in this case its good because you just await a single thing instead of using multiple await lines for the same thing

pure lion
#

Fair also dumb question

#

why is [![]] False but [!+[]] True?

quartz kindle
#

Who knows lmao

dreamy thistle
#

Its VoiceState.setMute()
@quartz kindle

Cannot read property 'setMute' of undefined

pure lion
#

Yes

#

You didn't copy the code did you?

quartz kindle
#

VoiceState is the class name

pure lion
#

You need to define a voicestate

quartz kindle
#

You get a VoiceState instance from member.voice

#

therefore the actual code should look like this: member.voice.setMute()

dreamy thistle
#

oh

#

i had this

quartz kindle
#

Also, the setMute function requires a boolean argument

dreamy thistle
#

            if (message.member.voice.channel) {
                user.VoiceState.setMute(true)
quartz kindle
#

You need to explicitly say if yoi want mute to be true or false

pure lion
#

In this case it'd be message.member.voice.setMute(true)

dreamy thistle
#

i misscoded R)

quartz kindle
#

And you will need to do this for every single user you want to mute

#

There is no other way to mute all

pure lion
#

I mean you could push them all into an array then use a forEach loop

quartz kindle
#

Thats what i meant

drifting wedge
#

wut does blocking mean?

pure lion
#

It depends

midnight blaze
#

it means life is bad

quartz kindle
#

Blocking code means code that makes your entire program freeze until it finished

pure lion
#

Ouchy

dreamy thistle
#

and how do i pick them all?

quartz kindle
#

Its literally blocking the program from processing other things while it waits for a specific thing

drifting wedge
#

Its literally blocking the program from processing other things while it waits for a specific thing
@quartz kindle ok... um is aiohttp blocking?

quartz kindle
#

Afaik no, aiohttp is async

#

All Async code is non-blocking

drifting wedge
#

url = str(ctx.guild.member.avatar_url)

#

would this work?

#

im changinfg from requests to aiohttp

dreamy thistle
#

for mi avatar command i use this

quartz kindle
#

Async means that the task is performed asynchronously, which means its not synchronized with the main program, meaning the main program can continue processing stuff while the async task is waiting

dreamy thistle
#
            var user = message.mentions.users.first();
            message.channel.send(user.avatarURL());

            break;
drifting wedge
#
            var user = message.mentions.users.first();
            message.channel.send(user.avatarURL());

            break;

@dreamy thistle async?

pure lion
#

@dreamy thistle reccomend not using var it's kinda decapricated and stinky

dreamy thistle
#

that sends the mentioned user avatar

grizzled raven
#

why is [![]] False but [!+[]] True?
if my calculations are correct, [] is truthy, [] as a number (+[]) is 0 and 0 is falsey

quartz kindle
#

Makes sense

pure lion
#

Ohhhhh

#

Yeah that does make sense

quartz kindle
#

Now why is +[] 0 lmao

pure lion
#

Empty array no values

quartz kindle
#

Would make more sense if it were nan

pure lion
#

Maybe +[1, 2, 3] is the length? /shrug

#

Yeah it's NaN

quartz kindle
#

Exactly lmao

pure lion
#

Strange

drifting wedge
#

url = str(ctx.guild.member.avatar_url)

#

is this correct?

quartz kindle
#

Just js quirks

pure lion
drifting wedge
#

it doesnt

#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'member' is not defined

#

thats the error

dreamy thistle
#

newbie ask: how do you make guild-custom prefixes

drifting wedge
#

newbie ask: how do you make guild-custom prefixes
@dreamy thistle with json?

#

if so there ya go

gentle talon
pure lion
#

Fuck?

gentle talon
#

yes

drifting wedge
#

url = str(ctx.guild.member.avatar_url)

#

this says member not defined

#

its in a command

#

so can i do ctx.message.author?

gentle talon
#

i am no expert on that

grizzled raven
#

Now why is +[] 0 lmao
apparently js converts an array into a string, then into a number

#

so +[6] === "6" === 6

#

and +[1,2,3] === "1,2,3" === NaN

pure lion
#

:o epic

quartz kindle
#

Make a command that reqires the user to mention a channel

#

Then in that comman use message.mentions.channels to access this mention

#

Then get the channel id from it

#

Then store the id in the db

drifting wedge
#

how can i make the welcome card like alighn text in a box

#

like center, left, right etc

#

using pillow and python

pure lion
drifting wedge
#

i checked this out

#

didnt really help ill read it again

#

thanks

pure lion
#

0, what you want to do is halve the values of the axis you want to center on

#

So if i had a box of 100 by 100, I'd center stuff by:

box height / 2 for center alignment along the Y axis

box width / 2 for center alignment along the x axis
quartz kindle
#

Drawing libraries dont have the concept of centering or aligning

#

They only understand coordinates

#

You need to implement any centering or aligning logic yourself, using math

pure lion
#

Because there are no established "elements" like in markup

long hare
#

which is the best way? with command handler or without command handler and why?

pure lion
#

Definitely with

long hare
#

and why?

pure lion
#

It's very clean and you get multiple files instead of one obese index

#

So modular too

long hare
#

perfect, thanks for the answer.

pure lion
#

And you don't need to write a help command

#

Np

white vapor
#

how to delay sending a message with discord js

torn ravine
#

how do I get an sql database

nimble kiln
#

apt install mysql-server

pure lion
#

I need more info IF6

#

Okay cool

earnest phoenix
#
"artists": [
    {
      "external_urls": {
        "spotify": "https://open.spotify.com/artist/4Fn5clYETVpCxnIcFSZhr9"
      },
      "href": "https://api.spotify.com/v1/artists/4Fn5clYETVpCxnIcFSZhr9",
      "id": "4Fn5clYETVpCxnIcFSZhr9",
      "name": "Massaka",
      "type": "artist",
      "uri": "spotify:artist:4Fn5clYETVpCxnIcFSZhr9"
    },
    {
      "external_urls": {
        "spotify": "https://open.spotify.com/artist/2u4xMsh0M2B7R8Wb3pEWae"
      },
      "href": "https://api.spotify.com/v1/artists/2u4xMsh0M2B7R8Wb3pEWae",
      "id": "2u4xMsh0M2B7R8Wb3pEWae",
      "name": "Anıl Piyancı",
      "type": "artist",
      "uri": "spotify:artist:2u4xMsh0M2B7R8Wb3pEWae"
    },
    {
      "external_urls": {
        "spotify": "https://open.spotify.com/artist/5rBUMBV7L6zPsEKnlgiOm9"
      },
      "href": "https://api.spotify.com/v1/artists/5rBUMBV7L6zPsEKnlgiOm9",
      "id": "5rBUMBV7L6zPsEKnlgiOm9",
      "name": "Yener Çevik",
      "type": "artist",
      "uri": "spotify:artist:5rBUMBV7L6zPsEKnlgiOm9"
    },
    {
      "external_urls": {
        "spotify": "https://open.spotify.com/artist/3yzGegJHrOW1CndMVFoo3m"
      },
      "href": "https://api.spotify.com/v1/artists/3yzGegJHrOW1CndMVFoo3m",
      "id": "3yzGegJHrOW1CndMVFoo3m",
      "name": "Hidra",
      "type": "artist",
      "uri": "spotify:artist:3yzGegJHrOW1CndMVFoo3m"
    }],

how can I get all the artists. object

torn ravine
#

sounds easy enough

pure lion
#

@white vapor use setTimeout()

nimble kiln
#

sounds easy enough
@torn ravine actually:
apt install mysql-server mysql-client

white vapor
#

thanks

pure lion
#

@earnest phoenix error first questions later

nimble kiln
#

not sure if the client gets installed automatically

torn ravine
#

actually google cloud offers sql

#

postgressql or mysql

pure lion
#

Why not use phpmyadmin hajajajajahajaj

#

@torn ravine entirely up to you

#

I don't know the pros and cons

#

I just know that both are good

pale vessel
#

definitely postgres

torn ravine
#

I already created a mysql

#

It's not to late to change tho

nimble kiln
#

It is. You have to use mysql now, better anyway

earnest phoenix
#

are we talking about the same mysql

#

mysql is complete trash

indigo flax
#
import time
from discord.ext import commands,tasks

client = commands.Bot(command_prefix = 'eh!')
client.remove_command('help')

@client.event
async def on_ready():
    print('Bot is ready!')
    await client.change_presence(status=discord.Status.online,activity=discord.Game('COMING SOON | eh!help'))

@client.command()
async def help(ctx):
    embed = discord.Embed(
        title = '**EasyHost Help Panel**',
        description = '',
        colour = discord.Colour.blue(),
    )
    
    embed.add_field(name='eh!help',value='Shows this help panel."',inline=True)
    embed.add_field(name='eh!ping',value='Returns the ping of the bot."',inline=True)
    embed.add_field(name='eh!website',value='Gives you the link to the website."',inline=True)
    embed.add_field(name='eh!invite',value='Sends you a link to invite this bot..',inline=True)
    embed.add_field(name='eh!discord',value='Sends the invite to the support server.',inline=True)
    embed.add_field(name='eh!support',value='Returns a link to support us!',inline=True)
    embed.set_thumbnail(url='https://cdn.discordapp.com/attachments/751978117156962426/751978146299117669/EasyHosting.png')
    await ctx.send(embed=embed)

@client.command()
async def ping(ctx):
    await ctx.send(f'Pong! {round(client.latency * 1000)}ms')

@client.command()
async def website(ctx):
    await ctx.send('Website: <https://easyhosting.gq>')

@client.command()
async def invite(ctx):
    await ctx.send('Invite the Bot: <https://invite.easyhosting.gq>')
    
@client.command()
async def discord(ctx):
    await ctx.send('Discord: <https://discord.easyhosting.gq>')
    
@client.command()
async def support(ctx):
    await ctx.send('Support Us: <https://support.easyhosting.gq>')
    
client.run('NzUxNjI5ODU1Njg2MjYyODM0.X1L32g.MT6TELPGvo02c7lC8-g2BrkX5Ls')``` how come it doesnt work for status or eh!help?
pure lion
#

Nice token bro

nimble kiln
#

@indigo flax You should delete that or reset your token, yes

indigo flax
#

i really need this fixed its in 10,000 servers

#

and people or like

#

spamming me

nimble kiln
#

Reset your token first

pure lion
#

10k servers you say

nimble kiln
#

Then we may be able to help you

pure lion
#

😏

indigo flax
#

1k*

placid iron
#

@pure lion centering is even wose than that in PIL if you want it actually centered

indigo flax
#
import time
from discord.ext import commands,tasks

client = commands.Bot(command_prefix = 'eh!')
client.remove_command('help')

@client.event
async def on_ready():
    print('Bot is ready!')
    await client.change_presence(status=discord.Status.online,activity=discord.Game('COMING SOON | eh!help'))

@client.command()
async def help(ctx):
    embed = discord.Embed(
        title = '**EasyHost Help Panel**',
        description = '',
        colour = discord.Colour.blue(),
    )
    
    embed.add_field(name='eh!help',value='Shows this help panel."',inline=True)
    embed.add_field(name='eh!ping',value='Returns the ping of the bot."',inline=True)
    embed.add_field(name='eh!website',value='Gives you the link to the website."',inline=True)
    embed.add_field(name='eh!invite',value='Sends you a link to invite this bot..',inline=True)
    embed.add_field(name='eh!discord',value='Sends the invite to the support server.',inline=True)
    embed.add_field(name='eh!support',value='Returns a link to support us!',inline=True)
    embed.set_thumbnail(url='https://cdn.discordapp.com/attachments/751978117156962426/751978146299117669/EasyHosting.png')
    await ctx.send(embed=embed)

@client.command()
async def ping(ctx):
    await ctx.send(f'Pong! {round(client.latency * 1000)}ms')

@client.command()
async def website(ctx):
    await ctx.send('Website: <https://easyhosting.gq>')

@client.command()
async def invite(ctx):
    await ctx.send('Invite the Bot: <https://invite.easyhosting.gq>')
    
@client.command()
async def discord(ctx):
    await ctx.send('Discord: <https://discord.easyhosting.gq>')
    
@client.command()
async def support(ctx):
    await ctx.send('Support Us: <https://support.easyhosting.gq>')
    
client.run('NzUxNjI5ODU1Njg2MjYyODM0.X1L32g.MT6TELPGvo02c7lC8-g2BrkX5Ls')```
#

any reason why

nimble kiln
#

dude

pure lion
#

@placid iron don't know PY, don't know pillow

placid iron
pure lion
#

What is the error

indigo flax
#

to see if it works

pure lion
#

Oh my god

nimble kiln
#

@indigo flax How about some errors

earnest phoenix
#

they're intentionally leaking it because they reset it

nimble kiln
earnest phoenix
#

lol

placid iron
#

@pure lion well its a good start tbh and it works but for me i needed to get the size not including margins things around the text

indigo flax
#

Ignoring exception in on_ready
Traceback (most recent call last):
File "/home/container/.local/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "bot.py", line 11, in on_ready
await client.change_presence(status=discord.Status.online,activity=discord.Game('COMING SOON | eh!help'))
AttributeError: 'Command' object has no attribute 'Status'

placid iron
#

dude gonna get his server nuked :(

pure lion
#

@placid iron ah that ought to be a bitch

placid iron
#

yeah pillow is quite 2Head

#

to do with text at least

indigo flax
#

hold on omg let me reset my token

#

done

nimble kiln
#

noice

placid iron
#

gg

indigo flax
#

ok first off

nimble kiln
#

I hope your bot has 0 servers now :3

indigo flax
#

eh!help wont work

#

the status wont work too

#

Ignoring exception in on_ready
Traceback (most recent call last):
File "/home/container/.local/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "bot.py", line 11, in on_ready
await client.change_presence(status=discord.Status.online,activity=discord.Game('COMING SOON | eh!help'))
AttributeError: 'Command' object has no attribute 'Status'

#

when i do eh!help it says Ignoring exception in command help: Traceback (most recent call last): File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped ret = await coro(*args, **kwargs) File "bot.py", line 15, in help embed = discord.Embed( AttributeError: 'Command' object has no attribute 'Embed' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke await ctx.command.invoke(ctx) File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 855, in invoke await injected(*ctx.args, **ctx.kwargs) File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Command' object has no attribute 'Embed'

placid iron
#

ok let me read your code

earnest phoenix
#

How do you get a random user from a d.js reaction collector?
On the end event, i've tried to do collected.random()
But I don't know how to get to the user object

#
collector.on('end', collected => {
   console.log(collected.random());
});
pure lion
#

@earnest phoenix what does it log?

earnest phoenix
#

dis

placid iron
#

@indigo flax for some reason or somehow you are setting discord to be a command which is messing everything up

pure lion
#

Please bin

earnest phoenix
#

omfg

#

I only just saw the users object :((((((((

indigo flax
#

@placid iron where?

placid iron
#

it should work if you werent doing that - but i cant find where its happening

indigo flax
#
import time
from discord.ext import commands,tasks

client = commands.Bot(command_prefix = 'eh!')
client.remove_command('help')

@client.event
async def on_ready():
    print('Bot is ready!')
    await client.change_presence(status=discord.Status.online,activity=discord.Game('COMING SOON | eh!help'))

@client.command()
async def help(ctx):
    embed = discord.Embed(
        title = '**EasyHost Help Panel**',
        description = '',
        colour = discord.Colour.blue(),
    )
    
    embed.add_field(name='eh!help',value='Shows this help panel."',inline=True)
    embed.add_field(name='eh!ping',value='Returns the ping of the bot."',inline=True)
    embed.add_field(name='eh!website',value='Gives you the link to the website."',inline=True)
    embed.add_field(name='eh!invite',value='Sends you a link to invite this bot..',inline=True)
    embed.add_field(name='eh!discord',value='Sends the invite to the support server.',inline=True)
    embed.add_field(name='eh!support',value='Returns a link to support us!',inline=True)
    embed.set_thumbnail(url='https://cdn.discordapp.com/attachments/751978117156962426/751978146299117669/EasyHosting.png')
    await ctx.send(embed=embed)

@client.command()
async def ping(ctx):
    await ctx.send(f'Pong! {round(client.latency * 1000)}ms')

@client.command()
async def website(ctx):
    await ctx.send('Website: <https://easyhosting.gq>')

@client.command()
async def invite(ctx):
    await ctx.send('Invite the Bot: <https://invite.easyhosting.gq>')
    
@client.command()
async def discord(ctx):
    await ctx.send('Discord: <https://discord.easyhosting.gq>')
    
@client.command()
async def support(ctx):
    await ctx.send('Support Us: <https://support.easyhosting.gq>')
    
client.run('nou')```
earnest phoenix
indigo flax
#

@placid iron code above

earnest phoenix
#

I'm trying to get the ID of a random user

indigo flax
#

shaking?

#

hello?

#

are you there

pure lion
#

collected.random().id

indigo flax
#

shaking my head

#

u there?

earnest phoenix
#

it returns undefined @pure lion

placid iron
#

@indigo flax ah i see

indigo flax
#

shaking my head

#

are u there

pure lion
#

Oh it gets a message

placid iron
#

you are setting discord here

indigo flax
#

yeah

#

its the discord server

placid iron
#

and it overwrites discord

pure lion
#

collected.random().message.author.id OR collected.random().author.id

indigo flax
#

ok

placid iron
#

so change it to _discord and set an aliase as "discord"

indigo flax
#

OMG

#

ok

#

wait

placid iron
#

and it works now

pure lion
#

jeejee

placid iron
#

if i comment the status thign

indigo flax
#

ok

#

wait

placid iron
#

ill fix the status thing now

indigo flax
#

so like

earnest phoenix
#

@pure lion That just gets the ID of the author of the message, i'm trying to pick a random user from a reaction

indigo flax
#

thx

placid iron
#

btw when a bot logs in it automatically goes online so you dont need to set status = online

pure lion
#

@earnest phoenix then remove id

placid iron
#

and removing that part

#

gives no more error

earnest phoenix
#

bruh

indigo flax
#

@placid iron what is short for discord?

#

dsc?

#

dc?

#

dd

#

dsc?

placid iron
#

disc

#

?

indigo flax
#

ok

placid iron
#

whatever you want

#

just set an aliase to discord

indigo flax
#

ok

thick gull
#

@dreamy thistle with json?
@drifting wedge #development message

please don’t tell newbies to start with json databases 😩

indigo flax
#

tysm

#

do u have paypal i have 1 cent lol

placid iron
#

XD its fine

indigo flax
#

ok

thick gull
#

you can always give it to me

pure lion
#

Or me

thick gull
#

shmile;]

placid iron
drifting wedge
#

@drifting wedge #development message

please don’t tell newbies to start with json databases 😩
@thick gull i was just asking

#

not saying he should

thick gull
#

you linked him a json video..?

drifting wedge
#

well yes, fair good point

#

@dreamy thistle dont use json

#

use like mongo or seomthing similar

green kestrel
#

Yay finally hit the big 2500!

pure lion
#

Ggggg:)))

indigo flax
#

how do u get shards

pure lion
#

Shard manager

#

Or just generate them

#

Apparently

indigo flax
#

like

#

shards.js?

pure lion
#

Nono

green kestrel
#

Me: yay 2500
Dank memer, mee6: megalul

indigo flax
#

@green kestrel how do i get shards like urs

pure lion
#

@green kestrel they are much bigger and stupider bots, do not compare yourself >:((((

green kestrel
#

A shard count in your presence?

indigo flax
#

thats my bot

green kestrel
#

Or just how to enable shards

indigo flax
#

ignore the uptime thing

#

every 24 hours

#

it adds 1 to days

#

but doesnt remove the hour thing

#

idk how to fix it

green kestrel
#

Lol

#

It's cute

indigo flax
#

but i only have 1 shard

#

ik i dont need any

#

but how do i get them

green kestrel
#

Yeah I always run my bots on multiple shards from the first server

indigo flax
#

im not good with sharding

green kestrel
#

But depending on what language you use that isn't a good idea

indigo flax
#

-shards

nimble kiln
#

You can shard without having like 1000servers minimum?

green kestrel
#

Yes

indigo flax
#

yes

#

u can shard

nimble kiln
#

mhmm interesting

indigo flax
#

with 0 servers

#

lol

green kestrel
#

Whenever you like but it isn't practical until 2500

#

Or required

indigo flax
#

my friend sharded his bot 6 times and its in

#

5 servers

green kestrel
#

Sporks has ten shards

indigo flax
#

but yeah if i shard

green kestrel
#

Doesn't need to shard yet. Just below 2300 servers

indigo flax
#

do i have to add a code

#

or something

green kestrel
#

Depends, discord.js?

indigo flax
#

yes

#

on discord.js

#

i saw them say like

#

go to package.json

#

and than change

#

main file to shards.js

green kestrel
indigo flax
#

and chaine node.js to shards.js

green kestrel
#

There's two ways to do it

#

Either each shard as a process or each shard as a connection in the same node process

indigo flax
#

also thanks for telling me so far :)

green kestrel
#

No problem

indigo flax
green kestrel
#

Bear in mind I don't use discord.js or even JavaScript so my advice may be spotty in places

#

Yes I think so @indigo flax

indigo flax
#

also my friend's bot is in like 3k servers

#

and like

#

he said he keeps getting rate limited

#

cause hes only using 1 shard

green kestrel
#

You have to shard to connect more than 2500

#

Or discord rejects your websocket connection

indigo flax
#

ok

#

wait

leaden shoal
#

can anyone help me please, I need to make sub folders work with my command handler.

---> Current Code

const fs = require('fs');

client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
    const command = require(`./commands/${file}`);

    client.commands.set(command.name, command);
}
green kestrel
#

Can't you change the second to last line to be like require (./commands/${file}/index.js) or such

indigo flax
green kestrel
#

And take the endswith off

#

Instead checking if is directory

#

@indigo flax not sure on that one, someone here will know though

#

It's worth knowing how to shard, way before you need it

#

Because if your bot suddenly grows and you don't have sharding support your growth can be kneecapped really quick

indigo flax
#

:c theres no tutorials on it

#

on how to shard

earnest phoenix
#

can anyone help me please, I need to make sub folders work with my command handler.

---> Current Code

const fs = require('fs');

client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
    const command = require(`./commands/${file}`);

    client.commands.set(command.name, command);
}

@leaden shoal
i think you can enable withFileTypes in options, it will return Dirent objects instead

#

then you can just call isDirectory() on the Dirent object

#

if it is, loop through that directory too

leaden shoal
#

can you give me a example please

earnest phoenix
#

you don't need an example for that

#

it's just passing options

#

to save yourself some pain you can create a function that reads contents of a directory

#

then you can just recursively call it inside of itself if Dirent#isDirectory returns true

leaden shoal
#

Im sorry but I think I am just kinda dumb at this time because I have no idea what you mean, but thanks for the help

compact notch
#

how can i make my webhook send messages on the channel?

leaden shoal
#

@earnest phoenix Hey sorry to bother you but I didnt really understand what you was saying in the discord. By any chance at all could you just write the code for me if possible

const fs = require('fs');

client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(./commands/${file});

client.commands.set(command.name, command);

}

Please I really need this to continue with my bot but I do understand if not

#

@compact notch what you mean

compact notch
#

i want to log the votes on a channel

earnest phoenix
#

no i cannot @leaden shoal

#

i don't spoonfeed and it's against the rules anyways

leaden shoal
#

you need to get the webhook from a channel not just the main server

#

and ok thanks for the help anyway @earnest phoenix

compact notch
#

ok

earnest phoenix
#

attempt to do it yourself

leaden shoal
#

I am and have

earnest phoenix
#

if you have any questions about the implementation

#

ask away

leaden shoal
#

ok thanks 💯

torn ravine
#

does anyone use quick.db

split hazel
#

a lot

compact notch
#

how can i make a webhook send a message?

torn ravine
#

I wanna connect my google cloud sql to quiickdb

split hazel
#

you'd have to modify the lib

#

it only supports sqlite3

torn ravine
#

oh boy...

inland shore
#

maybe use mongodb

split hazel
#

better-sqlite3 is hard coded into the whole lib

#

that's not helpful

torn ravine
#

do you have a suggestion for a better wrapper?

split hazel
#

there aren't many really, closest I really saw was a mysql wrapper for keyv

#

it's a key value json

torn ravine
#

hm.

split hazel
#

be aware the owner no longer maintains it

#

mysql/mariadb drivers should work with Google cloud sql server

torn ravine
#

thanks speedy

drifting wedge
compact notch
#

so, why isnt my webhook working?

drifting wedge
#

how can i measure the xp nesessary for the next level?

compact notch
drowsy sentinel
#

You don't use discord webhooks for voting. You use your own webhook service.

#

You have to provide your own service for retrieving and sending. All you do is access our API.

leaden shoal
#

TypeError: member.guild.channels.find is not a function

#

thats the error code I get ^^

drowsy sentinel
#

If you're using v12, it's channels.cache.find(channel => ...)

#

Channels is the ChannelManager, cache would access the collection of channels.

leaden shoal
#

ok I am thanks but where do I put that please or does it not matter

drowsy sentinel
#

I just told you.

#

Put it before the .find

leaden shoal
#

ok thanks sorry its 2am lol

#

now it says channels is not defined @drowsy sentinel

drowsy sentinel
#

Show me your code.

leaden shoal
sick cloud
#

if i install a module off gh do i ref it by the username and repo name

#

ie.
thattonybo/store on github
do i require('thattonybo/store') or require('store')

drowsy sentinel
#

No, you silly goose. It's member.guild.channels.cache.find(channel => ...)

#

I never told you to erase everything before that.

leaden shoal
#

oh my god my brain

#

thanks

drowsy sentinel
#

❤️

#

@sick cloud Just look what it's called in your package.json silly.

sick cloud
#

well it's called 'store'

#

but it's not published on npm

drifting wedge
#

is this correct

#

url = str(ctx.message.author.avatar_url)?

#

its giving me erors

#

member not found

drowsy sentinel
#

Canvas context does not discord.js objects and properties.

drifting wedge
#

Canvas context does not discord.js objects and properties.
@drowsy sentinel me?

#

im using pillow

drowsy sentinel
#

Well, I am pretty sure pillow doesn't have those either.

#

¯_(ツ)_/¯

drifting wedge
#

so what can i do?
i need to get the users avatar

#

so i can put it in the image

compact notch
#

You have to provide your own service for retrieving and sending. All you do is access our API.
@drowsy sentinel how can i access the API

drowsy sentinel
#

By setting up a webhook service and putting it in the webhook section under your bot's page in the editing page.

compact notch
#

do i have to make my own webhook?

#

then copy the url?

drowsy sentinel
#

@drifting wedge message.author is pointing to a user object. Which means it has .displayAvatarURL() method.

#

const url = message.author.displayAvatarURL();

#

@compact notch That's on you. I cannot help you with that. Read our docs and look into making your own web service for handling webhooks.

drifting wedge
#

const url = message.author.displayAvatarURL();
@drowsy sentinel im using d.py

#

isnt this d.js

drowsy sentinel
#

Then ask in a d.py discord

#

¯_(ツ)_/¯

sick cloud
earnest phoenix
#

how do I get all body.artists.name values?

"artists": [
    {
      "external_urls": {
        "spotify": "https://open.spotify.com/artist/4Fn5clYETVpCxnIcFSZhr9"
      },
      "href": "https://api.spotify.com/v1/artists/4Fn5clYETVpCxnIcFSZhr9",
      "id": "4Fn5clYETVpCxnIcFSZhr9",
      "name": "Massaka",
      "type": "artist",
      "uri": "spotify:artist:4Fn5clYETVpCxnIcFSZhr9"
    },
    {
      "external_urls": {
        "spotify": "https://open.spotify.com/artist/2u4xMsh0M2B7R8Wb3pEWae"
      },
      "href": "https://api.spotify.com/v1/artists/2u4xMsh0M2B7R8Wb3pEWae",
      "id": "2u4xMsh0M2B7R8Wb3pEWae",
      "name": "Anıl Piyancı",
      "type": "artist",
      "uri": "spotify:artist:2u4xMsh0M2B7R8Wb3pEWae"
    },
    {
      "external_urls": {
        "spotify": "https://open.spotify.com/artist/5rBUMBV7L6zPsEKnlgiOm9"
      },
      "href": "https://api.spotify.com/v1/artists/5rBUMBV7L6zPsEKnlgiOm9",
      "id": "5rBUMBV7L6zPsEKnlgiOm9",
      "name": "Yener Çevik",
      "type": "artist",
      "uri": "spotify:artist:5rBUMBV7L6zPsEKnlgiOm9"
    },
    {
      "external_urls": {
        "spotify": "https://open.spotify.com/artist/3yzGegJHrOW1CndMVFoo3m"
      },
      "href": "https://api.spotify.com/v1/artists/3yzGegJHrOW1CndMVFoo3m",
      "id": "3yzGegJHrOW1CndMVFoo3m",
      "name": "Hidra",
      "type": "artist",
      "uri": "spotify:artist:3yzGegJHrOW1CndMVFoo3m"
    }]
valid frigate
#

you just did

#

oh you mean in an array

leaden shoal
#

can anyone help me with sub folder command handling please

earnest phoenix
#

yeah

valid frigate
#

iterate over it using a for loop or forEach

earnest phoenix
#

array

valid frigate
#

for each iteration you just need to return the artist name

drifting wedge
#

hey

#

me have question about pillow

#

i know this cneter aligns text

#

but can i like align text to the right?

earnest phoenix
#

@valid frigate TypeError: Cannot convert undefined or null to object

valid frigate
#

bruh

#

that means it isnt defined

earnest phoenix
#
                body.artists.forEach(body => {
                    Object.entries(body.artists).forEach(([key, value]) => {
                        console.log(`${key} ${value}`);
                    });
#

i think i did wrong

#

artists property is undefined/null

sick cloud
#

@earnest phoenix artists is an array already

#

"artists": [ ...

#

body.artists.forEach(artist => ...

mental willow
#

how do i get the message content of a command

@bot.command(pass_context=True)
async def help(context, message):
    print(message)
    if message.content == "a-help":

the error is message is a requirment that is missing

so if i type a-help [option] i wanna get the [option] part of the command

This is python

earnest phoenix
#

@slender thistle how do u replace string?

drifting wedge
#

how do i make the number not send with a .0 at the end?

#

like i have a varable

#

in py

#

like it send like 10 istead of 10.0

slender thistle
#

I assume you're asking about python, hayper.

string.replace(what_to_replace, the_replacement_string)

earnest phoenix
#

Yes

#

@mental willow thats your answer

#

replace the command name with ""

slender thistle
#

like it send like 10 istead of 10.0
If you are sure you will get a whole number, int() or round() it

earnest phoenix
#

where is the error? too many artists write.

                const sex = [];
                for(var i = 0; i < body.artists.length; i++) {
                    sex.push(`${body.artists[i].name}`)
                
                    embed.addField('Sanatçı', sex.length ? sex.join(", ") : "Yok.")
                }
slender thistle
#

Tbh .stripleft could work for the command

earnest phoenix
#

where is the error? too many artists write.

slender thistle
#

Or use .split(" ")[1:] and see what the argument was

earnest phoenix
#

@earnest phoenix wd

#

Wdym*

#

ahahah

#

i did strange things

drifting wedge
#

also how can i align text to a box

#

like center left or right:

#

with pillow:

mental willow
#

@earnest phoenix my issue is passing the message content when the command is called

earnest phoenix
#

Gotta ahem ping the expert

#

@slender thistle

mental willow
#

it appears that i am not getting the Message

earnest phoenix
#

shIVacO heLP

drifting wedge
#

is pillow blocking?

#

and what imports does it get?

earnest phoenix
#

@drifting wedge web dev?

drifting wedge
#

pillow the python image editor thing

earnest phoenix
#

Ask shivaco

#

He is expert at python

slender thistle
#

I'm invis for a reason

earnest phoenix
#

oh

slender thistle
#

I assume Pillow is blocking unless you are running it in a threadsafe executor

earnest phoenix
#

I judt notice, sorry for disturbing

slender thistle
#

which is only a workaround and not a solution

#

@mental willow show your command

#

code

drifting wedge
#

hmm

#

can i use pil?

#

ik its outdates

#

outdated

#

but does it still work>?

earnest phoenix
#

it constantly opens .addField. what should I do for a single .addField. I'm a beginner yet

const sex = [];
for(var i = 0; i < body.artists.length; i++) {
  sex.push(`${body.artists[i].name}`)
  embed.addField('Sanatçı', sex.length ? sex.join(", ") : "Yok.")}
slender thistle
#

Don't know

mental willow
#

@slender thistle ```python
@bot.command(pass_context=True)
async def help(context, message):
print(message.content)
if message.content == "a-help":
embeded_message = discord.Embed(
title='Help Version 2.4',
description='Type a-help [option] to get specific information about a component of the bot',
color=0xffffff)
embeded_message.add_field(
name='Options',
value=f'a-help music \n a-help leveling [Currently offline] \n a-help moderation',
inline=False)
await context.channel.send(embed=embeded_message)
if message.content == 'a-help music':

slender thistle
#

and how are you using the command

#

Just a-help?

mental willow
#

a-help or a-help [option]

slender thistle
#

message = None

mental willow
#

it is erroring on the print

slender thistle
#

yes

#

use context.message

drifting wedge
#

can i use pil?

#

instead of pillow?

slender thistle
#

Have you tried asking in the Python server yet

drifting wedge
#

i have

mental willow
#

then do i need to use context.message.content when i am looking for the message content

drifting wedge
#

ealier today actually

slender thistle
#

The message that invoked the command - yes

drifting wedge
#

pil doesnt suppoer py 3

#

so PILLOW is blocking?

slender thistle
#

Don't check for message content though, that's pointless. Literally just check if your argument is equal to something

mental willow
#

ok, i will see if i can get it to work

slender thistle
#

so PILLOW is blocking?
@drifting wedge PIL, Pillow... both are sync so yes

#

See d.py docs for a workaround

#

running in executor

#

It should be in the FAQ

drifting wedge
#

gracias

#

can i use aiohttp with pillow

#

to prevent blocking?

slender thistle
#

Do I want to answer that

drifting wedge
#

no, and no

slender thistle
#

It's not hard to answer it yourself if you think about it

drifting wedge
#

yep

slender thistle
#

aiohttp is web requests

drifting wedge
#

yep...

slender thistle
#

Pillow is image processing

#

So what do you think

drifting wedge
#

no

#

im reading the docs, i cant find anything on running in executor

#

u know which part?

slender thistle
#

Oh maybe it's in the d.py server as a tag somewhere

#

Try asking there, they might either throw the tag at you or tell you to Google it

drifting wedge
#

thanks, i did google it

slender thistle
#

That's nice

chilly mason
#

im using a -say command but when i do -say @.here or @.everyone it pings everyone, how do i make it so when they use that command it doesnt ping people

Here is my code: https://srcb.in/0a7db7bf46

sonic lodge
#

add a zero-width space between the @ and everyone

chilly mason
#

how

#

other people can just do it

#

without space

#

i want my bot to not even ping

sonic lodge
#

adding a zero-width space will do just that

chilly mason
#

how

sonic lodge
#

@​everyone

chilly mason
#

like @ evryone

#

oop

#

@​everyone

#

how do u do that im so stupid

#

i want my bot to just not ping when other people use it @ here and @ everyone

sonic lodge
#

search the input content for @everyone; if it exists, replace it with @​everyone (with a space)

chilly mason
#

im kinda new and bad at coding so most of the stuff i learned is from yt, idk how to do that, do i have to do something like if(!@ everyone) return message.channel.reply('something')?

sonic lodge
#

first, get the content of the message, in your case, message.content

#

second, use message.content.replace to replace at-everyone mentions

chilly mason
#

so i put message.content.replace('@ everyone')?

sonic lodge
#

you can use one replace call to replace both at-everyone and at-here mentions

#

use this regex: /@(everyone|here)/g

message.content.replace(/@(everyone|here)/g, callbackFunction);```
chilly mason
#

ok ima try

#

it still pings

sonic lodge
#

for callbackFunction, it's a function that takes two parameters, and the second one will be either everyone or here

opal plank
#

huh

sonic lodge
#

replace alone does not change the original string

opal plank
#

what?

#

no

#

stop that

#

bad advice

#

message has mentions payload

#

no need to regex or replace anything

#

disable_mentions

chilly mason
#

what

sonic lodge
#

yeah so, i forgot that exists

opal plank
#

this

chilly mason
#

im confsued

sonic lodge
#

send() also accepts a second parameter that contains options for sending the message

chilly mason
#

?

opal plank
#

or send the embed object directly

chilly mason
#

why ami sto stupid

opal plank
#

send({allowed_mentions: parse[], content; 'CONTENT HERE', embed: 'EMBED HERE'});

#

its really not that hard mah dude

#

just add allowed_mentions on the message payload

sonic lodge
#

when someone says "function "abc" accepts a second parameter" they mean

abc(parameter_one, parameter_two)
                   ^^^^^^^^^^^^^
                   whatever this is 
chilly mason
#

i dont have an embed

opal plank
#

then dont add an embed

#

its sending the payload directly

sonic lodge
#

send(content, {disableMentions: ...})

opal plank
#

thats the structure that the api follows

chilly mason
#

ill try

opal plank
#

it accepts a json payload, aka an object(im assuming you know what a js object is)

#

each one of those is a property

#

use the ones you want, they arent all necessary

worthy glacier
#

Anyone here familiar with mongodb how do i have it so when i do a findOne() i can access the document variable outside the function like data.prefix outside of Data.findOne({ }, (err, data) => {...

earnest phoenix
#

Is it possible to know the instance of an object without using the instanceof operator? For example, here we have a GuildMember object and we want to know it's instance, it's obviously an instance of a GuildMember but we don't always know, every object has a different instance

message.member instanceof Discord.GuildMember``` so this is true, so is there a way to know the actual instance?
fathom topaz
#

Anyone

#

knows the fix of this in heroku

#

Error waiting for network: Resource temporarily unavailable

sonic lodge
#

@earnest phoenix you can use message.member.constructor.name

earnest phoenix
#

Huh, i didn't know that was possible, thanks

fathom topaz
#

someone

#

knows this error Error waiting for network: Resource temporarily unavailable

#

my bot faced 6 hrs downtime

delicate shore
#

How you host your bot

fathom topaz
#

hroku

#

heroku

#

using heroku cli i commit directly

delicate shore
#

Idk about Heroku so sorry

#

and don't use heroku

fathom topaz
#

i think i have to go get some money

#

sad

earnest phoenix
#

i wanna throw everything in folder X to my github repository Y but i don't get any of this git shit (woah that rhymed). On https://glitch.com I can just click Export to GitHub select the repo and boom but now I'm on repl.it (TEMPORARY HOST DO NOT KILL ME) and there is no export thingy. How would I upload my folder X to my GitHub repository Y? (throwing the docs at me is fine unless they're npm docs)

#

reading codeacademy's git course

karmic compass
#

Is there a way to make a .exe file that runs node index.js when opened?

#

I'm very confused on how to make one in the first place

earnest phoenix
#

Is there a way to make a .exe file that runs node index.js when opened?
@karmic compass uhh yeah

fathom topaz
#

yes

#

go to

#

uh

#

that guy who make sokobot

#

worng

#

server

pure lion
#

@fathom topaz just wait and try again later

fathom topaz
#

no i made new

#

app

#

and works

pure lion
#

In the meantime look for a new host

fathom topaz
#

ok

earnest phoenix
#

Anybody know what this error even is

<--- Last few GCs --->

[11:0x516d8e0] 38589 ms: Mark-sweep (reduce) 515.2 (524.9) -> 514.7 (525.9) MB, 1501.6 / 0.0 ms (average mu = 0.096, current mu = 0.002) allocation failure scavenge might not succeed

[11:0x516d8e0] 40093 ms: Mark-sweep (reduce) 515.7 (524.9) -> 515.2 (526.4) MB, 1503.0 / 0.0 ms (average mu = 0.049, current mu = 0.001) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

1: 0xa02ec0 node::Abort() [node]

2: 0x94e471 node::FatalError(char const*, char const*) [node]

3: 0xb765de v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]

4: 0xb76957 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]

5: 0xd311f5 [node]

6: 0xd31d7f [node]

7: 0xd3fe0b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]

8: 0xd439cc v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]

9: 0xd120ab v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]

10: 0x105802f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]

11: 0x13fdfd9 [node]

/entrypoint.sh: line 11: 11 Aborted (core dumped) ${MODIFIED_STARTUP}```
nimble kiln
#

some out of memory error Kapp
JavaScript heap out of memory

sonic lodge
#

you probably have a memory leak somewhere

earnest phoenix
#

This only happens if i try to show a collection that contains way too many objects

sonic lodge
#

then don't show all of them

earnest phoenix
#

It's with eval

#

Just

Vx_eval message.guild.members.cache``` and there it goes
#

Or js bot.users.cache

sonic lodge
#

oof i'm not too sure what's happening

#

what does your eval command's code look like

earnest phoenix
#

It's over 200 lines

opal plank
#

voltrex

#

rather than logging

#

attach a .txt file

earnest phoenix
#

I don't even log them

#

I have pagination

opal plank
#

if you eval that, console.log if length >2000, and attach them if lenght is higher than 10k chars

#

thats what i do on mine

#

(i havent figured out a way to check line count rather than char, so im using chars)

earnest phoenix
#

Showing 10 million characters as my bot is, it's fine, but showing a 8 million character collection just fucks it up

opal plank
#

that'd be my only recommendation

#

¯_(ツ)_/¯

#

try writing it on a temp .txt file and attach it

delicate shore
#

abort(RangeError: Source is too large). Build with -s ASSERTIONS=1 for more info.
(Use node --trace-uncaught ... to show where the exception was thrown)

#

wtf

#

here is full error

fluid basin
#

I like how immediately when someone gives an OOM error people say its a mem leak

#

sometimes its just because you have too much memory in use

#

@earnest phoenix did you check your bot memory usage

earnest phoenix
#

I already have, if it was a memory leak or my bot was out of memory, my vps would have thrown the out_of_memory property as true but it doesn't

fluid basin
#

wait does it only happen when trying to eval?

earnest phoenix
#

Yes

earnest phoenix
#
~/codeco-discord-bot$ git remote add bot-backup-repo https://github.com/code913/codeco-backup-repo.git
~/codeco-discord-bot$ git add .
~/codeco-discord-bot$ git push bot-backup-repo master
Username for 'https://github.com': code913
Password for 'https://code913@github.com': 
To https://github.com/code913/codeco-backup-repo.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/code913/codeco-backup-repo.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

waitWhatSpin what does this mean???

#

yeah i use github for keeping backups

#

Git pull

#

lemme try

#
~/codeco-discord-bot$ git pull bot-backup-repo master
From https://github.com/code913/codeco-backup-repo
 * branch            master     -> FETCH_HEAD
fatal: refusing to merge unrelated histories

github hates me ig

#

GIT PULL -FORCE

#

LMAO WHAT

void sigil
#

force that puppy

pale vessel
#

use the force

earnest phoenix
#
~/codeco-discord-bot$ git pull bot-backup-repo master -force
error: did you mean `--force` (with two dashes ?)
~/codeco-discord-bot$ echo lmfao
lmfao
#

lol

#

GIT PULL --FORCE

void sigil
#

LOL

earnest phoenix
#
~/codeco-discord-bot$ git pull bot-backup-repo master --force
From https://github.com/code913/codeco-backup-repo
 * branch            master     -> FETCH_HEAD
fatal: refusing to merge unrelated histories

the force wasn't enough I NEED MORE POWER
looks at banana and screams GET IN MAH BELLY

#

GIT FETCH

pale vessel
#

-f mmLol

earnest phoenix
#

GIT FETCH

#

GIT REBASE -F

#

git die

#
git commit -m "fine i'll manually upload files"
git remote remove bot-backup-repo
#
programmer - brain
= code913
delicate shore
#

why tf it gives ping in negative

earnest phoenix
#

cuz

#

bug

delicate shore
#

e

earnest phoenix
#

common in local computer timing

delicate shore
#

oh