#development

1 messages ยท Page 339 of 1

quiet bobcat
#

That's my id

#

doe

neon pasture
#

You have !

rose tangle
#

I mean yes

rich kiln
#

take a look at it

rose tangle
#

you're inverting

#

twice

quiet bobcat
#

Yeah if its not me

rose tangle
neon pasture
#

That means it's not

rose tangle
#

no, if its not not you

quiet bobcat
#

it wont do anything

neon pasture
#

O wait

quiet bobcat
rich kiln
#

no

#

if its YOU

#

it'll return

#

now begone

rose tangle
#

like I said

quiet bobcat
#

Sorry ๐Ÿ˜ฆ

rose tangle
#

if its not not you

#

that will return true

#

i.e. if its you

#

no, you should be

rich kiln
#

๐Ÿคฆ

#

too much

#

syntax

#

error

quiet bobcat
#

Error 404 brain not found

rose tangle
#

!= is valid c#

#

but not js

quiet bobcat
#

Ok

rose tangle
#

and you should never say happy now to people trying to help you

#

unless you want us to tell you to fuck off next time you post bad code

quiet bobcat
#

Sorry

gaunt dune
#

@quiet bobcat @rose tangle != IS valid js

#

tho

rose tangle
#

is it a boolean operator?

#

(keep in mind I have never in my life touched JS and would rather kill myself than try)

quiet bobcat
#

@gaunt dune That just returns syntax error

gaunt dune
#

๐Ÿค”

#

that's what I use in my code

quiet bobcat
#

๐Ÿค”

#

ERROR SyntaxError: Unexpected string

#

When I use l.eval "test"

#

@gaunt dune Are you here? Thonk

gaunt dune
#

not anymore

#

bie

quiet bobcat
#

ok bie

earnest phoenix
#

@rose tangle != means does not equal

steel shoal
#

how can in add my bot to this server ๐Ÿ˜‚

rose tangle
#

blobwaitwhat no shit?

hushed oyster
#

guys

#

I have no experience with d.py's rewrite

#

so

#

would all commands be in

#

async def on_message(self, message):

#

as the repo's example bot shows

slow swan
#

@hushed oyster have you considered asking in discord api

hushed oyster
#

forgot about it

brisk hawk
#

how do i control luca on my own server

#

?

slow swan
#

you cant

brisk hawk
#

so this is the only server it works on

prime cliff
#

Luca is a custom bot made for this guild only

brisk hawk
#

awe

earnest phoenix
#

trust me, I've tried lmao

brisk hawk
#

awwwwwwwwwwwwwwwww

prime cliff
#

Although some bots can use the API to get botinfo

brisk hawk
#

are there any bots that do the same thing

prime cliff
#

Yes i have one but the commands are broken right now im already fixing it

delicate zephyr
#

Who here uses Eris?

brisk hawk
#

oh

slow swan
#

@delicate zephyr BlobWave

delicate zephyr
#

So, heres my problem lol

#

I have the connection stored in server.dispatcher in my server object

#

but when I do server.dispatcher.end() to skip a song it stops working after the first one, any ideas how I can fix this @slow swan

slow swan
#

.end doesn't exist?

earnest phoenix
#

lolkekgoodmem

delicate zephyr
#

It does tho

#

one sec

slow swan
delicate zephyr
#

I used that lmao

#

I mean

slow swan
#

there is no '.end'

delicate zephyr
#

connection.on("end")

#

lol

slow swan
#

you didn't say that

delicate zephyr
#

Im storing the event in the object too

#

but its then storing the functions in an array

slow swan
#

are you doing .on or .once

delicate zephyr
#

Which one works better

slow swan
#

I do .once once I start a song

#

.once means it will only be triggered once

delicate zephyr
#

Then how would I skip the song?

slow swan
#

.stopPlaying()

delicate zephyr
#

Oh

#

So

rich kiln
#

.stopPlaying().then(//start next)

slow swan
#

no

#

read the docs

#

.stopPlaying() doesn't return anything (doesn't return a promise in your case)

delicate zephyr
#

does it trigger the end

#

?

#

if so

slow swan
#

yes

rich kiln
#

yes

delicate zephyr
#

๐Ÿ‘Œ๐Ÿผ

rich kiln
delicate zephyr
#

Thanks

slow swan
#

my skip command is litterally .stopPlaying()

delicate zephyr
#

Im moving from d.js

#

just so you know

slow swan
#

yeah discord.js sucks

#

mmlol

delicate zephyr
#

Im getting used to it

#

Eris I mean

#

Its taken about 8 hours to move over

#

and im not even done

slow swan
#

here if you need me

delicate zephyr
#

thanks ๐Ÿ˜„

#

does connection.play return a promise @slow swan

slow swan
#

no

#

what would the promise do

delicate zephyr
#

just allow me to .then to shift the queue when it starts playing xD

slow swan
#

it starts playing instantly

delicate zephyr
#

Im trying to get the queue to shift properly

#

but its failing

#

horribly

#

got it ๐Ÿ‘Œ๐Ÿผ

#

putting the shift in the .once("end") bad idea

#

xD

slow swan
#

lol

#

i can't remember what i do

#

but i have a weird queue system

delicate zephyr
#

I just use a very easy object system

#

I wont move to databases til I build my own server

#

Literally

#

thats it

#

and then I use them globally

slow swan
delicate zephyr
#

Finished the move

#

\o/

#

FINALLY

#

after like 12 hours

restive silo
#

exporting functions instead just creating a class is gross

#

eww

delicate zephyr
#

@slow swan whats the Eris version of bulkDelete?

slow swan
delicate zephyr
#

Tried that

#
            bot.deleteMessages(message.channel.id, messages)```
#

doesnt work

umbral pelican
#

var GWfroggyThink

delicate zephyr
#

stfu ok, I cba to use let, they basically do the same thing

#

stop being a triggered person

jagged plume
#

no

#

they dont

delicate zephyr
#

ok

#

they dont

#

but they work for me

#

I aint gonna change a habbit

slow swan
#

you need to await the promise

#

or .then it

delicate zephyr
#

im getting bad request lmao

earnest phoenix
#

which bot name is better? adProd or AdProd or adprod

delicate zephyr
#

@slow swan last question

#

How to set game and presence?

slow swan
#

.editStatus

delicate zephyr
#

oh

#

Thanks ๐Ÿ˜„

#

Bot is fully moved now

#

God that too long

slow swan
#

learn to a b s t r a c t

warm pebble
#

AdProd @earnest phoenix

delicate zephyr
#

@slow swan halp

#

full error

slow swan
#

wait for it to join the voice channel

delicate zephyr
#

oh

slow swan
#

before you play

delicate zephyr
#

I am though

#

see

slow swan
delicate zephyr
#

hmmm

slow swan
#

maybe add like a half a second delay between songs?

delicate zephyr
#

yea

#

I will now

earnest phoenix
#

add crossfading

#

@delicate zephyr

trim steppe
#

No

delicate zephyr
#

No

#

I mean

#

if you wanna pay me money on patreon sure

#

but the answer is pay me or no

#

lmao

vital lark
#

ol

sleek prawn
#

Can somebody send me the commands of Rem? i have a little problem with that bot

earnest phoenix
#

-botinfo @slow laurel

gilded plankBOT
#
Rem
Bot info
ID

355930938397687808

Username

Rem

Discriminator

7444

Short Description

= - = Rem, the Discord Boat = - =

Library

JDA

Prefix

!r.

Upvotes

10

Server Count

279 Servers | 1 Shards

Owner(s)

@vital lark
@low niche

Links
earnest phoenix
#

!r.help probably @orchid horizonrBroklins#6612

earnest phoenix
#

left

peak tendon
steel shoal
#

help

neon pasture
#

How do you get a id from a mention? Eris / Javascript

umbral pelican
#

mmm, isn't it just Message.mentions[0].id GWbowsuBlobThonkeng

neon pasture
#
var userIdOnly = userId.replace(/[^0-9]/, '');```
This doesn't work, what's wrong?
#

@umbral pelican Thanks btw

umbral pelican
#

msg.mentions[0] is the User object of the first mention (if there is a mention)

#

msg.mentions[0].id should just be the id, no need to use regex

neon pasture
#

okay

#

Thank you, I was looking for that ๐Ÿ˜›

polar dove
#

.

quiet bobcat
#

Can someone help me with my eval command in discord.js?

lethal sun
#

thonk

quiet bobcat
#

Is that a yes?

lethal sun
#

no ๐Ÿ˜‚

quiet bobcat
#

Ok ๐Ÿ˜ข

lethal sun
#

im working on eval but i didnt even get to 2%

#

thonk

quiet bobcat
#

2%?`

lethal sun
#

heh

steel shoal
#

hi

quiet bobcat
#

Hello

#

brb

steel shoal
#

someone need some help?

#

pm me if you need some help ๐Ÿ‘

frigid vault
#

@quiet bobcat follow the Idiot's Guide tutorial on discord.js

inner jewel
#

hint: eval()

rich kiln
#

hint: learn js Thonk

lethal sun
#

^

tawny lava
#

Hmm

gaunt dune
#

I just realised

#

I posted in the wrong channel xdd

quiet bobcat
#

@rich kiln Im trying to Thonk

rich kiln
#

codecademy is your friend

quiet bobcat
#

I figured out the eval command

#

btw

earnest phoenix
#

Woo

earnest phoenix
#

@peak tendon I hate Superior Servers

#

I also hate Hyplex

#

I like servers with around ~15 players, that is the best time

quiet bobcat
#

Hyplex? Thonk

earnest phoenix
#

a Gmod server

cosmic plover
#

big game servers are a mess

wanton nova
#

or after a bit?

umbral pelican
#

just edit & save your bot page and it will update

wanton nova
#

ah okay

#

thanks

#

๐Ÿ‘Œ

neon pasture
#

How do I check the name of the role? Eris / Javascript
role.name('id')

languid dragon
#

isn't it

#

role.get("id").name?

neon pasture
#

Going to check that

languid dragon
#

ill check

neon pasture
#

So it's correct?

languid dragon
#

if you have the role already

neon pasture
#

I already have the id's yes

languid dragon
#

it would just be var roleName = role.name;

uncut slate
#

var in 2017

languid dragon
#

it was a lazy example

uncut slate
#

bad habits

#

smh

neon pasture
uncut slate
#

yeah if you have the role defined somewhere else

neon pasture
#
userRoles.forEach(function(userRoles) {
  bot.createMessage(msg.channel.id, `${userRoles} \ ${role.get(userRoles).name}`)
});```
languid dragon
#

1 sec

uncut slate
#

role.get isn't anything

languid dragon
#
var userRoles = msg.member.roles;
userRoles.forEach(function(index) {
  bot.createMessage(msg.channel.id, `${userRoles} \ ${userRoles[index].name}`)
});
#

try that

neon pasture
#

okay

languid dragon
#

that is probably terribly wrong

uncut slate
#

userRoles can't be stringified properly either

#

pretty sure it's something along the lines of index.name for the role name

neon pasture
#

But now it's like userid[index].name

#

So I miss the .role part?

uncut slate
#

what are you trying to do? List all roles a user has?

neon pasture
#

Yes

#

I'm trying to see if the user has the role "Settings"

uncut slate
#

then msg.channel.createMessage(msg.member.roles.map(r => r.name).join('\n'))

#

and style it however you want

languid dragon
#

member.roles returns an array of role ID's
so you would need to do guild.roles.get(array[index]).properities

uncut slate
#

wait, does it

neon pasture
#

Yes it does

languid dragon
#

let me write something up real quick

neon pasture
#

369854927532457984,364345636742496257

#

That was the output

uncut slate
#

cri

#

then msg.channel.createMessage(msg.member.roles.map(r => msg.guild.get(r).name).join('\n'))

#

msg.channel.guild *

neon pasture
#

umm

languid dragon
#
var userRoles = msg.member.roles;

var messageToSend = "";
for(var i=0;i<userRoles.length;i++){
    let role = msg.guild.roles.get(userRoles[i]);
    messageToSend += `${role.id} // ${role.name}\n`;
}
msg.channel.send(messageToSend);

#

that makes sense yeah?

uncut slate
#

I would suggest against making a message for each role

#

also, msg.channel.guild

neon pasture
#

msg.channel.guild instead of bot.createMessage?

uncut slate
#

no

languid dragon
#

check my example now LOL

uncut slate
#

but that's dumb

languid dragon
#

well that's how i'd do it

uncut slate
#

why append it to a string and then send the string if you can just join an array

#

smh

languid dragon
#

because this is how i was taught to do it and its the easiest shitcode i can shit out

#

yeet

neon pasture
#

isn't working..

uncut slate
#

yeah so I'd do something like This

msg.channel.createMessage(msg.member.roles.map(r => msg.channel.guild.roles.get(r).name).join('\n')) 
neon pasture
#

Isn't there a way to check if there this item inside the array?

#

That piece of code is working.

uncut slate
#

I don't understand what you mean

neon pasture
#

Like

#

Check every item, and see if there's a item called "Settings"

#

with items I mean roles

uncut slate
#

a role name called Settings you mean?

#

ohh

#

then you can just check for ```js
msg.member.roles
.map(r => msg.channel.guild.roles.get(r))
.filter(r => r.name === 'Settings')[0]

neon pasture
#

And that would return true?

#

if there is a role called settings

uncut slate
#

That would return undefined it if exists

#

And the role if it exists

#

You can do it like

neon pasture
#

Yeah, thanks

#

So like === undefined.

#

And would should I use instead of var?

stone kiln
#

let

restive silo
#

Const or let

uncut slate
#
const possibleRole = msg.member.roles 
    .map(r => msg.channel.guild.roles.get(r))
    .filter(r => r.name === 'Settings')[0]

if (possibleRole) {
    // Role exists
} else {
    // role doesn't exist
}
#

and yeah use const/let

neon pasture
#

okay

restive silo
#

const is like the name says constant and cant be redefined let can be redefined

neon pasture
#

Okay, thank you for helping me.

golden vector
whole mural
#

dont you usually have a string.join

#

not just join

#

??

golden vector
#

same error

whole mural
#

idk js

#

just guessing

golden vector
#

ok

whole mural
#

try standing in your fridge

gaunt dune
#

it's array.join(" ") where array is args

whole mural
#

oof

golden vector
#

args don't work

gaunt dune
#

because you don't have an array named args

#

for arguments

golden vector
#

how do i do that

#

oh

#

wait

#

i know

#

const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase(); like this?

gaunt dune
#
var args = message.content.split(" ");
golden vector
#

THX'

rain swift
#

Good ideaaaaa

supple shale
#

lmao js skrubs

#

dont have a command handler

sinful meadow
#

I do @supple shale

earnest phoenix
#

y this not working?

request({
    "method": "POST",
    "url": "https://discordbots.org/api/bots/ay/stats",
    "headers": {
      "Authorization": "ayyyyy"
    },
    "body": JSON.stringify({
      "server_count": client.guilds.size
    })
  }, function(){});
#

{"error":"Required parameter server_count or shards missing"}

#

!

rich kiln
#

its form not body

sinful meadow
#
  1. Use snekfetch because its easier
rich kiln
#

also no need to stringify

earnest phoenix
#

y snekfetch

sinful meadow
#

Easy

rich kiln
#

@sinful meadow dont recommend bullshit

sinful meadow
#

Mate

#

Snekfetch isnt bullshit

#

Using snekfetch has alot of things that are usefull

#

As in

#

Not installing another fucking npm that something else can do

#

And is twice as easy

inner jewel
#

javascript - for every type of lib there are at least 10 different ones

sinful meadow
#

@inner jewel snekfetch is default

#

No installing of it

rich kiln
#

no request is default.

umbral pelican
#

lol

sinful meadow
#

But is it really now

young cradle
#

snekfetch is not default, what are you on \๐Ÿค”

sinful meadow
#

Weird for me it is

young cradle
#

it is a dependency that comes with d.js as they use it

#

But it is not default

sinful meadow
#

^^^^^^^

#

Thats why i said its default

young cradle
#

Then do not say that

#

Specially when snekfetch is based on another module

sinful meadow
#

Well why not use snekfetch tho

young cradle
#

I am not saying not to use, i am saying that he could be using Eris or perhaps Discordie, and i am saying that snekfetch uses the same API as superagent

sinful meadow
#

I know that

#

BUt snekfetch itself is easy

#

and easy to use compared to request

earnest phoenix
#

@rich kiln No, it uses body, not form

#

@earnest phoenix Make sure you are proving Content-Type in the headers list

#

and set it to application/json

rich kiln
#

@earnest phoenix body didnt worked for me

earnest phoenix
#

Not my fault

#

Works fine for me

earnest phoenix
#

I'm new to here. May I know what languages require to create a bot? Java? C++?

languid dragon
#

Any

pale light
#

any

languid dragon
#

Most languages have API wrappers

rich kiln
#

most backend devs arent fucking furrys

earnest phoenix
#

I got question. Possible to create a private bot, where public can't find when search the name?

#
import os
from google.cloud import firestore

# Project ID is determined by the GCLOUD_PROJECT environment variable, so we set it
os.environ["GCLOUD_PROJECT"] = "nodal-algebra-179323"
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = '/home/kot/projects/database-discord-manage/creds.json'
db = firestore.Client()

def getValue(doc_ref, removalWord, attr, attrSplit):
    '''
    Gets value from firestore.
    '''
    doc = doc_ref.get()
    removed = None
    endresults = []
    for attribute in attr:
        print(attribute)
        results = doc.to_dict()[attribute].split(attrSplit)
        if removalWord in results:
            results.remove(removalWord)
            removed=True
        if removed != None:
            results.append(removed)
        endresults.append(results)
        print(results)
        return endresults
# ''' Example
print(getValue(
    doc_ref=db.collection(u'adprod').document(u'config'),
    removalWord='@mention',
    attr=['token', 'prefixes'],
    attrSplit=' | ')
     )
# '''
``` help
#

it only returns the 'token'

#

but it should return both token and prefixes as shown in attr=['token', 'prefixes'],

#

@abstract mango you be python right?

#

:C

abstract mango
#

I don't have experience with firestore though

earnest phoenix
#

:C

#

why tho

abstract mango
#

bc I don't use dbs

sinful meadow
#

Yes @earnest phoenix

#

Just make sure the public bot option isnt checked

neon pasture
#
  console.log(GuildMember.guild.id)
});```
#

Why isn't this working? Using javascript / Eris

languid dragon
#

ill check for you :}

neon pasture
#

There is something wrong with GuildMember, but I don't know what.

languid dragon
#

What error are you getting?

neon pasture
#

None

#

It just says: undefined

languid dragon
#

ok 1 sec

#

i believe guildMemberAdd emits two variables

#

try (guild, member) =>{

neon pasture
#

bot.on('guildMemberAdd', (guild, member) =>{

#

Like that?

languid dragon
#

ye

neon pasture
#

Yes, that's working

languid dragon
#

Sweet :]

neon pasture
#

how can I make the prefix case insensitive?
I'm using CommandClient, Eris

languid dragon
#

im not sure with that
but you could do something like .toLowerCase();

#

to force an incoming message to lowercase first

neon pasture
#

umm

bitter sundial
#

cant really do that with a command client

neon pasture
#

Or I make a array

crystal void
#

heii

feral fiber
#

Hallo

neon pasture
#

Someone know a good npm package for cpu usage and shit?

earnest phoenix
#

Question: if a music bot leaves a voice vhnael due to inactivity they disconnect but what if I made a Afk bot that will be in the same voice channel, will the music read the afk bot and still play music or will disconnect eventually?

B: are Afk voice channel bots allowed?

clear kernel
#

@tacit hatch js ${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}
I use that for memory. Idk for cpu, there is a ton if you search

tawny geode
#

guys, how do you load commands in bots? for example: are all commands written inside the bot file or all commands are in a folder?

#

talking to who uses js

earnest phoenix
#

Does anyone know y i get error EACESS when i try to use music commands?

#

I have opusscript & fftmpeg

earnest phoenix
#

@earnest phoenix no permission to read something

#

@tawny geode make a command loader

sage nymph
#

Hi

uncut slate
#

hi

earnest phoenix
#

@earnest phoenix im hostin it off android, does that mean the os is shit? Cuz my local music cmds worked on my pc (windows)

#

um

#

don't host on android

#

there is fix

#

Knew it, will github work or that one wilm return eacess too?

inner jewel
#

github doesn't host node.js lol

earnest phoenix
#

Heroku

lethal sun
#

Does anyone have a tool that you can use to get the correct possition on an image? I'm using Jimp and i really need a tool so i dont have to restart my bot every second. ๐Ÿ˜‚

earnest phoenix
#

ยฏ_(ใƒ„)_/ยฏ

#

@earnest phoenix just buy a VPS

#

$3

lethal sun
#

you will die from laughter if you see my paypal balance... believe me, you dont.

weak parrot
#

Tbf @earnest phoenix some of use can neither afford one or buy it Thonk

uncut slate
#

@weak parrot tons of free VPSes out there, and you can probably sell code for a bot

#

find someone who wants a custom bot, make it for them and use the money for a VPS ๐Ÿคท

#

or you can literally pick up pennies in the street, VPSes are hella cheap nowadays

weak parrot
#

Well I don't need one anyway xD. Just saying some of us can't because we don't have access to bank account(s) in the first place

uncut slate
#

you can get a VPS using prepaid cards too, from a physical store with cash money

earnest phoenix
#

Or you can try getting money from mowing a lawn or something

#

One lawn could equal 6 months of a VPS

weak parrot
#

Depends on who you get the money from xD

uncut slate
#

if you're old enough to use Discord I'd like to assume you're old enough to have $5 somewhere and you can get a prepaid card

weak parrot
#

Well yeah but like I said it's not me that needs it just pointing out some people might

lethal sun
#

How to make a bot respond to a message if it only contains numbers?

shy rose
#

regex?

uncut slate
#

you could do if (parseInt(msg.content))

shy rose
#

(\d)+

lethal sun
#

discord.js btw

shy rose
#

/(\d)/g works in javascript

#

with i think its .match

lethal sun
#

example @shy rose ?

shy rose
#

ok so dont know your "message strucutre" but

if("1234".match(/(\d)+/)){
//do stuff
}
#

where 1234 if you message thing

uncut slate
#

parseInt is way faster though

shy rose
#

can cause issues though if you parsed a snowflake

uncut slate
#

he's not parsing anything, he just needs to see if it's numbers

shy rose
#

but using parse int on a massive number wont that cause issues?

#

like out of range?

uncut slate
#

no, worst case it will round it off to 53b precision which is irrelevant for this use case

shy rose
#

cause that will still parse it to an integer only reason it passes statment is cause its a defined value

#

ok nope just tested it your right

earnest phoenix
#

@lethal sun if (!isNaN(Number(msg.content))) {
// all numbers
} else {
// not all numbers
}

#

mobile sorry

uncut slate
#

@earnest phoenix why

#

parseInt is faster and way less messy

#

and you can drop the isNaN completely

earnest phoenix
#

@uncut slate he wants to check if the whole message is numbers

#

parseInt just checks the first part

#

parseInt("25"); // true

#

parseInt("25 yes no"); // true

uncut slate
#

ah, fuck

#

forgot about that

earnest phoenix
#

yeah

uncut slate
#

should still be able to drop the isNaN though

earnest phoenix
#

Doubt you can drop the isNaN because NaN is true

#

Iirc

#

Lemme check

#

never mind

#

you're right

inner jewel
#

lol

#

wtf is that

#

retarded behaviour

uncut slate
#

the joys of Ja\๐Ÿ…ฑascript

earnest phoenix
#

My bot is a failure. I cannot fix the problems on it. ๐Ÿ˜ฆ discord.js (if a command is failed the bot stops working)

rich kiln
#

learn javascript then Thonk

thorny hinge
#

^

rich kiln
#

"if a command is failed the bot stops working" get a linter Thonk

neon pasture
#

Remove the command that let your bot crash, problem fixed.

thorny hinge
#

Or

#

Delete the file

#

No more errors

neon pasture
#

lol

thorny hinge
#

For life

rich kiln
#

if its a modular bot it'll be the same as removing the command lol

neon pasture
#

haha

earnest phoenix
#

I mean I have songrequests that works only with links and when someone doesnt use link and then another command comes the bot crashes

neon pasture
#

first check if the user gives a like.

thorny hinge
#

Then check if someone doesnt input a link

rich kiln
#

or

thorny hinge
#

o

neon pasture
#

lel

rich kiln
#

use another module that checks links & ids

earnest phoenix
#

How can I fix this?

neon pasture
#

Check if there a link.

rich kiln
#

in noobish language we would do

earnest phoenix
rich kiln
#
if(msg.content.toLowerCase().startsWith("https://www.youtube.com/") {
//Add shit here
}
inner jewel
#

what's the error?

#

ยฏ_(ใƒ„)_/ยฏ

thorny hinge
#

if user doesnt put link
send a message what a noob pls use a link

#

Written in english

#

Good lang

rich kiln
#

oh no boi

inner jewel
#

typo

thorny hinge
#

discord.en should be a thing GWchadThink

rich kiln
#

dont you do these youtube tutorials tho

#

they are 89% wrong

inner jewel
#

video tutorials for libs are 99% of the time wrong

rich kiln
#

yeah

#

except anidiot's guide

#

also evie and crawl

#
#

there you go

earnest phoenix
#

Got dammit I cannot learn code by just watching the things

rich kiln
#

agreed

neon pasture
inner jewel
#

google.com.bananaland

rich kiln
#

@neon pasture default shit

#

ยฏ_(ใƒ„)_/ยฏ

neon pasture
#

Google.moe

earnest phoenix
#

ReferenceError: 'Friends' is not defined

shy rose
#

hu i get that error to lemme know when you solve it

earnest phoenix
#

Oh solved.

cosmic plover
#

webscale programming

#

kappa

#

:^)

earnest phoenix
#
console.log(friends) //null``` ๐Ÿ˜ญ  @shy rose
muted walrus
#

has anyone ever used yandex in their bot?

neon pasture
#

Lol

shy rose
#

isnt that the russian search engine?

#

or am i mistaking it

cosmic plover
#

ye it is

muted walrus
#

I want to add translation to my bot but I just can't get it to work

#

Whatever I do it returns the api docs url

#

Wonder if Discordia / Luvit is doing something wrong?

abstract mango
#

typos are nice

restive silo
#

LMAO

cosmic plover
#

discpatcher

inner jewel
#

diskpatcher

cosmic plover
#

same

earnest phoenix
#

oof

earnest phoenix
#

disccpatcher

earnest phoenix
#

๐Ÿค”

earnest phoenix
#

@earnest phoenix

#

Anyone?

#

No?

#

Maybe?

languid dragon
#

?

earnest phoenix
#

@The Darkness Soldier#1418 Why did you ping me?

#

rip

#

blocked

runic hemlock
#

hey

languid dragon
#

@uneven sonnet

uneven sonnet
#

hi

languid dragon
#
<html>
    <head>
        <style>
            body{ ... styles }
            .class{ ... styles }
            #id{ ... styles }
        </style>
    </head>
    <body>
        <div class="class"> ... content </div>
        <div id="id"> ... content </div>
    </body>
</html>
#

that would be
index.html

uneven sonnet
#

how do

#

you

#

make

#

a

#

square

#

around

#

ur

#

shit

languid dragon
#

Naga

uneven sonnet
#

i know how html works

#

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}

.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

.smaller-image {
width: 100px;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back. " src="https://bit.ly/fcc-relaxing-cat"></a>

<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>

languid dragon
#

this is where you go and learn how to fucking code

uneven sonnet
#

Ken

#

I know html

#

and

#

some

#

css

#

thats it

#

i suck

#

i cant learn anyhting

#

I dont know where to begin

languid dragon
clear kernel
uneven sonnet
#

nice ltt pic

languid dragon
#

just go into inspect and check out my code, you can get some idea there with my stuff

#

yano

uneven sonnet
#

rn

#

im using

#

Freecodecamp

#

and Khan

weak parrot
uneven sonnet
#

omg @weak parrot

#

THANKS

#

<3

languid dragon
#

why didnt you just say that, wow

uneven sonnet
#

wait

#

wot

weak parrot
#

Fucking internet

uneven sonnet
#

how do i even get that

#

ยดยดยด

#

te fuck

languid dragon
#

its the ~ on your keyboard

#

next to 1

uneven sonnet
#

what

#

im on nordic

#

layout

languid dragon
weak parrot
#

Kek

uneven sonnet
#

ยดยด'

#

ยดยด

languid dragon
#

hold shift?

uneven sonnet
#

kool

#
My nama chef
languid dragon
#

``` nice ```

uneven sonnet
#

@weak parrot <3

weak parrot
#

Np

uneven sonnet
#
Ken is vri gay
languid dragon
#

banned

uneven sonnet
#

nopls

#

not again

#

lul

#

YOO

#

@languid dragon

#

UR SITE IS AWESOME >:O

languid dragon
#

?

uneven sonnet
languid dragon
#

lmfao

#

glad you like it

earnest phoenix
#

nice background

uneven sonnet
#

i

#

love

#

it

languid dragon
#

fucc u

uneven sonnet
#

@earnest phoenix gay 4k

languid dragon
#

with ur gey 4k

uneven sonnet
#

how do u make these

languid dragon
#

that was when i was a noob @ code, ok

uneven sonnet
#

dang

#

sucks there isnt any sound tho

languid dragon
#

lmao

#

i might work on it again one day

uneven sonnet
languid dragon
#

yes

uneven sonnet
languid dragon
#

yes i am aware that pictures do not work

uneven sonnet
#

damnn

#

how long

#

did that take u

#

to learn

#

from day 1

languid dragon
#

to make websites?

uneven sonnet
#

ye

languid dragon
#

a couple years

uneven sonnet
#

y

#

e

#

a

#

r

#

s

languid dragon
#

i did it cos i think its fun

uneven sonnet
#

do u want

#

to make a website with me? >:D

languid dragon
#

sorry, all i saw right now was
"do you want to make a website for me?"

uneven sonnet
#

oops

#

english isnt my first lang

#

sry bb

rich kiln
#

windows weeb version..when?

scenic crest
#

skin windows 10

#

add a live background of your waifu

earnest phoenix
#

the top bar should be fully green

tawny geode
#

for discord.js should i use node-opus or opusscript

bitter sundial
#

thats probably something in your own css

earnest phoenix
#

k

#

i did

#
nav {
    background-color: green;
}
earnest phoenix
#

you're selecting the container

#

not the full navbar

#

@tawny geode node-opus

tawny geode
#

ok thanks

silver ore
#

Can someone help me?

#

Mibro went suddenly down.
When we tried to restart the bot couldnt log in.
It says Invalid token. But its 100% not the token. We changed the token and also specified the new one but it still doesnt work.
Error: 4004
Invalid Token

earnest phoenix
#

@silver ore It is definetly the token then

#

Discord is not wrong

silver ore
#

We also tried a simple login code it also didnt work

#

we changed the token many times

earnest phoenix
#

Go to your bot's page and get the token

#

on discord

silver ore
#

We already did that

earnest phoenix
#

Make sure you're getting Token and not Secret

#

You definetly have an invalid token

uncut slate
#

or you're passing it wrong

#

could be passing undefined accidentally, or you have quotes in it

#

and your lib might not be checking for String

silver ore
#

what is a client secret for? I never used this

#

Is it also important?

jagged plume
#

You donโ€™t need the secret for a bot

#

just use the bot token

silver ore
#

I do

jagged plume
#

what

silver ore
#

Im just using the bot token

jagged plume
#

4004 means your token is incorrect

silver ore
#

You cant believe how often we tried with new tokens

inner jewel
#

you need that one

silver ore
#

I know

#

Its not the first time im starting this bot

inner jewel
#

make sure there are no spaces at the beginning/end

silver ore
#

The weird thing is that the bot went down suddenly

#

All was working

inner jewel
#

check your email

quasi sandal
#

@silver ore maybe your token got reset

inner jewel
#

might have been a token reset

silver ore
#

Ill check

#

No email

quasi sandal
#

I recommend checking your application page to see if your token changed

silver ore
#

I made a new token and I changed it in the code

#

nothing is working

scenic crest
#

are u using the client token

#

or the bot token

silver ore
#

this token

scenic crest
#

can you enlarge that SS a bit

silver ore
#

where?

rich kiln
#

wait...

#

.login() can .then()?

silver ore
#

whats wrong?

rich kiln
#

try without the .then() part

silver ore
#

ok wait

quasi sandal
#

Double semicolon at the end, how can that not give an error?

rich kiln
#

yeah

#

also you can catch() without try? Thonk

fiery swallow
#

It's javascript...that doesn't care about double simicolon

#

the problem is not code related.... It's something wrong with the tokens

#

it works with other tokens

rich kiln
#

double semicolon throws an err

fiery swallow
#

it doesn't. but that's not the problem

#

Javascript doesn't care about double simicolon

quasi sandal
#

chrome, opera, firefox and edge disagree on that one

scenic crest
#

^ that's weird since node uses V8 as their engine but so does chrome

quasi sandal
#

Chrome screams at me for no or double semicolons

#

They could have modified it slightly

uncut slate
#

chrome screams are you for no semicolons?

earnest phoenix
#

Hi

earnest phoenix
#

@rose tangle please disable your bot ( @still vector )'s logging in #265156322012561408 , either disable it or move its log messages to #265156361791209475 , until you address this, your bot ( @still vector ) will remain muted (see case 1378)

#

lol rip

strange lintel
#

@earnest phoenix

#

try that gradient

#

that i just made for you

earnest phoenix
#

lol

#

SCREENSHOT COMING SOON

sinful meadow
#

lol

earnest phoenix
#

lol

#

ty @strange lintel

strange lintel
#

fuck codepen

#

with there screenshot coming soon

narrow dagger
#

their

earnest phoenix
#

xD

strange lintel
#

fuck spoon with his grammer corrections

earnest phoenix
#

fuck me with my lonelyness badum chzz

wispy jolt
#

can confirm spoon is fuckable

pulsar cairn
earnest phoenix
#

hey

#

how do you get a link that when people click on it, it upvote your bot

#

?

delicate zephyr
trim steppe
#

Sounds like a problem with Eris itself

delicate zephyr
#

well its causing my bot to restart

earnest phoenix
#

how do i make it so it says i need to specify a city to function this command

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

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

  weather.find({search: args.join(" "), degreeType: 'F'}, function(err, result) {
    if (err) message.channel.send(err);

    if (args.length < 1) {
        message.channel.send('You need to specify a location!');
    }

    var current = result[0].current;
    var location = result[0].location;

    const embed = new Discord.RichEmbed()
        .setDescription(`**${current.skytext}**`)
        .setAuthor(`Weather for ${current.observationpoint}`)
        .setThumbnail(current.imageUrl)
        .setColor(Math.round((Math.random() + 1) * 99999))
        .addField('Timezone',`UTC${location.timezone}`, true)
        .addField('Degree Type',location.degreetype, true)
        .addField('Temperature',`${current.temperature} Degrees`, true)
        .addField('Feels Like', `${current.feelslike} Degrees`, true)
        .addField('Winds',current.winddisplay, true)
        .addField('Humidity', `${current.humidity}%`, true)
        message.channel.send({embed});
  })
}


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

exports.help = {
  name: 'weather',
  description: 'Shows the weather',
  usage: 'weather'
}
trim steppe
#

You might need to catch disconnects

delicate zephyr
#

oh ok

trim steppe
#

I'm not sure because I don't like dealing with audio, but that's what I'll do

#

to test

earnest phoenix
#

i did the code but it doesnt work

trim steppe
#

The solution is to not have audio

#

Lol

delicate zephyr
#

on a music bot?

#

k

#

xD

trim steppe
#

oh lol

delicate zephyr
#

should I contact abal?

trim steppe
#

Probably would kill you for a simple error that I've missrd

delicate zephyr
#

why tho

trim steppe
#

ยฏ_(ใƒ„)_/ยฏ

delicate zephyr
#

ill dm him xD

#

I'll risk being killed

trim steppe
#

@earnest phoenix check args first before requesting weather api

#

if args less than 1
fuck off
else
weather stuff

#

before the weather

earnest phoenix
#

?

trim steppe
#

because atm

delicate zephyr
#

o

#

d.js

trim steppe
#

Your code tries to find the weather for a location before you check if it's empty

delicate zephyr
#

7coil I got this

trim steppe
#

kk

#

Even if it was empty, it would still output something

delicate zephyr
#
    return message.channel.send("Invalid Args");
    } else {
    //weather stuff
}```
#

@earnest phoenix

trim steppe
#

wtf no no no

#

Where are the braces

#

Aaaaaaa

delicate zephyr
#

there

#

lmao

trim steppe
#

Also return?

#

Isn't that useless here

delicate zephyr
#

I use it as a fail safe

#

Ive had code run regardless

trim steppe
#

I never use return, like at all

earnest phoenix
#

ahhh

trim steppe
#

it's all else if else if else if

indigo field
#

Oh god

#

cancer

trim steppe
#

It's not cancer it's brilliance

indigo field
#

Its cancer

pulsar cairn
#

only if my fucking intellij worked for a FUCKING phone to TEST a fucking app im making

#

reee

indigo field
#

Lol

pulsar cairn
#

im fucking dumb

#

I need dev mode on

#

goddamnit

#

this is developement so it makes sense

earnest phoenix
#

How are you supposed to make a upvote command

#

?

#

I need help making one

trim steppe
#

A command that requires upvoting?

shy rose
#

ew

trim steppe
#

I highly frown on those

shy rose
#

^

trim steppe
#

However if you would like to continue

#

Grab who has upvotes

#

Upcoted

#

Upvoted

#

And then compare to message author id

shy rose
#

there a 2 types of bots those that everyone likes and has a few upvotes
and those that people less like and have high upvotes

trim steppe
#

Your bot will be marked as terrible in high volume guilds

shy rose
#

do you get api limited?

trim steppe
#

a cache seems more responsible

#

but it's going to be very unlikely to be ratelimited

shy rose
#

0-0

trim steppe
#

especially for smaller bots

shy rose
#

so it does have a rate limit?

#

like a coded one not a dont abuse me plz one

trim steppe
#

no idea

earnest phoenix
#

?

#

Isnโ€™t there a link for a upvote?

trim steppe
#

Check API docs

earnest phoenix
#

Ok

#

Nvm

earnest phoenix
#

Hi

next wedge
#

q

scenic crest
#

have you tried googling the error

next wedge
#

yes

#

:/

languid dragon
#

try changing it and just putting a 1?

#

you're trying to assign a variable inside a function :]

stone kiln
#

^

next wedge
#

ops

prime cliff
#

Btw nice token leak ๐Ÿ‘€

next wedge
#

xd

languid dragon
#

also try not to expose your bots token
you managed to keep it blurry and uncopyable
regardless it shouldn't be shown to anyone besides yourself

next wedge
#

nut wurks :/

languid dragon
#

have you read the documentation

prime cliff
#

@next wedge

next wedge
#

yes?

prime cliff
#

Read my comment and the pic

next wedge
#

now works

#

ok

sinful meadow
#

@earnest phoenix

#

Sup

earnest phoenix
#

hoi

sinful meadow
#

What do ya need

earnest phoenix
#

nothing.

sinful meadow
#

It responds undefined @earnest phoenix

earnest phoenix
#

ya

#

i said that

#

then i was gonna fix it

sinful meadow
#

oh lol

earnest phoenix
#

lol

solemn sparrow
#

.

earnest phoenix
#

I needz help

#

Anybody

#

Anyone at all?

languid dragon
#

What with? :]

earnest phoenix
#

I made a ban command

#

With d.js

languid dragon
#

Hmm?

earnest phoenix
#

But it isnt working

languid dragon
#

Show code

earnest phoenix
#

Like at all

#
var command = "---ban @ebon shadow reason";
var args = command.split(" ");
var mention = args[1];

client.on("message", (message) => {
    if (message.content.startsWith('---ban')) {
        if (message.guild) {
    message.mentions.members.filter(member => member.id !== message.client.user.id).forEach(member => member.ban());
    } else {
    message.reply('You need to be in a guild to do that!');
    }
console.log(`Command run: Ban in ${message.guild.name} in ${message.channel.name} by ${message.author.username}`)
    }
});
#

Theres a bunch of useless vars at the top

languid dragon
#

message.mentions.first().ban()

earnest phoenix
#

Wait

languid dragon
#

you only need to ban one user?

earnest phoenix
#

Yes

languid dragon
#

just get the first mention

earnest phoenix
#

The one you mention

languid dragon
#

which will be the only mention

earnest phoenix
#

Oh!

languid dragon
#

so do .first()

earnest phoenix
#

message.mentions.members.first().user.ban()

#

Would this suffice?

languid dragon
#

also checking if a user is in a guild before banning is pointless

#

no

#

message.mentions.first().ban();

earnest phoenix
#

Okay....

#

Ill try it!

#

Doesnt work

languid dragon
#

who did you try it on

earnest phoenix
#

A bot

#

In one of my servers

languid dragon
#

what error shows up?

earnest phoenix
#

None

#

Its strange

languid dragon
#

ยฏ_(ใƒ„)_/ยฏ

earnest phoenix
#

?

scenic crest
#

did you test it on yourself

earnest phoenix
#

Why would I do that

scenic crest
#

I'm just ruling out novice mistakes

#

are you sure the bot has perms + has a higher tole

earnest phoenix
#

Okay

scenic crest
#

role(

earnest phoenix
#

Yes

scenic crest
#

role****

earnest phoenix
#

Oh wait hold on

#

I know whats wrong

#

Nvm

#

Imma try this

#

node .

#

Whoops

#

Okay nvm still doesnt work

#

I have a working mention code for getting a user's tag

#
message.mentions.members.first().user.tag
#

Alright so would I replace user with members?

#

Or just get rid of that altogether