#development

1 messages · Page 530 of 1

earnest phoenix
#

dm - send

bright spear
#

the point is u wanna get banned from discord

#

for api ab00se

earnest phoenix
#

i'm just wondering is it possible

tepid laurel
#

@knotty steeple edited it

#
logEmbed: function(content, author) {
        return {
            title: `\`${author.tag}\``,
            description: `\```\n${content}\````
        };
    }
#

rip

bright spear
#

course its possible

#

but just because its possible doesnt mean its ok to do

knotty steeple
#

just gets you api banned

bright spear
#

murder is possible but if u do it u go to jail

#

and lets not turn that into a conversation kthx

earnest phoenix
knotty steeple
#
const write = (str = '') => {
    process.stdout.cursorTo(0);
    process.stdout.clearLine(1);
    process.stdout.write(str);
}
``` @sick cloud also do i loop this
#

im assuming yes lmao

sick cloud
#

you have that in 1 place

#

and use write()

#

so like

#
write('1%')
write('17%')
write('banana')
write('done')```
knotty steeple
#

ook

earnest phoenix
#

now how can i check if the person voted or not

#
dbl.hasVoted(message.author.id)
inner jewel
earnest phoenix
#

now what do i do next?

#
const voted = await dbl.hasVoted(message.author.id);
  if (voted) {
    message.channel.send(yesvote) 
  } else {
    message.channel.send(novote)
  }```
inner jewel
#

it's a Promise<boolean>

earnest phoenix
#

@inner jewel

serene sun
#

can anyone help me with !membercount? i am using discord.js and javascript.

quartz kindle
#

@earnest phoenix do console.log(voted)

#

to see if voted is actually working

earnest phoenix
#

alright

quartz kindle
#

@serene sun elaborate please?

earnest phoenix
#

@quartz kindle it says false but i did vote 😂

quartz kindle
#

then there's your problem

#

either wrong id, or broken dbl api

serene sun
#

@quartz kindle like when i do !membercount in a channel the bot tells me how many members are in the discord server.

earnest phoenix
#

hmm.

#

so i refresh my api token?

knotty steeple
#

Guild has a memberCount property

quartz kindle
#

you can try, but i dont think it will make a difference

#

have you double checked if your account on the website is correct? could happen that you voted as a different account

earnest phoenix
#

so wait the api key is my bots api key?

quartz kindle
#

no, dbl api key is different

earnest phoenix
#

where do i get it 😂

quartz kindle
#

is the one you get from your bot's edit page

earnest phoenix
#

ohhh thats what it is.

#

alright ty for being useful

quartz kindle
#

lmao

earnest phoenix
#

but its the same thing 😂

topaz fjord
#

it's not

earnest phoenix
#

im at the edit website.

#

and its the same thing i copied.

#

dafaq.

mild quarry
#

In Discord.py, how could I pass_context, yet still get context from the author anyway? For example, if I wanted to get a user's ID when they run the command, and get arguments they throw in after the command, how could I do that?

quartz kindle
#

idk the specifics of d.py but you need to listen to subsequent messages from the same user

mild quarry
#

I wasn't clear, I meant for it to be like >command [args from user here]

#

Not subsequent messages

quartz kindle
#

hmm cant you just get the message content and split it?

mild quarry
#

I can try that

#

Actually

#

That won't work if I have pass_context = True

#

Because I'd need the context of the message sent

quartz kindle
#

can you do like ctx.message.content?

mild quarry
#

I'll try

#

Yeah that worked

#

From previous experiences for some reason using pass_context didn't let me get the message content

quartz kindle
#

idk anything about python, but the more i see people using it the more i want to stay away from it lmao

#

it just looks so weird

misty pawn
#

Someone can help me understand, why my bot doesn't get the JSON from the api-page of GitHub?
I want to display changed files (name, changes, additions and deletions) of the latest commit in my bots repo with a command.
But when I try to get the json from https://api.github.com/repos/:user/:repo/commits/:sha (I obviously replaced the :info with the required one) it doesn't get it?

earnest phoenix
#

Alexa help

#

@mighty pond help

#

fuck

#

Alexa race

#

alexa race

#

Oh shit wrong channel

sick cloud
#

i can get json fine from it

misty pawn
#

I mean my bot doesn't get it....

#

And I use with the sha/hash at the end

sick cloud
#

that gets a specific commit

misty pawn
#

Since the commits shows all commits and also don't have the files array which I need

sick cloud
#

do you have the correct sha

#

it works perfectly fine

misty pawn
#

And that one doesn't exist for my bot

#

Like it's just {}

#

It works for me (my browser) too

#

Just my bot can't see it for some reason

sick cloud
#

hmm

#

so

#

you can't see any of that?

misty pawn
#

-_-

earnest phoenix
#

can someone here help me?

#

how can i make it to where my play command just searches what ever someone times

#

types(

#

play faded

#

and it plays the first search in the queue

valid frigate
#

would it be recommended to link a bot client and server (e.x. express) to one file? i want to keep them seperate so if the bot goes down, the web dashboard can still be accessible

bright spear
#

@earnest phoenix nobody here is gonna code ur bot for you

#

you can ask specific questions, not generic questions like that

serene sun
#

Does anyone know how to host a bot 24/7 for free? If that is even possible.

earnest phoenix
#

Glitch and uptime robot @serene sun

#

@bright spear never said for anyone to spoon feed me.

serene sun
#

@earnest phoenix sounds good thank you

earnest phoenix
#

np

serene sun
#

i thought glitch wasn’t a hosting website though

earnest phoenix
#

well its not requested alot because it has problems

#

but i use glitch for @pliant bluff

serene sun
#

and it’s mostly 24/7?

earnest phoenix
#

depends.

#

it may reboot every 6-12 hours

#

but it depends if uptime robot has a matience

serene sun
#

how long is the reboot?

earnest phoenix
#

70ms to 1 minute

#

i think

serene sun
#

oh damn

#

that’s dope

earnest phoenix
#

you can use heroku and github

serene sun
#

so do uptime robot and glitch work together?

earnest phoenix
#

but glitch and uptime is waaay easier.

serene sun
#

oh, i tried that but it didn’t work

#

dope

#

thanks for all the help

earnest phoenix
#

np

misty pawn
#

Nobody has an idea, what my issue could be?

valid frigate
#

when you don't specify the issue nobody will know mmLol

misty pawn
#

I specified it above

steel pelican
#

How do you use github to host a bot?

earnest phoenix
#

find a video

#

but i suggest u use glitch and uptime

steel pelican
#

I tried finding a vid but it's only like for websites

earnest phoenix
#

if u dont wanna sit in ur computer for 3 hours figuring out how shit works.

#

easiest way to host 24/7

steel pelican
#

Reap I don't use js

earnest phoenix
#

py?

steel pelican
#

Nope

#

I use .net

earnest phoenix
#

.

#

brain.exe has stopped working

steel pelican
#

Oof

vernal rivet
#

He means c#

valid frigate
#

glitch is not a reliable host but it works for testing, if your bot gets huge glitch won't be able to handle the load mmLol

night imp
#

Glitch is fine for development but shouldn't be used for production

solemn valve
#

hi, i have finished writing a bot for our gaming guild server, it's compiled and running smoothly from my powershell
are there places that will host it so i can turn my laptop off at some point?

valid frigate
#

you can use glitch if the guild is small i guess, or you can read the pinned messages for hosting options

earnest phoenix
#

Alright Kinda need help. I need someone to help with the process of a xp system using quick.db (along with a cool down) since Glitch cant update json files

#

Ping me if u can help me! I will respond either in a few hours or tommorow.

solemn valve
#

will gltich only host node.js?

#

i wrote my bot in java

#

@earnest phoenix

earnest phoenix
#

@solemn valve you dont need node.js just need packages.

keen drift
#

Yes glitch only takes nodejs

fierce thorn
#

You can host java / python / php / nodejs on glitch

mossy vine
#

Wait you can host python?

keen drift
#

How do you run other langs on glitch

#

oh neat, looks like their vm has java and python installed

mossy vine
#

J.. Java?

#

hosts minecraft server on glitch like a boss

keen drift
#

cpu seems very limited

bright spear
#

@earnest phoenix FYI you can edit json files on glitch, but never use json for storing data that can change since it will get corrupted

earnest phoenix
#

@bright spear like its just increasing but not editing so everytime the bot restarts it reverts back to the empty json

bright spear
#

That shouldn't happen đŸ€”

#

Glitch has persistent storage iirc

#

Weird

#

Well anyways you should be using a db

#

It would probably be easier to just look up a tutorial on how to set up a db

earnest phoenix
#

Yeah already tried

#

But where does the db store the file?

bright spear
#

It won't show in the editor unless you run the refresh command in the console to sync it

solemn valve
#

ive been trying to get it to work but it doesnt seem to like packages

#

or my pom.xml

#

all the libs came in fine

#

cant find my main class

drowsy lily
lament meteor
#

tbh i only use glitch for projects and test rendering markdown

solemn valve
#

so what happens when i close the window?

#

it keeps running?

lament meteor
#

wait... u actually can run py on glitch

earnest phoenix
#

@solemn valve after u close ur window ur bot will be online for 5 minutes before turning off. Uptime robot will fix that

lament meteor
#

but glitch is not meant for hosting discord bots

solemn valve
#

that vid said set the timer to 10mins

#

change it to 5?

silver jewel
#

<@&304313580025544704> my bot is fixed

coral trellis
#

Pls don't ping all mods

languid dragon
#

cool beans 👍

#

not like i wanted to know but ok

silver jewel
#

sry

bright spear
#

@solemn valve yeah 5

hoary stag
#

Hi i need help

lament meteor
#

ur project is using too much cpu

bright spear
#

No that's disk space

#

@hoary stag did you do what it said

obsidian badger
#
if(command === "avatar"){
    var member= message.mentions.members.first();
    let embed = new Discord.RichEmbed()
  .setImage(message.member.avatarURL)
  .setColor(`RANDOM`)
    message.channel.send({embed: embed})
  }

it works, but the embed is just an empty box.

#

y is that?

bitter sundial
#

maybe you meant to do .setImage(member.avatarURL)
and afaik avatarURL is a function so .setImage(member.avatarURL())

#

ah avatarURL isn't a function so scrap that

#

you need to access the user object of the member first

#

member.user.avatarURL

sick cloud
#

avatarURL is a function in master

bitter sundial
#

ah yeah makes sense

mossy vine
#

Excuse me what

keen drift
#

Does setColor actually takes RANDOM

mossy vine
#

Yea

#

It does

#

Weird

keen drift
#

that's fun

neat falcon
#

Ugh i come back to hear glitch

knotty steeple
#

wait

neat falcon
#

well

#

look in your code

#

is there a random <

#

it'll be in nav somewhere i think

#

like <nav>> or something

knotty steeple
#
<body>
    <div id="navbar" class="nav-container default">
        <span id="menu-icon"></span>
        <h3 class="nav-title">SamuraiStacks</h3>
        <div id="navside" class="sidenav">
          <a href="#" class="current">Home</a>
          <a href="#">Projects</a>
          <a href="#">Contact</a>
        </div>
    </div>    
</body>
neat falcon
#

mm

misty pawn
lament meteor
#

iirc you need to be logged in to use the api not sure

misty pawn
#

No

lament meteor
#

idk then

earnest phoenix
#

Hi

ruby dust
#

is this a .db file format of database's structure or is this unique to sqlite? https://puu.sh/CbGpm/59c5a0f2a0.png why I'm asking is can I simply move from sqlite to lets say monodb without any issues?

keen drift
#

Monodb?

#

The extension doesn't really matter

#

It can use any extension and data will remain the same, just ease for identification

#

If you mean mongodb, it's no way similar

ruby dust
#

so if I have already created the database with sqlite it won't work with other dbs?

earnest phoenix
#

not all

eager kite
#

^

ruby dust
#

what

quartz kindle
#

if you want to switch databases you have to migrate the data

#

there are some migration tools to transfer between rmdbs

#

but mongo is not an rmdb

#

still, you will probably find something to migrate between them since they're both popular

#

but you can also write your own migration code

#

ie from sqlite to mongo: get all tables, for each table write a collection. for each row in table write a document in collection

ruby dust
#

ok I get it

#

thanks

earnest phoenix
#
client.on('message', message => {
  

  if (message.content === '@anecdote') {

    const embed = new RichEmbed()
      // Set the title of the field
      .setTitle('Zapper')
      .setDescription('Chaque jour 10 nouvelles anecdotes à découvrir')
      // Set the color of the embed
      .setColor(0xFF0000)
      // Set the main content of the embed
      .addField('Vocabulaire', "NycthémÚre signifie l'espace de temps d'une durée de 24 heures, alternant nuit jour.", true)
      
    message.channel.send(embed).then(message => message.react(':yum:'))
  
          
}


});```
#

and consol says me

#
events.js:200
    throw new errors.ERR_INVALID_ARG_TYPE('listener', 'Function', listener);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type Function. Received type undefined
    at _addListener (events.js:200:11)
    at Client.addListener (events.js:259:10)
    at Object.<anonymous> (C:\Users\ElĂšve\Desktop\Bot\index.js:36:8)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)```
#

i try a lot of thing for add reaction, but no way :/

lament meteor
#

client.on('message', (message) => {})

#

thats the issue

earnest phoenix
#

mmm

#

same error when it do message.channel.send(embed).then(client.on ('message', (message) => {message => message.react(':yum:')}))

lament meteor
#

no

earnest phoenix
#

?

lament meteor
#

why would you add a listener when you send an embed

earnest phoenix
#

ohh outside

#

okok

lament meteor
#

no...

#

the first line of the code you sent

#

is the issue

#

?

#

oh

#

"300 chars" this is counted as 7 chars cause it doesn't count spaces

mossy vine
#

what

lament meteor
#

im confused

mossy vine
#

did you put the servers id

#

wait nvm

amber junco
#

Missing perms

#

I got that err is command prompt, I have no idea what file that err was in.

#

It just says DiscordAPI error

molten edge
#

i hate when i get a discord api error

#

i can never find where its coming from

mossy vine
#

i mean

#

you can log it

#

so

quartz kindle
#

missing permissions is just missing permissions

#

econnreset means the connection was lost

fierce thorn
#

Do you have check if bot have permission to send message to channel?

vocal meteor
#
    let ed = new Discord.RichEmbed()
    .setDescription(`Welcome to the ${member.guild.name}, ${member}!`)
    .setImage(attachment)
    channel.send(ed);```
#

is this wrong to use attachment in .setImage

quartz kindle
#

you have to use .attachFile()

#

Sets the file to upload alongside the embed. This file can be accessed via attachment://fileName.extension when setting an embed image or author/footer icons.

vocal meteor
#

oh thanks

earnest phoenix
#

@lament meteor same error with client.on('message', (message) => { code }

lament meteor
#

not sure then

earnest phoenix
#

throw new errors.ERR_INVALID_ARG_TYPE('listener', 'Function', listener);

#

so perhaps i can add listener

#

thus

#

client.on('message', (message), message => { code }

quartz kindle
#

no

#

something is wrong with your entire code

#

can you post everything?

earnest phoenix
#
const { Client, RichEmbed } = require('discord.js');


const client = new Client();


client.on('ready', () => {
  console.log('I amdd ready!');
});

client.on('message', (message), message => {
  

  if (message.content === '@anecdote') {

    const embed = new RichEmbed()
      // Set the title of the field
      .setTitle('Zapper')
      .setDescription('Chaque jour 10 nouvelles anecdotes à découvrir')
      // Set the color of the embed
      .setColor(0xFF0000)
      // Set the main content of the embed
      .addField('Vocabulaire', "NycthémÚre signifie l'espace de temps d'une durée de 24 heures, alternant nuit jour.", true)
      
    message.channel.send(embed)
    message.react(':yum:')
  
      
      
      
}


})


client.on('messageReactionAdd')



  
  client.login('TOKEN)```
quartz kindle
#

remove client.on('messageReactionAdd')

earnest phoenix
#

oh yh

quartz kindle
#

change client.on('message', (message), message => { back to what it was

amber junco
#

Hey!

#

How do I figure out where the discord api error is coming from?

earnest phoenix
#

i'm so

#

ty Tim and Telk

vocal meteor
#

I want to set the attachement like welcomer bot send

quartz kindle
#

@amber junco if the error is ECONNRESET thats a connection error, not much you can do there

#

its an error coming from the websocket

#

if the error is missing permissions, then you have you check which permissions your commands need, and add a permission check

amber junco
#

Oh just figured it out

#

My VPS account got disconnected

earnest phoenix
#

Second question on emoji:

#
client.on('message', message=> {
  
  if (message.content === '@anecdote') {

    const embed = new RichEmbed()
      // Set the title of the field
      .setTitle('Zapper')
      .setDescription('Chaque jour 10 nouvelles anecdotes à découvrir')
      // Set the color of the embed
      .setColor(0xFF0000)
      // Set the main content of the embed
      .addField('Vocabulaire', "NycthémÚre signifie l'espace de temps d'une durée de 24 heures, alternant nuit jour.", true)
      
    message.channel.send(embed)
    message.react('😀')
            
}

})```
#

the emoji is on tje msg who send '@anecdote' (and that's logic) and i want put the emoji on embed.

#

but i can't do embed.react...

quartz kindle
#

you have to wait for the message to send

#

send().then(message => message.react)

#

you get the new message after it finishes sending

earnest phoenix
#

Someone have Giveaway bot?

high raft
#
bot.on("message", (message) => {
  if(message.content == 'snochbot') 
    var teksty = ['ta gra jest rozjebana jakaƛ','zwal se konia','beka z ciebie typie','ale ja tylko godzine sprawdzaƂem','jo','miaƂem laga','dobra zamknij morde','jebac disa','patrzcie przeskocze','na duza by weszlo','orange ty kurwo',
   'ale go ograƂem','ale ƁATWOOO','twój stary pijany'];  
   var random = teksty[Math.floor(Math.random() * teksty.length)];
    message.channel.send(random);
    message.delete();
   })

TypeError: Cannot read property 'length' of undefined

yesterday it was fine lol

quartz kindle
#

i dont think you can have new lines in the middle of an array literal

tight heath
#

said who

quartz kindle
#

said my code last time i tried lul

#

but well, it was in chrome's console

#

copy/pasting an array from somewhere else which borked the new lines

earnest phoenix
#

How install quick.db?

quartz kindle
#

npm install quick.db ?

#

if using node.js

west raptor
#

the server has pins in the quickdb support

#

on how to install

#

@earnest phoenix ^

lofty abyss
#

hey if anyone is using the DBL api like fully plz send me the github to ur bot i just need some info on it xD

#

also my bots servers is like outdated

#

so oofofs

#

its on 600

#

and it says 511

#

LOL

#

anyone know what causes this? @pale sparrow

earnest phoenix
#

whats up

dusk raft
#

I was using repl to test out my code and it worked fine, then I used heroku to deploy and the client.user.setActivity function was defined as not a function, why is this?

grave mist
#

How to change my profile color

#

In site

amber junco
#

How do you make it so that a command can only be used one a day

#

@lofty abyss There a problem with your web socket connection

#

Are you hosting your bot?

#

@dusk raft Did you check it is still defined?

earnest phoenix
#

how i can make pictures for HTML?
and is this question development?

valid frigate
#

the bare minimum you need for an img tag is the src attribute, but i would also recommend including alt in case the image doesnt load mmLol

late hill
#

@amber junco Save a timestamp of when they use the command

earnest phoenix
#

why aint this working anymore?'

        .setThumbnail(guild.iconURL)
#

discord.js is library

shell blade
#

What do you have the guild variable set to?

#

@earnest phoenix

radiant void
#

anyone use eris or are you too cool for that?

inner jewel
#

i'm too cool for that

shell blade
#

Same

#

I wish

past crypt
#

hi, how to make a lockdown command ?

earnest phoenix
#

@shell blade its new guild event

#

has worked before

#

then stopped like POOF

#

also
how can i make it so if i eval a role create, i can make the role mentionable

shell blade
#

message.guild?

earnest phoenix
#

Obviously this wont work, what would replace mentionable to make it work

--eval  role = message.guild.createRole({
                name: "Owner2",
                color: "Blue",
                permissions: ["ADMINISTRATOR", "MENTIONABLE"]
            })
message.guild.createRole(role)
message.member.addRole(role)
inner jewel
#

mentionable: true

earnest phoenix
#

o

inner jewel
#

a role being mentionable is a property of the role, not a permission it gives

primal egret
#

Why the guild owner returns undefined? ._.

.addField(`Owner:`, msg.guild.owner)
west raptor
#

for this server?

primal egret
#

Yes

west raptor
#

oliy isn't cached for some reason

primal egret
#

😼

#

oh, but, only on this server?

#

or it's a possible error on other guilds

west raptor
#

it could happen on other servers

#

depends if the member is cached or not

primal egret
#

okay, thanks

west raptor
#

np

primal egret
#

but

#

other bots (here) serverinfo command returns owner successfully

#

._.

west raptor
#

they have oliy cached then

primal egret
#

:/

ruby dust
#

the best answer would be because your bot doesn't fetch offline members, that is, if when you tried to get the server info back then he was offline @primal egret

primal egret
#

Oh

#

makes sense

ruby dust
#

there should be a parameter to fetch offline members on startup

primal egret
#

xd

ruby dust
primal egret
#

I use discord.js

ruby dust
#

yeah, look in the docs if there is something like that

dusk raft
#

@amber junco i copy+pasted the code from 1 place to the other

quartz kindle
#

there is fetchAllMembers

#

but that will eat your ram like crazy

#

much better to just fetch guild owner

ruby dust
#

how is that eating ram? Thonk

uneven rover
#

it caches all users

ruby dust
#

expectable, but not understandable

quartz kindle
#

the two single things that use the most ram in a bot are cached users and cached messages

#

if you cache ALL users on startup, not only does your bot take longer to start, it also loads all users into memory, which can be a LOT depending on the size of your bot

ruby dust
#

but what if I'm not caching many messages, like I set a minimum value of cached messages possible

past crypt
#

how to make a lockdown command ? (discord.js)

quartz kindle
#

just do it and see

#

you can do a simple test

#

console.log users size and check ram usage

#

then do the same thing with fechall enabled

#

post results

earnest phoenix
#

guys what is the best way to keep track of servers

#

🍯

quartz kindle
#

keep track in what way?

#

database

earnest phoenix
#

i mean server name,server usernames server users

#

server owner mail

#

details like that

#

maybe a db yes?

quartz kindle
#

@past crypt what kind of lockdown? prevent people from joining? prevent people from typing? slow mode? increased security?

#

a db yes, and you cant get owner email lol

ruby dust
#

internal cache already does keep track of that Thonk

earnest phoenix
#

welp i need my own

#

so if i want to send messages for example to owners i an do that

#

but i think i can have the email of the owner

#

cause when they add the bot it gets the email

ruby dust
#

no, you can't have owner email

quartz kindle
#

you cant have emails without oauth2

earnest phoenix
#

ido use oath2

ruby dust
#

it's not only the owners that add the bots

earnest phoenix
#

yes

#

but mostly owners

#

wait

#

is there another way to auth?

#

than oaut2

#

?

#

đŸ€”

quartz kindle
#

oauth2 has many methods

ruby dust
#

why are you planning on flooding their emails just because they add a bot? cause that's exactly what it sounds like

quartz kindle
#

the one used by bots cannot access emails

#

you need to create an oauth2 requesting email access

#

and have people accept it

earnest phoenix
#

i see

#

why would i need to flood emails

#

devedux

#

đŸ€”

#

mass email attack ?

ruby dust
#

well what kind of emails are you planning on sending the owners? typical changelogs that can be announced in your server instead?

earnest phoenix
#

i dont have a serv

ruby dust
#

so is that true?

earnest phoenix
#

yes

quartz kindle
#

make one? @_@

ruby dust
#

wooow

#

I'm done

earnest phoenix
#

🍐

#

im lame to keep a serv

ruby dust
#

it's like 1000 times easier to create a support server than asking people their email access, flood their inboxes with total nonsense, and with a chance that not owners specifically will add your bot anyway

earnest phoenix
#

but nobody will join

#

when ppls see rheres noone in the serv

#

they quit

#

its a loop

ruby dust
#

the purpose of a support server is to get support for a bot they are interested in, if you want a hangout server then create a server specifically for hangouts, asking for emails is totally not the greatest workaround for not getting members in your servers

earnest phoenix
#

they think its useless and leave

quartz kindle
#

dont be scared

earnest phoenix
#

not hangout lmao

quartz kindle
#

just because server is empty doesnt mean people will insta-quit

#

you have to start somewherwe

#

if your bot is cool, people will go there to talk about it

earnest phoenix
#

welp i have a hangout serv with 360 memfrs

#

members

ruby dust
#

my server has been with 10 members for 2 months, and after a year of my bots' popularities I started getting some cause they needed assistance with them

#

it's just how it works

quartz kindle
#

if you dont want a dedicated server for you bot, just make some other server do it

earnest phoenix
#

no thats not a prob

quartz kindle
#

ie: server where you're more active in, tell people to go there to ask about your bot

earnest phoenix
#

ill make one

#

oliy btw this guy looks a lot like me wff

quartz kindle
#

oily

#

🛱

earnest phoenix
visual zenith
#

How do I make the bot dm you without the mention? - discord.js

knotty steeple
#

dm without a mention?

#

wat

visual zenith
#

nvm

rich sail
#

Need help af

#

what is handleVideo

#

i have error

topaz fjord
#

Show code and we can help

formal agate
#

Discord.js - Basically every example of a mention prefix I’ve seen does not work in the slightest. I’ve tried it myself but I’ve run out of ideas on how to do this. I’ve also just given up on multiple prefixes. If you have any solutions to this, even if they kinda work I’ll take.

zenith moss
#

I have per server settings with change able prefix using enmap

obsidian badger
#

does anyone know how to get my bot (discord.js) online 24/7 for free?

inner jewel
#
  1. you don't
  2. you don't
  3. you don't
obsidian badger
#

i heard you can do it on github, but im not sharing my code.

inner jewel
#

github only stores your code

#

it won't host anything

rocky mesa
#

heroku but like

#

dont

obsidian badger
#

y not?

rocky mesa
#

because its really bad

#

if you really need to

#

then ya

obsidian badger
#

and minecraft command blocks are better than scratch

rocky mesa
#

but just use something cheap like galaxygate or virmach

obsidian badger
#

ok

#

i dont have any money wse

rocky mesa
#

list of good hosts are in pins

obsidian badger
#

im only 13

rocky mesa
#

im fourteen and I can

sick cloud
#

i'm 14 and have a dedicated server

#

mostly because i only pay a bit tm

formal agate
#

@obsidian badger use glitch

#

Also lol spider

earnest phoenix
#

Glitch is bad too

sick cloud
#

get a vps

#

you can get them for like $3

earnest phoenix
#

People don't understand: these services are not meant for hosting discord bots

formal agate
#

^

#

But you can

earnest phoenix
#

Then the complain when something doesn't work

sick cloud
#

its like using an airplane underwater

formal agate
#

Don’t expect great quality tho

earnest phoenix
#

and I just say, "What do you expect"

sick cloud
#

ITS NOT A SUBMARINE

young dragon
#

pls multiplier

formal agate
#

Lol

earnest phoenix
#

its free and you're misusing it

formal agate
#

No

#

Using glitch for me is like using a axe on metal

#

It works

#

But it’s not really effective

#

Glitch also now has “built in” support for discord bots

sick cloud
#

ily

earnest phoenix
#

@frigid lichen

#

z!comandos

#

z!rep

#

Muted ;-;

west raptor
silent anchor
#

@Rashad_Sams#3840

west raptor
#

what?

obsidian badger
#

can someone send me a link to glitch?

#

and explain how to use it?

#

or tell me if its a website or not?

sick cloud
earnest phoenix
visual zenith
#

Error: Please install sqlite3 package manually - discord.js

bright spear
#

So do it...

#

It puzzles me how people copy and paste an error message which literally says what to do

west raptor
#

lol

rich sail
#

Hey

#

boys

#

how i do a global event

formal agate
#

Here is my repost of a cry for help.
Discord.js - Basically every example of a mention prefix I’ve seen does not work in the slightest. I’ve tried it myself but I’ve run out of ideas on how to do this. I’ve also just given up on multiple prefixes. If you have any solutions to this, even if they kinda work I’ll take.

#

oh um wdym by global events @rich sail

rich sail
formal agate
#

um

#

idk if there are "global" events

#

i think there are just events

vernal rivet
#

What's the question?

formal agate
#

For me or him?

vernal rivet
#

Global event is basically an event that shares the same data with all the servers, I believe. I can give you an example if I know what language you are using

#

Either

serene sun
#

does anyone know if skysilk is a good discord bot host website?

formal agate
#

idk

#

its a vps

serene sun
#

yup

#

true

formal agate
#

so it varies whether it is good or not

rich sail
#

nvm

#

I have one thing more

vernal rivet
#

Idk, I don't use vps, cause they cost money, I just run it on my computer with nodemon

formal agate
#

^

#

except i don't use nodemon

rich sail
#

if i have a file called commands/music/command.js
and i want to do const event = // ...., but the file is called events/event.js how i do?

#

it sounds dumb, but i mean

vernal rivet
#

Have you done an command handler before?

serene sun
#

@vernal rivet is that 24/7?

rich sail
#

@vernal rivet using commando framework

formal agate
#

"../events/event.js"

#

oh

#

idk that

#

but that should work

vernal rivet
#

Nodemon is an improved version of node.js

knotty steeple
#

its not

formal agate
#

depends

vernal rivet
#

It will be the same as any other file

knotty steeple
#

also

#

dont use skysilk

vernal rivet
#

Lol

knotty steeple
#

its decent but eh

serene sun
#

lol okay

vernal rivet
#

Samurai uses vps

serene sun
#

maybe vultr instead?

knotty steeple
#

use digitalocean or galaxygate

rich sail
#

const handleVideo = require('../events/handleVideo.js') **Currently File where is the const: commands/music/play.js
Error: Cannot find module '../events/handleVideo.js'

vernal rivet
#

Is ocean actually free, or is it, a lie?

formal agate
#

what is your file structure

knotty steeple
#

read the error

serene sun
#

@knotty steeple i want to host na east though and ocean doesnt have servers for that

formal agate
#

@rich sail

knotty steeple
#

too bad

serene sun
#

lol

#

how about glitch + uptime robot? hahahaha

formal agate
#

also how do i do mention prefixes

vernal rivet
#

Always check your error messages

knotty steeple
#

you have to do ../../

formal agate
#

lol don't need for glitch

knotty steeple
#

because as you have it there

formal agate
#

@serene sun

serene sun
#

dont use it?

knotty steeple
#

its looking for ./commands/events/handleVideo.js

vernal rivet
#

What it is saying is it can't find a file named handle video.js in ../events/

formal agate
#

no, you can use code to do it

serene sun
#

ive seen 24/7 bots on it though

rich sail
vernal rivet
#

You can also give the full pathway, it works better doing that

knotty steeple
#

why do people fucking put their bots on glitch

#

its for websites

vernal rivet
#

Why

serene sun
#

pog if it works, it works

knotty steeple
#

@rich sail did you read what i sent

rich sail
#

i know

formal agate
#

<@&304313580025544704> use this for glitch app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
http.get(http://${process.env.PROJECT_DOMAIN}.glitch.me/);
}, 280000);

#

oop

#

oops

#

oh dear

#

oh dear

vernal rivet
#

If you do what I do, my not seems to be going 24/7 on nodemon

queen sentinel
#

why

#

the ping

formal agate
#

sorry

queen sentinel
#

what even

vernal rivet
#

Oh god

knotty steeple
#

jonny chill

#

and leave now

serene sun
#

i want to get a vps but i have no clue on how they work so i dont want to buy something i have no clue what im doing on

vernal rivet
#

Run

granite tartan
formal agate
#

meant for you twitch

queen sentinel
#

@knotty steeple, don't ever ask me for fucking help

knotty steeple
#

for what

vernal rivet
#

Use nodemon first, and see if it will give you a decent result till you find the right vps

knotty steeple
#

look at what i sent

formal agate
#

ok, im gonna ask my question again. How do add a mention prefix

serene sun
#

@vernal rivet how would i go about doing that

#

i dont see anything online about using that for 24/7

formal agate
#

just use code in your main file

  console.log(Date.now() + " Ping Received");
  response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
  http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 280000);```
vernal rivet
#

Look up nodemon in your web browser

formal agate
#

and

  if (typeof(text) === "string")
    return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
  else
      return text;
}```
#

done

acoustic monolith
#

how i donwload

serene sun
#

can i use nodemon and node.js at the same time?

acoustic monolith
#

the bot?

#

help me pls

formal agate
#

what bot??

vernal rivet
#

Nodemon uses node.js

serene sun
#

oh simple enough lol

formal agate
#

also you won't be able to publish you bot here

acoustic monolith
#

i nedd to put groovy bot on my server

formal agate
vernal rivet
#

Nodemon is basically node.js, expect a improve version. It will restart the bot when it senses a file been saved

knotty steeple
#

click invite

earnest phoenix
#

@acoustic monolith invite it into your server

knotty steeple
#

then select your server

earnest phoenix
#

where it says invite

high anchor
#

@formal agate you want a mention prefix?

acoustic monolith
#

ah okokok

earnest phoenix
#

i mean

acoustic monolith
#

i love tyou

formal agate
#

yes @high anchor

acoustic monolith
#

thx

formal agate
#

all ex are crap

high anchor
#

Just check if it mentions the bot, it’s an object property in all the libraries as far as I’m aware

formal agate
#

.

high anchor
#

For the message param

formal agate
#

client.mention or something like that?

high anchor
#

even if not, just check if the message content string contains the id

#

message.whatever

vernal rivet
#

It would be helpful if you can say what language your using

formal agate
#

discord.js

#

forgot to say that

high anchor
#

I’m pretty sure it’s .mentions(client.id)

formal agate
#

ok

high anchor
#

Haven’t checked in a while though

formal agate
earnest phoenix
#

or do what i do if(message.content.starts(${botmentionprefixthingidon'tactuallyfeellikethisishelpful} `)

high anchor
#

If not just do a simple regex

earnest phoenix
#

oh

formal agate
#

i tried

earnest phoenix
#

markdown is broken

high anchor
#

That limits it to when it starts with it, but that also works perfectly fine

earnest phoenix
#

neat

vernal rivet
formal agate
#

i look at an idots guide

#

i got that desperate

high anchor
#

Yeah i would just do a id regex match

#

lol

#

brb

formal agate
#

it uses reg

#

does not work

vernal rivet
serene sun
#

@vernal rivet so i installed nodemon and also put both of that code into my main code file so now the bot is 24/7?

vernal rivet
#

Look at d.js docs

formal agate
#

i am

vernal rivet
#

Well it depends on the stable of your bot

sick cloud
#

no it wont be 24/7

formal agate
sick cloud
#

the second you close your terminal it'll die

formal agate
#

then an == right?

sick cloud
#

no

vernal rivet
#

Yes

sick cloud
#

mentions is an object

#

you want .users

#

filter by the bots id

vernal rivet
#

And you need your computer to be on and sign in

sick cloud
#

call first on it

serene sun
#

oh... lol, so @vernal rivet do you leave your computer on always?

formal agate
vernal rivet
#

Yes, well it's lock, but I am sign in

serene sun
#

oof, i see

quartz kindle
#

get a vps

earnest phoenix
#

that seems like a waste of energy tbh

formal agate
#

cost $$$

serene sun
#

i was going to @quartz kindle but i have no clue on how they work, i was looking into vultr

formal agate
#

aws

vernal rivet
#

Give me some money tim

formal agate
#

lol jk

quartz kindle
#

a vps is much cheaper than the electricity bill for leaving your computer on 24/7

formal agate
#

google firebase maybe

serene sun
#

true

vernal rivet
#

I need money, lol, I am only 17, with no job

formal agate
#

my server rn costs less then a vps

earnest phoenix
#

then get job @vernal rivet

formal agate
#

and its a self host

earnest phoenix
#

easy

formal agate
#

hard in us

rich sail
#

ok i need help

#

why says me handleVideo is not a function

earnest phoenix
#

or ask your mother for money

formal agate
#

lol

quartz kindle
#

ask your parents for a credit card and sign up at google GCE. its free for like, ever, and you only need the credit card to sign up. explain that to your parents, that its for your education and its free

vernal rivet
#

Because you made it into a function when it cant

earnest phoenix
#

i mean

serene sun
#

@quartz kindle can you give a small explanation as to how to use a vps. I feel overwhelmed when looking at vultr. Like server startup and ssh keys.

earnest phoenix
#

tim is right

rich sail
#

@vernal rivet wdym

sick cloud
#

its easy

vernal rivet
#

HandleVideo is a method, not a function

sick cloud
#

@quartz kindle does it really

rich sail
#

handleVideo file is this:

async function handleVideo(video, msg, voiceChannel, playlist = false) {
  const queue = new Map();
    const serverQueue = queue.get(msg.guild.id);
  const play = require('./events/play.js')
    console.log(video);
    const song = {
        id: video.id,
        title: video.title,
        url: `https://www.youtube.com/watch?v=${video.id}`
    };
    if (!serverQueue) {
        const queueConstruct = {
            textChannel: msg.channel,
            voiceChannel: voiceChannel,
            connection: null,
            songs: [],
            volume: 5,
            playing: true
        }
// rest of code hidden...
sick cloud
#

link me

serene sun
#

or is gce a better option?

rich sail
#

@vernal rivet check the message

quartz kindle
#

@serene sun basically when you sign up you will be given ssh access to a remote machine running whatever operating system you set it to (linux prefered), and you can access it instantly from their online admin panel

formal agate
#

@serene sun google firebase

#

use it

vernal rivet
#

Going off of crawl I see

quartz kindle
#

later on you can configure an ssh key to access it from an ssh program instead of using the admin panel

serene sun
#

hmm, cool, someone told me to use ubuntu.

quartz kindle
#

yeah i use ubuntu as well

rich sail
#

@vernal rivet yes, hlep me

serene sun
#

i might try out gce now that you say it @quartz kindle

quartz kindle
#

do that, you wont regret it

#

i've been using it for almost a year

serene sun
#

awesome, thank you so much

quartz kindle
#

when creating a compute engine instance, select the F1-micro, thats the one thats free

serene sun
#

now to just see if i can use my moms credit card lmfao

quartz kindle
#

tell her that you need it to study programming

#

and that programmers make good money

#

although they dont get girlfriends

vernal rivet
#

Is gce better than AWS?

quartz kindle
#

gce is free for longer than aws

#

other than that idk

#

gce is 600mb ram

vernal rivet
#

Ok

earnest phoenix
#

just let her know that if she does this she'll won't have to live in a retirement home

quartz kindle
#

how much ram is aws?

vernal rivet
#

Idk

#

I am not home

earnest phoenix
#

but like

#

couldn't you just

#

look it up

vernal rivet
#

Umm not when your almost home and it's cold outside

earnest phoenix
#

but like

#

it's google

quartz kindle
#

aws its 1gb i think

#

750 hours of Amazon EC2 Linux or RHEL or SLES t2.micro instance usage (1 GiB of memory and 32-bit and 64-bit platform support) – enough hours to run continuously each month*

vernal rivet
#

Is that going to be a better option, before asking if I can use a credit, and then regret that their was a better deal then what I paid for

high anchor
#

@formal agate it just suddenly occured to me. It’s .isMentioned(id)

#

Yeah

#

Yeah i think that’s right

formal agate
#

@high anchor tried that

quartz kindle
#

just go 1 year free on amazon then go 1 year free on google

#

then create a new account

#

lmao

high anchor
#

@formal agate oh?

formal agate
#

does not work in the way im using

#

Tried let prefix = [setting.prefix, message.client.users.get(mention.id === "506900253765795842")]; and got ```let prefix = [setting.prefix, message.client.users.get(mention.id === "506900253765795842")];
^

ReferenceError: mention is not defined```

vernal rivet
#

Ok, thanks

high anchor
#

Is this in your on message event listener

formal agate
#

im trying to have more then 1 prefix

#

yes

#

it was all working

high anchor
formal agate
#

untill i changed that

high anchor
#

Not the “mention id” whatever that is?

formal agate
#

it does nothing

#

no errors

high anchor
#

You want the bot’s mention as a prefix yes?

formal agate
#

yes

high anchor
#

Or client.user.if

#

id

formal agate
#

like @merry saffronsasasdf

high anchor
#

don’t remember which

quartz kindle
#

or just hardcode it lol

high anchor
#

try using client.author or client.member

#

Not memver

#

user

sick cloud
#

whitenames failing at discord.js is awesome to watch

slim heart
#

what do you think the best way of making regional indicator emojis into letters recognized by the bot?

high anchor
#

@sick cloud ok buddy

quartz kindle
#

[setting.prefix, "@primal swan","<!@506900253765795842>"]

formal agate
#

ok

sick cloud
#

thats what i do

#

hardcoding 👌

formal agate
#

ill try that

high anchor
#

Lmao

#

Ok bub

formal agate
#

but i did something similar and it did not work

#

which is why i tried this

formal agate
#

didn't work for me

high anchor
#

lol

west raptor
formal agate
#

i tried the whole internet before i came here lol

west raptor
#

(X) doubt

high anchor
#

dude

quartz kindle
#

whole internet

#

thats like

formal agate
#

ended up on german vids

high anchor
#

It’s a bult in method

formal agate
#

and yes its sarcasm

quartz kindle
#

500EB of data lmao

slim heart
#

the dark web too GWqlabsThinkPlant

vernal rivet
#

Lol, which I can translate

formal agate
#

👁

slim heart
#

👀

vernal rivet
#

👀

slim heart
formal agate
#

reeeeeeeeee

slim heart
#

alright anyways

vernal rivet
#

So confuzzled

slim heart
#

anyone got any idea for my question?

high anchor
#

msg.isMentioned(client.user) @formal agate

#

There

quartz kindle
#

what was your question?

high anchor
#

That’s literally it

formal agate
#

ok @high anchor

slim heart
#

what do you think the best way of making regional indicator emojis into letters recognized by the bot?

quartz kindle
#

what do you mean? like for emoji buttons?

high anchor
#

Map it, hardcode it like these geniuses would suggest. Or just find a module

slim heart
#

no like say if i say 🇯 it'll be changed into j

formal agate
#

ok, i think its just me. Nothing is working

vernal rivet
#

You can make a huge list of it

high anchor
#

@formal agate nobody knows what your code is like bro, bugfix it yourself

inner jewel
#

make a lookup table

west raptor
#

show ur code atleast

slim heart
#

y e a

formal agate
#

im trying

west raptor
#

like

formal agate
#

maybe its the handler

quartz kindle
#

what if you write the literal unicode? \🇯

west raptor
#

w h a t

slim heart
#

i mean i could probably

inner jewel
#
const lookup = {
    "<regional indicator>": "letter"
};```
slim heart
#

i think i did that before when my entire thing was just .match()

inner jewel
#

for 1⃣ to 9⃣, it's the first character

high anchor
#

ES6 recognizes all emojis dude, it won’t be a problem at all to map it pairwise

slim heart
#

like i can copy the regional indicator from online and i think it'd switch

inner jewel
#

1⃣ == 1<box character>

formal agate
#
    let prefix = [setting.prefix, "@primal swan", "<!@506900253765795842>"];

    if (!message.content.startsWith(prefix)) return;
    if (message.author.bot) return;

    var cont = message.content.slice(prefix.length).split(" "); //slices off the prefix, then puts it in a array
    var args = cont.slice(1); //everything after the command in a array

    var cmds = client.commands.get(cont[0]); //tries to grab the command called
    if (cmds) {
      cmds.run(client, message, args, setting); //checks if command is real, if so it runs said command
    };
});```
inner jewel
#

but letters are a bit different

#

so rip

quartz kindle
#

if you copy the correct one it wont change

west raptor
#

omg

quartz kindle
#

startsWith doesnt accept an array

#

afaik

west raptor
#

^

slim heart
#

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

#

yea

#

i'd say for loop but probably a better way of doing it

quartz kindle
#

you would need to use startsWith with each item of the array individually

inner jewel
#

prefixes.find(p => message.content.startsWith(p))

quartz kindle
#

hax

formal agate
#

what is p?

slim heart
#

the thingy

#

each part of the array

#

yeah

#

im smart

#

the thingy

west raptor
#

lol

inner jewel
#

the name of the first argument of the closure you pass to prefixes.find

high anchor
#

p is just the param in the anonymous function

slim heart
#

thingy*

high anchor
#

literally irrelevant

#

is string .find async?

formal agate
#

yes, but where would it go?

slim heart
#

do you think i could do the regional indicator match thing in my accent removal?

high anchor
#

wdym

formal agate
#

in the runner itself or just about in the event

high anchor
#

w

quartz kindle
#

literally unplayable

high anchor
#

it's the same as passing in function(p)

slim heart
#
client.RemoveAccents = (str) => {
          var accents = "$ÀÁÂÃÄÅĄ";
          var accentsOut = "sAAAAAAA";
          str = str.split('');
          var strLen = str.length;
          var i, x;
          for (i = 0; i < strLen; i++) {
              if ((x = accents.indexOf(str[i])) != -1) {
                  str[i] = accentsOut[x];
              }
          }
          return str.join('');
        };```
this is not all the accents but just an example
#

do you think i could put the regional indicator like unicode actual emojis in it then put an output for it?

earnest phoenix
#

u like removing accents

#

oh hey cmon $ is not allowed 😂

slim heart
#

it is allowed

#

it just swaps it to "s"

earnest phoenix
#

bs

#

i have s23

#

$23

slim heart
#

$hit

quartz kindle
#

if you want to match regional indicators i dont think that will work because of how discord converts them

earnest phoenix
#

.

inner jewel
#

discord just sends the raw unicode

west raptor
#

he is making a swear filter @earnest phoenix

high anchor
#

Discord just passes it in as unicde

quartz kindle
#

does it?

slim heart
#

yeah

inner jewel
#

yes

earnest phoenix
#

boi then list it

#

;/

high anchor
#

Yeah
there's no reason not to, it's in es6

quartz kindle
#

then it should work

inner jewel
#

well

earnest phoenix
#

anyone here knows how to die?

#

cause i do

inner jewel
#

not sure about how they're accessed

slim heart
#

i mean for some reason if you send it again itll be <:emoji:id> but still

inner jewel
#

because emojis are multiple characters

high anchor
#

That's only for custom emotes

#

on servers

#

the global emojis just go in as unicode

earnest phoenix
#

totally unrelated, anyways anyone here can help me with a settings command?

slim heart
#

oh ye

inner jewel
#

so a lookup like that is probably going to break

earnest phoenix
inner jewel
#

a lookup table would be a safer approach

high anchor
#

and in your code you can just use their visual equivalent

slim heart
#

im pertty sure regional indicators i one characs but yeah ill do the lookup i guess

high anchor
#

yeah if you want it sanitized

slim heart
#

pertty

inner jewel
#

discord replaces :name: with the unicode on messages

#

but not on reactions

#

just fyi

#

so to play safe the raw unicode is better

high anchor
#

huh

slim heart
#

so how would i even use the lookup thing

high anchor
#

.charCodeAt(0).toString() would convert it yeah

inner jewel
#
const lookup = {
    "Ăą": "a"
};```
earnest phoenix
#

how can i make it to where it returns after scanning a guild id.

#

cause me bot gonna get muted for leveling ;p

high anchor
#

returns what
where

#

??

inner jewel
#

then for each character in the string, if(lookup[string[i]] !== undefined) string[i] = lookup[string[i]]

bright spear
#

leveling should always be disabled by default @earnest phoenix

#

you should make an admin enable it

earnest phoenix
#

Yeah I need help making a settings command

#

and every person ive asked for help became toxic

bright spear
#

nobody is gonna help you make a command lol

high anchor
bright spear
#

if you have a specific question you can ask

#

if you just want to make a command look up tutorials and docs

#

but dont ask anyone to help you make a command

#

since thats just annoying

high anchor
#

how many of you guys started learning NodeJS or even programming at all by trying to make a discord bot?

bright spear
#

me

high anchor
#

nice

earnest phoenix
#

i learned node, but not js, through making a discord bot

bright spear
#

i learned js

earnest phoenix
#

i learned my first programming lang (js) through a book from 2005

#

quality, up-to-date sourcesℱ

bright spear
#

so the rest of us in this server were babies

high anchor
#

I learned my first Javascript off of w3schools in middle school