#development
1 messages ยท Page 972 of 1
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
Why not just have them all next to each other?
i done it like that and now i get
im trying to show two guilds on one line
instead of one
why I cant turn my bot online
Show your code please
<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}) %> <% }) %>
Why are the first two divs still inside your guild template?
because it was making it weird and squashing it together
The squashing was due to not using is-multiline, try again
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
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?
๐๐ผ
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> ?
If you want 2 per line, use is-half instead of is-one-quarter
Don't forget the closing </div>
oh yeah. woops
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?
wdym
This is my array: [ 'goblin', 'wolf' ]
That the problem
Move <h1 class="h1-select-server">Select a Server You'd Like to Manage</h1> outside of columns
kk
You are not getting the name in he
Looks like you didn't specify a column width
Are you talking to me?
@hasty sparrow how would i do that?
thats what im doing
@quaint hornet what are you trying to say
In that case you must have custom CSS or something messing with your formatting
<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>```
yes thats what it's supposed it do
Array[name] dont work on that type of array
the only css i've got is to change the background colour and stuff, nothing to do with changing the format
But monsterfile[viablemonsters[i - 1]] is a json file
@quaint hornet
monsterfile is a json
Can't reproduce it on my end, time for you to "Inspect element"
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
Chickendev i teste here aand dont work
yeah I know it doesn't work thats why I came here but how do I fix it
Isn't that what I'm doing
I don't get what you mean by this
This should get you started: https://stackoverflow.com/questions/47019863/discord-bitwise-permission-calculator
Array.find(element => element == "monstername")
And how am I supposed to do this to get the chance?
i know the bit number, but how can i check if they have permission?
Bitwise AND
You have a array of objects right
The second answer on the SO post should help you
monsterfile.find is not a function @quaint hornet
I dont know how you are saving that data
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
Yeah well thats not what my problem is
What your problem?
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?
You can put && i > 0
Wait what no
Thats not
Oh
You mean like that
Yeah ok
I'll try
But then if i = 0 it won't trigger
You dont want to run the else if when i ==0 right?
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
thats not a for loop
No
whats even ur issue?
Its logged inside a for loop...
I'm for looping that array
But it logs 3 entries
While the array only has 2
can u show all the code
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)
[ 'goblin', 'wolf' ]
[ 'goblin', 'wolf' ] goblin wolf goblinThis is a for loop, it only has 2 entries but logs 3 times
@tulip ledge
undefined
Is what encounter logs
Sometimes
Not always
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
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'] 
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 havehelloand it would give me['h', 'e', 'l', 'l', 'o']:GWchadThinkeyes:
@peak quail <String>.split("")
Thanks
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
console.log(message.guild.emojis.filter(emoji => emoji.animated === true).size)
returns all emojis of the guild.
and ... === "true" returns 0
Help please :)
@clever tree because there are no animated emojis?
I found the problem. All fine. Thanks xd
use a process manager
How
he told you how
rate my custom made DM command https://cdn.discordapp.com/attachments/650053537861992471/721393695982878791/unknown.png
Is it right that after someone votes on top.gg, it takes some time for bot.monthlyPoints to update?
yes
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
๐
rate my custom made DM command
@scarlet geyser what part specifically? There's nothing to really rate.
Anyone has a solution to mine?
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?
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.
How do i use a @tasks.loop ?
(Python:
)
Does it have to be inside the command or seperate like a function or so?
@tasks.loop(seconds= 300):
#stuff
Like that?
Thats my question ๐
Since you said like a function i guess there'll be stuff here so
So i do
@tasks.loop(seconds= 300)
async def something():
#stuff
This ^ ?
Ohhh... so this is just a function that'll run every 5 minutes or the time i put on seconds= ___
Right?
Basically a check
a loop with a delay
You could technically use minutes instead of seconds if you only need 5 minutes 
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?
Refer to the examples in the docs oop
start the task somewhere in the code where you are certain it will run
The command then 
I don't think starting a loop on command usage is a good idea
What do you need the task for?
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 justasyncio.sleepbut 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.
So, one task running every 5 minutes checking if the paychecks are supposed to be handed out.
Yup, sounds about right
Nope, I was just trying to confirm that I understood it properly
But yeah, the idea of implementation is nice
Damn i feel smart

alr then i'll try to make that whole thing that i said work.
Wish me luck
๐
Ty
Uh... that way my chance of success has reduced by 90%
Nah you can do it. Ask questions here if you need help
One tutorial looped on all commands on one command usage..
In bots channel?
ฤฑn the channel that bot is in
you mean voice or text
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
voice
yeah there is an event for that
can you say the event name
let me try that
Is there a way to slice from args
Like if I want everything from args [2] because the length or args[2] could vary
.
what is the difference bewteen "premission", "premission" and "premission || "premission"
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
ok thank you so much
in the script tag in html, how can i require a file?
i done ```js
const thing = require('thing');
import { thing } from 'thing';
Yes
what
yes
huh
Help with Discord.js
I'm trying to make a command taking random images from https://wallpaperhub.app/
and sending them through my bot
and did you actually try?
yep
we're not here to spoonfeed
i tried, but stuff failed
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?
Can you show me the code that you tried? [@earnest phoenix]
i deleted it lmao
but it was a simple embed
with a small script taking images from an URL
Anyone?
ima try following this vid
it might help
https://www.youtube.com/watch?v=EFtTTCbGwYY
Make Your own discord bot with discord.js!
Subscribe To My Second Channel - https://www.youtube.com/user/ClashOfAlesh/
Pa...
why no-one is not answering to my ques..
i would answer if i knew
Sad :>(
anyone know how to get all online members of a guild?
Filter?
filter by presence.status
Is it guild.members.filter?
if you're on v12 then no
members.cache
guild.members.cache.filter(m => m.presence.status === 'online').size
And it giving me
37
.size
But there is 71 online

prob not cached
Is it 71 members online in total, or 71 members with the status of online as there are others like idle, dnd, etc.
or just use !== "offline"
Oh I pointed it to to the wrong guild
Wrong channel?
.
-dotpost @cosmic shard
@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.
Stop posting dots
I did not approve my bot
no
wut ?
Because its not been approved
So how is it confirmed?
You have to wait for it to be tested after submitting
the time range for waiting is 1-2 weeks
They're mod-only
makes sense
-upto
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.
There you go
:D
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
fair fair
you dont even need to specify the shard Ids unless youre clustering later on
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
nah thats pretty much it
oh sweet
Discord.py does the rest
is there any way to check shards are running ok or anything like that?
How do I find the index of an array by value?
array.indexOf("foo")
[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?
@pale vessel isn't indexOf() for a string?
arrays work too
Oh
it'll return -1 if it's not found
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
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)```
args is not defined
that is not helpful
Well
how to I define args
it is though
show us where you declared args
obviously but what if you somehow found it 
I use args all the time
let args = ...
^ isnt what I'm trying to do.. I'm trying to make "reason" in my code for my warn command
If I do let thing = arr.splice and I log thing is that the thing that's spliced or the array
If you want to make reason, you need to have args. This is confusing.
Yeah
^^
Because you said you use args all the time.
flazepe u know what mine returns?
I never defined args? I just used ${args} before without defining it before
This.
You can't eat a cookie if you don't have one in the first place
If it worked before, then you defined args somewhere in that particular file.
yeah.. I'm sure I defined it I cant remember tbh
I have it defined now its not defined/;
What this for
Splice returns the spliced index if you define it to a variable.
Alright
Otherwise, it will modify the original array.
yeah its defined i've used ${args} before
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.
See u later about to work on my bot
bye
ยฐbyeยฐ
apparently if its not defined how to I re define it or smthn
Open the file where you used it and look for args.
bye going to work on my bot
yeah we know
That does not add anything to the topic.
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
(slap command )
yes
in your index.js file but it's not appearing in commands?
or specifically a few commands
He's prob tryna call args before he defined it
i think we need more context
interesting
He probably defined his args after line 14
ugh this is a lot of work for a single variable
the first time I used args is- Wait its like line 200-
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
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
well then there is your problem
you need to define args before you can use it lmfao
everyone tried to emphasize that already
I'm so ||****||ing stupid
Dude you realize that now after like 5 people told you the same thing?
ยฐim backยฐ
Relax.
Your SQL?
@digital ibex try using .style.display = "block" instead of visibility
By any chance, does matarr come from any form of user input?
nope
actually in theory your original code should work
check that you are specifying the right id
same thing @valid frigate
there might be something overriding it then
where did you put the script?
and thats whta i done,
if you put your js script in the head before your styles it will not work
the default doesnt necessarily make a difference here
its just the placement of that line
try putting it on the bottom or something
all this works, apart from making it visible,
how does that even work
thats saving the stuff to the db
o
how
it works lol dw
This is what my console is logging (newmats)
This is in my database
So it's not being saved
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?
idk, the css or the js?
oh
well
.style.visibility = "block" is invalid
in regards to this case it has to be .style.display = "block"
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```
change let args to const args
why is the reason outside the event
you defined args inside the event, that's why you couldn't access it outside
outside of what event 
message event mate
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 ?
should be in docs
Why do I put my reason in a message event
I messed something up
acording to my console I already have a memory leak
no clue what it means thought ;-;
o
@fiery stream which permission exactly
ban_members
eh, Member.guild_permissions will do for that
oh not that
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
@slender thistle i want to check if bot has that permission not the memeber
your bot is also a member
ig
Returns Member version of your bot
right so should this work?
not quite
I messed up my warn cmd
the whole thing
What command?
idk whatever command that is
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
thats not what i was saying lol
the idea is that you pass your args as a parameter to your commands
assuming you already do that nvm
they're not using a command handler
interesting
and confusing
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
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
})
```
not that it hates you. you have to learn the basics first
i how to fix pls help
bruh what is this code supposed to do
long story....
do tell
I wrote thousands of lines of code for 1 day ๐
but I get an error because of this code
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
thousands lines of code for 1 day without knowing the basics, smells disaster
im curious really
send full code
yes send the full code
I made a joke...
yeah it's probably a joke at this point
well that was pretty obvious
Full code, not English
it looks like your code creates some kind of message collector in a channel you fetch from a specific db
i mean channel id
if you can understand i can throw @pale vessel
wow
okay here
what is going on
there's probably his token in that file ngl
o good
so many db. xd
it seems to be the primary condition in your code
@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.
oh so it's like global chat
If I give an example as follows:
-Pudochu: Hello!
-Vysion: hello how are you
like this
yes global chat
Can you help me? pLeAsE

i only understand my own code tbh
and then after a week or so you forget what it does
its in turkish so i dont know whats going on
only the strings and variables though
I even made an auto-register bot. But I failed this bruhhh
ur syntax looks ok but not gonna comment any further
thats awesome
I think I will try to fix it myself.
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)```
what is bot
const bot = new Client()
where is this code?
.
MongoDB
in which lib
TypeError: channel.fetchMessages is not a function Why this error?
channel.messages.fetch now I assume
^
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?
I would do some testing on your side
for what
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
didnt know Date.now() costed money
confuso
member.send(welcome[member.guild.id].mesaj);``` result ```Welcome ${member}!``` how can i fix that? i want Welcome @ta.ggedmember!
let then = new Date()
setTimeout(() => {
console.log(`Took ${Date.now() - then}ms to execute`)
}, 1000)
o ok
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
let array = ['1', '2', '3', '4', '5'];
How can i remove 2, 3, 4 from the array ?
array.splice(index of number, 1);```
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
Thanks guys, iโll try that
i have
how can i make a small line in between the columns and the navbar at the top?
HTML?
in css
Great, got a live version I can look at?
Is it in a flexbox container? bootstrap?
bulma
let array = ['1', '2', '3', '4', '5'];
array = array.splice(array.indexOf("2"), 2)
-> 2, 3
lemme try that
ardor
array = array.splice(array.indexOf("2"), 3)```
Sorry I cant count
thanks ardor :)
No worries
Ardor array.splice mutates the array. You don't need to assign it to a variable.
in fact, doing so will make array be whatever was deleted
I didn't say you had too, I just copied and pasted too save myself a headache off retyping on a mobile..
also, do u know how i can make them not touch each other?
like in the middle, they touch
Offically, provide that DIV margin: 1px; Instead of margin-top
Hmm?
Send me the css element for the children Divs
kk
That
.column {
background-color: rgb(143, 139, 139);
padding: 20px;
border: ridge;
border-radius: 10px;
margin: 10px;
}```
Right, so I probably wouldn't have a 10px margin. But does that not work ^^?
Can you send me the file through PM?
whole thing or just the relevant code?
Relevant
its not much
sending whole thing would be easier so we could debug it in the browser
That's a point, but tread carefully ya'know lol ^
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?
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
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
that's not how you should be creating one
You can create one by using <Guild>.channels.create and setting the parent (https://discord.js.org/#/docs/main/stable/class/GuildChannelManager?scrollTo=create)
thank you
Hi
help please
Who have knowledge about discord.js beacause my kick command doesn't work
What's the issue you're having
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
Is Eris actually faster than Discord.js?
How do you make a levelling up system with discord.js?
@opaque seal discord.js is more functional
How do you make a levelling up system with discord.js?
@marble scaffold weird question, elaborate more please
also yes I think eris is faster than d.js (connecting to Discord)
its not faster
@marble scaffold making an X system has nothing to do with discord.js
why do people always bundle everythig together
This
it's like saying: how do I make a neural network with discord.js
Idk
its not faster
@quartz kindle I've read it's more effiecient
discord.js v12 is better than eris iirc
wh
v12 is a bunch of more stuff added onto v11
so theres no way its faster than it lol
A levelling up system is an x system? What
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
Thank you for this info
discord.js now requires node.js v12+ while eris still runs on node v8+
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
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
what is that
document.getElementById('edit-cmd').style.display = '?' // what do i put instead of the '?'```
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
@digital ibex you can do "none" to hide it and "block" to show it again
but its easier to do with css and classes
kk
for example add a class that has display:none then add/remove the class from the element with js
?
I thought there was a way to put your code on for 24/7
Is there not a code for this?
@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
Else
So will the bot run when you have your pc on for 24/7?
Or is there a time limit
if you have the program running in your pc yes
it will work as long as the program works
Ahh ok
@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
@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
o ok
show more code, the problem might not be there
@misty goblet show your message event, where you do command.execute
@digital ibex you're adding a listener inside a listener
dont do that
im not
you have execute(message,args)
but in your command you have execute(message,client,args)
@digital ibex the onclick="" property is already an event listener
+rep tim
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
How do I automatically reward Voted users
I know this is not the place to ask for that but someone masters puppeteer here?
Hi
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 ?
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*
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
Yes?
We would only ban you if you intentionally advertised your server if itโs for support itโs fine
Anyone use JDA who knows why I'm getting this?
java.lang.IllegalStateException: Cannot open a PrivateChannel with a Fake user.
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
wdym
no your english is actually pretty good @earnest phoenix
So wait
Il send my code
:)
english is my 3d language please be easy
here is my code
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
woah that's a pretty cool bot
mine?
yeah
oh thanks :)
it's a pretty cool concept and a pretty cool execution of it
I really like the cli you made
oh thanks, i just finished that today
noice
lol
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
oh ok, il try porting to it tommorow
i just got to figure out posting server count today
you want to use the remainder array
shift modifes the original array
so the original array will be fine
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
Is there anyone who can have a look at what my bot does coz i need help with a couple of things
@weary ridge What Language?
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
@void lichen you can access them with args[0] and args[1], unless you absolutely have to mutate the array
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
I want make double str command that separated
example : "Command1 help", "Command2 help"
@restive shell that should work fine
so using Args[0] + " " + args[1] for that?
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
How can I write two statements together
It's not same
You could try if else
what are you doing anyway
they both look almost identical. maybe you should use ternary operators instead?
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
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
Ok
let prefix = "default";
if (message.guild) prefix = await getPrefix();```
an example
dbl.webhook.on("vote", vote => {
isn't working, i don't have any errors
const dbl = new DBL('token', { webhookPort: 3001, webhookAuth: '* * * * *' }, client);
client = commands.Bot(command_prefix = 'p!') doesnt want to work. its saying 'commands' is an undefined variable?
Anyone Know issue ?
@vapid jetty do this at start ```import discord
import random
from discord.ext import commands
client = commands.Bot(command_prefix = '<') ```
if ur on python
thank you ^^
YW
(p.s. i am on python)
ok
how do people use python
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
how do people use python
@strong tundra
using PC,Android etc
lol
@strong tundra You Download Visual Studio Code And Add Python As An Extension
@commands.has_permissions(ban_members=True)
@weary ridge
it will allow only users with ban rights to execute that command
ok Thanks @stable grail i wan trying to figure it out you saved me
np
if u want to create a clear command u can also use between client.command()
@commands.has_permissions(manage_messages=True)
yeh umm but also in between i have @client.command(aliases=['clear', 'purge'])
oh k
wait
yeh
k
[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?
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
I guess it's not a valid url if you get that error
@stable grail whats the manage message's one ? for this @commands.has_permissions(ban_members=True)
is it manage_message
ban members is for ur ban and unban command
yep
and kick_members=True is for ur kick command
yep
and manage_messages is for the clear command
thanks





