#development

1 messages · Page 452 of 1

unreal plover
#
const Discord = require(“discord.js”)
const bot = new Discord.Client();

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`)
});

client.on('message', msg => {
  if (msg.content === 'hi') {
    msg.reply('Hello!')
  }
});

client.login('sercret')```
tardy viper
#

can you help me plz ?

quiet bobcat
#

idk, is there @unreal plover

earnest phoenix
#

Some errors

tardy viper
#

Y have a probleme with my canvas

#
    at Client.bot.on (/home/nanobotpro/index.js:49:27)
    at emitOne (events.js:116:13)
    at Client.emit (events.js:211:7)
    at Guild._addMember (/home/nanobotpro/node_modules/discord.js/src/structures/Guild.js:1142:19)
    at GuildMemberAddHandler.handle (/home/nanobotpro/node_modules/discord.js/src/client/websocket/packets/handlers/GuildMemberAdd.js:12:13)
    at WebSocketPacketManager.handle (/home/nanobotpro/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (/home/nanobotpro/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (/home/nanobotpro/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
    at WebSocket.onMessage (/home/nanobotpro/node_modules/ws/lib/event-target.js:120:16)
    at emitOne (events.js:116:13)
    at WebSocket.emit (events.js:211:7)
    at Receiver._receiver.onmessage (/home/nanobotpro/node_modules/ws/lib/websocket.js:137:47)
    at Receiver.dataMessage (/home/nanobotpro/node_modules/ws/lib/receiver.js:409:14)
    at Receiver.getData (/home/nanobotpro/node_modules/ws/lib/receiver.js:347:12)
    at Receiver.startLoop (/home/nanobotpro/node_modules/ws/lib/receiver.js:143:16)
    at Receiver.add (/home/nanobotpro/node_modules/ws/lib/receiver.js:117:10)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at TLSSocket.Readable.push (_stream_readable.js:208:10)
    at TLSWrap.onread (net.js:607:20)```
earnest phoenix
#

Litterally you did a lot wrong there

#

@unreal plover

steel heath
#

@tardy viper install canvas@next, that function only exist in next version afaik

tardy viper
#

how to installe the next version

steel heath
#

npm i canvas@next
or
yarn add canvas@next

tardy viper
#

ok

earnest phoenix
#
  1. Missing “();” at new Discord.Client
  2. Missing ; at line 6.
  3. At line 12, youre missing ; at “})”.
#

@unreal plover

unreal plover
#

I dont understand

tardy viper
#

@steel heath no

#

error

#

(node:19364) UnhandledPromiseRejectionWarning: ReferenceError: applyText is not defined
at Client.bot.on (/home/nanobotpro/index.js:64:5)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:19364) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:19364) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

unreal plover
#

Guys help

#

i ned help

neon schooner
#

They just told you what you're missing.

unreal plover
#

Need*

#

I dont understand tho

quiet bobcat
#

what do you not understand?

earnest phoenix
#

Deal with it urself, i aint spoonfeedin spoonfeed

steel heath
#

I don't think applyText is a thing

tardy viper
#

?

neon schooner
#

You might need to learn up about how to write in js before trying to write a bot in js.

tardy viper
#

i wrote ?

young mortar
#

When will I get an answer on my bot?

neon schooner
#

I'm talking to RantHomeZ

young mortar
#

😦

neon schooner
#

Not Lewan.

quiet bobcat
#

wdym answer?

#

like if it was approved or declined?

neon schooner
#

@young mortar did you resubmit with a readable description?

#

Using spaces and proper formatting?

unreal plover
#

Is this what you meant?

#
const Discord = require(“discord.js”)
const bot = new Discord.Client();

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`)
});

client.on('message', msg => {
  if (msg.content === 'hi') {
    msg.reply('Hello!')
  }
});

client.login('sercret')```
neon schooner
#

If not, when it gets back to the top of the list it could get declined again.

young mortar
#

yes

tardy viper
#

@steel heath Can you help me I do not know what to put in place of applyText

steel heath
#

You should stop mentioning me lol

earnest phoenix
#

@unreal plover Correkt

steel heath
#

Check the docs it was something like fillText()

tardy viper
#

ok i test it

neon schooner
#

@young mortar no you haven't, please fix it.

steel heath
#

I don't remember I just told you these functions do not exist in stable

young mortar
#

😫

unreal plover
#

Can i have code examples?

earnest phoenix
unreal plover
#

Later

#

i just need examples

earnest phoenix
#

facepalm Your examples are avalible there

unreal plover
#

??????

#

ok i get it

neon schooner
#

OK, so you'll need to actually go look at the guide and stuff.

unreal plover
#

This can take a while

#

An internet troll needs time to make a bot

neon schooner
#

Good luck

tardy viper
#

Can you help me for canvas to error ?

#

applyText is not defined

#

the line was

young mortar
#

😦

tardy viper
#

``` ctx.font = applyText(canvas, ${member.displayName}!);
ctx.fillStyle = '#ffffff';
ctx.fillText(${member.displayName}!, canvas.width / 2.5, canvas.height / 1.8);

quartz kindle
#

what are you trying to do?

#

where does applyText come from?

neon schooner
#

node-canvas

tardy viper
#

so can you help me ?

quartz kindle
#

is applyText a function you made?

neon schooner
#

I don't see an addText for canvas here though

#

So I'm wondering why you're using that

tardy viper
#

the code of my code is at the finally of this page

neon schooner
#

fillText is the closest that I see.

tardy viper
#

no don't work

neon schooner
#

Yea, it mentions that it is buggy right now

#

But there is no addText

#

in the docs here

quartz kindle
#

in the link you posted, there is this

#
const applyText = (canvas, text) => {
    const ctx = canvas.getContext('2d');

    // Declare a base size of the font
    let fontSize = 70;

    do {
        // Assign the font to the context and decrement it so it can be measured again
        ctx.font = `${fontSize -= 10}px sans-serif`;
        // Compare pixel width of the text to the canvas minus the approximate avatar size
    } while (ctx.measureText(text).width > canvas.width - 300);

    // Return the result to use in the actual canvas
    return ctx.font;
};```
#

its a custom function

#

but you dont need it if you're going to use a fixed size font

neon schooner
#

OK, that explains why I'm not finding it 😛

tardy viper
#

@quartz kindle I don understant ?

lament meteor
#

lol

quartz kindle
#

dont copy code if you dont understand

tardy viper
#
 bot.on('guildMemberAdd', async member => {
    const channel = member.guild.channels.find(ch => ch.name === 'join_leave');
    if (!channel) return;

    const canvas = Canvas.createCanvas(700, 250);
    const ctx = canvas.getContext('2d');

    const background = await Canvas.loadImage('/home/nanobotpro/fondnoir.jpg');
    ctx.drawImage(background, 0, 0, canvas.width, canvas.height);

    ctx.strokeStyle = '#74037b';
    ctx.strokeRect(0, 0, canvas.width, canvas.height);

    // Slightly smaller text placed above the member's display name
    ctx.font = '28px sans-serif';
    ctx.fillStyle = '#ffffff';
    ctx.fillText('Bienvenue sur le serveur,', canvas.width / 2.5, canvas.height / 3.5);

    // Add an exclamation point here and below
    ctx.font = applyText(canvas, `${member.displayName}!`);
    ctx.fillStyle = '#ffffff';
    ctx.fillText(`${member.displayName}!`, canvas.width / 2.5, canvas.height / 1.8);

    ctx.beginPath();
    ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
    ctx.closePath();
    ctx.clip();

    const { body: buffer } = await snekfetch.get(member.user.displayAvatarURL);
    const avatar = await Canvas.loadImage(buffer);
    ctx.drawImage(avatar, 25, 25, 200, 200);

    const attachment = new Discord.Attachment(canvas.toBuffer(), 'welcome-image.png');

    channel.send(`Bienvenue sur le serveur, ${member}!`, attachment);
});
neon schooner
#

addText is not a function, you have to make it yourself, you ned to use fillText.

tardy viper
#

my code

quartz kindle
#

sigh..

#

you see this line? ctx.font = applyText(canvas, `${member.displayName}!`);

tardy viper
#

yes

quartz kindle
#

this part applyText(canvas, `${member.displayName}!`);

#

does not exist in your code

#

either make it, or remove it

tardy viper
#

ok i test SO that for wrote on the image the name of the person

#

Oh no sorry

quartz kindle
#

if you want to remove it

#

use something like this instead ctx.font="30px Arial";

tardy viper
#

ok

#

OH thank you bro

bitter sundial
#

I was reminded of making dbl widgets and the fun I had making them

#

not sarcastic

#

it was actually kinda fun

quartz kindle
#

kinda

#

kinda annoying too

bitter sundial
#

some bits

quartz kindle
#

my bot makes heavy use of canvas, and lots of weird math

#

for those circular charts

unreal plover
#

How do we invite the bot to your server

bitter sundial
#

the most frustrating part was when I was trying to load an svg image and use it

unreal plover
bitter sundial
#

I think I ended up making a large png instead lol

unreal plover
#

The actual

#

Ff

quartz kindle
#

yeah canvas works with pngs mostly

unreal plover
#

Help

bitter sundial
unreal plover
#

any1

#

Oh

#

Thx

tardy viper
#

can you help me to create a system to activate a commande on just one serveur or ..

quartz kindle
#

check server id

bitter sundial
#

@quartz kindle the weird part was that while looking for help online others were doing it fine

quartz kindle
#

with canvas?

bitter sundial
#

yea

tardy viper
#

i have won

quartz kindle
#

well idk, i havent tried working with svg

tardy viper
#

to use canvas

quartz kindle
#

my canvas is entirely generated without any external image

bitter sundial
#

even tried weird stuff like loading into a buffer and using that buffer as a source for an image

#

I only needed external images for the avatars and the certified badge (svg)

quartz kindle
#

you could convert them to png or to base64 and have them embedded in your code

#

embedded base64 would get rid of disk i/o as well

#

assuming you dont need to resize it

tardy viper
#

can you help me to create system activate or desactivate

quartz kindle
#

activate or deactivate what?

tardy viper
#

you can choice to no ue this command on this server or use this command

#

with a activation or desactivation

quartz kindle
#

you need a database

#

then you need to add the server id to the database

#

and save if the server is enabled or disabled

tardy viper
#

i have a db

#

its so dificult for me to create that can you help me to create that ?

quartz kindle
#

its difficult because you dont have enough knowledge or experience, so you need to learn/study more

dull breach
#

Can someone help me with bot's join message? I need to send a "welcome" message to a joined server. Ex. - Tatsumaki (BOT)

#

like:

        CHANNEL.SENDMESSAGE("Hi! I'm a bot! Thanks for adding me to your server!")
});```
#

it's TatsuBot code

#

BUT IT DOESN"T WORK

earnest phoenix
#

Lol that's very old JavaScript from when @slender kestrel was actually open source

dull breach
#

yep

earnest phoenix
#

It's basically garbage with today's node.js

#

@bitter sundial are you op?

bitter sundial
#

I am op af

earnest phoenix
#

Yes lol he is

#

Op af

#

hmm whos op-er than u

#

None is more op than @bitter sundial

#

Oily isnt more op?

#

oliy*

#

i read it wrong

#

Lol I thought your keyboard fucked up and autocorrected you

quartz kindle
#

@dull breach is basically channel.send("hello") but first you need to get a channel, like in which channel is the bot supposed to send that?

#

you can probably do something like channels.first() to get whichever channel happens to come first

earnest phoenix
#

@quartz kindle smart

#

I wouldn't have thought of that

dull breach
#

TypeError: channel.send is not a function

#

🙃

orchid jewel
#

channel.sendMessage() @dull breach

quartz kindle
#

sendmessage is deprecated in discord.js

dull breach
quartz kindle
#

its .send()

dull breach
#

client.sendMessage(channel, "hi") ???

quartz kindle
#

unless you're using eris or something else

dull breach
#

no, discord.js

orchid jewel
#

channel.sendMessage('hello'); or channel.send('hello');

quartz kindle
#

well apparently .first() doesnt work for channels

dull breach
#

i've seen something like (variable) = bot has permission SEND_MESSAGES in channel

quartz kindle
#

interestingly, according to that link, .first() does work if you use channels.sort().first()

dull breach
heady zinc
#

according to the docs, .first() should work with channels too

quartz kindle
#

yeah it should

dull breach
#

ok thx @quartz kindle

quartz kindle
#

but in his example it didnt for some reason

heady zinc
#

oh well

#

doesn't channels

#

includes categories

#

that might be why

quartz kindle
#

yeah that might be

#

like, it will turn into category.send or voicechannel.send

#

which dont exist

heady zinc
#

ye so you'd need to filter categories out first

ruby dust
#

idk if it's possible in d.js, but in d.py you can choose to either get a list of all channels or a list of specific type of channels

quartz kindle
#

yeah not natively, you have to filter it yourself

upper ember
#

anyone knows how to use RPC with the new development portal?

earnest phoenix
#

There's a section for that in the sidebar

upper ember
#

yea but where do I enable it?

#

set the images

#

etc

#

this is only rich presence visualizer

earnest phoenix
#

You can set images using Art Assets

#

There's a link there

bitter sundial
#

it's already enabled for all applications now I think

#

and yea theres a subsection for art assets

earnest phoenix
#

im using discord bot maker and the mod about music dont working whats the solution

sullen path
#

Don’t use discord bot maker.

earnest phoenix
#

waow why

sullen path
#

That’s the solution

earnest phoenix
#

i dont know coding

sullen path
#

I suggest learning

earnest phoenix
#

you are cruel

quartz kindle
#

unfortunately he is right

#

discord bot maker might be a fun experience, but in the end its just a toy, you cant make a serious bot with it

earnest phoenix
#

My friend uses DBM he says it is way easier than python

#

He used python before DBM

quartz kindle
#

of course its easier, its made for noobs

#

but python is a fully featured programming language which can do anything

#

dbm is just a tool that can do a few things and has a lot of limitations

earnest phoenix
#

How to get a token of weeb.sh?

quartz kindle
#
If you think that you should also be a part of weeb.sh, feel free to write us at devs@weeb.sh```
earnest phoenix
#

Lol

sullen path
#

Yes

earnest phoenix
#

Ok .thx!

#

You must send an email to the developers, their api is not public

#

ok.

austere hound
#

is it possible to let my bot make a invite link for me from the guild is he joined

#

?

quartz kindle
#

it should be, as long as the bot has invite permissions

austere hound
#

oke now i need to figure out how ^^

solar pier
#

Yo im trying to connect discords gateway with ws module but i dont know how to use it i tried to identfy but the websocket closes can someone help me

eager spoke
#

With a method like Server.createInvite

heady zinc
#

you first need to get the gateway and then attempt an identify ZoomEyes

restive totem
night imp
#

Looks like a protected character

#

Probably a render error

tawny lava
#

supposed to be a greater than sign

karmic parcel
#

it's html escaped

restive totem
#

ye i would lly like to know what it is it that it meant to be here

earnest phoenix
#

I'm having issues loading images onto an embed with eris, I'm using an image object and i set the url to load the picture from my localhost server (http://localhost:8080) but when the embed displays it shows a placeholder picture from discord, can someone explain why this ain't working?

#

I have the pictures stored in a folder called media, i set the server to load that folder

#

if i visit the server through the browser it shows correctly

uncut slate
#

that's not really how discord api works, if you want to do something like that you have to download the image to a resource accessible by discord and pass that

#

like imgur

earnest phoenix
#

That sucks

heady zinc
#

discord can't access your locally hosted server ZoomEyes

#

nobody can in fact

uncut slate
#

or you upload it as a file

karmic parcel
#

he/she can

heady zinc
#

ronin pls

karmic parcel
#

hehe

earnest phoenix
#

Well node can access it

#

Discord can't i guess

#

Makes sense

#

So if i like get a domain and put a server on it using node then discord can access it correct?

#

Not a local host domain that is

heady zinc
#

well you can work-around it i mean

karmic parcel
#

Yeah, you can even use GitHub Pages as a CDN kinda

heady zinc
#

does github pages actually allows you to do that

#

iirc github doesn't like to be used as cdn

earnest phoenix
#

i just want to have a cdn that discord can access

#

probably won't use github tho

karmic parcel
#

I have images hosted on my GH Pages that I use in commands

earnest phoenix
#

That sounds like a pain in the ass to do tho

#

Probs have to do a workaround

karmic parcel
#

you could just run a smol webserver to serve the images alongside your bot if it's on a VPS or something

solar pier
#

@heady zinc i have done read all of them already

#

I can connect

#

But cant identify

earnest phoenix
#

My bot is setup on localhost right now lol

heady zinc
#

are you sure you are following all the steps

#

also you should check out the error code discord returns

solar pier
#

I am trying to understand

heady zinc
#

it should give you a lead on what you are doing wrong

solar pier
#

I need some info about the module I am new to websockets

ruby dust
#

does anyone know how patreon bot assigns roles? if I have made it to assign 3 roles on a specific tier does it trigger 3 separate on_member_update events or does it do that in one?

lament meteor
#

not sure

earnest phoenix
#

got the cdn working

#

discord is loading the images now

earnest phoenix
#

Roles undefined...

let patreonPlusRole = client.guild.roles.get("471259869085827072")
#

is it role.get?

uncut slate
#

client,guild is not a thing

earnest phoenix
#

What about client.roles.get?

gilded blaze
#

You have to get the guild.

earnest phoenix
#

message.guild?

#

lol

gilded blaze
#

yes

earnest phoenix
#

then guild.roles.get

#

Okay thanks

earnest phoenix
#

Lol trying to get the guild of a client? thonkku

#

I mean you can try and get the guilds the bot is in

#

But there is no way to get the client's guild because it doesn't exist

#

Anyway what's the best way to contact discord support? I'm having bot avatar uploading issues with the new dev portal

quartz kindle
#

dont advertise

earnest phoenix
#

Nevermind it seems like it uploads avatars correctly now

#

Hurray

frail harness
#

No, you're not sorry

#

If you were sorry you would've deleted the ad

quartz kindle
#

@scenic axle in case you havent noticed, advertising will get you banned, i suggest you delete that post immediately

frail harness
#

The edit lol

quartz kindle
#

lmao

#

i change my mind often

slender thistle
#

Looks like they don't care, do they?

quartz kindle
#

probs a throw away account or they really just came here to do that then leave

slender thistle
#

I personally would leave it up to mods :^)

quartz kindle
#

same

earnest phoenix
#
case 'setlogs': {
    if (!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send(nuaiacces)
    if (!message.mentions.channels.first() && args.join(" ").toUpperCase() !== 'NONE') return message.channel.send(folosesteaga)

    let newChannel;
    if (args.join(" ").toUpperCase() === 'NONE') newChannel = '';
    else newChannel = message.mentions.channels.first().id;

    db.set(`logChannel_${message.guild.id}`, newChannel).then(i => {
        message.channel.send(afostsetat)
          })
        };```
I want to set up the event channel
message deleted
message updated
when I set the logs on a channel
and I want to send the event, tells me that no channel has been set
I'm using the latest version of quick.db
#

6.3.2

#

if I use version 3.0.3, quick.db, it works but they can not make the economy system because it's the latest version

earnest phoenix
#

What does this mean?
(node:4492) MaxListenersExceededWarning: Possible EventEmitter memory leak detec ted. 11 guildMemberUpdate listeners added. Use emitter.setMaxListeners() to incr ease limit

sick cloud
#

@earnest phoenix, you have too many guildMemberUpdate events and it's causing a memory leak.

earnest phoenix
#

ok thought so

earnest phoenix
#

it doesn't cause a memory leak certainly, its just a warning so you're aware you are listening to the same event more than X times (10 by default) which might result in a memory leak if unintended, you can change the X using setMaxListeners either to the emitter or in the process (catch-all)

knotty steeple
#

what is an alternative to canvas i can use?

spring ember
shy rose
#

@knotty steeple jimp is stand alone and way faster also not a truck on dependencies to setup

knotty steeple
#

some people say jimp is slow Thonk @shy rose

shy rose
#

never had that

#

also like canvas is such cancer to setup on some systems

knotty steeple
#

especially windows

shy rose
#

ubuntu got me

knotty steeple
#

which i am trying to install it on now

shy rose
#

bloody spent a day on it

knotty steeple
shy rose
#

cario cdn died that makes it fun

quartz kindle
#

jimp is slow if you read images from disk all the time

#

if you do everything in memory, then it should be close to canvas

#

there's also sharp which looks very good on paper, but i havent tested it

fluid basin
#

sharp speed is really comparable to canvas

#

Tbh if you don't want to spend time setting up stuff you could use prebuilt

shy rose
#

If sharp native though or is it binding cause afik jimp was only native one on that graph

knotty steeple
#

what about the buffers

#

that can be returned when using jimp how do i use that

quartz kindle
#

sharp uses libvips

#

idk if natively or not

#

jimp is the only one who is pure js tho

knotty steeple
#

how to install discord.js v12

main cairn
#

Hi

split lantern
#

@knotty steeple
`To install and use the Discord.js master branch:
Without voice support: npm i -S discordjs/discord.js
With voice support (node-opus): npm i -S discordjs/discord.js node-opus
With voice support (opusscript): npm i -S discordjs/discord.js opusscript

If you use yarn:
Without voice support: yarn add discordjs/discord.js
With voice support (node-opus): yarn add discordjs/discord.js node-opus
With voice support (opusscript): yarn add discordjs/discord.js opusscript

You need Git for this to work:
Ubuntu/Debian: sudo apt-get install git
Windows: https://git-scm.com/download/win

Documentation: https://discord.js.org/#/docs/main/master/`

knotty steeple
#

why did you have to post all that

split lantern
#

Idk

#

@knotty steeple u might also consider joining d.js support discord

knotty steeple
#

i am in it

quartz kindle
#

did you have to post all that in single quote blocks?

split lantern
knotty steeple
#

can you like stop mentioning me on every message pls

#

also im not joining if im never going to ask anything

#

so if i have something about bot dev ill just ask/say here

wild tide
#

Does anyone know a permission node that checks if the user is the Server Owner?

#

like ADMINISTRATOR or something

knotty steeple
#

there is none

wild tide
#

hmm

#

ok den

#

that just made life very hard

knotty steeple
#

how

wild tide
#

I need server owner

#

not administrator

knotty steeple
#

ok what lib

wild tide
#

discord.js

heady zinc
#

discord.js gives you guild.ownerId

wild tide
#

ah

#

🙏 praise be

heady zinc
#

actually

#

it even gives you the member object of the owner directly

wild tide
#

YAS

#

🙏 Praise be

#

Thonk that was what it does

#

lmao

split lantern
#

Gud when internet lags out and shows u the conva 40 secs later

wild tide
#

at least you didn't ping anyone

#

👌

earnest phoenix
#

Lol

wild tide
#

if(!message.guild.member(guild.owner)) return message.channel.send(`You are not the server owner!`) would this work?

heady zinc
#

i don't think so, if you only want to check the owner, you should rather compare the guild.ownerID property with the message's author id

wild tide
#

ah ok

earnest phoenix
#

Is there no way to make mobile embed titles a different color?

#

My embed's main color is red and i don't like the blue title with red color embed

#

But i want to use the title object

wild tide
#
message.channel.send({embed: {
color: //color integer here,
description: ("Embed")
}});```
#

should work on mobile and pc

earnest phoenix
#

That only changes the main embed color

#

Not the title

wild tide
#

ah

earnest phoenix
#

Mobile embed titles are blue by default

wild tide
#

make the title a URL, that redirects to no website

earnest phoenix
#

Aren't urls blue

wild tide
#

yes

earnest phoenix
#

I don't want blue

#

My embed is red

#

I want a white title

wild tide
#

so in a RichEmbed, it would be something like `.addTitle("Title", null)

earnest phoenix
#

But guess that won't be possible

wild tide
#

you can only do blue

earnest phoenix
#

I'm not using rich embeds

wild tide
#

you can only change title color in RichEmbed()

#

however, you can mak a title a color if you put it in a code block

#

for example, green text = css

#

so: css This is green text

earnest phoenix
#

doesnt show as green on mobile

#

but on pc it does

wild tide
#

there is no other way

earnest phoenix
#

all i want is to change the embed title color to white

#

but nevermind

#

seems like its a no go

wild tide
#

mhm

quartz kindle
#

code block colors dont work i mobile

#

who knows why

knotty steeple
#

embed titles can turn blue?

#

wait

wild tide
#

ye

quartz kindle
#

maybe they just strip the markdown.js from it

earnest phoenix
#

Lol probably so

#

On mobile embed titles look blue

#

By default

#

On pc they're white

knotty steeple
#

oh

#

didnt know what Thonk

earnest phoenix
#

I wonder when discord is finally going to make mobile embeds look like pc embeds

knotty steeple
#

also for embed titles you can do

title: "title here"
earnest phoenix
#

That's what i use

#
        "embed": {
          "title": "Bot status",
          "color": 16749459,
          "description": msg.channel.guild.shard.latency + "ms",
        }
      }
    }```
#

using eris

#

then bot.createMessage(msg.channel.id, embed)

#

the title object is blue on mobile

earnest phoenix
#

I've been trying to get music to work on d.js for a long time, but ever since I moved from Glitch.com to DO, YouTube-search or ytdl-core gas said I have an invalid API key. Can anyone @here help?

sick cloud
#

It'd be YouTube-search, ytdl-core doesn't use an API key. Make sure you still have the API key stored correctly, and that it's valid maybe?

Side note: Mentioning @here wont' work. mmLol

earnest phoenix
#

Ye

#

Wait. I don't even use YouTube-search

#

Been so long

#

Or ytdl-core just youtube-dl

gilded blaze
#

Music on d.js is horrible

earnest phoenix
#

Ikr

#

Fucking terrible

sick cloud
#

Works fine for me. ._.

earnest phoenix
#

Can anybody help me figure this out?

earnest phoenix
#

coding on mobile? oof

shy rose
#

wait what

#

sure its not a weird monitor size GWqlabsFeelsFunnyMan

earnest phoenix
#

nah man its android

sick cloud
#

Quick question for any Express users; can you use res.redirect and redirect a user to a page while a POST is still running, then when done redirect them again without killing the process?

#

Like, here I have a POST on /, when my code's info event runs I want to redirect to /in_progress with that info, then when it's done I want to redirect to /done, though I don't want to stop the POST code from running.

obtuse wind
#

question

#

through the bot console, is it possible to send a message to a certain channel

#

if so, how can I do that?

#

( the bot I use is, node.js / discord.js ), with atom editor

glossy sand
#

you could attach an event listener to stdin and send messages accordingly

obtuse wind
#

you may not get it

#

I'm allowed to run commands and type codes and stuff through the console itself

glossy sand
#

is this a bot you wrote lol

obtuse wind
#

My bot is not on the website nor in any servers, it's only in my personal server

#

and I want to be able to send messages in a channel

#

through the console

#

( without running it in discord chat )

glossy sand
#

yes uh

#

so you read from stdin and relay that data to the discord channel

obtuse wind
#

how

#

I'm sorry for this but I'm actually new to all this javascript and coding stuff

glossy sand
#

ok uh

#

you know about the process global?

obtuse wind
#

not really

glossy sand
#

node has a global called process that exposes a bunch of properties of, as you might have guessed, the node process

#

one of these properties is process.stdin, which is a readable stream sourced from the process's stdin

obtuse wind
#

so if I type process in the console ( which I already did )

#

it showed me a'lot of stuff

glossy sand
#

you're at a repl?

obtuse wind
#

ok I typed in process.stdin

#

hmm

glossy sand
#

ok here's what i suggest

#

you don't seem to know a whole lot about node or programming in general, i guess?

obtuse wind
#

yeah I started yesterday

glossy sand
#

and you already have a working bot? lol

obtuse wind
#

yeah I mean

glossy sand
#

did you just clone an open src bot

obtuse wind
#

no

#

I mean

#

I know a little on how to make commands and stuff like that

#

I'm just trying something new with the console

#

aka trying to send a message to a channel

glossy sand
#

you uh got that far in one day with no prior experience

obtuse wind
#

Yeah

glossy sand
#

sounds fishy to me

obtuse wind
#

Pretty much

#

I mean I am a quick learner

glossy sand
#

do u know what an event listener is then

obtuse wind
#

not much about it, kinda

glossy sand
#

ok what you need to do is attach an event listener to the stdin object

#

as i recall, you need to listen for the data event

obtuse wind
#

ok

glossy sand
#

you'll be passed the raw data received from stdin, which you can parse and send to the discord channel

obtuse wind
#

okie

#

hmm

obtuse wind
#

Sorry, for bothering again Nines, but what would I right in the stdin? @glossy sand sorry for ping if u don't like being pinged

glossy sand
#

er we have a no-spoonfeeding policy

#

process.stdin is an event emitter so you can attach event listeners with the on method

#

i assume you've used that before?

obtuse wind
#

oh ok I get it now

#

my mind was in the wrong place

#

xd

glossy sand
#

👍

wide ruin
#

hey

#

discord changed the site for bots

#

how do you make a bot profile?

sick cloud
#

add your bots pfp to the general information page

#

same as before

wide ruin
#

there is no option anymore

obtuse wind
#

Nines, it just printed out the process.stdin when you first enter it

wide ruin
#

oh

sick cloud
#

there is?!??

wide ruin
#

its called build-a-bot now

obtuse wind
#

no there isn;t

sick cloud
#

face palm

#

also yes i'm using a touchpad so my arrow drawing skills suck

wide ruin
#

thats change icon

sick cloud
#

it changes the bots pfp too

#

.>

#

if you really don't believe me, go to the Bot tab and upload it there

wide ruin
#

yeah, ive done all of that

#

where do i get the token?

sick cloud
#

bot tag -> copy/reveal token

wide ruin
#

oh

#

im blind

#

not really

#

thanks

#

just the name change is strange

summer narwhal
#

@median bear

earnest phoenix
#

Help

#

nhandledPromiseRejectionWarning: TypeError: Assignment to constant variable.

knotty steeple
#

help

#

we dont know what to help you with

#

if you dont say what is causing the error

#

(╯°□°)╯︵ ┻━┻

earnest phoenix
#

I dont even know what is causing the error

#

(╯°□°)╯︵ ┻━┻

knotty steeple
#

oh wait

earnest phoenix
#

u are assigning to a const

#

again

knotty steeple
#

i was about to say >:(

#

if you want to change value of a variable use let

earnest phoenix
#

O

#

k

#

i get it

#

no u can change the value

#

ita not immutable

#

u just cant reassign

knotty steeple
#

oh ok

silent kiln
#

Help me make a bot, it is not working...

patent tinsel
#

i have two bots, my main bot (on the site) and another on the testing branch which has a different user token and everything

#

is there a way to use the discordbots' websites api bot without validating another bot

ruby dust
#

use the main bot's token?

quartz kindle
#

^

tribal hazel
#

it says theres an error in the shards.js code.
Although thats not a command in my bot file?
I need help!

topaz fjord
#

Send the error

tribal hazel
#

@topaz fjord

topaz fjord
#

It says right there there isn't a file called shards.js

tribal hazel
#

There isnt.

#

But it says there is above.

topaz fjord
#

What are you even trying to do

tribal hazel
#

Nothing. I just tried to load my bot and it didnt work.

#

Shards.js isnt even a command.

#

in my folder.

#

but theres an error with code?

topaz fjord
#

Because it's seems like your trying to shard

tribal hazel
#

Im not?

#

Theres no thing called fs.js...

gilded blaze
#

You are using the shard class

topaz fjord
#

fs.js is an internal thing

tribal hazel
#

I dont get why its not working? In my folder for my bot theres literally not a single command fs.js

#

or shards.js

topaz fjord
#

fs.js is a node thing

#

Comes with it pre installed

#

I forgot to ask this but show code

tribal hazel
#

Theres no code..

#

No fs.js

#

No shards.js

#

Its randomly coming up with an error.

topaz fjord
#

Show core from index js

#

Did you not see what I said fs.js is a node thing

tribal hazel
#
const prefix = ('=');
const client = new Discord.Client();
const bot = new Discord.Client({disableEveryone: true});
const ytdl = require("ytdl-core");
const ms = require("ms");
const Manager = new Discord.ShardingManager('./shards.js');

fs.readdir("./commands/", (err, files) => {

    if(err) console.log(err);
    let jsfile = files.filter(f => f.split(".").pop() === "js")
    if(jsfile.length <= 0){
      console.log("Couldn't find commands.");
      return;
    }
  
    jsfile.forEach((f, i) =>{
      let props = require(`./commands/${f}`);
      console.log(`${f} loaded!`);
    });
  });

client.on("ready", async () => {
    console.log(`Logged in as ${client.user.tag}!`);
    client.user.setStatus('idle');
    client.user.setActivity(`=help`);
    
});
client.on('message', async message => {

    let msg = message.content.toUpperCase();
    let sender = message.author;

    let args = message.content.slice(prefix.length).trim().split(" ");
    let cmd = args.shift().toLowerCase();

    if (!msg.startsWith(prefix)) return;
    if (message.author.bot) return;
    try {

        let commandFile = require(`./commands/${cmd}.js`);
        commandFile.run(client, message, args)
    }catch(e) {

    }
    
});
client.login(``)```
#

Oh I see.

#

Im dumb..

gilded blaze
#

That is not how Discordjs sharding works

tribal hazel
#

I realised..

#

My mistake..

topaz fjord
#

I usually keep my sharding manager In a separate file

tribal hazel
#

Im so dumb..

topaz fjord
#

Speaking of that I need to ad a separate Shard

tribal hazel
#

😮

#

Omg..

#

Its working

#

for gods sake..

earnest phoenix
#

hey does anyone know how to create a patreon if you pay then get access to a command in heroku?

ruby dust
#

I would recommend you doing it my way which is a stolen way of how rythm bot devs do it

earnest phoenix
#

@ruby dust how do you do it?

ruby dust
#

after they execute the command the bot checks if they are donators according to your database

#

have a private bot for your support server which will be adding/removing people from database when they have an apporpriate donator role in the server

earnest phoenix
#

do i use mysql?

#

or what?

ruby dust
#

SQLite3

earnest phoenix
#

ahh

#

but i dont know how to use SQlite3

ruby dust
#

any database works, as long as you know how to use it

earnest phoenix
#

Problem is he uses heroku

#

Yes that's the biggest problem, heroku sucks

#

Heroku does not support sqlite

#

Heroku sucks tickYes

#

ok

dull breach
#

Hi my bot was declined cuz google command can search some 18+ in non-nsfw channels. Can someone help me with search filters? Maybe Google have something like "baby-mode"

earnest phoenix
#

Make your nsfw command only work in nsfw enabled channels

#

Fixed

dull breach
#

@earnest phoenix umm what

earnest phoenix
#

In discord there are nsfw type text channels

#

You can make it so your command only works there

dull breach
#

Google command can search some 18+ in non-nsfw channels

#

So its not a nsfw command

#

But user can search "sex"

ebon bolt
#

hmmm

#

What are you using to Google?

#

Is there an API?

dull breach
#

no

ebon bolt
#

Are you generating links?

dull breach
#

snekfetch

#

searchUrl = https://www.google.com/search?q=${encodeURIComponent(message.content)};

#

maybe some arguments in link

earnest phoenix
#

You could always restrict words

ruby dust
#

if you'd use a google api, you would be able to enable safe search that filters out the excplicit content from your result matches

ebon bolt
#

^

#

requesting from that link will be bad, you'll get captcha'd

earnest phoenix
#

But does the filter work 100%?

ebon bolt
#

oh wait

#

no

#

but it's not controllable at all

#

No, not 100% but it's pretty reliable.

#

I have a bot that uses the same system to automatically detect NSFW messages in Discord, 80-90% accuirate.

earnest phoenix
#

He can still get declined then

ruby dust
#

safe search is one of the google's apis, so it handles what results you will get on their end

earnest phoenix
#

I know what it is

#

But it's not 100% certain u won't get nsfw

ruby dust
#

it's still a better fix than any other workarounds that you might think of yourself

dull breach
earnest phoenix
#

Oh is it

#

Ye

#

Whatever

ebon bolt
#

(kinda nsfw)

#

i guess?

earnest phoenix
#

That's what i was suggesting

#

Blocking words

ruby dust
#

still not the best solution

ebon bolt
#

It's just a matter of finding and developing the block array over time.

ruby dust
#

safe search is all I can suggest

ebon bolt
#

That one is... oddly detailed.

earnest phoenix
#

lol

ebon bolt
#

@ruby dust Safe Search + that will make for a pretty decent combination.

dull breach
earnest phoenix
#

@ruby dust the best solution is up to jarvis to decide for his bot

ruby dust
#

I guess, but I'm afraid that will limit out too much while hiding actual results

ebon bolt
#

https://www.google.com/search?num=30&[[[[[[safe=active]]]]]]&ei=FahYW6mIJout0gLO6b2wBw&q=I+love+you&oq=I+love+you&gs_l=psy-ab.3..35i39k1j0i67k1l9.11230.14960.0.15319.26.16.7.2.2.0.141.1227.12j3.16.0....0...1c.1.64.psy-ab..2.24.1240.6..0j0i131k1j0i10k1.67.dejskJZgd_0

dull breach
#

&safe=active yes

#

thx

ebon bolt
#

yup

dull breach
#

uhh wait

earnest phoenix
#

does anyone know any free recommended vps that doesnt require a credit card cuz im only 14 and dont have one XD

#

free vps?

#

Kek

dull breach
#

if google command can search 18+ content dbl verification will decline too

ebon bolt
#

Jarvis, that's why you implement the array I sent

earnest phoenix
#

Google works through key words remember

#

If you block keywords

dull breach
#

The best solution: delete google command 😃

ebon bolt
#

🤦

earnest phoenix
#

@earnest phoenix there are no free vps out there that i know

#

Just host on your machine

#

If it's decent enough

#

then i would have to leave my computer on

#

Yes

dull breach
#

fri.gate extension for chrome

earnest phoenix
#

Free vps are a no go

#

You'd have to pay

ebon bolt
#

^

#

I mean... I'm paying $5 per month for a server hosted by Digital Ocean

#

It's flawless

#

Just do chores around the house for the money or something

earnest phoenix
#

Sucks he doesnt have credit card

ebon bolt
#

or buy like..a Raspberry Pi lol

dull breach
#

virtual credit card?

earnest phoenix
#

What

dull breach
#

lol

#

idk i live in russia and here is QIWI wallet that can create virtual MasterCard

earnest phoenix
#

how do i get a virtual CC?

#

XD

#

@dull breach how do you transfer money onto it

dull breach
#

like vcard is a your QIWI wallet account

#

and you transfer money to your account

earnest phoenix
#

I have no idea

slow ice
#

@earnest phoenix You could also get a Pay2d credit card

dull breach
#

uhhhhhhhhhhhhhh 400 words

#

ok how i said best solution - delete

#

haha i found the solution
just use google only in nsfw channels

eager spoke
#

sounds stupid to use google commands only in nsfw channel tbh

dull breach
#

doesn't matter 🙃
noone use google command

eager spoke
#

btw isn't google a 13+ service like discord ?

topaz fjord
#

yes

dull breach
#

yes with SafeSearch

topaz fjord
#

ew safesearch

earnest phoenix
#

@slow ice whats a Pay2d CC?

dull breach
#

ok safesearch doesn't do anything cuz when i google sex it OUTPUTS SOME INFO

topaz fjord
#

safesearch prevents images afaik

#

like bad images

#

and some words

#

sex aint a bad word

dull breach
#

ok here is no rule about bad words (only arguing)

#

idk i'm russian i don't know what is bad words in eng :)

nimble star
#

Hello! I have a question that is sort of urgent.

I want to make my bot @ancient mirage 's purge command only delete messages that aren't 14 days old or above. I figured I have to use the before parameter, but I don't know how to make a datetime object that will do the job. Does anyone know how to do this?

#

These are the documentaries. I can send the links when requested.

dull breach
#

maybe request now time minus 14 days

topaz fjord
#

catch the error, check if the error message says that you cant delete messages that are older than 14 days, send message that you cant delete them

nimble star
#

No, I need to go for messages created since now (let's say) up to 14 day old ones. The time now minus 14 days wouldn't do it, as well as it might not always work the way I might've done it.

#

The command proceeds to delete messages older than 14 days either way, but one-by-one. I've been told now inside of the official discord.py server that that's not recommended and that I should set a limit, though I'm not sure how.

#

If it would've thrown an error, my error handler would've taken care of that.

topaz fjord
#

bots cant delete messages 14 days or older anyways

#

if it tries it just throws an error

sullen path
#

Just delete everything until discord says no

dull breach
#

^
just catch error and say haha you can't

nimble star
#

It can. The message cache is at 5000 by default, which means messages older than 14 days are still inside, until they just get forgotten by the client.

#

(That is, if they are one of those 5000 messages)

topaz fjord
#

well i asked library devs and they said that only the bulk delete endpoint has a limit to 14 days

eager spoke
#

also you can check the timestamp of the message and compare it to now

nimble star
#

I'm afraid however that datetime will pull a prank on me, since if the command is called, let's say, on the 20th of Sept, the bot will go and look for messages that are sent before the 34th of Sept instead of the 4th of October. Though, I'm not certain of this.

#

I also hardly work with datetime, so feel free to judge if it's a dumb mistake/thought.

#

Wait, I just figured that I mixed the dates.

#

Though, wouldn't the number go negative or would datetime figure out that it has to go 1 month back and continue from the last day?

eager spoke
#

also which api do you use?

nimble star
#

rewrite version, I use the commands extension.

eager spoke
#

ok, also timestamp is the number of second since the 1/1/1970

nimble star
#

According to my quick maths, I just have to look for messages that are younger than 1209600 seconds?

#

(That's 14 days)

eager spoke
#

yes

#

you could also use datetime.timedelta()

earnest phoenix
#

theres PostgreSQL

#

on heroku

#

but dont know how to use

dull breach
#

heroku doesn't support sql

#

:)

#

just don't use heroku

#

glitch for example

earnest phoenix
#

theres postgresql XD

slow ice
#

@earnest phoenix Im sorry for the late response but a pay2d cc is a virtual card

earnest phoenix
#

thats there type of data base

#

@slow ice its fine

slow ice
#

oke

earnest phoenix
#

Does anyone here know how to use postgresql to set up patreon pay to access command

#

lol i dont, but if i did, i would help

#

stackoverflow

#

might

#

know

#

what?

#

check stackoverflow/google

#

ok

#

if my tag bot was in this channe, i'd do +googleit and you'd get a nice gif

#

???

#

wahts this for?

#

its for laughs

#

but it got no laughs

#

so ill shut up

#

XD

shell grove
#

Does anyone know do they add the bots manually here or how?

knotty steeple
#

once the bot gets approved the moderator who approved it invites it to this server

shell grove
#

so it's all manual

ruby dust
#

how do you think people would do it automatically if discord has a captcha on authorization page

shell grove
#

I don't know that's why I am trying to figure out is there any way to automate it

eager spoke
#

bypassing captcha is a thing too 👀

nimble star
#

Good luck coding it though, without taking other's entire scripts. Code samples are okay.

clever pecan
#

is this the right place to ask a quick question

#

?

earnest phoenix
#

yes

#

if it's related to discord

#

and bot dev

clever pecan
#

yup

#

cool

#

im writing a bot

#

im trying to figure out if/how i can use the link feature in Markdown

#

I know average users cant

#

but i've seen some posts about how bots CAN

#

but no actual record of how. I've tried just sending this is a link from the bot

#

it doesnt work.

#

thoughts or ideas @earnest phoenix ?

ruby dust
#

the reason why it only works for bots is because hyperlinking only works in embed descriptions

clever pecan
#

So I'd need to make an embed?

ruby dust
#

yes

earnest phoenix
#

Pretty easy using libs

clever pecan
#

cool, there was some debate in a reddit thread I found whether you actually NEEDED the embed

ruby dust
#

although, webhooks can hyperlink in message content Thonk

clever pecan
#

... BLARG

#

it would be great if i could get that working, but if an embed is necessary thats helpful

#

thanks guys

earnest phoenix
#

sure

earnest phoenix
#

Any alternatives to canvas that run on Digitalocean? I really need one

bitter sundial
#

why not canvas?

earnest phoenix
#

It fucks up my vps

bitter sundial
#

wut

#

you're doing something wrong

earnest phoenix
#

Errors no matter what I do

bitter sundial
#

well what is the error

#

also please replace "runs on Digitalocean" to "runs on [the distribution of linux my droplet is running]"

earnest phoenix
#

Ubuntu 16.04

bitter sundial
#

exactly what I was using

#

and it was fine on my vps

#

you're probably missing a dependency

earnest phoenix
#

Canvas had some type of error installing I think

#

And it retried with prebuilt or some alternative, and the installation went through

ripe crown
#

Lol

earnest phoenix
#

@bitter sundial

#

node gyp

bitter sundial
#

anything above that?

earnest phoenix
#

I don't understand this and I'm about done screwing around with this

#

Pls help this is killing me

#

@bitter sundial ^^

tardy viper
#

Can you help me plz

#

To code an bdd

#

for me its so difficult

neat falcon
#

what you need help with

#

@tardy viper

earnest phoenix
#

@bitter sundial the second image is what's above

#

@earnest phoenix nodegyp doesn't work well on android

bitter sundial
#

that's ssh on a vps

tardy viper
#

@neat falcon I want to be use one command ..join #thechannel (message) and that wrote the id of #thechannel and wrote the message

earnest phoenix
#

what kind of os

neat falcon
#

do i detect someone running node on their fuckin phone

bitter sundial
#

@earnest phoenix try sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++

earnest phoenix
#

they're not

#

It seemed like it

#

But its ssh

neat falcon
#

yes

bitter sundial
#

literally just said

earnest phoenix
#

Because you can run node on android

#

But some modules don't work

tardy viper
#

no the module work just the probleme is the modules was temp (forme) with Termux

earnest phoenix
#

What

split lantern
#

U can run windows me on android

earnest phoenix
#

I am running through codeanywhere ty and @bitter sundial I'll try it

bitter sundial
#

yea that looks normal

#

until you killed it

earnest phoenix
#

What happened... I didn't kill it. It did it automatically

bitter sundial
#

maybe the keys that take screenshots are used to kill as well idk

earnest phoenix
#

No. I took it after it killed

split lantern
#

Well u could use pre built ones

earnest phoenix
#

How exactly?

#

@split lantern ^^

#

I need to get off. I have parents who want me off

#

and will do anything to get me off my phone

#

@bitter sundial I used prebuilt and it broke the bot. Just won't even start

bitter sundial
#

again, error please

earnest phoenix
#

Nvm I still required 'canvas' not 'canvas-prebuilt'

#

How do you set up an sqlite database file?

#

Name.sqlite

earnest phoenix
#

i just realized that heroku is not life time XD

#

it only has 500 hours

sick cloud
#

gg

earnest phoenix
#

rip me

#

i need a vps but im broke XD

#

im trying to look on google for a free one XD

sick cloud
#

checked pinned messages maybe

#

there are pretty cheap vpses

earnest phoenix
#

ok

#

@sick cloud do you recommand VIRMACH

#

i have music command tho

#

so idk?

#

XDDD

bitter sundial
#

this is the prebuilt?

earnest phoenix
#

you run your bot on your phone?

bitter sundial
#

what's your code like

sick cloud
#

i don't use them so idk

earnest phoenix
#

@earnest phoenix I do not run my bot on my phone I run it on Digitalocean, which can be accessed by an app on my phone, and @bitter sundial, yes this is prebuilt

bitter sundial
#

you commented out all your code?

earnest phoenix
#

Oh I uncommented it afterwards

#

I used an earlier download

bitter sundial
#

this one is still using canvas instead of canvas-prebuilt

earnest phoenix
#

Lemme jus get the current code...

bitter sundial
#

oh

#

canvas-prebuilt is version 1.6

earnest phoenix
#

Oh, yes?

#

What version does the d.js guide use?

bitter sundial
#

and you're probably reading version 2.0.0 documentation

earnest phoenix
#

Fuck

bitter sundial
#

let's get you a 2.0 one

earnest phoenix
#

I'm kinda stupid. Prebuilt does have 2.0 binaries, right?

bitter sundial
#

npm i canvas-prebuilt@2.0.0-alpha.12

earnest phoenix
#

Killed

bitter sundial
#

now im confused did that work or not

earnest phoenix
#

Ikr

bitter sundial
#

just run it again

earnest phoenix
#

Should I append -S?

bitter sundial
#

-s is no longer needed in newer versions of npm

earnest phoenix
#

Nice

#

Didn't know that.

#

Killed again no persistent success

bitter sundial
#

I've never seen node-gyp say Killed

earnest phoenix
#

@earnest phoenix a mobile? Wutt????

#

ssh

#

How.?

#

google it

sick cloud
#

How do you add a dropdown selector and get the value given from it in html/express? I'm too dumb to understand them, so far I only understand how to use usual input fields and res.body.inputname

bitter sundial
#

use the select element

#

if you use a form, set a name attribute on it

sick cloud
#

alright

#
<form action="/" method="post" name="inputs">

so set it as that or something?

bitter sundial
sick cloud
#

ook

#

thanks

earnest phoenix
#

@bitter sundial it finally worked. Thanks for all your help. And may the force be with you

sick cloud
#

thanks thonkku tonkku

earnest phoenix
#

Note: everyone but heroku is not lifetime you only have 500 hours of hosting
Extra hours: if you add billing information you get extra 450 hours

ocean moss
#

Anyone willing to aid me in returning a user that has voted for my bot?

uneven depot
sick cloud
#

@bitter sundial think you can help me more? everything i select returns undefined

bitter sundial
#

did you add values to the options

sick cloud
#

yeah i did

uneven depot
#

@ocean moss i could answer questions since i've used discord.py

bitter sundial
#

and a name to the select element

sick cloud
#

oh not a name to it

#

._.

#

ay adding a name worked lol

#

thanks

ocean moss
#
self.dblpy = dbl.Client(self.bot, self.token)
        self.bot.loop.create_task(self.update_stats())

    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count"""
        while True:
            await self.dblpy.post_server_count()
            await asyncio.sleep(1800)```
I have this atm @uneven depot
#

Get a 403 error

sick cloud
#

does "HTML escaped" mean that <p></p> and such will show as plain text instead of their actual element?

uneven depot
#

did you add that add_cog thing at the went for your discord.py client?

ocean moss
#

Yeah i did

uneven depot
#

i guess what i would try to do is add try and except blocks from within the loop, with logging to see what's going on. One sec i'll post example

ocean moss
#

Okaays

uneven depot
#
            try:
                await self.dblpy.post_server_count()
                logger.info('posted server count ({})'.format(len(self.bot.guilds)))
            except Exception as e:
                logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
            await asyncio.sleep(1800)
#

and for logger could do something like

#
    logging.basicConfig(level=logging.INFO)
    logger = logging.getLogger('discord')
#

after doing import logging

#

If it's a new bot, it's possible that maybe it throws exceptions when it doesn't have anything to post yet (not sure if that's how it behaves, but this is what i have and it seems to work for me)

#

just correct a typo i had. I had pass instead of logger, which basically tells it to do nothing and continue the loop lol

earnest phoenix
#

@earnest phoenix it was killed bc it was found compiled already

#

whether thats online or cached somewhere on ur pc

#

oh anyway its fixed now @earnest phoenix

#

nice

ocean moss
#

Thanks!

earnest phoenix
#

@bitter sundial another issue:

12|mini-me | Error: error while reading from input stream
12|mini-me |     at Image.src (/home/node/mini-me-stable/node_modules/canvas-prebuilt/canvas/lib/image.js:30:17)
12|mini-me |     at Promise (/home/node/mini-me-stable/node_modules/canvas-prebuilt/canvas/index.js:34:15)
12|mini-me |     at new Promise (<anonymous>)
12|mini-me |     at Object.loadImage (/home/node/mini-me-stable/node_modules/canvas-prebuilt/canvas/index.js:23:10)
12|mini-me |     at module.exports (/home/node/mini-me-stable/events/guildMemberAdd.js:24:35)
12|mini-me |     at emitOne (events.js:116:13)
12|mini-me |     at Client.emit (events.js:211:7)
12|mini-me |     at Guild._addMember (/home/node/mini-me-stable/node_modules/discord.js/src/structures/Guild.js:1142:19)
12|mini-me |     at GuildMemberAddHandler.handle (/home/node/mini-me-stable/node_modules/discord.js/src/client/websocket/packets/handlers/GuildMemberAdd.js:12:13)
12|mini-me |     at WebSocketPacketManager.handle (/home/node/mini-me-stable/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
#

i don't do much image manipulation you can probably tell

sick cloud
#

@earnest phoenix, means the file path you've added is incorrect and Canvas can't find the image.

earnest phoenix
#

oh thx

#

i'm dying out here

#

all these stupid fucking complicated-ass error messages

#

@sick cloud will it load a .jpg?

sick cloud
#

yes

earnest phoenix
#

hmm, i'm pretty darn sure i've got the path right

sick cloud
#

its relevant to your cwd

#

so if you have your image in / and the cmd using it is in /stuff/, you'd need to require it as ./image.png or whatever

#

(i think, thats on @next at least)

earnest phoenix
knotty steeple
#

try ././assets/welcome.jpg

earnest phoenix
#

?

knotty steeple
#

on loadImage

earnest phoenix
#

that calls the cwd twice

knotty steeple
#

just try it

earnest phoenix
#

ok i did

#

now i need a test dummy lol

knotty steeple
#

i can do for you