#development

1 messages · Page 1026 of 1

median star
#

that against TOS

#

smh

earnest phoenix
#

i just want to see if i can

opal plank
#

for (r in results) try {
client.users.cache.get(id).tag
} catch{
client.api.fetch(id).then() => {}}
@earnest phoenix

#

something like this

earnest phoenix
#

okay

opal plank
#

if its not cached, get it

solemn latch
#

client.users.cache.fetch checks the cache first

#

or wait

slender thistle
#

hey, im messing around with discord.py, any idea on how i can delete all channels?
for channel in guild.channels:
channel delete()

median star
#

  await bot.message.add_reaction('👍')
  if reaction.emoji == '👍':

;-; sadcat

slender thistle
#

What do you think bot.message is

solemn latch
#

fetch checks cache first

opal plank
#

i think this is the method @earnest phoenix client.api.users(userid).get()

median star
earnest phoenix
#

I know but if I was to do that, I can't put it directly into the embed description

solemn latch
#

why not 🤔

earnest phoenix
#

Here is the question this time, the one that you are on about @solemn latch

#

Is there a way to cache all members in a guild on the ready event?

solemn latch
#

yes

#

i still dont understand why you need to do it directly in the description of an embed tho

#

even if thats true

opal plank
#

why not?

solemn latch
#

`${put all your code here, it makes no diffrence}`

opal plank
#

parse your stuff before putting into the embed

#

¯_(ツ)_/¯

#

make a string, use concat to add the new stuff after that loop

#

done, add string onto embed after

#

@earnest phoenix

slender thistle
#

@median star

some_message = await ctx.send("REACT TO THIS MESSAGE WITH THUMBS UP PLEASE WITHIN 30 SECONDS OR AN ERROR WILL APPEAR")

# line below will also need a check to restrict the reaction to the same channel where the command was used
# refer to https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.wait_for for info on check function
reaction, user = await bot.wait_for("reaction_add", timeout=30)
if str(reaction.emoji) == "👍":
    # do stuff
else:
    # don't do stuff```
unborn steeple
#
/rbd/pnpm-volume/a89bee78-e8f1-4401-87e1-5e9285a987ce/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/node_modules/bindings/bindings.js:135
  throw err;
  ^
Error: Could not locate the bindings file. Tried:

How do i fix this?

solemn latch
#

looks like quick.db error, I think they have a support server

#

yeah

#

they have a support server

unborn steeple
#

They do but im banned for dming someone i asked for help an invite to a server to help me test a bug

solemn latch
#

yikes

earnest phoenix
#

But if I was to make it easier than that, would It be better to cache all members on the ready event?

solemn latch
#

preloading users will be a privlaged intent

#

it wont work in a few months

#

and will dramatically increase bot ram usage

earnest phoenix
#

Doesn't matter about performance

solemn latch
#

well

#

it also wont work

earnest phoenix
#

😛

solemn latch
#

so

#

in a few months

#

honestly, your making it harder than it needs to be.
you could theoretically make sure the top 10 users are always cached by fetching them every once in awhile.

or just do it the normal way and parse all the data beforehand.

lament hinge
#

/invite

median star
#
  if str(reaction.emoji) == "👍":
  """Create instant invite"""
  guild = ctx.guild
  link = await ctx.channel.create_invite(max_age = 300)
  chan = bot.get_channel(729403688455635014)
  await chan.send(f"problem in {link}")#sending

@slender thistle Await outside function, unexpected indent

#

link = await ctx.channel.create_inv
ite(max_age = 300)
^
SyntaxError: 'await' outside function

slender thistle
#

where did you even move that

median star
#

@bot.command()
async def problem(ctx, message):
await ctx.send('are you sure you want a staff to join and help, you have 30 seconds to react')

line below will also need a check to restrict the reaction to the same channel where the command was used

refer to https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.wait_for for info on check function

reaction, user = await bot.wait_for("reaction_add", timeout=30)
if str(reaction.emoji) == "👍":
"""Create instant invite"""
guild = ctx.guild
link = await ctx.channel.create_invite(max_age = 300)
chan = bot.get_channel(729403688455635014)
await chan.send(f"problem in {link}")#sending
else:
await ctx.send('no one will join')

slender thistle
#

yeah

#

indent those lines

#

they're outside of the command

median star
#

i have

#

it still says await outside function

elfin flower
#

is on_guild_changed an event

elfin flower
#

oh ty'

#

i forgot its name

median star
#

me?

slender thistle
#

no

#

as for your code, are you sure you are actually indenting properly?

median star
#

yes

slender thistle
#

What does your code look like rn?

median star
#

i am pretty sure

peak quail
#
let i = 0;
[ { first: 0, last: 2 }, { first: 3, last: 4 } ].forEach((test_data) => {
    for (let index = test_data.first; index < test_data.last; index++) {
        console.log(`${i} | ` + index);
    }
    i++;
});
```i think i'm currently brain afk as fuck
i expect the output:
```prolog
0 | 0
0 | 1
1 | 3
1 | 4
```but i get  ```
0 | 0
0 | 1
1 | 3
median star
elfin flower
#

woah

#

phone

median star
#

not phone

#

just cropped

elfin flower
#

oh

#

ok

peak quail
#

xD

median star
#

lmao

slender thistle
#

you didn't

#

indent anything

earnest phoenix
#

he didn't

slender thistle
#

put spaces/tabs before all the other crap that's related to your command

median star
#

lmao

#

woops

median star
slender thistle
#

Move else back

#

a bit

modest maple
#

2 spaces to be exact

proven lantern
#

await too

modest maple
#

i mean yeah but meh

slender thistle
#

oh also you STILL forgot to add a check

#

despite my comment telling you to add it

median star
#

i added reaction

#

discord.ext.commands.errors.MissingRequiredArgument: reaction is a required argument that is missing.

modest maple
#

😩

median star
#

sadcat i sound so dumb probably

#

because i am

#

b bvb gg plses help

#

p ples

#

p l e a s e

earnest phoenix
#

???

slender thistle
#

why

median star
#

im just goig to head out

slender thistle
#

Actually where is that error even coming from

median star
#

i think here

#
@bot.command()
async def problem(ctx, reaction, user):
slender thistle
#

you...

#

what

#

why

#

What made you think you are supposed to add that there

fleet robin
#

guys i am having a hard time with the rulesbot. i've added it to my server but i dont know how to make it to where my members accept the rules to unlock the rest of the server. please help as I am new to making a discord server

median star
#

i think i am supportsed to add rection and use r but it stil not workng

solemn latch
#

go to the rulesbot support page. this is support for top.gg

median star
#

;-;

slender thistle
#

You're not supposed to enter anything in the command argument

#

the reaction, user stuff comes as returned values from wait_for

median star
#

ok it works

#

but you hava manually add the reaction

slender thistle
#

make your bot add the reaction to some message then

elfin flower
#

is there a way if the guild gets changed, then it goes back?

median star
#

how do i add a reaction to the message the bot sends

pure lion
#

okay im trying to make a sticky messages command but

slender thistle
#

msg = await ctx.send
await msg.add_reaction

pure lion
#
  if (msg.channel.id === StickyMessages.get(`sticky.${msg.channel.id}.chID`)) {
    if (!msg.member.hasPermission('MANAGE_CHANNELS')) {
      let dlt = await msg.channel.messages.fetch(StickyMessages.get(`sticky.${msg.channel.id}.msgID`))
      msg.channel.bulkDelete(1)
      dlt.delete()
      let newID = await msg.channel.send(StickyMessages.get(`sticky.${msg.channel.id}.content`))
      StickyMessages.set(`sticky.${msg.channel.id}`, ({
        content: args.slice(1),
        chID: msg.channel.id,
        msgID: newID.id
      }))
    }
  }

its not working, and im getting the unknown message error

#

its logging the message content to the db, just not updating the ID

#

wait i may have fucked up brb

elfin flower
#

how do i use rewrite?

pure lion
#

did you not just link some docs...?

elfin flower
#

ok

tulip ledge
#

Any idea why this is saying 28 February 5285 17:28?
moment.unix(message.createdTimestamp).format("DD MMMM YYYY HH:mm")

earnest phoenix
#

if someone made a change, like add a channel, how would i undo that with discord.py?

slender thistle
#

events

elfin flower
#

that was what i asked a few mins ago

#

i know what event

earnest phoenix
#

time to scroll up

elfin flower
#

on_guild_change

#

but

slender thistle
#

well no

elfin flower
#

how do we undo the change

#

oh ok

slender thistle
#

what change exactly

#

There's events for all sorts of things

earnest phoenix
#

add a channel as an example

elfin flower
#

hold on

slender thistle
#

etc etc scroll around

elfin flower
#

that gave me an idea

#

when that event happens

#

it creates a new channel with the same name and properties of the channel

solemn latch
#

you mean the copy channel function?

elfin flower
#

._.

#

does this code look good

solemn latch
elfin flower
#

@client.event
async def on_guild_channel_delete(before, after):
print("a channel has been deleted")
after.guild.create_text_channel(name = before.name)

slender thistle
#

await

elfin flower
#

frick

#

ty

slender thistle
#

also

#

there's no before or after

#

in a deleted channel

elfin flower
#

i was looking on the wrong event reference

#

oof

tulip ledge
#
            let embed = new Discord.MessageEmbed()
            .setTitel(`Bot Ban`)

TypeError: (intermediate value).setTitel is not a function
??? tf

#

Oh nvm

#

I made a typo

elfin flower
#

its actually setTitle

#

im having trouble using the clone() function

elder garnet
#
if(msg.member.bot) return

I have this on

client.on('message', msg => {

but i get an error saying

TypeError: Cannot read property 'bot' of null
#

I don't know why but it happens i guess

#
client.on('message', msg => {
    if(msg.member.bot) return
    if(msg.channel.type === 'dm') { if(msg.content.startsWith(prefix + " ")) { return msg.channel.send("I'm sorry but we don't support DM commands since they crash the bot client."); }}
#

is what i have

sudden geyser
#

Was the message sent in a DM? You could use msg.author instead.

elder garnet
#

oh

#

lemme try that

sudden geyser
#

But it's still possible .author could be null.

elder garnet
#

ah

#

ok

#
    if(msg.channel.type === 'dm') { if(msg.author.bot) { return } else { if(msg.content.startsWith("goose ")) { return msg.channel.send("I'm sorry but we don't support DM commands since they crash the bot client."); }}}
    if(msg.member.bot) return

like that?

sudden geyser
#

It's quite hard to read. Are you on mobile? You can just check it at the top of the function scope rather than just if it was only sent in a DM.

elder garnet
#

I will test it out

#

no i'm on a pc

valid frigate
#

I'm sorry but we don't support DM commands since they crash the bot client.
why include this message? just don't respond at all

#

its more design choice but do as you wish

elder garnet
#

maybe some users would think that the bot isn't working or something, leaving a message behind lol

valid frigate
#

a lot of bots just dont respond to dms

elder garnet
#

yeah

valid frigate
#

a lot of tutorials use a similar fashion: if (message.channel.type === 'dm') return

elder garnet
#

yeah

#

will do that since the other solution didn't work

elfin flower
#

how do i use the clone() function

sudden geyser
#

In python?

elfin flower
#

discord

#

py

valid frigate
#

oh

elfin flower
#

i did read the docs but it didnt help

elder garnet
#

"TypeError: Cannot read property 'bot' of null"

#

all i did was this

#

lol

#
if(msg.member.bot) return
#
client.on('message', msg => {
    if(msg.channel.type === 'dm') return
    if(msg.member.bot) return
quartz kindle
#

some message types dont have a member property, such as system and welcome messages, webhooks, etc

#

also, bot is not a member property

#

its an author property

elder garnet
#

i'll try that i guess

#

ty

#

works

solemn latch
#

depends on what language and library.

#

on djs you can just make a collection, and store things with .set and get things with .get

elfin flower
#

can someone tell me how to use clone()? discord py

solemn latch
#

the docs probably tells you how

elfin flower
#

i did read them

#

but it didnt help

solemn latch
#

just do whatever the text channel is .clone()

elfin flower
#

so like this?

#

@client.event
async def on_guild_channel_delete(channel):
print("a channel has been deleted")
await channel.guild.clone(channel)

solemn latch
#

channel.guild.clone
would attempt to clone the guild wouldnt it?

#

idk, try it

elfin flower
#

ill see

#

it didnt work

tawny trench
#

i have a problem with a bot

solemn latch
#

i would think it would be channel.clone()

elfin flower
#

okay

tulip ledge
#

message.guild.id
TypeError: Cannot read property 'id' of null

elfin flower
#

woah

#

it worked

#

i deleted a channel and the bot cloned it

solemn latch
#

its exactly what the docs said to do

#

lol

elfin flower
#

thank you for the help

earnest phoenix
solemn latch
#

^

tulip ledge
#

well no

solemn latch
#

messages dont always have guilds

tulip ledge
#

i can't do that

earnest phoenix
#

you should return to dms

tulip ledge
#

Since I'm using the id to get the settings of the guild

#

Oh

#

yeah

#

k

#

Thats why

#

ty

#

channel.type === "dm" right?

earnest phoenix
#

if (!channel.guild) return might be

#

¯\_(ツ)_/¯

solemn latch
#

or type

tulip ledge
#

Like I did?

solemn latch
#

or if(!message.guild) return

tulip ledge
#

channel.type === "dm"?

solemn latch
#

or any of the other ways

#

ye, should work i think

tulip ledge
#

k ty

earnest phoenix
#

¯\_(ツ)_/¯

peak quail
elfin flower
#

how do i know who deleted the channel with the on_guild_channel_delete event? discord py

slender thistle
#

Pulling the info from audit logs

elfin flower
#

how do i do that

solemn latch
#

Docs

elfin flower
#

D O C S

earnest phoenix
#

D O G S

elfin flower
#

...

solemn latch
#

Docs are generally your main source on how to do things.
It helps to know how to read them and turn it into working code

elfin flower
#

ok

#

im guessing its the audit logs data part

earnest phoenix
#

How do i edit a message after sending it? I tried let sentMessage = await message.channel.send("hi"); but it gives an error. I use discord.js 11 because I'm lazy and won't edit the 100 embeds i use because RichEmbed is now MessageEmbed in version 12

slender thistle
#

audit_logs method of guild

elfin flower
#

guild.audit_logs(action = channel_delete)

solemn latch
#

If you use vsc, you can edit all instances of richembed quite quickly @earnest phoenix

elfin flower
#

hopefully its the right name of the action

slender thistle
#

What class has that property

earnest phoenix
#

If you use vsc, you can edit all instances of richembed quite quickly @earnest phoenix
@solemn latch what if you're lazy

solemn latch
#

Well, v11 won't work in a few months anyway

#

Longer you wait, longer it'll take you to fix

elfin flower
#

@slender thistle idk, i guessed the name tbh

slender thistle
#

Ctrl + F on the docs page

elfin flower
#

then?

earnest phoenix
#

can you take a look at my source and tell me everything i need to change? glitch.com/codecodiscordbot i don't have an exposed bot token don't worry

solemn latch
#

🤔

slender thistle
#

channel_delete

#

You need discord.AuditLogAction before the channel_delete in the channel

solemn latch
#

I'm not going to do all that work for ya.
Time is money KEKW

elfin flower
#

it took me to event reference

slender thistle
#

You need discord.AuditLogAction before the channel_delete in the channel
code, not channel

elfin flower
#

okay

#

im confused

#

im trying to get the id of the person who deletes a channel

strange trout
pure lion
#

🧃 💩

elfin flower
#

juice poop?

pure lion
#

I'm drinking

elfin flower
#

oh

#

have fun drinking

#

that came out wrong

pure lion
#

Tankya

elfin flower
#

np

slender thistle
low marsh
#

does somebody use youtube-dl?

#

I'm trying to get for example the Video ID with youtube-dl

#

but I only get the error: cannot read property id of undefined

pure lion
#

nononono

#

you dont wanna do that

#

yt-dl takes a URL

pure lion
#

so uh

#

how the fuck do i overwrite channel perms in djs v 12? (per user)

#
(node:6664) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied overwrites is not an Array or Collection of Permission Overwrites.
            let overwritemedaddy = msg.mentions.members.first()
            
            msg.channel.overwritePermissions(overwritemedaddy, [{
                allow: ['VIEW_CHANNEL','SEND_MESSAGES',"READ_MESSAGE_HISTORY"]
            }])
hollow saddle
sudden geyser
hollow saddle
#

Look at the example

pure lion
#

alright

#

is there a way i can add certain permissions to a user per channel?

sudden geyser
#

Yes, that's what you're doing.

pure lion
#

oh

#

sorry, just read this

#

works now, tankya @sudden geyser @hollow saddle

finite bough
#

how many dms is a bot allowed to send per sec?

#

ratelimits

sudden geyser
#

It's like 5 per 5 seconds, but I wouldn't rely on it unless you have a reason to do it in bulk.

brittle copper
#

FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUCK

#

The one time I’m not paying attention

#

I don’t have it running

#

And it gets declined. Time to wait another month I guess

finite bough
#

@sudden geyser nah nah just like I want know a sage value to add it between the thingy

#

like the time between the dms

sudden geyser
#

Ah okay. Just remember that the library you're using also handles it for extra guarding

exotic cradle
#

Does anyone know a script that sets the bots status??

solemn latch
#

Discordjs has a ratelimited event, seems kinda useful

exotic cradle
#

ok

solemn latch
#

That was for the previous conversation

#

That was being discusses

#

Discussed

sudden geyser
#

Does anyone know a script that sets the bots status??
@exotic cradle what library are you using.

elfin flower
#

how do i break discord ToS with discord py?

pale vessel
#

but why

elfin flower
#

i was joking

exotic cradle
#

i use discord.js, node.js, and Visual Studio Code

elfin flower
quartz kindle
pure lion
#

What's the V12 version of isMentioned?

elfin flower
#

Men

pale vessel
#

like mentions.has()?

pure lion
#

If a user is mentioned

#

Do cool shit

pale vessel
#

check message mentions

quartz kindle
#

mentions.has() yes

pure lion
#

Ok

elfin flower
#

50 percent of perfect a

haughty elbow
#

Can anyone help me with my bot

pale vessel
#

please just ask

haughty elbow
#

Can you help me

#

Please

pale vessel
#

we can't help you if you don't tell us the problem

haughty elbow
#

I don't know how to code tbh I didn't know this app requires coding

pale vessel
elfin flower
#

@client.event
async def on_guild_channel_delete(channel):
print("a channel has been deleted")
if channel.guild.audit_logs(action = "channel_delete", user = client):
await channel.clone()
else:
await channel.delete()

@client.event
async def on_guild_channel_create(channel):
print("a channel has been created")
if channel.guild.audit_logs(action = "channel_create", user = client):
await channel.delete()
else:
await channel.clone()

E

#

the code is supposed to clone the channel if it gets deleted

#

and if the channel gets deleted it gets cloned

#

and if a channel gets created it gets deleted

#

I also made it if the bot creates or deletes channels it wont delete/clone

#

which worked

haughty elbow
#

Aww i have to pay for the bot maker on steam

pure lion
#

Don't

#

Don't

#

Use a bot maker and come here asking for help

haughty elbow
#

I have one

pure lion
#

h

elfin flower
#

but

#

can someone help me with that code i sent

pure lion
#

I wish I could

#

Is there something on stack I could look for ?

haughty elbow
#

Idk how to code tbh i thought I wouldn't have to

slender thistle
#

async context manager time

elfin flower
#

what

pure lion
#

@haughty elbow if you came here to discuss bot makers you're in the wrong place, either learn to code or leave the channel

slender thistle
#

tfw there's examples

#

in the docs

elfin flower
#

uh

#

i know about audit_logs

slender thistle
#

Debatable

elfin flower
#

okay

honest perch
#

What is html

quasi holly
#

Does anyone know the check que position command?

honest perch
#

There isn't one

quasi holly
#

Thanks!

honest perch
#

And no you can't find out where your bot is in the queue

elfin flower
#

why do i need to read the audit_logs docs

slender thistle
#

because you're not using that method properly

cobalt trellis
#

Idk how to code tbh i thought I wouldn't have to
@haughty elbow tru tho

#

What is html
@honest perch hyper text markup language

shy turret
#
    try {
      let invite = guild.channels.cache.filter(c => c.type === 'text').find(x => x.position == 0).createInvite(
        {
          maxAge: 10 * 60 * 1000,
          maxUses: 1
        }
      )
      console.log(invite)
    } catch(err1) {
      console.log("An error has occured while creating an invite.")
    }

guild is set.

For some reason, I keep getting:

Promise { <pending> }
elfin flower
#

guild lild

#

\

#

\\\

shy turret
#
elfin flower
#

guild = discord.Guild

shy turret
#

wdym

quartz kindle
#

@shy turret one word: await

solemn latch
#

create invite is a promise

#

returns a promise

elfin flower
#

guild

shy turret
#

SyntaxError: missing ) after argument list
i dont know why but ^ keeps happening when i put console.log(await invite)

#

i think i need to remove try {} catch(err) {}

solemn latch
#

await where you create invite

shy turret
#

nope didnt work

solemn latch
#

not where you read invite

shy turret
#

ok let me try .then

solemn latch
#

let invite = await guild.channels.cache.filter...

quartz kindle
#

should also work where he reads it tho

solemn latch
#

o

#

🤔

#

i didnt know that

quartz kindle
solemn latch
#

i need to get a refresher on promises

shy turret
#

await isnt working for some reason lol

strange trout
#

I'd still await where the invite is being created though

quartz kindle
#

@shy turret show code with await

amber fractal
#

how did it allow you to use await?

#

Lmao I always defined an async function in the dev console

#

:P

#

Didnt know it just worked

quartz kindle
#

dev tools supports top level await lul

#

since chrome 62

exotic cradle
#

any tips to grow a bot

elfin flower
#

code it

exotic cradle
#

i did

solemn latch
#

have features that make users want to use it

exotic cradle
#

lmao

#

300 lines so far

quartz kindle
#

growing a bot involves many factors: quality features, ease of use, nice design, good presentation, some advertising or website and a bit of luck

sudden geyser
#

^ all of those, give your users a reason to add your bot instead of another bot that may have similar features

quartz kindle
#

and also bandwagoning trends lmao

sudden geyser
#

planttrees

quartz kindle
#

covidbot, pokemonbot

ebon kelp
#

Converting APIs into bots are handy

elfin flower
#

converting converters into converting converts

earnest phoenix
#

What do people recommend to write bots in? I see loads of libraries in pretty much every language, are there languages I should avoid using? Does anyone have any experience writing bots at large scale? How do these bots scale (from a server point of view)? Obviously when no one is using the bot you would want to scale down and conserve compute power.

amber fractal
#

A lot of big bots either modify the libraries they use or make their own

solemn latch
#

discordjs is about the worst at anything scaled up pretty large.
however people do have bots with millions of users on it.

#

really, any offically library will work up to a pretty okay scale.

sudden geyser
#

You can write a bot in any language. A language is simply a tool, and so is a library. Discord.js, for example, is popular as it's very easy with a lot of features and guides, but doesn't handle well when it comes to how much resources it uses. Eris, on the other hand, is another Discord library in JavaScript which is known to do better in the resources it uses.

earnest phoenix
#

Hmm okay, also has anyone split their bots out over different regions to reduce latency, or is this not something that needs to be worried about?

sweet ravine
#

can anyone hel me with discord python

sudden geyser
#

what's the issue you're having, please explain

solemn latch
#

i once heard there is only one text server location for all of discord

#

i actually never checked

sweet ravine
#

How does the bot edit a message when a response is clicked

earnest phoenix
#

Not any particular issue, just thinking ahead, I work at a company where we split our infrastructure over several regions, America, Asia, Europe so we can deliver lower latencies to everyone

#

Just wondering if anyone has had to do this, or if it’s not something that I should even think about

#

One text server location makes coding a lot easier hahaha

solemn latch
#

only bots im aware of that has multiple locations are voice based bots.
ive seen bots with millions of users on basic VPS's costing $10 a month.

quartz kindle
#

the only part of discord that is split in regions is their voice servers

#

so you should only worry about that you plan to make a music bot

#

the biggest problem with scaling a bot is caching

#

because most popular libraries offer very limited caching control

#

and just cache as much as they can to avoid hitting the api

restive shell
#

hey guys, I'm about to implement sharding since my servers past 2k servers now. Currently I'm just using dbl.postStats(client.guilds.cache.size), what would be the best way to update this to ensure all servers get posted to stats when I've included sharding?

solemn latch
#

i think you can just pass it the client, like normal

earnest phoenix
#

Okay makes sense, I’ll keep this in mind, thank you for your time 🙂

quartz kindle
#

if you pass your client to the dbl constructor, you dont need to use postStats

#

if you want to explicitly use postStats, you just need to add the shard id and total shards parameters

marble geode
#

hey

#

i create cmd rob

#

i set if i want to rob i must have crowbar and gun

#

but that not work

#

someone can help me?

#

i use quick.db

strange trout
#

What

#

That gives us zero context

#

No code or explanation of what you have done so far

marble geode
#

if (db.has(message.author.id, ["gun", "crowbar"]) === true)

ebon kelp
#

=== 'true' thinkmad

#

You get a string as responds?

marble geode
#

oops

#

but that not work

ebon kelp
#

still the === true part is not needed

elfin flower
#

===?

torn ravine
#

what I'm trying to do is get the message content using message.content.startsWith to get the "Now Playing" Message to delete and display the next now playing message

elfin flower
#

anyways

marble geode
#

@ebon kelp no need === true??

strange trout
#

Is that even how you use the has method

elfin flower
#

how do i use icon_url_as?

ebon kelp
#

An if statement needs a boolean value, if the responds is boolean you don't have to do equal to

obtuse jolt
#

if() {//does this if true}
if(!) {//does this if false}

ebon kelp
#

This is what you did @marble geode

if (true/false === true) {
  // code
}
obtuse jolt
#

true === true

#

Interesting

strange trout
#

how are you storing the user items?

obtuse jolt
ebon kelp
obtuse jolt
#

if(true) { big brain code }

#

It will never be false

#

if(true) { big brain code } else { this will literally never be executed }

ebon kelp
#

Pog

obtuse jolt
#

That’s some big brain stuff

#
if(true) {
//gets executed every time
} else {
//never gets executed
}```
ebon kelp
#

Big Brain

obtuse jolt
#

Why that would ever be used

#

I have no idea

elfin flower
#

how do i use icon_url_as

torn ravine
#

I use this to get song results but I can only select the first 1

#

to return search

ebon kelp
#

[1-9] not [1-10]

#

I believe

#

I hate regex

elfin flower
#

||||

#

...

ebon kelp
#

[1-10] has a range from 1-1, cuz 10 gets counted as 1

torn ravine
#

Thank you

ebon kelp
#

To test your regex

torn ravine
#

I changed to 9

ebon kelp
#

Why the |cancel?

strange trout
#

That doesn't match a range by the way

#

That matches any number

amber fractal
#

why not just \d?

strange trout
#

They probably want to match between 1 and 10

amber fractal
ebon kelp
amber fractal
#

that's the same as \d, but I guess it excludes 0

ebon kelp
#

You can use [0-9]

torn ravine
#

i see

#

1-9 is a range

#

and they split cancel into individual letters

ebon kelp
#

It can be 1 2 3 4 5 6 7 8 or 9

#

and they split cancel into individual letters
@torn ravine yup idk what you did there xd

torn ravine
#

fucking regexp

solemn latch
#

just play around with it

strange trout
#

^(?:[1-9]|0[1-9]|10)$|cancel though matching cancel is kind of unneeded in my opinion

sudden geyser
#

regexp looks encrypted at first, but try it out for a while and you'll know how it works easily

solemn latch
#

^

#

its something that kinda just clicks

strange trout
#

That also matches 000001, 00002 etc. by the way

#

You can remove the second alternation if you don't want that

torn ravine
#

@strange trout it is kinda uneccesary

#

because the bot times out automatically after 30 seconds

strange trout
#

I just think it's redundant since you'll have to check if the content is equal to cancel after that anyway

sudden geyser
#

This is kind of a weird question, but does anyone know of a site/app/whatever for designing/sketching a user interface?

hardy vector
#

(node:32613) UnhandledPromiseRejectionWarning: AkairoError [ALREADY_LOADED]: Command 'ping' is already loaded
is there a reason this is happening

#

how can a command already be loaded

solemn latch
#

your webbrowser

sudden geyser
#

Nerd is it possible the ping command is a default command supplied

#

Woo oliythink

solemn latch
#

set your browser to refresh a local webpage every couple seconds and just edit away

#

🤔

#

or just edit directly

#

in the browser

elfin flower
#

wait

#

icon cant be edited?

hardy vector
#

wdym defualt command

#

Lite?

elfin flower
#

can someone just tell me how to change the guilds icon with discord py my head hurts from searching and scrolling everywhere

solemn latch
#

youd likly need the image buffered in memory

elfin flower
#

oh god

#

i think i remember the image enough

zenith gazelle
#

in discord.py can one of my args be role : discord.Role or is discord.Role not a thing?

elfin flower
#

discord.Role exists yes

#

and i cant believe something so simple is just so hard for me to know

delicate shore
#

hey

#

how to make

#

i mean

#

how to do image manipulation in discord.js v12

solemn latch
#

i use canvas

#

its easy enough

elfin flower
#

how do i change the guilds

#

nevermind

#

im not gonna ask the 50th time

#

im annoying sorry

hoary elm
#

^^ try this

elfin flower
#

i googled on google on how to, that showed up

#

it doesnt work

hoary elm
#

You read through all the comments

elfin flower
#

yes

hoary elm
#

Hmm

solemn latch
#

python seems familiar, but also so foreign at the same time

elfin flower
#

does message.guild.icon.edit() exist?

delicate shore
#

hey @solemn latch can we talk in dms

#

no @elfin flower i don't think so but i maybe wro g

#

wrong*

solemn latch
#

im in a csgo game 🤔

delicate shore
#

ok

#

play it

#

np'

solemn latch
#

if its something simple i can answer while im dead

delicate shore
#

ok

#

it's

#

realted to image manipulation

elfin flower
#

i dont care

#

give me the answer

#

i will sacrifice my brain cells to change the guilds icon

solemn latch
#

pgamer is a js dev

#

🤔

#

probs wont be helpful with your python issues

delicate shore
#

bruh

#

lol

elfin flower
#

oh

delicate shore
#

pgamer is a js dev
@solemn latch u know me rght?

#

i have been asking you silly questions since weeks

solemn latch
#

ye

elfin flower
#

im gonna dig around docs till i find something

#

i found three stuff related to guilds icon

#

guild.icon

#

guild.icon_url

#

and

#

guild.icon_url_as

#

and none of them is related to changing the guilds icon at all

#

changing guilds icon impossible confirmed?

zenith gazelle
#

anyone know why py async def reactrole(ctx, role, emoji): if isinstance(role, discord.Role): print("test") else: print("test2") does not print "test" when I mention a role as the arg?

delicate shore
#

@elfin flower chill

elfin flower
#

okay

opal plank
#

send a manual curl or something request

#

if your lib doesnt do it, do it manually

#

¯_(ツ)_/¯

elfin flower
#

okay

delicate shore
#
if(command === "jail"){
    client.on('guildMemberAdd', async member => {
    const channel = member.guild.channels.cache.find(ch => ch.name === 'member-log');
    if (!channel) return;

    const canvas = Canvas.createCanvas(700, 250);
    const ctx = canvas.getContext('2d');

    const background = await Canvas.loadImage(member.user.displayAvatarURL({ format: 'jpg' }));
    ctx.drawImage(background, 0, 0, canvas.width, canvas.height);

    ctx.strokeStyle = '#74037b';
    ctx.strokeRect(0, 0, canvas.width, canvas.height);

    const avatar = await Canvas.loadImage('./assets/jail.png');

    ctx.drawImage(avatar, 25, 25, 200, 200);

    const attachment = new Discord.MessageAttachment(canvas.toBuffer(), 'jail.png');

    channel.send(`Bruh you are in jail, ${member}!`, attachment);
});
    
  }```
#

this is not working

zenith gazelle
#

@elfin flower does
await ctx.guild.edit(icon=somethinghere) not work?

delicate shore
#

and yes i haev defined canvas

elfin flower
#

@opal plank im using discord py

delicate shore
#

it's obvious so don't ask

zenith gazelle
opal plank
#

@elfin flower thats the raw api, regardless of language you need to send a json request

delicate shore
#

can anyone

#

help

#
if(command === "jail"){
    client.on('guildMemberAdd', async member => {
    const channel = member.guild.channels.cache.find(ch => ch.name === 'member-log');
    if (!channel) return;

    const canvas = Canvas.createCanvas(700, 250);
    const ctx = canvas.getContext('2d');

    const background = await Canvas.loadImage(member.user.displayAvatarURL({ format: 'jpg' }));
    ctx.drawImage(background, 0, 0, canvas.width, canvas.height);

    ctx.strokeStyle = '#74037b';
    ctx.strokeRect(0, 0, canvas.width, canvas.height);

    const avatar = await Canvas.loadImage('./assets/jail.png');
    // Move the image downwards vertically and constrain its height to 200, so it's a square
    ctx.drawImage(avatar, 25, 25, 200, 200);

    const attachment = new Discord.MessageAttachment(canvas.toBuffer(), 'jail.png');

    channel.send(`Bruh you are in jail, ${member}!`, attachment);
});
    
  }
#

this code is not working

#

it logs nothing

#

i have defined canvas

#

and i know avtar is jail imae

#

because i wanna lay over that

elfin flower
#

@zenith gazelle no it doesnt

zenith gazelle
#

then idk, because it should work

#

works for me ¯_(ツ)_/¯

elfin flower
#

it said

#

TypeError: startswith first arg must be str or a tuple of str, not bytes

#

so like

#

message.guild.edit("32323.jpg", blah blah, blah blah blah)?

zenith gazelle
#

no

#

message.guild.edit(icon="32323.jpg")

#

i sent the api link :P

delicate shore
#

help me

wary flame
#

What is the easiest way to get a guild by id when sharding? (discord.js)

elfin flower
#

it got the same error

#

I think I will have to know what bytes are

sick cloud
#

@delicate shore don't put events in commands

#

you'll add a new event every time you run it

mild flower
#
    at RequestHandler.execute (C:\Users\farah\Desktop\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  method: 'delete',
  path: '/guilds/710369656262623253/members/404365332912930827',
  code: 50013,
  httpStatus: 403```
#

I keep gettting this error when trying to kick anyone from the server.

#
            if (!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send('ERROR : Must have administrative rights to execute this command!') 

            const usere = message.mentions.users.first();

        if (usere) {
            const member = message.mentions.members.first();

            if (member) {
                member.kick('You were kicked from this server.').then(() => {
                    message.reply('Successfully kicked the user from this server.');
                }).catch(err => {
                    message.reply('I was unable to kick the user.');
                    console.log(err);
                });
            } else {
                message.reply("Please specify a user from this server.")
            }
        } else {
            message.reply('Please specify a user from this server.')
        }
            break;```
#

here is the kick code

restive pebble
#

missing permissons lol

mild flower
#

so what should I do den

restive pebble
#

give admin straight lol

mild flower
#

ok

restive pebble
#

or go and check permission integers

mild flower
#

the bot has perms tho

sudden geyser
#

You should check if the target member is kickabale.

mild flower
#

it is

sudden geyser
#

Also why are you checking .users.first() and .members.first() when you only need the members one.

restive pebble
#

give ur bot higher role than ur user lol

sudden geyser
#

You aren't. There's a property called .kickable on an instance of GuildMember for this

solemn latch
#

doing a kickable check will check for that

mild flower
#

i gave it administrator

#

but it doesnt seem to be working

sudden geyser
#

That does not mean it'll be able to kick the member.

mild flower
#

kick perms also

#

every perms

solemn latch
#

that also doesnt mean it can kick a user

sudden geyser
#

You could have administrator on a server yourself and you still wouldn't be able to kick the guild owner for example

#

Check if .kickable is true.

delicate shore
#

@delicate shore don't put events in commands
@sick cloud so i need to keep the member one event outside on top

#

?

solemn latch
#

discord perms also work off a tier system, the user is above the bot in that tier list, it wont kick, no matter the perms

delicate shore
#

@solemn latch what u use canvas for in your bot ??

mild flower
#

they are the same role

#

they are on the same level

sick cloud
#

yes

sudden geyser
#

then that's the issue

delicate shore
#

they are the same role
@mild flower it won't work

mild flower
#

hmm

sudden geyser
#

like I said for the 3rd/4th time, check if .kickable on a guild member is true.

#

If it is, you can kick them.

delicate shore
sick cloud
#

try it and see

delicate shore
#

yes
@sick cloud ```js
client.on('guildMemberAdd', async member => {

if(command === "jail"){
  
  try{const channel = member.guild.channels.cache.find(ch => ch.name === 'member-log');
if (!channel) return;

const canvas = Canvas.createCanvas(700, 250);
const ctx = canvas.getContext('2d');

const background = await Canvas.loadImage(member.user.displayAvatarURL({ format: 'jpg' }));
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);

ctx.strokeStyle = '#74037b';
ctx.strokeRect(0, 0, canvas.width, canvas.height);

const avatar = await Canvas.loadImage('./assets/jail.png');
// Move the image downwards vertically and constrain its height to 200, so it's a square
ctx.drawImage(avatar, 25, 25, 200, 200);

const attachment = new Discord.MessageAttachment(canvas.toBuffer(), 'jail.png');

channel.send(`Bruh you are in jail, ${member}!`, attachment);

}catch(err){console.log(err)
msg.channel.send("This command is in")
}

console.log();

}

})

mild flower
#

ye

delicate shore
#

i mean this

#

or should i place it on top??
?

sick cloud
#

try it and see

delicate shore
#

ok

#

try it and see
@sick cloud it's not working

#

no error

#

in logs

restive pebble
#

how are u using commands inside guildMember

sick cloud
#

¯_(ツ)_/¯

#

i don't use canvas

restive pebble
#

canvas easy bruh

#

but how he using command inside guildMemberJoin thing

delicate shore
#

bruhruhruhurhu®hruhrururhu

#

then wot

mild flower
#

I fixed it

delicate shore
#

u meenaee

restive pebble
#

u cannot use message property inside guildMemberAdd

wary flame
#

What is the easiest (or best) way to get a guild by id in discord.js when sharding?

delicate shore
#

u cannot use message property inside guildMemberAdd
@restive pebble then how to use it

#

@solemn latch what u use canvas for ?

hoary elm
#

@restive pebble then how to use it
@delicate shore in a message event ie: Client.on(“message”

restive pebble
#

just directly use it

delicate shore
#

?

restive pebble
#

u cannot use message and another instance

#

together

delicate shore
#

then it says member is not defined

restive pebble
#

directly execute

delicate shore
#

¯_(ツ)_/¯

#

then it says member is not defined

restive pebble
#

no member joined bruh

#

and u are executing

#

the cmd

solemn latch
#

@delicate shore I do some stuff with gifs

delicate shore
#

bruhruhruhruhrhurhruhru wym

#

boeing

errant perch
#

how would i convert the time my server was created at to just the date?

solemn latch
#

My blaxkjack game uses canvas too

delicate shore
#

okokok

#

no member joined bruh
@restive pebble ok so what to do

solemn latch
delicate shore
#

hmm

#

how do i define member?

restive pebble
#

chill dude

delicate shore
#

ok

#

@restive pebble ```
typeError: Cannot read property 'channels' of undefined
at Client.<anonymous> (/app/index.js:123:40)
at Client.emit (events.js:196:13)
at MessageCreateAction.handle (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
at WebSocketShard.onPacket (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22)
at WebSocketShard.onMessage (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)
at WebSocket.onMessage (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/node_modules/ws/lib/event-target.js:125:16)
at WebSocket.emit (events.js:196:13)
at Receiver.receiverOnMessage (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/node_modules/ws/lib/websocket.js:800:20)

#

cannot read property channels?????????

restive pebble
#

send code lol

solemn latch
#

The important part is of undefined

#

Whatever you put before .channels isn't defined

delicate shore
#

ok

#
 
    if(command === "jail"){
      
      let member = msg.author
      
      try{const channel = member.guild.channels.cache.find(ch => ch.name === 'member-log');
    if (!channel) return;

    const canvas = Canvas.createCanvas(700, 250);
    const ctx = canvas.getContext('2d');

    const background = await Canvas.loadImage(member.user.displayAvatarURL({ format: 'jpg' }));
    ctx.drawImage(background, 0, 0, canvas.width, canvas.height);

    ctx.strokeStyle = '#74037b';
    ctx.strokeRect(0, 0, canvas.width, canvas.height);

    const avatar = await Canvas.loadImage('./assets/jail.png');
    // Move the image downwards vertically and constrain its height to 200, so it's a square
    ctx.drawImage(avatar, 25, 25, 200, 200);

    const attachment = new Discord.MessageAttachment(canvas.toBuffer(), 'jail.png');

    channel.send(`Bruh you are in jail, ${member}!`, attachment);
}catch(err){console.log(err)
           msg.channel.send("**This command is in development**")
           }
    
    console.log();
  }
    
#

@restive pebble Here^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

restive pebble
#

what are u doing even

delicate shore
#

what are u doing even
jail command like dank memer
@restive pebble

#

hehe

#

like this ^^^^
^^^

#

@restive pebble

restive pebble
#

¯_(ツ)_/¯

unborn steeple
#
(node:2133) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit

How do i fix this lmao

solemn latch
#

You set member to msg.author
Which is a User
User doesn't have .guild @delicate shore
https://discord.js.org/#/docs/main/stable/class/User

sudden geyser
#

Do you use .on("message", (...) => {...}) explicitly 11 times.

unborn steeple
#

Lmao yeh

sudden geyser
#

If not, do you think you have the event listener nested in another listener or anything that's called more than once

#

ah well you don't need that

#

you only need one

unborn steeple
#

Too much work

solemn latch
#

Lol

sudden geyser
solemn latch
#

Its more work to do it your way

unborn steeple
#

Its like 800+ lines of code lmao

opal plank
#

what

solemn latch
#

I have individual commands with over 1100 lines

#

🤔

sudden geyser
#

Your way is likely going to take more space, along with additional resource use that can easily be chopped down.

#

You can also make it modular.

unborn steeple
#

its 800+ lines of code per message event lmao

#

Its a full on system

sudden geyser
#

Is it within one single file?

unborn steeple
#

rpg system

#

yeah my main file

trim saddle
#

uhhh, how would i go about choosing wether to use black or white when faced with a certain color

unborn steeple
#

I guess i can cut them down smaller

solemn latch
#

Making a black and white filter?

cinder patio
#

I don't think you should do it yourself

regal raven
#

You can use dank memer's api @delicate shore

#

But I don’t think they will allow it to be used by another bot

delicate shore
#

@regal raven how

regal raven
#

Find it

#

I forgot

delicate shore
#

ohhö

summer torrent
earnest phoenix
delicate shore
#

how to use

#

it

#

using fetch?

#

@summer torrent

summer torrent
#

doesn't matter

delicate shore
#

o

#

then howwwwwww

unborn steeple
#
(node:5238) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send messages to this user

I have my settings to allow anyone to dm me but it still sends this what does it mean?

summer torrent
#

user disabled dm messages / user blocked bot

#

or there is no mutual servers

earnest phoenix
#

@unborn steeple it's means the user has dm closed or blocked the bot :)

#

Or not allow direct message

delicate shore
#

hey

#

how to define channel

#

like i am sending s!command

#

here

#

and i wanna define this channel

#

so will it be msg.member.channel?

summer torrent
#

msg.channel

delicate shore
#

ok

#

thnx

marble geode
#
const { MessageEmbed } = require('discord.js')
const ms = require('parse-ms')

exports.run = async(client, message, args) => {
 let user = message.author
 
 if (db.has(`${user.id}`, ["gun", "crowbar"]) === true) {
 let timeout = 3600000
 let robed = db.fetch(`robed_${user.id}`)
     
 if (robed != null && timeout - (Date.now() - robed) > 0) {      
   let time = ms(timeout - (Date.now() - robed));
      message.channel.send(`You have already robbed a bank please come back in **${time.hours}h ${time.minutes}m ${time.seconds}s**`)

} else {
  let earned = Math.floor(Math.random() * 1500) + 1
  
  let jobs = ["Rexy Bank", "Discord Bank", "NYC Bank", "BCA Bank"]
  let job = jobs[Math.floor(Math.random()* jobs.length)]
 
  let embed = new MessageEmbed()
  .setColor(0x7289DA)
  .setAuthor(`${user.username}`, user.avatarURL())
  .setDescription(`Robbed in: ${job}\nGet: ${earned}$`)
  
  message.channel.send(embed)
  
  db.add(`money_${user.id}`, earned)
  db.set(`robed_${user.id}`, Date.now())
}
} else if (db.has(`${user.id}`, ["gun", "crowbar"]) === false) {
return  message.channel.send("You need to buy a gun and crowbar first (hint: r!shop leads you to shop where you can buy stuff)")

}
 }
exports.help = {
         name: "rob",
         description: "rob a bank and earn money",
         usage: "r!rob",
         example: "r!rob",
};

exports.conf = {
          aliases: [""],
          cooldown: 5
};
#

that my code

restive pebble
#

error lol?

marble geode
#

i want someone want to rob must have gun and crowbar

#

but i test it

#

i no have gun and crowbar

#

and can do it

#

someone can help fix?

#

@restive pebble sir

restive pebble
#

sorry i cant help with quick.db

#

(!db.has(${user.id}, ["gun", "crowbar"]) maybe try like that

golden condor
#

You could check the docs

marble geode
#

@golden condor i did

#

but same not work

potent holly
summer torrent
potent holly
#

Tall me how can do that

pure lion
#

@potent holly you added your bot to 100 servers

You

#

At a guess

potent holly
#

No bro

pure lion
#

There's no point denying if you did

#

That's what it thinks happened

#

Yeah go to the Dev server :////

potent holly
#

OK thanks @pure lion

pure lion
#

Np

earnest phoenix
lusty quest
#

d.js?

pure lion
#

^

#

It's not hard, just map them

earnest phoenix
delicate merlin
#

get the list store it somewhere and edit the message

earnest phoenix
#

but how i do the pages thing?

lusty quest
#

idk then. on .js i chunk them down into a wanted amount and create a new page for each chunk

delicate merlin
#

on_reaction

#

smth like that

#

on_reaction then edit message

earnest phoenix
#

huh

#

and how do i make pages?

delicate merlin
#

its an embed

lusty quest
#

edit the embed

delicate merlin
earnest phoenix
#

like only 20 users on first page

delicate merlin
#

yeah

#

do you know python

earnest phoenix
#

yh

lusty quest
#

chunk your array into 20 users each chunk

#

its one way

#

there are other

delicate merlin
#

or get first 20 then print 21->40

#

there are so many ways to do this

regal raven
green kestrel
#

@potent holly you added your bot to 100 servers

You
@pure lion no, he added his bot here.

#

adding your bot to bot lists to get that initial leg up to 75 servers is considered "inorganic growth"

delicate merlin
#

im pretty sure if u have like 5 test server or smth somewhere around there it is also inorganic

green kestrel
#

maybe, but theyve stated clearly that adding a bot here is called inorganic or advertised, and best thing you can do is reapply once you hit 250 servers and they tend to always accept that

#

its not like they can say no for no reason, just to cripple your bot, right? 😛

lusty quest
#

there are some issues with this, they made a Post on the d.js dev server about it and they want to fix some of the issues

green kestrel
#

Hmm would have been good to post that somewhere more generic,.not everyone uses djs

#

Can you copy and paste that please @lusty quest

lusty quest
#

they removed the channel there

#

or im Blind AF and cant find the FAQ channel anymore

weary ridge
#

Hey i recently installed a, tracker for like fortnite stats but how do i put a class into a command?

#
class TestRainbow6Siege(unittest.TestCase):

    def test_get_player_info(self):
        r6s = Rest('config.yaml', ignore_limiter=True).Rainbow6Siege
        info = r6s.get_player_info('barzY-YT', 'uplay')

        assert info['player']['username'] == 'barzY-YT'


    def test_get_player_operators(self):
        r6s = Rest('config.yaml', ignore_limiter=True).Rainbow6Siege
        info = r6s.get_player_operators('barzY-YT', 'uplay')

        assert len(info['operator_records']) > 0


    def test_get_leaderboards(self):
        r6s = Rest('config.yaml', ignore_limiter=True).Rainbow6Siege
        leaders = r6s.get_leaderboards('pc', page=1)

        assert len(leaders) == 100


    def test_get_player_stats_seasonal(self):
        r6s = Rest('config.yaml', ignore_limiter=True).Rainbow6Siege
        player_stats = r6s.get_player_stats_seasonal('bedbbe83-015a-4e6f-babc-580c6e6ff9f3')

        assert player_stats['username'] == 'SanalsBae'


    def test_get_player_stats(self):
        r6s = Rest('config.yaml', ignore_limiter=True).Rainbow6Siege
        player_stats = r6s.get_player_stats('bedbbe83-015a-4e6f-babc-580c6e6ff9f3')

        assert player_stats['username'] == 'SanalsBae'


    def test_get_high_level_player_status(self):
        r6s = Rest('config.yaml', ignore_limiter=True).Rainbow6Siege
        player_stats = r6s.get_high_level_player_status('SanalsBae', 'pc')

        assert player_stats[0]['ubisoft_id'] == 'bedbbe83-015a-4e6f-babc-580c6e6ff9f3'```
#

for examle that

green kestrel
#

@lusty quest dm me an invite please i'll take a look

delicate shore
#
if(command === "covidadv"){
    
    api.all().then(console.log)
    const data = await api.all()
    
    const coronaadv = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTitel("Advance Covid Stats")
    .setDescription("No. of cases are not exact and may differ")
    .addField("Global Cases" ,data.cases, true)
    .addField("Global Deaths" ,data.deaths, true)
    .addField("Global Recoveries" ,data.recovered, true)
    .addField("Active cases" ,data.active, true)
    .addField("Cases Today", data.todayCases, true)
    .addField("Critical Cases", data.critical, true)
    .setFooter("Stay Home, Stay safe | s!help")
    
  }```
#

it says .setColor is not a function

#

like

#

wot

#

oh

weary ridge
#

have u tried colour?

delicate shore
#

yes

#

i forgot msg.channel.send

lusty quest
#

@green kestrel found it was not the d.js server

weary ridge
#

oh lol

green kestrel
#

ah, ok

weary ridge
#

@lusty quest you know python right?

lusty quest
hoary elm
#

i forgot msg.channel.send
@delicate shore you also spelt title wrong let me just save you the problem in advance

lusty quest
#

@weary ridge not really

green kestrel
#

ah its ddev

weary ridge
#

oh

thorny meteor
green kestrel
#

tbh their suspicious growth thing is a bit silly

hoary elm
#

Agreed

weary ridge
#

agreed

green kestrel
#

they dont let you apply till you grow, and most grow by telling people about their bot, but thats inorganic

lusty quest
#

there are users that will get Friends together to create 100 Guilds just for getting the Badge

weary ridge
green kestrel
#

my last bot i put on here, i went from 3 guilds to 75 in a day, then went over 250 over the next week

weary ridge
#

and then they woulda told you apply in 2 weeks

lusty quest
#

gg. i grow about 3 servers/week since i hit 100

hoary elm
#

my last bot i put on here, i went from 3 guilds to 75 in a day, then went over 250 over the next week
@green kestrel I don’t understand how they classify that as inorganic tbh Iike yeah I get it’s suspicious that it grew fast but it’s not like your sitting there saying “hey everyone check out my bot page”

weary ridge
#

my friend got to 160 in 2 days Lul

delicate shore
#

@delicate shore you also spelt title wrong let me just save you the problem in advance
@hoary elm oh thnx

#

lol\

weary ridge
#

and i think ik why

green kestrel
#

thing is, i also do advertise, legitimately, on facebook

#

i pay for fb ads

weary ridge
#

but thats a waste

green kestrel
#

and i pay for ads here too

weary ridge
#

lul

green kestrel
#

not at all, it gets me massive growth

hoary elm
#

^^

#

Lol

weary ridge
#

hmm

green kestrel
#

but theyre saying then that this method of growth thats fine in any other industry isnt fine for a bot dev... why?

lusty quest
#

i dont want to compete with Mee6 and spend like 300$ on ads

green kestrel
#

marketing is BAD y'all

#

😄

hoary elm
#

Yeah that doesn’t make sense

green kestrel
#

then dont

#

my marketing budget is $30 a month and mee6 cant snipe my spot

weary ridge
#

hmm just curious is it possible to put ads in that html you allow us to add?

lusty quest
#

also im fine with the current grow. getting over night 1000 new Guilds would kill my Server

green kestrel
#

i could cope with that

#

100,000 and i'd be hoping at least a small percentage got premium lol

#

because then i'd need more physical servers

lusty quest
#

my Database is already ready for infinite scaling but the Server where the bot is running on not

delicate shore
#

TypeError: (intermediate value).setTitle(...).setcolor is not a function
at Client.<anonymous> (/app/index.js:822:6)
at processTicksAndRejections (internal/process/task_queues.js:88:5)

#

i am havin this error

lusty quest
#

also i need to find a way to get the shards on mutiple servers better managed. doing it manually is annoying

delicate shore
#
if(command === "covid"){
    
    const countrycovid = args[1]
    const countrydata = await api.countries({country : countrycovid})
    
   try{ 
    
    const countryembed = new Discord.MessageEmbed()
    .setTitle(`${countrycovid}`)
    .setcolor("RANDOM")
    .setDescription("No. of cases are not exact and may differ")
    .addField("Cases" ,countrydata.cases, true)
    .addField("Deaths" ,countrydata.deaths, true)
    .addField("Recoveries" ,countrydata.recovered, true)
    .addField("Active Cases" ,countrydata.active, true)
    .addField("Cases Today", countrydata.todayCases, true)
    .addField("Critical Cases", countrydata.critical, true)
    .setFooter("Stay Home, Stay safe | s!help")
 msg.channel.send(countryembed)
   
  
   } catch(err){
     console.log(countrycovid)
   console.log(err)
     msg.reply("**This command is under construction**")
 }
  }
lusty quest
#

your code?

delicate shore
#

my code ^^

hoary elm
#

setColor

lusty quest
#

setColor

hoary elm
#

Capital C

delicate shore
#

oh

#

what about title

#

?

#

there is an error

lusty quest
#

fix the captial C and see if it works

hoary elm
#

^^

delicate shore
#

guys

restive pebble
#

ok

delicate shore
#

i want it to say country not found

#

instead of undefined

#

hmm

#

how to do that

earnest phoenix
#

u use corona api

restive pebble
#

Use my api lol

lusty quest
#

check if the API return something usefull. if not change it to wahtevery you want

earnest phoenix
#

with postman ??

delicate shore
#

Use my api lol
@restive pebble which

#

give me

#

pls

restive pebble
#

Hmmmm

#

Hmmmmmmmmm

delicate shore
#

lol

restive pebble
#

It's webscrapped

earnest phoenix
#

first console log the respounce

restive pebble
#

So u can see

earnest phoenix
#

then u can see

delicate shore
#

oohohohohoohohohhohohohohoohohohoohohohohohohohohh

#

ok

earnest phoenix
#

what u need

#

Anyone know anything about either.io's api or how to find it?

restive pebble
#

npm I worldometer-coronavirus-info

earnest phoenix
#

@earnest phoenix nope0

restive pebble
#

So easy to use

earnest phoenix
#

look docs

restive pebble
#

Take a look at docs before trying anything lol

delicate shore
#

send me

#

docs

earnest phoenix
#

dide

restive pebble
#

It's a npm package

earnest phoenix
#

go google and search

#

smh

delicate shore
#

so

#

my api does return msg

#

in logs

#

@earnest phoenix

restive pebble
#

Hmmm

delicate shore
#

what too do