#development

1 messages ยท Page 1647 of 1

opal plank
#

all in one bots usually flunk

#

the way to grow is to be specific in an area

tired panther
#

lol, what does your bot do?

opal plank
#

theres WAY too many multi purpose bots

vivid fulcrum
#

this tbh

#

the whole community is so oversaturated

opal plank
#

^^

opal plank
#

clears throat

#

so, my bot is using detritus...

tired panther
cinder patio
#

The recursive descent parser for my programming language written in JS is coming along nicely.

tired panther
vivid fulcrum
lyric mountain
opal plank
#

typescript, postgres, redis and detritus.
im always talking about either one of those

tired panther
opal plank
#

ts bae tho

vivid fulcrum
#

yes

#

i love ts because it supports latest es

opal plank
#

^^

vivid fulcrum
#

and experimental es features

opal plank
#

typeguarding pog too

#

funfact

vivid fulcrum
#

and you don't have to even worry about browser compatibility because it's transpiled to the es version you define

opal plank
#

ts usually has stuff before node even releases it

#

conditional chain was in ts before it was in node

opal plank
#

see? cry gets it

#

i just need someone who understands me on that level, but on detritus

#

for postgres i have xetera

#

for grafana i have zorotic

#

for ts we got a couple here

#

but i got no one to flex detritus with

lyric mountain
#

me too, psql is superior

opal plank
lyric mountain
#

although I'm a sqlite boy

#

instead of redis

opal plank
#

i prefer cutting/putting jam on my bread with a chainsaw tho

#

overkill tools for the right job

lyric mountain
#

you're american aren't u?

opal plank
#

im not lul

vivid fulcrum
#

i recently migrated our school's account system from ms access to postgres

opal plank
#

even though i had plenty of peanuyt butter jelly in canada

lyric mountain
#

weird, because for america overkill is the only kill

opal plank
#

๐Ÿ‘€

#

shots fired

lyric mountain
#

access...

vivid fulcrum
#

site loading (ssr'd) went from ~860ms to ~120ms

opal plank
#

ba-dum-ts

lyric mountain
#

who tf ever uses access?

vivid fulcrum
#

our government ๐Ÿ˜”

opal plank
#

cry fbi agente

tired panther
vivid fulcrum
#

every government-issued school site runs on a 2008 forum engine with like 128mb ram

cinder patio
#

Cry where are you from

vivid fulcrum
#

you can crash the site by doing ```js
while(true) fetch('url');

#

croatia

cinder patio
#

cool

#

I'm also from the Balkans

stone anchor
#

Do the yoinky spoiky

#

Now

vivid fulcrum
#

what

#

oh

#

you're using markdown blockquotes

tired panther
vivid fulcrum
#

ours dont lmfao

#

not protected by cloudflare

#

nor a reverse proxy

#

nor anything for that matter

vivid fulcrum
lyric mountain
vivid fulcrum
#

good point

lyric mountain
#

schools are weird, especially universities

#

like

#

they teach you that innovation is the key in any business

#

yet they use the most deprecated or outdated software as possible

cinder patio
#

Ours is probably not protected either, but I don't have access to any of the school's servers sadly

opal plank
#

and their computers are those white blocky machines from the 2000's

vivid fulcrum
#

it's both funny and embarassing when they're supposed to educate you about security but they don't implement security in the first place ๐Ÿงโ€โ™‚๏ธ

opal plank
#

in fairness

lyric mountain
opal plank
#

who would attack a uni?

lyric mountain
#

CS university

#

blocking ubuntu

opal plank
#

best you can do is change your own grades

lyric mountain
#

yet we had ubuntu classes on our 2nd year

#

don't need to point that our teacher had to undergo a bureucracy to free ubuntu site

cinder patio
#

Our grades aren't even stored in a database owned by our school

earnest phoenix
#
<iframe src="https://sites.google.com/view/narutoryo/home?authuser=1" width="80%" height="80%"></iframe>```
can a google site bot website work for this?
opal plank
vivid fulcrum
#

fun fact, when online classes started due to the pandemic last year, our whole school authentication system (that goes through the government) crashed, nobody in the entire country could log in

classes where postponed for a week and in the end they blamed "hackers"... but it was just their shitty servers

opal plank
#

in paper

earnest phoenix
#

k

lyric mountain
#

just make sure not to have iframe blocking stuff

#

like google does

earnest phoenix
#

okay

#

k ill make a bot website using google sites rn

lyric mountain
#

welcome to brazil

opal plank
#

brazilian/russian difficulty comes after hardcore mode

#

gotta beat it twice on hardcore to unlock it

lyric mountain
#

brazil is gta online, russia is tarkov

vivid fulcrum
#

you convinced me that croatia is relatively ok as a second world country ๐Ÿ‘๏ธ ๐Ÿ‘„ ๐Ÿ‘๏ธ

opal plank
#

good comparison

lyric mountain
#

here people fly on you in bikes and steal ur money

vivid fulcrum
#

enter a new extra line between each one

opal plank
#

ah yes english

vivid fulcrum
#

so you get this

jade saddle
#

for getting multiple outputs out of a single function, I should use lists right?

vivid fulcrum
#

in what context

jade saddle
vivid fulcrum
#

sure thing then

#

if you can, use an array instead

#

less allocation over the board

fierce ether
#

if its true set to false if false set to true, can i use this method or no?js true ? false : true

vivid fulcrum
#

what

#

why not just invert the bool

#

!

cinder patio
#

lol

quartz kindle
#

a = !!!!!!!!!!!!!!!!!a

earnest phoenix
#

doesn't give error just doesn't work

vivid fulcrum
#

debug it

quartz kindle
#
function randomBool() {
  let bool;
  return eval(`${"!".repeat(Math.round(Math.random() * 100))}bool`)
}
vivid fulcrum
#

cursed

dire obsidian
#

should i stay with normal js or learn ts?

earnest phoenix
vivid fulcrum
#

hi confusion, i'm cry

#

anyway

#

i told you to debug it

#

we're not computers, we can't run your code on the go

#

trial and error baby

#

gradually fix your code

earnest phoenix
#

baby๐Ÿ˜ซ

sudden geyser
# dire obsidian should i stay with normal js or learn ts?

Try some TypeScript and see if you want to use it. Personally, I'd use another language that supports strong typing and other features natively (since TS is just safe JS compiling down to JS), but if you want interpolation with JS, sure.

dire obsidian
#

k thanks

noble plinth
#

whats the mongodb nested dict limit?

#

please answer

fierce ether
#

what do i use to skip the gap?

jade saddle
fierce ether
#

i seen a way so it carrys on

#

so theres no gap inbetween

opal plank
#
let a = !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!true```
#

time to write a 40k line file with that

formal tusk
#

What way would you say is the best for making a DB for your bot?

vivid fulcrum
#

you probably shouldn't make one but rather use one

#

which one? depends on your use case

jovial elk
#

Hello everyone, does anyone knows if there a fix for unicode emoji display being weird when using unicode? as you can see in the screen shot, the โžก๏ธ displays correctly in the reaction but not in the embed

vivid fulcrum
#

the footer doesn't support emojis

jovial elk
#

oh i see, thanks!

vivid fulcrum
lament rock
vivid fulcrum
#

i just tried it

#

it doesn't work

#

give me a sec

lament rock
#

does embed image fields even support svgs

vivid fulcrum
#

nope

#

i don't think discord supports rendering svgs from a url at all

#

anyway

#

that should definitely work

unreal estuary
#

not really discord related

#

but whats a good start for game development

lament rock
#

Learning C# for Unity or whatever language Unreal Engine uses depending on your engine preferences

vivid fulcrum
#

it really depends whether you want to do 2d or 3d

#

as the difficulty varies a lot

unreal estuary
unreal estuary
vivid fulcrum
#

with blazor

lament rock
#

Sounds jank

vivid fulcrum
#

it is

#

here's a webseries that was shared in the c# guild https://www.youtube.com/watch?v=wTmZCu16LNU

Build a web application without JavaScript! In this tutorial series, we will build the game "Flappy Bird" using C# with Blazor WebAssembly!

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡

๐Ÿ‘‹ Hi, I'm Erin. My goal is to help bridge the gap between "learning" and "doing" by building demo applications that are fun and interesting while also demonstrating important concepts within C# and ....

โ–ถ Play video
unreal estuary
#

thanks

vivid fulcrum
#

you should probably just use js though

lament rock
#

Honestly, if you're gonna make html games, just learn js

vivid fulcrum
#

if you want to do browser games

#

^^

unreal estuary
#

yeah im familiar with js

#

thats probably best

lament rock
#

Then there you go. Maybe some socket based games if wanting to make online or just generic single player. I'm personally a fan of games such as agar.io or diep.io

They're simple in design and keep attracting players

unreal estuary
earnest phoenix
#

how do I debig

#

debug

lament rock
#

It depends on what the issue is.

For instance, If something isn't what it's supposed to be;
you should log the value of variables around where an error occurs then use that info to deduce where the logical error occured. Stepping back into code execution further if you find nothing useful

opal plank
opal plank
#

console log should be using for logging, not debugging

#

it can be used for logs, but good practices would lead you to have a different app for testing, and one for production

#

use sentry for production or debugger for local branches

lament rock
#

You should already have different envs for prod and testing

opal plank
#

indeed, but my point stands, its bad practice to use console log for debugging

#

once you learn how to properly use breakpoints and conditional breakpoints, you'll ditch console logging as a means for debugging

lament rock
#

Perhaps my practices are rather primitive compared to what vsc has to offer, but it is still a basic means to debugging since not all editors are built equally.

opal plank
#

instead of

client.on('message', message => {
  if(message.author.bot) console.log(message);
});

do

#

or use a logpoint if you always want a value

#

but in the example above you can set conditional breakpoints that'll only trigger on specific values

#

instead of having to change your code for the sake of debugging

opal plank
#

not really related to vsc specifically

#

the way you debug code is exposing a debugging port to it

#

it might be a bit too sofisticated, you're right, for someone new its best to use console.log() by a mile, simply because its easy to understand, but its not proper debugging

#

when offered tools, one should likely use them

proven lantern
#

dont use console.error for errors

opal plank
#

indeed, use process.exit(error)

#

||im clearly joking, dont do that||

proven lantern
#

i thought console.error was for logging errors so i was doing that in my catch statement and it kept crashing my project

opal plank
proven lantern
#

not even logging them

#

pro

opal plank
#

cant log errors if they dont exist

proven lantern
#

๐Ÿ™ˆ

opal plank
earnest phoenix
#

code

opal plank
#

what code?

opal plank
# earnest phoenix code

i dont see any code
notepad
notepad++
vim
atom
sublime
vsc

those are the only ones im aware of

#

oh, and neovim

#

i guess nano fits there too as an editor

#

but yeah, no code

opal plank
earnest phoenix
#

dms

#

I'm gonna get hate

opal plank
#

keep it here

earnest phoenix
#

def not

opal plank
#

good luck then

lyric mountain
opal plank
lyric mountain
#

Weren't you going to take courses?

opal plank
#

my dms are only for business , friends or regarding stuff im developing or developed

#

such as bugs or something

onyx hare
#

i cant find anythignon google for a basic send a pre-made message to all guilds like a simple "Bot Going Offline - UPDATE"

opal plank
#

have your guilds set an announcement channel for that

lyric mountain
#

Either use announcements channel or ask your users to setup a webhook

sturdy dock
#

what's the most efficient way to make a menu with reactions to switch pages? reactioncollector?

earnest phoenix
#

if i do like (f'welcome {user.mention}') with that make it so it pings them

lyric mountain
sturdy dock
lyric mountain
#

Don't think so

#

Unless you can convert a java code to javascript

#

The problem with collectors is that they create a new listener for each collector created

#

Even if they're short lived

#

That said, you asked for the MOST EFFICIENT way, not for the MOST SIMPLE

sturdy dock
#

haha alright

#

i think i can take care of the map part, it's just figuring out the events

#

what would be the "simplest" or most conventional way though?

lyric mountain
#

Collectors

sturdy dock
#

i see

lyric mountain
#

The maps would actually be string-array pairs

#

The key being message id

#

And the array containing object with emote names and functions

#

So the event checks if the message id is in the map, then checks if the reaction emote is in the array

#

If it is, execute the function

sturdy dock
#

ahh

#

i see

#

yeah i have to read up on how the reaction events work first

lyric mountain
#

It's like with message events

#

But returns reactions instead of messages

solemn leaf
#

i18n

#

@earnest phoenix welcome back

earnest phoenix
#

nah I was just messing around

#

ik the line for it just wanted to make sure I wasn't tripping

lyric mountain
solemn leaf
#

lol

#

youll be tripping until you take the time to learn what you are doing

bitter badger
#

Is there a simple way to make a channel joinable for a role and then re-lock it?

#

Or do I have to do channel#overwritePermissions twice?

lyric mountain
#

Even if the person joins before you hide it, he/she'll not be able to read it anyway

earnest phoenix
#

guild.member() returns null when the user is in the server

bitter badger
#

It's voice

lyric mountain
#

Same for voice

earnest phoenix
#

why is this happening

lyric mountain
#

He'll be kicked from it

bitter badger
#

I'm not hiding it though. Just making it joinable

lyric mountain
#

Actually, guild.member() doesn't exists

#

Didn't u mean guild.members?

earnest phoenix
#

it does when i run for myself

lyric mountain
earnest phoenix
lyric mountain
#

Just add a user perm override if u want to allow only a specific person join

bitter badger
#

I need a role to be able to join though

lyric mountain
#

No

#

You can add user overrides

bitter badger
#

If I do voice.join they can be moved and can stay in

lyric mountain
#

Like, the same as you do with roles

#

Because if you pull someone onto a channel it's a different kind of join

lyric mountain
#

Also, I'm pretty sure you need to do guild.members.cache(id)

earnest phoenix
#

theres only two users that exist in the server

lyric mountain
#

The way you're doing is getting the author of the message, you can't pass an id to it

earnest phoenix
#

when the member count is like 50

lyric mountain
#

Cache

#

You'll almost never have all members cached

old cliff
quaint wasp
#

guys

#

I got this

#
const Discord = require('discord.js')

module.exports = {
    name: 'report',
    execute: async (client, message, args) => {

        const myID = '717526789882380338'
        var lockedList = ['717526789882380338', ''];

                const person = message.author.username
                const userID = message.author.id
        
                if (userID == lockedList) {
                    return message.channel.send('***You have abused this feature before and as such have been put on a blacklist***')
                } else { //ect.. }```
#

and when I put locked id in..

#

and the locked id trys to run command

earnest phoenix
quaint wasp
#

it just acts like the part isnt there

bitter badger
earnest phoenix
#

I just tried and I wasn't kicked, unless I missed something

#

If you really want to reduce the request, ig you can move the member from an open channel instead

bitter badger
#

I'm currently doing that but trying to change it to make it easier for users

lyric mountain
#

UserID == lockedList

#

How do you compare a person to a building?

quaint wasp
#

idk

#

should it be.. ===?

bitter badger
#

He's saying do lockedList.includes(id) or something similar

quaint wasp
#

I dont think so..

lyric mountain
#

How do you still compare a person to a building?

quaint wasp
#

oh

#

ok

lyric mountain
#

=== is "equals to"

quaint wasp
#

oh

#

so it IS ===

lyric mountain
#

== too but this one is less specific

#

No

bitter badger
#

A single Id will never equal an entire list of Ids

quaint wasp
#

oh..

lyric mountain
#

Userid DOES NOT EQUALS to lockedlist

#

Lockedlist is a list

#

Userid is an id

quaint wasp
#

yes..

bitter badger
#

You could make it quicker if the list gets big and use a set instead

quaint wasp
#

what u told me?

#

lockedList.includes(id)

#

?

lyric mountain
#

Will throw "id is not defined" tho

bitter badger
#

Well yeah. Don't user id

lyric mountain
#

Adapt. Overcome. Thrive

bitter badger
quaint wasp
#

well that work if I do const lockedList = ["", ""] if (lockedList.includes(lockedList)) { }

lyric mountain
#

Oh my dog

earnest phoenix
#

lmao

#

ree

lyric mountain
#

A building that contains itself

#

@earnest phoenix see?

#

That's what I didn't want u to turn into

quaint wasp
earnest phoenix
#

no i just wanted say ree

#

cause i got a noto

bitter badger
#

Quick update, you can use overwrite permissions to allow users to connect and then deny the permission again.

#

It doesn't kick

vestal stirrup
#

wee

solemn latch
#

woo

terse finch
#

in the discord.py rewrite is there a method or event for a user boosting the server?

terse finch
#

thanks

#

is there an event trigger for it?

#

i want when a user boosts, to give them a custom role

latent heron
#

you could do this:

@bot.event
async def on_guild_update(before, after):
  if (some condition here) in after.guild.premium_subscribers:
    print("found")
earnest phoenix
#

you can just listen to member update event ig

fervent hull
#

can i get help for herkou hosting?

#

pls

#

i am having issues hosting my bot

blissful coral
#

Yes

#

Don't use it

fervent hull
#

bruh

#

nice help

blissful coral
#

Heroku is a really bad option

fervent hull
#

i cant do paid hosting

#

can ya help or not

#

???

blissful coral
nimble kiln
#

If you can't do paid hosting you shouldnt do it at all

blissful coral
#

yeah

#

lol

fervent hull
#

i wish i can curse

nimble kiln
#

like "fuck you"?

fervent hull
#

๐Ÿฅฑ

#

idc

#

you people just cant help

blissful coral
#

I literally...

#

Linked you...

#

A guide to how to do it...

nimble kiln
#

Yeah idk what your problem is, we answered your questions with what we believe is right

blissful coral
nimble kiln
#

And Extreme even posted you that guide

fervent hull
#

no need of you help

#

got it from someone

earnest phoenix
#

damn

proven lantern
fervent hull
#

and also idk what is aws

#

what is it

proven lantern
#

Amazon web services.

#

I think every vps service is going to require a credit card just to prevent hackers from creating bot nets

proven lantern
#

Heroku isn't a vps

solemn latch
#

he already got support, poor guy keeps getting tagged after he got support ๐Ÿ‘€

earnest phoenix
#

guys

#

can someone help me pls

sudden geyser
#

Itโ€™s probably not in the correct scope of usage

earnest phoenix
#

its in the message event

#

but i cant put it in the guildmemberadd event cause then it says "message is not defined"

sacred aurora
sacred aurora
#

and change the message to member

#

maybe tho

earnest phoenix
earnest phoenix
sacred aurora
#

Bruh

#

Did u need that welcome message for all command?

#

why u put it on the message event

#

not move then

earnest phoenix
earnest phoenix
sacred aurora
#

On the memberadd event

earnest phoenix
sacred aurora
#

not the message event okay

earnest phoenix
near stratus
#

How do I say if the given text is a youtube link ?
(I don't do regex)

obtuse jolt
#

use regex

near stratus
obtuse jolt
obtuse jolt
bold orbit
nimble kiln
#

Great, another botghost bot

obtuse jolt
#

Then you use like

let regex = "put the regex here"
"text".match(regex) 

or 

let text = "yes"
text.match(regex)```
@near stratus
#

and it gives true or false

tired panther
#

Does anyone know a good api for random cats?

unreal estuary
#

or margarine

obtuse jolt
tired panther
obtuse jolt
#

http get?

obtuse jolt
obtuse jolt
#

Whatโ€™s wrong with get? Do you have a person hatred? Because Iโ€™m sure your browser wouldnโ€™t agree with that idea

obtuse jolt
#

having a discord bot costs bandwidth

#

all you have to do is get the url of the image, browsing the web on your pc uses more bandwidth then doing that, the node module I sent you will do that

old cliff
#

yo why is my old rpc code not working?

grizzled raven
#

make sure the code is running on your pc

old cliff
#

frick

#

my game activity was off

shell void
#

Anyone else here use repl.it for their bot? Or just me ๐Ÿ˜…

nimble kiln
#

Too many people use it for their bots, unfortunately

tired panther
#

lol

tired panther
shell void
#

Oh fair.

#

Ive managed to find my way around it pretty good

earnest phoenix
#

Hey

#
const Discord = require('discord.js');
const db = require('quick.db')
const { defaultPrefix, deletionTimeout, reactionError, suggestionPending, suggestionApprove, suggestionDecline } = require('../../config.json');

module.exports = async (client, oldMessage, newMessage) => {
    let data = db.get(`msglogssynapse_${message.guild.id}`)
    if(oldMessage.partial) await oldMessage.fetch()
    const logsmessageupdate = oldMessage.guild.channels.cache.find(channel => channel.id === data)
    if (!logsmessageupdate) return;
    const embed = new Discord.MessageEmbed()
        .setColor("RANDOM")
        .setTitle(`Un message a รฉtรฉ modifiรฉ !`)
        .addField(`Membre :`, `${newMessage.author}`)
        .addField(`Ancien message :`, `${oldMessage.content}`)
        .addField(`Nouveau message :`, `${newMessage.content}`)
        .addField(`Channel :`, `<#${oldMessage.channel.id}>`)
        .setTimestamp();
    logsmessageupdate.send(embed)
}
```How can I use message with module.exports? Because I need this for my data db
earnest phoenix
#

client.guilds.cache.forEach(async (guild)=>{ }) will this work?

ripe prairie
#

what's a python db library i should use

near stratus
ripe prairie
#

great, haven't even started yet and i already hate it

#

i shall learn sqlite3

near stratus
#

I was gonna say mongo but I'm not sure if that exists in Python

earnest phoenix
#

hey

ripe prairie
#

@near stratus it does

#

mongodb

earnest phoenix
#

i have 2 users and their guilds in 2 differents array and i want to filter to get mutual Guilds in a new array

ripe prairie
#

just iterate through one

#

and compare to the other

earnest phoenix
#
const mutualGuilds = [];
...
return mutualGuilds
}```
ripe prairie
#

and append to new array if match

earnest phoenix
#

bu how

ripe prairie
#

using loops

earnest phoenix
#

i try lot of things but

#

....

ripe prairie
earnest phoenix
#

i have 12 guilds in common with my bot but it says 0 guild

ripe prairie
#

what do the arrays store

#

guild IDs, names, etc

#

?

earnest phoenix
#

yeah

ripe prairie
#

that doesn't answer my question tho

#

gotta be specific

near stratus
ripe prairie
#

smh don't spoonfeed pls

earnest phoenix
#

@near stratus will try thks

near stratus
#

lol It was a joke

earnest phoenix
#

hmmm

ripe prairie
#

disappoint

near stratus
tired panther
#

I am having a problem with my command reloader ๐Ÿ˜ฆ

#
delete require.cache[require.resolve(`../${command.category.toLowerCase()}/${command.name.toLowerCase()}.js`)];
#

it cannot find any module

earnest phoenix
#

hmm

#

@near stratus i edited your code

#

thks

#
    for(let i = 0; i < botGuilds.length; i++){
        const guildPos = userGuilds.map(g => g.id).indexOf(botGuilds[i].id)
        if(guildPos !== -1){
          mutualGuilds.push(userGuilds[guildPos])
        }
      }
    return await mutualGuilds;```
#

works fine

near stratus
#

if it woks then congrats

near stratus
earnest phoenix
#

Hey

near stratus
earnest phoenix
#
const Discord = require('discord.js');
const db = require('quick.db')
const { defaultPrefix, deletionTimeout, reactionError, suggestionPending, suggestionApprove, suggestionDecline } = require('../../config.json');

module.exports = async (client, message) => {
  const guildCreateEmbed = new Discord.MessageEmbed()
  .setColor("GREEN")
  .setTitle(`Omg, j'ai rejoint un nouveau serveur !`)
  .addField(`Serveur :`, `${client.guild.name}`)
  .addField(`Fondateur :`, `${client.guild.owner}`)
  .addField(`Membres :`, `${client.guild.memberCount}`)
  .setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
  .setTimestamp();
  const guildCreateLogs = message.guild.channels.cache.find(channel => channel.id === '819866826753441824')
  guildCreateLogs.send(guildCreateEmbed)
}
```My guildCreate.js has a problem, client.guild is undefined, how to fetch this?
old cliff
#

hmm

#

wait

#

this event doesn't give a message

earnest phoenix
#

oh

old cliff
#

change message to guild @earnest phoenix

earnest phoenix
#

at module exports?

old cliff
#
module.exports = async (client, guild) => {```
#

change to that

earnest phoenix
#

but the const

#

the message guild find

#

const guildCreateLogs = message.guild.channels.cache.find(channel => channel.id === '819866826753441824')

old cliff
#

change to client.channels.cache.find(channel => channel.id === '819866826753441824')

earnest phoenix
#

const guildCreateLogs = guild.channels.cache.find(channel => channel.id === '819866826753441824')

#

like this?

old cliff
#

no

#

read the edit

#

client.channels.cache.find(channel => channel.id === '819866826753441824')

earnest phoenix
#

oh okay

#

I test

old cliff
#

the channel is in the client object not the guild or message

earnest phoenix
#

.addField(Serveur :, ${client.guild.name})
cannot read property name

old cliff
#

if you would do guild.channels.cache.find then it would return undefined if the guildis not the guild in which the channel exists

old cliff
#

change to guild.name

#

client.guild is nothing

earnest phoenix
#

I test

near stratus
old cliff
#

thats what I told him

earnest phoenix
#

oh yes

#

works so

#

thx

old cliff
#

welcome

near stratus
#

@earnest phoenix client.guild.cache will return all guilds the bot is in

earnest phoenix
#

yes

#

but works to

near stratus
earnest phoenix
#

oof

tired panther
old cliff
#

wtf

#

this is guildCreate event

#

not message

earnest phoenix
old cliff
#

@tired panther

earnest phoenix
#

oof

tired panther
old cliff
old cliff
earnest phoenix
#
const Discord = require('discord.js');
const db = require('quick.db')
const { defaultPrefix, deletionTimeout, reactionError, suggestionPending, suggestionApprove, suggestionDecline } = require('../../config.json');

module.exports = async (client, guild) => {
  const guildCreateEmbed = new Discord.MessageEmbed()
  .setColor("GREEN")
  .setTitle(`Omg, j'ai rejoint un nouveau serveur !`)
  .addField(`Serveur :`, `${guild.name}`)
  .addField(`Fondateur :`, `${guild.owner}`)
  .addField(`Membres :`, `${guild.memberCount}`)
  .setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
  .setTimestamp();
  const guildCreateLogs = client.channels.cache.find(channel => channel.id === '819866826753441824')
  guildCreateLogs.send(guildCreateEmbed)
}
tired panther
earnest phoenix
#

Its works I don't edit anything oof

old cliff
#

thats what I told him

near stratus
old cliff
#

its guild.name

near stratus
tired panther
old cliff
#

@earnest phoenix you should read the docs for each event
-> https://discord.js.org/#/docs/main/stable/class/Client

near stratus
#

We have a working code end of Discussion

#

||Don't mind the spelling||

near stratus
inland galleon
#

hi

tired panther
#

hi

inland galleon
#

i got a messages from luca

#

in dm

tired panther
#

yes?

inland galleon
inland galleon
inland galleon
cosmic panther
#

How do you change the color of the review stars using css?

#

I tried this:

.entity-reviews {
  color: rgb(114, 137, 218);
}
tired panther
inland galleon
#

<@&304313580025544704> there is any option to advertise my bot or server ?

gilded plankBOT
#

@inland galleon

Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.

Here are some examples of emergencies:

  • Raids / Multiple members mass spamming.
  • Severe disruption of Discord's ToS (NSFW content, etc)
  • Anything that requires more than 2 moderators to handle.
rustic nova
#

ah god damnit

modern sable
old cliff
old cliff
near stratus
inland galleon
near stratus
#

ndw

old cliff
#

Use path.join

#

const path = require('path')

pale vessel
#

it's __dirname + "/..

#

you're missing a /

tired panther
pale vessel
#

i c

old cliff
#

Use freaking path tool

pale vessel
#

i never needed to use that even when working on windows and linux machines

#

just __dirname worked fine so

old cliff
#

Yes

#

But its good for beginners

#

Like Meister

earnest phoenix
#

client.guilds.cache.forEach will this work?

pale vessel
#

actually for reloading you don't even need __dirname

tired panther
old cliff
#

.map will work

earnest phoenix
#

ah yea

pale vessel
tired panther
old cliff
#

Or convert it to array then forEach

pale vessel
#

this works fine

old cliff
#

No

#

Dirname

tired panther
old cliff
#

Is necessary

pale vessel
#

not for me

tired panther
old cliff
#

Its useful for sharded reloading

tired panther
old cliff
#

This will work

tired panther
#

check here

#

My code did nor work Agree ๐Ÿ˜ฆ

old cliff
#

Try what I sent or don't post query in dev channel

#

Asking for help without actually trying the code

tired panther
old cliff
#

If the command is in the dir then only do one ..

#

Instead of 2 ..

tired panther
# old cliff

a full screesnhot pls,,thats cutted of on the sides

old cliff
#

Did you get it?

earnest phoenix
# old cliff No

does not enter it
my code

client.guilds.cache.map(async (g) => {
    let data = await ccdata.fetchall(g.id);
    data.forEach(x => {
        client.cache.push(x)
    })
})```
tired panther
old cliff
#
    let file = path.join(__dirname,'..',`${command.config.category}`,`${command.config.name}.js`);
        delete require.cache[require.resolve(file)];
        let newCommand = new require(file);
        this.commands.set(newCommand.config.name, newCommand);
    message.channel.send(`Command \`${command.config.name}\` was reloaded!`);
    console.log(`Reloaded ${command.config.name} command`);
} catch (error) {
    console.error(error);
}
tired panther
old cliff
#

I never thought you were a noob Thonk

tired panther
river panther
#

-.-

tired panther
old cliff
#

Beginner != noob

river panther
#

i guess not, at least not at the correct place

tired panther
old cliff
#

I am asking you

river panther
tired panther
river panther
#

3?

old cliff
#

Thats what I said...

#

Beginner is not noob

river panther
#

^

old cliff
#

You are not noob

#

Nvm

#

Back to coding

#

Does it work?

tired panther
old cliff
#

Does meme.js exist?

tired panther
#

yes

old cliff
#

Sometimes the command name and file name can differ

old cliff
#

Make sure they are the same

tired panther
old cliff
#

Also make sure you are using the correct code

#

Send your latest code

tired panther
old cliff
#

๐Ÿ˜”

#

Yes ๐Ÿ‘

tired panther
#
try{
 const path = require("path")
let file = path.join(__dirname,'..',`bot`, `help.js`);
 delete require.cache[require.resolve(file)];
}catch(e){console.log(e)}
#

I removed useless stuff

old cliff
#

You aren't even setting the new command anywhere

#

That was not useless

#

Deleting require cache doesn't automatically reload the command

tired panther
old cliff
#

Bro

tired panther
#

I just sended the snippet, which is not working

old cliff
#

You have to save the new command somewhere

tired panther
old cliff
#

Make sure your path is correct

inland galleon
#

how much time it take for approval ?

tired panther
tired panther
inland galleon
inland galleon
#

oh my god !

old cliff
#

So its your issue

#

In the file path

tired panther
old cliff
#

Fix the path.... it would work

tired panther
old cliff
#

Sometimes you should also try to fix things on your own end...

#

Try learning about dirt and paths

#

Someday...

tired panther
pale vessel
#

you cannot perform asynchronous operations inside array methods

old cliff
#

You would have to await Promise.all if you do so

pale vessel
#

only if it's an array of promise

earnest phoenix
#

is client.cache reserved?

#
client.guilds.cache.forEach(async (v,g,a) => {
        let data = await client.ccdata.fetchall(g);
        if(!data) return;
        data.forEach(async (x) => {
            client.cache.push(x)
        })
    });

this does not work :c

pale vessel
#

you can't use await inside .map() or .forEach()

earnest phoenix
#

i can console it

pale vessel
#

it'll still run it concurrently

#

use a for loop

earnest phoenix
pale vessel
#

it doesn't work

crimson vapor
#

you can use a .map() but then you need to await Promise.all() iirc

pale vessel
#

only if it's an array of promises

crimson vapor
#

so you would need to map it to an async function

pale vessel
#

tbh just use a for loop because this is just going to make it even more complicated

lusty quest
#

forEach doesnt respect async stuff

old cliff
#

Let me quick send the code

#
let myArr = Array.from(client.guilds.cache);
for(let i = 0; i < myArr.length; i++){
let obj = myArr[i];
//loop body
}
#

Ez pz

pale vessel
#
for (const guild of client.guilds.cache.values()) {
    guild
}```
old cliff
#

Is that a thing ?

cinder patio
#

you can also

for (const [, guild] of client.guilds.cache) { 

}
pale vessel
#

that would be entries(), I'm guessing?

old cliff
#

wow I need to learn about modern for loop

cinder patio
#

you don't need to call .entries

pale vessel
#

yeah

cinder patio
#

I wonder which one of these two is faster

pale vessel
#

probably the same

vivid fulcrum
#

the for loop is definitely faster

pale vessel
#

of course

vivid fulcrum
#

otherwise you would need to go over the collection twice

cinder patio
#

both are for loops tho

vivid fulcrum
#

yes

tranquil basin
#

My bot i Finished i Just Need to Make it Run 24/7

old cliff
#

What can we do?

tranquil basin
#

The node_modules File is Large that it Cant Fit in Github

old cliff
#

Oof

pale vessel
#

yikes

hidden lynx
#

xD

tranquil basin
#

i want suggestions on what to do

old cliff
#

Learn about git and gitignore

#

And npm

#

Too

vivid fulcrum
#

but with entries you go over the collection once already, then calling for on that means you iterate two times... when you could've done it in a single loop

micro optimizations people, if you don't do it now, dont be surprised your code runs like yandere simulator

#

it seems insignificant but when you scale it up, it has an impact

cinder patio
#

No but you said the for loop is faster, but both of em are for loops

vivid fulcrum
#

should've mentioned that

cinder patio
#

ah

cinder patio
#

@rustic nova

rustic nova
#

thanky

small plume
#

This is asking for help not giving help ;)
Discord.js master (Requires Node 14+), pm2 causse it says its using node 11.4.0

Screenshot: https://i.imgur.com/Le6opzp.png

Using nvm install node and nvm use node it put me to v15.11.0 node.
Tried editing something like the interpreter to -interpreter=~/.nvm/versions/node/v15.11.0/bin/node but still same outcome.

Frankly would anyone know how to edit anything regarding pm2 eyes_shaking

cinder patio
#

try nvm use --lts

small plume
#

Same outcome

cinder patio
#

try uninstalling all other node versions

#

nvm uninstall v11.4.0

small plume
#

hmm i might try something quickly and force the process via package.json to use X version

#

Managed to find a workaround ๐Ÿ˜‰

severe pike
#

Hey, im not sure if anyboidy knows how i can update my local repo to what my online repo is? I have deleted all of these branches on my online repo but they are still here on my local one

cinder patio
#

git pull

severe pike
#

That doesnt get rid of the branches

#

Also, im not wanting to merge with a branch, i just want to get rid of all the branches which have been deleted

#

Because only have 2 branches now, but this shows like 40

lyric mountain
#

you're in intellij...

#

using command line git

#

in intellij

#

and activate ur windows

pale vessel
#

that's pycharm

opal plank
#

thats clearly vsc

thorn seal
#

hi I'm using discord.net library. And it looks like one of their methods triggers API limits. Should I try to patch it by coding own method, or discord.net automatically limit itself to prevent Discord API spams?

plucky geyser
#

can anyone tell me how to use rich presence in python?

#

im noob

#

๐Ÿ˜ฆ

near stratus
near stratus
plucky geyser
#

or link?

near stratus
plucky geyser
#

okay LOL

plucky geyser
livid lichen
#

Does anyone know any good libraries for detecting when a user voted on top.gg?

plucky geyser
#

๐Ÿ˜ฆ

misty sigil
near stratus
opal plank
near stratus
# plucky geyser im noob can u send any tutorial video

How to add buttons to your Discord Status
We will use Discord Rich Presence for this so follow the tutorial!
In-built video captions will be located in the bottom
.......................................................................................
๐Ÿ”ด Video by xZyn ๐Ÿ”ด
โบ \ Recorded with OBS Studio
๐ŸŽฌ \ Made with VEGAS Pro 17
๐ŸŽฅ \ Pl...

โ–ถ Play video
opal plank
misty sigil
#

rpc moment

livid lichen
pale vessel
opal plank
#

^^

livid lichen
#

Only that, most of them hasn't been updated in 1+ years.

opal plank
#

its true tho

misty sigil
opal plank
#

rpc deprecated

misty sigil
#

sdk harder to work with
mmLol

opal plank
#

i was expecting people to simply queue in the

#

say the line Bart

opal plank
livid lichen
near stratus
#

@livid lichen then

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

const app = express() // Your express app

const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)

app.post('/dblwebhook', webhook.middleware(), (req, res) => {
  // req.vote is your vote object e.g
  console.log(req.vote.user) // 221221226561929217
}) // attach the middleware

app.listen(3000)
livid lichen
#

Thank you so much!

opal plank
#

imagine needing a token

#

json scrapping ftw

misty sigil
#

json scrapping?

opal plank
#

well kinda, yeah

crimson vapor
opal plank
#

get the json responses from querying the bots directly

crimson vapor
#

bruh

#

get it?

livid lichen
crimson vapor
#

oh shit

#

wait

#

does that mean

#

I am you?

opal plank
#

you've been bamboozled

#

yes

dusk scarab
#

UMMM
So im doing the giveaway bot and it just doesnt end...

TypeError: Cannot set property 'hasEnded' of null
    at endGiveaway (C:\Users\shree\Desktop\Discord Bots\DiscordBot\node_modules\discord-giveaway\src\functions.js:70:19)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Job.job (C:\Users\shree\Desktop\Discord Bots\DiscordBot\node_modules\discord-giveaway\src\functions.js:58:39) Unhandled Rejection at Promise Promise {  
  <rejected> TypeError: Cannot set property 'hasEnded' of null
      at endGiveaway (C:\Users\shree\Desktop\Discord Bots\DiscordBot\node_modules\discord-giveaway\src\functions.js:70:19)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
      at async Job.job (C:\Users\shree\Desktop\Discord Bots\DiscordBot\node_modules\discord-giveaway\src\functions.js:58:39)
}

i get this error and it keeps resending the CONGRATS @dusk scarab you have won the giveaway!

const ms = require('ms')
const { MessageEmbed } = require('discord.js')

module.exports = {
    name: 'giveaway',
    description: "sends youtube link",
    async execute(client, message, args, cmd, Discord){
        const channel = message.mentions.channels.first();

        const duration = args[1]
        if(!duration) return message.reply(', specify a duration for the giveaway to last')

        const winners = args[2]
        if(!winners) return message.channel.send('Please specify a number of winners')

        const prize = args.slice(3).join(" ")
        if(!prize) return message.reply('Please specify a reward for this giveaway!')

        await client.giveaways.startGiveaway({
            prize: prize,
            channelId: channel.id,
            guildId: message.guild.id,
            duration: duration, 
            winners: winners, 
            hostedBy: message.author.id
        });
    }
}

that is my giveaway code
please ping me if you know what suo
*sup

crimson vapor
dusk scarab
#

const { GivewayCreator, GiveawayCreator } = require('discord-giveaway')
const Creator = new GiveawayCreator(client, process.env.MONGODB_SRV);

#

wait, i dont have a client.giveaways.starGiveaway

#

I modified a tutorial I followed and it just doesnt end...

misty sigil
#

write your own code

dusk scarab
#

m8, the tutorial i wateched copy and pasted the packaging lol

#

i added all the args and stuff

#

wait

#

i might have a solution

#

yeah it works now

#

all I had to do was do const duration = ms(args[1])

feral aspen
#

Guys question.

#

When calling out a function, we pass the 0th or 1st argument, I'm confused.

#

What do we call the first one?

#
test(1); // <--- Is 1 considered as the 0th or 1st argument?
umbral zealot
#

in the arguments array it's index 0 but in english we usually will called it "the first"

feral aspen
#

Ah.

#

so Argument 0

#

or Index 0?

umbral zealot
#

arguments[0]

feral aspen
#

Aight!

#

Thanks.

#

Lol, i'm living under a rock just to know that there is something called as rest operators in functions to make things an array instead of a single value.

tired panther
#

lol, basic js xD

umbral zealot
#

it's just a lot easier to do things when you know what you're doing ๐Ÿ˜‰

tired panther
#

Agree yes Agree

earnest phoenix
#

e

feral aspen
#

f

earnest phoenix
#

Hi, how do I make it so that only people with "moderation role " can use the bot ?

#

in js

vivid fulcrum
#

check if they have the role

earnest phoenix
#

No, but anyone can use the bot

#

i want to add a white list system

vivid fulcrum
#

what do you want now

#

a whitelist or requiring a role

earnest phoenix
vivid fulcrum
#

ok you're a lost cause

earnest phoenix
tired panther
#

lol

earnest phoenix
#

I want to do the command .wl id_user and my bot will give the moderator role and only people who have their roles can use my bot, it avoids having a DB

#

is this inefficient

var removeIndex = client.cache.map(function (item) { return item.token; }).indexOf(change.fullDocument.token);
        client.cache.splice(removeIndex, 1);
        client.cache.push(change.fullDocument) ;
#

i remove it and add a updated

feral aspen
earnest phoenix
feral aspen
#

Oh.

#

Alright.

#

You can do this.

#

You basically need to get the guild since the role is is in a specific guild, and cache the member or user who is performing the command then check if the user has a specific role by ID.

fossil grove
#

What do u guys use for coding bot
I use javascript and repl.it hehe

feral aspen
pale vessel
#

Python or JDA.
wha

fossil grove
#

So u know repl

feral aspen
#

I don't use it as a cloud

fossil grove
#

No one here use repl?

feral aspen
#

๐Ÿ‘€

cosmic forum
#

Hi! So I have the following code:

let eggs = db.get(`${message.author.id}.egg`);
let birds = db.get(`${message.author.id}.bird`);
const bread = db.get(`${message.author.id}.bread`) || 0;
let egglength = eggs.length || 0;
let birdlength = birds.length || 0;
let egglist = eggs.join("`, `") || "No eggs";
let birdlist = birds.join("`, `") || "No birds";

let embed = new Discord.MessageEmbed()
    .setTitle(`${message.author.tag}'s Inventory`)
    .addField(`Eggs - ${egglength}`, `\`${egglist}\``)
    .addField(`Birds - ${birdlength}`, `\`${birdlist}\``)
    .addField("Bread", bread)
    .setColor("BLUE")
    .setFooter("Rubber Duck Games", "https://i.imgur.com/s7R7YC3.png")
    .setTimestamp();

message.channel.send(embed);

And it keeps throwing an error for:

let egglength = eggs.length || 0;
let birdlength = birds.length || 0;
let egglist = eggs.join("`, `") || "No eggs";
let birdlist = birds.join("`, `") || "No birds";

Saying that eggs/birds doesn't exist. Why doesn't it switch to 0/No eggs/No birds?

#

It works for the bread variable

#

nvm

opal plank
#

@earnest phoenix i exposed our dms in another dm, with you being a devoted cultist of detritus

cosmic forum
#

i figured it out

opal plank
#

just fyi mmulu

#

happyCustomerโ„ข๏ธ

earnest phoenix
#

DUeeE

#

wHY

opal plank
#

selling point

#

its like happy customer reviews

#

but you didnt give consent

agile rune
#

Hi

#

Can you help me

opal plank
agile rune
#

Hellooo

#

Can you help me

opal plank
carmine hornet
#

I will subscribe to this bot forever and pay 5 usd monthly if the following options are added too:

-starboard
-rank roles (lv 1 members get one role, lv 5 get another role... like amari bot)
-birthday announcer (like mantaro)
-embedded welcome message that shows member acc info (like welcomer bot)
-when members leave and then, join- their roles are given back (like Role Saver bot)
-username colors can be picked by users if they type the hex color code from google (Lexa bot)
-reaction roles (like yagpd bot)

feral aspen
#

What?

opal plank
carmine hornet
#

I really love the .pick feature and hope to see more

#

May I know where I can post my message please? :)

feral aspen
#

Anywhere not here.

opal plank
#

not in this server

#

woo hit em with -needdev

solemn latch
#

I think you might be on the wrong server

river panther
solemn latch
#

I dont have tag perms :(

feral aspen
opal plank
#

rip

river panther
carmine hornet
#

oh no... I clicked to join the mimu bot server

shell void
opal plank
feral aspen
#

-support

#

bruh, whats the command.

carmine hornet
#

ah, requests aren't allowed... nvm x)

river panther
#

I WANT FINANCIAL DEVELOPMENT, SOMEONE HELP PLES

carmine hornet
#

thanks anyway

solemn latch
feral aspen
crimson vapor
#

Hmm

feral aspen
river panther
#

why?

feral aspen
#

Rather than that, I am not sure how I can provide you with money.

river panther
#

why no pateron?

feral aspen
#

You could do in patreon.

river panther
feral aspen
#

Cause it's not recommended to ask people to donate.

misty sigil
#

because patreon is shit

feral aspen
#

Unless they want to, and you give them something in return

misty sigil
#

at least the developer side

feral aspen
river panther
#

oh, hmm

#

donation is bad

#

ok ok

feral aspen
#

Ok.

river panther
#

i will just go rob a bank

#

brb

feral aspen
#

Good luck.

zenith terrace
#

he cannot do commands

exotic galleon
#

I have such an error on my discord bot please help me

misty sigil
#

install quick.db?!?!?!?!?!?!?!?!?!?!!???????????

#

learn to read your fucking errors

zenith terrace
#

its somewhere

livid lichen
#

Bot.users.cache.get(request.vote.user);This should work... correct?

exotic galleon
#

yes

livid lichen
#

Does it require an intent?

severe pike
misty sigil
#

no

severe pike
#

frick

feral aspen
#

I have a question.

#

I have removed some packages from the package.json

#

.. and I want it to update in the package-lock.json and all the node-modules.

#

How can I do that?

pale vessel
#

you're not supposed to modify package.json directly

#

use npm uninstall

#

that will also update package-lock.json

feral aspen
#

Hm.

#

But I did it anyways! ๐Ÿ‘€

#

Which was not good, I guess.

#

How can I make it update for all.

lyric mountain
#

re-add it then use npm uninstall

feral aspen
#

Oh, I barely know what I removed.

#

Ffs.

pale vessel
#

Just ctrl z

feral aspen
#

Bruh.

#

I did that a long time ago and I got no answer, and now I am here asking again.

pale vessel
#

Ah