#development

1 messages · Page 1398 of 1

earnest phoenix
#

Pycharm has support for R

frank crescent
#

What kind of uses does R have

earnest phoenix
#

@frank crescent if you just want to code in python I'd recommend pycharm but if you wanna learn other languages like Golang java c or js keep using vscode

frank crescent
#

I do plan to learn other languages

#

And I was actually thinking of switching to

#

Atom

earnest phoenix
#

Atom is like vscode

#

With multiple language support via plugins

#

why is my bot not approved

#

how can i make it approved

sudden geyser
#

because it hasn't been approved yet

earnest phoenix
#

but how do i approve it

sudden geyser
#

it can take a while. a mod reviews it

frank crescent
#

This guy

earnest phoenix
#

ah ok

sudden geyser
#

you'll need to be patient

errant perch
#
      setInterval(() => {
        const tdvApi = require('tradingview-scraper');
        const tv = new tdvApi.TradingViewAPI();
        var array = ['719362069975138354', '331222209299349504']
          async function alertPrice() {tv.getTicker("aapl")}
            alertPrice().then((resp) => {
              for (var i = 0; i < array.length; i++) {
                console.log(resp)
                console.log(array[i]);
          }
            });
    }, 5000);``` resp is returning as undefined please help i dont know what else to ask
frank crescent
#

Do you have the error message

errant perch
#

it is successfully looping through each id though

#

no its just undefined

frank crescent
#

Oh

#

Interesting

sudden geyser
#

uh

#

You aren't returning anything (no return)

errant perch
#

i mean

#

resp is undefined

sudden geyser
#

and that's not solving the issue I pointed out originally

#

because you don't return anything. An async function is going to return a Promise

#

The value in this context will just be undefined

earnest phoenix
#

@frank crescent if you want to backup your code or make it so that you can code your bot anywhere put your bot onto a private github repo

frank crescent
#

What's that

earnest phoenix
#

Github is a website where you can put your source code

#

There's gitlab too

midnight blaze
#

a good question to ask is: why

errant perch
#

ay thanks g i got it working 🤝

frank crescent
#

I keep back ups of my code

#

So generally

#

What would you guys say is a good next step for me as a python programmer

#

B]

sudden geyser
# errant perch ay thanks g i got it working 🤝

No problem, but the original issue with your problem was with promises and resolving on time. To solve this, I suggested you use async/await like this: js setInterval(async () => { for (...) { let resp = await tv.getTicker("appl"); // resp will be the value of what the promise holds. // ... } }, 5000)

#

4 Slice, in my opinion, if you already know Python, put your knowledge to the test by working on whatever project you're working on. If you know it, but still want some help, look at some resources to learn it, like the three I gave above. You should focus on what's relevant right now rather than what's relevant later because you'll eventually get there.

errant perch
#

thank you for your time and help dude

frank crescent
#

Thank you lite

#

Wise words

fresh sky
#

I have a question?
what are some good commands that can help make people want to use our bot?

sudden geyser
#

That's more of an issue with what you want your bot to be about rather than how to get people to use your bot. None of us are analytics, but at most, we can say you need to make something unique and a good way of presenting it to users.

frank crescent
#

Is it possible to profit from a bot

sudden geyser
#

yes

#

look no further than mee6

frank crescent
#

What?

#

And dyno right?

#

Dyno prime

sudden geyser
#

yes

frank crescent
#

But what about a bot itself

sudden geyser
#

wdym a bot itself.

#

mee6 and dyno are bots

frank crescent
#

Yeah but the revenue comes from the extra perks you'd need to buy

sudden geyser
#

like if you mean a bot and only the bot

#

like no dashboard

frank crescent
#

Yeah

sudden geyser
#

Yes. If you have some way of a user making transactions and the user wants to, you make money off it.

frank crescent
#

So discord wouldn't pay you

#

For making a sick ass bot

sudden geyser
#

probably not discord.

frank crescent
#

Damn

#

My friend lied to me

earnest phoenix
#

Pygame is pog

frank crescent
#

Why is pygame so pog

earnest phoenix
#

It's a game sdk for python

#

Python is also used as a web framework

split hazel
#

it's also used as anything

#

it's a universal language

#

you can pretty much do anything with it nowadays

frank crescent
#

So why learn other languages?

sudden geyser
#

not everything

frank crescent
#

Python gang ✊

sudden geyser
#

It's about choosing the right tool for the job.

split hazel
#

if you really want to you can use python for everything but every language has its advantages and disadvantages

sudden geyser
#

JavaScript is very popular as well but sucks in a lot of departments.

split hazel
#

same applies to any language with bindings

#

some languages are better for certain things

#

the i/o event driven infra of nodejs made it really popular as a backend web server

#

see python a lot more popular in client sided apps

frank crescent
#

Can someone summarise json to me quickly

split hazel
#

key value data structure

#

in a nutshell

earnest phoenix
#

Yeh

frank crescent
#

My guy Jason

earnest phoenix
#

Sometimes json is used as a config file oh god fuck Minecraft config json files

frank crescent
#

Interesting

#

I wish I got the joke

#

B[

split hazel
#

i found it odd that they use json files quite often

#

i mean nothing wrong with it but just a bit unusual

#

for a program like that

earnest phoenix
#

@frank crescent basically Minecraft datapacks uses json files to mod the game

frank crescent
#

I feel like I need a slightly more in depth explanation

#

To what a json file is

earnest phoenix
#

and Minecraft forge mods uses either yml, cfg or a json

frank crescent
#

I need sleepth

#

Gn

pale vessel
#

Gn Toaster

torn hollow
#

How can i reset my bot of discord?

#

With the terminal

earnest phoenix
#

hi

#

hi

#

can u help me with sum

stiff salmon
torn hollow
modest crane
torn hollow
#

I wrote "node ." for turn on

#

Now i put new code, saved and control c

torn hollow
#

But now my code not run

safe creek
#

how do i make my bot send a message when it gets invited into a server

#

do kinda like

#

Thanks for inviting me. blah blah

quartz kindle
#

guildCreate event

boreal iron
#

Damn

#

While I’m typing...

safe creek
#

discord py right

#

@quartz kindle

quartz kindle
#

guild_create in dpy i believe

#

check the docs

safe creek
#

mmmk ty

boreal iron
#

Don’t u sleep sometimes Tim?

quartz kindle
#

i go sleep now

#

its 2am

#

xd

boreal iron
safe creek
#

its 2:15 am here

boreal iron
#

Well have a good one

quartz kindle
#

collected.user

#

actually, collected is a collection

#

so collected.first()

torn hollow
#

Before my code was running but I put what's green and it doesn't do anything anymore, I don't know what to do, suggestions?

quartz kindle
#

actually is a bit more complicated

#

collected.first().users.cache.first()

#

but it wont work if your bot already reacted

torn hollow
#

Hablas español?

quartz kindle
#

no

faint prism
#

How often do you guys see people trying to get the user count for their bot nowadays?

quartz kindle
#

hmm?

faint prism
#

Before privileged intents for members

umbral zealot
#

What does privileged intents have to do with userbots

faint prism
#

Count

#

Sorry, voice to text

quartz kindle
#

oh user count?

faint prism
#

Yeah

umbral zealot
#

I mean, anytime someone brings it up, I tell them it's against the ToS and not to do it and they won't get any help with it - that's the only valid response.

faint prism
#

I'd imagine pretty often

quartz kindle
#

lmao i see tons of people complaining about how their user count is suddenly wrong

#

even on discord.js's github

umbral zealot
#

Oh! Sorry i missed that edit

faint prism
#

I was confused initially as well. When my bot got verified, I'm pretty sure they declined my privileged intent request just so I can list users by niceness. They basically told me to just store it in my database :P

umbral zealot
#

You don't need privileged intents to get a member or user count.

faint prism
#

Which makes sense, easier on discord

quartz kindle
#

guild.memberCount still exists, just wont be updated without server members

umbral zealot
#

untrue, the membercount is given to all bots

#

regardless of their intent status

quartz kindle
#

yes

#

it just wont be updated

umbral zealot
#

I'm not sure what you mean by that.

quartz kindle
#

libs update it via memberAdd/memberRemove

#

guild.memberCount++

umbral zealot
torn hollow
#

How can i do what a message be deleted after 3 seconds of my bot?

drifting wedge
#

how can i rank a mongodb database

quartz kindle
#

you can fetch approximate count

#

its a different prop than memberCount

drifting wedge
#

like get a list of the user's by sorting thru the guild id?

quartz kindle
#

the one you get at login

umbral zealot
#

sounds like there wouldn't be much difference in the end

quartz kindle
#

the difference is mostly irrelevant, but its still a difference xd

umbral zealot
#

You have got to be seriously obsessed with insignificant details if that difference is relevant to you.

quartz kindle
#

yup

#

but memberCount will remain unupdated in the long run

#

you need to fetch approximateCount periodically and use it instead

safe creek
#
async def ping(ctx):
    await ctx.send("Pong!")(latency = float)``` it works but it only says pong and no latency
#

theres no errors being shown either

quartz kindle
#

lol

boreal iron
#

i go sleep now

#

he he

quartz kindle
#

i go sleep now for real

boreal iron
#

It’s like a drug being here

#

You can’t

quartz kindle
#

just reposted carpal's code for the memes

#

see ya

boreal iron
#

Bb

safe creek
#
async def ping(ctx):
    await ctx.send("Pong!")(latency = float)```
 it works but it only says pong and no latency
theres no errors being shown either
#

did i miss something?

boreal iron
#

How about adding the latency inside your send() function? KEKW

safe creek
#

i knew it

#

ugh i need sleep

hollow sedge
#

"coding is easy"

safe creek
#

Fuck off

hollow sedge
#

😆

modest crane
#

lol

rotund trellis
#

Hey guys!

#

I wanna ask a question

#

Cus someone is asking that

#

Can we use apps to make bots and verify it on top.gg?

umbral zealot
#

What do you mean "use apps" ?

rotund trellis
#

Like those apps like "Bot designer for discord"

#

?

#

Hello?

#

Anyone?

modest crane
#

yes you can

rotund trellis
#

Do you think that the bots using Bot designer for discord will get verified in top.gg?

#

I don't think so

umbral zealot
#

It will if you actually write commands and content for it. But if all you do is make a clone of the default app and submit it, it'll be denied because what would even be the damn point?

rotund trellis
#

Oh good

#

Now I'll warn my friend

hasty mulch
#

Any recommendations on an API to use to get the current weather conditions of an area?

harsh lake
#
const client = new discord.Client();

client.on('ready', message => {
  console.log('I am ready')
})

client.on('message',message =>
         if(message.content  === '+ping')
             message.channel.send('Hi, You pinged me?')
          }
})``` 

I added this code..but id why the bot isn't coming online..whenever  I start code..the bot comes online..but nto this time..
umbral zealot
#

do you even have a client.login() line?

harsh lake
#

Yes..

#

I even added token in it..

umbral zealot
#

what happens when you run it?

#

like, when you run node index.js ?

harsh lake
#

I saved the file...and the bot is still offline

umbral zealot
#

Did you run the file?

harsh lake
#

How to?

#

I use Glitch...

umbral zealot
#

then that file name should be called index.js

#

and it'll start automatically

harsh lake
#

It doesn't as that I guess...And, I just started making bots a day ago!

umbral zealot
#

Note that glitch is not an appropriate place to host bots as you cannot maintain them there 24/7

harsh lake
harsh lake
#

Ok...I'll figure something out! Thx for help!

hasty mulch
umbral zealot
#

👍

hasty mulch
#

It’s a search, not a recommendation

umbral zealot
#

So.. what you're saying is, you don't want to bother doing any research or testing on your own.

#

openweathermap is fine. It's recommended... literally by the search algorithm of google.

hasty mulch
#

I would rather use one that has been tested by other developers by Discord and has proven to work

umbral zealot
#

If they're on the front page of google search, they've actually been proven to work.

slender thistle
#

Many of the popular ones actually work /shrug

umbral zealot
#

And "other developers on Discord" isn't relevant - the fact that you're doing this from Discord has no impact on the quality of the results you'd get from an API.

hasty mulch
#

Well, it’s my second API

#

The first one worked flawlessly and I would like to keep that streak going

#

Sorry that I want to be careful

umbral zealot
#

No you want others to be careful for you, and trust their word over actually testing things yourself.

#

why would you trust other random devs over your own data?

hasty mulch
#

-_-

#

Whatever...

umbral zealot
#

Seriously though, openweathermap is a great API

#

It's not at the top of the results by chance, y'know.

solemn latch
#

I hear the accuweather api is fantastic.

steep sun
#
 let channeMen = message.guild.channels.cache.find((x) => (x.name === "general")) // Let the bot send the embed to channel called general.

How do I prevent the bot from sending it if there's 2 channel with the name general?

sudden geyser
#

Instead of using .find, use .filter and check if the .size (.filter returns a new collection, so it has a size property) is equal to 2.

#

If you'd like to save on a bit of performance, you could short-circuit it by making it stop as soon as you find two channels (save a variable and increment it for each pass, see if a second one passes and break).

earnest phoenix
#

Hi im new at bots and coding and can someone help me with the script whenever i try to run it "SyntaxError: Identifier 'Discord' has already been declared" can someone help?

solemn latch
#

are you declaring Discord twice?

steep sun
earnest phoenix
#

im pretty dumb

#

lmfao

sudden geyser
solemn latch
#

a declaration looks like this.

const Variable = 0;
^ are you doing something something like this twice for Discord.
@earnest phoenix

earnest phoenix
#

uuuh lemme check

earnest phoenix
#

@solemn latch like this "const Discord"

solemn latch
#

yeah

earnest phoenix
#

if not idk

earnest phoenix
solemn latch
#

you can only declare something once

earnest phoenix
#

oooh

#

thanks

#

so do i delete the other ones and keep the first one?

earnest phoenix
#

thx

#

I did that and i still says the same thing...

solemn latch
#

do you have a third declaration?

earnest phoenix
#

i deleted 3/4

solemn latch
#

lol, are you copy pasting code from somewhere?

earnest phoenix
#

no

#

i asked my friend

#

and he changed the code

#

to that

solemn latch
#

ah

earnest phoenix
#

and im confused CH_Pepeconfused

solemn latch
#

are you also declaring Discord multiple times?

#

discord and Discord are separate variables

earnest phoenix
#

idk

#

can i dm u rq

#

i gotta eat dinner

solemn latch
#

I'm about to go to bed anyway

#

I'm sure someone else will be around to help.

steep sun
earnest phoenix
#

I need help with my bot. This is my first bot and when i try to run it "SyntaxError: Identifier 'Discord' has already been declared" pops up

#

@steep sun

steep sun
#

You're using discord.js right?

earnest phoenix
#

yep

steep sun
#

Did you find anything in your code like:

const Discord = require("discord.js")
const Discord = require("discord.js")
earnest phoenix
#

I had 4 but deleted 3

steep sun
#

Does it still shows some errors?

earnest phoenix
#

no

hazy sparrow
#

is message.channel.delete valid in d.js v12?

earnest phoenix
#

idk

steep sun
steep sun
earnest phoenix
#

it did in the beginning but after i added more code it doesnt

halcyon linden
#

Guys do you know a npm for twitch notifications?

#

I wrote terrible

steep sun
halcyon linden
halcyon linden
#

But nothing good unu

steep sun
#

Well, maybe there isn't...

hazy sparrow
halcyon linden
#

What you wanna exactly do?

hazy sparrow
#

i wanna make a command which deletes a channel and remakes it with the same topic, permissions, etc but i cant find how to delete the channel

sudden geyser
halcyon linden
#

Yes

slender thistle
#

does djs have a clone method?

sudden geyser
#

Is it a TextChannel? Yes, you can delete it.

#

I don't think so (maybe). What do you need to clone for?

halcyon linden
#

But he wanna restore it

hazy sparrow
#

yeah text channel obv

sudden geyser
#

oh I see

slender thistle
#

Isn't that what bow pro is aiming for

halcyon linden
#

._.XD

#

well

sudden geyser
hazy sparrow
#

i just wanted to ask how to delete a text channel

halcyon linden
#

you can use a map to clone the channel things (idk exactly)

#

to storage in cache

hazy sparrow
#

so its just message.channel.delete?

halcyon linden
#

@hazy sparrow

#

See that one

hazy sparrow
#

thanks!

halcyon linden
#

No problem

tribal siren
#

Worn Off Keys is one of the best discord.js tutors

#

But still DashCruft is better 😎

earnest phoenix
#

@earnest phoenix have you ctrl S

halcyon linden
#

Yes

#

I made it

#

@hazy sparrow

topaz fjord
#

technically they're not needed

#

but it's good practice

earnest phoenix
#

yes

ornate tree
#

LOOKING FOR A Bot Web Developer, I Have A Large Bot But Need a Website DM me or reply to this!

dull blade
sage bobcat
#

One message removed from a suspended account.

stable eagle
#

Simple

#

Semicolons are useless in js (except if its a for loop)

unborn ridge
#
  let chx = db.get(`welchannel_${member.guild.id}`);
  let msx = db.get(`welmessage_${member.guild.id}`);
  let data =  canva.welcome(member, { link: "https://wallpapercave.com/wp/wp5128415.jpg" })
  if (!chx || chx === undefined)
  return;
 
      const attachment = new Discord.MessageAttachment(
        data,
        "welcome-image.png"
      );
      client.channels.cache.get(msx).send(msx,attachment) 
  }
  
 
);
#

hi

#

pls

#

help

#
      client.channels.cache.get(chx).send(msx,attachment)
                                    ^
#

pls

#

pls

earnest phoenix
#

it is

unborn ridge
#

😶

earnest phoenix
#

in certain cases the interpreter can get confused where you want to end the line if you're not using them

#

happened here before

#

which obviously messes up your logic flow and potentially gives you a mental breakdown

cedar gyro
#

Hey, I have

 .whole-thing {
    background-color: '3E3B3B';
    color: 'white';
    font-family: 'Oswald', sans-serif;
    }```
And ```html
<div class='whole-thing'>
//stuff here
    </div>```
But the background color isn't applied and nor is the text color, anyone know why?
cobalt spruce
#

guys

#

how i can add multiple ids to this

    "multiple id": "id"
#

anyone?

slender thistle
#

id: [id1, id2]

cobalt spruce
#

no need for ""

#

??

slender thistle
#

I gave you the general idea. Now, whether to use it should be judged by you

cobalt spruce
#

@slender thistle nvm

#

i dont know why i asked

cobalt spruce
#

why r u dead now

#

guys

torpid whale
carmine summit
#

add it.

#

(error, response, body, additionalParameters)

torpid whale
#

🤔

#

ok

carmine summit
#

also, replace "Bearer " with your authorization token

#

@torpid whale

torpid whale
#

oh, in the docs its bearer and then token

#

so i removed token in this

carmine summit
#

right

torpid whale
#

this is callback

#

(error, response, body)

humble rock
torpid whale
humble rock
#

I think.... you can add parameters but it hasn't no function

#

(Sorry for my en, im not english)

torpid whale
#

ehm, what do you mean by it hasn't no function?

humble rock
eternal osprey
#

I have asked this question several times. I have been stuck now for almost a week. Still can’t figure out this problem:
https://hatebin.com/knkauwpabw

look at the code, line 52. TypeError: Cannot read property 'toLowerCase' of undefined

#

I have logged everything for the people asking

torpid whale
#

(if you have logged, show previous one)

eternal osprey
#

okay I will do it when I am on pc, and then I will show everything

vale garden
#

hello

#

does anyone know how i can put this error instead of except statement

#
raise CommandOnCooldown(bucket, retry_after)
discord.ext.commands.errors.CommandOnCooldown: You are on cooldown. Try again in 86397.04s
#

except CommandOnCooldown: isnt working

#

except discord.ext.commands.errors.CommandOnCooldown: isnt working either

junior wharf
#

hey,
idk if this is the related channel but i have a question:
'Detailed description of your bot' part in add bot, i have pasted my python code, is this what to do?
if it is, indentation sucks, will it work anyways?

high spear
#

Anyone know how to make a rob command?

junior wharf
#

wdym, like a bank bot?

steel orbit
#

i need help to bot me

nova rampart
#

If you wanted to use a bot, what fun commands would you want to use?

junior wharf
#

!getrect <user>

steel orbit
#

please help me to settings bot me

junior wharf
junior wharf
high spear
prime glacier
#

can i get to know how to make regxp for special character's

steel orbit
junior wharf
# high spear Yes

well u need to create a bank interface where the money of every user is stored(text file etc.), and what language btw

high spear
#

English

junior wharf
#

then u need a randomizer that gives True or False

junior wharf
#

and you must edit that text file

#

umm.. hello?

high spear
#

Hello

junior wharf
#

what coding language

high spear
#

BDScript

junior wharf
#

ive never heard of that but nvm,

u need to create a bank interface where the money of every user is stored(text file etc.),
then u need to edit the money values according to what user they are robbing(like !rob Justaknightoof, -5$ from justaknightoof and +5$ to 111nk111 etc.)

#

'Detailed description of your bot' part in add bot, i have pasted my python code, is this what to do?
if it is, indentation sucks, will it work anyways?

anyone gonna answer?

earnest phoenix
#

no

#

Detailed description of your bot doesn't mean your code lol

#

It mean to explain what your bot did, and how to use it and stuff

junior wharf
#

well i saw the numbered lines and stuff so i pasted code lmao

earnest phoenix
#

bruh

#

it's markdown

junior wharf
#

ohh my mind fricked

#

ok thx

earnest phoenix
#

you can use markdown on your detailed description

junior wharf
#

so will i run it from my computer again?

#

when its verified

#

i mean gets approval

prime glacier
#

can i get to know how to make regxp for special character's!

strong fractal
#

Is it possible to change background colour of a bot description using css?

earnest phoenix
#

@junior wharf you have to keep bot online lol

strong fractal
#

And is it possible to make gradient animation in a bot description?

junior wharf
#

my day is ruined

#

sad pig noises

strong fractal
#

Somebody pls answer :(

#

😩

junior wharf
#

i dont think so, discord has an app and css wont work in there

#

bu if u mean gif/emoji

#

then yes

strong fractal
#

Not an app XD

junior wharf
#

oh

#

i thought discord desc

strong fractal
#

Xddd

junior wharf
#

no idts

#

lol

eternal osprey
#

hey @torpid whale

#

I have asked this question several times. I have been stuck now for almost a week. Still can’t figure out this problem:
https://hatebin.com/knkauwpabw

look at the code, line 52. TypeError: Cannot read property 'toLowerCase' of undefined

#

this was the question

#

i am logging it right now. Sorry i was eating.

earnest phoenix
#

How to do

eternal osprey
earnest phoenix
#

why does message.channel.send(message.guild.owner)

Return me with null sometimes.

sharp birch
earnest phoenix
#
2020-11-21T10:50:19.489473+00:00 app[worker.1]: Traceback (most recent call last):
2020-11-21T10:50:19.489485+00:00 app[worker.1]:   File "bot.py", line 166, in <module>
2020-11-21T10:50:19.489676+00:00 app[worker.1]:     client.load_extension(f'cogs.{filename[:-3]}')
2020-11-21T10:50:19.489679+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 664, in load_extension
2020-11-21T10:50:19.489925+00:00 app[worker.1]:     self._load_from_module_spec(spec, name)
2020-11-21T10:50:19.489927+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 624, in _load_from_module_spec
2020-11-21T10:50:19.490168+00:00 app[worker.1]:     raise errors.ExtensionFailed(key, e) from e
2020-11-21T10:50:19.490188+00:00 app[worker.1]: discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.Moder' raised an error: TypeError: __init__() missing 1 required positional argument: 'client'
#

help me

eternal osprey
#

guys

#

@earnest phoenix don't interrupt someone's question.

#

for fuck sakes wait for your turn

earnest phoenix
#

you fuck

earnest phoenix
#

¯\_(ツ)_/¯

eternal osprey
#

@earnest phoenix yeah exactly

earnest phoenix
#

Like

`let owner = message.guild.owner;

message.channel.send(owner)`

earnest phoenix
eternal osprey
#

yeah that is how i solved my problem too!

#

or wait

earnest phoenix
#
2020-11-21T10:50:19.489473+00:00 app[worker.1]: Traceback (most recent call last):
2020-11-21T10:50:19.489485+00:00 app[worker.1]:   File "bot.py", line 166, in <module>
2020-11-21T10:50:19.489676+00:00 app[worker.1]:     client.load_extension(f'cogs.{filename[:-3]}')
2020-11-21T10:50:19.489679+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 664, in load_extension
2020-11-21T10:50:19.489925+00:00 app[worker.1]:     self._load_from_module_spec(spec, name)
2020-11-21T10:50:19.489927+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 624, in _load_from_module_spec
2020-11-21T10:50:19.490168+00:00 app[worker.1]:     raise errors.ExtensionFailed(key, e) from e
2020-11-21T10:50:19.490188+00:00 app[worker.1]: discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.Moder' raised an error: TypeError: __init__() missing 1 required positional argument: 'client'
#

help

#

me

#

only russian

eternal osprey
#

@earnest phoenix no-one is going to

earnest phoenix
boreal iron
eternal osprey
#
I have asked this question several times. I have been stuck now for almost a week. Still can’t figure out this problem:
https://hatebin.com/knkauwpabw

look at the code, line 52. TypeError: Cannot read property 'toLowerCase' of undefined```
eternal osprey
worthy pine
#

how do i replace cancer chars with normal chars

#

in js

eternal osprey
#

what

#

i am not using any form of args

#

look at the codebin i sent

earnest phoenix
#

Ok

obtuse jolt
#

What’s happening here then?

#

@eternal osprey what line on the link, line 52 is an event

boreal iron
#

@eternal osprey options is an array not an object

orchid vortex
#

is there a good way of .catch()ing errors within synchronous functions in javascript

boreal iron
#

options[0].level exists as property but not options.level

orchid vortex
#

since try..catch is just not catching everything

#

e

eternal osprey
#

@boreal iron hmmmm

#

but the level is working great

quartz kindle
#

try catch is for synchronous

#

.catch is for promises

eternal osprey
#

i am stuck at the name.options

orchid vortex
#

hm alright

boreal iron
#

You declared options on top of your script being an array of two objects

quartz kindle
#

hmm a bot just dmed me

boreal iron
#

lmao

quartz kindle
#

weird

eternal osprey
#

whahaha lol

boreal iron
#

That’s the reason why disabling DM is an option, an important one

quartz kindle
#

it only dmed once tho

boreal iron
#

lel

quartz kindle
#

ye doesnt dm anymore

rocky hearth
#

if the bot leaves a server (not kicked), will the guildDelete event be called?

grizzled raven
#

if you broadcast eval with a sharding manager with kurasuta can you only use variables defined in the function? like can i do this ```js
let h = true
broadcastEval(client => h ? client.users.cache.size : 0)

restive furnace
#

not iirc, use broadcastEval and declare the variable there

grizzled raven
#

okay just making sure

#

also does anyone know the difference between the different api versions?

#

like if i switch from v7 to v8 would anything bad happen

quartz kindle
#

there are a few breaking changes in v8 yes

#

wait until the library supports it

grizzled raven
#

hm

#

okay

boreal iron
#

No matter how

glad violet
#

Hey i want help

#

i got an error

rocky hearth
#

hmm, then the <Guild>.me must be null

glad violet
#

in js

quartz kindle
#

because djs only deletes the guild from the cache after a small delay

boreal iron
#

The event just includes the guild ID which the bot has left

glad violet
#

can u help me

#

i send the code in a txt file

#

heck i have token in that file

#

i deleted

quartz kindle
#

lmao

glad violet
#

regenerated

rocky hearth
boreal iron
#

Use code blocks

#

Nope just the guild id

quartz kindle
#

discord sends you the guild id in the event, but discord.js will give you the full guild instance from the cache

turbid parcel
#

Which API wrapper should I use for a bot I need to write? My options rn are some JS wrapper (probably discord js), discordgo, or serenity-rs

quartz kindle
#

@turbid parcel the one in the language you are most comfortable in

boreal iron
#

Well dunno about djs but as I said you will receive the ID only by the API

glad violet
quartz kindle
#

what is the error

glad violet
#

plss

boreal iron
#

lmao

glad violet
#

oh no need

#

fixed

#

forgot a ,

quartz kindle
#

lol

glad violet
#

,.,.,..,,.

#

¯_(ツ)_/¯

#

in vsc i have 0 problems

#

but when i start the bot i got this err

rocky hearth
#

install a linter bro, you're messing with the syntax itself

glad violet
rocky hearth
#

may or may not be

glad violet
#

i have alerady added a ;

open flicker
#

Why does my bot take a long time to connect?
error Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.

boreal iron
#

Depends on the context.
Do you call the function play() or declaring it?

quartz kindle
#

@open flicker do you have fetchAllMembers:true?

open flicker
#

yes

glad violet
#
 let args = message.content.substring(PREFIX.length).split(" ");
    switch (args[0]) {
        case 'play':
            
            function play(connection, message){
                var server = servers[message.guild.id];
                
                server.dispatcher = connection.playStream(ytdl(server.queue[0], {filter: "audioonly"}));

                server.queue.shift();

                server.dispatcher.on("end", function(){
                    if(server.queue[0]){
                        play(connection, message);
                    }else {
                        connection.disconnect();
                    }   
             
               });
            }

               
             if(!args[1]){
                 message.channel.send("You Need To Provide A Link")
                 return;
             }

          
             if(!message.member.voiceChannel){
                 message.channel.send("You Must Connect To A Voice Channel To Play")
                 return;           
             }  

             if(!servers[message.guild.id]) servers[message.guild.id] = {
                 queue: []
             }

             var server = servers[message.guild.id];

             server.queue.push(args[1]);

             if(!message.guild.voiceConnection) message.member.voiceChannel.join().then(fuction(connection),{
               play(connection, messaget);
             })

            
              break;
    }    
})

bot.login(token);
quartz kindle
#

do you have server members enabled in the dev portal?

open flicker
#

yes

quartz kindle
#

do you have GUILD_MEMBERS intent enabled if you're using intents?

light widget
#

@high spear $serverCount

high spear
#

Ty

light widget
#

Np

quartz kindle
rocky hearth
glad violet
#

i will got an error if i remove

open flicker
#

but if I remove fetchAllMembers: true then I do not have the correct statistics in serverinfo

quartz kindle
#

@open flicker try increasing the spawnTimeout

#

default is 30000

dreamy thistle
#

Gonna stop using this clear command, here it is if someone wants to use it

#

feel free

quartz kindle
#

in your sharding manager

#

try increasing it to 60000 for example

open flicker
#

ok

quartz kindle
#

@glad violet the comma is wrong, but what you wrote is also wrong

#

you wrote fuction

#

instead of function

rocky hearth
glad violet
#

oups

#

xd

#

but again the same problem

#

YES IT WORKS NOW

#

i do it function and deleted the comma

#

and no more errors

sterile ridge
#

how can I do this

#

whit python?

glad violet
#

and have the ✅

thin hare
quartz kindle
#

you can

#

wtf

slender wagon
#

u gotta use top.gg api @sterile ridge

thin hare
#

no in the description you can only use html and markdown

sterile ridge
#

no, I mean I can not show the guilds thats my bot is in?

#

oh ok

thin hare
quartz kindle
#

hes talking about server count lol

sterile ridge
#

thanks

slender wagon
#

um

thin hare
quartz kindle
#

yes

#

nothing to do with description

slender wagon
#

yeah lol

thin hare
#

ok

slender wagon
quartz kindle
#

wtf is that url

slender wagon
#

lmao

glad violet
boreal iron
#

Idk who’s creating such ugly params

quartz kindle
#

cf

#

as usual

glad violet
quartz kindle
#

@glad violet install it

slender wagon
#

well u haven't instaled it

delicate shore
#
client.on("guildCreate", async guild => {
    let finalowner = guild.owner;
    const helpembed3 = new Discord.MessageEmbed()
      .setColor("GREEN")
      .setTitle(`Thanks For adding me in ${guild.name}`)
      .addField(
        "Need Support?",
        "[My Support Server]()"
      )
      .addField(
        `Wanna know everything about me?`,
        "[My Website]()"
      )
      .addField(
        "Wanna know my commands?",
        "[My Command List]()"
      )
  
      .addField(
        `Love me :love:!`,
        "[Upvote me on top.gg!]()"
      )
  
    finalowner.send(helpembed3);
    
})```
#

Why error

glad violet
quartz kindle
#

@delicate shore guild owners are not cached by default

#

you need to fetch them

delicate shore
#

Oh

#

Shoot

quartz kindle
#

@glad violet npm install ytdl-core

slender wagon
#

@glad violet go to package.json and press on add package

#

then write the name out ytdl-core

quartz kindle
#

hes not using glitch/replit

unborn ridge
#

Pls help

slender wagon
#

oh my bad i tho it was glitch

unborn ridge
#

Pls

#

@slender wagon

#

Can u

#

Help

slender wagon
#

what's the problem?

open flicker
#

can I use something else instead of fetchAllMembers?

quartz kindle
#

depends, what do you need?

glad violet
slender wagon
#

define message

#

you use a command handler right?

quartz kindle
slender wagon
#

oh no no, no copy and paste, change the message to msg

open flicker
#

i need all users from a specific server and show them in serverinfo

slender wagon
#

cuz otherwise it isn't defined

quartz kindle
#

you can try await guild.members.fetch()

#

if fetchAllMembers doesnt work

open flicker
#

ok

#

thx

glad violet
#

@quartz kindle can u help me

sinful cloud
#

Just a quick question related to the top.gg website - what is the css value we have to change to edit our bot's page's background colour/image?

quartz kindle
#

@glad violet message.member.voice.channel

glad violet
#

i have it !message.member.voiceChannel

quartz kindle
#

@sinful cloud right click the area you want to edit, inspect element

#

look into the existing css values for that and edit those

#

@glad violet voiceChannel is old and outdated

#

its voice.channel now

sinful cloud
glad violet
#

ok

grizzled raven
#

bro tim you're on a development helping spree

quartz kindle
#

im bored

earnest phoenix
#

Hi bored

glad violet
#

it joins in the voice channel but it dont play music and i got this message in cmd

quartz kindle
#

you should stop following outdated tutorials

#

playStream was removed like 2 years ago

#

its connection.play()

glad violet
#

.../.....

#

sorry

#

i have all commands outdated

#

i used 2019 tutorials

earnest phoenix
#

Install ffmpeg

#

Or add it to Path

glad violet
#

ok

#

npm install ffmpeg

earnest phoenix
#

ffmpeg isn't a npm module i think

glad violet
#

it is

#

i typed
npm install ffmpeg
npm install avconv
but same again

earnest phoenix
#

Did you install ffmpeg (not the js module)

glad violet
#

yes i installed

#

using npm install ffmpeg

earnest phoenix
#

Not that one

#

The software

glad violet
#

oh ok

#

i didnt find ffmpeg for win

#

i finded source code

molten yarrow
glad violet
#

ok

#

done

#

download ffmpeg

#

does is contain malware

molten yarrow
#

yes

glad violet
#

...........

pale vessel
#

Why would we ask you to install it if it has malware

earnest phoenix
#

^^

glad violet
#

...

#

56%

amber sedge
#

how to votelock a command

glad violet
#

100%

amber sedge
#

100 what ?

glad violet
#

install ffmpeg 100%

delicate shore
#

bru-

#

@amber sedge he's not talking to you

glad violet
#

lets test the bot

amber sedge
#

oh

boreal iron
#

votelock? Try to explain

amber sedge
#

if the guy vote.. they can use the command , others cant

#

its like premium

glad violet
delicate shore
#

@discordjs/opus

amber sedge
#

@delicate shore votelock plss

glad violet
#

there isnt @discordjs/opus

#

there is opus

amber sedge
#

there is opus

#

@discord. js/opus ig

#

oh no

#

wow

#

why it pinged

#

im sorry.. not intended

#

@discord. js/opus

#

ig

unkempt ocean
#

without dot ig

amber sedge
#

oh

unkempt ocean
#

@discordjs/opus

amber sedge
#

pls help me on votelock

#

votelock command

boreal iron
#

Understandable this time

amber sedge
#

there is a vote option in top.gg right ?

#

if they vote..they can access the command

boreal iron
#

On the website yes

amber sedge
#

but others (who didnt vote) cannot use the command

boreal iron
#

Ah okay

glad violet
#

bro it is
@discordjs/opus and opus

amber sedge
#

we (devs) lock the command only for voters

amber sedge
#

reading api docs blew my brain so my brain ded

boreal iron
#

An exclusive command just for voters would have been a good explanation

#

But I got it

amber sedge
#

im not that good in english

#

my first language is different

#

sorry

glad violet
#

thxxxxxxxx

#

works

#

i typed npm i @discordjs/opus

boreal iron
#

Well then you have to use a webhook service for example to receive a request if someone has voted and then store the user id in a database for example

misty sigil
#

excuse me?

misty sigil
#

nah

#

thats a selfbot embed

#

its white

#

not blu

dull blade
#

How do you know tho

glad violet
misty sigil
slender thistle
#

Yup

sudden geyser
#

I'm pretty sure it's an embed generator.

#

I took the time to dip my feet in the pit of hell using inspect element and found this link: https://rauf.wtf/embed/Click+Here+To+Make+An+Embed?&author=Rauf%27s+Embed+Generator&color=04FFF3&url=https://test.rauf.workers.dev/

glad violet
#

yea

sudden geyser
#

though I feel it should be discouraged as it's hard enough to tell

amber sedge
boreal iron
#

tutorials... lmao

amber sedge
#

oof

#

my brain is ded today

quartz kindle
#

thats actually smart

amber sedge
#

i sitting at pc from 23 hrs straight cuz of programming

quartz kindle
#

the website generates og data that discord uses to generate web embeds

misty sigil
stuck wigeon
#

So...

#

What know?

misty sigil
#

but its blue titled

#

so that is definitely a selfbot.

sudden geyser
#

yes that one's a selfbot

stuck wigeon
#

What should I doo

#

What know

#

Meh ima leave

misty sigil
#

thats an author text .

#

the embed above is clearly a title text.

worldly python
#

I might be blind

past needle
#

beautiful

#

nvm

gusty quest
#

hello so im trying to make eject cmd like in among us and when i mention someone with 2 part name it split up, and link doesnt work when it split out

worldly python
#

url encode it

#

spaces should be +

gusty quest
#

message.channel.send(https://vacefron.nl/api/ejected?name=${user.username}&impostor=${imposter[index]}&crewmate=${colors[index2]});

#

this is code

#

how to fix that then

worldly python
#

There's probably a URL encoding utility in whatever language you're using

#

Otherwise, you could just replace space with +

boreal iron
#

encodeURI()

gusty quest
#

yea but

#

theres entire coee

worldly python
#

what

gusty quest
#

`const imposter = ["true", "false"];
const colors = ["brown", "blue", "yellow", "cyan", "red", "white"];

module.exports = {
name: 'eject',
description: "this is a eject command!",
execute(client, message, args){

    const index = Math.floor(Math.random() * (imposter.length - 1) + 1);
    const index2 = Math.floor(Math.random() * (colors.length - 1) + 1);

    let user = message.mentions.users.first() || message.member.displayName;
    if (!user) {
        return message.channel.send('Who do you want to eject from ship?');
    }

    message.delete()
    message.channel.send(https://vacefron.nl/api/ejected?name=${user.username}&impostor=${imposter[index]}&crewmate=${colors[index2]});
}

}`

#

what to do

#

now

#

to fix

#

that

worldly python
#

Encode the string

boreal iron
#

still

worldly python
#

But yeah

#

Just URL encode all your inputs

#

I'm sure you can stackoverflow it if you can't figure out how

glad violet
#

Imposter?

#

is it among us

past needle
#

yes

#

and the problem is that in ```js
message.channel.send(..

glad violet
#

i want that bot

worldly python
#

'

past needle
# gusty quest to fix
message.channel.send(`https://vacefron.nl/api/ejected?name=${user.username}&impostor=${imposter[index]}&crewmate=${colors[index2]}`);
``` here
gusty quest
#

yea its like that

#

i just removed rn in message

#

''

#

bczx

past needle
worldly python
#

🐒

past needle
#

why do i have a weird nickname

#

@worldly python did you change what i sent u ?

pale vessel
#

Because your name is weirder

past needle
worldly python
#

huh

past needle
#

no

#

i want

boreal iron
#

once again: encodeURI(string)

past needle
#

${message.author.username} as nickname

#

:C

dull blade
#

No

past needle
#

pls

dull blade
#

No unicodes

past needle
#

oh wait nvm it's not you

worldly python
#

🙂

delicate shore
#
 const botid = ["763418289689985035","@ember harbor,<!@763418289689985035>"]
   if(botid.some(word => message.content.includes(word))){
       message.channel.send(`Hey there ! I think I just got mentioned , or atleast my ID did XD. Anyway , My prefix for this server is ${prefix} . ${prefix}help for my commands`)
   }
#

My bot still doesn't respond

molten yarrow
#

are u trying to get response on Bot mention?

delicate shore
#

Yes

molten yarrow
#
if (message.mentions.has(bot.user)) { }
pale vessel
#

message.mentions.has(bot.user) || message.content.includes(bot.user.id)

delicate shore
#

o

#

thnx

eternal osprey
#
let res = await afetch("https://nycpokemap.com/raids.php?time=" + new Date().valueOf())
      let data = await res.json();
      const getName = id => nameList.filter(el => el.i === id)[0].n;
      let raids = data.raids.filter(raid => getName(raid.pokemon_id).toLowerCase() === options.name.toLowerCase() && raid.level >= (options.level ? options.level : 5))
      const reactionEmoji1 = message.guild.emojis.cache.find(emoji => emoji.name === 'valor');
      const reactionEmoji2 = message.guild.emojis.cache.find(emoji => emoji.name === 'mystic');
      const reactionEmoji3 = message.guild.emojis.cache.find(emoji => emoji.name === 'instinct');```TypeError: Cannot read property 'toLowerCase' of undefined
delicate shore
#

huh

boreal iron
#

Told you your issue already

#

Options is an array of objects which means you can’t access options.name since it doesn’t exist

eternal osprey
#

huh really?

boreal iron
eternal osprey
#

orry i did not see that!

glad violet
leaden lake
glad violet
#

string.toLowerCase

eternal osprey
#

@glad violet what does that have to do with my code

glad violet
#

wait

slender thistle
#

a in b or a in c

#

not a in b or c

leaden lake
#

okay thx

slender thistle
#

also resultbypass is None

glad violet
#
let res = await afetch("https://nycpokemap.com/raids.php?time=" + new Date().valueOf())
      let data = await res.json();
      const getName = id => nameList.filter(el => el.i === id)[0].n;
      let raids = data.raids.filter(raid => getName(raid.pokemon_id).string.toLowerCase() === options.name.toLowerCase() && raid.level >= (options.level ? options.level : 5))
      const reactionEmoji1 = message.guild.emojis.cache.find(emoji => emoji.name === 'valor');
      const reactionEmoji2 = message.guild.emojis.cache.find(emoji => emoji.name === 'mystic');
      const reactionEmoji3 = message.guild.emojis.cache.find(emoji => emoji.name === 'instinct');
#

replace the code with this @eternal osprey

leaden lake
#

resultbypass is a tuple @slender thistle

glad violet
#

make a backup first

eternal osprey
#

but why using .string

boreal iron
slender thistle
#

Clearly not, seeing that error

eternal osprey
#

i should call options[0].name

boreal iron
#

You provided the full code earlier

eternal osprey
#

yeah

boreal iron
#

I saw options in an array of objects

eternal osprey
#
const options = commandLineArgs([
  { name: "level", alias: "l", type: Number },
  { name: "name", alias: "n", type: String }
])
``` this yeah
boreal iron
eternal osprey
#

oooowh okay i get yo

#

because i wrapped it in [] ofcourse

boreal iron
#

Which means it’s an array

#

Yeah

#

Not an object inside an object what you actually tried to do

glad violet
eternal osprey
#

@glad violet no

#

it has nothing to do with that

#

i actually tried it but it does not work.

past needle
#

options[0].name

#

would work

eternal osprey
#

aha

past needle
#

in your case

boreal iron
#

Nah just create an object not an array

glad violet
#

try .string()toLowerCase

eternal osprey
#

(node:2632) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'name' of undefined

slender thistle
glad violet
#

?

earnest phoenix
#

wut

eternal osprey
#
let raids = data.raids.filter(raid => getName(raid.pokemon_id).toLowerCase() === options[0].name.toLowerCase() && raid.level >= (options[0].level ? options[0].level : 5))```
earnest phoenix
#

'String'.toLowerCase() // 'string'

glad violet
#

ok

slender thistle
#

Please tell me where .string()toLowerCase is helpful

#

or where it will actually work

earnest phoenix
eternal osprey
#

yeah i am just getting confused more by @glad violet

glad violet
#

..........

boreal iron
#

Just console.log(options) please to see how you can access it

eternal osprey
#

okay

#

before the filterer right

boreal iron
#

Instead of guessing much more

#

At the beginning yeah

#

After it’s defined of course

eternal osprey
#

yeah ofc

boreal iron
#

Hmm an empty object

#

That’s why it says the property name doesn’t exist

eternal osprey
#

yeah that'strange

boreal iron
#

Means there’s something wrong with your const options

#

At least with the function I mentioned

eternal osprey
#

yeah

molten yarrow
#

why do u even use command-line-args?

boreal iron
#

So what does commandLineArgs actually looks like

#

Why don’t u just split your message and use the result (array) as arguments?

eternal osprey
#

hmm uhh okay

#

could you give an example on how that would look

#

because what mesage should i split>

boreal iron
#

Well just splitting the message.content

eternal osprey
#

but i am not sending any message at the beginning?

#

or wait

#

you mean after the command call

#

if (message.content = "!raids") {

boreal iron
#

That must be part of your command

eternal osprey
#

gotcha

boreal iron
#

Wut that’s actually your code?

#

content = "!raids"

#

?

eternal osprey
#

yeah why?

#

but i can also call using --name egg --level 6

#

would start the function too

boreal iron
#

What a weird command handler

earnest phoenix
#

how i can download a video of youtube and send the file in .mp4? 🤔

molten yarrow
#

thats not a command handler, thats his commandLineArgs

eternal osprey
#

sorry what

boreal iron
#

Obviously I’m speaking about the command handler and not the arguments, but thanks for the useless comment

molten yarrow
#

he dont use one

#

he has everything in his index

boreal iron
#

Oh enabling my magic glass ball, yeah I can see this now too

eternal osprey
#

@earnest phoenix brother don't interrupt someones questions. Please.

#

just wait for your turn

#

yeah but now i lost the fucking conversation

boreal iron
#

Funny... Tim told you the solution this night already

#

Oliy

molten yarrow
#

in your collected cb :3

earnest phoenix
#

LOL

#

stop feeling so entitled

#

this isnt your channel

eternal osprey
#

who

earnest phoenix
#

you

eternal osprey
#

bro shut the fuck uo

tribal siren
#

?