#development

1 messages · Page 592 of 1

west raptor
west spoke
#

if you dont know how to make it

neat falcon
#

Learn

west raptor
#

that's like saying i cant walk yet you've never tried

midnight lantern
#

hello, someone can help me with a strange error in my code (of my bot) ???

#

someone know mega-dtbs?

hallow folio
#

I'm having some issues regarding sessions with SQLalchemy in my bot
i'm trying to fetch some data from my database using a model

user = model().get(user.id, ctx.guild.id)

balance = user.amount

model : https://hastebin.com/cuzajimuli.py

which gives the following traceback

Ignoring exception in command coins:
Traceback (most recent call last):
  File "C:\Users\Jamy\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\ext\commands\core.py", line 64, in wrapped
    ret = await coro(*args, **kwargs)
  File "C:\Users\Jamy\Desktop\python\KonekoBot\src\cogs\economy\currency.py", line 31, in coins
    embed = discord.Embed(title=f'`{Name.nick_parser(user)}` has {balance.amount} :neko:',
  File "C:\Users\Jamy\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\orm\attributes.py", line 275, in __get__
    return self.impl.get(instance_state(instance), dict_)
  File "C:\Users\Jamy\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\orm\attributes.py", line 669, in get
    value = state._load_expired(state, passive)
  File "C:\Users\Jamy\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\orm\state.py", line 632, in _load_expired
    self.manager.deferred_scalar_loader(self, toload)
  File "C:\Users\Jamy\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\orm\loading.py", line 913, in load_scalar_attributes
    "attribute refresh operation cannot proceed" % (state_str(state))
sqlalchemy.orm.exc.DetachedInstanceError: Instance <Currency at 0x18b6af23278> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: http://sqlalche.me/e/bhk3)
inner jewel
hallow folio
#

yeah red that article actually, and it presume it's because my session is closed as soon as the user object is fetched. To call the .amount property of my object the session can be closed?

#

or does reading the object properties actually require me to have an active session?

earnest phoenix
#

how can i make a se-welcome code

#

my linguage is : Discord.js

#

a what

west spoke
#

welcome message in JS

earnest phoenix
#

o

#

the client has a guildMemberAdd event, use that

neat falcon
#

read the docs™

empty owl
#

How would I find which date an acc was created .js

marble needle
#

which lib

empty owl
#

discord.js

#

i included it in my statement

marble needle
empty owl
#

thanks

marble needle
#

i hope you realize there are more javascript libraries than discord.js

empty owl
#

I was looking at guildyser

marble needle
#

eris for example

empty owl
#

Ik

#

discord.js covers all of it

#

so it works for me

marble needle
#

i was refering to the "i included it in my statement" part, because you didn't

#

anyway, have fun with it

empty owl
#

sorry for the misunderstanding

#
  message.channel.send("Verifying").then(m => m.edit(`Verified...`)); 

  let vEmbed = new Discord.RichEmbed()
    .addField('Verified', `${message.author} verified.`)
    .addField('ID', message.author.id)
    .addField('Tag', message.author.tag)
    .addField('Account Created', message.author.createdAt)
    .addField('Joined', message.author.joinedAt)
 client.channels.get('559457970581143607').send({embed: vEmbed})


#

it says it cant find the send property of undefined

#

discord.js

earnest phoenix
#

well your channel is undefined

mossy vine
#

how often can i update a rich presence field but not be considered api abuse?

#

1 second? 3 seconds? 15 seconds? 5 minutes?

earnest phoenix
#

on a bot?

mossy vine
#

no

#

a rich presence field

earnest phoenix
#

i think 15s is ratelimit friendly

mossy vine
#

is say 1 alright?

earnest phoenix
#

not sure

dusky marsh
#

1200 ms is where I find a comfortable spot

mossy vine
#

cuz looking through discord-rpc examples folder

#

theres a unity example

#

which updates the presence every time a button is clicked

#

which can be several times a second :thonk:

#

and i mean, it is in an official repo

dusky marsh
#

Discord will rate limit if you send too many requests too fast

mossy vine
#

the example doesnt handle ratelimits

#

this is the file im talking about btw

#

line 33

earnest phoenix
#

you can always rely on ratelimit headers

mossy vine
#

so if it gets ratelimited the presence just wont be updated?

dusky marsh
#

It'll get updated just not instantly

earnest phoenix
#

false

#

the request will fail

mossy vine
#

so if it keeps spamming the requests it wont update at all?

dusky marsh
#

Anytime discord ratelimits my stuff, it just takes longer for things to go through

earnest phoenix
#

you need to block, wait for the ratelimit to expire then requeue the request

#

the library is more than likely doing that @dusky marsh

mossy vine
#

the linked example doesnt do that

dusky marsh
#

You rite

earnest phoenix
#

it isnt meant to

mossy vine
earnest phoenix
#

its up to library devs to implement ratelimit handling

mossy vine
#

shouldnt ratelimited be something thats implemented in an official repo?

dusky marsh
#

I would assume that the cs lib has that

mossy vine
#

it doesnt

dusky marsh
#

Mega oof

dusky marsh
#

That's p bad on their part

earnest phoenix
#

🤷

real crystal
inner jewel
#

what python version?

unique nimbus
#

do
await client.send_message

#

however go to rewrite

#

its better

#

yes

#

@real crystal

real crystal
#

i tried await client.send_message got the same message

slender thistle
#

Your indentation is wrong

#

You are doing stuff outside of your command

grim aspen
rocky mesa
#

ok so, I have this code and I keep getting DiscordAPIError: Unknown Emoji. anyone know how to help?

  msg.react("👍")
  msg.react("👎");
})
inner jewel
#

wrong file encoding

grim aspen
#

at least you didn't show your repl.it project name

rocky mesa
#

wym

amber fractal
#

he was talking to Crimson

#

and it cant be that hard to find

real crystal
#

true

#

im moving the bot soon to a laptop i got 24/7 open

#

btw if i will move to the rewrite one i will have to change some stuff

grim aspen
#

move it to a vps

real crystal
#

eh idk i don't think i should after all this bot is just to learn python basics i will most likely stop developing it next year

earnest phoenix
#

selfhosting is fine as long as you know you have a stable internet connection

real crystal
#

my internet connection is good and i wont even run the bot 24/7 only if the bot will actually be on some servers other then mine maybe i will but you know its just for self education

marble needle
#

how are you planning to gain servers if you don't even host it 24/7

earnest phoenix
#

they just said its private, indirectly

amber fractal
#

If it's private, then why would it go on the list

earnest phoenix
#

i have no idea

earnest phoenix
#

discord.js
hey so my bot is having a issue with its prefix
the prefix is "j!" and defined in a json file
i looked at a couple tutorials to make sure I was doing it right and it doesnt seem wrong
doing a command like j!help works fine but it also responds to other prefixes like l! or i!
no idea why it does this. any ideas?

latent willow
#

how do you check if the message starts with your prefix ?

jagged birch
#

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

#

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

#

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

latent willow
#

i meant spicy

jagged birch
#

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

#

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

#

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

#

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

#

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

#

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

latent willow
#

wtf

jagged birch
#

Fuck oops

earnest phoenix
#

uh i forget

coral trellis
#

Phone glitch?

#

Accident?

jagged birch
#

Yes

#

Sorry I kept clicking send cause t wasn’t working

latent willow
#

@ spicy have a look in your code and show us or look what pete wrote that will work aswell

earnest phoenix
#

dont have my code on this computer

#

also other question
so whenever i set my bot's activity to streaming it says playing and the status color stays green
but when you click on the bot's profile picture it says streaming

lavish forge
coral trellis
#

Do js const prefix ('./../../config.json')

lavish forge
#

Nope.

coral trellis
#

You certain?

lavish forge
#

Yeah.

#

It's spitting the same error, so it's something else than the ready event.

#

...

#

It was because of something in the eval command.

#

Wot.

coral trellis
#

Show eval code

lavish forge
#

It's fixed now. I removed the line causing it. But now I'm getting the damn "prefix is not defined."

amber fractal
#

Your setting prefix equal to the config Thonk

potent frost
#
function removeSpecials(stringValue)
{
    let returnString = "";
    const lowerString = stringValue.toLowerCase();
    const upperString = stringValue.toUpperCase();

    for (let i = 0; i < lowerString.length; ++i)
    {
        if (lowerString[i] != upperString[i] || lowerString[i].trim() === '')
        returnString += stringValue[i];
    }
    return returnString;
}    ```
potent frost
#
exports.promptQuestions(speaker, channel, callback)
{
    channel.send(`Are you sure you want to run this command?`);

    const isResponse = msgObjTemp => msgObjTemp.author.id == speaker.id;
    channel.awaitMessages(isResponse, { max: 1, time: 1000 * 25, errors: ['time'] })
        .then((collected) =>
        {
            const response = collected.first();
            if (/y[aeiouy]+?[sh]|y[aeiy]+?\b|\by\b/.test(response.content.toLowerCase()))
            {
                channel.send('your request has been processed');
                callback(true);
            } else
            {
                channel.send('your request has been cancelled.');
                callback(false);
            }
        })
        .catch(() =>
        {
            channel.send(`your request has expired`);
            callback(false);
        });
}```
blazing star
#

callbacks in 2019

potent frost
#

yea

#

var is meme

mossy vine
#

Whats wrong with callbacks tho @blazing star

blazing star
#

nothing i just like async functions tho

idle basalt
#

imagine using callbacks instead of await when youre already using promises

zealous veldt
#

Aaaaa no thank you

earnest phoenix
#

guys

#

how can i make the rich presence of my bot change every 10 sencods?

#

bots cant use rp

jagged birch
#

Use a setInterval @earnest phoenix although I’d do it every 30 seconds

slender thistle
#

Possible only 5 times in a minute

tough raptor
#

i have a question...
how long does the approval usually take?

grim aspen
tough raptor
#

ok thx

#

and also why are some newly added bots in #logs dont have names?

#

they only show the client id

smoky spire
#

Cuz they aren't in the server

slender thistle
#

You share no servers with them, hence, your Discord can't load the user info properly

#

And if you share a server with someone and when mentioning them they appear as user ID, blame your Discord cache

west spoke
#

lol

earnest phoenix
#

For Post Stats to Discord Bot List.

#

its this right

client.on('ready', () => {
    setInterval(() => {
        dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
    }, 1800000);
});
zealous veldt
#

Please properly format your code blocs (put js right after the first three backticks)

earnest phoenix
rugged linden
#

How come even though I add a width and height to my iframe, it still appears as big as possible?

<iframe width="560" height="315" src="https://www.youtube.com/embed/gfc14Js0XIM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
earnest phoenix
#

nvm think I got it but the 1800000
is that milliseconds?

mossy vine
#

yes

earnest phoenix
#

awesome

#

Ok now I wait

loud salmon
#

anyway if you are looking to make an android app then go for android studio

bold pagoda
#

If i want to start making a app how would I? and what software do you recommend anyone may answer this question

loud salmon
#

read above tho

mossy vine
#

what type of app are you trying to make?

loud salmon
#

if its an ios app then use xcode

#

both of them have good documentation

mossy vine
#

you could also use something like flutter

earnest phoenix
#

I dont think it worked

#

still says N/A on site

bold pagoda
#

I don't have a apple computer

#

or phone

#

xcode is for apple user only

grave pilot
#
        client.shard.fetchClientValues('this.guilds')
``` Any idea why this returns: ```      for (const prop of props) value = value[prop];
                                             ^

TypeError: Cannot read property 'guilds' of undefined```
soft plaza
#

anyone got docs for discord.js-lavalink ?

amber fractal
grave pilot
#

Idk if this is the right channel or not but I keep getting errors from webhook when I try to shard my bot? Something about the port is allready in use? Any ideas on how to fix this?

loud salmon
#

use a different port

grave pilot
#

Well the port is allready in use when I use multiple shards

#

So I need to use different ports on the different shards?

loud salmon
#

hm what language

#

no

grave pilot
#

Discord.js

loud salmon
#

oh im sure there is a way to do that in the non-shared code

grave pilot
#

It is working fine without sharding

loud salmon
#

but im not sure because i dont use js

#

yea because its just 1 instance

grave pilot
#

Yep

#

Any idea on how to fix this? I have taking a look on the docs but that did not help me

amber fractal
#

oof message deleted

grave pilot
#

Because I did not mean it that way lol

amber fractal
#

Still on starboard anyways mmLol can you restate your question tho?

grave pilot
#

I am getting a port error from the webhook when I try to shard my bot. How do I shard my bot without getting the port error from the dbl api?

#

Using discord.js

amber fractal
#

only run it on one shard

grave pilot
#

Does it not need to run on all shards?

amber fractal
#

well you cant

#

you'll always get the port error

grave pilot
#

Well the bot needs the dbl api on all shards

#

That is the problem

#

I am checking if the user has voted sometimes

amber fractal
#

You dont need a webhook to check for votes unless you manually save it to a database

#

the webhook is only for receiving votes

grave pilot
#

But .hasVoted

#

Requires dbl

amber fractal
#

You dont need to run the when you create a dbl iirc

#

if you just provide a token you can use it's methods

grave pilot
#

Ah

#

Gotcha

#

Thanks

#
    if (client.shard.id == 0) {
        const DBL = require("dblapi.js");
        const dbl = new DBL("TOKEN", {
            webhookAuth: "Na",
            webhookPort: 5000,
        });
        client.dbl = dbl;
    } else if (client.shard.id != 0) {
        const DBL = require("dblapi.js");
        const dbl = new DBL("TOKEN");
        client.dbl = dbl;
    }```
#

That would work?

slender thistle
#

client.shard thonkku

grave pilot
#

Yea?

slender thistle
#

Is that actually an attr

amber fractal
#

Should work

#

yes

grave pilot
#

Ill give it a try

slender thistle
#

Noted

amber fractal
#

I have my own lib, I havent looked at dblapi.js in a while so it may not

junior summit
#

I get a thrw error about a connection not made in 15 seconds when people do my connect command.

#
    if(!message.guild.me.hasPermission('CONNECT')) return message.channel.send('bruh did u really remove my perms')
    if (message.member.voiceChannel) {
      // check if there is already a voice connection
      if (message.member.voiceChannel.connection) {
        console.log('conn status: ' + message.member.voiceChannel.connection.status);
      }
      console.log('is joinable: ' + message.member.voiceChannel.joinable);
      if (message.member.voiceChannel.joinable) {
        message.member.voiceChannel.join()
          .then(connection => { // Connection is an instance of VoiceConnection
            message.reply('I have successfully connected to the channel!');
          })
          .catch(console.error);
      }
    } else {
      message.reply('You need to join a voice channel first!');
    }
  }```
#

how to fix

west roost
#

ı have a error "FFMPEG not found" but ı have ffmpeg

high lava
#

Is it fully installed with an environment table? (If you're on windows)

#

@west roost

grizzled spruce
#

Help me. My bot isn’t responding to anything for some reason. Errors point me to this code having an issue

west spoke
#

?

#

Wat happen

grizzled spruce
#

(Will send code one second)

#

So my bot won’t send messages
And logs tells me it’s something wrong with this

#
 if(message.channel.type === "dm") return;

  
 let prefixes = JSON.parse(fs.readFileSync("./prefixes.json","utf8"));
  if(!prefixes[message.guild.id])
    prefixes[message.guild.id] = {
      prefixes: botconfig.prefix
    };

  let prefix = prefixes[message.guild.id].prefixes;
  console.log(prefix);

  
  let messageArray = message.content.split(" ");
 let cmd = messageArray[0];
 let args = messageArray.slice(1);```
west spoke
#

Is this rewrite ;-;

grizzled spruce
#

No

signal yarrow
#

discord.js right?

grizzled spruce
#

Yes

signal yarrow
#

Let me take a look at it

west spoke
#

Mm that would explain why it looked weird

signal yarrow
#

lol

west spoke
#

I use py

signal yarrow
#

I used to use it, got quite bored and changed to js

west spoke
#

meh

signal yarrow
#

but anyway, what do the errors tell?

west spoke
#

I like creating small games in py

grizzled spruce
#

Lemme get a pic of the error

signal yarrow
#

kk

west spoke
#

xd

grizzled spruce
earnest phoenix
#

how about not using json for a database as a first

signal yarrow
#

it has something to do with the JSON file

#

lol

earnest phoenix
#

yes

signal yarrow
#

that is long file lol

earnest phoenix
#

but dont use json as a database in the first place

signal yarrow
#

well yeah

#

but I still use it because dumb

earnest phoenix
#

then migrate

signal yarrow
#

Woah

grizzled spruce
#

I didn’t use the Json as a database, but I had to add it for a prefix command

signal yarrow
#

Aren't you using it for saving prefixes?

grizzled spruce
#

Right

#

Right

signal yarrow
#

So, that kinda makes it a db

earnest phoenix
#

use a proper database system

#

sqlite is fine for your use

signal yarrow
#

still, that's not the real problem here

grizzled spruce
#

Hmm

signal yarrow
#

Did you change the json file manually?

earnest phoenix
#

its the root of the problemlol

grizzled spruce
#

No I haven’t

#

No I haven’t

#

No I haven’t

#

No I haven’t

#

Crud sorry glitch

signal yarrow
#

waoh

hushed berry
#

it's just invalid json 🤷

signal yarrow
#

Ok then bad

#

ik

grizzled spruce
#

Invaliiiid

#

I’ll purge it and fix

signal yarrow
#

Oh well, just don't use json next i guess

west spoke
#

:I

signal yarrow
#

¯_(ツ)_/¯

west spoke
#

I use json and it works fine xd

grizzled spruce
#

Yeah welll thx for helppp

signal yarrow
#

ik, but some people don't like it lol

#

and it's not the most efficient

grizzled spruce
#

Yep just cleared it’s database and now it works again

signal yarrow
#

wack

west spoke
#

xd

grizzled spruce
#

I’ll have to fix that, wether it be through a different database or better system

west spoke
#

I mean if it's just to store player health values and weapon names then I thinkies it's fine

signal yarrow
#

typing intensifies

grizzled spruce
#

It’s for storing prefixes

west spoke
#

It's not like I'ma need to soon migrate to a 64 gb micro SD card

earnest phoenix
#

why json is bad:
it is not meant to be used as a database
its a file, the size will grow a lot over a short period of time
its a file, you cant edit/read in parallel (async)
huge risk of losing data

signal yarrow
#

^^^^^^

west spoke
#

If data is lost the user can just create a new profile

signal yarrow
#

I can easily relate

west spoke
#

And it always deletes the file and recreates it

earnest phoenix
#

so youre saying you would rather risk data loss than your time

west spoke
#

It's more efficient than individual .txt files

grizzled spruce
#

Well it’s just prefix storage. It doesn’t really hurt me if I lose it

signal yarrow
#

you don't need text files?

earnest phoenix
#

its actually less efficient

#

json is syntax sensitive

west spoke
#

It can store more at once

earnest phoenix
#

so can text files

signal yarrow
#

json is a b**ch

grizzled spruce
#

*bench

signal yarrow
#

totally what I meant

earnest phoenix
#

if youd risk data loss over your effort to migrate to a proper database you dont deserve to be a dev in general 🤷 its security 101, speaking of which json isnt secure, like at all

grizzled spruce
#

Lol @signal yarrow

#

Security 101:
Step one: Backup files to onedrive
Step two: erase old files
Step three: discover that onedrive didn’t even save ur files and you lost everything
Step four: die a slow death

signal yarrow
#

well that's just unfortunate

#

cries internally

west skiff
#

step 0 use git xd

#

seriously though, that sucks

grizzled spruce
#

We don’t speak of git

signal yarrow
#

aight, git it is then

amber fractal
#

?

#

git actually works tho

hushed berry
#

im gonna use git for my database 😎

amber fractal
#

not as a database

west skiff
#

I think that was a joke lol

amber fractal
#

I know it was a joke

#

some 0 year old is gonna come here and not take it as one

#

start using github as a database

idle basalt
#

github best db

lusty dew
#

How could I make a button when clicked make something appear and when clicked again it will go away

#

This is my code so far

#
    <script>
    function appearFunction(){
        document.getElementById("form").style.display = "block";
    }
    </script>
idle basalt
#

change the visibility to hidden

lusty dew
#

Well I know that

#

But how would I go about doing that?

#

Cause so far as I see it when it is clicked it only makes it appear

#

and when clicked again it does nothing except keep the thing therre

idle basalt
#

if its showing, hide it
if its hiding, show it

lusty dew
#

Hm

#

Mk

idle basalt
#

style.visibility = 'hidden'

#

check if visible, if yes, change to hidden. if no, make visible

lusty dew
#

Ah ok thanks

torpid dew
#

can someone help me?

bright spear
#

@torpid dew never just ask for help, always just ask your question and make sure you mention the lib & version, and the code and error if applicable

#

see channel topic pls

torpid dew
#

i need help coding a bot can you he

#

help*

#

whos good with coding in the java code??

scarlet bane
#

Post your actual problem, and we will help solve your problem

torpid dew
#

i dont know how to code and i need help making a review bot so you type in the prefix

#

"F" and then after f do review and then it will pull up a reaction box and the bot will keep count of all the reviews

#

so i want to do "{review" and then it come up with a menu and the menu will be like how many stars 1-5 and then after that i want it to say what is the description the review

#

then you put your review in the description and the bot will keep track of all the reviews

#

i need help coding all of that

#

my question is what do i need to type in to code the bot to do that

midnight arrow
#

that doesnt sound like asking for help, that sounds like "make me a bot"

torpid dew
#

idk what to do can someone teach me a little bit on coding then?

lusty dew
#
        function appearAndDisappearFunction() {
            if (document.getElementById("form").style.display = "none") {
                document.getElementById("form").style.display = "block";
            } else if (document.getElementById("form").style.display = "block") {
                document.getElementById("form").style.display = "none";
            }
        }
#

Probably stupid question

#

But this is not making it disappear only appear

#

when the checkbox is clicked

lusty dew
#

Can anyone tell me or give me a hint as too why?

idle basalt
#

never changing the visibility to hidden

lusty dew
#

Oh?

idle basalt
#

style.visibility = 'hidden' hides

lusty dew
#

Ah ok

idle basalt
#

check if vis is hidden, not if display is block

#

also this is a solid google question

#

ive only ever used visibility, but theres another option

lusty dew
#

Okie

#

Thanks

idle basalt
#

i think visibility makes it transparent vs removing it

#

which is why ive always used that for popups

#

sorry, my css is rusty i havent done front-end in a while

#

all the properties blur together after a while haha

lusty dew
#

Lol yea

#

Same here

#

This is why I am having so much trouble

#

I am forgetting things

#

uwu

earnest phoenix
#

I developer

#

permission

#

?

astral scaffold
#

.

echo pasture
#

.-.

potent frost
#

@bitter sundial i need advice

bitter sundial
#

why mention me

potent frost
#

because ur IQ is over infinite

#

im trying to use the DBL server count

#

oh wait

#

it fixed itself

#

delayed 😂 sorry for ping

lament meteor
#

lol

ruby dust
#

regarding modlogs, how would I ignore the ban/kick events when they were executed with a command?

mossy vine
#

since theyre events, i dont think you can

coral trellis
#

@ruby dust You can check if the action was done by your bot and just return;

ruby dust
#

huh

#

true

earnest phoenix
#

.

pallid zinc
#

.

lusty dew
#
                <label class="checkbox is-2" onclick="toggleFunction()">
                    <input type="checkbox" name="Dev"/>
                    Developer

Any ideas on how I could make it so when they click the word developer it runs that function as well?

#

Because you can click the word by the checkbox and the checkbox will be checked but it doesn't run the function unless you actually click the checkbox

#

and I want it to happen if they click the word or the checkbox

mossy vine
#

@lusty dew iirc you can do that by putting "Developer" in an <a> tag and adding onclick="myFunction()"

lusty dew
#

Thanks!

#

Well damnit.

#

Using the <a> it isn't allowing me to text in the form I have

#

it just makes the form disappear

#
                <label class="checkbox is-2" onclick="toggleFunction()">
                    <input type="checkbox" name="Dev"/>
                    <a onclick="toggleFunction()">Developer</a>
                    <div class="field" id="form" style="display: none">
                        <label class="label">Label</label>
                        <div class="control">
                            <input class="input" type="text" placeholder="Text input">
                        </div>
                        <p class="help">This is a help text</p>
                    </div>
#

The toggleFunction() makes things appear or disappear

slim heart
#

Well maybe™ <a> isn’t supported in forms, not sure, but you can just use a button?

#

You can put onclick in every element. Just decide where you want it to be clickable

summer delta
#

You can put almost anything inside a form, I includeding <a>

torpid dew
#

I’m trying to get my bot to respond with a question and use the reactions for a review bot and if you give me a sec I can send you the code I have

#
const Discord = require('discord.js')
const client = new Discord.Client()

client.on('message', (receivedMessage) => {
    if (receivedMessage.author == client.user) { // Prevent bot from responding to its own messages
        return
    }

    // You can copy/paste the actual unicode emoji in the code (not _every_ unicode emoji works)
    receivedMessage.react(" :thumbsup: ")
    receivedMessage.react(" :thumbsdown: ")
    // Unicode emojis: https://unicode.org/emoji/charts/full-emoji-list.html

    // Get every custom emoji from the server (if any) and react with each one
    receivedMessage.guild.emojis.forEach(customEmoji => {
        console.log(`Reacting with custom emoji: ${customEmoji.name} (${customEmoji.id})`)
        receivedMessage.react(customEmoji)
    })
    // If you know the ID of the custom emoji you want, you can get it directly with:
    // let customEmoji = receivedMessage.guild.emojis.get(emojiId)
}) 
#

is that right?

#

i asked a friend and this is what he gave me

arctic grove
#

i am trying to add new commands to my new bot i am working on with discord.js but when i try the command i get this

restive halo
#

Command is not defined

#

So you're using Command without defining it first

arctic grove
#

i am still new to making bots

#

so i dont know what i am doing

#

that well

mossy vine
#

learn javascript properly first

#

there are great learning resources pinned in this channel

grim aspen
ruby dust
#

random guy jumps to bot development without training... why is this even a mainstream? why do people don't ever learn?

arctic grove
#

I'm a fast learner but nothing on YouTube to help or teach me

grim aspen
#

youtube isn't that well with helping

ruby dust
#

that's what I also though, but programming languages are far more complex than you think

restive halo
#

Reading your thing rn frito
Just its formatted weirdly on mobile lol

torpid dew
#

lol

ruby dust
#

do everyone a favor and learn the language first, that will save time for both you and us

restive halo
#

By the looks of it that should work (not really done much in terms of using reactions)
If you wanna use the reactions tho pretty sure you can set up a reaction collector in discord.js

torpid dew
#

okay i just is wondering if it would work

ruby dust
#

was this whole message supposed to be a whole url? lol

fallen atlas
#

Hello

#

Trying to make a server but having trouble with it

#

Don’t own a computer only have my iPad Pro

#

Want to make my server for drone flying people

#

Can I get some help?

restive halo
#

Wait making a discord server?

fallen atlas
#

Yes

restive halo
#

Left hand side of the app, under the servers you're in is a plus button

fallen atlas
#

Let me look

#

...... oh gawd I’m a idiot

#

I’ll probably be back for help setting up bots

restive halo
#

:p
This channels for development though so thought you were gonna say you were trying to run an actual server off an iPad pro

fallen atlas
#

?

#

Will my server be listed on the discord dashboard site?

quartz kindle
#

No

ruby dust
#

you have to add it yourself

#

this is not official discord

versed pawn
#

I get an error

#

I can't run my command bot

grim aspen
#

show us the error and we'll try to help

versed pawn
grim aspen
#

that's not what i meant

versed pawn
#

?

grim aspen
#

what does it bring up on the bot's console?

versed pawn
#

Console : good

#

Hello everyone I want to ask how to make a web like an example

discordbots.org / api
what is that?
How do I make /?

earnest phoenix
#

what does that even mean

#

you want to make a website?

versed pawn
#

Y

earnest phoenix
#

thats called a path

#

dbl is probably built on top of node

frameworks like node and asp.net create virtual paths

viral spade
#

Hey guys. how can i listen on when a certain emoji reaction is triggered anywhere on any server? should i call the msg.awaitReactions method on every message on every server for that?

earnest phoenix
#

which lib

viral spade
#

discordjs

earnest phoenix
#

your client has a messageReactionAdd event

#

use that

viral spade
#

Thanks!!!

#

Another question. When i extract emojis from a msg.content i get the unicode format in my code and when i save it to database it shows "???". I would like to not get the unicode format but simply retrieve the ":emoji:" string value and save to my databse. is this possible somehow? the emoje object does not seem to contain an extra field for this.

earnest phoenix
#

it isnt

#

its how its returned by the api

viral spade
#

so i have to change encoding or smth for my database`

earnest phoenix
#

yeah

#

you can also make an array of unicode - > emoji names but that would take up a lot of time

viral spade
#

haha no

#

thats stupid that they dont simply convert to :emoji:

earnest phoenix
#

its not

#

your client is what does the :emoji:, the api keeps everything in unicode and for a reason

inner jewel
#

haha yes why use tens of characters to store an emoji instead of 4 bytes

earnest phoenix
#

+help

#

+help

#

+help

#

+help

#

+help

#

+botpermissions

unique nimbus
#

also dont use common prefixes

earnest phoenix
#

ok sorry

hearty plank
#

Where can I host my bot?

#

pls, help

amber fractal
#

a vps

hearty plank
#

.-.

amber fractal
#

he told you to read pins

hearty plank
#

get it, but where's the cheap rent?

amber fractal
#

it's literally $3 a month

hearty plank
#

You know the site?

amber fractal
#

did you even read pins

viral spade
#

okey this is strange. so i need to write an emoji to my database via a command. when i write ❤ is shows the correct symbol in my database, but with any other (fe 😄) its shows only "???". what can it be? its mysql on utf8_general_ci

quartz kindle
#

If you get it back from the database and send it to discord does it still show ???

viral spade
#

@quartz kindle

hushed berry
#

perhaps google "mysql emojis question marks"

hollow pawn
#

hi

icy saffron
#

Uhh I need help

amber fractal
#

that doesnt help us help you at all

grim aspen
#

need help with what?

icy saffron
#

Well I'm trying to set up my server on discord server list and every time I click submit it gives me a 500 error

grim aspen
#

this is meant for bots, not discord servers

icy saffron
#

I know but the other server is dead so

earnest phoenix
#

so
this is still for discord bots lol

willow marlin
#

Hi :D. Currently I'm not able to find a solution how to log deleted messages with JDA. The GuildMessageDeleteEvent gives me no solution how to get the previous content of the message. How did you solve this?

opaque eagle
#

Let's say I have this. Would the console.log() in alpha.js show up as "foo.js", "bar.js", or "alpha.js"?```js
// foo.js
export class Foo {
get name() {
return __filename;
}
};js // bar.js import Foo from "./foo.js"; export class Bar extends Foo { // stuff };js
// alpha.js
import Bar from "./bar.js";

const thing = new Bar();
console.log(thing.name);```

viral spade
#

can i check somehow if something (certain part of the user entered message) is a valid emoji, that can also later be used on the respective server by the bot?

#

discordjs

earnest phoenix
#

you need to validate it yourself

#

loop through all emoji codepoints and see if there is a match, alternatively use regex

hushed berry
#

@willow marlin thats because discord doesnt actually send the message data when its deleted

#

they only provide the id that was deleted

#

what you need to do is to cache the messages you receive and then pull from the cache when you get a message that one was deleted

viral spade
#

msg.client.emojis, as well as
msg.guild.emojis
returns empty collections 😦

willow marlin
#

Ah, okay. Thanks, @hushed berry 😃

earnest phoenix
#

thats meant for custom emojis

#

i think this is my 3rd time telling you that builtin emojis are unicode and you need to loop through the string yourself and check for codepoints

viral spade
#

so i need some predefined imported list of all valid emis

earnest phoenix
#

yes

#

i believe there is a prebuilt regex somewhere that does that already for you

viral spade
#

ok thanks

willow marlin
#

Now I want to cache my messages within a LinkedHashMap. What should I take as the maximum stored messages? Or may I make it with no limit?

#

Or should I use another algorithm to cache my messages?

earnest phoenix
#

!futte

lusty dew
#

wrong server

grim aspen
lusty dew
#

?

#

Oh him xD

earnest phoenix
#

where is the cheapest RDP/you know? so i can have bot up 24/7 there`?

earnest phoenix
#

ty

earnest phoenix
#

does sharding duplicate all loops and process for each shard?

#

like does it duplicate all files and process bot uses or will it just split workload of one instance of those files across shards

amber fractal
#

I only run intervals on shard 0

earnest phoenix
#

ouf

amber fractal
#

Is that in the mongo thing?

#

That has just about 0 context

earnest phoenix
#

from that

#

its a pretty garbage tutorial

#

ngl

amber fractal
#

Dude. Sharding works with enmap for me you're gonna be fine

earnest phoenix
#

i have a lot of automated processes like cronjobs and loops i dont want to duplicate multiple times

amber fractal
#

Then run only on shard 0 Thonk

earnest phoenix
#

how would you go about specifying which shard handles that?

amber fractal
#

I only do my calculate stats thing on shard 0

#

wym

earnest phoenix
#

one sec ill just do testing

amber fractal
lusty dew
#

Hi uber lol.

earnest phoenix
#

ah got ya

#

hi

amber fractal
#

This guy smh smh

earnest phoenix
#

ye it duplicate loops and such

#

interesting

#

ok

amber fractal
#

why wouldnt it

earnest phoenix
#

means i got to refactor my entire backend furcry

amber fractal
#

it starts the script multiple times

zealous veldt
#

That sounds fun

#

So fun

earnest phoenix
#

im just not even going to bother until its required of me

#

but im adding sharding support to the bot framework

amber fractal
#

so when your bot will be offline because it cant connect to the gateway mmLol

earnest phoenix
#

yea but i wont hit 2500 any time soon

#

only at 330 rn

amber fractal
#

exactly so why not work on it now 🤔

earnest phoenix
#

more important thing

zealous veldt
#

I have a cool 12

#

I should probably run 19 shards

earnest phoenix
#

is there a way to start each shard on individual pm2 process?

amber fractal
#

doubt

earnest phoenix
#

ive seen it done

zealous veldt
#

Yeah you can shard without the internal D.Js stuff

amber fractal
#

unless you start it a bunch of times with different data mmLol

zealous veldt
#

Like across servers

earnest phoenix
#

someone i know pulled it off

#

ill go annoy him

amber fractal
#

makes sense

zealous veldt
#

add it to your framework thing

earnest phoenix
#

yep

#

i already have sharding semi-added in

zealous veldt
#

Oo

earnest phoenix
#

like it works and suhc

#

just want to tidy it up

amber fractal
#

Didn't need to add it frostpDab

zealous veldt
#

Time to steal be inspired by your code

earnest phoenix
#

if i leave .spawn() empty it just auto shards correct?

amber fractal
#

ye

bright spear
#

@earnest phoenix if you use discord.js internal sharding then it only uses 1 process and 1 client

earnest phoenix
#

how would i go about that?

bright spear
#

only external sharding (ShardingManager) uses multiple processes and clients (and you have to mess with broadcasteval and stuff)

#

what d.js version do you use

earnest phoenix
#

latest (11.4.2

bright spear
#

internal sharding is only for version 12

#

11 sucks

earnest phoenix
#

ok ill update

#

👍

amber fractal
#

updating out of stable zoomeyes even tho it's basically stable anyways

bright spear
#

yeah switch to master

#

npm i discordjs/discord.js

#

fyi you will probably need to update ur code

earnest phoenix
#

thats fine

#

this is for a framework im doing

bright spear
#

ah k

amber fractal
#

how would you internal shard on master tho

bright spear
#

its simple

earnest phoenix
#

ok

#

so now what

bright spear
#

just set shardCount: 'auto' in d.js ClientOptions

#

and it will handle sharding stuff for you

amber fractal
#

so in new Discord.Client?

bright spear
#

yeah

earnest phoenix
#

yea but im trying to start

#

one shard per process

#

on pm2

bright spear
#

oh

earnest phoenix
#

not auto shard

bright spear
#

well in internal sharding all shards are in 1 process

amber fractal
bright spear
#

yes but 'auto' works too

amber fractal
#

big sad

#

weird that it doesnt say that

zealous veldt
#

There is a way to split a bot across multiple servers with d.js, no?

amber fractal
#

would client.shard still work with this cuz I really dont want to rework a bunch of my stuff atm mmLol

bright spear
#

no

#

its null

earnest phoenix
amber fractal
#

k I'll stick with external sharding

#

I'm fine with that mmLol

zealous veldt
#

That looks cool

bright spear
#

i didnt want to deal with external sharding so i just used internal when i first sharded

amber fractal
#

it wasnt that hard tbh

faint cedar
#

Does anyone use @sentry/node over the NodeJS Raven? Raven got deprecated and I am trying to find the equivalent of Raven.context()

earnest phoenix
#

where did yall see the docs for shardcounnt?

#

oh under master

bright spear
#

yeah

#

cuz internal sharding is only supported on master

earnest phoenix
#

cool beans

#

oh yeah master has some weird deprications

#

@bright spear any way to know the current shard your on etc with the internal sharding?

#

as well as get data from all shards etc

bright spear
#

Anything on client is from all shards

earnest phoenix
#

oh really?

#

sweet

#

ok

#

so i dont have to do any funky stuff

#

to access other shards etc?

#

awesome!

bright spear
#

And I don't think you can get the current shard 🤔

#

Yeah

earnest phoenix
#

thats legit like

#

next level

#

cool

bright spear
#

You can get the amount of shards though

earnest phoenix
#

yea

#

i saw

bright spear
#

client.ws.shards.size

amber fractal
#

so with internal sharding client.guilds is all guilds and you dont need to client.broadcastEval?

bright spear
#

Yeah

earnest phoenix
#

yea this is legit cool

#

wait

#

will it duplicate loops?

#

like the shard manager did?

bright spear
#

Wdym

earnest phoenix
#

like if i setInterval will it duplicate it when a new shard is spawned

amber fractal
#

It doesnt run the process multiple times

earnest phoenix
#

oh

#

sick

amber fractal
#

I wouldnt think so

bright spear
#

Yes it's only one process

earnest phoenix
#

ok now this

#

is epic

#

why is this not like

amber fractal
#

but I use external so not really sure

bright spear
#

Afaik there's no duplication stuff

earnest phoenix
#

recommended

#

thats great

bright spear
#

Well 12 is technically not not "stable" yet

#

It works fine tho

#

I've only used 12 and all my bots use it

amber fractal
#

I think Imma stay on external sharding even when it becomes stable because I dont wanna redo anything mmLol

bright spear
#

Lol

amber fractal
#

wait but wouldnt that break dblapi.js?

bright spear
#

Wot

amber fractal
#

wait no

#

cuz client.shard is null

#

nvm

earnest phoenix
#

@still karma that means this framework bouta push will auto shard and you dont have to do any funky stuff

#

woot

bright spear
#

I just use blapi, I contributed internal sharding support to it

amber fractal
#

needed to know if that would break my lib

#

lmai

#

lmao*

#

I dont support shard data tho, it just posts guild count mmLol

bright spear
#

Lol

earnest phoenix
#

wow this is like

#

crazy simple

#

internal sharding ftw

bright spear
#

Yeah

#

Wait @earnest phoenix did u mean to ping a bot named moose

#

Cuz you did

amber fractal
#

Moose is a bot?

bright spear
#

@still karma is

earnest phoenix
#

i did?

#

TIL

#

woot

#

thx for this internal sharding dark magic

#

way better then alternative

pallid zinc
#

Console say
Error: Cannot find module ‘discord.js’

earnest phoenix
#

lol

#

funny thing about modules, you have to install them

pallid zinc
#

@earnest phoenix I install 10 times

#

But same

#

I install npm install, npm install discord.js

amber fractal
#

is that glitch?

#

you cant just install modules like that on glitch

#

you have to put them in as dependencies in package.json

pallid zinc
#

Ok

#

I am using glitch first time

earnest phoenix
#

I have a problem with mention prefix just the problem are when i do @MyBot ping its not working and when i do @MyBotping its working

zealous veldt
#

@earnest phoenix you're going to need to provide more details. Show us the code in question, explain more about what's happening vs what should happen, etc.

earnest phoenix
#

const mention = new RegExp(`^<@!?${bot.user.id}>`); const prefix = message.content.match(mention) ? message.content.match(mention)[0] : "blablabla"

pallid zinc
earnest phoenix
amber fractal
#

you see that const prefix part right?

earnest phoenix
#

yes

amber fractal
#

try `${message.content.match(mention)[0]} ` maybe

#

idk, but it may work

earnest phoenix
#

not working

amber fractal
#

neither?

pallid zinc
#

i want to make my own rich presence how to make

earnest phoenix
#

I'm trying this

#

const mention = new RegExp(`^<@!?${bot.user.id}> `); const prefix = String(mention).match(message.content) ? message.content.match(mention)[0] + " " : "blablabla"

amber fractal
kind wyvern
#

any py developer here ?

slender thistle
#

Yes

lusty dew
#

Anyone wanna work on a website with me?

#

If so dm me and I will give further details.

earnest phoenix
#

With discord authentication, after the user signs in and you have the "code", you can get the access token and refresh token. How do you use the refresh token? What's the grant type?
https://discordapp.com/api/oauth2/token?grant_type=authorization_code&code=${code} doesn't seem to work

#

alright i messed with the first part and lost that too

#

What's wrong with:

app.get('/api/callback', async (req, res) => {
  if (!req.query.code) res.redirect('/')
  const code = req.query.code;
  let data = {
    'client_id': CLIENT_ID,
    'client_secret': CLIENT_SECRET,
    'grant_type': 'authorization_code',
    'code': code,
    'scope': 'identify'
  }
  let response = await fetch(
    `https://discordapp.com/api/v6/oauth2/token?code=${code}`,
    {method: 'POST',headers: {'Content-Type': 'application/x-www-form-urlencoded'},json: data}
  );
  let json = await response.json();
  res.redirect(`/api/store?data=${encodeURIComponent(JSON.stringify(json))}`)
});```
from <https://discordapp.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-exchange-example>
#

where is the code to display the server count found here
https://gyazo.com/0a6515bad253768ff4fdb9f81add48d4
is it this?

const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);

// Optional events
dbl.on('posted', () => {
  console.log('Server count posted!');
})

dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})
#

Update: code now looks like this (still not working)

app.get('/api/callback', async (req, res) => {
  if (!req.query.code) res.redirect('/');
  let data = {
    'client_id': CLIENT_ID,
    'client_secret': CLIENT_SECRET,
    'grant_type': 'authorization_code',
    'code': req.query.code,
    'redirect_uri': "https://discord-backup.glitch.me/api/callback",
    'scope': 'guilds'
  }
  let response = await fetch(
    `https://discordapp.com/api/v6/oauth2/token?code=${req.query.code}`,
    {method: 'POST',json: data}
  );
  let json = await response.json();
  res.redirect(`/api/store?data=${encodeURIComponent(JSON.stringify(json))}`)
});```
#

@earnest phoenix it auto posts when you create a new instance of DBL

#

so I just add this in?

const dbl = new DBL('Your discordbots.org token', client);

#

yes

#

I have that in my code already but its still saying N/a

#

you have changed the 'Your discordbots.org token' right?

#

yes

#

¯_(ツ)_/¯

#

There is no error though

#

i mean your non-working code

#

you'll probably get more people, who know what they're doing, seeing it

#

Code works and what not

#

but I guess

#

try waiting as well

#

sometimes it takes some time to update iirc

soft eagle
#

so when i do member.send("msg") what does member find to dm it??

#

trying to have it dm me instead of righting the error in console

eager kite
#

he will find msg

kind wyvern
#

U py developer?

eager kite
#

simple as that

#

i just know basic py

soft eagle
#

discord.js

#

what will i need to have it dm me errors

#

rn its set to consle.log(err)

#

but i want it to dm me so i see them so i dont need consle up

eager kite
#

try and catch

soft eagle
#

i learn by doing im slowly learning discord.js

eager kite
#

try and catch is js

#

not discord.js

#
try{
member.send("smth")
}catch(e){
message.channel.send(e)
}```
soft eagle
#

but if i do member it would dm a member when it errors out what do i need in members spot to only dm me

#

my tag, name, id?

eager kite
#

message.author.send

#

to send to ur dm

soft eagle
#

that wouldnt send the error

eager kite
#

message.author.send(e)

soft eagle
#

message.autor does that find id, tag,

eager kite
#

wtf u talking bout

soft eagle
#

message.autur is the person who said something i dont want it sending errors to them i want it coming to my dms

#

im doing a let statment to find me but i need to know if i need my tag or id or @tag

eager kite
#

message.guild.members.find(r => r.id === "someoneid").send(e)

soft eagle
#

nope

kind wyvern
#

help me with it

#

py

eager kite
#

wat u mean nope gamearoo

#

i dont understand wtf u are trying to do

#

use try and catch

#

to get the error

#

the rest idk what u want

kind wyvern
#

pls help

soft eagle
#

ok think of the u run a command to msg me the bot owner how would i set that up to have it dm me even tho im not in the server'

#

ex a.feedback would dm me the feedback even if im not in the server

eager kite
#

bot.users.get("urid").send("smth")

soft eagle
#

let errUser = bot.users.get("171373018285735936")
errUser.send(ERR)

#

nothing was sent to dms

#

i want it coing to me even if im not in the server

eager kite
#

wat ERR is define as?

soft eagle
#

i have a cmd set to error out so i can test it on the test bot

eager kite
#

can u just give ur whole code

soft eagle
#

so basicly athat error

#

do u know what member.send() would look like if so replace member with the thing that will allow it to dm

#

member is the user doing the cmd i want it coming to me not the users dm

eager kite
#

idc bout that i just want to see ur code thats not working

soft eagle
#
  
  
  console.log(member.user8.tag + ` Joined ${member.guild.name} which the bots on`);

  let gRole = member.guild.roles.find(`name`, "Member");

  member.addRole(gRole.id);

  member.send("Welcome To: " + member.guild.name + " Please Enjoy Your Stay :)");

  let welcomechannel = member.guild.channels.find(`name`, "airi-sena-welcomes");
  if(!welcomechannel) return;
  let welcome = [` LOOK OUT EVERYONE ${member} JUST JOINED THEY SEEM OP PLZ NERF!!!`, ` LOOK OUT EVERYONE ${member} just joined. Can I get a heal??`, ` EVERYONE Roses are red, violets are blue, ${member} just joined this server with you!`, `EVERYONE ${member} just joined HOLD MY Sprite Cranberry `, `Everyome ${member} Just Joined What should i get to help him??`, `It's dangerous to go alone, take ${member}` ];

  let result = Math.floor((Math.random() * welcome.length));

  welcomechannel.send(welcome[result]);

  member.send(`Welcome To ``${message.guild.name}`` `)

  bot.users.get("171373018285735936").send("test")

  

});```
eager kite
soft eagle
#

thats just so i can test

eager kite
#

u will get undefined

#

then

soft eagle
#

trying to get that line to be dmed o me

eager kite
#

u dont even have try and catch

#

wtf

#

how u want to get bot to dm u

#

if there is error

#

and deprecated find method

soft eagle
#

@eager kite bot.on("ready", async () =>{ try{ bot.users.get('171373018285735936').send(`${bot.user.username} is online!`) }catch(e){ console.log(`${bot.user.username} is online!`) } }); still no work

eager kite
#

do u know what u doing?

#

and wat not work

soft eagle
#

not my first time coding a bot my first time doing this

#

it wont dm me

eager kite
#

not answering my question

#

it only dm u

#

when the bot is restart

soft eagle
#

dm me for errors and start

eager kite
#

wtf

#

english man

#

still nonsense english

#

dm u for error and start?

lusty dew
#

Maybe their first language isn't english?

soft eagle
#

im english i have autism a learning disability

lusty dew
#

Ah ook

soft eagle
#

so it may come out confusing

lusty dew
#

It's fine my guy

#

What are you trying to do?

eager kite
#

he trying to get smth

soft eagle
#

have my bot dm me on errs, and on start

eager kite
#

at the start?

lusty dew
#

He wants his bot to dm him when errors occur and when the bot logs on

soft eagle
#

basicly instead of it going to consle it comes to my dms

eager kite
#

but hes using ready event

lusty dew
#

Easy

eager kite
#

use try and catch

lusty dew
#

He is

eager kite
#

but that code will never reach at catch

lusty dew
#

He is just not doing it right

eager kite
#

bcz there is no error

lusty dew
#

Yea

#

You aren't sending the error anywhere anyway

eager kite
#
bot.on("ready", async () =>{
  try{
    bot.users.get('171373018285735936').send(`${bot.user.username} is online!`)
    }catch(e){
      bot.users.get('171373018285735936').send(`${bot.user.username} is online!`)
    }
});
#

look at that code i edit a bit

#

u must do smth wrong

#

at that try scope

soft eagle
#

ok that worked

#

now it should only dm me no one else if i use that code

kind wyvern
#

u didnt help me

lusty dew
#
                    <a onclick="toggleFunction()">Developer</a>
                    <div class="field" id="form" style="display: none">
                        <label class="label">Label</label>
                        <div class="control">
                            <input class="input" type="text" placeholder="Text input">
                        </div>
                        <p class="help">This is a help text</p>
#

This isn't allowing me to type in the text box at all

#

whenever I clcik on the text box to try

#

it toggles the checkbox and it makes it disappear

soft eagle
#

@eager kite

eager kite
#

@soft eagle do the same method as above

#

and dont tag me anymore

soft eagle
#

no its just basic coed

#

code*-

eager kite
#

no

#

just do the same

soft eagle
#

didnt even add the log dm to it

#

its not working even without the adon

#

im trying to fix the bwelcome msg

#
bot.on("guildMemberAdd", async member => {

  let gRole = member.guild.roles.find(`name`, "Member");

  member.addRole(gRole.id);

  member.send("Welcome To: " + member.guild.name + " Please Enjoy Your Stay :)");

  let welcomechannel = member.guild.channels.find(`name`, "airi-sena-welcomes");
  if(!welcomechannel) return;
  let welcome = [` LOOK OUT EVERYONE ${member} JUST JOINED THEY SEEM OP PLZ NERF!!!`];

  welcomechannel.send(welcome);```
#

its not working as is why would i try to log

#

can someone help plz

#

my wifi sucks so i can just google search a fix this time

late hill
#

Use ids instead of names

pallid zinc
#

``` if (message.content.toUpperCase() === prefix + DAILY) {
message.delete();
if (money[message.author.username + message.guild.name] != moment().format('L')) {
money[message.author.username + message.guild.name] = moment().format('L')
money.updateBal(message.author.id, 500).then((i) => { // The daily ends of the day, so everyday they can get a daily bonus, if they missed it, they can't get it back again.
message.channel.send({embed: {
color: 3447003,
description: 'Recieved your $500 `!daily\. I think you should check \!money`.',
author: {
name: ${message.author.username}#${message.author.discriminator},
icon_url: message.author.avatarURL
}
}});
})
} else {
message.channel.send({embed: {
color: 3447003,
description: 'You already recieved your `!daily\. Check later **' + moment().endOf('day').fromNow() + '**.', // When you got your daily already, this message will show up. author: { name: ${message.author.username}#${message.author.discriminator}`,
icon_url: message.author.avatarURL
}
}});
}
}

});```
#

THIS COMMAND NOT WORKING

sinful lotus
#

define "moment"

pallid zinc
#

ok

bright spear
#
  1. please use a real code block (
    ```js
    code
    ```
    )
  2. chill on the caps
pallid zinc
#

ok

sinful lotus
#
  1. Read the error because it actually tells you where it is
bright spear
#

^

pallid zinc
#

ok thanks

#

not working

#
var moment = require('moment');
sinful lotus
#

define what do you mean by "notworking"

pallid zinc
#

i wright

sinful lotus
#

error message if anything

pallid zinc
#

Same as before

#

Is it right

sinful lotus
#

how did you define moment

#

unless you are putting that moment somewhere weird

#

it should be defined

vague chasm
#

make sure you saved file after defining moment too

pallid zinc
#

var moment = require('moment');

vague chasm
#

btw you can use const on it if you don't want to change it again

open flicker
#

Can you help with dbl-api

vague chasm
#

Sure

#

What is the issue?

open flicker
#

(node:8868) UnhandledPromiseRejectionWarning: TypeError: dbl.getBot is not a function
What am I doing wrong?

sinful lotus
#

dbl has no getbot function

#

either you are doing it wrong

#

or something

vague chasm
#

@open flicker Can you show me your dbl definition

#

const dbl = ???

late hill
#

God

pallid zinc
#

Hmm

open flicker
pallid zinc
#

What

late hill
#

Please use ids and not names..

vague chasm
#

Use DBL.getBot(), not dbl.getBot() @open flicker

pallid zinc
#

Why

#

I love to use name

late hill
#

Names can change

#

There can be duplicate names too

pallid zinc
#

Hmm

#

You are right

sinful lotus
#

ids are unique

#

names are not

vague chasm
pallid zinc
#

But my bot will not work even I change user into id

vague chasm
#

Why?

lunar wasp
#

can someone help me

vague chasm
#

First do it and we will look into errors after that

#

@lunar wasp Sure

pallid zinc
#

Because it's unique shit

lunar wasp
#

how can i turn the server list bot online on my server?

pallid zinc
#

Lmao

vague chasm
#

you can't turn it on..

sinful lotus
#

@pallid zinc it will not work because you will lose all the data

vague chasm
#

there might be a hosting or bug issue with it that DBL devs are looking into

pallid zinc
#

@lunar wasp only owner of the bot can

sinful lotus
#

you used name, migrating to id would need a reconfiguration

vague chasm
#

@pallid zinc No

#

People who have token of bot can start the bot

lunar wasp
#

@pallid zinc its offline in my server

pallid zinc
#

Bot is off

vague chasm
#

lol

#

its offline everywhere

lunar wasp
#

oh

#

why

sinful lotus
#

you need a program to make a bot run

pallid zinc
#

@lunar wasp only in your server

vague chasm
#

I just told you

lunar wasp
#

@pallid zinc what do u mean

pallid zinc
#

Bot is off only in your server

lunar wasp
#

ye

pallid zinc
#

Lmao

sinful lotus
#

I dont think you even use shards

lunar wasp
#

when will it be back online

sinful lotus
#

could be not only in your server but on all servers