#development

1 messages · Page 470 of 1

earnest phoenix
#

help my bot has an average ping of about 12,000 @earnest phoenix

#

yeah

steel drum
#

dude

#

ovh has 3.49 vpses

#

thats literally a part of most ppls lunch money

topaz fjord
#

lmfao

earnest phoenix
#

@topaz fjord help me

topaz fjord
#

DO has one for 2.50usd afaik

#

There's a pin in Dev for cheap vps

earnest phoenix
#

my bot has too high ping

steel drum
#

dont run a public bot if you're not gonna run it on a vps imo

earnest phoenix
#

I have 45p

topaz fjord
#

Get better internet @earnest phoenix

steel drum
#

what is a p

topaz fjord
#

That's how u fix it

earnest phoenix
#

If I didn't want to live in my room my bots ping would be better

#

p is pence aka british version of cents

#

45p= £0.45

knotty steeple
#

whats a module that i should use for making http requests in python

#

found requests but idk if i should use that

wide shale
#

¯_(ツ)_/¯

lone wraith
#

Don't use request

knotty steeple
#

then what do i use

solid cliff
#

aiohttp

lone wraith
#

^

knotty steeple
#

aiohttp 😩

#

well ok

solid cliff
#
async with aiohttp.ClientSession() as cs:
    async with cs.get("https://thonk.com/data.json") as r:
        res = await r.json()
print(res["data"])```
shell blade
#

Is there a way to enable cookies using cURL?

spring ember
#

for any of you using express and express-session. I have auth functions implemented (which are async).js api.post('/user', async (req, res) => { id = req.body.id password = req.body.password rememberMe = req.body.rememberMe const data = await auth.login(id, password) // await the login if (!data) { res.status(400).json({}) return } req.session.token = data.id // set the session if (!rememberMe) { req.session.cookie.maxAge = 900000 // shorten cookie life if session doesn't need to be remembered } res.json(data) // finally return the data })

#

this middleware is being called from the browser after the data returns, and as you can see the expires didn't update as well as the store itself is nowhere to be found

#

and no req.session.save and then to return the data in the callback doesn't work

earnest phoenix
#

im not super familiar with express, but if that middleware is async, wouldnt it run, but then immediately go on to the route?

#

what im saying is maybe you have some kind of race condition going on

spring ember
#

I also have this middleware before all of this and yes there is a race condtion and making it sync doesn't work eitherjs api.use('*', (req, res, next) => { Promise.resolve(next()).catch(next) })

earnest phoenix
#

ahh ok. 🤔

spring ember
#

as you can see the database did update but not in time

#

for the record I made everything sync again and used promises insread

earnest phoenix
#

Is there a way to embed the vote button for my bot into my website?

#

Didn't know what other channel to post this in

spring ember
#

umm can't you just redirect to your_bot_dbl_website/vote?

earnest phoenix
#

i want the actual button to be on the website i dont want the user to be directed to an external site

#

so like

#

no, and im guessing dbl also blocks iframing

#

so probably not

#

k

#

rip

spring ember
#

I think I will try and use passport

#

it looks way better than express-session and can be customized

whole helm
#

hello, can someone help me with this? i'm using node.js

let dom = (body, callback = () => {}) => jsdom.env(body, (err, window) => {
                                               ^

TypeError: jsdom.env is not a function
wide shale
#

jsdom.env is not a function

visual surge
#

djs
Is there any way to force users to cache or otherwide get an accurate number?

bright spear
#

you can add the member count of all servers but then you'd have to remove duplicates somehow

earnest phoenix
#

My friend told me to do ```Client.on('message', function(message){
if(message.content.startWith(prefix + "const cooldown = new Set();

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

const package = require("../package.json")

exports.run = (client, message) => {

let guild = message.guild;

// message.delete(3000);

var bpmb = client.ping;

var bpm = bpmb.toFixed()

let os = require("os");

var usageMb = process.memoryUsage().heapUsed / 1024 / 1024;

var usage = usageMb.toFixed(2);

/*

Cooldown for the command

*/

if (cooldown.has(message.author.id && message.guild.id))

return message.reply(This command have a cooldown of 5 **Minutes**); // this will check if the users is in the cooldown

cooldown.add(message.author.id && message.guild.id);

setTimeout(() => {

cooldown.delete(message.author.id && message.guild.id);

}, 300000);

/*

Fetch the client info and parse it into an embed

*/

const embed = new Discord.RichEmbed()

.setAuthor(${clieient.user.username} Info Below, client.user.displayAvatarURL)

.addField("❤ BPM", bpm, true)

.setThumbnail(client.user.displayAvatarURL)

.setColor(3118751)

.addField("MB usage", ${usage}MB, true)

.addField("Discord.js", ${Discord.version}, true)

.addField("ArsBot", ${package.version}, true)

.addField("npm", ${process.version}, true)

.addField("Users", ${client.users.size.toLocaleString()}, true)

// .addField("Bot Platforn:", os.process.platform(), true)

.addField("Click the emoji", [🤖](https://discordapp.com/oauth2/authorize?permissions=8&scope=bot&client_id=Bots client id), true)

.addField("Channels Overall", client.channels.size, true)

.addField("Guilds Overall", client.guilds.size, true);

message.channel.send({

embed

}).catch(e => logger.error(e))

};

module.exports.help = {

name: "botinfo"

}

Code for command

}
}")```

#

But it wont work

visual surge
#

You need to be more specific xD

#

"it wont work" doesn't tell us anything

knotty steeple
#

that code is very wrong

#

just

#

very very bad

earnest phoenix
#

Well i put it in and saved it amd it did nothing so i can't be more specific than that

knotty steeple
#
  1. if(message.content.startWith(prefix + "const cooldown = new Set(); what
  2. u have a message evnt but using module.exports
  3. logger isnt defined
earnest phoenix
#

The command he found on GitHub

visual surge
#

Hahaha I didn't even read the code, that's horrible

wide shale
#

this looks borrowed...

stone hinge
#

@neon schooner why my bot is muted?

neon schooner
#

Because it responds without prefix.

bright spear
stone hinge
#

Ohh.

#

@neon schooner Thank you , i will make up the problem, after making how can i repair it? Can I apply to you ?

#

Do I have to apply to you*

neon schooner
#

You can poke any of us, but I will be gone in ~30 minutes.

stone hinge
#

Okey thank you.

bright spear
#

@earnest phoenix you shouldnt need sharding at 800 servers

#

if your bot isnt responding its a code issue

earnest phoenix
#

Its only in my server so far

#

I dont know about other servers

bright spear
#

check the console for errors?

earnest phoenix
#

No errors

#

it says I used the command but no error

sick iron
#

Did you mess with the bots permissions in your guild?

#

or someone else?

earnest phoenix
#

No.

bright spear
#

any errors?

earnest phoenix
#

Alright I think I might be retarded, So I must have change my prefix and completely forgot, Just disregard what I said. Sorry.

bright spear
#

lol its ok

sick iron
#

Happens to the best of us

bright spear
#

js is a lang

earnest phoenix
#

Are you saying you wanna learn js or..?

#

ah

#

ok

#

I'll dm you

small wagon
#

recommend you to use codecademy @earnest phoenix

glossy talon
#

@smoky spire What do you mean by trash paramater

smoky spire
#

It’s so that the link is different every time so it can’t rely on cache

#

@glossy talon

shell blade
#

Is anyone familiar with the curl-request NPM package?

buoyant snow
#

.

earnest phoenix
earnest phoenix
shy rose
#

thats a great time unit

earnest phoenix
#

ikr

#

started getting msgs at 5am that music broke

#

and audio player wouldnt start even after reboot GWcmeisterPeepoShrug

#

stupid intermittent issues with useless errors

slim bane
#

Asking for a friend who uses discord.js. Is it possible to get the owner of a guild by the guild ID?

#

The owner ID.

gilded blaze
#
client.guilds.get("id").owner```
slim bane
#

Forgot to mention the only problem. The bot is not in the server.

#

I forgot to include that lol.

gilded blaze
#

Then you can't get the guild owner.

earnest phoenix
#

Nice developing work, but maybe to make it easier for the developers general, it's the possibilty to HTML & CSS bigger

#

and then concentrate on difficult languages like PHP, Javascript & MySQL

#

javascript is pretty easy

slim bane
#

Aw heck. Thanks though. GWfroggyPepoThumb

earnest phoenix
gleaming glen
#

check line 365

earnest phoenix
#

yeah?

gleaming glen
#

just a syntax error?

#

nothing too fancy

earnest phoenix
#

?

#
async def on_member_join(member):

    with open('users.json', 'r') as f:
        users = json.load(f)
        
    await update_data(users, member)
        
    with open('users.json', 'w') as f:
        json.dump(users, f)
    
@bot.event
async def on_message(message):

    with open('users.json', 'r') as f:
        users = json.load(f)
    
    await update_data(users, message.author)
    await add_experience(users, message.author, 5)
    await level_up(users, message.author, message.channel)
    
    
    with open('users.json', 'w') as f:
        json.dump(users, f)
        
async def update_data(users, user):
    if not user.id in users:
        users[user.id] = {}
        users[user.id]['experience'] = 0
        users[user.id]['level'] = 1
        
async def add_experience(users, user, exp):
    users[user.id]['experience'] += exp
    
async def level_up(users, user, channel):
    experience = users[user.id]['experience']
    lvl_start = users[user.id['level']
    lvl_end = int(experience ** (1/4))
    
    if lvl_start < lvl_end
        await bot.send_message(channel, '{} has leveled up to level {}'.format(user.mention, lvl_end))
        users[user.id]['level'] = lvl_end```
#

this is code

#

btw

#

what's wrong with it?

gleaming glen
#

i dunno py that much

#

so i cant help u

earnest phoenix
#

;__;

solid cliff
earnest phoenix
#

ohh

earnest phoenix
#

s!play

autumn rain
#

soo my bot gains votes and servers really fast... can someone send me a good sharding tutorial for jda or give a short explaination how sharding works in detail?

quiet bobcat
earnest phoenix
#
                    ^

TypeError: Class constructor Client cannot be invoked without 'new'
    at Object.<anonymous> (C:\Users\user\Desktop\Echo\index.js:2:21)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3```
#

what does that mean?

heady zinc
#

this is self-explanatory

earnest phoenix
#

?

#

@heady zinc

#

Wdym?

heady zinc
#

i mean the error tells you what you cannot do and tells you what to do to fix it

#

i can't help you more than that

earnest phoenix
#

so basically it cant have new in the code?

#

uh

#

fixed it

#
operable program or batch file.```
#

How do I fix that?

red parcel
#

lol do you even know javascript tbh

#

or cli

earnest phoenix
#

I have not had those errors before

ruby cargo
#

That's erroring because Client is a class and you're not instantiating it with new

frigid bone
#

new Constructor() is how you invoke constructors to create a new object

ruby cargo
#

Yes

frigid bone
#

So you just need to do const bot = new Discord.Client();

ruby cargo
#

^

#

And for your second error, n doesn't exist in your PATH so it's unsure what to execute @earnest phoenix

frigid bone
#

Otherwise it would be just calling the Discord.Client() method and catching its return value with const bot, which not allowed because Client is a constructor

#

Show me what you're trying to run in the console

ruby cargo
#

Might be trying to type node 🤔

frigid bone
#

That's what I thought too

earnest phoenix
#

@frigid bone My friend fixed it for me

frigid bone
#

nice, I guess

earnest phoenix
#

Why does it spam Hello, 👋 how are you? When i say Hello.

frigid bone
#

Make sure it's not responding to itself..

earnest phoenix
#

client.on("message", (message) => {
if (message.content.startsWith("Hello")) {
message.channel.send("Hello, 👋 how are you?");
}
});

#

thats the code

frigid bone
#

Well, it is responding to itself

#

Since the bot message also starts with "Hello"

knotty steeple
#

so maybe dont check if it starts with hello

#

but if the content alone is hello

#

then it wont respond to it self GWfroggyPepoThumb

frigid bone
#

or just check if the message author is a bot inquisitive_corn_pop

knotty steeple
#

but you can also do if(message.author.bot) return;

frigid bone
#

That way it won't ever respond to itself, and ignore other bots

earnest phoenix
#

ok

#

or.. OR

#

this is gonna sound crazy

#

dont make it respond to hello

frigid bone
earnest phoenix
#

on a bot invite link, can you pre-specify a guild
like as a suggestion

#

Anyone wanna collab on a bot?

#

u dont just ask that sort of stuff

#

...

#

Why?

pine canopy
#

function googlesrch(search) { var srch = ""; if(search.startsWith('!google ')){srch=search.replace('!google ', '');}else{srch=search;} google(srch, function(e,r){ let re = new Discord.RichEmbed() .setTitle("I think this is all I can find...") .setAuthor("Trevor", client.user.avatarURL) .setColor(3447003) .setDescription("I sniffed all around the world of Google. Hope this is correct!") .addBlankField(true); try{ for (var i=0; i<5; i++){ var t = ""; if(r.links[i].title.length>256){ t = r.links[i].title.substring(0,250)+"..." }else{ t=r.links[i].title }; if(t!==null|r.links[i].description!==null|r.links[i].link!==null){ re.addField("["+t+"]("+r.links[i].link+")", r.links[i].description); } } return re; }catch(e){ return error_embed(e); }

#

EMPTI MESSAGE? WHY, ITS NOT EMPTY

#

if(msg.content.startsWith('!google ')){
msg.channel.send(googlesrch(msg.content));
}

#

fucucucucucukcufuck

carmine echo
#

do console.log(the output)

pine canopy
#

it didnt output

#

@carmine echo

carmine echo
#

Then it's empty

pine canopy
#

HOW IS IT EMPTY

#

IT CLEARLY HAS CODE FOR EMBEDSSSS

#

FUCK

frigid bone
carmine echo
#

Embeds can't have empty fields

pine canopy
#

Kthx

#

no.

#

NO.

#

@frigid bone

frigid bone
#

okay, I guess

pine canopy
#

FUCK WHO WILL HELP ME? FUCK YOU JAVASCRIPTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

#

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

#
    var srch = "";
    if(search.startsWith('!google ')){srch=search.replace('!google ', '');}else{srch=search;}
    google(srch, function(e,r){
        let re = new Discord.RichEmbed()
        .setTitle("I think this is all I can find...")
        .setAuthor("Trevor", client.user.avatarURL)
        .setColor(3447003)
        .setDescription("I sniffed all around the world of Google. Hope this is correct!")
        .addBlankField(true);
        try{
        for (var i=0; i<5; i++){
            var t = "";
            if(r.links[i].title.length>256){
                t = r.links[i].title.substring(0,250)+"..."
            }else{
                    t=r.links[i].title
            };
            if(t!==null|r.links[i].description!==null|r.links[i].link!==null){
                re.addField("["+t+"]("+r.links[i].link+")", r.links[i].description);
            }
        }
        return re;
        }catch(e){
            return error_embed(e);
        }```
#

SHIT

gleaming glen
#

Please do not spam

#

just be a little patient

pine canopy
#

Ok i ask discord.js

gilded blaze
#

So you are using the googlesrch function to send the embed?

pine canopy
#

Yes

gilded blaze
#

Because from what I see it isn't returning anything.

pine canopy
#

return re

gilded blaze
#

You seem to be having a problem with nested functions.

earnest phoenix
#

hi

gilded blaze
#

You are returning in the google function.

pine canopy
#

return re;

gilded blaze
#

Not in the main function.

pine canopy
#

it says return rich embed

#

"return re;"

gilded blaze
#

Yes. But the main function is not returning that.

#

Try setting a variable in the googlesrch scope and instead of returning re set the variable to re then return that variable in the googlesrch function.

pine canopy
#

No.

#

@gilded blaze

#

SAME. GODDAMN. ERROR

gilded blaze
#

Show code

pine canopy
#
    var srch = "";
    var ret;
    if(search.startsWith('!google ')){srch=search.replace('!google ', '');}else{srch=search;}
    google(srch, function(e,r){
        let re = new Discord.RichEmbed()
        .setTitle("I think this is all I can find...")
        .setAuthor("Trevor", client.user.avatarURL)
        .setColor(3447003)
        .setDescription("I sniffed all around the world of Google. Hope this is correct!")
        .addBlankField(true);
        try{
        for (var i=0; i<5; i++){
            var t = "";
            if(r.links[i].title.length>256){
                t = r.links[i].title.substring(0,250)+"..."
            }else{
                    t=r.links[i].title
            };
            if(t!==null|r.links[i].description!==null|r.links[i].link!==null){
                re.addField("["+t+"]("+r.links[i].link+")", r.links[i].description);
            }
        }
        ret = re;
        }catch(e){
            ret = error_embed(e);
        }
    });
    return ret;
}```
#

@gilded blaze

gilded blaze
#

Oh wait. That's cause google returns a promise. It's returning ret before google calls your callback.

#

You could make the function return a promise and just await it when you use it.

#

Then just resolve re which means you don't have to use ret.

earnest phoenix
#

why is ret undefined SadEyes
not inside callback
mmLol

glossy talon
#

https://discordbots.org/api/bots/458431964119040000/check?userId={ctx.author.id}?trashhere={random.randint(1, 1000)}

#

So why does this no longer work

#

I added a trashhere to the get

#

And it no longer works

#

I added a Trashhere so it would start updating the links info

#

But it now always gives a no

earnest phoenix
#

webhook instead of raping api awesmart

#

lol

#

help?

solid cliff
#

Is a problem with strings and backslashes on windows, an r before the " should work > r"C:\Users\etc"

earnest phoenix
#

I want to give a role to my voters who have a code ready

kindred sequoia
#

How can I make a command like t+votecheck and if you didn't vote it would say you didn't but if you did it would say you did

#

someone please help

earnest phoenix
#

*vote

#

uh

#

wtf

lethal lake
earnest phoenix
#

uhh

lethal lake
#

if you could help, and want to do a VS:Code live share DM me

knotty steeple
#

u using pylint?

lethal lake
#

yep

knotty steeple
#

dont

#

it brings up random errors

lethal lake
#

ok. how do i uninstall, im pretty dump

knotty steeple
#

pip uninstall pylint

lethal lake
#

k kool thanks

knotty steeple
#

i did that (get pylint) and it said something 100% valid was invalid code

lethal lake
#

ye

#

thx you

kindred sequoia
#

how can I check if a user voted, in dblapi.js

earnest phoenix
#

by using webhook, then saving to a db and check there.

#

how do I see what the 2nd message is so I can see what it is so like >setting true/dalse

kindred sequoia
#

how @earnest phoenix

inner jewel
#

up to you to implement

kindred sequoia
#

wdym

civic wedge
kindred sequoia
#

The Bot Client ID isn't correct it is the id of you discord bot

civic wedge
#

okay thanks

kindred sequoia
#

no problem

earnest phoenix
#
    if(messageid !=='296750415964274689')```
Would this work?
wide shale
#

No

#

Maybe

gilded blaze
#

Why do you split and join? That is redundant.

earnest phoenix
#

i has disable the leveling up message, will my bot get unmute? my bot name @dim trail

gleaming glen
#

Yes

#

Just tell a mod after fixing

earnest phoenix
#

yes i has fix it @gleaming glen

gleaming glen
#

Okay. unmuted but you can tell in #general next time

latent heron
#

does anyone know how to convert ctx.author.status into a string?

#

without doing an ext.commands converter

slender thistle
earnest phoenix
#

ReferenceError: guild is not defined
.addField(`Server name:`, `${guild.name}`)
Shouldn't guild not need to be defined

inner jewel
#

no

#

it has to be defined

#

and in scope

earnest phoenix
#

just
let guild = msg.author.guild

#

?

inner jewel
#

no

#

msg.guild

#

users don't belong to guilds

earnest phoenix
#

ty

#

OAuth2 says not a well formed URL, any way to fix?
The URL is https://shoown.glitch.me (due to me running a dashboard from there), and all it says it's not a well formed URL.

Sorry for not explaining earlier

latent heron
#

oh

#

ok

hallow bear
#

Kan Iemand helpen weet niet hoe ik veder met de bot moet

#

Want dit staat er Please enter at least 300 characters excluding special characters in your detailed description. If you use iframes, you need to use at least 300 more characters..

#

Dus wat moet ik dan doen?

gleaming glen
#

u gotta have at least 300 characters in ur long desc

hallow bear
#

waar staat dat?

#

??

gleaming glen
#

english would be better

hallow bear
#

Where is that

gleaming glen
#

bot submitting page

#

"Detailed Description"

hallow bear
#

Where??

#

Please Screenshot

gleaming glen
hallow bear
#

Yes, but what do I have to do there? I do not understand that

earnest phoenix
#

What your bot is about

gleaming glen
#

Type about your bot..

#

not that hard

#

and add some style and stuff

earnest phoenix
#

I don't know why they changed it to that, it's stupid imo

#

If your bot gets declined, you have to retype it

gleaming glen
#

.count?

hallow bear
#

So should drop '' about your bot ''

gleaming glen
#

exactly

earnest phoenix
#

@earnest phoenix Discord.js?

#

TypeError: Cannot read property 'count' of undefined @gleaming glen

hallow bear
#

I put this down there about your bot but remains the same report

earnest phoenix
#

guild.memberCount

gleaming glen
#

u can easily find this kinda stuff in docs

earnest phoenix
#

I'm getting the guild. things from the doc

hallow bear
#

I put this down there about your bot but remains the same report

earnest phoenix
#

@earnest phoenix ty and the something_something just do somethingSomething?

#

it depends on what you are trying to get, but with member count, yes

#

so if its undefined do that

#

Best bet.

#

👌

hallow bear
#

How do I fix that now especially bone does it because I really do not succeed I still do not understand what to put down there or Where I can find it at that Detailed description of your bot *
HTML & Markdown allowed, minimum 300 characters

#

Hello??

slender thistle
#

Describe/list your bot commands, for example.

gleaming glen
#

its there when adding a bot

#

are u blind? zoomeyes

hallow bear
#

Is that in my discord?

gleaming glen
#

what are u trying to do?

hallow bear
#

Make your own bone but do not come out

gleaming glen
#

i dont understand what u r doing, its there when trying to add a bot

hallow bear
#

I do not understand what I should put down here. Detailed description of your bot *
HTML & Markdown allowed, minimum 300 characters and if I like that If you just help me Well would be nice

gleaming glen
#

we said that

#

some information of your bot

earnest phoenix
#

just describe about your bot that you want to add there

gleaming glen
#

like commands or whatever u want

#

yeah

#

not that hard

earnest phoenix
#

whats a guilds splash

inner jewel
#

it's for partnered guilds

earnest phoenix
#

what so if its partnered or not?

bright spear
#

no

#

its the background of the invite screen

#

but you can only set it if the server is partnered or verified

hallow bear
#

Where do I ensure that I have a Bot Command Prefix

#

??

#

Hello??

grizzled isle
#

const prefix = ";" if (message.content.startsWith(prefix + "ping") { // code here}

hallow bear
#

Can you send a Link where I can find it because it can not find it

#

@grizzled isle

#

Hello??

rustic axle
#

Hey can someone help me find a way for my bot to stop listening into this server

#

It is basically getting ddos-ed

#

Or if some mod can kick it

floral zinc
#

That doesnt make sence

fiery birch
#

If you are doing a collab on a bot is it possible to have 2 ownerID's in the config.json?

floral zinc
#

RecyclingBin your not getting ddosed

#

At least not because of the bot being here

rustic axle
#

2018-08-25T21:12:49.041253+00:00 app[worker.1]: [debug] message-sent-to-bot: (264445053596991498)
2018-08-25T21:12:49.072477+00:00 app[worker.1]: [debug] message-sent-to-bot: (264445053596991498)

#

I get these each time a message is sent

floral zinc
#

Yes?

fiery birch
#

@rustic axle In your code let it check if the message is coming from that server using the server id, if it is then return;

rustic axle
#

I am just going to disable logging

#

Completely

floral zinc
#

Thats not called ddosing wth

rustic axle
#

Its a joke

floral zinc
#

Just disable it for the guild id

rustic axle
#

Oh yeah you are right

fiery birch
#

Ok but uhm, if you are doing a collab on a bot is it possible to have 2 ownerID's in the config.json?

knotty steeple
#

ye

fiery birch
#

Would you separate them using a comma then or what?

knotty steeple
#

arrays work in json files

fiery birch
#

oh i gotta learn arrays now then GWqlabsFeelsBadEh

knotty steeple
#

its literally just ["id1", "id2"]

fiery birch
#

o, oki ty

latent heron
#

🤔

hallow bear
#

My Bot Doet het niet

latent heron
#

мой бот доет нет ниет?

#

thats some gibberish lol

slender thistle
#

assets.help_message?

#

If on rewrite, you can just use ctx.author.

hallow bear
#

I do not have a site so I can make a bone

red parcel
#

I need help with webhooks

#

How do I say when someone votes

#

with a weebhook

bright spear
#

@red parcel are you using one of the dbl api libs? (also this would be better in #topgg-api)

red parcel
#

i fixed it i think i need someone to test

hallow bear
#

How do I get mn bot Online

prime cliff
#

What are you using to run it

hallow bear
#

I do it via Google Dan via DEVELOPER PORTAL

ruby dust
#

I bet he just created an app

#

you know... those type of people that think it's so easy to make the bot they want

prime cliff
#

Without reading up anything yea.... and google is staring you in the face to be used

hallow bear
#

How is it then?

prime cliff
#

Are you hosting it on google cloud computers and what language?

hallow bear
#

No

prime cliff
#

But you said you were using Google?

ruby dust
#

he googled the dev portal

prime cliff
#

Thats for APIs releated to Googles own services not Discord

hallow bear
#

How Dan?

prime cliff
#

Look up tutorials on Google/YouTube to learn how to create a bot

earnest phoenix
#

does anybody know how to setup skysilk?

prime cliff
#

What is that?

ruby dust
#

vps

#

I use skysilk

#

what's the problem?

earnest phoenix
#

I just cant connect

#

can you screen share and showme

ruby dust
#

my dms are locked, and so are friend requests

prime cliff
#

Have you tried pinging your host ip?

earnest phoenix
ruby dust
#

what is that

earnest phoenix
#

woops

#

wrong one

ruby dust
#

just tell me where you are stuck

earnest phoenix
#

my ping

ruby dust
#

he said your host ip

#

not api

fast marten
#

bit low

earnest phoenix
#

bit low

#

boi

fast marten
#

bet you couldnt get it to 20,000

earnest phoenix
fast marten
#

uh so how come your getting 16second ping

earnest phoenix
#

shit code @fast marten

#

👌

#

im addicted to embeds thats why

fast marten
prime cliff
#

Are you using a website to ping that or your own computer?

ruby dust
#

you still didn't provide any information on where you are stuck in skysilk

earnest phoenix
#

a website

#

I cant connect to it

prime cliff
#

open up command prompt and type ping (ip)

ruby dust
#

I cant connect to it can mean a lot, not just what you are thinking of sigh

#

I'm still clueless as to what exactly you want to connect, or connect with and connect to

prime cliff
#

Same GWqlabsMmSad

earnest phoenix
ruby dust
#

no need to blur your computer name

prime cliff
#

hmmm timeouts

earnest phoenix
#

i dont want you seeing my name @ruby dust

#

@ruby dust how do you connect to the vps

fast marten
#

So are you not able to connect to your vps?

earnest phoenix
#

idk how

fast marten
#

You have putty?

ruby dust
#

I use filezilla for file transfer, and putty as terminal

earnest phoenix
#

yes

ruby dust
#

nice

fast marten
#

Port 22?

ruby dust
#

putty twice

earnest phoenix
#

yes

fast marten
#

and when you attempt to connect what does it bring up?

earnest phoenix
fast marten
#

then you type in root right?

earnest phoenix
#

root

#

wat

fast marten
#

your username is root?

#

do you remember your password?

earnest phoenix
#

whats my root

#

my name?

#

the vps name

fast marten
#

Yes you login as root

earnest phoenix
#

when ever you say root i wonder wtf you are saying

fast marten
#

Root is a default username

ruby dust
#

actually if you want to access root, you'll have to have a private key generated from your putty instead of logging into one of the users

fast marten
#

Does it give you a user?

ruby dust
#

no

earnest phoenix
#

I have a ssh

prime cliff
#

No not if you set up private keys in the first place

ruby dust
#

you have to create one via root

#

the only access to root is by using a private key, yes

earnest phoenix
ruby dust
#

a key is a file that you should have generated from putty

earnest phoenix
#

dont let me put a password

fast marten
#

It does

earnest phoenix
#

no

ruby dust
#

it's hidden

earnest phoenix
#

it dont

fast marten
#

But it doesnt show what letters you type

earnest phoenix
#

oh

#

wow it let me in

fast marten
earnest phoenix
#

now what

#

xd

#

@ruby dust now you can help

#

xd

fast marten
#

sudo apt-get ugrade and sudo apt-get update

ruby dust
#

usually you'd want to create a user, that process may differ depending on what OS you use

rustic axle
#

smh all of you use vps like scrubs just use a github public repository as a user database and heroku as server smh

fast marten
#

lol

rustic axle
#

so everyone's data can be hacked

ruby dust
#

you don't generally want to run anything on root because it's an alias to windows administrator access, which would really fuck up your system if not treated carefuly

fast marten
#

shit you outsmarted me zoomeyes

earnest phoenix
#

I just ran the update thing

#

damn

prime cliff
#

Aslong as the root password isnt 123 then you're fine GWqlabsFeelsLULMan

earnest phoenix
#

lmao

#

thats my password to everything @prime cliff

fast marten
#

adduser (username)

bitter sundial
#

did you get the current password from the provider?

fast marten
#

hes in

bitter sundial
#

if yes you should change it right away using passwd

fast marten
#

uh to add new user do - adduser (name) then usermod -aG sudo (name) then su (username) to login

earnest phoenix
ruby dust
#

once you'll be done with whatever you're doing, you'd want to install tmux, which is what originally used to create sessions (aka multiple command prompts on windows) and actually run your programs on the cloud instead of locally

fast marten
#

Kayo your using special characters in your name right?

inner jewel
#

or use system services

earnest phoenix
#

yeah stay here to tell me how after @ruby dust

inner jewel
#

and have the system watch your stuff

earnest phoenix
#

no

#

its just letter

fast marten
#

uh just letters?

earnest phoenix
#

yes

#

Kayo what it looks like

#

but its not Kayo

#

its a name but it looks like Kayo

#

Clolololo

ruby dust
#

I can't stay any longer, just type apt get tmux and then google the tmux commands

earnest phoenix
#

can I not use windows remote

#

how do i make an account @fast marten

#

adduser Kayo

#

yes

fast marten
#

try with all lower case?

earnest phoenix
#

welp worked

rustic axle
#

Hey how do you send a message to a channel before bot.on(message, funct.)

#

Because I tried it in bot.on(ready, funct.)

#

but it doesn't work

earnest phoenix
#

why does it say room number

#

wat

fast marten
#

screenshot?

earnest phoenix
#

Room Number []:

fast marten
#

Oh just press enter till you get a question saying if the information is correct and put yes or y

earnest phoenix
#

how do i login

fast marten
#

wait before you do so

earnest phoenix
#

it exited

fast marten
#

?

earnest phoenix
#

and said the user already exxists

fast marten
#

usermod -aG sudo kayo

#

you need to do that first

earnest phoenix
#

Room Number []: ^Cadduser: `/usr/bin/chfn kayo' exited from signal 2. Exiting.
root@Kayo:~# newuser kayo

Command 'newuser' not found, did you mean:

command 'newusers' from deb passwd

Try: apt install <deb name>

root@Kayo:~# adduser kayo
adduser: The user `kayo' already exists.

fast marten
#

do

#

deluser kayo

#

then run though the adduser kayo

earnest phoenix
#

i redid it

fast marten
#

now do su kayo

earnest phoenix
#

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

fast marten
#

Yeah that just means when you need permissions for a command put sudo in front of it to run it as root

earnest phoenix
#

now it says name@Kayo:/root$

fast marten
#

type cd

#

cd /home/kayo

earnest phoenix
fast marten
#

uh your probably already in it

earnest phoenix
#

do I really have to just use commands

#

now what

#

this is fustrating

inner jewel
#

yes you do

earnest phoenix
#

oooofffff

#

this is taking lots of time and getting no where

#

@fast marten

fast marten
#

yes

earnest phoenix
#

now what

fast marten
#

what are you wanting to do

earnest phoenix
#

put and run a bot on it

fast marten
#

what library?

earnest phoenix
#

js

fast marten
#

sudo apt-get install nodejs probably

topaz fjord
earnest phoenix
#

its installing

#

it installed

topaz fjord
#

I recommend using the ppa way

earnest phoenix
#

i have the js

#

on it

#

just how do I put my code on it

#

and run it

topaz fjord
#

sftp

earnest phoenix
#

then be able to edit it

inner jewel
#

or git

topaz fjord
#

SFTP to transfer files

#

or git

#

i don't see how hard it is to Google tbh

fast marten
earnest phoenix
#

I like to know here so I dont spend 10 hours googles it

topaz fjord
#

more like 10 minutes but k

fast marten
#

nice turtle

quartz kindle
#

you can use an sftp program like filezilla to transfer files

valid briar
#

Tim

earnest phoenix
neat falcon
#

hi there, if anyone uses dbm does anyone know why i get this on play youtube video:

Error: \\?\C:\Users\node_modules\node-opus\build\Release\node-opus.node is not a valid Win32 application.
\\?\C:\Users\node_modules\node-opus\build\Release\node-opus.node
#

tried reinstalling node-opus

sick cloud
#

.node is not a valid Win32 application.

#

thats why probs

neat falcon
#

i did npm install

#

but i get that

#

how do i get valid win32

sick cloud
#

i mean, valid win32 apps are usually

#

.exe

neat falcon
#

a

#

will test on vps

shy rose
#

its trying to execute a .node :?

neat falcon
#

ye

#

for some reason

shy rose
#

did it run gcc on install?

inner jewel
#
File is corrupt, bad, or missing. 
- If the hard disk drive is corrupted or bad it can cause working programs to fail either because not all the data can be read from the hard disk drive or because the program has become corrupted while on the drive. Run scandisk and defrag on the hard disk drive to check for any potential errors.
- If you're running the program from a shortcut on the computer, verify that the program is still on the computer. In some cases if the program is no longer installed on the computer you may get this error.

File is not designed for your version of Windows:
- If you're trying to run a program that is not designed for your version of Windows you may get this error. 
- Although many older programs designed to work in older versions of Windows will work with new versions of Windows, unfortunately, not all programs will work.
- If the program is an older MS-DOS program or early Windows program you may get this error.
- If the program is designed for a 64-bit version of Windows and you're running it in a 32-bit version of Windows, it will not work and generate this error.```
neat falcon
#

oh

inner jewel
#

probably second part

neat falcon
#

i'm on windows 64-bit tho

#

ok i think i fixed by using cmd

inner jewel
#

can you open git bash (or anything else that has the file command) and file <that file>

fiery birch
#
      message.member.voiceChannel.join()
        .then(connection => { // Connection is an instance of VoiceConnection
          message.reply('I have successfully connected to the channel!');
          const dispatcher = connection.playFile('songs/' + `${songnames[randomNo]}` + '.mp3');
          if (message.content.toLowerCase().startsWith(config.prefix + 'volume')) {
            let volume = args[0];
            dispatcher.setVolume(`${volume} / 100`);
          }``` heres my bot code, in discord.js
#

i need help with my volume command, it just wont change

neat falcon
#

git crashed but fixed the issue thank

#

hmm

#

you can't do that

fiery birch
#

oh

neat falcon
#

it has to be a number

#

not a string

#

like setVolume(100)

#

i think

fiery birch
#

the command im running is >volume 50

#

i think it should take 50 and divide by 100, to set volume to 0.5

inner jewel
#
setVolume(`${volume} / 100`)```
#

that makes it a string

#

why not just volume / 100

knotty steeple
#

^

earnest phoenix
knotty steeple
#

so if you run >volume 50

#

you are trying to set the volume to "50 / 100"

fiery birch
#
        case "play":
      message.member.voiceChannel.join()
        .then(connection => { // Connection is an instance of VoiceConnection
          message.reply('I have successfully connected to the channel!');
          const dispatcher = connection.playFile('songs/' + `${songnames[randomNo]}` + '.mp3');
          if (message.content.toLowerCase().startsWith(config.prefix + 'volume')) {
            let volume = args[1];
            dispatcher.setVolume(volume / 100);
          }
        })``` heres what ive got now then
#

it still doesnt work though

knotty steeple
#

'songs/' + ${songnames[randomNo]} + '.mp3'

#

why tho

fiery birch
#

it plays music off my osu lool

knotty steeple
#

just do it all in one template literal

fierce thorn
#

Wait shouldn't volume be args[0]
If you use it as
+volume 50

fiery birch
#

i tried it as args[0] and args[1]

fierce thorn
#

Wait how you think you can have command in command

fiery birch
#

uh

#

idk.

knotty steeple
#

probably if it was separate commands cant get dispatcher

fiery birch
#

yea

fierce thorn
#

Ah

#

Ik how then

#
let volume = args[1]
dispatcher.setVolume(volume / 100)
}```
#

so command will be play volume 50

#

@fiery birch

fiery birch
#

alr

#

ill try it in a few mins ty

fierce thorn
#

It should work

fiery birch
#

@fierce thorn that doesn't work either

fierce thorn
#

Can you show me code

fiery birch
#
       case "play":
      message.member.voiceChannel.join()
        .then(connection => { // Connection is an instance of VoiceConnection
          message.reply('I have successfully connected to the channel!');
          const dispatcher = connection.playFile('songs/' + `${songnames[randomNo]}` + '.mp3');
          if (args[0] === "volume") {
            let volume = args[0];
            dispatcher.setVolume(volume / 100);
          }```
fierce thorn
#

Is there any error?

fiery birch
#

no

inner jewel
fiery birch
#

i tried let volume = args[1] as well

gilded blaze
#

Try learning more JavaScript.

fiery birch
#

good help, real useful lool

quartz kindle
#

debug your code

#

put console.logs everywhere, read the code flow, identify where the issue is, and fix

fiery birch
#

no bugs show up though

#

im just not that good to even do much, wip

#

ill just abandon the volume command

turbid robin
#

try removing the double quotes around volume

#

small chance it would work

#

it depends on the context of the rest of your program

quartz kindle
#

have you tried simply dispatcher.setVolume(1)

#

to see if it works

fiery birch
#

yea

#

didnt work

quartz kindle
#

then the problem is the dispatcher

glossy talon
#

@earnest phoenix How does one webhook 🅱

earnest phoenix
#

what does this mean
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function

#
    const fs = require("fs")
    const warns = JSON.stringify(fs.readFile('../warns.json', 'utf8'))
    let user = msg.guild.member(msg.mentions.users.first())
    if(!user) return msg.reply("Hmmmm I won't be able to successfully warn someone unless you mention them.")
    let userd = JSON.stringify(fs.readFileSync("././storage/warns.json", "utf8"))
    if(!userd[user.id]) {
      (userd[user.id]) = {
        warns: 0
      }
    }
    userd[user.id].warns++
    fs.writeFile('././storage/warns.json', JSON.stringify(userd), (err, call) => {
    if(err) msg.channel.send(err)});
    msg.channel.send("I have issued a warning to the user: " + user +".")
  },```
knotty steeple
#

literally says what it means

rustic axle
#

¯_(ツ)_/¯

earnest phoenix
#

should I keep my bot in 1 file or start to do things like exports.conf

rustic axle
quartz kindle
#

you're mixing up readFile and readFileSync

#

readFileSync is not async, meaning it will block your code until its node, and doesnt have callbacks.
readFile is async, meaning it will not block your code, but it needs a callback to know what to do after its finished.

knotty steeple
#

also use a database and not json

earnest phoenix
#

I cant make databases

#

that what I'm trying to do

knotty steeple
#

what

#

get sqlite

neat falcon
#

rethonk >>

earnest phoenix
#

but I think i'm gonna start making my bots with multiple files

rustic axle
#

Well it depends... like my bot has just one file with 300+ lines of code and 3 supporting files but to be honest I could break it up further or I could make it into one huge file totaling 600+ lines of code. It depends on what you want and what will be easier for you. If you don't want a huge block of text then break it up. If you don't want a ton of files then make it into one. @earnest phoenix

quartz kindle
#

my bot has like 3 files with 1-2k lines each

neat falcon
rustic axle
#

0,0

neat falcon
#

my old bot had like 40 files

#

1 for each cmd and event mm

knotty steeple
#

my main file is only ~120 line

quartz kindle
#

and im still using a json database xD

neat falcon
#

heck

knotty steeple
#

i use sqlite

#

get on my level

neat falcon
#

i use no db and no bot mm

rustic axle
#

pls use a text file

quartz kindle
#

in short, its fine to use json, but you need to be careful with it, because if you use it wrong, it can lead to corruption

rustic axle
#

thats how I store songs for my audio bot... in a text file even tho heroku allows for me to use a db 😂

neat falcon
#

especially don't use json for level system

#

writing to it every time message sent

quartz kindle
#

for example, writefile and writefilesync will both corrupt the json file if they are interrupted in the middle of saving due to a bot restart or crash, and will make you lose the entire json file

knotty steeple
#

i use json for my leveling

neat falcon
#

ur banned

rustic axle
#

lol

knotty steeple
#

jk

#

i have an xps table

#

on my sqlite db

quartz kindle
#

wheres that dude who had a google sheets database

#

lmao

knotty steeple
#

oh i remember

rustic axle
#

use vb script to automate marcos so it save stuff in an excel file

knotty steeple
#

well not the guy

#

but that time

#

😂

neat falcon
#

i use floppy disk database

rustic axle
#

I use ftp

neat falcon
#

each user has a floppy disk

knotty steeple
#

right now i should have about

#

uh

quartz kindle
#

google sheet database is actually a great idea if for example, you want a community run database containing stuff like trivia

knotty steeple
#

500 rows in my economy table

rustic axle
#

nice

neat falcon
#

I store passwords in my google sheet database cosmicbrain

#

plain text

knotty steeple
#

everytime someone levels up they get added to economy table

#

so

neat falcon
#

heck

rustic axle
#

i store passwords in the text file in the downloads folder of windows

knotty steeple
#

are they hashed

rustic axle
#

no

knotty steeple
#

boi

rustic axle
#

here is the ip and port

neat falcon
#

who stores password

rustic axle
#

its port fowarded

neat falcon
#

when you can remember it

rustic axle
#

so no issue

#

192...

knotty steeple
#

hash the password

#

then if someone gets it

#

they cant use it mmLol

neat falcon
#

my ip is 127.0.0.1 have fun ddosing me

quartz kindle
#

what if you forget the password

rustic axle
#

okay

knotty steeple
#

uh

neat falcon
#

you don't forget it

knotty steeple
#

use ur own decrypt algorithm

neat falcon
#

i've used the same one for years

quartz kindle
#

you cant decrypt hashes

knotty steeple
#

same

#

yes u can

quartz kindle
#

only bruteforce them

knotty steeple
#

ok then

quartz kindle
#

or dictionary attacks

knotty steeple
#

bruteforce the hash then to get the password back

rustic axle
#

here is a tip

#

just give the password to the attacker and they won't attack you...

#

no encryption needed

knotty steeple
#

or

#

give them the password

#

but change it

#

it technically is the password

neat falcon
#

who wants my password

quartz kindle
#

make your password 2444666668888888 and tell them the password is 12345678

neat falcon
#

yes

knotty steeple
#

no

#

make it null

#

so you cant even login

earnest phoenix
#

does anyone know what this means?

#
path.js:1086
          cwd = process.cwd();
                        ^

Error: ENOTCONN: socket is not connected, uv_cwd
    at Object.resolve (path.js:1086:25)
    at startup (internal/bootstrap/node.js:252:32)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
topaz fjord
#

anyone know how to obfuscate new Date()

inner jewel
#

new (window[[0, 17, 30, 21].map(x=>String.fromCodePoint(parseInt(new String(x+44), 16))).join("")])()

earnest phoenix
#

"Socket is not connected"
"What this means?"

#

l

fiery birch
#

using discord js, js case "play": message.member.voiceChannel.join() .then(connection => { // Connection is an instance of VoiceConnection message.reply('I have successfully connected to the channel!'); const dispatcher = connection.playFile('songs/' + `${songnames[randomNo]}`); if (command === pause) { dispatcher.pause(); };
pause command wont work

bright spear
#

you cant put if(command === pause) inside the .then

fiery birch
#

uhh

#

alr

#

sec

#
        case "play":
      message.member.voiceChannel.join()
        .then(connection => { // Connection is an instance of VoiceConnection
          message.reply('I have successfully connected to the channel!');
          const dispatcher = connection.playFile('songs/' + `${songnames[randomNo]}`);
        })
            if (command === 'pause') {
                dispatcher.pause();
            };``` @bright spear still doesnt work
bright spear
#

is there an error?

fiery birch
#

there isnt

#

if you want i can dm u the entire code

bright spear
#

no

#

but

#

is the pause completely seperate from play?

fiery birch
#

its not

bright spear
#

the code you sent doesnt include if (command === 'play')

fiery birch
#

if i had them as seperate cases it'd return dispatcher not defined

bright spear
#

use message.guild.me.voice.channel.connection.dispatcher.pause()

#

and keep them seperate

#

well

#

if ur on pre-12 change voice.channel to voiceChannel @fiery birch

#

@frank forge no

#

dont take other's code

#

write ur own

fiery birch
#

alr that works

#

tyvm

#

@bright spear aaa, once its paused i cant resume

#

thonk

#
                message.guild.me.voiceChannel.connection.dispatcher.resume();```
bright spear
#

did you make a resume command?

fiery birch
#

yea that

bright spear
#

hm

#

that should work

#

any error?

fiery birch
#

none

upper ember
#

how do I run a jar file in background? (linux)

gilded blaze
earnest phoenix
#
    let user = msg.mentions.members.first();
    let args = msg.content.split(" ").slice(1)
    if (!args[0]) return msg.channel.send("Hmmm, looks like you didn't tell me a user to check!")
    let embed = new Discord.RichEmbed()
    .setTitle("Checking...")
    .setDescription("Please wait while I run a few tests to see if the user is bannable by me.")
    msg.channel.send({embed})
    await new Promise(resolve => { setTimeout(resolve, 5000) })
    if (user.bannable !== 'false') {
      embed.setTitle("This user is not bannable.").setColor("RED").setDescription("Please make sure I am a higher role then the user so I can ban them successfully.")
      msg.channel.send({embed})
    }
    else {
      embed.setTitle("This user is bannable!").setColor("GREEN").setDescription("Good news! I can ban this user! If you find a bug please use >bug to report it, thanks!")
      msg.channel.send({embed})
    }
  },```
This always says someone is bannable when its === and someone isnt bannable when its !==
fiery birch
#
        case "play":
      message.member.voiceChannel.join()
        .then(connection => { // Connection is an instance of VoiceConnection
            const dispatcher = connection.playFile('songs/' + `${songnames[Math.floor(Math.random() * 350)]}`);
            message.react('▶')
        dispatcher.on('end', () => {
            sleep(5000);
            connection.playFile('songs/' + `${songnames[Math.floor(Math.random() * 350)]}`);
            return;
            });```
need help letting this keep looping, discordjs. when a song ends, plays a new one and then it stops, i'd rather have it just not stop tho
bright spear
#

@earnest phoenix change user.bannable !== 'false' to !user.bannable

fiery birch
#

any help pls

cedar maple
#

What lang @fiery birch ?

fiery birch
#

Discord.js

#

Oh shit JavaScript I mean

cedar maple
fiery birch
#

Aw, ty tho

cedar maple
#

have u tried the API server for help?

fiery birch
#

mm I should

#

Thought I'd try here before

sick cloud
#

go to the discord.js server

#

you'll get little success in dapi

fiery birch
#

alr

earnest phoenix
#

@earnest phoenix change 'false' to false

#

no quote

#

@fiery birch have that as a play() function and call it on end.

wide ruin
#

Discord.js

#

It has the message author

#

Would I say if(message.author === pineapplefan1234YT#9295); or === server nickname, or === pineapplefan1234YT

frigid bone
#

Message author is a user object, check the tag parameter of it, if you want to compare username and discriminator

#

Or, better, check for ids

wide ruin
#

But would it just be if(... === Jokersus#????)

languid dragon
#

@wide ruin don't ghost ping

#

that's extremely rude

#

have some patience.

frigid bone
#

message.author.tag would be jokersus#3343

wide ruin
#

Ok

frigid bone
#

I don't mind

#

message.author.username would be just jokersus

wide ruin
#

So if(message.author.username === jokersus);

#

Or would it have to be the server nickname

frigid bone
#

Would be the username

wide ruin
#

Ok

#

Thanks

frigid bone
#

If you need nicknames, and other guild+specific properties, you should check the message.member parameter

wide ruin
#

I won't need nicks

#

It's a bot for 1 server

#

And I want commands for certain users

frigid bone
#
wide ruin
#

Thanks

earnest phoenix
#

i swear u have a new simple q every day

frigid bone
#

Like I said, it's better to store ids of whitelisted users somewhere, and check that instead of usernames

#

Since that's practically impossible to fake, but anyone can easily change their username

deep inlet
#

How do I get the error from an Error() without the trace?

prime cliff
#

You should be able to use Error.Message depending on the language you use

deep inlet
#

JS

#

Let me test....

#

Ah, lowercase M

#

Thank you

fast marten
#

What databases do people use for there bots?

deep inlet
#

PostgreSQL

earnest phoenix
#

SQLite

#

mongodb

quartz kindle
#

json

#

;)

fast marten
#

I switched from mongodb to mysql

prime cliff
#

I have used many databases before but i mostly use json

earnest phoenix
#

It doesn't matter tbh, as @quartz kindle said, JSON could also work pretty well

deep inlet
#

Not if you're using a VPS

fast marten
#

Although if your sharding there is chance of data loss

deep inlet
#

Or some sort of host

#

And sharding

quartz kindle
#

using a vps has nothing to do with it

#

sharding tho, does

earnest phoenix
#

yes it does because they have shared disk

#

database faster on dedi FeelsGoodMan

deep inlet
#

Well, you can't really access it if it's on VPS

#

And updating your bot might overrwrite the file

quartz kindle
#

well, true, but only if you're working with a big amount of data

#

my json databases are under 1mb

earnest phoenix
#

i mean any sort of DB on dedicated server with enough ram

fast marten
#

Unless you have VPS with only dedi storage btmcHmm

earnest phoenix
#

as long as ur working set in memory

#

ur chilling

#

like thing about it

#

even if EVERY command took 1 databse read/write

#

you would need astronomically high command use

deep inlet
#

Sigh rewriting like 40 commands sure is fun

earnest phoenix
#

to even start stressing the database

fast marten
#

DB can be run on VPS quite easily

quartz kindle
#

load db into object at startup. only write when changes happen. profit

prime cliff
#

Yea thats what i do

#

C# has very nice support for json

fast marten
#

I'm guessing some people use there DB for alot of things

prime cliff
#

For stuff like a game or economy yea but if its just a simple guild config json is the way to go

quartz kindle
#

people who use command handlers and module exports which need new bindings on every file probably need a new db connection and transaction for each file that needs it

earnest phoenix
#

1 connection pool awesmart

quartz kindle
#

yeah but most people dont do it

earnest phoenix
#

yeah i forked enmap just to pass my own db connection into it

prime cliff
#

1 connection per guild

10k guilds thonkku

earnest phoenix
#

its a joke since it has a shorthand for instanciating multiple enmaps but uses a new db connectio nfor eah OMEGALUL

deep inlet
#

@earnest phoenix What's the max length for an embed field value again?

#

Is it 6k?

earnest phoenix
#

1024

#

6k overall whole embed

deep inlet
#

Ah

earnest phoenix
#

Can bots use animated emojis ?

knotty steeple
#

yes

earnest phoenix
#

How?

#

i tried the ID way it just shows :emoji: and no animation

knotty steeple
#

well

#

animated emotes are different

heady zinc
#

<a:whatever:id>

knotty steeple
#

heck u i was about to say that

#

well yea thats how u do it

heady zinc
#

get baguetted u facken furry

knotty steeple
#

oi

earnest phoenix
#

it works, ty

earnest phoenix
#

text.replace(/\{\{([^}]+)\}\}/g, function(i, match) {
ok i dont understand this, but i want it if i type "(lmao)" it replaces lmao with something, i already set up before but it only works with {{

quasi forge
#

-help

earnest phoenix
#

I did node . to run my bot and it popped up with this what does it mean?

#

it means you added multiple message listeners

#

and you probably didnt want to

#

cause: bad code

#

Can I delete the code to fix it?

knotty steeple
#

what are you doing with 11 message listeners

#

just put everything in those listeners into 1 GWqlabsNotLikeNoot

earnest phoenix
#

Idk

#

Sometimes I'm very stupid and stometimes I'm smart

fiery birch
#

@earnest phoenix I ended up having it as a function like you said, tyty

earnest phoenix
#

np 👌

#

Is there a way to get last 3 voters ?

light viper
#

Can't you just save all voters to a database?

prime cliff
#

Yes use the /votes endpoint to get the last 100 upvoters

light viper
#

nvm

earnest phoenix
#

use the votes endpoint to get the last 1000 votes, then setup a webhook for votes from then on

#

and check your own db for votes instead then mmLol

earnest phoenix
#

"Yes use the /votes endpoint to get the last 100 upvoters" how that?

#

@earnest phoenix ty, but are you sure that that works for smaller bots(with under 1000votes) too?

#

webhooks work for any bot

#

u should use it, so that you dont have to check the dbl api for votes

wicked latch
#

Hey guys !
I add a bot on discordbot
But on the my bots page I don't see the bot, so I can't have the API key, so how do I do I get the API key ?

earnest phoenix
#

wdym by API key

wicked latch
#

The discordbot token

earnest phoenix
#

There is no slot for a token

#

If someone would say "give me your bot token" they're remotely trying to steal your bot

wicked latch
#

It need a discordbot token, no ? But where can I find it, that's my question

earnest phoenix
#

You can find it at your bot's configuration page

wicked latch