#development

1 messages · Page 393 of 1

austere meadow
#

^

#

probs

#

if it can't play a video it'll hit the end event immediately

neat falcon
#

i'll try other videos

austere meadow
#

ok sounds good

earnest phoenix
#

@neat falcon i mean client#debug

neat falcon
austere meadow
#

yeah come on derpy you're slacking

neat falcon
#
bot.on("debug", e => {  console.log(e) });

didn't give me any info about it either

earnest phoenix
#

right bc d.js uses a separate websocket connection, ffs d.js

austere meadow
#

doesn't the end event emit a reason

#

you could probably check the reason

#

it'd probably just say "This video is not available in your country."

earnest phoenix
#

(I mean, you could use master and use the latest voice rewrite)

austere meadow
#

i mean you could use lavalink

earnest phoenix
#

true

neat falcon
#

lavalink mmLol

#

it works now 🎉

#

region lock reeee

earnest phoenix
#

lul

fleet mason
#
exports.run = (client, message, args) => {
  var user = args.slice(0).join(" ");
  var request = require('request');
  client.realmeye = require("../realmeye.json");
  const fs = require("fs");

  var options = {
    url: `https://nightfirec.at/realmeye-api/?player=${user}`,
  };
if(!user) return message.channel.send("YOu need a user!!")
  request(
    options,
    function (error, response, body) {
      if(error !== null)
        console.log('error:', error);
      else {

var data = JSON.parse(body);

client.realmeye [message.author.id] = {
  discord_username: message.author.Username
//  realm_name : user,
//  guild : data.guild
}
//var fs = require('fs');
fs.writeFile("../reamleye.json", JSON.stringify (client.realmeye, null, 4), err => {
  if (err) {
      console.log(err);
  }
    message.channel.send("I hope this works");
    message.channel.send(data.guild)
});
      }
    }
);
}``` why wont this edit my json file?
neat falcon
#

why are you using request, and client.realmeye should just be realmeye i think

#

client is already defined by discord.js

fleet mason
#

im using request to get the info from the api and that works. But the fs.writeFile wont work

drowsy falcon
#

is there any tutorials how to use make node-canvas work with discord.js?

fleet mason
#

@neat falcon when i took away the client it didnt work.

neat falcon
#

hmm ok

gusty mantle
#

How do I get my bot online?

spring ember
#

what library?

upper ember
solemn obsidian
#

what are you running on the vps

upper ember
#

apache2

#

and website (obv)

solemn obsidian
upper ember
solemn obsidian
#

oh you are using www.

#

yeah that works fine for me

#

flush your dns?

upper ember
#

flush?

solemn obsidian
#

ipconfig /flushdns

gusty mantle
#

How do I get my bot online?

spring ember
#

second time you ask this @gusty mantle what library?

gusty mantle
#

Libary?

spring ember
#

what programming language are you using?

gusty mantle
#

What's the webiste to do that?

#

I have only used Devloper Api.

spring ember
#

holy shit what?

#

send me a link to what you have been using

gusty mantle
#

Tahts my bot.

spring ember
#

no that's not the case

#

you need to code your bot too

#

have you programmed anything?

#

also what programming languages do u know?

gusty mantle
#

I did to my other bot but it was offline for the max time and i can't use it anymore.

kindred yacht
spring ember
#

join welcomer's support server @kindred yacht

#

@gusty mantle what?

gusty mantle
#

I have code my other bot but Luca dm me and said my bot is disabled so I started again.

kindred yacht
#

What server is that @spring ember

spring ember
#

idk

#

not here though

#

@gusty mantle why did you start over? all you had to do is to keep it online and reapply

kindred yacht
#

does anyone have the link to welcomer's support server? (ping me)

gusty mantle
#

How?

#

@spring ember How do I make it online?

spring ember
#

WHAT PROGRAMMING LANGUAGE DO YOU USE?

upper ember
#

XD

#

@gusty mantle Stop piss off dondish

gusty mantle
#

Discord.js

upper ember
#

So node index.js

#

Use that

gusty mantle
#

@spring ember

#

Discord.js

upper ember
#

Stop mention dondishhh

#

Just do node index.js in the folder directory

spring ember
#

^

#

btw I love you @upper ember

upper ember
#

<3

#

omg

#

he's typing

gusty mantle
#

How do i make it online?

upper ember
#

please NOOO

#

open cmd

#

type cd folder_directory

#

and node index.js

#

!!!

spring ember
#

omfg

gusty mantle
#

What website dp I use to make it active? @spring ember

spring ember
#

don't tag me first I am here

#

second listen to MrSheldon

gusty mantle
#

MrSheldon, who?

#

Dondish?

spring ember
#

literally 5 messages ago

gusty mantle
#

What website do I use to make my bot active?

spring ember
#

stop repeating yourself you should host that on a vps or on your pc

shrewd totem
#

You don't do website to make your bot online.

gusty mantle
#

Vps?

spring ember
#

google it

gusty mantle
#

I mean use*

spring ember
#

that's what you typed...

shrewd totem
#

You need to code and keep it running to make it online.

gusty mantle
#

But Luca deactiveated my bot.

shrewd totem
#

Deactivated your bot? 🤔

gusty mantle
#

Yes. I'll send proof.

shrewd totem
#

🤦🏼

solemn obsidian
#

It didnt deactivate it, they just rejected it because it wasn't online

shrewd totem
#

It declined your bot, not deactivated.

gusty mantle
#

O.

solemn obsidian
#

They cant accept bots that aren't online

shrewd totem
#

You need to keep your bot online if you want it to get accepted.

gusty mantle
#

What do I do now?

shrewd totem
#

Keep your bot online, and apply again.

gusty mantle
#

How?

shrewd totem
#

Did you code your bot yourself?

gusty mantle
#

Yes.

shrewd totem
#

So you must know how to run it, right?

gusty mantle
#

I haven't coded it.

#

D:

shrewd totem
#

You just said yes, two messages ago

solemn obsidian
#

You just said you coded it WaitWhat

shrewd totem
#

If you didn't code it, it won't get accepted anyway, because it would be a copy. So, don't bother to apply.

gusty mantle
#

How do I code it?

shrewd totem
#

By writing the code.

gusty mantle
#

Can you send the website link?

shrewd totem
#

What website link?

gusty mantle
#

To code.

shrewd totem
gusty mantle
#

Ty.

solemn obsidian
gusty mantle
#

Hi.

floral stone
#

How would I remove small letters like ᵛᵉʳᶦᶠᶦᵉᵈ from a python string

earnest phoenix
#

@floral stone cant u use the

var.replace("ᵛᵉʳᶦᶠᶦᵉᵈ",  "")```
low rivet
#

@floral stone ```py
import string
string = 'your input'
new_string = ''.join(l for l in string if l in string.printable)

shrewd totem
#

Or remove non-ASCII characters, simply like:

text = 'fsᵛᵉʳᶦᶠᶦᵉᵈ'
new_text = (c for c in text if 0 < ord(c) < 127)
print(''.join(new_text))
gilded blaze
#

Is there any free solution to sending SMS?

austere meadow
#

not that i know of

#

the two major ones are twilio and nexmo

earnest phoenix
#

beg for money in the street and buy the stuff(u didnt spend ur money bloblul )

sand roost
#

Anybody who could check my queue mechanism to see what i am doing wrong

#

since its something with the mechanism

dusty sandal
#

hey for the bot uploading images, how do you get it to send a permanent link? meaning it will never expire.

#

like i have a command that would send an image, a month later it doesnt work becuase the image isn't there.

floral stone
#

It's because it's deleted

dusty sandal
#

i use the discordattachments links

floral stone
#

What for?

dusty sandal
#

to send the images

floral stone
#

Can't you store the bytes or host the image yourself?

solemn obsidian
#

If the original message gets deleted, so does the links contents

dusty sandal
#

ok

#

how do i host the images my self @floral stone }

floral stone
#

Save the file to a folder

#

Google it

dusty sandal
#

save the file to a folder online?

neat falcon
solemn obsidian
#

either needs to be inside {} or just without return

topaz fjord
#

^

neat falcon
topaz fjord
#

Show code nub

neat falcon
#

no U

#
 static getStats (id) {
       snekfetch.get(`https://discordbots.org/${id}/stats`)
       .then(res => {return res})
     }``` high quality code
topaz fjord
#

You could just make it async and use await with snekfetch

solemn obsidian
#

u need to return the snekfetch.get

neat falcon
#

using async + await makes it say that it is not a function

solemn obsidian
#

full error?

neat falcon
#

owo i thonk i did a thing

solemn obsidian
#

async static function getStats...
return await snekfetch.get(url);

topaz fjord
#

Const {body} = await Snekfetch.get('url')

#

Then return body

uncut slate
#

@solemn obsidian return await is a really shitty practice

solemn obsidian
#

why though

topaz fjord
#

What's the point of static

solemn obsidian
#

Class.staticfunc()

#

Instead of new Class().staticFunc()

bitter sundial
#

just return without await

uncut slate
#

using await means you're already in an async function, so whatever you're returning is going to be wrapped in a promise regardless. Calling await would be resolving the promise for no reason

topaz fjord
#

Ye

#

I use eslint

#

It's pretty nice

solemn obsidian
#

that actually makes more sense yeh

neat falcon
earnest phoenix
#

how do u make a discord.js bot dm a certain user

#

pls

languid dragon
#

user.send()

earnest phoenix
#

yeh

#

but where does the user go @languid dragon

#

or the id

languid dragon
#

message.author.send

earnest phoenix
#

message.author.send

#

i dont want the author

#

i want a specific user

spring ember
#

user object.send

languid dragon
#

no

earnest phoenix
#

whos the object @spring ember

languid dragon
#

you can read the documentation

earnest phoenix
#

oofo

languid dragon
#

we're not spoonfeeding

earnest phoenix
#

yes u r

languid dragon
earnest phoenix
#

u just did

#

oh

#

lol

oblique sequoia
#

spoon feeding is bad

earnest phoenix
#

nah it good

spring ember
#

it's not exacty spoonfeed

#

but read the docs please

earnest phoenix
#

i have

#

nothing is there

#

;--;

oblique sequoia
#

not well enough try again

topaz fjord
#

I suggest learning js

earnest phoenix
#

kewl

#

ty

languid dragon
#

follow the documentation, google it and learn javascript

earnest phoenix
#

i googled it

languid dragon
topaz fjord
#

Ken those links look like ads

oblique sequoia
#

ADS in my SERVER? It's more likely than you think!

earnest phoenix
#

omfg

#

u no help lol

languid dragon
#

good

topaz fjord
#

Then learn ja

languid dragon
#

learn to teach yourself

topaz fjord
#

Js

#

Wait

languid dragon
earnest phoenix
#

@languid dragon dont be a hoe and just tellme hoow, its like a basic thing

languid dragon
earnest phoenix
#

well that help

#

s

#

;_;

languid dragon
#

fucking read the documentation

earnest phoenix
#

time to spoonfeeedd!! jk

languid dragon
#

it's not rocket science

#

it's literally straight forward english

earnest phoenix
#

IT IS

#

they dont help

#

:'

#

😂

#

oof

languid dragon
#

they've taught me how to use D.js

#

it's really simple to understand

earnest phoenix
#

good for u

languid dragon
#

take the time to actually read it and understand it

earnest phoenix
#

want a medal

#

😂

topaz fjord
#

Useful links for learning JavaScript and Node:

codecademy online course: https://www.codecademy.com/learn/javascript
Eloquent Javascript, free book: http://eloquentjavascript.net/
Some Node:
http://nodeschool.io/
https://www.codeschool.com/courses/real-time-web-with-node-js
Javascript reference/docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference

#

@earnest phoenix ^

floral stone
#

I recommend sololearn

shy rose
#

Hey guys just launched a space api I think its really cool and something you would probably like https://cheweybot.ga/api/space also due to hosting issues its up at current time for 11 days cause that's when the fund for media server run out so if you like it consider donating https://www.patreon.com/CheweyZ

I'm also hopefully by the end of the day going to have a cat api as well

Also let me know if you have any suggestions for other media endpoints currently thinking to add dogs and birds

topaz fjord
#

@shy rose idk if development is the right place for this

shy rose
#

neither idk where else

trim plinth
shy rose
#

yeah but then its there for like 10 seconds

trim plinth
#

¯_(ツ)_/¯

#

then it may not be suited any place here

#

i'll check the api out though

karmic parcel
#

also ads

shy rose
#

#buy my merch

#

also hey cyber long time no see

karmic parcel
#

Hello

low owl
#

@earnest phoenix Give a man a fish and he has food for a day, teach him how to fish and he has food for the rest of his life 😉

floral stone
#

@low owl you say that a lot

low owl
#

Second time

#

Also, it's just true lol

upper ember
#

Give a man a fish and he has food for a day, teach him how to fish and he has food for the rest of his life 😉

#

lol

low owl
#

🙄

cold harness
#

Give a man a nuke, and it will be the end of him and his neighbors

#

Just some food for thought ^-^

gusty mantle
#

:(

south finch
#

give a man a channel he's not suppose to be having a general discussion in and he will anyway.

frail harness
#

Lmao

wet ferry
#

I need help
it says i have a malacious script
but i don't:

<script defer src="https://use.fontawesome.com/releases/v5.0.9/js/all.js" integrity="sha384-8iPTk2s/jMVj81dnzb/iFR2sdA7u06vHJyyLlAd4snFpCl/SnyUjRrbdJsw1pGIl" crossorigin="anonymous"></script>
![alt text](https://cdn.glitch.com/4bc19d0a-3304-4ab1-a8eb-afdf1716df2b%2Fthumbnail.png?1522706511412)
# MakerSandbot:

### Own a making server? Need a helpful bot? This bot has features for searching 3D files, Searching learn guides, and other things for fun!

### Features:
#### <i class="fas fa-check-circle"></i> Online 24/7
#### <i class="fas fa-check-circle"></i> Guide Searcher
#### <i class="fas fa-check-circle"></i> Fast Ping
#### <i class="fas fa-check-circle"></i> Open Source! <i class="fab fa-osi"></i>


## Commands:

> <i class="fas fa-bullhorn"></i> Run ms!(command) to run a command. Run ms!help to get a full list of commands.

Command | Info | Usage
--- | --- | ---
`learn` | Adafruit Learning System | `ms!learn <random/search> (search)`
`product` | Adafruit Store | `ms!product <id/search> (id number/search)`
`3D` | Thingiverse | `ms!3D <search/id/user> (search/thing id/username)`
`shorten` | Bit.ly URL shortener | `ms!shorten (Full https:// URL)`
`opensource` | MakerSandbot github page! | `ms!opensource`
`news` | Shows latest news | `ms!news`
`ping` | Ping the bot | `ms!ping`
`suggest` | Link to our trello board | `ms!suggest`
`invite` | Get the bot invite | `ms!invite`
`server` | Invite to the MakerSandbox server | `ms!server`
`servers` | List of servers that the bot is on | `ms!servers`
`version` | Shows you the bot version | `ms!version`

<i class="fas fa-copyright"></i> 2018 @Codingpro#9213
#

@south finch is there a way you can accept it?

#

cause you are a web mod?

topaz fjord
#

@wet ferry only certified users can use script tags

south finch
#

yea

topaz fjord
#

also

#

why ping aly

wet ferry
#

oh sry

#

😦

south finch
#

of all ppl lmfao i dont code LUL so i couldnt tell u whats wrong

#

its okay tho

frail harness
#

Wait but you have the bot dev role lmao @south finch

topaz fjord
#

shes co-owner

#

of bot

south finch
#

i dont code extensively

#

im learning

frail harness
#

Oh

wet ferry
#

I don't have 100 servers so i can't certify it yet

south finch
#

but i help manage @river compass

topaz fjord
#

ok

#

help managed

#

english pls

south finch
#

pls

wet ferry
#

lol

floral stone
#

What's discordbots ratelimit for calling the server count?

gray briar
floral stone
#

per minute?

gray briar
#

60 per minute yea

floral stone
#

Wasn't it 60 per hour?

gray briar
#

i mean that's what it says on the official API documentation

inner jewel
#

60 per minute

floral stone
#

Ah ok

abstract mango
#

@wet ferry you should use the fontawesome css instead

wet ferry
#

hmmmm smart

#

😃

proven siren
trim plinth
#

did you try to open the file using Windows bloblul

#

use node.js

proven siren
#

i tried node.js. it said it was null or not an object

#

mo it said it was undefined

trim plinth
#

did you type node [file name].js in the terminal while Node.js was installed

proven siren
#

i did not try that🤔

trim plinth
#

try it then

earnest phoenix
#

look in the log

#

it’s what snarky said

frail harness
#

Lmao

proven siren
#

didnt work for some reason. it said it cant find the module

#

i cant figure out what module its lookimg for

trim plinth
#

ok since your file name seems to be bot.js from the screenshot try typing node bot.js in the terminal

proven siren
#

ok

#

couldnt find the module, but it did find discord.js

#

or something like that

trim plinth
#

couldn't find bot.js?

#

show the error

proven siren
trim plinth
#

you didn't install discord.js then

proven siren
#

i see

#

i was not aware of such a program

trim plinth
#

try npm install discord.js --save in the terminal

proven siren
#

ok

trim plinth
#

ok now try node bot.js

proven siren
#

ok

earnest phoenix
#

show us bot.js code but not your bots token

trim plinth
#

ew Powershell

earnest phoenix
#

what

proven siren
#

yep

trim plinth
#

anyways for the terminal doing that I can't really explain that

cunning oxide
#

agh

#

can I get some help from someone

earnest phoenix
#

sure what liv

cunning oxide
#

im tryna do an image welcome

#

discord.js

proven siren
#

ill try the node terminal

heady zinc
#

it won't change anything

cunning oxide
#

@proven siren use nodemon

earnest phoenix
#

so when somebody joins its sends a message?

cunning oxide
#

not that

#

i can do that

#

xD

heady zinc
#

this happen either because your code has finished its job or because a critical error occurred

cunning oxide
#

but i mean

proven siren
#

nodemon. ok ill try

cunning oxide
#

like generating an image

#

then sending it

#

for someones welcome

#

see bot hell

earnest phoenix
#

yeah that’s image matilupation (or whatever im shit at spelling) and what bot it is that

cunning oxide
#

i forget

#

im just wondering how i do it

#

its giving me a fucking headache

earnest phoenix
#

do something else more original

proven siren
#

i see what it did. when i put in node bot.js, it swapped from cmd back to powershell

earnest phoenix
#

that doesn’t matter?

topaz fjord
#

@cunning oxide either use canvas or jimp

proven siren
#

thats all it would do

#

it keeps swapping back to powershell

heady zinc
#

what about it

proven siren
#

thats just it. i have no idea

heady zinc
#

just use powershell then ThinkRaging

earnest phoenix
#

shows us ya code but not ya token

proven siren
#

ive tried. ends up in error

heady zinc
#

the issue is your code

#

not powershell

earnest phoenix
#

shows us ya code but not ya token

proven siren
earnest phoenix
#

is there a bot.login() anywhere

proven siren
#

no

#

there is not

earnest phoenix
#

add that

proven siren
#

does line matter

earnest phoenix
#

where? no.

proven siren
#

ok

#

done

earnest phoenix
#

does it work now?

proven siren
#

not quite. hold on

#

i keeps saying bot is null or not an object

#

wait i may know whats wrong

torpid vale
#

@proven siren try putting bot.login('TOKEN'); at the end of your file so the bot variable exists

proven siren
#

ok

shy flicker
#

try putting bot.login('TOKEN'); at the end of your file so that the bot logins and it gets online.

proven siren
#

i seem to be missing an 'object' on line 1

#

well i will have to continue the attempt later. i must go. thank you for all the help

alpine lark
#

i got a question

topaz fjord
#

?

#

ask away

alpine lark
#

where would i find my info command

topaz fjord
#

wut

alpine lark
#

my info command

#

like !info

low rivet
#

create it yourself?

alpine lark
#

what js is it in

topaz fjord
#

there is only one js

#

and your code it in the lib you choose

vital lark
proven siren
#

Yes I am. But my bot is on discord.js and haven't changed it 😅

shy flicker
#

i was explaining the actual work of login as well.

karmic parcel
#

Discord.io is still on v5 and won't connect without using a community port afaik

cyan orchid
#

lol anyone know how to use klasa

earnest phoenix
#

yes, me

#

and Kyra

cyan orchid
#

can you help?

#

@earnest phoenix

earnest phoenix
#

Im always happy to help

cyan orchid
#

sweet

#

DM?

earnest phoenix
#

Here is better

#

then other people can help

cyan orchid
#

ok thats fine

#

so

#

im trying to make a command were when you type help it with the prefix it will help

#

iv been using the switch statement

earnest phoenix
#

there is already a help command that comes with klasa

cyan orchid
#

oh really?

earnest phoenix
#

yeah

cyan orchid
#

how do i use it

earnest phoenix
#

just prefixhelp

cyan orchid
#

ok

#

let me try

#

it dont work

#

@earnest phoenix

earnest phoenix
#

screenshot

cyan orchid
earnest phoenix
#

Are you even using klasa?

cyan orchid
#

i installed masters

#

is that bad?

earnest phoenix
#

no

#

show me your code

cyan orchid
#

were

#

which file?

earnest phoenix
#

Main file

cyan orchid
#

the whole thing?

earnest phoenix
#

Yes

cyan orchid
#

its too long

earnest phoenix
#

it should be around 5-15 lines long if you're using klasa...

cyan orchid
#

wait

#

what?

#

the index.js for the help.js

earnest phoenix
#

waitwhat what?

cyan orchid
#

hmm

#

help. js is the klasa file

#

and the index.js is my main file

earnest phoenix
#

Show me ur main file, if its too big upload it to hastebin

cyan orchid
#

ok

earnest phoenix
#

Nice token.... Reset it

cyan orchid
#

shoot

earnest phoenix
#

So you dont actually use klasa Thonk

cyan orchid
#

what do you mean?

earnest phoenix
#

you dont require klasa at all

cyan orchid
#

oh shoot

#

was i ment to do that

earnest phoenix
#

ur main file should be 8 lines long

#

not 133

cyan orchid
#

do you know why

#

i started with thw switch statement as you see

#

sorry if that sounded sassy or somthing

#

?

#

somthing came up

earnest phoenix
#

Okay, Klasa is a discord.js framework with many features such as commands with a command handler monitor so you dont need to listen to the message event yourself as klasa does that... you simply install klasa, make a main file, chuck in ```js
const { Client } = require('klasa');

new Client({
fetchAllMembers: false,
prefix: '+',
cmdEditing: true,
typing: true,
readyMessage: (client) => Successfully initialized. Ready to serve ${client.guilds.size} guilds.
}).login('your-bot-token');

cyan orchid
#

oh

#

so should i delete my main file?

earnest phoenix
#

Well not delete you might wanna keep the code to make the commands but in the long run yes

cyan orchid
#

well im gonna delete everything execpt my music ommands

earnest phoenix
#

(just comment it out for now)

cyan orchid
#

ok

earnest phoenix
cyan orchid
#

ok thanks

earnest phoenix
#

A lot more people who know klasa would be able to help you in the support guild its on the docs

cyan orchid
#

ok

#

why i have a problem

earnest phoenix
#

What?

cyan orchid
#

in the terminal

earnest phoenix
#

oh right, you need to install discord.js v12 aka master so npm install dirigeants/klasa discordjs/discord.js

cyan orchid
#

oh ok thanks

#

dont i have to require discord.js

earnest phoenix
#

nope

cyan orchid
#

ok cool

#

hey its working

#

thanks bro!

#

but i dont get how to add the music thing to it

#

@earnest phoenix

earnest phoenix
#

Read the docs please

cyan orchid
#

ok

earnest phoenix
#

They're well done

#

Just make sure to read master docs

cyan orchid
#

yeah ok

#

but do i put new commads in that folder

earnest phoenix
#

it will answer ur question

cyan orchid
#

thres two commad folders

#

can i dont know how to make music commands!?!!?!?!

#

wait dont worry

#

@earnest phoenix what if i dont have a youtube search API key?

earnest phoenix
#

then scrape?

cyan orchid
#

haha

#

ok one more thing

#

if i wanted a simple commad

#

coz i dont know js very well

#

@earnest phoenix and it dosent say how to do it in the docs

earnest phoenix
#

The docs arent gonna tell you how to do certain things, only how to do that thing

cyan orchid
#

yeah i know

gusty topaz
#
/**
 * Performs a deep copy of an object
 *
 * @param { * } source - Object to copy
 *
 * @return newObject - Copy of that object
 */
function deepCopy(source) {
    let newObject;
    if (typeof source === "string" || typeof source === "number") {
        newObject = source;
    } else if (source.length) {
        newObject = [];
        for (var i=0; i < source.length; i++) {
            newObject[i] = source[i];
        }
    } else {
        newObject = {};
        for (let i in source) {
            newObject[i] = deepCopy(source[i]);
        }
    }
    return newObject;
}

Should this deepcopy function work?

earnest phoenix
#

it wont make a deep copy

gusty topaz
#

why?

earnest phoenix
#

if thats what you're asking

gusty topaz
#

so, what should I change for newObject be the deep copy?

earnest phoenix
#
function deepCopy(source) {
    if (typeof source !== "object" || source === null) return source;
    const output = {};
    for (const key in source) output[key] = deepClone(source[key]);
    return output;
}
gusty topaz
#

wont it get stuck?

earnest phoenix
#

no?

gusty topaz
#

ah

austere meadow
#

may i ask

#

what is a deep copy and what would you use it for

earnest phoenix
#

Clone a object and not keep the same reference

gusty topaz
#

I am creating a thing for bots, kinda like red except in js and I need to deep copy contexts for each specific module

#

because I pass contexts onto modules by using .bind

austere meadow
#

ah

gusty topaz
#

and I need to deepcopy the original context

#

which then can get modified for each module

fleet mason
#

Ok how can i make something = undefinded like ```if(config[message.author.id].code === undefined ) return message.channel.send("Sorry you dont have that code yet");````

#

how can i make it work`?

earnest phoenix
#

We are not going to spoonfeed you @sacred atlas

rare mist
#

Hi i had a problem with my bot and i would like to talk to an admin in DM

spring ember
#

Omg you made that dm spam bot

gilded thunder
spring ember
#

Yes

#

Use python lib json

rare mist
#

@spring ember i didnt made the bot to spam people my token was leaked and now i fixed it

spring ember
#

Didn't the bot send a dm pls donut to my bot or smth?

rare mist
#

no thats not even in the vode

#

sb ysing the token did it

spring ember
#

Oh ok

rare mist
#

what admin should i DM to try to get my bot back to the server?

quiet bobcat
#

create a new bot profile

rare mist
#

Ok

spring ember
#

Just reapply

#

Don't dm them

rare mist
#

ups,i dm oliy yesterday :(

hearty tulip
#

how to remove the server count from my bot page?

spring ember
#

post server_count 0

hearty tulip
#

won't work

spring ember
#

?

hearty tulip
#

i keep gettings this

#

[dblapi.js autopost] Failed to post stats: {"error":"Unauthorized"}

spring ember
#

you forgot to add the header Authorization

#

with your token as a value

hearty tulip
#

what do you mean

cunning oxide
#

anyone know the var for guild size

#

in discord.js?

hearty tulip
#

like this >? let servsize = bot.guilds.size

cunning oxide
#

im just trying to do a welcome msg

#

but i forget the var

#

for it

#

for the guild its on

hearty tulip
#

idk i use this bot.guilds.size is shows the guild count

cunning oxide
#

for the amount of guilds, or the members?

#

@hearty tulip ^

hearty tulip
#

guilds

cunning oxide
#

whenever i try guild.memberCount

#

it says guild isnt efined

#

which is weird

topaz fjord
#

@hearty tulip you can never get rid of server count of webpage once it's posted

spring ember
#

if it isn't defined it means that there is not var named guild...

still cobalt
#

F

cunning oxide
#

ye obviously

hardy moon
#

how to display a random number between 100 and 1000?

languid dragon
#

Math.random()

cunning oxide
#

^

#

then you set a limit

inner jewel
#

floor(Math.random() * (max-min)) + min

#

if Math.random() returns [0, 1]

drowsy falcon
#

can someone tell me what's wrong?

#
const leet = require('leet');

module.exports.run = async (client, message, args) => {
if(!args[0]) return message.reply('Please provide something to convert.');  

    leet.convert(args[0], (data) => {
              message.channel.send(data)
           })
}
module.exports.help = {
name: "leet"
}```
#

hmm

#

wait

earnest phoenix
#

I wonder if using a programmable browser to use discord would be selfbotting

drowsy falcon
#

i think so

#

because u don't control the account

earnest phoenix
#

but it'd be like normal except it'd be code controling the browser

drowsy falcon
#

still

#

idk

#

you can try it but i don't trust it

inner jewel
#

you'd still be automating an user account/modifying the client

drowsy falcon
#

yeah

#

@inner jewel can you help me?

inner jewel
#

/shrug

#

i don't use js

drowsy falcon
#

ok rip

earnest phoenix
#

Is it possible for a bot to change the bitrate of a voice room?

inner jewel
#

yes

earnest phoenix
#

Does anyone know python?

#

I need help with the ping command

quiet bobcat
#

🤔

earnest phoenix
#

I asked 3 bot developers and they couldnt help me

#

I want the real ping not fake one

#

u want it like
Pong! 100ms?

#

Yeah

#

cant spoon feed but here is what u have to do
current date - message timestamp

#

dat is the ping

#

@bot.command(pass_context=True) async def ping(context): d = datetime.utcnow() - context.message.timestamp s = d.seconds//1000 + d.microseconds//1000 await bot.send_message(context.message.channel, "Ping: {}ms".format(s))

#

I used this

#

And u stull get errors so

#

Yeah

inner jewel
#

that's not how you calculate ping

earnest phoenix
#

Hmm

drowsy falcon
#

does someone understand d.js?

earnest phoenix
#

yes

#

i do

drowsy falcon
#

wait

inner jewel
#

start = gettime()
m = await sendmessage("calculating")
elapsed = gettime() - start
m.edit("ping! " + elapsed)

earnest phoenix
#

@inner jewel spooon feeding lmao

inner jewel
#

no

earnest phoenix
#

well tru

#

What a spoon feeding?

inner jewel
#

it's pseudocode

drowsy falcon
#
const leet = require('leet');

module.exports.run = async (client, message, args) => {
if(!args[0]) return message.reply('Please provide something to convert.');  

    leet.convert(args[0], (data) => {
              message.channel.send(data)
           })
}
module.exports.help = {
name: "leet"
}```
#

what's wrong?

earnest phoenix
#

And what does it mean @inner jewel

#

error?

inner jewel
#

spoonfeeding would be if i sent you code for you to copy paste

earnest phoenix
#

Ooh

#

Ok

drowsy falcon
#

when i type the command and the thing i want to translate, it does not send the translated text and no errors in log

#

:/

earnest phoenix
#

It happened to me

#

When i used this

drowsy falcon
#

@earnest phoenix

earnest phoenix
#

what is leet for?

drowsy falcon
#

to translate text to 1337 text

dense bone
#

is anyone having issues with the api, like hasVoted()?

earnest phoenix
#

0H 0KZORZ

drowsy falcon
#

yeah

#

lol

earnest phoenix
#

why do u need the discord.js there?

drowsy falcon
#

to send the text

#

to the channel

earnest phoenix
#

try to do

var text = leet.convert(args);
message.channel.send(text)```
drowsy falcon
#

ok

#

brb

dense bone
#

?

#

anyone?

earnest phoenix
#

what @dense bone

dense bone
#

Having an issue with the api, wondering if its just me

earnest phoenix
#

what lib?

#

must be discord.js

drowsy falcon
#

@earnest phoenix (node:11427) UnhandledPromiseRejectionWarning: TypeError: string.replace is not a function

dense bone
#

js, and its dbl's api

earnest phoenix
#

@drowsy falcon ah...

#

change the args to args[0]

drowsy falcon
#

worked!

#

thanks for helping :)

earnest phoenix
dense bone
#

Well i see where its happening but not why, I have forked dblapi so i could a some things that i wanted. How ever didin't change those funcs just addes some

earnest phoenix
#

also sometimes it returns false cause the voted was cache i think

dense bone
#

i see what happened

#

They have made some changes that i havent published to my fork.

#

which broke my fork

rare mist
#

@uncut slate All the commands of my bot are working but when it joins your server i get this error and it crashes.Any clues?

gray briar
#

is it possible for my bot to be re-added to this server?

#

I have disabled welcome messages now :P

south finch
#

perhaps

trim plinth
#

ELIFECYCLE error GWchadThinkeyes

#

hmmm

rare mist
#

Yeah...

#

idk how to solve it

#

and i cant apply again without fixing that bcz otherwose b1nzyhyperban

earnest phoenix
#

anyone know a regex to get arguments separated by spaces

#

BUT also get arguments inside "" as 1 argument

#

so like:

base arg1 arg2 "arg3 arg3 still" arg4

#

nvm got it

#

** ("[^"]+"|[^ ]+)**

inner jewel
#

not possible

#

use an actual parser

#

regex wasn't made for this

earnest phoenix
#

I managed to get it working

#

I like to use regex for situations like this

inner jewel
#

an actual parser could support eg !command "this is some text with nested \"quotes\"" a "b c d"

earnest phoenix
#

I could get nested quotes to work with a simple regex

#

why implement a parsing library

#

i prefer regex

inner jewel
#

a parser is faster

earnest phoenix
#

really?

inner jewel
#

uses less resources

#

is the right tool for the job

earnest phoenix
#

interesting maybe ill consider it

severe glen
#

hey

earnest phoenix
#

hi

livid violet
#

Hi

earnest phoenix
#

@keen anvil hows the canvas rewrite going?

keen anvil
#

Alright. Going to have to try and use it to make a gif later @earnest phoenix

earnest phoenix
#

nice, if you need any help hmu

keen anvil
#

Kk

cyan orchid
#

im having troble with klassa

earnest phoenix
#

Ask in the support server

cyan orchid
#

um ok

#

what support server

toxic oracle
#

dirigeants hq

cyan orchid
#

link?

toxic oracle
#

dm

earnest phoenix
#

what are shards?

#

what are shards?

quiet bobcat
#

They are parts of your bot that can even out the load

earnest phoenix
#

oh ok

torpid frost
#

i'm tring to add the servercount to my bot
JDA java
what should i put in string discordbots_key?

uncut slate
#

your API key, probably

torpid frost
#

the bot token?

#

hope not

quiet bobcat
#

No

#

discord bot list api key

#

👀

torpid frost
#

okok i found it

#

😅

quiet bobcat
#

👌

quiet bobcat
#

How can I make so that when I mention the bot as a prefix it doesn't count that as a mention? If that makes sense.

#

In discord.js

#

Lets say I do @quiet bobcat kick @quiet bobcat I want it to count the second mention and not the first one

languid dragon
#

sec

#

i got a gr8 way of handling prefixes

quiet bobcat
#

o

low owl
#

Remove the first occurence of <*>

#

Or just remove the first word of your string

#

that's easier

languid dragon
#
let prefix = "]]"
let MP = false

    if (message.content.indexOf(prefix ) !== 0) {
      if (message.content.indexOf(<client>.user.toString()) !== 0) {
        return
      } else {
        MP = true
      }
    }

    let args = message.content.slice(((MP) ? <client>.user.toString().length : prefix.length)).trim().split(/ +/g)
    let command = args.shift().toLowerCase()
#

wait no

quiet bobcat
#

uh

low owl
#

Mind you that this will only detect mentions

#

@quiet bobcat

quiet bobcat
#

the way you said?

low owl
#

Looks fine now 😄

#

Or actually, still only removes mentions

#

If you want to remove any prefix, no matter mentions or not
just split your string based on empty characters and remove the index 0

quiet bobcat
#

Alright

#

Thanks

languid dragon
#

prefixcommand args[0] args[1] args[2]

]]ban @mention
prefix = ]]
command = ban
args[0] = @mention
args[1] = null //etc

@mention ban @mention
prefix = @mention
comman... etc etc

#

i do it the cheat way tbh LOL

quiet bobcat
#

lol

low owl
#

@languid dragon Not keen in JS, what does split(/ +/g) do? 🤔

#

Is that like an empty space?

languid dragon
#

ok so

low owl
#

Or is that Regex..

languid dragon
#

]]ev "message with spaces and such".split(/ +/g)

river compassBOT
#
📥 Input ~
"message with spaces and such".split(/ +/g)
📤 Result ~
[ 'message', 'with', 'spaces', 'and', 'such' ]
low owl
#

Ah, exactly what I thought then

languid dragon
#

that's why my args is returned as an array

#

so you could check for args[0] for a mention to ban

low owl
#

]]ev "message with spaces and such".split(' ')

river compassBOT
#
Only Developers can use this command!
low owl
#

😦

languid dragon
#

should do the same

#

]]ev "message with spaces and such".split(' ')

river compassBOT
#
📥 Input ~
"message with spaces and such".split(' ')
📤 Result ~
[ 'message', 'with', 'spaces', 'and', 'such' ]
austere meadow
#

@earnest phoenix quick random question, with the new equalizer coming to LL would we be able to bass boost music too?

#

that'd be pretty neato

earnest phoenix
#

yeah

austere meadow
#

nice

earnest phoenix
#

@languid dragon not to be rude, but thats a shit way

#

😐

languid dragon
#

lmao

#

what's ur way

earnest phoenix
#

I'll write good way in a sec

austere meadow
#

idk i dont think its too bad but eh

#

if theres a better way ill take it

languid dragon
#

@river compass ev @austere meadow

river compassBOT
#
📥 Input ~
@austere meadow
📤 Result ~
Unexpected token <
low owl
#

Well, technically you don't need to split twice

austere meadow
#

i just realized i spelt command wrong in comandUnfiltered lmfao my code is such a meme

languid dragon
#

same

#

im doing a huge rewrite

#

my command system right now is weird

#

]]ev this

austere meadow
#

AlycatBot

#

oof

languid dragon
#

yes

#

that's my main class

#

inb4 i break my bot

#

]]ev this.Main = null

low owl
#

Aw, I wasn't done reading it 😦

austere meadow
#

broke

languid dragon
#

br0ke

earnest phoenix
#
const regExpEscRegex = /[-/\\^$*+?.()|[\]{}]/g;
function regExpEsc(str) {
    return str.replace(regExpEscRegex, "\\$&");
}
const prefix = new RegExp(`^<@!?${regExpEsc(client.user.id)}> |^${regExpEsc(prefix)}`).exec(message.content);
if (!prefix) return;
const args = message.content.slice(prefix[0].length).trim().split(/ +/g);
const cmd = client.commands.get(args.shift().toLowerCase());
if (!cmd) return;```
languid dragon
#

what

#

that look so overly complicated

low owl
#

I mean yeah, that would work, but I would not be using regex to be honest

bitter sundial
#

looks like a bunch of shit was just thrown on my screen

#

oh wait it was jacz's code

languid dragon
#

wanna see my rewrite command handler?

earnest phoenix
#

Sorry that discord codeblocks are cancer

austere meadow
#

@languid dragon yee boi

#

lets go kk

languid dragon
#

ok 1 sec

#

ur not gonna understand it at all

austere meadow
#

lmao

earnest phoenix
#

btw, Regex is the best way to do that

languid dragon
earnest phoenix
#

I've tried 3 different ways and regex is the simplest

low owl
#

Assuming you know the type of prefixes you allow beforehand

#

then Regex is neat, otherwise kind of eh..

austere meadow
#

@languid dragon pretty nice

#

i like it

languid dragon
#

1 sec ill show u the command layout

#
module.exports = new Command(
  ['ping'],
  [false, 'ADMINISTRATOR'],
  "Pong",
  false,
  async (m, a) => {
    const now = new Date().getTime()
    const roleColour = m.guild.me.displayColor
    await m.channel.send('Pinging...', { embed: { color: roleColour, description: '...' } }).then(async (m2) => {
      const after = (new Date().getTime()) - now 
      await m2.edit('Pong! ~ owo', { embed: { color: roleColour, description: '`API :: ' + Math.floor(m.client.ping) + 'ms`\n`MSG :: ' + Math.floor(after) + 'ms`' } }).catch(Error)
    }).catch(Error)
  }
)
earnest phoenix
#

I dislike

#

a lot

bitter sundial
#

same

austere meadow
#

the command layout

#

i mean

#

im sorry ken

#

its just not so nice

bitter sundial
#

i cant tell what is what without looking at the constructor of command

austere meadow
#

yeah thats what i was thinking

#

tbh mine isn't much better

bitter sundial
#

would rather pass an object

languid dragon
#

basically it goes like this

module.exports = new Command(
    [], // triggers for command
    [user_permsisions, bot_permissions],
    "", // short description
    "", // long description
    async (message, args) // the function
)
austere meadow
bitter sundial
#

what if bot needs multiple perms

languid dragon
#

its an array

earnest phoenix
#
const { Command } = require('klasa');

module.exports = class extends Command {

    constructor(...args) {
        super(...args, {
            name: 'yourCommandName',
            enabled: true,
            runIn: ['text', 'dm', 'group'],
            cooldown: 0,
            bucket: 1,
            aliases: [],
            permLevel: 0,
            botPerms: [],
            requiredConfigs: [],
            description: '',
            quotedStringSupport: false,
            usage: '',
            usageDelim: undefined,
            extendedHelp: 'No extended help available.'
        });
    }

    async run(msg, [...params]) {}

    async init() {}

};
#

my style

languid dragon
#

bot_permsisions = array

low owl
#

@languid dragon If you want to step up your game you should consider introducing more objects

bitter sundial
#

@austere meadow when you have
let variable = whatever
{variable: variable}

you can just do {variable}

earnest phoenix
#

^

austere meadow
#

yeah i know :/ i just do it so it looks nice but ill actually change it now

#

just wasting space

earnest phoenix
languid dragon
#

does everyone else set commands in a map?

low owl
#

JavaScript is weird 😐

earnest phoenix
#

yes

austere meadow
#

^ i do

languid dragon
#

ok lit

austere meadow
#

oo thats a nice theme jacz

#

on the editor

languid dragon
#

]]ev Main.Commands.get('ping')

earnest phoenix
#

Monokai pro

languid dragon
#

nice

#

oh thats right i broke the ev command lmao

austere meadow
#

00f

coral lichen
languid dragon
#

]]eval Main.Commands.get('ev').Main = Main

#

]]ev 2+2

#

k den

coral lichen
#

4

earnest phoenix
languid dragon
#

-bots @earnest phoenix

gilded plankBOT
#
Jacz#0001
Bots <:dblSupporter:401725034453925889> <:dblCertifiedDev:401725450470031362>

@limber frigate dblCertified
@near coral

languid dragon
#

do u contribute for York?

earnest phoenix
#

Im a contributor of misaki

languid dragon
#

nice

#

u know i suggested that name

earnest phoenix
#

yes

languid dragon
#

was the name of @river compass ages ago

earnest phoenix
#

uwu

languid dragon
#

like 20 names ago haha ecksdee

austere meadow
#

Haha!

languid dragon
#

]]eval

earnest phoenix
#

lmfao

languid dragon
#

sigh

#

i need a backup eval

austere meadow
#

rip ken

low owl
#

Where are all these Anime/Japanese names coming from? 😛

austere meadow
#

its hard being ken seriously i mean are you ok ken

#

how you holding up

languid dragon
#

dying

austere meadow
#

@low owl anime bots perform better mmLol3D

earnest phoenix
#

im currently making my music more OOP based

low owl
#

Just like my blue RBGs?

languid dragon
#

people love weeb shit

#

and i think @river compass is a cute name

#

OwO

austere meadow
#

it is owo

low owl
#

Choose a Latin name zoomeyes

languid dragon
#

restarted cos im an idiot

#

i had a latin name

low owl
#

What was it?

languid dragon
#

Utilitatem

earnest phoenix
languid dragon
#

lmao

#

nice

low owl
#

@languid dragon Usefulness, advantage? 😄

languid dragon
#

yeaha

#

kinda on the lines of a utility bot

#

]]ev -s (function(){ Client.users.get('246574843460321291').send('nice meme').then(g => g.delete(2000)) })()

#

waits

austere meadow
#

lul delete didn't work

low owl
#

I named my bot Animus because it understands natural language and has a "character/mind/intellect" lol

#

why's your eval command broke btw?

languid dragon
#

damn

#

its not

#

]]ev -oo 2+2

river compassBOT
#
4
languid dragon
#

parameters LUL

low owl
#

Oh, seemed so 😄

languid dragon
#

-s = silent

austere meadow
#

damn you've got so many switches on ur eval

languid dragon
#

]]ev --silent 2+2

austere meadow
#

its good

languid dragon
#

1 sec

#

    if (Args[0] === '-s' || Args[0] === '--silent') {
      Args.splice(0, 1)
      silent = 1
    }
    if (Args[0] === '-l' || Args[0] === '--log') {
      Args.splice(0, 1)
      loggit = 1
    }
    if (Args[0] === '-oo' || Args[0] === '--output-only') {
      Args.splice(0, 1)
      outOnly = 1
    }
austere meadow
#

i used to have a thing on my eval command --gist where it would post the response of the eval to a gist but i removed it because i never used it lmao

low owl
#

@proper veldt Evaluate whether its worth living life

#

¯_(ツ)_/¯

earnest phoenix
#

lol i have --slient, --depth=depthnumber, --showHidden the showHidden nodejs util inspect option

languid dragon
#

i had --repeat

#

but it was OP

#

i think the favourite part of my bot

#

the thing i'll be adding to my rewrite

#

is the help command

low owl
#

Show it 😛

languid dragon
#

best use of regex

#

]]help ping

#

]]help util

low owl
#

Yeah, that looks cool

languid dragon
#

basically the regex automatically matches the nearest related string

#

so like

low owl
#

I've something "similar"

languid dragon
#

]]help inv

#

]]help su

low owl
#

@proper veldt How do I use the undo feature?

languid dragon
#

it'll show multiple if there's more than one match

austere meadow
#

thats neatO

low owl
#

Ah.. can it even post in here?

languid dragon
#

likely not EYES

low owl
#

Welp

languid dragon
#

i enabled my bot to use it for eval examples lmaoooo

low owl
#

Anyways, I like your help 😄

languid dragon
#

ay no problem

#

i love JS

low owl
#

I hate it

languid dragon
#

you wanna see my favourite object in my bot?

low owl
#

Yes sure

languid dragon
low owl
#

"slap_image"

#

what's that? 😄

languid dragon
#

]]slap Brian

low owl
#

lmao

languid dragon
#

basically i have a few

#

]]slap

river compassBOT
low owl
#

That's actually good

languid dragon
#

i just have a bunch of coordinates

low owl
#

most of these image kind of thingies are pretty crap

languid dragon
#

and reference to specific ones using "r" which is the random number used between 0 and the amount of images i have

low owl
#

If you have a lot of free time you could implement pseudo randomness

#

so it doesn't repeat as often

languid dragon
#

ay

#

i probably would do some sort of organised random system

#

but tbh it doesn't do too bad on it's own

#

i would likely do it when i add more images

#

but yeah been a bit busy

low owl
#

Well, repeats are more noticeable when you have a small data set

languid dragon
#

steals

uncut slate
#

oh

#

ok

low owl
#

Looks good 😛

earnest phoenix
#

idiotic api

languid dragon
#

]]slap @uncut slate

uncut slate
#

uh

languid dragon