#development

1 messages · Page 444 of 1

gleaming glen
#

@austere meadow

austere meadow
#

can you try

npm uninstall snekfetch
npm install snekfetch@3.6
gleaming glen
#

okay

restive silo
#

3.2.4 is outdated af

austere meadow
#

snekfetch@4.0.4 is known to have issues with requests

restive silo
austere meadow
#

that too

knotty steeple
#

what causes the issues with requests? GWqlabsThonkery

austere meadow
#

im not quite sure tbh
i know that discord.js had to move away from the newer versions of snekfetch due to request issues with ratelimiting or something similar

#

other people were also reporting issues with getting 401's

knotty steeple
#

or just use request ;)

tribal hazel
#

lol

gleaming glen
#

I did it

#

But it's still same

austere meadow
#

can you use npm ls snekfetch again?

#

if the version is right you must have something misconfigured in your code, or you have the wrong token

gleaming glen
#

Okay

#

I'll check when I get to pc

#

Thank you

austere meadow
#

okay

#

i don't know much py

#

can't help you there

#

code?

#

there's a few music bot templates online

#

there's one for py

#

did you want it

knotty steeple
#

im pretty sure to run a python bot (or any python file) its just python <file>.py

austere meadow
#

otherwise you're just submitting a clone

knotty steeple
#

or if you have python 3 just do python3 <file>.py

#

that template does have a start.bat file tho

#

wat

#

just open a folder

#

File > Open folder

#

i think

#

pls no spam

neat falcon
#

luca bot developed by weebsite admins

knotty steeple
#

^

restive silo
#

...

meager flower
#

You just got the answer....

#

Is that spam? @restive silo

restive silo
#

might be shit internet and mobile

meager flower
#

true

buoyant sandal
#

@restive silo @knotty steeple Is there a way to bring them in right order by commands or sth ?

restive silo
knotty steeple
#

i was about to screenshot that

#

and i have no idea

#

```js
// code
```

#

code block

ruby dust
#

now you're just spamming

knotty steeple
#

{type: 2} im pretty sure this is wrong

buoyant sandal
#

Whats so hard about giving useful answers 😃

austere meadow
#

@knotty steeple type can be an integer

ruby dust
#

ok stop

austere meadow
#

@mellow plume if you post it once more, you'll be muted

#

stop spamming

knotty steeple
#

it can be an int?

#

ok

#

didnt know that zoomeyes

austere meadow
#

yeah a string or a number

#

memeber

#

yes i just told you

knotty steeple
#

yes

austere meadow
#

if you don't give us an error to work with we cannot help you

knotty steeple
#

there is also something else wrong

austere meadow
#

please read the topic of this channel

ruby dust
#

internet maybe that bad that messages are being sent with like 2 minute delay

knotty steeple
#

its just memeber => //code

#

memeber

#

look for that and replace it

meager flower
#

memeber is spelled wrong...

#

it's member

ruby dust
#

dude... get a better internet

meager flower
#

^^

#

I don't know if you did not understand what was wrong or if you actually did

#

Just copy that...

restive silo
#

dont fucking spoonfeed him

#

.....

#

thats not how people learn

meager flower
#

Fair enough

frozen spade
#

i made a music bot in js but i have a problem idk why its not working can someone help me?

spring ember
#

Send the error and relevant code?

frozen spade
#

the code is big

#

the error

#

this is the error

#

this is the code

#

idk

#

why is not working

#

@spring ember

spring ember
#

What error on the console

frozen spade
#

emm

slender thistle
#

Discord.py rewrite latest.
Are there any code examples for voice commands?

frozen spade
#

this is the erroe

#

is jd

#

js

#

@spring ember

restive silo
#

code: 400, message: 'Bad Request' you did a bad request

spring ember
#

You did not provide an API key

#

Use lavalink for music

frozen spade
#

how i add api key

#

how @spring ember

#

@restive silo wats that mean?

restive silo
frozen spade
#

its not randomly

#

i want to ask

#

;-;.

raw horizon
#

does anyone know

#

how to get server count

ruby dust
#

is there a way to add/remove a column in the existing table in the database with sqlite3?

slender thistle
#

ALTER TABLE {tableName} ADD COLUMN NewCol {type_here}

ruby dust
#

alter table is very limited in what it can do

#

for example, I'd like to be removing more than adding new ones

#

I find a workaround by making a temporary table with temporary data, but I need to be 100% certain that there is no official way of doing it

raw horizon
#

for the server count examples

#

i need one for c#

#

does anyone have one for c#?

knotty steeple
#

is there none for c# in there

raw horizon
#

ik

#

i need one for it tho

knotty steeple
#

i asked you if there isnt any c# examples in the channel

raw horizon
#

o

#

Fuck i didn't read that correctly

#

And if i didn't skip any

#

Theres not

shy verge
#

@raw horizon DiscordSocketClient.Guilds.Count

raw horizon
#

Already got that

#

;p

shy verge
#

ok

tranquil tree
#

What causes a bot to take forever to start?

raw horizon
#

database maybe

tranquil tree
#

Would having no command handler effect it?

#

xD

shy verge
#
  1. how many guilds do you have
  2. do you have to compile before every run
  3. what's your connection speed
sullen path
#

I find that the more guilds a bot is in the slower the loading time

vagrant sinew
#

can someone help me for testing , i want to speak with <@&304313580025544704> if it is possible

uncut slate
#

🤦

quiet bobcat
#

uhh

south finch
#

yikes

earnest phoenix
#

Rofl

neon schooner
#

oof

native narwhal
#

👏🏼

austere meadow
#

@vagrant sinew what's up

sullen path
#

Um

earnest phoenix
#

@someone

languid dragon
#

um no its not possible

vagrant sinew
#

as you know i declined a lot of times 😄

earnest phoenix
#

Sherlock is that you

vagrant sinew
#

but i have to explain it

austere meadow
#

you declined a lot of times

#

ok

earnest phoenix
#

I have a question anyway

vagrant sinew
#

now it is working

ruby dust
#

got declined

austere meadow
#

now it's working?

#

good to hear

#

you can re-apply

quiet bobcat
#

apply it again?

vagrant sinew
#

okey

austere meadow
#

yep

vagrant sinew
#

wait

native narwhal
#

Is that what you needed the whole staff team for?

austere meadow
#

oh?

#

hang on theres one more thing

earnest phoenix
#

Is it possible to make an async function to load my bot commands from a separate folder when my bot goes online

#

Right now I just have a bunch of require lines under my message function

austere meadow
#

@vagrant sinew if you have any further queries please mention them in #memes-and-media so we don't disrupt others

earnest phoenix
#

I'm using djs

#

Node 10

vagrant sinew
#

okey sorry zBlake#0007

earnest phoenix
#

I need help, could anyone help me?

austere meadow
#

go ahead

earnest phoenix
#

ok

#

thanks

sullen path
#

still hasn’t asked the question

marsh lark
#

lol

tribal hazel
#

Can someone give me code

#

Nvm

#

My eval command is brok.

#

an someone give me link to something that can help me?

sullen path
#

What language?

#

No, I’m not spoon feeding you

tribal hazel
#

JS

sullen path
#

eval()

#

I think

tulip ledge
#

Dude I litterly gave MY eval command to you

sullen path
#

Literally*

tulip ledge
#

You asked for my eval command

#

I'm dutch

#

IDFC

sullen path
#

👌

south finch
#

don't be rude.

tulip ledge
#

Anyone knows how to fix this error?

    con.get(`SELECT * FROM blacklist WHERE snowflake = ? AND guild = ?`, message.author.id, message.guild.id, (err, r) => {
        console.log('6')
        if(err) throw err;
        if(r) return message.channel.send("You are blacklisted.");

        let command = bot.commands.get(name);
        if(command) command.run(bot, message, args, con, cfg);
    });
#

That's the wrong one XD

#

It has something to do with the code above

tribal hazel
#

The eval command doesnt work for me.

tulip ledge
#

I don't know how to help when you don't show the code

tribal hazel
#

you said brb

#

I messaged you back

#

you didnt answer.

tulip ledge
#

I'm 2 minutes back

#

Does anyone know how to fix my error?

sullen path
#

It says “syntax error”

#

Maybe you’re messing up your SQL query?

robust jackal
#

Other then needing python and notepad of coarse why do you need to make a discord bot? Tag me plz because I won’t see this unless

tulip ledge
#

It's fun

sullen path
#

@robust jackal a bot application

robust jackal
#

Like discord devdocumentation?

sullen path
#

My Apps

#

Sort of

robust jackal
#

Link?

sullen path
#

One sec

robust jackal
#

This is why I mean...

sullen path
robust jackal
#

What’s that I’ve heard of jt

sullen path
robust jackal
#

Lol

#

Same link XD

sullen path
#

It’s a discord API library for python

#

No the link is different

robust jackal
#

Link for that?

sullen path
#

🤦

#

Mine ends in /me

#

Not /authorized

robust jackal
#

Oh

#

Well same website

sullen path
#

I think there’s a tutorial somewhere actually

#

Yes same site

robust jackal
#

So can I have the link to discord py

sullen path
#

Google it

robust jackal
#

K

#

So I need python, notepad, that link, and discord py?

sullen path
#

For starters

robust jackal
#

Ok

sullen path
#

Instead of notepad, use IDLE

#

It’s the bundled python IDE

robust jackal
#

Could I use notepad ++ would that be better

sullen path
#

That’s better

robust jackal
#

K

#

What’s the diff between IDLE and notepad ++?

sullen path
#

Notepad++ is a text editor. If you use IDLE you can run your bot from it while developing

grim elk
#

Why not use PyCharm?

sullen path
#

True

#

I don’t do serious development in python, so yeah

slender thistle
#

Eats a lot of RAM, doesn't it

grim elk
#

What does?

slender thistle
#

PyCharm

grim elk
#

Oh

#

It's a good IDE though.

slender thistle
#

I have been told that it requires quite enough RAM, not sure myself though

grim elk
#

1 GB of RAM is good enough.

#

In fact, I only allocate 1 GB of RAM for that IDE because that's all it needs.

slender thistle
#

Nah kthx Imma use notepad instead

grim elk
#

Notepad?

slender thistle
#

:^)

grim elk
#

The ++ one or the crap from Microsoft Windows?

slender thistle
#

Either you wish to imagine

frozen spade
#

how i can make a say command?

#

i use js

knotty steeple
#

just make the bot send arguments

#

by getting the message content and slice off the <prefix>say part

long forge
#

! keep getting this error:

    at Timeout.setTimeout [as _onTimeout] (C:\Users\jorda\node_modules\discord.js-musicbot-addon\index.js:1892:17)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)```
knotty steeple
#

well

long forge
#

My code at that point is:

        const dispatcher = voiceConnection.player.dispatcher;
        let vc = client.voiceConnections.find(val => val.channel.guild.id == msg.guild.id);
        if (!vc.player.dispatcher) return;
        try {
          vc.player.dispatcher.end();
          vc.disconnect();
        } catch (e) {
          console.error(`[leaevCmd] [${msg.guild.name}] ${e.stack}`);
        }```
knotty steeple
#

well vc seems like it is null

#

looking at the error

long forge
#

If I remove vc and instead put voiceConnection like the rest of my code would I receive an error?

knotty steeple
#

maybe GWcmeisterPeepoShrug

fervent oyster
mental solstice
#

?

sullen path
#

I don’t get it

earnest phoenix
#

how get discord token on mobile???

#

🤔 🤔 🤔 🤔

shy verge
#

dont

#

get on a desktop

sullen path
#

It’s hard, but doable

inner jewel
#

even better

#

don't get the token

#

and don't break the ToS

shy verge
#

i think he was talking about getting the token for his bot on mobile

#

which is fair

#

because the dev docs on mobile are unusable

coral lichen
#

If you want to get your bot token on mobile
Here's the steps:

  • discordapp.com
  • login
  • go to /developers
  • Desktop Version ✔ <- Since mobile isn't supporter you will need to do this
  • make/get your token from the application

If you want to get your own token, on mobile it's not possible, nor on chrome nor on the application

young cradle
#

It is possible, just tricky on mobile, but the problem is what you will use your own token for

shy verge
#

but what would you use it for owo

coral lichen
#

On phone I tried multiple times to get it, haven't find a single button

shy verge
#

desktop client

coral lichen
#

I'm talking about phone, that you can't get your token

#

Only on desktop you can smh

sick cloud
#

So i has this embed. Where the red arrow is, how do i push it across so its like there is 3 fields? thonk

shy verge
#

to get the token on mobile you would need to have a development build of the mobile client

#

cause react native disables the developer menu in production builds

coral lichen
#

I do have development build

shy verge
#

do you

coral lichen
#

yup

shy verge
#

proof?

coral lichen
#

..

shy verge
#

@sick cloud impossible

coral lichen
#

I'm on my VPS

shy verge
coral lichen
#

rn

sick cloud
#

it isn't impossible, i know that

#

i've seen others do it

shy verge
#

hmmmmmmmmmmm

coral lichen
#

um

sick cloud
#

you add a blank field or something i'd guess, dunno how tho

shy verge
#

maybe they're using the primitive embed format and abusing the shit out of it?

coral lichen
#

ya I believe you have to add a blank field

#

well no
Blank fields are possible

#

if you never lnew

#

Knew*

shy verge
#

i.e. directly constructing the json object that embeds are built off of

sick cloud
#

honestly i just wanna know if its possible :P

shy verge
#

oh i thought you literally means 3 inline fields

coral lichen
#

It is

shy verge
#

i think you can just stick a few hundred spaces before your content and hope it works

sick cloud
#

oof

#

i mean, would it be possible to add a field (inline) that has no title /desc

#

use zws or something?

shy verge
#

@coral lichen if you have a development build of the mobile client run it in an emulator and do ctrl D if youre on ios or ctrl M if on android

#

i've read that opens dev tools

coral lichen
#

Will check when I get my development build as I left it at home

shy verge
#

LOL

#

is this a meme

coral lichen
#

Nope

shy verge
#

xd

#

ios or android

coral lichen
#

Android

shy verge
#

k try opening app and conecc to computer

#

adb shell input keyevent 82

young cradle
#

@sick cloud set the field's title and description as \u200b (Null width space)

sick cloud
#

thanks :D

earnest phoenix
#
let nombrerol = args.split(' ').slice(1).join(' ');
shy verge
#

what

earnest phoenix
#

It says that args.split is not a function

spring ember
#

What is args?

earnest phoenix
#
if (message.content.startsWith(',.addrol')) {
  let miembro = message.mentions.members.first();
let nombrerol = args.split(' ').slice(1).join(' ');

let role = message.guild.roles.find("name");
let permss = message.member.hasPermission("MANAGE_ROLES_OR_PERMISSIONS");

if(!permss) return message.channel.send("`Error` `|` No tienes Permisos para usar este comando.");
     
if(message.mentions.users.size < 1) return message.reply('Debe mencionar a un miembro.').catch(console.error);
if(!nombrerol) return message.channel.send('Escriba el nombre del rol a agregar.');
if(!role) return message.channel.send('Rol no encontrado en el servidor.');
    
miembro.addRole(role).catch(console.error);
message.channel.send(`El rol **${role.name}** fue agregado correctamente a **${miembro.user.username}**.`);
spring ember
#

But what is args though

distant raven
#

@sick cloud in discord.js there is a method to add a blank field

#

... it's called addBlankField

#

lol

sick cloud
#

@distant raven no, that adds a total space, and it doesn't work inline iirc

distant raven
#

just call true on the inline param?

#

assuming there is one

#

mayb check docs

sick cloud
#

maybe

thin silo
#

You can just do .addBlankField(true) to make it inline iirc :p

earnest phoenix
#

Thanks guys

#

Sorry for asking another thing (i'm so noob)

#
if (message.content.startsWith(',.mute')) {
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send(({embed: {color: 0x6139ad,description:"**❌ | You don't have permissions to execute this command**"}}))
let toMute = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
if(!toMute) return message.channel.send(({embed: {color: 0x6139ad,description: "**⭐️ | You need to mention someone or type an ID**"}}));
let role = message.guild.roles.find(r => r.name == "Rabot mute")
if(!role) {
try{
role = message.guild.createRole({
  name: "Rabot mute",
  color: "#000000",
  permissions: []
  
 });
 message.guild.channels.forEach(async (channel, id) => {
   await channel.overwritePermissions(role, {
     SEND_MESSAGES: false,
     ADD_REACTIONS: false

 });
});
} catch(e) {
  console.log(e.stack);
}
}
if(toMute.roles.has(role.id)) return message.channel.send(({embed: {color: 0x6139ad,description:"**❌ | This user is already muted!**"}}));
toMute.addRole(role);
message.channel.send(({embed: {color: 0x6139ad,description:"🌈  | User muted succesfully"}}))

return;
}
#

That's the code for muting. Now everything goes well, but the bot does not add the permissions

sick cloud
#

We aren't going to spoonfeed you code. Add some kind of try catch around it maybe, debug it.

earnest phoenix
#

Okay GWseremePeepoThink

tidal parrot
#

🥄

#

No food for spoon-feeding

#

Sorry

tulip ledge
#

Hey so I'm using sqlite and i get an error wich shouldn't be... db.get is not a function this is my code:

const sqlite = require('sqlite');
const db = sqlite.open('database.sqlite');
client.sqlite = sqlite;

db.get(`SELECT * FROM settings WHERE guildid = "${message.guild.id}"`).then(row => {
        if(!row) {
            db.run(`INSERT INTO settings (guildid, prefix, lang, color, admin, mod, user, autor, channel) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?,)`, [message.author.id, '!', 'en', '#ffffff', 'admin', 'mod', 'false', 'false', 'false'])
            client.gprefix = '!';
        } else {
            client.gprefix = row.prefix;
        }
    }).catch(() => {
        db.run(`CREATE TABLE IF NOT EXISTS settings (guildid TEXT, prefix TEXT, lang TEXT, color TEXT, admin TEXT, mod TEXT, user TEXT, autor TEXT, channel TEXT`)
        db.run(`INSERT INTO settings (guildid, prefix, lang, color, admin, mod, user, autor, channel) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?,)`, [message.author.id, '!', 'en', '#ffffff', 'admin', 'mod', 'false', 'false', 'false'])
            client.gprefix = '!';
    })

Please mention me or I won't see

earnest phoenix
#

I'm trying to make a very dumb timeout function.. lol

a = 0;
sleep(5000);
a++;

and im doing if(a != 1) return;

tulip ledge
#

So?

uncut slate
#

(t) => new Promise(r => setTimeout(r, t))

bright spear
#

@coral lichen honestly you're not making sense, you're saying you want to check if a person has a role in the server, im asking how you have the person as

#

also im assuming ur using discord.js

coral lichen
#

Boi

#

Ye

#

I want to check if the person have the role

#

Or let me do it

#

Better

#

I want to check like if i or @neat falcon (GWfroggyBlobHappyPing ) have the L role on the KyaraHost guild

bright spear
#

anyways, this is some code that will hopefully work in ur situationjs client.guilds.get('guildID').members.get('userID').roles.has('roleID')

coral lichen
#

bruh

neat falcon
coral lichen
#

So If I add you and @neat falcon

#

Do I need to put the ids in that place

#

Ugh

bright spear
#

if you have a user object you can use user.id in place of 'userID'

coral lichen
bright spear
#

if u have a message object its message.author.id

coral lichen
bright spear
#

why

coral lichen
#

Since i need the command

#

For more details

bright spear
#

@coral lichen if u didnt see it

if(!client.guilds.get('guildID').members.get(message.author.id).roles.has('roleID'))
    return message.reply('You're not a donator!')
```just put that in the top of the command
coral lichen
fervent oyster
#

i need to make a decent eval command for javascript. mine doesnt even work with newlines

earnest phoenix
#

how to i create a channel in a category in discord.js 👀

night imp
#

<channel>.setParent(<category id>)

earnest phoenix
#

and to create a category 👀

restive silo
#

you use master or stable?

earnest phoenix
#

idk lol

#

but i got it

restive silo
#

...

earnest phoenix
#

just found out

restive silo
#

you did npm i discord.js to install it right

earnest phoenix
#

y..no

restive silo
#

what did you do to install it

earnest phoenix
#

its like 11.2.0

restive silo
#

thats outdated

earnest phoenix
#

i installed it once

restive silo
#

update it

earnest phoenix
#

every time just copied node_modules

restive silo
#

dont do that notLikeMiya

#

thats the worst you can do

earnest phoenix
#

👀

compact moth
#

hello alpha ^^

earnest phoenix
#

OwO

#

Hi alpha

compact moth
#

;D

earnest phoenix
#

;D

compact moth
#

you want to stay on my discord for fun? ^^

earnest phoenix
#

dm

knotty steeple
upper tundra
#

Do you know of any weather app that needs you to login to be able to use it?
If yes, what are the features that only logged in users have?

sullen path
#

🤔

#

I don't get why that is here

earnest phoenix
#
msg.guild.createChannel('announcements').setParent(msg.guild.channels.find('name', 'info').id);``` info is a category.. uhm..\
restive silo
#

thats not how Promises works

earnest phoenix
#

;-;

#

i mean it needs an id

earnest phoenix
#

Hi, i have a lot of else if in my code, do you think that use a lot of "if" instead of all these "else if" is better ?
Or use a switch is maybe a better choice ?

karmic parcel
#

oh man

#

uhh I recommend trying to build a handler for that

trim plinth
#

switch case is probably better

#

because

#

that is a LOT of else ifs

earnest phoenix
#

how ? I'm learning coding in same time i code so what sort of handler ?

karmic parcel
#

Yeah, a switch is better for what you're doing without changing much

#

but I recommend trying to find/create a handler for your commands

trim plinth
#

@earnest phoenix like putting commands in seperate files

#

in functions or classes

#

etc

earnest phoenix
#

Ow yes it's I already do for the execution code but calling a file that will call an other file to execute the code will not augment the reponse time ?

trim plinth
#

no

#

it won't make a huge difference

#

in speed

#

or any difference in general probably

earnest phoenix
#

ok so from my index, I set and "if message starts with prefix", launch a commands.js file that will contain all the commands, is that ?

trim plinth
#

you'd rather put each of the commands in their own seperate files to avoid clutter

earnest phoenix
#

is that a question ?

trim plinth
#

no

#

statement

earnest phoenix
#

oh ok i've bad translated it

#

so, if I correctly understand, in my index, i redirect it to a command.js that will contain all commands and they script is that ?

trim plinth
#

roughly, yes

#

you would treat the commands.js file as the message event listener

earnest phoenix
#

ok but in total, all the commands take around 2k of lines (so it's a little a mess), this is why I decided to separate it in 3 category files

inner jewel
#

you could have one command per file

atomic prism
#

Help me

#

😭

earnest phoenix
#

wrong server

atomic prism
#

Why

earnest phoenix
#

it’s the wrong server lol

#

this is DBL not pw

karmic parcel
#

Lol

gilded thunder
#
@bot.group(pass_context=True)
async def purge(ctx, amount):
        """Purge a number messages. Pass noembed to prevent the success embed from sending."""
        if ctx.invoked_subcommand is None:
            if ctx.message.author.server_permissions.administrator or ctx.message.author.server_permissions.manage_messages:
                await bot.purge_from(ctx.message.channel, limit=int("1"))
                await bot.purge_from(ctx.message.channel, limit=int(amount))
                embed=discord.Embed(title="Purged successfully!", description="Purged " + amount + " message(s).", color=0x176cd5)
                embed.set_footer(text="Responsible moderator - " + ctx.message.author)
                await bot.say(embed=embed)
            else:
                embed = discord.Embed(title="Permission Denied.", description="You don't have permission to use this command.", color=0x176cd5)
                await bot.say(embed=embed)

@purge.command(name='noembed', pass_context=True)
async def _noembed(ctx, amount):
    """Purge messages without the result embed"""
    if ctx.message.author.server_permissions.administrator or ctx.message.author.server_permissions.manage_messages:
            await bot.purge_from(ctx.message.channel, limit=int("1"))
            await bot.purge_from(ctx.message.channel, limit=int(amount))
    else:
            embed = discord.Embed(title="Permission Denied.", description="You don't have permission to use this command.", color=0x176cd5)
            await bot.say(embed=embed)```
Should use the noembed logic if that subcommand is passed but it always uses the standard command.
quartz kindle
#

if its d.js thats normal

stray wasp
#

200mb's? really

#

jeez

quartz kindle
#

i have that "problem" too so i researched

#

turns out d.js caches users as they come online

stray wasp
#

oooo I saw something to clear that

quartz kindle
#

so overtime more and more users get cached when they connect

topaz fjord
#

you can clear cache in master

quartz kindle
#

im not running master yet

topaz fjord
quartz kindle
#

i solved the out of memory problem with a swap file

sick cloud
#

sweep

topaz fjord
#

well i would switch to master before it comes out

#

it breaks a fuck ton of things

sick cloud
#

@topaz fjord I use master now, would you just make a sweep cmd?

stray wasp
#

so do I just make it auto run a file every 3hrs?

#

that clears cache?

night imp
#

Settimeout

stray wasp
#

in the main file right?

night imp
#

yeah

topaz fjord
#

@sick cloud if you want to be able to clear the cache by cmd yeah

stray wasp
#

alright sweet thanks

topaz fjord
stray wasp
#

when are they releasing the master fully?

topaz fjord
#

dunno

quartz kindle
#

soon™

stray wasp
#

ok

topaz fjord
#

still in the works

#

if you want to see the things it changes

#

but thats only for stores

stray wasp
#

yeah which is kinda annoying

topaz fjord
#

exactly why you should switch now™

stray wasp
#

Yeah I guess it's only 200mb out of 2gbs I'll wait.

topaz fjord
#

the highest ive ever been is 700mb with 12 voice connections

stray wasp
#

rip

topaz fjord
#

tbh thats isnt much

#

but thats also with me having some mem leaks

quartz kindle
#

mine restarts like once per week and its fine

topaz fjord
#

i dont restart since i dont find a reason for it

#

even when uploading new cmds i have a reload command

stray wasp
#

@quartz kindle how do you have auto restarts ?

quartz kindle
#

yeah my bot isnt well designed, so i cant do that

#

no i dont

stray wasp
#

oh you do it manually

quartz kindle
#

but i need to restart everytime to do some change

#

and it auto restarts on any error

#

there's still errors every now and then

topaz fjord
#

if u use pm2 just set interval for 1 week to process.exit(0)

quartz kindle
#

i just use a loop

topaz fjord
#

might change my bot to golang, since its pretty fast

inner jewel
#

won't change much anyway

#

since you spend more time doing I/O than actually using the cpu

#

for most tasks

long forge
#

I keep getting this error:

          ^^^^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:607:28)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

My code right there is:

    await member.kick(reason)
      .catch(error => message.reply(`Sorry ${message.author} I couldn't kick because of : ${error}`));
    message.reply(`${member.user.tag} has been kicked by ${message.author.tag} because: ${reason}`);

  }```
What is it I am missing at await?
stiff juniper
#

A) what library?

#

B) make sure the function it's inside is async

long forge
#

discord.js

stiff juniper
#

i see

long forge
#

what would be a fix now Im wondering...

stiff juniper
#

it'd be better tbh if you put all your code in a hastebin or something

#

so we can better spot the issue

quartz kindle
#

unexpected identifier is often caused by misplaced code, like a missing semicolon before that code

stiff juniper
#

^

night imp
#

seeing as it didn't output the reserved error I don't believe this to be the case but make sure that the function is asynchronous

#

and some code before it would help

topaz fjord
#

you get unexpected identifier on await when its outside of async

#

afaik

floral stone
#

How to setup Atom with winscp

ruby cargo
#

Open a file in Atom when you double-click it on WinSCP?

#

Right-click on the file you need > Edit > Configure > Editors > Add... > External Editor > Browse for editor directory

#

I'm pretty sure that's how you'd do it, haven't configured an editor on WinSCP since I first got my VPS

long forge
#

Hm for some reason I am not able to download discord.js commando. I keep getting:

npm ERR! error: pathspec '11.2' did not match any file(s) known to git.
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\*****\AppData\Roaming\npm-cache\_logs\2018-07-10T03_00_57_439Z-debug.log```
I tried uninstalling git and reinstalling, as well as removing and readding that file. Nothing is working...
earnest phoenix
#

so

#

thats the code i was having trouble with

#

error:

(node:6283) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'playStream' of undefined

at play (/app/commands/play.js:41:43)

at Object.exports.run (/app/commands/play.js:29:25)

    at <anonymous>

    at process._tickCallback (internal/process/next_tick.js:188:7)

(node:6283) 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: 7)


#

any fix?

ruby cargo
#

Is the connection null?

#

It may be acting too fast

long forge
#

Here is the log of my error:

1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\*****\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'discord.js-commando' ]
2 info using npm@5.6.0
3 info using node@v8.9.4
4 verbose npm-session 05b640078743174a
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for discord.js-commando@github:Gawdl3y/discord.js-commando#11.2 Command failed: C:\Program Files\Git\cmd\git.EXE checkout 11.2
7 silly fetchPackageMetaData error: pathspec '11.2' did not match any file(s) known to git.
8 verbose stack Error: Command failed: C:\Program Files\Git\cmd\git.EXE checkout 11.2
8 verbose stack error: pathspec '11.2' did not match any file(s) known to git.
8 verbose stack
8 verbose stack     at ChildProcess.exithandler (child_process.js:275:12)
8 verbose stack     at emitTwo (events.js:126:13)
8 verbose stack     at ChildProcess.emit (events.js:214:7)
8 verbose stack     at maybeClose (internal/child_process.js:925:16)
8 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
9 verbose cwd C:\Users\*****\Desktop\Discord Test Things\Music Bot (live, public)
10 verbose Windows_NT 10.0.16299
11 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jorda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "discord.js-commando"
12 verbose node v8.9.4
13 verbose npm  v5.6.0
14 error code 1
15 error Command failed: C:\Program Files\Git\cmd\git.EXE checkout 11.2
15 error error: pathspec '11.2' did not match any file(s) known to git.
16 verbose exit [ 1, true ]

What is the issue? I have reinstalled git twice and deleted the file. Neither worked...

primal adder
#

hey

#

my js doesn't work on the site

#

what's wrong? :thooonk:

languid dragon
#

Show code

#

👌

stiff juniper
#

djs-commando

#

reeee

neat cosmos
#

-about resources

#

ooof

stable juniper
#

Any way to get a user's full username (discord.net c#)? For example if I do user.Username that gives me their username, but I want say for me, Ethan#5739 instead of just Ethan.

gilded thunder
#

@stable juniper user.Username plus user.Discrim might work

#

Try Discrim or Discriminator

#

One of the terms

#

I'm just guessing how that would work, I don't know d.net

stable juniper
#

Give me a second I'll try that

gilded thunder
#

👌

stable juniper
#

Ah that worked. It's either user.Discriminator or user.DiscriminatorValue depending on what context you use it in.

#

Thank you @gilded thunder

gilded thunder
#

All good

sick cloud
#

Do you have a Tag property or something @stable juniper?

#

discord.js at least has <user>.tag, which automatically adds <user>.username # <user>.discriminator together.

stable juniper
#

Wym?

sick cloud
#

wrong ethan

#

oof

stable juniper
#

I just changed my pfp

#

Haha

sick cloud
#

ohk

stable juniper
#

No I just concatenated them

#

I did something along the lines of

user.Username + "#" + user.Discriminator

sick cloud
#

I'm not asking that, I'm asking if your library has a tag property, in this case like user.Tag?

stable juniper
#

No

#

If there is I couldn't find it

sick cloud
#

rip

earnest phoenix
#

Hey I need some help. I made custom prefix command but how to show it on help

#

When someone change the prefix of my bot, it should change on help tab too

harsh zenith
#

language?

compact moth
#

Does anyone knows some easy way or some program to learn russian alphabet and cyrillic?

lyric lotus
#

whats wrong with this on python

#

@client.event
async def on_ready():
await client.change_presence(game=discord.Game(name='j!help'))
print("Bot is online and connected to Discord")

ruby dust
#

@lyric lotus async on rewrite version of d.py?

lyric lotus
#

what?

ruby dust
#

async and rewrite

#

which version are you using?

lyric lotus
#

async

#

why

#

i think its async

#

preety sure

ruby dust
#

if that would be rewrite I could help, cause I'm not async

lyric lotus
#

ok

ruby dust
#

also async is very outdated and pretty much abbandoned

#

rewrite version is currently the only one receiving new updates

lyric lotus
#

ok

#

how do i use it on mobile

spring mesa
#

in d.js, can i simply use something like !Thonk to add a reaction?

knotty steeple
#

you can just use the id

#

to add a reaction

lyric lotus
#

oof

cinder stratus
#

i need a help

slender thistle
#

@lyric lotus What error, though

#

That doesn't look wrong

lyric lotus
#

it was like

#

indent doesnt match indent thing

knotty steeple
#

say what u need @cinder stratus

lyric lotus
#

let me find it

#

i fixed it

#

by

#

removing that code

#

cuz its useless

#

boom

slender thistle
#

¯_(ツ)_/¯

cinder stratus
#

by mistake cleared the code😭

lyric lotus
#

xd

#

ok

#

i dont even need botgame it wasnt even a cmd

#

so who cares

#

cinder stratus
#

why it shows erroe

knotty steeple
#

your missing a )

cinder stratus
#

okh

knotty steeple
#

is that sourcecode i see 👀

earnest phoenix
#

looks like it

cinder stratus
#

where

night imp
#

line 6

cinder stratus
#

oo

knotty steeple
#

you should reset your token now

cinder stratus
#

same

earnest phoenix
#

no

#

hes missing a }

cinder stratus
#

where?

earnest phoenix
#

just remove that {

night imp
#

you didn't close off the sender check

#

no

#

don't remove it

earnest phoenix
#

there isnt a closing }

night imp
#

just put a matching

knotty steeple
#

he didnt close the if help

earnest phoenix
#

or that

knotty steeple
#

either

earnest phoenix
#

doesnt matter

night imp
#

also I recommend learning javascript

earnest phoenix
#

^

knotty steeple
#

^^

night imp
#
Udemy

Learn Node.js by building real-world applications with Node, Express, MongoDB, Mocha, and more!

earnest phoenix
#

he didnt end the sender id if check not the help if

cinder stratus
#

the bot run

#

runs

#

thnx

knotty steeple
#

did you even reset your token

#

after you literally exposed it

cinder stratus
#

yes done

inner jewel
#

reset your token nvm wasn't scrolled down

knotty steeple
#

fix that depreciation warning

cinder stratus
#

how to fix that

knotty steeple
#

do what it says

#

use setActivity instead of setGame

cinder stratus
#

ok

gilded thunder
#

@lyric lotus I can help

#

You need to define the game change under the bot event async def on_ready():

#

It doesn't work in normal script

#

msg is not defined

#

Read the traceback before sending screenshots here

knotty steeple
#

...

gilded thunder
#

He deleted the messages

cinder stratus
#

Becausen You Got Offend

gilded thunder
#

Because you don't read whats wrong with your code and expect us to fix it for you.

earnest phoenix
#

That is what annoys me the most about newcomers

gilded thunder
#

Same.

ruby dust
#

I'm having OperationalError: database is locked when I restart the bot on windows. Should I be worried about it or will this not happen on a Linux server?

earnest phoenix
#

no way to know imo

#

doesnt hurt to try

ruby dust
#

that's what I'm afraid of

#

if I'm gonna upload the changes to the public bot and that will affect it

#

I'll have problems with all commands not being executed

earnest phoenix
#

cant run a test version?

ruby dust
thorny fractal
#

still trying to get my bot online

#

😭

knotty steeple
#

@ruby dust that an sql error right?

ruby dust
#

sqlite3 yes

knotty steeple
#

if that happens i use the cli

#

to open it

gilded thunder
#

@thorny fractal Then write some code for it

thorny fractal
#

idk how to write an code LIKE FR

earnest phoenix
#

then i suggest you not code a bot

#

and learn the basics of some language

#

then learn basics 2..... 3, 4, 5 and 6

#

then intermediate

#

then get a though tof coding a bot

#

then learn expert stuff on the language

#

then attempt

stiff juniper
#

yeah if you dont know whatever language you're trying to use

#

it wont help

shy verge
#

lol you don't need full proficiency to make a bot

ruby dust
#

so I'm still getting OperationalError: database is locked after restarting the bot even in the linux server

#

my only assumtion is my code

#

I want to have a list of commands and how many times each command was executed

command_list = ['help', 'invite', 'commandstats', 'lookup', 'uprate', 'downrate', 'logging']
for i in command_list:
    try:
        c.execute("INSERT INTO CommandStats (Command, Counter) VALUES ('" + str(i) + "', 0)")
        conn.commit()
    except sqlite3.IntegrityError:
        continue
```even though the `Command` column is set to unique, I found this the easiest way to quickly create all rows with all commands, that is when the bot is starting up
#

if this is the actual reason why it's locking the database, maybe some other options could be handy?

slender thistle
#

If I have settings.json in the same folder as .gitignore, do I just put settings.json in .gitignore?

inner jewel
#

yes

slender thistle
#

Thanks

lyric lotus
#

Sorry

#

I just came back

#

I wasnt here

slim heart
#

Okay I feel dumb

#

How do I make the timestamp on the embed autogenerated

#

I tried "timestamp": Date();

sullen path
#

Have you tried converting the Date object to a string?

#

I assume JS has a str() function of sorts

slim heart
#

i did Date().toString()

#

Still doesnt work

#

also tried Date().toLocaleString()

sullen path
#

I’m not a JS developer, so idk

slim heart
#

oof

stiff juniper
#

making a dashboard rn

coral lichen
#

nice

stiff juniper
#

update

coral lichen
main ravine
#

Hello

gilded thunder
sour perch
#

how do you make the bot send the message to a specific server in a specific guild?

knotty steeple
#

how do we know what library it is?

sour perch
#

tried to use this but channel was undefined...

client.guilds.get(<guild id>).channels.get(<channel id>).send(<message>)
#

discord.js

knotty steeple
#

also to a specific server in a specific guild wat

sour perch
#

i want it to send a message to a channel in my devserver...

knotty steeple
#

also you just need client.channels.get().send()

#

works for me

sour perch
#

client.channels.get(id?).send(message?)

#

??

#

ill try try that

#

(node:12996) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined

#

now what

quartz kindle
#

the id must be a string, and only numbers, without the <>, for example client.channels.get("9746593794563").send()

sour perch
#

ok thx

stiff juniper
#

uhhh

#
{ DiscordAPIError: Missing Permissions

when trying to use guild.fetchInvites() on discord.js

#

what

#

the bot has the Create Instant Invite perm

#

what else does it need

sullen path
#

View Audit Log

stiff juniper
#

really now

#

wtf

#

that's weird

sullen path
#

It needs to see all the invites that have been created. The only place to get them is in the audit log

stiff juniper
#

discord needs to add something better

#

that gets them

#

requiring the bot to search the audit log is a bit shit

#

it still says Missing Permissions after giving it the view audit log perm

#

so huh

#

oh

#

it requires Manage Server

#

according to the Discord docs

#

that's

#

what

#

@sullen path

sullen path
#

my bad

stiff juniper
#

Manage Server to get the invites?

#

whyyy

sick cloud
#

Just like us users need Manage Server to access the Server Settings "Invites" tab @stiff juniper. lol

stiff juniper
#

oh

#

right

sick cloud
#

Why is my file sending me this error?

exports.messageEdit = async (old, new) => { ...

neon schooner
#

you're missing a )

#

(function (exports etc))

#

at least that's what I can see from the snippet

sick cloud
#

Figured out that new is used, but I'm not. :p

neon schooner
#

👍

jade flower
#

How i make user avatar editing with python bot

worn ridge
#

Hey, I would like to use this documentation page: https://docs.discord.club/xenon/ on my dbl bot page. I tried with an iframe: <iframe src="https://docs.discord.club/xenon/"></iframe> but it just shows a white page.
I thought it's because the page has a pretty long loading time, but maybe there is a way to fix that think

stiff juniper
#

@worn ridge A) where are you placing it?
B) Check the console for errors (CTRL+SHIFT+I -> Console on Chrome)

#

@gilded plank bots @worn ridge

gilded plankBOT
#
Merlintor#6111
Bots <:dblCertifiedDev:401725450470031362>

@quaint flax dblCertified
@last onyx dblCertified

worn ridge
stiff juniper
worn ridge
#

lol

#

But not for me

#

weird

stiff juniper
#

huh

#

are you clicking Preview or seeing it on the actual bot page?

#

@worn ridge

worn ridge
#

actual page

stiff juniper
#

i see

#

very odd cuz it works for me

worn ridge
stiff juniper
#

but uhh that error in the console isn't fixable by you because it's a header thing

#

if "X-Frame-Options" is "sameorigin"

as you can guess
it'll only load iframes of discordbots.org

worn ridge
#

yeah

#

But why 😄

stiff juniper
#

because iframes are open to XSS attacks

#

and other bad stuff

red spade
#

what's the best Discord bot library according to you guys?

worn ridge
#

But why is it working for you 😄

stiff juniper
#

discord.js in my opinion

it's fast, nice and easy to use, etc etc @red spade

#

@worn ridge idk

#

¯_(ツ)_/¯

worn ridge
#

Ok thank you anyways 🙃

#

Ok seems like it's a local cache issue

#

it works in incognito

stiff juniper
#

i see

sullen path
#

The best Discord bot library is the one you use

eager perch
#
  .bot-name {
    -webkit-animation: rainbow 5s infinite alternate;
    animation: rainbow 5s infinite alternate;
  }
  
  @keyframes rainbow {
    0%   {color: blue;}
    10%  {color: #8e44ad;}
    20%  {color: #1abc9c;}
    30%  {color: #d35400;}
    40%  {color: blue;}
    50%  {color: #34495e;}
    60%  {color: blue;}
    70%  {color: #2980b9;}
    80%  {color: #f1c40f;}
    90%  {color: #2980b9;}
    100% {color: pink;}
  }```
#

How does one do that?

#

Like the rainbow name

#

this doesn't work for me >.>

onyx summit
#

How should I make a detailed information and guide about my bot
He is on ca 110 Servers.
Should I make a own website or is there anything other where I can write a detailed Information about it (I saw some people using github)

slow ice
#

you could make a own website if you know html, css and js or just document it on the discord bot list, make a help command with detailed information or do it on github

#

@onyx summit

onyx summit
#

thx but found gitbool, seems pretty cool

slow ice
#

ah k

acoustic olive
#

aahhh

#

can anyone help me with my play function?

#
  play(message, queue, song) {
    const search = require('youtube-search')
    const ytdl = require('ytdl-core')
    const bot = message.client
    const opts = {
      part: 'snippet',
      maxResults: 10,
      key: 'YOUTUBE API V3 KEY',
      type: 'video'
    }
    var intent
    let player
    let test

    try {
      if (!message || !queue) return

      if (song) {
        search(song, opts, function (err, results) {
          if (err) return message.channel.send('Video not found please try to use a youtube link instead.')

          song = (song.includes('https://' || 'http://')) ? song : results[0].link

          let stream = ytdl(song, {
            audioonly: true,
            qualty: "highestaudio",
            highWaterMark: 30000
          })
          
          if (queue.length === 0) test = true
          
          queue.push({
            'title': results[0].title,
            'requested': message.author.username,
            'toplay': stream
          })
          message.channel.send('Queued **' + queue[queue.length - 1].title + '**')

          if (test) {
            setTimeout(function () {
              bot.functions.play(message, queue)
            }, 1000)
          }
        })
      } else if (queue.length !== 0) {
        message.channel.send(`Now Playing **${queue[0].title}** | Requested by ***${queue[0].requested}***`)

        const connection = message.guild.voiceConnection
        if (!connection) return console.log('No connection!')

        player = connection.playStream(queue[0].toplay)
        

        player.on('error', () => {
                  queue.shift()
          message.channel.send('Sorry lads an error occurred while playing this song')
          bot.functions.play(message, queue)
        })
        player.on('end', () => {
                  queue.shift()
          bot.functions.play(message, queue)
        })
      }
    } catch (err) {
      console.log(err)
    }
#

the problem is with the test part

#

since the test is true it will just play the song when its queued

#

whats very annoying is this code works in my other bots and not this one

vale harness
#

What are the HTML element names that you can edit through CSS in the long description? What’s the name for the upvote button and the invite button etc.?

stiff juniper
#

use Inspect Element

knotty steeple
#

you can use inspect- dammit

#

look at source code also :^)

vale harness
#

I tried that, I’ll look further, I think I was looking in the wrong place

onyx summit
#

Can someone with a good antispam give me examples on how it should work, also the numbers whats the limit and etc (Iam not asking for the finished code, just a instruction how a good antispam is build up and Wich numbers for sensitivity)

vale harness
#

Thx

#

I got the name to go multicoloured by using the example above

eager perch
#

The shadow thing

inner jewel
#

what page?

eager perch
#

Profile page where you can do custom css and stuff.

#

in the long description

inner jewel
#

add box-shadow: none !important; to .bot-img

eager perch
#
  .bot-img {
      box-shadow: none !important;
  }
#

that didn't work for me.

inner jewel
#

i added it directly to the div

#

the stylesheet has !important on it too

#

.columns .column .bot-img {box-shadow: none !important;}

#

this one works

#

@eager perch

eager perch
#

Yep, thanks!

tawdry fox
#

this is my code

public void execute(Context c, String[] args) {
        
        Core.deleteLastMessage(c);
        
        if(args.length == 0) {
            c.invalid(this);
            return;
        }
        
        Giphy giphy = new Giphy(Settings.GIPHY_TOKEN);

        StringBuilder s = new StringBuilder();
        for (int o = 0; o < args.length; o++) {
          s.append(args[o] + " ");
        }
        String msg = s.toString();
        
        try {
            SearchFeed feed;
            feed = giphy.search(msg, 1, 0);
            String url = feed.getDataList().get(0).getImages().getOriginal().getUrl();

            EmbedBuilder embed = new EmbedBuilder();
            embed.setImage(url);
            embed.setFooter("Command executed by: " + c.user.getName() + "#" + c.user.getDiscriminator(), c.user.getAvatarUrl());
            c.channel.sendMessage(embed.build()).queue();
            System.out.println(url);
        } catch (GiphyException e) {
            e.printStackTrace();
            c.channel.sendMessage(Emoji.ERROR + " Nothing found by '" + msg + "' (Can be a problem with giphy)").queue();
        }
        return;
    }

and this is the returned url (printed on console)

https://media1.giphy.com/media/aC45M5Q4D07Pq/giphy.gif

but when i execute the code i only get this http://prntscr.com/k5895q

Lightshot

Captured with Lightshot

#

Can someone help me? (JDA)

inner jewel
#

might be discord's proxy being stupid

tawdry fox
#

idk, i tried a lot of things (JDA server people tried to help me) but nothing works

inner jewel
#

do you have images disabled?

#

that same url works for me

sullen path
#

That line of code (the setImage() function) works fine for me, so...

#

Either your link is bad, or your images are disabled

tawdry fox
#

i have images enabled and my bot has all perms on the server

sullen path
#

one sec

#

@tawdry fox look in #commands , it's working for me

#

so it's something with your image settings (probably)

granite hedge
#

embeds disabled?

#

open console and check if there are huge red blocks saying failed to load

sullen path
#

there is no console on the desktop app, browser user 😉

granite hedge
#

there is on the desktop app xd

sullen path
#

🤔

granite hedge
#

ctrl + shift + i

slender thistle
#

Images disabled? Previews, you mean? That would disable embeds as well

sullen path
#

o

sour perch
#

how do you generate pictures like the mee6 bot does for its rank card?

shy verge
#

canvas

#

go learn it my doot

sour perch
#

lmao, what?

austere meadow
#

have a look at node-canvas

night imp
#

Thinking of joining both my bots on a single vps running d.js for both. This is possible, right?

sullen path
#

I have 5 bots running on my server.

#

all using java

#

and my server is bad

#

take the hint

night imp
#

what

sullen path
#

Translation: yes it is 100% possible

karmic parcel
#

why didn't you just say that?

sullen path
#

idk

#

I’m brain dead

#

I was listening to someone sing despacito for an hour, so that probably didn’t help

#

k moving to another channel

long forge
#

On discord.js using ytdl-core, this line of code:

let validate = await ytdl.validateURL(args[0]);```
Gives me this error:
```(node:11996) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Parameter "url" must be a string, not object
(node:11996) [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.```
How can I fix it, as I think it is what is causing my play command to not work...
knotty steeple
#

it clearly says how to fix it

#

it has to be a string

quartz kindle
#

Parameter "url" must be a string, not object

long forge
#

so... move it to where then?

stiff juniper
#

you have to join the args together

#
args.join(" ");
#

the quotes are a space

#

which is prob what you want to join them together by

#

that makes a string

#

unless well args[0] is an object

#

then you're kinda

#

well

#

console.log the object

quartz kindle
#

i dont think the problem is args[0] itself. the content of args[0] should be the problem

stiff juniper
#

yeah prob

#

seems to be a type mismatch

quartz kindle
#

array/object keys/pointers usually always resolve themselves before being sent to the function

long forge
#

so what should I do then? Im still confused...

quartz kindle
#

console log args[0]

long forge
#

in the beginning? or right before?

quartz kindle
#

before

long forge
#
let dispatcher = await connection.play(ytdl(console.log(args[0]), {
        filter: 'audioonly'
    }));```
quartz kindle
#

.... no...

#

you are getting that error because args[0] probably contains an unexpected value

#

so console log args[0] anywhere before the function to see if its content is what you expect it to be

#

first you need to see what is the problem, then fix after you find out what the problem is

#

you havent discovered the problem yet

long forge
#

Ok I seemed to find what was giving me that... needed to relook over it.

safe night
#

hi guys, how can I test a bot?

stiff juniper
#

run it

#

and add it to a test server

safe night
#

how can I add it to a test server? 😬

stiff juniper
#

create a server

#

for testing your bot

#

use the Discord OAuth2 generator to get a link for it

#

check Bot

#

and put in your bot's client id

#

then bam

marsh lark
#

The use of at least one of our widgets on your website/github page. (Get widgets for your bot by going to your bot's profile and pressing edit), in relation to certification what happens if you dont got a website or github page, just curios

stiff juniper
#

well then

#

you're fucked

#

tbf though if you're making a bot worthy of certification

#

you need one of those

safe night
#

@stiff juniper Thanks!

stiff juniper
#

@safe night no problem

quartz kindle
#

@marsh lark you can make an empty github page with just a readme guide, thats what i did

#

post a commands list / help menu there and you're good

marsh lark
#

ah right thanks Tim 👍

astral pier
stiff juniper
#

no

astral pier
#

It only happens when I'm not logged in.

quasi marsh
astral pier
#

K. I will do that tomorrowGWvertiPeepoCheer

old swallow
#

Hey there 👋

I'm on the latest discord.js v12/master, how would I do these two things: 1, on user join/leave (I already have the event) figure out who invited them, and 2, make a "fake invite" system (i.e, if a user joins and leaves within 15 minutes, add 1 to a variable like fakeInvites.

Thanks in advance!

quasi marsh
#

In my experience you'd constantly needed to check the server invites, then check for changes

steady prawn
#

How do you do dick length

quasi marsh
#

just randomize between two numbers?

old swallow
#

I don't want to do that since if the bot gets big it'll hurt the performance majorly in a way.

stiff juniper
#

also

#

checking server invites

#

requires your bot to have the Manage Server permission

#

sooo

old swallow
#

Doesn't matter, I enforce the permission on the invite, and if the bot doesn't have the permission it alerts the user and won't run any further.

quasi marsh
#

The thing is there isn't any invite related events I think

stiff juniper
#

nope

#

just checked djs docs

quasi marsh
#

@old swallow You might try the GUILD UPDATE thing

#

Event

#

But I"m not too sure that it will include invites

#

But that's my best bet other than just fetching invites for every server using it

stiff juniper
#

this kind of changing

#

i presume it's talking about

#

so prob not tbh

old swallow
#

I'll try add the event and see if it fires when I make an invite.

quasi marsh
#

In py guild.invites is a coroutine so it's probably fetched from a web api

#

So I'm doubting that it will send

#

But best to experiment

old swallow
#

The only invite endpoint I found is msg.guild.fetchInvites();

stiff juniper
#

yeah discord.js has this

#

which i presume it also fetches from the web API

quasi marsh
#

Yeah it's a promise

stiff juniper
#

yeah when it isnt fulfilled it gives a DiscordAPIError

#

so yes it is

#

as in

quasi marsh
#

Yeah

stiff juniper
#

it says
"DiscordAPIError: error"

quasi marsh
#

Probably won't fire then

#

GUILD UPDATE probably fires when like server name or avatar or region changes

stiff juniper
#

yeah