#development

1 messages · Page 516 of 1

tight heath
#

Or the docs haven't updated yet to reflect the changes.

#

Either way it's forbidden.

#

And will get you banned at a high chance.

#

I actually have a friend who got his account banned

terse pier
#

No, I'm using latest disord library in python 3.6.6

hushed berry
#

@tight heath wdym use a proper way

tight heath
#

@hushed berry for that database lmao. I'm just joking.

quartz kindle
#

why make a self-bot when you can make a userscript :^)

tight heath
#

All client mods are banned sadly

#

Even BD

#

I know you're using the best way known to you (and me) :p @hushed berry

terse pier
#

I like that feature because it lets me write all messages to terminal but I think that there should be clearly stated in API that self bots are not allowed

tight heath
#

Tell the devs

#

But there is a clear statement by Discord.

sick cloud
#

so this is my shards command

await client.shard.broadcastEval('this.shard')
        .then((results) => {
            const embed = new MessageEmbed()
            .setAuthor(`All shards`, client.user.displayAvatarURL({ format: 'png' }))
            .setColor('#ED1B24')
            .setFooter(`${results.length} shards total`)
            results.forEach(shard => embed.addField(shard.id, `${~~shard.ws.ping}ms`));
            return msg.channel.send({ embed: embed });
        });

how do i get it to show the ping? shard.ws.ping is undefined lol

earnest phoenix
#

shardClientUtil does not have a ping property

sinful lotus
#

@sick cloud if you use latest master client.ws.ping

#

if not client.ping

sick cloud
#

client doesnt exist tho

#

thats for the current shard

#

@earnest phoenix then how can i get one lol

earnest phoenix
#

Wdym client doesn't exist

sinful lotus
#

oh

#

you cant broadcastEval complicated objects

#

I think

earnest phoenix
#

No...not the issue at all

sinful lotus
#

like discord.js collection but I dont think you use that

earnest phoenix
#

The issue is that he's trying to access an undefined property

sick cloud
#

i tried evaling this

#

then accessing .shard etc

#

but it failed

earnest phoenix
#

Client is bound as this

sinful lotus
#

what did you eval

sick cloud
#

broadcastEval(this)

earnest phoenix
#

this.ws.ping

sick cloud
#

so i eval .. this.ping && this.shard?

#

i need the ping and shard id

sinful lotus
#

just for clarification

#

what master commit you use

sick cloud
#

#3f44320bbe23f5de829fdad0e19f4381f634ef62

sinful lotus
earnest phoenix
#

The indexes of the array represent the shard number

#

So, the first element is shard 0

#

Second shard 1, so on so forth

#

So you don't really need the ID

sick cloud
#

oh

#

ok

sinful lotus
#

also maybe dont eval the whole this.shard property

#

takes some time to get that ^

west raptor
#

@sand halo you probably disabled disabledeveryone in client options

#

disableEveryone*

sand halo
#

🤦

torpid sable
#

does anybody know how to code a prefix command, with discord.py

bright spear
#

@torpid sable we won't code anything for you

torpid sable
#

ik

bright spear
#

I'm sure there are tutorials

torpid sable
#

i was just asking for tips and i forgot to mention that.

#

oof

bright spear
#

Well you'll need a database

torpid sable
#

my friend reccomended tinydb but idk how to use it

tight heath
#

rethink is love, rethink is life, fight me

quartz kindle
#

anyone who uses postgres, whats its average memory consumption?

hollow fulcrum
#

just write to disk

#

dont use postgres nonsence

serene cobalt
#

Postgres or bust.

quartz kindle
#

what would be the most memory-efficient way to perform full text search on a 50mb database?

#

thats also fast

#

im currently using sqlite FTS5

#

and its doing a decent job

#

just wondering if theres anything better

earnest phoenix
#

Write to disk? Oh no...

#

hello

#
    client.on('message' , message => {
      var prefix = "-";
      if(message.author.bot) return;
    
      if(message.content.startsWith(prefix + "bcrole")) {
        let args = message.content.split(" ").slice(1);
    
        if(!args[0]) {
          message.channel.send("قم بمنشنة الرتبة | #bcrole @everyone message")
            return;
        }
        if(!args[1]) {
          message.channel.send("قم بكتابة الرسالة | #bcrole @everyone message")
            return;
        }
    
          if(args[0] == "@everyone") {
            message.channel.send(`لقد تم ارسال هذه الرسالة الى ${message.guild.memberCount} اعضاء`)
            message.guild.members.forEach(m => {
              m.send(
              "**" + "السيرفر :" + "\n" +
              `${message.guild.name}` + "\n" +
              "المرسل :" + "\n" +
              `${message.author.tag}` + "\n" +
              "الرسالة :" + "\n" +
              `${args[1]}` + "**"
              )
            })
            return;
          }```
#

this code is allowed ?

#

this sand massge members in server if members have role

#

allowe or not

#

?

weary zodiac
#

@earnest phoenix No not allowed lol

hollow fulcrum
#

I write to disk @earnest phoenix i have not regretted

inner jewel
#

if you write to disk yourself you'll end up suffering if you ever have to write a complex query

patent reef
#

Will
(Date.now() - 604800000) < Date.now()
work for checking if 1 week has passed?

slim heart
#

Ok I asked this question yesterday and it never got answered so here:

#

What's actually going wrong here? Because this only happens if there's only 1 arg (after I .split(' ')) but if it's one argument it always does this idk...
https://cdn.discordapp.com/attachments/272764566411149314/510255842415607808/unknown.png
actual code:

for(i=0; i < arg.length; i++) {
            if(arg[i].match(/http/gi)) {
                linkbypass.links.forEach(bs => {
                    let bsr = new RegExp(bs, 'gi')
                    if(arg[i].match(bsr)) {
                        arg = arg.filter(f => f !== arg[i])
                    } 
                })
            } else {
            arg[i] = arg[i].replace(/("|\*|\.|'|\||\\|\/|`|\<|\>|@|#|!)/gi, '')
            }
        }
        ```
inner jewel
#

arg = arg.filter(...)

#

on the first link regex that matches

#

once it tries another one

#

arg is now empty

#

so arg[i] is undefined

slim heart
#

no but it's only filtering arg[i]

inner jewel
#

you reassign arg

#

so it may not have the element that was arg[i] anymore

slim heart
#

but this still works

#

also i redefine arg but it just equals []

#

if there's only one arg

#

and it's not trying to use arg[i] anymore after it filters so why would it error?

#

also @inner jewel obviously it's not a problem because this error only happens when there's only one argument. Everything else is defined fine but if arg.length is only one then it wouldn't even need it anymore anways

#

??

inner jewel
#

use a debugger and you'll see the error

#

exactly as i described

slim heart
#

Idk any debuggers

#

but still using logic that couldn't make any sense?

#

It wouldn't try and match anything after I filtered

inner jewel
#

links.forEach

slim heart
#

so even though, one that's wrong in general because if i filter then arg would still be left with everything else so shouldnt run into any problems, and it doesnt when there are multiple args which is the only situation that'd even make a difference in. and then it wouldnt be trying to match anything after i got rid of arg[i] because that's just it

inner jewel
#

that's a loop

#

it'll continue running as long as there's data left

#

your code would error for any input that has a link as the last element

slim heart
#

ohdqiwhqdw

#

i see

#

so can i do something like this

let ok = false
linkbypass.links.forEach(bs => {
                    let bsr = new RegExp(bs, 'gi')
                    if(arg[i].match(bsr)) {
                        ok = true
                    } 
                })
if(ok == true) {
arg = arg.filter(f => f !== arg[i])
}```
rocky mesa
#

okay so I'm really dumb, so I run here for some help from smart people. I'm trying to make a blacklist command so if someone is abusing the bot i can do a command to blacklist them. any ideas/help would be greatly appreciated.

#

(discord.js)

gilded blaze
#

Basic idea would be to have some way to add id's to a database and if you want speed caching them on startup then after you check if the message is a command check if they are on the blacklist and return if they are.

rocky mesa
#

yeah, kinda what I thought

#

all I really have to do is make a command to add id's to a blacklist file

#

I have no idea how to execute that idea

sick cloud
#

not a file

#

use a database

rocky mesa
#

yes sir/ma'am GWvertiPeepoSalute

slender thistle
#

Tony is a cute girl

slender thistle
#

url("MY LOVELY LINK")

#

iirc

earnest phoenix
#

give an example

knotty steeple
#

shh bakagain

#

im making a gif

earnest phoenix
#

@earnest phoenix right click image

#

at the end

#

add !important

knotty steeple
#

not needed

earnest phoenix
#

just try tho

#

no

gritty quail
#

upload it to imgur

earnest phoenix
#

outside the parenthesis

#

oh yeah

gritty quail
#

I feel that's much better

earnest phoenix
#

theres that

gritty quail
#

what are you doing this for?

earnest phoenix
#

I feel like you were certified @gritty quail

#

@earnest phoenix does it work?

gritty quail
#

Nah I'm just a normal joe

earnest phoenix
#

k cool

#

wym

#

is it repeating the same image

#

it'll be something like

#

background-repeat

spring wharf
#

wait you can use css in bot pages?

earnest phoenix
#

idk

#

@spring wharf yeah

spring wharf
#

o

earnest phoenix
#

uhh

spring wharf
#

holy shit my bot page looks like absolute garbage

earnest phoenix
#

i can link you to a tutoral that does

spring wharf
#

I added html to it yet it just looks like shit

#

like wtf?

knotty steeple
#

background-repeat: no-repeat !important;

gritty quail
#

lmao

earnest phoenix
#

^

spring wharf
#

Ohhh

#

I forgot to use paragraphs

knotty steeple
#

its css who cares

earnest phoenix
#

i knew it was background-repeat

#

yeah

#

maybe

knotty steeple
#

no

earnest phoenix
#

sad

knotty steeple
#

you use it on background-size

earnest phoenix
spring wharf
#

ah w3schools

#

good site

#

for learning basics

earnest phoenix
#

yee

knotty steeple
#

cover isnt a property

spring wharf
#

what is the BOT_DISCORD_ID in the discordbotlist API?

#

is it like the client ID?

knotty steeple
#

yes

spring wharf
#

ok

#

@long sierra

#

just pinging so I can copy

knotty steeple
#

idk whats a text box

spring wharf
#

he means the main box with the info

#

aka description field

earnest phoenix
#

its like

spring wharf
#

one last question about the API

#

I found this code on the docs

#
ISelfBot me = await DblApi.GetMeAsync();
// Update stats sharded   indexShard shardCount shards
await me.UpdateStatsAsync(24,        50,        new[] { 12, 421, 62, 241, 524, 534 });

// Update stats           guildCount
await me.UpdateStatsAsync(2133);```
#

where would I apply this?

earnest phoenix
#
.long-description {
 //c
}
knotty steeple
#

is that c#

spring wharf
#

yeah

knotty steeple
#

maybe in the ready event

spring wharf
#

🤔

#

do you mean RunBot?

earnest phoenix
#

most likely

#

idk

knotty steeple
#

whatever event fires whenever the bot connected to discord

spring wharf
#

ok so RunBot

earnest phoenix
#

i guess

spring wharf
#

and "ISelfBot" causes an error hwo nice

#

how nice*

#

not suggesting any using I should try :v

earnest phoenix
#

you can use chrome web tools

#

wait

#

what browser are you using?

#

anyways

#

go on chrome

knotty steeple
#

ctrl

#

shift

#

i

earnest phoenix
#

and press f12

#

no

#

go up to the thing with the cursor in the top left corner

#

wut

#

show pic

quartz kindle
#

you're in the console

#

switch to elements

#

thats right

#

see the two sections in the right side? you can chose an element on the left one, and change its css on the right one

#

so you can test your css live

#

before you put it in the code

earnest phoenix
#

Does anyone know how to solve this?

sick cloud
#

listen for errors

earnest phoenix
#

@sick cloud it seems to be in discord.js though?

restive silo
#

listen for the error event meguFace

earnest phoenix
#

@restive silo ah thank you @sick cloud

#
dl.on('error', err => {
    console.log('An error has occurred: ' + err);
});
knotty steeple
#

nope

#

still gonna say [object Object]

earnest phoenix
#

@knotty steeple Then what?

knotty steeple
#

err => { console.log('An error has occurred: ' + err); }

#

remove all of this

#

and add your console logging function

earnest phoenix
#

So

#

dl.on('error', err => console.log(err))

knotty steeple
#

(err) remove this

#

err => and this

earnest phoenix
#

dl.on('error', console.log);

#

wat

knotty steeple
#

yes

earnest phoenix
#

but

#

wat

#

are u sure

knotty steeple
#

its valid code

earnest phoenix
#

okay if you say so

#

but console.log is a method

#

so shouldnt it be console.log()

knotty steeple
#

someone else can explain

earnest phoenix
#

Well it seems to run so

#

We'll see if it occurs again

#

Thank you

knotty steeple
#

np

earnest phoenix
#

guys

#

idk java

#

script

#

but

#

i need help in something, its not worth learning just for one single stupid line

#
  member.createDM().then(function (channel) {```
#

how do i use the settimeout on this

ionic barn
#

wdym

#

like wait to make the dm?

earnest phoenix
#

i want this to creatadm every 1 minute

#

yea

#

wait to make the dm

ionic barn
#

timeout doesnt repeat

earnest phoenix
#

i want something that repeats

ionic barn
#

setInterval

earnest phoenix
#

yeah may i get help please sir

#

setInterval(member.createDM().then(function (channel) {; }, 3000);

#

i dont think that would work

ionic barn
#
setInterval(function,interval)
#

wouldnt work

earnest phoenix
#

yea

#

it looked weird

#

thats why

ionic barn
#
setInterval(()=>{
...
}),interval in ms)```
earnest phoenix
#

setInterval(()=>{member.createDM().then(function (channel) {}),10000)

#

that looks more weird

#

wouldnt work

ionic barn
#

i dont see nothing wrong there

earnest phoenix
#

oh

#

thanks pal

#

i will try it

ionic barn
#

wait

earnest phoenix
#

i am waiting, sir

#

where

ionic barn
#

before the interval

earnest phoenix
#

set(Interval(()=>{member.createDM().then(function (channel) {}),10000)

#

i think this is wrong

ionic barn
#

}))

earnest phoenix
#

looks way too wrong

#

oh

#

setInterval(()=>{member.createDM().then(function (channel) {})),10000)

#

like that?

ionic barn
#

seems k

earnest phoenix
#

thank you sir

earnest phoenix
#

how i do aliases to commands?

#

guys

#

help?

#
const client = new Discord.Client();

console.log("Welcome Again !");

 client.on("guildMemberAdd", member => {
setInterval(()=>{member.createDM()},1000)
  setTimeout(function(){ return channel.send("Hello , May i ask you for feedback for a website and a bot?"); }, 60000);
  setTimeout(function(){ return channel.send("thank you"); }, 240000);
  setTimeout(function(){ return channel.send("hope you enjoy it here"); }, 270000);
}).catch(console.error)

 
})
client.login("token");```
sick cloud
#

lint your code

#

or learn js

earnest phoenix
#

@sick cloud tony i am not going to learn js for one freaking stupid error

sick cloud
#

then don't ask us to debug your stupid mistakes

#

read your code

earnest phoenix
#

@sick cloud please help me

#

i am asking for help dude

sick cloud
#

stop mentioning me

earnest phoenix
#

daam

sick cloud
#

i've told you

#

read it

earnest phoenix
#

you are mean as

#

bro

sick cloud
#

you'll figure it out if you bother to try instead of being lazy

earnest phoenix
#

what do you mean

#

i have

#

tried for the past 10 minutes

cinder mango
#

How do I always open my bot?

earnest phoenix
#

and my friend was helping me out and we didnt figure it out

sick cloud
#

then try some more

#

@cinder mango what?

cinder mango
#

How can I always open my bot

earnest phoenix
#

why wouldnt you help me

#

right all most programmers are dogs

#

i am out

sick cloud
#

what do you mean by open

earnest phoenix
#

@cinder mango run the code 24/7 pal

cinder mango
#

online

earnest phoenix
#

yea

sick cloud
#

host it

#

on a vps or dedicated server

earnest phoenix
#

i can give you one for 2 days

#

only if i get help

sick cloud
#

i am out
yet your still here

#

smh

#

let me say it again

earnest phoenix
#

tony mate why are you like that

#

i was helping a dude

sick cloud
#

read your fcking code

earnest phoenix
#

i have

#

what do you mean

#

tell

#

me

#

whats wrong

#

instead of telling me to read it when i have read it

#

bro

sick cloud
#

you've literally forgot a ) or } somewhere

earnest phoenix
#

i see it

sick cloud
#

make sure every ( and { has a matching closing ) or }

earnest phoenix
#

setInterval(()=>{member.createDM().then( (channel)=> {})},1000)

#

tony

#

guess what

#

same stupid error

sick cloud
#

then read it all again and double check

earnest phoenix
#

am i messing

#

a

#

)

sick cloud
#

check

earnest phoenix
#

it must

#

be

#

{

sick cloud
#

then look and fix it

earnest phoenix
#

i just dont know

#

js isnt my thing

terse pier
#

Is here anyone experienced with googles OAuth 2?

#

I wan't to be able to update my playlist with discord bot, but this oauth throws me back wierd errors

earnest phoenix
#

Is there any way to take user input through the host console in NodeJS?

#

A simple link to a module/docs will work.

quartz kindle
#

you can pass arguments to the js file

#

node file.js arg1 arg2 arg3 etc

#

but if you want it to await input like an interactive cmd, then there are modules for that in npm

bitter sundial
#

there's a native module too

quartz kindle
#

readline can also be used in files

#

but yeah its the stdin stdout that does the job

earnest phoenix
#

Great. Thanks boys!

terse pier
serene cobalt
#

You're redirecting to localhost

#

not everyone runs a server on localhost:8080

terse pier
#

OK, but how can I make it this way?

serene cobalt
#

You can't make everyone run a localhost server smh

tight heath
#

uh sure?

#

I can make everyone run a localhost server zoomeyes

#

no but honestly

#

Type in your server IP

#

Not localhost

neat falcon
#

henlo qts, am trying to do a post:

const fetch = require("node-fetch");

exports.run = async(client, msg, args) => {
    if (!args[0]) return msg.channel.send(":x: I can't post nothing to Hastebin!");
    const res = await fetch(`https://hastebin.com/documents`, { method: 'POST', body: args.slice(0).join(" ") })
    msg.channel.send(`:white_check_mark: Posted text to Hastebin at this URL: https://hastebin.com/${res.body.key}`);
}```

however my bot responds with a /undefined, the fuck am i doing wrong
#

first time using node-fetch, no bulli

restive silo
#

node-fetch doesn't work like that LUL it returns a Reponse what extends Body and on that oyu can use methods like json or buffer so you wanna do something like .then(res => res.json())

#

that will give you the body as object

neat falcon
#

oh

#

can i still async it

restive silo
#

sure

neat falcon
restive silo
#

but care res.json returns also a Promise

neat falcon
#

how many fucking promises lmao

restive silo
#

ye

tight heath
#

Why was snek deprecated btw

neat falcon
#

ask the dev

restive silo
#

one for the Request itself, one for the Serialization

neat falcon
#

hmm

#

console.log(res.json(res=> console.log(res)))
tried logging this

#

promise pending

#

but i did a thing

#

wait no

#

fuck

#

im tired

#

ignore this laughboye

tight heath
#

Just use d.js

#

No need for extra deps

neat falcon
#

Lmao

inner jewel
#

fetch(...).then(r => r.json()).then(body => use(body.key))

earnest phoenix
#

I'd just use axios for requests nowadays

#

The thing I hate about the fetcg api is that the promise won't reject on non-200 status codes

restive silo
#

you can easely make that yourself tho

#
    async _fetch(url, options = { returnType: 'json', returnValue: true }) {
        const res = await fetch(url, options);
        if (res.ok) {
            if (options.returnValue) return res[options.returnType]();
        } else {
            throw new APIError(url, res.status, res.statusText);
        }
    }
``` i literally just do this
earnest phoenix
#

yeah, the fact that you have to do that, is why I hate it

restive silo
#

i see

#

no thats js

amber junco
#

Is is possible to run gifs in Embeds?

sonic monolith
#

Hey, is it possible to do non image attachments (normal files) in embeds?

amber junco
#

Yes

#

I think

tight heath
#

gifs inside embeds yes

#

Other attachments only alongside embeds

#

@sonic monolith @amber junco

sonic monolith
#

meh

amber junco
#

But when I put a URL in an embed, my bot doesnt send actual gif, it send ONLY the link in the embed

sonic monolith
#

thanks for answering

#

you'll have to declare it as an image

amber junco
#

Yes I did

quartz kindle
#

you have to send the image as an attachment

bitter sundial
#

@inner spruce is your bot even sharded

inner spruce
#

Yeah

amber junco
#

Tim, how do you send the gif as an attachment?

inner spruce
amber junco
#

Wait

#

nvm

inner spruce
#

Only gives the error when it updates after the timeout

bitter sundial
#

is your code removing the shard object then?

inner spruce
#

It's on top ill send a snippet after my game

amber junco
#

Tim, how do you send the gif as an attachment?

#

lmao

#

I am baka

inner spruce
#

index.js

const config = require("./config.json");
const Discord = require("discord.js");
const { ShardingManager } = require('discord.js');
const manager = new ShardingManager('./bot.js', { token: config.botToken });

manager.spawn(4);

manager.on('launch', shard => console.log(`Launched shard ${shard.id}`));

bot.js

const DBL = require("dblapi.js");
const dbl = new DBL('key', bot);

bot.commands = new Discord.Collection();

bot.on("ready", () => {
    console.log(`Call Of Duty: Black Ops 4 Beta Bot is online.`)

    bot.user.setPresence({ activity: { name: 'BETA Stats Bot' }, status: 'online' });

    setInterval(() => {
        dbl.postStats(bot.guilds.size, bot.shards.id, bot.shards.total);
    }, 1800000);
});
chrome olive
#

Error: ER_HOST_IS_BLOCKED: Host 'bla' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
how can i solve it?

random rapids
#

Lmao uou got api block?

restive silo
#

?

#

what did you ping me for

#

?!?!?!

#

you said that before fucking pinging me

#

wtf

past lichen
#

нихуэнд

restive silo
#

i would like ot not get random pings in here thanks

coral trellis
past lichen
#

О чём вы, а? У моего бота пинг за 500

queen sentinel
terse pier
#

@serene cobalt but I need it only for my purpouse 😄

slender thistle
#

The Russian wasn't asking/answering questions related to development anyways mmLol

chrome olive
#

Error: ER_HOST_IS_BLOCKED: Host 'bla' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
How can i solve it?

slender thistle
#

Let's read the error

chrome olive
quartz kindle
#

unblock with 'mysqladmin flush-hosts'

lethal sun
#

How can I detect when an emoji has been added/removed/changed in a guild? Talking about discord.js.

knotty steeple
#

read the docs™

lethal sun
#

.-.

#

Been searching in there for a while.

tight heath
lethal sun
#

Thank you.

summer ore
#

guys how can i get live score for discord bot with java?

#

I can't find any free api

heady anvil
#

what score?

summer ore
#

football

quartz kindle
#

what league/tournament?

summer ore
#

turkish league

quartz kindle
#

if you cant find it, it probably doesnt exist

#

you'll have to scrape it off of sports websites or something

heady anvil
#

point a camera at your tv and run a machine learning algorithm to recognise the score

summer ore
#

@heady anvil it's cool but 😄

quartz kindle
#

find a website that does live updates, and get data from it

summer ore
#

okey thanks i'll try

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

  if(err) console.log(err);
  let jsfile = files.filter(f => f.split(".").pop() === "js");
  if(jsfile.length <= 0){
    console.log("Couldn't find commands.");
    return;
  }

  jsfile.forEach((f, i) =>{
    let props = require(`./commands/${f}`);
    console.log(`${f} loaded!`);
    bot.commands.set(props.help.name, props);
  });

});
}

what i need add this to do aliases?

knotty steeple
#

what

#

r/engrish

#

try to say that again

earnest phoenix
#

i dont speak english good lol

#

i want add aliases to my commands

#

what i need add to this code

#

to do aliases?

knotty steeple
#

ok so you have to make a collection for the aliases

#

like how you did for bot.commands

split dune
#

@earnest phoenix add, props.help.alias ? lol

earnest phoenix
#

yo how do I add so it shows how many servers the bot is on

#

like on the web

keen drift
#

the api

sonic cove
#

How i can ban user and delete all message from last 7 days?

knotty steeple
#

banning users already deletes messages

#

if you choose it to

slim heart
#

H o w t o s h a r d ?

#

Is there like a video or something I can watch- idk

knotty steeple
#

w h a t l i b r a r y

slim heart
#

d i s c o r d . j s

ionic wind
#

d i s c o r d . p y

knotty steeple
#

oh

agile lodge
#

d i s c o r d . t o a s t

earnest phoenix
#

d i s c o r d . w h e n c a n i d i e

agile lodge
#

d i s c o r d . n o w i f u w a n t

slim heart
#

no seriously

#

How do

ruby dust
#

Kids these days...

slim heart
#

pls

knotty steeple
#

nice shitpost

agile lodge
slim heart
#

th an k

#

ok cool

#

Got it lol

#

But that example only gives an option for 5000 each how do i do a different amount?

knotty steeple
#

500 what

slim heart
#

5000*

knotty steeple
#

5000 what

slim heart
knotty steeple
#

just take 2500 * shardcount

#

i

#

think

topaz fjord
#

1000 per shard is what people usually do

slim heart
#

where do i put that though-

topaz fjord
#

2500 is when it's mandatory

slim heart
#

Yeah

#

I need to go 500

#

Because I've delayed all my commands in order to hurry up the censoring but it's still like a pretty big delay and it's getting worse the more servers

drowsy lily
#

its 2018 and there are still shard managers out there that dont auto shard by the recommended amount coming from discord?

topaz fjord
#

For d.js sharding you need a separate file

knotty steeple
#

you dont have to shard at 500

#

wtf

slim heart
#

Yes I do

ruby dust
#

I don't think you choose the server count per shard, discord doesn't for you, you only handle the shard count

slim heart
#

You don't see what i see

ruby dust
#

Does it*

slim heart
#

I would've sworn you can choose the amount?

#

per shard

knotty steeple
#

you can spawn 2 shards

drowsy lily
#

I don't think you choose the server count per shard, discord doesn't for you, you only handle the shard count

no you can choose your own but why would you

topaz fjord
#

Sharding at 500 is the stupidest fucking thing I've heard

knotty steeple
#

ikr

slim heart
#

l i s t en I need it ok

knotty steeple
#

you dont

topaz fjord
#

you don't choose how many per shard, it's all based on server id

#

you don't need it you want it but there is no valid reason

knotty steeple
#

^

slim heart
#

I'm not arguing whatever sure

ruby dust
#

Either way, you have the information you wanted,why are you still here?

topaz fjord
#

we gave you all you need, it's pretty self explanatory

slim heart
#

I still don't know how to choose the amount of servers per shard like gnu said

ruby dust
#

You dont

knotty steeple
#

you dont

quartz kindle
#

you dont

ruby dust
#

Nice

agile lodge
#

you....can....not

knotty steeple
#

LOL

topaz fjord
#

you don't

#

the formula is on discords developer docs

quartz kindle
#

if you have 1000 servers, and you put shard count 2, it will be ~500 on each shard

slim heart
quartz kindle
#

if you have 500 servers and you put shard count 5, it will be ~100 each shard

slim heart
#

Oh I see

#

Ok fair enough

topaz fjord
#

@quartz kindle not necessarily

drowsy lily
#

@slim heart dont quote me kthx

knotty steeple
#

@topaz fjord try out ahk

slim heart
#

"me"

knotty steeple
slim heart
#

Alright I'll leave

#

lol

topaz fjord
#

I've seen some shards that have drastically different guild counts

quartz kindle
#

notice the use of ~

drowsy lily
#

my quote does not justify your plan

topaz fjord
#

fucking tilda looking like a dash

ruby dust
#

Your avatar states the opposite

drowsy lily
#

putting less servers on a shard than recommended will leave you worse off in pretty much all dimensions

#

if your shit code has performance issues with too many guilds i suggest you go fix that instead

quartz kindle
#

sharding low amount of servers is like writing 1kb files on 64kb allocation units

hushed berry
#

I'm running 32 shards for my test bot rn :^)

zenith moss
#

....

hushed berry
#

😂

#

most of the shards dont even have any guilds assigned to them

zenith moss
#

I don’t need to shard for a long ass time

sick cloud
#

me and my friend are debating between github and gitlab

#

what do we do

rigid belfry
#

just accept how much better gitlab is

sick cloud
#

no

rigid belfry
#

sad

earnest phoenix
#

gitlab has unlimited private repos for free

#

so that's a + in my opinion

rigid belfry
#

that's one of many

earnest phoenix
#

i have free unlimited private repos on github aswell

topaz fjord
rigid belfry
#

no

earnest phoenix
#

How do I get an iframe working in the bot description? I enter the url to my website but I only get a white screen. Any tips?

topaz fjord
#

is the website https

earnest phoenix
#

nope, it's http

#

eek

#

it's not like there's any data you can feed into it anyways

#

but that's the issue ay?

#

Might have to get a SSL cert then

topaz fjord
#

it wont work without https

#

since dbl is https the iframe link must be https

earnest phoenix
#

ayhe, true that

coral trellis
#

Anyone know how to fix this: error not found: git

earnest phoenix
#

yes, git isn't found

#

install git

coral trellis
#

Clearly

#

I did PMonkaBan

stable tide
#

Add it to path

#

Check if its there if the error is like that then 2 strong possibilities are

Git isnt installed
Git isnt added to path

#

@coral trellis ^

coral trellis
#

Yeah thanks

stable tide
#

np :)

earnest phoenix
#
2
3 using namespace std;
4 
5 int main () 
6 {
7 int a;
8 int b;
9 int sum;
10
11 cout << "Please enter your first digit! n\";  
12 cin >> a; 
13
14 cout << "Please enter your second digit! n\";
15 cin >> b; 
16
17 sum = a + b;
18 cout << "The sum of those numbers is" << sum << endl; 
19 }
20
21```
sick cloud
#

why do shard IDs in djs revert?

#

i set my activity to [id] but it keeps reverting to my old [#id']

uncut delta
#

@earnest phoenix copy pasta

sinful topaz
#

how can I do it ?

earnest phoenix
#

what

stable tide
#

@earnest phoenixisnt it /n thonkku

earnest phoenix
#

no

#

its \n

whole karma
#

On the Webhook Url, what should be put in there?

earnest phoenix
#

your webhook url.

jagged plume
#

oh lol

#

why is it adding the extra slash

whole karma
#

I kinda don't get it.

earnest phoenix
#

then use the standard method

jagged plume
#

the ip to your vps + port + path

whole karma
#

That?

jagged plume
#

you need to be running a web server of some sort to be able to actually get the requests

#

0.0.0.0 is a local ip

whole karma
#

Oh.

jagged plume
#

you need the public ip

#

the one you use to connect to the vps, assuming you're using one

whole karma
#

I just need it for upvoting then the upvoter will get reward. 😦 But i kinda don't get it.

earnest phoenix
#

i mean

#

like you could just use a premade lib for that

#

¯_(ツ)_/¯

#

wait

#

no

#

im dumb

jagged plume
#

looks like they have it setup but they're just not able to put the url in lol

earnest phoenix
#

if it's a vps just get the public ip?

jagged plume
#

thats what i said

earnest phoenix
#

if you're using a computer...

#

uhh yeah

#

invest in a proper hosting

#

¯_(ツ)_/¯

whole karma
#

💭

#

Oh.

earnest phoenix
#

but yeah if you have a vps

#

just get the public ip address

whole karma
#

Like glitch

#

?

jagged plume
#

doesnt glitch give you a domain thingy

earnest phoenix
#

does glitch even have a public ip address

jagged plume
#

yes?

earnest phoenix
#

How to post Server Count to API

jagged plume
#

glitch is designed for apps/websites so yes lol

earnest phoenix
#

yeah

coral trellis
earnest phoenix
#

but like how would you get the public ip

whole karma
#

Kinda.

earnest phoenix
#

idk but if you're using glitch

#

ehhhhh

whole karma
#

Yes, i'm using glitch.

earnest phoenix
#

get a vps lol

jagged plume
#

or something

#

like project name

earnest phoenix
#

¯_(ツ)_/¯

jagged plume
#

yeah it is im sure

whole karma
#

Yes

jagged plume
#

so you'd put project-name.glitch.me:5000/dblwebhook

#

not hard

whole karma
#

Oh, I see. Thanks

round solstice
#

Hey, does anyone want to help me design a new RPG bot?

#

I'm going with a space-themed, futuristic approach where players can mine, trade, kick each other in the ass and play in a dynamic galaxy.

#

If anyone is interested in working with me, shoot me an DM.

uncut delta
#

Is i can create a webhook and delete it after webhook sent message using code

#

Or there is a ratelimit?

#

Anyone can help?

rugged pond
#

Did someone now this : my bot token regenerate when i reload the dash page thonking And when i log my bot with the token it's say "Invalid Token"

slender thistle
#

I hope you aren't copy-pasting only some part of the token

#

If you aren't, just regenerate it and try again

rugged pond
#

I have already try this ^^

#

I reload my page

#

And i have a new token..

#

@slender thistle

slender thistle
#

The previous one should still be available

rugged pond
#

Nop

#

Didn't work thonking

slender thistle
#

Discord you cuck thonkku

rugged pond
#

😦

#

And when i regenerate the token with a new, i copy it the button and paste the token and lunch my bot

uncut delta
#

That's not token

#

May be client secret

#

Jk

#

Regernate and copy and close that tab

slender thistle
#

Forgetting to save the file yet? thinkx4

rugged pond
#

Nop @slender thistle And @uncut delta it's the token and not the client secret

#

😦

uncut delta
#

Yeah ik

slender thistle
#

I have no doubts it's a token, dw ThinkButUpsideDown

rugged pond
#

Maybe my bot get ban ?

slender thistle
#

I have a doubt on that one

rugged pond
#

@uncut delta i try what you say and same problem

#

😕

uncut delta
#

Huh

sonic cove
#

someone know good meme api?

uncut delta
#

Make your own

sonic cove
#

i don't know where i can upload memes

#

or

slender thistle
sonic cove
#

where i can find meme collection for upload them on image and and then to json and random json url

ruby dust
#

learn basic english grammar first, please

sonic cove
#

no

#

Maybe im not fron English

#

kiddo

ruby dust
#

I'm 20, kiddo

sonic cove
#

k Kiddo

slender thistle
#

I'm just kidding. niceme.me is a no-go at this point

ruby dust
#

I like this guy, he stands for himself when he gets argued at

sonic cove
ruby dust
#

seems easy enough

round solstice
#

Nah

#

Too hard

ruby dust
#

no one asked you, greenname

#

oh wait

uncut delta
#

Lol

slender thistle
#

I hope you aren't going colorblind, Deive

ruby dust
#

actually I do have a little bit of colorblindness

#

almost only between green and blue

#

I sometimes can't tell the difference

uncut delta
#

Is i can create a webhook and delete it after webhook sent message using code

#

Or there is a ratelimit?

#

Anyone can help?

slender thistle
uncut delta
#

Discord's webhook*

slender thistle
#

Do you mean delete a webhook after it sent a message?

uncut delta
#

Yeah

ruby dust
#

yes, a webhook can be deleted afterwards

#

the message object will keep the author's name and avatar

uncut delta
#

Is there any limit of webhook or ratelimit?

ruby dust
#

webhooks have slightly more forgiving ratelimits on sending messages than anything else on discord

uncut delta
#

Ok thanks

earnest phoenix
#

Anyone familiar with Image Manipulation API's for JavaScript?

#

Please DM me if so

austere snow
#

Hi

#

All

earnest phoenix
#

@uncut delta wrong

#

@stable tide nope, it's \n

#

To change line

#

Or go to the next line

#

Uh

#

xD

#

You can also use endl; btw

torpid juniper
#
{
    embeds: [
        embed
    ]
}
#

webhooks can have multiple embeds

earnest phoenix
#

Oh

#

That didn't solve the issue ^

ruby dust
#

webhooks are overpowered

slim heart
#

Okay so I made this and in all honestly I'm kind of proud about it, however I would like to make it so that it doesn't only work with 3 args, it just work completely if 2 or more are only 1 in length and then combines it

for(i=0; i<arg.length; i++) { 
            arg1 = arg[i]
            arg2 = arg[i+1]
            arg3 = arg[i+2]
            if(!arg2) continue;
            if(!arg3) continue;
            if(arg1.length == 1 && arg2.length == 1 && arg3.length == 1) {
                arg[i] = arg1 + arg2 + arg3
                arg.pop(i+1)
                arg.pop(i+2)
            }
        }
#

Because I could just if a bunch of times but i 1 really dont want to do that and 2 it still wouldnt work sometimes because i'm not about to write scenarios 2000 times for each possible 2000 args that could be 1 in length

hushed berry
#

@slim heart what does it do

slim heart
#

so for each argument (message content .split(' ')) it checks if it's only 1 in length (ex: a) and then checks if the one after it is 1 in length and then checks if the one after that one is 1 in length and then if they all are it's replacing the first arg with the combined version of all 3 of those args and then pops them out after

#

so that people cant just bypass my filter with a space

hushed berry
#

is this for like a word filter?

rugged pond
#

For a specific bot my token is regenerated every time. Any ideas thonking ?

hushed berry
#

Check your email

slim heart
#

yes

hushed berry
rugged pond
#

Nothing

#

🤷

#

I didn't have any mail from discord

zenith moss
#

The best part of that email is it is addressed to you

slim heart
#

k e k

zenith moss
#

I’ve never had one of those emails 😃

hushed berry
#

lol

slim heart
#

but yes groovy it is

hushed berry
#

It's easy to hit when your bot has 128 shards

tight heath
#

oof

hushed berry
#

lmao

tight heath
#

how

hushed berry
#

remember that rave

#

i finally had fixed all the issues and the bot was like 90% logged in

#

😂

#

and hten discord was like

#

nup

tight heath
#

lmao

rugged pond
#

No one have an idea for me ?

tight heath
#

no

#

maybe check your spam folder

rugged pond
#

I check all folder

#

🤷

slim heart
#

so rip my question?

tight heath
#

I'll have a look

#

you use js?

#

code looks like it

#

question is

#

what's its purpose?

quartz kindle
#

im confused about it

tight heath
#

-bots @quartz kindle

gilded plankBOT
#
Tim#2373
Bots <:dblCertified:392249976639455232>

@oak sentinel dblCertified

tight heath
#

I knew it

#

I've seen you somewhere

#

anyways

quartz kindle
#

but it seems like he wants to turn insert random s tring w i th swear w ords broken by spaces into something readable by his spam filter

#

oh we've met before?

#

your profile pic is familiar

tight heath
#

you know it from Anna maybe

#

but

#

I know you and your bot

#

idk where from

#

but I do

#

lmao

quartz kindle
#

lmao

tight heath
#

so hi

#

I'm Raven

quartz kindle
#

hi im Tim xD

tight heath
#

oh, that was unexpected

coral trellis
#

:(

tight heath
#

we're still about the script tho

coral trellis
#

angeryBOYE Then stay on topic

tight heath
#

I was just midly mindblown

#

okay okay

#

before he sends the bearcops

#

because if you wanna do a swear filter

#

you could just

quartz kindle
#

im a law abiding citizen (for the most part)

tight heath
#

replace all spaces

#

with ''

quartz kindle
#

^

tight heath
#

and then check if that long string

slim heart
#

rave and tim im just talking about if after arg[i] (which is 1 in length) if after it is 1 in length then combine them and then if after than check if it's 1 then combine

#

I do an arg based filter

tight heath
#

contains the word

#

yes but why?

slim heart
#

Because it works well

#

So i can make it so assume isnt censored by ass

tight heath
#

hmmm

#

make sense

slim heart
#

but if you check if content matches assume then you could write assume fuck then it wouldnt do anything

quartz kindle
#

so you could do a recursive function that continues until the next arg is not length 1

slim heart
#

this is the basic premise

#

yes

#

that s o u n d s like what i need

#

n o w, how lol

#

i just sent the wrong screenshot btw

#

this is the basic premise

knotty steeple
#

tfw you censor code

slim heart
#

besides the point however

#

cuz

tight heath
#

okay I see the issue

slim heart
#

its not really an issue

quartz kindle
#
let result = "";
function something(args,index) {
    if(args[index].length === 1) {
        result += args[index];
        if(args[index+1].length === 1) {
            something(args,index+1);
        }
    }
}
something(args,0)```
slim heart
#

just more of a want to stop people just bypassing with space

tight heath
#

thanks tim

slim heart
#

wait wouldn't it just combine every that's only 1 in length?

#

because i wasnt to have it so if its seperated by a word with more then 1 in length then it doesnt combine them

quartz kindle
#

it will do it sequentially, if the next one is not length 1, it doesnt repeat

slim heart
#

so h wuihedihdw i wouldnt have "hi"

#

oooh

#

i see i see, thank you!

tight heath
#

mmmm recursion

stable tide
#

@earnest phoenix o it was typo sry

earnest phoenix
#

Ke

slim heart
#

Ok so Tim i got that and it works great the one thing though is if i do it in a for it'll keep going down the list so if if i do it to args with a s s it'll also return ss, how would i 1. pop it after and 2. combine them into one?

#

@quartz kindle

quartz kindle
#

i dont get it, can you show an example?

slim heart
#

So like while that does work, I want make it so that if those args after that arg[i] are a length of 1 it combines it back into arg[i], and then also pops them out of the args array

quartz kindle
#

ah i see

uncut delta
#

@earnest phoenix what wrong

#

Why you mentioned me???

topaz fjord
#

wouldn't you just push it back into the array?

slim heart
#

yes i could but theres no keeping track of which args were combined so i cant pop it

quartz kindle
#

@slim heart try something like js result += args[index]; args.splice(index,1); if(args[index+1].length === 1) { something(args,index+1); } else { args.push(result); result = ""; }

#

that would remove it from args, and push the result to the end of args if the next arg is not length 1

#

so ["abc","a","b","gg","lol"] will become ["abc","gg","lol","ab"]

#

if you want to keep the original index, you need another variable to keep track of it

slim heart
#

wellll

quartz kindle
#

uh...

slim heart
quartz kindle
#

move the args.splice() to inside the if(args)

#

i made it delete the array before checking the next array, which makes it check a non-existent array xd

#

oopsie

#

(i hope thats the only problem with it)

slim heart
#

it added hi ?

quartz kindle
#

Lol

#

goes back to the drawing board

slim heart
#

it looks like it'd work

#

idk why it does that

#

oh you know what

#

result += args[index];

#

correct me if im wrong

#

but it seems like you're adding args[index] even if it isn't length 1

#

no still doesnt work

cinder mango
#

please help me

quartz kindle
#

well, that part was supposed to be put inside the previous one

cinder mango
quartz kindle
#

it checks if length === 1 before it puts it in the result

cinder mango
#

ok thanks

slim heart
#

primed that wasnt for usksks

#

what does the error say?

#
function findone(args,index) {
                     if(args[index+1].length === 1) {
                        result += args[index];
                            args.splice(index,1);
                           findone(args,index+1);
                      } else {
                      args.push(result);
                        result = "";
                         }
        }```
ok well this is what i have tim so far
cinder mango
slim heart
#

=

#

dont use 3 ='s

#

use 1

#

you're not asking if it equals something you're defining it

slender thistle
#

1 = - define

#

2/3 = - compare

#

(afaik)

slim heart
#

wait why does the first screenshot have = and then the second has ===

sick cloud
#

he changed it

slim heart
#

no duh

#

really?

quartz kindle
#

because i said that

#

Lol

slender thistle
#

smh Tim Thinkmas

quartz kindle
#

@slim heart you removed one of the ifs

sick cloud
#

lol

quartz kindle
#

now you're only checking if the next element is length 1, not if the current one is

earnest phoenix
#

Where can I find my directory for globally installed packages?

quartz kindle
#

if im not mistaken its a hidden .npm folder

#

in your home directory

#

(linux)

slim heart
#

Oh ok, wait can you just type out what it looks like?

#
function findone(args,index) {
            if(args[index].length === 1) {
                if(args[index+1].length === 1) {
                    result += args[index];
                            args.splice(index,1);
                           findone(args,index+1);
                      } else {
                      args.push(result);
                    result = "";
                }
            }
        }```
#

is this what it's supposed to look like?

quartz kindle
#

remove the index+1 since the splice takes care of that

#

forgot about this

#

else it will error if the last arg is also length 1

slim heart
#

ok well something isnt the same here

#
function findone(args,index) {
            if(args[index].length === 1) {
                result += args[index]
                args.splice(index, 1)
                if(args[index] && args[index].length === 1) {
                    something(args,index);
                } else {
                    args.push(result)
                    result = ""
                }
            }
        }```
keen drift
#

Yikes my bot shards is having timeout issues

#

Anyone else?

zenith moss
#

No

#

But I don’t shard

quartz kindle
#

^

slim heart
#

tim u have any idea why?

quartz kindle
#

show the code where you run the function in

slim heart
#

and even if i just do findone(args, 3) which 3,4,5 = a,s,s it just pops a and then does literally nothing else

quartz kindle
#

well, for loops are not supposed to be used together with recursive functions

#

because the for will execute faster and run over the function

slim heart
#

so i await it?

quartz kindle
#

nevermind that

#

i just tested and it still works

#

because its still sync code

slim heart
#

can you send me exactly what you're doing

#

like so i can copy and paste it

knotty steeple
#

what

slim heart
#

i feel like it must me something wrong with me