#development

1 messages · Page 525 of 1

keen drift
#

some of the official libs have webhook built in

earnest phoenix
#

ik but would I need to include https or something?

#

Is the IP, the IP of my VPS and the path? Idk what that is meant to go to

#

A Path to what file?

keen drift
#

http, the built in does not have key file support

#

Look at the JS lib

#

...

earnest phoenix
#

😦

#

Would I section them both off with a /?

#

So http://my.ip.here/root/SkillBot/bot.js?

#

😂

#

??

#

@hollow fulcrum thank you i used tmux and it works.

#

soo ehm...

Bot(s)Owner|Callumok2004Today at 10:37 PM
--eval client.message.send("test")
[--] CatManiaBot 🐱BOTToday at 10:37 PM
TypeError: Cannot read property 'send' of undefined
sick cloud
#

@earnest phoenix client doesnt have a message

#

smh

earnest phoenix
#

ye somehow, but how

#

xd

#

what could i do to fix this

#

message is broken, but the event is ok

#

and my handler is grand

#

something must have changed

#

while i was messing with enmap

#

but whats wierd is some commands work, with message.channel.send, and others do not

topaz fjord
#

all should work with message.channel.send

#

its just your code thats broken if it doesnt

ruby dust
#

so I've ran into a problem, this is my json file:

{
    "token": "",
    "default_prefix": "-",
    "response_string": {
        "success": ":white_check_mark:",
        "error": ":x:"
    },
    "owner_ids": [],
    "home_server": 0123,
    "patreon_reward_roles": {
        "tier_1": 1111,
        "tier_2": 2222,
        "tier_3": 3333,
        "tier_4": 4444,
        "tier_5": 5555
    }
}

unfortunately, when I try to open the file and parse json content in it, I get this message:
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 9 column 18 (char 212)

tepid jasper
#

"home_server": 0123,
That number starts with a 0

#

can't have a number starting with 0 :P

knotty steeple
#

huh

ruby dust
#

wait what

#

since when

tepid jasper
#

since json

#

I recommend https://jsonlint.com/ for finding json errors, Python's json error reporting is dumb

ruby dust
#

well ok, thanks

sick cloud
#

can you safely put a number into the negatives in js?

#

like if a user has 20$, can i do -30 and it'll sit safely at -10

keen drift
#

@earnest phoenix did u even look at the lib

#

...

sick cloud
#

@keen drift do you know fishy

keen drift
#

huh

#

yeah you can have negative in js

#

why can't you

sick cloud
#

i was just wondering

#

safely

#

since it might break something

quartz kindle
#

9mb string -> .split("\n") -> 34mb array

#

@_@

sick cloud
#

lol

kind nexus
#

How would I get the current channel of the user?

#

I'm in c# btw hehe

sick cloud
#

i'd guess there'd be some kind of channel property in your message?

#

never used c#

keen drift
#

which lib

shadow dust
#

i think regardless of your lib you should be able to access a Context object that contains a Message property

#

From that Message property you should get a Channel Property probably

sick cloud
#
        bread: NaN,
               ^^^
        items: 2
    },
    current: {
        bread: NaN,
        items: 1
    }```
how can i fix this in my rdb query?
#
current: { bread: (parseInt(u.current.bread) || 0) + returnBread, items: (parseInt(u.current.items) || 0) - amount }```
thats what i'm passing through
worldly steeple
#

anyone know if attaching PNG data and embedding it is likely to load any slower or faster for users than embedding a URI to a PNG?

sick cloud
#

@worldly steeple depending on your bots internet speed, uploading can be as fast or slower

worldly steeple
#

but im talking about loading for users. so when the message from the bot appears, there is a delay before the image is visible to the user as discord propogates it around the CDN. external URIs and uploaded data are treated differently so im wondering if either tends to get to the user more quickly

sick cloud
#

either, it depends on the users speed

#

all you need to worry about is how you do it, since images, embedded by attachment/url or not, will load based on the end users speed

worldly steeple
#

subjectively im seeing embedding URIs seem to load more quickly and they both come from different URIs so it doesnt just depend on the user, discord's infrastructure is a factor too

#

im wondering if anyone knows any details

knotty steeple
static lynx
#

why though

knotty steeple
#

so there is a way to say that a package can only be installed globally to work right?

#

like clis

#

theres a thing you can put in package.json to do that but i forgot what it is

keen drift
#

bin?

#
"bin": {
    "blastertop": "./index.js"
  }
brittle nova
#

why no work code eris on node.javascript version number 0.1.14?!!1!??

#

please give help @everyone

#

lol

bright spear
#

...

#

What's your problem

brittle nova
#

lol

#

come on it's obviously not real

#

..right? 👀

bright spear
#

Why do you keep trolling after mods warned you in general

brittle nova
#

the first part was gonna be sent in offtopic but it was too late

winged shell
#

Deciding to make an auction system where you can sell images/text in an auction that's public and you can get tacos (my bot's currency) to do that. How can I do that.

I use JSONs to make the bot remember stuff!

[I'm using discord.py]

brittle nova
#

json database

#

oh no

#

you should use a real database

#

maybe an sql one

#

idk python nosql databases

#

json files are good for storing static information

winged shell
#

i see, so i *should use sqlite3 then

#

why

#

literally edited that msg 3 times

brittle nova
#

@winged shell
"So tired of people just saying "json is shit".

JSON isn't shit. JSON is an awesome format for exchanging small bits of structured data between processes, or to and from an API, especially if you're using javascript on either or both sides. It's a great exchange format. JSON is also great when doing small configurations files - for your tokens and passwords, and data that doesn't change.

But if you need a way to store temporary data that changes constantly, then JSON is the most horrible way to do so. JSON files can be corrupted super easily but concurrent read-writes will most definitely completely fuck it up. So JSON isn't shit. Using JSON as a database is utter garbage." - evie

#

that should explain it

#

You could use sqlite3

#

I prefer nosql databases so I use mongodb

echo pumice
#

I have a general question about how node.js works

#

When I have a variable set to something in my main node file, that variable is dynamic, and information is somewhat permanently stored there?

sick cloud
#

json is for static

valid frigate
#

when you store a variable in your main node file it will persist until the process exits

#

if theres a function where the variable is local within it, it will obviously be reset when the function is completed

#

tldr it isnt permanently stored but for as long as the process is running

echo pumice
#

That's what I mean by "permanent"

#

Thanks for the clarification

earnest phoenix
#

Can somebody tell me how to use CSS to edit the bots page like changing the text color?

#

Any examples?

earnest phoenix
#

for those who have bots upper 5000 to 10,000 servers, how much does it cost to pay for your VPS monthly?

#

always wanted to ask that

sick cloud
#

@earnest phoenix i pay $25 for mine and i'm at about 4k servers, tho i host a couple other things and such so i use other parts

#

@earnest phoenix ```html
<style>
.something {
color: #000000;
}
</style>

rest of your desc..

#

ew no

#

are you saying you can host a 4k bot on glitch

earnest phoenix
#

@sick cloud Can you tell me something how to change the page's background

sick cloud
#

body

#

edit that

earnest phoenix
#

any examples?

sick cloud
#
body {
    css here
}
keen drift
#

I think I'm paying $40 atm

earnest phoenix
#

ok thanks

keen drift
#

I have 45k guilds

#

@earnest phoenix

echo pumice
#

When showing usage for a command, how do you denote exclusive arguments

#

Like it has to be either or

earnest phoenix
#

should I do background-color:color; for example?

sick cloud
#

background: hex;

keen drift
#

either or?

#

I just give them a list

sick cloud
#

@echo pumice however you want lol

earnest phoenix
#

thanks

echo pumice
#

<mention> or <password>

keen drift
#

<mention/password>

#

?

echo pumice
#

Is there really no standard lol

#

Although I guess it's bad practice in JS to do things like that

sick cloud
#

its

#

text

#

i do <> for required, [] for optional, and {} for split

echo pumice
#

What do you mean by split

sick cloud
#

<name> [optional user] {mention | id | tag#0000}

echo pumice
#

Oh that's a good idea

sick cloud
#

split as in |

echo pumice
#

Thank you

#

Can I steal

sick cloud
#

sure

#

lol

echo pumice
#

How do you get a user from tag#0000

earnest phoenix
#

how can I change then buttons color? @sick cloud

sick cloud
#

learn css

#

use inspect element to find names

echo pumice
#

lol

sick cloud
#

edit

#

profit

echo pumice
#

What part of the user class gives you the discrim

earnest phoenix
#

ok

sick cloud
#

uh

earnest phoenix
#

Thank you so much for the answers! Although my bot doesn’t have that much servers I’m actually terrified about how much it cost to pay for that much of servers

sick cloud
#

isnt that plain obvious

echo pumice
#

Idk

sick cloud
#

@earnest phoenix just be more weary bout cpu and mem usage

earnest phoenix
#

does the donations covers at least some of the costs?

sick cloud
#

if you get them

#

lmao

#

i get $0 from any of my projects

earnest phoenix
#

if you guys receive donations

sick cloud
#

never got a single dollar

echo pumice
#

Oh I'm dumb

#

I literally can't read documentation

earnest phoenix
#

$25 is a bit of money for a month ahah

#

But you’re hosting other things too

sick cloud
#

5gb ram

echo pumice
#

Why is discriminator a string

sick cloud
#

why wouldnt it be?

echo pumice
#

I honestly don't know what it exactly is

#

The documentation is somehow descriptive yet vague

#

And I'm too lazy to put it in my code to figure it out lol

coral trellis
#
  if (typeof thisArg !== 'undefined') fn = fn.bind(thisArg);
                                                ^

TypeError: fn.bind is not a function```
#

Anyone know how to fix that?

echo pumice
#

That's... odd

#

Why not use arrow functions for that

coral trellis
#

Nvm fixed it

echo pumice
#

Actually I don't understand JS enough to give help

coral trellis
#

I found the issue

bright spear
#

What is it?

echo pumice
#

What was it? In case it ever happens to me

#

I've had some rough times with recursive binding already

bright spear
#

I've gotten fn.bind issues before even though I didn't use fb.bind

coral trellis
#

Nah I was trying to use a function for the wrong library

echo pumice
#

Before I discovered the wonders of arrow functions

coral trellis
#

So when it tried to run that it just was like the heck you doin

echo pumice
#

Oh it was undefined.bind

#

lol

sick cloud
#

yes what the heck are you doin xig

coral trellis
#

Being a dumb ass 😩

earnest phoenix
#

Can somebody tell me why does this dont work?

div.logdescription {
  background: #6666ff;
 }
#

oh nvm I typed the long desc wrong

keen drift
#

@earnest phoenix Patreon is covering all my cost atm

earnest phoenix
#

thank you for the answers ^^ last question, would anyone have any general advices for bot going through 1000 servers? Should sharding be early or wait until the bot reaches 2500? Thank you!

keen drift
#

Early, way early

#

I started to shard around 200 guilds

#

By the time you get to 2500, you have too much to deal with and not enough time to write, test and deploy things

#

My bot exploded around 1k guild

#

but thank god I had sharding implemented early

winged shell
#

how to like make the css in the bot description have a lil animation

languid dragon
#

animation: name;

#

@key-frames name {}

sick cloud
#

anyone able to help with my leaderboard? it won't work at all lol

        const bakeries = await msg.client.r.table('bakeries').orderBy('current.bread').limit(10);

        const top = bakeries.sort((a, b) => b.current.bread - a.current.bread).splice(0, 10);
        
        const embed = new MessageEmbed()
        .setTitle(`Best bakeries`)
        .setDescription(`Showing the top 10 users with the most bread globally.\n
        ${bakeries.map(b => `${bakeries.indexOf(b) + 1}. ${b.nickname ? `"${b.nickname}" (${msg.client.users.get(b.id).username || msg.client.users.fetch(b.id).username})` : `Unnamed Bakery (${msg.client.users.get(b.id).username || msg.client.users.fetch(b.id).username})`}, ${b.multiplier}x with **${b.current.bread} bread** 🍞.`)}`)

        return msg.channel.send({ embed: embed });
keen drift
#

Provide a dump of bakeries

sick cloud
#

its an array of objects

#

sec

#

@keen drift thats whats in the db rn

#

fixed it

jagged plume
#

nice

coral trellis
#
                ^

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.```
#

Am I retarded or smth

jagged plume
#

is the content empty

coral trellis
#

No cause it sends the message

jagged plume
coral trellis
#

It literally sends the edited messages in the channel and then it crashes

sick cloud
#

add a fallback

coral trellis
sick cloud
#

oldContent || 'None'
newContent || 'None'

jagged plume
#

oh

#

is it reacting to its own message

#

the embed is sent with no message content

#

?

sick cloud
#

thats it probably

coral trellis
#

Yes it is

jagged plume
#

since when did it send a message update though

jagged plume
#

discord.js mmLol

coral trellis
#

Well I just added a check

#

Lets see if that even fixes it

#

Yes it did think

jagged plume
#

lmao

coral trellis
#

Thanks

jagged plume
earnest phoenix
#

@coral trellis help me

#

how do u shard

coral trellis
#

😩

lament meteor
earnest phoenix
#

im confused

sinful lotus
#

@earnest phoenix just make a sharding file and put ur bot main file there

#

thats it

quartz kindle
#

console.log ascii art

#

noice

shadow dust
knotty steeple
#

@keen drift not bin

#

you can set it to true or false to say the package has to be installed globally to work or not

#

its preferGlobal but its depreciated GWqlabsMmSad

earnest phoenix
#
icon_url=ctx.author.avatar_url

if this image for author that sending the command, how i can change it that it will be the bot image?

#

ctx.me.avatar_url?

#

@earnest phoenix ctx its not bot

#
icon_url=bot.user.avatar_url)
#

I thought it was an alias for ctx.bot.user

ruby dust
#

it doesn't need context to find itself

#

especially if it's just a user object

lofty hamlet
#

Hi !

#

Cna you help me ?

sick cloud
#

@lofty hamlet read the channel topic smh

#

what doesn't make sense in "don't ask to ask"

lofty hamlet
#

My code

#

So :

#

I want this to be a message from all trainers

#

@sick cloud

sick cloud
#

then do that

lofty hamlet
#

Do what?

#

@sick cloud ?

sick cloud
#

code

lofty hamlet
#

I can not do it

#

It does not work because it's just for the server or the person makes the message

#

Can you help me or no @sick cloud ?

mossy vine
#

stpo tagging him lol

sick cloud
#

^

#

no tho

#

because your confusing

lofty hamlet
#

...

#

I confuse wath ?

#

Who can help me ?

#

I have trying : bot.guilds.members.map but he don't work

#

guilds.members.map

#

As well

#

Nothing works

knotty steeple
#

speak ur native language

lofty hamlet
#

Why ?

knotty steeple
#

no one understands what you are trying to say

lofty hamlet
#

So :

#

My code

#

A top of trainers but he send a top of trainer the server but i want send the all top of trainers

#

Not only discord where the personn is

#

You understand ? @knotty steeple

mossy vine
#

whats your native language?

lofty hamlet
#

French

#

You don't understand ? ???

shadow dust
#

Non

mossy vine
#

no

lofty hamlet
#

Tu es francais ?

#

Earu ?

shadow dust
#

Ouais

lofty hamlet
#

Tu peux m'aider ?

shadow dust
#

not here

lofty hamlet
#

Ah

#

Sa prend juste deux min

shadow dust
#

I don't JS

lofty hamlet
#

Ah

#

Nobody can help me ?

lament meteor
#

i can help

#

sorry but i do not seem to undersand what you need

west raptor
#

no bad screenshot wait

#

also undefined while trying to log it

#

you know what ignore all of that im really dumb

earnest phoenix
#

i only know two of them

#

so

#

TFW memory leak

#

25gb

knotty steeple
#

does npm have an api?

#

to find info about a module

earnest phoenix
#

soo ehm...

Bot(s)Owner|Callumok2004Today at 10:37 PM
--eval client.message.send("test")
[--] CatManiaBot 🐱BOTToday at 10:37 PM
TypeError: Cannot read property 'send' of undefined

this happened out of nowhere, no code edits, and this was caused

knotty steeple
#

look at ur code

#

client.message

earnest phoenix
#

ye?

#

o

latent peak
#

So...how does this work and all?

zealous veldt
#

Why do you need client options?

#

It's just JSON is it not?

opaque eagle
knotty steeple
#

is it on the home page?

earnest phoenix
#

would this enmap thing work to fetch something in the enmap sqlite file

const Enmapguildsdb = global.Enmap.fetch('Enmapguildsdb')
opaque eagle
#

I'd be surprised if anyone here actually used Enmap...

#

It's very basic and limited

topaz fjord
#

use a real db

knotty steeple
#

enmap is just new Map() "but better"

hollow fulcrum
#
    command_prefix=async getPreRaw(None, True),
                                 ^
SyntaxError: invalid syntax
#

What am I doing wrong?

#
 = Bot(
    description="UltraBot, a bot which works 90% of the time",
    command_prefix=async getPreRaw(None,True),
    case_insensitive=True
    )```
knotty steeple
#

im sure you cant put async there

hollow fulcrum
#

preRaw is an async function

#

oh wait

#

its await

#

🤦

#

but it still errors

#
 = Bot(
    description="UltraBot, a bot which works 90% of the time",
    command_prefix=await getPreRaw(None,True),
    case_insensitive=True
    )```
zealous veldt
#

lul

hollow fulcrum
#
TypeError: command_prefix must be plain string, iterable of strings, or callable returning either of these, not coroutine
``` In the examples in VSCode, this is how they do it
slender thistle
#

What the hell is getPreRaw

#

Don't await it btw

earnest phoenix
#

tell me how this means ive no perms

if (!message.member.hasPermission("MANAGE_MESSAGES") || message.author.id !== ownerID) return;
hollow fulcrum
#

how this means?

#

clarify please

earnest phoenix
#

my bot says ive no perms when my id is the ownerID

slender thistle
#

my bot says ive no perms
Nothing in the code snippet above says that the bot is supposed to say anything if you don't have perms

earnest phoenix
#

i know, i removed that so from the above because its a full embed

hollow fulcrum
#

What is ownerID?

earnest phoenix
#

231699100721086464

#

my id

hollow fulcrum
#

is it a string or an int

slender thistle
#

Are IDs strings in DJS thonkpeek

earnest phoenix
#

its in a config file which is defined

#

const {prefix, PREFIX, footer, owner, ownerID} = require('../../settings/config.json')

slender thistle
#

Uhhh

hollow fulcrum
#

Thats no help

slender thistle
#

Do you wrap it around " or `

earnest phoenix
#

""

west raptor
#

@earnest phoenix we've went over this before...

#

do we need to again

earnest phoenix
#

yup

west raptor
#

replace the || with &&

slender thistle
#

have went is wrong
have gone is not wrong
:^)

earnest phoenix
#

@west raptor u know, we have gone true this, and if i put && then both must be true

west raptor
#

no

earnest phoenix
#

yes

slender thistle
#

&& - and
|| - or

earnest phoenix
#

i know

#

i want it to be or

west raptor
#

@slender thistle yea no shit but look at his logic

earnest phoenix
#

ill try

slender thistle
#

What's wrong there tho

earnest phoenix
#

and u will be wrong

west raptor
#

he is basically saying if x does not have y OR x does not have y return

#

wait

earnest phoenix
#

wait what

west raptor
#

wait wait

earnest phoenix
#

makes no sense how & even worked

#

but th

#

x

west raptor
#

yw

#

basically if either returns true it returns

earnest phoenix
#

would i have to do same with this

    if (message.content.indexOf(config.prefix) !== 0 || (message.content.indexOf(prefix) !== 0|| message.content.startsWith("<@>"))) return;
#

dont think i will, cause i think it might be working

slender thistle
#

message.content.startsWith("<@>")

#

That's uh

#

Literally <@>

earnest phoenix
#

i know, i didnt add it yet, just did

#

the id is added now, but why does it not do anything when i ping bot in message

#

it has a space after aswell, made sure i added that in code

#

and i evaled message.channel.send('@heavy thistle') but it did not send that

quasi hearth
#

I think the reason it doesnt do anything when you use that id is because your code returns when that user id is used. If you want it to run for that user, you need to use !message.content.startsWith("@heavy thistle") or something.

thin loom
#

or .includes

earnest phoenix
#

anyone got a clue why its doin this?

#

same part S EVERY COMMAND HAS, YET ON THIS ONE ITS DECIDING NOT TO LIKE IT...

#

sos for caps (caps lock)

knotty steeple
#

can u post ur code?

earnest phoenix
#
const Discord = require("discord.js")

module.exports.run = async (client, msg, args) => {
    
    if (!args[0]) return;
    if (args[0] === "reportbug") return message.reply("Please specify the bug. Example:\n`gs!ping isn't working. It isn't responding with anything.`");
    args = args.join(" ");
    message.reply("Thanks for submitting a bug!");
    const content = `**${message.author.username}#${message.author.discriminator}** (${message.author.id}) reported:\n~~--------------------------------~~\n${args}\n~~--------------------------------~~\nOn the server: **${message.guild.name}**\nServer ID: **${message.guild.id}**`;
    client.channels.get('513318399518965770').send(`${content}`);

}

module.exports.help = {
    name: "reportbug"
}
#

@knotty steeple

knotty steeple
#

weird

earnest phoenix
#

ikr

#
const Discord = require("discord.js")

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


    msg.channel.sendMessage(`:game_die: **${msg.author.username}**, you rolled a **${Math.floor(Math.random() * 6) + 1}**!`);
    
}

module.exports.help = {
    name: "roll"
}
#

cos this is one of the others

knotty steeple
#

and also

#

you dont have message defined

earnest phoenix
#

i do

#

its defined in the main.js

knotty steeple
#

in exports its msg

earnest phoenix
#

yes

knotty steeple
#

so you use that

earnest phoenix
#

?

#

oh wait yeh

knotty steeple
#

and sendMessage is depreciated

earnest phoenix
#

i see what u mean, but that shouldn't affect it?

knotty steeple
#

idk

quartz kindle
#

whats on line 167?

earnest phoenix
#

there isnt a line 167?

#

oh wait

tight heath
#

what kinda framework is that

#

it hurts my eyes

knotty steeple
#

wym

earnest phoenix
#

think ive found the issue XD

tight heath
#

mmmyes

earnest phoenix
#

just my tired ass misreading it

knotty steeple
#

cool

#

also

tight heath
#

such pain

knotty steeple
#

dont use heroku

#

pls

earnest phoenix
#

why?

#

@knotty steeple

tight heath
#
send([
    'multi',
    'line',
    'string'
].join('\n'));
#

looks cleaner imo

knotty steeple
#

raven

tight heath
#

yes

knotty steeple
#

u have reason to not use heroku

tight heath
#

true

#

don't use heroku

earnest phoenix
#

why not?

tight heath
#

don't

earnest phoenix
#

that isnt a reason tho?

knotty steeple
#

ur gonna have to pay eventually

earnest phoenix
#

yes, but for now its fine

tight heath
#

I'd rather selfhost than use Heroku no lie

earnest phoenix
#

it aint the best, but it does me for now until i can sort some ood hosting out

tight heath
#

mmm

knotty steeple
#

galaxygate exists

tight heath
#

DO starts at 5$/month and I got 10$ free credit just click this link

#

lmao

#

noone actually uses my referrals smh

echo pumice
#

What about C9

tight heath
#

except one person

#

on Hacktober

#

where it was 100$

#

actually got some rev

echo pumice
#

Is AWS okay for temporary hosting

tight heath
#

yes

echo pumice
#

Doesn't AWS have the longest free trial

#

Out of every paid service

knotty steeple
#

there are good reasons

tight heath
#

I mean I don't pay for my hosting

#

so

#

¯_(ツ)_/¯

#

so I COULD use Heroku

quartz kindle
#

anyone tried hetzner? im thinking about trying it out

earnest phoenix
#

Voice wasnt working on it

#

Afaik

#

Idk if they fixed it or not

tight heath
#

@quartz kindle didn't they have an argument with Discord about some shit?

#

or is it resolved now

earnest phoenix
#

Yeah

#

They had

quartz kindle
#

i have no idea

earnest phoenix
#

But I recommend you using vultr or digitalocean

quartz kindle
#

rip

tight heath
#

official statement

quartz kindle
#

Update: Hetzner has reached out to us and we hope to have the issue resolved soon. For now we have lifted the API level IP ban, however the ban from our voice infrastructure still remains.

#

idk when is this from tho

tight heath
#

1y ago

quartz kindle
#

apparently its still blocked

#

and not gonna be unblocked

#

rip hetzner i guess

quartz kindle
#

what about scaleway? anyone has experience with them?

heady zinc
#

yes

#

don't use scaleway

#

it's cheap but for a reason, they use atoms mm

#

absolutely unusable

inner jewel
#

i've been running a music bot there for months

#

no issues with cpu

keen drift
#

I use Hetzner cause no music is needed

heady zinc
#

that's because nobody uses atlanta natan

inner jewel
#

we're running some mantaro audio nodes in scaleway too

#

when we move to andesite

heady zinc
#

self-promotion smh banned

#

lavalink ftw

quartz kindle
#

wait, hetzner is working? its just the music that doesnt work?

#

then i guess i'll still go for hetzner

heady zinc
#

yeah some bots that don't have voice features are hosted on hetzner

#

though it's ridiculous that hetzner is still blacklisted

keen drift
#

Yeah only voice is blocked

quartz kindle
#

what about vpsdime?

#

apparently they offer 4cpus, 6gb ram and 30gb ssd for 7$/mo?

knotty steeple
#

galaxygate

#

smh

quartz kindle
#

yeah yeah, im just researching xd

#

btw is kvm worth the price difference?

knotty steeple
#

idk

echo pumice
#

How do I get a username from a user id

bright spear
#

@echo pumice whenever you ask a question say what lib you're using

tight heath
#

fetch the user

echo pumice
#

discord.js,sorry

knotty steeple
#

get the user

echo pumice
#

I don't really understand how you do that

#

Wait

#

Actually I still don't know

quartz kindle
#

do you know how a js Map works?

earnest phoenix
#

yeah @quartz kindle

echo pumice
#

No...

quartz kindle
#

discord.js's client contains a Map (also called a collection) called users

echo pumice
#

Oh

#

Okay thanks

empty owl
#

@echo pumice message.author.username or message.author.user.username

#

Try both I forgot

#

I’m on mobile so I can’t look at my code

echo pumice
#

It's message.author.username but that only gets me the username of the person who sent the message, which I don't care about

empty owl
#

ok

#

I got u

echo pumice
#

I think I figured it out thougm

earnest phoenix
#

client.users.get(id).username

echo pumice
#

Yeah that's what I did

earnest phoenix
#

good boi

empty owl
#

message.mention.members.username

echo pumice
#

Well I did nickname

empty owl
#

U could of done that

echo pumice
#

It's not from a message anymore

empty owl
#

10x easier

#

oh

#

Well

#

U can take the user id then get the username

topaz fjord
#

@empty owl message.mention.members.username wont work

empty owl
#

Well then look up the documentation

topaz fjord
#

message has no property mention

earnest phoenix
#

yes

#

it's mentions

#

and members is a collection

topaz fjord
#

well you would have to do

earnest phoenix
#

and i dont think a member has a username prop

bright spear
#

message.mentions.users[0].username iirc

topaz fjord
#

message.mentions.users.first().username

earnest phoenix
#

yeah

bright spear
#

oh

earnest phoenix
#

users is a collection not an array

topaz fjord
#

or replace .users with .members if you want the user as a guildmember

empty owl
#

!djs mentions

bright spear
#

wot

knotty steeple
#

is there a way to set a timeout when that timeout is done set another timeout and go on

#

without stacking

quartz kindle
#

like setTimeout({},200) -> setTimeout({},200) instead of setTimeout({},200) -> setTimeout({},400) ?

knotty steeple
#

eh kinda

quartz kindle
#

your best bet is probably a callback or recursive function

#
function timeout() {
    //dothings
    setTimeout(function(){ timeout() },200)
}```
knotty steeple
#

smh

earnest phoenix
#

setInterval?

keen drift
#

yeah setInterval

earnest phoenix
#

@keen drift do you know html?

#

I figured it out

#

Nvm

#

I had to use a <insert>

keen drift
earnest phoenix
#

Sorry

#

I had a problem with aligning

bright spear
#

dont mention random people for help

#

or any people

desert slate
#

I feel dumb for asking this, but how does one add text color into the bot program, where it spits out used commands?

earnest phoenix
#

Can someone tell me how can I get rid of the box shadow of the pfp of the bot in DBL?

knotty steeple
#

what do you think

#

set box shadow to none

brittle nova
#

@desert slate what?

earnest phoenix
#

@knotty steeple yea

desert slate
brittle nova
#

you want to add color to console?

desert slate
#

Yep.

#

But I don't remember how.

brittle nova
#

idk how to do that with your lang

keen drift
#

which lang

desert slate
#

Rip.

#

C#.

brittle nova
#

try searching "change console text color in c#" or something lol

desert slate
#

Yeah, now I remember I can do that, but it's been about a year since I did so I don't remember.

keen drift
#

System package has Console in which you can set color upon

#

It's basically a wrapper to prepend in accordance to ascii escape code

desert slate
#

I don't remember using wrappers when I made my 8 Ball? think2

keen drift
#

System's console color is a higher abstraction for underneath escape codes

#

aka a wrapper

desert slate
#

Ohhh.

#

Oh it's er.

#

Fore/back ground color. Duh.

#

Yep. It was that.

keen drift
#

Colors are standardized across pretty much all platforms with their escape sequence

#

Which is suppose be intercepted by your terminal

desert slate
#

True. Thanks for the help.

#

I swear I'm getting dumber by the day.

#

First I can't realize where to write the log even though I stare at it for two days trying to think of how to do it and then I forget how to write colors.

keen drift
#

There are plenty of packages for logging as well

desert slate
#

Mmf, for what I was after, I got it. Looks real nice right now imo.

zealous veldt
brittle nova
#

why

earnest phoenix
#

Ok

#

So I have this

#

<!DOCTYPEhtml> <!--Written in Html--> <html> <head><insert align="center"> <p><h2> <!--Nerf Bastian--> TikTok Memes</h2></p></head> <body> <p align="center">Me: Is it May Sir?</p> <p align="center"><p>Boss: I'm already tracer</p></body> <hr> <body><p>Me: Can I have a tray, sir? <p align="center">Him: I'm already Tracer</p></body> <hr> <body> <p>Police: Get them with the taser</p> <p>Me: I'm already Tracer</p> <hr> <body><p>Him: I got an Acer</p> <p align="center"><p>Me: I'm already Tracer</p></body> <hr> <body><p align="center">Her:Chase her!</p> <p align="center">Employee: I'm already tracer</p> </body> <a href="https://cdn.discordapp.com/attachments/199895251735805953/515431805936074767/image.jpg">Click Me!</a> <!--T series Is almost ahead of pewdiepie-->

#

And I'm so happy

brittle nova
#

codeblocks

#

please

earnest phoenix
#

Sorry

brittle nova
#

`

html code

`

#

like that

earnest phoenix
#

why are you putting <p> in the head code

#

that’s not where it goes

brittle nova
#

lol you actually bothered to read that code in single ticks

earnest phoenix
#

it doesn’t look too bad on mobile

brittle nova
#

If I have something like:```html
<div class="categories">
<div id="x-category">
<!-- content -->
</div>
<div class="hidden" id="y-category">
<!-- content -->
</div>
</div>

How can I (in jQuery) make it so if you click a tab (just a ul with <a>s), the category corresponding with the tab's `hidden` class gets toggled?
quartz kindle
#

if you just want to toggle the hidden fields (ie: have more than one open at a time):

$(".categories").find("#y-category").toggleClass("hidden")```
if you only want one open at a time: ```js
$(".categories > div").addClass("hidden");
$(".categories").find("#y-category").removeClass("hidden")```
brittle nova
#

I want to be able to do this with any category though

#

there will be more than 1

#

I mean 2

quartz kindle
#

get the category from the click listener using this

ivory marlin
#

hey guys relatively new to the JavaScript language, I created my own class in a .js file and in another .js file say const x = new Team(); Team is the class I created yet I am receiving a Team not defined error. i am using node. Is there a special thing to allowing class access?

quartz kindle
#

something like js $(".something").on("click",function(){ $(".categories").find($(this).attr("id")).toggleClass("hidden") })

#

@ivory marlin how did you connect both files?

knotty steeple
#

did you do const Team = require("blah")

ivory marlin
#

I tried to just write require('team.js') in the new .js file

quartz kindle
#

you need both require in one file and module.exports in the other file

ivory marlin
#

the require statement is it as simple as just writing require(pathfile);?

#

im used to java import

quartz kindle
#

yeah

ivory marlin
#

So to get the file on the right to gain access to the file on the left should just need a require('team.js') ?

#

ignore x.announceName(message) forgot to delete it

topaz fjord
#

const Team = require('path to file')

brittle nova
#
$(document).ready(function () {
    $(".tabs").click("a", function () {
        $("li .is-active").removeClass("is-active");
        $(this).parent().addClass("is-active");
    });
});
``` no classes are changing, why is that?
earnest phoenix
#

Can someone tell me is there a way to move the bot's pfp to another place in DBL?

zealous veldt
#

What do you mean? Moving it on the bot page?

earnest phoenix
#

I sized the bot's pfp a little bit and it stick on the side. I would like to move it to the middle.

keen drift
#

So styling it?

#

@brittle nova first make sure $("li .is-active") actually returns a dom element

zealous veldt
#

@earnest phoenix Yeah, use CSS like you already are

earnest phoenix
#

ok but is their a way to use CSS to change the img position?

zealous veldt
#

Yeah

#

You can probably use the position tag iirc

#

I'm not very good with CSS

earnest phoenix
#

ok Imma got search to see how to use the position tag

west raptor
#

position: center or something like that

#

left, right, etc

earnest phoenix
#

It dont work

brittle nova
#

@keen drift ```
ƒ (e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])

#

theres more

keen drift
#

wtf am I looking at

zealous veldt
#

lmfao yeah what is that

keen drift
#

do I look like a machine to you

zealous veldt
#

yes nope

brittle nova
#

thats what it logs to

#

¯_(ツ)_/¯

west raptor
#

beautify it at least pls

brittle nova
#

console.log($("li .is-active"));

topaz fjord
#

for those who like their eyes

#

I beautified it for you

west raptor
#

thank

earnest phoenix
#

How can I remove the border of the bot's PFP?

keen drift
#

heck I haven't use jquery in a minute

#

let me check

#

u wanna link me ur site

brittle nova
#

sure

#

localhost:8080

#

omega lul

keen drift
#

👏

zealous veldt
#

gotem

topaz fjord
#

@earnest phoenix

.columns .bot-img {
    box-shadow: none !important
}
earnest phoenix
#

ok thanks

brittle nova
#

is $("element .class") not how you select an element and class?

keen drift
#

it's

topaz fjord
#

lmao

brittle nova
#

doesn't work in w3 for me 🤔

topaz fjord
#

hey fishy

brittle nova
#

Tryit Editor™

topaz fjord
#

do you know how to do regex in go

keen drift
#

yeah

#

I forgot how to get it to highlight the element with jquery

#

I could do it with document.querySelector not jquery

brittle nova
#

I removed the space and it worked on the editor

#

lol

topaz fjord
#
src := "@barren island ping"
re := regexp.MustCompile(`^<[@!?]{1,2}361657857223163925>\s?$`)
``` how 2 replace `@barren island ` with nothing
brittle nova
#

$('element.class')

keen drift
#

do you really need regex for that

topaz fjord
#

I use it to check the @! @? @ in the mention

keen drift
#

^(?:<@!?)?([0-9]+)>?$

#

are you doing fixed userid?

topaz fjord
#

yes by fixed user id

keen drift
#

That regex already works right?

topaz fjord
#

ye it does

brittle nova
#

@?

#

what

topaz fjord
#

I get the regex part but idk how to get rid of the mention in the message

brittle nova
#

I thought mentions were only @ or @!

keen drift
#

replaced := re.ReplaceAll(src, []byte(""))

west raptor
#

@brittle nova its different on certain platforms I think

#

iirc

#

I might be wrong

topaz fjord
#

If this works im committing fishy

keen drift
topaz fjord
#

yea no

#

it didnt work

#

wait

#

shit

keen drift
#

try the updated

topaz fjord
#

forgot to change the regex

keen drift
#

or you can use the string version

topaz fjord
#

still

#

both dont want to work

keen drift
#

did you check for match first

topaz fjord
#

I changed it to yours

zealous veldt
#

lul ok

keen drift
#

remove the position assertion

#

My is designed for single arg parsing

topaz fjord
#

so remove the \s?

keen drift
#

(?:<@!?)?([0-9]+)>?

earnest phoenix
#
@keyframes imgfloat {
    0% {
        transform: translatey(10px);
    }
    50% {
        transform: translatey(-20px);
    }
    100% {
        transform: translatey(10px);
    } 
}

.bot-img > img { 
    box-shadow: none; !important
    transform: translatey(0px);
    animation: imgfloat 3s ease-in-out infinite;
    width: 260px;
    height: 260px;
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
    position: absolute;
``` The box shadow still exist. Please help me.
keen drift
#

Also you may not need the greedy modifier

zealous veldt
#

regex is neat scary

topaz fjord
#

oh I see

#

it works

#

thanks

keen drift
#

this reminds I gotta fix some shit

zealous veldt
keen drift
#

@brittle nova @west raptor to explain it more, @!? the ? is the quantifier or greedy flag in regex

#

there's only @ and @! for user ping

west raptor
#

o

brittle nova
#

k

brittle nova
#
 <div class="modules">
                <div id="home-module">
                    <p>thing</p>
                </div>
                <div id="home2-module" class="hidden">
                    <p>thing2</p>
                </div>
            </div>
``` How can I select modules that are not hidden without selecting .modules?
keen drift
#

i'm not certain if that's possible with css selectors

earnest phoenix
#
@keyframes imgfloat {
    0% {
        transform: translatey(10px);
    }
    50% {
        transform: translatey(-20px);
    }
    100% { 
        transform: translatey(10px);
    } 
}
  .bot-img > img {
    box-shadow: 0 0px 0px 0px rgba(0, 0, 0, 0.6);
    transform: translatey(0px);
    animation: imgfloat 3s ease-in-out infinite;
    width: 260px;
    height: 260px;
    position: absolute;
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
}
``` Is there an error in this code? Because the box shadow wont go away.
keen drift
#

@brittle nova you could try this perhaps: div[id]:not(.hidden)

#

that's a very vague query, it's prob going to match more than one

keen drift
#

@earnest phoenix box-shadow: none !important;

earnest phoenix
#

@keen drift It dont work. Should I put it in the <style> part or <script> part?

keen drift
#

style

#

you don't have access to script

#

nor do you need it

earnest phoenix
#

Should I post the entire css for you to check?

keen drift
#

for me to check SWEATSTINY ?

#

does it work

earnest phoenix
#

check is there any error?

keen drift
#

well check if works

#

then you'll know if there's error

#

I'm not a machine

earnest phoenix
#

is there a console thing that will upload the errors?

keen drift
#

no

#

just check for visual appearance

earnest phoenix
#

ok

#

Well I saw a syntax error, it says "Unexpected indentifier" on 477614216409514014:123.

keen drift
#

where

earnest phoenix
#

in the console section of inspect?

keen drift
#

can you link me your bot page

earnest phoenix
keen drift
#

sec

earnest phoenix
#

k

keen drift
#

oh yeah, you can ignore that

earnest phoenix
#

the syntax error?

keen drift
#

yeah

earnest phoenix
#

So, should I just leave the box shadow there or ask somebody else to help me with getting rid the box-shadow

keen drift
#

did you use the code I gave?

#

in the style right?

earnest phoenix
#

yes

keen drift
#

use

#
.columns .bot-img {
      box-shadow: none !important;
  }
#

or remove the children tag >

#

¯_(ツ)_/¯

earnest phoenix
#

It works now, thanks @keen drift.

potent anchor
#

i had a question

#

i was making a translate

#

commnad

#

for my bot

#

im using node.js

#

discord.js lib

#

and how will i make it to translate for languages

#

like for more than one language

#

i want it to be like this .gtranslate hello -pt

#

but how will i do it

#

please tag me if anyone can help

soft plaza
potent anchor
#

no

soft plaza
#

Then what do you want

potent anchor
#

if i want it

#

like how will i make the command work for any language

#

like the person can choose his language

soft plaza
#

Omg did you read the package info

potent anchor
#

@soft plaza im not using that package

#

im using anothe rone

#

i dont want packages

#

im asking how will u make the command

#

so that ppl can choose their languages

#

not in console

#
example 
` .gtranslate hello -pt` 


//output will be ola

other example

`.gtranslate hello -es`

// output hola```
soft plaza
#

Don't understand what you want dude. The package literally has every thing you are looking for

potent anchor
#

@soft plaza do u have a bot ?

soft plaza
#

You juste use the command argument as the language parameter

#

Yes

potent anchor
#

dude

#

u still didnt understand

soft plaza
#

Why is your native language

#

What*

keen drift
#

Don't understand what

#

I'm seeing it from Vanerac's pov

potent anchor
#

what im trying to say

#

i gave an example to how its should be

#

how can i do it like that

keen drift
#

just parse the second argument?

#

is it that hard

soft plaza
#

I think he doesn't want to use the package but I don't understand why

keen drift
#

apparently he's using another one

#

and he's apparently having trouble parsing args

potent anchor
#

im using another one

#

yes

#

@keen drift

soft plaza
#

What's the name then

keen drift
#

just split space

potent anchor
#

im having trouble with parsing

keen drift
#

retrieve second index

void mantle
keen drift
#

you never even show us any code to how you are handling it now

potent anchor
#

im using js "translate"

#

@soft plaza

soft plaza
keen drift
#

this one

potent anchor
#
      if (message.content.startsWith(prefix + 'translate')) {
     if (message.author.bot) return;
      translate.key = process.env.TRANSLATE_KEY;
      let args = message.content.split(' ').slice(1);
    let reason = args.join(' ');
         if(!reason)
         return message.channel.send(`**..**`)
    translate(`${reason}`, 
    { 
    to: 'es', 
     engine: 'hidden', 
     key: process.env.TRANSLATE_KEY }).then(text => {
  message.channel.send(text); 
});```
#

no

#

@keen drift

#

wait

keen drift
#

stop

#

pinging

#

me

#

i have things to do

potent anchor
keen drift
#

that's literally the same package

#

as the one I linked

potent anchor
#

oh sorry idk

keen drift
#

args[1].substring(1)?

potent anchor
#

yeah ok

soft plaza
#

The wants `<command> <string to translate> <language>

keen drift
#

how the hell do you even read your own code

#

the indents, spacing doesn't even have any semantics to it

potent anchor
#

ik

#

its beacause

keen drift
#

great

potent anchor
#

and its messed up

#

but thanks for helping

bright spear
#

my spacing is bad cuz I use glitch
Glitch doesn't have anything to do with spacing

keen drift
#

@deft prism wow user account

#

same scope right blurryeyes

deft prism
#

no idea

keen drift
#

lmao

deft prism
#

i didn't run that bot

keen drift
#

it's two different things

raw wharf
#

Jimp or canvas? thonK

deft prism
#

all i think is where is discord.bat

#

lol

#

jk

#

that'd literally be hell for whoever had to make the library

inner jewel
#

bots can't have rich presence at all

#

if you send rich presence discord just ignorrs it for bots

#

i tried ™

tight heath
#

so sad

midnight widget
#

Anyone know what the css tag is for the background of the bot page

knotty steeple
#

body

#

lmao

midnight widget
#

can't find it tho

#

.body right?

knotty steeple
#

no

#

its a html tag

#

body

midnight widget
#

ffs

dense mist
#

oof whats an embedded message?

#

this makes no sense :/

hollow fulcrum
earnest phoenix
#

what

hollow fulcrum
#
            self.np = await self._channel.send(f'Now Playing: **{source.title}** requested by '
                                               f'**{source.requester}**')
            await self.next.wait()

            # Make sure the FFmpeg process is cleaned up.
            source.cleanup()
            self.current = None

            try:
                # We are no longer playing this song...
                await self.np.edit(content=f"The song **{source.title}** (requested by **{source.requester}**) is no longer being played.")```
#

i'm using eeviee's music cog

earnest phoenix
#

you have really good spacing

hollow fulcrum
#

thanks, blame the codeblock

earnest phoenix
#

is that python

hollow fulcrum
#

yes

earnest phoenix
hollow fulcrum
#

yes

#

it edits into that mess

#

And after a while, it changes back into what it should me

#

be

earnest phoenix
#

lol wha

#

Soo it isn't saying the name twice when it says song added to queue

#

try making a global variable and change the string of it to the source.title

#

and rather than having ${source.title} every time u want the song title ut the var

hollow fulcrum
#

k

#

st = str(source.title) st returns the proper title

#

await self.np.edit(content="**" + st + f"** requested by **{source.requester}** is no longer playing.") the title prints twice

#

k whats going on

potent anchor
#

im using node.js

#

how will i make it if the user

#

reacts to the bots reaction the bot will respond

knotty steeple
#

addMessageReaction event

#

i think thats what its called

earnest phoenix
#

hang on

tight heath
#

or just do

late hill
#

Depends on what library you use to connect to discord <.<

tight heath
#

msg.createReactionCollector

earnest phoenix
#

are you using discord.js?

tight heath
#

also depends on your version

potent anchor
#

yes

#

thanks

tight heath
#

Eris !== D.js stable !== D.js master !== D.io

late hill
#

If using discord.js you should use reactioncollector yes

earnest phoenix
#

tbh o

potent anchor
#

yes thank you

tight heath
#

:-)

knotty steeple
#

reaction collector

#

meh

tight heath
#

I mean

#

I wrote a bot which needed it

#

w/o knowing of its existence

#

so I also have my own reactionCollector class lmao

#

util/ReactionManager.js

amber junco
#

What vps do you recommend to host a bot?

mossy vine
#

read pins

trim saddle
#

@hollow fulcrum ffs use lavalink

hollow fulcrum
#

:screw: you

topaz fjord
#

But like honestly use it

signal saffron
#

If the user voted in DBL I would like to give him the role that has Upvoter, but I can't, can you help?

sick cloud
#

using webhooks

signal saffron
#

I want to do it in command

west raptor
#

webhooks would be easier and if it fails to give them it make a command for it

#

webhooks are faster aswell

signal saffron
#

ok thanks

earnest phoenix
#

``
npm ERR! path C:\Users\Administrator\Desktop\yvsYedek\node_modules.staging\hastebin-gen-7763b217\node_modules\snekfetch
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Administrator\Desktop\yvsYedek\node_modules.staging\hastebin-gen-7763b217\node_modules\snekfetch' -> 'C:\Users\Administrator\Desktop\yvsYedek\node_modules.staging\snekfetch-d4aff403'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2018-11-24T13_49_47_571Z-debug.log

C:\Users\Administrator\Desktop\yvsYedek>``

#

Where is hata

#

p!çevir en hata

#

p!cevir en hata

#

help me

#

I'm doing npm i discord.js, and eventually gives this error.

zenith moss
#

I think it means it can’t find the path

earnest phoenix
#

how to fix @zenith moss

zenith moss
#

Have you been able to install other libs?

earnest phoenix
#

Now @zenith moss

zenith moss
#

Yeah

earnest phoenix
#

?

zenith moss
#

Have you been able to install and other library’s?

earnest phoenix
#
[ WARNING ] [UNHANDLED REJECTION] DiscordAPIError: Missing Permissions
    at item.request.gen.end (E:\BotDevelopment\Rxiqi BETA\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:79:15)
    at then (E:\BotDevelopment\Rxiqi BETA\node_modules\discord.js\node_modules\snekfetch\src\index.js:215:21)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
``` I can't figure out where its coming from
zenith moss
#

What command are you running?

earnest phoenix
#

I'm uploading and joining all the libraries that are currently missing and working together ara

#

its not a command, its seconds after the bot loads up

#

ive disabled all events

zenith moss
#

Is your main files name Sequential.js?

earnest phoenix
#

no rxiqi.js

#

Problem fix 😃