#development

1 messages Β· Page 477 of 1

lusty dew
#

oof

#

Ok

#

I just didn't want to have to make

#

separate commands

tulip snow
#

Well depends actually

#

I think its possible

#
client.on('message', async message => { 
    if (message.author.bot)return;
  if (message.content.startsWith(prefix) && message.channel.type !== "text")return mesage.reply("Please use my commands in a server");                                                 
  if(!message.content.startsWith(prefix))return; 
  let messageArray = message.content.split(" ");
  let cmd = messageArray[0];
  let args = messageArray.slice(1);
  let commandfile = client.commands.get(cmd.slice(prefix.length));
  if(commandfile) commandfile.run(client,message,args); 

if(cmd === `{prefix}list`){
return
}

if(cmd === `{prefix}time`){
return
}

if(cmd === `{prefix}convert`){
return
}







});
``` In your main file @lusty dew
west raptor
#

Why return a message in dms

lusty dew
#

I have a command handler

earnest phoenix
#

you need a $ before thos {}

tulip snow
#

Yeah ik lol

earnest phoenix
#

lol

tulip snow
#

Im on phone

#

So its difficult

lusty dew
#

You wrote that up fast on a phone

#

o>o

leaden gyro
#

alot of things are difficult on the mobile version of discord

lusty dew
#

Meh

#

Everything ok for me

#

just the typing

#

is horrible

leaden gyro
#

ikr?

lusty dew
#

I misspell words all the time

leaden gyro
#

^^

lusty dew
#

I use command handler thouhg :/

#

I will just create

tulip snow
#

So can somone show me how to set a channel for like logging?

sick cloud
#

get a database

tulip snow
sick cloud
#

setup a table

#

and stuff

#

add guild records

#

add a command to edit them

#

profit

leaden gyro
#

@tulip snow for logging of anything in general or what?

sick cloud
#

i just answered their question @leaden gyro

#

no need to continue it

sly compass
#

Hallo

#

Leave

idle mountain
#

wot

wanton sphinx
#

For djs what is the event for when a bot joins a server

bright spear
#

i see you were helped in the djs server

wanton sphinx
#

ye

steel drum
#

GuildCreate or something

#

Check doucmentation

bright spear
#

someone already helped them

tulip snow
#

How do you write to JSON file using fs like this

{
"dm": "off"
}
bright spear
#

json files are known to get corrupted when editing with fs @tulip snow

lusty dew
bitter sundial
#

@bright spear depends on the usage, if you use it as a database that's frequently accessed, yeah, but if it's a simple save of settings that's written to rarely then it would be fine to use json

earnest phoenix
#

is it guildMemberRemove

bright spear
#

?

earnest phoenix
#

for when a member leaves

#

yes

earnest phoenix
#
    if (construction == true) msg.channel.send("Sorry Kayo is under construction.")```
how do I get this to not let anything happen after it
uneven rover
#

Return it

    if (construction === true) { 
return msg.channel.send("Sorry Kayo is under construction.")
} else {
//The rest of your command handler
} ```
steel drum
#

or

#

you can ust do what he did

#

the else is not needed

#

when you return the msg, the function is exited

uneven rover
#

I indicated the else, to remind her to put it above the cmd handler xD

wide ruin
#
if(message.member.hasPermission("ADMINISTRATOR"))``` does this work?
#

d.js

uneven rover
#

It should work, the question would be "how will you make it work for"

steel drum
#

do you mean

#

how would you implement it

uneven rover
#

Nice

#

That should explain it better xD

#

I like this, I learn as well

wide ruin
#

no

#

i know how it works

#

manage_messages works, but i just wanted to know about that one

steel drum
#

discord.js has a list of all permissions

#

if its in that

wide ruin
#

it is

steel drum
#

it will work with hasPermission

wide ruin
#

where can i find the list?

steel drum
#

so you should have no isue using

#

check documentation

wide ruin
#

ah

#

found it

earnest phoenix
#

KK do you love me ?

#

im have bug on
https://discordapp.com/developers/applications/

#

this token is change automatic when i Restart the page

earnest phoenix
#

part of the token is a timestamp. it will change every time you refresh no matter what

#

How to make it constant does not change

#

you don't

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

module.exports.run = async (bot, message, args) => {
  let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
    let usericon = message.rUser.iconURL;
    const mentionID = rUser.id;
    let serverembed = new Discord.RichEmbed()
    .setDescription("User Information")
    .setColor("#00ff00")
    .setThumbnail(usericon)
    .addField("User Name", message.rUser.tag)
    .addField("User ID", mentionID)

    return message.channel.send(serverembed);
}

module.exports.help = {
    name: "userinfo"
}``` does the user name field work?
earnest phoenix
#

as long as the first and third parts don't change you're fine

#

does message.rUser exist?

wide ruin
#

its a let at the top

earnest phoenix
#

no, you have rUser at the top

#

you're trying to access message.rUser

wide ruin
#

what should it be then?

earnest phoenix
#

just rUser?

wide ruin
#

and is usericon right?

earnest phoenix
#

you tell me

wide ruin
#

it doesnt

#

the bot says nothing

#

ok

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

module.exports.run = async (bot, message, args) => {
  let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
    let usericon = rUser.iconURL;
    const mentionID = rUser.id;
    let serverembed = new Discord.RichEmbed()
    .setDescription("User Information")
    .setColor("#00ff00")
    .setThumbnail(usericon)
    .addField("User Name", rUser)
    .addField("User ID", mentionID)

    return message.channel.send(serverembed);
}

module.exports.help = {
    name: "userinfo"
}``` it doesnt send the usericon
#

in discord.js

#

pls help

quartz kindle
#

isnt it avatarURL?

wide ruin
#

is ```js

.setThumbnail(message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0])))``` better?

#

@quartz kindle

earnest phoenix
frigid bone
#

Your token is invalid

#

That what "Incorrect login details were provided" usually means..

earnest phoenix
#

IKNOW.

#

IM HAVE BUG ON SITE

#

token is change automatic when i Restart the page

frigid bone
#

uhhhh don't share your token in public

earnest phoenix
#

-_-

#

change your account password

#

@frigid bone he is change

#

log out of discord on site

#

check if it's still changing

#

@earnest phoenix ok i will do it now

frigid bone
#

It was already said above that the token constantly changes

#

Can you show me how you log into your client with the token?

earnest phoenix
#

the part that's changing for him shouldn't be

#

doubt it's a site bug though. probably more user error

#

still changing

gleaming glen
#

it always changes when u refresh

#

@earnest phoenix

#

just re generate it and use that

wild tide
#

it says under the token it resets when your refresh the page or generate a new token?

#

or was that on the old developer portal

#

idk but it was/is there

earnest phoenix
#

the auth part of his token is regenerating

wild tide
#

oh

#

Thats normal

earnest phoenix
#

no it's not

#

the timestamp is the part that changes

wild tide
#

is for me

earnest phoenix
#

the auth part only changes on regeneration

wild tide
#

and he's regenerating it

earnest phoenix
#

wait did they change how it all works

#

it didn't used to change but now it is

wild tide
#

I think so

earnest phoenix
#

i haven't had to regenerate or even look at my token in like a year

#

i guess the auth part does change on reload now

wild tide
#

you should see if discord said something about it on the support website or in a blog post

#

highly likely they did

earnest phoenix
#

@earnest phoenix it changing seems to be working as intended. your bot not being able to log in is likely user error

wild tide
#

did he send a snippet of his bot login code?

earnest phoenix
#

@earnest phoenix im test make new bot but he is bug

#

i think this bug on my account

wild tide
#

if you are concerned about it send discord a tweet @discordapp

#

womp

earnest phoenix
#

im do it

#

are you testing the new app on heroku

#

or are you testing it locally

#

yah

#

which

#

but im test make new account discord

#

and make bot

#

the new account work

#

but my account not work

#

are you testing on heroku or locally

#

yas i do

wild tide
#

your account is most likely not defective, its just either how you coded the bot/hosted the bot

#

your bot may be refreshing the token

earnest phoenix
#

"yes" is not a valid answer to a this or that question

#

IM BAD IN ENGLISH -_-

#

if you're doing the testing on heroku, other than it being a bad service for bot hosting, it may be causing a problem

#

try running your bot from your pc with a freshly regenerated token

#

hmmmm

#

@earnest phoenix im running bot on my pc and have error in token xDDDD fuck man

#

inb4 your api access was revoked for tos abuse mmLol

wide ruin
#

can music commands for .js be found in the docs?

wild tide
#

commands can't, they are built by YOU, and the documentation does not talk too much on music, its quite vague on the music part

earnest phoenix
#

@earnest phoenix much as I know, it’s normal

#

When you refresh the page, the token changes. However, any previously generated tokens will still be working perfectly unless you press the β€œregenerate” button

upper ember
#

how do I get server creation date with JDA?

bright spear
#

@wide ruin if you're using discord.js: https://discord.js.org/#/docs/main/stable/topics/voice

#

FYI always mention what lib you're using.

earnest phoenix
bright spear
#

Can you explain? I don't get what you're trying to do

earnest phoenix
#

Im trying to change the metadata on an mp3 file

#

so an mp3 player can read it

wide ruin
#
const Discord = require("discord.js");
const { RichEmbed } = require('discord.js')
module.exports.run = async (bot, message, args) => {
    
    let reportschannel = message.guild.channels.find(486167748205084694);
  
  message.reportschannel.send(args)
  
  
  
}
    
module.exports.help = {
    name: "report"
}``` will this send a message in reportschannel?
#

discord.js

oblique sequoia
#

idk try it and see

topaz fjord
#

It will not

wide ruin
#

it did not work

#

what do i do?

topaz fjord
#

The I'd has to be a string

#

And it's just reportschannel.send

wide ruin
#

let reportschannel = message.guild.channels.find("486167748205084694");?

topaz fjord
#

Yez

#

Yes

wide ruin
#

thanks

topaz fjord
#

Remember reportschannel.send()

wide ruin
#

reportschannel.send(args) or message.reportschannel.send(args)

#

@topaz fjord

topaz fjord
#

1st one

wide ruin
#

thanks

#
const Discord = require("discord.js");
const { RichEmbed } = require('discord.js')
module.exports.run = async (bot, message, args) => {
    
    let reportschannel = message.guild.channels.find("486167748205084694");
  
   reportschannel.send(args)
  
  let helpEmbedsub1 = new RichEmbed()
    .setTitle("Successful")
    .setColor(0x00ff00)
    .addField(message.author, args, true);
    
  
}
    
module.exports.help = {
    name: "report"
}```
#

thats what i have

topaz fjord
#

ok?

wide ruin
#

but nothing sent

topaz fjord
#

wait

#

Is report channel in every guild

#

Or in one server

wide ruin
#

one server

#

i want all reports to go there

west raptor
#

just get the channel

topaz fjord
#

then it should be bot.channels.get("Id")

west raptor
#

^

topaz fjord
#

If .get doesn't work use .find

wide ruin
#

it worked,

#

but got no "successful"

#

@topaz fjord

west raptor
#

because you never sent the embed

topaz fjord
#

lmfao

fast crescent
#

s

bright spear
#

Can you just learn your lib pls

ruby dust
#

not just lib, but the whole lang

bright spear
#

Well it looks like it could be valid js

earnest phoenix
#

-_-

#

every night i will dreem 😦

slate kayak
#

are there any .py here ?

slender thistle
#

Yes

wide flicker
#

Hello all. I'm looking for a bot to get patch notes for an app on Google Play and the App Store.

rustic axle
wide flicker
#

@rustic axle that's not a bot or directions on how to make a bot post patch notes to my discord. Also I dont own the app..

earnest phoenix
#

lmao its an API for google play. so it probably has a way to get app patch notes

topaz fjord
#

Afaik there aren't any bots that do that yet

#

may be wrong

wide flicker
#

@earnest phoenix I'm not familiar with APIs.

#

@topaz fjord ok

bright spear
#

recyclingbin thought you wanted to make your own bot @wide flicker

earnest phoenix
#

^ considering you posted in the bot development channel

bright spear
#

well they posted it in #topgg-api first and someone told them to come here lol

earnest phoenix
#

wew

wide flicker
#

Do you think I could use mee6 to grab the patch notes? @earnest phoenix yea @west raptor told me to post that here

bright spear
#

@wide flicker no mee6 doesnt have that

#

as turtle said, its unlikely someone already made a bot for that

#

your best bet is finding some api and making your own bot

wide flicker
#

Ok.. yea I've looked everywhere. What is api?

#

Also what is a webhook?

wide ruin
#
const args = message.content.slice(config.prefix).trim().split(/ +/g);```
#

how do i make it all appear on one line

#

d.js

#

do i just remove .split(/ +/g)

west raptor
#

why pong

wide ruin
#

wdym

#

i just need it all on 1 line

bright spear
#

??

#

thats an array

#

it doesnt have lines

#

@wide flicker an api is an application programming interface

#

basically a way for you to make a program that connects to a service

west raptor
#

huh oh, i thought he wanted to make a bot to grab patch notes

#

my bad

bright spear
#

a webhook is basically just a POST request to an endpoint

#

first you need to learn how to code tho

#

also google is good

wide flicker
#

Would it be possible for a webhook to get the patch notes from the apps Google Play direct URL when they get updated?

bright spear
#

well

wide ruin
#

@bright spear how can I change it to a string?

bright spear
#

@wide ruin just use message.content

#

please learn js

wide ruin
#

const args = message.content

#

Just that?

bright spear
#

@wide flicker you can probably just get the page content and check the patch notes, however you might not be able to know when it gets updated

#

@wide ruin uh try this? i dont really know how your code works but js message.content.slice(config.prefix).trim()

#

and please learn js and stop asking dumb questions about your own code

wide flicker
#

Ok so the webhook wouldnt update as the URL does? I really dont have years to learn code lol I just need patchbot for mobile

bright spear
#

if you want to know instantly you'll need to see if google and apple provide apis for that

#

but i dont think they do

topaz fjord
#

I don't think they make that stuff public

wide flicker
#

No it's only for the developer of the app

topaz fjord
#

ok?

#

well ofc the dev of the app will have access to it

wide flicker
#

So it's safe to say it isnt possible? Because I dont have any solutions. Not sure what steps I'd need to take

#

My goal is to get the patch notes for all platforms of the game.

tulip snow
#

Can somone fix this for me? ```js
dmfile["dm"] = {
dmfile : "off"
};

        fs.writeFile("DM.json", JSON.stringify(dmfile), (err) => {
            message.channel.send("Restart DMS are now Off");
            if (err) console.log(err)
          });
Its writing ```json
{"dm":{"dmfile":"off"}}

Instead of ```json
{"dm": "off"}

ruby talon
#

Hey.
My bot still responds to bots but I used this code to prevent it.

async def on_message(message):
    if message.author.bot:
        return
    await bot.process_commands(message)

The code doesn't work as the bot still responds.

~~ ~~ INFO ~~ ~~
langleague: python
libary: discord.py
bot: @ruby siren
~~ ~~

slender thistle
#

Is @bot.event there

ruby talon
#

nope blobfacepalm

slender thistle
#

rip

ruby talon
#

I'm supid

#

xD

tulip snow
#

Could somone answer my question lol

ruby talon
#

@tulip snow what lib?

tulip snow
#

D.js

ruby talon
#

include that in your message

#

πŸ˜‰

topaz fjord
#

afaik you can do

#

dmfile["dm"] = "off"

earnest phoenix
#

i mean:

 dmfile["dm"] = {
                 dmfile : "off"
            };

means you have:

dmfile = { dm : { dmfile: off }}
#

so its writing the correct thing

#

u just dont understand objects mmLol

ruby talon
#

@slender thistle ty, doesn't respond to bots now :DDDDDDDD

slender thistle
#

πŸ‘Œ

earnest phoenix
#

How would I make it so that a member has to react to a message to obtain a role?

rustic axle
#

If you are using js of

#

c

#

use one of the ones that says reaction in them

earnest phoenix
#

I don't know what I want to use, all I want to do is make a simple moderation bot.

rustic axle
#

discord.js

#

if you are new to coding

#

or discord

#

or anything really

#

or .py if you like python better

#

or C# if you are insane

daring chasm
#

πŸ˜ƒ

west raptor
#

or make your own lib

rustic axle
#

hahaha funny man

#

now stop joking

west raptor
#

ok

rustic axle
#

oh fuck thats why my shit isnt working...

#

135 verbose stack Error: EINVAL: invalid argument, read 135 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\gentle-fs\lib\rm.js:245:7 135 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\iferr\index.js:13:50 135 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18 135 verbose stack at FSReqWrap.oncomplete (fs.js:153:5)

#

hold on while I uninstall node.js while running my bot off of it

icy scroll
#

(node:7108) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open './autorole.json'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:348:35)
at Object.module.exports.run (/root/bot/SbireBot/commandes/autorole.js:10:34)
at Client.bot.on (/root/bot/SbireBot/index.js:83:31)
at Client.emit (events.js:182:13)
at MessageCreateHandler.handle (/root/bot/SbireBot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/root/bot/SbireBot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/root/bot/SbireBot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/root/bot/SbireBot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/root/bot/SbireBot/node_modules/ws/lib/event-target.js:120:16)
(node:7108) 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: 1)
(node:7108) [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.

#

Plz me help

bright spear
#

@icy scroll it says autorole.json doesnt exist...

west raptor
#

also code block

bright spear
#

yes pls

#

```code```

west raptor
#

^

icy scroll
#

Okay How tout install it ?

#

To*

west raptor
#

uh

icy scroll
#

#google traduction πŸ˜‚πŸ€£

west raptor
#

you dont install it, you make the file

icy scroll
#

Ah yes ok uh... I'm beginner πŸ˜…

west raptor
#

its fine

icy scroll
#

???

#

What ?

#

You can help me tout create the file πŸ˜…

#

Pkz

#

Plz*

rustic axle
#

well

#

what is it anyways

#

its not like we have the code here

#

its not like npm install

#

you have to write the actual code

wide flicker
#

Could I get some help setting up a webhook?

ruby dust
#

what webhook?

wide flicker
#

I want to get the updates from a website where the developers post updates for an app. They said I could use we webhooks to do it

earnest phoenix
#

how do I do command timeouts

wide ruin
#

How do you view the servers a bot is in (d.js)?

earnest phoenix
#

The number of guilds?

#

@wide ruin

wide ruin
#

The names of the guilds

#

I had a different idea

#

It logs new ones instead

frigid bone
#

client.guilds.map(guild => guild .name) should get you an array of the names of the guilds your bot is in

#

And yes, a Guild object is pased on the guildCreate event

#

Whose name is accessible

earnest phoenix
#
      let args = msg.content.split(" ").slice(1).join(' ')
      if (!msg.member.voiceChannel) return msg.channel.send("Error: Please connect to a VC.");
      if (msg.guild.me.voiceChannel) return msg.channel.send("Error: I'm already playing a song in a differant VC.");
      if (!args[0]) return msg.channel.send("Please tell me a link to play!")
      let validate = await ytdl.validateURL(args[0]);
      if (!validate) return msg.channel.send("Please only tell me a URL to play!")
      let info = await ytdl.getInfo(args[0]);
      let connection = await msg.member.voiceChannel.join();
      let dispatcher = await connection.play(ytdl(args[0], { filter: 'audioonly' }));
      msg.channel.send(`Now playing: ${info.title}`)
    },```
spring ember
#

args is not an array

#

you joined it to a string

#

so

#

you might want to call args and not args[0]

#

@earnest phoenix

earnest phoenix
#

on all of them

spring ember
#

yes

#

and you should just make a command handler

earnest phoenix
#

Error: FFMPEG not found

#

@spring ember

bright spear
#

did u install ffmpeg?

spring ember
#

πŸ‘€

bright spear
#

i mean, these error messages are pretty self explanatory

spring ember
#

And/or imported it

earnest phoenix
#

yeah I'm not good with music

split lantern
#

npm i ffmpeg wont work

earnest phoenix
#

how do I import it

split lantern
earnest phoenix
#

I've installed ffpmeg

bright spear
#

btw

earnest phoenix
#

i think

bright spear
#

you'll get better performance if you use d.js v12 without ffmpeg

earnest phoenix
#

it dont say I need to install it

bright spear
#

New to v12 is the ability to play OggOpus and WebmOpus streams with much better performance by skipping out Ffmpeg.

earnest phoenix
#

how update

#

install discord.js

split lantern
#

Did u restart ur pc after installing ffmpeg

ruby dust
#

I forgot what was the way in d.py to catch someone connecting/disconnecting from a voice channel?

sick cloud
#

@ruby dust you might have some kind of voice state update event

#

discord.js has VoiceStateChange iirc

earnest phoenix
#
      ^```
#
    host: 'api.exchangeratesapi.io',
    path: `/latest?base=${base1}`
}```
#

Why cant I use a variable in my path?

sick cloud
#
"/latest?base=" + base1

just try that

#

or encode

#

(encoding is probs better)

#
encodeURIComponent(`/latest?base=${base1}`)```
ruby dust
#

I guess that is possible by checking before/after member objects in on_member_uptime event

#

uptime?

#

update

#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

sick cloud
#

lol

earnest phoenix
#

lol

#
<html>
^

SyntaxError: Unexpected token < in JSON at position 0```
#

when I have

#
    host: 'api.exchangeratesapi.io',
    path: encodeURIComponent(`/latest?base=${base1}`)
    ```
sick cloud
#

thats the lib

#

not your code

earnest phoenix
#

riperoni

#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

sick cloud
#

try snekfetch or something

#

far easier

earnest phoenix
#

lol

#

I love redoing my code

sick cloud
#

you mean breaking

knotty steeple
#

snekfetch is depreciated

wicked summit
#

Yeah

#

But u still can use it

knotty steeple
#

but its recommended you dont

bright spear
#

use jaczfetch then

#

a fork of snekfetch

earnest phoenix
#

Is there any way to change metadata on an mp3 file? kinda like the album and artist ect?

#

yes

gusty rune
#

cant use links in <iframe> ?
just brings blank page

topaz fjord
#

you can

#

but the link must be https

bright spear
#

works for me on your bot page @gusty rune

gusty rune
#

i mean like the join

#

at the bottom

#

join discord

bright spear
#

oh

#

you cant put discord in an iframe

#

you'll need to open it in a new tab

gusty rune
#

Ah

#

kk

#

thx

tulip snow
earnest phoenix
#

Hello

#

im make music bot but he some time crashed when i say <-play Hello> but if me say < -play link > he it work any help ?

#

this code

#

@tulip snow you not chose the languge whe you make app

rustic axle
#

@tulip snow make sure the worker is set to node.js

earnest phoenix
#

just make new app

rustic axle
#

If you are using js

tulip snow
#

wait now its working

rustic axle
#

/shrug

bright spear
#

@earnest phoenix i bet you didnt make any code to search youtube

#

also pls stop spamming your question everywhere

earnest phoenix
#

hmmmm

rustic axle
bright spear
#

lol

rustic axle
#

And why are all of the bots saying I have been editing my messages?

#

Wtf

#

Eh whatever

bright spear
#

iirc it triggers an edit event when it loads the link preview

rustic axle
#

Oh ye

earnest phoenix
#

I NEED HELP in a lanuage i dont know

#

what language

#

js

#

whats up

#

i need to use 1 simple code for after effects

#

i think after effects use js right?

#

yeh it does

#

so i want the audio to "wiggle" from the left to the right channel

#

can't you use keyframes

#

with audio balance

#

it will take me years

#

lmaoo aight

#

sec

#

Okay so, the wiggle expression can be used for audio by convert audio to keyframes and then paste the resulting keyframes into the wiggle control property

#

i think?

#

take a look at this from like 13 years ago. hopefully it's still relevant

#

well, i know how to wiggle audio , but what i'm saying is i want the left channel lets say go up by 1db and the right channel goes down by 1db then the right channel goes up by 2 db then the left channel goes down by 1 db

#

ohh.

#

so like wiggle the 2 channels seperatly

#

idk how to do that other than keyframes

#

dont you code js

#

i do yes but im not experienced in writing stuff for after effects

#

i got it

night bridge
#

this one have a very very noob question

#

what opposite of (A === B)?

earnest phoenix
#

A !== B

night bridge
#

oh we can do that?!

#

thanks!

wintry quest
idle mountain
#

Just put ` around the text?

#

ohh

#

do "`" + credentials.botId + "`"

wintry quest
#

ah ty ty

idle mountain
#

np

bright spear
#

You can also do ```
\${credentials.botId}``

frosty path
#

hi

wild tide
#

hi

frosty path
#

Hurrah im now a developer

wild tide
#

to pass the test, tell me what being a developer means

idle mountain
#

oh yeah I keep forgetting that ` is a thing in JavaScript truebingLUL

frosty path
#

It's not just someone who can write code, its some one who understands how to build software

wild tide
#

lol

#

you are

#

right

#

lol

frosty path
#

lol

#

Which bot di you make?

#

.join

idle mountain
#

this is development, guys bing3

frosty path
#

.prefix +

idle mountain
frosty path
#

ok

wild tide
#

on the other hand, is there a way that ytdl-core can play a set youtube url, rather than requiring a user input? I know I sound really dumb lmao but im not sure

frosty path
#

Just save the url in a var and use that instead of usere input

#

Check this out

#

.stack discord.js api

#

o

#

I searches stack overflow

earnest phoenix
#

How can I make the bot's server count and member list display in its playing status?

warped ruin
#

Which lib @earnest phoenix

earnest phoenix
#

discord.js

wintry quest
#

.addField ("Primary Profession",JSON.stringify(body.professions.primary[0].name + body.professions.primary[0].rank), true) How would I make anything past the "+" fall onto a line below it? Can't use \n and such obvs.

idle mountain
#

what is JSON.stringify(body.professions.primary[0].name + body.professions.primary[0].rank) supposed to output?

wintry quest
#

it's wow's api

#

brings up current profession + rank

#

works

#

just wanna make format a little nicer thonk

idle mountain
#

still not sure I completely understand so I'm taking a shot in the dark here but

#

would this work: JSON.stringify(body.professions.primary[0].name) + "\n" + JSON.stringify(body.professions.primary[0].rank)

#

?

wintry quest
#

it sure did

idle mountain
#

cool beans Yee

earnest phoenix
#

-_-

#

now how this tall me -_-

topaz fjord
#

ok

#

Also you shouldn't be putting this in development

earnest phoenix
#

-_-

wild tide
#

wrong channel

earnest phoenix
#

ok im just ask rhis help good or bad ?

topaz fjord
#

yes?

wild tide
#

um

topaz fjord
#

but I wouldn't dm

wild tide
#

I don't know arabic though

#

kinda hard to read, ya know

earnest phoenix
#

.setFooter(`Total Banned Users : ${client.ban.size}`) how would i get the number of bans from a server?

quartz kindle
loud cedar
#

How do i scrape a dynamic website with PhantomJS? It just scrapes it like a static one

quartz kindle
#

phantomjs is not being developed anymore

#

try zombie

livid whale
#

RangeError: You need to provide a client to bind to, either in the constructor of dblposter or in the bind function!

night imp
#

Relevant code plz

#

ie dblposter

livid whale
#

DBLPoster.bind(bot.guilds.size);

#

it is wrong ??

quartz kindle
#

show the rest of the code, the require, and the new dblposter

livid whale
#
const DBLPoster = new dbl(`api`);

DBLPoster.bind(bot.guilds.size);```
#

i type api which i get from DBL website

quartz kindle
#

then you're missing the client in the new dbl()

livid whale
#

ya i didn't type ,client

#

it work now

mystic harness
#

Hey, sorry for this post if it seems obvious. I'm new with node.js but understanding more but wanted to see how you would go about this. Say you wanted to welcome user with channel.send(`Welcome to the server, ${member}. Please visit #roles to assign a role.`); but you wanted the #roles to be a clickable channel. Is it possible?

earnest phoenix
#

you can do it like

channel.send(`Welcome to the server, ${member}. Please visit ${msg.channel.guild.channels.get(channelId)} to assign a role.`);
mystic harness
#

Ah thanks! I was quite close then. I had tried the same but ${msg.channel.get(channelId)}

sick cloud
#

@mystic harness use <#id>

earnest phoenix
#

oh, right, it also works...

#
  if(message.author.bot) return;
  if(message.channel.type === "dm") return;

  let prefix = "-";
  let messageArray = message.content.split (" ");
  let cmd = messageArray[0];
  let args = messageArray.slice(1);



if(cmd === `${prefix}8ball`){


if(!args[1]) return message.reply("Please ask a full question!");
let replies = ["Yes", "No.", "I don't know.", "Ask again later plez."];

  let result = Math.floor((Math.random() * replies.length));
  let question = args.slice(1).join(" ");

  let ballembed = new Discord.RichEmbed ()
  .setAuthor(message.author.tag)
  .setColor("#FF9900")
  .addField("Question", question)
  .addField("Answer", replies[result]);

  message.channel.send(ballembed);
}
});```
#

why this code not work >?

sullen path
#

πŸ€”

earnest phoenix
#

Imma get ips

sullen path
#

I saw that link

mystic harness
#

Thanks @sick cloud

sick cloud
#

πŸ‘Œ

#

@earnest phoenix what errors

earnest phoenix
#

IDK

#

he not work

night imp
#

You need to specify embed

#

({embed: ballembed})

#

For the send function

#

@earnest phoenix

earnest phoenix
#

@night imp i will try ty

night imp
#

If it was just named embed then you could just say embed

#

because it will just use the key and value

#

es20something

earnest phoenix
#

I want a code of my bot that can dm announcements to my server members

#

Can anyone of you help me with this?

lament meteor
#

if it sends to all members at once it will hit the ratelimit

#

and that is BAD

tiny lodge
#

What's wrong with just mentioning everyone to make an announcement?

#

100% less api spam

lament meteor
#

^

earnest phoenix
#

They dont see

#

They just mark them as read

#

And i want to learn it as well

tiny lodge
#

if people ignore your announcements api spam won't help Β―_(ツ)_/Β―

slender thistle
#

Won't they just open the DM and close it at this point?

#

That literally won't do anything

earnest phoenix
#

I said i also want to learn it

#

if you mass DM your bot will het ratelimited, could be banned and it will be annoying

heady zinc
#

then again it won't be ratelimited

earnest phoenix
#

if people ignore ur announcements then blobshrug

heady zinc
#

pmuch all noob-friendly libs will prevent you from reaching the ratelimit

earnest phoenix
#

i mean you wont exceed it

heady zinc
#

so it is fine but still api spam in practice

marble elm
#

whats the element for the vote button?

earnest phoenix
#

right click > inspect element

lament meteor
#

class='votebutton'

earnest phoenix
#

Make sure to like comment and SMASH that vote button

steel drum
#

im looking to convert a integer such as 60000 into 60 mins

#

what would be the best approach to doing something such as that ?

quartz kindle
#

60000*60 = 3600000 (60 minutes in milliseconds)

ruby dust
#

in discord.py in on_voice_state_update, the before and after are the equivalent of channel objects?

#

nvm I can't read docs properly

inner spruce
#

Is there a way too loop through this data without knowing what abc, abcd, !test etc is?

#

I am using js

shy rose
#

@inner spruce Object.values(myVariable)

inner spruce
#

ty

earnest phoenix
#

how do i send a locale image with a embed? im using eris

ruby dust
#

local image?

#

as you can see

#

the image structure of the embed can only pass urls

solid cliff
#

Can have a local image with an embed by uploading the image and in the embed of that message would have image url of attachment://imagename.png lurk

earnest phoenix
#

Yeah thanks!

gusty rune
#

how can i change the scroll bar

#

in iframe

#

if these is anyway

knotty steeple
#

change it on the website

#

that is being iframed

#

i think

gusty rune
#

okay

earnest phoenix
#

how i can back my bot now ?

ruby dust
#

what

dapper fiber
#

Does anyone know how to make a bot online 24/7 for free?

knotty steeple
#

glitch

#

or

#

heroku

#

at the cost of shitty specs and other stuff

barren brook
#

How do you make a music command?

earnest phoenix
#

you make it

barren brook
#

Ik bot idk howto get the music

#

But

earnest phoenix
#

you follow a tutorial

#

or

#

look here

#
barren brook
#

Ok

earnest phoenix
#

there are a lot tutorial on how to make a bot in js

barren brook
#

Ok

#

Thanks I’ll go do that

earnest phoenix
#

alright

sour grove
#

mongoDB or MySQL ?

steel drum
#

id say MySQL

#

i personally use a mariaDB server

topaz fjord
#

mongodb is good for big data

wide ruin
#
const Discord = require("discord.js");
const { RichEmbed } = require('discord.js')

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

 const success = new RichEmbed()
           .setTitle(`Cleared ${args[0]} messages!`)
           .setColor(0x00ff00)
 if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.reply("You don't have the required permission to use this command!");
  if(args[0] < 1) return message.channel.send("Amount must be larger than 0!");
  if(!args[0]) return message.channel.bulkDelete(10).then(
      message.channel.send("No amount specified, deleted 10 messages by default!")).then(() => {
        message.channel.send(`Cleared 10 messages!`).then(msg => msg.delete(5000))});
    message.channel.bulkDelete(args[0]).then(() => {
        message.channel.send(success).then(msg => msg.delete(5000));
  if(args[0] > 100) return message.channel.send("${args[0] <== 100")
      message.channel.bulkDelete(100).then(msg => msg.delete(5000));
    });
}

module.exports.help = {
    name: "purge"
}``` this deletes loads of messages after the .then bits
knotty steeple
#

why did you have to require discord.js twice

wide ruin
#

Reasons

#

Idk

west raptor
#

just require it once

knotty steeple
#

bulkDelete returns a promise? Thonk

topaz fjord
#

there is no good explanation for requiring it twice

wide ruin
#

Can I just have help with the fact it deletes loads please

topaz fjord
#

wrll ofc it does

#

lmfao

#

also

wide ruin
#

Apparently it works now

heady zinc
#

why wouldn't it return a promise lmfao

topaz fjord
#

you will need to parseInt args

wide ruin
#

Ok

topaz fjord
#

bc args[0] is a string

#

you cant compare a string to a number

knotty steeple
#

idk @heady zinc

topaz fjord
heady zinc
#

uh

#

im psure you can tho

topaz fjord
#

u can for what

#

@heady zinc

heady zinc
#

comparing strings to number

topaz fjord
#

wait

#

tf

heady zinc
#

javascript performs type conversion

topaz fjord
#

i totally knew that

heady zinc
#

i mean it's normal to not know that

#

because any sane language wouldn't do that

topaz fjord
#

i parseInt as a habit

heady zinc
#

but this is javascript fireduck

topaz fjord
knotty steeple
#

javascript is cool like that

topaz fjord
knotty steeple
#

tf

#

go is fuckin' weird

topaz fjord
#

its not

knotty steeple
#

it is

topaz fjord
#

its just that part looks weird to u

knotty steeple
#

no go is very weird

#

also

topaz fjord
#

no

knotty steeple
#

whats chan interface

#

tf

topaz fjord
#

channel

#

you can make a channel that is type inteface

#

you can pass that in to a function

knotty steeple
topaz fjord
#

and load the channel in the function

heady zinc
#

you know why go is weird

#

there's a clear reason why go is weird

topaz fjord
#

why

heady zinc
#

As much as no sane language would allow comparisons between strings and numbers, no sane language would chose this as mascott

topaz fjord
#

inb4 because its made by google

#

@heady zinc actually they would

heady zinc
#

holy fuck

#

that's so disgusting

#

im never gonna learn go now that's for sure

knotty steeple
#

yes

#

it is

topaz fjord
#

its not

#

: (

heady zinc
#

it's so fucking disgusting it's even worse than turtles

#

can you even believe that

#

i never thought i'd see the day

topaz fjord
#

its so cute

#

stop bullying the golang gopher

terse badger
#

imagine being so depressive that you actually have hatred for a mascot

#

pretty depressing tbh

#

@knotty steeple so go is weird because you dont get pretty basic types such as interfaces?

#

god i feel sorry for the developer world if its being taken over by js devs with no knowledge of a basic type system

knotty steeple
#

wew

quartz kindle
#

too late, the entire world runs on dependencies

terse badger
#

left-pad.js

quartz kindle
#

require("improved-oxygen-particle-physics-and-breathing-system")

terse badger
#

who creates a language and is like "implicit global variables? that sounds like a great idea!"

#

this scope is also unecessarily badly designed

#

its so bad some of the most hailed people in the community abandoned it because they got sick of it

quartz kindle
#

what would be the correct way to have globals?

terse badger
#

explicit

quartz kindle
#

guess they just made it "simpler"

terse badger
#

its abused

#

block scope in js is terrible

knotty steeple
#

i heard you can use pm2 with python

#

how Thonk

topaz fjord
#

google mmLol

knotty steeple
#

no

terse badger
#

its a language so badly designed that the ECMA are having to add new constructs to it to try fix it, but they cant replace the old ones because it would break too many websites

topaz fjord
#

yes

knotty steeple
#

smh

quartz kindle
#

well, despite being badly designed, it still works nicely for most people, and does what they want it to do

#

same with php

terse badger
#

like php, because of bad design decisions and low barrier to entry, its got a load of terrible devs and terrible code out there

#

and the ecosystem as a whole has suffered as a result

#

that being said, its slowly getting to a better state

quartz kindle
#

but it made it simpler and more accessible, creating more devs, cheaper websites and cheaper workforce

terse badger
#

at what cost

#

and how is a cheaper workforce better for you as a developer

quartz kindle
#

not for me

#

but good for corporations

#

lul

terse badger
#

why would you care lmao

quartz kindle
#

hence why they push these languages

terse badger
#

i pushed to have js replaced with ts at the company i work

quartz kindle
#

typescript?

terse badger
#

yea

knotty steeple
#

typescript wew

quartz kindle
#

isnt that just a compiler?

knotty steeple
#

no

terse badger
#

typescript is transpiled to javascript

quartz kindle
#

^

knotty steeple
#

o

#

ok

terse badger
#

its got a nice configurably strict type system

#

no more of that shit of type x doesnt have property y

quartz kindle
#

basically it helps code better by pointing out issues that regular js doesnt care about

terse badger
#

regular js does care about it

#

it just doesnt tell you until it dies

#

unless youre gonna suggest that js will pull attributes out if its ass if it doesnt find one on a type

quartz kindle
#

well im not an expert, so i never faced any of those issues

terse badger
#

no one never comes across issues dealing with the type system in a dynamically, weakly typed language

#

not at a decently large scale for sure

#

theres a reason a lot of larger js projects are migrating or already use typescript

#

vscode, vuejs etc etc

quartz kindle
#

i dont even use arrow functions

#

lul

terse badger
#

why wouldnt you though

knotty steeple
#

sometimes i do mmLol

terse badger
#

arrow functions are great

quartz kindle
#

im used to regular functions, and they work, so why change

terse badger
#

because they actually preserve the scope of this

#

theres a reason they were added

quartz kindle
#

i dont use this either, except if using jquery

terse badger
#

then it sounds very much like you havent worked with a codebase of any half decent size :p

#

either that or god bless the company you work/will work for

quartz kindle
#

i dont work

#

im self taught, own boss

terse badger
#

im also self taught

#

doesnt mean i wont go work for others

quartz kindle
#

i could work as a contractor, but i have my hands full with my own project

terse badger
#

working hasnt stopped me from havingmultiple projects

#

Β―_(ツ)_/Β―

#

you sound a lot like the kinda guy whose codebase i had to take over

#

implicit global abuse, no arrow functions, no OOP

#

just a few thousand lines of JS

#

because its "good enough" and "it works"

quartz kindle
#

yup, thats me

terse badger
#

fun fact

#

he got fired

quartz kindle
#

i cant get fired

#

unless i fire myself

terse badger
#

then do yourself a favour and keep working for yourself if you wanna keep it that way

quartz kindle
#

thats my plan

#

a question tho, is there important reason to use arrows and classes, when you can do the same things the "old way"? like performance gain, compatibility gains, etc

terse badger
#

its a lot easier to reason with constructs that are well defined

quartz kindle
#

or is it just to improve cooperation with multiple people?

terse badger
#

if only you will ever work on the codebase, then its just a matter of how much do you care about how good your code is for you to code in

#

if youre working in a place where others in the future or present will be working on it as well, a lot more is at stake then

#

being able to reason with why your code does what and not have to battle with badly designed and literally ancient constructs can save you a lot of time and headaches

#

"this" doesnt have property xyz? yea javascript decided to fuck with your scoping again

quartz kindle
#

idk about the future, but for the time being, im the only one who's gonna work with it

#

and even if i dont use those newer features, i do review my designs and code flow a lot

#

so i like to think to my self its not that bad, and understandable if anyone ever gets their hands on it

terse badger
#

if only you work on it, then youre the only one who you can yell at and and youre the only one who will care about the code :p

#

think of it this way

#

if the "old way" is good enough, why are they changing it/adding the other stuff

quartz kindle
#

well, as primarily a web dev, browser compatibility is more of an issue than code design

terse badger
#

use transpilers

quartz kindle
#

a few years back when i was more active as a web designer, i absolutely had to work with the ancientest of the techs

terse badger
#

babel, webpack

#

let them take care of that

#

thats what theyre designed for

#

to let you use the cool new tech while still having perfect compatibility

earnest phoenix
#

babel is nice, indeed

knotty steeple
#

can you do ternary operators in python? if you can, how

earnest phoenix
#

Ternary?

knotty steeple
#

idk what it means but in js it would be like

something ? yes(something) : nope(something)

so in our case, something would return true which would run yes(something) but if it wasnt run nope(something)

inner jewel
#

a if condition else b

knotty steeple
#

oh ok

lusty dew
#

Does anyone know a good npm package for steam o.O I want to make a steam command that gives you all the info of whatever game you search

sick cloud
#

the steam api is weird

#

i couldn't ever find a good package

knotty steeple
#

just make requests from the api yourself

tulip snow
#
Error: RSV2 and RSV3 must be clear

?

inner jewel
#

anyway that's a websocket error, bad payload

tulip snow
#

So npm install uws?

west raptor
#

on a guildCreate event you could do this correct

if (guild.owner.user.id === 'id here') {
    guild.leave()
}``` a friend is having issues with some one inviting his bot to multiple servers
#

thats just to troll him

knotty steeple
#

that looks fine

west raptor
#

alright

tulip snow
#

Can somone tell me how to fix ```js
Uncaught Exception: Error: RSV2 and RSV3 must be clear

lusty dew
#

Hmmm

#

if I was requesting something from Steam what URL would I use?

tulip snow
#

Can somone please help me I cant figure out that error

lusty dew
#

Search up the error

#

That is what I do when I can't figure it out

tulip snow
sick cloud
#

go to the discord.js server and ask

barren brook
#

my bot went offline for no reason does anyone know why??

night imp
#

check logs

barren brook
#

ok

night imp
#

What service are you using to host it @barren brook

barren brook
#

js

west raptor
#

You could have stopped the process

night imp
#

No like hosting

#

Vps

#

Where you run it

west raptor
#

he could be self-hosting

night imp
#

Ik

west raptor
#

@barren brook did you close the cmd prompt?

barren brook
#

yes

west raptor
#

thats why

#

you stopped the process

barren brook
#

ill open it

west raptor
#

ok

barren brook
#

still offline

west raptor
#

run the file

barren brook
#

ok

west raptor
#

node <filename>.js

barren brook
#

k

#

fixed

west raptor
#

alright

outer niche
#

Ok I'm here

night imp
#

Ok

#

So on the page I sent you should see a list of bots

#

Click on yours

outer niche
#

Yes I've gotten all the way to where I'm on the bot page

night imp
#

Oh I forgot about the new layout

knotty steeple
#

what is he trying to do

night imp
#

disable code grants

#

@outer niche scroll up

#

above that there should be the checkbox

knotty steeple
#

the first category iirc

#

uh

#

wait no

outer niche
#

Yeah it's been off

knotty steeple
#

yes there

night imp
#

hmm

#

try to remake the bot's permissions

#

and try to use that link

west raptor
#

huh

#

deleted image

#

thonk

night imp
#

@west raptor was showing my bots page to him, but it became irrelevant and I didn't want it floating around even if it hardly showed anything

outer niche
#

Got it thank you

west raptor
#

ah alright

night imp
#

Np

#

I'm glad it's alright with you @west raptor thinkf

west raptor
lusty dew
#
request.get(`https://store.steampowered.com/api/storesearch?cc=us&l=en&term=${game}`)
#

I have a question

#

what would game be defined as

#
var game = await this.fetchGame
#

I have it as that

#

but not sure if it will work

earnest phoenix
#

What is this in the current scope?

lusty dew
#

One question

#

Which is better

#

Node-superfetch or Snekfetch

rustic axle
#

Depends on your needs

lusty dew
#

I am trying to make a steam command that requests data from the game a user searches

Like: !steam Rust and it gives the info on that game

tiny lodge
#

Any good guides on sharding with eris?

lusty dew
quartz kindle
#

snekfetch is deprecated

lusty dew
#

Read docs

quartz kindle
#

so better use something else

lusty dew
#

Ah shit

#

Ok

#

So will

#

node-superfetch work?

tiny lodge
#

oke thanks

lusty dew
#

Np

quartz kindle
#

should work yes

lusty dew
#

Ok

#

Also

#

isn't

#

this.fetchGame node-superfetch this

quartz kindle
#

what are you trying to do?

#

this is the example they give const { body } = await request.get('https://registry.npmjs.com/node-fetch'); console.log(body);

lusty dew
#

Ok

#

I am trying to

#
request.get(`https://store.steampowered.com/api/storesearch?cc=us&l=en&term=${game}`)
#

define game

#

but what I had before

#

did not work

outer niche
#

Which one is better Navy or Army

quartz kindle
#

is it a json response?

lusty dew
#

Not that I know of

quartz kindle
#

what does body return?

lusty dew
#

?

#

Wym

quartz kindle
#

what does the request return?

lusty dew
#

I want it to do the same thing that does

#

Returns info on a game

quartz kindle
#

and you're trying to get the game name from that info?

lusty dew
#

well

#

I want the URL

#

to like

#

when they do !steam Rust

#

it will return info on that game

slender thistle
#

@outer niche How is that related to coding?

outer niche
#

I did not mean to put it in here sorry

slender thistle
#

Np πŸ˜„

lusty dew
#

XD

#

Anyway

#

I am trying to make it so

quartz kindle
#

just put the game directly into the url

#

it works

lusty dew
#

Well