#development

1 messages · Page 620 of 1

earnest phoenix
#

usually youd make a rest api web server which forwards requests to discord, you can then call your web server from any other apps while still keeping shit like concurrency and cooldowns synced

late hill
#

Alright

#

Thanks

spring ember
#

@white brook my own, it's not on the play store

#

Also I am not planning on sharing it

copper cradle
#

"a bot switch" lmfbao

idle basalt
#

"switch a bot to be online"

earnest phoenix
#

@grizzled spruce yea

grizzled spruce
#

Huh?

#

Oh yeah

#

Thx

white brook
#

😢😢😢

unique nimbus
#

?

white brook
#

I want to install IOS9

#

BUT I CAN'T

earnest phoenix
#

ok

unique nimbus
#

IOS9 as Apple IOS?

#

what

white brook
#

I have the IOS9_SIGNED_ZIP_FILE

#

I CAN'T OPEN THE RECOVERY MOD

earnest phoenix
#

ok

white brook
#

Oof?

#

ofo?

#

FCC Ofofoop?

earnest phoenix
#

stop being annoying

unique nimbus
#

I actually don't know what IOS9_SIGNED_ZIP_FILE

white brook
#

🤔

#

Wtf why you don't know what is IOS9_SIGNED_ZIP_FILE

unique nimbus
#

Yes I do not know

white brook
#

OK

slim heart
#

It’s a troll guys don’t pay mind to him

white brook
#

IS A IOS FILE WITH THIS FILE YOU CAN RUN IOS on ANY PHONE

unique nimbus
#

Oh

#

but why would you want IOS?

white brook
#

IOS IS MORE BETTER THAN ANDROID

slim heart
#

You can’t install iOS on android

white brook
#

No you can

slim heart
#

Now please.
Accept no iOS
Or buy an iPhone

unique nimbus
#

You can't, it's illegal

#

IOS is a private os

white brook
#

No you can run ios

unique nimbus
#

and you do not have consent from Apple directly

#

making it illegal

slim heart
#

Everything you find will either be a virus or it’s just gonna be a theme

white brook
#

no

#

man

#

wait a sec

slim heart
#

No
Accept it

#

Your “signed iOS file” is likely a virus which will brick you

#

If you truly believe it’s real unzip it into your root directory and still watch it brick

unique nimbus
#

iOS is a private OS, Apple does not share their iOS files making it an Apple Exclusive system, Android is open source meaning anyone can take the code and make their own os running a form of android.

#

that is very simple definition

slim heart
#

What’s the name of like the android kinda theme thingy’s

#

Launcher

#

Yea
It’ll either be a launcher or a virus that will brick you

unique nimbus
#

yes

#

Don't forget it is highly illegal

#

No Consent

slim heart
#

However seeing that you’ve left it seems that you’ve actually listened to my advice of unzipping it into your root, which was a joke, but hopefully now you’ve learned your lesson 👀

unique nimbus
#

and its not open source

white brook
unique nimbus
#

No Consent and Stealing

slim heart
#

@white brook I t s n o t g o n n a w o r k

#

G i v e I t u p a n d blobstop

unique nimbus
#

Alex, even if it was legit, that is illegal

white brook
#

😤😤😤

#

😀ok

unique nimbus
#

If you want iOS get an iPhone

white brook
#

I hate iphone

#

I love Samsung

slim heart
#

Then u don’t want iOS lmao

white brook
#

#S10

slim heart
#

So you want iOS and hate iPhones ok

white brook
#

I don't like Android and I love IOS

mossy vine
#

when this whitename couldnt comprehend that they need to write code to make a bot i didnt know the conversation is going to be this stupid

slim heart
#

Don’t discriminate against people for whether they have a bot dev role or not ty

unique nimbus
#

Alex what don't you like about android?

mossy vine
#

its a joke name anyways not actual discrimination

amber fractal
#

@slim heart you bad cuz ur a dev kid

white brook
#

ALL

#

I DONT LIKE Android

slim heart
#

Ok but ur the same race role as me so

amber fractal
#

No one cares

slim heart
#

#NotWhiteImABotDev

unique nimbus
#

Alex if you want iOS get iPhone

#

If you like Samsung then you get Android

#

If the company is not Apple, its Android

slim heart
#

Or Nokia

#

Do they still have ladybugs

unique nimbus
#

Nokia is in the Android league now

#

However they do have their feature phones still

slim heart
#

Is that still a thing people give to their children

unique nimbus
#

but not really in production anymore

#

Yes that is a feature phone, like the Nokia 3310

grim aspen
#

@white brook we don't do that here, and running an ios that's cracked is highly illegal and can lead to problems, i suggest you uninstall it and go to the apple store and buy a actual iphone which already has IOS. we can't help you with your problem since this is bot development, not illegal phone development.

opaque eagle
#

If you like iOS so much, then buy an iPhone.

white brook
#

Kkkok

#

Ok

#

Ok

#

Ok

opaque eagle
#

You’re so self-contradicting... you think iOS is superior but you refuse to pay the money for one.

white brook
#

I buy iphone

#

ok

#

alright

west spoke
#

Lol

#

Android far superior

slim heart
#

Don’t egg him on

#

Y’all shoulda been ignoring for an hour by now

scarlet phoenix
#

If you dont give one shit about what phone you are getting -> Go Iphone
If you dont give one shit about what phone you are getting and dont like IOS or iPhones -> Go samsung
If you like to tinker with your phone, or have some specific features you want -> Find the right android
If you like using nice headphones -> Go LG V or G lines.
At least thats my simple formula I tell friends and family

#

By dont give a shit, i mean the really non techy people that just dont really care

west spoke
#

Or just get the pixel

#

Very customizable, easy to root, you can edit literally everything on it (gen 1)

scarlet phoenix
#

Only reason i went for a V35 as opposed to the pixel 3/xl (3a was not out) is the headphone jack

#

Came up from an OG pixel (10/10 great phone, started boot looping)

west spoke
#

Mine took a hit to the battery

#

I still need to root my s10e

scarlet phoenix
#

I got my battery replaced at a ubreakifix and it went really well. Then like 6 months later she ded

#

s10 looks nice, so pricy tho.

west spoke
#

Meh

#

I got it for my bday. I'm surprised it has a audio jack

unique nimbus
#

oneplus 7 pro seems good

#

but I require money

#

thonk

west spoke
#

I'm worried that the camera will break

#

Tbh

unique nimbus
#

They made a 12hr video for testing

#

kek

west spoke
#

What

#

Lol

unique nimbus
#

@west spoke

scarlet phoenix
#

I like the full front screen. But no headphone jack is a deal breaker. Same case for the mi mix3 I was eyeing up

unique nimbus
#

I mean phones are losing them unfortunately

earnest phoenix
#
const search = require("yt-search");

exports.execute = (bot, message, args, prefix, ops) => {
  
  search(args.join(" "), function(err, res)  {
    if (!message.member.voiceChannel ) return message.channel.send("**Join to Voice Channel.**");
    //if (message.guild.me.voiceChannel) return message.channel.send(":x: Sorry the bot is already connected to a voice channel");
    if (err) return message.channel.send("**:x:  Try again.**");
 
    let videos = res.videos.slice(0, 10);
    let resp = ``;
    for (var i in videos) {
      resp += `**${parseInt(i)+1} | ${videos[i].title}\n`;
    }
 
    resp += `\n**:notes: Please provide a number 1-${videos.length} :notes:**`;
 
    message.channel.send(resp);
 
    const filter = m => !isNaN(m.content) && m.content < videos.length+1 && m.content > 0;
 
    const collector = message.channel.createMessageCollector(filter);
 
 
    collector.videos = videos;
 
 
    collector.once(`collect`, function(m) {
      let commandFile = require('./play.js');
      commandFile.execute(bot, message, this.videos[parseInt(m.content)-1].url, prefix, ops);
    })
  });
}
 
 
module.exports.help = {
  name: "search"
}```
#

at Object.exports.execute (/app/commands/search.js:6:15)

at Object.exports.execute (/app/commands/play.js:10:24)

    at processTicksAndRejections (internal/process/task_queues.js:86:5)

(node:30186) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:30186) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

(node:30186) UnhandledPromiseRejectionWarning: TypeError: args.join is not a function

at Object.exports.execute (/app/commands/search.js:6:15)

at Object.exports.execute (/app/commands/play.js:10:24)

    at processTicksAndRejections (internal/process/task_queues.js:86:5)

(node:30186) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)```
scarlet phoenix
#

yeah it stinks, at some point I will go all bluetooth, but I have spent way too much money on different wired headphones and IEMs. I cant just make them all obsolete :feelsbatman:

earnest phoenix
#

can i got help?

mossy vine
#

well, args.join is obviously not a function

#

can you console.log(args) and see what it is?

earnest phoenix
#

it yes bro

#

ok

mossy vine
#

if it isnt an array then you fucked up

copper cradle
#

args.split().join(" ")

grizzled spruce
#
  if(!prefixes[message.guild.id])
    prefixes[message.guild.id] = {
      prefixes: botconfig.prefix
    };
  
  let prefix = prefixes[message.guild.id].prefixes;
  console.log(prefix);


let messageArray = message.content.split(" ");
 let cmd = messageArray[0];
 let args = messageArray.slice(1);
  
  fs.writeFile("./prefixes.json", JSON.stringify(prefixes), (err) => {
    if (err) console.log(err)
  });
#

How would I convert this from .json storage to SQLite

scarlet phoenix
#
  1. learn sql
  2. Make the db
  3. Query db
grizzled spruce
#

oooof

#

i have much work to do

dusky marsh
#

You'd have a table of guilds and make one of the columns a prefix column and then use sql queuries

scarlet phoenix
#

^^ Thats a good starting point, the work will be very worth it.

earnest phoenix
#

is sql some sort of database you can stack datas for free?

#

privately

copper cradle
#

^

earnest phoenix
#

sql is a language

spring ember
#

sql is a query language to be more exact

earnest phoenix
#

yes

spring ember
#

not a programming language and thank god not a normal human language

earnest phoenix
#

i code in css

copper cradle
#

lmao

#

I made a bot using json

earnest phoenix
#

honestly seeing as json is overutilised for everything i wouldn't be surprised if there was an actual attempt

spring ember
#

there is an actual programming language for databases that's called pl/sql

#

it is kind of SQL

copper cradle
#

@earnest phoenix there is actually something

#

lemme find it

scarlet phoenix
#

Yeah there are a decent amount of SQL derivatives that are turing complete

#

Then again, microsoft powerpoint is also turing complete. So thats not saying a ton

copper cradle
#

@earnest phoenix

earnest phoenix
#

jesus christ

copper cradle
#

lmfao

scarlet phoenix
#

delet this

#

it hurts

copper cradle
#

lmfbao

scarlet phoenix
#

I mean its js under the hood, but still hurts

copper cradle
#

oof

barren brook
#

Im looking for a dev to help me code dm me you most likey got to teach me a bit...

earnest phoenix
#

just... ask your question here?

barren brook
#

im a noob at coding and i want someone to teach me how to use a data base

scarlet phoenix
barren brook
#

hm k

earnest phoenix
#

a lot of people's problem here is not knowing how to do research for themselves 🤷

#

it's a skill you should better learn earlier than later

scarlet phoenix
#

^

barren brook
#

also ReferenceError: command is not defined
at Object.<anonymous> (C:\Users\Alex\Documents\Clan Bot\index.js:21:45)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

my command helper is not working

earnest phoenix
#

giw code

barren brook
#

k

#

try {
let commandFile = require(./commands/${command}.js);
commandFile.run(bot, message, args);
} catch (err) {
console.error(err);
}

earnest phoenix
#

did you define command? like (command) =>

barren brook
#

um no i didnt im dumb...

opaque eagle
#

@shy rose @unique nimbus this is the kind of stuff I'm talking about

unique nimbus
#

smh

#

A good thing is reading docs

earnest phoenix
opaque eagle
#

It's not even about the docs: ReferenceError: command is not defined

#

It's about having common sense

#

Why would u use a variable that doesn't exist (insert that emoji here where there's that small question mark next to the black guy)

#

lol

#

That thing ^

earnest phoenix
#

U dont have nitro do you

opaque eagle
#

no

light matrix
#

XD

#

what did i walk in to

harsh nova
#

That’s the fella I was sending about in #memes-and-media! Guess he was getting disappointed with my help

opaque eagle
#

LOL

earnest phoenix
#

@gilded plank bots @earnest phoenix

gilded plankBOT
#
Xuance#1586
Bots

@tropic prism

earnest phoenix
#

Still waiting for approval

opaque eagle
#

Cool, how does that relate to the conversation or belong in #development

earnest phoenix
#

it doesnt

opaque eagle
#

Ok then

earnest phoenix
#

can someone help me with discord-passport, it says TokenError

#

i was too lazy to switch channel

opaque eagle
#

Well it has to say more than just TokenError... what's the actual message @earnest phoenix

earnest phoenix
#

one min then

opaque eagle
#

And the mods r too lazy to ban u for that unsolicited advertising, so ur off the hook I guess @earnest phoenix

earnest phoenix
#

Probs wrong token, invalid token or no token

#

Thank mods

opaque eagle
#

It's not like the mods do anything here anyways

#

They're asleep

#

Except when ppl trash talk them

#

Then they get roused up

#

jkjk mods u cool™

earnest phoenix
#

nvm i just reset the secret

light matrix
#

boredom

shy rose
#

@opaque eagle yeah ik
And it's cause of Google

earnest phoenix
#

Yea...I think imma give up on it. Nothing I try will stop it from flooding my Console log with warnings and errors.

copper cradle
#

I hate when people don't read the error

#

It literally says "Missing permissions" John

earnest phoenix
#

And it's being caused by this server not giving it the propper permissions that won't be fixed

copper cradle
#

Yeah

fiery stream
#
    var user = GoogleAuth.currentUser.get();
    if (user) {
      $('#sign-in-or-dashboard-button').html(user.w3.ig).href='/Dashboard.html'.src=user.w3.Paa;
      console.log(user)
    } else {
      $('#sign-in-or-dashboard-button').html("Login")
      console.log(user)
    }
  }```
#

hey why cant i use .href='dashboard.html' ????

opaque eagle
#

Eww jQuery

#

Vanilla JavaScript is so much cleanerjs const btn = document.getElementById("sign-in-or-dashboard-button"); btn.setAttribute("href", "dashboard.html");

fiery stream
#

wait what?

shy rose
#

is there a way to detect if a user gets banned/deleted off discord?

#

not off a server but discord as a whole

fiery stream
#

i dont think so

#

there might be a discord api to check

#

web api*

willow sparrow
#

Pls help me lol

west spoke
#

No

#

Learn the lang first

copper cradle
#

lmfao

west spoke
#

I dont even use that and I know about it

copper cradle
#

who unstared the msg

#

stop doing that

west spoke
#

Whomst the fukc

copper cradle
#

someone called chips

west spoke
#

They left? Lol

unkempt heron
#

👀

copper cradle
#

bruh

west spoke
#

Then why couldn't I ping them

unkempt heron
copper cradle
#

bruh

unkempt heron
#

👁 👀 zoomeyes

west spoke
#

Ok let's not spam

#

Useless whitenames :v

unkempt heron
#

whitenames?

copper cradle
copper cradle
#

can someone give me the link of the DBL Css repo

pallid zinc
#

Anyone host his/her bot on glitch

#

?

shy rose
#

people do

but you shouldnt

#

look at heroku its more designed for those kind of things

west spoke
#

Host it on a 2gb ram laptop

pallid zinc
#

Chewey till now I am hosting on heroku only but it after I add new code it stop working

fiery stream
#

Lmao

copper cradle
#

you used an invalid domain name

pallid zinc
#

Where

#

I can't find invalid domain

balmy lantern
#

help with like market, or otherwise db commands i believe db commands no clue how to start

pallid zinc
#

Beginner ?

gray python
#

Bajingan itu seseorang yang tiba² datang mebuat nyaman lalu pergi..

Toxic dikit😂 @everyone

earnest phoenix
#

What do you think about galaxygate?

#

It is Good?

bright spear
#

ive heard its good

pallid zinc
#

I have a friend who can host your bot 24/7 in 1 dollar

bright spear
#

and @gray python english only + dont try to ping @ everyone

pallid zinc
#

Better then galaxygate

quartz kindle
#

anyone knows if zlib-sync and erlpack are incompatible with node 12?

#

they install fine in node 11 but not in 12

mossy vine
#

Lots of modules are broken in node 12

quartz kindle
#

it seems to work if i install them in 11 then switch to 12

#

but idk if im generating needless overhead with internal errors tho

#

because they are optional libaries, and supposed to improve djs's performance

main sluice
#

Pls rich

modern sable
lost seal
#

Hi, I've added a bot I made to my discord server, and assigned it a new role with the "Send Messages" permission globally turned off. Yet, he's still able to send messages on all channels. The only way I found is to manually add the role to each text channel and disable the permission... but I'd like to avoid that. Any idea where to look at?

quiet topaz
#

The bot role have write permission

light matrix
#

@lost seal if the permission is granted to everyone, you have to use your method, what i found easiest is setting their permission for the category

quiet topaz
#

The Role created vy the intergration have i think the permission to send messages

#

@lost seal

pallid zinc
#

Help

lost seal
#

@light matrix Forgot about categories permissions, setting it on category level seems to work

#

Thanks for the help guys

jovial hamlet
#

I need some bots

quartz kindle
#

Make them or get them

jovial hamlet
#

Get them n make them

calm saddle
#

can you have more than one client.on I am working through the tutorial and am wondering...?

quartz kindle
#

Yes, there are many different events to listen to

#

Just avoid listening to the same event multiple times

#

ie: ```client.on("message", msg => {})

client.on("guildMemberAdd", member => {})```

calm saddle
#

ah yep thanks

light matrix
#

@indigo geyser ik how to do it in python3

indigo geyser
#

Ok

slender thistle
#

No need to specify the 3 tbh

indigo geyser
#

@light matrix I use it

#

I use Client

#

There's someone who can help me pls?

#

(sorry for my Eng)

mossy vine
#

just post your issue

indigo geyser
#

Ok

#

How can I embed message?

#

(with my bot)

#

I use Phynton 3

#

@mossy vine

mossy vine
#

i dont use pythonk

opaque eagle
#

Idk what Phynton is

grim aspen
#

i was going to say i never even heard of phynton

indigo geyser
#

Sad

#

Phyton sorry

opaque eagle
#

I’ve never heard it Phyton either

mossy vine
#

it just gets even worse

indigo geyser
#

Python?

light matrix
#

@indigo geyser i use python3

#

do you use js or that

indigo geyser
#

Ok

#

I use it too

#

@light matrix

light matrix
#

oki

#

i can show you how to use embeded messages in dm

indigo geyser
#

Ok tnks

calm saddle
#

but getting an await async function error

#

i am using client.on('message', async message

#

never mind

#

i commented out my other client.on

#

and its ok

mossy vine
#

do you have 2 client.on('message'... handlers?

calm saddle
#

yeh i had one for non async commands

pallid zinc
#

Just use ""

calm saddle
#

for both of them?

pallid zinc
#

client.on("message", async message

#

Show your codes

calm saddle
#

all good

#

i got it

#

thanks 😃

pallid zinc
#

Np

calm saddle
#

i am getting an error on the Random cat example though

#

i copy and pasted the code so am a bit miffed

#
    at Client.client.on (/Users/adrianthorburn/Projects/discordBots/nivbot/index.js:99:28)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)
(node:9087) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9087) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
mossy vine
#

@pallid zinc both ' and " are valid string identifiers in javascript, it doesnt matter which one you use

pallid zinc
#

Code

calm saddle
#
    if (!message.content.startsWith(prefix) || message.author.bot) return;

    const args = message.content.slice(prefix.length).split(/ +/);
    const command = args.shift().toLowerCase();

  if (command === 'cat') {
      const { body } = await fetch('https://aws.random.cat/meow').then(response => response.json());

      message.channel.send(body.file);
  }
  else if (command === 'weather') {
    const { body } = await fetch(`http://api.openweathermap.org/data/2.5/weather?q=${args[0]}&units=metric&APPID=7d9ba91ae33f813b901a2b37f72aaac5`).then(response => response.json());

    message.channel.send(body.file);

  }
});```
#

ignore the weather stuff

#

thats next

copper cradle
#

use superagent

mossy vine
#

or just literally any fucking http client as it doesnt really matter

calm saddle
#

i was using node-fetch

pallid zinc
#

File undefined

calm saddle
pallid zinc
#

Have you installed fetch

#

??

calm saddle
#

yes

mossy vine
#

it would give a different error otherwise smh stop being dumb

#

can you console.log body?

calm saddle
#

ill try

#

its undefined

mossy vine
#

exactly

calm saddle
#

must be something wrong about the fetch

mossy vine
#

yeah

warm marsh
#

Node fetch requires options i am pretty sure

#

headers, Method and some other things

#
fetch('urlhere', {
    method: "GET"
});
#

etc

calm saddle
#

ok i got it

#

this is my code

#

const {body} = await fetch('https://aws.random.cat/meow').then(res => res.json()).then(json => message.channel.send(json.file));

#

i dont think i need the {body} bit

mossy vine
#

put it in a variable called res and see what it is ig

lament meteor
#

uh... why do u use .then with await

mossy vine
#

^

#

also that

calm saddle
#

im new to JS

#

just try stuff till it works...

lament meteor
#

learn js then

calm saddle
#

i followed the guide here

lament meteor
#

dont jump to projects

calm saddle
#

it is misleadning i think

warm marsh
#

await .then?

lament meteor
#

it isn't misleading

#

on the other hand reading guides is different than learning js

warm marsh
#

also when inserting code blocks into discord do ```langhere
code ```

lament meteor
#

you should learn the basics of js

warm marsh
#

Copying and pasting code you have no clue how works is a bad practice.

lament meteor
#

^

grim aspen
#

i suggest learning js instead of copying the code... it's like me trying to do two handed bowling without learning first, it would just be a mess and i wouldn't know how to fix it or understand

calm saddle
#

i know some JS

#

still learning obvs

#

but my point is if you copy paste code from a guide it should work

#

which in this case it didnt

grim aspen
#

and that's where you need to learn js

#

paragraph two

warm marsh
#

The code probably does work, Just coping and pasting hoping that it works because it's from a guide doesn't mean you don't require to learn something about it first.

grim aspen
#

you've skipped the introduction and went right into the rest of the guide

calm saddle
#

i didnt lol

grim aspen
#

in which it didn't make sense

calm saddle
#

look

#

anyway

#

dw thx for the help

#

but u are kinda right

#

i did jump to the api stuff

#

after doing the first few examples in the guide

warm marsh
#

Fair. Well have fun learning!

grim aspen
#

or you can just look through https://discord.js.org/#/docs/main/stable/general/welcome, but ok

warm marsh
#

Yeah, I think he'd need to know a little more first.

grim aspen
#

let him be

warm marsh
#

I guess. Have fun!

earnest phoenix
#

so i'm trying to look at the docs and see what i'm doing wrong(as this doesnt work) but i can't find out why
any ideas?

msg.channel.overwritePermissions((role => role.name === "muted"), {SEND_MESSAGES: false});```
#

wait

#

fuck

#

nvm

#

actually yeah i still dont know what im doing

ruby dust
#

I'm not js, but I think SEND_MESSAGES must be a string

mossy vine
#

yes

#

it has to be string

earnest phoenix
#

yeah thats the thing i fixed

#

i didnt realize that

#

but now im getting
TypeError: Supplied parameter was neither a User nor a Role.

mossy vine
#

yeah

#

you dont need a filter

#

you need to write a role or user

earnest phoenix
#

like an id or can i just put 'muted'

mossy vine
#

get the role from the guild

earnest phoenix
#

ok

ruby dust
#

I wonder how the random module is made

mossy vine
#

thats how its made

fiery stream
#

Lmao

#

In binary?

near ether
#

Do you guys know how to make it so when I first invite my bot, it will automatically be given its own role and have permissions?

pallid zinc
#

No

amber fractal
#

Yes, any invite link

pallid zinc
#

Very nice question btw

amber fractal
#

If it has a permissions query it will get a role and permissions

near ether
#

Ah ok I tried that and it worked

#

Ty

pallid zinc
#

Bhai are you beginner ?

near ether
#

Me?

pallid zinc
#

Yup

near ether
#

I mean idk how to define beginner tbh lol I have a functioning bot that does server utility, plays music, etc

#

I’m not a coding beginner

pallid zinc
#

Ohh

near ether
#

But some administrative stuff for discord I don’t really know completely

mossy vine
#

the invite link includes parameters that lets people add your bot, and your bot will immedeatly get the permissions they checked. if the bot doesnt have the correct permissions, it cannot give itself other permissions. your bot might join a server where it has no permissions at all, or it may be given admin perms

near ether
#

Gotcha

#

Thanks

late hill
#

(way too many people give every bot admin)

earnest phoenix
#

including me

lofty hamlet
#
    setInterval(() => {
        randompop = bot.channels.get("555124662619602970")
        var pokep = Math.floor((Math.random() * (15 - 0) + 0))
        var FinalRand = Math.floor((Math.random() * (Pokemon.Noms.length)))
        var embedpoke = new Discord.RichEmbed()
            .setColor(embedcolor)
            .addField(`Pokémon sortant de nulle part`, `C'est un **${Pokemon.Noms[FinalRand]}** avec **${pokep}** Points`, false)
            .setFooter(`Appuyez sur la réaction pour le capturer`)
            .setImage(Pokemon.Gifs[FinalRand])
        randompop.send(embedpoke).then((anothermessage) => {
            anothermessage.channel.awaitMessages(response => response.content === 'capture', {
                max: 1,
                time: 30000,
                errors: ['time'],
            })
                .then((collected) => {
                    anothermessage.channel.send(`Pokemon ${Pokemon.Noms[FinalRand]} capturé par ${collected.author.username}`)
                    if (!Dresseurs[collected.author.id]) return anothermessage.channel.send("Erreur : `Vous devez être un Dresseur pour effectuer cette commande : ?start`")
                    Dresseurs[collected.author.id].Sac.push(Pokemon.Noms[FinalRand])
                    Dresseurs[collected.author.id].NbPokemons += 1
                    Dresseurs[collected.author.id].Points += pokep
                    anothermessage.delete()
                })
                /*.catch(() => {
                    anothermessage.channel.send(`Le Pokemon s'est enfuit`);
                  });*/
        })
    }, 10000);
})```
#

Not work error is : username is not defined

fiery stream
#

Its undefined

lofty hamlet
#

Why ?

fiery stream
#

Because u didnt define it

lofty hamlet
#

Wtf

#

You can help me ?

mossy vine
#

where are you getting that?

lofty hamlet
#

Of ?

mossy vine
#

ah

#

yes

#

collected.author.username

lofty hamlet
#

Yes

fiery stream
#

Yep

lofty hamlet
#

And : collected.author.id

#

Id is undefined

fiery stream
#

Define it with something

mossy vine
#

its because it doesnt return a Message object

#

it returns a Collection<Snowflake, Message>

lofty hamlet
#

username is basic with discord.js right?

mossy vine
#

???

#

no

lofty hamlet
#

Uh ok

#

So, how i can make this ?

#

responses.author.username ,

#

?

mossy vine
#

wtf no

earnest phoenix
#

pls help

mossy vine
#

do you know what a fucking Collection is

earnest phoenix
lofty hamlet
#

Yes i, know

#

But how i can make this

#

Collection is :

mossy vine
#

get the values, get the first value, boom thats your Message object

earnest phoenix
#

pls help

#

what i need to do

mossy vine
#

@earnest phoenix you provided an invalid token

lofty hamlet
#

With key ?

earnest phoenix
#

no

mossy vine
#

you obviously did

#

otherwise it wouldnt throw 401

earnest phoenix
#

nope im not

ruby dust
#

dude, that's exactly what the error is saying

lofty hamlet
#

@mossy vine how i can make this 🤔 ?

earnest phoenix
#

im trying

#

nope its not about toekn

amber fractal
#

Unauthorized is invalid token

earnest phoenix
#

i chNGED

#

the token

#

its not about token

fiery stream
#

😂

#

Who made u do that?

earnest phoenix
#

?

fiery stream
#

Go and search 401 discord.js

#

And do some search

mossy vine
#

wtf thats not even a discord.js issue

#

this channel is making me lose so many brain cells help

fiery stream
#

Its for everything not just bot

earnest phoenix
#

i know

#

but

#

when i close glitch

#

its stops working

#

normally it should work

#

but when i am console

#

it workes

lofty hamlet
#

console.log(Object.values(collected))

#

@mossy vine ...

#

I can not do it :/

earnest phoenix
#
const Discord = require ("discord.js");
const fs = require ("fs");

module.exports.run = async (bot, message, args) => {
    if(message.author.id !== '546968486606536706' && message.author.id !== '390574128890904579') return message.channel.send("**❌ Vous ne pouvez pas effectuer cette commande.**");
	let user = JSON.parse(fs.readFileSync("./blacklist.json", "utf8"));
	
	let identifiant = args.join(' ');
	if(!identifiant) return message.channel.send("**❌ Veuillez entrer un identifiant valide.**");
	
	user = {
    utilisateur: identifiant
  };

  fs.writeFile("./blacklist.json", JSON.stringify(user), (err) => {
    if (err) console.log(err)
  });
  message.channel.send(`**✅ L'identifiant ${identifiant} à bien été ajouté à la blacklist.`);

}

module.exports.help = {
	name:"addblacklist"
}

When I reorder a second time, it replaces the old
Please help me

#

when i type a command

#

it says this

amber fractal
#

It tells you the warning

#

.find("username", "bob") isnt supported anymore

earnest phoenix
#

where

#

can i find that

amber fractal
#

Are you on commando?

earnest phoenix
#

no

#

js

amber fractal
#

Discord.js/commando is what I mean

earnest phoenix
#

discord js

#

what is i am using

amber fractal
#

Somewhere you use a find method not passing a function

earnest phoenix
#

but it says

#

everytime when i type and command

#

and

#

when i close glitch its gging

#

Glitch =/

#

help me

warm marsh
#

@earnest phoenix send the code you use inside message event

#

Because no doubt it's there.

warm marsh
#

Why are you sending a link to a channel's message?

earnest phoenix
#

js ? @lofty hamlet

#

What do you think it wants to define username? The author of a message?

grim aspen
#

looks like message was never set

lofty hamlet
#

@earnest phoenix yes

earnest phoenix
#

ok

lofty hamlet
#

How can I get it?

earnest phoenix
#

put this:

lofty hamlet
#

With my code ?

earnest phoenix
#

y

#

@lofty hamlet Parle français

warm marsh
#

He's using a message collection so he would require to do collection.first();

lofty hamlet
#
    setInterval(() => {
        randompop = bot.channels.get("555124662619602970")
        var pokep = Math.floor((Math.random() * (15 - 0) + 0))
        var FinalRand = Math.floor((Math.random() * (Pokemon.Noms.length)))
        var embedpoke = new Discord.RichEmbed()
            .setColor(embedcolor)
            .addField(`Pokémon sortant de nulle part`, `C'est un **${Pokemon.Noms[FinalRand]}** avec **${pokep}** Points`, false)
            .setFooter(`Appuyez sur la réaction pour le capturer`)
            .setImage(Pokemon.Gifs[FinalRand])
        randompop.send(embedpoke).then((anothermessage) => {
            anothermessage.channel.awaitMessages(response => response.content === 'capture', {
                max: 1,
                time: 30000,
                errors: ['time'],
            })
                .then((collected) => {
                    anothermessage.channel.send(`Pokemon ${Pokemon.Noms[FinalRand]} capturé par ${collected.author.username}`)
                    if (!Dresseurs[collected.author.id]) return anothermessage.channel.send("Erreur : `Vous devez être un Dresseur pour effectuer cette commande : ?start`")
                    Dresseurs[collected.author.id].Sac.push(Pokemon.Noms[FinalRand])
                    Dresseurs[collected.author.id].NbPokemons += 1
                    Dresseurs[collected.author.id].Points += pokep
                    anothermessage.delete()
                })
                /*.catch(() => {
                    anothermessage.channel.send(`Le Pokemon s'est enfuit`);
                  });*/
        })
    }, 10000);
})```
#

Not work error is : username is not defined

copper cradle
#

For the guy on general: use .leave()

#

@light matrix message.guild.me.voiceChannel.leave()

light matrix
#

oki

#

thank you

#

lemme test it in another server, i dont wanna ping the lovely mods

#

if it messes up again

earnest phoenix
#

@lofty hamlet oh you dont found

lofty hamlet
#

No ^^'

earnest phoenix
#

@earnest phoenix english only

near ether
#

How can I make my bot send a specific help message when it joins a guild?

#

Is there an event for that?

#

Like specifically for when my bot joins a guild, not when anyone else does

earnest phoenix
#

Yes its guildMemberAdd events on js

#

But doesn't use it here bc its not allowed here

near ether
#

Oh really?

earnest phoenix
#

Yes

near ether
#

Oh nvm I thought you meant in general

earnest phoenix
#

You can disabled it just for here

#

You are in javascript?

near ether
#

Yes

#

But how can I check when the bot itself joins? Is it the same event?

earnest phoenix
#

When the bot join a server?

near ether
#

Yes

earnest phoenix
#

guildCreate

near ether
#

Ok thank you so much

earnest phoenix
#

Check on google, a lots of exemples if you search guildCreate discord.js on google

near ether
#

I see

#

Thanks bro

earnest phoenix
#

Np

lofty hamlet
#

Nobody can help me ?

earnest phoenix
#

bout what?

mossy vine
#

@lofty hamlet i told you how to do it. Noone will give you complete code smh

lofty hamlet
#

Except that it's now that I'm looking for

#

Before I was with a reaction system I changed for that because no one arrived there including you

#

And even with that nobody can help me because nobody gets there

#

@mossy vine

copper cradle
#

@lofty hamlet what do u need?

lofty hamlet
#

I want the id and the name of user who answer "capture"

#

@copper cradle

#

Or id and username is not defined

molten yarrow
#

@lofty hamlet
collected.first().author
or
collected.first().author.id

earnest phoenix
#

For some reason, a bot can not play music (it just connects to the voice channel and is silent), despite the fact that all modules (opusscript, ffmpeg) are?

#

He is shy

scarlet phoenix
#

I would put my money on that they are not set up correctly

green pond
#

@copper cradle

#
if(args[1].equalsIgnoreCase("help")) {
                new Paginator.Builder()
                 .setText("this following badges are avaiable:")
                 .setItems("![dblCertified](https://cdn.discordapp.com/emojis/392249976639455232.webp?size=128 "dblCertified") **Fruit-Badge** ![dblCertified](https://cdn.discordapp.com/emojis/392249976639455232.webp?size=128 "dblCertified")", "item2")
                 .setItemsPerPage(1)
                 .setEventWaiter(waiter)
                 .setColor(e.getGuild().getSelfMember().getColor())
                 .useNumberedItems(false)    
                 .waitOnSinglePage(true)
                 .build().display(e.getChannel());
}
copper cradle
#

hey

#

huj

#

it should work

ruby dust
#

<dblCertified392249976639455232>

earnest phoenix
#

copy pasta that^

ruby dust
#

check if the bot is even in this server

green pond
#

@steep grail

ruby dust
green pond
#

its readded

ruby dust
#

what the

green pond
#

what?

ruby dust
#

damn luca should have logs when bots are readded

opaque eagle
#

Lol

ruby dust
#

is it actually this one?

green pond
#

yes

#

@ruby dust any solution?

late hill
#

Have you tried sending it as a regular message

#

Seems like the paginator thing is to create embeds?

#

setItems most likely being fields

#

Field names can't have emojis

#

Or at least that's not supported on all systems

#

So perhaps that's your problem

green pond
earnest phoenix
#

there isn’t something called bot nitro

late hill
#

Oh yeh

#

Make sure your bot is actually allowed to use external emojis in the server you're testing it

#

Could also be your issue

green pond
#

yeah, he can use external emojis

earnest phoenix
#

that’s not in fields tho

green pond
earnest phoenix
#

yours is

green pond
#

this is what he send (not embed)

mossy vine
green pond
#

![dblCertified](https://cdn.discordapp.com/emojis/392249976639455232.webp?size=128 "dblCertified")

mossy vine
#

Yes

green pond
#

yes, I use this

amber fractal
#

Do you use d.js?

green pond
#

I use jda

amber fractal
#

Ah

sturdy depot
#

how do you make a bot kick, ban, mute, warn etc?

#
  • make a rank thing for talking
amber fractal
#

Reading docs

unique nimbus
#

The rank system requires a database to hold peoples data yes

#

google and docs helps

opaque eagle
#

Lmao

sturdy depot
#

@unique nimbus and @amber fractal what do u mean?

unique nimbus
#

There is docs where you can read what to do

sturdy depot
#

ok what is it

unique nimbus
#

Do you know how to code?

sturdy depot
#

yes

unique nimbus
#

What Language?

sturdy depot
#

english

opaque eagle
#

Go read the lib's docs @sturdy depot

sturdy depot
#

k

earnest phoenix
#

lmao what

opaque eagle
#

I thought he said d.py once

#

What programming language do u know @sturdy depot

sturdy depot
#

node.js

opaque eagle
#

Ok then go look at discord.js docs

sturdy depot
#

k

#

on it

#

api?

opaque eagle
sturdy depot
#
const client = new Discord.Client();

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

client.on('message', msg => {
  if (msg.content === 'ping') {
    msg.reply('pong');
  }
});

client.login('token');```
#

that?

opaque eagle
#

No, the Discord API is not the same as discord.js...

#

Anything D.js specific that you're looking for would be in the D.js docs.

sturdy depot
#

um i dont get it

opaque eagle
#

What don't u get exactly? @sturdy depot

barren brook
#

.

zealous veldt
#

]]dotpost

covert turtleBOT
#

Please do not post dots to clear your messages/get attention. It adds absolutely nothing to the conversation and just causes spam If you need to get attention, then say hello everyone. If you need to clear your messages, then press the Esc key. If you do not follow these instructions you will be muted.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

cerulean jacinth
#

]]help

#

...

#

...

#

...

#

yeet

grim aspen
shy rose
#

@red salmon your trying to call/read post_server_count on the client object?

#

assuming its the discord bot client?

#

how are you calling it?

#

still haven't clarified how are you calling it?

#

have you got self.bot=bot

#

=bot being what ever youve called your client instance

fiery birch
#

=bot

shy rose
#

odd that matches exactly

#

and that gives the trace you sent above?

#

the most recent trace msg

#

@red salmon try post_guild_count where you have post_server_count

#

*yes i think thats it

#

cause in update logs says they removed the server count one

#

that fixed it right?

#

any decade now 😛

#

well thats progress

#

can you send me link to some other cog lib?

#

ive never used python for bots lol

#

cause got a feeling ik what it is but need to check how another cog works

#

any cog

earnest phoenix
#

Anyone here know of a good example to get me started on learning how to run bots on android?

#

Preferably JavaScript or Python

shy rose
#

android is uh

#

not ideal for either of those langs

#

can you send a url to some cog thing?

earnest phoenix
#

Ah, well i used a terminal with something my friend made and it worked

shy rose
#

it can do it yes

but its really not designed to run it

#

ive got a bot builder that can run in your browser if that counts for anything?

earnest phoenix
#

Cog? For what purpose would the cog be? [Hopefully I am correctly using the word.] Moderation or something... i can see about looking for a cog for you

calm jolt
#

can you teach me how to make a program ?

shy rose
#

cog question is for @red salmon zoomeyes

earnest phoenix
#

Oh xD

#

Also, bot builder?

shy rose
#
calm jolt
#

thank you @shy rose

shy rose
#

cant really build bots on mobile but you can take the saves and run them off mobile

earnest phoenix
#

Ah..

calm jolt
#

i need to make a bot

shy rose
#

cause mobile building support is uh

calm jolt
#

a wonderful bots

shy rose
#

you can try it but like its really not designed for it lol

earnest phoenix
#

Alright zoomeyes

calm jolt
#

i need more guidance here!

#

how to config bots please

shy rose
#

still waiting on cog GWeulixThonk

calm jolt
#

what is cog?

shy rose
grim aspen
#

nvm that question

shy rose
calm jolt
#

beautiful how did you do that

shy rose
#

without even sending a cog link GWshikizPersianDerp

trim swallow
#

@red salmon make sure your cog class is proper

#
class mycog(commands.Cog)
fiery birch
#

@shy rose ask Ken I guess idk

#

Idk bout the docs

shy rose
#

ken is?

#

tonku?

#

brain.exe has stopped responding

#

@red salmon modded clients are a void of tos in case your wondering

#

im not saying that its just incase you were wondering or considering it

sturdy depot
#

how u do mod code? like mute ban warn etc

shy rose
cobalt owl
#

Hey everyone I am hiring a developer that is willing to develop me a sneaker monitor

#

I need someone to develop me a software that can monitor websites and products and notifies you when a product releases on a site or restocks I need to be able to use proxies with the software and I need it to be able to work with discord so basically when the product drops the monitor will send notifications to multiple webhooks to discord with the link of the product and I need it to be able to work with keywords of the product. and I need it to be able to scrape websites for early links for products so you can get the link of the product before it releases on the site and I also want the software to have quick tasks for sneaker bots so basically when the notification shows up on discord it should have an option for you to choose from a couple sneaker bots you want to finish the process with and the notification should also have an ATC (add to cart) link
and the sites I need to monitor are:
all shopify sites
Monitor any new arrivals category
Monitor any Shopify earlylinks
Monitor any Non-Shopify earlylinks
Adidas
Nike
Supreme and much more

shy rose
grim aspen
#

this is discord bot development

cobalt owl
#

Oh

#

Sorry

#

Lol

grim aspen
#

but also what chewey said

shy rose
#

also im not sure on the legality of making a service of content your scraping

shy turret
#
client.on("message", (message) => {
  if (message.content.startsWith("!ping")) {
     if (fs.existsSync("data\" + .fetchMember(User) + ".txt")) {
        fs.writeFile('data\" + .fetchMember(User) + ".txt', 'File has been edited!', function (err) {
        if (err) throw err;
        });
     } else {
        let data = "File has been made!"
        fs.writeFile('data\" + .fetchMember(User) + ".txt', data, (err) => { 
        if (err) throw err; 
        }) 
     }
});
#

Why is there an error?

#

(and I don't want to use a config)

shy rose
#

whats your error trace?

#

also .fetchMember is being called on what?

#

should be client.fetchMember

shy turret
#

F:\Discord\My Discord Bot\bot.js:37
if (fs.existsSync("data" + .fetchMember(User) + ".txt")) {
^^^^^

shy rose
#

what lib are you using?

shy turret
#
const fs = require('fs') 
const Discord = require('discord.js')
const client = new Discord.Client()
shy rose
#

so in that the on messages event will have the user data in it already

shy turret
#

... how do I get the user id then?

shy rose
#

iirc

#

lemme check doc

grim narwhal
shy rose
#

@grim narwhal depends on your ide some support them some dont

shy turret
#

I'll try it, thx

willow sparrow
shy rose
#

you may see empty rectangle or other wise \ abcs (random digits) @grim narwhal

shy turret
#

F:\Discord\My Discord Bot>node bot.js
F:\Discord\My Discord Bot\bot.js:37
     if (fs.existsSync("data\" + message.author.id + ".txt")) {
                                                          ^^^^^

SyntaxError: Invalid or unexpected token
    at new Script (vm.js:80:7)
    at createScript (vm.js:274:10)
    at Object.runInThisContext (vm.js:326:10)
    at Module._compile (internal/modules/cjs/loader.js:664:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
shy rose
#

bad brackets @shy turret

#

your missing )

grim narwhal
#

@shy rose I used VS Code, where should i go to check support Emoji list?

shy rose
#

i think

#

\😄

#

paste that in ^

shy turret
#

Wait where?

shy rose
#

if you see as is above then vs is fine

grim aspen
#

let me fix the code

shy turret
#

I'm kind of new to js

shy rose
#

oh

#

hang

#

on

shy turret
#

(not to coding though)

shy rose
#

if (fs.existsSync("data\\" + message.author.id + ".txt")) { @shy turret

#

note the double backslash

#

the first backslash is escaping the quote

shy turret
#

oh wow, I tried \ before but it didn't work. guess I learned its a double backslash now

shy rose
#

so the second backslash escapes the first one

grim aspen
#

nvm hastebin's being a bitch

shy turret
#
client.on("message", (message) => {
  if (message.content.startsWith("!ping")) {
     if (fs.existsSync("data\\" + message.author.id + ".txt")) {
        fs.writeFile('data\" + message.author.id + ".txt', 'File has been edited!', function (err) {
        if (err) throw err;
        });
     } else {
        let data = "File has been made!"
        fs.writeFile('data\" + message.author.id + ".txt', data, (err) => { 
        if (err) throw err; 
        }) 
     }
});

F:\Discord\My Discord Bot>node bot.js
F:\Discord\My Discord Bot\bot.js:47
});
 ^

SyntaxError: Unexpected token )
    at new Script (vm.js:80:7)
    at createScript (vm.js:274:10)
    at Object.runInThisContext (vm.js:326:10)
    at Module._compile (internal/modules/cjs/loader.js:664:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
shy rose
#
client.on("message", (message) => {
  if (message.content.startsWith("!ping")) {
     if (fs.existsSync("data\\" + message.author.id + ".txt")) {
        fs.writeFile('data\\" + message.author.id + ".txt', 'File has been edited!', function (err) {
        if (err) throw err;
        });
     } else {
        let data = "File has been made!"
        fs.writeFile('data\\" + message.author.id + ".txt', data, (err) => { 
        if (err) throw err; 
        }) 
     }
});

that i think

shy turret
#

ok i used that

#

F:\Discord\My Discord Bot>node bot.js
F:\Discord\My Discord Bot\bot.js:47
});
 ^

SyntaxError: Unexpected token )
    at new Script (vm.js:80:7)
    at createScript (vm.js:274:10)
    at Object.runInThisContext (vm.js:326:10)
    at Module._compile (internal/modules/cjs/loader.js:664:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
shy rose
#
client.on("message", (message) => {
    if (message.content.startsWith("!ping")) {
        if (fs.existsSync("data\\" + message.author.id + ".txt")) {
            fs.writeFile('data\\" + message.author.id + ".txt', 'File has been edited!', function(err) {
                if (err) throw err;
            });
        } else {
            let data = "File has been made!"
            fs.writeFile('data\\" + message.author.id + ".txt', data, (err) => {
                if (err) throw err;
            })
        }
    }
});

take 2

shy turret
#

thx it works ❤

#

wait the command doesn't work...

#

wait I think I know tis

#

fixed it

#
client.on("message", (message) => {
    if (fs.existsSync('data\\' + message.author.id + '.txt')) {
        fs.readFile('data\\' + message.author.id + '.txt', 'utf-8', (err, beforepoints) => { 
        if (err) throw err; 
        })
        var nowpoints = beforepoints + 1
        fs.writeFile('data\\' + message.author.id + '.txt', nowpoints, function(err) {
            if (err) throw err;
       });
    } else {
        let data = "0"
        fs.writeFile('data\\' + message.author.id + '.txt', data, (err) => {
           if (err) throw err;
        })
    }
});
#

So I decided to make a points system.

#

But after it makes the first file, it makes an error.

#

I think it doesn't detect the read file into a number

#
F:\Discord\My Discord Bot\bot.js:37
        var nowpoints = beforepoints + 1
                        ^

ReferenceError: beforepoints is not defined
    at Client.client.on (F:\Discord\My Discord Bot\bot.js:37:25)
    at Client.emit (events.js:194:15)
    at MessageCreateHandler.handle (F:\Discord\My Discord Bot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (F:\Discord\My Discord Bot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:105:65)
    at WebSocketConnection.onPacket (F:\Discord\My Discord Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (F:\Discord\My Discord Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
    at WebSocket.onMessage (F:\Discord\My Discord Bot\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:189:13)
    at Receiver.receiverOnMessage (F:\Discord\My Discord Bot\node_modules\ws\lib\websocket.js:789:20)
    at Receiver.emit (events.js:189:13)
earnest phoenix
#

json?

shy turret
#

I don't like configs

earnest phoenix
#

Number cant be in a string on json

shy turret
#

how do you even make a json?

copper cradle
#

@shy turret ```json
{
"SOMETHING1": "hola",
"SOMETHING2": "Hello"
}

#

json

shy turret
#

nah

#

found a way to convert string into number

#

just need to learn number into string

#
client.on("message", (message) => {
    if (fs.existsSync('data\\' + message.author.id + '.txt')) {
        fs.readFile('data\\' + message.author.id + '.txt', 'utf-8', (err, points) => { 
        if (err) throw err; 
        })
        points = parseInt(points, 10)
        var points = points + 1
        var points = '' + points
        fs.writeFile('data\\' + message.author.id + '.txt', points, function(err) {
            if (err) throw err;
       });
    } else {
        let data = "0"
        fs.writeFile('data\\' + message.author.id + '.txt', data, (err) => {
           if (err) throw err;
        })
    }
});

Variables Changes Into:

1: undefined
2: NaN
3: NaN
4: NaN
#

Why is the first one undefined

#

No error

shy rose
#

Your re definiing the variable points

#

Where your parse int is

shy turret
#
client.on("message", (message) => {
    if (fs.existsSync('data\\' + message.author.id + '.txt')) {
        fs.readFile('data\\' + message.author.id + '.txt', 'utf-8', (err, points) => { 
        if (err) throw err; 
        })
````        points = parseInt(points, 10)` ```js
        var points = points + 1
        var points = '' + points
        fs.writeFile('data\\' + message.author.id + '.txt', points, function(err) {
            if (err) throw err;
       });
    } else {
        let data = "0"
        fs.writeFile('data\\' + message.author.id + '.txt', data, (err) => {
           if (err) throw err;
        })
    }
});
#

there

shy rose
#

Now your double re defining it

shy turret
#

wdym

#

where?

shy rose
#

Points parse int

Then the lines below you declear it twice

shy turret
#

?

shy rose
#

I'm on mobile now so can't point it out but..

shy turret
#

k

shy rose
#

Basic js now

shy turret
#

gotta go

#
client.on("message", (message) => {
    if (fs.existsSync('data\\' + message.author.id + '.txt')) {
        fs.readFile('data\\' + message.author.id + '.txt', 'utf-8', (err, varpoints) => { 
        if (err) throw err; 
        })
        points = parseInt(varpoints, 10)
        var points = points + 1
        fs.writeFile('data\\' + message.author.id + '.txt', points, function(err) {
            if (err) throw err;
       });
    } else {
        let data = "1"
        fs.writeFile('data\\' + message.author.id + '.txt', data, (err) => {
           if (err) throw err;
        })
    }
});
#

just gonna post that and go

#
F:\Discord\My Discord Bot>node bot.js
Bot is ready!
F:\Discord\My Discord Bot\bot.js:37
        points = parseInt(varpoints, 10)
                          ^

ReferenceError: varpoints is not defined
    at Client.client.on (F:\Discord\My Discord Bot\bot.js:37:27)
    at Client.emit (events.js:194:15)
    at MessageCreateHandler.handle (F:\Discord\My Discord Bot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (F:\Discord\My Discord Bot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:105:65)
    at WebSocketConnection.onPacket (F:\Discord\My Discord Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (F:\Discord\My Discord Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
    at WebSocket.onMessage (F:\Discord\My Discord Bot\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:189:13)
    at Receiver.receiverOnMessage (F:\Discord\My Discord Bot\node_modules\ws\lib\websocket.js:789:20)
    at Receiver.emit (events.js:189:13)
#

and that

shy rose
#

Double decleration on on points

And var points like error says isn't defined

shy turret
#

k back

#

why isn't it defined

shy rose
#

Cause you haven't defined it...

shy turret
#
        fs.readFile('data\\' + message.author.id + '.txt', 'utf-8', (err, varpoints) => { 
#

i did

shy rose
#

Not in that scope

late hill
#

Are you using txt files as database rolf

earnest phoenix
#

@shy turret you dont need to convert string into number

#

Just delete the string

#

let n = 0

#

For your let data

proper inlet
#

There is a string. It is necessary to encode it in base64 using only the node.js tools. How do i do this?

mossy vine
#

iirc the btoa() and atob() functions exist in node

spring ember
#

@proper inlet

 Buffer.from(string).toString('base64')
mossy vine
#

Or that

proper inlet
#

Thank you

shy turret
#

I found out the problem that the file isn't even read.

spice pivot
#

i dont understand , how i can add my bot to the website ?

quaint hare
earnest phoenix
#

@shy turret can you send it?

#

hey here is a solution

dont use text files as a database

earnest phoenix
#

hi

#

(node:116) DeprecationWarning: Collection#find: pass a function instead

#

can someone help

deft grove
#

Hey im beginner ish. Got a basic bot set up looking for ideas for new commands

knotty steeple
#

@earnest phoenix hi

#

i assume ur using this Collection.find("thing", "something else")

earnest phoenix
#

in bot.js?

#

no i dont

knotty steeple
#

ok so how do u get a deprecation warning

earnest phoenix
#

idk

knotty steeple
#

what the fuck

earnest phoenix
#

im sending ss

knotty steeple
#

youtube api token revealed

earnest phoenix
#

İll try

knotty steeple
#

reset it

#

also

#

i cant help u if you dont see any problem

earnest phoenix
#

ik

#

leme reset the api

#

doesnt worked

pallid zinc
#

Is it possible to auto role bot ?

#

With .filter

shy turret
#

yah

#

i think

topaz sphinx
#

really unusual question

#

when it comes to bot voting system

earnest phoenix
#

(node:10232) DeprecationWarning: Collection#find: pass a function instead

#

can someone help

topaz sphinx
#

goddammet wanttodie

#

yes fine

#

deprecation warning means ur using an old function

#

that's about to get removed / is already removed

earnest phoenix
#

functions.js?

#

what will i do

topaz sphinx
#

find an alternative to it

earnest phoenix
#

and how i can find where i used that

#

i forgot

topaz sphinx
#

find what specific thing hm

earnest phoenix
#

(node:10232) DeprecationWarning: Collection#find: pass a function instead

topaz sphinx
mossy vine
#

@earnest phoenix <Collection>.find as youre using it, is deprecated. you need to pass a function to it instead
https://discord.js.org/#/docs/main/stable/class/Collection?scrollTo=find

#

@topaz sphinx Collection is a discord.js thing, so general javascript docs dont apply here

topaz sphinx
#

i see

#

alrighty

#

@mossy vine quick question btw

#

u know voting system

#

how would i implement it when it comes to commands

mossy vine
#

use the dbl api to fit your needs

topaz sphinx
#

do i have to make the user obliged to vote as /vote command or can i disguise it inside another command

mossy vine
#

you can see if the user has voted when running the command

topaz sphinx
#

yes indeed

#

but can i disguise the vote webhook

mossy vine
#

wdym

topaz sphinx
#

inside a frequently used command

west spoke
#

:v

topaz sphinx
#

as in, if the user use a command called "meme"

west spoke
#

Yes

topaz sphinx
#

that'd be counted as vote as in the user has used a command that's connected to the bot

#

including having its own unique id

west spoke
#

Let's say instead of /vote you wanted something like /cat

topaz sphinx
#

yes

west spoke
#

You would just rename the command...?

topaz sphinx
#

yes

#

would that be allowed

#

or

#

more like

mossy vine
#

so what you want, is to only be able to run a command if the user running it has voted?

topaz sphinx
#

implement the vote command inside a functional command

west spoke
#

That's common tbh

topaz sphinx
#

that'd vote hiddenly

mossy vine
#

you could use the webhook to store the user ids that have voted, and check if the user running the command is included in your array or map of user ids

topaz sphinx
#

yes and then log the timer to be 12h 5 min between each vote call

mossy vine
#

you dont need a timer

topaz sphinx
#

u sure?

mossy vine
#

why would you?

topaz sphinx
#

but then why do i need the user id's logged

#

i mean sure for like one time only

#

but would it really need to be saved

#

goal isnt to take all user id's and mass-vote

mossy vine
#

because .hasVoted might be a bit delayed

topaz sphinx
#

ah

#

so you mean like a queue

mossy vine
#

while webhooks basically get trigerred instantly

#

so if a user has voted, they wouldnt need to wait minutes before they can use the command

topaz sphinx
#

i thought of just throwing it into a cog

#

ah wait yes

#

i see

#

hasVoted is delayed

#

but webhook is instant

#

yes

mossy vine
#

yes

topaz sphinx
#

i throw all of it into a cog

#

while they use the bot, and run the cog separately

supple copper
#

türk varmı?

topaz sphinx
#

in the bg

#

so the user dont experience any latency

mossy vine
#

i dont use python and i have no idea what a cog is, but yeah, i think youre right

topaz sphinx
#

cog is kinda like a thread

#

but doesnt nessesarily mean its multithreaded

#

cause cogs can run at single threads

#

it rely on timing