#development

1 messages · Page 640 of 1

earnest phoenix
#

Does anybody have a play-command script? Um, SpoonFeeding is not allowed here so DM me the script, my friend.

amber fractal
#

bruh

earnest phoenix
spare goblet
#

@earnest phoenix That's still considered spoonfeeding shruggies

earnest phoenix
#

oh

#

i dunno tf spoonfeeding is lmao

#

js? @earnest phoenix

#

yes

amber fractal
#

if you spoonfeed this man

earnest phoenix
#

Wait

amber fractal
#

I swear

grim aspen
#

spoonfeeeding?

earnest phoenix
#

Google

spare goblet
#

Ask people to teach you how, not give you all the code

#

:\

grim aspen
#

that is when you give people code and not teach them how to code

earnest phoenix
#

Just search on google 4TriX

grim aspen
#

late message

earnest phoenix
#

I'm teaching to people how to spoonfeed

#

@earnest phoenix yes i did and they dont

#

okay..

#

@earnest phoenix lets take it to DMs

spare goblet
near igloo
#

hello developers

earnest phoenix
#

Hello

near igloo
#

helloooooo.....

#

oh hi

earnest phoenix
#

Do you need help?

near igloo
#

yup

spare goblet
#

@near igloo this isn't really a chat for saying hi but if you have a question you can drop it here.

earnest phoenix
#

Ask your question

near igloo
#

how will i make my webpage public?

spare goblet
#

but hi, hope you're having a good day so far. blobsmilehappyeyes

earnest phoenix
#

hum

#

What webpage?

spare goblet
#

are you referring to being listed in dbl or something else ?

near igloo
#

i create a webpage by using HTML so i wanna make it public so any 1 can surch it on it...

earnest phoenix
#

nobody cant help you

near igloo
#

😰

#

😢

earnest phoenix
#

look the topic of the channel @near igloo

#

I have another question, if my boy was declined for a reason, can I fix that and apply again?

#

yes

slender thistle
#

Yep

earnest phoenix
#

sure

#

Thanks doggowave

near igloo
#

every 1 is rude\

earnest phoenix
#

not rude

near igloo
#

then help me to make a discord bot

earnest phoenix
#

Okay

near igloo
earnest phoenix
#

In the topic

#

Its a rule

near igloo
#

where is topic

#

?

earnest phoenix
#

Read the topic of the channel before talking in the channel

slender thistle
somber verge
covert turtleBOT
near igloo
#

sir i want cold coffe

#

not bot coffe

#

how will i code

slender thistle
#

Move out of this channel if you are not going to ask any question about programming

earnest phoenix
#

learn and apply what you have learn

near igloo
#

ie learned HTML

earnest phoenix
#

There are plenty videos on youtube too about how to get started

near igloo
#

lemme send u a pic of my bot

#

his name is admin

near igloo
grim aspen
#

get started on a bot

spare goblet
#

It teaches you how to get started with programming a bot.

near igloo
#

i have note.js

#

idk how to make json file

spare goblet
#

do you mean node ?

grim aspen
#

note

#

that's new

near igloo
#

i typed in cmd too

earnest phoenix
#

@near igloo create a file name.json

#

just that

spare goblet
#

just create a file called that 🤠

earnest phoenix
#

and if you want to write and read in the file, install fs

#

And read the fs docs

near igloo
#

so i dont need to type amy thing in cmd this whol time

#

?????

spare goblet
#

you don't need to type anything in cmd until you wanna run the bot.

near igloo
#

oh

#

can i add my bot on this server?

earnest phoenix
#

sure

near igloo
#

yay

#

bindo

grizzled spruce
#

Once it’s finished enough

grim aspen
#

if you want

earnest phoenix
covert turtleBOT
grizzled spruce
#

If the bot is offline/only has 1 feature they’ll reject it

grim aspen
#

or does not comply with the rules

near igloo
#

i have q can i ask it?

grim aspen
#

uh yea

near igloo
#

q=questions

earnest phoenix
#

dont ask to ask

#

dont ask to ask, just ask your question

#

just ask

#

yes

near igloo
#

okok

#

i made a bot on my laptop but its off linr for 30 or more then 30 days

#

how will i make the bot online again

slim heart
#

running the bot?

earnest phoenix
#

you need to keep the process that connects to the gateway up

#

aka you have to run the code and keep it open

near igloo
#

what ?????????????//

earnest phoenix
#

theoretically you could make the code run as a windows service on startup so you don't have to bother with it but that's advanced right now

near igloo
#

i have to keep coding??????????

cunning oxide
#

No

earnest phoenix
#

you don't have to keep coding, you have to keep the process that runs the code open

cunning oxide
#

@near igloo what is ur bots library?

#

Oh wait depends if ur hosting or not

near igloo
#

mean?

earnest phoenix
#

you should probably backtrack (a lot) and first learn how to code before trying to run a bot

near igloo
#

w8 how old r u guys?

grim aspen
#

18

earnest phoenix
#

16

cunning oxide
earnest phoenix
#

@near igloo you can host your bot 24/7 if you have a laptop or computer

grim aspen
#

what we mean by library

earnest phoenix
#

discord.js better for beginner

grim aspen
#

yes

near igloo
#

14 years old me dont know where to goo im lost😰

somber verge
near igloo
#

i wanna cry

cunning oxide
#

goldy, id recommend looking up some tutorials and then coming back

earnest phoenix
#

@near igloo okay, just dont shitposting here

near igloo
#

ok master

earnest phoenix
#

if you have a question ask your question

near igloo
#

💩

#

bye

cunning oxide
near igloo
#

shit posting

grim aspen
#

well here's some advice, go find a good tutorial, like node js, and if you have questions come and contact us

earnest phoenix
#

And that's a mute

cunning oxide
#

Nah

#

That’s his last warning though

earnest phoenix
#

He left

#

meh, telling people what to use as their starting language is generally bad. let the person pick themselves, what seems satisfying to you may seem unsatisfying to someone else

cunning oxide
#

Fair

#

Okay let’s move elsewhere

digital sparrow
#

hey discord bot have c++ library?

somber verge
#

google is your friend

digital sparrow
#

-_-

cunning oxide
#

Yeah in the future please do your best to see if you can google any of the questions you may have.

earnest phoenix
#

most of c++ libs are abandoned or lack a lot of support for new features

#

if not all actually

cunning oxide
#

To answer, I don’t think so. They’re pretty dead.

digital sparrow
#

F

earnest phoenix
#

Is the dm command acceptable if it says who sent the message like: (message) sent by Pablo

#

?

slender thistle
#

Yes

frail ocean
#

As long as it’s clear, yes.

earnest phoenix
#

So basically my bot gets a error called

#

Npm moving to pnpm remame node module from blankety to blankety

spare goblet
#

type pnpm instead

#

like pnpm install

earnest phoenix
#

mmm

spare goblet
#

pnpm install (module name here)

earnest phoenix
#

I'm going on my computer brb

spare goblet
#

so if you're using djs do like pnpm install discord.js

earnest phoenix
#

If it appears in the dms like Today we have an event going on at 6, be ready sent by Pablo

#

It's ok?

#

I just wanna be sure

#

It needs permissions to be sent so not everyone can do it

#

Ofc im using discord.js

spare goblet
#

would do like
From Baron Der Pablo#1627: Today we have an event going on at 6, be ready!

#

but as long as it's clear the author of the message, it's allowed.

frail ocean
#

@earnest phoenix your one is fine.

earnest phoenix
#

Yeah, like that

#

So I wanna know sum else

frail ocean
#

It could even go in the footer if it’s an embed.

earnest phoenix
#

What is the #1 bot

frail ocean
#

As long as you see who it’s from.

spare goblet
#

There's no #1 bot imo

frail ocean
#

We can’t say the #1 bot, if you mean in terms of severs or?

earnest phoenix
#

Ok

frail ocean
#

But bots do different things.

#

So they can’t mostly be compared.

earnest phoenix
#

And is it permitted to send a message to all members with a specific role? Like:
From Baron Der Pablo#1627: Be ready players for our game night

#

if we're speaking in numbers, rythm

#

Sent to users with a mentioned role

#

Wait so is it normal for glitch to turn off a bot for a couple hours/minutes and turn it back on

spare goblet
#

i mean yeah but make sure not to abuse discord api :')

earnest phoenix
#

Oh that's why...

frail ocean
#

@earnest phoenix if a bot isn’t used for 5 minutes it turns off until you re edit it

earnest phoenix
#

Ok

frail ocean
#

You can add a ping or a loophole however.

spare goblet
#

Enzo - it shuts off if no ping after 5 mins
but if it's on for 12h or more it'll shut off itself

#

so you'll need an outside ping-er thingy

frail ocean
#

There are many good ones, uptime robot for examples. Look online or get a host.

earnest phoenix
#

How do I do status loop

#

with a loop

spare goblet
#

loop a function to ping the http address of your project

earnest phoenix
#

ummm

#

how?

spare goblet
#

use increment or setInterval

earnest phoenix
#

i got a lil issue uwu, ask now ir when whatever is above is solved though.

spare goblet
#

ask away ^

earnest phoenix
#

where do i put setintervla

spare goblet
#

in your code ?

earnest phoenix
#

no like where in my code

#

discord.js
My code:

let att = msg.attachments;
      if (!att) return msg.channel.send(`:warning: Please upload the banner directly to discord. when using \`${config.prefix}setbanner\``);
      let attUrl = att.array()[0].url;```
Error:
```error
TypeError: Cannot read property 'url' of undefined```
veri sad
spare goblet
#

in a place where the code will run lol
usually main bot file

earnest phoenix
#

the error is where i define attUrl

#
function game1(){
    bot.user.setPresence();
    setTimeout(game2, 10000);
};

function game2(){
    bot.user.setPresence();
    setTimeout(game1, 10000);
};

``` example from stackoverflow
#

after you need to call the function

#

oh i have setinterval

spare goblet
#

try .first instead of .array()[0]

earnest phoenix
#

in your bot.on('ready' event

inner jewel
earnest phoenix
#
const express = require('express');
const app = express();
app.get("/", (request, response) => {
  console.log(Date.now() + " Ping Received");
  response.sendStatus(200);
});
app.listen(process.env.TOKEN);
setInterval(() => {
  http.get(`https://${process.package.url}.glitch.me/`);
}, 280000);
spare goblet
#

it can be out of ready event too, doesn't really matter

halcyon mountain
#

glitch is best lool

earnest phoenix
#

that's like saying stale bread is the best type of bread ??

#

u mean i put teh setinterval() in client.on(ready

#
  // This event will run if the bot starts, and logs in, successfully. 
  console.log(`Bot has started, with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`);
    console.log(`Bot Tag: ${client.user.tag}`) 
    console.log(` `);
    console.log(`Will Now be Logging Commands`);
    console.log(`====================================`);
    console.log(`Command Logs:`);
    console.log(` `);  
  client.channels.get('586350574057029652').send(`Bot has started, with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} guilds.`);
client.user.setActivity(`${client.users.size} Users | e@help`, {type: "LISTENING"}) 
}); ```
inner jewel
#

@earnest phoenix if(!message.attachments) will always be false, since it's always defined

#

you want to check if the size is 0 there

#

message.attachments.size == 0

earnest phoenix
#

so i put it below client on

#

@earnest phoenix what do u need ?

#

awh

spare goblet
#

@earnest phoenix - check if message.attatchments.first is defined

earnest phoenix
#

activity loop

#
function game1(){
    bot.user.setPresence();
    setTimeout(game2, 10000);
};

function game2(){
    bot.user.setPresence();
    setTimeout(game1, 10000);
};

iron sentinel
#

why not setInterval?

earnest phoenix
#

put that above your client.on('ready'

#

setpresence is discord py

#

and then call the function in your events

#

no

#

discord.js

inner jewel
#

setTimeout to change between them

earnest phoenix
#

yes

inner jewel
#

game1 sets a timeout to game2, which sets a timeout back to game1

earnest phoenix
#

i wanna have one say listening to client.users.size

iron sentinel
#

or use a boolean and a.. forgot what its called
true ? something : something_else

earnest phoenix
#

and watching client.guilds.size

#

after you need to call the function in your events like setTimeout(game1, 10000);

spare goblet
#

@earnest phoenix - hi, please refrain from asking to be spoonfed, but you should be a loop function before ready event or within

earnest phoenix
#

and playing w@help

#

e*

slender thistle
#

@iron sentinel json

inner jewel
#

sujeden: ternary

earnest phoenix
#

@earnest phoenix come dm

#

2m

inner jewel
#

but the easiest method is to just have an array

iron sentinel
#

ternary operator

#

ye

#

thats it

slender thistle
#

(oops)

earnest phoenix
#

nope

#

                                 ^


TypeError: Cannot read property 'url' of undefined```
code: ```js
let att = msg.attachments;
      if (!att.size == 0) return msg.channel.send(`:warning: Please upload the banner directly to discord. when using \`${config.prefix}setbanner\``);
      let attUrl = att.array()[0].url;
iron sentinel
#

no

inner jewel
#

still wrong

spare goblet
#

not !

iron sentinel
#

you are doing if(true == 0)

inner jewel
#

also your operator precedence is wrong

#

no

#

it was if(!(att.size) == 0)

earnest phoenix
#

what.

spare goblet
#

your code is doing this:
if(has attachament) return

earnest phoenix
#

no it's not

#

it crashes when you upload nothing

inner jewel
#

exactly

spare goblet
#

exactly

inner jewel
#

because you try to read an attachment when there's none

spare goblet
#

because you're making it run code below it

#

if it has nothing

inner jewel
#

your if statement is wrong

earnest phoenix
#

if (!att.size == 0) return Think_Hyper

inner jewel
#

exactly

earnest phoenix
#

oh wait

#

!

inner jewel
#

you want to stop if there are 0 attachments

earnest phoenix
#

oh wait

spare goblet
#

yes lmao

iron sentinel
#

take away the == 0 and its good

inner jewel
#

not if the negation of the size is equal to 0

iron sentinel
#

what? @inner jewel

inner jewel
#

!att.size == 0 means "is the negation of att.size equal to 0"

iron sentinel
#

ohh i thought you were replying to me

#

my b

earnest phoenix
#

i just realised lmao

#

thankss

spare goblet
#

have a good day :)

earnest phoenix
#

my unban command no work

amber fractal
earnest phoenix
#

ok so

#

lib is discord js and lang is javascript

#

my error is that it not unban user

#

my code is following

#
    if(!message.guild.member(message.author).hasPermission("BAN_MEMBERS")) return message.reply('You don\'t have permission to do that.');
    if(!message.guild.member(bot.user).hasPermission("BAN_MEMBERS")) return message.reply('I don\'t have the permission to do that!');
    let user = args[0];
    let reason = message.content.split(" ").slice(2).join(" ");
    if(!reason) return message.reply("you need to enter a reason");
    if (!user) return message.reply ("you need to enter an ID");
    let modlog = message.guild.channels.find("name", "bans");


    message.guild.unban(user);

    const unbanembed = new Discord.RichEmbed()
        .setColor(0xd9a744)
        .setAuthor('Unbanned ' + user)
        .setTimestamp()
        .addField("Unban information", '**Unbanned user: **' + user + '\n**Moderator: **' + message.author);
    if(modlog) modlog.send(unbanembed)
    console.log(`${user} got unbanned by ${message.author.tag} in ${message.channel.name}`)
    client.channels.get("586350574057029652").send(`${message.author.tag} Used the "unban" command`);
  }```
slim heart
#

Show ur full actual error

earnest phoenix
#

  }

  ^


SyntaxError: missing ) after argument list

    at new Script (vm.js:80:7)

    at createScript (vm.js:274:10)

    at Object.runInThisContext (vm.js:326:10)

    at Module._compile (internal/modules/cjs/loader.js:664:28)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)

    at Module.load (internal/modules/cjs/loader.js:600:32)

    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)

    at Function.Module._load (internal/modules/cjs/loader.js:531:3)

    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)

    at startup (internal/bootstrap/node.js:283:19)

slim heart
#

This is a syntax error you can debut yourself

#

Look at line 266

earnest phoenix
#

ok

#

now what

slim heart
#

Fix it

earnest phoenix
#

ohh that was the thing

#

ok i fixed it

#

but when i do unban it dont unban the user

#

oh so now thats the error

#

(node:8205) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 31 ready listeners added. Use emitter.setMaxListeners() to increase limit

#

jesus christ

#

you don't have to create a new handler for each command

#

do it all in one handler

split hazel
#

oh my

dusky marsh
#

Where do people get the idea that you have to create a listener for each command

split hazel
#

god knows

dusky marsh
#

I've never seen a tutorial or anything that does that

frail ocean
#

If you do have errors, it would first recommend if they are frequent to follow a tutorial, as chances are they would be able to assist or you could follow their method which is usually easier and also more people would use it.

mossy vine
#

@dusky marsh they dont know it any better

grim narwhal
#

Anyone know about this error?

Traceback (most recent call last):
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\ptvsd_launcher.py", line 43, in <module>
main(ptvsdArgs)
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd_main_.py", line 434, in main
run()
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd_main_.py", line 296, in run_file
setup_connection()
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd_main_.py", line 284, in setup_connection
if not daemon.wait_for_launch(addr):
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd\runner.py", line 61, in wait_for_launch
_, start_session = self.start_client(addr)
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd\daemon.py", line 217, in start_client
connect(client, addr)
File "c:\Users\qbwvw.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd\socket.py", line 197, in connect
sock.connect(addr)
TimeoutError: [WinError 10060]

i'm using python and IDE is VS code

inner jewel
#

TimeoutError: [WinError 10060]

grim narwhal
#

yea.. i don't know how can handle that.

#

it is just didn't connect with discord bot?

earnest phoenix
#
    member.ban()
          try{
           member.send("**Vous avez été banni car vous êtes sur la liste noire du bot pour la raison suivante : __" + motif_msg + "__. Pour plus d'informations, rejoignez ce serveur :  **")
           } catch(e) {
             return
           }
    } catch(e) {
       console.log(`impossible de ban un blacklist.`)
   }``` 

it's say `cannot send message to this user` but i have put an try !?
grim narwhal
#

@inner jewel How can i solve this problem?

frail ocean
#

It means you can't send a message to that user (DMs closed most likely) and that it has logged the error in the catch block.

earnest phoenix
#

ok thx$

inner jewel
#

it didn't log in the catch

#

send is async

#

try-catch is sync

#

send() returns before the message is sent

#

so there's no way to catch that error

#

unless you await it

frail ocean
#

Mhm.

inner jewel
#

or use .catch

grim narwhal
earnest phoenix
#

Yeah @inner jewel xD

#

I have right to use this : try { member.guild.owner.send("") } catch(e) { }

inner jewel
#

still won't work

earnest phoenix
#

hy ?

#

why

inner jewel
#

you need to await it or call .catch() on the promise returned by send

west spoke
#

^

earnest phoenix
#

ok

west spoke
#

Also send message before banning

grim narwhal
#

any1 know how can solve this error "TimeoutError: [WinError 10060]" ?

west spoke
#

google

inner jewel
#

and the message sending/banning is a race condition

#

it might send the message or it might not

west spoke
#

^

#

Try the send too

#

And catch

#

pass

#

Then. An

#

ban

inner jewel
#

send(...).finally(() => ban())

west spoke
#

^

#

Essentially ig

earnest phoenix
#

bot goes online and offline

spare goblet
#

Is it sending an error or is it just going online and offline and repeat?

warm flame
#

you gotta give people more than that

#

like where you host

#

and library

#

and stuff

spare goblet
warm flame
#

i know you already host on glitch

#

so that in its self is its own problem

#

but someone should be able to help

frail ocean
#

I think I know the issue

west spoke
#

Go to glitch help center and request new IP

spare goblet
#

Does it go back online itself? Or does it just randomly go offline

frail ocean
#

@earnest phoenix How long does the loop take? Does it take 5 mins to go offline?

spare goblet
#

Honestly don't even know your issue so hard to resolve mmLol

frail ocean
#

As glitch projects shutdown after 5mins if they are not pinged.

slender thistle
#

No details provided

frail ocean
#

And they come online as soon as you open the glitch page associated to it.

west spoke
#

creates script to ping project every minute

frail ocean
#

But in the future include details.

#

Cough Uptime Robot does that, it's a free website.

spare goblet
#

Every 4 mins will suffice but

you asked about this earlier already. You can loop a function to self-ping it using setInterval and a 3rd party ping-er as it'll shut down itself in 12h of continuous running

earnest phoenix
#

    at Promise (/rbd/pnpm-volume/4479fb6b-4973-4a2c-82ce-7d5fbe829ed0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/rest/RESTMethods.js:34:54)

    at new Promise (<anonymous>)

    at RESTMethods.login (/rbd/pnpm-volume/4479fb6b-4973-4a2c-82ce-7d5fbe829ed0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/rest/RESTMethods.js:33:12)

    at Client.login (/rbd/pnpm-volume/4479fb6b-4973-4a2c-82ce-7d5fbe829ed0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/Client.js:280:30)

at Object.<anonymous> (/app/index.js:584:8)

    at Module._compile (internal/modules/cjs/loader.js:701:30)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)

    at Module.load (internal/modules/cjs/loader.js:600:32)

    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)

    at Function.Module._load (internal/modules/cjs/loader.js:531:3)

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

(node:20350) [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.```
spare goblet
#

You gave an invalid token

frail ocean
#

Best bit about Uptime Robot which I use which was recommended on here I believe was that if it detects it's offline it'll ping it until it comes back online or if it can't, it will email you.

spare goblet
#

Go to Discord Bot Developer Page thingy and grab new token

earnest phoenix
#

oh u mean the loop thing

#

i have it at 1500

spare goblet
#

1500 is way too much

frail ocean
#

Either: you had a space in your token or what iara said. I would recommend resetting the token and re-doing it as sometimes there is an issue on my side.

lament meteor
#

tell me ur project doesnt restart everytime you edit the code

spare goblet
#

ping per 1500ms is way too much i mean

earnest phoenix
#

i have settimeout 1500

#

is that y its doing what its doing

frail ocean
#

I would ping 600000ms (10min) at the quickest.

earnest phoenix
#

so the bot would turn off every 10 minutes

spare goblet
#

would do it every 4 mins. 1500ms means it pings once every 1.5 seconds which is too quickly.

#

do setInterval

frail ocean
#

Or an easier method would be use a third-party method.

spare goblet
#

with my testing bots I do third-party and internal loops

#

cuz uptimerobot has been down in the past

#

Regardless, your token is wrong so generate a new one

frail ocean
#

True but I mean I host 4 or so bots on Uptime Robot and I have had no complaints of it being down.

#

Of course have a fail safe ready but.

earnest phoenix
#

i did settimeout 60000

#

it restarts still every second

frail ocean
#

do setInterval like iara said

earnest phoenix
#

replace timeout with interval

split hazel
#

Yes

earnest phoenix
#

ok

split hazel
#

That'll work

frail ocean
#

Have you sorted out the token issue first? That is more important..

earnest phoenix
#

Yes

frail ocean
#

Ok, so is there another reason why it is contently restarting? Are you editing the code? Have you got it set in the settings that each edit restarts the app?

earnest phoenix
#

No

split hazel
#

What are you hosting on? Self hosting or possibly on glitch

earnest phoenix
#

glitch

frail ocean
#

Glitch I believe Speedy.

#

When did it start frantically restarting itself?

split hazel
#

Glitch restarts the bot as soon as theres an edit to code

earnest phoenix
#

Today

split hazel
#

Unless you add a special file

frail ocean
#

@split hazel You can disable that though, and apparently Enzo has.

earnest phoenix
#

I added unban command

frail ocean
#

Anything else?

earnest phoenix
#

And it don't work

split hazel
#

Do you have a watch.json file

frail ocean
#

Is there an error in the code at all?

earnest phoenix
#

Ofc

#

No

#

glitch blacklisted a lot of ip

split hazel
#

Indeed

#

Discord banned every glitch host yesterday, but its still recovering

frail ocean
#

Not true, my bot wasn't affected.

earnest phoenix
#

Oh

#

Not on every bot

spare goblet
#

There's a way to make it not refresh per edit without watch json

#

Just edit it in settings

#

Of glitch

earnest phoenix
#

Ok

split hazel
#

@earnest phoenix could you go into the glitch console and run curl -I https://discordapp.com/api/v7/gateway and tell us what happens

frail ocean
#

@earnest phoenix When you are on your page, click on the project title at the top, then look at the settings and UNTICK "Refresh App on Changes" see if that helps.

#

Please update us when you have so we know if we have helped you. 😃

earnest phoenix
#

ok gotchu

split hazel
#

The command will let us know that your bot isn't on a banned host

frail ocean
#

@earnest phoenix Worked? 🙂

earnest phoenix
#

didnt do it yet

frail ocean
#

Alright, let us know when you did.

#

I am pretty sure it will work.

earnest phoenix
#
Date: Sat, 22 Jun 2019 18:17:55 GMT
Content-Type: application/json
Content-Length: 35
Connection: keep-alive
Set-Cookie: __cfduid=d0552afd001471c4d92420a08e643bb801561227475; expires=Sun, 21-Jun-20 18:17:55 GMT; path=/; domain=.discordapp.com; HttpOnly
Strict-Transport-Security: max-age=31536000; includeSubDomains
Via: 1.1 google
Alt-Svc: clear
CF-Cache-Status: HIT
Expires: Sat, 22 Jun 2019 18:47:55 GMT
Cache-Control: public, max-age=1800
Accept-Ranges: bytes
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 4eb038c8ce04246c-IAD

split hazel
#

That can be excluded, your host isn't banned.

frail ocean
#

Now try my thing, turning that setting off.

earnest phoenix
#

uhh how

fiery stream
#

Lmao

frail ocean
#

By doing what I said above Enzo

spare goblet
#

He said this earlier:

When you are on your page, click on the project title at the top, then look at the settings and UNTICK "Refresh App on Changes" see if that helps.

earnest phoenix
#

ok

fiery stream
#

You guys are doing so good job to keep your mod

earnest phoenix
#

IM DONE

#

IM FU****G done

#

the bot is still broken

split hazel
#

What is happening specifically

#

And also what library you using

earnest phoenix
#

@earnest phoenix maybe glitch connection

#

discord js

split hazel
#

That can't be the issue, One of my bots that are on Glitch work fine

earnest phoenix
#

So i figured out how to make the bot say from who is the message for the dm command, and it works!

#

but i still get an error

#

like this one

#
(node:11600) 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:11600) [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.
#

but it works

#

is confusing

split hazel
#

Are you showing the full error?

earnest phoenix
#

imma try self hosting it

spare goblet
#

Send full error

#

You only sent the bottom bit

split hazel
#

@earnest phoenix Add this to your bots code above the ready event
client.on('debug', event => console.info(event))

#

And paste everything that logs onto pastebin or something

slender thistle
#

I can see a missing )

frail ocean
#

And send the link here.

split hazel
#

the first thing that gets logged is your token, so make sure to hide it before giving us a link

earnest phoenix
#
(node:11600) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
    at item.request.gen.end (C:\Users\Dany\Desktop\DiscordBot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15)
    at then (C:\Users\Dany\Desktop\DiscordBot\node_modules\snekfetch\src\index.js:215:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:11600) 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:11600) [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.
#

this is it

#

i got a error

#

with putting the debug

split hazel
#

What error?

#

And also try my edited one, i missed a )
(thanks @slender thistle )

earnest phoenix
#

unexpected token client

#

client.on('debug', event => console.info(event)
client.on("ready", () => {

#

it's confusing cuz it works but it still sends an error

frail ocean
#

You missed an )

split hazel
#

What did you define your client as?

frail ocean
#

After (event).

spare goblet
#

@earnest phoenix You're running a method towards a message that wasn't resolved

split hazel
#

oh yeah

#

try my edited code

frail ocean
#

It should be:

client.on('debug', event => console.info(event)) client.on("ready", () => {

split hazel
#

client.on('debug', event => console.info(event))

earnest phoenix
#

ok

frail ocean
#

Cough thats why we don't spoonfeed and why you shouldn't copy and paste code and always check it xd.

split hazel
west spoke
#

pfft

#

I find stuff for py rewrite and redo it for async all the time

#

I'm used to translating it

earnest phoenix
#

writing my own code?????? are you crazy??!?!

split hazel
#

No we are not.

west spoke
#

nope

earnest phoenix
#

I spent some time figuring out how to send the author's username too :P

#

its still online

west spoke
split hazel
#

You should read the libs docs, it's very useful.

west spoke
#

bruh

earnest phoenix
#

i know that

frail ocean
#

@earnest phoenix Did it work then? 😃

split hazel
#

@west spoke username

west spoke
#

nien

earnest phoenix
#

message.member.username

#

didn't know where to put it

#

yes

frail ocean
#

I would use message.author.tag tbh tho.

#

@earnest phoenix Your welcome! Enjoy. 😃

spare goblet
#

@earnest phoenix You can't do that I think it has to be user prop

earnest phoenix
#

no

#

You can

#

it is something like this

      case 'dm':
            if (!message.member.hasPermission("ADMINISTRATOR")) return message.channel.sendMessage('❌  ***Nu ai permisiuni bos***  ❌ ')
            msg = message.content.toLowerCase();

            if (message.author.bot) return;
            if (!args[1]) return message.channel.send('ce? cine? cui?');

            mention = message.mentions.users.first();

            message.delete();
            mentionMessage = `From ${message.author.username}:` + args.join(' ').slice(24);
            mention.send(mentionMessage);
            message.author.send ('sent!');


        break;
spare goblet
earnest phoenix
#

if its not in dm you can

#

and yes, i'm that kind of a noob

#

member its a guild member

frail ocean
#

@earnest phoenix Try it? If an error then send it here 😃

earnest phoenix
#

i tried it

#

it works

spare goblet
#

No you can't @earnest phoenix

earnest phoenix
#

but still sends an error

#

uwu

#

permissions don't exist dms and you can't delete other user's message

earnest phoenix
#

@earnest phoenix what error

#

iarapls

#

(node:11600) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
at item.request.gen.end (C:\Users\Dany\Desktop\DiscordBot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15)
at then (C:\Users\Dany\Desktop\DiscordBot\node_modules\snekfetch\src\index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:11600) 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:11600) [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.

spare goblet
#

You can only do message.member.user.tag xd

earnest phoenix
#

its the sameee

split hazel
#

If the error isn't useful, you can do some self debugging, like logging 1, 2 etc at each part of code to see where it stops

spare goblet
earnest phoenix
#

yeaaaah

spare goblet
#

Guildmember and user is not the same hon

frail ocean
#

@earnest phoenix It means there is an unknown message, as Speedy said try sections of the code.

split hazel
#

@earnest phoenix This means either the message doesn't exist or you're not fetching from the channel the message was in

earnest phoenix
#

@spare goblet yes i'm dumb

#

iara told me about running a method towards a message that wasn't resolved

spare goblet
#

You're not pandasad

split hazel
#

now excuse y'all i need to get my bots code ready for sharding 🙂

earnest phoenix
#

I fixed it guys, I just replaced message.author.username with message.author.tag

#

:D

#

Thanks for everything

frail ocean
#

No problem 😃

#

I made that mistake once, and usually the tag is a better all-round thing.

atomic tangle
#

twst

tardy bolt
#

Can you guys make noob of the year contest if not it's ok

warm flame
#

no and wrong channel

tardy bolt
#

Ok

split hazel
#

If i get a guild property via broadcast eval from another shard, can i then use <guild>.members.get(id) without any issues?
(discord.js)

earnest phoenix
#

anyone know how to do webhook

split hazel
#

For DBL api webhook, move to #topgg-api @earnest phoenix

#

@earnest phoenix Whatcha mean exactly?

earnest phoenix
#

ok

pale marsh
#

Webhooks

#

The easiest solution that came to my mind. Send a discord webhook POST request

split lantern
#

Easiest would be to use a webhook but its guild channel only, for dms you need a back end

pale marsh
#

Yeah

#

It's gonna be sent to a channel though, not DM's like plasma said

split hazel
#

create a webhook for the specific channel, get the url and get a module that allows you to send json data via post and your json data will be "msg": (whatever you wanna send to webhook, but for an embed its a little trickier

pale marsh
#

Go to a channel and create a webhook

#

Yup what speedy said

split hazel
#

and then send the post request to the webhook

split lantern
#

Did you create the contact form?

#

So go to the part where it sends the email

#

and replace that with the discord webhook post request

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

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

let member1 = currentTeamMembers1[0];
let savoir = message.guild.roles.find(`name`, "Savoir");
        if(!savoir) {
            try {
              savoir = await message.guild.createRole({
                name: "Savoir",
                color: "#1240cf",
                permissions:[]
                });
                message.guild.channels.forEach(async (channel, id) => {
                  channel.overwritePermissions(savoir, {});});
            }catch(e){console.log(e.stack)}
        }
        member1.addRole(savoir)
        //for(var i = 0; i < currentTeamMembers1.length; i++){member1.member.addRole(savoir)}
}

Error: addRole is not a function
Can u help me?

#

(currentTeamMembers1 is a global araylist)

slim heart
#

what is it filled with?

#

ids or actual member objects?

plucky sun
#

<@id>

slim heart
#

thats not an object that doesnt have the .addRole function

#

id suggest filling the array with normal ids (not the <@...>)

#

and then doing message.guild.members.get(member1).addRole(etc..)

mossy vine
#

and also passing functions to .find

slim heart
#

that too, itll work but eventually its gonna leave deprecation

plucky sun
#

Ok i try...

#

Ok its work ty :-)

royal fog
#

@slim heart hey hello

#

of the bot arabic

#

np?

warm flame
#

please don't randomly ping people

slim heart
#

im also completely lost what you just said

royal fog
#

?

earnest phoenix
#

he ask if arabic bot is allowed i think @slim heart

warm flame
#

in that case yes they are

slim heart
#

i mean yea sure

warm flame
#

but they need to have some form of entry for english people via some help command

obsidian star
#

hi

#

bunker code

slim heart
#

??

west spoke
earnest phoenix
#

@solid spear can you fix something on your bot?

#

@earnest phoenix

#

k

split hazel
#

On discord.js is there a way to see if a specific shard is online?

vague chasm
#

readthedocs?

slim heart
#

you can broadcastEval, reconnecting/disconnected ws props

grim aspen
#

i mean for reading the docs

split hazel
#

aha! client.status

misty pawn
#

Did the DBL API change?
My bots count no longer updates....

slim heart
#

it takes a while

#

it wont be instant

misty pawn
#

Like.... 4+ days?

slim heart
#

no. has it taken that long?

misty pawn
#

It is at 1763 on the site

#

My bot is on 1770 right now

slim heart
#

hm, so its been those 4 days

misty pawn
#

More a week apparently

#

Sharding wouldn't be the issue right?

#

I use a Java wrapper and only provide the total count

slim heart
#

shouldnt be? did u shard when this happened?

#

because you can supply shard and server count

#

via [shard0servercount, shard1servercount, etc.]

misty pawn
#

I can't say what the issue would be....

#

I blame the wrapper tbh

slim heart
#

i dont think so, but it could be,

#

you can always make posts your self i guess?

misty pawn
#

yeah

#

But right now I have a seperate issue where the bot only performs an update once and then just.... dies

slim heart
#

(go ahead and supply your stuff, someone else should come by and help, i gtg and eat sorry :p)

untold umbra
#

Anyone here

warm flame
#

if you have a question its better to just ask and wait for someone to help

quick dune
#

does anyone know how i can get my bot online, cause i did node . but id didnt send back anything

quick dune
#

nvm it wroked

spare goblet
#

congrats

west spoke
#

you can but depending on how you use it it can be p broke

#

Its allowed

#

I use it, others use it

#

Mine?

#

Tbh my webpage isnt comete

#

No

#

It's a webkit animation

#

Movements

#

just moves the image around

#

Wdym

quaint latch
#

hmmm

earnest phoenix
#

hmm?

earnest spear
#

hey guy's i'm trying to run a simple java program with vsc, but I get the following error:
Error: Could not find or load main class .\HelloWorld
and here's the code:

class HelloWorld
{
    public static void main(String args[])
    {
        System.out.println("Hello, World");
    }
}

these are the commands I run to run my java program:
javac HelloWorld.java; and
java HelloWorld

sinful lotus
#

it mans it cant find the main class

#

probably a wrong configuration

earnest spear
#

anyway to correct my configuration? does this have anything to do with my operating system

#

i just downloaded the latest updates from the java site... maybe i need to download the JDK too?

inner jewel
#

i ran the same commands and it's working just fine

sinful lotus
#

Cant answer that tbh, I dont use vsc for java

inner jewel
earnest spear
#

i really like working with python, but recently i've been interested to develop skills in java/c++ recently

#

i'm downloading the latest JDK

#

let's see if this helps

#

has anyone worked with x86 assembler

#

must be something to do with my OS. i'll download the latest JDK and update you guys...

sinful lotus
#

if you want you can try developing java apps on intellij

#

intellij helped me a lot in my developing process

earnest spear
#

nah the update didn't help 😦 i'm very used to VSC and i love its hotkeys is there anyway i can make it work with VSC...

#

actually it doesn't even work on PowerShell lol

sinful lotus
#

Im not sure why if thats the case then. goumen sad

#

usually intelli j detects stuff that went wrong

peak quail
#

how can i get the name of the highest role that the user have

#

🤔

late hill
#

library?

peak quail
#

?

late hill
#

Which library do you use

#

👀

peak quail
#

oh xD

#

js

late hill
#

discord.js

#

?

peak quail
#

yes

late hill
#

guilds have a roles property

#

which returns all roles

#

Those roles have a calculatedPosition

#

Don't know if the highest or the lowest would be 0

#

Go test stuff with it

spare goblet
#

Lowest is 0

#

Highest will be the highest number in position

late hill
#

^then filter out the highest one

spare goblet
#

so just grab the guildMember object, grab roles of them and find the highest for the position blueyay

peak quail
#

eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee xD

#

so what i need too type ? xD

spare goblet
#

sorry hon we can't spoonfeed you. but basically you'll have to insert a guildMember object, and one of the properties are roles (i.e. guildMember.roles) and then filter the role with highest number by position

digital sparrow
#

C++ library?

spare goblet
#

There aren't any libs for discord really maintained for c++ from my knowledge

digital sparrow
#

f

#

y

spare goblet
#

uh idk. most people use js or py

digital sparrow
#

ik

cursive dagger
earnest spear
#

ok so i ran the same java program on my desktop and it works fine!

#

but on my laptop, it doesn't

#

i have no idea why...

cursive dagger
#

error?

earnest spear
#

so on my laptop, i'm trying to run a simple HelloWorld.java program and it reads error! cannot find main method to run the program

#

but on my desktop, that same program works fine with no errors

earnest phoenix
#

Hi, I can create two guildMemberAdd events ?

spare goblet
#

Yeah you can but I don't suggest it?

earnest phoenix
#

why ?

spare goblet
#

you can always put more than one listener for something :') but it's not recommended cuz it creates messy code

earnest phoenix
#

But if Not, can I?

spare goblet
#

As I said beforehand, it's possible, but it's not recommended personally

earnest phoenix
#

ok

spare goblet
#

You can always just put a function under the current ones in your already created event listener

cunning oxide
#

Why would you want to create two?

mossy vine
#

^

#

theres no reason for 2

earnest phoenix
#

To have an event with message otherwise I lost a little

spare goblet
#

lost what?

earnest phoenix
#

I'm losing my sense of code, etc.

spare goblet
#

pandasad i'm confused

#

but you do you

cunning oxide
#

Ok - best practice here: create one event for each single event you wanna listen for. Run the functions within those event listeners, if you need to, write them outside the file and just declare then call it.

earnest phoenix
#

but this not fonctionnaly :

if(!db.get("raid_mode").find({ serveur : server }).value()) {
	return
} else {
	try {
		member.kick()
		try {
			member.send("**test**")
			} catch(e) {
				return
			} 
			} catch(e) {
				return
			} 
	}
#

@cunning oxide

cunning oxide
#

“Serveur:”

#

Is that intentional?

#

I can barely see tbh

spare goblet
#

no need to ping, they're already replying

i'm not sure what it's doing, lowkey

#

are you getting an error ?

cunning oxide
#

Ya my guy that code will never work lol

earnest phoenix
#

no

earnest spear
#

serveur ?...

#

french? 😉

earnest phoenix
#

yes

earnest spear
#

ça va :3

cunning oxide
#

Sorry, I’ve been on planes for 20 hours

earnest phoenix
#

Ah ui xD

cunning oxide
spare goblet
#

all those try, catches... i'm out blobsmilesweat

earnest spear
#

😂

spare goblet
earnest phoenix
#

i love catch xD

mossy vine
#

okay first of all, what the fuck is that code
second, thats not how you catch promises

earnest spear
#

i love French! 😃

mossy vine
#

i feel like you were told that at least 3 times yesterday

cunning oxide
#

@mossy vine said it, not me!

spare goblet
mossy vine
#

eh, some people just never listen

earnest spear
#

what? i'm not doing anything

#

i'm just saying i love a language

spare goblet
earnest phoenix
#

I'll be fine.

earnest spear
#

i did ask a question about development above

cunning oxide
spare goblet
#

and talking about development, not languages blobsmilesweat

earnest spear
#

about the java programming

earnest phoenix
#

@earnest spear chut

spare goblet
#

just resolve the promise Vinx

cunning oxide
#

Vinx, try reading more about promises and whatnot.

#

Will prove very useful.

earnest spear
#

you could also try the ES6 async and await for promise handling

#

instead of using .then etc. but both work!!

earnest phoenix
#

in async

spare goblet
#

in that case use async/await

frail ocean
#

Mhm.

earnest phoenix
#

quick q, can you do js .catch().then()

#

basically what i'm doing is checking if the invite is valid

#
let invite = bot.fetchInvite(obj.pinv).catch(() => {
        return msg.channel.send(':no_entry: Your invite is invalid.');
      });```
#

and if its not valid it throws an error

#

and if its valid it does coder below

#

ugh stupid question

#

cuz it finds the invite only after it executes the code below, aka it doesn't look iftheres an error instantly

mossy vine
#

i think promises let you do that

earnest phoenix
#

what am i saying rn

#

so i can .catch().then() ?

mossy vine
#

i think so

#

if the promise fails it will do the catch callback, if it resolves it will do the then callback

earnest phoenix
#

it still damn executes code below 😭

mossy vine
#
var p1 = new Promise(function(resolve, reject) {
  resolve('Success');
});

p1.then(function(value) {
  console.log(value); // "Success!"
  throw new Error('oh, no!');
}).catch(function(e) {
  console.log(e.message); // "oh, no!"
}).then(function(){
  console.log('after a catch the chain is restored');
}, function () {
  console.log('Not fired due to the catch');
});

// The following behaves the same as above
p1.then(function(value) {
  console.log(value); // "Success!"
  return Promise.reject('oh, no!');
}).catch(function(e) {
  console.log(e); // "oh, no!"
}).then(function(){
  console.log('after a catch the chain is restored');
}, function () {
  console.log('Not fired due to the catch');
});```
#

actually can you chain them like that

earnest phoenix
mossy vine
#

lemme try it out

earnest phoenix
#

wait .then has two funcs?

#

like

#

.then(a, b)

#

wutt

mossy vine
#

im confused about that as well, lemme get the docs

earnest phoenix
#

uh ok

mossy vine
#
p.then(onFulfilled[, onRejected]);

p.then((value) => {
  // fulfillment
}, (reason) => {
  // rejection
});```
#

OH

#

SO THATS HOW IT DOES THAT

earnest phoenix
#

OHHHHHHHHHHHHH

#

but wait what

mossy vine
#

lemme make an example

earnest phoenix
#

does that mean js .catch().then(catch has no error, catch has error)?

mossy vine
#

one sec, im trying out something

earnest phoenix
#

ok

mossy vine
#

ah i see

#
p = new Promise((resolve, reject) => {
    resolve('e')
})

p.then(res => {
    console.log(`Resolved with: ${res}`)
}, rej => {
    console.log(`Rejected with: ${rej}`)
})
#

the res callback is triggered if the promise is resolved, the rej callback is triggered if the promise is rejected

earnest phoenix
#

yeah what

mossy vine
#

the code above is the same as this

#
p = new Promise((resolve, reject) => {
    reject('e')
})

p.then(res => {
    console.log(`Resolved with: ${res}`)
}).catch(rej => {
    console.log(`Rejected with ${rej}`)
})
earnest phoenix
#

i think i got it

#

one sec testing

mossy vine
#

if you were to use .catch().then(), it would execute the then block IF the catch fires AS WELL

#

which is pretty useless

#

as you can just put the code in the .catch() anyways

#

and that is why both of your responses fired in your original code

earnest phoenix
#

hmm

#

time for trial and error

mossy vine
#

in the example .then().catch() would the catch callback only fire if the then callback throws an error?

#

lemme try it out

earnest phoenix
#

yay i got it

#

.then only executes if the catch after it doesn't give an error

mossy vine
#

yes

#

wait what

#

ok at least its working

earnest phoenix
#

i thought i had to catch first so if it does, .then wouldn't execute

#

lmao

mossy vine
#

and i was right, if you do .then().catch() then the catch block will execute if the promise rejects OR then block throws error

spare goblet
#

it doesnt matter the order, .then().catch() is same as .catch().then() i think 👀 oop i'm wrong apparently o-o

mossy vine
#

no

#

we just discussed that it isnt

#

and i just provided examples why it isnt

spare goblet
#

i see 👀

mossy vine
#

if you want to do thing a if promise resolves and thing b if promise rejects, then .then() with 2 callbacks seems to be the best option

graceful mist
#

When will my bot get aproval??

mossy vine
#

takes about a week

#

you added your bot 3 minutes ago

#

wait AT LEAST 7 days before asking again

covert turtleBOT
copper crystal
#

Is it possible to manually move a server to another shard?

earnest phoenix
#

no

lofty bane
#

h

#

hi guys

#

please i wanna help

mossy vine
#

if you have a question just ask it

slender thistle
#

yeetask2ask

covert turtleBOT
#

By asking if you can ask a question, you have already asked a question so simply just ask the actual question. State exactly what the problem is so someone can help you as soon as possible.

lofty bane
#

yea please

#

i have this

#
2019-06-23T09:21:03.398697+00:00 heroku[web.1]: State changed from starting to crashed
2019-06-23T09:21:03.236796+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2019-06-23T09:21:03.236849+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-06-23T09:21:03.374571+00:00 heroku[web.1]: Process exited with status 137
#

what it mean

mossy vine
#

okay first of all, you are using deprecated things

lofty bane
#

like ?

#

Packages ?

#

or heroku ?

mossy vine
#

second, is there any other error that isnt you using a function in a deprecated way?

lofty bane
#

no

mossy vine
#

did you trying search the error on google "heroku web process failed to bind to $PORT within 60 seconds of launch"?

lofty bane
#

oh

#

no i will try this

#

didnt get the answer

mossy vine
bleak vortex
#

how do I setup shards for my bot?

mossy vine
#

@bleak vortex are you using discord.js?

bleak vortex
#

yes'

mossy vine
bleak vortex
#

¨thanks

desert musk
#

help me

bleak vortex
restive night
#

anyone now why when I playFile(), my .mp3 file not fully playing? I mean like 90% of full length.
its like the sound fading out at the end. and theres no error. im using discord.js btw

cursive dagger
#

Code?

earnest phoenix
#

oof

frail ocean
#

@restive night

#

]]moreinfo

covert turtleBOT
#

Please provide as much information as possible to get the most efficient assistance as soon as possible; state the library, language, the specific part of the code in question, and what you are trying to do and/or what you think may be causing the error.

frail ocean
#

Code, and what you think the error is.

#

Is there a return that could of tripped? Is there an error? Is there a timer?

#

Probably is if it cuts out at the same place all the times

restive night
#

const dispatcher = connection.playFile(`./soundboard/${sound}.mp3` , { volume: 0.5, passes: 3 });

frail ocean
#

What about more of the code?

restive night
#

var sound = args[0];

        if (!vc)
            return message.channel.send(`**${message.author.username}, you have to be in voice channel to use this command.**`);

   const connection = await vc.join();

            const dispatcher = connection.playFile(`./soundboard/${sound}.mp3` , {
  volume: 0.5,
  passes: 3
});```
frail ocean
#

Is there anything below that?

restive night
#

no, just that

frail ocean
#

Is the file all correct?

restive night
#

and this error when the sound is playing
(node:8013) [DEP0112] DeprecationWarning: Socket.prototype._handle is deprecated

#

file is correct, sounds playing

#

but not full length

frail ocean
#

Is your bot doing anything else?

#

Does it stop at the same time all the time?

restive night
#

whats that mean of doing anything else?

#

yes its like fading out at the end

frail ocean
#

Like is there an error in the code somewhere else that could make it restart?

#

I got to quickly go for lunch, I will be back in 15-20 minutes otherwise someone else could help you here.

restive night
#

no, the bot not restarting

#

ok, thanks for your time

chrome olive
#
        readdir(cmdPath, (err, files) => {
            if (err) console.error(err);

            files.forEach(cmd => {
                const command = new (require(`../commands/${cmd}`))(this);

                this.commands.set(command.info.name, command);
                command.info.aliases.forEach(al => this.aliases.set(al, command.info.name));
            });
        });
opaque eagle
#

How does the Command class look like

chrome olive
#
module.exports = class Command {
    constructor (client, options) {
        this.client = client;
        this.cooldown = new Set();

        this.info = {
            name: options.name || undefined,
            aliases: options.aliases || [],
            description: options.description || "No description specified!",
            usage: options.usage || "",
            category: options.category || "general",
            requirements: { 
                cooldown: options.cooldown || null,
                userPerm: options.userPerm || "SEND_MESSAGES",
                clientPerm: options.clientPerm || "SEND_MESSAGES",
                guildOnly: options.guildOnly || false,
            }
        }
    }

    startCooldown (user) {
        this.cooldown.add(user);
        
        setTimeout(() => {
            this.cooldown.delete(user);
        }, this.info.cooldown);
    }
}
tribal violet
#

Hii

frail ocean
#

👀

#

What did I just see?

#

Who keeps posting a bit of code and deleting.

#

You can edit it right? @tribal violet

tribal violet
#

@frail ocean how can i send coloured message?

frail ocean
#

Wait.

#
```JS
#

So

tribal violet
#

hii

frail ocean
#

You do 3 "" and then a JS on the first line after the 3 ""s

tribal violet
#
    constructor (client, options) {
        this.client = client;
        this.cooldown = new Set();

        this.info = {
            name: options.name || undefined,
            aliases: options.aliases || [],
            description: options.description || "No description specified!",
            usage: options.usage || "",
            category: options.category || "general",
            requirements: { 
                cooldown: options.cooldown || null,
                userPerm: options.userPerm || "SEND_MESSAGES",
                clientPerm: options.clientPerm || "SEND_MESSAGES",
                guildOnly: options.guildOnly || false,
            }
        }
    }

    startCooldown (user) {
        this.cooldown.add(user);
        
        setTimeout(() => {
            this.cooldown.delete(user);
        }, this.info.cooldown);
    }
}```
#

but no colour is coming

frail ocean
#

Copy and use that format

tribal violet
#

@frail ocean Thabs

#

Thanks brpo

frail ocean
#

No problem. 😃

tribal violet
#
Hii
#
Hii ```
frail ocean
#

Only works for JS code tho.

tribal violet
#

ohh

#

Bro

#

Can you join my server and do some help for my bot

#

@frail ocean My Bot is not working

frail ocean
#

You can ask for help here!

covert turtleBOT
#

Please provide as much information as possible to get the most efficient assistance as soon as possible; state the library, language, the specific part of the code in question, and what you are trying to do and/or what you think may be causing the error.

tribal violet
#

@frail ocean Can you help me

frail ocean
#

Read the embed ^

tribal violet
#

Can you please join my server

#

and fix my bobt

#

bot

#

because you are a developer

frail ocean
#

State the issues here.

tribal violet
#

Can you edit a welcomer bot for me

#

can you give me some codes

frail ocean
#

Use the documentations online and tutorials but we don't spoonfeed (rule 7a)

tribal violet
#

ohh

latent oasis
#

if (!message.member.hasPermission("MANAGE_CHANNELS") || message.author.id !== '282504799897780225')
but when i use command it says that i dont have perms to do it

spare goblet
#

your code is saying:
if the member who is typing the command doesn't have manage channels or their user id isn't 282504799897780225, then ...

#

whats the function it runs after ?

latent oasis
#

i need to check
if user not have MANAGE_CHANNELS perms and he/she is not me
send message => no perms to do it

spare goblet
#

then it should be &&

slim heart
#

You have to use && cuz unless both those permissions are true it won’t work

spare goblet
#

not ||

latent oasis
#

oh

spare goblet
#

|| means or
&& means and

latent oasis
#

no

spare goblet
#

what ?

latent oasis
stray garnet
#

How can i do the Streaming Status for my Bot? Its Not working for me

slim heart
#

You need to provide a legitimate streaming link

spare goblet
stray garnet
#

@slim heart Ok

slim heart
split hazel
#

@stray garnet You using discord.js?

stray garnet
#

Yes @split hazel

split hazel
#

client.user.setActivity(`some status text after streaming`, { type: 'STREAMING' }); @stray garnet

#

Optionally, if you wish to have your bots streaming status to have a link to a legitemate stream, include one in the url property

spare goblet
#

@split hazel All of them have to have legitimate stream or else it won't work 👀

slim heart
#

^^

#

I’m dming you and you’re ignoring me but

#

@stray garnet we apologize for the mix up, disregard this sorry. You have to use the url option in order for it to register as Streaming ...

stray garnet
#

Ok

#

Np thx

split hazel
#

Optional

slim heart
#

Speedy it is not

#

Dm me and stop talking in here

spare goblet
#

It's not optional, trust me blobsmilesweat (not for streaming its not)

split hazel
#

Didn't include url and it works flawlessly

slim heart
#

SPEEDY stop arguing here, go to my DMs

amber fractal
#

Or you could just look at the docs

cunning oxide
#

speedy why does tht embed look so good

slim heart
#

@amber fractal shh, we already solved this, url is required periodt

split hazel
#

I probably have a little older d.js version

earnest phoenix
#

the url needs to be a twitch url, d.js probably sets the url to twitch's url internally by default

stray garnet
#

how can i do a command for Staff only?

spice mango
#

Someone is using Discordgo Library and knows if they rate limit calls for changing the status?

earnest phoenix
#

ratelimits are dynamic, they don't have a specific value

#

and there's a ratelimit for everything

west spoke
#

WHOMSTTHEFUCK

#

@earnest phoenix why

amber fractal
#

@west spoke Wrong channel bud

west spoke
#

Nah