#development

1 messages Β· Page 625 of 1

slender thistle
#

What's the actual error

#

Full traceback is really appreciated

lime fiber
slender thistle
#

What's your Python version

lime fiber
#

3.5.4

slender thistle
#

There we go

#

F-strings are 3.6+

lime fiber
#

😦

#

I'll install 3.6 thanks πŸ‘

slender thistle
lime fiber
#

nope

#

But yep it worked thanks a lot πŸ˜„

jolly sentinel
#

Never really figured out the difference between f strings and .format()

#

is it that fstrings are just faster orr

#

I think I've heard someone say that

unique nimbus
lime fiber
#

I want to make a welcome message function for my bot. And I need the f parameter. So how can I "f" the msg?
Here is my code:

slender thistle
#

@jolly sentinel faster, better looking

jolly sentinel
#

true

slender thistle
#

@lime fiber format? "{} is cool".format('DBL')?

lime fiber
#

But this is a customizable message

slender thistle
#

I'm not sure what your actual question is

lime fiber
#

Do you know the welcome message function in the bot like mee6 or dyno.
I want the same.
The user will able to set his own message.

#

And I want to the bot display that message.

#

With eg: mentions , server name

#

etc...

slender thistle
#

User: !welcomeset {server.name} is cool!
Bot: literally saves the message as "{server.name} is cool!"
Bot when someone joins: msg.format(server=Some_Server_Instance)

lime fiber
#

πŸ€”

slender thistle
#

f parameter what?

lime fiber
#

User: !welcomeset #joins Welcome {member.mention} on {server.name}.

#

For eg

#

It saves the msg

#

But it sends the raw text

slender thistle
#

With f-string you would most likely define variables and then use them

#

aka server = message.server, etc.

fiery stream
#

Ayy how to save data from html

#

In mongo

lime fiber
#

I know it but my but is used on 75 servers

fiery stream
#

Just front end

lime fiber
slender thistle
#

Just save yourself a headache and use .format(server=..., member=...)

fiery stream
#

Lmao

#

Shiv

#

Help me

lime fiber
#

ok i'll trx it

amber fractal
#

Saving an entire html page?

#

Just make sure the site is fine with a web crawler first

fiery stream
#

No saving data from kt front ended

amber fractal
#

Oh

#

Lol

#

No idea what that means

fiery stream
#

Go there and u ill figure out after logging in

lime fiber
fiery stream
#

/dashbord

#

Dashboard

slender thistle
#

WIll you ever post full traceback immediately

fiery stream
#

Me?

slender thistle
#

I have no fucking idea what you are doing .mention on

lime fiber
#

I'm just forget to put the e to member.

#

It works now

#

Thanks a lot!

hushed quarry
lime fiber
#

πŸ™„

hushed quarry
#

we're serious

#

you post no code and not a full stacktrace so we can't help you

fiery stream
#

Loli

#

πŸ˜‚

mossy vine
#

can we pin that video please

slender thistle
#

Who will watch it, though?

mossy vine
#

tru

fiery stream
#

@slender thistle do u know how can i save data with front end only

#

<script></script>

slender thistle
#

Never done never heard

#

BeautifulSoup4 probably

fiery stream
#

Who is that

#

@little barntifulSoup4

#

Whst

slender thistle
#

You can Google, you know

#

First result you get when typing in beautifulsoup4

fiery stream
#

Lol i need js

slender thistle
#

See if BS4 can scrape the js part, idk and I currently have no time

quartz kindle
#

what do you mean save data with front end?

slender thistle
#

Also, isn't front end HTML + CSS and back end JS?

quartz kindle
#

js is both

slender thistle
#

πŸ‘€ cool

fiery stream
#

Lol

quartz kindle
#

js was baiscally front end only

fiery stream
#

Tim

quartz kindle
#

until node happened

fiery stream
#

I need help saving data for my document websiteI

#

I never saved data in front end

mossy vine
#

you cant really save data in front end

quartz kindle
#

you want to save data on each user's pc?

mossy vine
#

unless browser cache

quartz kindle
#

like website settings?

#

there are many storages for that

#

like localstorage, sessionstorage, indexedDB

#

you can save user information in them so that your page remembers their information when they come back

fiery stream
#

@quartz kindle okay so i have a website like google docs i got all editor n stuff working all i need now is save the data they type in editor and i cant figure that put

quartz kindle
#

where do you want to save it?

fiery stream
#

In db like mongo redis or sql

#

Thats the options i got

quartz kindle
#

then you have to use backend not front end

#

front end is for temporary things, you cant store permanent stuff in front end

fiery stream
#

They how ill i transfer data from front to backend

#

Because quilljs is front only

quartz kindle
#

send a POST request

fiery stream
#

Ohh that ill suck

quartz kindle
#

no need for sockets

#

just a normal xhttp

#

you know how to use ajax?

viral plover
#

Is it possible to have a bot list/read local files?
I tried finding an answer online and got mixed results.

opaque eagle
#

What language

viral plover
#

Javascript. I think that's the default one for bots.

earnest phoenix
#

Looking for a dev that can code in Java script for a sneaker bot
Will be paid well message me if interested or if you know anyone who is

opaque eagle
#

No one does that, also #general @earnest phoenix

#

There’s no real β€œdefault” language for Discord bots, and you’re looking for fs @viral plover

viral plover
#

Okay, so it is possible. Great, thanks!

What all languages can be used then?

amber fractal
#

Any language that can make a http call

#

But a bot accessing a users files isnt possible afaik

#

And probably highly against tos

viral plover
#

I intend for it to read my files, not other users.

amber fractal
#

Wait were you talking about a discord bot?

viral plover
#

Yes.

amber fractal
#

I think it'd have to be running on your local machine to access your files

viral plover
#

That's the plan.

amber fractal
#

Then if you use node you can use filesystem (fs)

opaque eagle
#

Yeah, you’d use fs.readdirSync() for folders and fs.readFileSync() for files

mossy vine
#

just for reading your local files, fs is enough

#

or you can be like me and just do exec('cat example.txt') and get the output

opaque eagle
#

Lol

lime fiber
#

I have another question :D
So here is my code. As you can see I mention a channel and I want it in discord.Channel.

slender thistle
#

I'm sorry but what is that even supposed to do? WaitWhat

lime fiber
#

I want an interactive setup for my welcome system.

#

And here I need to mention a channel

slender thistle
#

wait_for_message most likely has a check kwarg that accepts a function

lime fiber
#

But how can I convert the input into discord.Channel

#

I'll show it in a better way πŸ˜ƒ

#

just a minute

#

And this is the error what i get

slender thistle
#

I don't remember if async d.py had text channel converter

#

Time to install async...

#

Make your own or force people to mention the channel

lime fiber
#

But when I mention a channel I get that error

slender thistle
#

Jesus fuck me

#

Have you read the example for wait_for_message

lime fiber
#

yep

slender thistle
#

Where the fuck did you get the idea to make that a parameter for Channel object then

#

Basic example:

#

The check keyword argument can be used to pass in more complicated checks and must be a regular function (not a coroutine).

#

It has author and channel kwargs, why don't you use those

#

Don't create d.py objects yourself

lime fiber
#

Why I need to use the channel kwargs?

#

It is for: channel (Channel or PrivateChannel or Object) – The channel the message must be from.

slender thistle
#

Bot waiting for X's message, user replies to someone else in another channel, bot sees that message

lime fiber
#

Ok, but that's not for this problem

slender thistle
#

I pointed out the problem

lime fiber
#

Do you know @vale fiber

slender thistle
#

Saw it do its job before

lime fiber
slender thistle
#

It asks you for the name of the channel, so do you want the name or a mention of a channel

lime fiber
#

I want the same as that bot

slender thistle
#

As I said before, wait_for_message returns a Message instance

lime fiber
#

Ok, but what can i do if i want to return a channel

slender thistle
#

You use discord.utils.get where the iterable is [channel for channel in server.channels if channel.type is discord.ChannelType.text]

#

server in that case would be msg.server if you put your wait_for_message under msg variable

lime fiber
#

But it won't get the channel which the user wrote into the chat

slender thistle
#

Which part doesn't get the channel

lime fiber
#

ok, i'll give a try, thanks

#

It worked, but only when I wrote the name. When I write a channel mention it returns NoneType

slender thistle
#

if not msg.channel_mentions:

#

Could write your own channel converter

lime fiber
slender thistle
#

sigh

#

if not answer2.channel_mentions:
discord.utils.get(...)

#

else:
get first element of channel_mentions, which is a list

lime fiber
#

ok, thanks

#

And can you please send me the example for the get first element of channel_mentions, which is a list

slender thistle
#

If you knew Python, you wouldn't need me to help you with that

lime fiber
#

Please

slender thistle
#

Are you banned from Google?

#

Put some effort in learning, will you

lime fiber
#

But I found nothing about it. i searched before I asked this.

slender thistle
#
lime fiber
#

Oh I got it, thanks πŸ‘

indigo geyser
#

@gleaming geyser do you use Repl?

jolly sentinel
#

How do I assign a variable in python

indigo geyser
#

Lel

unique nimbus
#

a = print("sad")
a

#

a is the variable

indigo geyser
#
await message.channel.send(content)```
#

This is another one

jolly sentinel
#

But why are you assigned the content a variable when there's no point thonking

#

Assigning*

indigo geyser
#

I?

jolly sentinel
#

I feel like that's async and not rewrite

indigo geyser
#

Yes

jolly sentinel
#

lame

unique nimbus
#

await ctx.send()

#

ye

indigo geyser
#

I PR3F3R 4WAIT!1!1!1!1!1!1!1!1!1!1!1!1

slender thistle
#

What the fuck is going on here

unique nimbus
#

Python arguments

#

I think

jolly sentinel
#

I asked a joke question

#

You couldn't ask me what happened after

indigo geyser
#

It's async

#

async def on_message()

jolly sentinel
#

Why you put your commands in your on_message

#

Nerd

indigo geyser
slender thistle
#

This channel is so full of autistic shit ngl

jolly sentinel
#

Yeah but when was it not

slender thistle
#

discord.py had a version 0.16.12 which is also called async

#

Whenever you say "async or rewrite", what do you expect people who have used d.py for a while will think you mean

jolly sentinel
#

I think most people know this

indigo geyser
#

Ok

slender thistle
#

And do I seriously need to go all the way up in this channel to demonstrate the difference between d.py 0.16.12 and 1.0.0+ again

jolly sentinel
#

The only reason that it looks like async to me is because I only saw the channel.send(), which is something I thought async did for their message sending

slender thistle
#

sigh

#

client.send_message was async

jolly sentinel
#

Got it

slender thistle
#

Messageable.send is rewrite+

earnest phoenix
#

what should i do for this

slender thistle
#

Exactly what it says

#

Be patient and wait

earnest phoenix
#

oh

#

ok

#

I thought i had to do somekinda

#

captcha things

slender thistle
#

Nah

earnest phoenix
#

I think that message is English

#

not Caribberanish

barren brook
#

Can someone teach me how to make a application like for say a website or just like something you can download and use?

modern sable
#

depends on the language

barren brook
#

I’m trying to code in js

earnest phoenix
#

lol

barren brook
#

trying lol

#

I can code a bit of discord bots

earnest phoenix
#

use this to make your app selfcontained https://github.com/zeit/pkg

barren brook
#

K

modern sable
#

Does someone have a idea on how to speed up this SQL query?

SELECT 
    currentbotdata.botname,
    (currentbotdata.points - (SELECT points
        FROM botdata
        WHERE currentbotdata.botid = botdata.botid
        AND botdata.time >= DATE_SUB(NOW(), INTERVAL 1 DAY)
        ORDER BY time ASC
        LIMIT 1)) AS pointslast1d
FROM currentbotdata
WHERE deleted = 0
ORDER BY pointslast1d DESC;```

I was hoping that I would be able to solve it without having to save the data somewhere, but rn this query takes 22 seconds which would be unusable for a website ![weirdsip](https://cdn.discordapp.com/emojis/546328425300754433.webp?size=128 "weirdsip")
fading wigeon
#

can you create another db to store the results of the mathematical expressions?

modern sable
#

i would be able to

fading wigeon
#

and make sure to use InnoDB with plenty of ram

modern sable
#

i was just hoping that i didnt have to

fading wigeon
#

make it pre-calculate at a certain interval

#

thats the only way it'll get useable

modern sable
#

then i'll do that blobshrug

earnest phoenix
#

How would I make a bot do something when something sends anything in a certain channel. (Discord.js) for example I send this message in the channel and it would do something like delete this message or ban the member.

fading wigeon
#

oof

#

i told u

idle basalt
#

@earnest phoenix read this: https://discordjs.guidejs client.on('message', (message) => { // code here will run on message // javascript is event based and this is an event handler // the message parameter stores the message object that triggered this event console.log(message); // this will log the object for you });

flint trellis
#

hi syz

idle basalt
#

helo

knotty steeple
#

@earnest phoenix thats actually useful for me thanks

earnest phoenix
#

res.body.type = ["Type", "On"]

.addField('β•”β–· β—‰ Type', 'β• β–· β—‰ ' + res.body.type.forEach(function(element) {element})) give:

β•”β–· β—‰ Type
β• β–· β—‰ undefined

#

I do not solve the problem

idle basalt
#

.forEach() doesnt return anything

#

also your forEach is doing absolutely nothing

#

just do res.body.type

digital sparrow
#

how to make event handler discord.js?

earnest phoenix
#

do a ritual and pray for the best

idle basalt
#

same as a command handler

#

but for events

#

?

opaque eagle
#
const client = new Discord.Client();
client.on(event_name, callback_function);```
idle basalt
#

snek case 🀒

digital sparrow
#

oh..

fiery stream
#

@barren brook learn java for application

idle basalt
#

fantastic advice

#

you can make desktop apps with any language. you dont have to learn a special language for it unless you want to do something very specific that only a few languages provide

earnest phoenix
#

even better advice dont touch java because it's mission impossible to write optimized code that doesnt mem leak

idle basalt
#

and if you wanted to recommend a general language for desktop apps, id argue that c++ is a better language to suffer with than java

inner jewel
#

it's mission impossible to write optimized code that doesnt mem leak
"i can't write it so it's obviously a bad lang for some random reason"

idle basalt
#

^ how i feel about literally every language when i just start out with it

earnest phoenix
#

oh, i do know java, but most java apps do mem leak

#

including lavalink

scarlet phoenix
#

I mean I work with a lot of java microservices every day and none of them leak

#

I think its all about doing it properly

inner jewel
#

and the language is to blame for some random program leaking?

earnest phoenix
#

minecraft for example too, though minecraft's code is shit and unoptimized so it's not really a valid one

inner jewel
#

let's just stop using computers at all then because if someone forgets a free() call the whole kernel will leak memory!

earnest phoenix
#

i didnt say java itself mem leaks, i just said it's hard to write code that doesn't do that

#

pls

inner jewel
#

it's hard to write code that leaks

scarlet phoenix
#

Every language has the possibility of performing like shit, and all can perform well. Some can be optimized more. Java is surprisingly fast and lean compared to the usual java slow meme

inner jewel
#

you need to really want to leak

#

and it's not even the traditional memory leak

scarlet phoenix
#

I dont think its very hard, if you are not a total beginner

inner jewel
#

the only way to leak is to eg have a global collection you add all objects you allocate and never clear

#

since the classic leaks (malloc without free) are impossible

scarlet phoenix
#

Java GC is nice, but can be a bitch to deal with. Not an issue more than .01% of the time in reality tho

inner rover
#

Dm me if you can make me bot

drowsy lily
#

including lavalink
feel free to share any insights you have from your heap dumps on the github issue tracker. whining about problems without even letting ppl who can fix them know helps noone.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

idle basalt
#

yes this man is super high if you scroll down through 1500 developers and 2700 bots

#

great ping

modern sable
#

i dont think they appear high, even if they're a bot dev

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

idle basalt
#

also those chars only lower your name

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

idle basalt
#

@royal?

sage bobcat
#

One message removed from a suspended account.

idle basalt
#

he pops up lol

drowsy lily
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

fading wigeon
#

lol

sage bobcat
#

One message removed from a suspended account.

idle basalt
#

lol

fading wigeon
#

the heck is happening lol

idle basalt
#

dv is drunk

wet walrus
idle basalt
#

"spoon-feed definition" thats rich

#

if you run the code youll quickly find out if its correct or not

#

that looks like you pulled it straight from guidebot so assuming the rest of your structure is the same as theirs, it will work

wet walrus
#

CANT WHO HELP ME?!

grim aspen
#

it says the error right there

#

gah i'm tired

west spoke
#

I see someone else's work

grim aspen
#

and that also

opaque eagle
#

Is it really worth the hassle naming ur files with non-latin alphabets?

#

u have to memorize alt codes n stuff right

grim aspen
#

what lazy neko said

opaque eagle
#

Yeah it does look like others' code... especially the unusual comments

#

Also he has Atom Editor open in the background... why not use that instead of glitch

west spoke
#

Why tf are you using bandicam

#

Windows 10 OS comes with a screen clipper

grim aspen
#

bandicam?

#

i don't use that

dusky marsh
#

glitch, atom, and vsc all open at once

#

makes sense

west spoke
#

Look at the filename

#

@grim aspen

#

And bottom right corner

grim aspen
#

oh now i see it

fiery stream
#

ayy is lavalink a good music player package

#

???

west spoke
#

idk

fiery stream
#

i m new to music playing

grim aspen
#

i think so

#

never used it

west spoke
#

That's why I'm not gonna mess with music

#

Well

#

I mean a friend of mine did a music bot using a windows vista

fiery stream
#

lol im make a whole new event

#

for music

west spoke
#

cool ok

forest sage
#

Red bot uses lavalink as far as I know

fiery stream
#
  password: '', // your Lavalink password
  userID: '', // the user ID of your bot
  shardCount: 0, // the total number of shards that your bot is running (optional, useful if you're load balancing)
  hosts: {
    rest: '', // the http host of your lavalink instance (optional)
    ws: '', // the ws host of your lavalink instance (optional)
  },
  send(guildID, packet) {
    // send this packet to the gateway
    // you are responsible for properly serializing and encoding the packet for transmission
    return gateway.connections.get(Long.fromString(guildID).shiftRight(22).mod(this.shardCount)).send(packet);
  },
});``` wtf is password??
west spoke
#

Your lavalink password

fiery stream
#

lol i can read that

west spoke
#

Look at the comment ;v

#

Use the api password ig

#

Idk

fiery stream
#

how do i get it do i enter random stuff

west spoke
#

idk

#

Google

inner jewel
#

you set the password in your lavalink config

fiery stream
#

@inner jewel what is that password used for?

earnest phoenix
#

it's used... as a password

#

auth key so random people can't connect to your instance

fiery stream
#

lol do i need to login to use the music everytume

#

wdym can't connect to your instance

earnest phoenix
#

lavalink is a server

#

it listens on a port

#

how do i use the homework bot?

fiery stream
#

uhh ohh

#

@earnest phoenix please contact his owner

earnest phoenix
#

idk who his owner is

fiery stream
#

use luca to figure it out

west spoke
#

@earnest phoenix a mod already told you

fiery stream
#

@earnest phoenix can u help me

earnest phoenix
#

told me what

fiery stream
#

im new to music bots

earnest phoenix
#

help with what

#

im new to bots, who told me @west spoke

fiery stream
#

with music

earnest phoenix
#

be more specific, i can't help you on such a wide term

inner jewel
#
  1. run lavalink
  2. connect to lavalink
  3. send commands to lavalink
  4. profit
fiery stream
#

...@gilded plank botinfo @homewor do that

#

@inner jewel can i run lavalink on different instance tehn the bot like sperately

west spoke
#

@earnest phoenix a mod named Marco

inner jewel
#

you can run it anywhere

#

as long as the bot can connect to it

earnest phoenix
#

@gilded plank botinfo @homework

gilded plankBOT
#

Please include a bot mention

west spoke
fiery stream
#

so thats what u mea

earnest phoenix
#

there is no bot mention?

west spoke
#

And it's not here

#

Look on google

earnest phoenix
#

well wtf

west spoke
#

I sent the link in general

fiery stream
#

wait so how does lavalink get music

#

like from where

west spoke
#

Dont expect to get what you want all the time @earnest phoenix

earnest phoenix
#

it scrapes

west spoke
#

URLs I think

inner jewel
#

you load tracks, it plays them

earnest phoenix
#

i just joined this server idk what im even doing so yeah

#

im not exactly sure if lavalink does straight converting to opus bytes

inner jewel
#

could be youtube, files in disk, random mp3 urls

fiery stream
#

i want it to make user choice

#

so users can chose what they want to play

west spoke
#

@earnest phoenix ask them not us now change that cursed pfp kthz

inner jewel
#

then just give the user input to lavalink's loadtracks endpoint

fiery stream
#

okay one more question would u prefer ytdl-core or lavalink

#

?

inner jewel
#

lavalink

fiery stream
#

thx

#

the mods are so nice here

#

in other servers they are like dont mention us n stuff

opaque eagle
#

that happens here too, u get muted for mentioning the mod role

fiery stream
#

i mentioned natan he didnt mute me?

slender thistle
#

the mod role

forest sage
fiery stream
#

Moderators

#

so

#

im not beign thst

forest sage
#

Mentioning a mod is alright, but if you click the "shit's on fire yo" button for no reason, then your shit's going to be on fire mmLol

fiery stream
#

lol duh thats prbably every server

empty owl
#

hey whats the limit of changing seconds?

#

every 10?

grim aspen
#

yes

empty owl
#

ok

grim aspen
#

i think

#

i do it with my bot

empty owl
#

ok

grim aspen
#

doing 5 seconds is abuse

empty owl
#

ok\

high lava
#

5x a minute*

empty owl
#

soo 20 s

#

?

high lava
#

you'd be better off doing 15 seconds so you don't get declined

#

15 seconds = 4 times a minute

empty owl
#

no i mean for priv bots

grim aspen
#

i thought you were talking to yourself

empty owl
#

o

grim aspen
#

two blue pfps that looked similar to me

empty owl
#

XD

high lava
#

This is more of a discord rule than a DBL rule

empty owl
#

kk

barren brook
#

can someone teach me how to make a application on glitch.com

pallid zinc
#

Can we copy msg for one server and paste on other server

hushed quarry
#

@pallid zinc yes

pallid zinc
#
    await client.guilds.get('535061455167422464').channels.get('550392859975614467')Client.users.get("User ID here").send(`Author: ${message.author.username}\nContent: ${message.content}`)
})
#

I have this

#

But I want to send to a guild server

hushed quarry
#

and what's the error

earnest phoenix
high lava
#

what

pallid zinc
#

Sorry I solved it

earnest phoenix
#

lol

#

im just saying we need more info

hushed quarry
#

best video

high lava
#

All you need to do is send it to the Channel ID instead of the User Id

earnest phoenix
#

bEST VIDEO

gleaming geyser
#

@indigo geyser nope

earnest phoenix
#

@vague chasm add .setColor("0xffb18a")

vague chasm
#

@earnest phoenix not embed color

mossy vine
#

What thats just wrong

vague chasm
#

@earnest phoenix how did you make that green?

earnest phoenix
#

hmm i forgot

#

probobly i typed .setColor("0xffb18a")

#

try this

vague chasm
#

that is for embed color oof

mossy vine
#

And... Is that not what you need?

#

Oh wait i see

vague chasm
#

I marked in photo what I want to color

mossy vine
#

Either downloaded image edited manually
Or some css magic idk

earnest phoenix
#

wait

vague chasm
#

ok

vague chasm
#

ok

mossy vine
#

Huh thats cool

vague chasm
#

ty

earnest phoenix
#

np

pallid zinc
#

Any one know trivia bot?

earnest phoenix
#
const Discord = require ("discord.js");
const talkedRecently = new Set();

module.exports.run = async (bot, message, args) => {
	
	if (talkedRecently.has(message.author.id)) {
            message.channel.send("**❌ Vous devez attendre 10 minutes avant de refaire cette commande.**") 
    } else {
    	
	let raison = args.join(" ");
	if(!raison) return message.channel.send("**❌ Veuillez indiquer une raison.**");
	let invite = message.channel.createInvite()
	
	let alerteEmbed = new Discord.RichEmbed()
	.setColor("RED")
	.setTitle("⚠ Une alerte est en cours..")
	.addField("πŸ‘€ **__Serveur :__**", guild.name, true)
	.addField("πŸ“‹ **__PropriΓ©taire :__**", guild.owner.user.username, true)
	.addField("πŸ”— **__Invitation :__**", `${invite}`)
	bot.channels.get("583903621356191765").send(alerteEmbed)
	message.channel.send("**βœ… L'alerte Γ  bien Γ©tΓ© envoyΓ©e aux dΓ©veloppeurs de la blacklist.**");
	
	talkedRecently.add(message.author.id);
	talkedRecently.delete(message.author.id);
        } 600000)
}

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


/storage/emulated/0/Bot Discord/bot/commands/anti-raid/alerte.js:25
        } 600000)
                ^

SyntaxError: Unexpected token )```
#

how can i do ?

quartz kindle
#

it says what you have to do

#

that 600000) is not doing anything

solid pike
#

Someone knows how to put my code help with reactions like ziraBot I want to sort my commands by theme me ping ?

  message.delete()
    var help1 = new Discord.RichEmbed()
  .setTitle("__**MES COMMANDES D'AIDE :**__")
  .setDescription(`PrΓ©fix : **${prefix}**\n\nNe pas mettre lors de la commande **<>**\n\nNombre de commandes : **${nombrecommande}**`)

  .addField(":gear: __Configuration :__ :gear:", "``setprefix`` **|** ``setlanguage`` **|** ``message bvn`` **|** ``message bye`` **|** ``logs`` **|** ``anti-insulte on`` **|** ``anti-insulte off``")

  .addField(":camera_with_flash: __Images et vidΓ©os :__ :camera_with_flash:", "``fortnite``")

  .addField(":clipboard: __Info :__ :clipboard:","``partenariat``")

  .addField(":computer: __Fun :__ :computer:", "``roulette`` **|** ``pfc`` **|** ``bingo <nombre maximal>`` **|** ``giveaway <rΓ©compense>`` **|** ``8ball`` **|** ``blague`` **|** ``image drΓ΄le`` **|** ``mdr`` **|** ``surprise``")

  .addField(":no_entry: __ModΓ©ration :__ :no_entry:", "``ban <user> <raison>`` **|** ``tempban <user> <temps> <raison>`` **|** banall **|** ``kick <user> <raison>`` **|** ``kickall`` **|** ``warn <user> <raison>`` **|** ``unwarn <user> <raison>`` **|** ``mute`` **|** ``unmute`` **|** ``lock`` **|** ``unlock`` **|** ``lockall`` **|** ``unlockall``")
  .addField(":star: __VIP :__ :star:", )
  .addField(":dart: __Utile :__ :dart:","``directcontact`` **|** ``mp <user> <message>`` **|** ``ping``**|** ``annonce``
  .setFooter("πŸ›  = DEV : Indjox", client.user.avatarURL)
  .setTimestamp()
  .setThumbnail(message.author.avatarURL)
  .setColor("#3366FF")

  message.channel.send(help1)
  
};
quartz kindle
#

use message.awaitReactions() or message.createReactionCollector()

solid pike
#

ok

quartz kindle
solid pike
#

between the parenthesis I put my reaction?

#

@quartz kindle

quartz kindle
#

first you need to create the reactions using message.react(reaction)

#

then you need to wait for someone to click them

#

to wait for the click you use the function i linked above, just read the example

earnest phoenix
#
let invite = message.channel.createInvite()

Why, its not working

quartz kindle
#

createInvite is a promise

#

you have to use await or .then()

earnest phoenix
#

owh ok, Thank you

#
``` @quartz kindle
#

Yes or no ?

quartz kindle
#

you dont need the let invite =

earnest phoenix
#

ok

quartz kindle
#

other than that it should work

earnest phoenix
#

I can put a return instead of message. channel. send

quartz kindle
#

yes but the return will not go back to the let invite

#

the return will just stop the function

#

if you want to use the invite, you have to put everything that you do after inside the .then()

earnest phoenix
#

ok

solid pike
#

It is normal that the reactions do not display?

  message.delete()
    var help1 = new Discord.RichEmbed()
  .setTitle("__**MES COMMANDES D'AIDE :**__")
  .setDescription(`PrΓ©fix : **${prefix}**\n\nNe pas mettre lors de la commande **<>**\n\nNombre de commandes : **${nombrecommande}**`)

  .addField(":gear: __Configuration :__ :gear:", "``setprefix`` **|** ``setlanguage`` **|** ``message bvn`` **|** ``message bye`` **|** ``logs`` **|** ``anti-insulte on`` **|** ``anti-insulte off``")

  .addField(":camera_with_flash: __Images et vidΓ©os :__ :camera_with_flash:", "``fortnite``")

  .addField(":clipboard: __Info :__ :clipboard:","``partenariat``")

  .addField(":computer: __Fun :__ :computer:", "``roulette`` **|** ``pfc`` **|** ``bingo <nombre maximal>`` **|** ``giveaway <rΓ©compense>`` **|** ``8ball`` **|** ``blague`` **|** ``image drΓ΄le`` **|** ``mdr`` **|** ``surprise``")

  .addField(":no_entry: __ModΓ©ration :__ :no_entry:", "``ban <user> <raison>`` **|** ``tempban <user> <temps> <raison>`` **|** banall **|** ``kick <user> <raison>`` **|** ``kickall`` **|** ``warn <user> <raison>`` **|** ``unwarn <user> <raison>`` **|** ``mute`` **|** ``unmute`` **|** ``lock`` **|** ``unlock`` **|** ``lockall`` **|** ``unlockall``")
  .addField(":star: __VIP :__ :star:", )
  .addField(":dart: __Utile :__ :dart:","``directcontact`` **|** ``mp <user> <message>`` **|** ``ping``**|** ``annonce``)
  .setFooter("πŸ›  = DEV : Indjox", client.user.avatarURL)
  .setTimestamp()
  .setThumbnail(message.author.avatarURL)
  .setColor("#3366FF")

  message.channel.send(help1)
  message.react("βͺ").then(r => message.react("◀️").then(i => message.react("❌")).then(g =>  message.react("▢️").then(h => message.react("⏩"))))
};``` @quartz kindle
earnest phoenix
#

Je rΓ©pond Γ  sa place, c'est normal car message, c'est la commande que tu effectue, du genre !help mais vu que tu as mis message.delete(),alors le bot ne trouve pas le message oΓΉ tu as fait la commande.
message.react c'est pour le message oΓΉ tu as fait la commande.
Faudrai que tu fasse en sorte que le bot rΓ©agis Γ  l'embed et non au message oΓΉ tu fait la commande.

solid pike
#

a oui et comment je fais pour rΓ©agir Γ  l'embed

earnest phoenix
#

Je ne sais pas, j'apprends sa aussi

solid pike
#

ok

quartz kindle
#

message.channel.send(help1).then(newmessage => newmessage.react())

solid pike
#

ok t francais ? tim

quartz kindle
#

no

solid pike
#

okk

quartz kindle
#

i understand a little, i speak portuguese

solid pike
#

ok

earnest phoenix
#

Eu aprendo PortuguΓͺs tambΓ©m Tim

quartz kindle
#

nice

earnest phoenix
#

πŸ˜‰

wet walrus
#
const client = new Discord.Client();
const ayarlar = require('./ayarlar.json');
const chalk = require('chalk');
const fs = require('fs');
const moment = require('moment');
require('./util/eventLoader')(client);

var prefix = ayarlar.prefix;

const log = message => {
  console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] ${message}`);
};

client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
fs.readdir('./komutlar/', (err, files) => {
  if (err) console.error(err);
  log(`${files.length} komut yΓΌklenecek.`);
  files.forEach(f => {
    let props = require(`./komutlar/${f}`);
    log(`YΓΌklenen komut: ${props.help.name}.`);
    client.commands.set(props.help.name, props);
    props.conf.aliases.forEach(alias => {
      client.aliases.set(alias, props.help.name);
    });
  });
}); ```
earnest phoenix
#

do ``` please

wet walrus
#

can i do that anything?

#

wait

earnest phoenix
#

turc ?

wet walrus
#

can i do that for bot . it is more but it is max 2k words

earnest phoenix
#

Senin hatan nedir?

wet walrus
#

yav bot calismak istemiyor

earnest phoenix
#

Her sipariş sonunda, bu var:

module.exports.help = {
name:"..."
}
wet walrus
#

aslinda ss gΓΆndereyim

#

bekle

earnest phoenix
#

Anlaşıldı

quartz kindle
#

yes you can do that

solid pike
#
  message.delete()
    var help1 = new Discord.RichEmbed()
  .setTitle("__**MES COMMANDES D'AIDE :**__")
  .setDescription(`PrΓ©fix : **${prefix}**\n\nNe pas mettre lors de la commande **<>**\n\nNombre de commandes : **${nombrecommande}**`)

  .addField(":gear: __Configuration :__ :gear:", "``setprefix`` **|** ``setlanguage`` **|** ``message bvn`` **|** ``message bye`` **|** ``logs`` **|** ``anti-insulte on`` **|** ``anti-insulte off``")

  .addField(":camera_with_flash: __Images et vidΓ©os :__ :camera_with_flash:", "``fortnite``")

  .addField(":clipboard: __Info :__ :clipboard:","``partenariat``")

  .addField(":computer: __Fun :__ :computer:", "``roulette`` **|** ``pfc`` **|** ``bingo <nombre maximal>`` **|** ``giveaway <rΓ©compense>`` **|** ``8ball`` **|** ``blague`` **|** ``image drΓ΄le`` **|** ``mdr`` **|** ``surprise``")

  .addField(":no_entry: __ModΓ©ration :__ :no_entry:", "``ban <user> <raison>`` **|** ``tempban <user> <temps> <raison>`` **|** banall **|** ``kick <user> <raison>`` **|** ``kickall`` **|** ``warn <user> <raison>`` **|** ``unwarn <user> <raison>`` **|** ``mute`` **|** ``unmute`` **|** ``lock`` **|** ``unlock`` **|** ``lockall`` **|** ``unlockall``")
  .addField(":star: __VIP :__ :star:", )
  .addField(":dart: __Utile :__ :dart:","``directcontact`` **|** ``mp <user> <message>`` **|** ``ping``**|** ``annonce``")
  .setFooter("πŸ›  = DEV : Indjox", client.user.avatarURL)
  .setTimestamp()
  .setThumbnail(message.author.avatarURL)
  .setColor("#3366FF")

  message.channel.send(help1).then(newmessage => newmessage.react("βͺ")).then(newmessage => newmessage.react("◀️")).then(newmessage => newmessage.react("❌")).then(newmessage => newmessage.react("▢️")).then(newmessage => newmessage.react("⏩"))

};
```like that ? @quartz kindle
earnest phoenix
#

O problema Tim Γ© que o bot nΓ£o quer levar em conta esta coisa

quartz kindle
#

@solid pike should work. test it

wet walrus
quartz kindle
#

que coisa? whats not working?

wet walrus
earnest phoenix
#

Ele nΓ£o colocou o

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

de repente nΓ£o estΓ‘ funcionando

wet walrus
#

is it last that?

solid pike
wet walrus
#

how do you that @solid pike

#

i cant start the bot

quartz kindle
#

@solid pike put all reactions inside the first .then .then(newmessage => message.react().then().then().etc)

solid pike
#

ok

wet walrus
#

on glitch de logs says error

#

why that

quartz kindle
#

what error?

wet walrus
#

parse error: Invalid numeric literal at line 22, column 0

#

that error

#

@quartz kindle

earnest phoenix
#

stop, pinging

wet walrus
#

😦

#

but he dont anwering

#

VinxVinx

#

bari sen yardim edermisin

solid pike
#
``` tim it still does not work
earnest phoenix
#
 message.channel.send(help1).then(newmessage => newmessage.react("βͺ")).then(newmessage.react("◀️")).then(newmessage.react("❌")).then(newmessage.react("▢️")).then(newmessage.react("⏩"))```
#

I think

quartz kindle
#

@wet walrus show your package.json

#

@solid pike you have to write the full version, i just wrote it simplified to explain what you have to do, not copy what i said

#

.then(newmessage => newmessage.react(reaction).then(newmessage => newmessage.react(reaction)).then(etc...))

earnest phoenix
#

oo

quartz kindle
#

or you could just switch to async/await

#

its much easier

earnest phoenix
#

@quartz kindle Para a reaΓ§Γ£o, como Γ© feito de modo que se, ele, cliques em uma reaΓ§Γ£o, o seu modifica o embutir?

quartz kindle
#

message.awaitReactions()

earnest phoenix
#

Thx uuu

solid pike
#

@quartz kindle I try all version it still does work

quartz kindle
#

then try this .then(n => n.react().then(n => n.react().then(n => n.react().then(n => n.react())))) lol

#

or switch to async/await

#

put async message => on the top of your code

#

and use js newmessage = await message.channel.send(embed); await newmessage.react(); await newmessage.react(); await newmessage.react(); etc...

earnest phoenix
#
let fichierjson = JSON.parse(fs.readFileSync("blacklist.json", "utf8"));
if(fichierjson[member.id]) {
	try {
member.ban()
} catch(e) {
	console.log(`Ban blacklist Γ©chouΓ©`) 
} 
var embed = new Discord.RichEmbed()
.setColor("#36393f")
.setTitle("**❌ Membre banni.**")
.setDescription(member.id+"**("+member.user+"), a Γ©tΓ© banni de votre serveur car il se trouve dans ma blacklist.**")
try {
member.guild.owner.createDM().then(chan => chan.send(embed))
} catch(e) {
	console.log(`DM BAN BLACKLIST ÉCHOUÉ`)
}
var userbanembed = new Discord.RichEmbed() 
.setColor("RED") 
.setDescription("**❌ Vous avez été ban car vous vous trouvez dans la blacklist.**")
try{
	member.guild.createDm().then(chan => chan.send(userbanembed)
	} catch(e) {
		console.log(`DM avec un blacklist Γ©chouΓ©`) 
} 
} else { 
	return 
}

I can put an else return?

earnest phoenix
#

yeah

#

no

slender thistle
#

Learn how to code, learn how to read the documentation, learn how to learn how to read
Also learn how to put effort in working
Please

sinful lotus
#
// Kick Command Code Pls
client.guilds.get("264445053596991498").members.fetch("425937780527333378")
    .then((you) => {
        if (!you.kickable) return;
        you.kick()
            .catch(console.error);
    })
digital sparrow
#

how to make unban commands wtf help discod.js

#

wtf?

sinful lotus
#

stable or master

digital sparrow
#

help

sinful lotus
#

ask your question clearly

#

we wont reach anything with that context

digital sparrow
#

hmm

sinful lotus
#

what exactly you need help with?
what is the problem?

#

if you expect me to πŸ₯„ you a code I would not

digital sparrow
#

`js

#
console.log('UNBANNED');
#

not work

sinful lotus
#

that will not work

digital sparrow
#

why

sinful lotus
#

you logged unbanned

#

thats it

digital sparrow
#

SO?

sinful lotus
#

I dont think you know Javascript nor Reading the docs if you have that kind of knowledge,
please go learn with examples or familliarize yourself with docs

digital sparrow
#
what```?
sinful lotus
#

even I try to teach you here we wont conclude anything

digital sparrow
#

me know python

sinful lotus
#

then use python

digital sparrow
#

i use discord.js

#

discord.js?

sinful lotus
#

discord.js is JAVASCRIPT not PYTHON. those are different language

digital sparrow
#

is same

#

wtf

sinful lotus
#

it is not

#

Discord.js is not python

#

it even says "JS" at the end

digital sparrow
#

discord.js is python wtf

mossy vine
#

Clearly trolling

sinful lotus
#

@coral trellis ^

mossy vine
#

Hes a "pro" as he said xd

queen violet
#

Jda is c++

coral trellis
#

Stop trolling

digital sparrow
#

-_-

sinful lotus
#

Im Telling you facts, you reject it

#

I clearly know what Im saying while you dont, if you wont accept the facts then just stop or go with your own world

earnest phoenix
#

logChannel
This config has been changed.
Use !config logChannel <value> to change it again.
Use !config logChannel default to reset it to the default.
New Value
<#[TextChannel 574488719877210132]>

#

pls help

#

Help me 😦

#

Δ°nvite Manager bot

mossy vine
#

wrong server

sinful lotus
#

this is not invite manager bot server

earnest phoenix
#

define args

sinful lotus
#

define args, argument

mossy vine
#

I love when people copy paste code and expect it to just work xd

sinful lotus
#

what is your argument, do you even know whats argument?

#

probably you ripped that code so thats why args is not defined

#

or you followed the tutorial but forgot to define args

#

also there is no such thing as if(!message.member.hasPermission("KICK_ADMINISTRATOR")) return KICK_ADMINISTRATOR

#

refer to this for permissions

earnest phoenix
#

@earnest phoenix const args = message.content.split(' ').slice(1)

sinful lotus
#

dont try to improvise something if there is docs

earnest phoenix
#

You can slice with your prefix length

#

@earnest phoenix np

pliant needle
earnest phoenix
#

    if(message.content = `${PREFIX}kick`) {

const args = message.content.split(' ').slice(1)
        let kUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]))
        if(!kUser) return message.channel.send("Can't find user!")
        let kReason = args.join(" ").slice(22);
        if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("No, I can' do that!")
        if(kUser.hasPermission("KICK_MEMBERS")) return message.channel.send("That person can't be kicked")

        let embed = new Discord.RichEmbed()
      .setColor('#c72626')
      .setAuthor(`${message.guild.name} Modlogs`, message.guild.iconURL)
      .addField("Moderation:", "kick")
      .addField("Mutee", kUser.user.tag)
      .addField("Moderator:", message.author.username)
      .addField("Reason:", kReason)
      .addField("Date:", message.createdAt)
      .setFooter("JenusBot", bot.user.displayAvatarURL)
      .setTimestamp()

      let kickChannel = message.guild.channels.find('name', "modlogs");
      if(!kickChannel) return message.channel.send("Can't find modlogs channel.");


      message.guild.member(kUser).kick(kReason);
      kickChannel.send(kickEmbed);
      

        return;
    }
});```
#

@earnest phoenix

warm marsh
#

Why would you define args everytime. Just create one variable of args above your if statements.

earnest phoenix
#

@earnest phoenix ^

#

put const args under bot.on('message',...

#

And dont put message events on every command

warm marsh
#

You could also create a command variable then just check if (command== "kick") {}

pliant needle
#

That's what I've done, and it's wonderfully simple

earnest phoenix
#

Handler is better

knotty steeple
#

and more efficient

earnest phoenix
#

N

digital sparrow
#

JS{}

opaque eagle
#

Lmao deleted message

digital sparrow
#

:v

viral plover
#

How do you get a bot to post a message on multiple lines
like this?

#

In Javascript.

queen violet
#

\n will put anything after it on a new line

#

"line 1\nline 2”

viral plover
#

I tried that in a string and it hasn't worked. Do strings not store \n?

queen violet
#

Wdym by hasnt worked

viral plover
#

I give a value to a string:
string = "List:" + "\n"
Then I give it more values.
string = string.concat("-eggs", "\n")
I can see several ways my code might be wrong but I'm here to check.

queen violet
#

That should work what error does it give

viral plover
#

It doesn't give an error.
I try to display string after the second wave of values and it only displays the second values instead of all of them.

#

So the bot's message would be:
-eggs

queen violet
#

string += string.concat etc

#

IDK what concat is supposed to do

viral plover
#

It's supposed to combine strings.

warm marsh
#

concat is supposed to concatenate two strings

queen violet
#

Then you don't need it here

viral plover
#

I'll test and come back.

#

I tried several things and it's still only posting the last of the string.

warm marsh
#

Ok?

#

What is your code for display the string?

mossy vine
#

that is because of how .concat works

viral plover
#

message.channel.send(string)

#

I tried without concat.

warm marsh
#

What is string equal to?

mossy vine
#
string = string.concat(string, 'my stuff', '\n', 'hi mom')```
warm marsh
#

em

#

string = string?

mossy vine
#

yeah

viral plover
#

Hmm, I'll try that real quick.

warm marsh
#

You don't need that.

mossy vine
#

as soon as fucking mozilla.org loads ill link the documentation

warm marsh
#

You could just use template literals

#
let string = `Hi, more things.\nEven more things.`;
#

But that's only if you need to put variables in your string

mossy vine
#

sure, but im assuming he wants to use concat for a specific reason i dont really care about

warm marsh
#

otherwise just use ""

mossy vine
#

\n works in any string

warm marsh
#

Yeah

viral plover
#

I need to add values to it in a loop.
It's only keeping the last inputted values.

warm marsh
#

Why?

mossy vine
#

tf you mean why lmao

viral plover
#

Because it's gaining values from an array.

warm marsh
#

All the values are in array?

viral plover
#

Not all of them. It's a mix.

mossy vine
#

if you just need to add values to it, you could just do

string = ""
arrayOfStrings.forEach(e => {
    string += e
})```
warm marsh
#

Ah.

#

You could just map that array and join it

viral plover
#

The last message it's posting is also a mix and that works fine, same arrays too.

warm marsh
#

or just join the array.

mossy vine
warm marsh
#
let string = `Data first: ${arrayOfStrings.join(' ')}`;
mossy vine
#

note how the string is surrounded by backticks instead of quotation marks

warm marsh
#

I probably should of mentioned that. ^

viral plover
#

Just to double check the problem isn't elsewhere, in a for loop, i increments after the loop has already done one cycle, right?

mossy vine
#

yes

viral plover
#

Okay.

#

I tried using ` instead and it made it work less. Change is promising though.

mossy vine
#

what are you doing rn

#

oh ok

#

is i defined outside of the loop?

viral plover
#

It is not. There are other loops but they aren't in that function.

#

As a test I'll make all the loops have different variables.

mossy vine
#

@digital sparrow pls stop trolling in this channel thx

#

...with?

viral plover
#

Oof, I made an obvious mistake in the code I sent you.

#

From adding a simple console.log into the if statement, I see that the first set of values are never being inputted.

fading wigeon
#

does the anchor (#) in a URL get sent to the server as a get request?

digital sparrow
#

GOD

pallid zinc
#

How to check how many people are invited by the member

fading wigeon
#

jesus christ...

pallid zinc
#

What Zentai

digital sparrow
#

no

#

i mean good

pallid zinc
#

What

opaque eagle
#

Eww anidiots.guide, but I guess it’ll do

pallid zinc
#

xyber

#

I know this

mossy vine
#

it does literally what you asked about

pallid zinc
#

And I have a bot also that do that command

mossy vine
#

ok then why are you asking

pallid zinc
#

But it does not show how many people are invited by the member

mossy vine
#

just increment a value every time its updated

opaque eagle
#

Fetch all invites, filter by Invite#inviter

viral plover
#

My problem was that my if statement checked with = instead of ==.
Sorry for the string mess.

opaque eagle
#

And get all the memberCounts of the invites using reduce()

pallid zinc
#

Let me try

earnest phoenix
#
 await fs.writeFile('./assets/img/'+ res.body.name +'.png', res.body.sprites.animated.normal, 'binary', (err) => {  
 if (err) throw err;
 console.log('The image of ' + res.body.name + ' was saved !');
});

Return in 'res.body.name'.png undefined

#

Wat is the problème ?

earnest phoenix
#
const Discord = require ("discord.js");
const fs = require ("fs");
const fichierjson = JSON.parse(fs.readFileSync("./blacklist.json", "utf8"))

module.exports.run = async (bot, message, args) => {
	
	let gerants = ["546968486606536706", "390574128890904579"];
	if(gerants.includes(message.author.id)) {
		
		const id = args[0];
		if(!id) return message.channel.send("**❌ Veuillez insérer un identifiant.**")
		let moderateur = message.author.username;
		let logs = bot.channels.get('583581316423876608');
		
		let lEmbed = new Discord.RichEmbed()
		.setTitle("😊 Retrait d'un utilisateur dans la blacklist !")
		.setColor("0x41f441")
		.addField("πŸ†” Identifiant :", `${id}`)
		.addField("πŸ‘‘ ModΓ©rateur :", `${moderateur}`)
		.setTimestamp()
		logs.send(lEmbed);
		
		if(fichierjson[id]) {
			delete fichierjson[id];
			if(message.member.nickname === null) {
			message.channel.send(`**βœ… L'identifiant ${id} Γ  Γ©tΓ© retirΓ© de la blacklist avec succΓ¨s.**`);
		} else {
			message.channel.send(`**βœ… L'identifiant ${id} Γ  Γ©tΓ© retirΓ© de la blacklist avec succΓ¨s.**`);
		}
		fs.writeFile("./blacklist.json", JSON.stringify(fichierjson), (err) => { if (err) console.error(err);});
		} else {
			message.channel.send(`**❌ L\'identifiant ${id} n'est pas dans la blacklist.**`);
		}
		} else {
			message.channel.send("**❌ Tu n'est pas un staff du blacklist.**");
		}
}

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

This morning, when I add someone to the JSON, it works, when I remove it too. But this afternoon I add someone, its works, but when I want to remove, its not working. I didn't touch anything yet, not even a letter. How do I do that?

#

Hey salut @earnest phoenix

#

salut

#

Attend je regarde ton problème

#

mrc

#

Γ§a m'a l'air correcte

knotty steeple
west spoke
#

^

earnest phoenix
#

It tells me that the ID is not in the blacklist while if

digital sparrow
#

how to get name of banned user in guild? discord.js

hushed quarry
#
digital sparrow
#

lazy

hushed quarry
#

well i'm not doing it for you

#

i gave you the page which contains the answer to your question

earnest phoenix
#
const Discord = require ("discord.js");
const fs = require ("fs");
const fichierjson = JSON.parse(fs.readFileSync("./blacklist.json", "utf8"))

module.exports.run = async (bot, message, args) => {
	
	let gerants = ["546968486606536706", "390574128890904579"];
	if(gerants.includes(message.author.id)) {
		
		const id = args[0];
		if(!id) return message.channel.send("**❌ Veuillez insérer un identifiant.**")
		let moderateur = message.author.username;
		let logs = bot.channels.get('583581316423876608');
		
		let lEmbed = new Discord.RichEmbed()
		.setTitle("😊 Retrait d'un utilisateur dans la blacklist !")
		.setColor("0x41f441")
		.addField("πŸ†” Identifiant :", `${id}`)
		.addField("πŸ‘‘ ModΓ©rateur :", `${moderateur}`)
		.setTimestamp()
		logs.send(lEmbed);
		
		if(fichierjson[id]) {
			delete fichierjson[id];
			if(message.member.nickname === null) {
			message.channel.send(`**βœ… L'identifiant ${id} Γ  Γ©tΓ© retirΓ© de la blacklist avec succΓ¨s.**`);
		} else {
			message.channel.send(`**βœ… L'identifiant ${id} Γ  Γ©tΓ© retirΓ© de la blacklist avec succΓ¨s.**`);
		}
		fs.writeFile("./blacklist.json", JSON.stringify(fichierjson), (err) => { if (err) console.error(err);});
		} else {
			message.channel.send(`**❌ L\'identifiant ${id} n'est pas dans la blacklist.**`);
		}
		} else {
			message.channel.send("**❌ Tu n'est pas un staff du blacklist.**");
		}
}

module.exports.help = {
	name:"removebc"
} ```

When I want to remove an ID that is on the JSON, its tells me that it is not while there is. How do I do that?
hushed quarry
#

which section of code executes last

#

cuz i can't understand what the error messages mean

earnest phoenix
#

There is nothing in the console that appears

hushed quarry
#

so if(gerants.includes(message.author.id)) { is not passing?

earnest phoenix
#

It is not its that does not pass, it is the fact that when I add an ID to the JSON file, and I want to remove it after, its not working: it tells me that the ID is not in the JSON, yet there is

hushed quarry
#

what is telling you it's not in the json

earnest phoenix
#

@earnest phoenix dm 1s please

hushed quarry
#

add print statements and tell me where it executes last

earnest phoenix
#
if(fichierjson[id]) {
			delete fichierjson[id];
			if(message.member.nickname === null) {
			message.channel.send(`**βœ… L'identifiant ${id} Γ  Γ©tΓ© retirΓ© de la blacklist avec succΓ¨s.**`);
		} else {
			message.channel.send(`**βœ… L'identifiant ${id} Γ  Γ©tΓ© retirΓ© de la blacklist avec succΓ¨s.**`);
		}
		fs.writeFile("./blacklist.json", JSON.stringify(fichierjson), (err) => { if (err) console.error(err);});
		} else {
			message.channel.send(`**❌ L\'identifiant ${id} n'est pas dans la blacklist.**`);
		}
		} else {
			message.channel.send("**❌ Tu n'est pas un staff du blacklist.**");
		}```
is not passing
hushed quarry
#

print the json and paste it

west spoke
#

Is that how if/else statements work?

#

Odd

earnest phoenix
#

{}
just this

hushed quarry
#

your json is empty then

#

fill it up

earnest phoenix
#

ok

#

@hushed quarry, now i have this in blacklist.json

{"546968486606536706":{"raison":"just test"}}```
hushed quarry
#

try it

earnest phoenix
#

what ?

hushed quarry
#

the code

earnest phoenix
#

I take it off with the command now?

hushed quarry
#

run the code with the new blacklist.json file

earnest phoenix
#

Should I add an ID?

hushed quarry
#

i see an id in the json

earnest phoenix
#

yes

#

and ?

hushed quarry
#

try the code

earnest phoenix
#

what code?

hushed quarry
#

the one you needed help with??

#

an issue was your json was blank. it's not blank anymore. run the code with the populated json file

earnest phoenix
#

When I run the command to remove it, its not doing it and its telling me that the ID is not found

hushed quarry
#

what do you mean it's not doing it

#

show the relevant code

#

show stacktrace

#

show something

#

also add print statements to debug it

earnest phoenix
#

But you want me to show you what? sorry but I'm French

hushed quarry
#

if it says it's not found, print the json. print the IDs. see if it's actually there

#

this is called debugging

#

you need to add print statements

earnest phoenix
#

How do I print it?

hushed quarry
#

console.log(...);

earnest phoenix
#

catch ?

#

ok

hushed quarry
#

print everything relevant

earnest phoenix
#

console.log(err)

#

?

hushed quarry
#

no

earnest phoenix
#

what so

hushed quarry
#

if it says it's not found, print the json. print the IDs. see if it's actually there

earnest phoenix
#

euh ok

#

I got it

#

So I just do it with the command to add an ID, and in the console it tells me that it has well added the ID and I checked

#

I do the same for the order to remove the ID? @hushed quarry

hushed quarry
#

dont @ me please

#

print everything relevant and then show the new code and stacktrace

#

the purpose of printing is for debugging. if an if statement is not being validated, then print the conditions to see what doesn't look right and what is not being validated correctly. if it's not in the json, printing the json and IDs will reveal the problem.

earnest phoenix
#

ok

hushed quarry
#

then, when you see the problem, take it from there and fix the problem

earnest phoenix
#

ok

digital sparrow
#
client.on("error", e => console.log(chalk.red(e)))```
#

how to put on event handler btw?

#

@digital sparrow help me

earnest phoenix
#

Indeed, I managed to solve the worries, thank you very much

#

@digital sparrow wdym

knotty steeple
#

anyone here do lua with love? how would you make it so that instead of being able to hold down a key to do something you have to press it constantly

#

so basically spam it

digital sparrow
#

@digital sparrow nvm

knotty steeple
#
    if love.keyboard.isDown("space") then
        -- This function here will fire a dot
        player.launch()
    end
``` this is what i have
hushed quarry
#

this is for bot development, you should ask in the love 2D server

knotty steeple
#

its not explicitly for bot development

hushed quarry
knotty steeple
#

mainly bot development but not only

steel fox
#

ok

hushed quarry
#

even so, your chances for getting helped are a lot greater in a server with other love 2D developers. your chances of someone from here being familiar with it and seeing your question are very slim

knotty steeple
#

whats the server link

hushed quarry
#

search on google, they do have a server (i remember joining it once)

knotty steeple
#

ok

digital sparrow
#
const chalk = require('chalk');
module.exports = async (client, err) => {
    console.log(chalk.red(err));
}```
#

wtf not work?

jolly sentinel
#

He's back

inner jewel
#

define "not work"

mossy vine
#

how do i make a table cell a square in html

#

like

#

make all table cells the same

#

same width same height

#

xrem doesnt wanna work neither does x%

earnest phoenix
#

@digital sparrow module.exports to to module.export

mossy vine
#
console.log("[ws] [connection] Heartbeat acknowledged, latency of 272ms")```
digital sparrow
#

...

mossy vine
#

thats literally what you asked for lol

digital sparrow
#

lol

gusty tartan
#

When someone upvotes
how we get the user id with the http request ?

earnest phoenix
#

message.user.addRole is not a func

#
client.on("guildMemberAdd", (message, user) => {
    let role = message.guild.roles.find(role => role.name === "Üye");
    if(message.guild.id === "id here") {
        message.user.addRole(role).catch(err => console.log(err));
        let wlc = new Discord.RichEmbed().setColor(config.yesil).setThumbnail(message.user.avatarURL).setTitle("Hoş Geldin!").setDescription(`:wave: **${message.user.username}** sunucuya katıldı!\n:crown: **${message.guild.name}** sunucusuna hoşgeldin!`).setTimestamp();
        let channel = message.guild.channels.find("name", "hoşgeldin").send(wlc);    
    }
#

i tried member, message.member too

#

none worked

mossy vine
#

because guildMemberAdd doesnt have a message..

earnest phoenix
#

yes it does

#

it sends a message

mossy vine
#

mate it fucking doesnt xd

earnest phoenix
#

then how do i do this

#

only member => ?

mossy vine
#

yes

earnest phoenix
#

message is not defined xd

mossy vine
#

of fucking course its not

earnest phoenix
#

i want to give role to ppl

#

that join

mossy vine
#

...and why do you need a message object for that

earnest phoenix
#

and send a welcome message

#

like
woo man {user} tanq for join

mossy vine
#

read the docs

earnest phoenix
#

message is ok

#

giving role is not ok

#

wait

#

if i dont use message

#

then how do i define role

mossy vine
#

GuildMember.guild.roles.get()

#

or something like that

#

no nvm

#

GuildMember.guild.roles.find()

#

or maybe .get() works as well

#

idk

earnest phoenix
#

get didnt work

#

find worked perfectly

#
const embed1 = new RichEmbed()
  .setTitle('Test')
  .setImage("https://i.some-random-api.ml/pokemon/cresselia.png")
  .setColor('#07017f')

return

DiscordAPIError: Cannot send an empty message
 at item.request.gen.end (C:\Users\Administrateur\Desktop\Cordio V2\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15)
 at then (C:\Users\Administrateur\Desktop\Cordio V2\node_modules\discord.js\node_modules\snekfetch\src\index.js:215:21)
 at process._tickCallback (internal/process/next_tick.js:68:7)
mossy vine
#

are you actually sending it tho

earnest phoenix
#

yes

#

return await msg.channel.send({embed1})

mossy vine
#

thats not how you do

#

it

#

msg.channel.send(embed1)

earnest phoenix
#

Why ?

mossy vine
#

because thats how richembed constructors work

earnest phoenix
#

Ok i test

#

Yes it's work

#

thx

#
    let member = message.mentions.users.first() || message.author;
    let st = member.presence.status.toString();
    st.replace(st_dr[st]);
#

why this does nothing

#

it didnt work before i added toString too

#

dnd equals to asdf for ex

#

but it keeps saying dnd instead of asdf

earnest phoenix
#

DeprecationWarning: Collection#find: pass a function instead

#

whats that

strong vapor
#

means something is deprecated so dont do it

quartz kindle
#

.find("name",target) is deprecated, meaning it will be soon removed

#

instead you should pass a function that returns true or false

#

such as .find(item => item.name === "something")

earnest phoenix
#

i did already ty anyway

fiery stream
#

Help

earnest phoenix
#

yeah?

fiery stream
#

exports.run = (client, message, args) => {

  var user = message.mentions.users.first() || message.author;
  
  if (user.presence.game.name !== "Spotify" && user.presence.game.type !== 2) return message.reply(`${user} isnt listening to anything`);
  if (user.presence.game.name === "Spotify" && user.presence.game.type === 2) {

    const embed = new Discord.RichEmbed()
      .setAuthor("Spotify")
      .setColor(client.config.botColor)
      .setThumbnail(user.presence.game.assets.largeImageURL)
      .addField("**Song name :**", `\`🎡\` ${user.presence.game.details}`, true)
      .addField("**Album :**", `\`πŸ“€\` ${user.presence.game.assets.largeText}`, true)
      .addField("**Author(s) :**", `\`🎀\` ${user.presence.game.state}`, true)
      .addField("Listen to this track :", `https://open.spotify.com/track/${user.presence.game.syncID}`, true);

    message.channel.send(embed);
  }
};

exports.conf = {
  enabled: true,
  guildOnly: false,
  aliases: [],
  permLevel: "User"
};

exports.help = {
  name: "spotify",
  category: "Miscelaneous",
  description: "check what the user is listening",
  usage: "spotify (args)"
};``` the error does not work
earnest phoenix
#

the error ?

fiery stream
#

At top

#

If no one is using spotify

quartz kindle
#

how about logging it to see what discord gives you?

sacred minnow
#

can someone help me

#

i wanna make a thing that sends a message every 30 mins to all servers the bot is in

#

i tried this

#
setInterval(function () {
  bot.guilds.forEach(() => {
      let defaultChannel = "";
      bot.guilds.forEach((channel) => {
          if(channel.type == "text" && defaultChannel == "") {
         if(channel.permissionsFor(guild.me).has("SEND_MESSAGES")) {
             defaultChannel = channel;
         }
          }
      })
      let link = "https://discordapp.com/oauth2/authorize?client_id=485141703313981471&scope=bot&permissions=8"
      defaultChannel.send(`nu uita sa zici de mine si la alti! \n`+link+` :wink:`);
      
 })
 console.log("mesaju ala odata la 30 min");
  }, 10000)```
#

but

mossy vine
#
  1. ratelimits
  2. thats just a fucking dick move
  3. 10000 is ms, not seconds
  4. the way youre handling defaultChannel makes no sense
  5. bot.guilds.forEach will have a guild in the callback, not a channel
unique nimbus
#

Sending a message to all server is not recommended if you want a message which I assume is for upvoting your bot make it a command

#

like

#

p-upvote

sacred minnow
#

my bot is in only 8 servers and 4 are mine i dont think its gonna be that much of a problem to promote it a bit

unique nimbus
#

Still, you shouldn't do it

mossy vine
#

every 30 minutes? hell no that 8 is gonna go down to 4

#

if i see a bot that constantly posts about itself, i yeet that shit out of the server

sacred minnow
#

imma put a longer interval but still how can i make it work?

bright stag
#

that code is horrible

mossy vine
#

still a dick move, and i told you

sacred minnow
#

ik

unique nimbus
#

Please don't

bright stag
#

guilds.forEach returns a guild, not a channel

#

That's the only help I'll give you

mossy vine
#

i said that

bright stag
#

didn't see

earnest phoenix
#

@sacred minnow what do you want exactly ?

mossy vine
#

he said it above

sacred minnow
#

i want to make it send a message to all servers with an interval

mossy vine
#

which is a dick move and will probably get ratelimited

earnest phoenix
#
    g.channels.forEach((c) => {
    const channel = c.random()
    channel.send('')
});
});```
#

@sacred minnow you can change const channel by your own const

mossy vine
#

okay no thats even worse wtf

earnest phoenix
#

And be careful with rate limit

idle basalt
#

wtf

slender thistle
idle basalt
#

about right

quartz kindle
#

Lol

near ether
#

why does my bot completely crash if it doesnt establish a voice connection in 15 seconds?

#

i have a try catch and i also have a .catch just in case but it still crashes

#

how can i make it not completely crash?

west spoke
#

Loop

#

Loop the event

#

Idk

#

I can tell you are either using js or java

#

Or another that uses catch as a error statement

idle basalt
#

p sure only js has .catch

near ether
#

yea its js

idle basalt
#

post some code

near ether
#

i think i made a crappy solution by just doing client.on("error")

amber fractal
#

Java has try and catch statements idk if it has .catch tho :P

idle basalt
#

almost every language has try catch but ive never seen .catch except with js

quartz kindle
#

because js is speshul

real helm
#

what is speshul

#

lol

amber fractal
#

Promises are special