#development

1 messages · Page 900 of 1

royal portal
#

guildCreate doesnt work

#

it gives me an error that its deprecated

wet dove
#

What library?

sudden geyser
#

What language? What library? What are you doing?

royal portal
#

discord.js

wet dove
#

Oh JS

#

Which version?

royal portal
#

I need my bot to message owner of guild when the bot is invited

#

v12

pale vessel
zealous urchin
#

Hello, I registered my bot to DBL, but I want my bot not to stay in this server (This server consumes my bot's performance a lot) Is it possible to request mod to remove my from this server but not in DBL webpage?

pale vessel
#

yes

sudden geyser
#

Yeah DM a mod

quartz kindle
#

you can make it leave yourself

pale vessel
#

or eval

sudden geyser
#

or that too ^^

timid blade
#

anyone know why my bot is showing offline here but online everywhere else (i only have one shard)

royal portal
#

I don't understand what I have to change

#

whats the new guildCreate?

quartz kindle
#

there is no new guildCreate

zealous urchin
#

Oh then make my bot leave here doesn't matter at all?

quartz kindle
#

its the same as the old

royal portal
#

its not working for me

quartz kindle
#

nope doesnt matter

#

the only thing is that your bot will not show online in the top.gg website

zealous urchin
#

thanks

royal portal
#

bot.on("guildCreate", guild => {
guild.owner.send("hi")
});

#

that

hardy vector
#

i want to make my bot so when someone votes it knows who voted and can give coins to them

royal portal
#

it works but gives an error

quartz kindle
#

owner might not be cached

hardy vector
#

cos ik a bots that do that

quartz kindle
#

bot.users.fetch(guild.ownerID).then(owner => owner.send())

royal portal
#

guild.cache.owner.send?

quartz kindle
pale vessel
#

no

royal portal
#

bot.on("guildCreate", guild => {
bot.users.fetch(guild.ownerID).then(owner => owner.send("hi"))
});

#

like that?

quartz kindle
#

yes

hardy vector
#

i want to make my bot so when someone votes it knows who voted and can give coins to them

pale vessel
royal portal
#

@quartz kindle doesnt work

#

nvm it does

#

im just like on 21438192481294812831238 ping

earnest phoenix
#

can you help me please :

#
@bot.event
async def on_member_unban(user, guild):
    embed = discord.Embed(title=f"**__{user.guild.name}__ à été debanni du serveur**", description=f"Information du membre banni : ", color=65280)
    embed.add_field(name="``nom``", value=f"{user.guild.name}")
    embed.add_field(name="``Compte créer le``", value=f"{user.guild.created_at}")
    await discord.utils.get(user.guild.text_channels, name='📜pee1-logs📜').send(embed=embed)
pale vessel
royal portal
#

@earnest phoenix um

#

you're asking for help but you didnt say what you need help with

subtle topaz
#

is there a help channel?

slender thistle
#

regarding what

earnest phoenix
#

@zinc condor 4. No self promotion / advertising

slender thistle
earnest phoenix
#

just trying to keep ya out of trouble 🙂

stoic shard
#

I can help you guys with python

copper cradle
#

@rustic jewel what do you need help with? you can't just drop a chunk of code and expect people to instantly try to help you, I didn't even read the code bc of the way you asked

slender thistle
#

Also how does User.guild make sense to you

copper cradle
#

you need to ask your question

stoic shard
#

AFAIK is member, guild

copper cradle
#

the names don't matter

#

they're just arguments in a function

slender thistle
#

They... kinda do

#

in this case they do

copper cradle
#

if they're kwargs

stoic shard
#

Guild, user

copper cradle
#

iirc

slender thistle
#

docs might be better to read instead

#

positional args != kwargs

stoic shard
#

And? I don't see any errors in this code

slender thistle
#

I see plenty of errors

copper cradle
#

I know the diff shiv

#

my point was: the name doesn't matter as long as you know exactly what each argument is

slender thistle
#

true

copper cradle
#

ofc positional args matter bc they're positional

#

I just messed up there

slender thistle
#

but guild_object.guild doesn't make sense

copper cradle
#

nice

pale vessel
#

never heard of a country called android @stoic shard

copper cradle
#

I didn't read their code

#

I was just pointing that out

stoic shard
#

Lol, on Android

#

🤦‍♀️

slender thistle
#

aye no shitposting in this channel lads

grizzled raven
#

bruh what happened to tim

#

oh nvm my client was being bad

safe echo
#

d!server

#

Ok

tight plinth
#

what

digital ibex
#

hi, why am i getting Cannot read property 'edit' of undefined when i used the same resolver for my whois command?

#

code: wuser.edit({ nick: args.join(' ') });

sudden geyser
#

show what wuser is.

digital ibex
#

and when i log wuser it doesn't log

#

the issue can't be with it because i just tested my whois command and theres no issue with it

#

its the same resolver

sudden geyser
#

okay but can you show what wuser is

digital ibex
#
  let wuser = members.find((m) => m.mention.replace('!', '') === query.replace('!', '') ||
 `${m.username}#${m.discriminator}` === query || m.username === query || m.id === query || m.nick === query) || // Exact match for mention, username+discrim, username and user ID
members.find((m) => `${m.username.toLowerCase()}#${m.discriminator}` === query.toLowerCase() ||                                       m.username.toLowerCase() === query.toLowerCase() ||m.nick && m.nick.toLowerCase() === query.toLowerCase())
) || // Case insensitive match for username+discrim, username
members.find((m) => m.username.toLowerCase().startsWith(query.toLowerCase()) || (m.nick && m.nick.toLowerCase().startsWith(query.toLowerCase()));```
sudden geyser
#

so the user could not be found? I assume this is Eris?

digital ibex
#

yeah

#

idk,

sudden geyser
#

query is your user-input I assume. Can you show what that is? Maybe the user you searched for could not be found/cache/etc.

digital ibex
#
let query = args.join(' ')
sudden geyser
#

I just assume the user could not be found. Are you sure the user is cached and is in the server/your input is correct

#

It's messy but it looks correct

digital ibex
#

yes

#

the user is cached because i cache all users

#

oh, i think i know why

#

because query is args.join

#

not args[0]

#

bc its a nick command

#

ok, er, my bot has admin, but its saying its missing perms

sudden geyser
#

if query is args.join(" "), why is nick supposed to be set to the same input you used to find the member?

#

I can't even test it as I seem to get a syntax error.

digital ibex
#

yeah

#

thats why i changed it to args[0]

nocturne grove
#

Hey. When my bot gets this guild (client.guilds.cache.get(IdOfThisGuild)) it gives an object without name and available = false. What's wrong?

amber fractal
#

bots are having trouble with this server atm

#

some are seeing it as an outage

nocturne grove
#

ohw thanks

plucky heart
#

Hey, how can I load all users immediately?
I use now Client.users.cache.size

nocturne grove
#

should solve the error then 😅

amber fractal
#

available is only false when your bot doesn't have access to the guild due to an outage

#

nothing we can do

#

we have to wait for discord to work

digital ibex
#

haksui, cache all users

amber fractal
#

yeah if you cache all users your memory will just die

#

there's 100k users here

#

caching all will not be good for the system

digital ibex
#

not if ur using eris smirk

sudden geyser
#

that's for any program

#

just because eris is better than discord.js in its memory doesn't mean it'll be a good idea

amber fractal
#

uh that's not how that works

#

cache is cache

digital ibex
#

i mean

#

it wouldn't break

amber fractal
#

using a different library will not be any better for caching 100k users at startup

digital ibex
#

i cache all users and everything works fine

amber fractal
#

and your bot doesnt have 100k users on it from this server

sudden geyser
#

Yeah but... why would it break?

amber fractal
#

it will use more memory, not break

digital ibex
#

well, from startup it would just take long

#

wouldn't break

surreal notch
#

How to mark spoiler in bot text?

amber fractal
#

same way you would with sending one?

surreal notch
#

like|| this||

digital ibex
#
message.channel.send('|| hi ||');
#

should work

sudden geyser
#

You do it like normal: ||text here||

surreal notch
#

Ok let me try

#

How to add field?

digital ibex
#

embed.addField

late cargo
#

How you enter the giveaway

plucky heart
slender thistle
surreal notch
#

Hey I want codes like that if someone used that command he cannot use it for next 12 hours

lyric mountain
#

does someone here know how to deal with oauth2?

hardy vector
#

how do you style your bots description

#

cos it says html and markdown allowed

#

and other bots have a cool design

#

so how do i do it

#

can someone tell me cos instead of helping some mod is saying "inspect element"

lyric mountain
#
<styles>
YOUR CSS HERE
</styles>
surreal notch
#

Hey I want codes like that if someone used that command he cannot use it for next 12 hours

#

Please help me out

hardy vector
#

<style>
h1 {
color: blue;
}
</style>
Meme
_meme
_coronameme
_cursedimage
_wholesome
_joke
_cnjoke
Moderation
_kick
_ban
_report (person) (reason)
Cubing
_cubing, sends a random image from r/cubers
_3 generates a random 3x3 scramble
_4 generates a 4x4 scramble
_2 generates a 2x2 scramble
Miscellaneous
_stats, gets the stats of server
_stats @mentionpersonhere, gets stats of a person
_ping
Economy
Gambling
_coinflip (prediction) (amountgambling)
_dice (prediction) (amount gambling)
_slots (amount)
Money
_work, lets you work
_daily, gets you 100 coins every day
_transfer (person) (amount), transfers money
_stonks, try investing in stonks
_lb, checks the leaderboard
_bal, check your balance
_beg, beg if you are really desperate
_pm, lets you post a meme
_scout, lets you search for money if you're desperate
Minecraft
_mc (server ip) (server port)
More Help
For more information on certain commands do _help (Name of command category), ex: _help Economy

slender thistle
#

styles or style

hardy vector
#

does this work

slender thistle
#

jeez that's a big description you decided to paste here

hardy vector
#

oops

#

sorry

#

dont band

#

ban

lyric mountain
#

@surreal notch you gotta give more info.

what language are you using?
do you have a database?
why?

hardy vector
#

wait would that style work

#

the tag i put

slender thistle
#

Use HTML and put your stuff in <h1> tags

#

or use <p> catshrug

hardy vector
#

ok

#

k

slender thistle
#

but tbf if you only want to change the description's color...

hardy vector
#

can you also change background color?

lyric mountain
#

does anyone here know how to deal with oauth2?

#

I'm stuck in the legendary "invalid_grant" error

surreal notch
#

@lyric mountain I am using discord.js v12

#

Non command hhandler

slender thistle
#

iirc it's .long-description #content except I don't remember if the content was a class or an ID

lyric mountain
#

store users in a database, and whenever someone uses that command just query the user with SELECT timestamp FROM Users WHERE id = :id

#

first of all you'll need to create a sqlite.db file

surreal notch
#

@lyric mountain actually i am new to coding means 3-4 weeks

lyric mountain
#

I imagine those 12 hours cooldown is meant for votes, right?

surreal notch
#

Nope for votes but normally

lyric mountain
#

what?

#

still, you'll need a database for that much time

surreal notch
#

so how can i create a database

lyric mountain
#

create a file named sqlite.db

#

not sqlite.db.txt, but sqlite.db

surreal notch
#

ok

#

ok

#

done

lyric mountain
#

now do npm install sqlite3

surreal notch
#

in that file?

lyric mountain
#

no

cobalt mesa
#

@nocturne grove the second condition that you passed to me earlier does not work with d.js 11.5.1 you can tell me how I can do it (because I'm not on d.js 12.xx but 11.5. 1)

lyric mountain
#

in your command line

surreal notch
pale vessel
#

just create a JSON file mmLol

surreal notch
#

should i add a package?

lyric mountain
#

wait, image still loading

#

just create a JSON file mmLol
@pale vessel better not make them start the wrong way

#

have you installed sqlite3?

surreal notch
#

should i add a package of npm install sqlite3

lyric mountain
#

use the command line to do that

#

what do you mean with "add a package"?

surreal notch
#

?

lyric mountain
#

like, how are you starting you bot?

surreal notch
#

Means like we add package of discord.js

#

in glitch

lyric mountain
#

idk how to add packages on glitch, but I guess you need to add it to the package.json

surreal notch
#

Ok

quartz hill
#

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
How can I solve this? discord js

surreal notch
#

yes

#

i have installed it

#

@lyric mountain

lyric mountain
#

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
How can I solve this? discord js
@quartz hill optimize your code

surreal notch
#

@woven sundial ik that

lyric mountain
#

no

surreal notch
#

?

#

This is much confusing here can you come in DM?

#

@lyric mountain

digital ibex
#

hi

#

how can i send a message to a user with eris

#

when i do ```js
let dm = client.getDMChannel(message.author.id).then((e) => e.id);
client.createMessage(dm, 'hi');

unique nimbus
#

Have you googled it @woven sundial

#

I mean I found this after googling "Javascript Timezone"

pale vessel
#

@digital ibex it's not asynchronous

#

you're supposed to put that inside .then

#

or use await, easier

digital ibex
#

so

pale vessel
#

???????????

#

you are officially lost

digital ibex
#
let dm = await client.getDMChannel(message.author.id);
let o = dm.id;
client.createMessage(o, 'hi');
pale vessel
#

you can do dm.createMessage if you put it inside .then

digital ibex
#

?

#

what

unique nimbus
digital ibex
#

oh

#

ok

pale vessel
#

that works too

digital ibex
#

so, dm.createMessage('hi);

pale vessel
#

yes

digital ibex
#

ok, thank u

pale vessel
#

no need for o

digital ibex
#

dm.createMessage is not a function

pale vessel
#

let me see your code

digital ibex
#
let dm = client.getDMChannel(message.author.id).then((e) => e.id);
client.createMessage(dm, 'hi');```
unique nimbus
#

yes

digital ibex
#

the reason y i'm using .then is bc i'm evallign it

pale vessel
#

you got it right there

digital ibex
#

and my eval is broken

#

yea

#

i can't use await in my eval

#

for some reaosn

pale vessel
#

then make it inside the .then

#

inside it.

digital ibex
#

ok

pale vessel
#
let dm = client.getDMChannel(message.author.id).then((e) => e.id); // <-- inside here
client.createMessage(dm, 'hi'); // not here```
#

so e.createMessage

digital ibex
#
client.getDMChannel(message.author.id).then((e) => e.createMessaege('hi');
pale vessel
#

or client.createMessage(e.id

digital ibex
#

?

#

oh

#

ok, thank u

#

oj

#

oh

pale vessel
#

yes

digital ibex
#

kk, thank

nocturne grove
#

@nocturne grove the second condition that you passed to me earlier does not work with d.js 11.5.1 you can tell me how I can do it (because I'm not on d.js 12.xx but 11.5. 1)
@cobalt mesa remove the '.cache' and it will work

livid marsh
#

@earnest phoenix

royal portal
#

can anyone help me with a random user command, it just stopped working

#

discord.js v12

sudden geyser
#

show what you did

cobalt mesa
#

@nocturne grove ok thanks and if the server isn't in the cache how do i do ??

earnest phoenix
#

need help importing my play command (ytdl) from my old bot file to its own command file

#
                var server = servers[message.guild.id];

                const channel = message.member.voiceChannel; {
                    server.dispatcher = connection.play(
                        ytdl(server.queue[0], {
                            filter: "audioonly"
                        })
                    );
                }
                server.queue.shift();

                server.dispatcher.on("finish", function () {
                    play(connection, message);
                    if (server.queue[0]) {} else {
                        connection.disconnect();
                        message.channel.send('Bye Bye :sc2:')
                    }
                });
            }

            if (!args[1]) {
                message.channel.send("send link pwease :sc1:");
                return;
            }

            if (!message.member.voice.channel) {
                message.channel.send(
                    "Pwease go in da channel :sc1:"
                );
                return;
            }

            if (!servers[message.guild.id])
                servers[message.guild.id] = {
                    queue: []
                };

            var server = servers[message.guild.id];

            server.queue.push(args[1]);

            if (!message.guild.voiceConnection)
                message.member.voice.channel.join().then(function (connection) {
                    play(connection, message); {
                        message.channel.send("Playing :sc1:");
                    }
                });```
nocturne grove
#

@nocturne grove ok thanks and if the server isn't in the cache how do i do ??
@cobalt mesa I guess all servers are in the cache. Never thought about something like that

#

@earnest phoenix sorry I don't have knowledge of music things

cobalt mesa
#

ah ok

earnest phoenix
#

its all good

proper mist
#

how do i send a message to two channels in one commands discord.js v12

nocturne grove
#

@proper mist do you know which channels?

proper mist
#

?

earnest phoenix
#

possibly channel id?

proper mist
#

I know which channels

#

but how do i do it

#

so that

#

both send at the same time

nocturne grove
#

@proper mist if you have something you want to send, just do:
channel1.send(message);
channel2.send(message);

#

that's very obvious, I know. But I can't make it any harder to do

earnest phoenix
#
if (message.channel.id == 702161547421810824) {
        if (cmd == "hey") {
            message.channel.send("All Works!");
        } else {
            message.delete(1000);
        }
    }

Why he do not delete the message?

amber fractal
#

what version are you using

#

of d.js which I assume is what that is

earnest phoenix
#

The widget doesn't load, and I'm doing everything correctly

proper mist
#

message is not defined

#

frik how do u define message again

heavy marsh
#

In discord.js v12.2.0 how can i use invite to fetch information from an invite code?

earnest phoenix
#

@woven sundial This does not work too!

proper mist
#

In discord.js v12.2.0 what is message.guild.channels.forEach's equivalent

earnest phoenix
#

can anyone validate the following line? execute(async, args, message, channel, server) {

sudden geyser
#

Loudy it's in the docs: channels.cache.forEach

#

IF6 did you test it.

#

If you did you should get a syntax error.

earnest phoenix
#
if (message.channel.id == "702161547421810824") {
        if (cmd == "hey") {
            message.channel.send("All Works!");
        } else {
            message.delete(1000);
        }
    }

Why he do not delete the message?

#

no I can;t because vsc gives back

sudden geyser
#

MrOuxr what versino

#

what does VSC give you back.

#

an error?

earnest phoenix
#

discord is a little slow today

sudden geyser
#

okay so click on that and it'll tell you where you messed up on your syntax. async is a keyword in javascript and can't be used like that.

#

If you want to dub a function as async, it must be before the function name.

earnest phoenix
#

@woven sundial v12

proper mist
#

so i'm trying to reset my server and delete all the channels

#

I have this

#
client.on('message', message =>{
  if(message.author.id == "my id") {
  if(message.content === "/bye") {
  channels.cache.forEach(channel => channel.delete())
    }
  }
})
proper mist
#

i have this

earnest phoenix
#

@woven sundial There is not error, but it did not delete the message

proper mist
#

it says that channels is not define

sudden geyser
#

Fetch invite to get basic guild data?

heavy marsh
#

Yes

earnest phoenix
#

@woven sundial Yes

proper mist
#

how do i define channels

heavy marsh
#

online members & total members

#

And the invite code is constant

proper mist
#

where in the docs does it tell you how to define channels

sudden geyser
earnest phoenix
#

@woven sundial I tried yours but I do not work

proper mist
#

yes

#

but now it says channels isn't defined

sudden geyser
#

In v11, you could pass the time as the first argument. In v12, you need to pass an object with timeout being the milliseconds before the message is deleted. If your error is something else (like you said, channels isn't defined), that code snippet is not the issue.

proper mist
#

it says message is not defined

#

I'm on v12

#

if (message.channel.id == "702161547421810824") {
if (cmd == "hey") {
message.channel.send("All Works!");
} else {
message.delete();
}
}
setTimeout(() => {
},1*1)
}
}

#

would this work

#
if (message.channel.id == "702161547421810824") {
        if (cmd == "hey") {
            message.channel.send("All Works!");
        } else {
            message.delete();
        }
    }
 setTimeout(() => {
    },1*1)
    }
    }
pale vessel
#

what is the timeout for

proper mist
#
if (message.channel.id == "705477023061245957") {
        if (cmd == "hey") {
            message.channel.send("All Works!");
        } else {
            message.delete();
        }
    }
 setTimeout(() => {
    .then(console.log)
    .catch(console.error);
    },1*1)
    }
    }
earnest phoenix
#

what is with discord and taking forever to send images?

oak cliff
#

its having an outage rn

#

with images.

terse girder
#

When I create a new client and login, the ready event is never emitted. I'm pretty sure this has something to do with the outage that happened earlier, as it started to not work when that happened.

#

There are no errors

#

And I use discord.js

#

Does anyone have any ideas?

#

Or am I literally the only person who has had this happen during this outage?

earnest phoenix
#

alright imma cool it on message. why does send come up as undefined

turbid bough
#
channel.send('<content>');```
earnest phoenix
turbid bough
#

add a : right after execute

earnest phoenix
#

thank you

proper mist
#

how do i make a command that deletes all channels in a server

quartz kindle
#

i hope you're not nuking/destroying servers

proper mist
#

im notd

quartz kindle
#

loop over all channels and delete each of them

#

use a for loop with async await to avoid rate limits

earnest phoenix
proper mist
#

how ;c @quartz kindle

#
channel.delete()
  .then(console.log)
  .catch(console.error);
#
client.on('message', message => {
  if(message.content.toLowerCase().startsWith('/delete')) {
channel.delete()
  .then(console.log)
  .catch(console.error);
}
});
quartz kindle
#

do you know what is a loop?

proper mist
#

yes

wide glade
#

How can I check if a user has voted in the last 12 hours

quartz kindle
#

do a for of loop on the guild's channels

wide glade
#

Not just only 1 user but like anyone

proper mist
#

ok nvm i don't knwo

quartz kindle
#

@wide glade you can use the top.gg api

#

there is an endpoint to get votes

#

they also have webhooks that notify you when someone votes

wide glade
#

Oh ok

proper mist
#

._.

#

a for of loop???

quartz kindle
#

yes, read the links i posted above

earnest phoenix
#

Hello, there's a guide about filter offline members? weirdsip

proper mist
#

ok

#

there's only for of???

#

there's only for in*

restive furnace
#

theres lot of loops, but best ones are for..of and for..in

proper mist
#

ok

restive furnace
#

even tho for in, is like for(let i = 0; i < count; i++)

proper mist
#
const arr = [3, 5, 7];
arr.foo = 'hello';

for (let i in arr) {
   console.log(i); // logs "0", "1", "2", "foo"
}

for (let i of arr) {
   console.log(i); // logs 3, 5, 7
}
restive furnace
#

yep

proper mist
#

ok

#

so how do i now loop this to delete channels

restive furnace
#

so basically, for in gives wheres the object/array located in, example 0 means 3, and for of gives wheres the object/array property.

#

for..of loop of guild channels.

proper mist
#

ok

#

soooooooooo

pale vessel
#

you don't expect us to spoonfeed you

dusky spade
#

Hi

proper mist
#

I'm watching a video on it

restive furnace
#

u dont need to

#

i expleaned very well, atleast i think so.

proper mist
#

ok

restive furnace
#

just simply use google, if you have questions or this didn't solve ur problem

#

never trust any videos. (they're mostly outdated)

proper mist
#

ok

sudden jay
#

Pls help me

#

how i do her pls

quartz kindle
#

when your bot is in 75+ servers

#

you go to your discord developer page and verify your bot

honest perch
#

you will get a dm and email with more info

tired nimbus
#

how do you detect if a message was copied from messages like hello

honest perch
#

once in 76 servers

small prairie
#

@tired nimbus that doesnt make any sense

tired nimbus
#

In dank memer

#

when you do your job

small prairie
#

If your bot got ip banned would u recieve an email?

mossy vine
#

even less sense now

tired nimbus
#

the messages are in backticks to detect copy paste

small prairie
#

Ah

#

Probably checks the message.starttyping and the message.created at timestamp

#

not sure thats a custom functionality they made

#

AFAIK no lib does that

#

If your bot got ip banned would u recieve an email?

tired nimbus
#

"Its because of the markup text, the backticks"

#

ill have to do some testing

small prairie
#

wut?

#

you know what

#

ignore me

tired nimbus
#

yep I was right

earnest phoenix
#

Error:

(node:1484) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'includes' of undefined```
> **Linea de Codigo:**
```js
let cmd = client.comandos.get(command) || client.comandos.find((c) => c.alias.includes(command))```

Con algunas cosas pasa, pero no se el por qué
pale vessel
sudden jay
#

@quartz kindlehow do i check?

earnest phoenix
#

idk why but voiceChannel and voice.channel come back undefined

sudden jay
#

What is it in the portal to develop

earnest phoenix
#

anyone used postgresql before, i don't understand why it's saying Sql is not an constructor,

const Sql = require('pg')
  const sql = new Sql({
    connectionString: process.env.DATABASE_URL,
    ssl: true,
  });
mossy vine
#

new Sql.Client

#

ur not destructuring the require object

earnest phoenix
#

the { } is not optional?

mossy vine
earnest phoenix
#

voice.channel and voiceChannel come back undefined

#

my exact error is UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'voiceChannel' of undefined

quartz kindle
#

when your bot is in 75+ servers, you go there to verify

earnest phoenix
#

the bot needs to be in 75+ guilds to be verified?

quartz kindle
#

by discord yes

earnest phoenix
#

does it need to have a website?

quartz kindle
#

no

earnest phoenix
#

ah

#

made a script

#

but

#

noooooo idea whatsoever

#

how to upload them to the bot

gilded plankBOT
quartz kindle
#

you run the script

hasty lotus
#

hey, i'm making a command for making anoucement in every channels that the bot can see, which has a defined name, but i juste know that send messages with a forEach block is against the ToS to limit the raids, but i'm using a map, like this :

bot.channels.findAll('name', "bot-annoucement").map(channel => channel.send(embed))```
Is it fine ? Or is it still against the ToS ?
#

ps : ping me i don't read every messages SmileyWinking

quartz kindle
#

@hasty lotus .map does the same thing as forEach

sudden geyser
#

It's "against the ToS" because it spams the API. You should set a cooldown.

#

Wdym?

#

It's still spam when it's used.

quartz kindle
#

@woven sundial use a for of loop with async await syntax

#

that way you can create a delayed loop, with a delay on every single iteration

earnest phoenix
#

How can I do a command that when you put !join the Bot enters in the channel and it puts a YouTube Playlist?

modest maple
#

magic

earnest phoenix
#

Yes, but I dont now how.

valid frigate
#

what language do you know

earnest phoenix
#

I have a public code.

#

Im starting with js

#

@valid frigate ^^

valid frigate
#

then you should pick from either discord.js or eris to start off

#

but if you're a js noob then start with djs since its easier

#

to an extent

earnest phoenix
#

ok so

valid frigate
#

eris is a js discord lib but with less utilities

earnest phoenix
#

I've never done this type of stuff before

valid frigate
#

sure

earnest phoenix
#

I'm good at scripting but,

quartz kindle
#

what kind of scripts?

#

in what language?

earnest phoenix
#

python because i wanted to make it simple

#

its a .py type file right now

modest maple
#

then why are you tryna do it in js

earnest phoenix
#

i usually would script with java but

modest maple
quartz kindle
#

alright so to create a bot in python you need to run a python program using a discord library

#

did you install a discord library?

earnest phoenix
#

And, can I do this, if you put !join the Bot enters in the channel and plays the music that the Bot has downloaded?

quartz kindle
summer torrent
#

I didn't used eris yet what does it is ?🤔
@woven sundial js library for discord API

earnest phoenix
#

Yes

modest maple
#

what have you dont so far

pale vessel
#

eris is the goddess of discord

#

why not?

modest maple
#

because Eris is better overall

summer torrent
#

eris doesn't use as much memory as discord.js

modest maple
#

if you dont mind having a more awkward time

pale vessel
#

it's not that bad

modest maple
#

no

#

it has the same utility

pale vessel
#

i barely use d.js utilities anyway

modest maple
#

you just have to build on it yourself

#

requiring some knowledge and brain power

earnest phoenix
#

i downloaded discord.py, then i tried to do cd desktop and py -3.5 (the name of my bot).py

lusty furnace
#

The fact that a bot like Luca and a site like tog.gg can have stuff go wrong and go offline makes me worry less when my bot goes offline for no reason

quartz kindle
#

@earnest phoenix did you follow the basic examples provided? what happens when you run it?

earnest phoenix
modest maple
#

dear god

#

why are you using py 3.5 32 bit

quartz kindle
#

well the error says it all

modest maple
#

secondly your not in the same directory as ur bot

earnest phoenix
#

3.5.3

modest maple
#

yeah you cant run a d bot on that

earnest phoenix
#

well i don't know how to do that because i actually learned most of my scripting in uh..

modest maple
#

Minimum is 3.5.5+

earnest phoenix
#

Idk if i should say this but..

modest maple
#

and even then recommended 3.6.1+

earnest phoenix
#

well

#

for this bot

#

i need that version

modest maple
#

what

earnest phoenix
#

but ill try an updated version

#

I have this error

#

Error:

TypeError: Cannot read property 'active' of undefined```
> **Code Line:**
```js
opts.active.get(message.guild.id);```
sudden geyser
#

what is opts

summer torrent
#

opts is undefined

earnest phoenix
#

how to i define it

#

So

#

what the fuck do i do

#

i have all these scripts here

#

(my english is bad, sorry :c)

sudden geyser
#

Can you show where you defined opts

earnest phoenix
#
let fm = opts.active.get(message.guild.id);
quartz kindle
#

@earnest phoenix you figure out how to run them, fix the errors, make it work

sudden geyser
#

that's not where you defined opts

quartz kindle
#

you dont "upload" anything to a bot, the bot itself is the program you create

#

at most you can upload the program to a hosting or a server you rent or own and run it there

earnest phoenix
#

Now that I realize it, I don't have opts defined, but I don't know how to do it either

#

😕

quartz kindle
#

your bot will only be online as long as the program is running

#

@earnest phoenix how did you come up with the idea to use opts then? did you copy the code from somewhere?

earnest phoenix
#

I made a bot with some friends, and that code must have been put by someone, but nobody says who it was

quartz kindle
#

well you'd need to figure out what the code is supposed to do and correct it or rewrite it accordingly

#

blindly defining opts without knowing what its actually doing would be a bad idea

earnest phoenix
#

The only thing I know is that the code is from the "play" option of a music command

lyric mountain
#

Guys errr....i need help using oauth2, does someone here know something about that?

modest maple
#

sadly i do

quartz kindle
#

sad

grizzled raven
#

i still havent realised that im too bad to be making a discord bot

sudden geyser
#

that's a good thing

earnest phoenix
#

I have this problem

#
Cannot read property 'get' of undefined```
```js
let cmd = client.comandos.get(command) || client.comandos.find((c) => c.alias && c.alias.includes(command))```
grizzled raven
#

check if comandos is undefined

#

are you able to change your client status before its ready?

sudden geyser
#

Are you sure client.commandos is a property.

astral yoke
#

Tim

#

are you able to help

#

me for this

#

cause i have no definition for this at all

earnest phoenix
#
  let args = message.content.slice(prefix.length).trim().split(/ +/g);
  let command = args.shift().toLowerCase();
  
  let cmd = client.comandos.get(command) || client.comandos.find((c) => c.alias && c.alias.includes(command))
  if(cmd) cmd.run(client, message, args, opts);```
#

I use handler, and the folder where my commands are located is called "comandos"

earnest phoenix
#

How do I know if it's defined?

astral yoke
#

get is undefined

earnest phoenix
#

and how can i define it?

astral yoke
#

which i believe is due to client.comandos being incorrect

earnest phoenix
#

mmm

#

I do not know what to do

toxic jolt
#

I don't want code to run on this server, how can I do? 😄

astral yoke
#

dont run it on the server

toxic jolt
#

yes.

rich coral
#

How do I invite my bot to the server

#

Help

#

Someone help me

hasty lotus
#

@rich coral have you got your bot id ?

rich coral
#

Idk

hasty lotus
#

go on you discord developer panel

#

select your application

rich coral
#

I’m just doing what the guide said

#

Ok

hasty lotus
#

and you should see something like application id

#

ok client id

#

don't remember

rich coral
#

I copied it

hasty lotus
#

ok send it to me

#

i'l generate you an invite link

rich coral
#

Ok

#

Ty

#

How do You code on mobile lol

glass sandal
#

How do you get message ping

digital ibex
#

u don't

#

wdym how do u get message ping?

rich coral
#

I thought You could code on mobile

digital ibex
#

no u can't

rich coral
#

Oof

digital ibex
#

prolly can code on mobile but not a bot no

#

message.createdAt - message.createdAt - message ping

quartz kindle
#

you can code a bot on mobile, its just absurdly complicated, slow and a stupid thing to do

earnest phoenix
#

what would shards be used for?

delicate zephyr
#

Shards are used to split the gateway connections of bots to help alleviate the load on discords and the hosts end. Also allows the ability to cluster the bot so that it can be run on more than one machine

astral yoke
#

@delicate zephyr

#

What's the code that I could use to see the number of my bots shards on eval?

clear wraith
astral yoke
#

show code

clear wraith
#

What did I do to cause that ^^^

astral yoke
#

whats your code?

viral kayak
#

find wherever u used warn

#

u cant just post an error and expect us to know the problem

summer torrent
viral kayak
#

especially with no trace

clear wraith
#
            serverID: message.guild.id,
            username: wUser.user.username,
            userID: wUser.id,
            wUsername: message.author.username,
            wUserID: message.author.id,
            time: message.createdAt
        });
#

That is where the error is at

#

apparently the first line

viral kayak
#

wrong channel

#

no one asked

wind solstice
viral kayak
#

dont delete it to make me look stupid

wind solstice
#
            serverID: message.guild.id,
            username: wUser.user.username,
            userID: wUser.id,
            wUsername: message.author.username,
            wUserID: message.author.id,
            time: message.createdAt
        });

@clear wraith you are trying to use "warn" before initialization

#

try using different names between the variable u want to call and the const

viral kayak
#

also dont name a var after something else already used

hardy vector
#

how do you get a dbl token

#

so i can use the api

clear wraith
#

Uh... Ok...

viral kayak
#

go on ur bot edit page

hardy vector
#

k

viral kayak
#

idk if its actually there so

clear wraith
#

Yes Its there

summer torrent
hardy vector
#

where

#

tho

viral kayak
#

scrolling and reading helps in anythin online

clear wraith
#

Go to where you edit your bot, and scroll to the bottom.

hardy vector
#

nvm found it

#

lol

clear wraith
#

For my error ^^^^^^. Would I do a different thing. Like a "let statement"?

wind solstice
#

For my error ^^^^^^. Would I do a different thing. Like a "let statement"?
@clear wraith yes

#

just change the name from the const

viral kayak
#

no u wouldnt

wind solstice
#

to another thing

clear wraith
#

Instead of a const

wind solstice
#

no

clear wraith
#
            serverID: message.guild.id,
            username: wUser.user.username,
            userID: wUser.id,
            wUsername: message.author.username,
            wUserID: message.author.id,
            time: message.createdAt
        });
#

Like that?

wind solstice
#

change let warn

#

to let newwarn

#

it should solve the problem

viral kayak
#

change the name of the variable

wind solstice
#

or anything else

rich coral
#

How do I make my bot go online

viral kayak
#

host it

rich coral
#

Wdym

#

I’m nub

viral kayak
#

im gonna assume you know nothing about bots

rich coral
#

Nope

viral kayak
#

first grow some braincells then learn to code

rich coral
#

Lol I’ll try

viral kayak
#

you can go on codecadamy or sololearn

rich coral
#

I’m using this thing

viral kayak
#

then come back in about a week

#

leave immediately

clear wraith
#

LOL

viral kayak
#

ok im joking

#

learn actual code

clear wraith
#

I used to use that

viral kayak
#

dont use shit like that

rich coral
#

Ok

viral kayak
#

why do u need a bot anyway

rich coral
#

Because I’m bored af

hardy vector
#

i added the server count post

#

but its not posting

rich coral
#

And i want to make a gaming bot

hardy vector
#

and the Server count posted message isnt being logged

clear wraith
#

show your code

hardy vector
#

k

viral kayak
#

wont get anywhere with botghost

#

again

#

go on codecadamy or sololearn

hardy vector
#
const DBL = require("dblapi.js");
const dbl = new DBL('token', client);

dbl.on('posted', () => {
  console.log('Server count posted!');
})

dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})```
viral kayak
#

i recommend u do js because lots more people can help

hardy vector
#

i also installed dblapi

viral kayak
#

does it not have a function to post

hardy vector
#

wdym it does

#

isnt that what dbl.on

#

does

viral kayak
#

no

#

what

clear wraith
#

no

viral kayak
#

thats an event

#

only when it posts it will log

hardy vector
#

oh i need to actually post it

summer jungle
#

i added the server count post
@hardy vector saame here. Thats why im here. How to fix it?

viral kayak
#

yes

#

read the docs

clear wraith
#

I could show my code to help you out.

#

idk

#

lol

viral kayak
#

u shouldnt

clear wraith
#

Im not

viral kayak
#

ok

#

rule 7

clear wraith
viral kayak
#

ok

hardy vector
#
lient.on("ready", async () => {
    console.log(`I am now online, my name is ${client.user.username}`);
    dbl.postStats(client.guilds.cache.size)
    let servers = client.guilds.cache.size
    client.user.setPresence({
        status: "online",
        activity: {
            name:"In " + `${servers.toString()}` + " Servers" + " /" + "_help",
            type: "PLAYING"
        }
    })

});
console.log(client.users.cache.size)
const DBL = require("dblapi.js");
const dbl = new DBL('token', client);

dbl.on('posted', () => {
  console.log('Server count posted!');
})

dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})```
#

still not working

viral kayak
#

u used dbl before it was defined

hardy vector
#

ah

#

im stupid

#

nvm lol

viral kayak
#

maybe dont just copy paste code

hardy vector
#

thats good advice

lyric mountain
#

sadly i do
@modest maple it's just a simple question, but what could be the causes of a invalid_grant error?

#

Like, I have followed the exact example from the docs

#

But it still give this error

#

I've checked if my request was being sent correctly with postman

earnest phoenix
#
const {TOKEN, PREFIX} = require('./config');

const client = new Client({ disableEveryone: true });


client.on('disconnect', () => console.log('Desconectado, logo mais parça..'));

client.on('reconnecting', () => console.log('Reconectando.'));

client.on('message', async msg => { // eslint-disable-line
    if (msg.author.bot) return undefined;
    if (!msg.content.startsWith(PREFIX)) return undefined;

    const args = msg.content.split(' ');
    const searchString = args.slice(1).join(' ');
    const url = args[1] ? args[1].replace(/<(.+)>/g, '$1') : '';
    const serverQueue = queue.get(msg.guild.id);

    let command = msg.content.toLowerCase().split(' ')[0];
    command = command.slice(PREFIX+length);

    if(command === PREFIX+teste) {
        msg.channel.send('Yep!');
    }
});


client.login(TOKEN);```
It's correct?
wind solstice
#

prefix.length

#

i think

lyric mountain
earnest phoenix
#

Did not work. kk

grizzled raven
#

so

#

intents

#

if you specify an intents object, does it mean that you will only recieve packets for those you specify, or you will not recieve packets for those you specify?

lyric mountain
grizzled raven
#

i asked first help me first

#

jk

#

yeah idk

#

you could look at the discord.js repo and see how they did it

lyric mountain
#

This code is the post request I'm sending, which returns invalid_grant.

The post request is being sent finely, but for some reason oauth hates me

grizzled raven
#

but

#

or look at the discord developer documentation

lyric mountain
#

if you specify an intents object, does it mean that you will only recieve packets for those you specify, or you will not recieve packets for those you specify?
@grizzled raven yes

earnest phoenix
#

@grizzled raven ,
I think you will receive the specified packages kk.

lyric mountain
#

or look at the discord developer documentation
@grizzled raven already done that, did exactly how they are doing

#

But to no avail, I think I might be missing something really silly

grizzled raven
#

@lyric mountain i looked it up and yeah that does answer my question

#

although i hate how i cant unsubscribe from presences without losing guild members 😔

lyric mountain
#

Unsubscribing from presences is almost a suicide sentence

#

The bot simply doesn't boot up in less than 5 min

#

Due to ratelimit

grizzled raven
#

wait what exactly do you mean

#

not putting presences in the intents?

lyric mountain
#

When your bot starts up it'll cache all the presences

grizzled raven
#

then YEAH

lyric mountain
#

Withou the gateway intent, it'll load EVERYTHING

grizzled raven
#

i dont wanna

#

but i need guild members

#

well

#

i want guild members

lyric mountain
#

With the intent it'll lazily load them

grizzled raven
#

so

#

i mean

lyric mountain
#

One way or another you're getting the presences

grizzled raven
#

wait

#

it could also mean just at startup

lyric mountain
#

Probably

#

Without the intent it'll bomb your bot

grizzled raven
#

say if i input GUILD_PRESENCES, will stuff like message.member be unavailable?

lyric mountain
#

Not at all

#

The intents just define whether you'll be lazily loading them or caching

#

At least in jda

grizzled raven
#

TIP
GUILD_PRESENCES is required in order to receive the initial GuildMember data. If you do not supply it your member caches will be empty and not updates, even if you do provide GUILD_MEMBERS! Before you disable intents think about what your bot does and how not receiving the listed events might prevent it from doing this. Version 12 of discord.js does not yet fully support any combination of intents without loosing seemingly unrelated data.

#

i need tim

lyric mountain
#

You definitely need tim

grizzled raven
#

@‎tim come here u development camper

summer torrent
#
 RangeError: Maximum call stack size exceeded```
I get this error when I run this code:
```js
const twitter = require("twitter")

class Stream extends twitter {
    constructor(client) {
        super(client)
        this.client = client
    }
    async run() {
        this.client.guildData.find({ feeds: { $exists: true, $not: { $size: 0 } } }, function (err, feeds) {
            if (err) throw new Error(err)
            const data = new Array()
            for (const feed of feeds) {
                data.push(feed)
            }
            console.log(data)
        })
    }
}

module.exports = Stream;```
lyric mountain
grizzled raven
#

i dont know so i cant help you 😔

#

sorry to push you up but

#

nah nvm its too cnfusing

lyric mountain
#

Don't worry, I'll keep bumping in hope of some help

grizzled raven
#

okayy

lyric mountain
#

I just don't know if I'm missing some headers

grizzled raven
#

if i opt in for server members intent,

#

aaaaaaaa

#

if i dont opt in for server members intent, will i not recieve anything to do with members?

sick cloud
#

i know about intents

#

can i help?

lyric mountain
#

@grizzled raven

astral yoke
#

anyone know why this happens its coming from node_module discord.js not my coding (node:16440) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions at C:\Users\Cools\discord-dogbot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15 at C:\Users\Cools\discord-dogbot\node_modules\discord.js\node_modules\snekfetch\src\index.js:215:21 at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:16440) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:16440) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

amber fractal
#

you're missing permissions

astral yoke
#

from like what how

amber fractal
#

sending messages maybe

#

it can be anything

#

your bot just doesn't have permissions to do something it tried to do

astral yoke
#

like in a server?

valid frigate
#

does the error message contain anything about what missing permissions?

#

like this is a totally different question

astral yoke
#

no thats all the error has

amber fractal
#

DiscordAPIErrors don't give an accurate traceback

astral yoke
#

it just keeps repeating it

lyric mountain
#

Laughs in java

valid frigate
#

if it keeps repeating it's probably that your bot can't send messages somewhere

#

wait jda actually gives the permission string that missing doesnt it

#

yeah thats kinda nice

lyric mountain
#

Yep

#

Jda is insanely well self-explained

amber fractal
#

That's a developer thing

valid frigate
#

you could check for if the bot has permissions to send a message in that channel

amber fractal
#

could pull request it

lyric mountain
#

Yet it doesn't have a wiki

valid frigate
#

so when it receives a message, initially check if it can send messages to the author's channel, and if not, ignore it

#

jda does have a wiki

#

well it's more like a javadoc

lyric mountain
#

So no wiki

#

But their javadocs are epic

#

Last time I've seen such javadoc was in apache utils libs

astral yoke
#

@valid frigate you were exactly currect

#

in my 49 servers

#

if anyone said anything

#

it would tag them being like "Howdy, prefix is db!"

#

my server count is about to get to 0

valid frigate
#

lmao

#

well then you should definitely change that

#

but just for redundancy add my suggestion so you don't get those errors in the future

clever garnet
#

im using discord.js


  let args = message.content.substring(PREFIX.length).split(" ");
  switch (args[0]){
    case 'unban':
      if(!args[1]) message.channel.send('Please put a members username.')

      const user = message.mentions.users.first();

      if(user){
        const memberr = message.guild.member(user)

        if(memberr){
          memberr.send('You have been banned from Basic Bots.')
          memberr.whatdoiputhere(Unbanned by moderative system.').then(() =>{
            message.channel.send(`${memberr} has been banned.`)
          })
        }
      }
    break;```
#

what do i put in whatdoiputhere to unban the player

lyric mountain
#

Unban?

clever garnet
#

i tried unban

#

it doesnt do anything

#

but no error

oak cliff
#

You're going to receive the same answer here as you did in the other place you asked.

To unban you need to use message.guild.members.unban(userid)

clever garnet
#

i want it to unban the mentioned player

#

not the userid

oak cliff
#

You have the mentioned user defined as user

clever garnet
#

like this?

#

  let args = message.content.substring(PREFIX.length).split(" ");
  switch (args[0]){
    case 'unban':
      if(!args[1]) message.channel.send('Please put a members username.')

      const user = message.mentions.users.first();

      if(user){
        const memberr = message.guild.member(user)

        if(memberr){
          memberr.send('You have been banned from Basic Bots.')
          message.guild.members.unban(user.id).then(() =>{
            message.channel.send(`${memberr} has been banned.`)
          })
        }
      }
    break;
    

  }
})```
oak cliff
#

You have it inside a check to see if memberr is true, so it wont work, because a banned user will not be a guild member

clever garnet
#

so

#

what do i do

lyric mountain
oak cliff
#

The check isnt necessary

clever garnet
#

so i remove the

        const memberr = message.guild.member(user)```
?
#

i remove that?

oak cliff
#

And the if(memberr)

grizzled raven
#

@sick cloud yes please, although its late and im going to bed so i'll ask tomorrow

clever garnet
#

  let args = message.content.substring(PREFIX.length).split(" ");
  switch (args[0]){
    case 'unban':
      if(!args[1]) message.channel.send('Please put a members username.')

      const user = message.mentions.users.first();



          {
          memberr.send('You have been banned from Basic Bots.')
          message.guild.members.unban(user.id).then(() =>{
            message.channel.send(`${memberr} has been banned.`)
          })
        }
      }
    break;
    

  }
)```

```    break;
    ^^^^^

SyntaxError: Illegal break statement```
what now
oak cliff
#

What does the error tell you

clever garnet
#

look at the error

oak cliff
#

Yes I read it, did you?

clever garnet
#

ues

#

i dont really understand break

#

do i remove break

sick cloud
#

okay

oak cliff
#

Try it and see.

sick cloud
#

@grizzled raven ping me when you get up and ask

lyric mountain
clever garnet
#

  let args = message.content.substring(PREFIX.length).split(" ");
  switch (args[0]){
    case 'unban':
      if(!args[1]) message.channel.send('Please put a members username.')

      const user = message.mentions.users.first();



          {
          message.guild.members.unban(user.id).then(() =>{
            message.channel.send(`${memberr} has been banned.`)
          })
        }
      }
    

  }
)
                                           ^

TypeError: Cannot read property 'id' of undefined```
lyric mountain
#

User is undefined

clever garnet
#

yes it is

lyric mountain
#

Because your bot can't query that user

clever garnet
#

what does that mean

lyric mountain
#

Mean that if that user isn't in a server where your bot is in you can't get that user

#

Since your bot cant see him

clever garnet
#

so

#

i should just manually unban the user

#

is that what youre saying

lyric mountain
#

Unban by id

#

Just get the ids of the banlist

clever garnet
#

i am doing that

#

uh]

#

how do i do that

lyric mountain
#

Idk, you'll need to read the docs

#

I'm a java dev

clever garnet
#

ok

lyric mountain
#

But just get the banlist and check for the target id, if it exists just unban it

grizzled raven
#

okay tony

clever garnet
#

how do i do that though

oak cliff
#

You'll have to read the docs

#

Like they said

clever garnet
#

im doing that right now

#

but i dont know where to look

lyric mountain
#

Look at guild docs

#

Banlist is probably there

clever garnet
#

theres no results

earnest phoenix
#

my bot is spamming

#

how would I stop this

lyric mountain
#

Well, don't you know why YOUR bot is spamming?

#

Check the code relevant to that command

earnest phoenix
#

I have an if (message.author.bot) return; statement

#
    let count = await logs.obtener(oldMessage.guild.id);
  //Obtenemos el nombre del canal donde se edito el mensaje
  let nameChannel = newMessage.channel.name;
  // Obtenemos el nombre del usuario que edito el mensaje
        if (oldMessage.author.bot) return;
     await snipedit.establecer(newMessage.channel.id, {
        "author": newMessage.author.username,
        "antes": oldMessage.content,
        "despues": newMessage.content 
    })
    
  let member = newMessage.member.displayName;
  const embed = new Discord.RichEmbed()
    .setTitle("**MENSAJE EDITADO**")
    .setColor(0xff0000)
    .setThumbnail(newMessage.author.displayAvatarURL)
    .addField('Antes', oldMessage.content)
    .addField('Despues', newMessage.content)
    .addField('ID del mensaje', newMessage.id)
    .addField('Link del mensaje',`[Link](${`https://discordapp.com/channels/${newMessage.guild.id}/${newMessage.channel.id}/${newMessage.id}`})`)
    .addField('Nombre del autor', newMessage.author.username)
    .addField('ID del autor', newMessage.author.id)
    .addField('Mencion del autor', newMessage.author)
    .addField('Nombre del canal', oldMessage.channel.name)
    .addField('ID del canal', oldMessage.channel.id)
    .addField('Mencion del canal', oldMessage.channel)
    .setTimestamp()
    .setFooter(newMessage.guild.name, newMessage.guild.iconURL);
  // enviamos un mensaje de información de la actualización de un emoji en un canal X
  client.channels.get(count).send(embed);
});```
The bot say two times!
prime cliff
#

@earnest phoenix is it doing it twice now? or was it before

earnest phoenix
#

Twice

prime cliff
#

No but is it doing it now

earnest phoenix
#

Right now not

prime cliff
#

Ok the issue is not your code

earnest phoenix
#

Oh

prime cliff
#

Discord has been having a lot of outages today and js bots are known to send messages twice when that happens

earnest phoenix
#

What time was that?

prime cliff
#

Like 30 mins to an hour ago? but there has been 4 outages today

earnest phoenix
#

Yes

#

My bot a twice msg right now

#

So?

#

@prime cliff srry ping but I want know

prime cliff
#

It's doing it now?

earnest phoenix
#

Yea

#

2 msgs

prime cliff
#

Do you have another process open of your bot

earnest phoenix
#

Like how?

prime cliff
#

Are you using glitch or something to test

earnest phoenix
#

No, I make a bot in glitch

#

I dont test

clear wraith
#

I can't seem to figure this out....

    at arbitrate (/rbd/pnpm-volume/3e0e7ff0-a6f9-4413-afc4-43ee427079be/node_modules/.registry.npmjs.org/quick.db/7.1.1/node_modules/quick.db/bin/handler.js:240:6)
    at Object.fetch (/rbd/pnpm-volume/3e0e7ff0-a6f9-4413-afc4-43ee427079be/node_modules/.registry.npmjs.org/quick.db/7.1.1/node_modules/quick.db/bin/handler.js:39:12)```
#

Can someone help me out?

earnest phoenix
#

File is not a database

clear wraith
#

How is it not a database?

#

I thought db meant database

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

exports.run = async (bot, message, args, config) => {
  let user = message.mentions.members.first() || message.author;

  const db = require("quick.db");
  let money = await db.fetch(`money_${user.id}`);
  if (money === null) money = 0;
  var fs = require("fs");

  fs.readFile("./e/cmds.json", "utf8", function(err, contents) {
    var c = JSON.parse(contents);
    if (c.economy === "0") {
      message.channel.send();
    } else {
      cc();
    }
  });
  function cc() {
    const embed = new Discord.MessageEmbed()
      .setColor("RANDOM")
      .setTimestamp()
      .setDescription(`${user}, has $${money}`);

    message.channel.send(embed);
    name: "bal";
  }
};
#

right?

prime cliff
#

Why are you doing const db = require("quick.db"); again?

clear wraith
#

Am i not supposed to?

prime cliff
#

Don't use js but probably not since it's already defined at the top

#

And you are trying to set that twice

craggy mural
#

wait @clear wraith what script engine do you use, since microsoft visual studio doesn't support quick db

prime cliff
#

microsoft visual studio is a code editor not a package manager which you use to install that

craggy mural
#

ok

clear wraith
craggy mural
#

ohh

#

ok that makes sense

#

yeah, idk how to help

clear wraith
#

Bummer

earnest phoenix
#

When my bot go to "normal status"?

#

Srry my bad english

craggy mural
#

you mean no playing

#

like it doesn't have "playing (something)"?

earnest phoenix
#

I mean

#

My bot is say twice

craggy mural
#

idk

#

uhh

earnest phoenix
#

Ok

#

Ty

craggy mural
#

say what twice?

earnest phoenix
#

The event messageUpdate

craggy mural
#

maybe something in the code

earnest phoenix
#

No

#

Just today dont work

craggy mural
#

idrk

earnest phoenix
#

Hi

#

what's a good way to define message to stop my bot from spamming

sonic lodge
#

please elaborate

earnest phoenix
#

people advise me to use an if statement to stop bot from spamming, you have to put it outside your message event. the only problem is that you have to define message and I don't have a definite for message

#

the exact if statement is

#

if (message.author.bot) return;

sonic lodge
#

discord.js?

earnest phoenix
#

yes

sonic lodge
#
bot.on('message', function(message) {
  if (message.author.bot) return;
}
earnest phoenix
#

thanks, I'll try it

sonic lodge
#

that's where message is coming from

earnest phoenix
#

hi why my bot votes decreased ?? In the morning it was 25 and now 2 :/

#

didn't work unfortunately

glad charm
#

@earnest phoenix it's a new month.

#

Votes reset each month.

earnest phoenix
#

oh oky ♥

#

my bot twice right now ;c

sonic lodge
#

perhaps you could make it real explicit

bot.on('message', function(message) {
  if (!message.author.bot) {
    // code here
  }
}```
misty river
#

heyo, just wondering what people use for a database

#

i use sqlite rn but im thinking of going with mongo or maybe redis, want it to be speedy but still scalable

earnest phoenix
#

I use heroku so im kinda forced to use mlab mongodb

#

@misty river

misty river
#

o rip

earnest phoenix
#

i think mlab sandboxes are free

misty river
#

i have a bunch of VPS'

#

my friend owns some, she lets me use them for free

earnest phoenix
#

those are cloud vms

misty river
#

yes

earnest phoenix
#

u sure that'd work as a db?

misty river
#

a vps?

earnest phoenix
#

yh

misty river
#

i mean, i dont see why it wouldn't

#

its just a server

#

i can deploy docker images to them

earnest phoenix
#

actually

#

that's a great Idea

misty river
#

yea mongo and redis both work fine in docker

#

as would any other type of db id assume lol

#

just wondering if using just redis as a db is a good idea

copper cradle
#

@earnest phoenix how did you do it?

misty river
#

or if i should use both redis and mongo

#

with redis caching stuff the bot accesses frequently, like prefixes

copper cradle
#

did you literally copy and paste the entire code block into your code, hoping it'll work or you actually tried something

grizzled raven
#

@sick cloud i cant sleep so

#

hope you're awake