#development

1 messages ยท Page 1634 of 1

rustic patrol
#

Guys

vivid fulcrum
#

there's no going around it

rustic patrol
#

How do I add my bot here?

vivid fulcrum
rustic patrol
#

How?

vivid fulcrum
#

read the faq

rustic patrol
#

I did

vivid fulcrum
#

you didn't

rustic patrol
#

It tells me to go to development

vivid fulcrum
#

read above that single section

rustic patrol
#

K

vivid fulcrum
#

a user can sniff traffic for anything

solemn latch
#

i can smell parm from here /s, im sorry ๐Ÿ‘€

rustic nova
#

aww poor Tim doesn't have blue name anymore sad

quartz kindle
#

sad

earnest phoenix
#

Is it possible to point the console to a channel?

#

I am using d.js v12

viscid gale
vivid fulcrum
#

are you genuinely high

#

discord was proof of concept lol

viscid gale
#

in terms of trying to hide the script, discord is basically example.com

crimson vapor
viscid gale
#

can you at least try ur sniffer.. me and feud were dealing with look, it specifically doesnt work like this, and look, it specifically is found like this

#

also if by some magic i could have code that could confuse a step by step debugger.. i think it'd be at least a bit difficult for a sniffer to understand as well

eternal osprey
#

hey! So i am using discord.js audiostream (createstream) to record voicechats. However, it exports as a pcm file. How would i export it as mp3 instead?

drifting shell
#

anyone here for some JS help, its confusing the fuck out of me

#

i just realised i unintentionally advertised

#

posted code that had a discord invite in it, oops

#
  const eles = document.getElementsByClassName('entity-sidebar__button no-link'); 
  if (eles.length === 1) {
      eles[0].setAttribute('href', 'mydiscordinvitehere')
  } else {
      eles[2].setAttribute('href', 'mydiscordinvitehere')
  }
#

for some reason the if statement always returns false SadCat

snow urchin
quaint wasp
#

hey

#

Umm

#

idk how to define toLowerCase

solemn latch
#

why do you need to define it?

quaint wasp
#

cuz I get an error saying its undefined.

#

sooo

#

Can yall help me define that?

earnest phoenix
#

toLowerCase shouldnโ€™t be defined, should work without error

#

it has to work on a string however

quaint wasp
#

Letters ARE strings... right?

earnest phoenix
#

yes, but then they needed to be surrounded by quote marks

quaint wasp
#

but what if its in vsd?

#

Like name of file?

#

cuz im trying to define command

#

and I got this:

#

        const name = args[0].toLowerCase();
        const command = commands.get(name) || commands.find(c => c.aliases && c.aliases.includes(name));
earnest phoenix
#

ok, and you said toLowerCase is not defined?

quaint wasp
#

ya

#

it tells me

#

in error

earnest phoenix
#

well, it should work, unless args is not correct

quaint wasp
#

TypeError: Cannot read property 'toLowerCase' of undefined is full error..

#

help?

solemn latch
#

args[0] is undefined

#

not toLowerCase

#

Cannot read property 'toLowerCase' of undefined
means
you cannot use .toLowerCase on something thats not defined, not toLowercase is undefined.

quaint wasp
#

o

#

But I have args

solemn latch
#

console.log(args);

quaint wasp
#

in index, it defines like this: const args = message.content.slice(prefix.length).trim().split(/ +/);

quaint wasp
solemn latch
#

log it in the command

quaint wasp
#

what

#

why

#

fine,

sudden geyser
#

Opinion: When searching for a guild member by name, should I consider their username & nickname or leave it out?

quaint wasp
sudden geyser
#

This is for the user to search.

quaint wasp
#

o

#

hmm

#

consider it.

solemn latch
#

yeah, i almost always still search by username still

sudden geyser
#

I fucked up, meant both their username and nickname

solemn latch
#

should do both

quaint wasp
#

oh

#

yes

#

both

sudden geyser
#

alright, I'll do both

quaint wasp
#

soo

solemn latch
quaint wasp
#

@solemn latch why did u tell me to log?

#

maby?

solemn latch
#

its kinda important the location you logged it at.

#

if you logged in index, and not in the command itself it wont mean anything.

quaint wasp
#

what do u mean by, log it in command?

solemn latch
#

discord?

#

please

#

thats weird ๐Ÿ‘€ ive never seen discord not embed images like that

quaint wasp
#

lol

#

happens to me all the time..

#

๐Ÿ˜

quaint wasp
#

๐Ÿ˜

#

Gives me so many useless stuff and just fills my console..

solemn latch
#

your passing a message object where args goes

quaint wasp
#

?

#

what

solemn latch
#

when you use execute in your index.js, the order of parameters needs to be the same in index.js and in your execute function

#

this is out of order

#

in your index, its something like
execute(something, message, something)

#

when args needs to be the second one

#

or the command needs to be changed, whichever is easier

viscid gale
quaint wasp
#

ya..

#

I fixed it

solemn latch
quaint wasp
#

now it lookslike it is in my index..

#

still does gives the sames error.

solemn latch
#

args is empty

quaint wasp
solemn latch
#

so args[0] is empty

quaint wasp
#

yes..

#

it checks if theres anything else after ++help.

solemn latch
#

and there isnt, so you cant tolowercase it

#

only tolowercase if something is there

quaint wasp
#

soo.

#

means I can just take that part away?

solemn latch
viscid gale
#

uh.. ok lemme explain the context

solemn latch
viscid gale
# solemn latch there are a handful of free sniffers online if you need one

basically for fun im trying to make something that can return script to the client without the user being able to see or manipulate the script.. it sounds impossible but im actually making progress.. if u wanna try.. try sniffing https://hidejs-example.paultaylor2.repl.co/ you're looking for a script that looks like

try{alert('HIDDEN SCRIPT >:D\nAt...\n/')}catch(err){}

you can use any means to try to find this script.. you probably can still find it but it wont be AS EASY as you think

quaint wasp
#

wait

#

@dim brook

solemn latch
#

feels bad wook

quaint wasp
#

sorry wrong user

#

umm

solemn latch
#

you dont have to tag me unless i dont respond ๐Ÿ‘€

quaint wasp
#

It turns out I was looking for FILE name..

#

and that means I just remove [0]?

solemn latch
#

if its not an array

quaint wasp
#

what do you mean array?

solemn latch
#

[0] is accessing the first thing in an array

#

if your not doing that, you dont need it

quaint wasp
#

that is similar to the requeest?

proven lantern
#

i am switching from discordjs to discordjs-light and this is now returning false. the bot does have manage roles permissions.
msg.guild.me.hasPermission("MANAGE_ROLES")

quaint wasp
#

why?

solemn latch
#

hmm?

quaint wasp
#

its .js file

solemn latch
#

whats the actual problem say?

#

unexpected end of file?

quaint wasp
#

never mind.. I didnt had }

#

do i really need torestart my WHOLE bot everytime to just update a command code?

solemn latch
#

nope

#

you can have a reload command

#

or if using pm2 you can tell it to auto restart when you change files

quaint wasp
quaint wasp
#

Whats scandir?

#

any why is it not a directory?

solemn latch
#

whats the code look like?

quaint wasp
#

oh

#

one sec

proven lantern
#

avatar.js is a file not a directory

quaint wasp
#
const fs = require('fs')

const commandFolders = fs.readdirSync('./commands');
const folderName = commandFolders.find(folder => fs.readdirSync(`./commands/${folder}`).includes(`${commandName}.js`));
module.exports = {
    name: 'reload',
    execute: async (client, message, args) => {

if (!args.length) return message.channel.send(`You didn't pass any command to reload, ${message.author}!`);
const commandName = args[0].toLowerCase();
const command = message.client.commands.get(commandName)
    || message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));

if (!command) return message.channel.send(`There is no command with name or alias \`${commandName}\`, ${message.author}!`);

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

try {
    const newCommand = require(`../${folderName}/${command.name}.js`);
    message.client.commands.set(newCommand.name, newCommand);
} catch (error) {
    console.error(error);
    message.channel.send(`There was an error while reloading a command \`${command.name}\`:\n\`${error.message}\``);
}

message.channel.send(`Command \`${command.name}\` was reloaded!`);

    }
}```
proven lantern
#

readdirSync wants a directory not a file

quaint wasp
#

that whole thing is from here

#

oh

#

I got it!

#

on line const folderName = commandFolders.find(folder => fs.readdirSync(./commands/${folder}).includes(${commandName}.js));

#

I should remove .commands/${folderr}

#

and just put ./${folder}

#

nope..

#

still same error..

#

anyone knows how to ix this?

#

fix

quaint wasp
#

guys

#

so

#

I changed my cmds a littile

#

Now idk how to make my index listen to files in folders...

sterile lantern
#

do readDir for all the directories

#

that have commands

#

basically@copy and paste and change the path

quaint wasp
#

o

#

done..

#

Now..

#

I made smth new..

#

And it worked PERFECTLY...

#

and just out of NO where..

#

this error came up:

#

error: ```TypeError: event.bind is not a function

code:
```js
fs.readdir("./events/", (err, files) => {
    if (err) return console.error(err);
    files.forEach(file => {
      const event = require(`./events/${file}`);
      let eventName = file.split(".")[0];
      client.on(eventName, event.bind(null, client));
    });
});```
ripe prairie
#

it breaks

#

yep

#

welcome to code

quaint wasp
#

Biggest weeb, huh?

#

lol

#

so

#

Anyone knows how to fix that?

ripe prairie
lyric mountain
#

How to fix a biggest weeb?

ripe prairie
#

dont fix what aint broke

lyric mountain
#

But what about my cat?

#

It's not behaving like a solid

quaint wasp
#

same thing..

#

still

#

wrong..

#

same error

#

๐Ÿ˜ฆ

#

help

ripe prairie
quaint wasp
#

ya

#

mine do

#

but the error is from index.

viscid gale
solemn latch
#

ah

quaint wasp
#

?

opal plank
#

im not surprised whatsoever that's generating errors, theres not a single error handler there

sudden geyser
#

They probably forgot to export a function

opal plank
#

not only that, the way that's done is also stupid

#

im bored enough, fuck it, i'll spoonfeed it for one

sudden geyser
#

everything else is primitive but works

quaint wasp
opal plank
#
try {
let events = fs.readdirSync("./events/").catch((...e) => {console.log(e); return} );
if(!events) return // or throw here to stop it from continuing, most likely folder is inexistent
for(let _event of events) {  
try {
 let binder = require(`./events/${_event}`);
  //do whatever you want here
} catch(e) {console.log(`Command ${_event} failed`, e)}
}

} catch(e) {console.log("loader failed",e)}

too lazy to do indentation or the rest, figure that out

#

@quaint wasp

quaint wasp
#

wow

#

dang

sudden geyser
#

That looks less reliable

opal plank
#

either throw or exit process if the readdir fails

quaint wasp
#

why is there _?

opal plank
#

cuz thats what i name my variables that are related to eachother but are nmamed similarly

#

events and event are too similar

#

so i tend to stack them with _ if they are related AND similarly named

sudden geyser
#

What about evt

dark crest
#

y its not woek ๐Ÿ˜ฆ

quaint wasp
#

so complicated

sudden geyser
#

This is the key

dark crest
#

so how to fix that?

opal plank
#
for (let event of eventsArray) {  
  for(let event of eventsArray) {
    for(smallerEvent of event) {}
    }
}

i rather do

for (let event of events) {  
  for(let _event of event) {
    for(__event of _event) {}
    }
}

but thats purely personaly preference

opal plank
#

figure out the rest

#

if you're at the level of blindly copy pasting code, you shouldnt be coding a discord bot

opal plank
#

shorttening stuff like that makes a hell to dig through code

#

you'll often see the usage of _ in a lot of more professional looking code

#

though a lot of times its used as a reference for internal stuff

sudden geyser
#

I often use and see _ used as a prefix for a variable/name to indicate it's unused/private.

opal plank
#

though i use in both cases

quaint wasp
#

imagine being Erwin.. weeb1

sudden geyser
#

Yeah I said that like 1 second after :p

#

But there's nothing wrong with using evt imo

dark crest
opal plank
#

for event of events
for evnt of event
for evn of evnt
for e of evn

if you go down that rabbit hole you'll find yourself choking at the hands of another dev

sudden geyser
#

They both work

#

That's really just preference

opal plank
#

indeed, but standards are there to be followed

#

otherwise people would be coding in sPonGEBoBCasE

sudden geyser
#

What standard says I shouldn't use evt as a name and instead _event, evnt, etc.? Even if that were a standard, that's such a petty thing

opal plank
#

same as Pascal case for classes , or _ for private/internal stuff, theres a lot of minor stuff you SHOULD follow, not that its necessarily a requirement

#

variables should be named what they are for

#

evt says nothing

#

doesnt explain what the variable is about

sudden geyser
# dark crest so how to fix that?

I don't know since the error points to a permission denied issue from npm logs and opening the better-sqlite3's package file. Maybe try running it with higher permissions like it suggests

opal plank
#

readability wise its better to use _ as a different way to name your variables

dark crest
sudden geyser
#

evt says nothing
doesnt explain what the variable is about
I'd say evt is sufficient. If you see for (const evt of events) {...}, you can infer what evt is. Even then, I don't regularly try shortening a variable if it's close to another variable name (but keep aware of it). I'd rather use for (const event of events) {...}. I understand the use of following standards.

If I wanted to argue, I could say _event is a bad practice since it indicates _event is either private or unused yet you're using it like a regular variable.

This isn't a matter of following standards. It's a matter of preference.

opal plank
#

i disagree

#

most loops you would use internally

#

its very few exceptions where you would be exporting something for user consumption within a loop

#

and even if you would, those exported things would get renamed by the user/consumer

sudden geyser
#

What kind of loop do you use publicly? It's a body of expressions. It's not as common to use _ for a variable name to indicate privacy in an expression, but rather as unused. I could write ```js
for (const _x of yz) {
console.log(_x)
}

because it's "internal" and not "exported" to the user, but that looks weird. Like I'm saying, use `_event` if you really want to. I'm not going to come to your house and hold a balloon next to your ear and pop it if you don't, but other names like `event`, `evt`, `evnt`, etc. are also acceptable. It's not a matter of following standards because it compiles down to preference.
opal plank
#

i disagree still, the example you are showing starts with a _ right away,m impling its used internally, what im suggesting is maintaining code redability while implying scopes using the same variable.
event explains what it is
evt and evnt doesnt, while they are shorthand of event, it still doesnt describe what the variable is about, which kills its readability

pale vessel
#

I always add _ as a prefix to variables when using methods like .map() to prevent variable overlapping

opal plank
#
let array = [[[1]],[[1]],[[1]],[[1]]];
for(let arr of array) {
  for(let _arr of arr) {
    for (let __arr of _arr) {
      console.log(__arr); //1;
}
}
}

// is more readable than

let array = [[[1]],[[1]],[[1]],[[1]]];
for(let arr of array) {
  for(let ar of arr) {
    for (let a of ar) {
      console.log(a); //1;
}
}
}

the former implicitly mentions the usage of the parent variable, while the latter is just mushing random variable names for random usage

latent heron
#

what the fuck

sudden geyser
#

what im suggesting is maintaining code redability while implying scopes using the same variable.
Again, that comes down to preference. evt and evnt are understandable from my perspective because I know it's a value from events. If you're in a loop spanning a lot of lines, maybe it won't.

The former is cleaner and easier to read, but __arr can be seen as misleading since __arr can implicitly imply that __arr is an array when it's a number. Then again, a change in the name to num fixes this. The second disadvantage is you need to count how many underscores you have (and they're very close together), but a good font can solve this. You don't have to shorten your variables. In fact, I'd discourage shortening a shortened name. Instead, what could've happened in the latter could've been different names to represent the value, but since your example is very primitive ([[[T]]]), it's hard to think of what that could be.

dark crest
#

help?

drifting wedge
#

what can i use to make an animated wave in html?

#

something like this

#

but it moves

quaint wasp
#

๐Ÿ˜ฆ

#

My bot isnt responding.

#

I think the cmd handler is trash.

sudden geyser
#

It probably works. You're just using it incorrectly.

quaint wasp
#

๐Ÿ˜

sudden geyser
#

May I ask if you have a good understanding of JavaScript?

quaint wasp
#

Its...

#

kinda?

#

I can readthe code

#

the

#

And I can code basic stuf

#

BASIC.

#

oop

sudden geyser
#

You may want to spend more time learning the language.

quaint wasp
#

Here comes Not Erwin

sudden geyser
#

Discord bots can be simple for some, but to a beginner, it's difficult.

quaint wasp
#

at some points yes

#

Farrr not all the time

sudden geyser
opal plank
# sudden geyser > what im suggesting is maintaining code redability while implying scopes using ...

yeah my example was crude, by my point still stands
using the example preiovusly

let events= [[[event]],[[event]],[[event]],[[event]]];
for(let event of events) {
  for(let _event of event) {
    for (let __event of _event) {
      console.log(__event); //event;
}
}
}

// is more readable than

let events= [[[event]],[[event]],[[event]],[[event]]];
for(let event of events) {
  for(let evnt of event) {
    for (let evn of evnt) {
      console.log(evn); //event;
}
}
}
pale vessel
#

I prefer underscores since they're consistent

#

dotenv is still good though, smh erwin

opal plank
#

fuck you too

pale vessel
#

mmlul

sudden geyser
#

anyway can we just agree to disagree

opal plank
#

indeed

quaint wasp
dark crest
#

if someone who know how to use vps can come to my voice that will be lovely

#

ho i can screen sher ๐Ÿ˜ฆ

solemn latch
#

on pc?

earnest phoenix
#

You need bot developer or nitro booster role

solemn latch
#

screenshare bottom left

#

oh

#

yeah

#

๐Ÿ‘€

dark crest
#

no per

#

m

#

๐Ÿ˜ฆ

solemn latch
#

if your having problems with using your vps, you should contact your vps provider

dark crest
sudden geyser
#

yo when did you become a mod

solemn latch
#

got trial like an hour ago

#

๐Ÿ‘€

earnest phoenix
#

@dark crest do you know how to use ssh and stuff?

sudden geyser
#

ah

#

congrats

solemn latch
#

ty

dark crest
earnest phoenix
#

Thats how you connect to your vps

dark crest
#

i connect him

earnest phoenix
#

For file transfer its ftp/sftp

dark crest
#

this is my [rob

#

its not run my bpt

#

bot

earnest phoenix
#

Oh

dark crest
earnest phoenix
#

I dont think so-

dark crest
#

oof

solemn latch
#

you copy pasted your node modules folder right?

dark crest
#

no i installed new

solemn latch
#

hmm

quaint wasp
solemn latch
#

did you install it than upgrade nodejs?

quaint wasp
#

lol

earnest phoenix
#

I dont think thats vps?

dark crest
solemn latch
#

okay, then delete node modules and do npm i in the proj root

earnest phoenix
#

^

dark crest
solemn latch
#

the root folder, the project folder

dark crest
#

so put the bot in the root folder?

earnest phoenix
#

project folder aka folder with the package.json file

#

Delete node modules in the project folder and run npm i in the project folder

dark crest
#

i shwold put the bot proj in the root folder?

earnest phoenix
#

No need to

dark crest
#

ok

solemn leaf
#

Im trying to get the locations bewteen 2 points on a x y grid I need help with the math or something

earnest phoenix
#

You mean distance?

solemn leaf
#

no

#

I 2want to make an array

#

for the points bewteen the 2 points

earnest phoenix
#

[p1, p2] right?

solemn leaf
#

?

#

It also needs to work all directions thats why Im struggling?

earnest phoenix
#

Ah, nevermind, i dont understand, sorry.

solemn leaf
#

say like I had point 1,1

#

and point

#

1,5

#

array would be

earnest phoenix
#

1,1 to 1,5 right?

solemn leaf
#

"1,4", "1,3","1,2"

#

say point

earnest phoenix
#

Ah i see

solemn leaf
#

"5,1","1,1

#

Im making collision for a 2d grid

small meteor
#

Can someone help me with guild.join scope? When someone logs into my web panel, I want it to have them join the Discord for the Bot in case of support.

#

I picked all the correct oauth stuff, just dont know how to make it add the user to my guild.id

dark crest
#

๐Ÿ˜ฆ

small meteor
#

run this: npm install latest-version

#

Also, the npm your trying to install isn't comp with node 15

dark crest
magic parcel
#

My bot logs all bans into concol but I want to execute a command if there is over 2 bans logged in a second. no clue how to do it.

magic parcel
#

i want to make the command if the consol logs something more than twice a second a will execute

feral aspen
#

When you are trying to check for multiple permissions, should I use logical and operators, or do I use an array?

if(!message.guild.me.hasPermission(["SEND_MESSAGES", "EMBED_LINKS"])) return;
earnest phoenix
#

Is it possible to save int in .env

proven lantern
feral aspen
#

Thanks!

#

Is there a way I can check if if(this is true && this is false) {... executes ...}

proven lantern
#

this can never be true and false at the same time

lapis geode
#

If (this == true && that != true)

feral aspen
#

Is there something like

if(variable && !variablefalse) return;
#

?

lapis geode
#

Yes. If you for example have an empty object or something like that it would be false

proven lantern
#

if (typeof variable === "boolean")

#

this might be what you want

feral aspen
#

nonon

#

For example

#
let variable;
let variableTwo = "Hello!";

if(variableTwo && !variable) console.log("Ok");
proven lantern
#

yep, that works

feral aspen
#

It works same as ```js
if(!variable && variableTwo) console.log("Ok");

... right?
proven lantern
#

yep, if they are functions they could be different

crimson vapor
# solemn leaf

you can iterate through every different x and y ex. P1 (1, 2) P2 (5, 4) loop 1 to 5 and for each of those, loop 2 to 4

feral aspen
#

Instead of checking things like

if(!variable && !variableTwo && ....)

// Does this work?
if(![variable, variableTwo, variableThree, ...]);
proven lantern
#

nope

feral aspen
#

Makes sense.

#
if(!variable && !variableTwo) return;

This works though.

proven lantern
#
if(!val || !acc) return false
return true;
  }, true)```

```const allTrue = [variable, variableTwo, variableThree, ...].reduce((acc, val) => !(!val || !acc), true)```
feral aspen
#

Oh, thank you! ๐Ÿ˜Š

cursive bough
#

@humble gyro hi

feral aspen
#

Anyways, thanks! :)

crimson vapor
#

it would be better to do js arr.some(e => !e)

proven lantern
#

can i pass an array of channel ids instead of just one?
client.channels.fetch('222109930545610754')
https://discord.js.org/#/docs/main/stable/class/ChannelManager?scrollTo=fetch

pale vessel
#

Just one

proven lantern
#

darn

zinc palm
#

What can i use to make a bot ๐Ÿ˜›

lusty quest
#

check the pins in this channel

old cliff
blissful coral
#

anyone here know ejs

#

lul

#
TypeError: C:\Users\Noah\Desktop\aqualix-dashboard\Build\pages\public\index.ejs:1
 >> 1| <%- include("../partials/header", { bot, user, path, title: "Welcome" }) %>

    2| 

    3| <div id="wrapper-main">

    4|     <script src="/socket.io/socket.io.js"></script>


include is not a function
    at index (eval at compile (C:\Users\Noah\Desktop\aqualix-dashboard\node_modules\ejs\lib\ejs.js:662:12), <anonymous>:51:17)
    at tryHandleCache (C:\Users\Noah\Desktop\aqualix-dashboard\node_modules\ejs\lib\ejs.js:272:36)
    at View.exports.renderFile [as engine] (C:\Users\Noah\Desktop\aqualix-dashboard\node_modules\ejs\lib\ejs.js:489:10)
    at View.render (C:\Users\Noah\Desktop\aqualix-dashboard\node_modules\express\lib\view.js:135:8)
    at tryRender (C:\Users\Noah\Desktop\aqualix-dashboard\node_modules\express\lib\application.js:640:10)
    at Function.render (C:\Users\Noah\Desktop\aqualix-dashboard\node_modules\express\lib\application.js:592:3)
    at ServerResponse.render (C:\Users\Noah\Desktop\aqualix-dashboard\node_modules\express\lib\response.js:1012:7)
    at module.exports (C:\Users\Noah\Desktop\aqualix-dashboard\Build\functions\renderPage.js:8:9)
    at C:\Users\Noah\Desktop\aqualix-dashboard\Build\routes\index.js:8:5
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
lusty quest
#

include is not a thing in ejs iirc

blissful coral
#

...??

#

Yes it is lmao

round cove
old cliff
#

are you sure you are using ejs ?

round cove
#

sadly

old cliff
#

cause include should work if you are using ejs

earnest phoenix
#

How can i round image corners in canvas? I'm trying to round the corners of my background image.

icy patio
#

Someone knows Status can add more๏ผŸ

lethal trout
#

I made the set edit logs cmd
but it logs in the same channel the message is edited not in the logs channel

https://media.discordapp.net/attachments/272764566411149314/817806870356951050/unknown.png?width=559&height=427
https://media.discordapp.net/attachments/272764566411149314/817806956043305030/unknown.png

https://sourceb.in/437SJ3EmcM
https://sourceb.in/ESFjGOQIKs

const { Schema, model } = require("mongoose");
module.exports = model(
    "logging",
    new Schema({
        req: {
            required: true,
            type: Boolean,
            default: false
        },
        channelID: {
            type: Number
        },
        guildID: {
            type: Number
        },
        MessageUpdate: {
            required: true,
            type: Boolean,
            default: false
        },
        MessageDelete: {
            required: true,
            type: Boolean,
            default: false
        }
    })
);```

I made the set edit logs cmd 
but it logs in the same channel the message is edited not in the logs channel for some reason it getting the id and logging it but not sending it pls help
robust moth
#

how i do black white in canvas
like this

#

in js

#

pls help

#

@earnest phoenix

#

u will help me?

earnest phoenix
robust moth
#

i know

earnest phoenix
#

Set the background to a black and white background if you want

robust moth
#

i have the code

earnest phoenix
#

Then why not use it? Lol

robust moth
#

but i dont know how to do black white picture like the background

earnest phoenix
#

Hmmm

#

This is an example of what I did with my bot for the canvas.js whois command

#

TopGGAPIError [Top.GG API Error]: 401 Unauthorized (You need a token for this endpoint)

robust moth
#

i know to do it but i want the avatar be black and white

earnest phoenix
#

what to do

earnest phoenix
#

@robust moth do JS

#

white text moment

#

And with your code

robust moth
#

send my code?

earnest phoenix
#

Do

``````JS

#

Put your code in the JS

#

But do shift+enter

robust moth
#

i know do that

earnest phoenix
#
const background = await Canvas.loadImage('IMAGE_LINK_HERE');
    // This uses the canvas dimensions to stretch the image onto the entire canvas
    ctx.drawImage(background, 0, 0, canvas.width, canvas.height);```
#

That's how to do it

cinder patio
#

they want to make the user's avatar black and white

earnest phoenix
#

@cinder patio oh, IDK how to do that LMFAO

#

Probably add a filter

magic parcel
earnest phoenix
#

?

#

Wdym?

robust moth
#

this is the code

#
if (message.content.startsWith('!wasted')) {
        if (!message.mentions.users.first()) {
            user = message.author
        } else {
            user = message.mentions.users.first()
        }
        const canvas = Canvas.createCanvas(512, 512);
        const ctx = canvas.getContext('2d');

        const avatar = await Canvas.loadImage(user.displayAvatarURL({ format: 'jpg' }));
        const background = await Canvas.loadImage(avatar);
        ctx.drawImage(background, 0, 0, canvas.width, canvas.height);

        ctx.strokeStyle = '#74037b';
        ctx.strokeRect(0, 0, canvas.width, canvas.height);

        const wasted = Canvas.loadImage(`./wasted.png`);
        ctx.drawImage(wasted, 0, 0, canvas.width, canvas.height);

        const attachment = new Discord.MessageAttachment(canvas.toBuffer(), 'shot-image.png');

        message.channel.send(attachment);
    }
#

i want the avatar be black and whute

earnest phoenix
#

@robust moth I'll go ahead and try to add a black and white filter for you. Give me one second to do so

robust moth
#

ok

#

thank u

earnest phoenix
#

Np

old cliff
#
import java.util.*;
class Test
{
    public static void main (String[] args)
    {
        Scanner op = new Scanner(System.in);
        System.out.println("Enter number");
        int num = op.nextInt();
        System.out.println("Factors are-");
        for(int i = 1 ; i <= num; i++)
        {
            if(num%i == 0){
              System.out.println(i);
            }
        }
    }
}

Type of programs coming in my tomorrow's java exam

cinder patio
#

that's ez

earnest phoenix
lethal trout
robust moth
#
const Canvas = require('canvas');
#

i do it

earnest phoenix
#

Hey

#

I have a problem to my messageupdate.js

#
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) => {
  client.on('messageUpdate', (oldMessage, newMessage) => {
    const logsmessageupdate = message.guild.channels.cache.find(channel => channel.name === 'suggestion')
    const embed = new Discord.MessageEmbed()
        .setColor("RANDOM")
        .setTitle(`Un message a รฉtรฉ modifiรฉ !`)
        .addFields(
          { name: `Membre :`, value: `<@${message.user}>` },
          { name: `Ancien message :`, value: `${oldMessage}` },
          { name: `Nouveau message :`, value: `${newMessage}` }
        )
        .setTimestamp()
    logsmessageupdate.send(embed)
})
}
#

why undefined :/

lethal trout
earnest phoenix
#

Here is my code:

const canvas = createCanvas(1100, 370);
const ctx = canvas.getContext('2d');
const backgroundImg = await loadImage('https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg');
ctx.globalAlpha = 0.8;
let h = 370;
let w = 1100;
let x = 0;
let y = 0;
let r = 80;
if (w < 2 * r) r = w / 2;
if (h < 2 * r) r = h / 2

ctx.beginPath();
ctx.moveTo(x + r, y);
ctx.lineTo(x + w - r, y);
ctx.quadraticCurveTo(x + w, y, x + w, y + r);
ctx.lineTo(x + w, y + h - r);
ctx.quadraticCurveTo(x + w, y + h, x + w - r, y + h);
ctx.lineTo(x + r, y + h);
ctx.quadraticCurveTo(x, y + h, x, y + h - r);
ctx.lineTo(x, y + r);
ctx.quadraticCurveTo(x, y, x + r, y);
ctx.closePath();
ctx.drawImage(backgroundImg, 0, 0, canvas.width, canvas.height);

How can i remove the gray in the background?
Img:

#

pepehmmNoBG Can't you just draw the background image a little bigger so it fits the whole thing without those gray areas?

#

@earnest phoenix I'm pretty sure it has to do with the globalAlpha or the size

#

Hmm? I'm trying to round the corners of it...

#

Hmmm

#

Let me try and remove the global alpha.

#

Mk

#

Nope still same ๐Ÿ˜

earnest phoenix
# lethal trout make `message.user` to `oldMessage.user`

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.

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) => {
  client.on('messageUpdate', (oldMessage, newMessage) => {
    const logsmessageupdate = message.guild.channels.cache.find(channel => channel.name === 'suggestion')
    const embed = new Discord.MessageEmbed()
        .setColor("RANDOM")
        .setTitle(`Un message a รฉtรฉ modifiรฉ !`)
        .addField(`Membre :`, `<@${oldMessage.user}>`)
        .addField(`Ancien message :`, `${oldMessage}`)
        .addField(`Nouveau message :`, `${newMessage}`)
        .setTimestamp();
    logsmessageupdate.send(embed)
})
}
earnest phoenix
#

wait

#

<Message>.user is not a thing, change it to <Message>.author

#

line 12

#

@earnest phoenix I will go ahead and test the command. I'll let you know if I can fix it

#

well it wasn't the full command

#

it was just my attempt to round image's corners

earnest phoenix
#

before it was undefined

#

and I have a error with this too:

const Discord = require("discord.js")
const db = require("quick.db")

module.exports = async (client, message) => {
  
if (!message.guild || message.channel.type === "dm") return;
if (message.author === client.user) return;
if (message.partial) await message.fetch();
db.set(`snipe.${message.guild.id}.content`, message.content);
db.set(`snipe.${message.guild.id}.channel`, message.channel.id);
db.set(`snipe.${message.guild.id}.user`, message.author);
setTimeout(function() {
  db.delete(`snipe.${message.guild.id}`);
  }, 600000);
    let data = db.get(`snipe.${message.guild.id}`);
    let content = data.content;
    let user = data.user;
    let channel = data.channel;
    const logsmessagedelete = message.guild.channels.cache.find(channel => channel.name === 'suggestion')
    let logs = await message.guild.fetchAuditLogs({type: 72});
    let entry = logs.entries.first();
    const embed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("Un message supprimรฉ a รฉtรฉ retrouvรฉ !")
    .setDescription(`J'ai retrouvรฉ un message de <@${user.id}> dans le channel <#${channel}> !\n\n${content}\n\nSupprimรฉ par : <@${entry.executor.id}>`)
    logsmessagedelete.send(embed)
}
#

line 8

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

the error: unknown message

#

You can't fetch a deleted message @earnest phoenix

earnest phoenix
#

so I delete this

#

@earnest phoenix can you send full command so I may test to fix?

#

wtf

earnest phoenix
#

๐Ÿ˜ฆ

#

And what's the error exactly

#
        .addField(`Membre :`, `${oldMessage.user}`)
#

oldMessage.author.tag

#

You didn't even change oldMessage.user to oldMessage.author as i told you

#

yes but

#

if I do this

#

I will show u

#

/app/node_modules/discord.js/src/structures/MessageEmbed.js:432
if (!value) throw new RangeError('EMBED_FIELD_VALUE');
^
RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.
at Function.normalizeField (/app/node_modules/discord.js/src/structures/MessageEmbed.js:432:23)
at /app/node_modules/discord.js/src/structures/MessageEmbed.js:452:14
at Array.map (<anonymous>)
at Function.normalizeFields (/app/node_modules/discord.js/src/structures/MessageEmbed.js:451:8)
at MessageEmbed.addFields (/app/node_modules/discord.js/src/structures/MessageEmbed.js:266:42)
at MessageEmbed.addField (/app/node_modules/discord.js/src/structures/MessageEmbed.js:257:17)
at Client.<anonymous> (/app/Events/Messages/messageUpdate.js1210)
at Client.emit (events.js:327:22)
at Object.module.exports [as MESSAGE_UPDATE] (/app/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_UPDATE.js1412)
at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31) {
[Symbol(code)]: 'EMBED_FIELD_VALUE'
}

#

Are you using the messageUpdate event?

#
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) => {
  client.on('messageUpdate', (oldMessage, newMessage) => {
    const logsmessageupdate = message.guild.channels.cache.find(channel => channel.name === 'suggestion')
    const embed = new Discord.MessageEmbed()
        .setColor("RANDOM")
        .setTitle(`Un message a รฉtรฉ modifiรฉ !`)
        .addField(`Membre :`, `${oldMessage.author}`)
        .addField(`Ancien message :`, `${oldMessage}`)
        .addField(`Nouveau message :`, `${newMessage}`)
        .setTimestamp();
    logsmessageupdate.send(embed)
})
}
#

here

reef needle
#

hei

earnest phoenix
#

yes

#

works

#

but

#

not the "Member"

#

You clearly haven't, log it and show us what it returns

#

wtf

#

i have a lot of thing

#

@earnest phoenix

#

I do console.log(oldMessage)
To: console.log(oldMessage.content)

#

Log the oldMessage object

#

Before creating the embed

#

its before

#

yes

#

@earnest phoenix I don't found the author of oldMessage

#

The object, not the content

#

console.log(oldMessage)

#

Do you have partials enabled?

earnest phoenix
#

Then the message could be partial

#

I delete partials?

#

Add this at the start of the event listener

if (!oldMessage.deleted && oldMessage.partial) await oldMessage.fetch();

if (!newMessage.deleted && newMessage.partial) await newMessage.fetch();```
#

at client.on?

quartz kindle
#

You cant fetch old message

earnest phoenix
#

oh

#

Oh yea

river panther
quartz kindle
#

With a file upload?

river panther
#

no

#

webhook

quartz kindle
#

Ah

river panther
#

i send an enpherial message

#

and then a webhook

#

em*

quartz kindle
#

Nice

river panther
#

๐Ÿ‘

#

how do i grow my bot's server count?

quartz kindle
river panther
#

its in the queue

#

idk when they will verify it

quartz kindle
#

Soonโ„ข๏ธ

earnest phoenix
#

Well as you're accessing the author of the updated message, access the author from the newMessage instead of oldMessage since both message's authors can't be different

#

when I console log newMessage

quartz kindle
#

There are 2 messages in that log

earnest phoenix
#

yes

quartz kindle
#

Did you log both old and new?

earnest phoenix
#

The author of the new message is available so access that

earnest phoenix
#

not the user who updated the message

quartz kindle
#

Then you logged the wrong message

earnest phoenix
#

bruh Bots can update their messages too

#

I do: console.log(newMessage)

#

It says send is undefined but there is another one exactly like this but it just says decreased and it works

#

oh another error :/

#

wtf

#

he worked before

#
const Discord = require("discord.js")
const db = require("quick.db")

module.exports = async (client, message) => {
  
if (!message.guild || message.channel.type === "dm") return;
if (message.author === client.user) return;
db.set(`snipe.${message.guild.id}.content`, message.content);
db.set(`snipe.${message.guild.id}.channel`, message.channel.id);
db.set(`snipe.${message.guild.id}.user`, message.author);
setTimeout(function() {
  db.delete(`snipe.${message.guild.id}`);
  }, 600000);
    let data = db.get(`snipe.${message.guild.id}`);
    let content = data.content;
    let user = data.user;
    let channel = data.channel;
    const logsmessagedelete = message.guild.channels.cache.find(channel => channel.name === 'suggestion')
    let logs = await message.guild.fetchAuditLogs({type: 72});
    let entry = logs.entries.first();
    const embed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("Un message supprimรฉ a รฉtรฉ retrouvรฉ !")
    .setDescription(`J'ai retrouvรฉ un message de <@${user.id}> dans le channel <#${channel}> !\n\n${content}\n\nSupprimรฉ par : <@${entry.executor.id}>`)
    logsmessagedelete.send(embed)
}
#

(node:19025) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null
at module.exports (/app/Events/Messages/messageDelete.js:\25:59)

river panther
#

go to messageDelete.js

#

is this message delee?

earnest phoenix
#

its the messagedelete.js

#

yes

river panther
#
.setDescription(`J'ai retrouvรฉ un message de <@${user.id}> dans le channel <#${channel}> 
#

you didn't

#

um

#

i forgot

#

const user = foundn't

#

you didn't declare a user

earnest phoenix
#

owo

#

@river panther I declared

river panther
#

but not in this file

#

oh wait

#

its there

#

wait

earnest phoenix
#

uhoh

#

how do i stop this loop

#

break doesnt work

earnest phoenix
river panther
#

break doesn't work for if

#

ig

earnest phoenix
#

so how am i supposed to stop it

river panther
earnest phoenix
#

Only a for loop

river panther
#

^

earnest phoenix
#

js moment

#

can u maybe help me do it with for loop

#

nvm google fixed it

#

@river panther the problem, works, the embed dosen't have a problem, but I have a error in the logs

#

owo

#

fuck

river panther
#

no

#

i am underage

#

and i am not gay

earnest phoenix
#

๐Ÿ˜‚

river panther
#

make it a string

quartz kindle
#

wsp[i]

river panther
#

"????????????????????????????????"

earnest phoenix
#

ayooo

#

@river panther I do what so? xD

river panther
#

oh wait

#

what

earnest phoenix
#

oh

#

dude I found

#

let me explain

river panther
#

๐Ÿ‘

earnest phoenix
#

the message delete

#

when I delete my own message

#

nothing

#

but when other admin delete a message

river panther
#

ah

earnest phoenix
#

I test a way

river panther
#

try try, i go eat something

earnest phoenix
#

oki

eternal osprey
#

hey

earnest phoenix
#

Hey

eternal osprey
#

does the checkmark next to my dc bot mean that it's verified?

#

removed the name as i don't want to get kicked for promoting or something.

#

just a real question

willow mirage
#

d.js so suck

eternal osprey
#

show how your setup looks like

#

in the json file + how you use client.login

willow mirage
#

dude

#

i did

#

i actually console.loged it

#

i regenerated 2 times

earnest phoenix
#

@river panther if you are here, I found the problem and I need your help oof

eternal osprey
#

you are probably accessing it wrong

#

remove the real token and just put a few cahracters that are totally distant from your real token

#

and then show me

#

otherwise i can't help

lusty quest
#

how did you pass the token? ive had some issues with dotenv loading the token properly, but got it fixed

willow mirage
#

nvm

#

imma put it directly

earnest phoenix
#
const Discord = require("discord.js")
const db = require("quick.db")

module.exports = async (client, message) => {
  
if (!message.guild || message.channel.type === "dm") return;
if (message.author === client.user) return;
db.set(`snipe.${message.guild.id}.content`, message.content);
db.set(`snipe.${message.guild.id}.channel`, message.channel.id);
db.set(`snipe.${message.guild.id}.user`, message.author);
setTimeout(function() {
  db.delete(`snipe.${message.guild.id}`);
  }, 600000);
    let data = db.get(`snipe.${message.guild.id}`);
    let content = data.content;
    let user = data.user;
    let channel = data.channel;
    const logsmessagedelete = message.guild.channels.cache.find(channel => channel.name === 'suggestion')
    const entry = await message.guild.fetchAuditLogs({type: 'MESSAGE_DELETE'}).then(audit => audit.entries.first())
    const userembed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("Un message supprimรฉ a รฉtรฉ retrouvรฉ !")
    .setDescription(`J'ai retrouvรฉ un message de <@${user.id}> dans le channel <#${channel}> !\n\n${content}\n\nSupprimรฉ par : <@${user.id}>`);
    
    const anotheruserembed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("Un message supprimรฉ a รฉtรฉ retrouvรฉ !")
    .setDescription(`J'ai retrouvรฉ un message de <@${user.id}> dans le channel <#${channel}> !\n\n${content}\n\nSupprimรฉ par : <@${entry.executor.id}>`);
    
    if (user == entry.executor) logsmessagedelete.send(userembed)
    if (!user == entry.executor) logsmessagedelete.send(anotheruserembed)
}
#

the bot dosen't send embeds

robust moth
#
message.channel.send(embed neme)
earnest phoenix
#

logsmessagedelete is a channel

#

look

robust moth
#

HA

willow mirage
#

djs so suck

earnest phoenix
#

but I don't have errors in console :/

obtuse jolt
#

does anybody know a way I can securely accept automated payments, bearing in mind that the only way to see that the payment was processed is through either webhooks (optionally) or through a javascript event which you can enter your own code to execute stuff, im reluctant to use the js event as people could just edit the code but im not exactly sure how else to go about it because you cant enter custom data with the webhook for like identifying users etc

#

(this is for using paypal buttons)

eternal osprey
#

can anyone help me out? I am using audiostream with discor.js to actually record audio chats.

#

however, it exports as pcm? How would i export it as mp3

long crow
#

Does --max-old-space-size affect any performance for discord bot?

vivid fulcrum
#

you can also convert in realtime

eternal osprey
eternal osprey
#

and eventually slow down your pc

vivid fulcrum
#

you'll need to pipe pcm data to ffmpeg through stdin

long crow
#

on vps wtih 2gb ram, and for now discord bot is the only thing that run on it

vivid fulcrum
#

the bookmark doesn't work properly ok

long crow
#

@eternal osprey

vivid fulcrum
eternal osprey
#

i would just allocate it to 1536

long crow
#

ya I make it 1536

#

Not a music bot either, so plenty of RAM for the bot

eternal osprey
#

okay great!

earnest phoenix
#

nvm figured it out

river panther
#

ping

long crow
#

pong

river panther
#

ping

earnest phoenix
#

Does anyone have a theme suggestion

near stratus
lusty quest
autumn dust
#

Hey
i entered my token to process.env file but i got this error in terminal

PS C:\Users\justi\Downloads\discord-modmail-master\discord-modmail-master> node bot.js
(node:29552) UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided.
    at Client.login (C:\Users\justi\Downloads\discord-modmail-master\node_modules\discord.js\src\client\Client.js:206:52)
    at Object.<anonymous> (C:\Users\justi\Downloads\discord-modmail-master\discord-modmail-master\bot.js:215:8)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47
#

can somebody help me?

long crow
#

How do you define it? Token=TheToken or Token="TheToken"

autumn dust
long crow
#

because the first is correct for .env fime

autumn dust
#

i tired all 2 but it still gaved me the same errors

long crow
#

Can't really help if no code either.

autumn dust
#

i downloaded it from github

#

to my server

unreal estuary
#

whats in ur .env file

#

replace the token with something ofc

autumn dust
#

TOKEN=Mytoken.smtng.smthng

#

i entered real token

#

i just gaved you the fake one

#

to don't steal my bot

unreal estuary
#

try put ur token directly into the bot.js

#

client.login("token_here")

misty sigil
#

oh god

autumn dust
unreal estuary
#

i dont really see whats wrong with it

elder onyx
#

Hi

unreal estuary
#

yes

elder onyx
#

How can i make bots?

unreal estuary
unreal estuary
autumn dust
#

tysm

unreal estuary
#

np

wanton prism
#

hi everyone, what do you guys know about PebbleHost?

#

Is it safe?

unreal estuary
#

havent heard of it tbh

quartz kindle
#

never heard about it

wanton prism
elder onyx
#

What?

#

Ahem

#

See

#

I want u to suggest a language and tell me how to make a bot with it

quartz kindle
#

its another pterodactyl host

misty sigil
#

just buy a VPS for that price

quartz kindle
#

they dont give you full ssh access, they jsut give you the control panel

long crow
#

I use OVH with that price, well $3.5

#

full ssh

quartz kindle
wanton prism
#

hm

quartz kindle
#

but learn the language itself first

misty sigil
#

fuck it

quartz kindle
#

dont jump straight into bots

misty sigil
#

jump straight into making bots in cpp

#

/s

quartz kindle
#

ecks dee

river panther
#

that dude whose token was invalid

#

can i ask him to give his token to me?

#

i can fix it x)

misty sigil
#

what

river panther
#

oh, hello matt

#

long time no see

elder onyx
earnest phoenix
#
const Discord = require("discord.js")
const db = require("quick.db")

module.exports = async (client, message) => {
  
if (!message.guild || message.channel.type === "dm") return;
if (message.author === client.user) return;
db.set(`snipe.${message.guild.id}.content`, message.content);
db.set(`snipe.${message.guild.id}.channel`, message.channel.id);
db.set(`snipe.${message.guild.id}.user`, message.author);
setTimeout(function() {
  db.delete(`snipe.${message.guild.id}`);
  }, 600000);
    let data = db.get(`snipe.${message.guild.id}`);
    let content = data.content;
    let user = data.user;
    let channel = data.channel;
    const logsmessagedelete = message.guild.channels.cache.find(channel => channel.name === 'suggestion')
    const entry = await message.guild.fetchAuditLogs({limit: 1, type: 'MESSAGE_DELETE'}).then(audit => audit.entries.first())
    const userembed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("Un message supprimรฉ a รฉtรฉ retrouvรฉ !")
    .setDescription(`J'ai retrouvรฉ un message de <@${user.id}> dans le channel <#${channel}> !\n\n${content}\n\nSupprimรฉ par : <@${user.id}>`);
    
    const anotheruserembed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("Un message supprimรฉ a รฉtรฉ retrouvรฉ !")
    .setDescription(`J'ai retrouvรฉ un message de <@${user.id}> dans le channel <#${channel}> !\n\n${content}\n\nSupprimรฉ par : <@${entry.executor.id}>`);
  
        if (user.id === entry.executor.id) {
        logsmessagedelete.send(userembed)
    }    else {
        logsmessagedelete.send(anotheruserembed)
    }
}

I have a problem, when I delete my own message, the bot say its another user who deleted my message ๐Ÿ˜ฆ

#

its my messagedelete.js event

river panther
#

or whatever i

elder onyx
#

Bro see

tall pine
#

do you know how to save emojis in a db? I can save them but when I try a select mysql (mariadb) returns everything and does not care of the exact emoji type

elder onyx
#

I want u to recommend a language

unreal estuary
#

nodejs

quartz kindle
#

i already did

elder onyx
#

And i will learnit

quartz kindle
#

javascript or python

river panther
#

js

elder onyx
#

K

river panther
#

pythos is just english

#

you won't be able to flex

elder onyx
#

I will see it now

river panther
#

exdi

earnest phoenix
#

xD

river panther
#

that makes it difficult for me to understand

earnest phoenix
#

oof

river panther
#

french destroys my confidence

#

i failed in french 3 times in a row

earnest phoenix
#

you don't need to read french words

river panther
#

tho the teacher was a complete bitch

#

anyways, back to programing

quartz kindle
#

so you are getting someone else's audit log

earnest phoenix
#

how to fix this so?

#
        if (user.id === entry.executor.id) {
        logsmessagedelete.send(userembed)
    }    else {
        logsmessagedelete.send(anotheruserembed)
    }
}

I made this, so if the user is not same at the logs, send another embed

quartz kindle
#

you will need to check if the message in the audit log has the same id as the deleted message

autumn dust
#

๐Ÿ˜

unreal estuary
#

whats ur code

river panther
#

code

unreal estuary
earnest phoenix
unreal estuary
#

can u click the error

river panther
unreal estuary
#

lol

autumn dust
#

its from github

unreal estuary
#

what line is the error on

river panther
#

show bot.js

autumn dust
unreal estuary
#

click

#

/app//bot.js:18:30

autumn dust
unreal estuary
#

it will take u to the error i think

autumn dust
#

the bot js file

river panther
autumn dust
#

ok

unreal estuary
#

let guild = client.guilds.cache.get(config.guild);

quartz kindle
unreal estuary
#

i think the error is on that line

river panther
autumn dust
river panther
#

hahahaha

unreal estuary
#

lol i dont see it

autumn dust
#

regenrated

#

i regenerated it

unreal estuary
#

ok

river panther
earnest phoenix
#

xDDD

river panther
#

why do you have so many anime friends?

autumn dust
#

i?

#

no u

river panther
#

oh no, why am i replying to myself from your account

earnest phoenix
river panther
#

umm

#

yes

#

ig

earnest phoenix
#

but

#

why not works :/

obtuse jolt
#

@quartz kindle can you help me?

earnest phoenix
#

sometimes he is wrong

#

@river panther can I show u with a screen share?

river panther
#

yes

earnest phoenix
#

come general

#

@river panther its not Chadoxi has deleted messages :/

river panther
#

so you want it like, if you delete the message then the bot shouldn't log it

#

right?

earnest phoenix
#

he can log

river panther
#

then what do you want it to do?

obtuse jolt
river panther
#

explain your error nicel y

#

do you want it to show the log or not?

earnest phoenix
#

when I delete my own message / a user delete his message, log it

#

and

obtuse jolt
quartz kindle
earnest phoenix
#

when I delete a user's message / a user delete my message, log it

river panther
#

oh, ok, then tim shall solve your problem

obtuse jolt
river panther
#

right?

earnest phoenix
#

yes

#

euhh

river panther
#

ok, now send the code again

#

or wait

#

nvm

earnest phoenix
#
const Discord = require("discord.js")
const db = require("quick.db")

module.exports = async (client, message) => {
  
if (!message.guild || message.channel.type === "dm") return;
if (message.author === client.user) return;
db.set(`snipe.${message.guild.id}.content`, message.content);
db.set(`snipe.${message.guild.id}.channel`, message.channel.id);
db.set(`snipe.${message.guild.id}.user`, message.author);
setTimeout(function() {
  db.delete(`snipe.${message.guild.id}`);
  }, 600000);
    let data = db.get(`snipe.${message.guild.id}`);
    let content = data.content;
    let user = data.user;
    let channel = data.channel;
    const logsmessagedelete = message.guild.channels.cache.find(channel => channel.name === 'suggestion')
    const entry = await message.guild.fetchAuditLogs({limit: 1, type: 'MESSAGE_DELETE'}).then(audit => audit.entries.first())
    const userembed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("Un message supprimรฉ a รฉtรฉ retrouvรฉ !")
    .setDescription(`J'ai retrouvรฉ un message de <@${user.id}> dans le channel <#${channel}> !\n\n${content}\n\nSupprimรฉ par : <@${user.id}>`);
    
    const anotheruserembed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("Un message supprimรฉ a รฉtรฉ retrouvรฉ !")
    .setDescription(`J'ai retrouvรฉ un message de <@${user.id}> dans le channel <#${channel}> !\n\n${content}\n\nSupprimรฉ par : <@${entry.executor.id}>`);
  
        if (user.id === entry.executor.id) {
        logsmessagedelete.send(userembed)
    }    else {
        logsmessagedelete.send(anotheruserembed)
    }
}
quartz kindle
#

there should be a transaction it at the moment you begin one, and then you should receive a webhook with the same id when its finished

earnest phoenix
#

eyo during the time where i was at 2500 servers without sharding would there of been a chance it kicked the bot from a bunch of servers

quartz kindle
#

or, you send some user identifying data to paypal when they press the button

#

and the webhook should return the same data

river panther
obtuse jolt
lusty quest
river panther
#

idk, i don't use it, a few people use it so...

obtuse jolt
#

My only idea is to have the client send their transaction id through an ajax query and then send the same through through the api but then there could still be a chance that someone tries to abuse it and change their transaction id

earnest phoenix
#
const Discord = require("discord.js")
const db = require("quick.db")

module.exports = async (client, message) => {
  
if (!message.guild || message.channel.type === "dm") return;
if (message.author === client.user) return;
db.set(`snipe.${message.guild.id}.content`, message.content);
db.set(`snipe.${message.guild.id}.channel`, message.channel.id);
db.set(`snipe.${message.guild.id}.user`, message.author);
setTimeout(function() {
  db.delete(`snipe.${message.guild.id}`);
  }, 600000);
    let data = db.get(`snipe.${message.guild.id}`);
    let content = data.content;
    let user = data.user;
    let channel = data.channel;
    const logsmessagedelete = message.guild.channels.cache.find(channel => channel.name === 'suggestion')
    const entry = await message.guild.fetchAuditLogs({limit: 1, type: 'MESSAGE_DELETE'}).then(audit => audit.entries.first())
    const userembed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("A message has been deleted!")
    .setDescription(`I found a message from <@${user.id}> in the channel <#${channel}> !\n\n${content}\n\Deleted by: <@${user.id}>`);
    
    const anotheruserembed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("A message has been deleted!")
    .setDescription(`I found a message from <@${user.id}> in the channel <#${channel}> !\n\n${content}\n\nDeleted by: <@${entry.executor.id}>`);
  
        if (user.id === entry.executor.id) {
        logsmessagedelete.send(userembed)
    }    else {
        logsmessagedelete.send(anotheruserembed)
    }
}
#

@river panther here

river panther
#

oh no

quartz kindle
#

the user fills a form, then clicks the button, the button should contain some of the form data

obtuse jolt
lusty quest
#

did you gave something like chargebee a shot? they manage most stuff that is used for the payments, from your side you just need to redirect some requests

obtuse jolt
lusty quest
#

also its free until you reach a certain volume of transactions

obtuse jolt
#

I might try it if I canโ€™t get PayPal to work

lusty quest
#

its a bit annoying but it works

#

also you can accept more stuff than just paypal with them

quartz kindle
#

why doesnt the button support sending data

obtuse jolt
#

Iโ€™m using "Smart Buttonsโ„ข๏ธ"

river panther
obtuse jolt
#

It doesnโ€™t accept custom fields as far as Iโ€™m aware

river panther
#

and then screenshare

#

i shall help you fix it

#

there

earnest phoenix
river panther
#

umm, just do

if ((the person who deleted the message).id === message.author.id){
  //code
}else{
  //code
}
earnest phoenix
#

the person who deleted the message = user.id so?

river panther
#

wot?

earnest phoenix
#

oh, nothing, I go test

river panther
#

yes

earnest phoenix
#

so

#

When I delete my own message

#

works

#

but When I delete another user's message / a user delete my message: not works

river panther
#

screenshare

earnest phoenix
#

oki

#

:/

river panther
#

so, explain to me what happened, it was all in french

earnest phoenix
#

so

#

I deleted my own message

#

the bot says a message by chadoxi has been deleted by chadoxi

#

works

river panther
#

yey

earnest phoenix
#

when a user delete his message

#

the bot says "the user" messages has been deleted by himself

#

but

#

when I delete a message by another user

#

but says the message has been deleted by the user

#

actually it was me who has deleted the message

river panther
#

ah

#

i get it

earnest phoenix
#

๐Ÿ˜ฎ

river panther
#
    const userembed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("A message has been deleted!")
    .setDescription(`I found a message from <@${user.id}> in the channel <#${channel}> !\n\n${content}\n\Deleted by: <@${user.id}>`);
    
    const anotheruserembed = new Discord.MessageEmbed()
    .setColor("RANDOM")
    .setTimestamp()
    .setTitle("A message has been deleted!")
    .setDescription(`I found a message from <@${user.id}> in the channel <#${channel}> !\n\n${content}\n\nDeleted by: <@${entry.executor.id}>`);

are you sure you have written these correctly?

river panther
earnest phoenix
#

the embed to when the user delete his message is userembed

#

and the anotheruserambed is when user1 delete user2's message / or user2 delete user1's message etc...

river panther
#

hmm

#

let me recode it

#

wait

earnest phoenix
#

oki

river panther
#

i shall do it in the dms

#

so other people can ask for help and stuff

strange pike
#

Hello

#

@earnest phoenix

earnest phoenix
#

@strange pike hello

strange pike
#

I wanted to ask something

#

Where can we code a bot like are there any special apps

#

@earnest phoenix

earnest phoenix
#

like special apps, like what? O_O

strange pike
#

How to make a bot online!!!!

river panther
#

heiroku

earnest phoenix
#

owo

strange pike
earnest phoenix
#

You have Heroku, Glitch, Repl.it, or host in your pc

#

or pay a vps

river panther
#

i self host my bot

strange pike
#

I do that for now

#

Self host

earnest phoenix