#development

1 messages Β· Page 426 of 1

gilded blaze
#

why the hell does everyone use ytdl

#

it's shit

earnest phoenix
#

I can't use anything else

#

lol

knotty steeple
#

what are we supposed to use then

#

πŸ‘€

trim plinth
#

lavalink

inner jewel
#

lavaplayer

earnest phoenix
#

ew

trim plinth
#

lavaplayer is only for java u weeb

knotty steeple
#

i found youtube-search which can get a link, title etc from search

#

its great zoomeyes

earnest phoenix
#

Yeah

trim plinth
#

but lavaplayer is really nice

earnest phoenix
#

I use that

#

lol

knotty steeple
#

lol

earnest phoenix
#

ytdl and youtube-search

#

best combination

knotty steeple
#

πŸ‘Œ

gilded blaze
#

using a module just to search seems unneeded

shrewd hedge
#

(discord.js) guys if I made a command like this would it work? ```if (command === "checkid" {

const idsent = get.args.first

if (idsent !== user.id) {

message.channel.send("But that is not an ID lol");}
else {

message.channel.send(That ID belongs to **${idsent.user.tag}**.);}

}```

gilded blaze
#

no

inner jewel
#

it won't work at all

#

syntax error

topaz fjord
#

lavalink is the best

worn sparrow
spring ember
#

also it's a bad idea to start your own lib

tall falcon
#

Hey I'm new to bot development and I keep encountering this error Error: cannot find module 'npm' I didn't change anything files I just changed the bot status from offline to online

#

Everything is installed because it was running fine

worn sparrow
#

@spring ember who said i was starting my own lib

#

I'm using my own framework, it's under discordia but a custom modular system

spring ember
#

@tall falcon it is as simple as that you should download npm

#

@worn sparrow oh ok so it extends discordia

tall falcon
#

Npm is installed

spring ember
#

is it global?

tall falcon
#

Yes

spring ember
#

wait do you require it?

worn sparrow
#

is it in your PATH

tall falcon
#

I'll install it again

spring ember
#

if it's global then it is in the path usually

tall falcon
#

Oh okay

spring ember
#

but still try and check if it is in the PATH

#

maybe you didn't install it globally

worn sparrow
#

go to your start menu search PATH

spring ember
#

if it's windows

worn sparrow
#

windows 10 at least

#

idk how to do it on linux or mac os

spring ember
#

ew hosting on mac os

tall falcon
#

I'm using win10

spring ember
#

and I am a mac user

#

oh ok

worn sparrow
#

good

spring ember
#

so do as @worn sparrow said

worn sparrow
#

search path

tall falcon
#

I'll be migrating to Linux soon though

solid cliff
#

think if it wouldnt exists it would say command not found or something but what is cannot find module

worn sparrow
#

then ya double click PATH

tall falcon
#

Ok

worn sparrow
#

should be something like that

#

C:\USERNAME\AppData\Roaming\npm

frank dust
#

%appdata%\npm might also work

tall falcon
#

Works thanks

worn sparrow
#

πŸ‘

buoyant estuary
#

How do I check if the ID of the person who sent the message is the same as the one in the variable, for example? discord.js

#

this way it's not working:

#
    if (message.author.id == 260227813037047820){
       //code
    }
uncut slate
#

javascript can't represent snowflakes as ints, they have to be strings

restive silo
#

BigInt soon

bitter sundial
#

BigInt is already in Chrome 67

restive silo
#

comes to node.js soonβ„’

bitter sundial
#

in 10 or 11?

restive silo
#

in some week when they bump there V8 version

#

should be 10 iirc

bitter sundial
#

idk what you can really do with BigInts I cant find documentation

inner jewel
#

1 - "1" // works
1 - BigInt(1) // doesn't

bitter sundial
#

lol

earnest phoenix
#

So I was going though some of my nsfw commands to make sure they work because I made them today to make sure they work and I get this error after running one command 2 times https://hastebin.com/fumukohede.sql What does it mean?

bitter sundial
#

your function seems to be calling itself repeatedly or other functions

inner jewel
#
function x() {
    x()
}```
#

tl;dr infinite recursion

dapper moon
#

@buoyant estuary if (message.author.id === variableId or '1234567890') { //...

inner jewel
#

no

#

that won't work

dapper moon
#

why not? ofc it will

bitter sundial
#

are you memeing alex

dapper moon
#

no?

inner jewel
#

it'll always evaluate to true

dapper moon
#

where did you get that code from?

#

mine is different

inner jewel
#

that's just an example

#

your code will always run the if block

dapper moon
#

Β―_(ツ)_/Β―

bitter sundial
#

well

inner jewel
#

also message.author.id === variableId or '1234567890' isn't even valid js

earnest phoenix
#

yeah

dapper moon
#

i put that so they choose what they have

earnest phoenix
#

I just checked with my syntaxer

dapper moon
#

.>

inner jewel
#

if(a == b || c) is basically if((a == b) || (c))

#

if a == b is false

dapper moon
#

so it'd be message.author.id === variableId or message.author.id === '1234567890'

inner jewel
#

it'll evaluate c

#

and if c is a "truthy" value it'll evaluate to true

earnest phoenix
#

is what I use

bitter sundial
#

yes alex, that but with ||

dapper moon
#

ok

tall falcon
#

Is anyone working on a chat bot with deep learning capabilities?

dapper moon
#

deep learning sounded spoopy to me πŸ‘€

mental solstice
#

You making an AI?

pearl schooner
#

is anybody else using discord bot maker on steam?

earnest phoenix
#

no

#

we are hardcore

pearl schooner
#

oh

#

ok

buoyant estuary
dapper moon
#

is there a native js way to repeat some code x times? like i want to run the skip() function x times, where x is defined as the length of the queue

trim plinth
#

for loops ```js
for (let owo; owo < 5; owo++) {
// do something here
}

inner jewel
#

for(let i = 0; i < x; i++) code()

dapper moon
#

umm.. idk i'll just use llamas since it makes sense but thanks

trim plinth
#

both examples are the same thing

inner jewel
#

it's literally the same thing?

trim plinth
#

πŸ‘€

inner jewel
#

just different variable names

dapper moon
#

oh

#

so i added it. will the code i pointed to with the arrow run AFTER all the songs have been skipped?

#

thats what i'm aiming for

trim plinth
#

yes

dapper moon
#

okay thx

inner jewel
#

you could just do queue[msg.guild.id].songs = []

trim plinth
#

true GWnanamiRemThink

dapper moon
#

can't

#

that'll fully empty it and kinda break my queue >.>

trim plinth
#

oof

dapper moon
#

ok so when i run !skip or a song ends it skips, but on the second time nothing happens. is that because the dispatcher.on(end) event isn't there anymore?

trim plinth
dapper moon
tall falcon
#

@mental solstice planning to yeah

dapper moon
#

fixed my last issue. but @inner jewel @trim plinth that code you gave me, the dispatcher.end is running before all songs are removed, or its just not working at all

#

since !stop is acting like !skip >.>

trim plinth
#

oof

gilded thunder
#
# dblstats command
@bot.command(pass_context=True)
async def dblstats(self, *, botid):
    """Get bot details on a bot from Discord Bot List."""
    stats = requests.get("https://discordbots.org/api/bots/" + str(botid)) # parse the json api with the bot id
    stats = stats.json()
    stats = stats[0]
    embed = discord.Embed(title="Discord Bot List.", description="Stats for the bot.", color=0x176cd5)
    embed.add_field(name="Bot name", value=stats['username'], inline=True)
    embed.add_field(name="Upvotes", value=stats['points'], inline=True)
    embed.add_field(name="Description", value=stats['longdesc'], inline=True)
    embed.add_field(name="Tags", value=stats['tags'], inline=True)
    embed.add_field(name="Library", value=stats['lib'], inline=True)
    embed.add_field(name="Prefix", value=stats['prefix'], inline=True)
    embed.set_thumbnail(url=stats['defAvatar'])
    await bot.say(embed=embed)```
Similar to how I'm parsing the Steam API but I don't get a terminal error or a printed error.
#

It registered that the command was being ran but didn't parse the API correctly.

solid cliff
#

requests notLikeMiya

floral stone
#

@gilded thunder use the aiohttp module

gilded thunder
#

is it easy to convert over to?

floral stone
#

probably

#

look at some examples

glossy mason
gilded thunder
#

That's for rewrite.

floral stone
#

you don't have to use it though

gilded thunder
#

I'm using async

floral stone
#

but I also don't think it's just for rewrite

glossy mason
#

It doesn't matter what version of discord.py you use, it works just the same, if you know what you're doing.

gilded thunder
#
Collecting aiohttp>=2.3.9 (from -r requirements.txt (line 1))
  Could not find a version that satisfies the requirement aiohttp>=2.3.9 (from -r requirements.txt (line 1)) (from versions: 0.1, 0.2, 0.3, 0.4, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.14.4, 0.15.0, 0.15.1, 0.15.2, 0.15.3, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.16.4, 0.16.5, 0.16.6, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.17.4, 0.18.0, 0.18.1, 0.18.2, 0.18.3, 0.18.4, 0.19.0, 0.20.0, 0.20.1, 0.20.2, 0.21.0, 0.21.1, 0.21.2, 0.21.4, 0.21.5, 0.21.6, 0.22.0a0, 0.22.0b0, 0.22.0b1, 0.22.0b2, 0.22.0b3, 0.22.0b4, 0.22.0b5, 0.22.0b6, 0.22.0, 0.22.1, 0.22.2, 0.22.3, 0.22.4, 0.22.5, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 2.0.0rc1, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6.post1, 2.0.7, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.3.0a4, 2.3.0, 2.3.1, 2.3.2b2)
No matching distribution found for aiohttp>=2.3.9 (from -r requirements.txt (line 1))
root@joshek:~/DBL-Python-Library# clear```
#

pip didn't find anything and manual failed to find a version.

glossy mason
gilded thunder
#
Collecting dblpy
  Could not find a version that satisfies the requirement dblpy (from versions: )
No matching distribution found for dblpy
root@joshek:~# ```
glossy mason
#

Is pip up to date, and running for Python 3?

#

What if you do pip3 install dblpy?

gilded thunder
#

That worked.

glossy mason
#

(Also, are you logged in as root?)

gilded thunder
#

Yeah...

mild garnet
#

You shouldn't ever run stuff as root, unless required to

gilded thunder
#

I share the VPS with someone else, I keep the bot in my root folder so he can't snoop around.

mild garnet
#

There are better ways to do that. Do you have a sudoer's file?

gilded thunder
#

Probably.

mild garnet
#

Also your home folder should be locked anyways (if you have one for your normal account which I assume you do)

#

Did you set up the VPS?

gilded thunder
#

Yeah, I'm hosting it on DigitalOcean.

mild garnet
#

And you have a regular user account right? If not, no big deal

gilded thunder
#

Yep, got one.

mild garnet
#

Sign in as that and see if you can use sudo

#

So on that account type in sudo pip3 install dblpy

gilded thunder
#

I have dblpy installed.

mild garnet
#

It shouldn't install it since you already installed it

gilded thunder
#

I did pip3 install.

mild garnet
#

It's just a test command

gilded thunder
#

Ohh, gotcha

mild garnet
#

You do something like sudo ls /root

#

If you can do that that means you can run stuff as root

dapper moon
gilded thunder
#

Yep, sudo ls /root asked for the password and displayed it.

mild garnet
#

It will ask for that user's password in order to do stuff. Using sudo is much better than being logged in as root because it restricts access to your account in case anything malicious came across it

#

Good

#

So just tag sudo in front of a command that requires root

gilded thunder
#

So I just run the bot under that account then?

mild garnet
#

You can sudo <then your run command>

#

It will run it as root, but you never have to sign into root

gilded thunder
#

I know how it works.

mild garnet
#

As for hiding your stuff, you should already be set on that

gilded thunder
#

Dual-boot with Ubuntu and Windows 10 πŸ˜‰

mild garnet
#

Awesome

#

I use Ubuntu as a main

gilded thunder
#

But your profile is Kali Thonk

mild garnet
#

That's for Pentesting

gilded thunder
#

ik

floral stone
#

^

mild garnet
#

I don't use it as a main home environment. I prefer to stick with things better suited for it

#

I love Kali though

gilded thunder
#

Ubuntu is pretty good but the store is awful.

#

At least on 16.04 it is.

mild garnet
#

Yeah, but it does have one unlike most distros

gilded thunder
#

Yeah.

mild garnet
#

Anyways, GL with the bot

gilded thunder
#

Thanks

mild garnet
#

@dapper moon What math are you doing?

dapper moon
#

@mild garnet

module.exports = {
    help: {
        name: 'ping',
        description: 'Pong!',
        usage: ''
    },

    config: {
        aliases: [],
        guildOnly: false,
        ownerOnly: false,
    },

    execute: async (msg, args) => {
        const m = await msg.channel.send('Ping?');
        m.edit(`Pong! :ping_pong: ( **${~~client.ping}ms** API heartbeat, **${msg.createdTimestamp - m.createdTimestamp}ms** roundtrip/response )`);
    },
};
#

thats the cmd

mild garnet
#

Reverse the order

#

Should return positive

dapper moon
#

m.createdTimestamp - msg.createdTimestamp?

earnest phoenix
#

(Date.now() - m.createdTimestamp)

dapper moon
#

why a new date

earnest phoenix
#

i do it in my ping command

dapper moon
#

msg works fine

earnest phoenix
#

ok GWlulurdWaitWhat

dapper moon
mild garnet
#

Isn't math something

dapper moon
#

math annoys me

mild garnet
#

Np dude. Glad it worked

earnest phoenix
#

math is awesome

#

you wouldn't be here if it weren't for it

mental solstice
#

i dont think thats technically true

floral stone
#

math raised me as a young child

earnest phoenix
#

I am 100% right

#

technically without math computers wouldn't exist

#

so technically we wouldnt be here (Discord) without it @mental solstice

mental solstice
#

well you didnt specify "here" earlier, and according to Mrs. Daniels, my 7th grade Health Teacher. Conception has nothing to do with math.. Thank you for clearing that up.

#

@earnest phoenix

earnest phoenix
#

ye I figured you misunderstood

mental solstice
#

No, i understood clearly. Just easy to twist things when people use vague words.

#

I got a C- in that class however 😦

#

Please use #memes-and-media to discuss why math is the reason for human existence. This room is for development.

mental solstice
#

hey

frail kestrel
#

wrong chat

ruby dust
#

yeah, you should have told him that like 10 hours later

floral stone
#

it was 3 hours

glacial sentinel
#

Soo any idea if there is a way to make the bot realize you voted faster?

    dbl.hasVoted(message.author.id).then(voted => {
        if(!voted){
#

@ me pls

floral stone
#

how slow is it

glacial sentinel
#

3-5~ mins

#

actually not exactly sure

#

I know it takes a few mins tho

floral stone
#

use webhooks

glacial sentinel
#

wut

#

how

rich kiln
#

Check DBL's api documentation > Webhooks

glacial sentinel
#

no I want to connect it with my bot

#

🀦

native narwhal
#

It shouldn't take any time. From what I tested after someone presses vote the api will have the new value

glacial sentinel
#

hmm

rich kiln
#

But the webhook will be connected to your bot, no?

glacial sentinel
#

u need to add webhooks to every channel

frail kestrel
#

lol

glacial sentinel
#

so that wont work πŸ˜‚

frail kestrel
#

no

rich kiln
#

No

frail kestrel
#

this is a webserver

glacial sentinel
rich kiln
#

Not a discord webhook.

glacial sentinel
#

how to use that

frail kestrel
#

go to docs

#

thanks

glacial sentinel
#

r i p

mental solstice
#

If youre using JS.. Tonkku pinned a webhook listener example in #topgg-api

#

Might need to setup portforwarding, and make a firewall rule for the same port

#

Easy to set up php webhook listener that will forward to discord too. Another way to get user ids

earnest phoenix
#

How do I make a bot message the server that it updated without being prompted?

#

also uh python

mild garnet
#

Bots don't update servers πŸ€”

#

What do you mean by this?

earnest phoenix
#

Nonono

#

I meant like for example i'm a bot

#

New commands have now been added to the bot!

#

like it will send a message automatically

#

without using a command

mild garnet
#

So you are going to spam all the servers it is in?

earnest phoenix
#

Yes

mild garnet
#

Or just the bot server?

earnest phoenix
#

Well idk if people used my bot

mild garnet
#

People would probably get annoyed by that if you spam them with updates

#

But anyways, you can still do that

earnest phoenix
#

Well I rarely update the bot so i'm fine

#

plus i'll only announce the important stuff

mild garnet
#

You have to pick 1 channel in each server to send to

earnest phoenix
#

oki oki
and then

mild garnet
#

Run it on ready or connect?

earnest phoenix
#

run it on ready

mild garnet
#

Anyways for sending a message on ready or connect you do ```python
async def on_ready():
for guild in client.guilds:
for channel in guild.channels:
# Find some way to figure out which channel you are going to spam
# Like saying if "bot" in channel.name: #Do stuff

#

It's been a while since I've looked at the API though. These might be slightly off

#

I'd recommend getting familiar reading the API docs

#

That will grab all of the channels in all guilds

#

If your variable for the bot isn't named client, it's probably named bot

earnest phoenix
#

Ohhh oki oki

#

arigatou

mild garnet
#

What?

floral stone
#

I have a function for getting the main channel

mild garnet
#

^

#

Do something like that

#

If I said anything wrong feel free to correct me. I gtg do other stuff

earnest phoenix
#

client.get_channel(<channelid>)

#

like dat?

floral stone
#
        channels = guild.text_channels
        text_cha = [x.name.lower() for x in channels]
        lines = ["general", "lounge", "chat", "hangout"]
        words_in_line = []
        for y in lines:
            words_in_line += [x for x in text_cha if y in x]
        k = []

        if len(words_in_line) > 0:
            for x in words_in_line:
                channel = discord.utils.get(channels, name=x)
                perm = guild.me.permissions_in(channel)
                if channel is not None and all([perm.send_messages, perm.read_messages, perm.embed_links]):
                    k.append(channel)
                    channels.remove(channel)

        if len(k) == 0:
            for x in guild.text_channels:
                perm = guild.me.permissions_in(x)
                if all([perm.send_messages, perm.read_messages, perm.embed_links]):
                    k.append(x)

        if len(k) == 0:
            return None
        else:
            return k[0]```
#

Still though, spamming the api for each server is against tos. There is better methods for this. @earnest phoenix

mental solstice
#

i was told its against the rules to do mass messages like that. Unless you give an option to opt-in

tall falcon
#

Is anybody working on a Discord using Lua?

earnest phoenix
#

How do I make it so my bot (djs) has per server configs?

#

I have a database setup already in case that's needed

#

Actually two, Mongo and MySQL

#

I want the server owners to be able to like change the bot prefix for their servers

#

If I store that in a variable I know it will reset when my bot restarts

#

That's not what I want

mental solstice
#

you could.. Make a table named Configs. insert ServerID, Prefix, etc...

#

in your command handler, query your DB for the prefix WHERE ServerID = serveridofcommand

#

if they are configs though.. you could just store in json or something simpler

spring ember
#

Per server config shouldn't be on JSON

#

Use a database

#

It doesn't matter mongo or sql

short hemlock
#

I prefer mongo because of Compass

earnest phoenix
#

I just use the shell or the Node driver to interact with Mongo

#

I use the command line for mysql too

#

I'm afraid querying the db on every command might get a bit slow tho

#

Specially if the bot is on many servers

#

I need a bit of help with creating a bot. I've created it and I can't add it to my server

ivory hawk
#

Go to OAUTH2

#

Copy that link into your browser and select the server you want to add it to @earnest phoenix

earnest phoenix
#

Thank you! @ivory hawk

ivory hawk
#

If you plan on sharing it with other servers make sure to add a command for inviting the bot

earnest phoenix
#

OK. I wasn't planning on that, I'm trying to learn how to code bots

ivory hawk
#

Oh lol

earnest phoenix
#

You should learn how to code first

#

It's better to learn it first then learn how to make bots and whatever you want to build

#

If you jump straight onto creating bots without learning how to code it'll likely be hard for you

ivory hawk
#

Yeah that's true

#

But JavaScript is easy to understand

#

If he's using js libs

earnest phoenix
#

Even so, if you don't understand what you're typing it's going to be hard to code a bot

earnest phoenix
#

I already know how to code. I did 3 years of coding when I was in school

#

Now I'm finishing off my gcses and hopefully going to get an A in cs

slow elk
#

Okay, so I might have an easy html question, but I want to show a thumbnail in Discord's website preview, which will be my logo. How does one do this or is that rendered automatically by the favicon?

mental solstice
#

Like.. your bots DBL profile?

#

@slow elk

slow elk
#

No, like my actual website

mental solstice
#

Your website has an iframe of discord and you want your logo inside that?

slow elk
#

No, once a link gets posted of my website in Discord, it will show a website preview with the description and title. But I want to show my logo with it as a thumbnail in the preview embed

spring ember
#

Umm you need to return an image for a call to /favicon.ico or declare it

slow elk
#

I have declared my favicon.ico to show up at the title.

mental solstice
#

Metadata?

#

Og:image ... etc?

slow elk
#

Maybe metadata.. I might as well google it

mental solstice
#

Yeah ive used that before to change link preview.. for facebook though, it may work the same for discord though

#

Comment says discord will pick up the opengraph metas.. so hopefully that solves what youre looking for

slow elk
#

Thanks I'll dive into it

radiant ridge
#

Are we allowed to put analytics scripts such as google analytics into the detailed description?

spring ember
#

JavaScript is for certified

#

And pls don't put analytics

quiet bobcat
#

Hi, I'm trying to install my packages to install with npm and I'm getting the error js SyntaxError: Unexpected token } in JSON at position 93799

#

This is for every package by the way

spring ember
#

Corrupt npm package maybe?

#

Like package.json

quiet bobcat
#

I can take a look

#

I just removed my package.json and it solved it

maiden geyser
#

Hi can someone help me

#

I tried to publish a bot but it came up with Unable to fetch application

topaz fjord
#

The client I'd is wrong in the application

maiden geyser
#

oh 😐

topaz fjord
#

Get the bot client id

maiden geyser
#

yeah

topaz fjord
#

To get that right click the bot name and select copy if

#

Id

maiden geyser
#

ok thank u

spring mesa
#
if(!withdrawed) {
    
    client.sql.prepare("INSERT OR REPLACE INTO withdrawals (id, user, guild, time) VALUES (@id, @user, @guild, @time);").run(message.id, message.author.id, message.guild.id, now);
    client.sql.prepare('UPDATE scores SET credits = credits + ? WHERE user = ? AND guild = ?').run(30, message.author.id, message.guild.id);
    
    message.channel.send(`:credit_card: <@${message.author.id}>, you received 30 daily credits!`);
    
    
     } else {
       message.channel.send(':warning: You already got today\'s credits. Check back tomorrow!');
     }```
#

                                                                                                                         ^

RangeError: Too many parameter values were provided

at Object.exports.run (/app/commands/daily.js:14:122)

at module.exports (/app/events/message.js:55:7)```
#

why

#

anyone?

earnest phoenix
#

I'm not an expert with SQL but it seems like your syntax is incorrect

#

Something to do with the values you've set in your query

spring ember
#

OR doesn't work like that GWvictoriaNotLikeBlob

#

You should query if no results were found insert otherwise update

#

Or use

#

INSERT ... ON DUPLICATE KEY UPDATE

spring mesa
#

hmmmmm

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

module.exports.run = async (bot, message, args) => {

    let r1embed = new Discord.RichEmbed()
    
    .setTitle("Rule 1")
    .addField("Being toxic is not allowed", "Beinng annoying or starting flamewars are ***not allowed***")
    
    let r2embed = new Discord.RichEmbed()
    
    .setTitle("Rule 2")
    .setField("Swearing", "Is allowed but please do not over do it.")
    
    let r3embed = new Discord.RichEmbed()
    
    
    
    let r4embed = new Discord.RichEmbed()
    
    
    
    let r5embed = new Discord.RichEmbed()
    
    
    
    let r6embed = new Discord.RichEmbed()
    
    
  
  message.channel.send(r1embed)
  message.channel.send(r2embed)
  
  
  
  
  
  
}

module.exports.help = {
    name: "rules"
}
``` why wont this work (this is for my server)
spring ember
#

Error?

west raptor
#

(node:1232) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: (intermediate value).setTitle(...).setField is not a function
spring ember
#

And you should await send()

#

Umm it is addField

#

Not setField

west raptor
#

OH'

#

iim stupid facepalm

#

thanks

spring ember
#

Np

earnest phoenix
#

PS C:\Users\corro\Desktop\emily.codes\SwiftBot> node swiftbot.js
C:\Users\corro\Desktop\emily.codes\SwiftBot\swiftbot.js:11
if(message.author.id !== config.ownerID) return;
^

ReferenceError: message is not defined
at Object.<anonymous> (C:\Users\corro\Desktop\emily.codes\SwiftBot\swiftbot.js:11:1)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
at startup (internal/bootstrap/node.js:238:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3)
PS C:\Users\corro\Desktop\emily.codes\SwiftBot>

#

Can someone help? I'm not sure what to do.

spring ember
#

Message is not defined

#

Send code

earnest phoenix
#

How do I fix it?

#

Alright.

quiet bobcat
#

You define message?

spring ember
#

Lmao

quiet bobcat
#

Do you have an on message event?

earnest phoenix
#

yea

quiet bobcat
#

and it's message and not msg?

earnest phoenix
#

this is my message.js

#

@quiet bobcat

quiet bobcat
#

Well the code that has an error isn't in that file

civic fulcrum
#

So, for people who are familiar with the verification process here (as I'm in the queue and just want to make sure things go smoothly):
When #rules-and-info mentions "join messages," does it mean messages sent when users join, or a message sent when the bot joins?
I have a message like the latter one, which just provides some basic "how to" info on using the bot, as well as a link to the source and where to get help. If this is against the rules, is a simple if (guild.id === "264445053596991498") return; enough to get by, or is this something that has got to go in general?
I can understand if it has to go; it should be easy enough to patch out. I just want to make sure.

quiet bobcat
#

On a user join

quasi hearth
#

It should be in general, but that might get by, idk

civic fulcrum
#

That's what I currently have in place.

quiet bobcat
#

Do you have on user joins?

quasi hearth
#

Though they will probably test your got on other servers though

bright bone
#

Does someone not let you install modules in Javascript?

quiet bobcat
#

wdym? @bright bone

quasi hearth
#

Uh no?

bright bone
#

It will not let me install modules/packages in JavaScript

quasi hearth
#

Weird

#

What's the error?

bright bone
#

Not load

civic fulcrum
quiet bobcat
#

Does it not load?

quasi hearth
#

Is there an error given when trying to install nodules?

bright bone
civic fulcrum
#

it could just be taking a while, depending on the number of dependencies you have

#

npm on windows isn't the fastest thing in the world

quasi hearth
#

Or you have bad internet :p

bright bone
#

ok

earnest phoenix
#

PS C:\Users\corro\Desktop\emily.codes\SwiftBot> node swiftbot.js
C:\Users\corro\Desktop\emily.codes\SwiftBot\swiftbot.js:18
client.on(eventName, event.bind(null, client));
^

TypeError: event.bind is not a function
at files.forEach.file (C:\Users\corro\Desktop\emily.codes\SwiftBot\swiftbot.js:18:32)
at Array.forEach (<anonymous>)
at fs.readdir (C:\Users\corro\Desktop\emily.codes\SwiftBot\swiftbot.js:15:9)
at FSReqWrap.oncomplete (fs.js:169:20)
PS C:\Users\corro\Desktop\emily.codes\SwiftBot>

unique solar
#

whatever object "event" is, it doesnt have the function "bind"

#

look in the documentation for whatever libary youre using

ivory hawk
#

Wow that looks so weird without MD

slim heart
#

hey okay. I have a feeling this is gonna be a bit confusing. But i wanna see if i can get some help with it. So I'm compacting everything down for ease on myself and heres the code i have so far:

            const words = ['tester', 'testing']
            const byptester = ['testers', 'testering']
            const byptyping = ['testings', 'testinger']
        arg.forEach(arg => {
            words.forEach(words => {
                let word = new RegExp (words, 'gi')
                if(arg.match(word)) {
                    let sio = 'byp' + word
                    sio.forEach(sio => {
                        let si = new RegExp (sio, 'gi')
                        if(arg.match(si)) return;
                    })
                }
            })
        })```
I want to be able to define seperate arrays depending on the word set off... so u  see the concept im thinking of, so i do byp + word, and create the string byptesting for example, but i want to use that to access the array variable "byptesting", and that doesn't work as a string. any idea how i could make it so that i can forEach it depending on the word?
tepid laurel
#

Ofc

glossy mason
knotty steeple
#

woa

glossy mason
west raptor
#

message.author.premium always returning false?

#

i have nitro

tepid laurel
#

@slim heart like uh how exactly is it possible to use the created function 'forEach' meant for a collection on a string

slim heart
#

Throudin that kinda looks weird im not to sure whats going on and tbh i wanna understand it instead of just spoonfeed myself

glossy mason
west raptor
#

oof

#

wait

#

so it only works with a selfbot?

tepid laurel
#

Ye

west raptor
#

god damnit

#

that would have been cool for a !user command

slim heart
#

also throudin that might not be quite right something just looks like its missing idk

tepid laurel
#

Dude

#

Do you even read what I said

#

You're using the 'forEach' function from the collection class on a string

slim heart
#

Ik like i said ik it wouldnt work BECAUSE its a string yes

glossy mason
#

@slim heart I made an object, and in it are key-value pairs with the key being stuff like byp + the word you want and the value being an array of words.
Like:
key - byptester
value - ['testers', 'testering']

slim heart
#

But im trying to figure out HOW to work it based on what the variable is

tepid laurel
#

Then why do it multiple times in a row knowing it doesnt work that way

#

If you want that

#

Yeah

slim heart
#

ya throudin nvrm that is what i need

glossy mason
#

It's a little unclear exactly though what you want in your original question. It sounded like you want a way to access a specific array based on a string input.

tepid laurel
#

And please learn to use for()

slim heart
#

throudin almost kinda of, but like any way i want like basically if words is "tester" then it would access an array made FOR "tester"

tepid laurel
#

Thats what hes saying

slim heart
#

ya ik

tepid laurel
#

You could do it indeed like his and it'd be something like

#
const arrays = {
  firstArray: ['test', 'something'],
  secondArray: []...
}
if(arrays['someword']) { //act on it }
slim heart
#

Wait hold on throudin how would i actually turn the mylists into the array i wanted into a variable

tepid laurel
#

Predefine values mate

#

And just check if the key exists

slim heart
#

...

#

:o

#

but like how would i define it?

tepid laurel
#

I just showed you

#

Reaaad

slim heart
#

would it just be let sio = mylists['byp' + words]

tepid laurel
#

No

#

Why do that

slim heart
#

iAlusion ur code has like no similarities with throudins...

tepid laurel
#

It does

#

Its exactly what he does

#

I just put in some example line

glossy mason
#

So, what you're saying is let's say you had something like

{
    "myArray1": ["a", "b"],
    "myArray2": ["c", "d"]
}

and the user said "a" you want to grab "myArray1"?
Or is it, if the user says "myArray1" you return it with ["a", "b"]?

But like @tepid laurel said, his const arrays is how you define it.

tepid laurel
#

^

#

But his is stringified however

#

Which is not necessary in a js file

#

However a json is

slim heart
#

so wait like

  testing: ['testers', 'testering'],
  tester: ['testers', 'testering']
}
if(arrays[words]) { //act on it }
tepid laurel
#

Do be sure

#

That words is the exact key

#

testing !== Testing

#

A lil fix could be using the strings .toLowerCase() function

slim heart
#

yeah i was about to say id need some kinda of regex flag or some other way of making it so its not exact

#

i only know regex lmao sorry

tepid laurel
#

Bruh

#

Regex is not the answer to everything aight

#

Its pretty op

#

But not always the way to go

slim heart
#

so let wordo = words.toLowerCase();

#

right?

tepid laurel
#

What

slim heart
#

idk why i had an = lmao

tepid laurel
#

Why make your code longer

slim heart
#

u rite

#

alright well it still didnt work...

floral stone
#

have you tried regex

slim heart
#
            const words = ['tester', 'testing']
            let mylists = {}
            const arrays = {
            testing: ['testers', 'testering'],
            tester: ['testers', 'testering']
            }
            

        arg.forEach(arg => {
            words.forEach(words => {
                let word = new RegExp (words, 'gi')
                if(arg.match(word)) {
                    if(arrays[words.toLowerCase]) {
                        return;
                    }
                    console.log("oof")
                }
            })
        })```
tepid laurel
#

so wait like

  testing: ['testers', 'testering'],
  tester: ['testers', 'testering']
}
const array = Object.keys(arrays)[word.toLowerCase()]
if(!array) return;
//your code for the array;
#

I thought that would work🀭

slim heart
#

I guess?

#

Lemme try

tepid laurel
#

And mate

#

If you only have like one word input

slim heart
#

it dont work

tepid laurel
#

Define dont work

glossy mason
#

It's still unclear what your goal is exactly.

slim heart
#

okay ill just spell out the whole thing ig

tepid laurel
#

I wonder whats hes gonna do once he gets the array from user input

slim heart
#

Bascially i have a swearfilter bot right, and it does this, wait lemme get the current code

tepid laurel
#

Oml

#

Lemmee guess

slim heart
tepid laurel
#

You wanna blacklist words per server and your own ones preset🀨

#

If im not wrong by just guessing

slim heart
#

Basically i have it so it matches a specific word, but if it matches a bypass (so it doesnt censor everything)

#

it returns

#

like here

#
                    if(arg.match(/adic/gi)) return;
                    if(arg.match(/dict/gi)) return;
                    if(arg.match(/dice/gi)) return;
                    if(arg.match(/acidic/gi)) return;
                    if(arg.match(/dicate/gi)) return;
                    stopped();
                    console.log(crash)
                }```
tepid laurel
#

So why blacklist a word for it to be bypassed

#

Whats the whole point in there

slim heart
#

if the word matches dic, then it will go into it, but if it matches any of the other words defined it wont go

tepid laurel
#

Bruh

slim heart
#

Im just tryna compact it down

tepid laurel
#

Sure looks like it

slim heart
#

it works so dont criticize me lmao

#

Im still missing an answer here too

tepid laurel
#

So do you know regex pretty well?

slim heart
#

a decent amount

glossy mason
tepid laurel
#

Or even just do

#

/someregex/.test(msg.content)

slim heart
#

yeah then people do .dick.

tepid laurel
#

You're always gonna have them try that

#

So use the uh

glossy mason
tepid laurel
#

/someregex/.test(msg.content)

slim heart
#

i dont see what ur tryna say here

#

Im still trying to figure out my original question

tepid laurel
#

That you dont need all those fucking statements

slim heart
#

I dont need to redo everything ive done

tepid laurel
#

Mr Compact

slim heart
#

Im working on this

tepid laurel
#

Bruh all your code

#

Into a few lines ere

slim heart
#

idcccccccc

#

lmao

#

Im trying to do that

#

But in like this way so i can rely on arrays

#

like
const array = Object.keys(arrays)[words.toLowerCase()]
i did what u said its not working

#

like its not recognizing anything at all

glossy mason
#

Some swear regexs:
https://pastebin.com/FxbeND0m (posted on pastebin so to keep this chat clean)
You can detect matches with these instead of not using Regex to its full potential, being incredibly redundant, and trying to think up all possible "safe" words.

tepid laurel
#
const content = msg.content.split(' ');
for(const word of ['somearrayofbadwords']) {
  const ok = /yourregexNotthatgreatatit/.test(msg.content);
  if(ok) { do something cause ey it got the bad word }
else continue;
}
#

I thought this might work lel

#

Might be a lot slower than @glossy mason example

slim heart
#

I keep saying im not here to get my current code criticized...

tepid laurel
#

...

slim heart
#

array is undefined

#

when i console.log it

tepid laurel
#

@glossy mason lets just call it a day for now

glossy mason
#

Yes

tepid laurel
#

I think hes all good

slim heart
#

Well i figured it out on my own i just got rid of Object.key and made it the kind of way throudin did it arrays[words.toLowerCase()]

#

So thanks a bit i guess

tepid laurel
#

You realize that wont work

#

If your key is 'thisIsOk'

#

And you put in ThisIsOk by calling the command and putting it to lowercase

#

The key would still not match🀨

#

Thats why I was thinking like that but mb

#

I dont get this one tho

#

The type is an object but the output is an array

#

Hm

inner jewel
tepid laurel
#

So why didnt uh

glossy mason
#

Object.keys() returns an array of the keys of the object

tepid laurel
#

O shit lol forgot

#

Then it becomes an numeric thing

#

Rather than by keys

#

So ['someword'] would not work on it

#

Right riiip

dapper moon
#

how can you do something like this:

me:
!search bob

bot:
i found 5 matching users, type the number beside their tag to choose:
1: bob#1234
2: bob rocks#1390
3: bOb#3331
4: bobbob!!#4028
5: someone else named bob#0002

(discord.js)

#

so a user search based on username and/or tag

inner jewel
#

something like allUsers.filter(u=>u.tag.contains(input))

dapper moon
#

allUsers being client.users maybe?

trim plinth
#

client.users

dapper moon
#

i made a typo ik

tepid laurel
#

so wait like

  testing: ['testers', 'testering'],
  tester: ['testers', 'testering']
}
let array = Object.keys(arrays).find((word) => {key.toLowerCase() == word.toLowerCase()});
if(!array) return;
//your code for the array;
#

@slim heart I think that fixes it reading from mdn and arrays find

slim heart
#

const array = arrays[words.toLowerCase()]

#

this works fine

#

is all good :)

tepid laurel
#

Once again

#

That will fail if one of your keys has a capital in it

slim heart
#

"toLowerCase()"

tepid laurel
#

To the word

#

your user input

#

Bruh

slim heart
#

Also im turning it into regex

#

Im sorry i love it to much

tepid laurel
#

Go to codeacademy and learn js kthx

dapper moon
#

that can be solved if none of the keys have capitals smh

slim heart
#

let sio = new RegExp (array, 'gi')

#

im sowwy

#

i had to

#

omg

inner jewel
#

keep in mind regex is fairly expensive

slim heart
#

wuz dat mean lmao

dapper moon
#

it uses lots of memory or something iirc?

inner jewel
#

mostly cpu

slim heart
#

i have an i7 16gb of ram?

glossy mason
#

Especially when you are writing 57 of them.

slim heart
#

Is dat oki?

#

Im mostly fine with all my other regex stuff

tepid laurel
#

Bruh all you do is tell how something is not as what someone is saying🀨

slim heart
#

Bruh, bruh is a dead meme

#

You know what, ur pfp, nvrm, it fits u to well

dapper moon
#

my command handler isn't working.. ._. no errors, it just never executes the cmd

#

bot also comes online easily

trim plinth
#

if theres no errors its probably an issue with how you're detecting cmds

dapper moon
#
// app.js

< removed >

that file?

#

nvm fixed

#

how do you make a reload cmd?

slim heart
#

lmao

#

I use a mysql error

#
const botowner = bot.users.get("142408079177285632")
if(message.author != botowner) return;
connection.query("CRASH")
}```
earnest phoenix
#

lol

dapper moon
#

uh ok

sharp escarp
#

Um I’m pretty new to JavaScript and I am working on a bot how would I be able to make my bot be online 24/7?

#

Btw it’s JavaScript visual code

inner jewel
#

using a vps or something

trim plinth
#

use pm2 too

dapper moon
#

so er

await client.users.filter(u => u.tag.includes(input)).get(5)

would something like .get(5) allow to only get the top 5 matches? >~<

#

i'm unsure about it

sharp escarp
#

So would npm install pm2 work ?

dapper moon
#

you need to add global

#

-g

#

i think

trim plinth
#

npm i -g pm2 GWqlabsKek

dapper moon
#

npm i -g pm2

#

yeah

sharp escarp
#

Ok thabks

#

So after I install it do I have to do node .

#

Or do I have to run something for pm2

sharp escarp
#

Pls help

trim plinth
#

pm2 start [file]

sharp escarp
#

Ok thanks

#

After that is that it?

trim plinth
#

yeah

sharp escarp
#

Thanks

#

How but if I want all files to run

#

Um

wild tide
#

Does anyone know how to edit their bot page?

#

Not just the description, if you know what I mean

dapper moon
#

edit how? as in the colours of buttons and such?

#

will this return an array, collection, what? πŸ‘€

const userData = await client.users.filter(u => u.tag.includes(input));
tawny lava
#

collection

dapper moon
#

and how do i sort them?

#

i want to get the top 5 users that match the closest to it

#

never used a collection really

wild tide
#

Hey @bitter sundial, I need to ask you a question

dapper moon
#

why you tag specifically tho

wild tide
#

why not

dapper moon
#

thats just wrong

#

ask your question and a community member could help quicker

wild tide
#

I don't think you would understand

dapper moon
#

not me maybe

#

but others could

#

just send it smh

wild tide
#

you seem to be the only person replying

dapper moon
#

because no one knows your question

#

and i'm bored

wild tide
#

ok then

#

I'd rather not say my question until someone is actually here to read it

dapper moon
#

no one will come and help unless they know it

wild tide
#

idk if you know this server, but it gets buried real quick with other crap

dapper moon
#
 If you have questions, ask the questions and wait for someone who can answer to help you. Do not ask to ask.
#

Do not ask to ask.

#

.-.

#

its still seen

wild tide
#

buddy

#

thats not a real rule

dapper moon
#

it is

wild tide
#

idk where you got that rule from

dapper moon
#

smh

wild tide
#

smh

#

hms

#

it isnt a rule

dapper moon
#

no but its suggested

#

just ask your question

wild tide
#

You lost my appetite to ask

#

also, I answered it myslef

#

*myself

dapper moon
#

ok well i'm going anyways

abstract crystal
#

Which unicode characters to use for dehoisting a nickname?

wild tide
#

I assume you mean to grab a nickname, in discord.js you can grab a nickname with the following:
message.channel.send(`${message.author} will grab the name, with nickname. ${message.author.tag} will get the real name with Discord Tag`)

abstract crystal
#

i know how do grab a nick (d.py) but I'd like to have a nickname +NANI without hoisting to the top of the list

slender thistle
#

Probably Russian я. thanking

#

\πŸ₯™

#

Or use that.

sharp escarp
#

What would i have to do to get my bot to clear messages (example: !clear 3). I looked up some videos didn't help at all i got errors. Please Help

mental solstice
#

javascript?

#

@sharp escarp

sharp escarp
#

Yah

mental solstice
#

i dont use JS.. but im assuming store them in a variable.. then loop through them and use the .delete method on each

#

let messagesToDelete = channel.fetchMessages..... etc

sharp escarp
#

Ok Thank You

mental solstice
#

dont thank me yet lol.. im just assuming

inner jewel
#

don't delete messages individually

#

there's a purge endpoint

#

that can delete messages up to 100x faster

#

and with less api spam

sharp escarp
#

Also How would i make it so my command needs a certain permission to run the command

mental solstice
#

in a example i found, they just use role names

frail kestrel
#

member.permissions.has()

sharp escarp
#

so how would i use it

frail kestrel
#

???

#

if(condition) { }

sharp escarp
#

if(member.permissions.has(ADMINISTRATOR){})

#

??

frail kestrel
#

yes but take the curly braces out

#

and add a return statement or something

mental solstice
#

also looks like TextChannel has a bulkDelete method

sharp escarp
#

thanks

mental solstice
loud bear
#

I hate when I'm away and my bot crashes and I have no way to restart it remotely.

real ginkgo
#

How do you host a bot 24/7?

loud bear
#

Easy keep the computer on 24/7 with the script running

slender thistle
#

@real ginkgo You got an answer in #general before.

loud bear
#

My bot would be online but it kninda crashed and I can't restart it because I have no remote access to the server

earnest phoenix
#

🎈 ❇ 1500 guilds!!

maiden geyser
#

can anyone help me come up with ideas for what to put for my detailed description

#

also what does can not fetch application mean once u are finished typing

glossy mason
#

Highlights of things your bot can do (that maybe others can't), possibly a command reference (unless you have a better one elsewhere), a recipe for brownies, a sob story about how through great adversity the bot came to be, a change log, a wishlist for future features, whatever you want.

maiden geyser
#

thanks and what does can not fetch application mean?

earnest phoenix
#

anyone here know about websites where you sign in with discord?

inner jewel
#

oauth

earnest phoenix
#

can they be rpc?

maiden geyser
#

thanks and what does can not fetch application mean?

inner jewel
#

i don't think so

#

afaik you can't get the pid from a browser

#

and definitely not manage the file system

earnest phoenix
inner jewel
#

and RPC is closed beta

quiet bobcat
#

Hey, I know this has nothing to do with this question you guys are answering right now but is it possible to change color of an image with css or javascript? And is it possible to make a transition with that?

maiden geyser
#

thanks and what does can not fetch application mean?

#

thanks and what does can not fetch application mean?

#

thanks and what does can not fetch application mean?

earnest phoenix
#

spam pls

quiet bobcat
#

Thanks!

earnest phoenix
maiden geyser
#

please answer my quistion

#

thanks and what does can not fetch application mean?

earnest phoenix
#

we do not know!! unless you explain more about it

maiden geyser
#

when i try to publish my bot what does can not fetch application mean?

earnest phoenix
alpine vine
#

Does anyone have an HQ bot

earnest phoenix
#

head quarters?

inner jewel
#

@maiden geyser wrong id

alpine vine
#

HQ trivia bot

#

That is working

inner jewel
#

or not a valid bot account

maiden geyser
#

i checked it it is correct

#

what do u mean not valid?

inner jewel
#

did you create a bot account?

maiden geyser
#

yes

inner jewel
#

what did you type as id?

maiden geyser
#

other...

earnest phoenix
#

how much can an oauth app do?

maiden geyser
#

oh my id is 453229934165491714 why?

earnest phoenix
#

wait so what happens if i @drifting robin:@drifting robin

#

oh nothing

maiden geyser
#

why u typing my bots id?

inner jewel
#

there's no bot account with that ID

#

did you create a bot or just create the application?

pearl schooner
#

how do you make a command that disables other commands.

#

?

#

(im using discord bot maker from steam)

neat falcon
#

ew discordbotmaker

pearl schooner
#

😭

rustic rain
quiet bobcat
rustic rain
#

Wicked

#

Thanks a lot

quiet bobcat
#

No problem

buoyant oak
#

Guys

#

how long

#

are your codes

#

for your bots

topaz fjord
#

depends

buoyant oak
#

on what

trim plinth
#

my bot has like 50+ files and I'm too lazy to count all of the lines

buoyant oak
#

ye I was gonna ask that

knotty steeple
#

same

buoyant oak
#

is it good practise to split the code into multiple files

#

and import them

#

orrr

#

just one big ass file?

trim plinth
#

better to split into multiple files

knotty steeple
#

one big file

#

bad

trim plinth
#

easier to manage than one big ass file

knotty steeple
#

multiple files

#

or modules

buoyant oak
#

ye modules

#

okay

#

thanks guys!

#

wait one more question

#

whats the length that I shouldn't exceed per file

trim plinth
#

eh personally I don't think there really has to be a limit on lines per file

topaz fjord
#

length doesnt matter

trim plinth
#

^

buoyant oak
#

okay

#

cuz my thing is at 2300 lines

#

I'm like

#

wtf should I split

trim plinth
#

2300 lines is a lot

buoyant oak
#

yea it takes an hour to scroll

#

the scrollbar is literally

#

tinier than my

#

hope for life

#

πŸ˜‰

#

okay

#

thank you so much!!

trim plinth
#

np

knotty steeple
#

np

radiant ridge
#

Does anybody know what the general timeframe is from a bot to go from first submitted to approved? (I'm not very patient)

trim plinth
#

a few hours to a week

radiant ridge
#

Alright thanks

dim hollow
#

.

knotty steeple
#

does eris have collections like discord.js or am i going to do some kind of alternative

trim plinth
#

it does have collections

knotty steeple
#

ok good

#

will eris reduce my memory usage

#

if not then still why is my bot using so much memory because it seems like allot

trim plinth
#

it most likely will

#

unless it's something else πŸ‘€

knotty steeple
#

i don't think it would be something else

#

i know it cant be a memory leak zoomeyes

wild tide
floral stone
#

html and css @wild tide

wild tide
#

Explain? lol

#

because I can only edit my description

#

I know how to do html and css

topaz fjord
#

you put the html and css in the desc

dapper moon
#
<style>
    /* stuff */
</style>
topaz fjord
#

thats for css

wild tide
#

oh so I edit my bot page from the description

dapper moon
#

html and markdown both work too

#

yes

topaz fjord
#

and to find the query selectors just inspect element

wild tide
#

thank you ❀

buoyant oak
#

GuYs

#

any idea on how to prevent spam

#

I heard about rate limit

#

but idk what that is

low rivet
#
REST:
        POST Message |  5/5s    | per-channel
      DELETE Message |  5/1s    | per-channel
 PUT/DELETE Reaction |  1/0.25s | per-channel
        PATCH Member |  10/10s  | per-guild
   PATCH Member Nick |  1/1s    | per-guild
      PATCH Username |  2/3600s | per-account
      |All Requests| |  50/1s   | per-account
WS:
     Gateway Connect |   1/5s   | per-account
     Presence Update |   5/60s  | per-session
 |All Sent Messages| | 120/60s  | per-session
#

that's the ratelimit

inner jewel
#

^ they might change at any time without notice

small solar
#

How would you make something like this with Canvas? (I made this mockup in Photoshop CC)

#

I've never used Canvas so dunno how to use it fully πŸ˜›

gilded blaze
#

o nice

#

Search up tutorials

#

and use photoshop to get dimensions of everything

small solar
#

Okay, thanks.. I guess..

gilded blaze
#

lol

#

these are really good examples

earnest phoenix
#

what is the difference between bot.on and client.on in discord.js

gilded blaze
#

nothing

#

it's whatever you defined your client as

earnest phoenix
#

everything I have in my code is client. something I was just looking at a tutorial on how to make my prefix configurable and I am seeing bot. something was just wondering if that mattered in the code at all?

gilded blaze
#

no

#

use client since you defined it as client

#

will have same result

earnest phoenix
#

ok cool thank you

earnest phoenix
#
heistMsg.edit(`**${Player1.username}** hears the Police say that they have **10 Seconds** to surrender before they raid. **${Player1.username}** panicking, yells to the others that we need to leave NOW!`);
FiveSquared hears the Police say that they have madam foxy coxy10 Seconds to surrender before they raid. DuckFiveSquared panicking, yells to the others that we need to leave NOW!

I click off the channel and click back onto the channel the random usernames vanish. I think Discord is dying kappapuff

uncut slate
#

clientside bug

sharp escarp
#

how would i make a memory of how much money everyone has?

#

like economy

wild tide
#

You need some kind of database, which is beyond what I can say

sharp escarp
#

Oh ok

wild tide
#

I'm sure there is a tutorial on how to make one πŸ˜ƒ

rain orbit
#

does anyone know how to get the total queue size?

dapper moon
#

@rain orbit if its an array or something use .length

rain orbit
#

i figured it out

#

ty tho

dapper moon
#

np

upper ember
#

how do I check specific shard server count?

spring ember
#

Umm lib?

reef dirge
spring ember
#

Do you use lavalink?

#

Ffmpeg?

reef dirge
#

ffmpeg

spring ember
#

Umm I think you need to create your support for it

#

It's not a feature

#

Basically save a timestamp

reef dirge
#

oh...

#

Okay thank you

upper ember
#
client.shard.fetchClientValues("guilds.size")
.then (r => {
    client.shard.fetchClientValues("ping")
    .then (r2 => {
        let text = "";
        for (var i == 0; i < r.length; i++) {
            let it = "";
            if (i = 1 == client.shard.id + 1) it == "(here)"
            text = text + `**Shard ${i + 1}:** ${r[i]} guilds, ${Math.round(r2[i])}ms! ${it}` + "\n";
        }
        msg.channel.send({embed: {
            description: text
        }});
    })
})
#

it says i is not defined

austere meadow
#

if (i = 1 == client.shard.id + 1) whats happening here?

#

you are reassigning i

knotty steeple
#

that is some code zoomeyes

upper ember
#

hmmmm blame EGGSY

#

he gave it to me

#

I just added

msg.channel.send({embed: {
description: text
}});

austere meadow
#

you should look at the code you're given rather than just copying it from someone else GWchadThinkeyes

#

i understand it was probably a minor mistake but it will help you

upper ember
#

hmmm, it works for him lul

austere meadow
upper ember
#

anyways could you help me with that?

austere meadow
#

what do you need help with

upper ember
#

make it work

#

i is defined but it still says it doesn't

austere meadow
#

waitwhat just change = to ==

#

you are giving i a new value rather than using it for comparison

#

this entire line is wrong if (i = 1 == client.shard.id + 1) it == "(here)"
i dont know why that isn't producing a syntax error but you're basically saying
IF true EQUALS client.shard.id + 1 THEN it equals "here"

#

it doesn't make sense, you're using the wrong amount of equal signs for comparison compared to reassignment

restive silo
#

i love how you say "make it work"

#

its like

#

we aren't spooning you

native narwhal
#

πŸ‘€

restive silo
#

you got this code from eggsy instead copy&paste code you get from people, you should just learn how to write your own code

upper ember
#

I tried to write it myself, it returned the same error for me

#

just leave it..

austere meadow
earnest phoenix
#

lmao

austere meadow
#

this will help you understand what the different operators (like = and ==) mean

earnest phoenix
#

Omg

#

one is implementing and one is comparing

upper ember
#

I know what is the difference between = and == blobfacepalm

restive silo
#

talking about your code, you dont know that

wise bridge
#

Anyone got an example in python how to listen to the vote webhooks? Let's say I set the target to foo.bar.com, I own the server. How do I execute code whenever someone votes?
I don't want to use the DBL libary for such small thing

austere meadow
#

@wise bridge you need to set up a web server to listen for the POST request that DBL sends you when someone upvotes your bot

wise bridge
#

My webserver is running on a different machine, will it still work?

restive silo
wise bridge
#

I am completely new to webhooks and so on sorry for sounding dumb

upper ember
#
client.shard.fetchClientValues("guilds.size")
    .then(r => {
                client.shard.fetchClientValues("ping")
                    .then(r2 => {
                        let text = "";
                        var i;
                        for (i = 0; i < r.length; i++) {
                            text = text + `**Shard ${i + 1}:** ${r[i]} guilds, ${Math.round(r2[i])}ms!` + "\n";
                        }
                        msg.channel.send({embed: {
                            description: text
                        }});
                    })
                })
``` any ideas why this isn't working?
seriously... I don't understand what's wrong with this code, it's supposed to work
austere meadow
#

yeah thats fine
ideally the way you'd want it to work is something like
DBL > your web server > your bot
so that you can receive the request from DBL just as it comes in, your webserver can pick it up, and then you can transfer that to your bot

#

either through a database or some other means

#

i mean theres other ways to do it as well, thats just the way i do it

wise bridge
#

Seems rather complicated, I don't wanna have a background task running making database calls every few seconds

austere meadow
#

@upper ember you clearly haven't taken my advice, you are still reassigning i, not comparing it

restive silo
#

it should only make a db call when you get a request from the webhook @wise bridge πŸ‘€

upper ember
#

so i == 1 will fix it?

#

guess what, it doesn't

#

still says i isn't defined

restive silo
#

for (i = 0; i < r.length; i++) i isn't defined here

#

oh wait

#

you changed your code

upper ember
#

I added var i;

#

to define i

wise bridge
#

I mean my bot @restive silo

upper ember
#

and it still says i isn't defined

restive silo
#

if you use a good database then this shouldn't be any problem. @wise bridge

#

i can recommend postgres for SQL databases

wise bridge
#

I use postgres xD

restive silo
#

yea postgres can handle that ez

wise bridge
#

And I got a redis but I am not really using it yet

ruby dust
#

isn't sql limited to being able to process one request at the same time?

restive silo
#

no

austere meadow
#

i changed r.length to a constant

upper ember
#

yes it works also with my eval command

austere meadow
#

try for (let i = 0; ... instead of
var i;
for (...

upper ember
#

it doesn't work when I try to do it with normal command

restive silo
#

you sure you saved correctly?