#development

1 messages ยท Page 972 of 1

digital ibex
#

im trying to add two guilds onto one column

#

instead of 1 column & one guild

hasty sparrow
#

Each guild is a column, you can have as many per container as you want

#

Having too many will just wrap the "overflowing" columns into a new line

digital ibex
#

if that makes more sense, the circles r meant to be servers

hasty sparrow
#

Why not just have them all next to each other?

digital ibex
#

what

hasty sparrow
digital ibex
#

im trying to show two guilds on one line

#

instead of one

flat obsidian
#

why I cant turn my bot online

hasty sparrow
#

Show your code please

digital ibex
#
  <div class="container">
   <div class="columns is-multiline is-mobile">
      <div class="column is-one-quarter">
         <a href="guilds/<%= guild.id %>">
            <img src="https://cdn.discordapp.com/icons/<%=guild.id%>/<%=guild.icon%>.png">
         </a>
         <p class="bd-notification"><%= guild.name %></p>
      </div>
  </div>``` thats my html
#

and my loop: js <% user.guilds.filter((e) => e).forEach((guild) => { %> <%- include('dash/guilds', {guild}) %> <% }) %>

hasty sparrow
#

Why are the first two divs still inside your guild template?

digital ibex
#

because it was making it weird and squashing it together

hasty sparrow
#

The squashing was due to not using is-multiline, try again

tulip ledge
#

I can't seem to get this to work.

            let randommonster = Math.floor(Math.random() * totalchance) + 1;
            let encounter;
            for (let i = 0; i < viablemonsters.length; i++) {
                console.log(monsterfile[viablemonsters[i]])
                if(i === 0 && randommonster <= monsterfile[viablemonsters[i]].chance) encounter = viablemonsters[i];
                else if(randommonster > monsterfile[viablemonsters[i - 1]].chance && randommonster <= monsterfile[viablemonsters[i]].chance) encounter = viablemonsters[i];      
            }

Error:
TypeError: Cannot read property 'chance' of undefined

digital ibex
#

so this is my loop: js <div class="container"> <div class="columns is-multiline is-mobile"> <h1 class="h1-select-server">Select a Server You'd Like to Manage</h1> <% user.guilds.filter((e) => e).forEach((guild) => { %> <%- include('dash/guilds', {guild}) %> <% }) %> </div> </div> like that?

hasty sparrow
#

๐Ÿ‘๐Ÿผ

digital ibex
#

and my html: html <div class="column is-one-quarter"> <a href="guilds/<%= guild.id %>"> <img src="https://cdn.discordapp.com/icons/<%=guild.id%>/<%=guild.icon%>.png"> </a> <p class="bd-notification"><%= guild.name %></p> ?

hasty sparrow
#

If you want 2 per line, use is-half instead of is-one-quarter

digital ibex
#

kk

hasty sparrow
#

Don't forget the closing </div>

digital ibex
#

oh yeah. woops

quaint hornet
#

I can't seem to get this to work.

            let randommonster = Math.floor(Math.random() * totalchance) + 1;
            let encounter;
            for (let i = 0; i < viablemonsters.length; i++) {
                console.log(monsterfile[viablemonsters[i]])
                if(i === 0 && randommonster <= monsterfile[viablemonsters[i]].chance) encounter = viablemonsters[i];
                else if(randommonster > monsterfile[viablemonsters[i - 1]].chance && randommonster <= monsterfile[viablemonsters[i]].chance) encounter = viablemonsters[i];      
            }

Error:
TypeError: Cannot read property 'chance' of undefined
You array is by index or words?

tulip ledge
#

wdym

digital ibex
#

uh

tulip ledge
#

This is my array: [ 'goblin', 'wolf' ]

quaint hornet
#

That the problem

hasty sparrow
#

Move <h1 class="h1-select-server">Select a Server You'd Like to Manage</h1> outside of columns

digital ibex
#

kk

quaint hornet
#

You are not getting the name in he

digital ibex
hasty sparrow
#

Looks like you didn't specify a column width

quaint hornet
#

You have to parse a number like

#

0 or 1

tulip ledge
#

Are you talking to me?

digital ibex
#

@hasty sparrow how would i do that?

quaint hornet
#

Monster[0]

#

Yes

tulip ledge
#

monster[name] should work aswell

#

So I don't get what you're trying to say

digital ibex
#

thats what im doing

tulip ledge
#

@quaint hornet what are you trying to say

quaint hornet
#

You are tryng get element by it value

#

No it index

hasty sparrow
#

In that case you must have custom CSS or something messing with your formatting

digital ibex
#
<div class="column is-one-half">
         <a href="guilds/<%= guild.id %>">
            <img src="https://cdn.discordapp.com/icons/<%=guild.id%>/<%=guild.icon%>.png">
         </a>
         <p class="bd-notification"><%= guild.name %></p>
</div>```  and the loop: ```js
<div>
   <h1 class="h1-select-server">Select a Server You'd Like to Manage</h1>
   <div class="container">
      <div class="columns is-multiline is-mobile">
 <% user.guilds.filter((e) => e).forEach((guild) => { %>
      <%- include('dash/guilds', {guild}) %>
<% }) %> 
      </div>
   </div>
</div>```
tulip ledge
#

yes thats what it's supposed it do

quaint hornet
#

Array[name] dont work on that type of array

tulip ledge
#

Wut

#

I didn't know that lol

digital ibex
#

the only css i've got is to change the background colour and stuff, nothing to do with changing the format

tulip ledge
#

But monsterfile[viablemonsters[i - 1]] is a json file

#

@quaint hornet

#

monsterfile is a json

hasty sparrow
#

Can't reproduce it on my end, time for you to "Inspect element"

digital ibex
#

okie, last question tho

#

@hasty sparrow how can i filter out the guilds i have a certain permission in? all i have is the id of the user accessing the site & the permission bit number thing

quaint hornet
#

Chickendev i teste here aand dont work

tulip ledge
#

yeah I know it doesn't work thats why I came here but how do I fix it

quaint hornet
#

You can try to get element by value instend of index

#

This shold work

tulip ledge
#

Isn't that what I'm doing

quaint hornet
#

You are searching for a element eith index 'Name'

#

Not a value

tulip ledge
#

I don't get what you mean by this

hasty sparrow
quaint hornet
#

Array.find(element => element == "monstername")

tulip ledge
#

And how am I supposed to do this to get the chance?

digital ibex
#

i know the bit number, but how can i check if they have permission?

hasty sparrow
#

Bitwise AND

quaint hornet
#

You have a array of objects right

hasty sparrow
#

The second answer on the SO post should help you

tulip ledge
#

monsterfile.find is not a function @quaint hornet

quaint hornet
#

I dont know how you are saving that data

tulip ledge
#

A json file

#

Like I said

quaint hornet
#

i say

#

its like

#

Name: "Pig",
Chance: 8

#

or you have two arrays

#

one with a name

#

and another with the values

#

if you have an object you can try

#
const array1 = [{Name:"Pig",Chance:5}, {Name:"Sheep",Chance:1}, {Name:"piglin",Chance:7}];

const found = array1.find(element => element.Name == MonsterName);

console.log(found.Chance);
// expected output: 5
tulip ledge
#

Yeah well thats not what my problem is

quaint hornet
#

What your problem?

tulip ledge
#
for (let i = 0; i < viablemonsters.length; i++) {
                console.log(monsterfile[viablemonsters[i]])
                console.log(i)
                console.log(i - 1)
                console.log(monsterfile[viablemonsters[i - 1]])
                if(i === 0 && randommonster <= monsterfile[viablemonsters[i]].chance) encounter = viablemonsters[i];
                else if(randommonster > monsterfile[viablemonsters[i - 1]].chance && randommonster <= monsterfile[viablemonsters[i]].chance) encounter = viablemonsters[i]; 
}
#

When i = 0 it goes to else if for some reason and 0 - 1 is -1 wich returns undefined

#

So I need a better way, anyone knows how?

quaint hornet
#

You can put && i > 0

tulip ledge
#

Wait what no

#

Thats not

#

Oh

#

You mean like that

#

Yeah ok

#

I'll try

#

But then if i = 0 it won't trigger

quaint hornet
#

You dont want to run the else if when i ==0 right?

tulip ledge
#

Ye

#

I added what u said

#

But it didn't solve it

earnest phoenix
#

how i can start lavalink forever

#

like in background

tulip ledge
#

This is weird

#
[ 'goblin', 'wolf' ]
goblin
wolf
goblin

This is a for loop, it only has 2 entries but logs 3 times

#

So thats why the 3rd one doesn't work

digital ibex
#

thats not a for loop

tulip ledge
#

No

digital ibex
#

whats even ur issue?

tulip ledge
#

Its logged inside a for loop...

#

I'm for looping that array

#

But it logs 3 entries

#

While the array only has 2

digital ibex
#

can u show all the code

tulip ledge
#
            let randommonster = Math.floor(Math.random() * totalchance) + 1;
            let encounter;
            console.log(viablemonsters)
            for (let i = 0; i < viablemonsters.length; i++) {
                console.log(viablemonsters[i])
                if(i === 0 && randommonster <= monsterfile[viablemonsters[i]].chance) encounter = viablemonsters[i];
                else if(i > 0 && randommonster > monsterfile[viablemonsters[i - 1]].chance && randommonster <= monsterfile[viablemonsters[i]].chance) encounter = viablemonsters[i]; 
            }
            console.log(encounter)
digital ibex
#

what does viablemosters log?

#

and encounter

tulip ledge
#

[ 'goblin', 'wolf' ]

#
[ 'goblin', 'wolf' ]
goblin
wolf
goblin

This is a for loop, it only has 2 entries but logs 3 times
@tulip ledge

#

undefined

#

Is what encounter logs

#

Sometimes

#

Not always

earnest phoenix
#

0k
Im trying to make a quote command for my ervice
and each event and command is in a differetn folder
And when someone reacts it triggered a file to run
Then, it gets the file and makes a channel and sets user tickets to quote 1
Then if someone says !quote 2$
It adds them to the channel
how do i access userTickets in all of the folders?
ping me if u know

peak quail
#

How can i get each letter of a word in a array ?
so i have hello and it would give me ['h', 'e', 'l', 'l', 'o'] GWchadThinkeyes

tulip ledge
#

Ok I found out what is happening

#
            let encounter = "test";
            console.log(viablemonsters)
            for (let i = 0; i < viablemonsters.length; i++) {
                console.log(viablemonsters[i])
                console.log(i)
                if(i === 0 && randommonster <= monsterfile[viablemonsters[i]].chance) encounter = viablemonsters[i];
                else if(i > 0 && randommonster > monsterfile[viablemonsters[i - 1]].chance && randommonster <= monsterfile[viablemonsters[i]].chance) encounter = viablemonsters[i]; 
            }

It logs test now how do I fix this?

#

It's not getting overwritten

#

How can i get each letter of a word in a array ?
so i have hello and it would give me ['h', 'e', 'l', 'l', 'o'] :GWchadThinkeyes:
@peak quail <String>.split("")

peak quail
#

Thanks

earnest phoenix
#

0k
Im trying to make a quote command for my ervice
and each event and command is in a differetn folder
And when someone reacts it triggered a file to run
Then, it gets the file and makes a channel and sets user tickets to quote 1
Then if someone says !quote 2$
It adds them to the channel
how do i access userTickets in all of the folders?
ping me if u know

clever tree
#
console.log(message.guild.emojis.filter(emoji => emoji.animated === true).size)

returns all emojis of the guild.
and ... === "true" returns 0
Help please :)

digital ibex
#

@clever tree because there are no animated emojis?

clever tree
#

I found the problem. All fine. Thanks xd

earnest phoenix
#

How to i can host lavalink forever

#

cuz when i close the terminal it shut down

mossy vine
#

use a process manager

earnest phoenix
#

How

pale vessel
#

he told you how

earnest phoenix
#

sudo apt-get isntall pv ?

#

pv commnad

#

?

mossy vine
earnest phoenix
#

yes

#

can u give me a link for tutorial

#

cuz i cant find

#

oh done

#

fixed

scarlet geyser
nocturne grove
#

Is it right that after someone votes on top.gg, it takes some time for bot.monthlyPoints to update?

mossy vine
#

yes

slender thistle
tulip ledge
#

I can't seem to get this right, I have some monsters in a json I already have the way of getting the random monster "number" now I need to get the random monster based on it I've tried alot of different aproaches but none work. Anyone knows how?

    "troll": {
        "health": 10,
        "damage": 15,
        "drops": ["2-4 wolf hide", "1 wolf tooth", "hunters knife"],
        "coins": "2-5",
        "xp": "3-5",
        "level": 3,
        "chance": 10
    }

Thats the json file and has multiple of those the chance is a % but doesn't add up to 100 necesarally. It can contain 3, 7, 5 basically a non set amount of entries

nocturne grove
#

๐Ÿ‘

sudden geyser
#

rate my custom made DM command
@scarlet geyser what part specifically? There's nothing to really rate.

scarlet geyser
#

um

#

how the command is

#

lol

tulip ledge
#

Anyone has a solution to mine?

sudden geyser
#

Eh it's kind of average but I don't think there's a good way to make the command look any better.

ChickenDev if the key is the monster and the value is another object having the data, did you try getting an array of keys and getting a random element from it?

tulip ledge
#

But they have a chance

#

Some are rarer then others

sudden geyser
#

There are many ways you could implement a chance. A basic example would be having 100 elements in an array and filling it up based on the chance, then picking a random element. There are certainly better approaches but that's the first one that came to my head.

tulip ledge
#

And how would I fill it up

#

And I said they dont necesarrally fill up to 100

wise quartz
#

How do i use a @tasks.loop ?
(Python: GWcodesPython)

wise quartz
#

Does it have to be inside the command or seperate like a function or so?

slender thistle
#

A separate function

#

No way in hell should it be nested in a command

wise quartz
#
@tasks.loop(seconds= 300):
   #stuff

Like that?

slender thistle
#

Elaborate on the stuff part

#

What will you put there

wise quartz
#

Thats my question ๐Ÿ˜‚

#

Since you said like a function i guess there'll be stuff here so

slender thistle
#

Well it is a function... with a decorator :^)

#

an async function, to be precise

wise quartz
#

So i do

@tasks.loop(seconds= 300)
async def something():
    #stuff

This ^ ?

slender thistle
#

Assuming it's a class method, add self in the function args

#

but yeah

wise quartz
#

Ohhh... so this is just a function that'll run every 5 minutes or the time i put on seconds= ___

#

Right?

#

Basically a check

slender thistle
#

a loop with a delay

wise quartz
#

Aha

#

Started making sense rn

slender thistle
#

You could technically use minutes instead of seconds if you only need 5 minutes catshrug

wise quartz
#

I saw on the docs it has those start(), stop(), current_loop, etc.. so do i use these in the function itself or the command?

slender thistle
#

Refer to the examples in the docs oop

wise quartz
#

Both i guess?

#

๐Ÿ˜…

slender thistle
#

start the task somewhere in the code where you are certain it will run

wise quartz
#

The command then MegaThonk

slender thistle
#

Ehh

#

You'd have to make sure the task is already running

#

unless...

wise quartz
#

can you please just say? I got confuzed...

#

On command or function?

slender thistle
#

I don't think starting a loop on command usage is a good idea

#

What do you need the task for?

wise quartz
#

Then function

#

Ty

#

What do you need the task for?
I have a work command but when you work you have to choose between a couple jobs and every job have a different time until you get your paycheck. Now i know i could just asyncio.sleep but i have some jobs that take up to 40 minutes because they give huge paychecks so i wont risk the bot suddenly going down and then you just lose the paycheck so i decided to store the endtime in my database then run a task loop every 5 minutes to check when if the time is done the it'd give the user his paycheck.

#

It sounds complicated and stupid because i am bad at explaining

#

๐Ÿ˜…

#

And my main language ain't English.

slender thistle
#

So, one task running every 5 minutes checking if the paychecks are supposed to be handed out.
Yup, sounds about right

wise quartz
#

Aaa.... ๐Ÿ˜• is that a compliment or your saying my idea is bad?

#

๐Ÿ˜…

slender thistle
#

Nope, I was just trying to confirm that I understood it properly

wise quartz
#

Owh thank god

#

Yeah y understood it right

#

Is it a good idea tho?

slender thistle
#

But yeah, the idea of implementation is nice

wise quartz
#

Damn i feel smart

slender thistle
wise quartz
#

alr then i'll try to make that whole thing that i said work.

#

Wish me luck

#

๐Ÿ˜‚

#

Ty

slender thistle
#

I wish you no luck and all skill

wise quartz
#

Uh... that way my chance of success has reduced by 90%

slender thistle
#

Nah you can do it. Ask questions here if you need help

wise quartz
#

Sure thing

#

Alr ty.

restive furnace
#

One tutorial looped on all commands on one command usage..

wary swan
#

how can i get users in bots channel

#

excluding bots

#

is there a event for that

tight plinth
#

In bots channel?

wary swan
#

ฤฑn the channel that bot is in

marble juniper
#

you mean voice or text

tight plinth
#

Every channel has a members property which contains the members who can access the channel iirc, you can just filter the members to exclude bots

#

iirc this applies for both text & voice channels

wary swan
#

voice

marble juniper
#

yeah there is an event for that

wary swan
#

can you say the event name

marble juniper
wary swan
#

let me try that

woeful pollen
#

Is there a way to slice from args
Like if I want everything from args [2] because the length or args[2] could vary

earnest phoenix
#

how do i remove the <@> in the mention?

#

ping me

pale vessel
#

@earnest phoenix

#

use the replace function

earnest phoenix
#

how

#

srry im new

cosmic shard
#

.

still merlin
#

what is the difference bewteen "premission", "premission" and "premission || "premission"

pale vessel
#

first one would be the required permissions, which the member needs to have them all and second would be the member needs to have at least one of those two

still merlin
#

ok thank you so much

digital ibex
#

in the script tag in html, how can i require a file?

#

i done ```js
const thing = require('thing');

import { thing } from 'thing';

earnest phoenix
#

Yes

digital ibex
#

what

pale vessel
#

yes

digital ibex
#

huh

earnest phoenix
pale vessel
#

and did you actually try?

earnest phoenix
#

yep

pale vessel
#

we're not here to spoonfeed

earnest phoenix
#

i tried, but stuff failed

pale vessel
#

ah, okay

#

what failed?

earnest phoenix
#

first i tried it using the random_puppy
the did not work well
then i made a API myself
taking images from the URL
it did fetch images
but the next time the command was run
the images didn't load the my bot failed

#

so I came here to ask if anyone got suggestions of what I can use for that

#

How can i block if a video url/parameter is a live stream? I tried video.duration.seconds === 0 etc. but not worked. Anyone?

pale vessel
#

Can you show me the code that you tried? [@earnest phoenix]

earnest phoenix
#

i deleted it lmao
but it was a simple embed
with a small script taking images from an URL

#

Anyone?

#

why no-one is not answering to my ques..

#

i would answer if i knew

#

Sad :>(

deft condor
#

anyone know how to get all online members of a guild?

earnest phoenix
#

Filter?

summer torrent
#

filter by presence.status

earnest phoenix
#

hello

#

how a ican use visual study and modify glich

#

i have the extension

deft condor
#

Is it guild.members.filter?

pale vessel
#

if you're on v12 then no

summer torrent
#

members.cache

deft condor
#

guild.members.cache.filter(m => m.presence.status === 'online').size

#

And it giving me

#

37

summer torrent
#

.size

deft condor
#

But there is 71 online

summer torrent
digital ibex
#

prob not cached

sudden geyser
#

Is it 71 members online in total, or 71 members with the status of online as there are others like idle, dnd, etc.

earnest phoenix
#

or just use !== "offline"

deft condor
#

Oh I pointed it to to the wrong guild

earnest phoenix
#

Wrong channel?

cosmic shard
#

.

slender thistle
#

-dotpost @cosmic shard

gilded plankBOT
#

@cosmic shard

Please do not post dots to clear your messages/get attention. It adds absolutely nothing to the conversation and just causes spam.
If you need to get attention, then say hello everyone. If you need to clear your messages, then press the Esc key. If you do not follow these instructions you will be muted.

cosmic shard
#

hello everyone

#

Esc

#

/get attention

#

.

slender thistle
#

Stop posting dots

cosmic shard
#

Okey

#

I am Bot developer

#

but you not give my role why ?

slender thistle
#

Have you submitted it on top.gg and had it approved?

cosmic shard
#

I did not approve my bot

slender thistle
#

The bot developer is given only to owners of approved bots on top.gg

cosmic shard
#

and my discord bot is not active on top.gg

modest maple
#

no

cosmic shard
#

wut ?

modest maple
#

you bot is not public on top.gg

cosmic shard
#

yes

#

so why not active?

modest maple
#

Because its not been approved

cosmic shard
#

So how is it confirmed?

earnest phoenix
#

?

#

ours?

modest maple
#

You have to wait for it to be tested after submitting

earnest phoenix
#

the time range for waiting is 1-2 weeks

cosmic shard
#

Okey :)

#

Thanks

pure lion
#

-upto

#

why cant i use it :<

slender thistle
#

They're mod-only

pure lion
#

makes sense

green kestrel
#

-upto

gilded plankBOT
#

The FAQ clearly states that it will take UP TO 1 week or more.
This does not mean it will take a week and does not mean it will take less than a week.
There is no set time for how long bot approval will take.
There is a queue and you're not first, nor are you last.

green kestrel
#

There you go

pure lion
#

:D

dusty onyx
#

hewo! im pretty sure ive sharded my bot correctly, but it would be really nice to be able to check if that's so. is there a way to do that for discord.py? my code is client = AutoShardedBot(description="description", command_prefix="!", shard_id=1, shard_count=2) as ive just reached 2400 servers

modest maple
#

that is..... Not quite it no

#

lmao

#

you have 2 Shards but only 1 id ??

dusty onyx
#

fair fair

modest maple
#

you dont even need to specify the shard Ids unless youre clustering later on

dusty onyx
#

oh cool

#

i have no idea what im doing lol, i can find barely any decent documentation of py sharding

#

is there anything else i need to do after removing shard id?

#

or is it literally just defining client

modest maple
#

nah thats pretty much it

dusty onyx
#

oh sweet

modest maple
dusty onyx
#

is there any way to check shards are running ok or anything like that?

tulip ledge
#

How do I find the index of an array by value?

pale vessel
#

array.indexOf("foo")

balmy knoll
#

[JavaScript] If I want to insert in a string the contents of a txt file that I attach to the message, how can I do it?

tulip ledge
#

@pale vessel isn't indexOf() for a string?

pale vessel
#

arrays work too

tulip ledge
#

Oh

pale vessel
#

it'll return -1 if it's not found

tulip ledge
#

Now

#

How would I edit the array at a specific index?

#

So basically remove the index and place a new thing in the same spot

#

I'll just splice it out and splice a new value in

pale vessel
#

prolly reconstruct the array lol

#

you'd need a loop

still merlin
#

Someone help (discord.js) I use "args" whenever I try to do a argument ( ${args} ) yet args is undefined

let reason = args.slice(2).join(" ");
             ^

ReferenceError: args is not defined
    at Object.<anonymous> (C:\Users\Jon\Desktop\SpiderBot Project\index.js:14:14)
    at Module._compile (internal/modules/cjs/loader.js:1128:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)```
tulip ledge
#

args is not defined

still merlin
#

that is not helpful

tulip ledge
#

Well

still merlin
#

how to I define args

pale vessel
#

it is though

tulip ledge
#

We can't help alot

#

If you don't show code

still merlin
#

..

let reason = args.slice(2).join(" ");```
#

is my reason thing

pale vessel
#

that's not args

#

that's reason

sudden geyser
#

show us where you declared args

pale vessel
#

well if you see the error they didn't xd

#

maybe it's in another file?

sudden geyser
#

obviously but what if you somehow found it 1Komi

still merlin
#

I use args all the time

tulip ledge
#

let args = ...

still merlin
#

^ isnt what I'm trying to do.. I'm trying to make "reason" in my code for my warn command

tulip ledge
#

If I do let thing = arr.splice and I log thing is that the thing that's spliced or the array

sudden geyser
#

If you want to make reason, you need to have args. This is confusing.

tulip ledge
#

Yeah

pale vessel
#

Where did you define args?

#

That's the question.

tulip ledge
#

^^

pale vessel
#

Because you said you use args all the time.

tulip ledge
#

flazepe u know what mine returns?

still merlin
#

I never defined args? I just used ${args} before without defining it before

tulip ledge
#

Lol

#

Wut

#

Maybe define args first?

#

Then use args?

pale vessel
#

This.

tulip ledge
#

You can't eat a cookie if you don't have one in the first place

pale vessel
#

If it worked before, then you defined args somewhere in that particular file.

tulip ledge
#

flazepe

#

U know what mine returns?

still merlin
#

yeah.. I'm sure I defined it I cant remember tbh

tulip ledge
#

.splice does it return the array or the spliced index?

#

You're confusing

still merlin
#

I have it defined now its not defined/;

tulip ledge
#

Did you define it

#

So yes show us

buoyant karma
#

What this for

pale vessel
#

Splice returns the spliced index if you define it to a variable.

tulip ledge
#

Alright

pale vessel
#

Otherwise, it will modify the original array.

buoyant karma
still merlin
#

yeah its defined i've used ${args} before

pale vessel
#

In order to add an element into a specific index of an array, you would need to use a loop and reconstruct the array.

#

Correct me if I am wrong.

sudden geyser
#

You can use splice

#

<Array>.splice(index, amountToRemove, ...newElements)

buoyant karma
#

See u later about to work on my bot

sudden geyser
#

bye

pale vessel
#

Oh.

#

That's new.

buoyant karma
#

ยฐbyeยฐ

still merlin
#

apparently if its not defined how to I re define it or smthn

buoyant karma
#

ยฐยฐbyeยฐยฐ

#

bye

pale vessel
#

Open the file where you used it and look for args.

buoyant karma
#

bye going to work on my bot

sudden geyser
#

yeah we know

buoyant karma
#

:-(

#

๐Ÿ”ผโ–ถโ—€๐Ÿ”ฝ

pale vessel
#

That does not add anything to the topic.

still merlin
#

index.js has args used in my slap command and at the top of index.js i'm trying to do a reason thing for a ban kick and warn command. Well not top but under some stuff on line 14

valid frigate
#

in summary

#

so you mean that args exists?

still merlin
#

yes

valid frigate
#

in your index.js file but it's not appearing in commands?

#

or specifically a few commands

tulip ledge
#

He's prob tryna call args before he defined it

valid frigate
#

i think we need more context

tulip ledge
valid frigate
#

interesting

tulip ledge
#

He probably defined his args after line 14

valid frigate
#

ok lets back it up

#

where is the first place you define args

#

what line

sudden geyser
#

ugh this is a lot of work for a single variable

still merlin
#

the first time I used args is- Wait its like line 200-

digital ibex
#

hi, i have js document.getElementById('saved').style.visibility = 'visible'; does anyone know why its not changing the visibility to visible? the default visibility is hidden btw

tulip ledge
#
let matarr = materials.split(", ")
let found = matarr.find(x => x.includes(drop))
let index = matarr.indexOf(found)
let amm = parseInt(found.split(" ")[0])
let newamm = amm + ammount;
matarr.splice(index, 1)
matarr.splice(-1, 0, `${newamm} ${drop}`)
console.log(matarr)
let newmats = matarr.join(", ")
console.log(newmats)
let matsql = `UPDATE inventory SET materials = "${newmats}" WHERE discordid = "${message.author.id}"`;
client.con.query(matsql, console.log)

Why is this not saving? Logging newmats gives a new value but it doesn't save it to my database

valid frigate
#

well then there is your problem

#

you need to define args before you can use it lmfao

#

everyone tried to emphasize that already

still merlin
#

I'm so ||****||ing stupid

tulip ledge
#

Dude you realize that now after like 5 people told you the same thing?

buoyant karma
#

ยฐim backยฐ

pale vessel
#

Relax.

tulip ledge
#

Anyone knows why my sql isn't saving?

pale vessel
#

Your SQL?

valid frigate
#

@digital ibex try using .style.display = "block" instead of visibility

sudden geyser
#

By any chance, does matarr come from any form of user input?

valid frigate
tulip ledge
#

nope

valid frigate
#

actually in theory your original code should work

#

check that you are specifying the right id

digital ibex
#

same thing @valid frigate

valid frigate
#

there might be something overriding it then

pale vessel
#

where did you put the script?

digital ibex
valid frigate
#

if you put your js script in the head before your styles it will not work

digital ibex
#

prob the default is hidden?

#

yeah.

valid frigate
#

the default doesnt necessarily make a difference here

#

its just the placement of that line

pale vessel
#

try putting it on the bottom or something

digital ibex
pale vessel
#

before body closes

#

o

valid frigate
#

what is await save

#

also you know

pale vessel
#

how does that even work

digital ibex
#

thats saving the stuff to the db

valid frigate
#

o

pale vessel
#

how

digital ibex
#

it works lol dw

valid frigate
#

but

#

big question

tulip ledge
#

This is in my database

#

So it's not being saved

valid frigate
#

you can also assign a class to the element with id saved instead of writing out each individual style

#

but i digress

#

your code is correct, so it's probably just where it is?

digital ibex
#

idk, the css or the js?

valid frigate
#

oh

#

well

#

.style.visibility = "block" is invalid

#

in regards to this case it has to be .style.display = "block"

digital ibex
#

oh

#

still the same, nothing changed

valid frigate
#

no clue

still merlin
#

I put my reason under where args was used and I get a error-

client.on("message", (message) => {
  let args = message.content.substring(prefix.length).split(" ");

  switch (args[0]) {
    case "slap":
      message.channel.send(`You slap ${args[1]}!`);

      break;
  }
});

let reason = args.slice(2).join(" ");
let aduitLogReason = args.slice(0).join(" ");
let say = args.slice(1).join(" ");

PS C:\Users\Jon\Desktop\SpiderBot Project> node .
C:\Users\Jon\Desktop\SpiderBot Project\index.js:49
let reason = args.slice(2).join(" ");
             ^

ReferenceError: args is not defined```
digital ibex
#

change let args to const args

pale vessel
#

doesn't matter

#

in this case

digital ibex
#

wut

#

oh

#

oops mb

pale vessel
#

why is the reason outside the event

#

you defined args inside the event, that's why you couldn't access it outside

still merlin
#

outside of what event Confused

pale vessel
#

message event mate

fiery stream
#

ayy

#

how do you check if bot has permission to do something

#

in py

digital ibex
#

also, you always add the client.on('..') code, are you doing js client.on('message', (message) => { // one command }); client.on('message', (message) => { // second command }); @still merlin ?

pale vessel
#

should be in docs

fiery stream
#

i cant find it

#

theres alot about permissions in there

still merlin
#

Why do I put my reason in a message event

digital ibex
#

if ur doing that, you're prob gonna get a memory leak.

#

which aint good

buoyant karma
#

I messed something up

still merlin
#

acording to my console I already have a memory leak

#

no clue what it means thought ;-;

digital ibex
#

o

slender thistle
#

@fiery stream which permission exactly

fiery stream
#

ban_members

slender thistle
#

eh, Member.guild_permissions will do for that

pale vessel
#

oh not that

digital ibex
#

then its cuz ur adding the client.on for each command, do ```js
client.on('message', (message) => {
// command one

// command two
}); ``` @still merlin

#

wait wrong ping

fiery stream
#

@slender thistle i want to check if bot has that permission not the memeber

pale vessel
#

your bot is also a member

fiery stream
#

ig

slender thistle
pale vessel
#

get the bot as a member and check permissions

#

^

slender thistle
#

Returns Member version of your bot

still merlin
pale vessel
#

not quite

digital ibex
#

close

#

put the command inside the client.on

buoyant karma
#

I messed up my warn cmd

digital ibex
#

the whole thing

still merlin
#

What command?

digital ibex
#

idk whatever command that is

buoyant karma
#

The warn commands is -warn

#

For my bot

still merlin
#

I don't want to do it for each command.. I want to do it globally so I don't need to go around adding them all to my moderation commands

#

but i asume its my only option sksk

digital ibex
#

thats not what i was saying lol

valid frigate
#

the idea is that you pass your args as a parameter to your commands

#

assuming you already do that nvm

digital ibex
#

they're not using a command handler

valid frigate
#

interesting

pale vessel
#

and confusing

valid frigate
#

you know

#

i wouldnt mind if you sent your entire index.js file and cutting the token out

#

so that we can see exactly how the code works

digital ibex
#

btw

valid frigate
#

or pastebin

#

o hastebin is the one with formatted code

still merlin
#

No ty. I think ive fixed it

#

yeah I have

valid frigate
#

nice

#

what did you end up doing

toxic jolt
#
      let channel_test = await db.fetch(`channel_${message.channel.id}`)
           const channel_testing = client.channels.get(channel_testing).createCollector(message => message.content.startsWith(''), {
      time: 0
    })
        ```
pale vessel
#

not that it hates you. you have to learn the basics first

toxic jolt
#

i how to fix pls help

valid frigate
#

bruh what is this code supposed to do

toxic jolt
#

long story....

valid frigate
#

do tell

toxic jolt
#

I wrote thousands of lines of code for 1 day ๐Ÿ˜„

#

but I get an error because of this code

valid frigate
#

you sure that thousands of lines of code wouldnt produce like

#

maybe upwards of at least a few errors

#

given that you wrote that all in a day at least

turbid bough
#

thousands lines of code for 1 day without knowing the basics, smells disaster

valid frigate
#

im curious really

pale vessel
#

send full code

valid frigate
#

yes send the full code

toxic jolt
#

I made a joke...

pale vessel
#

yeah it's probably a joke at this point

valid frigate
#

well that was pretty obvious

toxic jolt
#

Full code, not English

valid frigate
#

it looks like your code creates some kind of message collector in a channel you fetch from a specific db

#

i mean channel id

toxic jolt
#

if you can understand i can throw @pale vessel

valid frigate
#

huh

#

throw the error?

#

O

toxic jolt
#

%30 code

#

here

valid frigate
#

wow

toxic jolt
#

okay here

valid frigate
#

what is going on

pale vessel
#

there's probably his token in that file ngl

valid frigate
#

nope

#

its a command file

pale vessel
#

o good

valid frigate
#

strange

#

what is veri_waiting?

toxic jolt
#

so many db. xd

valid frigate
#

it seems to be the primary condition in your code

toxic jolt
#

@valid frigate
The first person to use this command gets the id of their channel.

#

The second user can establish a dialogue with the channel of the first user.

valid frigate
#

oh so it's like global chat

toxic jolt
#

If I give an example as follows:

#

-Pudochu: Hello!

#

-Vysion: hello how are you

#

like this

#

yes global chat

#

Can you help me? pLeAsE

valid frigate
#

well

#

i dont actually get your code because its

pale vessel
#

i only understand my own code tbh

valid frigate
#

its a bit long

#

and uh

turbid bough
#

and then after a week or so you forget what it does

valid frigate
#

its in turkish so i dont know whats going on

#

only the strings and variables though

toxic jolt
#

I even made an auto-register bot. But I failed this bruhhh

valid frigate
#

ur syntax looks ok but not gonna comment any further

toxic jolt
#

@valid frigate yes i sayed my full code is not english.

valid frigate
#

thats awesome

toxic jolt
#

I think I will try to fix it myself.

valid frigate
#

yeah sorry mate

#

not much i can do here

astral yoke
#

why this error

#

let statuses = [`me being a good boy! | db!help`, `Woof! | db!help`, `me bark! Woof! | db!help`, `I'm not being a goodboy.. | db!help`]; setInterval(() => { let status = statuses [Math.floor(Math.random() * statuses.length)]; bot.user.setActivity(status, { type: "WATCHING"}) }, 10000);

#
at Timeout.setInterval [as _onTimeout] (/app/src/index.js:26:15)```
summer torrent
#

what is bot

astral yoke
#

const bot = new Client()

summer torrent
#

where is this code?

astral yoke
#

index

#

right there

summer torrent
#

It should be on ready event

#

you can store it on db blobthinking

silver flare
#

.

compact kite
#

MongoDB

earnest phoenix
#

in which lib

balmy knoll
#

TypeError: channel.fetchMessages is not a function Why this error?

amber fractal
#

channel.messages.fetch now I assume

earnest phoenix
#

^

amber fractal
digital ibex
#

hi, quick question

#

which is faster? ```js
// option one:

res.render('thing', {
guild // the guild object
});

// option two
res.render('thing', {
id: guild.id,
otherData: guild.other-data,
otherData2: guild.other-data2,
}); // etc```

#

or which is best for optimisation?

amber fractal
#

I would do some testing on your side

digital ibex
#

how would i test it?

#

most of them i saw, you've got to pay for it

amber fractal
#

for what

digital ibex
#

and i don't really want to do that since im not going to use it much

#

things to check how fast ur code is and stuff

amber fractal
#

didnt know Date.now() costed money

digital ibex
#

confuso

faint spade
#
member.send(welcome[member.guild.id].mesaj);```  result ```Welcome ${member}!``` how can i fix that? i want Welcome @ta.ggedmember!
amber fractal
#
let then = new Date()
setTimeout(() => {
console.log(`Took ${Date.now() - then}ms to execute`)
}, 1000)
digital ibex
#

o ok

amber fractal
#

that's the most basic way to test how fast your code runs

#

or, if you're using node you can look into process.hrtime which goes down to nanoseconds

mystic violet
#

How would I create a channel in a category?

#

On discord.js

earnest phoenix
#

let array = ['1', '2', '3', '4', '5'];
How can i remove 2, 3, 4 from the array ?

summer torrent
#
array.splice(index of number, 1);```
earnest phoenix
#

When i do

#

array = array.splice(1, 3);
it wonโ€™t return 2, 3, 4

summer torrent
#

try

array.splice(array.indexOf("2"), 1)
sand thicket
#

That wont remove 2, 3 and 4.. you want

#

array.splice(array.indexOf("2"), 2) or array.splice(array.indexOf("2"), 3)

it's getting late for me; try either

earnest phoenix
#

Thanks guys, iโ€™ll try that

digital ibex
#

how can i make a small line in between the columns and the navbar at the top?

sand thicket
#

HTML?

digital ibex
#

in css

sand thicket
#

Great, got a live version I can look at?

digital ibex
#

well ye, idk whichever way i can do it

#

wym

sand thicket
#

Is it in a flexbox container? bootstrap?

digital ibex
#

bulma

earnest phoenix
#

let array = ['1', '2', '3', '4', '5'];
array = array.splice(array.indexOf("2"), 2)

#

-> 2, 3

sand thicket
#

Surely margin-top: 2px will work - Offically

#

Wolfy

digital ibex
#

lemme try that

earnest phoenix
#

ardor

sand thicket
#
array = array.splice(array.indexOf("2"), 3)```

Sorry I cant count
earnest phoenix
#

lemme eval

#

1s

digital ibex
#

thanks ardor :)

sand thicket
#

No worries

sudden geyser
#

Ardor array.splice mutates the array. You don't need to assign it to a variable.

amber fractal
#

in fact, doing so will make array be whatever was deleted

sand thicket
#

I didn't say you had too, I just copied and pasted too save myself a headache off retyping on a mobile..

digital ibex
#

like in the middle, they touch

sand thicket
#

Offically, provide that DIV margin: 1px; Instead of margin-top

digital ibex
#

kk

#

wait im confused

sand thicket
#

Hmm?

digital ibex
#

which div?

#

the columns or the column?

sand thicket
#

Send me the css element for the children Divs

digital ibex
#

kk

sand thicket
digital ibex
#
.column {
    background-color: rgb(143, 139, 139);
    padding: 20px;
    border: ridge;
    border-radius: 10px;
    margin: 10px;
}```
sand thicket
#

Right, so I probably wouldn't have a 10px margin. But does that not work ^^?

digital ibex
#

nope, it does this

#

wait wym

#

confuso

sand thicket
#

So am I, i'm not following what you're asking?

#

What does it look like?

digital ibex
#

with margin

#

wait

#

im confused x3

sand thicket
#

Is that on a website?

#

Or localhost?

digital ibex
#

localhost

sand thicket
#

Can you send me the file through PM?

digital ibex
#

whole thing or just the relevant code?

sand thicket
#

Relevant

digital ibex
#

its not much

topaz fjord
#

sending whole thing would be easier so we could debug it in the browser

sand thicket
#

That's a point, but tread carefully ya'know lol ^

earnest phoenix
#
const Discord = require('discord.js');
const Enmap = require('enmap');

module.exports = (client, message) => {
  // Ignore all bots
  if (message.author.bot) return;

  // Ignore messages not starting with the prefix (in config.json)
  if (message.content.indexOf(client.config.prefix) !== 0) return;

  // Our standard argument/command name definition.
  const args = message.content.slice(client.config.prefix.length).trim().split(/ +/g);
  const command = args.shift().toLowerCase();

  const cmd = client.commands.get(command);
  // using this const varName = thing OR otherthign; is a pretty efficient
  // and clean way to grab one of 2 values!
  if (!cmd) return;

  cmd.run(client, message, args);
};

cmd.run is not a function

anyone help pls?

topaz fjord
#

cmd is null

#

or .run is not a method on it

#

either one

earnest phoenix
#

so what do i do?

#

how do i make a log of people who upvote my bot on top.gg?

#

How can I go about doing that?

#

@earnest phoenix

#

@topaz fjord

#

its in my events folder

#

message.js

mystic violet
#

could someone help me? this isn't working: ```
channel = await new Discord.TextChannel(adminChannel.guild, {"name":website-support-${guild.id}, "parentID": category.id})

#

Im just trying to create a new channel in a category

sudden geyser
#

that's not how you should be creating one

mystic violet
#

thank you

blazing python
#

Hi

#

help please

#

Who have knowledge about discord.js beacause my kick command doesn't work

sudden geyser
#

What's the issue you're having

digital ibex
#

does anyone know how i can make a block appear if u click a button? using html

#

the event works, i just don't know how to create the block

opaque seal
#

Is Eris actually faster than Discord.js?

marble scaffold
#

How do you make a levelling up system with discord.js?

summer torrent
#

@opaque seal discord.js is more functional

opaque seal
#

How do you make a levelling up system with discord.js?
@marble scaffold weird question, elaborate more please

summer torrent
#

also yes I think eris is faster than d.js (connecting to Discord)

quartz kindle
#

its not faster

copper cradle
#

@marble scaffold making an X system has nothing to do with discord.js

#

why do people always bundle everythig together

marble scaffold
copper cradle
#

it's like saying: how do I make a neural network with discord.js

marble scaffold
#

Idk

opaque seal
#

its not faster
@quartz kindle I've read it's more effiecient

summer torrent
#

discord.js v12 is better than eris iirc

digital ibex
#

wh

#

v12 is a bunch of more stuff added onto v11

#

so theres no way its faster than it lol

marble scaffold
#

A levelling up system is an x system? What

quartz kindle
#

eris is based on an old version of discord.js
while discord.js kept adding more features and updating their core, eris focused more on being simple and keeping the core compatible with older node versions
since eris is less complex than discord.js it does have a small advantage in resource usage, but otherwise they are pretty much equal

opaque seal
#

Thank you for this info

quartz kindle
#

discord.js now requires node.js v12+ while eris still runs on node v8+

digital ibex
#

i have this code: js function edit() { const button = document.getElementById('edit-cmd'); button.addEventListener('click', (event) => { const div = document.createElement('div'); console.log('button') }); } when i click it logs button how can i create something like

#

the thing to make it liek uhhhhhhhhh

#

open

#

with html, idk if im making sense at all

quartz kindle
#

make it in html first

#

then give it display:none in css

#

when you click the button, find it and give it display:block again

summer torrent
#

what is that

digital ibex
#

ok

#

how can i prompt it to show?

summer torrent
#

english only

#

show error @misty goblet

digital ibex
#
document.getElementById('edit-cmd').style.display = '?' // what do i put instead of the '?'```
marble scaffold
#

I thought there was a way to put your code on for 24/7

#

But every tutorial is just confusing

#

By using glitches

#

And stuff

quartz kindle
#

@digital ibex you can do "none" to hide it and "block" to show it again

#

but its easier to do with css and classes

digital ibex
#

kk

quartz kindle
#

for example add a class that has display:none then add/remove the class from the element with js

marble scaffold
#

?

#

I thought there was a way to put your code on for 24/7
Is there not a code for this?

quartz kindle
#

@marble scaffold a bot is a program. the bot only works while the program is running

#

the program needs to run somewhere

#

in a computer, a server, etc

marble scaffold
#

Else

#

So will the bot run when you have your pc on for 24/7?

#

Or is there a time limit

quartz kindle
#

if you have the program running in your pc yes

#

it will work as long as the program works

marble scaffold
#

Ahh ok

digital ibex
#

@quartz kindle how can i make it overwrite the divs i've already got? cuz its showing it at the back

#

its client.ping yunuz

quartz kindle
#

@digital ibex if you want to replace one with another, you can use element.innerHTML = "<html here>"
if you want to hide one and display another, give the existing one display:none and the new one display:block in css or classes
if you want to overlay the new one on top of the existing one, give it position:absolute in css

digital ibex
#

o ok

quartz kindle
#

show more code, the problem might not be there

misty goblet
#

this my ping command

digital ibex
#

nothing happens

#

if i add a console.log into the click event, it logs

quartz kindle
#

@misty goblet show your message event, where you do command.execute

#

@digital ibex you're adding a listener inside a listener

#

dont do that

digital ibex
#

im not

misty goblet
quartz kindle
#

you have execute(message,args)

#

but in your command you have execute(message,client,args)

misty goblet
#

oh

#

i see

#

im go testing

#

yeee

quartz kindle
#

@digital ibex the onclick="" property is already an event listener

misty goblet
#

+rep tim

quartz kindle
#

when you click it, you fire the edit() function

#

the edit() function adds an event listener

#

so every time you click, you add a new event listener

digital ibex
#

oh that

#

my code rn ^^

steel heath
#

Isn't that working?

#

Try putting the script in (before) the </body> tag.

ornate needle
#

How do I automatically reward Voted users

wicked pivot
#

I know this is not the place to ask for that but someone masters puppeteer here?

blazing python
#

Hi

weary ridge
#

Can anyone help me so im using discord.py and lavalink for my music bot BUT everytime i do my prefix following play (song name) eg [<play Hello by adele] The Bot Joins the voice channel waits 3 secs and leaves ?

earnest phoenix
#

How do I automatically reward Voted users
@ornate needle you can make a command, say ?vote, and if the user have not voted, he will be informed that he needs to vote and if he have voted, he will get the reward by using this command.
Documentation to check user vores can be found here :-
https://top.gg/api/docs

#

votes*

golden condor
#

Can anyone help me so im using discord.py and lavalink for my music bot BUT everytime i do my prefix following play (song name) eg [<play Hello by adele] The Bot Joins the voice channel waits 3 secs and leaves ?
@weary ridge rate limiting I think

earnest phoenix
#

how can i get current server permanant invite URl ?

#

in js

#

please help

ember atlas
#

Yes?

#

We would only ban you if you intentionally advertised your server if itโ€™s for support itโ€™s fine

crystal socket
#

Lemme grab it

#

I think this is all I got

tranquil drum
#

Anyone use JDA who knows why I'm getting this?

java.lang.IllegalStateException: Cannot open a PrivateChannel with a Fake user.
crystal socket
#

is there a way to close the previous session at the start of the program?

#

cause all I am doing is calling dblpy

#

so just run client.session at the end?

#

im in it

copper cradle
#

wdym

crystal socket
#

no your english is actually pretty good @earnest phoenix

#

So wait

#

Il send my code

copper cradle
#

well, you still said your instead of you're mmLol

#

lul

crystal socket
#

:)

#

english is my 3d language please be easy

#

here is my code

copper cradle
#

nice

#

english is my 2nd lang

glacial thicket
#

hey yall, could i get some help with making the bot add a reaction to its own message once its sent? i wanna make a poll command for my bot. im using discord.py

#

ive tried different things but none seem to work

crystal socket
#

yeah

#

its ctx.add_reaction("unicode")

copper cradle
#

woah that's a pretty cool bot

crystal socket
#

mine?

copper cradle
#

yeah

crystal socket
#

oh thanks :)

copper cradle
#

it's a pretty cool concept and a pretty cool execution of it

#

I really like the cli you made

crystal socket
#

oh thanks, i just finished that today

copper cradle
#

noice

crystal socket
#

all im trying now is to get the dblpy library working

#

its refusing to work

copper cradle
#

lol

crystal socket
#

whats carberaa?

copper cradle
#

well, just a little advice

#

try to use the built in cog system

#

it's pretty nice to use and it helps keep things clean

crystal socket
#

oh ok, il try porting to it tommorow

#

i just got to figure out posting server count today

copper cradle
#

alright

#

brb

crystal socket
#

oh wait I changed the code

#

this is the current code

void lichen
#

how to get 2 word from slice?

#

i mean from shift

copper cradle
#

you want to use the remainder array

#

shift modifes the original array

#

so the original array will be fine

void lichen
#

args = ['1','2','3','4']
the one i wanted is 1 and 2
result = args.shift(); // result is 1
result = args.shift(2); // result is 1

weary ridge
#

Is there anyone who can have a look at what my bot does coz i need help with a couple of things

crystal socket
#

@weary ridge What Language?

weary ridge
crystal socket
#

Il take alook

#

is it on github?

weary ridge
#

Umm no i just want u to join my test server and see the bot like what it does coz it's doin some weird stuff lol

crystal socket
#

ok sure

#

send a link

mossy vine
#

@void lichen you can access them with args[0] and args[1], unless you absolutely have to mutate the array

restive shell
#

If anyone here remembers I was having a memory leak, it seems to have fixed by adding these options to new Discord.Client();

new Discord.Client({
    messageCacheMaxSize:1,
    messageCacheLifetime:30,
    messageSweepInterval:60
})

Anyone else got any tips? This seems to be working after an hour of uptime for me

void lichen
#

I want make double str command that separated
example : "Command1 help", "Command2 help"

mossy vine
#

@restive shell that should work fine

void lichen
#

so using Args[0] + " " + args[1] for that?

restive shell
#

So glad it was such a simple answer, was trying to debug the rest of my code and couldnt figure anything out

#

But crazy that the default params so aggressively made my ram climb

robust moth
earnest phoenix
#

Just dont check for the dm channel

#

If it's the same embed

robust moth
#

It's not same

earnest phoenix
#

You could try if else

tight plinth
#

if (not a dm) {...} else {...}

#

If will trigger if it's a dm, else will if it's not

pale vessel
#

what are you doing anyway

#

they both look almost identical. maybe you should use ternary operators instead?

earnest phoenix
#

^

#

Those make your code look more advanced too lol

robust moth
#

Where i use this line
let prefix = await getPrefix(message.guild.id); in dm console.log show error id That's why I make two statement @earnest phoenix

earnest phoenix
#

You could just do if else

#

If it's a dm run 1st code
If not run 2nd code

pale vessel
#

make it the default prefix by default. if it's a guild, make it await for the guild's prefix.

#

you already have it correct by using let

robust moth
#

Ok

pale vessel
#
let prefix = "default";
if (message.guild) prefix = await getPrefix();```
#

an example

lapis meteor
#
dbl.webhook.on("vote", vote => {

isn't working, i don't have any errors

#

const dbl = new DBL('token', { webhookPort: 3001, webhookAuth: '* * * * *' }, client);

vapid jetty
#

client = commands.Bot(command_prefix = 'p!') doesnt want to work. its saying 'commands' is an undefined variable?

weary ridge
#

@vapid jetty do this at start ```import discord
import random
from discord.ext import commands

client = commands.Bot(command_prefix = '<') ```

#

if ur on python

vapid jetty
#

thank you ^^

weary ridge
#

YW

vapid jetty
#

(p.s. i am on python)

weary ridge
#

Same

#

it's way easier then .JS

#

alrighty i'm gonna go back to coding lol

vapid jetty
#

ok

lapis meteor
#

nvm

strong tundra
#

how do people use python

vapid jetty
#

they learn it

#

they use it for projects

#

such as making bots

#

they make bots like you do

#

but you may use a different library

ornate needle
#

how do people use python
@strong tundra
using PC,Android etc

strong tundra
#

lol

weary ridge
#

@strong tundra You Download Visual Studio Code And Add Python As An Extension

stable grail
#

or you use pycharm

#

@weary ridge put between @client.command()

strong tundra
#

Thank You YouTube Majed

#

Now I Know How To Use Python Now

stable grail
#

@commands.has_permissions(ban_members=True)

#

@weary ridge

#

it will allow only users with ban rights to execute that command

weary ridge
#

ok Thanks @stable grail i wan trying to figure it out you saved me

stable grail
#

np

#

if u want to create a clear command u can also use between client.command()
@commands.has_permissions(manage_messages=True)

weary ridge
#

yeh umm but also in between i have @client.command(aliases=['clear', 'purge'])

stable grail
#

i meant

#

put it under client.command

weary ridge
#

oh k

stable grail
#

wait

weary ridge
#

yeh

stable grail
#

like this

weary ridge
#

k

balmy knoll
#

[discord.js] I've seen that some people can set the STREAMING status, but without having to insert a link from twitch.tv. I tried, but I couldn't. Do you know how to do that?

stable grail
#

i did that once without link but on python

#

just do that he is on streaming

nocturne grove
#
const inviteObject = await client.fetchInvite(invite);
if (!inviteObject || inviteObject.maxUses !== 0 || inviteObject.maxAge !== 0) {
    return msg.channel.send('...');
}```
Why does this not work? Assume `invite` is a valid url.
The error is:
Invalid Invite
cinder patio
#

I guess it's not a valid url if you get that error

weary ridge
#

@stable grail whats the manage message's one ? for this @commands.has_permissions(ban_members=True)

#

is it manage_message

stable grail
#

ban members is for ur ban and unban command

weary ridge
#

yep

stable grail
#

and kick_members=True is for ur kick command

weary ridge
#

yep

stable grail
#

and manage_messages is for the clear command

weary ridge
#

thanks