#development

1 messages · Page 489 of 1

wide ruin
#

So what's the site?

rustic axle
#

Watch that

#

All of it

wide ruin
#

I mean just heroku site

rustic axle
#

That tells you how to set up your git ignore and procfile and upload it to heroku

wide ruin
#

Well I can't watch videos rn

rustic axle
#

¯_(ツ)_/¯

wide ruin
rustic axle
#

yep

#

sign up

#

set worker dynos to worker index.js

wide ruin
#

Then copy all file contents like normal?

rustic axle
#

set up a git ignore that ignores node_modules and package lock

#

then install the heroku cli

#

open up your wonderful cmd or pwsh

#

git init in the dir

#

git commit -am <reason>

#

git push heroku master

#

that should do it

wide ruin
#

I can't even code on it

late hill
#

lol

#

Install Git

#

Then right click on the directory

#

And git bash

#

👏

west raptor
#
       msg.channel.send('Alrighty, where will the poll be sent?')
        .then(() => {
            msg.channel.awaitMessages(response => msg.content, {
                max: 1,
                time: 30000,
                errors: ['time']
            }).then(collected => {
                let channel = msg.guild.channels.find(c => c.name === collected.content)
                if (!channel) return msg.channel.send('That\'s not a valid channel!')
                msg.channel.send('Alrighty, got that, next! What will the poll name be?')
            })
        })``` this seems to not wait at all https://i.imgur.com/iqNLqcI.png
#

it immediately assumes a message was sent in the channel

#

is there something im doing wrong?

knotty steeple
#

see the problem is

#

it responds to its own message

west raptor
#

ohh

knotty steeple
#

so make it only listen to responses from the command executor

west raptor
#

how

#

couldnt i just send the message then await messages?

knotty steeple
west raptor
#

alright, and if its not?

knotty steeple
#

it does nothing

sick cloud
#

the blocks have lines in them so, eh

inner jewel
#

rustic axle
#

tbh the look is quite nice and I wouldn't replace you

west raptor
#

how would i check if a role is higher then the bot

#

d.js

#

btw

gilded blaze
#

Compare the position of the role to the position of the highest role of the bot.

<Guild>.me.highestRole.position < <Role>.position
west raptor
#

alright, thanks

earnest phoenix
west raptor
#

whats the log

earnest phoenix
#

having this problem while using heroku cli to host my bot

knotty steeple
#

do you have a start script

#

meaning the thing in package.json

earnest phoenix
#

means..?

#

ye i have

knotty steeple
#

so like

#

oh

#

whats that file called that has basically
worker: node app.js

#

i think you need that

earnest phoenix
#

procfile?

#

i have it

knotty steeple
#

well i dont know

#

i dont use heroku

rustic axle
#

under dynos you need to modify it to worker: node index.js

#

not npm start

earnest phoenix
#

where in procfile?

#
worker: node index.js
#

my procfile @rustic axle

rustic axle
#

Not procfile

earnest phoenix
#

then?

rustic axle
#

the fucking dashboard

earnest phoenix
#

how to modify it?

west raptor
#

theres probably an edit button or you can just click on it

#

¯_(ツ)_/¯

earnest phoenix
#

how to edit and add it??

rustic axle
#

It must look like this

earnest phoenix
#

how you added it?

gilded blaze
#

Make sure the p is capital. Procfile

earnest phoenix
#

ye its capital

#

mine one

rustic axle
#

add this in procfile worker: node index.js

earnest phoenix
#

already

rustic axle
#

okay

#

git commit -am <reason>

#

git push heroku master

#

make sure you are in your dir

#

and have both git and heroku installed

earnest phoenix
#

i still have only web in deploy

#

@rustic axle No error

rustic axle
#

wdym

#

only web in deploy means

#

what

earnest phoenix
#

i mean in resources

rustic axle
#

oh

#

send me a screenshot of your procfile in Windows Explorer

earnest phoenix
#

windows explorer?

rustic axle
earnest phoenix
rustic axle
#

idk then

earnest phoenix
rustic axle
#

are you sure you are logged in via the heroku cli

earnest phoenix
#

ye

#

unexpected argument??

rustic axle
earnest phoenix
#

i dont have this

west raptor
#

then you dont have git

#

simple as that

earnest phoenix
#

i have git

#

wth??

west raptor
#

what

knotty steeple
#

or

#

hidden folders are off

west raptor
#

oh yea true

#

check that also

earnest phoenix
#

fk so confusing 😢

#

hidden folders?

west raptor
#

yes

#

wait

rustic axle
earnest phoenix
rustic axle
#

if you still don't have it @earnest phoenix then do $> cd <dir> $> git add .

earnest phoenix
#

i can see a .git folder

rustic axle
#

ignore that

#

cool

#

okay

#

we have gotten somwhere

earnest phoenix
#

but still cant see worker

rustic axle
#

what do you have in your .gitignore

#

if you don't have one create one node_modules/ package-lock.json .idea/

earnest phoenix
#
node_modules/
package-lock.json
.idea/
#

ye

rustic axle
#

hmm

#

save your files and recommit

earnest phoenix
rustic axle
#

Why are there files with 0KB in them

earnest phoenix
#

your branch is upto date

rustic axle
#

ofc its not tracking those

earnest phoenix
#

ah

#

idk i just used commit

#

and these files added automatically

rustic axle
#

what are they filled with

earnest phoenix
#

nothing

rustic axle
#

idk just delete them as long as they are not required in your code

earnest phoenix
#

fk still not working

#

should i delete all things?and start again from 0?

rustic axle
#

push it to heroku

#

then recommit

#

and then repush

sick cloud
#

anyone know how to get the version of Eris your on from the code?

earnest phoenix
#

i fixed it

quartz kindle
#

get it from package.json

sick cloud
#

@quartz kindle package .json doesn't provide a version

#

just the repo thing

cold harness
#

halp someone teach me how to make help menu embeds in py

west raptor
#

Isn't it like require('something').version? @sick cloud or are you talking about something else

sick cloud
#

i tried Eris.version but its undefined

west raptor
#

Hm

#

I'm assuming Eris is require('Eris')?

sick cloud
#

yes

west raptor
#

Hm

#

Weird

gilded blaze
#

Could try using child_process and running npm info eris version and getting the callback from that.

sick cloud
#

i got it now, its just VERSION lol

deep inlet
#

Why this no work?

msg.content.replace(new RegExp(`<@!\\?${client.user.id}> \\?`), set.prefix)```
earnest phoenix
#

how doesnt it work, please elaborate

deep inlet
#

It's supposed to be code for a mention prefix

#

But it doesn't detect anything

#

The thing is

#

When I log the constructed regex, I get this /<@!\?443374895783477248> \?/

earnest phoenix
#

dont escape the ? @deep inlet

deep inlet
#

Both?

#

/<@!?443374895783477248> ?/ Still not working

earnest phoenix
#

well ? means optional so the ! is optional cos ita only for nicknames

deep inlet
#
msg.content.replace(new RegExp(`<@!?${client.user.id}> ?`), set.prefix)```
earnest phoenix
#

whats the ? after for?

#

also if its a prefix anchor it to start of string with ^

deep inlet
#

It's for spaces

#

Make the space optional

#

But even if I remove it the regex doesn't catch anything

earnest phoenix
#

on phone so hard to test and help

deep inlet
#

Which means the first ? isn't working

#

Or at least something isn't

earnest phoenix
#

have you checked if the regex is matching? without trying to replace

#

check regex101. also not sure if template literal causes issue

#

also u shouldnt write to message content 😡

deep inlet
#

The screenshot I posted is from R101

deep inlet
#

How do I call an object variable but with a property changed for that 1 time? (JS)

cold harness
#

someone pls teach me how to make help embeds

#

in python pls

deep inlet
#

Ew

#

Why are you using Python?

cold harness
#

because AI

deep inlet
#

Also, @trim saddle zoomeyes

cold harness
deep inlet
#

Embed builders 🤢

#

I can't help, sorry

#

Dunno how to use 'em

#

(Embed builders for Python)

cold harness
#

i kno

#

i wanna spam skull now

slender thistle
#

@cold harness Field value can't be falsey

#

A.K.A "" will not work

earnest phoenix
#

How do I get the eqmarry command working

stone hatch
#

Code it.

#

We can't spoon feed you with code.

trim saddle
#

@cold harness what

slender thistle
#

Wrong person?

trim saddle
slender thistle
#

Oh, my bad

prime cliff
#

Field value cant't be falsey lol

slender thistle
#

wat

#

Bad phrasing?

prime cliff
#

Field title cant be null or empty

slender thistle
#

Yeah, thanks for rephrasing that

earnest phoenix
#

I need some help for create a music bot

#

like Rythm

#

?

wild tide
#

You can't learn to make a music bot instantly

#

It's up to you to learn

earnest phoenix
#

...

hot sleet
#

search on youtube

earnest phoenix
#

just say: "i dont know any coding or problem solving skills so im asking in here for somebody to get frustrated tryign to help me"

#

I want to code with this software

hot sleet
#

@earnest phoenix what is ur library

#

and language

wild tide
#

its an IDE GWfroggyBlobWokeThink

hot sleet
#

also what is this app name

earnest phoenix
#

@hot sleet i'm french

hot sleet
#

fuck

#

i mean coding language

#

and which module u use

#

all that

#

you don't know any of these

earnest phoenix
#

Visual Studio code

hot sleet
#

so don't ask for help

#

and search on youtube

#

coding isn't easy

earnest phoenix
#

Learn how to code

wild tide
#

You need to figure out what coding language you want to work in. There are many popular ones like discord.js and discord.py

hot sleet
#

discord.js is a library not language

#

you mean node.js

wild tide
#

I was referring to the langauge that the library wraps the API in

hot sleet
#

yeah but erise in node.js too

wild tide
#

Exactly

#

:>

hot sleet
#

how to kill myself

wild tide
#

thats not very family friendly

earnest phoenix
#

@earnest phoenix 'I want to code with this software'...
code then 🤔

topaz fjord
#

erise

earnest phoenix
#

Abal will kill u

#

NodeJS is not a language either, btw

topaz fjord
#

it's an implementation on js

scenic charm
topaz fjord
#

Show code

scenic charm
#

@topaz fjord which one

topaz fjord
#

Also

#

This might help

quartz kindle
#

that usually means your code is doing an infinite loop

scenic charm
#

how can ı fix that

quartz kindle
#

show your code

earnest phoenix
#

do I have to pay to change the background?

quartz kindle
#

no

west raptor
#

No

earnest phoenix
#

then?

quartz kindle
#

custom css

#

in your html description

west raptor
#
<style>
</style>
#

iirc

quartz kindle
#

yes

earnest phoenix
#

I'm a beginner in HTML, instead of the style I should put :))

#

the link?

west raptor
#

What

next wedge
#

<a href="link">

quartz kindle
#

no...

#

learn css

earnest phoenix
#

k

next wedge
#

Oh ok

earnest phoenix
#

I'll look at a tutorial

quartz kindle
scenic charm
quartz kindle
#

im not gonna read all your files

#

the problem is when using return-deep-diff

#

check your files and look for something that uses that package

earnest phoenix
#

@quartz kindle where i can put the code?

quartz kindle
#

in your bot's html description

earnest phoenix
#

here?

quartz kindle
#

yes

earnest phoenix
#

@quartz kindle
How do I replace this with an image?

body {background-color: lightred;}
quartz kindle
earnest phoenix
#

Thanks

#

@earnest phoenix also, there are loads of CSS snippets / templates / guides

#

Just try to google what you want to see on your profile, and you'll most likely find it

#

i need help on my new prfiex

#

@earnest phoenix ?

#

How can we help without seeing the actual problem? -_-

earnest phoenix
#

K

short mica
#

-reason

limpid cosmos
#

a!say t

#

Error srry

west raptor
#

what

limpid cosmos
#

Error

#

Srry

earnest phoenix
#

Is there a doc on channel perm changes for like muting

#

In js

earnest phoenix
#

this does nothing

#
msg.channel.overwritePermissions(member, {
      VIEW_CHANNEL: true,
      SEND_MESSAGES: false,
    }).catch(err) ```
frigid bone
#

VIEW_CHANNEL and SEND_MESSAGES should be strings

smoky spire
#

No

frigid bone
#

unless you declared them somewhere or you're using enums

earnest phoenix
#

how do Imake it a string

frigid bone
#

'SEND_MESSAGE'

earnest phoenix
#

'': true ?

frigid bone
#

'SEND_MESSAGE': true

earnest phoenix
#

still dont work

smoky spire
#

Log the error

earnest phoenix
#

nothing works now

inner jewel
#

they don't have to be strings

smoky spire
#

^

inner jewel
#

in object literals you can do just k: v

frigid bone
#

Oh wait

#

My brain froze for a second, apologies

earnest phoenix
#

the whole command dont work and the bot logs no errors

frigid bone
#

Try passing console.error instead of err inside catch

#

and you shouldn't have that comma after SEND_MESSAGES: false

marble elm
#

how can i see the amount of votes for my bot?

earnest phoenix
#

no error @frigid bone

#

oof I know why

frigid bone
#

huh

earnest phoenix
#

I have 2 command names mute

#

i was supposed to name it unmute

frigid bone
#

Get rid of catch completely and let it log an uncaught exception

#

oh

earnest phoenix
#

Works now @frigid bone tyvm

frigid bone
earnest phoenix
earnest phoenix
#

For mute how would I make it go through all the chats and do it?

scenic charm
#

const ddiff = require('return-deep-diff');
module.exports = (oMember, nMember) => {
console.log(ddiff(oMember, nMember));
};

#

@quartz kindle

#

ı found that

earnest phoenix
#

would this work?

msg.guild.channels.forEach(async (channel, id) => {
          await channel.overwritePermissions(member, {
            VIEW_CHANNEL: true,
            SEND_MESSAGES: false
          });```
#

to make the user not be able to chat in all channels?

high tinsel
#

ok, so if there is no embed, it cant be created, because aome parts are missing, how do I detect it and send a error message?

earnest phoenix
#

what

idle mountain
#

In what context would an embed not be able to be created?

earnest phoenix
#

@high tinsel you cant make fields that have no text in

#

@idle mountain would that code work?

idle mountain
#

Oh like that? ^ just check if the field’s text length is null or its length is 0, if so then put a 0-width joiner or an emote with no pixels or something

#

Idk, I’m not familiar with JS permissions, sorry

#

Try it

earnest phoenix
#

k

high tinsel
#

I know, it is for a gif command and if it does not find any gif, the npm does not respond

#

this is used in the embed

#

so when it finds no gifs nothing is posted

#

i need it to say there are no gifs of this thing, or something like that

topaz fjord
#

@earnest phoenix that code should work

idle mountain
#

Well your library should return an error when it can’t properly post, just a quick try{} catch{} would work

#

Try to send the embed, catch the error, if caught then send the error message

#

The best way to do that would probably be to ask giphy directly if the go exists, but eh

scenic charm
#
module.exports = (oMember, nMember) => {
  console.log(ddiff(oMember, nMember));
};```
high tinsel
#

if (err) message.channel.send(err);

#

is already in my code

#

but does not do the thing

earnest phoenix
#

it dont it just complains about code under ut

#

@topaz fjord

#

nvm i was just being stupid

high tinsel
#
  giphy.search(message.content.replace("ne gif ", ""), function(err, res) {
    if (err) message.channel.send(err);
    
    const embed = new Discord.RichEmbed()
      .setTitle("🖼️ Gif")
      .setColor(3447003)
      .setImage(res.data[Math.floor(Math.random() * 5)].embed_url.replace('giphy.com/embed/', 'media.giphy.com/media/')+'/giphy.gif')
    message.channel.send({embed});
  });
  }``` the whole code, hopefully this will help you understand
topaz fjord
#

what the fuck

#

nvm

#

Wait does res.data have the field embed_url

idle mountain
#

Check if res is null maybe? idk

#

If so then show the error

#

I’d guess

high tinsel
#

allways this error

#

no matter what I do

#

it just puts this in my console 😦

topaz fjord
#

Log res.data before you create the embed

high tinsel
#
  giphy.search(message.content.replace("ne gif ", ""), function(err, res) {
    if (err) message.channel.send(err);
    
    if(res.data === null){
      console.log("works now")
      return
    }
      
    const embed = new Discord.RichEmbed()
      .setTitle("🖼️ Gif")
      .setColor(3447003)
      .setImage(res.data[Math.floor(Math.random() * 5)].embed_url.replace('giphy.com/embed/', 'media.giphy.com/media/')+'/giphy.gif')
    message.channel.send({embed});
  });
  }```
#

this is with null

#

but I tried undefined too

#

nothing works...

topaz fjord
#

Try logging it outside of the if statement

high tinsel
#

oh, it is []

#

not null

#

🤦

#
  giphy.search(message.content.replace("ne gif ", ""), function(err, res) {
    if (err) message.channel.send(err);
    
    if(res.data === "[]"){
      console.log("works now")
      return;
    }
      
    const embed = new Discord.RichEmbed()
      .setTitle("🖼️ Gif")
      .setColor(3447003)
      .setImage(res.data[Math.floor(Math.random() * 5)].embed_url.replace('giphy.com/embed/', 'media.giphy.com/media/')+'/giphy.gif')
    message.channel.send({embed});
  });
  }``` ok, now it is this, but the error did not change 😦
vernal rivet
#

What error

#

@high tinsel

cosmic swallow
#

anyone can help me with a servercount code in async ?

#

or a shard code ?

vernal rivet
#

J's?

cosmic swallow
#

py

vernal rivet
#

Oh sorry, can't help I do js

cosmic swallow
#

well , I can use js in py so ...

#

wouldnt be a problem ig ..

vernal rivet
#

Well it only work with the discord.js lib

craggy fox
#

my css isnt working for dbl

high tinsel
cosmic swallow
#

@craggy fox mine either XD

craggy fox
#

why though?

cosmic swallow
#

I messed up my whole bot page XD

craggy fox
#

mine used to work

cosmic swallow
#

welp im just bad XD

vernal rivet
#

@high tinsel did you define embed_url?

cosmic swallow
#

@craggy fox are u good at it ? idk XD still looking for someone that can help me

vernal rivet
#

Oh wait

high tinsel
#

embed_url does not even need defining

craggy fox
#

mine should work since it worked last time

cosmic swallow
#

o

high tinsel
#

the error is in the

#

if(res.data === "[]"){
console.log("works now")
return;
}

#

part

#

not being able to filter the error response

#

foe some reason 😦

vernal rivet
#

Check and make sure the URL you are providing is real

high tinsel
#

it is, the problem is when the gif if that thing does not exist

#

it gives back

#

[]

#

and this

#

if(res.data === "[]"){
console.log("works now")
return;
}

#

should detect it and return...

vernal rivet
#

It should be if(res.data === []){

topaz fjord
#

^

vernal rivet
#

Don't put [] cause it's a array, array usually doesn't go in a message unless it's a object

high tinsel
#

if(res.data === []){

#

same error

vernal rivet
#

The do this do
let gif = []; If(res.data === gif){

craggy fox
#

can anyone help with the custom css thing for the website

#

mine stopped working for some reason

high tinsel
#

does not help 😦

vernal rivet
#

Ummmmm, can you send the full error? I am a person that needs to see the full error

neat vault
#

@cosmic swallow i can help u.

high tinsel
#

Activity Log

/app/server.js:161

  .setImage(res.data[Math.floor(Math.random() * 5)].embed_url.replace('giphy.com/embed/', 'media.giphy.com/media/')+'/giphy.gif')

                                                    ^

TypeError: Cannot read property 'embed_url' of undefined

at /app/server.js:161:57

at IncomingMessage.<anonymous> (/app/node_modules/giphy-api-without-credentials/index.js:199:15)

at emitNone (events.js:111:20)

at IncomingMessage.emit (events.js:208:7)

at endReadableNT (_stream_readable.js:1064:12)

at _combinedTickCallback (internal/process/next_tick.js:139:11)

at process._tickCallback (internal/process/next_tick.js:181:9)
cosmic swallow
#

@neat vault with XD the website or the py thing ?

neat vault
#

py thing

cosmic swallow
#

ok

vernal rivet
#

Aaaaaaahhhhhhhhh, your url is being replaced aaaaaaahhhhhhhhh OwO

cosmic swallow
#

dms ??

#

or .. XD

neat vault
#

come to other server, i tagged u there

#

@cosmic swallow

earnest phoenix
vernal rivet
#

@high tinsel check the discord.js documentation

high tinsel
#

what part of it..?

smoky spire
#

It's not d.js related the d.js docs won't help you

earnest phoenix
signal saffron
#
const ayarlar = require('../ayarlar.json');
const moment = require("moment");
var request = require('request');
request('https://www.doviz.com/api/v1/currencies/EUR/latest', function (error, response, body) {
if (error) return console.log('Hata:', error); 
else if (!error) { 
var info = JSON.parse(body); 
var prefix = ayarlar.prefix;

exports.run = (client, message, params) => {
    if (!message.guild) {
    const ozelmesajuyari = new Discord.RichEmbed()
    .setColor(0xFF0000)
    .setAuthor(message.author.username, message.author.avatarURL)
    .addField('**Eğlence Komutları Özel Mesajlarda Kullanılamaz!**')
    return message.author.send(ozelmesajuyari); }
    if (message.channel.type !== 'dm') {
      const sunucubilgi = new Discord.RichEmbed()
      .setColor(`RANDOM`)
      .setAuthor("Beinz Bot | Euro Verisi")
      .addField(':euro: **Satış Fiyatı:**', info.buying)
      .addField(':euro: **Alış Fiyatı:**', info.selling)
      .setTimestamp()
    return message.channel.send(sunucubilgi);
    }}}
});

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

exports.help = {
  name: 'euro',
  description: 'euro',
  usage: 'euro'
};```                       **not updated,remains constant, help me?**
vernal rivet
#

Check the send url part @high tinsel

earnest phoenix
#

Why are you making the request before exports.run?

vernal rivet
#

Or itexlo will know more than me about it

slate kayak
earnest phoenix
#

You do realize that if you do that, it only executes once

signal saffron
#

How will I do

vernal rivet
#

@slate kayak your missing a permission

earnest phoenix
#

Put the Ajax request inside of the exports run

slate kayak
signal saffron
#

@earnest phoenix ```const Discord = require('discord.js');
const ayarlar = require('../ayarlar.json');
const moment = require("moment");
var request = require('request');
var prefix = ayarlar.prefix;

exports.run = (client, message, params) => {
if (!message.guild) {
request('https://www.doviz.com/api/v1/currencies/EUR/latest', function (error, response, body) {
if (error) return console.log('Hata:', error);
else if (!error) {
var info = JSON.parse(body);
const ozelmesajuyari = new Discord.RichEmbed()
.setColor(0xFF0000)
.setAuthor(message.author.username, message.author.avatarURL)
.addField('Eğlence Komutları Özel Mesajlarda Kullanılamaz!')
return message.author.send(ozelmesajuyari); }
if (message.channel.type !== 'dm') {
const sunucubilgi = new Discord.RichEmbed()
.setColor(RANDOM)
.setAuthor("Beinz Bot | Euro Verisi")
.addField(':euro: Satış Fiyatı:', info.buying)
.addField(':euro: Alış Fiyatı:', info.selling)
.setTimestamp()
return message.channel.send(sunucubilgi);
}}}
});

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

exports.help = {
name: 'euro',
description: 'euro',
usage: 'euro'
};``` Is that like this?

vernal rivet
#

Ummm

earnest phoenix
#

Your curly braces are off somewhere

#

I can't really tell because on on a phone

signal saffron
#

Add me friends, let's do it tomorrow, I don't know if I can.

earnest phoenix
#

Also, the line where it checks if the channel is not a DM will never get executed

#

Since you have an else if and a return

#

@signal saffron do me a favor and make the code readable

#

Fix your indentation and curly braces

signal saffron
#

My English is bad, I'm trying.

earnest phoenix
#

A JS beautifier should suffice

signal saffron
#

I could not. 😢

earnest phoenix
#

Huh?

#

I don't understand

#

Just Google JS beautifier

jagged sun
#

JS?

#

Anybody here working with JDA?

signal saffron
#

I don't understand

jagged sun
#

What don't u understand?

#

Hellloooooo? Anybody here with JDA?

#

Why r u typing such long?

signal saffron
vernal rivet
#

Thyke, do you speak another language?

sullen path
#

@jagged sun if you need help, say what you need

vernal rivet
#

Yee

earnest phoenix
#

i need help, im tryna make a command only work for me but its not working

#
if (!message.member.hasPermission("KICK_MEMBERS") || message.author.id !== owner)

thats code

vernal rivet
#

What language is it?

#

J's?

west raptor
#

It is

vernal rivet
#

That seemed right

topaz fjord
#

What's not working zoomeyes

west raptor
#

Owner isn't defined?

vernal rivet
#

Made sure owner is equal to your id

west raptor
#

And it's ONLY for you

queen sentinel
#

Dream

vernal rivet
#

?!?

queen sentinel
#

👋

west raptor
#

Hi

vernal rivet
#

Lol

topaz fjord
earnest phoenix
#

Owner is defined, it just says i have no perms to use command

queen sentinel
#

@topaz fjord I'll come over the East Coast and knock you over

topaz fjord
#

your breaking your own rules idiot

west raptor
#

But like

#

You only want YOU to use it

vernal rivet
#

You don't have the perms then

topaz fjord
#

@earnest phoenix is owner a string or number

west raptor
#

Right?

#

Lemme get off bus real quick

#

Brb

topaz fjord
#

Faster

vernal rivet
#

Ok, what does the error look like?

topaz fjord
#

is owner a string or number zoomeyes

earnest phoenix
#

@topaz fjord its my owner id
i do this
const owner = ['MY ID'];

topaz fjord
#

then to check if the Id is equal to yours

#

You'll have to do

earnest phoenix
#

it is

topaz fjord
west raptor
#

@earnest phoenix answer my question

topaz fjord
#

owner is defined dream

#

it's just it's defines as an array

#

not a string

west raptor
#

I never asked if it's defined, well I did so answer my second question

earnest phoenix
#

@west raptor what question?

west raptor
#

You only want YOU to use it?

#

Right?

earnest phoenix
#

if (!message.member.hasPermission("KICK_MEMBERS") || message.author.id === owner)

#

^^

slender thistle
#

owner is an array, is it not?

earnest phoenix
#

look, its worked before, and it works for other commands, just not this one

slender thistle
#

The conditions are failing, then

west raptor
#

It looks like you are check IF the the author ID is yours

earnest phoenix
#

if (!message.member.hasPermission("KICK_MEMBERS") || message.author.id !== owner)
did that too, made no difference

#

thats full code

west raptor
#

So you want members with kick members perms and you to be able to run the command?

earnest phoenix
#

yes

west raptor
#

I had trouble with this yesterday

#

Try:

#
if (!message.member.hasPermission("KICK_MEMBERS") && message.author.id !== owner[0])```
slender thistle
#

Why is it an && GWchadThinkeyes

vernal rivet
#

Cause it's saying permission and owner basically

#

You can do || or &&

west raptor
#

@earnest phoenix did that work

#

@slender thistle
Using && is basically checking if both are true, if one is false it doesn't return the perm message

#

It's confusing

#

I know

slender thistle
#

I get that. What I didn't get was why you used &&

west raptor
#

Because || is check if either one is true

slender thistle
#

And isn't that what they wanted?

west raptor
#

If either one is true it returns the perm message

topaz fjord
#

&& makes sure both are true before continuing

vernal rivet
#

If you used || its only checking if one thing is true, which can cause problems, if you do && then it's checking for both to be true, so if the person doesn't have one of the required then it won't work for them

slender thistle
#

Eh well

#

Completely unrelated to what I was asking bloblul

west raptor
#

How

earnest phoenix
#

because

#

&& = and

west raptor
#

They want members with kick members and him to be able to run the command

earnest phoenix
#

yes

slender thistle
#

My actual question was "Didn't they want people who have Kick Members and themself allow to use the command?"

earnest phoenix
#

which will be ||

vernal rivet
#

Yes that's &&

slender thistle
#

what

vernal rivet
#

If you saying if have kick members or is the id then it would be ||

west raptor
#

What

earnest phoenix
#

what

vernal rivet
#

It's basically saying if the user doesn't have permission, or has the id, then don't run. But it's only checking if one is true meaning that if someone has permission but doesnt have a I'd, then it will still run. And is checking both things, usually you wouldn't use and in here, but it depends what the bot is going to do, usually you just check for one thing

#

You would only use && if you making sure that the person has both required things to use it, so in general this decision is pointless since the problem is that he didn't but the right id and didn't have the right permission

west raptor
#

What

vernal rivet
#

It's not a bot error, it's logical error

west raptor
#

He is checking if the user has perm or has his ID

#

|| checks if one is true

vernal rivet
#

Then it would be ||

west raptor
#

Therefore returning the perm message

vernal rivet
#

Yes

west raptor
#

What

earnest phoenix
#

shivaco, that statement wasn't followed by the command execution but by an error stating that you can't use the command

trail cypress
#

Hi I'm development

earnest phoenix
#

hence why ! and && rather ||

slender thistle
#

Oh

vernal rivet
#

&& makes sure that both things are true, || is make sure if one thing is true

slender thistle
#

Didn't quite notice that

#

My bad, rip

trail cypress
#

I get an error

earnest phoenix
#

I mean, at least we implied that is the case

vernal rivet
#

Yes nameless?

trail cypress
#

I type throw err and it errors

west raptor
#

Oh

#

Don't do that then

trail cypress
#

Should I type catch error?

vernal rivet
#

What does the full error look like name less

trail cypress
#

Like catching a cold?

#

I'm just messing with you, I know how to js

topaz fjord
#

Lmfao

vernal rivet
#

Lol

#

It's all good dream

west raptor
#

What

signal saffron
#

@vernal rivet I speak Turkish, bad english. 😠😠

vernal rivet
#

oh ok

earnest phoenix
#

pinging people for using English is awesome

bright spear
#

@timid escarp did you code the bot?

west raptor
#

It doesn't look like he did

marble elm
#

how can i see the amount of votes for my bot through the API?

earnest phoenix
#
var Maro = new commando.CommandoClient({
    owner: 'Aidan W.',
    commandPrefix: '!'
});

Maro.login('Token');

Maro.registry.registerGroup('other', 'Other');
Maro.registery.registerCommandsIn(__dirname + "/commands")
Maro.registry.registerDefaults();


```  can someone please tell me what is wrong with this?
trail cypress
#

Small nitpick that you're using var instead of const

#

But that won't fix it

sly girder
#

Gyus, does someone wants to check my framework I`v done for discord?:)

#

@earnest phoenix maybe owner should be id, or array of ids and not your nickname

earnest phoenix
#

well @sly girder it says ```Maro.registery.registerCommandsIn(__dirname + "/commands")
^

TypeError: Cannot read property 'registerCommandsIn' of undefined
at Object.<anonymous> (C:\Users\user\Desktop\Maro\index.js:10:16)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3``` in the terminal

trail cypress
#

Registry is undefined then...

sly girder
#

But the first Macro.Registery is ok, yeap?

trail cypress
#

Is is registry and not registery

sly girder
#

Oh yes

earnest phoenix
#

maybe

#

im gonna try that real quick

sly girder
#

@earnest phoenix are you creating new bot?

trail cypress
#

:)

earnest phoenix
#

ya a new bot

sly girder
#

@earnest phoenix wanna check out my framework? 😄

#

@earnest phoenix there is no docs, but I can help you anytime with it 😃

earnest phoenix
#

ok

rustic axle
#

Welp... time to re-modulize my entire bot mmLol

west raptor
#

why

sly girder
#

@rustic axle wanna try to use my discrod bot framework? based on service providers 😉

west raptor
#

@sly girder link me

#

i wanna take a look

sly girder
#

@west raptor it has no docs 😄

west raptor
#

its all good

rustic axle
#

The framework I had was weak and I want to try and remake it

sly girder
#

@west raptor i will DM you with the core component.

west raptor
#

im making my own framework soon hopefully

#

just knowing where to start is uh

sly girder
#

@west raptor better contribute to my 😄

rustic axle
#

So I can auto load new npm files and install them and also push new files to the cloud that auto reload as well

sly girder
#

I even have awesome naming 😄

#

Ramen.JS

rustic axle
#

and by framework I mean the framework of my bot that I just create new js files that get loaded in as commands

#

not wrappers

#

assuming thats what you guys are discussing now

sly girder
#

@rustic axle nah, that not framework 😄

#

Framework is tool that has build in many tools that allow fast resolving problems 😄

rustic axle
#

ah okay that type of framework

sly girder
#

That a huge bug! Only owners or MANAGE_GUILD should have permission to change the prefix 😄

west raptor
#

or admins

#

¯_(ツ)_/¯

sly girder
#

Yeap, but admins have option to manage guild

west raptor
#

I personally would give to people with admin permissions

#

thats me though

topaz fjord
#

Funny thing is that I don't even give myself perms to update prefix

west raptor
#

sad

topaz fjord
#

tb!set prefix gay

#

I bored it cus I'm dumb

#

great

#

Oh wait

#

This is dev

#

Fuck

bright spear
#

ew bots that restrict stuff to admin perms

west raptor
#

i only do that for prefix

#

dont kill me

#

pls

sly girder
#

But guild managers should be able to change bot settings too

bright spear
#

^

west raptor
#

true

sly girder
#

Even more, if you are doing some admin panels, this validation should be true on web site too 😄

topaz fjord
#

unless you do per user prefix mmLol

wide ruin
#

How do you describe the dangers of eval to somebody easily?

sly girder
#

that kinda cool, but a huge data holding 😄

topaz fjord
#

you tell them

#

If you keep open up eval I can destroy your server

#

Ez

sly girder
#

eval is not eval its evil

#

JS devs knows that 😄

wide ruin
#

Accurate

sly girder
#

Shit, why you even do eval in your bots?

west raptor
#

i dont know

topaz fjord
#

bc

wide ruin
#

Bagel bot has it, and is restricted to bot owners, and checks for user IDs and tag just to be safe

west raptor
#

if you do in like

#

a

topaz fjord
#

I want discord to add another way to confirm it's u

#

Inb4 d.js checks tokens mmLol

sly girder
#

@topaz fjord you can not fake discord ID

#

of message author

west raptor
#

big server

topaz fjord
#

You can type an I'd wrong mmLol

west raptor
#

people think you cool

#

yes

wide ruin
#

Well it's safer to check both

sly girder
#

I do not have even owener commands 😄

#

Yeap, but than i should change in bot validation if I will change my nickname or my Discrod Turbo ends

topaz fjord
#

If you have nitro you can fake a discord tag

sly girder
#

Yeap, but not ID

#

So only ID is fine

west raptor
#

id is unique

sly girder
#

Better is a Array of ids

west raptor
#

the only ids that are the same iirc

#

are

wide ruin
#

And tokens can be bad to have

sly girder
#

and then something like in_array 😄

west raptor
#

guild ids and default role ids

earnest phoenix
topaz fjord
#

windows vps

#

I found your problem

sly girder
#

@earnest phoenix does your VPS has DE on it?

earnest phoenix
#

the vps is windows

sly girder
#

yeap, answer is message up

earnest phoenix
#

I use windows because its easier for me

sly girder
#

That is your problem, its windows 😄

#

Learn some linux, all server work is linux, even windows has build in linux core support 😄

#

And supports bash like commands

earnest phoenix
#

no im never using linux

sly girder
#

@earnest phoenix you will not? 😃

west raptor
#

linux is awesome

#

(even though i havent used linux yet)

sly girder
#

linux is main for server structure

west raptor
#

i just know the benefits of using linux

#

and its a lot

sly girder
#

I just do ssh root@myserver and do pm2 restart bot to restart my bot 😄

#

ez

earnest phoenix
sly girder
#

Yea, more memory, more virtual CPUs, even if you do not need them 😄

#

Shit code? Nah, that a low memory on my server 😄

#

I just need more mem and the problem with low mem will go

earnest phoenix
#

52 Gigs? now that's a bit much

#

You don't need that much RAM for a node application.

sly girder
#

I can not image for what I will need 52 gigs?

#

Only i will spam shit in my Redis server

inner jewel
#

even spamming redis memory usage is fairly low :^)

earnest phoenix
#

it dont even let me

#

it just dont turn on apparently I have too many GPUs

#

4 isnt that many

west raptor
#

what

earnest phoenix
#

omg i connected to my vps on my phone! @topaz fjord

#

yay..?

#

i didnt know I could!

west raptor
#

i should get a vps soon

earnest phoenix
#

It's common knowledge

#

use mine <@&265158261945270273>

#

(or so I hope)

west raptor
#

wha

earnest phoenix
#

o shit

west raptor
#

why did you

#

ping

earnest phoenix
#

l

#

use mine @west raptor

west raptor
#

inb4 ban

earnest phoenix
#

no pls

queen sentinel
#

did someone say

#

Ban?

earnest phoenix
#

o shit

#

gotta run

#

hey guys

#

so i made this locked command thing, and i noticed that it takes sometime for the vote to sync

#

is this typical

west raptor
#

yes

#

iirc

topaz fjord
#

@queen sentinel did someone say get out jonny

#

oh yeah

#

that was me

bright spear
#

ew votelocks

quartz kindle
#

ew votelocks

earnest phoenix
#

we votelocks

west raptor
#

skcoletov we

rustic axle
#

You need that much ram for a node.js app if you refuse to use db's and use arrays instead and use loops that check for responses instead of async functions bloblul

earnest phoenix
#

@rustic axle Eh, not really

#

Node.js apps are limited in RAM anyway

#

I think 64-bit is limited to about 1GB of RAM?

#

yoyoyo

inner jewel
#

what

#

32 bit is limited to 4GB

earnest phoenix
#

oh

#

hi natan

inner jewel
#

64 bit is limited to 18 quintillions or something

#

2 ^64

#

18446744073709551616 bytes

earnest phoenix
inner jewel
bright spear
#

"good news: we dont know what it is anymore"

earnest phoenix
#

That's actually bad news
you do want to know your limits

inner jewel
#

on any proper 64 bit runtime you don't need to care about memory limits

#

we're not even close to reaching 64 bit ram limits

brisk notch
#

isnt it like billion to trillion gigabytes

earnest phoenix
#

@bright spear remember listcord lmao

rustic axle
#

Hand wiring ram to your motherboard to get more ram slots mmLol

#

Time to solder on my cpu mmLol

earnest phoenix
#

what

brisk notch
#

lmao yes

earnest phoenix
#

how about

#

replace your hard drive by using your ram as your disk

#

(which is possible)

#

Speeeeeeeeeeeeeeeeeeeeeed

#

no saves but

#

SPEDDDDDDDDDDDDD

quartz kindle
#

battery powered persistent ramdisk

quaint aspen
#

I am a noob in programming. just to get that out there lol. I created a bot for a game that calculates data for the players of that game but the bot seems to slow down a bit or have some issues. I was wondering if anyone feels like taking a look at some of the code and giving me some advice. I will know I need to rewrite it if I am told it is utter trash lol. I just want a few pointers. any help appreciated.

earnest phoenix
#

what libary?

#

library *

scenic charm
#

i found the code

#

const ddiff = require('return-deep-diff');
module.exports = (oMember, nMember) => {
console.log(ddiff(oMember, nMember));
};

#

someone can help me ?

earnest phoenix
#

Are u trying to run just that code?

#

Because right there ur exporting an anonymous function

#

And what is ddiff

craggy fox
#

@quartz kindle my css code that I used last time stopped working, I checked it out but couldn’t find the reason

#

Do I send the code?

topaz fjord
#

send it in hastebin

knotty steeple
#

stealing code not knowing what it does

craggy fox
#

I coded it last time but for some reason it isn’t working

#

Hastebin isn’t working for me so I’ll use pastebin @topaz fjord

earnest phoenix
#

idk much about html

#

so correct me if im wrong

#

but why is there a paragraph in the header

rustic axle
#

:thonkicide:

earnest phoenix
#

amonkaS that html

craggy fox
#

Html and css

#

Because I wanna have a text

topaz fjord
#

The CSS classes might have changed

craggy fox
#

There is internal css.

#

I rechecked

#

It’s the same

#

That’s what’s driving me crazy

brave wedge
quartz kindle
#

@craggy fox this is whats happening

#

dbl is putting your css code inside <p> tags

craggy fox
#

i didnt

quartz kindle
#

try minifying the css

craggy fox
#

oh nvm

quartz kindle
#

or at least remove the excessive spaces/lines

craggy fox
#

ok

#

@quartz kindle the button color isnt changing correctly on hover, its supposed to change to red but its changing to blue ish

quartz kindle
#

if you use !important on the base element, hover will get overriden by it

#

unless you use !important on the hover too

craggy fox
#

how do i do that?

#

also how can i align the widget from dbl to be centered on my website?

#

@quartz kindle

quartz kindle
#

your css is repeating the white on hover

#

.wrapper-page .longdescription .content .button:hover {
background-color: white

ruby dust
#

can bots see their own messages regardless of the read message history permission?

quartz kindle
#

for some time yes i think

#

it shows up in the logs

#

but when i tried accessing old messages later, i got errors

#

so there is a certain timeframe or something else until the message history removes access to it

ruby dust
#

that's weird, because I know you as a user are always able to see your own messages even if other messages are hidden by the permission

quartz kindle
#

not always

#

i've seen my own messages get lost in message history

inner jewel
#

that's clientside

#

if you restart the client they're gone

ruby dust
#

no natan

#

that's what I've been saying

#

after a restart the client still fetches my own messages

#

back in the server that has a verification channel, you have to introduce yourself and see if you get verified, I waited 2 days knowing that there have been a lot of other messages sent by other users already but the client has been fetching only my messages

lusty dew
#
    at Object.module.exports.run (C:\Users\User\Desktop\No name\commands\test.js:9:29)
    at Client.client.on (C:\Users\User\Desktop\No name\index.js:61:31)
    at Client.emit (events.js:182:13)
    at MessageCreateHandler.handle (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\User\Desktop\No name\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)``` This is the error I am getting
#

    if(!message.channel.nsfw) return message.reply(`Sorry, NSFW Commands can only be used in NSFW Marked channels only`)
    let gRole = message.guild.roles.find(`name`, "18+")
    if(message.author.roles.has(gRole)) return (`Sorry you need the ${gRole} role to use this command`)
#

Here is my code

earnest phoenix
#

message.author.roles is undefined

#

.... author.roles

#

....

lusty dew
#

?

earnest phoenix
#

author is a User, and users dont have roles

#

use message.member

lusty dew
#

AH

#

Ok damn

#

Ty ty

earnest phoenix
#

👌

#

@lusty dew try js message.member.roles.has

lusty dew
#

Ok

#

I did

#

(node:8104) DeprecationWarning: Collection#find: pass a function instead

#

Returned that

earnest phoenix
#
    if(!message.member.roles.has(gRole)) return message.channel.send(`Sorry you need the ${gRole} role to use this command`);
#

put !

lusty dew
#

It doesn't return that

#

It doesn't return the message i put in

earnest phoenix
#

you have a command handler

#

?

lusty dew
#

Nvm

earnest phoenix
#

you can help me?

#

with a vote

#

for testing

lusty dew
#

@lusty dew, Sorry you need the null role to use this command

#

This is what it replies with

#

it says null instead of the role

earnest phoenix
lusty dew
#

Doesn't work

#

AOh well gtg

#

I will figure it out later

earnest phoenix
#

return (`Sorry you need the ${gRole} role to use this command`)

#

??

#

return

#

just return

#

???

#

put message.channel.send

marble elm
#

how can i see the amount of votes for my bot through the API?

rustic axle
earnest phoenix
#

check the api docs awesmart

idle bough
#

I have created a bot from the discord py api and I was wondering how to, firstly share it with other people, and secondly how to set up commands like !setup where admins can change certain variables, I have read the API but I am still lost

earnest phoenix
#

to share it with others, go to the application page where you created it, and make it public (there is a checkbox option), then you can generate and share the invite link https://discordapi.com/permissions.html

#

the second part of youre questions where a command changes a variable is something you can figure out with a little bit of simple coding knowledge and problem solving skills

#

but to store them, such as settings, you should look into a database.

idle bough
#

Thanks, one other thing, would 1 single instance of my python script running on my VPS work on multiple discord servers

earnest phoenix
#

yes, until you reach 2500 servers, then oyu have to "shard" -- but probably no need to worry about that now 😃

ruby dust
#

that is exactly how it works

#

bot being added to servers by users and they can use it there as well

idle bough
#

I'd have thought that multiple instances of the bot would need to run on my VPS

quartz kindle
#

a single instance can run up to 2500 servers

#

and thats a limitation imposed by the discord api, not the script itself

#

theorically, there is no limit on how many servers a script could handle, except for hardware/ram limits

#

i dont know about python, but nodejs for example is designed for handling millions of connections per second

#

any programming language could theorically do the same, if built properly

idle bough
#

Would using a text file to store variables work instead of a database?

ruby dust
#

why am I laughing at this

versed turtle
#

can someone help me create a bot like Dyno please

quartz kindle
#

@idle bough it would work, yes. many people store variables in json files

#

but there are drawbacks you must be aware of

#

first of all is the amount of disk operations you're doing with reading and writing to an external file, you want to keep those to a minimum, for example never do read/write operations everytime someone does a command, rather do one read operation and keep the variable in memory and only write when its changed

#

and second is the reliability. external text files are unreliable because they are locked during read/write, which means if your script exits or crashes for any reason, your entire file will be destroyed or corrupted

idle bough
#

So a database would be better

quartz kindle
#

having a proper database such as mysql, sqlite, mongo, etc... solve this issue by creating a layer that does that for you

#

they work in memory most of the time, so access is fast, and when reading/writing, they do so in a separate process to ensure the file doesnt get modified if it fails

earnest phoenix
#

they do locking

#

and dont use sqlite

drowsy lily
#

whats wrong with sqlite?

earnest phoenix
#

its dogshit slow

drowsy lily
#

nothing wrong with that

earnest phoenix
#

ok

idle bough
#

Yeh i've used MySQL before, just didn't want to have to go there

drowsy lily
#

only bad if you need a fast db which 95% of users dont

#

also theres a big difference between using plain json files and using sqlite (which is, indeed, a file unless you run it in memory)

quartz kindle
#

you can always create a memory-allocated folder in linux and store the sql file there

#

and then do regular backups

#

if im not mistaken, most linux distributions mount /tmp in ram instead of disk

drowsy lily
#

putting your database into /tmp ablobsweating

quartz kindle
#

just do regular backups and it should be fine

#

if you need the extra speed that is

drowsy lily
#

just write your data to /dev/null for maximum speed :^)

quartz kindle
#

maximum speed and unlimited storage :3

green pendant
#

Is there is any bot that can make a rainbow role

inner jewel
#

no

#

discord does not allow rainbow roles

#

bota that do them can get banned

green pendant
#

I mean the bot that can change the role color in seconds

slender thistle
#

That's literally what rainbow roles are

#

And your question has been answered already :^)

green pendant
#

Thnx

tardy shoal
#

hello can one help me with one thing ?

#

when a member react a message, get a role..

#

:v

quartz kindle
#

use reactioncollector

boreal acorn
#

does anyone know how to make curl not verify/disable the ssl for php

sullen path
#

-k option

boreal acorn
#

i mean for php

sullen path
#

does anyone know how to make curl not verify/disable the ssl

boreal acorn
#

forgot to say for php

sullen path
#

are you running curl with php or are you curling a php page?

boreal acorn
#

curling

sullen path
#

-k option will disable SSL cert checking

boreal acorn
#

and for curl with php?

sullen path
#

are we talking about the same curl?

boreal acorn
#

idk anymore, what im trying to do is with curl in php trying to load a page that has an https to get json data from it. its giving me an connection refused. but if i tried postmaster with ssl verification off it works.

earnest phoenix
quasi sandal
#

@boreal acorn use guzzle instead of curl for php

boreal acorn
#

does not work with php 7

quasi sandal
#

Lol wut

#

I'm using it with 7.2 fine

boreal acorn
#

hmm weird

quasi sandal
#

What version did you install?

boreal acorn
#

did not do it rn. i was looking at its readme file

quasi sandal
#

PHP has decent backwards compatibility

quartz kindle
#

php version bigger than 5.5

#

7 is bigger than 5.5

quasi sandal
#

Also that

#

The guzzle version is 6

earnest phoenix