#development

1 messages · Page 396 of 1

sand vale
#

it really depends on what your bot does

#

and how many people are in the guilds /guild amount

inner jewel
#

i use ~600-800MB for 5.6k guilds

trim plinth
#

@solid cliff yeah 1gb would probably be best

solid cliff
#

oki

topaz fjord
#

@stone kiln what wus that command

#

to track memory

sand vale
#

what language

proven schooner
#

Now i just reached a milestone! 5 hours on a single fucking tutorial. I am now going back steps : D 👏 👏

trim plinth
#

ok so the least you'll need for your build.gradle would be ```gradle
group 'succ'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
mavenCentral()
jcenter()
}

dependencies {
compile 'net.dv8tion:JDA:3.5.0_329'
}

#

@proven schooner

inner jewel
#

update that jda angryeyes

trim plinth
#

mmLol

inner jewel
#
plugins {
    id'java'
    id'application'
    id'com.github.johnrengelman.shadow' version '2.0.2'
}

mainClassName = 'com.example.jda.Bot'

version '1.0'

sourceCompatibility = 1.8

repositories {
    jcenter()
}

dependencies {
    compile 'net.dv8tion:JDA:3.6.0_355'
}

compileJava.options.encoding = 'UTF-8'```
trim plinth
#

@inner jewel I haven't updated because I'm too lazy™

inner jewel
#

ur almost 30 builds behind

trim plinth
#

I don't use JDA that much anyways so I barely keep up with updates

brisk notch
inner jewel
#

i get a ping for each update

trim plinth
inner jewel
proven schooner
#

How do i update the jda?

inner jewel
#

changing the version in build.gradle

trim plinth
#

use Natan's JDA compile string mmLol

#

its the latest stuff

brisk notch
#

test

proven schooner
#

because the one i typed since i having a mental 'melting'

inner jewel
#

tbh you should learn java before trying to write a bot

trim plinth
#

^

#

that applies to any language

inner jewel
#

if you don't have any knowledge you'll get nowhere

#

and JDA isn't beginner friendly at all

trim plinth
#

you have to stalk the JDA docs to get anywhere with JDA tbh

#

just stare them down :^)

inner jewel
#

not really

proven schooner
#

@trim plinth Your's doesn't work

inner jewel
#

most methods are pretty clear on what they do

trim plinth
#

yeah cause I suck

proven schooner
#

@inner jewel What do i change out of yours?

inner jewel
#

nothing

#

mine's the latest version

trim plinth
#

maybe I should actually update rn

proven schooner
#

Do i keep the domain id?

#

How do i import the jda

trim plinth
#

look above GWliliumFacepalmSeola

#

scroll through chat

proven schooner
#

its* FINALLY WORKING

trim plinth
#

ok cool

proven schooner
#

Im adding a listener to my bot. Keeps flooding me with a fuckload of errors

trim plinth
#

did you import it bloblul

proven schooner
#

Nope.

#

Thats the probem

#

Problem

trim plinth
#

you need to import shit to get things running

proven schooner
#

This is the first time(of course) im doing this type of scripting.

#

Well where do I import the pile of shit to get the shit running?

topaz fjord
#

maybe you should learn Java

trim plinth
#

^

#

learn Java before running into stuff you don't know, helps a lot in the long run

proven schooner
#

@topaz fjord This is how I am going to learn it. At least part of it.

trim plinth
#

no just no

topaz fjord
#

Not a good way to learn

#

seems like your getting spoonfeeded

proven schooner
#

I do not do good at learning programming languages, I don't even know why the fuck im doing this.

trim plinth
#

learn langs outside of bot making instead of using bots as a way to learn

pastel violet
#

Can anyone teach me node?

trim plinth
#

node?

pastel violet
#

node.js

trim plinth
#

like the js runtime

pastel violet
#

mhm

trim plinth
#

ok

pastel violet
#

I want to develop a bot

topaz fjord
#

Learn from online mmLol

pastel violet
#

To confusion

#

Friends are way better

trim plinth
#

hint: run files with node urFile.js

pastel violet
#

wait what

#

idek how to export shards and that

trim plinth
#

shards?

#

wot

proven schooner
#

Should i do the java script acadmeny?

pastel violet
#

parts of the bot, so you wont lose it all togethe

proven schooner
#

Haven't done that in years

trim plinth
#

no thats not what shards are

pastel violet
#

idk then

trim plinth
#

shards are multiple processes of a bot designed to keep Discord from reeing at it once it gets too many guilds

pastel violet
#

welp

#

how to even make a BOT say hi

#

oml this is confusion

trim plinth
#

I'm guessing you want to know JS, Node.js isn't a lang, its a JS runtime

pastel violet
#

ok

#

JS then

trim plinth
#

your solution: learn JS

#

if you don't know it already

pastel violet
#

.

trim plinth
#

yeah seriously

pastel violet
#

i have visualcode

trim plinth
#

it'll help a lot to learn JS first before going into JS bots

#

even if you have VS it won't accomplish anything for you if you don't know a programming language

proven schooner
#

What would be the easiest way?

trim plinth
#

@proven schooner for what?

pastel violet
#

just gonna get a friend tohelp me

inland axle
#

Ew

gilded blaze
#

How do I avoid ratelimit when fetching multiple users?

#

or get around it

inner jewel
#
  1. you don't
  2. multiple tokens
gilded blaze
#

wew

errant bone
#

Is there a way I could make this line use queue()
User o = DATA.JDA.retrieveUserById(args[0]).complete();
?

dusty sandal
#

for js, how would i do a thing to detect if a message isn't a number
basically, heres what kind of code i want to run if the message isn't a number, then send an error message

glossy mason
#

@errant bone You can pass queue a consumer (callback), and so once it's competes it will pass that consumer the user object.

errant bone
#

code example?

glossy mason
#

I'm not sure how to do it in Java exactly, but in Kotlin it's:

data.jda.retrieveUserById(ages[0]).queue { user -> 
// my beautiful code using the user object 
}

If you'd like, I can try to look up how to write it in pure Java.

#

Actually, if I recall correctly, I think in Java you can do:

data.jda.retrieveUserById(ages[0]).queue((user) -> {
// my beautiful code using the user object 
});

I'll double check.

errant bone
#

alright, thanks dude

glossy mason
#

No problem. Hopefully it works.

errant bone
#

I'm not that good with lambda expressions

glossy mason
#

Instead of setting u to user, you can just rename user. I just wrote user to make clear what the value is.

inner jewel
#

you can't assign a local variable from inside a lambda

errant bone
#

oh

inner jewel
#

move the code that needs user inside the lambda

errant bone
#

Ohhhhhhhh

#

Thanks both of you guys

glossy mason
#

@dusty sandal You can use isNaN(messageContent) to check if it is Not a Number.

dusty sandal
#

ok thanks

inner jewel
glossy mason
#

What?

inner jewel
#

idk why did i expect JS to make sense

#

i'd expect isNaN to strictly compare to FP NaN

glossy mason
#
isNaN(123)         // false
isNaN('123')       // false
isNaN('1e10000')   // false (This translates to Infinity, which is a number)
isNaN('foo')       // true
isNaN('10px')      // true 
trim plinth
#

infinity is a number GWqlabsThonkery

glossy mason
#

[controversy intensifies]

trim plinth
#

the more controversal shit is how NaN is a number

glossy mason
lament hemlock
#

1e10000 !== infinity

#

infinity is infinity

#

and isNaN is going to attempt to parse the first parameter as a number

#

undefined is a javascript object and therefore is not a number

#

0 / 0 is also not a number

#

as it is not defined

#

hello is not a number

#

2005/12/12 is also not a number, the / make it unable to be parsed

#

this shit is easy

glossy mason
loud bear
#

ok python is being weird on windows i need to use game=discord.Game but on this laptop running ubuntu i need to use activity=discord.Game I find that weird

solemn obsidian
#

Different versions of the lib?

loud bear
#

its just a minor thing but i just find that weird

frail harness
#

@loud bear nope its different vers definitely

#

the one installed on windows is prolly an older version

solid cliff
#

Rewrite has updated from game to activity

torpid frost
#

i need an help/idea:
my bot need to delete a message from a user and rewite it sobstituting particular format....
but i want that before do that it waits to see if other bots deletes that message

any ideas?
i use JDA

torpid frost
#

... 😔

gilded thunder
#

How would I get a messages content from a message ID in discord.py async?

ruby dust
#

message.content is what you want, but you first need to define message as the message you are tarrgetting, you can find that in the discord.py docs

gilded thunder
#

Alright, thanks.

glossy robin
#

hi, my bot has the permission to nickname people, but cant nickname people who are higher rank than it is, is there any way at all that I can get it to nickname higher ranking people or do I just have to live with it?

topaz fjord
#

Unless the bot has a role higher than the person it's trying to nickname

#

You should probably check the role position of the member your trying to nickname and if the bots role position is lower than it, return a message telling them the user your trying to nickname has a higher role than me or smth

glossy robin
#

ok :/

#

thanks

topaz fjord
#

Np

torpid frost
#

someone have an idea for my question?

low owl
#

If you rephrase your question I might be able to help you

torpid frost
#

i've a bot that pratically echoes what a user says modifying some things
i want him to wait to reponse (like some ms) to see if the message gets deleted by other bots (like censor bots or slowmode)

low owl
#

Ah, I see

#

This might be outdated or not relevant to your version

#

But you get the point, I guess, that you need a Timer. If this SO doesn't work for you, I'd suggest researching other Timers.

earnest phoenix
#

I think u should look at setTimeout

low owl
#

Java != JavaScript

earnest phoenix
#

Brian u can google the SetTimeout function in java it is a bit the same but if im not wrong its called "Timer"

daring musk
#

Yeah Those are delays

#

setTimeout and maybe setInterval

low owl
#

I'm unable to find that method in any Java related Timer class

#

and researching only spits out JS

earnest phoenix
#

oof

torpid frost
#

err... the question is how to test if the message is still there

#

i've not found any methind like isDeleted() or isNotDeleted()

low owl
#

Dude

earnest phoenix
#

Check the docs

low owl
#

You wait for the message delete event > cache the deleted message id > check if it is in cache

#

if yes it got deleted

shell oxide
#

(discord.py) so ive got the ffmpeg folder, I'm not sure what it means by 'You must have the ffmpeg or avconv executable in your path environment variable in order for this to work.', can anyone point me in the right direction? thanks

glossy robin
#

when you installed ffmpeg did you have to go into the control panel and add the ffmpeg directory path into a text box?

#

because that might be what it is referring to

shell oxide
#

when i installed it with homebrew it just added the ffmpeg folder

glossy robin
#

ah

#

wait windows or linux?

shell oxide
#

osx

glossy robin
#

ah

#

sorry, only know how to do it in windows

shell oxide
#

how would you do it in windows

glossy robin
#

but you want to find out how to add ffmpeg to your path

ruby dust
#

does osx even have the "pathing" thing?

glossy robin
#

yes

#

so does linux

#

but i think in osx and linux you do it with a command

#

in windows you would go to system info in control panel then click "advanced system settings", click environment variables, then add the path variable with the directory path inside it

shell oxide
#

i added the path to bash_profile

glossy robin
#

this is what I found online.. that looks like it should work:


open -e ~/.bash_profile
Add this to the file at the end:

export PATH="/usr/local/bin:$PATH"
Save it, and close the editor. Now restart your Terminal and which ffmpeg should return /usr/local/bin/ffmpeg.```
shell oxide
#

yes

glossy robin
#

:D

shell oxide
#

well thats sorted thanks haha, but now a new error has thrown up 🙄 i'll get there smh

glossy robin
#

lol

earnest phoenix
#

lel

#

no

#

use vs or IDE

glossy sand
#

@vital plover ok so you're retrieving the command executor at line 47 right

#

looking it up in a hash table

#

so the solution is to mutate the key so case becomes irrelevant, right

vital plover
#

ye

glossy sand
#

so call .toLowerCase on it?

#

assuming your definitions register commands in lower case

vital plover
#

in which file to i put .toLowerCase

glossy sand
#

i'm trying very hard to not spoonfeed

#

so consider this

#

your command hash table maps lowercase command names to command executors, right?

vital plover
#

ye

glossy sand
#

now suppose a user tries to retrieve the entry help => [Help command] by doing !HELP

#

you receive the string "HELP" but you want the entry keyed "help"

#

what do you do?

vital plover
#

not sure

glossy sand
#

is it not sufficient to simply transform the string you receive to lower case before using it?

vital plover
#

idk

glossy sand
#

i get the distinct feeling that you just copied your command dispatcher from elsewhere

vital plover
#

as i said im kinda new to js

earnest phoenix
#

and any programming language?

#

dont need to do programming to know help != HELP

abstract crystal
floral stone
#

@earnest phoenix it could equal since your example contains variables, not strings.

#

I'm joking

topaz fjord
#

if u want it to work, just use .toLowerCase() kek

#

^ thats for js

floral stone
#

His example was python so .lower()

topaz fjord
#

ah

floral stone
#

Ah, you beat me to it.

topaz fjord
#

gonna go program in nandlang

#

lets see how this goes

floral stone
#

Good luck! :D

topaz fjord
#

: D

topaz fjord
#

can u use .broadcastEval in d.js too eval multiple things

earnest phoenix
#

yes

#
broadcastEval("[something, something2, anotherthing]").then(d => {
    const firstShard = d[0];
    firstShard[0] // something
    firstShard[1] // something2 
    firstShard[2] // anotherthing
});
clever yew
#

@earnest phoenix That's disgusting

earnest phoenix
#

@clever yew I didnt ask for your opinion

#

and it was an example

clever yew
#
broadcastEval("[something, something2, anotherthing]").then([[first, second, third]] => {
    // Do something with them
});```
earnest phoenix
#

so stfu

#

Kyra pls

#

Why do you always have to be better

clever yew
#

Because that's more readable loLmm

earnest phoenix
#
broadcastEval("[something, something2, anotherthing]").then(d => {
    for (const r of d) {
        r[0]; // something
        r[1]; // something2 
        r[2]; // anotherthing
    };
});
uncut slate
#

why wouldn't you destructure it in that example

earnest phoenix
#

Because you're destructing the first shard

uncut slate
#

or do I have no idea how broadcast eval works

earnest phoenix
#

broadcastEval returns Promise<Array<*>>

#

Array being the data from each shard

uncut slate
#

disgusting

earnest phoenix
#

same tbh

sinful lotus
#

so it means if you broadcast eval the shards on client.guild.size it would return answers then just add it then thats it?

toxic oracle
#

this is client

#

So this.guilds.size would return the clients guilds ye

sinful lotus
#

well do posting stats on dbl would need it to be added, or dbl will automatically add it?

toxic oracle
#

You can send per shard

sinful lotus
#

like on what is on docu?

toxic oracle
#

If you send shard id and count from each client

sinful lotus
toxic oracle
#

Ye

#

Just read the API docs it explains it all there

sinful lotus
#

I see thanks for that I thought I would need to add it first

#

before sending it to dbl

solemn obsidian
#

I mean at least jacz way wont break if you change shard amount...

left mulch
#

How long does it take to get a reply for bot certification?

prime cliff
#

@Dark#6246 You will get a DM from Luca

solemn obsidian
#

No bot dev role Thinkies

prime cliff
#

You still get a DM for being verified

left mulch
#

I understand that, but how long does it usually take?

earnest phoenix
#

Anywhere from 5 mins - infinity

#

i would wager max of 24 hours?

left mulch
#

Well the max wouldn't be infinity, right?

earnest phoenix
#

I would wager

#

but its infinity

left mulch
#

Like they never accept or deny?

primal adder
#

lmao freel?

#

i applied like a week ago

#

max 24 hrs?

earnest phoenix
#

40 years later

left mulch
#

Bruhhhh

toxic oracle
#

24 hours isn't even long

#

rofl

primal adder
#

bruh

#

i waited a week

#

thas not 24 hrs

earnest phoenix
#

i was going to say something but its depressing so i will shut me yop

primal adder
#

i'm depressing

#

i have no social life

earnest phoenix
#

@slender kestrel

#

lolz

#

i was wondering if it wa shere

#

whats your level with tatsu?

restive silo
#

Certification is something different than wait for approval btw

keen anvil
#

guys, this doesn't look like development talk lol

earnest phoenix
#

it looks like girl group numero 1

restive silo
earnest phoenix
#

We just did tho

#

But ok dokes

primal adder
#

oops sry

earnest phoenix
earnest phoenix
#

its so freaking easy but i can't figure it out

#

youtube easy

#

google

#

easy

#

urban easy

#

but this nope stop wait

earnest phoenix
#

NVM im an idiot

#

    const Discord = require("discord.js");
    const response = require("random-responder")
    
    exports.run = async (bot, message, args) => {
        
        let link = args.join(" ");
    

    
        response.get(`${link}`, function(err, daresponse) {
          message.channel.send(daresponse)
        })
        
        


    }
    
    ```
#

worked

#

so peeps i got a bot that can talk Xd

#

wait.....

#

@《RyzenFire》▪Sim's▪#3970 did u know

#

@earnest phoenix did u know. . . that i made that bloblul

#

nope

#

nice tho

#

when its no responding i dunno what you mean XD

#

But noice

#

im updating it

#

its nice

#

you need to do a boob function

#

it will be a bit slower but has more words and stuff

#

boob?

#

PREFIX do you have boobs?

answer yes big ones

#

like that

#

gay

#

XD

#

really good job tho a +

#

its gonna be dank!

#

it's dank already and it's gonna be the dankest. well as it gets better my bots chat ability gets better so wooo woop

#

the update has better functions

#

it uses callbacks

#

so its not good

#

shhhhh

#

@earnest phoenix do u prefer snefetch or request?

#

snekfetch

#

same

jagged birch
#

same

earnest phoenix
#

^
^
^
^

uncut slate
#

https 😩

low owl
#

@earnest phoenix like ah smartbot? Or however it was called.

#

Or more like open source what I use?

earnest phoenix
#

cleverbot

low owl
#

Ah yes, I can actually try that later

earnest phoenix
#

well some of em are paid

low owl
#

Wanted to work on it today anyways

#

Just gonna use the first free one I find for testing

earnest phoenix
#

u wanna see mine?

low owl
#

Sure

earnest phoenix
#

its pretty slow thou but it works fine for discord bots

sinful lotus
#

anyone available for some help here

#

its been 3 hours

earnest phoenix
#

ya

low owl
#

Shoot whatever you have trouble with

earnest phoenix
#

@sinful lotus u gonna ask?

sinful lotus
#

I cant make the bot

#

check itself

#

if it has permissions for sending message

#

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Missing Permissions

earnest phoenix
#

That’s ez

#

Do a .cacth() for errors

#

That’s all

sinful lotus
#

I tried doing that

earnest phoenix
#

And?

#

No need to console.log()

sinful lotus
low owl
#

Ahm

#

don't just try catch everything

earnest phoenix
#

Can’t u just....

sinful lotus
#

ok removed those

#
if (msg.isMentioned(config.kashimauserid)){
    try {
        let yourownprefix = settings.getProp(msg.guild.id, "prefix")
        return msg.channel.send(`**Teitoku**, this **Server Prefix** is set to => **${yourownprefix}**`)} catch(error) {}};
#

with that

#
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Missing Permissions

still here

earnest phoenix
#
  1. Ur trying to do ur commands
  2. Do message.channel.send().catch(e => {}) sorry I am on mobiel
#

No code blocks

sinful lotus
#

at last it woked

earnest phoenix
#

👍

sinful lotus
#

now my problem will be

#

do I need to rewrite all my code

#

if (!msg.content.startsWith(guildConf.prefix)) return;

#

after that line?

earnest phoenix
#

No

sinful lotus
#

because if you used a command

#

it will error again

#

so do I need to rewrite the whole code

#

or just put a try catch

#

yep it worked with the try catch

#

xD

#

ty for the help fellow devs

low owl
#

I want to note here that exceptions are not to be ignored

#

it's considered bad practice to expect an exception when in the first place you could avoid them

solemn obsidian
#

So you are saying making sure the process doesnt crash is bad?

low owl
#

No

#

Read again

orchid copper
#

I think unusually high use of try catch except blocks shall be avoided..But still where we have no control over causes of error like net problem bad user input etc etc

low owl
#

When you have no control, exactly

#

but in this case you have control in 95% of the cases

solemn obsidian
#

"it's considered bad practice to expect an exception when in the first place you could avoid them"

low owl
#

except for stuff where there are no API endpoints such as the ability to check if you can dm someone

solemn obsidian
#

you can't as a human expect your code to be perfect and never error

low owl
#

Have fun living on the edge then 🤔

sinful lotus
#

I wanna ask something

#

how do I check the bot if it has permissions for sending message

#

for some of my codes that needs it

#
msg.guild.members.get(client.user.id).hasPermissions('SEND_MESSAGES')

I already tried this but I cant make it work

low owl
#

That works for guilds, but it's possible that you have no permissions in a specific channel

sinful lotus
#

yeah thats the case of what Im trying to fix

#

since some of my codes doesnt really like the .catch stuff

low owl
#

Well, similar approach then. Get the channel and then the Channel Permission Overrides

#

at least that'd work in D.NET, no idea about JS

orchid copper
#
try: 
     await client.send_message(message.channel, chat)
except discord.Forbidden():
     print('wtf')
#

@sinful lotus this worked for me

sinful lotus
#

I use .js no idea on how I can convert that

#

xD

orchid copper
#

omg sorry

sinful lotus
#

its ok. im just looking for a way to

#

just let the bot check its perms

earnest phoenix
#

lemme see

night imp
#

message.guild.member(client.user).hasPermission

#

I think

earnest phoenix
#

i dont think u can do that

uncut slate
#

message.guild.me.permissions.has

#

or something around those lines

earnest phoenix
#

@uncut slate make em read the docs :/

uncut slate
#

not really

#

either message.guild.me.permissions.has or what you already linked

#

I'm just adding on

earnest phoenix
#

tru

low owl
#

Hint: he wants the channel permissions, not the guild ones 👀

sinful lotus
#

i got it working

#

but i cant convert it lols

low owl
#

Convert?

sinful lotus
#

DeprecationWarning: EvaluatedPermissions#hasPermission is deprecated, use Permissions#has instead

#

let permcheck = msg.channel.permissionsFor(msg.guild.me).hasPermission("SEND_MESSAGES")

#

using Permissions.has

#

makes send message undefined

low owl
#

Well, Permissions#has refers to an instance of Permissions on which you call .has

#

do you have an instance of Permissions?

sinful lotus
#

something like new Discord.Permissions(memberpermissions); ?

low owl
#

Hold on

#

what lib are you using?

sinful lotus
#

d.js

low owl
#

Ok, so what you want is to acquire a Permissions object

#

from some other method, probably in the Channel one

#

All you need to do is replace .hasPermissions with .has

sinful lotus
#

thanks a bunch

#

xD

earnest phoenix
#

why do people dont read my messages :/

spring ember
#

anyone has a good idea how to find if an invite link is in a message?

#

jda

restive silo
#

regex

spring ember
#

yeah I forgot you can do message.getInvites()

#

I recommend you to use that actually

inner jewel
#

Message#getInvites() doesn't catch sole advertisers

#

eg discord dot gg slash code

sand vale
#

dbl.getVotes(true)

#

does that check if someone voted at any time

#

or only within the past 24h

next wedge
#

~help

lavish mango
sage osprey
#

@south finch @charred pumice should now be fixed

south finch
#

oh okay

sage osprey
#

though I am not 100% sure, so could you also check if it is? I don't have any bots to check it with

spring ember
#

test before applying

sage osprey
#

OKTO is my first bot too so I am new too all this

spiral cliff
#

How about create one for testing? 😂

sage osprey
#

lol

south finch
#

idk why yall felt like commentating think

spring ember
#

It's ok to be new but just wait until it's polished before you publish it

sage osprey
#

yeah, well I never thought about the possibility of another bot causing it to reply before launching it here 😓

spiral cliff
#

lol, happens, if I would tell my first faults in programming, you would laugh 😂

sand vale
#

no matter what i do im getting
Error: Cannot find module 'dblapi.js'
i have the package

ruby dust
#

I feel like I should know this by now, but...

#

in discord.py-rewrite, how would I get a list of member objects that meet specific criteria?

#

for example all have ban members permission

spring ember
#

Rolewise? @ruby dust

#

Or just permission

#

Afaik you must go over all of the members sadly

ruby dust
#

it doesn't really matter, I just need to get a list of members that have something specific in common in a specific server

abstract crystal
#

For loop, i don't think there is another way

glossy mason
#

What about a list comprehension, or filter?

#

The Pythonic way of doing it.

low owl
#

That still should be O(n)

earnest phoenix
#

What's the color of embed "backgrounds"?

loud bear
#

I think my bot is having an attitude right now
all the console been doing for the last 10 or so min is spit out errors and restart and spam my server with start up announcements XD

topaz fjord
#

rgb(50, 54, 59)

#

@earnest phoenix

delicate zephyr
topaz fjord
#

am lazy

#

also i used sharex

#

¯_(ツ)_/¯

prime cliff
#

@loud bear Discord had an outage like 30 mins ago

#

So things might have broken idk

loud bear
#

ik about that but it was fine after that it just been spamming console with errors for the last 15 min or so

#

im hoping that restart just helped XD

#

yep that seemed to have helped XD

visual surge
#
if (command == "eval") {
  msg.delete()
    try {
      const code = args.join(" ");
      let evaled = eval(code);

      if (typeof evaled !== "string")
        evaled = require("util").inspect(evaled);
      let embed = new Discord.RichEmbed()
        .setDescription("**__Success!__**")
        .addField("Input:", "`` `xl\n"+args.join(' ')+"\n`` `")
        .addField("Output:", "`` `xl\n"+clean(evaled)+"\n`` `")
        .setTimestamp()
        .setColor(0x00AE86)
      msg.channel.send(embed)
    } catch (err) {
      let embed = new Discord.RichEmbed()
        .setDescription("**__Error!__**")
        .addField("Input:", "`` `xl\n"+args.join(' ')+"\n`` `")
        .addField("Output:", "`` `xl\n"+clean(err)+"\n`` `")
        .setTimestamp()
        .setColor("#ff0404")
      msg.channel.send(embed)
    }
  }```
This code worked fine until...

/home/cabox/workspace/node_modules/enmap/src/index.js:94
throw 'Method can only be used when the value is an object';
^
Method can only be used when the value is an object```
~note: Eval works fine, but it crashes afterward

trim plinth
#

enmap 👀

delicate zephyr
#

change it to this

#
if (command == "eval") {
  msg.delete()
    try {
      const code = args.join(" ");
      let evaled = eval(code);

      if (typeof evaled !== "string")
        evaled = require("util").inspect(evaled);
      let embed = new Discord.RichEmbed()
        .setDescription("**__Success!__**")
        .addField("Input:", "`` `xl\n"+args.join(' ')+"\n`` `")
        .addField("Output:", "`` `xl\n"+clean(evaled)+"\n`` `")
        .setTimestamp()
        .setColor(0x00AE86)
      msg.channel.send({embed})
    } catch (err) {
      let embed = new Discord.RichEmbed()
        .setDescription("**__Error!__**")
        .addField("Input:", "`` `xl\n"+args.join(' ')+"\n`` `")
        .addField("Output:", "`` `xl\n"+clean(err)+"\n`` `")
        .setTimestamp()
        .setColor("#ff0404")
      msg.channel.send({embed})
    }
  }```
visual surge
#

wait dur

earnest phoenix
#

Luke

#

its not his code

visual surge
#

Enmap, yeah...

delicate zephyr
#

I know Jacz

#

I use the same damn thing

visual surge
#

Alright, I should pay more attention to that though

delicate zephyr
#

evie.codes tutourial

#

lmao

visual surge
#

What difference does it make to put it in {}?

delicate zephyr
#

Makes it an object

#

Since RichEmbed outputs JSON

#

You need to wrap it to make it an object

#

that should fix it though

visual surge
#

(and that's useful how? lol)

delicate zephyr
#

Read your error man

#

Im literally fixing the thing you were told to do

earnest phoenix
#

its not related to his code or RichEmbed

#

its enmap

#

dude

delicate zephyr
#

with 2 {}

#

Jaczy

visual surge
#

mm alright brb

earnest phoenix
#

its enmap

#

my dude

delicate zephyr
#

Listen

#

Jacz

#

I have to do the same thing for embeds

earnest phoenix
#

no...

delicate zephyr
#

I do

#

lmao

visual surge
#

I just tried it...

#

And no

earnest phoenix
#

Luke you dont know what you're talking about...

#

/home/cabox/workspace/node_modules/enmap/src/index.js:94
throw 'Method can only be used when the value is an object';
^
Method can only be used when the value is an object

delicate zephyr
#

Imma just leave

#

o/

#

Oh

#

Okay

visual surge
#

I just need to find out where that enmap error is. Yaaayy

dusty sandal
#

how do i find out if two things are the same in js? heres my code

    var argresult = args.join(' ')
if(!coins[pUser.id]){
            coins[pUser.id] = {
                coins: 0
            };
        }
let pCoins = coins[pUser.id].coins;
if(argresult = message.author) return message.channel.send("```fix\nDon't try to cheat the system! You can't pay yourself to get more money!\n```")```
visual surge
#

Huh?

#

Compare with ==

visual surge
#
   let args = message.content.split(/ +/g).slice(1,2);
    var argresult = args.join(' ')
if(!coins[pUser.id]){
            coins[pUser.id] = {
                coins: 0
            };
        }
let pCoins = coins[pUser.id].coins;
if(argresult == message.author/*is this the author's ID? If so, use .id at the end. Is it their .username? .tag */) return message.channel.send("Don't try to cheat the system! You can't pay yourself to get more money!\n")```
Also, if you have a pay system that subtracts money from you and then adds it to the receiving user, it won't cause money duplication @dusty sandal
dusty sandal
#

ok thanks

visual surge
#

mhm

dusty sandal
#

actaully @visual surge i had a system like the one you listed above and it actaully did do duping

#

that's why i have the thing to check to see if the person being paid isn't the message author

visual surge
#

user1coins = user1coins - amountpaying
user2coins = user2coins + amountpaying

#

Still a good idea though, paying self is weird

dusty sandal
#

yeah i have a system like that

visual surge
#

Odd, but either way, that works

dusty sandal
#

yes in the end the same result is achieved

glossy mason
#

(Pst, why not just -= and +=?)

visual surge
#

oof duh haha

earnest phoenix
#

@earnest phoenix

sick cloud
#

hi guys, how do i get the invite someone used to join and who created it when a user joins a server?
discord.js, guildMemberAdd event. wanna do it like this:

'{username of who joined, already done} was invited by {invite code creators username#tag} with invite code {invite code, the - - - - - - one}'
earnest phoenix
#

dont think u can but. . . u can fetchInvitelinks

#

You could keep track of invite codes and see whoch one goes up on guildmemberadd

restive silo
#

^

earnest phoenix
#

just a guess

restive silo
#

Good guess

#

thats the only real way to do that

earnest phoenix
#

well it could work but needs some thinking

restive silo
#

not really

#

he explained ir perfectly

#

use a db => save all invite + usage count to it => on guildmemberadd check which count increased with the db entry => use that invite

sick cloud
#

sounds pretty advanced, i'll maybe try it

earnest phoenix
#

what is it thou *@*ThatTonybo#1234

earnest phoenix
#

how to make a discord randomly put the things i want

#

like meme

#

dm me if u know

languid dragon
#

does anyone have premiere or any gif editing software

earnest phoenix
#

just use gimp Thonk

languid dragon
#

no

wet geyser
#

yes

clever yew
#

Just use Canvas with GIFEncoder Thonk

#

Oh, wait

austere meadow
#

does anyone know if theres a way to send an entire JS Map over to my API using snekfetch or would i just have to use JSON

clever yew
#

Yes @languid dragon, I do.

languid dragon
#

dw about it i found solution ty

clever yew
#

The practically the entire Creative Cloud 2017

#

Alrighty agooglethumbsup

#

@austere meadow [...myMap]

#

That resolves to an array of tuples

#

Then in your API: new Map(myMap);

#

And that'll turn it back to a Map

austere meadow
#

ah thank you!

clever yew
#

I use [...myMap] because it's twice faster than Array.from(myMap);

#

you're welcome!

austere meadow
#

yeah i've always wondered what [...x] does

#

i've never used it

clever yew
#

I think JSON.stringify (which you'll call anyways) will convert the Map into an array of tuples

austere meadow
#

ill try that to see if it does but i might as well use [...]

clever yew
#

Oh, it doesn't

#

[...x] converts an iterator into an array

#

Technically, for each value the iterator yields, add a value to the array

#

Map has a built-in iterator (Symbol.iterator), which yields [k, v]

austere meadow
#

ah yeah

clever yew
#

So if you have```js
Map { 1 => 'Test', 2 => 'Test2' }

#

It'll yield each value

#

First yields [1, 'Test'], second yields [2, 'Test2'], next iteration is done, "cuts" the iterator

#

Then all the values yielded get wrapped in an array, aka [yielded1, yielded2, ...]

austere meadow
#

oh nice

clever yew
#

Resulting on [[1, 'Test'], [2, 'Test2']]

austere meadow
#

thats pretty convenient hahaha

clever yew
#

Yeah, I have used iterators and array spread a lot myself 😄

#
const array = [1, 1, 2, 2, 3, 3, 5, 6];
const uniqueArray = [...new Set(array)];
console.log(uniqueArray); // -> [1, 2, 3, 5, 6]```
#

Set has an iterator, so filtering duplicated entries is as easy as that

austere meadow
#

oh thats cool

#

i didn't know you could do that

clever yew
#

Now you do 😄

austere meadow
clever yew
#

You can use for-of and [...x]

#

Both rely on iterators, so it's pretty convenient because it ensures consistency in your code

austere meadow
#

yeah

clever yew
#

Since both can convert/iterate maps, sets (collections that aren't index based), strings, arrays, and anything else that has an iterator

#

Want to split a string by characters? Easy: [...myString];, done

austere meadow
#

damn thats insane i wish i knew that earlier lmao

#

thanks for telling me that

clever yew
#

yw ablobsmilehappy

low owl
#

@clever yew a map is like a dictionary in C# right? 😅

clever yew
#

Yes

#

It's keyed collection with a relation key-value, where you get the value by its key.

#

As opposed to a WeakMap where you get the key by the value.

low owl
#

Oh, TIL about WeakMaps

clever yew
#

The difference is that C#'s Dictionary throws if the key doesn't exist, whereas JS just returns undefined

low owl
#

Well, depends which method you use

clever yew
#

Design-wise they're quite similar

#

Yeah, Dictionary.TryGetValue reproduces JS' behaviour

low owl
#

Kind of weird, the API im currently serializing into c# objects says that a certain object is of type map. But I don't think it actually is. The whole documentation is blurry though. Very inconsistent.

clever yew
#
if (myDictionary.TryGetValue("foo", out string val))
{
    Console.WriteLine($"Value is {val}");
}
else
{
    Console.WriteLine("The key foo does not exist in the dictionary.");
}```Equals to```js
let val;
if ((val = myMap.get("foo")) != null) {
    console.log(`Value is ${val}`);
} else {
    console.log("The key foo does not exist in the map.");
}```
#

They both do exactly the same thing

low owl
#

Yeah

clever yew
#

Just that val is null in C# if there's no value, whereas in JS it gets re-assigned to undefined

#

(But can't do much about it because converting undefined to null is a bit tricky, ugly, and slow, unless I add a new line to the else)

#

We're waiting TC39 (the organization that decides JS' design) has the ?? operator held on

#

It does... exactly the same as in C# iirc: if it's null (and undefined in JS), run the next statement

#

There's another collection in JS called Set. It's identical to C#'s HashSet if you wanna check it out

low owl
#

Nah I don't like Js at all. I just need to work with Json right now.

clever yew
#

We're also getting optional chaining operator, great stuff agooglethumbsup

low owl
#

Thanks for your effort though

clever yew
#

yw ^^

edgy needle
#

im tring to make a vote command i want it to send the message and delete mine this is the code i have but it wont work it deletes my message and it wont send the message the bot is supposed to send
if (msg.startsWith( prefix + "vote")) {
message.delete();
const text = args.slice(1).join(" ");
message.channel.sendMessage(text)
message.react("✅");
message.react("❌");
}

fluid basin
#

Wait are you using msg or message

#

Clearly it can't be different

edgy needle
#

it can

#

msg is a var

fluid basin
#

Yeah did you define it?

edgy needle
#

yes i did

#

var msg = message.content.toLowerCase()

fluid basin
#

Ok alright

edgy needle
#

this works fine but it will add the reactions to my message and it wont delete it
if (msg.startsWith( prefix + "vote")) {
const text = args.slice(1).join(" ");
message.channel.sendMessage(text)
message.react("✅");
message.react("❌");
}

fluid basin
#

const text = args.slice(1).join(" ");
This is the line thats causing issues

#

.slice() returns the sliced element

edgy needle
#

can i just show u how the cmd works in #commands

#

?

fluid basin
#

Sure

edgy needle
#

wait...

fluid basin
#

No errors given in console?

edgy needle
#

nope

#

it works in my server

#

ima try
if (msg.startsWith( prefix + "vote")) {
message.delete();
const text = args.slice(1).join(" ");
message.channel.sendMessage(text)
message.react("✅");
message.react("❌");
}

fluid basin
#

Hmm what library are you using btw

edgy needle
#

.js

#

if (msg.startsWith( prefix + "vote")) {
message.delete();
const text = args.slice(1).join(" ");
message.channel.sendMessage(text)
message.react("✅");
message.react("❌");
}
/\ Does not work

fluid basin
#

Hmm

#

Btw .sendMessage is deprecated, you should be using .send instead

#

Just some remarks

edgy needle
#

i works for me

#

but ok

heady zinc
#

wtf are you doing

#

why would you delete the message and then try to react to it

fluid basin
#

ikr

edgy needle
#

React to the bots msg

heady zinc
#

no it doesn't

edgy needle
#

then ima just stick to
if (msg.startsWith( prefix + "vote")) {
const text = args.slice(1).join(" ");
message.channel.send(text)
message.react("✅");
message.react("❌");
}

heady zinc
#

if you want it to react to the bot message

fluid basin
#

Alright but you are reacting on the vote command message

heady zinc
#

you would either await the message and then react ot it

#

or use .then() but that's eh

edgy needle
#

if (msg.startsWith( prefix + "vote")) {
message.react("✅");
message.react("❌");
} **

fluid basin
#

Did you add any channel/guild checks? Maybe thats the reason why its not working here

edgy needle
#

i cant use await cuz it is not a async function

fluid basin
#

Then you need to run the code in a async function on by using the async declarator

#

Suggest you to read up on Javascript async/await if you are new to this

edgy needle
#

i never used async

topaz fjord
#

Why not

#

It's better than callbacks

edgy needle
#

for the past month or so i just used bot.on('message', (message) => {

topaz fjord
#

Well you cant use it for that

#

Wait did you make a new message event for each command

fluid basin
#

Hmm ES6 is bae

topaz fjord
#

^

edgy needle
#

nope

#

i did not use bot.on('message', (message) => { for every command

fluid basin
#

ok gud

edgy needle
#

for me it is
bot.on('message', (message) => {
if(command stuff)
}
if(command stuff)
(Insert more cmds here)
});

topaz fjord
#

I would suggest a command handler but that's a later thing

edgy needle
#

like commando?

topaz fjord
#

No

fluid basin
#

Thats a command framework, not a command handler

#

Yeah maybe that might be a later thing for you

edgy needle
#

rip i tried

#

bot.on("message", async (message) => {
if (msg.startsWith( prefix + "vote")) {
const text = args.slice(1).join(" ");
message.channel.sendMessage(text)
await message.channel.sendMessage(text)
message.react("✅");
message.react("❌");
}
});

#

but it still wont work

toxic oracle
#

lavish mango
#

@edgy needle can just use send

#

Don't need to use sendMessage

spring ember
#

woah I thought it was python at the beginning

earnest phoenix
#

You're trying to slice args

spring ember
#

^

earnest phoenix
#

@edgy needle

fluid basin
#

Well I'm assuming he defined args

earnest phoenix
#

He didnt

#

Very clearly no args defined there

fluid basin
#

Yeah then it should throw an error

#

But he said there weren't any console errors

earnest phoenix
#

You should be seeing errors just for using sendMessage lmao

#

Wouldnt it give you a depreciation warning

#

I think thats what it did when i used d.js

fluid basin
#

yeah

#

so idk

vital gorge
#

I wanna make a bot with my friend that can make it so that 2 or more people on a server can play blackjack, I'm completely new to bot making and have only devised a game of blackjack based in python which goes from computer vs player.

#

How should I do this :/

earnest phoenix
#

And please how I Can create à bot? And How language can I use?

#

Ur suppose to pick the language

#

Also coding Lang not language : English , Turkish, and others

#

Yeah I now but Java-python-c++ ... How?

#

How I create à DB please 😧

solid cliff
earnest phoenix
#

U can also google it

#

But I suggest picking a coding language and learning how to use it before coding a discord bot.

edgy needle
#

@earnest phoenix i defined args

#

I just cant talk rn

earnest phoenix
#

Ok tks :'D

#

Put it in code blocks s

#

Non i am on mobile. I can't see + :'(

#

iPhone code blocks exist lol

glossy robin
#

is catrandom unstable for anyone here?

earnest phoenix
#

Yes

#

How to get the users IP that goes to ur website?

fluid basin
#

Depends?

#

Like what type of server you are using

frigid thistle
#

Can someone help me setup a database

#

My team won't help me ;c

#

so can someone help

gilded blaze
#

How do I bulk delete messages older than 2 weeks without using bulk delete?

frigid thistle
#

You can't, as far as I know

gilded blaze
#

rip

frigid thistle
#

or mebbe

#
message.channel.messages.map(m => {
   m.delete()
})```
#

try that

gilded blaze
#

ok

frigid thistle
#

wait no

#

rip

inner jewel
#

fyi the ratelimit's low

#

really low

frigid thistle
#

mhm

inner jewel
#

1/1s

gilded blaze
#

oh

#

ok good

frigid thistle
#

So can someone help me with my db

inner jewel
#

1 message

earnest phoenix
#

sa

earnest phoenix
#

What do u mean @fluid basin

#

Using node.js as backend

restive silo
#

@languid dragon how do i actuall get all class names i need to do css stuff eyesButFaster

languid dragon
#

all class names?

restive silo
#

well if you do custom css you need the class names or?

#

for bot page

languid dragon
#
* {

}
restive silo
#

no

#

like

#

how do i know what each thing is called

#

im really new to frontend

languid dragon
#

you either use inspect element or you build a new div and overlay it

#

like i did with my page

restive silo
#

i guess i use inspect elements

#

thanks

languid dragon
#

      .element{
        position:fixed;
        left:0;
        top:0;
        width:100vw;
        height:100vh;
        background:white;
        z-index:1000;
      }

puts a layer on the very top

restive silo
#

why 👀

languid dragon
#

which you can use as body to put whatever you want in it

restive silo
#

o

languid dragon
#

like i did

restive silo
#

but i dont wanna modify it that much

#

just some custom css

#

to make it fancy

languid dragon
#

well in that case yes

restive silo
#

ty ablobpats

languid dragon
restive silo
#

tfw i cant use mdl because not certified

edgy needle
#

does anyone know why
bot.on("message", async (message) => {
if (message.startsWith( prefix + "vote")) {
const text = args.slice(1).join(" ");
message.channel.send(text)
const msg = await message.channel.send(text)
msg.react("✅");
msg.react("❌");
}
});
wont work?

abstract crystal
#

maybe await react?

edgy needle
#

why would i await react

#

it is supposed to react to the bots msg

#

not mine

abstract crystal
#

you are sending a message and reacting to it

edgy needle
#

yes

gilded blaze
#

what is the error?

abstract crystal
next wedge
#
    
    if(!args[0]){
      let embed = new Discord.RichEmbed()
      .addField('❌ ERROR ❌', '...')
      .setColor('97009e')
      message.channel.send(embed)
      return;
    }
   
    const sayMessage = args.join(" ");
   
    message.delete().catch(O_o=>{}); 
    let embed = new Discord.RichEmbed()
    .addField("speaking_head", sayMessage)
    .setColor('97009e')
    message.channel.send(embed)
    
  }```

Free working say command! Discord.js
gusty topaz
spring ember
#

is that... Spoon feed?

earnest phoenix
#

Has anyone done vue.js here?

weary shoal
#

@earnest phoenix What's ya problem?

earnest phoenix
#

trying to loop thru all commands from bot api (localhost) that returns an array of commands ```html
<div>
<section class="section">
<div class="container" v-for="command of commands" :key="command.category">
{{ command.category }}
</div>
</section>
</div>

#

commands being the array

#

but

#

i dont want dups of the category

#

where this should just be Admin, General, Animal not Admin Admin Admin, General General

#

@weary shoal

weary shoal
#

All i can think of is sql rn haha sorry bro

earnest phoenix
#

all g

weary shoal
#

I mean, you could make an array of command categories or something

earnest phoenix
#

Was thinking about it

weary shoal
#
const unique = [...new Set(commands.map(item => item.category))];```
#

Something like that then for category in unique

uncut slate
#

you'd want to use array.filter with indexOf, way faster

earnest phoenix
#

actually

#

Mercy's way is the easiest and most likely fastest way to get dups out

#

other then the map notlikeblob

uncut slate
#

array.filter is going to be faster than building a set out of it and then iterating it into a new array

#

array of 15 items for ref

earnest phoenix
#

not in v8 v6.5

#

im not certain tho

#

you could be very well correct

#

and tbh, ur way is like known as the fastest so shrug

uncut slate
earnest phoenix
#

canary?

uncut slate
#

chromium

earnest phoenix
#

Chrome canary?

uncut slate
#

I'm running bleeding edge from AUR, I'll have to check

bitter sundial
#

chromium-dev probably

inner jewel
#

microoptimization

earnest phoenix
#

inb4 im being dumb and forgot what version the new optimizations are in

uncut slate
#

ping kyra mmLol

earnest phoenix
#

hes asleep

uncut slate
#

sad

earnest phoenix
#

I'll just go install v10

#

brb

#

just got to remember what one doesnt break inspect

inner jewel
#

not exactly the same thing

#

but same concept

earnest phoenix
#

Come on, we should just all write bots in asm and use the least instructions as possible

#

we need nanoseconds

#

:^)

uncut slate
#

I'd probably go with new Set, just because the latter is ugly

#

heck, that's even what we use in Memer

#

but it's not the fastest

earnest phoenix
#

its not like its gonna matter to the end users

uncut slate
#

yeah, it's not

inner jewel
#

go with the most readable

#

readable code is maintainable code

uncut slate
#

which is new Set

inner jewel
#

maintainable code is good code

earnest phoenix
#

do that and you'll have times of minutes xD

uncut slate
#

not rlly

earnest phoenix
#

im just being lazy and going to go look at the v10 branch

inner jewel
#

unless you're writing code where a single microsecond is a big thing

#

which isn't the case here

#

there's literally zero reason for microoptimizing

bitter sundial
#

ever since jacz joined back I've seen alot of micro-optimization

uncut slate
#

lmfao

earnest phoenix
#

lmfao

#

One question since old peeps are here, Do you think i've changed

#

Reading nodejs src code be like notlikeblob

weary shoal
#

@earnest phoenix Yes, you have mellowed out so much lmao

earnest phoenix
#

lmao

inner jewel
#

from the few files i've read

earnest phoenix
#

its v6.6 with the optimizations iirc

inner jewel
#

node source isn't that bad

earnest phoenix
#

its not

#

but for me its like notlikeblob

#

plus i dont know C or C++

frank wyvern
#

anyone who knows html? whats wrong with this? <button class="button button2" href="https://www.google.com">Learn More</button> when I click it, it doesnt do anything?

weary shoal
#
<form action="http://google.com">
    <input type="submit" value="Go to Google" />
</form>
earnest phoenix
#

buttons dont have a href attribute

#

use a a element

frank wyvern
#

@earnest phoenix <a href="https://www.google.com/" class="button button2">Invite Now</a> still doesnt work, have I done it wrong?

weary shoal
#

put the a around the button

frank wyvern
#

oh

weary shoal
#
<a href="https://www.google.com/">
    <button class="button button2">Learn More</button>
</a>```
frank wyvern
#

ah ok

#
<a href="https://www.google.com/">
    <button class="button button2">Invite Now</button>
</a>
``` Still nothing
#

@weary shoal

weary shoal
#

Try the way i posted

frank wyvern
#

yeah I tried that first, didnt work either

weary shoal
#
<input type="button" onclick="location.href='http://google.com';" value="Go to Google" />
frank wyvern
#

oh if you right click and selct open in new tab, it works

#

whys that?

#

ok, it works. Dreamweavers preview must not let you click the buttons, thanks for your help

night imp
#

How would I check if a set has multiple instances of something?

#

ik this is probably pretty basic however I can't find anything on mdn and have never learned about sets

inner jewel
#

a set can't have duplicates

night imp
#

oh well that answers my question

#

thank you

spiral cliff
#

Maybe the stylesheet has the functionality, that you can style a link as button too... Just adding class="button butron2" to the a tag

#

@frank wyvern

hushed oyster
inner jewel
#

inb4 it's a string

hushed oyster
#

wow

#

it actually is a string

#

and i forgot

#

well

#

thank you

#

then

topaz fjord
#

@hushed oyster i have u a fix

#

dont use mysql

#

:^)

hushed oyster
#

i dont

#

i use postgresql

#

psycopg2 is for postgres

floral stone
#

tickYes is there any up and down emojis that looks like this or I mean match the style!? I would like to use it on my bot but I need up and down emojis.

elder rapids
#

Why not use the default unicode thumbs up and down

delicate zephyr
#

⏫ ⏬

floral stone
#

It's up, down, and ok. I'm using the check for Ok. It's more about the look, really. I know the default ones.

delicate zephyr
#

I mean

#

There is also an OK emoji

#

🆗

floral stone
#

I mean, I know there is already a default emojis. I know the default ones., as previously stated. I want to know if there are up and down emojis similiar to matching the style of the tickYes.

delicate zephyr
#

not that we know of.

floral stone
#

Is it a server only? Like the emoji from this server only?

elder rapids
#

That emote is made by DBL (afaik)

low owl
#

You could just recreate it. Not a complex shape :D

elder rapids
#

Don't steal it though

#

Copyright is a bitch

earnest phoenix
#

I've seen that emote everywhere, afaik

elder rapids
#

🤷 idk

floral stone
#

@earnest phoenix Same, before this server was popular.

weary shoal
#

IIRC that emote was one of many made for the server

#

I don't know if it was copied or not though

tiny turtle
#

How do you store the message that was edited and the new message it was changed to?

message like this

Someone edited message from to

message like this was supose to be

weary shoal
#

I'm pretty sure you can get edits from a message object anyways

#

Depends on the lib/lang on how

tiny turtle
#

javascript, yea I can get the last message bot not if it was prior to that

weary shoal
#

Oh bots can't see here anymore

tiny turtle
#

seen a few with before pic after pic and message edits, would be awesome for a bot log

weary shoal
#

There's an event for it

#

It's messageUpdate

#

that triggers when a message is edited or deleted IIRC

tiny turtle
#

ohh nice!

weary shoal
#

Yeah it has the old and new messages

#

Only edits, not deletes

tiny turtle
#

omg didnt even think to look here ty ^^

weary shoal
#

np

floral stone
#

How good of an idea is it to set my bot's help message to a url linking to a help page on my site?

earnest phoenix
#

got it working with custom css as well

trim plinth
#

owo

fluid basin
#

@earnest phoenix Ok if you are using express you can get the ip by this:

const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;

Basically the first part is used if you are behind a proxy(like nginx for example) and the second one is the direct connecting ip if it is not behind a proxy.

inner jewel
#

Cf-Connecting-Ip

fluid basin
#

^ yeah and this if you are using CloudFlare

earnest phoenix
#

kool ill see what i can do with it

#

ty @fluid basin

fluid basin
#

Np

languid vault
#

?serverowner

weary shoal
haughty kindle
#

i made kind of some weird bot i guess xd

dusty sandal
#

can anyone help me here, im trying to make sure that a thing is a number

#

so basically i want to do if this isn't a number, tell the user to use a number this is for js. I know you can use isNaN but it doesnt to be working for me