#development

1 messages · Page 1065 of 1

earnest phoenix
#

but I don't like headers

opal plank
#

-verify

rocky hearth
#

@fading holly U cant dude

fading holly
#

ok

#

thx lol

opal plank
#

forgot the lucas command

earnest phoenix
#

Wrench is this good?

wheat hornet
#

@earnest phoenix so do u only used html

earnest phoenix
#

I used javascript

#

jquery

#

html

#

css

honest perch
#

use ejs

wheat hornet
#

nice

earnest phoenix
#

and I'm going to be doing php

#

for web panel

honest perch
#

No

#

Don't

wheat hornet
#

Wrench is this good?
@earnest phoenix 👍 👍

honest perch
#

Use ejs

earnest phoenix
#

Don't tell me how to do my stuff xd

honest perch
#

Ejs better

earnest phoenix
#

I do things nice

honest perch
#

Php ew

earnest phoenix
#

I make them look professional tho

#

So I use what I want to use

honest perch
#

Yes but php is bad

wheat hornet
#

let him do how he likes bruh

earnest phoenix
#

I'm good at what I do in a certain way

#

No need to alter that

#

My goal is to be a bit like mee6

#

very modern/easy to use

wheat hornet
#

is the bot invite link working?

earnest phoenix
#

Just gonna take a lot of time

wheat hornet
#

gargle

earnest phoenix
#

well

#

the bot itself hasn't rlly been worked on

#

it has some things

wheat hornet
#

like

earnest phoenix
#

but it's offline rn cause I'm to lazy to turn it on 😂

wheat hornet
#

lmao

earnest phoenix
#

I'm doing website first

#

Then mobile app

#

then the bot

wheat hornet
#

well if u wana make it like mee6 i guess there is also a welcome message type thing

earnest phoenix
#

I will allow everything mee6 does

#

but free

wheat hornet
#

nice

earnest phoenix
#

I don't wanna copy them tho

#

I am my own theme

#

who looks better 😄

honest perch
#

Mee6

earnest phoenix
#

fuck

wheat hornet
#

lol

honest perch
#

Top buttoms

earnest phoenix
#

eh

#

those who over used

#

🙂

wheat hornet
#

mine welcome is like this

honest perch
#

Tbh i would get rid of them

#

Would look more clean

earnest phoenix
#

it's similar

wheat hornet
#

@earnest phoenix i like urs i am with u

earnest phoenix
#

I can easily add the header

#

I need to fix that gap tho

#

although you don't even notice it

#

on the phone itself

slender thistle
#

@opal plank you can't use Luca tags

wheat hornet
#

????

#

@earnest phoenix how long it took u to create the website

clever vector
#

@earnest phoenix

#

How u do website

#

??

wheat hornet
#

JavaScript
Html
css

honest perch
#

With code

clever vector
#

OOOOO

wheat hornet
#

anyone know a good free translate api

stiff stream
#

morefix

#

morfix*

earnest phoenix
#

i actually like bootstrap a lot more then bulma surprisingly

restive furnace
#

i like nothing :v

earnest phoenix
#

having a css framework speeds up my frontend dev time like 10fold

#

and i do not enjoy frontend so thats always a plus lol

#

so

#

is there a way to make server count without top.gg

#

wdym

#

on discord.js

#

like the number?

#

yeah

#

i believe it is

#

k thx i will try it

#

wait no

#

its client.guilds.cache.size

#

@earnest phoenix

#

k

opal plank
#

@slender thistle ah that explains why

delicate shore
#
 if(command === "bird"){

const bird = [`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(1).jpg?v=1594973390465`,
            `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages.jpg?v=1594973390591`,
            `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fdownload%20(5).jpg?v=1594973391172` ,
           `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fdownload%20(4).jpg?v=1594973392160`,
              `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(4).jpg?v=1594973428871`,
          `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(5).jpg?v=1594973429215` ,
            `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(3).jpg?v=1594973429240` ,
           `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(2).jpg?v=1594973429818`]

let final = `bird[Math.floor(Math.random() * bird.length)`

const embed77 = new Discord.MessageEmbed()
          .setTitle(`Here is a bird`)
          .setImage(`${final}`)
          .setFooter(`${PREFIX}help`);
        msg.channel.send(embed77);


}
           ```
earnest phoenix
#

you see tge pike at fibap?

#

line at final

delicate shore
#
embed.image.url: Not a well formed URL.```
earnest phoenix
#

remove `

#

at the let final

delicate shore
#

wheat

#

what

earnest phoenix
#

1 sec

delicate shore
#

ok

earnest phoenix
#
if(command === "bird"){

const bird = [`https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(1).jpg?v=1594973390465`,
            `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages.jpg?v=1594973390591`,
            `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fdownload%20(5).jpg?v=1594973391172` ,
           `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fdownload%20(4).jpg?v=1594973392160`,
              `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(4).jpg?v=1594973428871`,
          `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(5).jpg?v=1594973429215` ,
            `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(3).jpg?v=1594973429240` ,
           `https://cdn.glitch.com/aa72828e-329b-4d4b-a55d-e8f868d6e1c2%2Fimages%20(2).jpg?v=1594973429818`];

let final = bird[Math.floor(Math.random() * bird.length);

const embed77 = new Discord.MessageEmbed()
          .setTitle(`Here is a bird`)
          .setImage(final)
          .setFooter(`${PREFIX}help`);
        msg.channel.send(embed77);
}
#

There

delicate shore
#

what u changed

earnest phoenix
#
let final = `bird[Math.floor(Math.random() * bird.length)`

To

let final = bird[Math.floor(Math.random() * bird.length)
#

And

.setImage(`${image}`)

to

.setImage(final)
delicate shore
#

ok

#

thanks

earnest phoenix
#

Np

#

you shouldn't create the array everytime you execute your command

#

that's a memory leak

#

create it once somewhere and keep a reference to it

#

also hayper you should not spoonfeed code

#

Alright

#

heavily discouraged

#

I see

#

Sorry for my action, i wont do it again.

delicate shore
#

didn't work

#

that didn't work anyways

earnest phoenix
#

no worries it's just a heads up

restive furnace
#

when i was learning i made my help command automated, but it always created new array at command executing so uhh.. very inefficient code

#

(my code)

earnest phoenix
#

yeah that's a mistake people make very often

#

they keep rebuilding the help command when they can do it once and cache the result of that

#

because it's highly unlikely your commands are going to change during runtime

#

even if they are you can rebuild it again so

#

¯_(ツ)_/¯

hazy sparrow
#
const { MessageEmbed } = require('discord.js')


module.exports = {
    name: '',
    description: "",
    

    execute(message){
        const taggedUser = message.mentions.members.first();

        if(taggedUser){
        
            if (!message.member.hasPermission('BAN_MEMBERS')) {
                message.channel.send("you don't have permission to kick this user! ")
            }
                const embed = new MessageEmbed()
                .setDescription("***:bowyesmark: "  + taggedUser.user + " has been successfully banned*** ")
                .setColor(0x43b581)  
                if(message.member.roles.cache.has('562486904935940106')){
                guild.taggedUser.ban().then((member) => {
                
                    message.channel.send();
                }).catch(() => {
                    
                    message.channel.send('you cant ban this person!');
                });
            } 
               if (!taggedUser) {
                   message.channel.send('Next time, tag a person to ban.')
               }
        }  
        
    
}
}

not sending any message, not banning, no error in the console. any help?

earnest phoenix
#
                roles = sorted(user.roles, key=lambda r: r.position)
                for role in roles:
                    if str(role.color) != '#000000':
                        color = role.color
                    if 'color' not in locals():
                        color = 0
                role_names = ' `,` '.join([r.name for r in roles if roles != '@everyone']) or 'None'```

**Hi, I use this code to get user roles, but it is still displayed in the `@everyone` output section
What should I do?**
slender thistle
#

user.roles should already be sorted as-is

#

You are comparing the roles list to a string

night bridge
#
const Discord    = require("discord.js");
module.exports = {
    name: "ping",
    aliases: "",
    group: "Info",
    desc: "Return Latency and API Ping",
    usage: "<input>",
    run: async (client, message, args)=>{
        const msg = await message.channel.send(` Pinging...`);
        let embed = new Discord.MessageEmbed();
        embed.setDescription(`\`${msg.createdAt - message.createdAt}ms\``);
        msg.edit(embed);
    }
}

how to get name or desc inside run?

earnest phoenix
#

@slender thistle Is it possible to send me the correct code?

slender thistle
#

Compare r.name != '@everyone'

warm marsh
#

@night bridge change the arrow function to a normal function then you can call this.

night bridge
#

can i just added (client, message, args, name)=>{...}

warm marsh
#

Doing that would require you to pass it when you call the function.

night bridge
#

so it not work

warm marsh
#

It would work but is long winded.

earnest phoenix
#

@slender thistle thanks gifbase_164

warm marsh
#
run: async function(client, message, args) { console.log(this.name); }```
night bridge
#

thanks for guide

neon matrix
#

is there a vote listener in JDA?

earnest phoenix
#

Is Tim here?

still merlin
#

Anyone know why my bot isnt returning a error message when I get something wrong. In my eval command. I can eval things like message.author but getting something wrong nothing happens.

code

client.on("message", (message) => {
  const args = message.content.split(" ").slice(1);

  if (message.content.startsWith(prefix + "eval")) {
    if (message.author.id !== "529770099285032980")
      return message.channel.send(
        "**error** Only the bot owner can execute this command!"
      );
    try {
      const code = args.join(" ");
      let evaled = eval(code);

      if (typeof evaled !== "string") evaled = require("util").inspect(evaled);

      message.channel.send(evaled);
      message.channel.send(
        "``❌ Error preforming eval command``" + `(${err})`
      );
    } catch (e) {}
  }
});```
earnest phoenix
#

^

still merlin
#

I removed some code that triggered the error message O.o

#

I added some code so when theres a error it would return a err message but it didnt.


      if (err)
        return message.channel.send(
          "``❌ Error preforming eval command``" + `(${err})`
        );

      message.channel.send(evaled);
    } catch (e) {}```
#

So I put my error message in the } catch (err) { here }

#

(I forgot to change my e to err last night)

earnest phoenix
#

How can I fetch a certain guild member

warm marsh
#

Via their id.

earnest phoenix
#

yea i got it

#

guild.members.fetch(id)

warm marsh
#

Yeah

delicate shore
#

How To do this

#

Pls help

#

How to shift

hasty sparrow
#

Shift?

delicate shore
#

Like

#

Not shift

#

I mean what kind of changes I have to make

hasty sparrow
#

Nothing

delicate shore
#

they are staying

hasty sparrow
#

Most libraries will handle the domain change for you

delicate shore
#

Saying*

#

Ok

old shadow
#

discord.js users use this if people try to @ everyone

bot.on('message', function(message){
  if(message.content === '@everyone')
  {
    message.react("😡")
 }
})

#

🤣

earnest phoenix
#

omg so funny 🤣 🤣 😂 😂 😂

marble juniper
#

more like

client.on("message",e=>{e.content.includes("@everyone")&&e.channel.send(`<@${e.author.id}>`)});
pale vessel
restive pebble
#

lol

marble juniper
#

@pale vessel yes

spare mirage
#

anyone else got a dm from discord

marble juniper
#

yes

spare mirage
#

:)

marble juniper
#

developer tos update

pale vessel
#

everyone that has an application did

spare mirage
#

finally

marble juniper
#

so pretty much every bot dev

restive pebble
#

discord is being gay

pale vessel
#

discord mass dm weirdchamp

restive pebble
#

kek

marble juniper
#

api abuse

hazy sparrow
#

boeing hows your day

marble juniper
#

ban @hazy sparrow

hazy sparrow
#

oof

marble juniper
#

raid bots bad

hazy sparrow
#

what raid bots?

#

i never talked about them

marble juniper
#

you know logs exist

hazy sparrow
#

.

marble juniper
#

mods will still see what u sent

#

lol

restive pebble
#

good

#

@pale vessel u also got an dm?

marble juniper
#

also this is about development

pale vessel
#

no, because i definitely did not create an application for my bot

#

smh

marble juniper
#

and my brain is developing backwards

pale vessel
#

^

restive pebble
#

oh

hazy sparrow
#

your brain is evolving link

restive pebble
#

info bots

marble juniper
#

we are all bots

restive pebble
#

raid bots

#

normal bots

marble juniper
#

raid bots
@restive pebble no

restive pebble
#

ok bye

hazy sparrow
#

raid bots are not bots? Thonk

marble juniper
#

raid bots are breaking tos

#

lol

restive pebble
slender thistle
#

Off-topic

hazy sparrow
#

well they are bots so we can talk about them here

tulip ledge
#

I can't seem to allign them

slender thistle
#

well they are bots so we can talk about them here
@hazy sparrow They are prohibited so no

hazy sparrow
#

oof then

restive pebble
#

api abuse

tulip ledge
#

And also the left column the search bar if put to 100% width goes outside of the box

hazy sparrow
#

what about developing a raid-a raider's raidbot's dm's

#

is that prohibited?

earnest phoenix
#

anything that spams and/or abuses the api is prohibited

#

even if it's a "no u" attack

hazy sparrow
#

no u attack lmao

slender thistle
#

Raid a raider
surely a good idea... if you ignore the fact that you still abuse the API

hazy sparrow
#

well, the raider abused the api so why cant we?

#

🧠

slender thistle
#

Just because X or Y "did it" doesn't mean you are allowed to

earnest phoenix
#

they're kidding

slender thistle
#

Anyhow, off-topic content, move away from this channel

earnest phoenix
#

i hope

slender thistle
#

Optimal solution

hazy sparrow
#

alright

tulip ledge
marble juniper
#

no

tulip ledge
marble juniper
tulip ledge
#

Yes whats the issue?

#

This is development dude

marble juniper
old night
#

WHAT IS THE PROBLEM

#

with that

marble juniper
#

bot development

tulip ledge
#

(bot)

#

Is between ()

#

Any kind of development can be talked about here

delicate shore
#

What API is this

marble juniper
#

idk

earnest phoenix
#

probably scraping youtube

sterile minnow
#

Heya,

I have this issue:

A bot counts 5 servers together and the biggest Guild has 10k members.

Its giving me somehow this: 5533361643759861861107

This is the Code:

 const math = require('mathematics-js-example');

let all = math.add(greenflame,blueflame, yellowflame, redflame, purpleflame);
     console.debug("[DEBUG] All Members: " + all)

#

can someone help?

delicate shore
#

E

#

Ok

tulip ledge
#

Looks like they’re probably strings

#

Try to parseInt all of the values

sterile minnow
#

its like this:
redflame = client.guilds.resolve("583253117735272448").members.cache.size

delicate shore
#

probably scraping youtube
@earnest phoenix
He said discord-youtube-api

#

Npm

#

One

sterile minnow
#

Try to parseInt all of the values
@tulip ledge how?

tulip ledge
#

Parseint??

sterile minnow
#

yes. I'm dumb currently

tulip ledge
sterile minnow
#

so fucking confused lel

tulip ledge
#

Just read it dude

sterile minnow
#

i do but i'm dumb lel

slender wagon
#

read it again

tulip ledge
#

You clearly havent read it

#

The first line litteraly sais whay it does

sterile minnow
#

but for what do i use it in my code

summer frigate
#

oh nb

#

mb

sterile minnow
coral lichen
#

NaN = not a number

sterile minnow
#

i know

coral lichen
#

yeah the error explains it self

sterile minnow
#

I know

tulip ledge
#

Show code

sterile minnow
#

but it should be a nuber

#

i think i'm dumb wait

coral lichen
#

just parseInt it honestly if you ened to

#

need*

tulip ledge
#

U prob fucked up the parseint

coral lichen
#

^

sterile minnow
#

Now we have it

#

i stored greenflame wrong

tulip ledge
#

Show code

sterile minnow
#

Works nowe

#

i had greenflame stored wrong

tulip ledge
#

Aight

sterile minnow
#

ty

tulip ledge
#

Its funny how yesterday everyone was doing web development and now there’s noone who knows how to align a div Thonk

slender thistle
#

Which part are you trying to align exactly?

tulip ledge
#

They're 2 divs wrapped in a div wrapped in a div

#

i'm sad

frank wraith
misty sigil
#

no

tulip ledge
#

Wait what

earnest phoenix
#

their policy update and things

tulip ledge
#

I wish Tim was here he'd prob know how to allign the divs

quartz kindle
#

.>

misty sigil
#

Tim knows a lot.

tulip ledge
#

^-^

frank wraith
#

but my bot not join this server

tulip ledge
#

Literally say his name and he's here lmao

misty sigil
#

It needs to be approved

frank wraith
delicate shore
#

How to make it show my bot is typing

#

Like many bot does

#

But my bot doesn't show that black sheep is typing

earnest phoenix
#

in which library

quartz kindle
#

im a bot that auto-responds to my name

misty sigil
#

smart

clever vector
#

Hi

delicate shore
#

Discord.js v12

#

Tim

tulip ledge
#

I think u can do <Channel>.startTyping

quartz kindle
#

.>

tulip ledge
#

Or something like that

frank wraith
#

It needs to be approved
@misty sigil owh my bot must to be approved it

delicate shore
#

Ok

#

Thanks

tulip ledge
#

So Tim I suppose you don't know how to allign the divs then?

#

Wellp then I wasted my time trying to disable the scroll function pandasad

frank wraith
#

oke fine i leave

#

bye

earnest phoenix
#

How to add music command

tulip ledge
#

what library?

earnest phoenix
#

Bo

#

No

#

Iam using bot designer app@tulip ledge

#

Give me coomand

#

Coomand

indigo matrix
#

Spoonfeeding is not allowed here, we cannot give you the whole code of a command.

#

We will help you though.

earnest phoenix
#

K

#

Ok help me

white stone
#

it seems I'm not the worst coder here

indigo matrix
#

I don't really use bot designing apps

earnest phoenix
#

Np

indigo matrix
#

I code the bot myself

earnest phoenix
#

But give me coomand pls

white stone
#

what bot did you make Nasachan?

earnest phoenix
#

😓

indigo matrix
#

@hushed furnace

white stone
#

oh nice

indigo matrix
#

I made that ^

white stone
#

mine hasn't been added here but I made it today in like a 1 hour project

#

and it's don't laught Casually Ultimate Master bot

indigo matrix
#

oh wow

white stone
#

short for C.U.M

indigo matrix
#

lol

earnest phoenix
#

Help me

white stone
#

and there are more bugs than it's actually good

earnest phoenix
#

😑

white stone
#

but thats what makes the bot amazing

#

might work out the bugs if I ever want to or have the time to though

indigo matrix
#

We shouldn't be talking about that here since it's offtopic...

earnest phoenix
#

Give me command

#

So

#

How to add music command

white stone
#

They won't give you the entire code command, they can help you getting to it but giving out code thats not how it works mate.

jolly quail
#

Ffmpeg is a headache

#

🙄

earnest phoenix
#

K

#

How can bot online 24/7🤔

marble juniper
#

hosting

jolly quail
#

Host it

#

Ya

#

Aws azure heroku

earnest phoenix
#

Idon't have money

marble juniper
#

contabo

jolly quail
#

Heroku

#

Free 5 apps

#

Ig

earnest phoenix
#

Ohh

#

😮

white stone
#

I'm not sure if this guy is trolling

#

or if he's being for real

jolly quail
#

550 hrs or so per month though

white stone
#

I can't read his thoughts

jolly quail
#

Who?

earnest phoenix
#

Who

white stone
#

you Defalter

earnest phoenix
#

No

#

Iam beginner

white stone
#

me to

earnest phoenix
#

😓

spark wing
slender thistle
#

Don't just send the dictionary

spark wing
#

What?

slender thistle
#

Do you know what a Python dictionary is?

spark wing
#

Hm i am new on python, and am trying to learn api, hm idk what python dictionary

#

But how to remove that

slender thistle
#

...so no

jolly quail
#

Key pairs basically..

spark wing
#

Okay

slender thistle
#

...because you decided to ignore to the basics of Python before getting to a complicated library...

spark wing
#

Okay ')

jolly quail
#

Yeah

#

Studying python first

#

Will be better

white stone
#

In coding it's better to start learning the basics and slowly working your way up, never in any coding try doing hard stuff when you are only a beginner, I don't know python that much but want to learn it one day.

signal acorn
#

--> npm install
npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for npmtest-sql-template-strings

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2020-07-17T12_20_24_990Z-debug.log
exit status 1

^^^^^

#

need help with this

#

:

slender thistle
#

You are sending the dictionary itself. Two possible solutions for you are:

  1. Iterate over the dictionary keys, access a value under the key (hell, you can just iterate over dictionary.items()), add the text to a string but separate them with \n (newlines)
  2. A list comprehension with iterating over dictionary.items() where k is they key and v is value, then format the string
spark wing
#

Okay, tysm @slender thistle ^^

jolly quail
#

He said he doesn't know a dictionary though..

spark wing
#

Yeah, but i just say thanks:v

jolly quail
#

Lol

slender thistle
#

Google is easily accessible

jolly quail
#

His solution requires dictionary knowledge I meant

slender thistle
jolly quail
#

@spark wing learn dictionary first

white stone
#

So I'm learning how to code right, and I ran into a problem with Java script however it doesn't say that there are problems, when I use my bot I used the Args[0] but the prefix that I put doesn't seem to work

#

the prefix I meant for it is $

earnest phoenix
#

so my webhook doesnt work :/

white stone
#

but it seems to work with other things aswell

#

So any Java Scripters who know how to fix this current problem I have?

jolly quail
#

Kono giorno giovanna niwa yume ga aru xD

spark wing
#

@earnest phoenix hellooo

jolly quail
#

Lemme read

white stone
#

lmao

spark wing
#

@jolly quail okay ojay

digital ibex
#

im a java scriper!!!

spark wing
#

@slender thistle okay tysm

digital ibex
#

what do u need sony?

white stone
#

alright @digital ibex do you know how to fix this problem?

digital ibex
#

whats the problem?

#

looks fine to me

earnest phoenix
#

KONO DIO DA

white stone
#

I created a prefix which is supposed to be $

#

and it's supposed to only work with $

jolly quail
#

Just search if

digital ibex
#

send ur code

jolly quail
#

The message starts with

white stone
#

but it works with other things like ^ or ù or % or ! etc etc

jolly quail
#

Ur prefix

digital ibex
#

code?

earnest phoenix
#

someone help my bot doesnt log when someone votes :/

jolly quail
#

Ya

digital ibex
#

delete

jolly quail
#

Check if

digital ibex
#

t

#

delete

white stone
#

t?

digital ibex
#

ur message

jolly quail
#

Oof

digital ibex
#

@white stone

jolly quail
#

Token

#

Delete it

#

Don't reveal token

white stone
#

understandable my bad

digital ibex
#

send it without the token this time

jolly quail
#

Anyway

white stone
#

ye

jolly quail
#

I got it

#

Just see if that thing

#

Starts with ur prefix

white stone
jolly quail
#

U splitted the prefix but matched the prefix with yours?

earnest phoenix
#

help my bot doest well log when someone votes

white stone
#

wait what Loom?

#

where did I split the prefix

digital ibex
#

switch is fine

white stone
#

ah

jolly quail
#

Substring*

digital ibex
#

if u do $sex it won't respond?

jolly quail
#

I meant

white stone
#

I mean technically it does work but it doesn't work fully as it works with other prefixes that I didn't put

#

no it does

#

wait look

digital ibex
#

substring is fine too, what?

jolly quail
#

@digital ibex bro `sex will respond too

#

I mean anything+sex

white stone
digital ibex
#

oh right

obtuse jolt
white stone
#

yes thats the problem

jolly quail
#

He didn't match the prefix

white stone
#

aight Loom can you help me on that as I'm fairly new to coding

digital ibex
#

youu njust neeed to check if the message doesn't start with your prefix

jolly quail
#

ya

#

.startswith or something is there

#

I guess?

quaint hornet
#

how can i get the current time of music

digital ibex
#

if (!message.content.startsWith('ur prefix')) return

white stone
#

lemme see

digital ibex
#

time of music?

quaint hornet
#

then is playing on the voice channel

white stone
#

so do I put that right after the prefix?

digital ibex
#

i mean

#

you could just use Date.now() ?

jolly quail
#

@digital ibex no bro

#

He's asking time of music

digital ibex
#

what

jolly quail
#

Not system time

digital ibex
#

wtf is time of music?

white stone
#

aight ok I think I have it now

#

ty let's see if it works

jolly quail
#

Like 1:00

quaint hornet
#

for example

jolly quail
#

Mins have passed

winter basalt
#

he is probably talking about a music feature

quaint hornet
#

i put a music to play on a voice channel using ytdl-core

digital ibex
#

oh right

quaint hornet
#

how can i get the time the time of the music of the voice connection

hazy sparrow
#

is there a way i can make "chances" like i want my bot to execute either a or b when doing bow coinflip but i want the chance for a to be executed more than the chance for b to be executed

jolly quail
#

Hmm ytdl must have that function?

#

Ig

digital ibex
#

try taking away the full length of the song by the timestamp now, that might work

#

and u can format it however u want

#

cuz it'll return a timestamp

quaint hornet
#

maybe it have but i can use that

jolly quail
#

Date.now can be used that way

#

Yeah

quaint hornet
#

its a good ideia

#

thanks

digital ibex
#

np

white stone
#

@jolly quail @digital ibex Ty you fixed the problem I'm grateful

jolly quail
#

Np

digital ibex
#

you should probably learn basic javascript before trying to learn nodejs and using a library

old night
#

hmm

#

i want to host my bot on heroku but is quick.db allowed there??

jolly quail
#

Lol i learnt javascript while developing my bot

old night
#

me also

jolly quail
#

A good starter project

old night
#

i never knew anything about js before i coded my bot

jolly quail
#

Idk abt quick.db sorry xD

old night
#

i want to host my bot on heroku but is quick.db allowed there??
@old night

#

umm

earnest phoenix
#

don't use free hosts

jolly quail
#

Hmm

#

Heroku can be hacked or what?

earnest phoenix
#

no

#

well sure it can be

#

but heroku is not meant for bots

old night
#

i know

#

but..........

#

my bot is wrkin just fine with heroku my music bot

earnest phoenix
#

you'll experience huge throttling if you get more than 2 commands per second which most bots here don't because they are trash

#

put stress on your bot and you'll see how bad heroku is

old night
#

ohhhhhhhhhhhhhhhhhhhhhhh

earnest phoenix
#

how can i add the mute role to someone after rejoining the server using fs ?

golden condor
#

Heroku doesn't support quick.db due to it requiring integer.

old night
#

OMG

#

@golden condor salvage_dev

#

Lol

golden condor
#

I am not salvage_dev

old night
#

i know

#

but u are in his server

earnest phoenix
#

stop chatting here !1

old night
#

ok

golden condor
#

@earnest phoenix no you can't use FS because FS is the node file system.

earnest phoenix
#

if you want sticky roles, store the ids in a database

golden condor
#

^

#

If you are trying to read a JSON file with FS, that has nothing to do with the role stuff.

#

Goddamn mobile I don't wanna use caps for this

earnest phoenix
#

can u give me a tutorial video or smth ?

golden condor
#

Hold on. Let me read your mind and find out exactly what you mean and then go and search it up for you because why would you do it yourself?

earnest phoenix
#

there isn't a video for everything 👏

#

you are perfectly capable of doing research for yourself

#

you do not need to mindlessly copypaste from a video

#

you take the development part out of development lol

jolly quail
#

Lol

golden condor
#

Docs exist for a reason

jolly quail
#

Devs aren't copycats

old night
#

YEP

golden condor
#

I swear half the people here don't know how to Google or don't know how to read

old night
#

UMM

#

BUT I DO

#

i hate caps

golden condor
#

Can you shut up?

jolly quail
#

Hmm well sometimes asking other ppl seems a better option than asking google sensei xD

slender thistle
#

Keyword: "sometimes"

quaint hornet
#

why https have to be so hard to work

golden condor
#

Hmm well all the time, checking the docs first is better than asking here xD

earnest phoenix
#

yes

#

that is what you are supposed to do in the first place

#

first do research on your question

#

see if anyone else asked

#

browse forums

#

if you absolutely cannot find your answer then you resort to asking in discord

old night
#

Can you shut up?
@golden condor SHUT UP

slender thistle
#

Both of you cut it out

golden condor
#

smh

#

You know all hope is lost when people can't Google anymore

jolly quail
#

Lol

#

That's the way it's always been

#

Ppl think other ppl would answer fast idk why

#

Most errors.. Just type the log in google and done

restive furnace
#

yes, its way faster than asking from humans

hidden lynx
#

I always say coding is (even if you are a good programmer) 50% actual coding and 50% googling.

jolly quail
#

More than 50% googling

#

XD

hidden lynx
#

XD

jolly quail
#

Actual coding is surprisingly less

#

Google has everything almost

solemn latch
#

Imagine all the work that doesnt get done when Google is down

jolly quail
#

We'll be jobless then

#

Lol

hidden lynx
#

I'm coding everyday from 8 to 5. And still I can't code without having at least 20 chrome tabs open xD

jaunty junco
#
if content:lower():sub(1,#"+mute") == "+mute" then
        local mentioned = message.mentionedUsers
        local idOfGuild = message.member.guild.id

        if idOfGuild == "719486191535390780"
            then message.guild:addRole(mentioned[1][1], 731180560256466954)
        end
    end

when i do +mute <@user> i get this error:

Uncaught Error: C:/Bot/deps/coro-channel.lua:62: C:/Bot/deps/discordia/libs/utils/Emitter.lua:105: C:\Bot\Bot.lua:652: attempt to call method 'addRole' (a nil value)
#

This is discordia btw

finite bough
#

what language is that

#

lua?

jaunty junco
#

yes

finite bough
#

ok no idea sorry

fast yacht
#

@jaunty junco don't you miss those sweet curly brackets?

jaunty junco
#

@jaunty junco don't you miss those sweet curly brackets?
@fast yacht heh?

finite bough
#

wha

jaunty junco
#

what

finite bough
#

it is not discord.js

jolly quail
#

Is mentioned[1][1] giving the right thing?

pale vessel
#

that doesn't even look nowhere like js though

restive furnace
#

I'm coding everyday from 8 to 5. And still I can't code without having at least 20 chrome tabs open xD
@hidden lynx Eh i have ~20 brave tabs open

jaunty junco
#

Is mentioned[1][1] giving the right thing?
@jolly quail yes it gives off the id of the mentioned user

jolly quail
#

Hmm

#

I could only guess that could be error

#

No idea

#

addRole exists

jaunty junco
#

hmm ok

jolly quail
#

Right

finite bough
#

it does i suppose

jaunty junco
#

yeah i checked the documentation like 10 times

jolly quail
#

Lol

finite bough
#

a nil value

jolly quail
#

So u require to pass a user id and a guild id in addRole

finite bough
#

can u try throwing the mentioned[1][1] thingy in the console

jolly quail
#

Ya try it once

jaunty junco
#

maybe if i try

message.member.mentioned[1][1]:addRole()

?

jolly quail
#

And link the doc to addRole pls

#

Idk that lang xD

jaunty junco
#

can u try throwing the mentioned[1][1] thingy in the console
@finite bough hmm i will try to

jolly quail
#

But maybe doc can help

jaunty junco
#

its in the member section tho

jolly quail
#

addRole(id)

#

This is what the doc says

#

It doesn't require guild id i guess?

jaunty junco
#

thats the output of mentioned[1][1]

jolly quail
#

Try removing ,guild id once

#

Just pass user id

jaunty junco
#

?

jolly quail
#

Uhmm

restive furnace
#

"00", i hope this is right

jolly quail
#

addRole(mentioned[1][1])

#

See if this works i mean

jaunty junco
#

the id after mentioned[1][1] is the id of the role

jolly quail
#

Oh

#

Lemme see doc again

finite bough
#

mentioned[1][1] gets the 1st mention?

jolly quail
#

U don't need user id

#

Only role id needs to be passed

#

Doc says

jaunty junco
#

mentioned[1][1] gets the 1st mention?
@finite bough yes

finite bough
#

if mentions are an array

jaunty junco
#

U don't need user id
@jolly quail yeah i see

finite bough
#

isnt it suppose to be 0

#

like arrays start from 0

jaunty junco
#

idk

#

well

#

yes

#

they do

#

what if i just surround the id of the role in "" ?

#

nope doesnt work

#

🤔

jolly quail
#

Hmm

#

Why r u passing user id..

#

Doc says only role id is required

jaunty junco
#

oh i edited that

sudden geyser
#

Arrays in Lua start at 1 if I remember correctly.

jaunty junco
#

its

message.guild.mentioned[1][1]:addRole(731180560256466954)
jolly quail
#

Oof

restive furnace
#

@finite bough its lua

jolly quail
#

That mentioned returns the id

sudden geyser
#

What's the name of the library you're using.

restive furnace
#

in lua arrays start from 1

jolly quail
#

Ur adding role to user id

jaunty junco
#

What's the name of the library you're using.
@sudden geyser discordia

jolly quail
#

User id. Addrole method won't exist obviously

restive furnace
#

you need to fetch/get the user

jolly quail
#

Yep

jaunty junco
#

thats what

local mentioned = message.mentionedUsers

does

jolly quail
#

What is mentioned[1]

jaunty junco
#

it gets the id of the mentioned user

jolly quail
#

A user?

jaunty junco
#

hmmm

jolly quail
#

its

message.guild.mentioned[1]:addRole(731180560256466954)

@jaunty junco

#

Try this

jaunty junco
#

idk about that one to be exact

#

but without it it doesnt work

jolly quail
#

Try it

jaunty junco
#

btw now it gives off this

attempt to index field 'mentioned' (a nil value)
jolly quail
#

Hmm

#

message.guild.mentioned exists?

#

Or message.mentioned

jaunty junco
#

nope

#

only message.mentionedUsers

jolly quail
#

Ya

#

So u were using wrong code lol

jaunty junco
#

which is mentioned

jolly quail
#

hmm

#

message.mentionedUsers[1]:addRole()

#

Try this?

jaunty junco
#

hmmm

#

i will

sudden geyser
#

message.mentionedUsers returns ArrayIterable of User, but that's a user object and not a member object.

jolly quail
#

Mentioned user returns a member right?

#

Hmm

sudden geyser
#

no

jolly quail
#

Oof

jaunty junco
#

what

jolly quail
#

It won't work then

jaunty junco
#

hmmmm

#

but it works with stuff like a ban command

jolly quail
#

Just try it once

jaunty junco
#

why wouldnt it work then?

jolly quail
#

No point in not trying

#

XD

#

message.mentionedUsers returns ArrayIterable of User, but that's a user object and not a member object.
@sudden geyser how will u find the first member then

#

I mean we need member object

#

Iterate and get the first member

#

Use the method on that

delicate shore
#

Does having all code

#

In one file

#

Cause speed issues with bot

sudden geyser
#

I have very little to no experience in Lua, so I'm going off the documentation (https://github.com/SinisterRectus/Discordia/wiki). For example, if you have .mentionedUsers, you could get the first mentioned user, then get their ID to look in the guild.members cache and get them by ID.

delicate shore
#

Or will it just cause me issues

#

With finding commands

restive furnace
#

nah not really, but it light cause u issues

delicate shore
#

Ok

jolly quail
#

Updating code

#

Will be tough

delicate shore
#

I already use that way

#

And if I shift

restive furnace
#

and its bad practice tho

delicate shore
#

To command handler

#

I'll have to do Evey thing

#

Again

jolly quail
#

Hmm

sudden geyser
#

Having all your code in one file is an issue of readability and not taking power of doing it modularly.

jolly quail
#

Won't really take much time

delicate shore
#

But I can find the code

jaunty junco
#

message.mentionedUsers[1]:addRole()
@jolly quail

 attempt to call method 'addRole' (a nil value)
delicate shore
#

With find

#

Command

jolly quail
#

Yeah @jaunty junco

delicate shore
#

Control + F

jolly quail
#

He said User objects r returned

delicate shore
#

I'm not having issues

jolly quail
#

Not Member

delicate shore
#

I wanna make sure my bot doesn't

#

With the speed

jolly quail
#

@jaunty junco get the user ID and search in the guild maybe to get a member

#

Then addRole to that member

jaunty junco
#

but thats what the local mentioned is doing

#

it gets the id of the mentioned user

jolly quail
#

That's a user array

jaunty junco
#

well

jolly quail
#

Not member array

jaunty junco
#

mentioned[1][1] does

jolly quail
#

Hmm

jaunty junco
#

i mean

jolly quail
#

That's just user id

jaunty junco
#

it works in ban commands

jolly quail
#

Hmm

jaunty junco
#

so why wouldnt it work here?

jolly quail
#

Ban doc

#

Lemme see

jaunty junco
#

the fault is probably in the addRole

#

im literally trying everything

#

maybe . instead of : for addRole()

#

nope

jolly quail
#

Equivalent to Member.guild:banUser(Member.user, reason, days)

#

U r supplying a user there

jaunty junco
#

yeah and mentioned[1][1] works for it just fine

jolly quail
#

Cuz it's a user id

jaunty junco
#

it should require used ids for any interaction with a user tho

jolly quail
#

Send that ban command code

#

The one u wrote

jaunty junco
#
if content:lower():sub(1,#"+ban") == "+ban" then
        if member:hasPermission(0x00000004) or member:hasPermission(0x00000008) then
            local mentioned = message.mentionedUsers
            if #mentioned == 1 then
                message:delete()
                message:reply("The ban hammer has come, and it has chose to land on <@!"..mentioned[1][1]..">!")
                member.guild:banUser(mentioned[1][1], "get banned noob", nil)                
            end
            if #mentioned > 1 then
                message:delete()
                message:reply("You can only ban 1 person at a time you bot!")
            end
            if #mentioned < 1 then
                message:reply("Try to mention someone next time so that i can ban them!")
            end
        else 
            message:reply("<@!"..memberid.."> you dont have the permissions required to ban people, you noob!")
        end
    end
#

wait

#

member.guild

#

hmmm

jolly quail
#

Ya

#

Ur supplying user id there

#

so it works

#

Cuz that's in doc

#

Equivalent to Member.guild:banUser(Member.user, reason, days)

jaunty junco
#

then what should i do for the +mute

jolly quail
#

Hmm

#

Mute?

#

See probably

#

U have to get that user id

#

Search that in guild

#

For a member object

#

And mute that?

#

@sudden geyser help

#

@jaunty junco

jaunty junco
#

yeah im here

jolly quail
#

Guild.getMember(id)

#

This will return the member object

#

Probably

jaunty junco
#

hmmm

jolly quail
#

Guild.getMember(mentioned[1][1]):addRole(RoleID)

#

try something like this

jaunty junco
#

hmmm sure

jolly quail
#

Hmm

jaunty junco
#

attempt to index global 'Guild' (a nil value)

jolly quail
#

Oof

#

Not guild

#

message.guild or member.guild

#

Whatever it was

jaunty junco
#

hmmm

jolly quail
#

U were using before

jaunty junco
#

maybe

#

just MAYBE

#

one of my files got corrupted?

jolly quail
#

Nah

#

message.guild.getMember(mentioned[1][1]):addRole()

#

message.guild gets the correct guild i guess

#

@jaunty junco trying?

jaunty junco
#

yes

#

it does

jolly quail
#

message.guild.getMember(mentioned[1][1]):addRole()
@jolly quail

#

Try

jaunty junco
#

C:/Bot/deps/coro-channel.lua:62: C:/Bot/deps/discordia/libs/utils/Emitter.lua:105: C:/Bot/deps/discordia/libs/containers/Guild.lua:161: attempt to index field '_members' (a nil value)

jolly quail
#

Hmm

jaunty junco
#

WAIT

#

maybe

#

it needs

if #mentioned == 1 then
#

maybe it needs that

#

lemme try

jolly quail
#

Try

#

Log the output of message.guild.getMember(mentioned[1][1]) too

jaunty junco
#

hmmm

#

u mean

#

i wasnt gonna try with THAT

jolly quail
#

That member object

#

Is it even coming

#

Lol

jaunty junco
#

look imma try with my method first

#

then imma do that

jolly quail
#

Umm

#

Are functions in this language used like
:function()

#

Or .function()

#

@jaunty junco

jaunty junco
#

ik

#

but no

#

well

#

with :

#

not .

jolly quail
#

getMember is a function

#

Lol

#

I was using .

#

Use :

jaunty junco
#

hmm yes it is

#

ok wait a sec

#

xd

jolly quail
#

Sorry I'm completely new to that lang

#

XD

#

Heard its name first time tbh

#

😅

jaunty junco
#

HUH

#

wait

#

this is weird

jolly quail
#

Why

jaunty junco
#

when i do :add addRole doesnt show up

#

wtf

jolly quail
#

Hmm

jaunty junco
#

when i do :ban then banUser shows up

#

wtf

jolly quail
#

Can't 2 functions be used?

#

Together

jaunty junco
#

what idk

jolly quail
#

Like :function1():function2()

jaunty junco
#

im not a pro at lua myself

#

hmmm

#

i think not

jolly quail
#

That's the prob

#

U r facing rn

jaunty junco
#

no like

jolly quail
#

I guess

jaunty junco
#

the function addRole doesnt exist

#

thats the issue

jolly quail
#

message.guild:getMember(mentioned[1][1])

jaunty junco
#

probably one of my files got corrupted

jolly quail
#

This works?

jaunty junco
#

lemme see

#

it gives off this

jolly quail
#

Hmm

jaunty junco
#

so yes it works

jolly quail
#

Now try

#

Adding addRole

#

In that line

jaunty junco
#

but the issue is that :addRole doesnt exist

jolly quail
#

In that result

jaunty junco
#

nonon

#

like

#

the function :addRole doesnt exist

jolly quail
#

Store that result as a variable and try addRole on that?

jaunty junco
#

hmmm

#

i could try

#

but

jolly quail
#

Try try

#

Trying is everything xD

jaunty junco
#

if the function doesnt exist then how will it work?

jolly quail
#

Maybe it doesn't show

jaunty junco
#

no reason not to

jolly quail
#

Cuz it doesn't recognise it as member

jaunty junco
#

nono

#

if i just type :add on a new line

#

the function doesnt show up

jolly quail
#

It worked before?

jaunty junco
#

even tho it should

#

no

#

i havent tried before

jolly quail
#

Leave that issue then

#

XD

jaunty junco
#

xd

#

i guess imma see if any file is corrupted

jolly quail
#

No point really

#

I don't think so cuz

jaunty junco
#

cause last time one of my bot files was corrupted

#

good thing that it was just an empty .json file tho

jolly quail
#

What corruption?

#

Example..

misty sigil
#

how do u corrupt an empty file

jaunty junco
#

couldnt open it

#

nonono

#

like

#

empty as in

#

it only had {}

jolly quail
#

how do u corrupt an empty file
@misty sigil nice question xD

jaunty junco
#

well

#

it should have had {}

#

but it couldnt open

jolly quail
#

Nothing is corrupt bro

#

I don't think so really

jaunty junco
#

i should check just in case

jolly quail
#

That's just ur mindset cuz of that one time

#

😅

jaunty junco
#

maybe

#

but still

#

i should check

jolly quail
#

Kk

#

Lol

#

Ping me when back

restive furnace
#

no

jaunty junco
#

kk

#

@jolly quail nothing is corrupted

#

hmmm

jolly quail
#

Told ya

#

Lol

jaunty junco
#

maybe its a new function?

jolly quail
#

Nah

jaunty junco
#

since im using the version before the latest version

jolly quail
#

message.guild:getMember(mentioned[1][1]):addRole(ROLEID)

#

Try this

jaunty junco
#

i did tho\

#

you told me to

jolly quail
#

Try again

jaunty junco
#

sure...

jolly quail
#

Result?