#development

1 messages · Page 1097 of 1

pure lion
#

thats fucking weird asdklgfjioklagh;diofhgioaqf

solemn latch
#

Then yeah, I see zero issue with a global filter

pure lion
#

i just want to keel over and die

solemn latch
#

I feel that

pure lion
#

but also finish my dashboard ;)

left lake
#

covers a small avenue of words, very simple ones

solemn latch
#

Toothache, I've not been eating like at all

pure lion
#

i want to d r oopooow wwwn inj my shitty code

left lake
#

i might get a dashboard for my bot but tbh i can give 2 shits about it rn

lusty quest
#

its simple take a break. take a walk, and look at the issue again, this is how i fixed some of my stuff

left lake
#

too small and too little configurable settings for me to bother, not to mention i'd have to add so much more code to make it more in-depth

pure lion
#

idk how to even approach this

#

LMAO ALL I WANT TO DO IS MAP VALUES

faint prism
#

Why do i see this in production code :(
if (flag == false)

crimson vapor
#

is sending to a channel every X hours api abuse? it is right?

left lake
#

no

pure lion
#

if its disableable then no

left lake
#

if you're sending one message to a channel every hour then no

crimson vapor
#

k

left lake
#

just as dice said if its something that can be used for alot of guilds make sure its an option

#

and its disabled by default

pure lion
#

also dice says fuck please help me :(((((((

crimson vapor
#

its going to be something you can enable and set the hours

left lake
#

yeah then that'd be fine

pure lion
#

oh im an absolute retard........

cinder patio
#

maybe if you ask we'll help you

left lake
#

since api requests are by minute i believe so

pure lion
#

:))))))))))))))))))))))))))))))))))))))))))

#

maybe if you ask we'll help you
it didnt work last time

cinder patio
#

maybe the people who could help you didn't see the question last time

lusty quest
#

did someone got an idea how to properly debug canvas renderer? for some reason i dont get any image

pure lion
#

ok it logs the info

cunning gorge
#

Hey can someone help?

  const pages = {
    1: { title: ':one:', description: 'This is page one!' },
    2: { title: ':two:', description: 'This is page two!' },
    3: { title: ':three:', description: 'This is page three!' }
  }

I tried console logging:
console.log(pages.length) but it returns undefined, what should I be doing to find the length? Please ping me if you have a solution.

faint prism
#

Idk js, but should there be a 1: 2: 3: before object data?

cunning gorge
#

idk, i saw an example that used it

faint prism
#

It should know how to index itself

#

Try removing that bit

cunning gorge
#

okayy

#

@faint prism

  const pages = [
    { title: ':one:', description: 'This is page one!' },
    { title: ':two:', description: 'This is page two!' },
    { title: ':three:', description: 'This is page three!' }
  ];

is this valid?

#

with the []

#

and {} inside

tight plinth
#

it shoukd work theoretically

faint prism
#

Looks like an array of anonymous objects to me

cunning gorge
#

okayy

#

wdym by anonymous

#

in that context

#

Do you mean it wont work? or its fine

tight plinth
#

meh who cares its just an array

faint prism
#

Looks fine, but idk Javascript.
An anonymous object is the instantiation of a type without a class. Like what you're doing. Its inferred from the context.

cunning gorge
#

okayy

faint prism
#

actually, looks like JS calls them Object Literals

lusty quest
#
 const attachment = new Discord.MessageAttachment(image, "image.png");
               let embed = new Discord.MessageEmbed();
               embed.attachFiles([attachment]);
               embed.setTitle(data.title);
               embed.setImage("attachment://image.png");
               embed.setColor("RANDOM");
              
               await message.edit(embed);
```any idea why i cant edit the embed and add a image?. the image is rendered by canvas (tested it with just a normal message.channel.send(attachment) and there was the expected output)
cunning gorge
#
    const collector = msg.createReactionCollector(filter, { time: 60 * 1000 })
    collector.on('collect', async (r) => {
      if (r.emoji.name === '⬅️') {

        if (page != min) {
          page = page - 1;
          await msg.edit({ embed: pages[page] });
        }

      } else if (r.emoji.name === '➡️') {

        if (page != max) {
          page = page + 1;
          await msg.edit({ embed: pages[page] });
        }

      }
    })
    collector.on('end', async (collected) => {
      console.log("ended")
    })
  });
}

anyone know how I can remove the reactions from the author after they react?

cinder patio
#

r.remove()

delicate shore
#

yo @lusty quest how many servers u gained by bidding

faint prism
#

That's an interesting concept

cinder patio
#

That removes all users though, I don't think you can just remove one user

lusty quest
#

last week around 80 @delicate shore

delicate shore
#

alr

#

and in

#

total?

lusty quest
#

80

delicate shore
#

total

lusty quest
#

maybe 90

delicate shore
#

your bot

#

total guilds

cunning gorge
#

like that

lusty quest
#

205 i think

delicate shore
#

because i dunno if this is normal

cunning gorge
#

actually

delicate shore
#

my bot gained 200+ guilds

#

in one single

#

day

lusty quest
#

rip

delicate shore
#

it is now in 301

cunning gorge
#

r.remove("⬅️")?

delicate shore
#

why rip?

cunning gorge
#

for each reaction

#

or am i using that wrong

delicate shore
#

rip
@lusty quest why rip tho?

cinder patio
#

No, just r.remove()

faint prism
#

What's your server load at? @delicate shore

lusty quest
#

my bot is way to niche to gain large amounts of guilds

delicate shore
#

niche?

#

sorry i am not good at english

#

what does that mean

faint prism
#

Specific to a type of group of people

delicate shore
#

op

faint prism
#

denoting or relating to products, services, or interests that appeal to a small, specialized section of the population.

delicate shore
#

ok

pure lion
#

can i filter an array by an array?

delicate shore
#

:pepehmm:

faint prism
#

nested for loop time

pure lion
#

o h n o

#

how'd i structure that

delicate shore
#

@pure lion as i said

#

300 guilds

#

🥳

pure lion
#

:DDDDDDDDDDDDDDDDDDDDDDDDDDDD

#

@faint prism do you know if i should filter front by back or back by front?

delicate shore
#

:hmm:

faint prism
#

Does it matter?

pure lion
#

not sure

faint prism
#

@delicate shore
But how is your server holding up?

pure lion
#

also h o w

delicate shore
#

@delicate shore
But how is your server holding up?
@faint prism wym

#

my hosting?

faint prism
#

ye

pure lion
#

But how is your server holding up?
its complicated (blocked)

delicate shore
#

i am gonna shift to ditial ocean inn 3 weeks

#

currently it's on glitch

#

10$/month

#

then it will be 5

#

dollar or some

faint prism
#

Guess it's hard to tell with Glitch the performance of the bot under load?

cunning gorge
#

No, just r.remove()
@cinder patio
It removes the bot reaction as well, anyway to filter this out?

cinder patio
#

Yeah you can actually

cunning gorge
#

oo awesome

cinder patio
#

r.users.remove(userToRemove) where userToRemove is a User object

cunning gorge
#

id?

cinder patio
#

can be a user id, yea

cunning gorge
#

oo okayy

cinder patio
#

you can also do message.author

cunning gorge
#

gotcha thx

lusty quest
#

i dont get it. i can send the Rendered image as normal message but cant attach it to a embed

pure lion
#

tehfuck

lusty quest
#

(idk if it is even possible to attach images to embed that i edit)

finite bough
#

i think it is

faint prism
#

Should I be using an embed for my bot replies?

solemn latch
#

embeds give you more options for what you can do

still merlin
#

How do you get a users name, Not in a mention and not a nickname, And no tag included

#

in discord.js

solemn latch
#

like from an id?

earnest phoenix
#

you cannot edit a message with a new attachment, however you can send an attachment with an embed

faint prism
#

User.Username.Split("#")[0] ?

cinder patio
#

<User>.username should return just the username, without anything else

faint prism
#

Are you use it doesn't include the descriminator?

cinder patio
#

yes

faint prism
earnest phoenix
#

ToString isn't the same as the respective properties for the username and discriminator

faint prism
#

right, but their have it overridden

earnest phoenix
#

ToStringing and then splitting is slower than just directly using the props

faint prism
#

Definitely

#

I'm not using their tostring on the object anyways

cinder patio
#

in discord.js, toStringing also returns the mention string (<@id> ), not the username and tag afaik

faint prism
#

That's weird

#

I guess it's the framework dev's personal preference

#

Also, why is it that sometimes mentions have <@!id> instead of just <@id>

earnest phoenix
#

used to be

#

ages ago

thin sonnet
#

Hey. I forgot to make it so that an activity shows the amount of servers the bot is in (discord.js)

earnest phoenix
#

now it's just legacy behaviour

faint prism
#

@earnest phoenix Thank you!

thin sonnet
#

Do you know how I can make the bot have an activity like ServerCount Servers?

pure lion
#

:l

solemn latch
#

depends on the lib

pure lion
#

guilds.size or something to that effect

thin sonnet
#

I tried that and it said Undefined.

earnest phoenix
#

in v12 all cached entities have been moved to cache managers

pure lion
#

:l

earnest phoenix
#

in a .cache property

#

that

thin sonnet
#

Thanks.

restive furnace
solemn latch
#

oh, you said djs 🤔

thin sonnet
#

Now it's not updating when I invite it.

faint prism
#

I guess I shouldn't be doing this then

                userQuery = userQuery.Replace("<@", "<@!");```
Ugh, I had it backwards
solemn latch
#

you have to update it every time a new guild is joined, or over an interval

thin sonnet
#

How do I do an interval?

solemn latch
thin sonnet
#

I don't understand...

#

Sorry. I'm kinda new to discord.js

earnest phoenix
#

that's unrelated to djs

#

read the doc link you got sent

#

it tells you the args you need to pass

thin sonnet
#

ok

#

Btw do you know any good hosting servers. I use heroku mostly.

earnest phoenix
#

check pins

solemn latch
#

i like galaxygate, but digitial ocean is a good well known option aswell

#

but yeah, also pins

dapper ocean
#

Has anybody used lavalink? I know a lot of people using ffmpeg, but I don’t like it much. The main problem is that I don’t want to run the bot locally, I use Heroku with it, but I am so confused about these pow.xml etc. Who could help me deploy a music bot with lavalink on hosting?

pure lion
#
  1. dont reccomend heroku
solemn latch
#

heroku is known for being bad for hosting music bots

dapper ocean
#

I don’t other options

earnest phoenix
#

heroku isn't powerful enough for a music bot ^^^

thin sonnet
#

Oh

dapper ocean
#

What are best free hostings? (I don’t talk about raspberry etc)

pure lion
#

lOl JajAJajJa

thin sonnet
#

I need free online hostings with Github maybe?

earnest phoenix
#

there are none

dapper ocean
#

Well lol

#

I know Heroku doesn’t support ffmpeg

earnest phoenix
#

pay for resources you want to use if you want something reliable and strong

dapper ocean
#

But it supports lavalink

thin sonnet
#

I got no $$$

dapper ocean
#

Who knows lavalink?

earnest phoenix
#

sucks to be you i guess

#

you're expecting too much from free hardware

#

which already isn't meant for bots in the first place

dapper ocean
#

Em

pure lion
#

my host is pretty kickass but its limited in that it can only bot

#

and i cant access it like a server

dapper ocean
#

But there a lot of my friends bots hosted on Heroku with music

pure lion
#

or through the console

#

kirya check dms

dapper ocean
#

They said they use lavalink

earnest phoenix
#

and they havent stress tested it 🤡

#

have >=10 guilds streaming concurrently and your bot will begin to choke

dapper ocean
#

Who knows what is pow.xml?

sudden geyser
#

You mean pom.xml? Did you search it up?

faint prism
#

It's for maven projects, isn't it?

earnest phoenix
#

correct

#

i have no idea what they want with it if they want to use lavalink since lavalink is a drag and drop jar lol

#

probably a client lib for lavalink

restive willow
#

my bot just suddenly stopped running

#

discord.errors.LoginFailure: Improper token has been passed.

pure lion
#

Uh oh

grand dagger
#

Pow.xml

restive willow
#

i regenerated token and updated it, and it still won't start

karmic compass
#

@restive willow is your token out on github/anywhere it could be seen publicly? if so discord automatically regenerates the token for you

faint prism
#

Oh nice! That's pretty cool

restive willow
#

no, its not

faint prism
#

Yes it is. You don't want a security breach like that

#

Someone could impersonate your bot

solemn latch
#

he was saying no its not leaked

faint prism
#

Well, that's good then lol

#

Make sure it doesn't appear in your commit history either

restive willow
#

discord.py:

discord.ext.commands.errors.NoEntryPointError: Extension 'management' has no 'setup' function.
#

any ideas

vast glacier
#

JavaScript

How can i make a fetch message in a private message???
Like:
client.channel.get("id").fetchMessage("id");
but DM

restive furnace
#

discord.py:

discord.ext.commands.errors.NoEntryPointError: Extension 'management' has no 'setup' function.

error.

#

read the error.

restive willow
#

it has a setup function

restive furnace
#

well, check it is the right extension

restive willow
#

????

earnest phoenix
#

doesnt seem like you did

restive furnace
#

the error clearly says you havent.

cinder patio
#

Are you sure you've installed it? Go to your package.json and see if "express" is listed in the dependencies

#

Probably glitches fault

restive furnace
#

run npm install

crystal stream
#

Hello

#

Can someone help me plz

solemn latch
#

inorganically grown means a couple users with a lot of servers with your bot

restive furnace
#

tl;dr: waet few months

solemn latch
#

inorganically isnt the one you wait for

#

suspicious growth you can wait out

#

inorganic you must have servers with unique owners for

restive furnace
#

well basically, you need to wait for that too, the time depends how many different discord servers with unique owners adds the bot into their server.

crystal stream
#

Can you tell me how to solve this?

solemn latch
#

resubmit when you have organic growth

crystal stream
#

:c

#

const smallGuilds = bot.guilds.filter(g => g.memberCount < 3).map(g => g.name).join("\n");

#

@regal garnet

#

Leave them :c

#

How

#

<

misty sigil
#

why

#

tho

#

guild is guild angrybirb

solemn latch
#

for now, you really dont have to leave them, just wait till you have more organic servers and resubmit.

in the future there will be a cap before you get verified, so leaving inorganic servers will be required

#

to get organic servers

crystal stream
#

Oh, okey...

#

Thz :з

restive furnace
#

some bots have been doing that past 3 years what i know WeSmart

misty sigil
#

for me: guild = guild

#

doesn't matter tbh

solemn latch
#

even if one server owner created all 75 servers

#

🤔

misty sigil
#

no

#

that'd get servers they own blacklisted

crystal stream
#

:c

restive willow
#

@slender thistle

sorry for the ping, but I need some help semi-urgently:

I'm using discord.py. earlier, my bot suddenly turned off, and now I'm getting discord.errors.LoginFailure: Improper token has been passed.. I've tried regenerating my token and updating the file, to no avail. my test bot still runs just fine (it uses the same code, just diff token), so I'm not sure what's up rn

any + all help appreciated

restive furnace
#

add a limit if one person adds the bot in more than 5 servers, the bot leaves from the newest ones.

#

(replying to the last chat)

slender thistle
#

Are you sure you weren't API banned for excessively hitting the ratelimits?

restive willow
#

how would i find out if i am

slender thistle
#

Now that's a question I don't know an answer to

solemn latch
#

youd be getting 429's right?

slender thistle
#

You could try again in an hour blobshrug

#

API banned as in getting a lot of 401/403s

#

and iirc 429s also count

earnest phoenix
#

correct however they would get a 429 on an api ban

#

why not just log your token to see if it's being read correctly in the first place

restive willow
#

The above exception was the direct cause of the following exception:

discord.errors.LoginFailure: Improper token has been passed.```
and then i get
```RuntimeError: Event loop is closed```
earnest phoenix
restive willow
#

i think if the bot was running fine before it wouldnt randomly stop working for that reason

#

@earnest phoenix

earnest phoenix
#

log your token

restive willow
#

🙃

faint prism
#

Breakpoint on that line or log to see what your token is. Make sure it's correct.
If it's empty, you're setting it incorrectly. If it's there, you messed up somewhere else

feral aspen
#

Hello Devs

#

So I have a new system which is a premium feature system, where people purchase my premium using patreon and it gives them the role

#

But I have a problem with it

#

I usually use this as my command where if someone doesn't have premium role on my server, it will return

#
    .setTitle('Premium Error')
    .setDescription("This command can only be accessible in the Attitude Support Server.")
    .setColor(colors.cyan)
    .setFooter(`Created by HamoodiHajjiri#3886!`, bot.user.displayAvatarURL())
    .setTimestamp();

    if(message.guild.id != "721372685275234436") return message.channel.send(embedPErrorOne)

    let embedPErrorTwo = new Discord.MessageEmbed()
    .setTitle('Premium Error')
    .setDescription("It looks like you cannot access this command because you don't have premium. If you are willing to purchase premium, click [here](https://www.patreon.com/join/attitudepremium).")
    .setColor(colors.cyan)
    .setFooter(`Created by HamoodiHajjiri#3886!`, bot.user.displayAvatarURL())
    .setTimestamp();

    if(message.guild.id = "721372685275234436"){
        if(!message.member.roles.cache.has("736643325863395331")){
            return message.channel.send(embedPErrorTwo)
}
}```
#

But when someone uses the premium command on another server, it will start saying cannot read property 'id' of null

#

or something like that

sly dawn
#

-botinfo @velvet cypress

gilded plankBOT
#
Bot info
ID

658301705531949077

Username

Dick Kicker

Discriminator

7248

Short Description

Kick 'em in the dick! Stats, leaderboard, memes, and more.

Library

discord.js

Prefix

^ (customizable)

Total Upvotes

1982

Monthly Upvotes

338

Server Count

1454 Servers

Owner(s)

@desert swift
@snow ferry

feral aspen
#

Uhm,

sly dawn
#

Wait where is bot commands?

feral aspen
solemn latch
sly dawn
#

Oh sorry

#

I didn't knew

feral aspen
#

Its ok

#

Can someone help me?

solemn latch
#

what line is the error happening on

feral aspen
#

I added if(message.guild.id != "721372685275234436") return message.channel.send(embedPErrorOne)

#

what line is the error happening on
@solemn latch I explained above, re-read

solemn latch
#

🤔 i dont see where you say what line the error happens on

cinder patio
#

There are a few problems with the code Hamood. First off, are you ignoring DM messages? If a user tries the command in DMs message.guild will be null and it will error. Also, in the second if statement, you are assigning message.guild.id = "721372685275234436", not comparing the IDs (===)

feral aspen
#

Oh

#

So what do I do, do I compare?

#

do I add ===? and remove the if(message.guild.id != "721372685275234436") return message.channel.send(embedPErrorOne)???

cinder patio
#

Yes but I don't think the error is coming from there, but it is a problem

feral aspen
#

Let me explain deep

#

My bot's premium commands wont work if it was on another server, so I added if(message.guild.id != "721372685275234436") return message.channel.send(embedPErrorOne) to stop the problem for now

cinder patio
#

The general logic is kinda confusing, you should do:

if (message.channel.type === "dm") return; // Ignores DMs
if(message.guild.id != "721372685275234436") {
   // This code will execute if the server isn't "Attitude Support Server"
} else {
   // This code will execute if it is in the Attitude Support Server
}
feral aspen
#

Hm..

#

Okay, can I test it and come back?

#

And No, my bot never answers dms.

#

And you missed a part above @cinder patio , its that if the user does not have the premium role, he wont be able to access the command.

pure lion
#

suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuup

feral aspen
#

uhok

cinder patio
#

well I just included the code you showed us

feral aspen
#

Google, can you go dms?

cinder patio
#

I can't if you have any further questions ask them here

feral aspen
#

Ahh, no body understood me sadly, but did help me a bit.

#

Ill restart my explanation

cinder patio
#

I did understand you, and if you use the code snippet I gave you there should be no more errors.

pure lion
#

so right now my dashboard gets all of the guilds but i just want to get the ones that the user is in, not everything on the db

cinder patio
#

Ignore DM messages and compare the IDs instead of reassigning message.guild.id

#

Dice, if you are using oauth2 to autherize the user you can request all the guilds they're in

feral aspen
#

Hey, So I have a new system which is a premium feature system, where people purchase my premium using patreon and it gives them the Premium Role.
But I have a problem with it, when someone has the premium role and uses the command outside of the Attitude Support server, it will run an error stating cannot read property 'id' of null
I didn't know what to do, so I decided to put a solution for now and ask the solution for it later, I putted this solution for now,

        if(!message.member.roles.cache.has("736643325863395331")){
            return message.channel.send(embedPErrorTwo)
}
}```
My question is, someone has premium role on my support server, and when he uses the command outside the support server, it will error, how to fix?
pure lion
#

ikr

cinder patio
#

Okay... then do that

earnest phoenix
#

whatever I try to do on my vps

pure lion
#

google lemme explain more

earnest phoenix
#

how i can do the command skip in 12v?

#

it just says

#

EROFS: read-only file system, open '/root/.pm2/pm2.log'

solemn latch
#

what line is the error happening @feral aspen

pure lion
#

oh hey woo

earnest phoenix
#

I upgraded my plan and then this happened ^

feral aspen
#

what line is the error happening @feral aspen
@solemn latch no line @solemn latch

#

its general

solemn latch
#

errors come with line numbers

#

so

feral aspen
#

It just errors when someone has premium role on my support server, and when he uses the command outside the support server

solemn latch
#

okay i understand that

#

which line is erroring

#

or just give the entire error

earnest phoenix
#

I'm logged in as @rooton my vps (ubuntu) and i seem to lack permissions somehow

#

srry for ping

pure lion
#

okay i have a mongoose database that stores guild settings. i want to list all the guilds a user is in with the prefix next to them. i have managed to do this for every guild on the DB, but i want to somehow filter out the guilds that the user isnt in

earnest phoenix
#

can somebody help me

solemn latch
#

you have the user.guilds via oauth right @pure lion ?

#

you can ask for vps host for help @earnest phoenix
every vps host does things slightly differently

pure lion
#

yeah

#

i do indeed

feral aspen
#

Whats the solution, what should I add or remove?

earnest phoenix
#

i need to grand the root user all the permissions but dont know how to do so

#

that seems to be the problem

solemn latch
#

user.guilds.forEach
and the foreach push each guild into an array, after grabbing the data you need.
any null, just ignore

pure lion
#

how ignore null? thats what i was doing in the first place too lmao

#

fuck if i seriously wasted my day on this

#

and if this works

#

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

solemn latch
#

if(thingthatwouldbenull){ code that executes if its not null }

pure lion
#

ok expicsc

solemn latch
#

you might need to if(variable != null) it

crimson vapor
#

or if(!variable) { }

crystal socket
#

if variable is not null works as well

crystal socket
#

it can't be comapred

solemn latch
#

this is more complex than originally anticipated

crystal socket
#

wait let me check

#

thats from the node terminal

pure lion
#

oh no

solemn latch
#

what happens if you
if(null){}

hardy steeple
#

I make my bot with visual studio code and everytime i close it, the bot goes offline

#

is there any way to fix this

pure lion
#
            guilds.forEach(g => {

                if (await Guild.findOne({guildID:g.id}) !== null) console.log

            })

ehhh?

crystal socket
#

yes buy a vps @hardy steeple

solemn latch
#

bots require servers to run 24/7

hardy steeple
#

okay

crystal socket
#

they don't cost much

#

and its powerful, up to about 2.5k servers

hardy steeple
#

ill think about it

solemn latch
hardy steeple
#

thank you for telling me though

solemn latch
#

makes sense

crystal socket
#

nice

#

node is nice

#

and thats why i make bots on cpp or rust

pure lion
#

@solemn latch is the thing i put valid?

solemn latch
#

i believe so

pure lion
#

ok ill check brb

robust arrow
#

is there a way to store arguments in .json files, the bot im planning will only be in 1 server

solemn latch
#

store arguments from run commands?

robust arrow
#

yeah like

#

for example warn reasons

solemn latch
#

generally speaking, json databases are terrible and should be avoided.

misty sigil
#

no

#

json db bad

solemn latch
#

a proper database would be a bunch more reliable

cloud pebble
#

ok so i did nothing but restart my bot, it comes online and starts the on_ready function but won't respond to any commands now

misty sigil
#

get like a mongo

faint prism
#

if it's actually null, wouldn't it throw a null exception?

robust arrow
#

yeh but still it's only for 1 server

misty sigil
#

JSON BAD (for database)

faint prism
#

Its okay if you have an SSD tho

misty sigil
#

everyone here will HIGHLY urge you to use mongodb

#

or something similar

robust arrow
#

jeremu shut u-

solemn latch
#

if you dont care about the data at all, and dont mind the occasional data corruption, sure you can use a json db

robust arrow
#

ok

faint prism
#

I just serialize a repository

pure lion
#

USE MONGOOSE DIPSHIT

faint prism
#

But I can swap it out EZ if I migrate

crystal socket
#

json is bad

#

use redis

honest perch
#

js is about to kill me

crystal socket
#

or any database

#

@honest perch switch to dpy, serenity, or rust

#

so much better than js

robust arrow
#

databases are cool and all, but i wouldn't spend so much time on 1 server

honest perch
#

@crystal socket i need to make a js module

#

dumb dumb

crystal socket
#

databases take like 5 seconds to set up

#

they are hard for beginners tho

faint prism
#
public static class Factory
{
  public static IUserRecordsContext GetUserRecordsContext()
        {
            return new JsonUserRecordsContext(GetLogger());
        }
robust arrow
#

I tried to setup a database, the password wouldn't register :DDD

crystal socket
#

i mean

pure lion
#

Omg I'm so smart I made a big brain move

crystal socket
#

its apt-get install redis and then nohup redis-server &

pure lion
#

Nvm it doesn't work

crystal socket
#

thats it

#

two commands

hardy steeple
#

is discord.js a bad program to code a bot

solemn latch
#

nah, lots of bots use it.
it just caches too much

faint prism
hardy steeple
#

ok thats what i thought

crystal socket
#

and i mean js isn't the bestttt

#

but its okay

slender thistle
#

In terms of performance, it's not the best

crystal socket
#

hi shiv <3

earnest phoenix
hardy steeple
#

what would you say is the best

earnest phoenix
#

def would recommend c# though 👀

faint prism
#

It's not the best, but it gives me enough data to do my own code

hardy steeple
#

personally i like js more because im just more familiar with it

#

which i now realize is a bad reason

honest perch
#

ima take a look at rust because js is going to kill me

crystal socket
#

or aegis.cpp

faint prism
#

It's slower than C#, but meh JS for discord bots has a bigger community

earnest phoenix
#

disqord is my current favourite due to performance advantages, dsp allows you to be more open with your code (since discord.net only allows entity related methods on instance of entities instead of allowing you to just use the id)

#

so i suggest you definitely check those libs out

crystal socket
solemn latch
#

djs-light

#

🤔

faint prism
#

I'm not using the entity framework

hardy steeple
#

i might work on a new bot project

#

im not sure tho im quite busy

faint prism
#

Although I might when I migrate to SQL or something

honest perch
#

what language should one learn

pure lion
#
            guilds.forEach(g => {

                if (await Guild.findOne({guildID:g.id}) !== null) console.log

            })

it was literally working the first time i did it but now i get this error:

                if (await Guild.findOne({guildID:g.id}) !== null) console.log
                          ^^^^^

SyntaxError: Unexpected identifier
hardy steeple
honest perch
#

eris is js

faint prism
#

python? lol

earnest phoenix
#

yeah i didnt mean ef entities, i meant like the actual discord entities

hardy steeple
#

ok

#

ahhh

#

sorry im horrible at this

pure lion
#

no i

faint prism
#

Oh, do you mean, @earnest phoenix

        //
        // Summary:
        //     Gets the Discord.WebSocket.SocketGuild that the command is executed in.
        public SocketGuild Guild { get; }
        //
        // Summary:
        //     Gets the Discord.WebSocket.ISocketMessageChannel that the command is executed
        //     in.
        public ISocketMessageChannel Channel { get; }
        //
        // Summary:
        //     Gets the Discord.WebSocket.SocketUser who executed the command.
        public SocketUser User { get; }
        //
        // Summary:
        //     Gets the Discord.WebSocket.SocketUserMessage that the command is interpreted
        //     from.
        public SocketUserMessage Message { get; }```
digital ibex
#

use filter, dice

#

oh

hardy steeple
#

as of right now the current bot i have works with discord.js

faint prism
#

I feel the framework gives me plenty of data

digital ibex
#

thats not the issue

#

my bad 😳

pure lion
#

its more than one ID being pushed through less but still more than one IDs, some match and some dont

hardy steeple
#

i might go risky and use eris to make a higher quality one, thougj

pure lion
#

so ye idk what to do

digital ibex
#

eris is risky?

hardy steeple
#

no

digital ibex
#

wdym

hardy steeple
#

im just saying im really busy and itd take a while

earnest phoenix
#

yeah those, for example if you want to send a message to a user you need to have the actual user entity so you can call SendMessageAsync

dsp and disqord straight up allow you to SendMessageAsync on the client and it takes in an id as the parameter

solemn latch
#

i remember forEach is a bit weird with promises @pure lion

digital ibex
#

for loops 😛

pure lion
#

it worked the first time w t f f f f f f

hardy steeple
#

eris is great ive seen it in action

solemn latch
#

you might need to use Promise.all or something

#

🤔

digital ibex
#

its amazing

#

d.js needs to go !

pure lion
#

how would one use promise all

hardy steeple
#

i know im just saying it would take quite a while to migrate

earnest phoenix
#

@crystal socket do you know if discord.js has a bulk reaction method

hardy steeple
#

i dont think so

solemn latch
#

promise.all does an array of promises at once

pure lion
#

.then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then() @earnest phoenix

earnest phoenix
#

which that becomes a pain in the longrun because for something that could be a single REST request you would be making two, one to get the entity and the other to actually do what you want with it, Auger

solemn latch
#

so you could create each db promise, then do them all at once

crystal socket
#

@earnest phoenix consult the discord.js help server

earnest phoenix
#

no

#

this is a good server to ask in

crystal socket
#

which i do not have a invite server cause i'm not in it

pure lion
#

@solemn latch but theres only one promise there?

#

i am cumfused

crystal socket
#

i know im just saying it would take quite a while to migrate
@hardy steeple to a vps?

solemn latch
#

for each guild

#

theres once

earnest phoenix
#

.then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then() @earnest phoenix
@pure lion This wouldnt work first of all, and second that's not bulk

crystal socket
#

it would take 5 minutes

solemn latch
#

one*

digital ibex
#

d.js to eris

hardy steeple
#

yeah

pure lion
#

so push each promise into a Promise.all([])

#

?

earnest phoenix
#

no

#

thats not bulk Dice

pure lion
#

not you

#

:)

earnest phoenix
#

that's individual and can execute out of order

#

...

solemn latch
#

order doesnt matter here does it?

hardy steeple
#

my bot is coded to the standard of d.js and id have to change it to the way eris accepts commands and code which would take a while

earnest phoenix
#

it does, Woo

#

I want to add 5 reactions in order on one message

digital ibex
#

wdym fluffy?

earnest phoenix
#

in under a second like some bots do

solemn latch
#

what?

crystal socket
#

if print(5).then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().return(True): print(6)

pure lion
#

use a proxy to bypass some stuff

#

.then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then()

earnest phoenix
#

what?

digital ibex
#

????

earnest phoenix
#

are you guys stupid

#

...

pure lion
#

yes

earnest phoenix
#

ok

pure lion
#

:)))))

digital ibex
#

🗿

#

what

pure lion
#

🗿

#

that is literally me

crystal socket
#

same

digital ibex
#

???

opaque seal
#

How the heck can I get the animated emoji ID without nitro? or if I can't is there a way the bot can use the emoji without the ID?

earnest phoenix
#

WHO DID THIS 😂

digital ibex
#

right click on the emji

earnest phoenix
#

inspect element @opaque seal

digital ibex
#

click copy link

earnest phoenix
#

95% of the people on this server make my brain hurt

digital ibex
#

get the id from the link

earnest phoenix
#

:/

opaque seal
#

I tried @earnest phoenix seems like they fixed it

crystal socket
#

we should make a channel where there are no white names.

earnest phoenix
#

^

digital ibex
#

and then the <a:name:id>

#

....

#

why

pure lion
#

we should make a channel where there are no white names.
and no me

earnest phoenix
#

but i am not your casual whitename

digital ibex
#

thats not gonna change anything

crystal socket
earnest phoenix
#

so 90000 of the idiots here cant see it lol

#

look up my message history

#

anyways

hardy steeple
#

im revoking my bot from top.gg for now because its not developed enough

pure lion
#

JSON BAD

earnest phoenix
#

oof

opaque seal
#

Found the ID I'm just a retard sometimes

digital ibex
#

???

earnest phoenix
#

ur bad dice

pure lion
#

:(

digital ibex
#

am i an average whitename? 😳

earnest phoenix
#

yes

pure lion
#

no

earnest phoenix
#

no ur a qt

crystal socket
#

no

digital ibex
#

oh UHH

pure lion
#

qt for definite

earnest phoenix
#

u actually have a brain tho

#

so

crystal socket
#

a average white name pings atmods for bot verification

slender thistle
#

development gang

pure lion
#

speaking of

digital ibex
#

oh

crystal socket
#

gang gang

pure lion
#

gang gang

#

can i have help now please? :D

crystal socket
#

no

pure lion
#

>:c

digital ibex
#

whats the issue?

#

:o

pure lion
#
                if (await Guild.findOne({guildID:g.id}) !== null) console.log
                          ^^^^^

SyntaxError: Unexpected identifier

this one omfg i just opened the windows app store kill me

solemn latch
#

unpin windows store

#

🤔

#

madman

pure lion
#

There was a time when I had vs pinned

#

God that was annoying

pure lion
#

oh thats exactly what i wanted

solemn latch
#

so you could push each promise into the array, Promise.all().then()

digital ibex
#

wait

#

thats not gonna work

#

fuck

pure lion
#

uh i know

solemn latch
pure lion
#

lmao

#
            let a = []

            guilds.forEach(g => {

                a.push(await Guild.findOne({guildID:g.id}))

            })

            Promise.all(a).then(john => console.log(john));
solemn latch
#

yeah, i think thats what you want

pure lion
#

sickk

digital ibex
#

i think im stupid

solemn latch
#

you might have to do some logic to get rid of null results

digital ibex
#

am i missing something basic moyai

#

nvm me actually

faint prism
#

@earnest phoenix discord.net has:
discordClient.GetGuild("guildId").GetTextChannel("channelId").SendMessageAsync("Hello World")

digital ibex
#

compact

pure lion
#
                a.push(await Guild.findOne({guildID:g.id}))
                       ^^^^^

SyntaxError: missing ) after argument list
#

h m

solemn latch
#

you might not need the await

earnest phoenix
#

Extra )

solemn latch
#

since your promise.alling

earnest phoenix
#

You need the await, just await the function bruh

pure lion
#

e?

amber fractal
#

what? you dont await a push, he's awaiting what he's pushing

earnest phoenix
#

a.push((await <function>))

#

@earnest phoenix discord.net has:
discordClient.GetGuild("guildId").GetTextChannel("channelId").SendMessageAsync("Hello World")
@faint prism
yeah that's just pulling from cache thought

solemn latch
#

but Promise.all resolves promises

#

🤔

earnest phoenix
#

though*

sweet ruin
#

How do I make it, so where I can replace the 1 2 and 3 numbers of this? idk how


    let i = 0;
    let page = 1;
    let pages = Math.ceil(leaderBoard.length / 10);

    if (args[0] && !isNaN(args[0])) {
      page += Number(args[0]);

      if (page > pages) {
        i = (pages - 1) * 10;
        page = pages;
      } else {
        i = (pages - 1) * 10 - 1;
        pages -= 1;
      }
    }

    async function call(u) {
      let m = await message.guild.members.cache.get(u.userID);
      if (!m) m = u.username;
      else m = m.displayName;

      let level = u.level;
      let j = 0;
      let xpInLevels = 0;
      if (level >= 1) {
        do {
          let multiplier = j * 1.25;
          if (multiplier === 0) multiplier = 1;

          let xp = 150 * multiplier;
          xpInLevels = parseInt(xpInLevels) + parseInt(xp);
          j++;
        } while (j + 1 <= level);
      }```
faint prism
#

It probably queries the API on the connection thread

earnest phoenix
#

it doesn't

#

it's pulling from cache

pure lion
#
 >> 149|     <%-JSON.stringify(userGuilds)%>

    150|     <script>

    151|         window.onload = () => {

    152|             const fragment = new URLSearchParams(window.location.hash.slice(1));


Converting circular structure to JSON
    --> starting at object with constructor 'NativeTopology'
    |     property 's' -> object with constructor 'Object'
    |     property 'sessionPool' -> object with constructor 'ServerSessionPool'
    --- property 'topology' closes the circle
``` FUCK
earnest phoenix
#

@sweet ruin From which part and what are you exactly trying to do there

#

anything that interacts with the API is granted to be asynchronous and a task

sweet ruin
#

Im trying to replace i (not j). so pretty much I works perfectly right now. but I want to make the 1, 2, and 3 slots to be 🥇 🥈 and 🥉

earnest phoenix
#

So i is the 1 2 3 or w‫hat ‫

sweet ruin
#

i ranks people based off their xp

#

i want first second and third place to have the medals

#

but i dont know how to pull just those
@earnest phoenix

pure lion
#
a.push(async () => await Guild.findOne({guildID:g.id}))

modern solutions require modern problems

#

welp this is what it spat out

#
[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]
solemn latch
#

everything null?

#

🤔

pure lion
#

console:

#
[
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction],
  [AsyncFunction], [AsyncFunction], [AsyncFunction], [AsyncFunction]
]
solemn latch
#

i think you can just put in the promises, no await or anything

earnest phoenix
#

@sweet ruin i meant what does output the 1 2 and 3? Does i do that?

pure lion
#

ok

sweet ruin
#

this @earnest phoenix

faint prism
#
  arr[i] != null ? WriteLine($"You're looking for {i}") : WriteLine("My god... It's all null");```
pure lion
#

@solemn latch same cirular error

earnest phoenix
#

@sweet ruin that might need a switch case before that

let ranks;
switch(++i){
case 1:
ranks = "🥇";
break;
case 2:
ranks = "🥈";
break;
case 3:
ranks = "🥉";
break;
default:
ranks = `#${++i}`;
}``` and then you can use `ranks` instead of `**${'#' + ++i}`
faint prism
#

Careful with prefix or suffix incrementors

#

++i != i++

amber fractal
#

@pure lion a.push((await Guild.findOne({guildID:g.id}))) should work if the function is async

#

but if the function isnt async you simply cannot await it unless you want to use .then, which isn't the same thing

sweet ruin
#

Thank you @earnest phoenix it is basically working

#

except it skips 4

earnest phoenix
#

You also wanted 4 to be something?

#

Wait huh

sweet ruin
#

no no it just skips it

#

it goes 1, 2, 3, 5

earnest phoenix
#

I got no idea how tf it skipped 4

midnight blaze
#

if print(5).then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().then().return(True): print(6)
@crystal socket dont u have to resolve each of those then?

earnest phoenix
#

Doesn't even make sense

solemn latch
#

why await when using promise.all?

midnight blaze
#

then(variable => something)

crystal socket
#

i don't know js stop bullying me

chilly sphinx
earnest phoenix
#

("b" + "a" + + "a").toLowerCase()

midnight blaze
#

baNaNa

earnest phoenix
#

god tier programming

sweet ruin
#

@earnest phoenix it then skips all even numbers.

#

see

earnest phoenix
#

Idk how does that make sense lmao

sweet ruin
#

fixed it

#

it was the ++

#

it needed to be a +

earnest phoenix
#

Nice

sweet ruin
#

Tysm ❤️

pure lion
#

it logs da shit but theres still a tonne of null

#
            let promise = Promise.all(a);
            (await promise).forEach(p => { if (p) console.log; else return })

so i tried this and it logged nothing

rain cradle
#

.format is very useful to multi-language

tight tendon
#

nerd

sudden geyser
#

.format in python?

#

f-strings are life

slender thistle
#

chr(10).join for f-strings because yes

inner wharf
#

anyone know how to send a message to a channel via channel ID? I can't seem to get it to work.
Here is what I am currently doing;

 bot.get_channel("actual id").send(msg)

My error message is AttributeError: 'NoneType' object has no attribute 'send'

crystal socket
#

channel should be a int not string

#

and it should be awaited

#

heres the final code

#
 await bot.get_channel(12345).send(msg)
inner wharf
#

I've tried both of those, same error

crystal socket
#

are you sure bot is in the channel?

#

and has perms to see

inner wharf
#

I forgot to put await in the original
And yes, the channel doesn't need perms

crystal socket
#

well then try ```python
await bot.get_channel(12345).send(msg)

inner wharf
#

It can respond in the channel if I call it via command, but I can't get it to log into one single channel if I call it from a different channel. And I have.

crystal socket
#

are you getting the same error message?

inner wharf
#

yes.

crystal socket
#

and the bot is on the server?

inner wharf
#

yep

#

and it's running

crystal socket
#

can you triple check the channel ID

#

you can do this by doing "<#" + the channel id + ">"

#

make sure its the right id

inner wharf
#

Yeah. I just fixed it by changing some of the code around, looks like one of my variables was screwing it up. Sorry for the bother, and thanks for the help.

crystal socket
#

np!

honest perch
#

Tbh i thought that was js for a second lmao

#

Looks similar

sudden geyser
#

same lol

restive willow
#

should anybody want to make a discord bot (discord.py) together, shoot me a message, i currently have one in ~5k servers

honest perch
#

No

faint prism
#

Do you know C#? @restive willow

jagged crater
honest perch
#

Have you installed ms

jagged crater
#

i think so but maybe not lol

honest perch
#

Then install it

jagged crater
#

Okay i found the problem thanks

earnest phoenix
#

can someone help me make a prefix changer in discord.py

#
@bot.command(pass_context=True, hidden=True)
async def setprefix(ctx, *, nprefix):
    nprefix = nprefix.strip()
    if nprefix != "":
        try:
            prefix = nprefix
            await commands.Bot(command_prefix=prefix)
        except:
            await bot.say("Cant Change ...")
        else:
            await bot.say("New prefix : **{}**".format(prefix))
#

doesnt seem to work

slender thistle
#

uh no

#

you need a function for your bot object's command_prefix kwarg

earnest phoenix
#

i have already

slender thistle
#

Show

earnest phoenix
#

oke 1 min

restive willow
#

Do you know C#? @restive willow
@faint prism no

#

but I could learn it

earnest phoenix
#

bot = commands.Bot(command_prefix=prefix, description=description)

#

this u mean

slender thistle
#

What's prefix

earnest phoenix
#

in my config.json

#

$

slender thistle
#

and you need a function that relies on a global dictionary

#

where key is server ID and value is the prefix for the server

earnest phoenix
#

oke ty ❤️

#

ez works ty again

queen marsh
#

I need help with discord.js how do i know if its installed i use a chromebook and i know tis avalable on linux

quartz kindle
#

if its in your package.json and in the node_modules folder, then its installed

sudden geyser
#

well it is in the node_modules column

queen marsh
#

im dumb lol

faint prism
#

I recognize that chrome text editor

queen marsh
#

I use a chromebook............

faint prism
#

Me too

#

But not as my main PC, just for college

queen marsh
#

I dont have that much expirience

faint prism
#

You can install VSCode

queen marsh
#

i just need whatever software that is compatible with linux to use to make my bot work

faint prism
#

I host my bot on an ubuntu server

#

any JS should work with linux, and Dotnet Core also does too

#

and java

queen marsh
#

how do ik if js is downloaded tho

faint prism
#

You don't download js

#

It's an interpreted language

queen marsh
#

....

#

im really dumb then

faint prism
#

What you really mean to ask

#

is what do I download to run my js

queen marsh
#

yes

faint prism
#

And to that I say, NodeJS probably

slender thistle
#

to run a Discord bot, yeah

queen marsh
#

i went through he*l trying to download that

faint prism
#

Some JS dev correct me if I'm wrong, but

#

Alternatively, if you want dotnet core and to write in C# language, you will need other stuff

queen marsh
#

i have a folder named Node_modules

faint prism
#

Actually

queen marsh
faint prism
#

I just learned about some cool service for JS discord bot devs

#

Make an account here, and try to do your project there. They will actually HOST your bot for free

#

So you won't have to worry about VPS or dedicated servers for a while

halcyon crow
#

Lucky js devs... bah humbug

faint prism
#

fr

#

I'm over here, buying a rasp pi 4 to host my bot on lol

queen marsh
#

oh it costs money!?

honest perch
#

You cant host bots on glitch really

halcyon crow
#

I host mine on a pi 3

faint prism
#

what

sudden geyser
#

Fire will come upon this channel soon

faint prism
#

you can't?

sudden geyser
#

You can, but you shouldn't

queen marsh
#

does it cost money in any kind of way to host a bot?

honest perch
#

It goes offline after 5 minutes

faint prism
#

damnnn

honest perch
#

@queen marsh yes

halcyon crow
#

@queen marsh if you pay someone else to host it for you, yes

faint prism
#

It's "free" if you host it yourself @queen marsh

queen marsh
#

.........

#

how do i host it free

faint prism
#

It's a program you have to leave open

honest perch
#

Host it yourself

queen marsh
#

what programm

faint prism
#

The one you make

#

lol

halcyon crow
#

If you host it yourself on a Raspberry pi, you pay the price of the pi upfront (as low as £9.80) and then 5£ a year in electricity fees

faint prism
#

the bot program

queen marsh
#

Maybe i need to slow down my bot hasnt even got approved yet

halcyon crow
#

Furthermore your Raspberry pi is a full on computer not just. A bot

faint prism
#

@halcyon crow Did you just assume I'd run my bot on a pi zero...

honest perch
#

I would suggest getting the pi 3

#

Or 4

halcyon crow
#

I said as low as @faint prism lol

faint prism
#

$10 is the price of a pi zero

#

lmao

#

sneaky

halcyon crow
#

I mean minimum price to self host

queen marsh
#

is it a one time payment or subsription

faint prism
#

Just host yourself at first

halcyon crow
#

It’s a mini computer

#

You literally buy a mini computer board called a Raspberry pi

#

And then run your script on that 24/7

faint prism
#

You can just have it running on your laptop. And anyone can use it until you close the program or turn off your laptop

queen marsh
#

I dont know how to host it myself thays why im here i have expirience but not much

cloud pebble
#

Speaking of Raspberry pi, i'm hosting my bot on one and it recently it just won't connect to the Discord bot itself. Commands work but everything in the on_ready function won't load. The exact same code works on my PC and was working yesterday

halcyon crow
#

I don’t use the discord.ext module because of that

faint prism
#

Look into docker containers maybe for a baseline environment @cloud pebble

halcyon crow
#

I kept having issues

cloud pebble
#

docker containers are going a bit over my head 😅

halcyon crow
#

@queen marsh in order to run your bot 24/7, you need a computer. You can pay someone to run your bot on their computer, basically renting their computer. This is called a VPS and it’s a subscription. Alternatively you can host it yourself, by buying that ‘computer’ yourself. This is a Raspberry Pi. A cheap, lightweight computer which can run your script 24/7 from inside your house costing no more than the upfront cost buying it and electricity fees which is like $5 a year.

queen marsh
#

oof ok

#

i dont have expirence with coding at all tho :/

honest perch
#

Then get some

#

Don't try making a bot

halcyon crow
#

Ya it’s chill we all start somewhere

cunning gorge
#

How do I add an image to this embed

    {
      title: 'Bibi Shop',
      description: 'Welcome to the Bibi Shop!\n\nFeel free to browse around :)',
      color: '0xd305fa',
      image: {
        url: `attachment://${attachment.name}`,
      },
      footer: {
        text: `Page 1/${pageMax}`,
      },
    },
    {
  const attachment = new Discord.MessageAttachment(image.toBuffer());

I am using canvas construcotr to render

honest perch
#

Without knowing anything

faint prism
queen marsh
#

ok

honest perch
#

Please learn a language

#

Before you make a bot

faint prism
#

this ^ tbh

honest perch
#

@weak parrot will happily tell you why

faint prism
#

Watch some JS tutorials

honest perch
#

Wrong tag

#

Discord bad

halcyon crow
#

I would also say learn basic programming before making a bot

#

But it doesn’t have to be really advanced

honest perch
#

Sowwy for tag timo

queen marsh
#

i dont want a super fancy advanced bot

hardy steeple
#

my bot file got corrupted but i brought it back and re added it to top.gg

#

so that was an experience

honest perch
#

@quartz kindle will happily tell you why you should learn a language first @queen marsh

queen marsh
#

i know not to make a bot when i dont know what im doing, i thought it would be simple as i had a goal of creating a super simple bot with only 5 commands.

#

for personal use in my server

hardy steeple
#

use discord.js

halcyon crow
#

You can do that without learning programming tbh

hardy steeple
#

yeah

halcyon crow
#

Just look at someone else’s simple bot

#

You’ll figure it out

queen marsh
#

ok

#

i probably need to slow down anyways because my bot hasnt even been approved yet

halcyon crow
#

?

honest perch
#

@halcyon crow don't give stupid advice

halcyon crow
#

@honest perch if he wants 5 simple commands such as !say arg, then bot says it back I hardly think it’s efficient for him to learn js

#

He can just look at a similar bot and change the stuff around that he wants

honest perch
#

He won't "figure it out". He will just copy paste code not knowing what he is doing, then coming back and asking how to debug simple code

zenith terrace
#

^

honest perch
#

Its important to learn the language before doing bots, even if its simple

queen marsh
#

,...

halcyon crow
#

Maybe you’re right yeah

#

I’m not sure I haven’t thought about it much

#

I do think that if you have an ambitious project it’s most efficient to learn the language first but if your end goal is 5 commands then it’s not necessary. There are literally programs to make bots that don’t involve any programming at all

zenith terrace
#

rip

#

@minor kelp that wasnt pleasant was it

honest perch
#

Please don't make the mistake i did

#

I went straight onto bots and I regret it

queen marsh
#

6 commands

zenith terrace
#

@zenith terrace n o
@minor kelp turkish ?

halcyon crow
#

This guy doesn’t want to learn to create a bot, or to program from what I have heard, he just wants to make his bot and use it. @honest perch

zenith terrace
#

o god, thats worse

halcyon crow
#

So telling him to learn programming is not beneficial

honest perch
#

If he doesn't want to program it, tell him to use botghost or something

halcyon crow
#

What’s that?

queen marsh
#

what is botghost

earnest phoenix
#

can you put an emoji in your bot's status?

queen marsh
#

I've heard of it but what does it do and how is it gonna help me

bright dove
#

does
message.reply(blahblah);
not the thing you use for having it ping the command user and then saying the text given?

earnest phoenix
#

@queen marsh it's basically a third party that creates a bot for you aka you don't really have to code the bot

#

and it hosts the bot for you

torn ravine
#

@bright dove message.channel.send(message)

queen marsh
#

ok im using botghost then

halcyon crow
#

Wow that sounds like what ya want moddrn!

bright dove
#

that's to send a message, not to have it ping the user

earnest phoenix
#

disappointing

torn ravine
#

yes

hardy steeple
#

i really hope my bot is online when the devs test it

#

or else ill have to wait another 3 weeks

#

or more

#

which wouldnt be ideal

earnest phoenix
#

i applied like a month or two ago

#

and i didn't think they'd review mine that quick

#

and it was before i had hosting

#

now i have hosting and i have to apply again

halcyon crow
#

@bright dove message.channel.send(‘blah blah {}’.format(message.author.mention))

earnest phoenix
#

lmao

#

you can just do

restive willow
#

fstrings >>>

torn ravine
bright dove
#

but I've used message.reply(); before and it worked

#

it's just not now

#

and I don't know why

earnest phoenix
#

message.channel.send(`blah blah ${message.author}`)

try this ^

hardy steeple
#

do message.channel.send('blah blah')

honest perch
#

Message reply tags the user

#

Channel send does not

bright dove
#

Message reply tags the user
@honest perch exactly

hardy steeple
#

yeajh

torn ravine
#

channel.send doesn’t

hardy steeple
#

message.channel.send works tho

torn ravine
#

so use message.channel

hardy steeple
#

if you attach it too a prompt

earnest phoenix
#

-_-

bright dove
#

I don't want to do that

#

I want to use message.reply

hardy steeple
#

yeah

bright dove
#

but for whatever reason it's not working

restive willow
#

...why

honest perch
#

Bruh

restive willow
#

same result

earnest phoenix
#

yeah

hardy steeple
#

so use message.channel.send('message')

honest perch
#

Just use channel send ffs

earnest phoenix
#

^

#

USE message.channel.send OR BAD

#

HMPH

honest perch
#

There is no difference except from a pong

torn ravine
hardy steeple
#

use message.channel.send('message')

#

for no ping

quartz kindle
#

@bright dove are you using the disableMentions option?

honest perch
bright dove
#

I don't know what that means so I guess not

halcyon crow
#

@restive willow oh... wow. That is beautiful how did I not know that

quartz kindle
#

then it should work

bright dove
#

it was working an hour ago

#

idk why it stopped

restive willow
#

@restive willow oh... wow. That is beautiful how did I not know that
@halcyon crow what

bright dove
#

lol

halcyon crow
#

@restive willow fstrings

torn ravine
#

Tim literally has the entirety stackoverflow programmed into his brain its kinda funny

hardy steeple
#

true

restive willow
#

fstrings are the love of my life

halcyon crow
#

Im in love

#

Ive been using .format this time

faint prism
#

I have my bot check if a user's ID matches anyone in the Admin db. Then I can do extra stuff, but not just anyone

#

too bad I can't do eval in C#

bright dove
#

OH

hardy steeple
#

apparently it takes 3 weeks for a bot to be noticed or more

bright dove
#

it's because I was doing it in dms

#

I guess message.reply doesn't work in dms

hardy steeple
#

no it doesnt

faint prism
#

But it's probably best since I'd be afraid it'd go from an eval into RCE

restive willow
#

mine took jsut over 3 weeks but its well wroth it

halcyon crow
#

Why u tagging someone in a dm anyway @bright dove

hardy steeple
#

generally dms arent a good thing to rely on because they can be used in harmful ways sometimes

bright dove
#

Why u tagging someone in a dm anyway @bright dove
@halcyon crow error for when command no worky

hardy steeple
#

and your bot can be disapproved for dm harm

halcyon crow
#

!say ‘${token}’

#

Lit

bright dove
#

only thing it dm's is help message

#

or every other command if you happen to use them in Dms for whatever reason

#

lol

faint prism
#

lmaooo

#

That's what I was thinking