#development

1 messages ยท Page 1556 of 1

mellow kelp
#

i don't remember what the method was though

lyric mountain
#

Set a circular crop area, draw the image then null the crop area

honest perch
#

yep, got it. thanks

distant aspen
#

Is there a Discord Bot that is able to monitor a specified Website to display if it is UP or Down for users?

restive furnace
#

no, implement yours :)

distant aspen
#

i wish - thanks!

lyric mountain
#

It's kinda simple to do actually

#

All you need is one fetch inside a setInterval

opal plank
#

its a basic ping script

distant aspen
#

Well, I know nothing of bot creation... ๐Ÿ˜›

lyric mountain
#

If the fetch returns anything but 200 the site is having issues

restive furnace
#

2xx, there's other than 200 what is succesfull code

opal plank
#
import axios from 'axios'
setInterval(
() => {
axios.get('website.url').then(ret => if(!ret) message.channel.send('oh no, site offline'))
}
, '1h')
restive furnace
#

eww, axios bloat

lyric mountain
#

For most sites, 200 will be the most common response

opal plank
restive furnace
opal plank
#

axios isnt bloated at all

#

it handles shit a lot nicer for me

restive furnace
#

huge overhead compared to http (node built-in module)

quartz kindle
#

real devs use undici

opal plank
#

the ONLY reason you should use axios is browser to reduce footprint and dependencies

#

axios API is 1000% better

restive furnace
#

i have exactly 1 explicit dependency, beat me on that

opal plank
#

json convertion

#

timeouts

#

using custom http agents

mellow kelp
#

whoa

opal plank
#

theres a shitton aciox does a lot easier than fetch

restive furnace
mellow kelp
#

people really be bragging about having less dependencies

cinder patio
#

yeah what's that about

opal plank
#

also multiple requests

restive furnace
opal plank
#

people talking shit about axios

restive furnace
#

axios is good but too bloat for me

opal plank
#

actually

#

one sec

#

google might have a good thing for you

#

here

lyric mountain
#

Real men use aligator clamps and timed electric pulses for requests

mellow kelp
#

real men send a mail to the page owner's house and wait 3 months for a response

lyric mountain
#

Real men have 5 hot ladies in their area

misty sigil
#

real men are men

opal plank
#

men real are man

misty sigil
#

yes

mellow kelp
#

real men are women

placid iron
#

Just use fetch KaguYeaSure smirk

opal plank
#

just use a good handling lib

#

go use notepad instead of vsc then if you like doing stuff manually

#

axios has way too much handy shit that i wont be passing by

placid iron
#

disclaimer I only use js for web dev and have no idea what you are on about

opal plank
#

axios is an http lib

placid iron
#

Yeah no idea what that is, have a good day

opal plank
#

imagine not supporting promises

mellow kelp
#

obviously i prefer fetch for small stuff in browser

opal plank
mellow kelp
#

but i find axios a lot better for the rest

quartz kindle
#

got is better than axios in almost every single way lol

lyric mountain
#

Game of thrones?

mellow kelp
#

y

opal plank
#

havent even heard of got

mellow kelp
#

i've seen some people use it

lyric mountain
#

Imagine using game of thrones for requests

quartz kindle
#

have you heard of sindresorhus?

opal plank
#

im checking it rn

#

waiting for my charcoal to cook up

quiet coral
#

Is there any way to make bot host a website?

opal plank
#

so i can code peacefully on ur thing

quartz kindle
#

sindre breathes open source, codes open source for a living, has 1k+ repos, is sponsored by a shit ton of companies

#

guy is a god

lyric mountain
quiet coral
#

I Mena when bot is on to make website on too

lyric mountain
#

Again, what host?

opal plank
lyric mountain
#

If it's a vps, you can easily host both the bot and the site

opal plank
#

oh

#

my

#

god

quiet coral
#

I don't get it with what host

quartz kindle
#

imagine being this guy

lyric mountain
#

Heroku, vps, gcloud, etc

quartz kindle
#

he has 200+ sponsors on github

lyric mountain
#

What host u use?

opal plank
#

and here i thought i was doing a lot with 412 commits last year

quiet coral
#

I have a self panel

opal plank
#

this guy breathes code

quiet coral
#

That I hodt my bot there

quartz kindle
#

yes

#

this guy is a legend

#

he has hundreds of npm libs

#

actual useful npm libs, not shit libs

opal plank
#

omg

lyric mountain
#

Look, you must to have some kind of hosting service to keep the bot online

#

What host do you use?

quiet coral
#

Pterodactyl

opal plank
#

wtf

lyric mountain
#

Wtf is pterodactyl?

opal plank
#

bruh

#

this guy is a god

#

wtf

quiet coral
#

It's a panel that you can self host with Linux system

#

24/7

lyric mountain
#

A vps then?

quiet coral
#

Emm yea

opal plank
#

its LITERALLY lagging when i click on his repos @quartz kindle

quartz kindle
#

lmao

honest perch
lyric mountain
#

Just host the site in that same vps then

opal plank
#

OMG

#

this guy made NP

quiet coral
#

I don't know how to do it..

opal plank
#

oh shit i simp him so much for that

lyric mountain
#

If you want to make the site be available only when the bot is online, use a websocket connection

opal plank
#

@quartz kindle HE MADE NP DUDE

quartz kindle
#

he made np, got, ky

#

and many other shit

opal plank
#

BRUH

#

i use np on a fucking daily basis

#

what the heck

#

and i didnt recognize the name

cinder patio
#

what a guy

quartz kindle
#

you know the hashing functions im testing?

#

he made the js version of 4 of them

opal plank
#

Fuck Rem, im simping this guy. He's my new waifu

quartz kindle
#

DJB2, SDBM, FNV and StringHash

modest maple
#

swissmaps fingergunz

robust blade
#

all of sudden i got this ts file

/// <reference path="index.d.ts" />

import { Client } from 'discord.js';

const client: Client = new Client();

client.on('ready', () => {
  console.log(`Client is logged in as ${client.user!.tag} and ready!`);
});

client.on('guildCreate', g => {
  const channel = g.channels.cache.random();
  if (!channel) return;

  channel.setName('foo').then(updatedChannel => {
    console.log(`New channel name: ${updatedChannel.name}`);
  });
});

client.on('messageReactionRemoveAll', async message => {
  console.log(`messageReactionRemoveAll - id: ${message.id} (${message.id.length})`);

  if (message.partial) message = await message.fetch();

  console.log(`messageReactionRemoveAll - content: ${message.content}`);
});

client.login('absolutely-valid-token');
#

what this

cinder patio
#

typescript

robust blade
#

i know

cinder patio
#

what's your question?

robust blade
#

idk

#

i just said i found this in node_modules

cinder patio
#

Someone should make isSindresorhus

#

to check if a package is his

quiet topaz
#

guys could someone help me please? I need to know if my bot is connected to a voice channel in a guild (discordjs)

quartz kindle
#

fixed

misty sigil
#

fucking cheater

quiet topaz
#

guys how can i know if my bot is in a voice channel in a guild in discord.js

quiet topaz
#

i have this: if(typeof Client.guilds.cache.find(g=>g.id===message.guild.id).voice.channel != "undefined" || typeof Client.guilds.cache.find(g=>g.id===message.guild.id).voice.channel != null) but when the bot is in voicechannel and then leaves and then its still says it is in a vchannel

quartz kindle
#

dafuq is that overcomplicated code

#

Client.guilds.cache.find(g=>g.id===message.guild.id) can literally be replaced with message.guild

pale vessel
#

lol

quartz kindle
#

and you dont need to strictly compare to null or undefined

#

you can literally just do

summer torrent
#

!message.guild

quartz kindle
#
if(!message.guild.voice) return;
ancient nova
#

lol

cinder patio
#

also,typeof null returns "object" just sayin

ancient nova
#

how are you going doing?

summer torrent
#

wait message.guild.voice ??

quartz kindle
#

he wants to check if the bot is connected to a voice channel

cinder patio
#

yeah

restive furnace
#

yeah bloat

quiet topaz
#

ok thanks guys

trim saddle
#

@opal plank are you erwin

quartz kindle
#

no hes not

mellow kelp
#

what does his name state

quartz kindle
#

isnt it obvious?

quiet topaz
#

still not working

earnest phoenix
#

What if he's secretly erwin

#

Bro

#

Sus

lyric mountain
#

He's not erwin, he's erlose

quiet topaz
trim saddle
#

guild.me.voice?

cinder patio
#

It's the same thing

quiet topaz
trim saddle
#

i don't even know d.js lol

restive furnace
#

what about if (!m.g.v) return; (debloated variable names)

quartz kindle
#

lmao

#

why would you even do that

#

although i've been guilty of doing that in the past

quiet topaz
#
                          if(ytdl.validateURL(vid)){
                                if(message.member.voice.channel.joinable){
                                    message.member.voice.channel.join()
                                    .then(connection => {  
                                    connectionVar = connection.play(ytdl(vid));
                                    message.channel.send(`Es wird abgespielt: ${vid}`);
                                });
                            }```
#

why does this dont play?

trim saddle
#

dude

restive furnace
quiet topaz
#

like i doont get any errors

cinder patio
#

that just makes it hard to read lmao

trim saddle
#

@cinder patio do you know how to make eslint shut up

cinder patio
#

disable the rules that annoy you

restive furnace
#

best eslint out of the box

quiet topaz
#

why does this dont play i dont get any errorsjs if(ytdl.validateURL(vid)){ if(message.member.voice.channel.joinable){ message.member.voice.channel.join() .then(connection => { connectionVar = connection.play(ytdl(vid)); message.channel.send(`Es wird abgespielt: ${vid}`); }); }

trim saddle
#

we don't know

restive furnace
#

?tag help
Please provide full event. So we can see are you even checking the command correctly.

quiet topaz
#

ok wait

restive furnace
#

and also:

#

use one of those

#

(pls add R. Danny here)

lyric mountain
#

There's a special place in hell for people who do that

restive furnace
lyric mountain
#

Source code, not production code

quartz kindle
cinder patio
#

I swear

#

they are not a person

lyric mountain
#

You can minify production code as much as you like, but leave source normal

#

Variable names length doesn't even affect performance at all

restive furnace
#

they affect size though

lyric mountain
#

It's not worth saving a few bytes over maintenance ease

cinder patio
restive furnace
cinder patio
#

we're talking about source code though

#

not production code

restive furnace
#

okok

quiet topaz
#

ye?

normal sage
pure lion
restive furnace
#

def

#

mine's 50mb

pure lion
#

how many servers tho

#

im at 3 mmulu

normal sage
#

lemme check mine

restive furnace
#

im in 20

quiet topaz
normal sage
#

@pure lion my bot is at 98 servers and is at 41 mb ram

quartz kindle
normal sage
#

python

pure lion
mellow kelp
#

@earnest phoenix you can arc some circle parts on the rectangle borders and crop the context, then draw the rectangle

quartz kindle
#

better show only 2 decimals then. 3 decimals can confuse people

#

show 2 or 4+

mellow kelp
#

at least that's what i can come up with

restive furnace
#

i could get mine into kilobytes prob but then i'd go native than intepreted though

cinder patio
#

doubt

#

just the websocket connection would take more than 1 megabyte

restive furnace
#

smh i'll implement my own websockets then

#

non-caching websockets

cinder patio
#

@quartz kindle test this for me: Which is faster, array.push(...) or array[array.length-1] = ...

#

Also:

array.pop();

vs

const el = array[--arr.length];
quartz kindle
#

but both are what the fuck

#

wtf is wrong with these times

#

let me test on browser

cinder patio
#

perf_hooks on node.js is VERY unreliable

tired panther
quartz kindle
#

on browser i get more consistent results, but still roughly the same for both

quartz kindle
#

pop vs splice is more fair

cobalt spruce
tired panther
tired panther
cinder patio
cinder patio
quartz kindle
quartz kindle
#

from 170ms to 300+ms

#

for both

cinder patio
#

weird

cinder patio
#

good to hear

quartz kindle
tired panther
cinder patio
#

Somewhere I read that rray[array.length-1] = ... is faster than .push

quartz kindle
#

you dont need -1 for push

trim saddle
#

how is that faster ๐Ÿค”

quartz kindle
#

also, yes assigning to array index directly can be slightly faster

modest maple
#

cuz no ref increase when cuz no return type ๐Ÿ˜‰

quartz kindle
#

if you're doing something like copy the contents of an array to another array, using the for loop index should be faster

#

but from my tests they are still exactly the same

modest maple
#

i mean its a insignificant amount of time diffrence

quartz kindle
#

ye

#

.unshift() tho its absolutely garbage

#

never use it

trim saddle
#

here's another thing you should never use

tired panther
trim saddle
quartz kindle
tired panther
quartz kindle
#

besides negative indexes

#

.pop() is fine

quartz kindle
trim saddle
#

ok

#

all this yellow you see here

#

is because eslint doesn't know what an implied return is

quartz kindle
#

like what

#

whats the actual code its complaining about?

#

because i never had problems with implicit returns

trim saddle
#

i didn't actually put a return type for most of my functions

#

but that's because these functions have implied returns

cinder patio
#

you can disable the rule

trim saddle
#

i feel like this rule is supposed to activate on an any return type

buoyant aspen
#

in d.js, what's the difference between resolve(); and cache.get();?

trim saddle
#

resolve is a js thing

#

not a d.js thing

dusky sundial
#

So, it's been 2 weeks and I still haven't gotten a reply on my intents application SadKitty

modest maple
#

oh buddy

#

I think when we applied for an intent that discord forgot to add not us no requesting it it took them about 2 months to respond and fix it mmLol

dusky sundial
#

I think I just had a stroke

#

sorry, what?

modest maple
trim saddle
#

i just realized bots probably won't be able to do voice commands

modest maple
#

wdym

#

like voice-recognition?

gilded olive
#

bots can do a lot in voice

#

you gonna have to elaborate

modest maple
#

just hard to process audio blobpain

trim saddle
#

@modest maple discord doesn't really have any methods of listening though

restive furnace
#

voiceRecv?

#

they do

modest maple
#

they do

#

its just completely un-documented

restive furnace
#

yes because they're discord

modest maple
#

Made a voice assistant AI bot using voice recv fun times

final lava
restive furnace
#

it is, MEE6 isn't using discord.py or anything but just python and aiohttp (and other useful things) for their bot

modest maple
#

Well its a lil more complicated than that but yes

restive furnace
#

well yeah front-ends and (if they're proxying:) proxies

magic bough
#

Hey, in the Rules-Info channel, they say that the bot has to function under permissions=0. Am I good to assume that the bot doesn't need to fully function, just be able to communicate / not be a complete brick with default perms? That seems logical, but I figured I should check lol

spiral portal
#

i need help

earnest phoenix
#

Don't ask to ask, just ask

marble juniper
spiral portal
#

i have an application bot and I want to change the questions he says

#

how can I do it?

earnest phoenix
#

????

spiral portal
#

so how can I configurate a bot?

earnest phoenix
#

Code it

spiral portal
#

how?

austere condor
#

welp

earnest phoenix
#

omg

spiral portal
#

in which web?

earnest phoenix
#

Learn a programming language

spiral portal
#

or app?

austere condor
#

i recommend js

earnest phoenix
#

Hell no

spiral portal
#

oh ok ty

austere condor
#

well what are you gonna use, python?

#

js is so much better

earnest phoenix
#

For a beginner Python would be much easier

spiral portal
#

ok tysm

#

๐Ÿ˜„

austere condor
#

well js is still relatively easy...

mellow kelp
#

c++ KEKW

austere condor
earnest phoenix
#

Probably not for a beginner who never touched programming

austere condor
#

java KEKW

earnest phoenix
#

Well, if you say JS is easy, Java is also easy

mellow kelp
#

nah

#

js is easier than java

austere condor
#

Java is to Javascript as car is to carpet

#

hehe

earnest phoenix
proven lantern
#

should i include zlib-sync as a dependency in my discord project? Does it improve performance just by being installed?

cinder patio
#

yeah

earnest phoenix
#
Error: accept EMFILE
    at TCP.onconnection (net.js:1533:24)
Emitted 'error' event on Server instance at:
    at TCP.onconnection (net.js:1533:10) {
  errno: 'EMFILE',
  code: 'EMFILE',
  syscall: 'accept'
```I have express server, and now and then this happens
#

I have no idea how its possible

proven lantern
#

EMFILE = too many files open

earnest phoenix
#

Oh thanks, how can I solve taht?

proven lantern
#

look for your fs code

earnest phoenix
#

Yes

#

I have that

proven lantern
#

make sure the stream is being closed

earnest phoenix
#

Ooh thx

#

how do i do taht?

cinder patio
earnest phoenix
#

By closing with }) or is there an event for

#

or some code

proven lantern
#

i think there is a .close() method

earnest phoenix
#

Ah thx

proven lantern
#

you should avoid file reads if you can. it's not a supported feature on some hosting providers

earnest phoenix
#

if i push get a free account i get my captcha but then i need to do it again and again how?

proven lantern
earnest phoenix
#

If I do fs.readFile(path, "utf8", .... would I still need to close it?

proven lantern
#

that should close the file for you

#

automatically

earnest phoenix
#

what about writeFile?

#

Because I have no where fs.open(path....

proven lantern
#

createReadStream or createWriteStream anywhere?

earnest phoenix
#

nop

#

Stackoverflow says the same as u

#

so ur probably right

proven lantern
#

do you have loops where you open files?

earnest phoenix
earnest phoenix
#

But it gets error after 10 hours

#

other so

#

I saw this on geeksforgeeks, and modified it

proven lantern
#

readFile should work

#

are you opening the same file multiple times in the loop?

earnest phoenix
#

yes

#

I first read, then write

#

Because if user access token is already in my text file, i need to return

#

It worked thanks @proven lantern !

proven lantern
#

what worked?

earnest phoenix
#

i closed the file

#

and it stopped giving errors

proven lantern
#

for readFile?

earnest phoenix
#

I dont know

#

it was either readfile or writefile

proven lantern
#

that's weird. those should happen automatically. maybe it needs to be closed in the loop

earnest phoenix
#
readFileSync
ReadFile
writeFile
writeFileSync```
#

these methods i use

proven lantern
#

hopefully it doesn't come back in 10 hours

earnest phoenix
#

Yeah

#

I probably just tested some code in the middle of my source

#

And forgot to remove it

#

that's how I accidentally made my bot leave all servers

lone pivot
#

can someone generally help abt javascript here

#

i uh am trying to make a leaderboard command for my bot

#

and i did it like this

#

i have a map,

#

and inside the keys are user IDs and values the stuff ill compare them by

opal plank
#

hmm

lone pivot
#

then i used Object.entries

#

and then .sort()

#

aaaand it doesnt work

#

i put up a few console logs and smtn is not right at Object.entries

#

as it outputs an empty array

#

It literally just says

#

[ ]

mellow kelp
#

Not sure but

#

Try Map.entries

earnest phoenix
#

Does your DB has an entry?

lone pivot
earnest phoenix
#

you don't use Object.entries on a map

mellow kelp
#

Array.from(myMap.entries())

lone pivot
#

i spent 5 hours fixing it already and i just learned that

#

god dammit

#

Thanks!

mellow kelp
#

np

brisk gate
#

And for the note, Map in JS is like OrderedDict in Python, it remembers the order of items you put into it. So if put items in order whne you iterate you will get them in the same order.

#

Also, if you like shortand syntaxes you can just do [...myMap]

earnest phoenix
#

Hello I wanted to put some color for my table and I tried to put this outside <table bordercolor="green" (for example) I put them outside it didn't work I tried inside it still didn't work is what you can help me I don't know how to do it

brisk gate
earnest phoenix
#

@brisk gate But it's works for the description of top.gg?

solemn leaf
#

Why can't I use override

#

for java

#

Cannot resolve symbol 'Override'

brisk gate
#

@earnest phoenix yes. You can embed CSS.

earnest phoenix
#

Ah okey thanks I'm going to go test

brisk gate
#
<style>
  table {
    background: olive;
  }
</style>
<table>
  <tbody>
    <tr><td>col 1</td><td>col 2</td></tr>
  </tbody>
</table>
silent cloud
#

Hey guys

#

Anyone can help me, how i can EASILY create reddit refresh token

solemn leaf
#

Why do I keep getting resolve symbol errors I have no idea how to fix them

#

java

regal edge
#

Silly question, how does one show the user's nickname in the server instead of the username? message.author.displayName?

#

Im noob.

solemn leaf
#

HTat is nickname

#

that*

regal edge
#

It's giving me undefined

solemn leaf
#

show code

regal edge
#
module.exports.run = async (bot, message, args) => {
    let bruh = new Discord.MessageEmbed();
    let user = message.mentions.users.first()
        if(message.content = user) {
        bruh.setColor('#add8e6')
        bruh.setURL('https://www.youtube.com/watch?v=AH0uV-ijGy0')
        bruh.setTitle('BRUH?')
        bruh.setAuthor(`Hi Rushia, can you please say bruh to ${user.displayName}?`, bot.user.displayAvatarURL())
        bruh.setDescription(`**${user.displayName}** Rushia says bruh to you`)
        bruh.setImage('https://imgur.com/jJctIAy.gif',({dynamic: true}))
        bruh.setFooter(`${message.author.displayName}`, message.author.displayAvatarURL())
        bruh.setTimestamp();
        message.channel.send(bruh);
    } else {
        bruh.setColor('#add8e6')
        bruh.setURL('https://www.youtube.com/watch?v=AH0uV-ijGy0')
        bruh.setTitle('BRUH?')
        bruh.setAuthor('Hi Rushia, can you please say bruh?', bot.user.displayAvatarURL())
        bruh.setImage('https://imgur.com/jJctIAy.gif',({dynamic: true}))
        message.channel.send(bruh);```
solemn leaf
#

its member

#

bcs it is guild not the user

#

essage.member.displayName}

regal edge
#

Ok ill try that

#

nope.

solemn leaf
#

you're kidding right

#

read the error

#

displayName is undefined bcs message.member.author is null

#

its message.member

#

.displayName

regal edge
#

Alrighty

solemn leaf
#

does jda do webhooks?

lyric mountain
#

Used to, now it's a separate lib

#

Just search "discord jda webhooks"

#

I don't remember the exact maven lib

limpid moth
#

So I want my bot to create a variable called the user's id when they say a command into json file. How can I get it to check if the user's id is already in the json file?

pale vessel
#

You can store an array

#

and parse the file and use array.includes()

limpid moth
#

Ok ty

limpid moth
#

How can I make it so it creates a variable with the user's id?

#

Never mind I figured it out

wheat grotto
#

Ok, I'm using python to develop a bot that receives a vote. However, the docs just cover bot voting. And the webhook for on_dbl_vote returns bot_id and user_id... but not server_id..

My bot is to get dbl votes on servers not bots so how would I do this?

trim saddle
wheat grotto
#

are you talking to me or someone else?

trim saddle
#

you

wheat grotto
#

oh ok

#

thx

fierce flicker
#

Can I ask about something?

pale vessel
#

No

fierce flicker
#

Okay so bye and have a nice day

umbral zealot
earnest phoenix
#

Hey guys, I'm getting an error and my bot just crashes, there is something wrong with this code. Any idea on how to fix it?

spare goblet
#

I already told you your issue, it's that you defined discord.js as DiscordJS but then refer to a variable "Discord" in your code

#

Actually I'm not sure what your client is defined as

earnest phoenix
pale vessel
#

DBM?

earnest phoenix
#

Yeah.

pale vessel
#

Discord Bot Maker?

earnest phoenix
#

Yeah.

spare goblet
#

ight so

#

you can't put that code there

earnest phoenix
#

Yeah?

#

Oh.

#

Hold on.

spare goblet
#

you have to put it in initBot()

earnest phoenix
#

Let me get rid of it.

spare goblet
#

because thats the scope where you define your client

earnest phoenix
#

Like, in between the brackets?

spare goblet
earnest phoenix
#

Yeah.

spare goblet
#
Bot.initBot = function() {
  this.bot = new DiscordJS.Client({ blabalbalab i dont care enough to type });
  // put your setInterval() fucntion here
};```
earnest phoenix
#

This code?

#
const client = Discord.Client() // Your discord.js client

const Topgg = require('@top-gg/sdk')

const api = new Topgg.Api('Your top.gg token')

setInterval(() => {
  api.postStats({
    serverCount: client.guilds.cache.size,
  })
}, 1800000) // post every 30 minutes```
#

I'm sorry, I'm really dumb.

spare goblet
#

keep the const Topgg = and the const api = thing at the top of your code, but move the set interval thing there because thats the only scope you have client defined in

#

and remove const client = Discord.Client() because you already define your client in initBot()

earnest phoenix
#
const Topgg = require('@top-gg/sdk')

const api = new Topgg.Api('Your top.gg token')

setInterval(() => {
  api.postStats({
    serverCount: client.guilds.cache.size,
  })
}, 1800000) // post every 30 minutes```
#

Like this?

spare goblet
#

n o

earnest phoenix
#

What?

#

Dude.

spare goblet
#

don't dude me you're not being the brightest rn lmao

earnest phoenix
#

๐Ÿ˜ฆ

#

Ik.

#

I told you.

spare goblet
#

I'm literally spoonfeeding you ia_why_sob

earnest phoenix
#

I'm stupid.

#

Oh.

#

Are you able to rewrite it?

#

Please.

#

I'm so dumb.

#

๐Ÿ˜ฆ

spare goblet
earnest phoenix
#

THANK YOU

#

SO MUCH

spare goblet
#

Facepalm CM breaking rules by spoonfeeding

earnest phoenix
#

Lol.

#

I'm sorry.

spare goblet
gray bane
#

Will someone have the files for a welcome and farewell bot ???

earnest phoenix
# spare goblet <:Facepalm:773922149765349386>
Require stack:
- /home/container/bot.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:893:15)
    at Function.Module._load (internal/modules/cjs/loader.js:743:27)
    at Module.require (internal/modules/cjs/loader.js:965:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/container/bot.js:17:15)
    at Module._compile (internal/modules/cjs/loader.js:1076:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:941:32)
    at Function.Module._load (internal/modules/cjs/loader.js:782:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/container/bot.js' ]```
I got this and then it crashed.
#

Install it

#

I did.

#

Wait.

#

It didn't upload.

#

Wth.

#

Hold on.

spare goblet
gray bane
#

confused caht

spare goblet
#

?????????/

earnest phoenix
#

It keeps deleting it.

spare goblet
#

when i sent this image

#

did you delete the const Topgg line

earnest phoenix
#

I did that.

spare goblet
#

or did you delete the const client line

earnest phoenix
#

Const.

#

Client.

spare goblet
#

both of them starts with const

earnest phoenix
#

Wait.

spare goblet
#

did you delete the const Topgg line

#

๐Ÿ‘๏ธ

earnest phoenix
#

No.

spare goblet
#

okay send your code

earnest phoenix
#

You're using discord bot maker?

#

๐Ÿ—ฟ

#

Yeah.

spare goblet
#

yikes you included your token

earnest phoenix
#

Sorry.

spare goblet
#

LMAO

earnest phoenix
#

I'm stupid.

#

Ik.

spare goblet
#

pls scroll below

#

so i can see the rst of your code

earnest phoenix
#

Hold on.

spare goblet
#

also please install the module top-gg/sdk

#

you haven't instaleld it in ur node modules

earnest phoenix
#

I have.

#

But my hosting service keeps deleting it.

#

Whenever I start the bot.

spare goblet
#

my lord

#

you cannot even follow my spoonfeeding instructions

earnest phoenix
#

What did I do wrong now?

gray bane
#

How can I activate a bot from visual studio?

earnest phoenix
#

I'm sorry for my stupidity.

#

Iara, that's what happens when you spoon-feed a user who uses discord bot makers

spare goblet
earnest phoenix
#

Daily stuff in development

spare goblet
#

cries

gray bane
#

How can I activate a bot from visual studio?

earnest phoenix
#

OH

spare goblet
#

-faq 13

gilded plankBOT
spare goblet
#

the rest of your issue is becauase top-gg/sdk is NOT installed

#

your error basically says

#

"hi top-gg/sdk isn't installed plz install and retry"

earnest phoenix
spare goblet
#

that indentation is gross but yes

earnest phoenix
#

I'm pretty sure discord bot maker doesn't allow other packages to be installed

#

Its correct?

spare goblet
#

oh

#

LMAOO

#

bearieLOLpoint well that's your problem

earnest phoenix
#

๐Ÿ˜ฆ

#

NO

#

F

#

F

spare goblet
#

time to move out of dbm

earnest phoenix
#

F

spare goblet
#

stop spamming

earnest phoenix
#

Sorry.

spare goblet
#

i just spent 20 mins helping you to know that dbm is the stupidity

#

spoonfeeding you *

pale vessel
#

But you have Discord.js, why use DBM? amandathink

earnest phoenix
#

Never use DBM nor BDFD

#

I guess there is no way to do this then.

pale vessel
#

Your hosting has a console

earnest phoenix
pale vessel
#

Oh

#

Well then

earnest phoenix
#

I guess your only way of doing this is to not use DBM

lyric mountain
#

People say adam and eve were kicked out of eden because they ate the forbidden fruit.

That's untrue, they were kicked because they used dbd/dbm

earnest phoenix
#

Code it yourself

lyric mountain
#

Bot makers are the root of all evil

spare goblet
#

just don't use dbm

magic bough
#

Probably stupid question: In the Rules-Info channel, they say that the bot has to function under permissions=0. Am I good to assume that the bot doesn't need to fully function, just be able to communicate / not be a complete brick with default perms? That seems logical, but I figured I should check lol

spare goblet
#

yes

#

baiscally yes

#

so if it doesnt have the perms your bot should be like

#

yo give me kick perms

magic bough
#

"Yo, shits fucked bro"

lyric mountain
#

It needs to fully function or ask for required perms

spare goblet
#

or yo give me ban perms

magic bough
#

Yeah, lovely lol

spare goblet
#

it shouldn't ask for admin perms or perms it shouldn't need for that command tho

lyric mountain
#

Like, if they try to use kick command without kick perm you must ask that perm

magic bough
#

^^Exactly. For the scope of my bot, I really just deal with embed & reaction based perms, but I've already got some handling in place for that. Just making sure things are up to some degree of snuff before I throw it at the top.gg reviewers

#

thanks guys!

spare goblet
lyric mountain
#

Kudos for caring about reviewers

magic bough
#

Heh, something like that. Tbh respect for top.gg/whoever worked on the entry requirements explicitly rejecting bots that don't have a certain level of effort put into them

spare goblet
#

we have strict rules, but we're not unreasonable

#

iara_hairflip_queen thanks

#

jk im not the only one that does guidelines stuff

#

lmao

magic bough
#

^^ Entirely understandable, like I respect every single one of them honestly. Gives me a slight bit more confidence in bots from y'alls listings.

lyric mountain
#

It's actually easy to pass approval, many other bot lists have way more rigid rules

#

Tbf, top.gg's approval rate is only low because "bot was offline" dudes

magic bough
#

I mean I'd figure, but honestly the reqs even existing in the first place is a bit surprising to me

#

Lmfaooo, that's hilarious

spare goblet
#

we approve 20-30% of queue iara_thisisfine

lyric mountain
#

Would be 70-80% without offline bots

spare goblet
#

it's not that bad iara_pout_angry, people are just stupid

#

for a lil while ye, back when queue was like 8k

#

now it's steadily faster

magic bough
#

I'd assume 'people' has a subtext of "substantial amount of younger kids"

lyric mountain
#

Not wanting to discriminate, but forbidding turkish bots was a wise move

magic bough
#

Was there a legitimate problem with Turkish bots being exceptionally poor en masse?

#

That sounds oddly hilarious

spare goblet
#

we can't forbid turkish bots because literally half of queue is turkish bots

lyric mountain
#

Yep, they for some reason just mass-produced copypaste bots

spare goblet
#

we just spent more effort + resources on trying to find clones, tracking clones, and searching for turkish staff

earnest phoenix
#

Turkish botums, copy pasted, offline or has the entire npm registry installed

magic bough
#

the fucking storage space

#

christ

lyric mountain
#

Don't forget nekos.life

spare goblet
#

forbidding a language to me doesn't sound right

magic bough
#

Sh-
Should I ask about nekos life?

#

the uh

spare goblet
#

and this is someone that's tested thousands and thousands of turkish pain

earnest phoenix
#

Nekos life is basically not allowed

magic bough
#

google results are... intriguing?

lyric mountain
#

It's an image api

earnest phoenix
#

It can return nsfw images of lolis and shotas

lyric mountain
#

But it has pedo tendencies

earnest phoenix
#

Basically minors which is not allowed

magic bough
#

Ah. I see

spare goblet
magic bough
#

What a wonderful platform we reside on

lyric mountain
#

You've seem nothing

#

May I mention the time when we met capitalist jesus?

magic bough
#

Oh, I've said nothing contrary

#

LMAO WHAT

earnest phoenix
#

Capitalist je(sus)

magic bough
#

Please, please oh dear enlighten me

lyric mountain
#

Basically a dude that self-declared being the messiah and demanded money

#

Was a fun day

earnest phoenix
#

Usual thing on dbl

mellow kelp
#

wait did that actually happen

magic bough
#

I-
I see.

mellow kelp
magic bough
#

god bless you gentlemen

#

or gentlewomen

#

or uh

#

gentlethem?

lyric mountain
magic bough
#

Gentleall

mellow kelp
#

top.gg sure is an interesting place

lyric mountain
#

Was about 4-5 months ago iirc

#

Mod logs had it

earnest phoenix
#

Bro, like almost anything happened here

#

Not even surprising KEKW

magic bough
#

Have you guys ever like, wanted to dig in and find the root source of the turkish spam? Like, whether it's just one guy with way too much time on his hands somehow spamming garbage bots with shell accounts, or maybe some turkish youtuber somewhere promoting some kind of discord bot ponzi scheme?

earnest phoenix
#

Basically, 3 words

magic bough
#

Because there's no way that just, out of some freak coincidence, turkish discord users all decided to make godawful code abominations to spam your website with, en masse. Right?

earnest phoenix
#

Scuffed YouTube tutorials

lyric mountain
#

Yeah, youtube, stack and github

mellow kelp
#

the internet has a really darn interesting influence

magic bough
#

^^^^
I mean, it's entirely believable. Just very, very interesting that it caught on so disproportionately hard with a Turkish audience.

lyric mountain
#

The issue is that people don't generally understand that coding isn't about writing code but understanding what you're doing

#

So they just copypaste

mellow kelp
#

fax

magic bough
#

Amen

lyric mountain
#

Then proceed to ask spoonfeed in this channel

earnest phoenix
#

Most of them don't know english much so they just refuse to either read the documentation or the guide, so they decide to watch scuffed and outdated YouTube tutorials

#

Just following what they do

night coral
#

Hey how to set up dank sale item in my server say pls

mellow kelp
#

what?

lyric mountain
#

Dank memer?

earnest phoenix
#

And at the end of the day, their package.json file is like 1 billion lines

night coral
#

Dank sale items

lyric mountain
#

Is it a bot?

night coral
#

No

#

How to set that sale items of dank memer inventory

sudden geyser
#

Low hanging fruit

lyric mountain
#

You could ask in their support server

earnest phoenix
#

This isn't Dank Memer support server

mellow kelp
#

this server isn't for that

lyric mountain
#

Idk if anyone here would be able to answer

magic bough
#

Wish I could =P

lyric mountain
magic bough
#

@night coral If you don't have/can't find there support server, you can find it at this link. Someone there should be able to help you leagues better than any of us can.
https://discord.com/invite/meme

spare goblet
#

they have servers where they mass send out the bot codes around

#

some as a vote perk

summer torrent
#

yeah

earnest phoenix
#

the period when the verified badge was around was absolutely the worst for everyone

#

Tukish devs just rushed and copy pasting code just to make bots to get the badge

#

It was just basically hell

magic bough
#

That's... wild lmfao. I guess just about anything is possible on this god-abandoned pile of fiberoptics & copper

#

Like, hilarious, but also just wack as heck. What dungeonmaster of a god thought side-story up

earnest phoenix
#

Anything is possible in dev universe KEKW

magic bough
#

Hmm. In a complete change of topic, does anyone have any cute/self deprecating splash text ideas for my info cmd shard-counter?

earnest phoenix
#

github

i use mediafire

magic bough
#

Gold

odd stratus
#

Anyone know how to move a PostgreSQL database to a different server but still keep all the same data

earnest phoenix
#

do it within your code

#

get all values from one database

#

transfer it to another

#

postgres has a way to do this without code i think

odd stratus
#

I'm trying to do it with pgAdmin

#

Aka the GUI

earnest phoenix
#

you can use pg_dump

#

have no idea how to do it via the ui

#

What was the Server Name Field Code?

#

Javascript lib

#

what

gilded olive
#

I think he's talking about getting the name of a guild using javascript in an embed

pearl trail
# magic bough

i use process.env.SHARD_COUNT and it's working well. Maybe you can try it

delicate zephyr
#

can you use actual code blocks so we can read it

#

```py

```

#

like this

earnest phoenix
#

It's python

delicate zephyr
#

yea

#

use py then

earnest phoenix
#

Ok

earnest phoenix
#

hi

#

i need help

#

with my invite checker

#

can someone help

#

lol

earnest phoenix
#

alright

zenith terrace
smoky thorn
#

can someone help with a coding error

earnest phoenix
#

`def get_prefix(client, message): #first we define get_prefix
with open('prefixes.json', 'r') as f: #we open and read the prefixes.json, assuming it's in the same file
prefixes = json.load(f) #load the json as prefixes
return prefixes[str(message.guild.id)] #recieve the prefix for the guild id given

client = commands.Bot(
command_prefix= (get_prefix),
)`

what i need to change ?

smoky thorn
#

I can't find anything online

#

why is your command prefix on the bottom

#

That should prob be on the top g

#

the client part is also in the wrong spot g

earnest phoenix
#

๐Ÿค”

smoky thorn
#

Ugh

#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'to_dict'

#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'to_dict'

#

it's like

earnest phoenix
#

oh

smoky thorn
#

"str has no attribute to 'to_dict'

#

wtf

earnest phoenix
#

what did you do? did you pass a string to embed kwarg or something

smoky thorn
#

Yeah

#

embed

smoky thorn
#

I can send you me code

#

my*

#

just like edit out the parts that have the token and my WIP website

earnest phoenix
#

just pass an actual Embed object doe

smoky thorn
#

k

#

I'll send the code that has the issues

slender thistle
#

derp

next valley
#

hi

earnest phoenix
smoky thorn
#

hm

#

lemme try to redo the command thing

#

brb

#

I seem to have just changed the code to a working code LOL

smoky thorn
#

not what i'm tryna achience tho

#

achieve*

earnest phoenix
#

And I'm now only coding my bot bot giving anyone to invite ๐Ÿ˜‚

#

You'd better cache the prefixes in memory though, so you don't read the json multiple times. Actually, just use an actual db.

smoky thorn
slender thistle
#

CACHE AND PROPER DATABASE PLEASE

smoky thorn
#

The code circled is the one giving issues

slender thistle
#

Don't put embed in a strong

#

string

earnest phoenix
smoky thorn
#

it was working fine like

#

an hour or so agao

#

ago*

slender thistle
#

You need to reference a variable embed

#

Not a string that says "embed"

zenith terrace
earnest phoenix
#

return prefixes.get(str(message.guild.id), default_prefix) will fix your issue, but please just use an actual db.

smoky thorn
#

Someone sent me that

zenith terrace
#

300gbddos

rustic nova
smoky thorn
#

it's a token logger lmao

#

I spammed his webhook so

#

anyway

rustic nova
smoky thorn
#

I'm kinda a python newbie in this stuff

#

where do I edit my code

#

exactly

#

Lol

#

Like which string

earnest phoenix
#

Learn python lol

smoky thorn
#

..

#

I'm learning as I go g

#

I've made most of this bot off memory

#

some I got some hep

#

help*

#

but that's all lol

#

but yeah @slender thistle Idk like

#

which line I'm editting

#

I assume the 2nd to last?

slender thistle
#

Learning basics on the go

smoky thorn
#

yeah

#

pretty much

slender thistle
#

๐Ÿ˜ฉ

smoky thorn
#

Bro?

#

So I have author, then what

#

it's not supposed to be "embed = 'embed'

#

correct?

slender thistle
#

Yes it's not

smoky thorn
#

then I just put "embed"?

#

not "embed="?

zenith terrace
#

does Colour even work on python when making an embed

smoky thorn
#

Yeah

#

it does

slender thistle
#

Yes

smoky thorn
#

I had it change the embed color

slender thistle
#

Both color and colour work

smoky thorn
#

Oh

#

I thought it was just colour

#

lol

pale vessel
#

bri'ish

zenith terrace
#

JavaScript devs are gay then for only making color work sad

earnest phoenix
#

๐Ÿฅบ

#

huh? Just RTFD

zenith terrace
pale vessel
slender thistle
smoky thorn
#

so like

#

it's just embed

#

not embed =

#

?

slender thistle
#

So like how do you refer to a variable

smoky thorn
#

I'm retarded so

slender thistle
#

Do you know a difference between a string and a variable

#

And how they work

smoky thorn
#

yes

#

variables are things like "x" and shit

#

Strings are lines of code

slender thistle
#

i-

smoky thorn
#

stfu

slender thistle
#

@earnest phoenix give me a hug before I go crazy

smoky thorn
#

idc if I don't know variables vs strings g

#

I'm tired asf

smoky thorn
#

it's almost 1 AM and I'm working this bot

slender thistle
#

You should care if you're working in Python

earnest phoenix
#

what the fawk ๐Ÿค 

zenith terrace
#

hey cry

#

๐Ÿ‘‹

slender thistle
#

Strings are text, variables are keyword names that are used to refer to stored stuff in memory

smoky thorn
#

I was close

#

sorta kinda not really

slender thistle
#

you have a variable embed that you need to pass to embed=

smoky thorn
#

mhm

#

then what

slender thistle
#

Instead, you are passing a STRING that says 'embed'

smoky thorn
#

Ohh

#

NO WONDER IT DIDN'T

#

k ty

#

YESSS

#

THANK FUCKING GOT

edgy valve
#

yo is this the discord for the bot that creates tradingview charts?

smoky thorn
#

GOD*

#

k ty @slender thistle

smoky thorn
#

I don't have to go crazy tryna figure out some bullshit error the internet can't fix ๐Ÿ™‚

earnest phoenix
#

actually my full code for custom prefix is :

slender thistle
#

Eh I mean

smoky thorn
#

Jesus

#

Fuck

#

You could've like

slender thistle
#

It's very basic stuff if you think about it

smoky thorn
#

sent that in a .txt

earnest phoenix
#

there really needs to be a rule about binning code

smoky thorn
#

yeah

slender thistle
#

@earnest phoenix I think you were already told about codeblocks

earnest phoenix
#

ya

#

ohk bye

slender thistle
#

People here are amazing

earnest phoenix
#

noice

#

if you read the source code, you'll find many things that aren't documented

solemn jolt
#
message.member.roles.cache.forEach(R=>{
  message.member.roles.remove(R)
})```
I now this code well be work but how I can write a code If bot can't remove member role return for nothing
zenith terrace
#

check the bots position ?

solemn jolt
zenith terrace
#

check. bot. position

solemn jolt
earnest phoenix
#

forEach ๐Ÿคข

solemn jolt
#

I don't like a .map

earnest phoenix
#

who says you have to use map

#

map is for mapping values

#

use for...of

solemn jolt
#

How?

earnest phoenix
zenith terrace
#

never heard of that before lol

earnest phoenix
#

a fancy for loop

zenith terrace
#

oh wait

earnest phoenix
#

does the indexing for you

zenith terrace
#

I think I have

earnest phoenix
#

anyway

#

in order to see if you can modify the user

solemn jolt
#

Thank you for this

earnest phoenix
#

also

solemn jolt
#

Ok

earnest phoenix
#

your code will try to remove the everyone role

#

(you can't, it will error out)

#

so check if the role id is the same as the guild id

#

if it is, continue

solemn jolt
#

How I can check just you can give me an example by code

earnest phoenix
#

take a guess

solemn jolt
#
message.member.roles.cache.forEach(R=>{
  message.member.roles.remove(R)
})

Check this

earnest phoenix
#

no, i asked you to take a guess on how to do that comparison

#

it's really simple and logical

#

if you're wrong, i'll help you get to the right thing

solemn jolt
#
let member = message.guild.members.get(args[0])
if (!member) return;

In here i wanna add code if the bot can't remove member role just return 

member.roles.cache.forEach(R=>{
  member.roles.remove(R)
})
earnest phoenix
#

you aren't reading anything i'm saying

solemn jolt
#

I don't now how I can take a guess

pale vessel
earnest phoenix
#

don't know ๐Ÿ™„