#development
1 messages ยท Page 1029 of 1
Whats the problem?
@tulip ledge its actually dumb how you "hate" me because Im not good at js
Command raised an exception: IndexError: list index out of range
No, its not cuz you're not good at js it's cuz me and like 4 other people told you to learn JS but kept asking basic javascript questions
@spare mirage if you don't want to understand and just copy code then thats ur problem then we can't help you sorry to say that
learn js
Command raised an exception: IndexError: list index out of range
Where does the error come from?
the error is self-explanatory tbh
from my youtube search command
bot.commands = new Discord.Collection();
const commandDirs = fs.readdirSync('./commands/').filter(dir => dir);
const commandFiles = fs.readdirSync(commandDirs).filter(file => file.endsWith('.js'));
for (const dir of commandDirs) {
for (const file of commandFiles) {
const command = require(`./commands/${dir}/${file}`);
bot.commands.set(command.name, command)
}
}
client.on('message', async msg => {
if (!msg.content.startsWith('.')) return
let args = msg.content.substring(1).split(' ')
switch (args[0]) {
case '8ball':
bot.commands.get('fun', '8ball')
}
})
heres the shit
And saying im bad at js because I ask for fkn advice to make an embed look better is just childish
https://discordjs.guide @spare mirage
Say, a list has 8 elements and you are trying to access a 9-10th element
it finds it sometimes and sometimes not
l e a rn
Code please
THEY STILL LAND IN THE TRASH CAN
@marble juniper ive checked there not there
then make new shortcuts
i am i just had a shit ton of them
then make new shortcuts
@pure lion looks like your getting every command file, and sending each one into every dir.
which wont work i dont think
@pure lion Theres this thing in fs called isDirectory() you can use that to check if the file you're checking is a directory and then add the directory to look through that directory
If that made sense
why are you reloading commands and still use a switch wtf
Using switch is kind of counter intuitive
@tulip ledge eh?
if (fs.lstatSync(dir + file).isDirectory()) {
loadCommands(dir + file + "/");
return;
}
sorry my internet box is a potato jammed into a wall socket
bruh
@tulip ledge add or replace?
?
That code
Makes it call the function
loadCommands()
Wich that code is nested in
On the directory it found
not the place but ok
i was testing a thing and it deleted loads of my files
please keep this channel related to development
Say, a list has 8 elements and you are trying to access a 9-10th element
@slender thistle what do you mean?href=\"\\/watch\\?v=(.{11})do you mean that?
Can I ask oauth questions in here?
what about the discord dev server?
search_results = re.findall('href="\/watch\?v=(.{11})', htm_content.read().decode()) await ctx.send('http://www.youtube.com/watch?v=' + search_results[0])
so, how do I get the information from oauth redirects
Yeah, sometimes search_results might be an empty list so I'd suggest you use an if-statement to check if it's empty
Two ways to go around this:
if search_results:
# video found```
if list(search_results) > 0:
# video found```
I'd suggest sending an error
hmm ok
the first one would also handle cases when search_results might be None somehow
ok
im trying to do make a kiss command but its not working i put in the exact code
language? error? code?
suppp so this new epic handler is confusing me a little bit
TypeError: Cannot read property 'name' of undefined
let props = require(`${dir}${file}`);
client.commands.set(props.command.name, props);
@haughty elbow which coding language?
we don't know where it's coming from. It's your code after all. Where would it respond with that in your source code
Yo
ask away
oh jeez
When I execute this function console log show [function]
@earnest phoenix use reaction collectors
How do I use OAuth, I have the scopes working, but how do I use the deeta
@robust moth are you awaiting for the function? are you returning anything? did you provide the params?
theres plenty of questions, the reason its showing function is that you arent returning anything in the function
so it simply runs it
@opal plank see line 17
are you awaiting for the function to complete?
Yes
they resolved it
Any ideas?
name = waste of storage
What even is that
console.log(guild) after that returns [function]?
Bande de fou
I don't try it
do
Ig I'll try to get help else where
read your library's documentation
console.log(guild) after that returns [function]?
@opal plank yes
But it show 1st time
it bothers me a bit that its not async function findOrCreateGuild()
I get this error when trying to create a canvas with a custom font - It worked with another custom font I had, but not this one.
How are you loading it
@robust moth async findOrCreateGuild() => async function findOrCreateGuild()
try that
registerFont('./font/stretch.ttf', { family: 'stretch' })
and
ctx.font = `normal 20px stretch`;
exchange it for a token
wut
@earnest phoenix How does the rest of your file struct look
Could I send it to you in dms?
Don't see a reason to but if you want to sure
@opal plank I fixed it.... Just remove .toJSON()
Das crazy
oops wrong channel
Lol
@earnest phoenix
2- everytime a message is created, create a reaction collector to it
3- filter the collector to the reaction you want
4- set it to the collect event of the collector that when you react with that, it deletes the message
5- end the reaction collector after the message is deleted```
Uhh, we didn't talk about ram
Just at their own risk for their ram they should do that
time to get a really good ram
Or...
There's a second way, set it up by listening to the messageReactionAdd event
without wasting much memory
it only looks for messages which have been created after the bot was started the last time
(i think he meant messages that was created even before the client was constructed?)
okay this handler isn't working properly
i am 100% certain that my properties are named correctly
i dont understand what your doing, but are you missing some /
How can i register all fonts, lol
living his life probably
g o o d p o i n t
we really need to give tim a legend role
Legends never die
lmaoo
We should give tim a role called
The human stack overflow
yes
offtopic
hmm
where? I can't see off topic?
yes! lets go to #memes-and-media more staff there ๐
Is there a way I can make it so that there's a way to opt-out of being the receiver of my dm command? I'm using discord.py
it dms users messages. The rules state no "mass spam" so i need opt-out feature
databases are common with discord bots
^
opt out/in features are pretty common
so im assuming use a db to store the user ID and a boolean value
are dbs the same as libraries
dbs are databases
"somewhat" new to python
ah
like dpy is a library. is it also a database?
no
ok.
a database is a way of persistently storing data (meaning is stays between bot refreshes)
assuming the db uses better-sqlite 3 (but its basically default so dont worry)
ok
ok. Now it's time to watch that, and search google for a opting out database
just a database
opt-out just means the user can toggle an entry in the database that you check before sending them a message
missing permissions means your bot doesnt have a perm to do something
Mmm, but has all perms, weird can't work it out.
having every perm doesnt mean it can do anything.
discord's permissions are pretty complex.
a user can have ban perms, but wont be able to ban every user in the server
a user above your bot in permissions will not be able to be banned, kicked or modified.
Meh, it's working and still is doing what it's meant to do, I'll fix it if it starts crashing the bot.
Yeah but can't workout what it is.
well, everything you do that requires a permission, should be catched
Do I need a node server for my dashboard
if ur using node.js, yes
imo, most of ur dashboard should be in js
most will be
but yeah, u'd need html and js
you can't really do just frontend
well this is awkward

nvm lmao
but why
how do I restrict commands to nsfw
if a command is nsfw, check if the channel you are sending to is nsfw
channel.isnsfw or something, can check the docs
it will be a property of channel
@misty sigil wym?
wym
ah, you see, if i were to have that I'd needa have another server for backend
cuz it's just a webhost, not a node server
if (message.channel.nsfw) @solemn latch
my web server is practically just apache stuff i think
i've never worked with apache, but im still confused, im pretty sure you won't need more than one server though
apache can handle multiple things on one server
its just html/php/js host
cool, i might try it out. but i've never used it before so i could be wrong 
i have 4 websites on one server
@solemn latch i have 3 on one server, with subdomains
Guys, how can i slice commands in a embed? I want to make commands with page (with reactions)
lol
Anyone ?
like, making a help command?
because thats not a thing
User.setNickname isn't a thing
users dont have that property
maybe members do, i dont know
I said user, not member
My bot isn't changing status. Only changing activity. Does anybody know how to fix? Using node.js and discord.js
@spare mirage I dont know if you are still in need of a nsfw restrict thing but I have the code for it
nah
Anybody know a fix?
irs just
if (!channel.type.nsfw) {
return
}
k
get the first mentioned user or use args
umm?
for first mentioned users/members, use <message>.mentions.<users/members>.first()
good
check
define it first and check if it actually exists
const user = mentions.users.first(); if (!user) return reply ("no user provided")
or just change the user to message author
that should work
should work
have you tried using setPresence() since you're setting status and activity
Why cant I add an status if my bot is on IDLE
read docs
what did you do
this
Does anyone know how I get this "icon"?
And how do I get the other one?
ใฏใฏ
ใ
Tyvm
users is a manager that holds the cache
you'd want to access the cache
so users.cache
ok
bot.user.setPresence({ activity: { name: `%support blblbalbla` }, status: 'dnd' })
@thin sonnet
thanks
:3
Yeah nope
the status didn't change. The users did though! thanks.
Ok nvm
Thanks @spare mirage and @pale vessel
@cyan python
normal
if you want to be banned, sure
@pure lion I mean probably
You'd still be spamming the api and getting rate limited
:0
channels have a .members property
Oh ty
well in that case, discord.js has .members https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=members
yep
Channel.members.send?
no
bad idea
hi
for(let [id,member] of channel.members)
does anyone know how I can make shorten the input thing? like rn it takes up all the page when I dont want it to, this is what is shows:
tried using width but nothing changed
I looked in the bulma docs but it doesn't say anything about changing the size of it
you could use Map.forEach() as well or Collection.each(), which just returns the collection, which you shouldnt need unless you need to chain @pure lion
or what tim said also works
width works for me, do you have something overriding it?
I think its bulma, but idk how to make it not override
theres nothing in the docs about it so it probably isn't, idk tho
If you dont really care, you could use !important, or you can look through the source https://oliy.is-just-a.dev/mvqt4b_4955.png
so um
im having a similar issue,
its looking kinda shit cuz the black bit is not going all the way
Whats the fastest way to remove all occurrences of a value from an array
is splicing it the fastest or is there some built in filter system?
all the css is css body { background-color: black; }
does anyone know how can i overwrite bulma? I tried using !important too but nothing changed
yeah, it is .some, Array.some((value) => Array2.includes(value))
so I remove the light blue bit and this happens:
how to send gif emoji's in embed discord.js like this
you need to use the emoji form
@tired nimbus array.filter
ok thanks mr.beast
if(something) {
//code
} else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}else if(somethingelse) {
//code
}
@earnest phoenix wtf is that
Nice code
it just be like that sometimes
yo @earnest phoenix i have a similar question lol
I would do it like this
id use switch
switch
if anyone has a moment, could i please borrow a few seconds of your time?
return condition1 ? value1
: condition2 ? value2
: condition3 ? value3
: value4;```
@lament hull whats up
lmao
i appreciate you. i was told that this isn't possible... but after posting my link + image and text with multiple variations, i cannot get it to post like this. is it possible that this group is embedding an image into their invite link? so when they send someone their link via dm, it shows the image as well?
@chilly bison
i looked all over the freakin place... not even my csci buddy knew lol
or ignore me
i'm sorry boss @earnest phoenix i didn't know that was for me
like this?
well, similar.. how did they post the link, and then an image appeared before their invite info?
like it was all tied to the link
you guys are awesome lol. this is why i love this server
yo @earnest phoenix i have a similar question lol
@lament hull ohhh
@lament hull im not sure how they did that tbh
right LOL @chilly bison ... i really appreciate your time anyways.
i'm so intrigued... i have been googling and i can't find anythingggg lmao
@lament hull not sure, maybe ask the discord api server
discord-gg / discord-api
@lament hull try there
use a reaction collector / listen to the reaction event
the former is the latter but more heavy on memory lol
the docs cover it
that's a you problem
when i do npm install how come i get this like 20 times, i downloaded my project from glitch btw
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\main\Downloads\dogbot\node_modules\.staging\mongoose-2ec5c7be\lib\helpers\query\wrapThunk.js'
i believe fixed
fixed
Has anyone done anything with getting text from an image with a bot before? Trying to do that now and don't exactly know what to use
@bitter badger if you want to use an API expect to have some fees
I guess Google Cloud Vision has something, right?
Has anyone done anything with getting text from an image with a bot before? Trying to do that now and don't exactly know what to use
@bitter badger just make a text detection algorithm
I'm using js if that is any help at all
Yeah, its pretty expensive. A few cents per query if I remember
@lyric mountain I dunno how tf to do that lmao
Sobel's algorithm is very simple and easy to understand
I've used GCV for image labelling before and it isn't too cheap, so you're right about that
Then you just need to compare to a font's outline
If it's 75%+ similarity, get that character
Sounds like a lot of work when there are thousands of fonts
Yeah, one font for each type and you're done
"Make something unique" they said. "Not yet another multipurpose bot" they said. 
https://en.m.wikipedia.org/wiki/Sobel_operator here's some sobel stuff
What do you mean one font for each type?
It's basically a 3x3 matrix where you isolate high contrast pixels
Getting u an outline of shapes
Then you just need to test the shapes with each letter in each font file
Hi
Is there any easy way to figure out the font? I'd imagine I need to know the name of the font before starting
If you use one font for each type you'll have at most 3 font files
It's a really small loop
But yeah, you could check for letter width, if they're uniform then it's a monospaced font
Or if there are extended bits in the characters (serif or sans-serif)
what game is it @bitter badger
Realm of the Mad God
I have a picture of an example, but do I have perms to post an image?
@lyric mountain I appreciate all the info by the way
I find it super interesting either way
Edge detection is really fascinating
One post says the font is Myraid by Adobe
oo
Yeah that one lo
My graduation project was about generating texture maps from images
I'd imagine it has a lot of uses
And I had to learn how to edge detect
It's impressive how you can generate very complex detailing maps from a simple smartphone's camera
It reminds me of those old filters where it make a penciled look. I take it it uses something like that

https://en.m.wikipedia.org/wiki/Canny_edge_detector canny detection
haha custom plugin system go brrrr js (function(plugin) { plugin.enable = node => { const bot = new _.discord.Client; bot.on("ready", () => console.log("ready")); bot.on("message", msg => { if (msg.content == "rigidreset") { _.manager.reload("bot/bot"); } }); bot.login(_.config.token); plugin.bot = bot; } plugin.disable = node => { console.log("Destroying"); plugin.bot.destroy(); } })(module.exports);
They use the same image example as the sobel 
Lol
2 const Discord = require('discord.js');
3 const bot = new Discord.Client();
4
5 const TOKEN = process.env.TOKEN;
6
7 bot.login(NzAzMTQ5NjE3ODA5OTgxNDc3.XwPYOQ
8 bot.on('ready', () => {
9 console.info(`Logged in as ${bot.us
10 });```
Someone Tell Me What Wrong With Is Code Please?
whats your error
First of all: you just leaked ur token
it's invalid lol
Second: that's HALF a code
login after all your events
Ok I'm a mobile bot Dev like can someone be of assistance
You need to give us the full code AND an error to look at
Use https://hastebin.com for that
I'm getting a syntax error
"SyntaxError: missing ) after argument list
at wrapSafe (internal/modules/cjs/loader.js:1116:16)
at Module._compile (internal/modules/cjs/loader.js:1164:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17"
That's the exact error copy pasta from the terminal
Is your token enclosed in quotation marks? (or apostrophe, whatever)
The token is a string, you gotta put it inside qm/apostrophes
Oh thanks, it worked :)
Yw
So, I'm still trying to find the font. The game recently went from Adobe Flash to Unity and I'm pretty sure the fonts have changed. The old one was Myriad Pro, but I can't find the new one. I've tried like 4 different font matching sites, but they all suck 
There's a site for finding the correct font from an image
Seen a font in use and want to know what it is? Upload an image to WhatTheFont to find the closest matches in our database.
I tried that one. It was the best one though
My example doesn't have good contrast though, so I'm going to try using a new one
Try using an image editing software to increase the contrast of the font
๐ฏ
This is truly making me understand the pure number of fonts in the world
my bots stops working after a couple of messages after bootup. no idea why, nothing in console
Is the process/node.js closing or is it still running.
still running
and then after a while the bot just disconnects
proccess is still running according to the console
It disconnects?
Is there a way to spoiler-fy an embed image?
at RequestHandler.execute (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:88:5)
(node:21941) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:21941) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
missing perms??
???
if(command === "privacy"){
const privacy = new Discord.MessageEmbed()
.setColor("RANDOM")
.setTitle("You are Safe")
.setThumbnail(`https://cdn.glitch.com/38b33121-f779-43cc-a95d-c99a7cf7a9d4%2Fsafe.png?v=1594094062884`)
.setDescription("We Don't store any of your Data!")
.addField("Chat" , "The bot never stores your chat data it only respond to commands with it's prefix and never stores anything")
.addField("User Info" , "We never store your username or anything. The only time we display your pfp and name is when whois command is executed")
.addField("Server Info" , "Server info is not stored in any case. We access number of emoji or roles or server name only when serverstats command is executed")
.setFooter("You are Safe")
msg.channel.send(privacy);
}```
this is my code
@earnest phoenix v12
what library?
ok
so im making my bot embed it's messages now, why isn't this working?
๐ค
my problem got solved
nice
probelm was
I just use
@client.command(aliases=['p'])
async def ping(ctx):
embed = discord.Embed(timestamp=ctx.message.created_at)
embed.add_field(name="Ping", value=f'Pong! I got your message after {round(client.latency * 1000)}ms')
await ctx.send(embed=embed)```
i never refreshed the projcyt
the profile pic doesnt show up in the embed can someone help?
bruh
Happens for Me too
code is wrong
Just my thoughts but that privacy command makes the bot look suspicious lmao
@delicate shore what have i done wrong??
Ooooooh
user.displayAvatarURL()```
ok
let member = msg.mentions.members.first() || msg.member,
user = member.user;```
let this too
@earnest phoenix
no
ok
Why would you do that
Hello gamers
what should i do @strange trout
What's the issue
the pfp doesnt show up in the embed @strange trout
Lel
Show part of code where you're adding avatar
@strange trout
avatarURL isn't a property of User
for gods sake use a command manager
lol
(function(plugin) {
plugin.require = ["bot/bot"];
plugin.enable = () => {
$.commands.reload = {
run: async e => {
if (e.root) {
await e.say($.embed({
title: "Reloading Plugin",
description: "You have initialized the reload of that plugin.",
color: 0xFF00FF
}));
_.manager.reload(e.args.join("/"));
} else {
e.say($.embed({
title: "Lacking Permissions",
description: "You do not have permission to use system commands.",
color: 0xFF0000
}));
}
}
};
};
plugin.disable = () => {
delete $.commands.reload;
};
})(module.exports);```
like this
What even is that
what lang is that
that is what i did
you did avatarURL no?
i dont have displayavatarurl
oh
you dont do ${user.displayAvatarURL()} outside a template literal
remove the ${}
you do
i didnt add that
user is a var
No you don't have to do that
no
this is invalid syntax
@earnest phoenix how should i fix mine??
can you show me the full code except for the token?
I can fix it
ok\
:/
me?
The real way to add avatar '' + user.displayAvatarURL() + ''
When you have Xfinity "Smart Wifi" so you cant connect to the AWS Web Hosting Platform without it kicking you off the wifi and saying "Someone attempted to access your computer attacker is Amazon Inc"
Fucken Mint
๐
@strange trout displayAvatarURL() returns a string. check the docs
So concatenating empty strings or using .toString() is pointless
I'm well aware
hmmm
smh
user.id === message.author.id
Yes
that is literally what that does
smh
bruh
you're too nice ashton
xD
@lyric mountain So I'm almost positive that the font used is a custom font
I am trying to use tessaract.js and it doesn't identify a font
make it inline
how specificallhy
i used inline-block but that didn't do anything
.box {
display: inline-block;
...
<div class="box render-correctly">
<div class="input">...</div>
<div class="arrow">...</div>
<div class="output">...</div>
</div>
My bot has a command that shows the users in a certain role
What should the permission requirement for it be?
either manage roles or nothing since that's something users can see manually (just slower)
Yep
do you have the site url or is it local
why does this seend an empty embed lol
avatarURL() is a method
you should use displayAvatarURL() though since it also gives default avatars
ok
it's local
DUCK
but i can send the files if you wanted
sure
just a css file and a html file
all g
var scount = bot.guild.cache.size
message.channel.send(This server has ${scount} users!)
whats wrong?
bot.guild isn't a thing
usercount command
message.guild
member cache size
memerbers.cache
thats only online users btw
hmmm,
not all members
fk
then fetch
would anyone be able to hop in a voice channel and help me with this bot, im using DBM
@opal plank what?!?!?
!
why cache all users on your end?
\${bot.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}\
just iterate all the guilds
ops
\``${bot.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}\``
wtf
uh
${bot.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}
use that
do {
//shit
}
while (//shit)
gets help
complains
while (state) {//do stuff}
do while does it at least once right? while does it only if the condition is true
hey sorry to be a bother but would anyone be willing to help me fix this problem im having, im using Discord Bot Maker, im in testing #2 voice channel, thanks :)
@inland linden maybe ask on the DBM discord
laughs lmaoo
lol
ive already tried but i dont think anyone is active to help at the moment @lusty quest
@inland linden we are here to help you code, using pre-made bots is probably not a good idea here
its not a pre made bot
@spare mirage try my code bro
guild user count
v
im making it from scratch
i used it when i started with Discord bots but its verry limited
what is your issue? @inland linden
const Discord = require('discord.js')
module.exports = {
name: "usercount",
description : "usercount of a server",
execute(bot, message, args) {
message.channel.send(`This server has ${bot.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()} users!`)
}}```
?
message.guild.memberCount
ooo he only want count user in guild?
lmaoo
wait
noterwin do u check ur dms?
you only want count member in 1 guild right?
yes
:3
guild.memberCount
no
message.guild.memberCount
wdym no?
what are you trying to do?
it gives error
i gave you a non spoonfed explanation. guild has a memberCount property in it
use it
ok
ok
This server has ${bot.guilds.cache.reduce((a, b) => a + b.guild.memberCount, 0).toLocaleString()} users!I thought u meant to put it heree
nah, if what you want is total users, yeah, that'd work
though i thought
it didnt
like i said, guild has that property, you can access that via message or get it from cache
l.eval console.log(message.guild.memberCount)
n.eval console.log(message.guild.memberCount)
there's no guild in guild
message.channel.send(`This server has ${message.guild.memberCount} users!`) this works thanks @opal plank
np
@opal plank all my discord server is growtopia private server lol :D
I bet he is active in 1% of the servers
imagine having mobile push notifications on
i mean, its their discord, none of my business, but still triggering to see that many unread messages
lol same for me :3
how to code something like that if a person have done !send hi then the hi will be come to my server channel. in discord.js v12
Umm I guess u just make a say command
Idk about js but in python It's just 3 lines
and send it in another channel
idunno

get from client the target channel

client.channels.cache, then get the id and fetch it onto the map cache. then you can send it
do u want the message to be sent from channel1 to channel2
or do u want the message to be sent from server1 to server2
ok
ok
Oh, so like userphone?

yes
not like that
cache channels
That seems to be what you're implying
You missed a capital letter after the full stop, shame on you!
You go to jail now
@surreal notch how well versed with js are you?
not quite there, but close
.get
cache is a map
1 to 10, 1 being java = js and 10 being above tim
you need to get or filter the map to get the proper channel/guild you want
Wait after you map values can you get from the map?
map, as the word describes, is a map. it maps all the objects inside of it
think of it as an array of objects, ish
yes

would recommend reading that, map is essential basics of js
Oh got it
actually, use this one too
Oh yeah because map and Map are different
still dont get it
its the second one you want to check
hmmmm
Ik how Maps work, I use it for my global music queue
client/bot => your instance
.channels => the channels property
.cache => the cached channels your isntancce has
// now get a method to find the channel with your ID of the channel you want
@surreal notch
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
this will give you ample options to filter it using your channel ID, for example
d.js map keys as the channel id
if (message.content.startsWith(`${prefix}send`)) {
let args = message.content.substring(5);
if (!args) return message.channel.send("Please mention what you wanted to send");
client.channels.cache.get('729249421832880238')
}
});```
I wanted that my args should go to a dedicated server channel
you are getting that channel, but you arent doing anything with it
send
trying not to spoonfeed
message.channel.send?
Await the .get and then send to it
message is looking at the message sent
since you already looking at client, you wont need messsage
that thing has a method send
message is the initiator of what you are doing. its your starting point, per se
message will return the channel its IN
client will return the CHANNELS its in
since the message isnt in the guild you want to send the message, you should use your client @surreal notch
Well in truth message returns a message object but that's probably irrelevant rn as you're learning the basics
trying to make it as easy as possible to understand the basics
||but i m nub||
then learn. What is that you dont understand? i can explain a bit better if you wish
Same I think maybe
ยฏ_(ใ)_/ยฏ
try to log things
if you dont have any questions, i take you understood it

How can I use global variables in my bot (python)
anyone using top.gg vote feature here?
what do u guys use? cuz i am using ngrok and it resets after 6 hours means i have to restart it
help pls
There's probably a npm thingy
huh
@plucky harness #topgg-api
@plucky harness https://www.npmjs.com/package/top.gg
i am on python
O
i am using their api
for for my local host to accept request i need something like ngrok or ngnix
so i'm following this guide
https://www.w3schools.com/howto/howto_css_tooltip.asp
but the tooltip appears on top (see below)
how do i change it so the tooltip appears where the mouse is
i want to replicate this https://i.imgur.com/afiVagh.gifv
https://discordapp.com/channels/264445053596991498/272764566411149314/729968724328710224
THIS IS A FORK OF THE OFFICIAL dblapi.js PACKAGE FOR PEOPLE
???
but why
tis why i pointed
use their api
and OFFICIAL module
well
not counting the font
just the code to get the tooltip to be where the mouse is
eh, should be css only...
not possible
nice idea
js is required to track cursor position
Hopefully it helps
hmmm
Ok
so that works i guess, how would i actually put content where the mouse is
what js library should I use to edit images? jimp?
jimp, canvas, doesn't matter
jimp is good for composite and canvas is good for rank cards with custom fonts
i'd say canvas is better for you
alright
so i looked into it but have zero idea how to do these tooltips
https://minecraft.gamepedia.com/Dispenser#Crafting
they're used there
if that helps anyone figure it out
steal css and js
i tried but cant work it out
Anyone knows how to make this line dissappear with css? It doesn't appear on pc
I'm not even sure Firefox have a mobile view feature
Oh firefox
Lol
What
Yeah so my magik is like messing up now and then code:
const Discord = require("discord.js")
module.exports = {
name: "magik",
category: "Images",
run: async (bot, message, args) => {
let member = message.mentions.members.first() || message.guild.members.cache.find(m => m.user.username === args.join(' ')) || message.guild.members.cache.find(m => m.user.id === args.join(' ')) || message.member;
let user = member.user;
let icon = user.displayAvatarURL({ format: "png", size : 1024})
let url = `https://api.alexflipnote.dev/filter/magik?image=${icon}`
let embed = new Discord.MessageEmbed()
.setColor("#2f3136")
.setTitle(`Here is ${user.username}'s magik avatar!`)
.setImage(url)
await message.channel.send(embed)
}
}
``` @twilit rapids
Hi there,
I am trying to find a way to make music with less rate limits, what can I do to do this? Should I use the official YouTube api, Should I scrape I'm not sure
Api
With an API key?




