#development

1 messages · Page 483 of 1

whole plume
#

lemme look at documentation rq

lusty dew
#

Hey guys

#

Look what I made

keen salmon
#

didnt code for long time

lusty dew
#

I made something ;p

earnest phoenix
#

guild.defaultChannel

#

so pop a guild.defaultChannel.send

lusty dew
#

I made a Dragon

#

:D

earnest phoenix
#

isnt that the kali linux dragon?

whole plume
#

cheers uber

lusty dew
#

No

#

I made it

#

lol

earnest phoenix
#

cheers mate @whole plume

lusty dew
#

I coded it

earnest phoenix
#

nice

lusty dew
#

The dragon it's self

#

idk

#

But I coded the other stuff

keen salmon
#

owo

whole plume
#

TypeError: Cannot read property 'send' of undefined

#

oof

#

same error I had earlier

earnest phoenix
#

are you sure your passing a guild to it?

whole plume
#

guild.defaultChannel.send(`Hello!

earnest phoenix
#

so like

#

the guild. portion

whole plume
#

im super stupid today so

#

if its extremely obvious

#

my b

earnest phoenix
#

dm me the full function

lusty dew
#

Deprecated?

#

If it is deprecated shouldn't you not use it

earnest phoenix
#

correct

#

its obsolete now with discord

#

so just is undefined

#

which is why its depricated

whole plume
#

^

sick cloud
#

defaultChannel doesnt work

#

since you can now delete your channel

earnest phoenix
#

darn discord

#

desc

#

dms

lusty dew
#

Nope

#

sorry wrong channel

sinful lotus
#

@whole plume your best bet is to find a channel named general and send it there.

<guild>.channels.find(_ => _.name === 'general');
whole plume
#

@earnest phoenix and I made it send the owner of the server a dm

sinful lotus
#

that would be bad specially if the owner didnt add the bot

#

a person that has manage_server can add any bot

whole plume
#

i am aware

#

but the owner should be alerted if the bot needs perms

sinful lotus
#

I recommend to just find a channel named general. also as for perms, you can have a perm checker on some commands that needs it

whole plume
#

i already have done the perm checking

sinful lotus
#

then that should be fine even you dont alert the owner

whole plume
#

infact I think it has it so if it catches an error it replies with "Uh-oh! Something went wrong, maybe I dont have permissions to run this command!"

lusty dew
#

When I can't change my Nick

sinful lotus
#

in my opinion at least, its not really a good practice to have a bot dm the owner

#

when invited

whole plume
#

i respect that

sinful lotus
#

@lusty dew become a certified dev and you can change nick

whole plume
#

its still extremely wip

lusty dew
#

Wants to change nick to Saya Is The Best

#

Ah ok

whole plume
#

I take it that certified dev requires you to have a certification liscense?

earnest phoenix
#

sign up

whole plume
#

license*

earnest phoenix
#

or somethi

sinful lotus
#

in shorter words, the bot must be well built and passing the requirements to get in

lusty dew
#

oh nice

whole plume
#

doesnt seem that hard

#

just gotta iron out the errors

sinful lotus
#

I failed once

whole plume
#

and make everything pretty

sinful lotus
#

not because its well built you can get certified

whole plume
#

sorry but i dont get what you mean

#

im stupid today

sinful lotus
lusty dew
#

When you want to get your bot certified but the certifications are down

#

Rip

whole plume
#

yikes

lusty dew
#

Lmfao

#

I wouldn't pass

whole plume
#

i definitely wouldnt

lusty dew
#

not with @molten prairie

#

Yukari needs work

whole plume
#

but thankfully I have @earnest phoenix working on @earnest phoenix with me

lusty dew
#

Let me guess

sinful lotus
#

while Im alone @keen salmon help me

lusty dew
#

Hentai and nsfw?

whole plume
#

deadass

#

you got it

lusty dew
#

Lol

#

Knew it

sinful lotus
#

I got a lot to work non

lusty dew
#

Waifu means Wife in Japanese

whole plume
#

it also has some simple moderation commands and I plan on adding integration for esports and myanimelist

lusty dew
#

I am making my bot

#

Info/Fun

#

With simple moderation commands

sinful lotus
whole plume
#

just lemme copy that all

#

sike

lusty dew
#

Lol

#

Good luck using it

sinful lotus
#

copying those wont make the code work lmao

lusty dew
#

Yea lol

sinful lotus
#

I got my own modules that isnt on npm

lusty dew
#

OOF

#

He/She got's you there

whole plume
#

all my commands are in the same file rn

lusty dew
#

My shit is so unorganized

whole plume
#

once its mostly finished i'll prolly make it into modules

lusty dew
#

Nope

#

not posting that

#

o.O

whole plume
#

i didnt see

#

:c

lusty dew
#

I almost posted a code for a Virus

#

XD

whole plume
lusty dew
#

Yea

#

lol

#

Have fun

#

ima go destroy my code now

#

XD

earnest phoenix
#

wait what was the script to display server count on dbl?

sick cloud
earnest phoenix
#

thanks

sick cloud
#

np

lusty dew
#

-_-

#

@sick cloud Is that supposed to be some time of tease towards me

#

xD

#

Your name

sick cloud
#

no?

earnest phoenix
#

im using some dark magic called visual studio live to help him with his organizational skills

lusty dew
#

Oh lol

earnest phoenix
#

its litterally a remote vscode session

sick cloud
#

they're cool

earnest phoenix
#

i can access his vscode console, connections, file system and save files etc

#

dark magic

sick cloud
#

run the sudo rm rf no preserve root thingy

#

delete it all

earnest phoenix
#

so like

#

its restricted

#

to the files your editing

#

works like google docs

#

@lusty dew you high again?

visual zenith
#

I got the windows server vps

earnest phoenix
#

gross

visual zenith
#

u talking to me?

earnest phoenix
#

yes

#

u do u boo

#

<3

visual zenith
#

xD

lusty dew
#

@earnest phoenix No

#

Maybe

earnest phoenix
#

ok

lusty dew
#

Shh don't tell Oliy

keen salmon
#

p i n g

lusty dew
#

p o n g

earnest phoenix
#
function ok(){
    ok()
}
#

How cylic

stray wasp
#

Using evies enmap, I'm unable to use client.commands.get(command).run()

#

telling me this is not a function

keen salmon
#

owo

#

what do you put into enmap

stray wasp
#

I've checked the API docs for .run and it doesn't exist yet in the idiotguides thingy it uses it.

#

commands @keen salmon

keen salmon
#

no i mean you must put functions into enmap before you can run it

stray wasp
#
fs.readdir("./commands/", (err, files) => {
    if (err) return console.error(err);
    files.forEach(file => {
        if (!file.endsWith(".js")) return;
        let props = require(`./commands/${file}`);
        let commandName = file.split(".")[0];
        console.log(`Attempting to load command ${commandName}`);
        client.commands.set(commandName, props);
    });
});
keen salmon
#

and btw you mean this enmap.get(cmd)()

stray wasp
#

um

#

just a sec

#

nope

#

wait

#

might have borked myself

keen salmon
#

owo

#

nice

stray wasp
#

nope

#

still

#

it can find it. but I'm unable to find a way to run it

keen salmon
#

do you sure you initialized enmap correctly

#

owo

sinful lotus
#

two command?

keen salmon
#

then itll be a very nice problem

#

try to get it into a variable

#

if that variable is undefined you might have something wrong

#

or just console log the enmap

sinful lotus
#

or probably he is doing it wrong

keen salmon
#

owo

#

thats really possible

stray wasp
#
    let cmd = client.commands.get(command);
    if (!cmd) return;
    cmd.run(client, message, args);
#

it finds the command

keen salmon
#

you should just cmd() then

stray wasp
#

alright

keen salmon
#

did it works

stray wasp
#
    let cmd = client.commands.get(command);
    if (!cmd) return;
    cmd(channel, userstate, message, self);
sinful lotus
#

console.log cmd

stray wasp
#

sure

keen salmon
#

nice erroe

stray wasp
#

very helpful

#

is the output

sinful lotus
#

then you dont have anything on the command

#

I think so

stray wasp
#
    let cmd = client.commands.get(command);
    if (!cmd) return;
    console.log(cmd);
    cmd(channel, userstate, message, self);
#
    console.log(command);
    
    let cmd = client.commands.get(command);
    if (!cmd) return;
    console.log(cmd);
    cmd(channel, userstate, message, self);
sinful lotus
#

do you actually tried too do client.commands.size?

keen salmon
#

ok did you export your functions at the other files

sinful lotus
#

and log it

keen salmon
#

owo

sinful lotus
#

@stray wasp show me the log of client.commands.size

stray wasp
#

alright

keen salmon
#

@stray wasp is the file you try to load exported correctly

sinful lotus
#

how many commands did you exported one for now?

stray wasp
#

yes

#
module.exports = (client, channel, userstate, message, self) => {
    client.say(channel, "Hey it works omg!");
}
sinful lotus
#

ok now that it loads, how do you load the command

stray wasp
#

is what it contains

keen salmon
#

waiwaitwait

#

let it load longer and check the size again

stray wasp
#

ok

keen salmon
#

@sinful lotus probably foreacj

stray wasp
#

@sinful lotus

fs.readdir("./commands/", (err, files) => {
    if (err) return console.error(err);
    files.forEach(file => {
        if (!file.endsWith(".js")) return;
        let props = require(`./commands/${file}`);
        let commandName = file.split(".")[0];
        console.log(`Attempting to load command ${commandName}`);
        client.commands.set(commandName, props);
    });
});
#

nope didn't work

sinful lotus
#

module.exports = (client, channel, userstate, message, self) => {
client.say(channel, "Hey it works omg!");
}

#

try putting exports.run =

#

then run it with cmd.run

stray wasp
#

ok

#

omg

#

I think that would work haha

keen salmon
#

o

#

owo

stray wasp
#

omg

#

thank you

keen salmon
#

owo

#

respect +

stray wasp
#

it works!!!

#

thats because I didn't ref it

keen salmon
#

san Andreas mission complete sound

keen salmon
#

@Saya#0113

sinful lotus
wicked dust
#

hi

glossy echo
#
if(command === "cookie"){
let user = message.mentions.users.first();
let razon = args.slice(1).join(' ');

if(!user) return message.channel.send('You must tag someone.');

if(!razon){
  razon ='Just wanted to give you a cookie';

}
message.channel.send('**'+ user.username +',** you have received a :cookie: from **'+message.author.username+'**\n\n**Reason:** '+razon+'\n(づ。◕‿‿◕。)づ:・゚✧ :cookie:');
}``` 
There
#

Didn't want to send it here lol

#

I'm sleepy, sorry

sinful lotus
#

what is that for

glossy echo
#

Do you want a cookie?

sinful lotus
#

why post it here

glossy echo
#

I made the command for a friend and send it in the wrong chat, anyway, use it if you ever want to give a cookie to someone

knotty steeple
#
could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5430?
could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5430?
``` anyone know what this means
#

when im trying to connect to postgres server

earnest phoenix
#

I don't know, man

whole plume
#

its looking for it on localhost

#

if its not on your system that's why

#

if it is then I cant tell ya

knotty steeple
#

when i try to start the server with pg_ctl i also get that

steel drum
#

maybe the port isnt open/

#

shouldnt matter tho

#

its a local host

#

¯_(ツ)_/¯

earnest phoenix
#

Right

whole plume
#

interesting question coming

#
member.sendMessage(`${msg.author.tag} sent you some nudes.`, {files: [`./pics/hentai/${files[Math.floor(Math.random()*files.length)]}`]})```
#

how would I make it mention the author instead of the username#0000

#

disregard

slender thistle
#

Would ${msg.author} convert it into a mention?

onyx karma
#

@${msg.author.username}#${msg.author.discriminator}

#

@whole plume

whole plume
#

theers

#

cheers*

#

what i ended up doing was <@${msg.author.id}>

earnest phoenix
#

just put msg.member

#

the tostring gives a mention

earnest phoenix
#

Why erroring

#

?

#

Cant find sqlite moduke

#

Ok

#

Wait

#

Not working

#

its not sqlite

#

its looking for module in some weird folder lmao

#

deletee node modules

#

and reinstall them

#

Bot developers can you tell me how to make a spam bot

languid dragon
#

no, nobody here will help you break Discord's Terms of Service.

#

@earnest phoenix ^

earnest phoenix
#

My package.json

#
{
  "name": "crex",
  "version": "0.0.1",
  "description": "Bot yapımcısı Foalwy",
  "main": "bot.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node bot.js"
  },
  "engines": {
    "node": "8.4.0"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/An-Idiots-Guide/guidebot.git"
  },
  "author": "The Idiot's Guide Community",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/An-Idiots-Guide/guidebot/issues"
  },
  "homepage": "https://github.com/An-Idiots-Guide/guidebot#readme",
  "dependencies": {
    "array-sort": "^1.0.0",
    "chalk": "^2.4.1",
    "cleverbot-node": "^0.3.11",
    "cool-images": "^1.0.1",
    "dbl.js": "^1.5.0",
    "dblapi.js": "^2.2.0",
    "discord.js": "^11.2.1",
    "enmap": "^0.3.2",
    "express": "^4.15.5",
    "fortnite": "^4.1.1",
    "gifencoder": "^1.1.0",
    "isgd": "^1.1.3",
    "moment": "^2.18.1",
    "moment-duration-format": "^1.3.0",
    "node": "^10.8.0",
    "opus": "^0.0.0",
    "request": "^2.87.0",
    "simple-youtube-api": "^5.0.2",
    "steam-provider": "^0.2.0",
    "superagent": "^3.8.3",
    "table": "^4.0.3",
    "weather-js": "^2.0.0",
    "ytdl-core": "^0.21.1",
    "jimp": "^0.2.8",
    "figlet": "^1.2.0",
    "hastebin-gen": "^1.3.1",
    "quick.db": "^4.2.1",
    "fortnitetracker-7days-stats": "^3.1.1",
    "strict-uri-encode": "^2.0.0",
    "cowsay": "^1.3.1",
    "google": "^2.1.0",
    "cat-names": "^1.0.2",
    "canvas": "^1.6.11",
    "sqlite": "^3.0.0"
  }
}```
#

why are you telling me

#

do npm i to install ur modules

#

No

whole mural
#

Aight, someone wanna let me know why this doesn't work?

[JDA MainWS-ReadThread] ERROR JDA - One of the EventListeners had an uncaught exception
org.json.JSONException: JSONArray initial value should be a string or collection or array.
    at org.json.JSONArray.<init>(JSONArray.java:179)
    at Main.onMessageReceived(Main.java:43)
    at net.dv8tion.jda.core.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:410)
    at net.dv8tion.jda.core.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:84)
    at net.dv8tion.jda.core.handle.MessageCreateHandler.handleInternally(MessageCreateHandler.java:127)
    at net.dv8tion.jda.core.handle.SocketHandler.handle(SocketHandler.java:37)
    at net.dv8tion.jda.core.requests.WebSocketClient.onDispatch(WebSocketClient.java:996)
    at net.dv8tion.jda.core.requests.WebSocketClient.onEvent(WebSocketClient.java:894)
    at net.dv8tion.jda.core.requests.WebSocketClient.handleEvent(WebSocketClient.java:873)
    at net.dv8tion.jda.core.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:1031)
    at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:368)
    at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:270)
    at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:990)
    at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:749)
    at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
    at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
    at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)```
#

code is

#
        if ( event.getMessage().getContentRaw().equals("!dog") ) {
            //Use Unirest to get from api.
            try {
                
            HttpResponse<JsonNode> jsonResponse = Unirest.get("https://api.thedogapi.com/v1/images/search").asJson();
            //Use org.json.jsonobject to parse the json
            JSONObject jsonReply = new JSONObject(jsonResponse.getBody());
            //Store image url from json reply in "imageUrl"
            JSONArray jsonarray = new JSONArray(jsonReply);
            String imageUrl = "placeholder";
            for (int i = 0; i < jsonarray.length(); i++) {
                JSONObject jsonobject = jsonarray.getJSONObject(i);
                imageUrl = jsonobject.getString("url");
            }
            //Send message back with simply just the image url
            event.getChannel().sendMessage(imageUrl).queue();
        } catch (UnirestException e) {
            e.printStackTrace();
        }```
steel drum
#

org.json.JSONException: JSONArray initial value should be a string or collection or array.

#

the input was probably not one of those

whole mural
#

i guess?
This is the first experience i really have with java.

inner jewel
#

a couple things

  1. don't use unirest
  2. you're using org.json wrong:
    • new JSONArray(text goes here)
    • new JSONObject(text goes here)
#

when you do new JSONObject(jsonResponse.getBody()) you're using a constructor that'll treat the body as just a java bean, aka will read it's fields from getters into a new json object, instead of reading the json you already have

whole mural
#
  1. What's wrong with unirest?
  2. Okay
inner jewel
#

global state, doesn't follow the http spec properly, abandoned library

whole mural
#

wow, okay.

earnest phoenix
#

Should I use a fork of the MySQL module?

#

I was told the main is less stable for huge data retrieval.

steel drum
#

is there any particular reason to use a fork ?

topaz fjord
#

so you can contribute to it to make it actually stable and usable

steel drum
#

nice meme

earnest phoenix
#

Mongodb superior to all databases (unless you have a weirdly relational bot)

inner jewel
#

there's no "superior" db

earnest phoenix
#

Bet

inner jewel
#

also most bots can use relational databases perfectly fine

#

most data they have fits perfectly in relational storage

#

eg levels, prefixes, tags, modlogs, etc

earnest phoenix
#

Oh

inner jewel
#

all can fit easily in relational databases

earnest phoenix
#

Im thinking the opposite

#

Of what being relational means

#

Ignore my antics

#

But why not use a nonsql?

#

Curious

#

Nosql has proven to be faster that SQL langs

#

Alot of bots go rogue here with dms

#

Ive noticed xF

inner jewel
#

"has proven to be faster" in what?

earnest phoenix
#

MongoDB scales very well

#

Structured query langs struggle as your db gets larger

inner jewel
#

mongodb trades reliability for "scalability"

#

it doesn't instantly save data

earnest phoenix
#

I'd say if you don't care about schemas and the such, you'll be great with mongo

inner jewel
#

which means if for whatever reason it crashes you lose data

earnest phoenix
#

I hear this argument a lot...

#

Simple answer: back up your data

#

It's not hard

#

You should be doing that anyway

slender thistle
#

How can it even crash GWchadThinkeyes

earnest phoenix
#

Have a Cron job do it every minute if youre really conscious about it

steel drum
#

this data

#

is based off 1,000,000 requests

#

/ records

#

realistically

#

will a discord bot ever get this much traffic?

inner jewel
#

even if they do

#

there's a lot more factors to consider

#

not exactly with mongo but using rethink (also document based) has given a lot of headaches in my experience

earnest phoenix
#

Indeed

inner jewel
#

as in the database caches way too much data and fucks up by itself

#

cc @cosmic plover @hollow abyss

earnest phoenix
#

MySQL is suited best for small scale databases in my opinion

#

With that being said, your application can always grow big

hollow abyss
#

oh no why was I pinged

earnest phoenix
#

Which is why mongodb is like a long term investment: you plan for the future

hollow abyss
#

oh

#

oh no

inner jewel
#

didnt you lose data a couple times with mongo amy

hollow abyss
#

Yes

cosmic plover
#

we're going 10xer mode amyo

earnest phoenix
#

I've been using mongo for over a year. I always keep backups and I've been fine.

hollow abyss
#

The few things I have that use mongo are backed up hourly because I've had the most wtf data losses with it

earnest phoenix
#

Yes I back up at the top of the hour too.

#

If my bot gets really big, I can even back up every 30 minutes

hollow abyss
#

mongo is the only db where I've somehow lost the entire database by doing <your database here>'s equivalent of db.collection.find().count()

#

¯_(ツ)_/¯

inner jewel
#

having to do backups that frequently is a bad sign imo

earnest phoenix
#

You should be doing backups for any data that you remotely care about

inner jewel
#

doing backups is good, but having to do them because your db might lose all data in normal operation is another story

earnest phoenix
#

I don't do it because I expect to lose my data lol.

#

I do it because it makes sense for any data that's important

hollow abyss
#

well obviously

#

ofc you back up anything remotely important

#

But unless you're terrified that your database is gonna mysteriously disappear - as mongo has done to me more times than I want to think about - then the most you ever really need is ~daily backups

earnest phoenix
#

Maybe you just had really bad luck lol. I can't really relat to the idea of losing data
On the topic of backup frequency, there's really no reason not to backup hourly
I have a Cron job set up. I just start it and forget about it

hollow abyss
#

"I don't want hundreds of GBs of useless backups daily"

earnest phoenix
#

My god

hollow abyss
#

I make more than just bots .-.

earnest phoenix
#

What data do you have

hollow abyss
#

I don't really feel like telling my work "Hey, we need to be backing up this non-critical data every hour, even though a full backup of it is ~300GB each time"

steel drum
#

doesn't mongodb

#

take up more disk space

#

for the same amount of data

#

that'll add up

#

over time

#

especialyl with backups

earnest phoenix
#

Uhm

#

If you store backups on the same server, that's your fault

hollow abyss
#

I never said that

#

But storage elsewhere gets expensive too

earnest phoenix
#

Export them to network attached storage or something

hollow abyss
#

especially if you have fairly long-term backup retention policies because of <insert requirements here>

earnest phoenix
#

@hollow abyss no, wasn't referring to you

hollow abyss
#

ah

steel drum
#

i mean

#

i dont see the instance when

#

i said i stored all my data

#

in teh same server

#

???

earnest phoenix
#

It sure sounded like it

steel drum
#

if u have multiple servers for data storage

#

the mongodb backups

#

will def take up more space

#

than the sql ones

earnest phoenix
#

Actually I have yet to verify this claim

hollow abyss
#

I will say that Mongo has gotten much better in recent years - at least it can actually pass Jepsen nicely now - but it has a god-awful reputation that I don't really wanna trust my data with. And since many, MANY use-cases for databases are relational anyway, Mongo doesn't have much of a point if all you're doing is effectively just dbHandle.save(userInstance) or something

#

"I'm too lazy to use my database correctly" is not the same as "My data is not relational / structured"

earnest phoenix
#

Your data isn't relational. I think it needs counseling. LUL

earnest phoenix
#

someone good with lavalink? im getting error: no http module available

#

what do i need?

inner jewel
#

stacktrace?

earnest phoenix
#

stack-trace or stacktrace.js

inner jewel
#

do you know what a stacktrace is?

earnest phoenix
#

no, i don't

oblique sonnet
west raptor
#

Uh

#

That pic

#

Had ur token

#

So uh

#

Reset your token

#

Noe

steel drum
#

you should load your token from a separate sourc

west raptor
#

Now*

#

Also

#

^^^

oblique sonnet
#

Done also

#

How do i fix it?

west raptor
#

It's invalid syntax

oblique sonnet
#

Error in cmd

#

Its not part of my code :p

west raptor
#

No it isn't

oblique sonnet
#

Huh?

west raptor
#

That's the file throwing the error

oblique sonnet
#

Hm

west raptor
#

Also you don't need to import asyncio iirc

oblique sonnet
#

Ok

earnest phoenix
#
message.channel.send(embed).then(embed => {
        embed.react("🎉").then();
        const filter = (reaction, user) => {
 '🎉' === reaction.emoji.name
        };
        embed.awaitReactions(filter, {max: 1, time: 100000, error: ['time']})
        .then(collected => {
            const reaction = collected.first();
            if(reaction.emoji.name === '🎉') {
                message.author.send(`You just reacted!`)
            }  
        })
        .catch(collected => {
            message.reply("Couldn't reply as fast as time!")
        });
    });

}
  
#

Wont send the message when i react or anyone else reacts

olive lantern
#

did you literally paste an emoji in there

earnest phoenix
#

??

olive lantern
#

did you literally paste an emoji as the emoji name

earnest phoenix
#

yes

olive lantern
#

or did you write the emoji name out

#

lmao don't do that

#

discord uses names for emojis

#

hang on a sec

earnest phoenix
#

\🎉

#

i use unicode

olive lantern
#

Yeah

earnest phoenix
#

and okay

#

:3

olive lantern
#

that's not gonna work with discord reacts

#

kek

earnest phoenix
#

okay

olive lantern
#
message.channel.send(embed).then(embed => {
        embed.react(":tada:").then();
        const filter = (reaction, user) => {
 ':tada:' === reaction.emoji.name
        };
        embed.awaitReactions(filter, {max: 1, time: 100000, error: ['time']})
        .then(collected => {
            const reaction = collected.first();
            if(reaction.emoji.name === ':tada:') {
                message.author.send(`You just reacted!`)
            }  
        })
        .catch(collected => {
            message.reply("Couldn't reply as fast as time!")
        });
    });

}
#

this would be your code for that particular emoji

oblique sonnet
#

I may need help coding my bot in .py

earnest phoenix
#

DiscordAPIError: Unknown Emoji

#

@olive lantern

olive lantern
#

hm

#

🎉

#

works for me

earnest phoenix
#

bot

#

DiscordAPIError: Unknown Emoji

olive lantern
#

put the emoji into quotation marks, or remove them completely

#

I'm not too familiar with the standard DiscordAPI

#

i use JDA for most of my stuff

earnest phoenix
#

its unicode

#

as far as i know

oblique sonnet
#

Oof i need someone who knows python

olive lantern
#

I barely do

earnest phoenix
#
message.channel.send(embed).then(embed => {
        embed.react("🎉").then();
        const filter = (reaction, user) => {
 '🎉' === reaction.emoji.name
        };
        embed.awaitReactions(filter, {max: 1, time: 100000, error: ['time']})
        .then(collected => {
            const reaction = collected.first();
            if(reaction.emoji.name === '🎉') {
                message.author.send(`You just reacted!`)
            }  
        })
        .catch(collected => {
            message.reply("Couldn't reply as fast as time!")
        });
    });

}
olive lantern
#

only the basic basics

earnest phoenix
#

that was old

#

any idea to send message when they react?

oblique sonnet
#

On making a bot in python?

olive lantern
#

no of the language itself haha

oblique sonnet
#

Oh XD

olive lantern
#

I mean hit me with your problem I might be able to help

queen sentinel
#

@earnest phoenix try using `` instead of ""

earnest phoenix
#

for which code

#

?

queen sentinel
#

just a suggestion ¯_(ツ)_/¯

olive lantern
#

for the top one

queen sentinel
#

for the emojis

earnest phoenix
#
        embed.react("🎉").then();
        const filter = (reaction, user) => {
 '🎉' === reaction.emoji.name
        };
        embed.awaitReactions(filter, {max: 1, time: 100000, error: ['time']})
        .then(collected => {
            const reaction = collected.first();
            if(reaction.emoji.name === '🎉') {
                message.author.send(`You just reacted!`)
            }  
        })
        .catch(collected => {
            message.reply("Couldn't reply as fast as time!")
        });
    });

}
#

that

#

?

queen sentinel
#

yes

olive lantern
#
embed.react("🎉").then();
#

turn that into ' '

queen sentinel
#

only write the emoji name

olive lantern
#

^

queen sentinel
#

and not the pasted

olive lantern
#

that might also work

slate kayak
queen sentinel
oblique sonnet
#

Uh

queen sentinel
#

Youtube searchbar best IDE

olive lantern
#

lmao

#

instead of just doing a quick markdown

oblique sonnet
#

The code got deleted rip me

slate kayak
olive lantern
#

rip

queen sentinel
#

I'm not opening atom just to type that up

#

too much time meguface

olive lantern
#

writing a discord bot in cmd
damn son

queen sentinel
#

that's how I run mine Thonk

earnest phoenix
#

nope

#

not workinmg

olive lantern
#

Oof my program has an integrated console

slate kayak
#

nope @olive lantern thats the error im getting and it keeps stopping my bot 😦

queen sentinel
#

what have you got written at line 171 at character 17?

slate kayak
earnest phoenix
#
  const { RichEmbed, version } = require('discord.js');
    const config = require('../storages/config.json');    
  
module.exports.run = async (client, message, args) => {

let embed = new RichEmbed()
.setColor("FFFF00")
.setDescription(`React! below`)

message.channel.send(embed).then(embed => {
        embed.react(`🎉`).then();
        const filter = (reaction, user) => {
 ':tada:' === reaction.emoji.name
        };
        embed.awaitReactions(filter, {max: 1, time: 100000, error: ['time']})
        .then(collected => {
            const reaction = collected.first();
            if(reaction.emoji.name === `:tada:`) {
                message.author.send(`You just reacted!`)
            }  
        })
        .catch(collected => {
            message.reply("Couldn't reply as fast as time!")
        });
    });

}

#

thats my code

inner jewel
earnest phoenix
#

does not work

inner jewel
#

the api returns emoji names as unicode

earnest phoenix
#

😦

olive lantern
#

Oof

inner jewel
#

when they are unicode, obviously

queen sentinel
#

shouldn't the colour be setColor(0x0000) or something?

#

idk

earnest phoenix
#

i got it to react

#

just

#

i cant get the message to get through

slate kayak
#

im using discord.js @queen sentinel

earnest phoenix
#

when they react

queen sentinel
#

yea I do my colours in discord.js like that

earnest phoenix
#

P(

#

😦

queen sentinel
#

eg .setColor(0xffffff)

#

I think

#

too lazy to open my code

slate kayak
#

oof and here i thought that because its midnight here by me that im tired and lazy now i heard everything xD @queen sentinel

olive lantern
#

Idk how your API works, but regarding the sending of the message code, you have to tell the

reaction.emoji.name

to catch the latest reaction, and then make it check for

if(reaction.emoji.name === `:tada:`) {
                message.author.send(`You just reacted!`)
            }  
west raptor
#

@queen sentinel no, it can also be a string

queen sentinel
#

¯_(ツ)_/¯

earnest phoenix
#

i did that

olive lantern
#

no

queen sentinel
#

My bots are amateur as the come so what do I know

olive lantern
#

so it'll always confirm it

west raptor
#

also, rin is right, its looking for name

#

not unicode

earnest phoenix
#

nothing

#

still

slate kayak
#

nah i think im much more than you @queen sentinel xD

sick cloud
#

ie. \🎉 for tada

inner jewel
#

discord sends the unicode in the name field for reactions

earnest phoenix
#
  const { RichEmbed, version } = require('discord.js');
    const config = require('../storages/config.json');    
  
module.exports.run = async (client, message, args) => {

let embed = new RichEmbed()
.setColor("FFFF00")
.setDescription(`React! below`)

message.channel.send(embed).then(embed => {
        embed.react(`🎉`).then();
        const filter = (reaction, user) => {
 '🎉' === reaction.emoji.name
        };
        embed.awaitReactions(filter, {max: 1, time: 100000, error: ['time']})
        .then(collected => {
            const reaction = collected.first();
         if(reaction.emoji.name === `:tada:`) {
                message.author.send(`You just reacted!`)
            }  
        })
        .catch(collected => {
            message.reply("Couldn't reply as fast as time!")
        });
    });

}
  
                                              
exports.config = {
    command: 'giveaway',
    aliases: ['freegiveaway','free'],
    plevel: "Staff",
    description: "Checks the API Latency for Discord!",
    usage: "ping",
    category: "ヅ General ヅ"
};

exports.extra = {
    hidden: false
};
inner jewel
earnest phoenix
#
module.exports.run = async (client, message, args) => {

let embed = new RichEmbed()
.setColor("FFFF00")
.setDescription(`React! below`)

message.channel.send(embed).then(embed => {
        embed.react(`🎉`).then();
        const filter = (reaction, user) => {
if(reaction.emoji.name === `:tada:`) {
                message.author.send(`You just reacted!`)
            }          };
        embed.awaitReactions(filter, {max: 1, time: 100000, error: ['time']})
        .then(collected => {
            const reaction = collected.first();
         if(reaction.emoji.name === `:tada:`) {
                message.author.send(`You just reacted!`)
            }  
        })
        .catch(collected => {
            message.reply("Couldn't reply as fast as time!")
        });
    });

}
#

legit whaty i have

sick cloud
#

why are you sending "embed" then defining "embed"

#
message.channel.send(**embed**).then(**embed** => {
inner jewel
#

ohhh

sick cloud
#

lmao

queen sentinel
#

^^

slate kayak
inner jewel
#

it might be receiving it's own reaction

earnest phoenix
#

oh

queen sentinel
#

hold

sick cloud
#

also yeah it isnt filtering

earnest phoenix
#

embed.awaitReactions(filter, {max: 1, time: 100000, error: ['time']})

#

those the max

inner jewel
sick cloud
#

add to the filter

inner jewel
#

it'll start waiting for reactions before actually reacting

sick cloud
#

wait your filter is buggered

#
const filter = (reaction, user) => {
if(reaction.emoji.name === `:tada:`) {
                message.author.send(`You just reacted!`)
            }          };

thats not how the filters work

queen sentinel
#

@slate kayak .setColor(0xff3262) that's how I've always done it

sick cloud
#
const filter = (reaction, user) => (!user.user.bot && reaction.emoji.name === '🎉');
#

that woild work

earnest phoenix
#

embed.awaitReactions(filter, {max: 1, time: 100000, error: ['time']})

#

those the max

#

do anything?

sick cloud
#

we know

#

replace your filter

#

with my one

slate kayak
#

ok so i dont need the ' before and after the ' ? <@&304313580025544704>

#

@queen sentinel

sick cloud
#

wow

queen sentinel
slate kayak
#

sorry

inner jewel
#

what

queen sentinel
#

rip

sick cloud
#

👏

granite tartan
#

TRIGGERED

earnest phoenix
#

okay

#

done

inner jewel
#

also no need to do js const mystring = `this`;

queen sentinel
#

and no you shouldn't if it works for me @slate kayak

#

but that's just a theory

#

a GAME THEORY - thanks for watching

inner jewel
#

you can just do js const mystring = "this"; //or const mystring = 'this';

sick cloud
#

i always use '

inner jewel
#

i only use ` when doing interpolation

#

because that's the only one that allows

earnest phoenix
#
  const filter = (reaction, user) => (!user.user.bot && reaction.emoji.name === '🎉');

                                                      ^


TypeError: Cannot read property 'bot' of undefined
west raptor
#

@queen sentinel if can also be a string

earnest phoenix
#

@sick cloud

slate kayak
#

ok but why does the bot stops for that @queen sentinel ?

west raptor
earnest phoenix
#

@earnest phoenix One, what the heck is user.user.bot?

west raptor
#

oh yea

earnest phoenix
#

thats what @sick cloud told me to do

west raptor
#

no need for two user

slate kayak
#

@queen sentinel can you help me on hasbin please as the bot stopped again 😦

earnest phoenix
#

Two, and it's more of an opinion, you don't need () around the function

west raptor
#

you would only do that if you are getting user info from a member

#

@sick cloud angryeyes

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

let embed = new RichEmbed()
.setColor("FFFF00")
.setDescription(`React! below`)

message.channel.send(embed).then(embed => {
        embed.react(`🎉`)
        const filter = (reaction, user) => (!user.bot && reaction.emoji.name === '🎉');
        embed.awaitReactions(filter, {max: 1, time: 100000, error: ['time']})
        .then(collected => {
            const reaction = collected.first();
         if(reaction.emoji.name === `:tada:`) {
                message.author.send(`You just reacted!`)
            }  
        })
        .catch(collected => {
            message.reply("Couldn't reply as fast as time!")
        });
    });

}
#

what i have now

#

and it does not work

slate kayak
gilded blaze
#

Should probably await that react method

queen sentinel
#

I'm afraid I'm of no use here meguface

slate kayak
#

@queen sentinel thats what 173 is 😦

queen sentinel
#

Haven't a clue, sorry

earnest phoenix
#

ill reward someone 1.01$ paypal

#

to sort this out

#

;-;

night imp
#

What is the error?

earnest phoenix
#

theres no error

gilded blaze
#

What is not happening ?

earnest phoenix
#

just when i react it does not send a message

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

let embed = new RichEmbed()
.setColor("FFFF00")
.setDescription(`React! below`)

message.channel.send(embed).then(embed => {
        embed.react(`🎉`)
        const filter = (reaction, user) => (!user.bot && reaction.emoji.name === '🎉');
        embed.awaitReactions(filter, {max: 1, time: 100000, error: ['time']})
        .then(collected => {
            const reaction = collected.first();
         if(reaction.emoji.name === `:tada:`) {
                message.author.send(`You just reacted!`)
            }  
        })
        .catch(collected => {
            message.reply("Couldn't reply as fast as time!")
        });
    });

}
gilded blaze
#

That's cause you set a time of 100 seconds

earnest phoenix
#

^^

night imp
#

please console.log collected

earnest phoenix
#

okay

gilded blaze
#

It waits 100 seconds then resolves the promise.

#

With the collected reactions.

night imp
#

oh wait ur using that one yeah

#

or wait no

earnest phoenix
#

no logs

night imp
#

ok then there is something wrong with either your filter or with the max and such

#

try setting the time to 5000

gilded blaze
#

It's a unicode symbol

earnest phoenix
#

no

#

should i do

#

unicode

#

\🎉

gilded blaze
#

yes

earnest phoenix
#

okay

gilded blaze
#

Custom emojis and unicode emojis are different.

earnest phoenix
#

works

#

for me

#

but not with alt

gilded blaze
#

Because max is 1

#

It stops after 1 reaction

earnest phoenix
#

ah

#

so i increase to 100

#

?

#

or 1000

gilded blaze
#

Sure. If you want 100 people to react

earnest phoenix
#

okay

#

let me try

#

i increased

#

the max

#

and now it does not work

west raptor
#

what's the max

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

let embed = new RichEmbed()
.setColor("FFFF00")
.setDescription(`React! below`)

message.channel.send(embed).then(embed => {
        embed.react(`🎉`)
        const filter = (reaction, user) => (!user.bot && reaction.emoji.name === '🎉');
        embed.awaitReactions(filter, {max: 1000, time: 20000000, error: ['time']})
        .then(collected => {
            const reaction = collected.first();
         if(reaction.emoji.name === `🎉`) {
                message.author.send(`You just reacted!`)
            }  
        })
        .catch(collected => {
            message.reply("Couldn't reply as fast as time!")
            console.log(collected)

        });
    });

}
gilded blaze
#

It gets the first reaction

#

If you want to send everyone a message who reacts you should loop it

earnest phoenix
#

how would i do that?

gilded blaze
#

collected.forEach might be a thing

earnest phoenix
#

hm

#

i have no idea how to implement that

gilded blaze
#

What exactly are you trying to do?

earnest phoenix
#

when someone reacts

#

it sends a message

#

like everyone

#

client.on('messageReactionAdd', (reaction, user) => {
if(reaction.emoji.name === "✅") {
console.log(reaction.emoji.users);

#

na

#

would not work

gilded blaze
#

Forever?

earnest phoenix
#

yes

gilded blaze
#

Just use the messageReactionAdd event

earnest phoenix
#

so that

gilded blaze
#

No need for a collector

earnest phoenix
#

above

#

ah

spark grove
#

Good evening, sorry to disturb, Im learning web development and I know html/css and want to learn js and node js etc for web are you doing private teaching ? If one of you do contact me mp for more information

quartz kindle
#

i could, for a price

steel drum
#

lol

#

asking discord bot devs

#

to teach u webdev

spark grove
#

Yeah we told me there was a lot of web developer

quartz kindle
#

i was a web dev before making a bot so...

spark grove
#

Ok

visual zenith
#

um guys... how to send a message to a specific channel for c#

prime cliff
#

GWqlabsHyperSweats you get the channel from the guild object and send a message from the channel object simple

cold harness
#

I'm trying to find a way to check if a user has a specific role from one server in d.py

earnest phoenix
#
function test(){
    while(true){
        test()
    }
}```
#

effeciency

zealous veldt
#

yes

topaz fjord
#

calling a function within itself a great way to make mem leaks

#

if you have event listeners in the function

zealous veldt
#

O yes

#

Even better

quartz kindle
#
function lol() {
    while(true) {
        client.on("all", a => {
            console.log(a);
            fs.writeFile(`${performance.now()}.txt`,"lol","utf8",(err) => {
                console.log(err);
            });
        });
        lol();
    }
}```
zealous veldt
#

ever more bettererer

lusty dew
#

undefined

#

Can someone help me

#

That is all I get

#

In console

#
var IP = args[0]
#

Pretty sure

#

this is the problem

zealous veldt
#

that means that the item at position 0 in array args is undefined or, iirc, the array args might be undefined

lusty dew
#

Oh ok

earnest phoenix
#

its just args[0] is undefined

#

if args were undefined, you would get args is undefined im dumb

lusty dew
#
https://ipapi.co/${IP}/json/
#

I am trying to define IP for this

earnest phoenix
#

console.log(args) and make sure it has what you expect

lusty dew
#

I got nothing in console log

zealous veldt
#

nothing? or []? or undefined?

lusty dew
#

Well I get undefined

#

But I get that

earnest phoenix
#

are you sure your passing it propperly?

lusty dew
#

Even without the console logs

#

Brb

#

Taking shower

earnest phoenix
#

depending on how long it takes to get what your passing you may also look into async await or some sort of callback to only pass when its recieved what its passing properly

#
console.log('hello world')
#

am i developer now?

zealous veldt
#

lol

earnest phoenix
#

there should be a challenge here for most conveluded hello world

cold harness
#

if i edit a message a bunch of times, will i get ratelimited?

earnest phoenix
#

depends how fast

#

but i think its ratelimited

#

yea

cold harness
#

hm we'll see

#

XD

lusty dew
#

I think every 5s

#

Or so

earnest phoenix
#

what are you doing that requires quick edits?

#

curious

cold harness
#

"typing"

earnest phoenix
#

oh

#

like live typing

#

?

#

animation

#

esque

cold harness
#

kinda

earnest phoenix
#

maybe generate a gif with discords color background instead 👀

zealous veldt
earnest phoenix
#

-bots @zealous veldt

gilded plankBOT
#
Moose#9999
Bots

@ashen stag
@vocal seal

zealous veldt
#

datacenter maintenence

earnest phoenix
#

?

#

oh

#

fun

#

whats the name?

zealous veldt
#

of?

lusty dew
#

Pretty sure your bot

#

lol

lusty dew
#

Ye

earnest phoenix
#

-bots

gilded plankBOT
#
! 🌹ƐмreβuɠɠeƦ | ^^🌹#6026
Bots

@near hill
@full dust

whole plume
#

@sinful lotus

bot.on('message', message => {
    if(isValidCommand(message.content) == false) return
    try{
        require(`./commands/${message.content.split(" ")[0].replace(settings.prefix, '')}.js`).execute(message, bot)
    } catch(e){
        console.log(e)
        bot.errorMessage(message, "Command does not exist. Run ~help to see all current commands.")
    }
})```
sinful lotus
#

thats not good a practice from my standpoint

#

you require every time the command is run

whole plume
#

i mean

#

it works, which is all I ask of it

sinful lotus
#

basically I will put it in simple terms,

Its like requiring discord.js on every command

whole plume
#

eventually, yes I might swap it out for a more efficient version, but for now its fine

sinful lotus
#

I created this premade code for those who want to have a handler

#

it is also exported on event

whole plume
#

ight

#

i'll look at it

sinful lotus
#

I can pretty much explain what I wrote there so just ping me if you dont understand something

whole plume
#

ight

sick cloud
#

@whole plume invalid command responses are frowned upon

whole plume
#

idc xd

#

and it doesnt put it in chat anymore tbh

#

it puts it in console

civic wedge
#

-spano

earnest phoenix
#

anyone knows a http module for lavalink? (discord.js) (javascript)

heady zinc
#

you don't need one ThonkangEyes

earnest phoenix
#

i'm getting error: no available http module

restive silo
#

@earnest phoenix do you use a lib for lavalink? This error looks like you use one

earnest phoenix
#

ithink i do

restive silo
#

Pretty sure you do

#

Wait do you use appelations lib? GWpingKanyeLUL

#

If yes then you probaly didnt provide host.rest

#

Aka the rest url to use Lavalinks rest api

earnest phoenix
#

this is where i got the "lavalink" from

topaz fjord
#

use discord.js-lavalink

restive silo
#

No AngeryBOYE

topaz fjord
#

yes

#

jacz is better

restive silo
#

Anyway look the readme up @earnest phoenix

#

@topaz fjord dude fuck off

#

Thanks

heady zinc
#

yukine pls

restive silo
#

No its annoying af that people always come in and do "UHHHH MY LIB IS BETTER"

#

Like could you post that somewhere else, thanks

heady zinc
#

it is a better solution tho

#

like discord.js-lavalink is simpler to use, so it makes sense for this specific user to use it rather than appelations's lib

earnest phoenix
#

how do i setup the lavalink http host?

heady zinc
#

see what i mean ^

restive silo
#

sigh

earnest phoenix
#

well how do i do it lol

restive silo
#

@heady zinc thats not my point, he might be new to Js/node but i still dont need people always telling other people to use x lib in here and instead just answer his question help him with his issue

earnest phoenix
#

i suck ass at nodejs thts why im confused af

#

ok i have that hw df do i find a "http" host

restive silo
#

thtats the ip where your lavalink server is located + the http port you specified in the config

earnest phoenix
#

well i dont have a lavalink server...

restive silo
#

then you need to set one up

#

you can't use Lavalink without a Lavalink Server

earnest phoenix
#

and how do i set up one?

restive silo
earnest phoenix
#

how do u download files from github?

restive silo
#

scroll down

#

there is a "Server configuration" tab

earnest phoenix
#

ok got it

#

now wat

spring ember
#

@restive silo ffmpeg GWqlabsMmLol

hybrid raptor
#

hm

#
Date.daysBetween = function( date1, date2 ) {var one_day = 1000 * 60 * 60 * 24;var date1_ms = date1.getTime();var date2_ms = date2.getTime();var difference_ms = date2_ms - date1_ms;return Math.round(difference_ms/one_day);};  
let created  = new Date(message.author.createdAt);
        let days = new Date(created.getFullYear(), created.getMonth(), created.getDate());Date.daysBetween(created, new Date())
console.log()
#

how would i log this

#

;-;

#

when i eval without console.log()

#

got it from stackflow

#

i logged

#

created

#

returns time date

#

logged days returned the same

#

i used eval and it worked

#

as output

spring ember
#

Empty console.log()

#

Also

#

What do you want to achieve

#

I can't understand anything

hybrid raptor
#

i explained

#

why i have empty

#

xD

#

i need it to try send the data to the console

spring ember
#

No

hybrid raptor
#
penguin!eval Date.daysBetween = function(date1, date2) {
  var one_day = 1000 * 60 * 60 * 24;
  var date1_ms = date1.getTime();
  var date2_ms = date2.getTime();
  var difference_ms = date2_ms - date1_ms;
  return Math.round(difference_ms / one_day);
};
let created = new Date(message.author.createdAt);
let days = new Date(created.getFullYear(), created.getMonth(), created.getDate());
Date.daysBetween(created, new Date())
#

there.

spring ember
#

console.log(Date.daysbetween...)

hybrid raptor
#

tried that

spring ember
#

Btw

hybrid raptor
#

returns time and date

#

Yes?

spring ember
#

Your function does not return a result

#

just add return days

#

And remove the log from the function so you won't cause recursion

#

Or do console.log(days)

earnest phoenix
#

whats a websocket connection for lavalink?

#

its how your bot talks to lavalink

#

how df do you set that up

west raptor
#
const dbl = new DBL('Your discordbots.org token', client);
``` this isnt required to get bot info, correct?
#

or

#

no

earnest phoenix
#

to get info on a specific bot GET/bots/{bot.id}, no. no auth required

#

but that code is not just your token, that is making new instance of DBL which posts stats.

whole condor
#

const dbl = new DBL(tokendbl, bot);

Anyone know why he does not find my vote when I did it?

dbl.getVotes().then(votes => {

            if (votes.find(vote => vote.id == message.author.id)) {

}
})
meager stirrup
#

Hey, I'm trying to get my bot to come online, but it wont work.... I'm using Discord.js... any help?

loud salmon
#

https://anidiots.guide/ this is a good resource for discord.js bot development, maybe try looking at the Your First Bot section?

meager stirrup
#

kk thx

earnest phoenix
#

a copycats guide

loud salmon
#

no u

meager stirrup
#

👌

#

okay so I read through it, but I'm pretty sure it doesn't tell me how to turn on the bot :c

restive silo
#

this should help then

loud salmon
#

Did you try running the code?

earnest phoenix
#

do you use "player.play("youtubeurl")" for lavalink player.play ?

#

no it needs the base64 "track" from lavalink

#

you can get from the loadtracks endpoint

#
const res = voice.load("ytsearch: rickroll")
player.join(msg.member.voiceChannel.id)

player.play(res)

do i get the base64 via load?

meager stirrup
#

I get this error

#

still not working

smoky spire
#

Is discord.js the name of your file?

earnest phoenix
meager stirrup
#

no... its not,

loud salmon
#

replace discord.js with the name of your file

meager stirrup
#

kk

earnest phoenix
#

@earnest phoenix use the correct auth header in your request

#

to match the password in application.yml

#

clearly i did

#

but i still get the error

#

ok well clearly ur not

#

the auth

#

header

#

for

#

request

#

to

#

rest

#

endpoint

#
const voice = new Node({
    password: 'idfk1234', // your Lavalink password
    userID: '473043401374302218', // the user ID of your bot
    shardCount: 1, // the total number of shards that your bot is running (optional, useful if you're load balancing)
    hosts: {
        rest: '', // the http host of your lavalink instance (optional)
        ws: 'ws://127.0.0.1:80', // the ws host of your lavalink instance (optional)
      },
    send(guildID, packet) {
      // send this packet to the gateway
      // you are responsible for properly serializing and encoding the packet for transmission
      return gateway.connections.get(Long.fromString(guildID).shiftRight(22).mod(this.shardCount)).send(packet);
    },
    
  });

this ?

#

oh this is your websocket server auth error Thonk

#

could be...

#

but is there a fix to this?

#

did u restart lavalink since changing the config?

#

long shot but might as well ask

#

i did

#

i restarted 100 times still get the same

livid whale
#

how to delete a category in js

earnest phoenix
#

the errors popup when i type node bot.js

earnest phoenix
#

so @earnest phoenix is this rlly a websocket error or something else?

#

yes

#

socketserver is ur websocket

#

hmm ok

short sable
#

When ur bot is nearing completion and starting to come together FeelsAmazingMan

grizzled isle
#

When you think everything works but your Ctrl c+v didn't work right now you have to spend hours on end fixing it.

short sable
#

^ basically that

ruby dust
#

Or you can just Ctrl+z the mistake thonkku

restive silo
#

@earnest phoenix set hosts.ws and hosts.rest

tulip snow
#
2018-09-12 14:22:41 | [INFO]    | Discordia 2.5.1
2018-09-12 14:22:41 | [INFO]    | Connecting to Discord...
2018-09-12 14:22:41 | [ERROR]   | 401 - UNAUTHORIZED : GET https://discordapp.com/api/v7/users/@me
2018-09-12 14:22:41 | [ERROR]   | Could not authenticate, check token: HTTP Error 0 : 401: Unauthorized
loud salmon
#

wrong token?

short sable
#

Could not authenticate, check token:

#

definitely

tulip snow
#

Like wrong bot token?

#

oh wait I got it

#

Forgot

bot:login(`Bot My_Token`)
``` the Bot part
meager stirrup
#

you know i might be typing the wrong thing in, what is the thing I type in for Disocrd.js to start the bot? I know it's probably somethng simple and I'm just being dumb

earnest phoenix
#

Just how you start any other node.js application

meager stirrup
#

oh k

#

node.js : The term 'node.js' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1

  • node.js
  •   + CategoryInfo          : ObjectNotFound: (node.js:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
earnest phoenix
#

The syntax is node file.js

#

Or node . If the application is in the current working directory

meager stirrup
#

oof

#

wait what you mean by that again?

tulip snow
#

type node YOUR_MAIN_FILE.js

meager stirrup
#

okay i did it, didnt get any message back, but I have it where it gives me something saying "ready" when it works, but it didnt play, and the bot isnt on

spring ember
#

how do I get the guild icon when it's the letters? (oauth)

earnest phoenix
#

You don't

#

If there isn't an icon, it's null

tulip snow
#

How to install base64?

loud salmon
#

what

#

base64 isnt software?

tulip snow
#
base64 = require("base64")
hybrid raptor
#

is there a icon of dbl?

earnest phoenix
ruby dust
#

...it's literally this server's icon

hybrid raptor
#

its for a website

ruby dust
#

ok...?

spring ember
ruby dust
#

you managed to recreated it identicaly clapping

spring ember
#

yeah

inner jewel
#
function getIcon(guild) {
    if(guild.icon) return guild.icon;
    const guildName = guild.name;
    const name = guildName.replace(/\w+/g, n => n[0]).replace(/\s/g, "");
    return `http://via.placeholder.com/512/202225/ffffff.png?text=${name}`;
}```this is what i use
spring ember
#

what is placeholder . com

earnest phoenix
#

I use CSS to do it

whole mural
#

makes placeholder images

inner jewel
#

i can't use css for that because i set the favicon

rough trellis
#

Hey, can someone help me with a problem? I have the Dank Memer bot in our server, and I want to do a gamble function but the bot gives this message to me and no one else on the server "Error: gamble.15.186.21:57.err6530".

west raptor
#

This isn't development related

rough trellis
#

hmm, where do I post it?

loud salmon
#

In the dank memer support server