#development

1 messages · Page 598 of 1

earnest phoenix
#

Wait---

#

What the

#

Okay, so.

#

It stopped responding to commands, But outputted no error message, and claimed it was still online??

mossy vine
#

restart it?

earnest phoenix
#

I also just changed the bots token to another one of my bots and stopped getting this error?

#

what the fuck lol

quartz kindle
#

did you already try without dblapi?

earnest phoenix
#

chceck this:

#

bot.on("message", async message => {

#

@earnest phoenix

#

if its all okey

earnest phoenix
#

AHAH!

#

I found a loop.

#

That is what would have been ratelimiting me i bet

amber gorge
#

hey everyone,
i'm new to nodejs and need some help
i'm working on a react web app for a discord bot i made and i want to access data from the discord api
i've done the auth part and i have the token i need
now i need my react app to access that token, how can i do that ?

spring ember
#

@amber gorge the react app should not call the api

#

but your web server

#

set up a web server in express or hapi.js

#

then from there call everything

amber gorge
#

yes i made one using express

#

so i fetch an endpoint on my web server ?

#

how do i store the token ?

dull bobcat
#
create_task = asyncio.async
                              ^
SyntaxError: invalid syntax

W, h, a, t. What did I do wrong wth xD???

import discord
from discord.ext import commands
import json

with open("./config.json", "r") as file:
    config = json.load(file)
    token = config['token']
    prefix = config['prefix']

client = commands.Bot(command_prefix = prefix)

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

client.run(token)
slender thistle
#

That traceback is a complete opposite of what we call 'helpful'

#

But I get it

#

You're using async with Python 3.7

dull bobcat
#

@slender thistle so?

slender thistle
#

They're incompatible

dull bobcat
#

shit

slender thistle
#

Either move to rewrite or downgrade your Python

dull bobcat
#

ok nah im not downgrading my py

#

i removed this line async def on_ready() but it still gives me same error

#

though i dont use async

mossy vine
#

the library does

slender thistle
#

async version of d.py

dull bobcat
#

fk

slender thistle
#

D.py has two versions

#

async and rewrite

dull bobcat
#

difference?

slender thistle
#

async is old, rewrite has latest features that Discord provides

dull bobcat
#

how to use the rewrite then?=

slender thistle
#

Rewrite also is more OOP-alike

scarlet bane
#

Rewrite is also not directly converted from async, you'll have to do some work to convert your code

naive mirage
#

hey if I just type "screen" in my terminal for AWS will that keep my bot running when I close the terminal

earnest phoenix
#

Heya! Just finished adding a whole tonne new commands to @granite stratus, Has anyone got some suggestions? I'm stuck on what to add now.

idle basalt
#

i dont get the purpose of the bot. cant people just click screenshare on their own thonk

bright spear
idle basalt
#

thats some nice english

spring ember
#

Wait what

idle basalt
#

database and data base in the very next sentence

spring ember
#

MY DATABASE IS OUTDATED?!?

idle basalt
#

capital Please after a comma, lowercase Discord. out-dated is one word

#

were, not where
and what the heck does that message even mean

#

"you were running an outdated database".....? isnt it your db and why do you even need a db to serve links

bright spear
#

@earnest phoenix

grim aspen
#

muted

earnest phoenix
#

its not wrong, the dialect is so advanced that we are all too stupid to understand its beauty smh

scarlet phoenix
#

I have updated your database Tell me how you got my SSL keys? zoomeyes

scarlet bane
#

wym

#

he never said he did it via SSL

#

he just updated your database

#

dw

low bolt
#

@mystic narwhal i want show member count, client.users.size is wrong

#

My bot @earnest phoenix

scarlet bane
#

y'all gotta stop

#

that is the proper approach

#

lmfao

low bolt
#

shh

earnest phoenix
#

I don't think cilent.users.size is correct tho it sounds like we're telling the height of a user.

scarlet bane
#

"Height of a user"

low bolt
#

hm

scarlet bane
#

alrighty

low bolt
#

🤔

scarlet bane
#

welp, i gave you the answer you wanted, if you want to ignore me for no reason that's on you lul

prime cliff
#

Some langs use .count though

mystic narwhal
#

I use bot.users.size for it to show member count

earnest phoenix
#

no

#

member count property provided by the api is there for a reason

low bolt
#

@mystic narwhal

#

${client.guilds.reduce((a, b) => a + b.memberCount, 0).toLocaleString()} this is correct

#

Showing correct member count

scarlet bane
#

hey you did what i said 😩

low bolt
#

@scarlet bane i know

#

so i try

#

thanks

scarlet bane
#

Good job, now go enjoy your code

earnest phoenix
#

damn discord.js

scarlet bane
#

be proud that you came up with it yourself and didn't need code samples to copy

earnest phoenix
#

I literally copy paste the codes in the internet

scarlet bane
#

Ok

low bolt
#

k

mystic narwhal
#

I made that changing status for my bot when i started to make it since then i never changed it

earnest phoenix
#

k

#

you arent guaranteed to have all users cached and your cache might not be on par with realtime updates, band aid is to request all members but then you are adding unnecessary heavy load to your app. youre also allocating more memory by calling size on each collection

tldr use the property provided by the api, not .size on the users collection

low bolt
#

When you tag one in a message and when bot deletes the message, the tag appears, how can I fix it? @scarlet bane (Sorry, i translate.)

#

Like, when i tag @low bolt, bot deleting my message and says "Don't tag SedatTR". But tag appears again

earnest phoenix
#

deleting a message with a mention wont make the alert icon go away

#

jesus christ

low bolt
#

hmm

#

what?

#

@earnest phoenix ?

scarlet phoenix
#

The ssl was a joke. Like it was a l33t h4x0r and got into a db i own

scarlet bane
#

@low bolt not sure what you mean but:

  1. if you are deleting too fast, discord has bug where message will not go away (usually only on mobile but maybe your problem)
  2. Deleting message with tag does not remove tag, only removes message. Only way to remove tag is to open channel
low bolt
#

Okay, thanks

floral stone
#

What is the rate limit for editing stuff?

#

Ping me plz if you know.

earnest phoenix
#

it isnt strictly defined

#

all ratelimits are dynamic and returned in the headers

floral stone
#

Ah. Dynamic how?

earnest phoenix
#

... dynamic

#

discords backend decides what the ratelimit is

floral stone
#

oh.

earnest phoenix
#

its not set in stone and its pretty much different on what the backend decides, hence why dynamic

floral stone
#

I understand. I want to implent an auto translator and edit it in but i don't want to hit that limit.

earnest phoenix
#

if youre using a library chances are they already handle ratelimits for you

floral stone
earnest phoenix
#

sec i need to go over their docs

floral stone
#

ALright.

earnest phoenix
#

okay so basically they handle ratelimits for you, the request will fail if you are ratelimited, im not sure if they queue it back up though like for example discord.net

floral stone
#

I'll contact the server later...

earnest phoenix
#

yeah they retry the request

#

just looked through the source

floral stone
#

ok

lusty dew
#

How do I make a redis server?

scarlet bane
#

with skill, and by reading the billions of articles about it

spring ember
#

@lusty dew again?

lusty dew
#

You didn't tell me last time

spring ember
#

There is a redis-server package in Ubuntu

#

Done

lusty dew
#

I did that

spring ember
#

And

#

Now you should have a running server

lusty dew
#

Early it didn't work

#

MK

#

Now it works

#

:/

#

Thanks dondish

earnest phoenix
#

Using custom emojis for global bot, python

Just using the emojis ID is this possible?

buoyant wagon
#

probably

midnight edge
#
  1. Have the bot be in the same server as the emoji u want to use
  2. Send the emoji urself with a backslash at the start
  3. To send that emoji with the bot, copy what the emoji becomes should be something like <a:123413134234>
buoyant wagon
#

<:emojiname:emojiid>

midnight edge
#

^

earnest phoenix
#

Yep! Then that ID can be used spliced into the code where needed and it will be on all global servers where it's used?

midnight edge
#

yeap

buoyant wagon
#

yeah

earnest phoenix
#

Sweet! Just wanted to confirm!

buoyant wagon
#

unless they turned off "use external emojis"

earnest phoenix
#

Thanks guys!

lime geode
#

Hi Guys! I'm coding discord.py and idk how I give Permissions to specific Users/Groups...

buoyant wagon
#

i only know discord.js sry can't help you

slender thistle
#

Give permissions

#

The channel or role ones?

lime geode
#

For example, I'm doing the kick command but I do not know how to do it, only owners, admins etc. can do it

slender thistle
#

Owners of the server the command is invoked in or bot ones?

#

But anyway, are you using rewrite or async

buoyant wagon
#

people with the permission Kick Members

lime geode
#

Yeah

#

I'm using async @slender thistle

slender thistle
#

Iirc there should be a @commands.has_permissions(your_perm=True) decorator

#

Unless you are doing your commands in on_message, that's when permissions_in or server_permissions come in handy

lime geode
#

Ok

sonic pivot
#

So should I remove the command or make it only work in nsfw chats?

#

And does text actually count as nsfw?

#

Because it only sends text not images

coral trellis
#

Make it NSFW only

sonic pivot
#

Tried, got burried

earnest phoenix
#

How would i detect if a member has admin/mod permissions for moderation
Like something like this?

return message.channel.send("You can't server kick members that has Admins/Mod permissions");
}```
idle basalt
#

message.member.hasPermissions(put permissions here)

blazing star
#

isn’t that deprecated

#

iirc it’s now .has

idle basalt
#

wat

blazing star
#

for d.js

sonic pivot
#

I think u can check if they have manage server or sth too

idle basalt
#

damn hasPermissions is deprecated youre right

blazing star
#

bitwise yay

idle basalt
#

but hasPermission is still there

blazing star
#

yes

idle basalt
#

on master they use stores for everything so it would be member.permissions.has()

blazing star
#

i agree

#

yea, that’s what I use

#

i think

idle basalt
#

ye same

tulip wing
#

@earnest phoenix also

#

First command should be

earnest phoenix
#

if I remove everything from github heroku can't understand

#

like you have to put bot infos

tulip wing
#

heroku git remote: -a "nameOfHerokuApp"

#

Or i am wrong with this cmd

#

wait

#

@earnest phoenix do you have what heroku requests no?

#

Procfile
requirements.txt

earnest phoenix
#

As far I know heroku mostly uses requirements.txt and bot.py

#

And also procfile

tulip wing
#

Yes

#

do you have them in the folder?

earnest phoenix
#

Yes

tulip wing
#

so

#

Create an heroku app

earnest phoenix
#

I have it

tulip wing
#

Create a new one

earnest phoenix
#

ok

tulip wing
#

And below you will see some instructions

#

do what they say

#

and should be good

earnest phoenix
#

Done

tulip wing
#

You did the instructions?

earnest phoenix
#

Wait

tulip wing
#

is something like

#

git init

#

heroku blah blah

earnest phoenix
#

It tells to add app in pipleline

#

Should I do that

#

I created a pipeline

#

I understood nothing lol

floral bloom
#

Question - Role deletion
How would I delete a role. I know how to create one, but I need to know how to delete a role too.

Ping me when you answer, please

earnest phoenix
#

lib?

floral bloom
#

@earnest phoenix Discord.js

#

Sorry, forgot to mention that

earnest phoenix
floral bloom
#

Thanks. Seems like I couldn't find it

dull bobcat
slender thistle
#

handlet
Also, are you sure accept returns a tuple? And I doubt putting recv as well as accept are supposed to be in a while loop

cursive gale
#

i'm here

#

@neat falcon

#

oof

proud pivot
cursive gale
#

i wish i knew python

#

python can get me 5gb ram 24/7 hosting

#

free

mossy vine
#

what no thats not how it fucking works

earnest phoenix
#

though you can't create high quality commands with python

mossy vine
#

yes you can wtf

cursive gale
#

no??

#

who said so many bots use python

earnest phoenix
#

but python is really good for beginner's

cursive gale
#

and soooooo many hosts give free 24/7 python hosting

proud pivot
#

but im self hosting 😛

earnest phoenix
#

Yep heroku gives 24/7 hosting for python bots

#

But you have to give your bot infos on github

#

And if you do it your bot token is public

#

And you can't get your bot in discord bot list

cursive gale
#

ok

mossy vine
#

you have no idea what you are talking about

cursive gale
#

huh

#

python bots are in discord bot list

mossy vine
#

i fucking wonder why mmLol

trim saddle
#

@proud pivot what is def on_error Thonk

mossy vine
#

(almost) all discord libraries have 100% coverage for the discord api. you can do the same things with a discord.js bot that you can do with a discord.py bot

#

also one of the first things you see on the heroku website is the node.js logo and the python logo

#

and 5gb ram on heroku isnt free its 512mb

earnest phoenix
#

Should I use JavaScript or Python for my new bot

trim saddle
#

why not both

neat falcon
#

use haxe

mossy vine
#

veld we all know you are just trying to troll

neat falcon
#

@earnest phoenix you know private repos exist

mossy vine
#

use whatever you fucking prefer

earnest phoenix
#

I'm not

cursive gale
#

i am not talking about heroku for free 5gb ram hosting

#

it's another host

mossy vine
#

what host

#

im kinda curious now

cursive gale
#

it started with sta something like that

#

yeah

#

ask @vague chasm i have said it to him several times

trim saddle
#

# i forgot i had to add this to my error handler
if str(type(err).__name__) == "Forbidden" and str(err) == "FORBIDDEN (status code: 403): Missing Permissions":
                return
#

fucking

cursive gale
#

that if only i could code in py

trim saddle
#

discord

mossy vine
cursive gale
#

oof

#

not here

trim saddle
#

python really isn't that hard

mossy vine
#

then why dont you just read the dms mmLol

cursive gale
#

yeah

#

see

proud pivot
mossy vine
#

yes that is very helpful

cursive gale
#

i have not disclosed that site to him too as i saw it on a yt vid and went to it

neat falcon
#

yikes, d.py async and not rewrite

trim saddle
#

^

dull bobcat
#

any1 well experienced in python and sockets?

trim saddle
#

also

neat falcon
#

sockets zoomeyes

dull bobcat
#

^ ?

trim saddle
#

@proud pivot switch to rewrite

cursive gale
#

i am 0.01% experienced in python any1 need my help?? for python

neat falcon
#

switch to rewrite is 100% good idea

#

0 regrets

slender thistle
#

@proud pivot use asyncio.sleep

#

Not time.sleep

#

@trim saddle isinstance(error, discord.Forbidden)

trim saddle
#

idc

slender thistle
#

Make it look good you non-human being

earnest phoenix
#

Please take the argument in dm

slender thistle
#

Who was the one serious here YamiSmug

trim saddle
#

@slender thistle no u i refuse to acknowledge the resources danny provided

slender thistle
#

Why are you using dpy then

#

smh

trim saddle
#

thats it

#

im swtching to raw discord api + aiohttp

slender thistle
#

websockets or pussy

trim saddle
#

websockets are cz_sadcatto

slender thistle
#

Not that hard

#

I can give you the very beginning and from there you will start doing shit on your own

#

(Connecting isn't hard)

trim saddle
#

import websockets

websockets.get("gay")

slender thistle
#
import websockets as uwu

owo = uwu.connect(uwuss://discord.gg/)
print('daddy, it works!')

return
viral jacinth
trim saddle
#

@slender thistle seems gay

slender thistle
#

Fits you

trim saddle
#

because im a furry? furangry

slender thistle
#

Yes

spring ember
#

@slender thistle you forgot about the quotes for the url

slender thistle
#

r/wooooosh

spring ember
#

I didn't miss the joke I just ruined it

pseudo lion
#

@cursive gale hm

cursive gale
pseudo lion
#

lets continue

#

yes

cursive gale
#

sure

#

k

pseudo lion
#

thats right

cursive gale
#

ty

pseudo lion
cursive gale
#

yayy

pseudo lion
#

this u can see in lessons about HTML

#

first lessons

cursive gale
#

no?

earnest phoenix
#

How do i stop setInterval loop

flint dew
#

Anyone know how I could fix that?

slender thistle
#

this.botlists? ThinkCorn

flint dew
#

yeah

#

this.botlists works, but when I try to go one dot deeper it errors

earnest phoenix
#

hello , i need help

grim aspen
#

ask away

earnest phoenix
#

i want if member send #rehm
bot send to him
hello hey bey

#

@grim aspen

cursive gale
#

hmm

#

what lang u using??

earnest phoenix
#

js

cursive gale
#

ok

#

do you have a const for prefix??

earnest phoenix
#

yes

#

already.

cursive gale
#

or a command handeler??

#

if(message.content === ${prefix}rhem) {
message.channel.send("hello \n hey \n bey")
}

earnest phoenix
#

ok?

lusty dew
#

I think that isn't what they are talking about

earnest phoenix
#

d d

cursive gale
#

see edited

lusty dew
#

Still

cursive gale
#

hmm

lusty dew
#

Don't think that is what they are talking about

cursive gale
#

like random ??

lusty dew
#

@earnest phoenix Are you wanting your bot to listen for what users say then respond with a response?

cursive gale
#

you want it to send random message??

earnest phoenix
#

listen listen

grim aspen
#

hold on

lusty dew
#

👀

earnest phoenix
#

i want my bot stay online , 24/7 if error read, stay online.

grim aspen
#

i was trying to figure out what you meant by it those messates

#

messages*

cursive gale
#

lol

#

ohh

#

lol

grim aspen
#

you want it to respond with all 3 messages at once or it chooses a message to send?

earnest phoenix
#

yes yes

#

yes

lusty dew
#

Uhm

#

Yes yes what?

earnest phoenix
#

such that.

#

@grim aspen

#

If member send $premium
message send such this photo

#

......

#

@cursive gale

cursive gale
#

hmm

#

you have db setup??

#

@earnest phoenix

#

and other things needed for db?

#

also wut db ya use (just curious)

dull bobcat
#
Traceback (most recent call last):
  File "C:\Users\Super\Documents\Programming\Python\ChatApp\chat.py", line 54, in <module>
    server = Server()
  File "C:\Users\Super\Documents\Programming\Python\ChatApp\chat.py", line 10, in __init__
    self.sock.bind("0.0.0.0", 10000)
TypeError: bind() takes exactly one argument (2 given)

Code: https://hasteb.in/cigicenu.py

amber fractal
#

Look at the last 55 characters of the error

#

Then look at line 10 in your code

dull bobcat
#

i see the problem but

#

idk how to fix this

#

whenever i anter another argument (my ip address) i get this error:

self.sock.connect((address, 10000))                                                                                 TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 
```
trail dagger
dull bobcat
#

maybe you should start using the third param of addField 😃

trail dagger
#

what param?

dull bobcat
#
.addField(first param, second param, third param)
#

First and second params is usually a string

#

While the third has to be a boolean

#

Just try, puttin True on your fields as a third param

earnest phoenix
#

Your bot is cool

#

not useless man

dull bobcat
#

@trail dagger mannen, gör så här på alla dina .addFields()

.addField("str", "str", true)
#

Och sen pröva o se hur de ser ut sen

#

Kmr va mycket bättre, imo

trail dagger
#

Ja kanskje

#

æ bare har det sånn for nå

dull bobcat
#

what

earnest phoenix
#

So, is there any way to stop setInterval loop?

dull bobcat
#

@earnest phoenix Ye PepegaPls

earnest phoenix
#

Then how

#

Whitenames

dusky marsh
#

clearInterval()

silent cloud
#

hey yoo guys

#

somebody can help me

#

somebody know free host for c# bot?

vapid rune
#

bg!help

#

oh yeah

#

anyway @silent cloud its much better to pay a little

silent cloud
#

i know

#

but i need to test one thing

#

i have js bot in a nice host

#

not free

#

but i need free to test

lusty dew
#
    for (let cmd of Object.values(client.commands)) {
        let conf = cmd.conf;
        if (!conf) { continue }
        if (conf.guildOnly && message.channel.type !== "text") {
            return message.reply("That command is a Guild Only command!")
        }
    }
#

This works for if the commands are being used in dms and it is set to guild only

#

But if it is set to guild only and you try and use that command

#

it errors in the server

dull bobcat
#

Fast and good text editor for scripting?

earnest phoenix
#

nano is best text editor

unique nimbus
#

nonononono notepad is

dull bobcat
#

no

#

u

mossy vine
#

neovim

#

or visual studio code

lusty dew
#

@earnest phoenix Wym notepad ++ is

unkempt halo
#

Visual Studio for C++
PyCharm for Python
Visual Studio Code for JavaScript
And Sublime Text 3 for everything

thin lance
#

So sublime for Java?

#

Sublime for Go?

#

🤔

unkempt halo
#

Java for bot development? Nice joke

lusty dew
#

Visual Studio Code can be used for almost any coding lang mmLol

inner jewel
#

the biggest bot is java

mossy vine
#

hold up, wild idea incoming
hear me out
what if.. what if
we let people decide for themselves whatever the fuck they want to use for whatever
wild idea.. i know thonkku

thin lance
inner jewel
#

very nice joke indeed

thin lance
#
V4Today at 19:07
Java for bot development? Nice joke```
you do realise that quite a few big bots are written in Java, right?
lusty dew
#

Most are JS or Python iirc

thin lance
#

But most of the big ones are in Java.

lusty dew
#

Yea some of em

unkempt halo
#

Mee6? Tatsumaki? UnbelievaBoat?

#

maybe I just don't know soo many

thin lance
#

JukeBot and Groovy to name a few.

lusty dew
#

Mee6 isn't written in Java is it?

unkempt halo
#

Python

lusty dew
#

Yea

#

Thought so

inner jewel
#

rythm - java
mee6 - multiple
dyno - js
fredboat - java
tatsumaki - js

earnest phoenix
#

JavaScript is actually easy to code

#

and there will be tons of helpers

lusty dew
#

Mee6 is written in many languages?

#

I thought it was just python

thin lance
#

microservices i'm guessing

earnest phoenix
#

hmm mee6 is like a python bot

#

Idk

inner jewel
#

the (very) old version on github is python

#

iirc

thin lance
#

yeah

lusty dew
#

the more you know

earnest phoenix
thin lance
amber gorge
#

hello everyone
what is the best way to store the discord acces token that you get from the oauth ?

inner jewel
#

a database

earnest phoenix
#

database I think.

amber gorge
#

ok

#

and who's yasmin ?

earnest phoenix
#

Yasmin is a mod

#

And also certified developer

amber gorge
#

no i mean... it was a joke

#

nvm

lusty dew
#

Lol

thin lance
#

didnt even mention the fact that they are a tutorial writer

#

smh

lusty dew
#

What happened to Ken btw?

#

Probably should take that to general actually

amber gorge
lusty dew
#

Oh also if you didn't know

earnest phoenix
lusty dew
#

Yasmin is a tutorial writer

#

THere you go COnnor

#

xD

amber gorge
#

i thaught it was a Bot Developer

#

ok i'm leaving

lusty dew
#

xD

amber gorge
#

so i fetch an endpoint on my server that gets the token from the db and then asks discord for data

#

is this how it should be ?

#

i'm looking for the best practise

thin lance
#

i just use a google cloud function mmLol

#

but yeah as long as you have a strong db password then you should be fine

#

and strong server password/ssh key auth

clear moth
#

Hello I need some help. (discord.py) How can my bot edit its sent message? I now use

await client.edit_message("Test is good!")

but it's not working.
Error:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'channel'

#

any ideas?

amber gorge
#

i think that u forgot to specify the channel

earnest phoenix
#

how is your client supposed to know which message to edit

#

use common sense

amber gorge
#

and also what message you want to edit

clear moth
#

thanks @amber gorge

amber gorge
#

np

clear moth
#

btw this is the good one:

@client.command(pass_context=True)
async def edit(ctx):
    msg = await client.say("This is a test!")
    await asyncio.sleep(0.5)
    await client.edit_message(msg, "Message")
#

if anyone needs it in the future...

amber fractal
lusty dew
#

Hello Steven

#

Lol

earnest phoenix
#

hi,um,i'm traing to add again my bot but without a desc. with spam,but i can't bacuse it says that the invite server ID is invalid,What do i do??

dull bobcat
#

cant find it

earnest phoenix
#

🤔

dull bobcat
earnest phoenix
#
@client.command
async def Hi (ctx):
     await client.say("hi")```
#

best cmd evaaar

dull bobcat
#

Helloooo?

earnest phoenix
#

Hey 👋🏼

dull bobcat
#

Can you help me?

dusky marsh
#

It's as simple as google my friend

dull bobcat
#

I did google

#

I literally said i searched for the discordpy docs but i couldnt find it

#

thanks for the link though

dusky marsh
#

Np

dull bobcat
#

How do i get the clients discord tag?

#

wth?

mossy vine
#

Read the documentation you got a minute ago

dull bobcat
#

k but i dont find anythign

mossy vine
#

Took me no more than 30 seconds to find it on a fucking phone

dull bobcat
#

How can i find something idk what im supposed to look for? 🤔

#

I literally dont know how to use the docs for discordpy

#

i searched for client

#

then a bunch of texts comes up, nothing that has with client to do but paragrahs thats include the word client

mossy vine
dull bobcat
mossy vine
#

Yes

#

Scroll down

#

Find user

dull bobcat
#

so

#

client.user is the username of the bot?

mossy vine
#

What no

dull bobcat
#

...

mossy vine
#

No its the logged in user

dull bobcat
#

right?

mossy vine
#

Idfk read the docs

#

Told you where to look

lusty dew
#

client.user

#

iirc is just getting the user object of the client

dull bobcat
#

ok

#

in JS its user.tag but what is it in py?

lusty dew
#

Oh

#

in py

#

I thought you meant in js

#

xD

dull bobcat
#

xD

#

na

lusty dew
#

Look at the docs

#

Search up tag

dull bobcat
#

Yeah i did

lusty dew
#

or smth

dull bobcat
#

I dont get anything like that

#

Just the descriminator

lusty dew
#

Well

#

you could do

#

wait

#

in python you can concatenate right?

#

Like add two strings together

#

iirc you can

dull bobcat
#

ye u can

#

what does iirc mean?

lusty dew
#

If i remember correctly

#

but anyway

dull bobcat
#

yes

lusty dew
#

without the discriminator

#

you could do

#
client.user.name + client.user.discriminator
#

or however you get the discriminator

dull bobcat
#

im smart enough to do that xD

#

though

mossy vine
#

Everything is perfectly there

dull bobcat
#

it would be easier to do this:

botU = bot.user.name
botD = bot.user.discriminator
print("%s#%s", (botU, botD))
lusty dew
#

¯_(ツ)_/¯

#

Do it your way

dull bobcat
#

ya xD thanks man

lusty dew
#

I was just offering help

dull bobcat
#

Yeah, i appreciate that

#

Thanks

lusty dew
#

Mhm.

#

Np

#

Also are you using async version?

#

👀

dull bobcat
#

yea so what xD?

#

is it bad?

lusty dew
#

Well

#

matter of opinion tbh

#

I was just asking.

dull bobcat
#

how to install the rewrite version?

mossy vine
#

Man if only there were resources that told you everything

#

Something like a documentation

lusty dew
#

or

#

a support server

dull bobcat
#

inv?

earnest phoenix
#

hi,um,i'm traing to add again my bot but without a desc. with spam,but i can't bacuse it says that the invite server ID is invalid,What do i do?? x2

dull bobcat
#

link?

earnest phoenix
#

;n;

grim aspen
#

i'm pretty sure spam is against the rules

earnest phoenix
#

yeah,i didn't know that and they delicated(? my bot ;n;

lusty dew
#

Delicated?

earnest phoenix
#

i mean declined

#

sorry i don't talk english i'm from uruguay ;n;

queen sentinel
#

spanish

#

okay

lusty dew
#

You don't talk spanish?

grim aspen
#

visible confusion

lusty dew
#

Good thing we ain't speaking spanish then

grim aspen
#

i'm pretty sure not many people here speak spanish

#

but i'm probably wrong

lusty dew
#

A good bit probably do

#

but they also speak english

earnest phoenix
#

i mean english

#

i don't talk english

#

i know english but not too much

lusty dew
#

You are talking it rn.

grim aspen
#

you missed a message

#

what language do you mostly speak then

#

like your first language

earnest phoenix
#

spanish

lusty dew
#

👀

#

But...

earnest phoenix
#

:v

lusty dew
#

more visible confusion

#

But you said you don't talk spanish.

earnest phoenix
#

I TALK SPANISH BUT I DON'T TALK ENGLISH TNT

queen sentinel
#

calm

lusty dew
#

👀

earnest phoenix
#

hekking caps >:v

lusty dew
#

Sorry for being confused

earnest phoenix
#

:v

grim aspen
#

what do you need help with again? try speaking spanish

deep pond
#

help

#

please

#

wai

amber fractal
#

nice token

deep pond
#

FUK

ruby dust
#

what is your Send defined as?

grim aspen
deep pond
#

client.send_message

#

yea i cant afford a vps

#

dont slut shame me

amber fractal
#

Repl isnt private tho

#

if you're gonna do free at least do something that's private

deep pond
#

accounts

amber fractal
#

"private"

grim aspen
#

do glitch

deep pond
#

THATS NOT THE POINT

grim aspen
#

just

#

just paste the error and we'll help

deep pond
#

look up

grim aspen
#

🤦

deep pond
#

then clicc

grim aspen
#

on my screen it's not showing the full error

deep pond
#

ok

ruby dust
#

it's a 400, which is odd to me

grim aspen
ruby dust
#

all he does is send a normal message

deep pond
#

to a user tho

ruby dust
#

that would be 403 cause forbidden

deep pond
#

exactlu

ruby dust
#

400 is when you legit did something inproperly

deep pond
#

i mean, discord did just have a spasm a couple of mins ago

ruby dust
#

so try again now?

deep pond
#

i did

#

now theres just nothing

grim aspen
#

i might've found an answer, i only know discord.js

#

though*

deep pond
#

bc its doing stuff

ruby dust
#

that doesn't solve the issue

deep pond
#

in the channel already

ruby dust
#

creeper what did you find?

grim aspen
#

i found a stack overflow answer

deep pond
#

ok

#

yay

grim aspen
#

i'm afraid i would be spoonfeeding

ruby dust
#

still confused, a normal message returned a BAD REQUEST error

grim aspen
#

well then it's not the answer i have

deep pond
#

well, i think discord is having muscle spasms

ruby dust
#

I mean, if my bot is fine then it's still you

deep pond
#

its randomly not sending messages im sending

ruby dust
#

but anyway, I'm afraid I have to inform you that you are currently using the very outdated version of discord.py, which might possibly be the core of your issues

#

I can tell that by your code

deep pond
#

wdym

ruby dust
#

hold the fuck up

#

I just realized

#

you are trying to send a message to yourself, aka bot to itself

deep pond
#

oh

ruby dust
#

no wonder why a 400 code from a normal message

#

and it's description now also makes a lot of sense too

deep pond
ruby dust
#

mistakes like this slide by me a lot as well

#

I end up staring at my code for hours until I find something odd

deep pond
#

one time i forgot an eol, and stayed up til 4 to find the missing eol

ruby dust
#

but yeah, discord doesn't allow you to send a message to yourself

#

and I'm glad that it's not protected by a 403 error instead

earnest phoenix
#

:v

amber gorge
#

hi
i'm trying to fetch a server endpoint but

#

im getting cors issue

#

with Access-Control-Allow-Origin header

#

how to deal with it ?

earnest phoenix
#

@grim aspen what do you mean with "try speaking spanish"? and i need help with this:i'm traing to add again my bot but without a desc. with spam,but i can't bacuse it says that the invite server ID is invalid,What do i do??

hushed berry
#

what did u put in for the server id lol

west spoke
#

@earnest phoenix if you are trying to the "verified server" you need to have a server added to DSL

#

i'd just leave it blank tbh

earnest phoenix
#

i got a server,i added in the discord server list,and it says that is invalid :'c

west spoke
#

i'd still leave it blank

#

just for now

earnest phoenix
#

:v

opaque eagle
#

How does publishing an npm package written in TypeScript work out?

west raptor
amber gorge
#

how to use the refresh token to get a new access one ?

hushed berry
amber gorge
#

oh and i add the scopes too ?

#

ok

green swan
#

const dbl = new DBL(process.env.API, { webhookPort: 3000, webhookAuth: 'password' }, client);Error:```app@:~ 23:10
$ node bot.js
events.js:167
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (net.js:1290:14)
at listenInCluster (net.js:1338:12)
at Server.listen (net.js:1425:7)
at DBLWebhook._startWebhook (/rbd/pnpm-volume/0b28cce5-8ed1-4100-8276-eb9a8aee3f33/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/webhook.js:45:18)
at new DBLWebhook (/rbd/pnpm-volume/0b28cce5-8ed1-4100-8276-eb9a8aee3f33/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/webhook.js:27:12)
at new DBLAPI (/rbd/pnpm-volume/0b28cce5-8ed1-4100-8276-eb9a8aee3f33/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/index.js:69:22)
at Object.<anonymous> (/app/bot.js:11:13)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
Emitted 'error' event at:
at emitErrorNT (net.js:1317:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)```I'm trying to use glitch for my discord bot, but the dbl webhook keeps interfering. There is only one available port for glitch (3000) but that does not work?

earnest phoenix
#

have you tried reading the error before you cp'd it on here

#

ah nvm i got it

#

im blind

#

simple solution; dont use free hosting

scarlet bane
#

Does glitch even give it's containers an ip?

earnest phoenix
#

i think so

#

im not sure, never used it

scarlet bane
#

Either way, either you have a program using port 3000 already, or someone else does

green swan
#

ok then

#

Well glitch ports only run 3000

#

I've tried all other ports but not work.

amber fractal
#

Well because of what you said

#

They dont allow any other port

scarlet bane
#

You almost definitely have two sessions of your bot running

green swan
#

Oh ya I do. ty

#

I have glitch auto running code for the bot.

#

I'm stupid lol

scarlet bane
#

rip

#

glad to help

green swan
#

👌

lime geode
#
  File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>                        start(fakepyfile,mainpyfile)                              File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start                           exec(open(mainpyfile).read(),  __main__.__dict__)         File "<string>", line 1, in <module>                        File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/__init__.py", line 20, in <module>                                                from .client import Client, AppInfo, ChannelPermissions   File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/client.py", line 38, in <module>                                                  from .state import ConnectionState                        File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/state.py", line 36, in <module>                                                   from . import utils, compat                               File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.7/site-packages/discord/compat.py", line 32                                                               create_task = asyncio.async                                                           ^                             SyntaxError: invalid syntax                                 
[Program finished]```
earnest phoenix
#

I made a setnick command

#

but it says missing permission

#

but i am guild owner, and the bot has admin

scarlet bane
#

You can't change the nickname of people above you afaik

#

like, role wise

#

@lime geode the error says exactly what your problem is. try reading it

earnest phoenix
#

thx boo

lime geode
#

@scarlet bane I have read the text but I still do not understand what exactly is wrong...

scarlet bane
#
create_task = asyncio.async                                                           ^                             SyntaxError: invalid syntax                                 
[Program finished]
lime geode
#

But that is not in there

amber fractal
lime geode
#

But if I add it, it certainly does not start

amber fractal
lime geode
#

Thx

#

Wow he still does not start...

hushed berry
#

What happens if you try and get index zero of an empty array in js?

#

ie, [][0]

#

does it return undefined/error/something else?

amber fractal
#

Undefined

dense current
#

dbl.getVotes() return users who did not vote

#

;-;

#

half random

#

sometimes yes sometimes no

earnest phoenix
#

:v

amber fractal
dense current
#

yes

amber fractal
#

@dense current

dense current
amber fractal
#

the last 1000 votes

#

can be false

dense current
#

100 votes .-.

#

or down

amber fractal
#

Wait

dense current
amber fractal
#

Wait no I'm just an idiot

dense current
#

20 votes

amber fractal
#

why not use hasVoted?

#

Or do you need all the votes

dense current
#

I want to catch everyone

#

need all votes

#

but it returns random users

#

sometimes correct

#

sometimes incorrect

amber fractal
#

hm

dense current
#

i use console.log

amber fractal
#

When were those logged

#

like how long apart

#

Just now?

dense current
#

s

earnest phoenix
#

i just invited you're bot to my server @dense current

dense current
#

@earnest phoenix hmm

#

@earnest phoenix @amber fractal Vote for me to test.

earnest phoenix
#

oki

dense current
#

@earnest phoenix is a webhook

#

wait

earnest phoenix
#

ok

dense current
#

where are you

#

...

#

@amber fractal look ^

earnest phoenix
#

thats rare

amber fractal
#

I dont know then, sorry

#

could be dbl

#

being dbl

scarlet bane
amber fractal
#

Did you read below

#

at all?

dense current
#

@amber fractal GWsetmyxPeepoSad

scarlet bane
#

smh

amber fractal
dense current
#

@amber fractal what do I do GWvertiPeepoSadMan

earnest phoenix
hushed berry
#

@amber fractal thanks.

amber fractal
#

I'm not sure I dont know why it wouldnt work

dense current
#

@earnest phoenix this is not whit getVotes

#

"hasVoted"

earnest phoenix
#

:v

dense current
#

sorry my english kk

#

i'm brazilian

earnest phoenix
#

i'm latina(?

#

:b

#

i talk in spanish

copper cradle
#

I also speak spanish

lime geode
#
  File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>                        start(fakepyfile,mainpyfile)                              File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start                           exec(open(mainpyfile).read(),  __main__.__dict__)         File "<string>", line 8                                       create_task=asyncio.async                                                           ^                               SyntaxError: invalid syntax                                 [Program finished]```
#

•-•

scarlet bane
#

2nd time you've posted this

lime geode
#

Yeah

scarlet bane
#

/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py

create_task=asyncio.async
^ SyntaxError: invalid syntax

#

if that doesn't help you

#

idk what will

#

if you don't own that file, or have never heard of it before

#

you can google it

lime geode
#

This her is not possible:
create_task = getattr(asyncio, 'async')

scarlet bane
#

Look at different answers.

#

Usually first answer is best

#

Also, a bot is not something you should be making if you have not programmed before

#

bots are complicated, if you cannot google a problem this simple and find an answer quickly, you clearly are not ready for the pain that is about to come

west spoke
#

xd

#

very

#

make a text based game, since you are working with python

misty anvil
#

hey guys i keep getting Error: certificate is not yet valid
how long does it take?
i just switched hosts so that might be why

earnest phoenix
#

Probably

misty anvil
#

how long does it take usually ? 24 hours?

earnest phoenix
#

More or less

#

@misty anvil

misty anvil
#

thumbsupblob thanks

earnest phoenix
#

even though i reject it

#

so it shouldnt fire .then

#

correct?

#

or is .then fired regardless

#

I just do my shit through a mobile app

#

Like commands

dusky marsh
#

Propesterous boast yet alas

earnest phoenix
#

i got it working

#

it was a problem with how i chained the .then and .catch

lusty dew
#
2019-04-05 23:35:08.275  WARN 8196 --- [         japp-1] lavalink.server.player.EventEmitter      : Billie Eilish - Ocean Eyes (Official Music Video) got stuck! Threshold surpassed: 10000
2019-04-05 23:35:11.354 ERROR 8196 --- [ack-13-thread-1] c.s.d.l.t.p.LocalAudioTrackExecutor      : Error in playback of viimfQi_pUw

com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track.
#

Does anyone know what this error means?

#

I am using lavalink btw

spring ember
#

That's normal

#

Sometimes tracks get stuck

lusty dew
#

Ah mk

#

Is there a way

#

I can like

#

send a message in the discord chat

#

if that happens?

earnest phoenix
#

Nope

#

Or

#

if(err) return ...

spring ember
#

@lusty dew is that the python client?

lusty dew
#

Wait wut?

#

I am using discord.js

#

if that is what you are meaning

#

but I got it fixed

#

My bot was erroring

#

so it was "stuck"

spring ember
#

LavaLink is not dependant on your bot

lusty dew
#

o I mean

#

No*

#

something was wrong with the play command and the queue system that I had made that made lavalink error

#

I can't really explain it well

spring ember
#

That's not what the message says

#

But ok

ornate kernel
earnest phoenix
#

@earnest phoenix if it doesnt load from a browser client/any other client then its discord proxy issue, otherwise its just your client and internet being gay

dull bobcat
#
    bot.commands.set(commandName, props);
                 ^

TypeError: Cannot read property 'set' of undefined

How come

coral trellis
#

bot.commands doesn't exist

dull bobcat
#

it does

#

thats the problem..

#

it does..

earnest phoenix
#

it does

jagged birch
#

it does

dull bobcat
#

Nothing is working with the command, in my cmd it says stats.js is logged but whenever i run my command nothing gets executed

#

I tried commenting everything in the exports.run and just a console log

#

but nothing was logged either

#

there is a bug in the js file but idk what, help?

late hill
#

cmdFile - commandfile

dull bobcat
#

what?

late hill
#

index.js line 30

dull bobcat
#

ohh i see

#

simple mistake my b

#

xD

#

well

#

god

#

it still doesnt work..

#

ffs

#

@late hill help pls

late hill
#

You're cutting off the prefix twice?

earnest phoenix
#

I used this code so whenever use !goodnight it gives a goodnight message and a pic too
@bot.command()
async def goodnight():
await bot.say('Goodnight')
e = discord.Embed()
e.set_image(url="https://discordapp.com/assets/e4923594e694a21542a489471ecffa50.svg")
But it tells this
Traceback (most recent call last):
File "/data/data/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module> start(fakepyfile,mainpyfile) File "/data/data/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start exec(open(mainpyfile).read(), main.dict) File "<string>", line 28, in <module> NameError: name 'e' is not defined Unclosed client session client_session: <aiohttp.client.ClientSession object at 0xb5f0ccd0> [Program finished]

slender thistle
#

What the fuck is that formatting

#

Also, your e.set_image is not under command goodnight

earnest phoenix
#

hmm

#

what I did wrong there lol

slender thistle
#

I... just told you

earnest phoenix
#

That's what I am saying

#

what mistake I did there

gleaming tulip
#

spacing?

slender thistle
#

Indentation, it is

earnest phoenix
#

Yeah it tells indentation error now

#

what should I do

#

I wanna attach a image in !goodnight command

slender thistle
#

... Indent it?

dull bobcat
#

Ok any1 available to help me?

late hill
#

Still same issue?

#

?

earnest phoenix
#

How can I attach image to a command?

#

I'm using python

dull bobcat
#

Code:

let array = [ "Content1", "Content2", "Content3"];
let fAr = array.filter(); console.log(fAr);
let mAr = array.map(); console.log(mAr);

Error:

let fAr = array.filter(); console.log(fAr);
                  ^
TypeError: undefined is not a function

How come? 😂

mossy vine
#

excuse me what

dull bobcat
#

excuse me what

mossy vine
#

is filter() even a function?

dull bobcat
#

it is

#

🤦

mossy vine
#

yeah it is but you are doing it wrong

#

it takes a callback, thats why it says "undefined is not a function"

#

and you didnt provide it with a callback

#

so its undefined

dull bobcat
#

Ok fixed it

#

The link you sent me helped me alot thanks @mossy vine

#

Though, there is something else I wanna do but idk how and what to use

#

My roles in rank

xx
Admin
Mod
Member

This code ```js
member.roles.filter(x => x.name !== "@everyone").map(r => r.name).join(", ")

Outputs this:

Admin,Member,Mod,xx

The roles are sorted by A-z i guess but i dont want that, i want the highest role to be first, and then so on
earnest phoenix
#

sort by role position then map

dull bobcat
#
//Variables
let mGame = member.user.presence.game;
let type = { 0: "Playing", 3: "Watching" }
//In my embed
.addField('Activity', `${type[mGame.type] || "Nothing"}(${mGame.type || ""}) ${mGame || ""}`, true)

I get this error:

.addField('Activity', `${type[mGame.type] || "Nothing"}(${mGame.type || ""}) ${mGame || ""}`, true)
                                      ^

TypeError: Cannot read property 'type' of null

How do i fix this?

earnest phoenix
#

Uh

#

Headache

dull bobcat
#

?

#

How

#

xD

earnest phoenix
#

Just type are not correctly define

dull bobcat
#

It is

#

It works perfectly

earnest phoenix
#

first check if the user is playing a game in the first place

dull bobcat
#

@earnest phoenix I am xD

#

and if the user is not

#

i want it to send "nothing" instead of erroring

earnest phoenix
#

can you send the code for it?

carmine echo
#

Quick question. How long does it take for discord bots to update the profile pic of the bot?

#

(usually)

earnest phoenix
#

there isnt really a middle ground there

#

it depends on your up speed, api latency and if the api servers are optimal and stable at the moment

carmine echo
#

No no... that's not what I meant

#

I meant for this server's website to update it as the old one is still cached

earnest phoenix
#

ah

#

@carmine echo 5 minutes

carmine echo
#

epic, it's been longer than that