#development

1 messages · Page 1393 of 1

ocean cedar
#

so perfect, tomorrow i will adjust it and do final modification, now its 2:22 and i have class tomorrow so need some sleep. thank you again really a lot for your patient help

sick cloud
#

lemme check

blissful coral
#

Could honestly make the hovers go below

outer perch
#

my bot is like me and my gfs child @ocean cedar

#

no problems

sick cloud
#
.tooltip .tooltip-text
    opacity: 0
    text-align: center
    padding: 2px 6px
    position: absolute
    z-index: 100

.tooltip:hover .tooltip-text 
    opacity: 1
#

maybe its because of that z-index there

#

lol

#

never noticed i had it

ocean cedar
#

my bot is like my and my gfs child @ocean cedar
blush3

sick cloud
#

nope removed that and it didnt fix it but that's the tooltip code

outer perch
#

😅

quartz kindle
#

try giving them a negative zindex

sick cloud
#

so like z-index: -1 or

ocean cedar
#

the world needs more people like you, really appreciated it man

quartz kindle
#

ye

sick cloud
#

didn't work

outer perch
#

the world needs more people like you, really appreciated it man
@ocean cedar I hope so 😊

sick cloud
#

they still seem to overlap the search box

ocean cedar
#

goodnight

sick cloud
#

actually huh, now they won't show at all

#

okay

quartz kindle
#

they are probably behind the background now

sick cloud
#

the negative z-index stops them from showing

#

yeah

#

so it needs a slight z-index

#

i think

#

and then try to give the search box more

quartz kindle
#

check if you find a z-index value that works, if not, try giving the search bar position:relative (if it doesnt have position) and a z-index higher than them

sick cloud
#

so give the tooltips z-index: 1 and the search bar z-index: 2

quartz kindle
#

ye

#

not sure if it works with position:relative tho

sick cloud
#

doesn't seem to fix it

#

i'll try without position relative

#

nope

#

it's odd

quartz kindle
#

is that public or localhost only?

sick cloud
#

localhost only as it's just an index.html file with some assets

quartz kindle
#

ah

sick cloud
#

even with that, no luck

quartz kindle
#

does .tooltip have position:relative?

sick cloud
#

position absolute

#

i think

#

it's kinda weird how im doing it but it works

#
<p class="tooltip">
  <button class="bg-indigo-300 bg-opacity-25 hover:bg-indigo-200 hover:bg-opacity-50 text-white pl-2 pr-2 pt-1 pb-1 rounded transition duration-300 ease-in-out">
    <img src="https://icongr.am/jam/grid.svg?size=24&color=ffffff" />
  </button>

  <span class='tooltip-text bg-indigo-200 bg-opacity-50 text-white p-3 rounded bt2 transition duration-500 ease-in-out'>Switch collections</span>
</p>
quartz kindle
#

hard to say without seeing it =P

sick cloud
#

i can send you the code

quartz kindle
#

one option would be to make the search bar position:absolute

sick cloud
#

it's just kinda messy

quartz kindle
#

but that will likely screw something up

sick cloud
#

just added that

#

doesnt break it

#

but same issue, doesn't stop the tooltips

#

lemme dm you

earnest phoenix
#

is there a way for me to somehow detect and continue a timeout after a bot restart in javascript?

quartz kindle
#

nope

#

you need to save some kind of status in a file or database

#

and have the bot read it and restart the timeout if needed

earnest phoenix
#

oh ok then, is there a way for me to reload the entire bot without interfering with those timeouts?

sick cloud
#

run them on another process possibly

#

but that can get messy

#

define "reload"

#

just reloading commands or events and all

earnest phoenix
#

ok thanks i think i will just make my bot save the remaining time when restarting

#

because reloading is basically impossible for me because of the writing behind my bot

sterile ridge
#

some... example code or documentation to customize top.gg bot page

sick cloud
#

in your desc

<style>
css here
</style>
#

that's it

#

css

sterile ridge
#

yeh but... (invite) bottoms has their name on css

#

sorry if I am bad

#

I dont know too much of css

#

~~<

sick cloud
#

then learn it, it isn't too hard

#

just google some tutorials

sterile ridge
#

oh okie

#

thanks >~~<

stable nimbus
#

Anybody use discord-paginationembed?

ionic dawn
#

@sterile ridge Es simple Felix_cool_FB

stable nimbus
#

I need help changing the addField values.

ionic dawn
#

Never used it sry

#

Im looking at it rn at npm... seems cool

sterile ridge
#

@sterile ridge Es simple :Felix_cool_FB:
@ionic dawn aaahhh

lyric mountain
#

Anybody use discord-paginationembed?
you almost made me happy af

vale garden
#

hi

#

is there any way to get the number of lines in a div

rustic nova
vale garden
#

thx

stable nimbus
#

you almost made me happy af
@lyric mountain WYM?

orchid flare
#

Hey I don't know if this fits in this category but I am just wondering where I can host my Discord Bot for free or pretty cheap, I have tried Heroku but since my bot sends a lot of messages (I think about 50k each day, don't ask) it stopped running it.

lyric mountain
#

I have published a lib called pagination-utils for java

stable nimbus
#

I code in JavaScript

lyric mountain
#

ik

#

but the name was almost similar

stable nimbus
#

@orchid flare Yes its possible, especially for cheap, go to IcedHost LLC, for 2.99 a month you get pretty decent stats.

vale garden
#

Hey I don't know if this fits in this category but I am just wondering where I can host my Discord Bot for free or pretty cheap, I have tried Heroku but since my bot sends a lot of messages (I think about 50k each day, don't ask) it stopped running it.
@orchid flare use either glitch or repl both are great

orchid flare
#

but if you use REPL it shows the bot token doesn't it?

#

which resets the token?

real niche
#

Use a .env file

worthy pine
#

not if you use environment variables

stable nimbus
#

@lyric mountain Is it possible that its easier to use?

orchid flare
#

do you guys know of any tutorials for that then? im new

lyric mountain
#

no, not at all since javascript != java

real niche
#

But if your bot is responding to 50k commands, I would recommend you go with more dedicated hosting.

lyric mountain
#

but yeah, I made it as minimal as possible while leaving enough room for customization

#

if you ever come to java make sure to give it a look

#

although I'm struggling to properly publish it at maven central

real niche
#

Time to make pagination-utils for js

exports.paginate = (inp, maxlength) => ((a,b)=>Array.from({length:Math.ceil(a.length/b)},(e,r)=>a.slice(r*b,r*b+b)))(inp, maxlength);
stable nimbus
#

True I forget about that.

#

Oh hi.

real niche
#

That isn't quite pagination but still a pretty useful function

stable nimbus
#

I just don't know how to paginate and could use a little help if at all possible

real niche
#

Well

#

((a,b)=>Array.from({length:Math.ceil(a.length/b)},(e,r)=>a.slice(rb,rb+b)))(text, 2000)

lyric mountain
#
exampleChannel.sendMessage((Message) pages.get(0).getContent()).queue(success -> {
    //Pagination-Utils is just this line below
    Pages.paginate(success, pages, 60, TimeUnit.SECONDS);
});
orchid flare
#

not if you use environment variables
im not quite sure how to use enviroment variables, I just realized my bot token is stored in settings.json (I realized cause I am using DBM, dont judge)

real niche
#

iirc that function is meant for something else with arrays but if you pass in a single string it'll split it up into an array of strings of max legth

#

Similar to that. There's a npm module called dotenv

orchid flare
#

Oh and this is probably a noob question, how would I go about stopping my Discord.Js project.

lyric mountain
#

Wdym?

#

Like, shutdown the bot?

orchid flare
#

Yeah

lyric mountain
#

If you're executing it via terminal, just ctrl + c

#

If on heroku just turn off the dyno switch

orchid flare
#

thanks!

sudden geyser
#

I'm writing an app and I need to include a bundle identifier so I have a unique ID. The recommended convention is to use reverse domain name notation, which transforms site.com to com.site, but I don't have a site (nor do I need one) to base it off. What could I use in replace for com.site?

For reference, think of Apple's bundle identifier (com.site.app) and Java's groupId/base package identifiers. I currently have it set to com.example.lite, but I should need something to replace com.example.

stable nimbus
#

Is there a way to create a file that holds message embeds to reference for use?

lyric mountain
#

@sudden geyser where is it hosted?

#

Like , the source code

#

If it's on github, u can use com.github.username

sudden geyser
#

but that would imply the company is github. Shouldn't it be a bit more distinct?

#

and there's no guarantee I don't change it

lyric mountain
#

It already is distinct enough

sudden geyser
#

hmm

lyric mountain
#

Because u include the username there

#

Pretty much all github projects use that format

#

Including mine which got approved by sonatype for an official repo in maven central

#

So I guess you're free to use github domain for that purpose

sudden geyser
#

that's useful to know.

#

ty for the help

lyric mountain
#

I guess the same applies for bitbucket and other source code repos

proven vector
#

sorry if this is the wrong channel for this, but does anyone know if it is still possible to have someone else verify your bot for you? provided you move it to a team with them added ofc

sudden geyser
#

@lyric mountain sorry to bug again, but my nickname on GitHub is LiteLT instead of Lite. So I should set the identifier to com.github.litelt, correct?

lyric mountain
#

Exactly how it's written in the url

sudden geyser
#

alright, ty again

orchid flare
#

Trying to make bot.js file private like you do with a bot token in .env file

#

Is this possible?

earnest phoenix
#

what

#

you want to put your code in an env var?

boreal flume
#

I recently got my bot on top.gg, and after I added the listener for votes, my bot didn't work anymore, even though I followed exactly how the API docs has it set up. Can someone assist me?
My error

dbl.webhook.on('vote', vote => {
            ^

TypeError: Cannot read property 'on' of undefined
    at Object.<anonymous> (/home/ec2-user/impassive/tic-tac-toe/index.js:25:13)
    at Module._compile (node:internal/modules/cjs/loader:1083:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
    at Module.load (node:internal/modules/cjs/loader:948:32)
    at Function.Module._load (node:internal/modules/cjs/loader:789:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:72:12)
    at node:internal/main/run_main_module:17:47
orchid flare
#

well, I want to host my bot with repl.it since I had a reccomendation but I have to pay to make my project private but I don't want to make my project open-source , so I thought I could just put my code in a .env file and then people wouldn'ty see it but it will still work on repl.it

cunning gorge
#

Anyone know how to fix this error?
UnhandledPromiseRejectionWarning: MongoError: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting.

#

It's related to monog db. A command works on one server, but does not work on another.

mellow kelp
#

@boreal flume i think its because there isnt a webhook on your dbl

#

you gotta provide either a port or a server for the webhook to listen on

boreal flume
#

I found the issue.... I may have skimmed over an important part of the docs that initializes the webhook lol

mellow kelp
#

oh lmao

sick fable
#

My not got declined on top.gg cuz of it wasn't online

blissful coral
sick fable
#

So how much days will it take to get it approved?

blissful coral
earnest phoenix
#

pls help me ``` const user = client.users.cache.get(args[0]) || message.mentions.users.last() || message.author;
const guildUser = message.guild.member(user);

 let adminperms;
 if(guildUser.hasPermissions('ADMINISTRATOR')){    ``` return ```guildUser.hasPermissions is not a function```
blissful coral
#

message.member is a thing

#
message.member.hasPermission('ADMINISTRATOR')```
#

And it is hasPermission no s

#

checking for single perm not multiple

orchid flare
#

Trying to make bot.js file private like you do with a bot token in .env file because I want to host my bot with repl.it since I had a reccomendation but I have to pay to make my project private but I don't want to make my project open-source , so I thought I could just put my code in a .env file and then people wouldn'ty see it but it will still work on repl.it

earnest phoenix
#

@blissful coral what if i have to check mention user perms ?

blissful coral
#

Then you use that bitfield

#

for it

pale vessel
#

You can shorten your code to const guildUser = message.guild.members.cache.get(args[0]) || message.mentions.members.last() || message.member;

blissful coral
#

@orchid flare no

#

Do not use repl

orchid flare
#

Any suggestions then?

blissful coral
#

ever

#

Yes

#

Buy a VPS

orchid flare
#

Alright fair enough

#

Thanks

pale vessel
#

hasPermission() supports array where you can provide multiple permissions

blissful coral
#

ℹ️ This is a list of hosting providers, not a backing/support for them. You will need to make your own decision. All $dollar prices are in USD.
@blissful coral

orchid flare
#

Wish

#

Oh sorry

#

I meant woah

earnest phoenix
#

i have 1.5$ vps for 3 months

orchid flare
#

Woah

#

What’s it called

earnest phoenix
orchid flare
#

Thanks

earnest phoenix
#

but only 500mb ram

pale vessel
#

You can get a free VPS that has like 350mb of ram with no root access on Library of Code

#

Good for testing

blissful coral
#

Should tell me the name 👀

earnest phoenix
#

@pale vessel link pls

pale vessel
orchid flare
#

How do u use that?

pale vessel
#

It's a little complicated

#

You need to join their server, register and stuff

earnest phoenix
#

@orchid flare you buy it ?

orchid flare
#

Yeah

pale vessel
#

Ah you're talking about WitherHosting

orchid flare
#

Is it good?

earnest phoenix
#

@orchid flare yea

pale vessel
#

Voltrex also uses WitherHosting iirc

earnest phoenix
#

you know cedar ? owner of cosmic bot list ..

vale garden
#

hi

pale vessel
#

Which Cedar?

#

The full name

earnest phoenix
#

cedarblocks

pale vessel
#

Ah, yeah

earnest phoenix
#

@orchid flare dm me ill tel you

#

Tel?

#

Hmmmmmmm

#

he gift me witherhosting vps 😆

#

Alright

#

May you use grammar correctly?

#

what is grammer

#

lmao

#

._.

#

Did u go to school?

#

Bruh

#

Ask google for the answer

strong escarp
#

lmao i am soo struggling making a music commands

earnest phoenix
#

Ok.

#

But don't flood.

strong escarp
#

i worked for like 10 days

#

for that single code

#

*command

earnest phoenix
#

Oh

#

And did u make it with JS?

strong escarp
#

let me try again

timber cloud
#

The presence of users and the total number of members are not working, is it because I did not activate the intents? If so, how do I activate?

My bot has already been checked and the options are blocked.

sudden geyser
#

is it because I did not activate the intents?
Yes.

#

You could contact Discord asking for the intents, but I doubt they'd accept it.

ornate needle
#

They won't gave for privileged intents for cases like " userinfo"

Member chunking etc

earnest phoenix
#

nice grammar

#

lol

blissful coral
#

Please stop judging people thanks

earnest phoenix
#

what?

#

im saying that her/his grammar is nice

blissful coral
#

Ah ok

rustic nova
#

@earnest phoenix maybe you still have the Manage_messages message there

#

check the bot for yourself

#

maybe you're trying to delete the fire command

#

the command that executed the message

earnest phoenix
#

No, I already checked my code and the poor thing and it does not ask for it

#

For that reason I resubmitted the bot for review

rustic nova
#

Did you ask the corresponding moderator? maybe they can tell you what command they used and what the response was

earnest phoenix
#

Was that

#

But I check the code and it doesn't ask for permission

rustic nova
#

Maybe it was a false decline, that can also happen, nobody is perfect

#

Or maybe you're just missing something very obvious, everything can happen

earnest phoenix
#

Or maybe you're just missing something very obvious, everything can happen
@rustic nova I don't think so, the command only asks for the permissions that are in the capture array, nothing more, within the command code, no individual permissions are verified

#

Maybe it was a false decline, that can also happen, nobody is perfect
@rustic nova I will ask him, because I don't know what to fix if everything seems fine

rustic nova
#

try removing every single permission from your bot except send_message

#

and see if you get any error

#

but i assume you did that already

earnest phoenix
#

How do you see at no time am I asking for that permission

rustic nova
#

Yeah contact Alex then later when he's online. They will explain why it didn't work then

earnest phoenix
#

Yes, I will, because I have no idea what to correct if everything is fine

rustic nova
earnest phoenix
#

Yes, if he does not have that permission, he will send it to you by private message, because if you grant it in the same channel, he will make an embed page

#

But I am not asking for that permission on a mandatory basis

rustic nova
#

yeah a misunderstanding then, contact them later ThumbsUp

earnest phoenix
#

I will do that, thank you

#

I am creating a bot using mysql. The database contains data as shown in the photo, but the last two digits of the data acquired by the select command have been replaced with 0. How can I cure this?

 connection.query("SELECT id FROM user WHERE joinchannel = " +message.channel.id,(error,results) => {console.log(result)})

// result of console.log [ RowDataPacket { id: 661793849001246700 } ]
#

@rustic nova, Do you know how to contact him? I can't find it on the server

rustic nova
#

i don't want to ping them though, give me a second

#

dm them through their last message

earnest phoenix
#

Thank you, I appreciate your time

rustic nova
uncut vortex
#

How would you go about (in nodejs) setting it up so that you can run a block of code on a set time scale so it would run every two minutes.

rustic nova
#

ThumbsUp good

#

hope you can make it through queue

earnest phoenix
#

How would you go about (in nodejs) setting it up so that you can run a block of code on a set time scale so it would run every two minutes.
@uncut vortex Excuse me for mentioning ... Can't you do what you want to do? (I'm sorry if You've already tried this)

 const cron = require("node-cron");
  cron.schedule("* */2 * * * *", () => {
 //Write here what you want to do every 2 minutes

});
uncut vortex
#

I haven't tried anything. I didn't even know where to start looking so I asked.

earnest phoenix
#

Besides the above method, you can also use "setinterval".

unborn ridge
#

need a help

lucid prawn
#

Who needed help I dont mean code :)

oak cliff
#

Then what do you mean

#

This channel is for help with code.

earnest rivet
pure lion
#

@earnest rivet use the webhook system and then count 86400000/2 after, and then send the reminder

#

You can just use setTimeout or a schedule thingy

earnest rivet
#

ok

royal crescent
pure lion
#

@royal crescent inspect where the Elo: 1714 is

#

Then send

royal crescent
#

flashbang incoming

pure lion
#

Give it an ID

#

Just the 1714

earnest phoenix
royal crescent
#

Give it an ID
@pure lion mind if i ask how this works lol im newer to js

pure lion
#

Sorry lad I don't know SQL (@earnest phoenix)

#

@royal crescent the element, give it an ID

#

Unless it's not your site

royal crescent
#

not mine

#

i guess saying "i have" was misleading

#

i realize that now

#

my bad

pure lion
#

That's fine

earnest phoenix
#

hi

pure lion
#

Gi's a sec

#

Hey code

earnest phoenix
#

hey dice

#

I'm tryna make a tic-tac-toe game in node.js

pure lion
#

@royal crescent you wanna fetch that webpage with node-fetch and then pass in the fetch.text() to cheerio

#

Once you do that I'll help you with scraping

earnest phoenix
#

but doing stuff in the terminal is WAYYY harder than doing stuff in DOM cuz we have things like buttons

royal crescent
#

no idea what that means but i shall do my research

earnest phoenix
#

so should i use a normal HTML page or go nuts tryna do it in the terminal

royal crescent
#

thanks lol if i figure out how to do that ill ping u in the morning

tardy hornet
#

i want to make my bal command async, but i dont know how to make it async in this command handler

module.exports= {
    name: 'bal',
    description: "see your bal",
    execute(message, args){

        const Discord = require('discord.js');
              let user = message.author;
              let bal = await db.fetch(`money_${message.guild.id}_${user.id}`);
              if(bal === null) bal = 0;
              const balembed = new Discord.MessageEmbed()
              .setTitle(`${message.author.username}'s balance`)
              .setColor("GREEN")
              .setDescription(`${bal} coins`)
              .setTimestamp()
              message.channel.send(balembed)

        

    }
}
pure lion
#

@tardy hornet sqlite3?

earnest phoenix
#

@tardy hornet make the execute command async ig

tardy hornet
#

i tried

pure lion
#

async execute(...) {}

#

Piggus

#

Also you don't need to do that asynchronously

#

Also you don't need to pass in a string or not use .'s

royal crescent
pure lion
#

The wrapper has been updated lad

#

@royal crescent yeah

royal crescent
#

aight thanks

tardy hornet
#

so like that:

pure lion
#

Np

#

Yeah

tardy hornet
#

didnt work

pure lion
#

Also update your quick.db, you don't need to use underscores any more

#

What's the error?

tardy hornet
#

SyntaxError: await is only valid in async function

#

thats the command:

pure lion
#

Show me your new code

tardy hornet
#
module.exports= {
    name: 'bal',
    description: "see your bal",
   async execute(message, args){

        const Discord = require('discord.js');
              let user = message.author;
              let bal = await db.fetch(`money_${message.guild.id}_${user.id}`);
              if(bal === null) bal = 0;
              const balembed = new Discord.MessageEmbed()
              .setTitle(`${message.author.username}'s balance`)
              .setColor("GREEN")
              .setDescription(`${bal} coins`)
              .setTimestamp()
              message.channel.send(balembed)

        

    }
}
pure lion
#

Strange

#

Remove async and await doot

earnest phoenix
tardy hornet
#

ty

#

worked

earnest phoenix
#

does chalk have a client-side version

pure lion
#

Np

#

@earnest phoenix chalk?

#

The vee ess code eggstenstiotn?

earnest phoenix
#

no the noodle javascript moodule

pure lion
#

It's a vsc ext too

#

When you say client side do you mean DOM or discord?

earnest phoenix
#

When you say client side do you mean DOM or discord?
@pure lion what makes you think discord

pure lion
#

Tic

shadow lynx
#

Hi

pure lion
#

In console

#

Hey

ivory seal
#

is there any endpoint to check the user's custom status?

pure lion
#

Yeah

ivory seal
#

oh any docs on that?

earnest phoenix
#

i meant can i use it on DOM objects to change the color and background-color CSS properties

pure lion
#

Mhm

#

Go to the Dev portal

#

There will be docs there

earnest phoenix
#

why are you sending them to the dev portal

shadow lynx
#

My bot glitches when there's code in the deleted message logs lol 😅

earnest phoenix
#

discord.js already has it built-in

ivory seal
earnest phoenix
#

User#presence iirc

ivory seal
#

ye but that returns online,offline or dnd only righ?

earnest phoenix
#

tho you'll need to go to the dev portal anyway to enable presence intent

#

ye but that returns online,offline or dnd only righ?
@ivory seal there are more

ivory seal
#

ah ok

earnest phoenix
#

playing status custom status spotify status playing status streaming status watching status

ivory seal
#

that clarigied my doubt

earnest phoenix
#

the whole list

pure lion
#

why are you sending them to the dev portal
They didn't say a lib so I sent them to the general dAPI docs doot

earnest phoenix
#

plus DND, online, offline and idle

pure lion
#

It's invisible

#

Iirc

#

Maybe that's just for bots idk

earnest phoenix
#

invisible mode appears offline to everyone

pulsar perch
#

Error: Cannot find module 'quick.db'
Require stack:

  • C:\Users\rsama\economybot\commands\balance.js
  • C:\Users\rsama\economybot\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
#

Help!

#

im getting this error

#

i installed duick.db thought

#

though

earnest phoenix
#

@pulsar perch quick.db is not installed in the node_modules of the current folder

pulsar perch
#

How can i do that tho?

#

i did

#

npm install quick.db

earnest phoenix
#

try re-installing the package with -g parameter if your host allows

pure lion
#

You need windows build tools

pulsar perch
#

npm i quick.db -g

#

like this?

pure lion
#

Or just build tools

earnest phoenix
#

@pure lion they said they successfully installed it

pure lion
#

@pulsar perch no

earnest phoenix
#

npm i quick.db -g
@pulsar perch yes

tardy hornet
#
module.exports= {
    name: 'weekly',
    description: "get weekly money",
    execute(message, args){
        const db = require("quick.db");
        const Discord = require('discord.js');
            let user3 = message.author;
            let timeout2 = 604800000;
            let amount3 = 2500
          
            let weekly = db.fetch(`weekly_${message.guild.id}_${user3.id}`);
          
            if(weekly !== null && timeout2 - (Date.now() - weekly) > 0){
              let time = ms(timeout2 - (Date.now() - weekly));
              return message.channel.send(`you've already collected your weekly award. Come back in ${time.days}d, ${time.hours}h, ${time.minutes}m, ${time.seconds}s`)
            } else {
              db.add(`money_${message.guild.id}_${user3.id}`, amount3);
              db.set(`weekly_${message.guild.id}_${user3.id}`, Date.now());
              const weeklyembed = new Discord.MessageEmbed()
              .setTitle(`Successfully added ${amount3} coins to your balance`)
              .setColor("GREEN")
              message.channel.send(weeklyembed)
            }

        

    }
}
``` for some reason it send the balance command as well
pure lion
#

You don't need to globally isntall

earnest phoenix
#

they need to require the package in a folder where it isn't available

#

save space by just installing it globally and using it wherever needed

pure lion
#

h

pulsar perch
#

im gonna try it

earnest phoenix
#

i

pulsar perch
#

lol

queen moss
#

So I'm currently using nodejs's PassThrough readable class for guild streaming, in which I am piping a mp3 file chunk by chunk into the buffer, then outputting that in a livestream via express- to safe myself memory, after each chunk is output in the stream, I drain the streams buffer

I noticed that after around .5 million chunks written, the nodejs drain function stops operating properly- even if the buffer size is at the highWaterMark when drain is emitted - anyone possibly know why that may be

#

example code:

#
trackStream.pipe(throttle).on('data', (chunk) => {
            radio.streams[0].write(chunk)
            radio.streams[0].emit("drain")
})
#

this has worked well so far, till now, not sure what's up

#

I also tried calling drain after the "end" event is emitted from the track piping, and it still results in it eventually stopping

pulsar perch
#
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'quick.db'
Require stack:
- C:\Users\rsa
queen moss
#

I was only able to find 1 similar case on stackoverflow, from 2 years ago, and it was never answered lol

pulsar perch
#

Help!

earnest phoenix
pulsar perch
#

i did that 2

#

but its not working

earnest phoenix
#

ig just cd to your commands folder and install it normally without -g

pulsar perch
#

ok

#

better-sqlite3@7.1.1 install C:\Users\rsama\economybot\node_modules\better-sqlite3
prebuild-install || npm run build-release

prebuild-install WARN install No prebuilt binaries found (target=14.15.0 runtime=node arch=x64 libc= platform=win32)

better-sqlite3@7.1.1 build-release C:\Users\rsama\economybot\node_modules\better-sqlite3
node-gyp rebuild --release

C:\Users\rsama\economybot\node_modules\better-sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild --release ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --release )

#

Is this like normal?

#

that sthe whole error

queen moss
#

do you not know how to read

pulsar perch
#

No

queen moss
#

you'll need to compile it not just install it

#

there isn't a compiled format to install/use for your os

earnest phoenix
queen moss
#

ok so i think i found a solution to my issue, so im posting it here incase anyone searches for it down the line

#

basically, even if you emit the drain event, if you happen to be writing data in a nextTick format, it will ignore it

pulsar perch
#

F

queen moss
#

therefore, calling .cork() on the write stream to block new data from flowing, piping the data, then using .uncork() will have passed your data to the stream, but then flushes the buffer

#

meaning no memory leak, and it does the same thing

#

node is weird ¯_(ツ)_/¯

#

also make sure to uncork the same amount of times you corked, or data won't begin to flow again

earnest phoenix
#

cork uncork wtf's that

queen moss
#

an update- my solution works- the unit test passed 👏

earnest phoenix
#

what are streams

queen moss
#

well its basically a continual flow of data from a file in chunks

#

Or a flow of chunks from another stream, streamception

earnest phoenix
#

k

vagrant bison
#

where is the Discord API? country?

restive furnace
#

us

#

california iirc

vagrant bison
#

thanks

vagrant bison
#

Poland is good localization for host discord bot?

steep sun
#

Hi, I'm making a tempmute command and there's a problem. I use ms for my tempmute but whenever I type a invalid time like 12sdho, my bot instead reply sth like: I've muted user A for 0 Seconds. - How do I fix if user typed the wrong time format??

earnest phoenix
#

Hey, im using npm and whenever i want to install modules it installs it into "C:\Users\XXXX\AppData\Roaming\npm\node_modules"
and its also the prefix no matter from when im running "npm config prefix" I still gets this directory, how to make it so the prefix will be the closest parent directory for node_modules ?

#

@steep sun use isNaN (is not an number, in js)

#

@vagrant bison Poland should be fine, as long as its a good hosting provider

#

@earnest phoenix Can you try to explain it a other way?

#

Since I dont get you

#

im in: "C:\Users\XXX\OneDrive\Desktop\bots\test-bot"

#

and I did "npm install"

#

Yes

#

to install dependencies from package.json

#

but its installing it to "C:\Users\XXXX\AppData\Roaming\npm\node_modules"

#

Did you do npm init ?

#

instead of "C:\Users\XXX\OneDrive\Desktop\bots\test-bot\node_modules"

#

ye

steep sun
#

@steep sun use isNaN (is not an number, in js)
@earnest phoenix Will I be able to enter 10m stands for 10 minutes, 3w stands for 3 weeks?

vagrant bison
#

@vagrant bison Poland should be fine, as long as its a good hosting provider
@earnest phoenix Canada or Poland is better for hosting dbot?

earnest phoenix
#

@steep sun No you won't I think

#

I built my own package.json with the needed content

#

@vagrant bison I would say, canada but I'm not sure

vagrant bison
#

okey

slender thistle
#

You'd have to manually convert those to appropriate operations and possibly evaluate

steep sun
#

@steep sun No you won't I think
@earnest phoenix Technically I need the format: s, d, m, h, w for my tempmute. But when I do like : 1hfeios, it return as 0 Seconds

earnest phoenix
#

Maybe find a way to ignore the last arg

slender thistle
#

You'd have to manually convert those to appropriate operations and possibly evaluate

#

Could be done via regex

river wing
#

I have a problem with my bot and I dont know how to fix it. My bot now only replies to messages after 2 mins+ and not within a few seconds. Does anyone have any idea why?

sick fable
#

Can someone please tell how to make a logger type of thing which welcomes users and sends the welcome message to the channel where it's logged

unborn ridge
#

finnaly i made hastebin command lol

sick fable
unborn ridge
#

discord.js

earnest phoenix
slender thistle
#

Can someone please tell how to make a logger type of thing which welcomes users and sends the welcome message to the channel where it's logged
@sick fable on_member_join and on_member_remove

#

server admins configure a channel (ID of a channel) that you then use to get a text channel object and send a message to

sick fable
#

Thanks ❤️

#

@slender thistle what about custom channel?

slender thistle
#

wdym custom channel

#

server admins configure a channel (ID of a channel) that you then use to get a text channel object and send a message to

sick fable
#

Ok lol i gotchu

unborn ridge
#

(node:8632) UnhandledPromiseRejectionWarning: DiscordAPIError: Two factor is required for this operation

#

what it means

past needle
#

@unborn ridge the server the bot is in has enabled the 2 factors requirment to have power. So no one can do any moderation action before the user has enabled 2FA and (in your case) the owner of the bot should have 2FA

river wing
#

I have a problem with my bot and I dont know how to fix it. My bot now only replies to messages after 2 mins+ and not within a few seconds. Does anyone have any idea why?
@river wing does anyone have any idea why

earnest phoenix
#

@river wing your bot has a high latency

#

its maybe rate-limited

#

Can I pass an express app object to socket.io straight:

const express = require("express");
const app = express();
const io = require("socket.io")(app);

Instead of passing it into a classic node.js HTTP server then passing that server into socket.io:

const express = require("express");
const app = express();
const server = require("http").createServer(app);
const io = require("socket.io")(server);

The examples on socket.io's website all do the classic HTTP server method with some express.js sauce (yeah)

#

@quartz kindle halp

river wing
#

how do i check the rate-limited issues? @earnest phoenix

earnest phoenix
#

@river wing add this:


console.log("Rate limited")
})```
#

would it be or something

river wing
#

rate..?

#

how do i check the latency

quartz kindle
#

@earnest phoenix try it

#

if it doesnt work then you cant

river wing
#

it doesnt show rate limited

solid falcon
#

hi, I wanna ask. I'm using discord.py and how to get an image that sender sent and save it to server? is it possible?

slender thistle
#

aiohttp
Get the attachment's URL, send a GET request to it and save the received bytes

#

to save the image into a file, open() a file with rb mode

river wing
#

does anyone have any alternatives for cooldown managements? right now im running a database stored with the cooldown values of individual players and every second remove 1 from each component and i think its lagging my bot out.

solemn latch
#

I dont use a database, I just use a map.
I store the expiration time and compare it to the current time. If the current time is higher than the expire time they are no longer on cooldown.

river wing
#

in that case are u able to tell the remaining time left for the cooldown

solid falcon
#

aiohttp
Get the attachment's URL, send a GET request to it and save the received bytes
@slender thistle ok thanks, solved 👍

solemn latch
#

Yes, its just the expiration time minus the current time.

river wing
#

does map reset on every restart?

slender thistle
#

Usually you don't need a database for command cooldowns

solemn latch
#

Yes, which if you need it to work between restarts then use a db.

#

But I would cache that data

#

In a map

#

Or any caching method

#

I also have a db for my week long cooldown commands

river wing
#

so if you are using a db you store the expiration time?

solemn latch
#

I store the submission time I think for the longer times, but it doesn't really matter if you know the length of the cooldown.

#

If you are using a db, most also can auto remove entries once they get too old, which is how I clear my cooldown db.

river wing
#

im using mongodb rn with cooldowns

quartz kindle
#

if your cooldowns are like 5-10 seconds, you dont need a db

solemn latch
#

^

#

Since by the time the bot restarts its already over.

#

Even a few minutes not really needed.

river wing
#

hmm okay

#

ill learn mapping for this

outer perch
#

mapping is actually pretty easy as soon as you get how it works

#

I thought it was kinda hard at first

#

but after understanding, I can now use is more frequently in situations like that

earnest phoenix
#

fun fact

#

every object in js is just actually a map lol

#

well, they have differences from maps internally

#

but they behave the same

cinder patio
#

Well, regular js objects can only hold strings as keys, but the Map class can hold any type as key

earnest phoenix
#

Hello, help me
I want to install discord-canvas, it gives an error

#

Pls Help Me😭

outer perch
#

@earnest phoenix show the error

earnest phoenix
#

Big Error

#

Ok Wait

outer perch
#

send a PrtScn

earnest phoenix
rocky hearth
#

So when djs14 will be released?? 😆

outer perch
#

@earnest phoenix which command did u use to install?

#

So when djs14 will be released?? 😆
@rocky hearth dunno

solemn latch
#

sometime after 13 @rocky hearth

earnest phoenix
#

@outer perch discord-canvas

outer perch
#

u need to install it globally

rocky hearth
#

@solemn latch Nah djs13 will never be released
Only the node even versions are the main versions

solemn latch
#

going the windows 9 route?

outer perch
#

@earnest phoenix npm i -g node-canvas

earnest phoenix
#

ok Pls Wait iam Ts

#

t

#
root@bbzo:~/discordbot/bot/A# npm i -g node-canvas
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/node-canvas - Not found
npm ERR! 404
npm ERR! 404  'node-canvas@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-11-18T11_59_12_130Z-debug.log
outer perch
#

wait a sec.

earnest phoenix
#

Okk

rocky hearth
#

@earnest phoenix Show ur package.json

outer perch
#

@earnest phoenix run npm i -g canvas

#

@rocky hearth doesnt need, theres no node-canvas registed, cuz it's called just canvas

earnest phoenix
#

@rocky hearth

  "name": "Cranly",
  "version": "1.0.0",
  "description": "Elite Cranly",
  "main": "index.js",
  "scripts": {
    "test": "node index.js"
  },
  "repository": {
    "type": "git",
    "url": "https://persiangames98.ir/"
  },
  "keywords": [
    "Cranly",
    "bot",
    "Cranly",
    "example"
  ],
  "author": "Androz2091",
  "license": "ISC",
  "bugs": {
    "url": "https://persiangames98.ir/"
  },
  "homepage": "https://persiangames98.ir/",
  "dependencies": {
    "@vitalets/google-translate-api": "^4.0.0",
    "audit": "^0.0.6",
    "axios": "^0.21.0",
    "binding": "^3.0.3",
    "build": "^0.1.4",
    "chalk": "^4.1.0",
    "cheerio": "^1.0.0-rc.3",
    "common-tags": "^1.8.0",
    "convas": "^2.0.0",
    "discord-giveaways": "^4.2.1",
    "discord.js": "^12.4.1",
    "fix": "^0.0.3",
    "fortnite": "^4.3.2",
    "get-json": "^1.0.1",
    "giphy-api": "^2.0.1",
    "google-translate-api": "^2.0.3",
    "install": "^0.13.0",
    "js-beautify": "^1.13.0",
    "moment": "^2.29.1",
    "ms": "^2.1.2",
    "nekos.life": "^2.0.7",
    "node-fetch": "^2.6.1",
    "node-gyp": "^7.1.2",
    "node-pre-gyp": "^0.16.0",
    "novelcovid": "^3.0.0",
    "npm": "^7.0.12",
    "parse": "^2.18.0",
    "quick.db": "^7.1.3",
    "request": "^2.88.2",
    "simple-youtube-api": "^5.2.1",
    "snekfetch": "^4.0.4",
    "soundcloud-downloader": "^0.2.0",
    "sqlite": "^4.0.17",
    "steamrep": "^1.0.1",
    "string-progressbar": "^1.0.1",
    "uglify-js": "^1.3.5",
    "weather-js": "^2.0.0",
    "wokcommands": "^1.0.1",
    "yo-mamma": "^1.3.0",
    "ytdl-core-discord": "^1.2.4"
  }
}
outer perch
#

I checked the repo

earnest phoenix
#

@earnest phoenix run npm i -g canvas
@outer perch Pls wait Me Test

rocky hearth
#

convas???

outer perch
earnest phoenix
#

Erorr

outer perch
#

holy moly

#

show us

outer perch
#

follow this guide

#

just do the Install Manually guide

pseudo wadi
#

try clearing your cache

earnest phoenix
#

how ?

pseudo wadi
#

whereyouinstallnpm\Users\urmainuser\AppData\Roaming\npm-cache delete the npm cache folder

#

@earnest phoenix

earnest phoenix
#

Ok Wait Pls

pseudo wadi
earnest phoenix
#

@pseudo wadi erorr Again

pseudo wadi
#

what error

pseudo wadi
#

jeez

#

i dont know clearing my cache usualyy works for medoubt

earnest phoenix
#

I'm unlucky

quartz kindle
#

@earnest phoenix where are you hosting?

earnest phoenix
#

linox

#

@quartz kindle Linux

quartz kindle
#

did you install the required dependencies?

earnest phoenix
#

Yes

quartz kindle
#

this?

#

sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

earnest phoenix
#

Yes

green kestrel
#

this might uh, take a while

quartz kindle
#

@earnest phoenix which linux are you using? ubuntu?

earnest phoenix
#

Debian

#

Debian 10.3 .(64bit)

#

140@quartz kindle

eternal osprey
#

hey guys

#

can someone help me out with my problem:

pseudo wadi
#

i know nothing about linux

#

@eternal osprey yh what is it

eternal osprey
#
 let res = await afetch("https://nycpokemap.com/raids.php?time=" + new Date().valueOf())
      let data = await res.json();
      const getName = id => nameList.filter(el => el.i === id)[0].n;
      let raids = data.raids.filter(raid => getName(raid.pokemon_id).toLowerCase() === options.name.toLowerCase() && raid.level >= (options.level ? options.level : 5))
      const reactionEmoji1 = message.guild.emojis.cache.find(emoji => emoji.name === 'valor');
      const reactionEmoji2 = message.guild.emojis.cache.find(emoji => emoji.name === 'mystic');
      const reactionEmoji3 = message.guild.emojis.cache.find(emoji => emoji.name === 'instinct');

      if (timer !== null)
      {
        clearInterval(timer)
      }``` TypeError: Cannot read property 'toLowerCase' of undefined
#

my whole code:

#

i have no clue why it is undefined?

pseudo wadi
#

where do you have it?

eternal osprey
#

line 52 is the error

crimson vapor
#

which line is line 52?

#

oh nvm

#

you pasted it

eternal osprey
#

why is is that?

#

i clearly defined everything

#

and i am pulling the external info (raid.pokemon_id) etc from a site (nycpokemap)

crimson vapor
#

I would console log them before you do the function

#

see which is undefined

quartz kindle
#

@earnest phoenix are you sure you installed the dependencies correctly? that error usually happens when they are missing

#

try installing them again

#

sudo apt install build-essential libcairo2-dev libpango1.0-dev

#

then restart the machine just in case

#

if it still doesnt work, try using node 14 instead of node 15

earnest phoenix
#

sudo apt install build-essential libcairo2-dev libpango1.0-dev
@quartz kindle iam installed Error 404

quartz kindle
#

error 404?

pseudo wadi
#

?

#

uh huh whats the problem

#

wdym by get the command?

#

this may be simple but i juss woke up lol

#

ok

#

any errors in the console?

#

do you have code that reads the file?

#

u need a command handler that reads your files in said folder

#

so like e.g= i have a folder called commands and the handler reads the files

#

ok..

outer perch
#

@earnest phoenix r u usin Discord.JS?

pseudo wadi
#

k

outer perch
pseudo wadi
#

@pseudo wadi r u usin Discord.JS?
@outer perch yes its not my problem tho

#

can i send iv or no
@earnest phoenix yes

outer perch
#

wrong tag xD

pseudo wadi
#

Lol

#

@earnest phoenix dms tho

dusky mason
#
        await ctx.guild.add_roles(ctx.author, role)```
#

alr whats wrong with this

#

simple code

#

@slender thistle

#

ur python god

slender thistle
#

Frozen in time as we both close our eyes and dance
I know I’ve been wasting my whole life just waiting for you

#

okay what

#

oh

#

Oh

#

use add_roles on ctx.author

earnest phoenix
#

hello just wanna ask

dusky mason
#

ah

earnest phoenix
#

what's the proper cooldown between commands

dusky mason
#

thank youu

earnest phoenix
#

to avoid being rate limited

dusky mason
#

usually depends

#

but i think 12 seconds is good

#

because 12*5=60

slender thistle
#

Usually you'd just let your library handle ratelimits

dusky mason
#

which is a minute

slender thistle
#

Users spamming commands isn't exactly a thing you should be worried about unless those commands are resource-heavy

dusky mason
#

also shiv what u mean use add_role on ctx.author

#

i replace ctx.author with add_role

earnest phoenix
#

my cooldown commands are 2 seconds

slender thistle
#

You don't do guild.add_roles(member, role)

#

fucking

dusky mason
earnest phoenix
#

sometimes the bot lags

slender thistle
#

you do member.add_roles(role)

dusky mason
#

got it

slender thistle
#

ctx.author is Member when a command is used in a server

dusky mason
#

k it worked

#

yeah i never work with role creating and deleting

#

and for delete role

#

i just do delete_role

#

await ctx.guild.delete_role(name=".")

#

nice

dusky mason
#

kk lmao

slender thistle
#

unless None was returned

restive furnace
#

sometimes the bot lags
@earnest phoenix make ur cooldowns asynchronous

dusky mason
#

well it didn't work so lemme read

uncut river
#

someone direct me how to edit the style of buttons on my bot page

#

please <3

sudden geyser
#

You can use CSS in the long description

earnest phoenix
#

32 servers 😎

uncut river
#

@sudden geyser yes but how do i know which elements to edit

sudden geyser
#

You can use inspect element. I've rarely worked with HTML & CSS myself.

uncut river
#

alrighty thanks

gusty quest
#

so i want to mute my friend in voice channel

#

so this is what i have

#

`module.exports = {
name: 'talovic',
description: "this is a talovic command!",
execute(message, args){

    if (!message.member.hasPermission('MUTE_MEMBERS')) {
        return message.channel.send(You cant use this command! 🔒)
        }

        let talovic = '482183229571334176'

        talovic.voice.setMute(true);

}}`

#

and it sends error

#

TypeError: Cannot read property 'setMute' of undefined

cunning kiln
#

should a say command requier some sort of permission or should everyone be alowed to use it?

viral spade
#

Hello,
I have a question regarding a website dashboard. My shards cache stats info and guild settings in memory. Now when someone changes stuff via the website dashboard, the corresponding values can easily be changed in the underlying remote databases, but the actual shard is then still running with the old settings in cache. What is the best way of letting the correct shard on the correct vps know that a specific guild it holds has changed settings and needs to be reloaded?

brisk heart
#

@viral spade Nobody is going to read that

cunning kiln
#

i did

solemn latch
#

anyone can use a say command, but if you think it should have a perm, you can do that.
@cunning kiln

slender thistle
#

good job it's not even an essay

#

stop being a lazy ass and be helpful

cunning kiln
#

short version "how do i tell my bot it needs to recache database"

brisk heart
#

@cunning kiln Ok well you just wasted like 5 minutes of your life PES2_Shrug

solemn latch
#

5 minutes?

cunning kiln
#

1

solemn latch
#

for 2 sentences?

cunning kiln
#

at max

hazy sparrow
#
{node:24) UnhandledPromiseRejectionWarning: TypeError: client.users.setActivity is not a function
at Client.<anonymous> (/home/container/index.js:24:17)
at Client.emit (events.js:315:20)
at WebSocketManager.triggerClientReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:431:17)
at WebSocketManager.checkShardsReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:415:10)
at WebSocketShard.<anonymous> (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:197:14)
at WebSocketShard.emit (events.js:315:20)
at WebSocketShard.checkReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:475:12)
at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:447:16)
at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:125:16)
(node:24) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:24) [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.

help? d.js v12

brisk heart
#

It looks much larger on mobile...

cunning kiln
#

short version "how do i tell my bot it needs to recache database"

slender thistle
#

Oh boy, this one is quite complicated

gusty quest
#

@hazy sparrow client.user.setActivity

slender thistle
#

Are events emitted in an inter-shard manner?

gusty quest
#

not .users

hazy sparrow
#

oh, my bad lol

earnest phoenix
#

gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (node:events:329:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Linux 4.19.0-8-amd64
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /root/discordbot/bot/A
gyp ERR! node -v v15.2.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
#

Help

#

oof

#

Me ?

gusty quest
#

how to mute specific user with id?

earnest phoenix
#

Can some one help

#

Me

gusty quest
#

i mean mute in voice channel

earnest phoenix
#

How to make a bot

#

Please

#

go to discord api

#

Api

#

?

#

create an aplication

#

Then

#

I have done this

tired panther
#

How to get the current shard?

viral spade
#

how do i tell my bot it needs to recache database?

earnest phoenix
#

get discord.js or simular

#

I want to add my bot in discord bot list

#

i use botghost because i dont have a pc

#

Please help

tired panther
#

I want to add my bot in discord bot list
@earnest phoenix go on the site xD

earnest phoenix
#

Which

gusty quest
prisma oriole
earnest phoenix
#

Then

#

How to add

#

In list

prisma oriole
#

log in via discord

earnest phoenix
#

When some will search

viral spade
#

how do i tell my bot it needs to recache database

earnest phoenix
#

And get my bot

#

go to API

viral spade
#

WHERE HAS TIM GONE?

earnest phoenix
viral spade
#

only helpful person

solemn latch
#

Probably busy with his libs and support server.

prisma oriole
#

Laso @earnest phoenix these are questions for #support

#

Also*

hazy sparrow
#

how do i get the number of guilds my bot is in?

prisma oriole
#

what lib are you using

hazy sparrow
#

d.j v12

prisma oriole
#

<Client>.guilds.cache.size

hazy sparrow
#

d.js*

#

thanks!

prisma oriole
#

yep

viscid nymph
#

Forgetting about OOP and all that, is there a straightforward simple way to create a music bot in discord.py?

earnest phoenix
#
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (node:events:329:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Linux 4.19.0-8-amd64
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /root/discordbot/bot/A
gyp ERR! node -v v15.2.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
#

PLS Help Me Sry

pale vessel
#

Gyp moment

prisma oriole
#

node-gyp is like

earnest phoenix
#

Help

#

Do You Help Me ?

prisma oriole
#

gyp

#

oh wait

#

im stupid

#

for music

#

nvm

#

lol

earnest phoenix
#

Iam install Canvas
Error :

gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (node:events:329:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Linux 4.19.0-8-amd64
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /root/discordbot/bot/A
gyp ERR! node -v v15.2.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
prisma oriole
#

what version of npm and node are you running

earnest phoenix
#

Full Version

tired panther
prisma oriole
#

full version isn't a node version?

#

like 12.8.0?

#

or

#

13

earnest phoenix
#

Lasted Version

prisma oriole
#

oh ok

#

version of npm?

earnest phoenix
#

I do not know

prisma oriole
#

do npm -v

#

in consoe

#

console

earnest phoenix
#

7.0.8

#

!help

#

Any bot

regal creek
#

So, i'm making a video host website, and I am wondering how to embed a video or just send the image in general from the website. ( For example https://tryitands.ee )

prisma oriole
#

sudo is optional depending on if you're root

earnest phoenix
#

Well, I installed this, what should I do now?

prisma oriole
#

try installing cavas again

#

@earnest phoenix

earnest phoenix
#

oHHHHH

#

New Error

prisma oriole
regal creek
#

@regal creek If I'm understanding you correctly, you want a website url to send a embed or video within Discord. If so, you would use meta tags https://www.wordstream.com/meta-tags#:~:text=Meta tags are snippets of,a web page is about.
@prisma oriole is there any way to do that on Nginx directly?

prisma oriole
#

looks like a python issue now lol

hazy sparrow
#

does the bot/code erros if i code it to send a dm to someone and they have blocked the bot?

prisma oriole
#

@regal creek I'm not too keen on nginx with SEO, I've only seen meta tags done within html tags

earnest phoenix
#

looks like a python issue now lol
@prisma oriole what do I do

prisma oriole
#

whats your python version

#

wait nvm

#

it isnt python

regal creek
#

@regal creek I'm not too keen on nginx with SEO, I've only seen meta tags done within html tags
@prisma oriole alright thank you

prisma oriole
#

yep

earnest phoenix
#

yep
@prisma oriole Excuse me, where can I see it? 🌟

prisma oriole
#

i said yep to jon, python isn't your issue (node-gyp errors are like finding a needle in a haystack so I got confused). It seems this is a common issue with node-canvas. You can try following: https://github.com/Automattic/node-canvas/issues/913#issuecomment-342275618

earnest phoenix
#

I will go and try and announce the result

#

root@bbzo:/usr/lib/node_modules/npm# npm install pkg-config cairo pango libpng jpeg giflib
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/giflib - Not found
npm ERR! 404
npm ERR! 404  'giflib@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-11-18T14_43_50_844Z-debug.log
#

@prisma oriole

waxen tinsel
#

How would I link to a voice channel in discord?

#

Seems that doing it same way as it works for normal channels isnt working.

#

Please @ me when answering

hazy sparrow
#

does the bot/code errors if i code it to send a dm to someone and they have blocked the bot?

molten yarrow
#

yes you need to catch it

south sinew
#

@waxen tinsel

user.send('Your message').catch(error => {})
waxen tinsel
#

?

south sinew
#

if you want to dm someone, do that as it will catch if it fails

earnest phoenix
waxen tinsel
#

Did you mean to @ the other person?

earnest phoenix
#

33 servers

waxen tinsel
#

@south sinew ?

earnest phoenix
#

e.e

south sinew
#

user could be whatever and is a placeholder, message.author would work, etc

hazy sparrow
#

@molten yarrow is it a differnet type of catch that i dont know of? because my error handler isnt detecting it and it sends a unhandled promise rejection in the console

waxen tinsel
#

Ill take that as a yes since you defs are not talking about anything I said @south sinew

#

I am just using invite links for my thing anyway, I was being dumb. I believe you mean to be talking to @hazy sparrow.

south sinew
#

if you want to send an error, you could:

user.send('Your message').catch(error => message.reply(`Unable to send a DM! Make sure I'm not blocked and your privacy settings don't prevent me from DMing you!`);
#

yes bow pro

#

im dumb lmao

hazy sparrow
#

lmao

south sinew
#

sorry for the ping

waxen tinsel
#

ur all good lmfao

south sinew
#

🤦‍♂️

#

but yeah thats how you would do it bow pro

hazy sparrow
#

ok, thanks!

south sinew
#

np

tired panther
#

When , I run a command, I want that the bot pulls the code from a private git repo , will this work?

earnest phoenix
#

35 servers 😎

rustic nova
#

cool

earnest phoenix
#

36

#

Anyone knows a way to create a graph?
For example i give it 5 parameters for example the ping every minute and it builds me like a pic with the graph Thonk

rustic nova
#

from a private git repo
@tired panther you cannot pull from a private repo when you're not authorized

#

and have access to the repo

tired panther
#

I am the owner from the private repo xD @rustic nova

rustic nova
#

yeah no, but you said you want to "make a command that pulls the code from a private git repo"

#

how is your bot able to pull the code when it's private?

regal creek
#

eyyy,

tired panther
#

yeah no, but you said you want to "make a command that pulls the code from a private git repo"
@rustic nova I give the bot access to my repo, I mean the server , where it is running

rustic nova
#

you'll need to authorize the pull request then, use some kind of library for that for example

ancient nova
#

there's been a new api update, competing status was added

earnest rivet
#

actually

ancient nova
#

yeah

earnest rivet
#

how do you use it in d.js

ancient nova
#

just put competing or competing in as a type

sudden geyser
#

Anyone knows a way to create a graph?
For example i give it 5 parameters for example the ping every minute and it builds me like a pic with the graph Thonk
@earnest phoenix your question is quite ambiguous. Do you want to build it programmatically? What language are you using? Have you tried looking if there's a library which can accomplish this for you? Do you want to use an API so you can view the graph remotely?

earnest phoenix
#

I'm using JavaScipt, I'm okay with using a library or an API my target is to make the bot send a graph that is built. I would like to make a graph of how many reactions the bot receives or maybe a ping graph and then send it as a image to the discord channel.

ivory seal
#

ik this is a dumb question but how do i get a object from a array of objects

earnest phoenix
#

many ways

#

what are you doing and what do you exactly want to do

ivory seal
#

im trying to get the users status

#

message.author.presence.activities activities is a araay

ancient nova
#

message.author.presence.activities.toString()

#

use this

earnest phoenix
#

what

#

that'll just join the array they want to return an object

#

@ivory seal custom status?

ivory seal
#

yep

ancient nova
#

lmao

#

then do

#

message.author.presence.activities.toString().replace(',', ': ')

earnest phoenix
#

that's slow

#

not suggested to do that

#

you also won't have access to the object

ancient nova
#

then do || after that

#

or idk

#

if it works then it works

#

idc

ivory seal
#

lol

earnest phoenix
ivory seal
#

ye ok thanks

safe creek
#

im so stuckkkkkkk im trying to install discord.py but i keep getting an syntaxError.
the laptop just came today as an 32bit-x64 so if i need to go to an 64bit to use discord py then that sucks

south sinew
#

what is the command you are using to install?

safe creek
sudden geyser
#

Windows I assume

safe creek
#

mhm

sudden geyser
#

Can you show the error

#

Like wrap it in code blocks or something

#

Aka what got printed to the console/standard output

safe creek
#

how do i do codeblocks?

sudden geyser
#

```py
content here
```

south sinew
#

^

safe creek
#

mmk

#
  File "<stdin>", line 1
    py -3 -m pip install -U discord.py
             ^
SyntaxError: invalid syntax```
#

im using 3.9 (32bit) currently....

south sinew
#

maybe try updating pip?

python -m pip install --upgrade pip
safe creek
#

ok

#

uhhh

#
  File "<stdin>", line 1
    python -m pip install --upgrade pip
              ^
SyntaxError: invalid syntax```
sudden geyser
#

I don't think it has to do with 32-bit. Though, I don't use Windows myself, it doesn't treat -m pip as valid.

safe creek
#

huh ok

south sinew
#

it also may not be installed (which doesnt make sense as it installs with python)

#

check just by doing the help command

pip help
safe creek
#

k

#

syntax error again

south sinew
#

ok, so it isnt installed

safe creek
#

oh thats wierd

south sinew
safe creek
#

k ill do thay

#

after eating tho

south sinew
#

then navigate to the directory and run the install command

python get-pip.py
safe creek
#

when you say directory you mean the application from the .exe right? to paste python get-pip.py into right?

south sinew
#

it could be anywhere, i recommend your documents folder as you dont need special permissions like you do in any of the program files folders on your pc's root directory

safe creek
#

mmmk

south sinew
safe creek
#

ahhh ok

#

so i shouls open an note paste that into there and make it an py then past the python get-pip.py

#

after installing

sudden geyser
#

Carpal could you try entering dir as a command and pressing enter.

#

It should list all files in your directory.

safe creek
#

says built in function dir

south sinew
#

so paste the text from that link into a file named get-pip.py, then run in command prompt python get-pip.py

safe creek
#

aight i get you

#

brb

sudden geyser
#

So that would mean you're in the python interpreter

#

rather than the command line

#

which is why you keep getting that syntax error

south sinew
#

^^

#

that would do it

sudden geyser
#

You should be running the install command from the command line, not the Python interpreter.

south sinew
#

powershell or command prompt would work

#

if you use an ide like vs code, it has a terminal built in

safe creek
#

im so confused...

south sinew
#

ok

#

can you get in vc? (i can screenshare)

safe creek
#

sure

#

1 sec

#

ive been using the py command line so idk

south sinew
safe creek
#

ohhh visual studio

#

i see

#

btw ur kinda quite...

#

yup

#

i see....

#

im only used to bdfd lol so ill definetly be using yt for help

#

used w3school for css before

#

ty

south sinew
#

np

hollow sedge
#

what is bdfd?

cinder patio
#

google it, it's the first thing that comes up

hollow sedge
#

Yeah was about to say nvm

#

BDFD is not real programming btw

#

@safe creek

ancient nova
#

guys I get this error UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message a lot and I don't know where this even comes from so I can't fix it, can anyone please help me, it's been spamming my console for weeks now

rustic nova
fast quail
#

thanks

upper elm
#

discord.js how do I check what emoji a reaction is in an awaitReactions?

#

nevermind

slender thistle
#

?????????

#

@safe creek Ctrl-Z

#

or exit()

#

You don't use python commands in the Python interpreter

#

you use them in your terminal/command prompt