#development

1 messages · Page 584 of 1

empty owl
#

ok

sinful lotus
#

and the const tag is literally the tag already

uneven wren
#

I'm on mobile and not logged in and just notice theres a donate feature. Is that pretty easy to set up? also in terms of checking if someone donated

empty owl
#

do I use user.username and stuff

sinful lotus
#

no

#

its already done

empty owl
#

@uneven wren donate bot

amber fractal
#

tag = username#discrim

empty owl
#

oh

uneven wren
#

ok ill check out donate bot when i have a chance

empty owl
#

so I can use

#

like

#
send(tag)
#

and it would send the user+disc

sinful lotus
#

yes it will send the user+disc already

empty owl
#

ok

#

how would I find the ID then

sinful lotus
#

vote.user

empty owl
#

ok

amber fractal
#

Why does this make me want to develop a lib

#

Lmao

sinful lotus
#

something like .send(`${tag} (${vote.user})`)

empty owl
#

do I put my code using the user+discr into the vote event?

sinful lotus
#

yes since the scope of tag is there

empty owl
#

ok

#

Thank you

amber fractal
#

You tried that edit so many times

sinful lotus
#

THERE

#

lmao

amber fractal
#

idk why you cant escape single like things like that]

#

idk what they're actually called

empty owl
#

oogf

sinful lotus
#

I just created a mini server tbh for the votes for dbl api so that I can just send requests from my bot to that mini server

#

easier management

empty owl
#

ok

sinful lotus
amber fractal
#

Wouldnt you need to change your path in the dbl site?

#

Or does it listen to all of it or something

sinful lotus
#

the path for sending the votes is just one

#

I mean

#

the path for receiving votes

#

the request for checking vote has 2 paths

empty owl
#

oh shoot

#

uwu

#

is there to get t let voteEmbed = new Discord.RichEmbed()
.setTitle(${tag} just voted!)
.addField('ID', vote.user, true)

 .setColor(Math.floor(Math.random() * 16777214) + 1)

bot.channels.get('552674443131093002').send({voteEmbed});

#

transfered

#

like bot doesnt wokr

sinful lotus
#

maybe use webhook?

empty owl
#

but i need to send

sinful lotus
#

webhooks are easier on your use case

amber fractal
#

I'm just looking at your code and I'm confused some stuff, I'm not very good with listeners

empty owl
#

ook

#

lol

amber fractal
#

So it listens on the port, so in the dbl site, the dblwebhook default path

#

where is that going in this case

#

Looking at this line fastify.listen(port, '0.0.0.0', () => console.log(`[Notice] Haruna's Vote Service is now Online, listening @ ${port}`))

sinful lotus
#

look at the lines on top of that

#

theres a single .post there

amber fractal
#

to /vote/

sinful lotus
#

yes thats the endpoint for dbl webhook to send to

amber fractal
#

so the path of your webhook on the dbl site would be /vote/?

empty owl
#

@sinful lotus how do u use webhooks

sinful lotus
#

yes just add /vote/

amber fractal
#

then that calls the onVote function when it gets a request

#

ALright

#

Just trying to learn something new

sinful lotus
empty owl
#

ok thx

amber fractal
#

Your little lib thing is quite cool tbh

empty owl
#

Uwu do I create a new app for webhooks

sinful lotus
#

then checking for votes on my main bot is as simple as

class VoteManager {
    constructor(client) {
            this.client = client
            this.auth = 'Lewd_Password'
    }

    async hasVoted(id) {
        if (this.client.config.heroes.includes(id))
            return true
        const request = await this.client.fetch('http://coolstuff.net:69/hasVoted/', {
            headers: { 'authorization': this.auth, 'user_id': id }
        })
        if (!request.ok)
            throw new Error('Vote Service offline, please contact the developers')
        return request.json()
    }

    async checkStatus(id) {
        if (this.client.config.heroes.includes(id))
            return true
        const request = await this.client.fetch('http://coolstuff.net:69/getVotedTime/', {
            headers: { 'authorization': this.auth, 'user_id': id }
        })
        if (!request.ok)
            throw new Error('Vote Service offline, please contact the developers')
        return request.json()
    }
}

@amber fractal

empty owl
#

ik

#

i got my link

#

like how do I make it send messages

#

without using bot

#

because I have to double login if I do that

sinful lotus
#

require d.js on your server.js
then just refer to that code

amber fractal
#

So do these fastify.get('/hasVoted/', (req, res) => this._onCheck(req, res)) fastify.get('/getVotedTime/', (req, res) => this._onCheckInfo(req, res)) only run once?

sinful lotus
#

per request

#

someone requests in /hasVoted/ it will run onCheck

amber fractal
#

But doesnt it listen on /vote/?

sinful lotus
#

yes but that is post

#

basically

#

that server has 3 endpoints
POST /vote/
GET /hasVoted/
GET /getVotedTime/

empty owl
#

thanks

sinful lotus
#

it listens to all those 3 endpoints

amber fractal
#

Yeah, but when will it get a request to /hasVoted/?

#

Do you send it?

sinful lotus
#

it will get a request to hasVoted if you used that endpoint

amber fractal
#

So you manually do it

sinful lotus
#

that tackles
GET /hasVoted/
GET /getVotedTime/

amber fractal
#

To check for votes

#

Ill take a look

#

That's what I was wondering, if you called it yourself

#

I was just confused

#

Like I said not good with listeners and that

sinful lotus
#

I just call the function on the listener

#

for example I call GET req in http://{hostname}:{port}/hasVoted/
then it will invoke
fastify.get('/hasVoted/', (req, res) => this._onCheck(req, res))

#

imagine it like

#

the hasvoted is the message listener, and the data is the req, res

amber fractal
#

I understand it now mmLol

sinful lotus
#

yes thats how simple my tiny bitsy wrapper is

amber fractal
#

I wish that someday I could do something like that mmLol

sinful lotus
#

I just did that so I dont have to deal with sharding limitations

amber fractal
#

I stopped logging votes a while ago

#

I just send money to their balance

#

It was getting to spammy

sinful lotus
#

but I just did that so I dont need to see in logs if it does its cronjob properly

#

but yeah thats how a basic api works as well so you can use it possibly in one of your creations in future

amber fractal
#

Idk about that exactly, but making requests to a server that I have running to run a function seems handy

sinful lotus
#

yes it is really handy since you can slam it in another vps

#

and it wont affect your main bot process

amber fractal
#

also I could make my own little internal api

sinful lotus
#

possibilities are endless + fastify's overhead is really low

amber fractal
#

I was just reading some of fastify's docs

sinful lotus
#

on a simple hello world api it can handle up to 78k req per sec vs the express which is 38k only

amber fractal
#

Would I ever even need 1K req/s tho lmao

sinful lotus
#

not really but that overhead is nice to have

plain anvil
#

@jagged birch Yeah, if you could find a link that'd be nice; there's none

amber fractal
#

Lol look what you have me doing ```const fastify = require('fastify')()
const request = require('request')
fastify.get('/test/', (req, res) => doTheDo(req, res))
fastify.listen(666, () => console.log("ok."))

function doTheDo(req, res){
if(!req.headers.hi == "hi") res.send("No")
res.send("Sure bro, you're cool.")
}

const opts = {
headers: {
hi: "hi"
},
url: "http://localhost:666/test/"
}

request(opts, (err, resp, body) => {
if(err) console.error(err)
if(resp.statusCode == 200){
console.log(body)
}
})``` @sinful lotus mmLol

#

Good thing tho

sinful lotus
#

lmao

amber fractal
#

it worked

#

How would I send a different status code

#

is res.statusCode a thing?

#

ah res.code

sinful lotus
#

yes on reject stuff I do that

amber fractal
#

Wait I did a dumb

#

I know how to do stuff

#

So my little prototype works

#

doesn't seem that hard to expand on

sinful lotus
#

yes

#

it also handles the connection closes for you

amber fractal
#

Does it?

#

Cool

#

(I definitely know what that means)

#

it that lie it auto closes on end?

#

or something

sinful lotus
#

yes

#

with async support stuff

plain anvil
#

Welp since RR guy isn't here, anyone familiar with RE want to help me find a mem signature

#

Still in midst of scanning the PE bin

amber fractal
#

You should still be able to contact fishy if you're a patron

plain anvil
junior summit
#

lol

undone hearth
#

@trail river

#

<help

fiery birch
#

don't test bots here

#

thanks

undone hearth
#

ok

#

sorry

restive halo
#

uncaughtException: Unhandled error. ([object Object])Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object]) at Client.emit (events.js:169:17) at Client.emit (domain.js:422:20) at WebSocketConnection.onError (/home/marv/app/bundle/programs/server/npm/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:374:17) at WebSocket.onError (/home/marv/app/bundle/programs/server/npm/node_modules/ws/lib/event-target.js:128:16) at WebSocket.emit (events.js:180:13) at WebSocket.emit (domain.js:422:20) at _receiver.cleanup (/home/marv/app/bundle/programs/server/npm/node_modules/ws/lib/websocket.js:211:14) at Receiver.cleanup (/home/marv/app/bundle/programs/server/npm/node_modules/ws/lib/receiver.js:557:13) at WebSocket.finalize (/home/marv/app/bundle/programs/server/npm/node_modules/ws/lib/websocket.js:206:20) at TLSSocket.emit (events.js:180:13) at TLSSocket.emit (domain.js:422:20) at emitErrorNT (internal/streams/destroy.js:64:8) at process._tickCallback (internal/process/next_tick.js:178:19)

Got this error but no idea what could have caused it

bright spear
#

uh

#

thats really vague

#

anything else?

sinful lotus
#

client.on('error', console.error) listener is missing on your code

restive halo
#

Thanks :3

#

That was the full error that got logged btw advaith
Didnt know what else to send

bright spear
#

ah

#

those are annoying

sinful lotus
#

same

#

so annoying errors

storm elk
#

Hey

lost swallow
#
let playerID = message.author.id;
    let playerName = args.join(" ");
    if (!playerName) return bot.embed(message.channel, `Please provide me with a player name so I can create your profile!`);
    
    var starterWeapon = await message.channel.awaitMessages(message2 => message2.author.id === playerID, {
      maxMatches: 1,
      time: 30000,
      errors: ['time']
    });
    if (starterWeapon !== ["sword", "dagger", "hammer", "bow", "spear", "greatsword", "machete", "staff"]) {
      bot.embed(message.channel, `That's not a valid starter weapon`);
    } else { bot.embed(message.channel, `${message.author.username}, I see you choose ${starterWeapon}. Great option.`); }
    
    bot.embed(message.channel, `✅ Created a new profile, with the name **${playerName}**, and the starting weapon **${starterWeapon}**.`);
    var playerSecret = token.token(13, true);
    db.set(`profileSecret_${message.author.id}`, playerSecret);
    db.set(`profileStarterWeapon_${message.author.id}`, starterWeapon)
    db.set(`profile_${message.author.id}`, playerName, message.author.username);```
#

any ideas why when i run the cmd it jumps straight to the created a new profile message?

lost swallow
#

i got it to work

storm elk
#

Hello

lost swallow
#

why did you ping me

earnest phoenix
#

how do I require from a sub folder?

#

../data/xp.json doesn't work

#

.../

#

that doesn't work either

#

🤔

#

yeah

#

I tried

#

./../data/xp.json

#

nope

#

Hu

#

oof

#

../data/xp.json doesn't work ?

#

nope

#

../../data/xp.json

#

?

#

alright thanks

#

x

#

d

#

Noice

pallid zinc
#

I am not be able to host my bot on keroku

jagged birch
#

Good, heroku is very shit. If you’re looking for a decent free host try glitch @pallid zinc

valid haven
#

Glitch lmao

#

The bot stay 5 hours online and become offline

jagged birch
#

It can only support small bots though

#

Not if u use uptimerobot

#

If u set it up correctly it’s fine

valid haven
#

Maybe

jagged birch
#

Ping the glitch server every 5mins with uptimerobot and it stays up 24/7. My bots been online for a year and I haven’t touched it since

molten edge
#

i used to use glitch but my disk space would get full within a week

valid haven
#

You can patch this

earnest phoenix
#

no free host is decent, dont be a cheapskater and use a free host

grim aspen
#

in my opinion, a vps would be better to host a bot on

earnest phoenix
#

yes

uneven wren
#
The bot stay 5 hours online and become offline```

I can confirm this
#

shouldn't have to ping it to stay up

earnest phoenix
#

free hosting wasnt designed to be connected to a websocket 24/7 and receive thousands of bytes a day, not only that but doing anything that is beyond sending a POST request e.g sending a message will probably crash

uneven wren
#

home hosting is better than free online hosting lel

earnest phoenix
#

yes

#

but one con is that your internet has to be pretty reliable

#

other than that using something like an rpi is much better

uneven wren
#

the comp its hosted on is plugged into the router. its been up for about a week now without going offline

pallid zinc
#

Glitch is glitch

#

My bot online with heroku for 1 month without offline

earnest phoenix
#

if you use free hosting you are more than likely a shitty dev and you bot is more than likely shitty 🤷 change my mind

pallid zinc
#

I am having a qna bot only
But making a new hq bot

#

Sorry to say I am Indian
My English is shit
So I love it

earnest phoenix
#

epicgames has no official fortnite api iirc

#

that are public that is

#

Should I try Fortnite Tracker API?

#

dunno never used any, but you will have to use third party ones

pallid zinc
#

Cry can you suggest me a website where I can host my Python scripts

#

Anyone

earnest phoenix
#

DigitalOcean, Scaleway, AWS, Google cloud

pallid zinc
#

Thanks

dusky steeple
#

Could someone help me out. I am playing around with eris and trying to make a bug report command that will send message from other servers to mine in a certain channel. IDK what I am doing wrong here

const bugchannel = client.channels.get('541729879864115200');
        bugchannel.createMessage({```
#

i get an error saying get is undefined

stiff halo
#

what is the most ezest language for programming ?

#

a bot

ruby dust
#

python is a scripting language, but javascript feels more like a real language

#

they are both easiest

stiff halo
#

ok

queen violet
#

"real language"

several people are typing

stiff halo
#

are there any bot for fixing english grammar ?

ruby dust
#

I'd say no, but on the other hand that makes me think why aren't there bots for that

#

or there might be one already made

amber fractal
#

Like grammarly

#

For discord

#

Finna make grammarly.js

junior summit
#

lol

#

u understand that gramary took like years to make and then also u need to think how to embed the algorithm into discord lol

amber fractal
#

Clearly it doesn't work mmLol

junior summit
#

lol

#

of course

amber fractal
#

In d.js is there any way to go from ShardingManager to Shard so I can use the reconnect, disconnect and death events?

#

Or will I have to spawn shards differently

next wedge
#

hey

#
async def poll(self, *, polldata: str): # !poll  ASD
        
  
        options = {"🇦": "Yes", 
                   "🇧": "No",
                   "🇨": "I don't know.'"} 

        vote = discord.Embed(title="Poll", description="{}".format(polldata), color=discord.Colour.gold()) 
        value = "\n".join("- {} {}".format(*item) for item in options.items())
        vote.add_field(name="Vote now!", value=value, inline=True) 
        vote.set_footer(text="Time to vote: 10 Minutes left.") 

        message_1 = await client.say(embed=vote) # Send the vote embed in the channel. Use await self.bot.get_guild(snowflake).get_channel(snowflake).send(embed=vote)
                                              
            await client.add_reaction(emoji=choice, message=message_1)

    
        await asyncio.sleep(1200) 
        message_1 = await client.get_message(message_1.id)

        counts = {react.emoji: react.count for react in message_1.reactions}
        winner = max(options, key=counts.get) 

        await client.send("**%s** has won!" % (options[winner])) ```
#

what's the problem?

#

language python

ruby dust
#

what's the error

#

I see the issue but need to confirm if I'm correct

next wedge
#

this is why i cant fix. Its shows like nothing

#

in error code

earnest phoenix
#

lol

valid mason
#

@cubic

next wedge
ruby dust
#

is it still the same code as above?

next wedge
#

not very much

#

wait i send it

#
async def poll(self, *, polldata): 
        
  
        options = {"🇦": "Yes", 
                   "🇧": "No",
                   "🇨": "I don't know.'"} 

        vote = discord.Embed(title="Poll", description="{}".format(polldata), color=discord.Colour.gold()) 
        value = "\n".join("- {} {}".format(*item) for item in options.items()) 
        vote.add_field(name="Vote now!", value=value, inline=True) 
        vote.set_footer(text="Time to vote: 1 Minutes left.") 

        message_1 = await client.say(embed=vote) 
                                              
            await client.add_reaction(emoji=choice, message=message_1) 

      
        await asyncio.sleep(10) 
        await client.get_message(id=message_1.id, channel=self.message.channel)

        counts = {react.emoji: react.count for react in message_1.reactions} 
        winner = max(options, key=counts.get) # < error there

        await client.send("**%s** has won!" % (options[winner])) ```
ruby dust
#

I can't see any mistakes, plus I don't use discord.py async as it's a very outdated library

next wedge
#

:/

dusky steeple
#

Could someone help me out. I am playing around with eris and trying to make a bug report command that will send message from other servers to mine in a certain channel. IDK what I am doing wrong here

const bugchannel = client.channels.get('541729879864115200');
        bugchannel.createMessage({```
i get an error saying get is undefined
slender thistle
#

await client.send("**%s** has won!" % (options[winner]))

#

Where are you sending

#

Why is your Context instance named self

next wedge
#

to the channel where the command sent

slender thistle
#

Where did you specify that

next wedge
#

its automatic send there if the location not specified.

slender thistle
#

Whatever

#

How does it not work exactly

next wedge
#

After the timer runs out, it need to check te reactions on the message, then count the bigest reaction count,(where the error is happening) then it send the message.

#

btw sry for bad english.

earnest phoenix
#

@dusky steeple your code is very hard to read

slender thistle
#

await client.get_message(id=message_1.id, channel=self.message.channel)

#

You are getting message but not binding it to any variable

next wedge
#

oh

#

okay im try that

dusky steeple
#

this is the code

async run(client, message, args) {
        const bugreport = args.slice().join(" ");
        if (!args[0]) {
            return message.channel.createMessage(':x: Please supply a detailed report');
        }
        const bugchannel = client.channels.get('541729879864115200');
        bugchannel.createMessage({
            embed: {
                color: client.config.options.embedColor,
                author: {
                    text: message.author.tag,
                    icon_url: message.author.avatarURL
                },
                title: 'New Bug Report',
                description: `${bugreport}`,
                timestamp: new Date(),
                footer: {
                    text: message.channel.guild.name,
                    icon_url: message.channel.guild.avatarURL
                }
            }
        });
        message.channel.createMessage(`:white_check_mark: Thank you ${message.author.username}, your bug report has been sent to Red Queen Support Server`);
    }```
next wedge
#

Not working.

junior summit
#

So bascially, I use AWS (Amazon Web Services) and I was on the standard EC2 trial which gives you 1 vcpu and 1 GB of RAM, but I own a music bot and I have tested this on different locations in the west, east, central, etc.. and the east zones work well because the ping is better. However, when more than 3 servers use the music the CPU goes on 100% power, and the song quality is so bad, I would rather just leave. So then I switched to Microsoft Azure. Same thing east is better than central, and west, especially when I do my ping command. I am not sure also if I spam my ping command why it goes to a super high ping. I would like to find the error because I am not sure which area is the best and why my music bot quality is so bad.

amber fractal
#

Yes, streaming voice is resource intensive

junior summit
#

So is there a way to reduce it because otherwise I have to pay, lol.

mossy vine
#

no

#

streaming music eats your resources

#

there is an ez fix tho

#

dont make a music bot

next wedge
junior summit
#

lol rip i already did

quartz kindle
#

it depends on what you use for audio streaming

junior summit
#

Like my language?

quartz kindle
#

you can test different methods such as lavalink

junior summit
#

I use discord.js

#

Thats an L

dusky steeple
#

Tim could to see what I am doing wrong. I posted my code above and what I am trying to do.

hushed berry
#

@junior summit the high ping isnt caused by any issue

#

its caused by your lib obeying discord ratelimits

#

lmao

quartz kindle
#

@dusky steeple does eris even have client.channels? i cant find it in the docs

dusky steeple
#

tbh idk. I am just guessing to get it to work lol

quartz kindle
#

according to the eris docs

#

it should be client.getChannel(id)

dusky steeple
#

I will try that if not I will keep reading

earnest phoenix
#

wew

grim aspen
#

const config = require('./config.json'); is coming up with an unexpect token

#

i mean it doesn't like the / in ('./config.json');

#

i wonder how to fix it

thick bay
#

@grim aspen try const config = require("./config.json");

grim aspen
#

k

#

same error

slender thistle
#

Dk what you expected from changing apostrophes to quotes

thick bay
#

lol

slender thistle
#

The error is probably elsewhere

thick bay
#

idk i dont talk here much and bored rn

#

¯_(ツ)_/¯

quartz kindle
#

any other info like, unexpected token X in line Z or something

dusky steeple
#

That's happened to me a few times and it ended up being a either to many ; or not enough

#

someplace in the code

grim aspen
#

it says it's in JSON at position 4

slender thistle
#

Seems to be a problem with the JSON file itself

grim aspen
amber fractal
#

can you send your json without the sensitive stuff

#

keep the "'s tho

grim aspen
#

you mean this? const config = require("./config.json");

amber fractal
#

no

#

config.json

#

it's a problem with the json

#

not the require

#

or well send position 4 and around it mmLol

grim aspen
#

figured it out

amber fractal
#

ALright

grim aspen
#

it was an extra line in the file

#

apparently it doesn't like blank lines in the file

amber fractal
#

Json do be like that

earnest phoenix
#

json sounds like a punk

quartz kindle
#

sounds like jason from friday 13th

surreal marsh
#

How would you get info from a messageBulkDelete event, like the channel where the bulk delete occurred?

quartz kindle
#

in discord.js it returns a collection of messages deleted

#

so you could get the channel from those messages

surreal marsh
#

mk, I'll try that. thanks 👌

junior summit
#

How do i embed files using imgur lol i tried to look it up but it wont work

earnest phoenix
#

Like upload files to imgur or fetch and put in embed

split hazel
#

They have an api

#

You could fetch a random image link from their api gateway and throw it into your setImage

full tulip
#

Can anyone help me with a customizable autorole command?

#

For example, >autorole set {role}

amber fractal
#

And what would it do

full tulip
#

Because, right now, all I have is name-specific autorole

amber fractal
#

like give on join?

full tulip
#

That's what autorole does

amber fractal
#

I've never heard it called autorole, but meh.

#

Anyways

empty owl
#

autorole???

full tulip
#

What've you heard it called?

amber fractal
#

you'll need a per guild config for this, you have that right?

#

Join role

empty owl
#

if give on join

#

use an event

amber fractal
#

It seems that he wants to set it tho

#

per guild

empty owl
#

oh

amber fractal
#

I mean

#

it'll use the event

full tulip
#

Yes, it's a give on join, but I was using it in the general "autorole" command.

#

For like admins + to set

#

And @amber fractal I don't have a per guild setup yet

#

It's just specific to a role right now

amber fractal
#

You'd have to do that first unless you only want it to work for 1 server

empty owl
#

well check if its enabled using a guild "database" then check for the role, then add the role by name

full tulip
#
client.on('guildMemberAdd', async member => {
  var role = member.guild.roles.find(r=>r.name == "user");
  await member.addRole(role);

});```
empty owl
#

bro r u not using modules

full tulip
#

No

#

I host and code on Glitch

empty owl
#

OH

#

no wonder

amber fractal
#

I dont export my events either

full tulip
#

because am a cheep man

empty owl
#

well what db do u do then

bright spear
#

tarpergon who doesnt call it autorole

empty owl
#

dude u can use modules on glitch

amber fractal
#

I've only heard it called join role

bright spear
#

yes

#

you can use any code on glitch

full tulip
#

I know

empty owl
#

aye

#

so

full tulip
#

But I am relatively new to developing bots and I have no clue how to

empty owl
#

what db do u use

#

source code on youtube

full tulip
#

?

empty owl
#

what db do u use

full tulip
#

what do you mean?

#

like server.js?

empty owl
#

database

#

no DATABASe

full tulip
#

yes I can see what you're saying

empty owl
#

ok

full tulip
#

but what do you mean by it

#

please define

empty owl
#

like which database do u use or do u not have one

full tulip
#

i don't believe i use one

#

it's all hosted and coded on glitch

empty owl
#

well then u cant do per guild in an easy way

#

idk how to do autorole w/o databases

#

with a database u store a role, if the role exists, and it is enabled, it does it

#

I can make it with my database idk which one u like

full tulip
#

wdym?

#

by the last sentence

empty owl
#

like I can make it using my database

#

but u dont have one

#

sooooooo

full tulip
#

o

earnest phoenix
#

anyone here good with OpenGraph tags

#

cause i cant get this site to work properly with them

#

can i post it here

amber fractal
#

then you have optional ones

earnest phoenix
#

yeah but it doesnt seem to be working

#

cache?

amber fractal
#

Did you set a title/desc

earnest phoenix
#

i did title

inner jewel
#

what's the html?

earnest phoenix
#

nvm

#

think its discord cache

earnest phoenix
#

yeah you have to wait until discord recrawls

earnest phoenix
#

wtf

#

why have i never known about this

#

pretty neat

crystal spear
#

What if I want to use another donate system(ex. Qiwi). Can I put a donate url in the long description of bot?

#

Args- array

#

I think you need args[0]

lament kettle
#

show what your args is. user object? user id string? array?

bright spear
#

@crystal spear you can put anything in the long description but you can only change the link of the actual donate button if the bot is certified

fiery quest
#

anyone know how to format a date as: "Today at hours:seconds"? with datetime or time

ruby dust
#

embed object has a timestamp property that accepts datetime object

earnest phoenix
#

um

#

anyone know how to make bot show how much server it is in dbl?

late hill
#

Post your server count

hushed zodiac
#

Who can help me with the guildmemberjoinevent? If so please pin me in the message or write to me privately

stiff halo
#

how to active a bot when it is offline ?

merry ore
#

idk

#

bot.run("<insert token here>") for python

#

:smart:

#

@stiff halo

stiff halo
#

hm ?

#

oh

slender thistle
#

Run a bot inside a bot while that one runs another one

white sky
#

hi

#

Help set up a webhost
for votes
Give a link to the instructions.

loud grove
#

Actually you can find everything there

amber fractal
#

Why would posing server count with http return forbidden, the dbl token is for sure correct.

loud grove
#
const { dblToken } = "token"
const DBL = require("dblapi.js");
const dbl = new DBL(dblToken, client);
dbl.postStats(client.guilds.size);
sinful lotus
amber fractal
#

Thats not http

languid dragon
#

that's

loud grove
#

Use this

languid dragon
#

already wrong

loud grove
#

Js

amber fractal
#

Im not using the lib

sinful lotus
#

thats very wrong

loud grove
#

Nah

#

Correct

languid dragon
#

you're trying to fetch dblToken from a string

loud grove
#

Use it on eval

#

Thats my real code :

languid dragon
#

]]ev const { dblToken } = "token"

covert turtleBOT
#
undefined
sinful lotus
#

const { token } = "token" doesnt make any sense

languid dragon
#

]]ev const { dblToken } = "token"

dblToken

loud grove
#
const { dblToken } = require("../../tokens.json");
const DBL = require("dblapi.js");
const dbl = new DBL(dblToken, client);
dbl.postStats(client.guilds.size);
covert turtleBOT
#
undefined
loud grove
#

Just refered to it as "token"

sinful lotus
#

but not everyone does that

#

and it can be confusing when you put it like that

loud grove
#

That's the easy way

#

Lol

sinful lotus
#

the simplest is
const config = require('stuff.json')
config.token

neat falcon
#

semicolon

#

use it

#

also you need ./ iirc

amber fractal
#

The easiest way is providing a client when you make an instance of dblapi

sinful lotus
#

something like const { token } is not really something the beginner instantly knows

loud grove
#

Who uses semicolons

neat falcon
#

me

loud grove
#

Bruh

earnest phoenix
#

how to make how much server my bot is in dbl 😅

loud grove
#

That's what we were talking about

neat falcon
languid dragon
loud grove
#

Here is an easy code :

amber fractal
#

You give me something im not asking for

earnest phoenix
#

Ok thx

loud grove
#
const DBL = require("dblapi.js");
const dbl = new DBL('tokenhere', client);
dbl.postStats(client.guilds.size);
earnest phoenix
#

i use python

loud grove
#

Run this on eval

earnest phoenix
#

😅

loud grove
#

Python

#

OOF

earnest phoenix
#

i use js for music

sinful lotus
#

what if they dont have dblapi.js

earnest phoenix
#

Idk

#

i use both

#

😅

sinful lotus
#

what will they do ?

loud grove
#

Install it GWpaboaWeSmart

sinful lotus
#

make your own

amber fractal
#

If I was going to use the lib, I'd have asked for how to do it with the lib, which is pointless because its as easy as passing your client Thonk

sinful lotus
#

for me I would just write it my own

loud grove
#

Bruh

#

Why would you GWloopyBlobShrug

languid dragon
#

man it doesn't matter

#

each to their own

#

if this isn't dev chat and more of just an argument

sinful lotus
#

for me I just want it that way

languid dragon
#

end it here

#

srsly

loud grove
#

Lol

amber fractal
#

Could I still get an answer tho

#

to the question I asked

#

I get unauthorizaed

#

but forbidden

#

not so sure

languid dragon
#

Are you manually requesting from the API or are you using the library

sinful lotus
#

you are posting your own stats

#

?

amber fractal
#

Yes, which is weird, as it works when I call my command to post stats

#

it's using nodes https

languid dragon
#

can you show the code you used

amber fractal
#

Sure give me a sec, in the middle of changing classes lol

sinful lotus
#

do you put auth properly?

ripe crown
#

Wanna know how to get much guilds?

#

Do DBL.postStats("9999999");

#

There

loud grove
sinful lotus
#
const guilds = await this.client.getValues.getAllGuildCount()
try {
    await this.client.fetch(`https://discordbots.org/api/bots/${this.client.user.id}/stats`, {
        method: 'POST',
        body: JSON.stringify({ 'server_count': guilds, 'shard_count': this.client.shard.count }),
        headers: { 'Content-Type': 'application/json', 'Authorization': qttoken }
    })
    counter++
} catch (error) {
    this.client.cannons.fire(this.client, error)
}

@amber fractal is your headers the same like this?

loud grove
#

I was cheating once
I was adding 10 servers GWcorbinTopKek

amber fractal
sinful lotus
#

try to regen your token maybe thats the problem

amber fractal
#

If the token was wrong I'd get unauthorized, wouldnt I?

#

Maybe I'm passing something wrong

sinful lotus
#

yes

amber fractal
#

Unless that's not correct

#

that's the postData

#

403 is forbidden right?

#

Ye

#

Weird

#

I'll figure it out later

languid dragon
#
const fetch = require('node-fetch');
const dblAPIToken = "";

const sendStats = async () => {
    try {
        const response = await fetch(`http://discordbots.org/api/bots/${client.id}/stats`, 
        { 
            method: "POST", 
            body: JSON.stringify({server_count: 420}), 
            headers: {'Content-Type': 'application/json', 'Authorization': dblAPIToken } 
        });
    } catch(err) {
        // handle error
    }
};

try this

sinful lotus
#

nod fetch is easier to manage in posting server count you can try that if you want @amber fractal

amber fractal
#

I know all that, it's just weird because it works in my standalone command

mossy vine
#

why does part of my css refuse to load?

index.html

<div class="modal" id="modal">
            <h1>New grid</h1>
            <br>
            <div class="modal-content">
                <div>
                    <input type="number" id="gridhorizontal" placeholder="Rows">
                </div>
                <div>
                    <input type="number" id="gridvertical" placeholder="Columns">
                </div>
                <div>
                    <a id="submit" onclick="generate()">Add</a>
                </div>
            </div>
        </div>```

index.css
```css
.modal {
    display: none;
    position: absolute;
    width: 60%;
    height: 40%;
    background-color: rgba(10, 10, 10, 0.9);
    top: 1%;
    left: 20%;
    right: 20%;
    color: white;
    font-family: 'Montserrat', sans-serif
}

.modal-content {
    display: flex;
    justify-content: space-around
}
amber fractal
#

cache

mossy vine
#

i did ctrl f5 and restarted the webserver

#

both multiple times

amber fractal
#

try ctrl shift r

mossy vine
#

chrome inspect element doesnt mention modal-content

#

is this a joke

amber fractal
#

No

mossy vine
#

thanks ig lol

amber fractal
#

Ye

#

ctrl shift r is a cache override

mossy vine
#

this problem happens every time i work on this project and its getting really annoying that i always forget the solution D:

amber fractal
#

Imma be honest tho

#

idk if its a good practice

#

LOL

#

no wonder it's forbidden

#

good job me

#

Maybe I should've logged the options earlier

#

lmao

#

What do ya know, it worked

ruby dust
#

does the discord.py client not have text channels array? I have to manually get them from every server?

formal agate
#

When using discord.js I’m trying to detect when the bot stops speaking/playing a song.
This is the code I’m using rn:

data.dispatcher.on('end', function(){
        console.log("Song ended!!!!!");
        end(client, ops, this);
    });```
According to the js docs (here https://discord.js.org/#/docs/main/stable/class/StreamDispatcher?scrollTo=e-end) the event “end” occurs when the bot ends the connection with the vc. So I would thus have to use the event “speaking”.  So my question is, is there a semi simple way to detect only when the bot has stoped speaking?
slender thistle
#

@ruby dust Correct

#

gay dpy doesn't have that

amber fractal
#

so it logs h as undefined then logs body as what it should be

amber fractal
#

Ping me if you have a response, still havent figured it out mmLol

earnest phoenix
#

implementing unit testing after the fact is annoying

amber fractal
#

wym

earnest phoenix
#

i feel like if i program with testability in mind my code would be much better

amber fractal
#

it's just weird in my demo, it works

earnest phoenix
#

cert application here i come

amber fractal
#

nah

#

109 votes

#

you need 120

earnest phoenix
#

111

amber fractal
earnest phoenix
#

and should be at 120 by like 1.30 or 2 i imagine

#

server caching

amber fractal
#

well it's 1:50 for me so mmLol

earnest phoenix
#

1250 here

amber fractal
#

central america or?

earnest phoenix
#

yep

amber fractal
#

Still trying to fix this

#

I'm so confused at why it doesnt work

earnest phoenix
#

show me

amber fractal
#

It was my issue from 3 hours ago

earnest phoenix
#

idk what that was

amber fractal
#

it's just above

#

literally no one posted in here

earnest phoenix
#

and your using d.js?

amber fractal
#

Yes, but it has nothing to do with my lib

#

it's a class and a return

earnest phoenix
#

so .getuser is from your class?

amber fractal
#

Yes

#

what I posted

earnest phoenix
#

what does get users internals look like

amber fractal
earnest phoenix
#

thats all of get user?

amber fractal
#

it's an htt call

#

http*

#
      headers: {
        Authorization: this.token
      },
      url: `https://discordbots.org/api/users/${id}`
    }
    request(opts, (err, resp, body) => {
      if(err) return console.error(err)
      if(resp.statusCode == 401) throw new Error("Unauthorized, invalid DBL token.")
      if(resp.statusCode == 200){
        console.log(body)
        return new Promise((resolve, reject) => {
          resolve(body)
        })
      }else{
        return console.error("User not found.")
      }
    })```
#

I was bored

earnest phoenix
#

one sec

#

lemme open code

inner jewel
#

you return it from the callback to request

#

it won't return from the function calling request

amber fractal
#

The face of severe depression

#

thanks

earnest phoenix
#

relatable

strange compass
#

OoF

#

why there is no PHP bot for discord

#

||\😐||

dusky marsh
#

?

#

There is a PHP lib

earnest phoenix
#

Can anyone help me with the web hook that shows those that voted for the bot?

fiery quest
#

anyone know if it is possible to make servers counter presence dynamic without restarting the bot every time to get servers counter updated? sorry for the syntax, is bad i know EDIT: in python 3

inner jewel
#

update it on an interval

slender thistle
#

while client not closed:
do stuff
await asyncio sleep etc

fiery quest
#

thanks!

amber fractal
#

Alright

#

I was bored so I wanted to make my own lib thing or something mmLol

#

It's too big gimme a sec

west raptor
#

lol

amber fractal
#

And hastebin refuses to work

west raptor
#

lol

amber fractal
#

That took way too long

#

wait

#

are you serious

#

it doesnt encode quotes mmLol

west raptor
#

lol

#

ass

#

use pastebin then

amber fractal
#

Possible Spam Detected

#

Lol

west raptor
#

i saw

amber fractal
#

It should actually be up now tho

#

but that should emit ready shouldnt it?

#

Can I not emit in the constructor?

#

I didnt think of that

#

Nah still didnt work

#

Well if you got any ideas, ping me please

solemn shale
#

Hey uh actual idiot here how do you make a prefix for a bot?

fiery birch
#

prefix = "!"

amber fractal
#

A little js mixed with more js

fiery birch
#

set it as a variable

#

thats all

amber fractal
#

Assuming you're using js anyways

solemn shale
#

Yep

amber fractal
empty owl
#

hey!

#

how do I check if a users in a guild

#

without double logining

#

@amber fractal

amber fractal
#

if I had nitro I'd angryboye you rn

#

You dont need to ping me

empty owl
#

ok

amber fractal
#

Why would you need to login

#

again

empty owl
#

no like

#

because I cant access my bot

amber fractal
#

why

empty owl
#

without double logining;

#

my webhook is in server.js

#

and my bot is in index.js

amber fractal
#

You can make the https request yourself

empty owl
#

how

amber fractal
#

or use the thing I sent earlier mmLol

empty owl
#

idk

#

how do u do that

amber fractal
#

I sent you exactly how I learned it

sinful lotus
#

pass the client on server.js

#

or just dont do it

#

¯_(ツ)_/¯

amber fractal
#

Hey u

#

I got questions for u

#

and my other thing I did

#

would you happen to know why it wouldnt?

sinful lotus
#

what did you do?

amber fractal
#

it does say that it's listening

#

wym

#

it doesnt even run at all

#

which was the problem

sinful lotus
#

did you init properly?

amber fractal
#

Yes, it did log the address and path

#

all as I expected it to

#

but when test the webhook

#

it doesnt work

#

So I have big confusion

#

also for some reason I cant emit anything even tho the class extends EventEmitter idk what it's problem is

#
    console.log("vote")
    if(req.headers.authorization !== this.auth){
      res.status(401).send("Unauthorized")
    }else{
      res.status(200)
      let vote = JSON.parse(req.body)
      this.emit('vote', vote)
    }
  }``` This is the onVote part
#

and it isnt logging vote, so it isnt actually receiving anything

#

I was actually refrencing yours when making this part after it didnt work the first time

#

It is a tiny bit different from what the dbl one says tho

#

it says *:5000

earnest phoenix
#

Wats are good bots that are like mee6 with a programing page

amber fractal
#

mee6
good

#

what do you mean programming page tho

earnest phoenix
#

Like the website

#

Mee6.xyz

#

Its website

amber fractal
#

I know the mee6 website

earnest phoenix
#

Yeah

amber fractal
#

But what is the programming page

earnest phoenix
#

Is der bot that u use a websitr like dat

#

U know thr plugins

amber fractal
#

You mean with a dashboard?

earnest phoenix
#

Yeah

amber fractal
#

Plenty do

#

Dyno does

#

thats the only one I know off the top of my head

earnest phoenix
#

K thx

amber fractal
#

@sinful lotus Does mine even really differ from yours?

sinful lotus
#

if the vote console.log isnt reached there could be a problem on how it listens

amber fractal
#

I wonder if I can manually call it

sinful lotus
#

just use onVote() on init

amber fractal
#

Wym

#

just call it to see if it works?

sinful lotus
#

yes provide a test data

#

if it works there then its on how it listens

amber fractal
#

Worked

#

but idk how else to set it up to listen

#

Well I got it to work, but when it tries to parse the body it fails

#

Wait holy shit

#

it's all working

#

And it emits vote

#

but not ready

#

odd

earnest phoenix
#

hey i have if (!message.channel.music) return message.reply(" You must be in a `music` channel to use this command."); in my code and even when im in the music channel , this still return.. any idea why?

amber fractal
#

What is a music channel Thonk

#

message.channel.music isnt a thing

earnest phoenix
#

how can i define the music channel?

#

because for my nsfw command i didnt have to define nsfw :/

amber fractal
#

Thats because its a setting in discord

languid dragon
#

um

#

because music isn't a type of channel

#

that's user-based

amber fractal
#

Theres no such thing as a music channel option

earnest phoenix
#

im not sure how to define it

elfin vale
#

do you mean voice channel?

earnest phoenix
subtle thorn
#

I already made a bot named "Xbox" but when i want to invite it the page says UNKNOWN ERROR please fix this

earnest phoenix
#

ok

sharp maple
#

@ivory kelp Google is your best friend

#

What do you mean by that

#

Oh

#

Ok

slender thistle
#

Postman has arrived. There was an error connecting to {} where {} is a link to a DBL endpoint. How come? thonk_think

#

Headers with auth and content-type specified and params are good

#

Oh, really

#

A new line kept fucking it up

vapid rune
#

maybe you need a new linter

fringe bloom
#

What would be the most convenient way to store data of the bot? E.g. which prefix a server uses for the bot etc?

#

A json file sounds horrendous 😅

slender thistle
#

Database thonk_think

ruby dust
#

a database file will always be the best way to store data, prove me wrong

#

for beginners I recommend learning sqlite

slender thistle
#

mongo

fringe bloom
#

Lol didn’t even think of using a database

#

I’ll check out SQLite and MongoDB, thanks guys :3

subtle thorn
#

@le0

earnest phoenix
#

White name

sharp maple
#

Is someone making bots with python?

ruby dust
#

around half of bots are written in python

hollow knot
#

i have a question and that's that whenever i try and use my bots report command no errors show up in the console so I'm confused here's the code.

coral trellis
#

You're not sending it anywhere and you have a return statement at the end of it all

hollow knot
#

ahhh thanks i fixed it now 👍

opaque eagle
#

Lmao I smell TSC tutorials

strange compass
#

why one of the bots can't find the server owner ? it's works in other servers but not here

earnest phoenix
#

not cached

#

force download all users

sinful lotus
#

gotta cache it yourself

ruby dust
#

or instead of all users, how about just cache the server owner

sinful lotus
#

discord.js as well

#

you just need to fetch it

primal socket
#

is there some way of merging images into a new one and then send that image?

crimson gull
#

@primal socket JIMP if you're using node.js

primal socket
#

okay, thank you for the help, i'm gonna check if that works

tired root
#

Can someone help me? I can not host my music bot on heroku ;-;

marble elm
#

Don’t use heroku

tired root
#

Can you recommend another platform?

earnest phoenix
#

DigitalOcean, Scaleway, AWS, Google Cloud

tired root
#

thank you :^

neat falcon
#

There's a list in the pins here

earnest phoenix
#
        return message.channel.send(`Please go to the Music channel to use this command.`);
    }```   Command still runs even when not in the specific channel.
unique nimbus
#

It's == not ===

#

@earnest phoenix

earnest phoenix
#

o oops

inner jewel
#

no

#

=== is correct

#

but you should learn about operator precedence

#

! has higher precedence than ===

#

so it's executed first

unique nimbus
#

o

inner jewel
#

what you have is the same as if((!(message.channel.id)) === ('...'))

#

so you're basically doing if(false === '...')

earnest phoenix
#

yea i changed to !==

#

is there a way to add delay to a command? just curious

#

like a time limit on when everyone can use it again*

amber fractal
#

Like a cooldown on a command?

earnest phoenix
#

yea

#

exactly

amber fractal
#

Yes, it's possible

earnest phoenix
#

cuz my bot doesnt add music to a queue , so when ever someone runs the command again it cuts off the current song and its so toxic

mossy vine
#

Or you could implement a queue feature

earnest phoenix
#

i tried

#

but it just doesnt work idk why

mossy vine
#

Because ur code was bad

earnest phoenix
#

i based it on a plexi tutorial so its probably out dated

agile orchid
#
        if (args.options === 'nsfw') {
        if (message.channel.nsfw === true) {
            request.get('https://nekos.life/api/v2/img/nsfw_neko_gif').then(body => {
                let embed = new Discord.RichEmbed()
                    .setImage(JSON.parse(body.text).url)
                    .setFooter(`Requested by ${message.author.username} | 💛 API : ${Date.now() - message.createdTimestamp} ms`)
                    .setColor(config.color.second);
                message.channel.send({
                    embed: embed
                });
            });
        } else {
            let embed = new Discord.RichEmbed()
                .setDescription(`\`â›”\` **${message.author.username} :** \`#${message.channel.name}\` must have \`NSFW\` enabled.`)```
#

i can use my command in non nsfw channels

#

and idk why

#

can someone help me?

marble needle
#

if(!message.channel.nsfw) return; :>

agile orchid
#

okay

#

i'll try

#

brb

mossy vine
#

Iirc nekos.life endpoints shouldnt be used

marble needle
#

they return loli

mossy vine
#

As they can return illegal images

#

Yes

unique nimbus
#

Yes

agile orchid
#

still can use it in non-nsfw channels

elfin vale
#

Here, I think this will work, but I didnt test it.

    if (!message.channel.nsfw) {
        let embed = new Discord.RichEmbed()
        .setDescription(`\`â›”\` **${message.author.username} :** \`#${message.channel.name}\` must have \`NSFW\` enabled.`)
    } else {
        request.get('https://nekos.life/api/v2/img/nsfw_neko_gif').then(body => {
            let embed = new Discord.RichEmbed()
                .setImage(JSON.parse(body.text).url)
                .setFooter(`Requested by ${message.author.username} | 💛 API : ${Date.now() - message.createdTimestamp} ms`)
                .setColor("#ffffff");
            message.channel.send({
                embed: embed
            });
        });
    }
agile orchid
#

ok

marble needle
#

if (message.channel.nsfw === true) { why bother doing that, message.channel.nsfw is a bool itself

elfin vale
#

Yes, just so you can learn/know, if (!message.channel.nsfw) { is checking if the channel the message is sent in is not NSFW, ! in Javascript basically means: "is not" so the code means "if channel is not NSFW then".

agile orchid
#

shit

#

i forgot some part of the code

#
class NekoCommand extends Command {
	constructor() {
		super('neko', {
            aliases: ['neko'],
            channelRestriction: 'guild',
            args: [{
                id: 'options',
                type: ['nsfw']
            }]
		});
	}

    exec(message, args) {
        if (!args.options) {
            request.get('https://nekos.life/api/v2/img/neko').then(body => {
                let embed = new Discord.RichEmbed()
                    .setImage(JSON.parse(body.text).url)
                    .setFooter(`Requested by ${message.author.username} | 💛 API : ${Date.now() - message.createdTimestamp} ms`)
                    .setColor(config.color.second);
                message.channel.send({
                    embed: embed
                });
            });
        }
        if (args.options === 'nsfw') {
        if (message.channel.nsfw === true) {
            request.get('https://nekos.life/api/v2/img/nsfw_neko_gif').then(body => {
                let embed = new Discord.RichEmbed()
                    .setImage(JSON.parse(body.text).url)
                    .setFooter(`Requested by ${message.author.username} | 💛 API : ${Date.now() - message.createdTimestamp} ms`)
                    .setColor(config.color.second);
                message.channel.send({
                    embed: embed
                });
            });
        } else {
            let embed = new Discord.RichEmbed()
                .setDescription(`\`â›”\` **${message.author.username} :** \`#${message.channel.name}\` must have \`NSFW\` enabled.`)
                .setFooter(`Requested by ${message.author.username} | 💛 API : ${Date.now() - message.createdTimestamp} ms`)
                .setColor(config.color.err);
            message.channel.send({
                embed: embed
            });
        }
        }
    }
}```
earnest phoenix
#

https://hastebin.com/usavecutuj.js can someone tell me why when i run the command again , the song doesnt add to the queue it just turns off the current song and plays the one that was previously added.

elfin vale
#

hm. was there a problem with the code i gave you? eyotsh

agile orchid
#

no errors

elfin vale
#

Cause like i said that's how i do it and it seems to work but idk if it works always

agile orchid
#

but still workin' in non nsfw

#

but i forgot 1 part of the code

#

look at the beginning

#

wowowow

#

another thing i forgot wait

elfin vale
#

oooh lol

#

ok, it is working cause you didn't add a check at the beginning

agile orchid
#

now

elfin vale
#

So at the beginning add an nsfw check to (!args.options), like if (!message.channel.nsfw) or similar, like you did in the nsfw args section. Then it should work.

agile orchid
#

ok

#

uhh

#

sorry for asking, but how xD

#

i never used checks before

#

only for role permissions

elfin vale
#

you did use a check though.. if (message.channel.nsfw === true) { is a check :P

#

Ok hold on

agile orchid
#

ok

elfin vale
#
    if (!args.options) {
        if(!message.channel.nsfw) {
            //Error: Failed NSFW check, command wasnt run in NSFW channel!
        } else {
            //Command passed NSFW check, was ran in NSFW channel, so execute the command here.
        }
    }

It should look something like this ^^^

agile orchid
#

ok

#

i'll try brb

earnest phoenix
#

https://hastebin.com/usavecutuj.js can someone tell me why when i run the command again , the song doesnt add to the queue it just turns off the current song and plays the one that was previously added.

agile orchid
#

omg

#

it works

#

tysm

#

elfin vale
#

i am not sure what you mean, so the song doesn't add anything to the queue it just skips to the next one when someone adds a new one?

#

and you are welcome!

inner jewel
#

playStream(bot, bot, fetched);

late hill
#

Any java bot devs here 👀

#

Is Discord4J good

#

Would you recommend something else?

empty owl
late hill
#

For Java

#

😂

empty owl
#

idk java

#

also <a class="button is-link" onclick="href='mybotoauth'">ADD USAGIX TO SERVER</a> doesnt seem to work

late hill
#

oof

elfin vale
#

I think theres only two right? Discord4J and JDA? So just try them both out and see which one is best for you

sterile hedge
#

@empty owl

empty owl
#

no

sterile hedge
#

it should be

#

<a class="button is-link" href="mybotoauth">ADD USAGIX TO SERVER</a>

empty owl
#

oh ok

amber fractal
#

Doesnt even log undefined

sterile hedge
#

Im guessing that mybotoauth is the link

empty owl
#

eya

#

¯_(ツ)_/¯

sterile hedge
#

nooo

empty owl
#

oh shoot

sterile hedge
#

you mixed up the class and href

empty owl
#

wait

#

thx

sterile hedge
#

class = "button is-link" href="ilink"

#

add the "

empty owl
#

ko

#

which css is the vote boxes

sterile hedge
#

look for it in dev tools

empty owl
#

ok

amber fractal
sterile hedge
#

most likely a missing , or }

amber fractal
#

Wait no, im an idiot

#

This never happened

inner jewel
#

that's not valid json

#

all keys must be inside quotes in json

amber fractal
#

I was parsing when I meant to stringify

#

EIther way, I didnt need it anyways

#

I don't know why my webhook refuses to send this embed

empty owl
#

what is a promise pending

amber fractal
#

A pending promise

empty owl
#

????

#

i kinda get it

#

but like

amber fractal
empty owl
#

thx

amber fractal
#

It shouldnt be empty

#

reason*

empty owl
#

im horrible at webhooks

inner jewel
#

{embed: X} -> {embeds: [X]}

amber fractal
#

When did they change it?

inner jewel
#

never

#

webhooks were always an embed array

amber fractal
#

I send my other ones with just a variable tho

inner jewel
#

for channels it's a single embed

#

for webhooks it's an array

amber fractal
inner jewel
#

then it wraps in an array internally

amber fractal
#

Makes sense

#

thanks

next wedge
#

hey whats the problem?
javascript language.
```if(cmd === ${prefix}poll) {
let szavazás = args.join(" ").slice(22);
if (!szavazás) return message.channel.send("Give a title!"); //this is not working

let szavazásEmbed = new Discord.RichEmbed()
.addField(`${szavazás}`);

message.channel.send(szavazásEmbed);

}```

amber fractal
#

why slice 22

next wedge
#

oof

#

misstype :D

amber fractal
#

also @inner jewel would it become {embeds: [embed: {//embed stuff}]}? or just {embeds: [//embed stuff]}

inner jewel
#

do you know how arrays works

amber fractal
#

Yes.

#

And now it's an empty message

#

but progress I guess

sterile hedge
#

Don't u need something before the []

amber fractal
#

I didn't send that

#

I was just wondering of the syntax

#

Because it sent an empty message

#

Got it to work

bleak dawn
#

Help - our bot just crashed with UnhandledPromiseRejectionWarning: Error: This session would have handled too many guilds - Sharding is required. and when trying to restart we get the same issue... we are installed in about 2,500 servers...

inner jewel
#

read the error

#

you need to shard your bot