#development

1 messages ยท Page 1029 of 1

stable grail
#

still no answer on my problem lmao

tulip ledge
#

Whats the problem?

spare mirage
#

@tulip ledge its actually dumb how you "hate" me because Im not good at js

pure lion
#

How'd I make a handler using dirs?

#

I have a basic idea

#

But I have no idea too

stable grail
#

Command raised an exception: IndexError: list index out of range

tulip ledge
#

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

marble juniper
#

@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

slender thistle
#

Command raised an exception: IndexError: list index out of range
Where does the error come from?

#

the error is self-explanatory tbh

stable grail
#

from my youtube search command

pure lion
#
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

spare mirage
#

And saying im bad at js because I ask for fkn advice to make an embed look better is just childish

marble juniper
slender thistle
#

Say, a list has 8 elements and you are trying to access a 9-10th element

stable grail
#

it finds it sometimes and sometimes not

marble juniper
#

l e a rn

slender thistle
#

Code please

spare mirage
#

aight im out

#

byee

earnest phoenix
#

THEY STILL LAND IN THE TRASH CAN
@marble juniper ive checked there not there

marble juniper
#

then make new shortcuts

earnest phoenix
#

i am i just had a shit ton of them

marble juniper
#

then make new shortcuts

solemn latch
#

@pure lion looks like your getting every command file, and sending each one into every dir.
which wont work i dont think

tulip ledge
#

@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

pale vessel
#

why are you reloading commands and still use a switch wtf

pure lion
#

so fix?

#

also that doesnt sound very plesant

strange trout
#

Using switch is kind of counter intuitive

pure lion
#

@tulip ledge eh?

tulip ledge
#
            if (fs.lstatSync(dir + file).isDirectory()) {
                loadCommands(dir + file + "/");
                return;
            }
pure lion
#

sorry my internet box is a potato jammed into a wall socket

marble juniper
#

bruh

pure lion
#

@tulip ledge add or replace?

tulip ledge
#

?

#

That code

#

Makes it call the function

#

loadCommands()

#

Wich that code is nested in

#

On the directory it found

earnest phoenix
#

wait

#

AHHH FUCK

#

MY MINECRAFT SERVER GOT DELETED

pale vessel
#

not the place but ok

earnest phoenix
#

i was testing a thing and it deleted loads of my files

sinful belfry
#

please keep this channel related to development

stable grail
#

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?

slender thistle
#

I'm curious how you are getting a list

#

Could you send command code

misty sigil
#

Can I ask oauth questions in here?

slender thistle
#

aye

#

They're related to coding/programming

pure lion
#

what about the discord dev server?

stable grail
#

search_results = re.findall('href="\/watch\?v=(.{11})', htm_content.read().decode()) await ctx.send('http://www.youtube.com/watch?v=' + search_results[0])

misty sigil
#

so, how do I get the information from oauth redirects

slender thistle
#

Yeah, sometimes search_results might be an empty list so I'd suggest you use an if-statement to check if it's empty

stable grail
#

ah ok

#

what if its empty should it try it again?

#

or send an error?

slender thistle
#

Two ways to go around this:

if search_results:
# video found```

if list(search_results) > 0:
# video found```

#

I'd suggest sending an error

stable grail
#

hmm ok

slender thistle
#

the first one would also handle cases when search_results might be None somehow

stable grail
#

ok

haughty elbow
#

im trying to do make a kiss command but its not working i put in the exact code

winged owl
#

language? error? code?

pure lion
#

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);
strange trout
#

Your own code is confusing you? neko_think

#

How are you structuring your command files

pale vessel
#

props.command is undefined

#

check your command structure

haughty elbow
#

Help please

winged owl
#

@haughty elbow which coding language?

sudden geyser
#

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

strange trout
#

Yo

pale vessel
#

ask away

haughty elbow
pale vessel
#

oh jeez

robust moth
pale vessel
#

@earnest phoenix use reaction collectors

misty sigil
#

How do I use OAuth, I have the scopes working, but how do I use the deeta

opal plank
#

@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

robust moth
#

@opal plank see line 17

opal plank
#

are you awaiting for the function to complete?

robust moth
#

Yes

pale vessel
#

they resolved it

opal plank
#

on console

#

console.log(await findOrCreateGuild())

pale vessel
#

also, don't store guild names

#

id is enough

haughty elbow
misty sigil
#

name = waste of storage

strange trout
#

What even is that

robust moth
#

also, don't store guild names
@pale vessel ok

opal plank
#

console.log(guild) after that returns [function]?

earnest phoenix
#

Bande de fou

robust moth
#

I don't try it

opal plank
#

do

haughty elbow
#

Ig I'll try to get help else where

pale vessel
#

read your library's documentation

robust moth
#

console.log(guild) after that returns [function]?
@opal plank yes

#

But it show 1st time

opal plank
#

it bothers me a bit that its not async function findOrCreateGuild()

misty sigil
#

waii

#

i have a code

#

now how do i get data

earnest phoenix
#

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.

strange trout
#

How are you loading it

opal plank
#

@robust moth async findOrCreateGuild() => async function findOrCreateGuild()

#

try that

earnest phoenix
#
registerFont('./font/stretch.ttf', { family: 'stretch' })
and 
ctx.font = `normal 20px stretch`;
finite bough
#

it could not find the font file ig

#

do u have the file inside ur project?

earnest phoenix
#

Yes

misty sigil
#

hey

#

how do i use the oauth code

pale vessel
#

exchange it for a token

misty sigil
#

wut

strange trout
#

@earnest phoenix How does the rest of your file struct look

earnest phoenix
#

Could I send it to you in dms?

strange trout
#

Don't see a reason to but if you want to sure

robust moth
#

@opal plank I fixed it.... Just remove .toJSON()

earnest phoenix
#

Das crazy

heavy anchor
#

oops wrong channel

earnest phoenix
#

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```
finite bough
#

holdup

#

2nd option

#

u know how much ram it can take

earnest phoenix
#

Uhh, we didn't talk about ram

#

Just at their own risk for their ram they should do that

#

xQcM time to get a really good ram

#

Or...
There's a second way, set it up by listening to the messageReactionAdd event

finite bough
#

^

#

less ram

#

but

earnest phoenix
#

xQcM without wasting much memory

finite bough
#

it only looks for messages which have been created after the bot was started the last time

strange trout
#

partials

#
if (reaction.message.partial) await reaction.message.fetch();
earnest phoenix
#

(i think he meant messages that was created even before the client was constructed?)

pure lion
#

okay this handler isn't working properly

#

i am 100% certain that my properties are named correctly

solemn latch
pure lion
#

ahballs

#

same error

earnest phoenix
#

How can i register all fonts, lol

pure lion
#

canvas?

#

wheres tim when you need him

slender thistle
#

living his life probably

pure lion
#

g o o d p o i n t

spare mirage
#

we really need to give tim a legend role

earnest phoenix
#

Legends never die

spare mirage
#

lmaoo

earnest phoenix
#

We should give tim a role called
The human stack overflow

pure lion
#

yes

spare mirage
#

yes please

#

in orange

solemn latch
#

i think he just is really good at reading docs

#

๐Ÿค”

slender thistle
#

offtopic

spare mirage
#

hmm

earnest phoenix
#

where? I can't see off topic?

slender thistle
#

and what I meant was "the topic is outside of this channel's purpose"

spare mirage
earnest phoenix
#

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

pure lion
#

database?

#

not a py user sorry

earnest phoenix
#

oof ok

#

god dangit i don't think there is a way

solemn latch
#

databases are common with discord bots

pure lion
#

^

solemn latch
#

opt out/in features are pretty common

pure lion
#

so im assuming use a db to store the user ID and a boolean value

earnest phoenix
#

are dbs the same as libraries

solemn latch
#

dbs are databases

earnest phoenix
#

"somewhat" new to python

pure lion
#

ah

earnest phoenix
#

like dpy is a library. is it also a database?

pure lion
#

no

earnest phoenix
#

ok.

pure lion
#

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)

earnest phoenix
#

ok

solemn latch
earnest phoenix
#

ok. Now it's time to watch that, and search google for a opting out database

slender thistle
#

just a database

#

opt-out just means the user can toggle an entry in the database that you check before sending them a message

earnest phoenix
#

hmm

solemn latch
#

missing permissions means your bot doesnt have a perm to do something

earnest phoenix
#

Mmm, but has all perms, weird can't work it out.

solemn latch
#

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.

earnest phoenix
#

Meh, it's working and still is doing what it's meant to do, I'll fix it if it starts crashing the bot.

solemn latch
#

ideally you should still catch those erros

#

errors*

earnest phoenix
#

Yeah but can't workout what it is.

solemn latch
#

well, everything you do that requires a permission, should be catched

misty sigil
#

Do I need a node server for my dashboard

digital ibex
#

if ur using node.js, yes

misty sigil
#

so i can do it with pure html

#

a bit of js (obv)

digital ibex
#

imo, most of ur dashboard should be in js

misty sigil
#

most will be

digital ibex
#

but yeah, u'd need html and js

earnest phoenix
#

you can't really do just frontend

misty sigil
#

yea

#

i need some backend

digital ibex
misty sigil
digital ibex
#

nvm lmao

misty sigil
#

couldn't i just make another serverbut node

#

that the main site passes the auth code

pale vessel
#

but why

misty sigil
#

cuz my server isn't running node-server

#

just a standard webhost

spare mirage
#

how do I restrict commands to nsfw

solemn latch
#

if a command is nsfw, check if the channel you are sending to is nsfw

#

channel.isnsfw or something, can check the docs

spare mirage
#

I tried typing nsfw in docs

#

nothing

solemn latch
#

it will be a property of channel

digital ibex
#

@misty sigil wym?

misty sigil
#

wym

misty sigil
#

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

digital ibex
#

what is it then?

#

and why would you need more than one server anyways?

spare mirage
#

if (message.channel.nsfw) @solemn latch

misty sigil
#

my web server is practically just apache stuff i think

digital ibex
#

i've never worked with apache, but im still confused, im pretty sure you won't need more than one server though

solemn latch
#

apache can handle multiple things on one server

misty sigil
#

its just html/php/js host

solemn latch
#

i have 4 websites on one server

#

with one ip

digital ibex
#

cool, i might try it out. but i've never used it before so i could be wrong shrug

misty sigil
#

i have 4 websites on one server
@solemn latch i have 3 on one server, with subdomains

earnest phoenix
#

Guys, how can i slice commands in a embed? I want to make commands with page (with reactions)
lol

#

Anyone ?

solemn latch
#

like, making a help command?

digital ibex
#

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

pale vessel
#

nickname is a guild thing

#

so it only exists on members

#

author is a user

gray zealot
#

yess

#

๐Ÿ˜„

thin sonnet
#

My bot isn't changing status. Only changing activity. Does anybody know how to fix? Using node.js and discord.js

surreal jay
#

@spare mirage I dont know if you are still in need of a nsfw restrict thing but I have the code for it

spare mirage
#

nah

surreal jay
#

sorry for ping

#

Oh ok

thin sonnet
#

Anybody know a fix?

spare mirage
#

irs just
if (!channel.type.nsfw) {
return
}

surreal jay
#

k

thin sonnet
#

what happened?

#

discord.js or py?

#

k

pale vessel
#

get the first mentioned user or use args

elfin flower
#

how do i do webhook stuff

#

py

pale vessel
#

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

thin sonnet
#

flaze

#

not setting status

pale vessel
#

that should work

spare mirage
#

should work

pale vessel
#

have you tried using setPresence() since you're setting status and activity

spare mirage
#

Why cant I add an status if my bot is on IDLE

thin sonnet
#

oh.

#

How do I use that?

pale vessel
#

read docs

thin sonnet
#

ok

#

"undefined"

#

How do I fix this...

pale vessel
#

what did you do

thin sonnet
pale vessel
#

if you're on v12, you'd know what to do

#

otherwise, upgrade

tulip ledge
pale vessel
#

japanese quotes?

#

ใ€Œ

tulip ledge
#

And how do I get the other one?

pale vessel
#

ใฏใฏ
ใ€

tulip ledge
#

Tyvm

thin sonnet
#

I am new

#

to discord.js

pale vessel
#

users is a manager that holds the cache

#

you'd want to access the cache

#

so users.cache

thin sonnet
#

ok

spare mirage
#

bot.user.setPresence({ activity: { name: `%support blblbalbla` }, status: 'dnd' })
@thin sonnet

thin sonnet
#

thanks

spare mirage
#

:3

thin sonnet
#

Yeah nope

#

Ok nvm

#

Thanks @spare mirage and @pale vessel

spare mirage
#

hmm

#

weird

earnest phoenix
#

@cyan python

thin sonnet
#

It fixed

#

just was lag

spare mirage
#

normal

pure lion
#

is there a way to get all the members in a channel?

#

and then dm them

amber fractal
#

if you want to be banned, sure

pure lion
#

Jajajajajaj funny

#

Its a ticket thingy

spare mirage
#

@pure lion I mean probably

amber fractal
#

You'd still be spamming the api and getting rate limited

spare mirage
#

:0

pure lion
#

The channel only has 3 members

#

Including a bot

quartz kindle
#

channels have a .members property

pure lion
#

Oh ty

amber fractal
#

yep

pure lion
#

Channel.members.send?

quartz kindle
#

no

amber fractal
#

no, you'd have to iterate it

#

it's a collection

pure lion
#

Oh fuck I hate loops

#

Aaaaaaaaaa

#

Time to learn jajajajajajaja

pale vessel
#

bad idea

digital ibex
#

hi

quartz kindle
#

for(let [id,member] of channel.members)

digital ibex
#

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

amber fractal
#

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?

digital ibex
#

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

amber fractal
digital ibex
#

o ok

#

ah, !important works, thanks :D

solemn latch
#

๐Ÿค”

#

im trying to win a tiebreaker and theres no one on asking things

digital ibex
#

so um

#

its looking kinda shit cuz the black bit is not going all the way

tired nimbus
#

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?

digital ibex
#

all the css is css body { background-color: black; }

solemn latch
#

Is it some?

#

I think

digital ibex
#

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))

earnest phoenix
tired nimbus
#

you need to use the emoji form

chilly bison
#

@tired nimbus array.filter

tired nimbus
#

ok thanks mr.beast

chilly bison
#

@tired nimbus nice pfp

earnest phoenix
#

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
}

chilly bison
#

@earnest phoenix wtf is that

solemn latch
#

Nice code

earnest phoenix
#

it just be like that sometimes

lament hull
#

yo @earnest phoenix i have a similar question lol

chilly bison
#

I would do it like this

earnest phoenix
#

id use switch

tired nimbus
#

switch

lament hull
#

if anyone has a moment, could i please borrow a few seconds of your time?

earnest phoenix
#

its just a joke

#

lol

chilly bison
#
return condition1 ? value1
         : condition2 ? value2
         : condition3 ? value3
         : value4;```
#

@lament hull whats up

earnest phoenix
#

or something like that

chilly bison
#

@earnest phoenix goes nowhere

earnest phoenix
#

not shitposting sir

tired nimbus
#

lmao

lament hull
#

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

chilly bison
#

uhh

#

let me try that ut

lament hull
#

dude

#

if you figure this out.....

earnest phoenix
#

use an embed

#

just use

#

setimage

lament hull
#

i looked all over the freakin place... not even my csci buddy knew lol

earnest phoenix
#

or ignore me

tired nimbus
#

oops'

#

ignore me please

lament hull
#

i'm sorry boss @earnest phoenix i didn't know that was for me

chilly bison
lament hull
#

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

chilly bison
#

huh

lament hull
#

you guys are awesome lol. this is why i love this server

earnest phoenix
#

yo @earnest phoenix i have a similar question lol
@lament hull ohhh

chilly bison
#

@lament hull im not sure how they did that tbh

lament hull
#

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

chilly bison
#

@lament hull not sure, maybe ask the discord api server

#

discord-gg / discord-api left @lament hull try there

lament hull
#

thank you so much

#

i really appreciate that

#

cheers.

earnest phoenix
#

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

astral yoke
#

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

bitter badger
#

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

unreal cape
#

@earnest phoenix you got the job

#

welcome aboard

solemn latch
#

@bitter badger if you want to use an API expect to have some fees

bitter badger
#

I guess Google Cloud Vision has something, right?

lyric mountain
#

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

bitter badger
#

I'm using js if that is any help at all

solemn latch
#

Yeah, its pretty expensive. A few cents per query if I remember

bitter badger
#

@lyric mountain I dunno how tf to do that lmao

lyric mountain
#

Sobel's algorithm is very simple and easy to understand

bitter badger
#

I've used GCV for image labelling before and it isn't too cheap, so you're right about that

lyric mountain
#

Then you just need to compare to a font's outline

#

If it's 75%+ similarity, get that character

solemn latch
#

Sounds like a lot of work when there are thousands of fonts

bitter badger
#

I am reading text from a specific game

#

So it's one font

solemn latch
#

Oh ex

#

ez

lyric mountain
#

Yeah, one font for each type and you're done

bitter badger
#

"Make something unique" they said. "Not yet another multipurpose bot" they said. KEKW

lyric mountain
#

The Sobel operator, sometimes called the Sobelโ€“Feldman operator or Sobel filter, is used in image processing and computer vision, particularly within edge detection algorithms where it creates an image emphasising edges. It is named after Irwin Sobel and Gary Feldman, colleagu...

bitter badger
#

What do you mean one font for each type?

lyric mountain
#

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

pine falcon
#

Hi

bitter badger
#

Is there any easy way to figure out the font? I'd imagine I need to know the name of the font before starting

lyric mountain
#

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)

solemn latch
#

what game is it @bitter badger

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

lyric mountain
#

Edge detection is really fascinating

bitter badger
#

One post says the font is Myraid by Adobe

solemn latch
#

oo

bitter badger
#

Yeah that one lo

lyric mountain
#

My graduation project was about generating texture maps from images

bitter badger
#

I'd imagine it has a lot of uses

lyric mountain
#

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

bitter badger
#

It reminds me of those old filters where it make a penciled look. I take it it uses something like that

lyric mountain
#

Yep

#

It's either a sobel-based filter or a canny-based filter

pine falcon
lyric mountain
#

The Canny edge detector is an edge detection operator that uses a multi-stage algorithm to detect a wide range of edges in images. It was developed by John F. Canny in 1986. Canny also produced a computational theory of edge detection explaining why the technique works.

earnest phoenix
#

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);

bitter badger
#

They use the same image example as the sobel Pog

lyric mountain
#

It's a great image for testing the algorithm

#

Wikipedia loves it

pine falcon
#

Lol

fallow sentinel
#
 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?

solemn latch
#

whats your error

lyric mountain
#

First of all: you just leaked ur token

fallow sentinel
#

it's invalid lol

lyric mountain
#

Second: that's HALF a code

solemn latch
#

you did post, and then delete it

#

๐Ÿค”

fallow sentinel
#

No I get an error logging into the bot

#

*not cus of the token

solemn latch
#

login after all your events

fallow sentinel
#

Ok I'm a mobile bot Dev like can someone be of assistance

lyric mountain
#

You need to give us the full code AND an error to look at

fallow sentinel
#

I'm getting a syntax error

lyric mountain
#

Ok, we're getting there

#

Now, WHERE does the error point at?

fallow sentinel
#

"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

lyric mountain
#

Is your token enclosed in quotation marks? (or apostrophe, whatever)

fallow sentinel
#

um

#

No?

#

brb

lyric mountain
#

The token is a string, you gotta put it inside qm/apostrophes

fallow sentinel
#

Oh thanks, it worked :)

lyric mountain
#

Yw

bitter badger
#

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 lul

lyric mountain
#

There's a site for finding the correct font from an image

bitter badger
#

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

lyric mountain
#

Try using an image editing software to increase the contrast of the font

mellow anchor
#

๐Ÿ’ฏ

bitter badger
#

This is truly making me understand the pure number of fonts in the world

vernal basin
#

my bots stops working after a couple of messages after bootup. no idea why, nothing in console

sudden geyser
#

Is the process/node.js closing or is it still running.

vernal basin
#

still running

#

and then after a while the bot just disconnects

#

proccess is still running according to the console

solemn latch
#

It disconnects?

earnest phoenix
#

Is there a way to spoiler-fy an embed image?

vernal basin
#

like it goes offline

#

but it still appears to be running from the console

delicate shore
#
    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
#

wait

#

isnt it discord.Embed?

#

what discord lib u using? @delicate shore

delicate shore
#

@earnest phoenix v12

earnest phoenix
#

what library?

delicate shore
#

it's discord.MessageEmbed()

#

discord.js

earnest phoenix
#

oh lol

#

my b

delicate shore
#

ok

earnest phoenix
regal raven
#

๐Ÿค”

delicate shore
#

my problem got solved

earnest phoenix
#

nice

delicate shore
#

probelm was

regal raven
#

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)```
delicate shore
#

i never refreshed the projcyt

earnest phoenix
#

oh

#

ok

regal raven
#

Hmm

#

Try this

earnest phoenix
delicate shore
#

bruh

regal raven
#

Happens for Me too

delicate shore
#

code is wrong

strange trout
#

Just my thoughts but that privacy command makes the bot look suspicious lmao

earnest phoenix
#

@delicate shore what have i done wrong??

strange trout
#

If you are on discord.js v12 avatarURL is a method

#

Actually

regal raven
#

Ooooooh

delicate shore
#
user.displayAvatarURL()```
earnest phoenix
#

ok

delicate shore
#
    let member = msg.mentions.members.first() || msg.member,
  user = member.user;```
#

let this too

#

@earnest phoenix

earnest phoenix
#

ok

#

display avatar url isnt a command for me

#

@delicate shore

delicate shore
#

@earnest phoenix

#

haev you used ${}

earnest phoenix
#

no

delicate shore
#

bruh

#
(`${user.displayAvatarURL()
}`)```
#

@earnest phoenix

earnest phoenix
#

ok

strange trout
#

Why would you do that

weary ridge
#

Hello gamers

delicate shore
#

works for me

#

idk

earnest phoenix
#

what should i do @strange trout

strange trout
#

What's the issue

delicate shore
#

hello Youtuube

#

majed

weary ridge
#

Lul

#

๐Ÿ™‚

earnest phoenix
#

the pfp doesnt show up in the embed @strange trout

regal raven
#

Lel

delicate shore
#

@earnest phoenix try my way

#

it should work

#

works for m atleast

strange trout
#

Show part of code where you're adding avatar

earnest phoenix
delicate shore
#
.setThumnail(${user.displayAvatarURL()
})```
#

thumnail*

#

thumbnail*\

earnest phoenix
#

@strange trout

strange trout
#

avatarURL isn't a property of User

earnest phoenix
#

for gods sake use a command manager

delicate shore
#

lol

earnest phoenix
#
(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

strange trout
#

What even is that

delicate shore
#

what lang is that

earnest phoenix
#

JS

#

avatarURL isn't a property of User
@strange trout what should i do?

strange trout
#

Look at the doc

#

s

earnest phoenix
#

user.displayAvatarURL()

#

ok

#

@earnest phoenix

delicate shore
#

that is what i did

strange trout
earnest phoenix
#

you did avatarURL no?

#

i dont have displayavatarurl

#

oh

#

you dont do ${user.displayAvatarURL()} outside a template literal

#

remove the ${}

delicate shore
#

you do

earnest phoenix
#

i didnt add that

delicate shore
#

user is a var

earnest phoenix
#

no you dont PGamer

#

${} is for template literals

delicate shore
#

i has let user

#

so i do that

#

have*

earnest phoenix
#

its not in a template literal

#

so its a syntax error

strange trout
#

No you don't have to do that

delicate shore
#

no

earnest phoenix
#

@earnest phoenix how should i fix mine??

#

can you show me the full code except for the token?

#

I can fix it

#

ok\

#

:/

delicate shore
#

me?

earnest phoenix
#

no...

#

i fixed it

#

via dms

strange trout
ashen quarry
#

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

#

๐Ÿ‘Œ

earnest phoenix
#

@strange trout displayAvatarURL() returns a string. check the docs

#

So concatenating empty strings or using .toString() is pointless

strange trout
#

I'm well aware

restive pebble
#

hmmm

indigo folio
#

u already have that

#

its the filter

frigid lichen
#

smh

indigo folio
#

user.id === message.author.id

frigid lichen
#

Yes

indigo folio
#

that is literally what that does

frigid lichen
#

smh

indigo folio
#

bruh

frigid lichen
#

then change the bloody filter

#

get creative or something

#

idk

indigo folio
#

user.id != client.user.id

#

use brain

frigid lichen
#

you're too nice ashton

indigo folio
#

sometimes i think so ๐Ÿ˜”

#

but it took 2 seconds to type so whatever

frigid lichen
#

xD

bitter badger
#

@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

sick cloud
#

they're a group of 3 divs

pale vessel
#

make it inline

sick cloud
#

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>
regal raven
#

My bot has a command that shows the users in a certain role
What should the permission requirement for it be?

sick cloud
#

either manage roles or nothing since that's something users can see manually (just slower)

regal raven
#

Yep

pale vessel
#

do you have the site url or is it local

spare mirage
pale vessel
#

avatarURL() is a method

#

you should use displayAvatarURL() though since it also gives default avatars

spare mirage
#

ok

sick cloud
#

it's local

pale vessel
#

DUCK

sick cloud
#

but i can send the files if you wanted

pale vessel
#

sure

sick cloud
#

just a css file and a html file

pale vessel
#

sounds simple enough

#

add display: inline-block; to .arrow

sick cloud
#

oh that worked awesome

#

ty

pale vessel
#

all g

spare mirage
#

var scount = bot.guild.cache.size
message.channel.send(This server has ${scount} users!)

#

whats wrong?

sick cloud
#

bot.guild isn't a thing

spare mirage
#

hmm

#

bot.guilds works though

#

but thats for all servers

#

Lemme try smtng

restive pebble
#

what u want

#

to do

spare mirage
#

usercount command

restive pebble
#

message.guild

spare mirage
#

hmm

#

makes sense

restive pebble
#

member cache size

spare mirage
#

message.guild.cache.size

#

or members

restive pebble
#

memerbers.cache

opal plank
#

thats only online users btw

spare mirage
#

hmmm,

opal plank
#

not all members

spare mirage
#

fk

restive pebble
#

then fetch

opal plank
#

also bad

#

just sum

#

iterate thru each guild

#

no need for calls

inland linden
#

would anyone be able to hop in a voice channel and help me with this bot, im using DBM

restive pebble
#

fetchAllMembers true is option

#

it gives all users

opal plank
#

and kill your ram

#

great idea

marble geode
#

@restive pebble no

#

use this

spare mirage
#

@opal plank what?!?!?
!

opal plank
#

why cache all users on your end?

marble geode
#

\${bot.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}\

opal plank
#

just iterate all the guilds

marble geode
#

ops

#

\``${bot.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}\``

#

wtf

#

uh

spare mirage
#

lol

#

just `-``

#

without the -

marble geode
#

${bot.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}

#

use that

spare mirage
#

hmmm

#

code feeding

#

hmm

#

but thanks!

pure lion
#

do {
//shit
}
while (//shit)

opal plank
#

gets help
complains

spare mirage
#

what

#

lol

#

isnt that a loop?

#

shitting 24/7 doesnt seem fun

opal plank
#

while (state) {//do stuff}

pale vessel
#

do while does it at least once right? while does it only if the condition is true

opal plank
#

while loops

#

till it breaks out of the loop

inland linden
#

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 :)

lusty quest
#

@inland linden maybe ask on the DBM discord

spare mirage
restive pebble
#

lol

inland linden
#

ive already tried but i dont think anyone is active to help at the moment @lusty quest

opal plank
#

@inland linden we are here to help you code, using pre-made bots is probably not a good idea here

inland linden
#

its not a pre made bot

marble geode
#

@spare mirage try my code bro

restive pebble
#

guild user count

spare mirage
#

v

inland linden
#

im making it from scratch

spare mirage
#

I did

#

lmaooo

lusty quest
#

i used it when i started with Discord bots but its verry limited

#

what is your issue? @inland linden

spare mirage
#
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!`)
}}```
restive pebble
#

?

marble geode
#

see lol

restive pebble
#

message.guild.memberCount

spare mirage
#

yes?

marble geode
#

ooo he only want count user in guild?

opal plank
spare mirage
#

lmaoo

marble geode
#

wait

spare mirage
#

noterwin do u check ur dms?

marble geode
#

you only want count member in 1 guild right?

spare mirage
#

yes

opal plank
#

not my screenshot justii

#

its kang's

spare mirage
#

:3

opal plank
#

guild.memberCount

spare mirage
#

no

marble geode
#

message.guild.memberCount

opal plank
#

wdym no?

spare mirage
#

instead of b.membercount

#

doesnt work @opal plank

opal plank
#

what are you trying to do?

spare mirage
#

it gives error

opal plank
#

i gave you a non spoonfed explanation. guild has a memberCount property in it

#

use it

spare mirage
#

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

opal plank
spare mirage
#

it didnt

opal plank
#

like i said, guild has that property, you can access that via message or get it from cache

pale vessel
#

b.guild.

#

b is already a guild

opal plank
#

l.eval console.log(message.guild.memberCount)

#

n.eval console.log(message.guild.memberCount)

pale vessel
#

there's no guild in guild

opal plank
spare mirage
#

message.channel.send(`This server has ${message.guild.memberCount} users!`) this works thanks @opal plank

opal plank
#

np

spare mirage
#

:D

#

I'm cranking commands today lol

pure lion
#

Did you learn js

#

Yet

#

?

spare mirage
#

yes finished the course lol

#

still dont know a fck

marble geode
spare mirage
#

LOL

#

261

#

:O

opal plank
#

why tho

spare mirage
#

I bet he is active in 1% of the servers

opal plank
spare mirage
#

imagine having mobile push notifications on

opal plank
#

i mean, its their discord, none of my business, but still triggering to see that many unread messages

spare mirage
#

lol same for me :3

surreal notch
#

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

spare mirage
#

Umm I guess u just make a say command

regal raven
#

Idk about js but in python It's just 3 lines

spare mirage
#

and send it in another channel

surreal notch
#

So how I transfer that cmd to my server id?

#

ยฏ_(ใƒ„)_/ยฏ

spare mirage
#

idunno

surreal notch
opal plank
#

get from client the target channel

surreal notch
opal plank
#

client.channels.cache, then get the id and fetch it onto the map cache. then you can send it

spare mirage
#

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

surreal notch
#

ok

regal raven
#

ok

surreal notch
#

from server 1 to server 2

#

i think both

#

@spare mirage

pure lion
#

Oh, so like userphone?

surreal notch
spare mirage
#

yes

surreal notch
#

not like that

restive pebble
#

cache channels

pure lion
#

That seems to be what you're implying

pure lion
#

You missed a capital letter after the full stop, shame on you!

spare mirage
#

You go to jail now

opal plank
#

@surreal notch how well versed with js are you?

surreal notch
#

@opal plank client.channels.cache('CHANNEL ID')

#

something like that?

opal plank
#

not quite there, but close

restive pebble
#

.get

opal plank
#

cache is a map

pure lion
#

1 to 10, 1 being java = js and 10 being above tim

opal plank
#

you need to get or filter the map to get the proper channel/guild you want

spare mirage
#

I would say im lvl 4 rn

#

lol

pure lion
#

Wait after you map values can you get from the map?

opal plank
#

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

restive pebble
#

yes

surreal notch
opal plank
#

would recommend reading that, map is essential basics of js

pure lion
#

Oh got it

opal plank
#

actually, use this one too

pure lion
#

Oh yeah because map and Map are different

opal plank
#

indeed

#

i took the first search i found and blurted it here

surreal notch
#

still dont get it

opal plank
#

its the second one you want to check

restive pebble
#

hmmmm

pure lion
#

Ik how Maps work, I use it for my global music queue

opal plank
#

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

#

d.js map keys as the channel id

surreal notch
#
 
 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
opal plank
#

you are getting that channel, but you arent doing anything with it

restive pebble
#

send

opal plank
#

trying not to spoonfeed

surreal notch
#

message.channel.send?

pure lion
#

Await the .get and then send to it

opal plank
#

message is looking at the message sent

#

since you already looking at client, you wont need messsage

restive pebble
#

that thing has a method send

opal plank
#

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

pure lion
#

Well in truth message returns a message object but that's probably irrelevant rn as you're learning the basics

opal plank
#

trying to make it as easy as possible to understand the basics

surreal notch
#

||but i m nub||

opal plank
#

then learn. What is that you dont understand? i can explain a bit better if you wish

pure lion
#

Same I think maybe

surreal notch
#

ยฏ_(ใƒ„)_/ยฏ

restive pebble
#

try to log things

opal plank
#

if you dont have any questions, i take you understood it

surreal notch
modern wagon
#

How can I use global variables in my bot (python)

plucky harness
#

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

pure lion
#

There's probably a npm thingy

plucky harness
#

huh

opal plank
pure lion
opal plank
#

use their api

#

and OFFICIAL module

plucky harness
#

i am on python

pure lion
#

O

plucky harness
#

i am using their api

#

for for my local host to accept request i need something like ngrok or ngnix

opal plank
sick cloud
slender thistle
pale vessel
#

but why

opal plank
#

tis why i pointed

use their api
and OFFICIAL module

pale vessel
#

who made that

#

tony, you'd need the minecraft font

sick cloud
#

well

#

not counting the font

#

just the code to get the tooltip to be where the mouse is

hoary elm
#

@sick cloud ^^

#

Might help ๐Ÿค” Iโ€™ve never really played around with tool tips

sick cloud
#

eh, should be css only...

pale vessel
#

not possible

restive pebble
#

nice idea

pale vessel
#

js is required to track cursor position

sick cloud
#

fair enough then

#

so js it is

#

well ill look into onmouseover i guess

hoary elm
#

Hopefully it helps

earnest phoenix
#

Server invite link

#

???

#

Custom link

#

Plz

#

Tell me

#

Any buddy

pale vessel
restive pebble
#

hmmm

earnest phoenix
#

Ok

sick cloud
#

so that works i guess, how would i actually put content where the mouse is

sonic ivy
#

what js library should I use to edit images? jimp?

pale vessel
#

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

sonic ivy
#

alright

sick cloud
#

so i looked into it but have zero idea how to do these tooltips

#

if that helps anyone figure it out

pale vessel
#

steal css and js

sick cloud
#

i tried but cant work it out

tight plinth
pure lion
#

Go to mobile view and then hover?

#

On cp

#

Pc

tight plinth
#

I'm not even sure Firefox have a mobile view feature

pure lion
#

Oh firefox

sick cloud
#

it does

tight plinth
#

Lol

hushed temple
#

guys

#

how to make the html descption over some

#

??

tight plinth
#

What

earnest phoenix
#

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
golden condor
#

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

honest perch
#

Api

golden condor
#

With an API key?