#development

1 messages · Page 963 of 1

sudden geyser
#

has anyone ever heard of vivaldi

earnest phoenix
#

they wouldn't want to kill it

topaz fjord
#

but like I said only the ads that are spammy and resource heavy will be killed according to them

earnest phoenix
#

they're maybe killing third party ads and allowing adsense ads only

#

yeah

green kestrel
#

Been using Firefox developer edition for about ten years

earnest phoenix
#

that

green kestrel
#

Imho they need to kill the chum networks, taboola etc

#

"you won't believe what she did when she saw this photo!!!!"

topaz fjord
#

I wanna switch to another browser but literally everything I use depends on the sign in with gmail for syncing

green kestrel
#

What do you use?

topaz fjord
#

chrome

green kestrel
#

You can keep chrome for those apps but just make another browser your default

#

I have chrome too but not as my default, need it to cast YouTube videos

restive furnace
#

or make your own

green kestrel
#

We have Chromecast in the living room

earnest phoenix
#

i only use chrome for an addon that firefox removed from their extension page :(

topaz fjord
#

I just want edge to allow signing in with gmail but that'll get rid of the point

sudden geyser
#

what was the addon

earnest phoenix
#

substital

#

oh it seems that it is back on firefox

topaz fjord
#

subtitles

#

I can't switch to firefox

#

just don't like the UI and shit

earnest phoenix
#

there's a css mod

lyric mountain
earnest phoenix
green kestrel
#

Look at subadub or subtitle pro

lyric mountain
#

As I said, it's minimal

#

But is somewhat an adblock

green kestrel
#

I wouldn't trust a Google sponsored ad block

#

That's like trusting tobacco company sponsored nicotine patches

lyric mountain
#

It does block invasive ads

#

But only that

green kestrel
#

I want it to block all ads as in the name

lyric mountain
#

Sometimes it help if the site loves to throw 46675 new tabs

green kestrel
#

Ublock origin all the way for me

#

I guess it's a "some ads blocker"

#

😂

lyric mountain
#

Non google ad adblock

earnest phoenix
#

i've been thinking of getting an rpi so i can run pihole on it

#

network wide adblock

green kestrel
#

But 90% of ads are Google network ads....

earnest phoenix
#

^

#

unless you're visiting pirating sites chances are you're going to get google ads

green kestrel
#

You don't need a pi for pihole

#

Ive seen windows builds

earnest phoenix
#

i don't have anything to run it on

green kestrel
#

Run it on the same pc you browse from cry

#

All it is, is a simple DNS server

earnest phoenix
#

yeah ikik but i want to keep it on at all times so it affects my phone while my pc is off

green kestrel
#

Hmmm, there's DNS servers you can put in the router settings that do the same

#

If you trust them

earnest phoenix
#

oh, might try that

green kestrel
#

Saves you running a pi

restive furnace
#

1.1.1.1 best

earnest phoenix
#

but yet again i don't even have a proper router, i've got a homebox running 4g+

nocturne grove
#

How can I replace all spaces except the regular one? RegEx is hard for me but I'm trying

earnest phoenix
#

in what language

nocturne grove
#

js

topaz fjord
#

.trim()?

earnest phoenix
#

replace

nocturne grove
#

no that's totally not what it does

earnest phoenix
#

replace only does the first occurance, so you need to add the global regex flag to allow it to reoccur

topaz fjord
#

running pihole with openvpn. is also great

#

@green kestrel

nocturne grove
#

something like this:
.replace(/if char == ' ' ? do nothing : replace if it's another space/g, '')

earnest phoenix
#

/char/g

nocturne grove
#

but what I said in regex language lol

earnest phoenix
#

i understood nothing

#

you want to replace double spaces?

nocturne grove
#

no I want to replace all "fake" spaces

#

empty chars

lyric mountain
#

That's harder then

earnest phoenix
#

it isn't

#

OR operation

lyric mountain
#

I mean, there're lots of blank chars

earnest phoenix
#

(char1|char2|char3|...)

nocturne grove
#

I know .replace(/\s+/g, '') but then without the normal space

#

Is there not an option to replace all \s+ except ' '?

earnest phoenix
#

i'm really meh at regex so i don't know, i only know basic operations lol

nocturne grove
#

oh okay np

earnest phoenix
nocturne grove
#

thanks

pearl igloo
#

How do you make the discord bot have costum currency and the more they talk the more XP they get? A command is they can check their profile and see their XP and Coins. A normal User should make give [amount] [user], bank [user] or themself without adding a @. And a Admin should can make gift [infinite amount] [user] and take [amount (if its over a amount that the user has, he goes minus)] [user]. And a Jobsystem where the Jobs get everyday more money. And with the command work they can everyday get their coins, that I assigned to their job. And a marry and divorce command would be nice. so if anyone knows it by themself or knows a video, i would find it nice to see it.

tight plinth
#

Don't follow videos tutorial, please. Just learn js in general (assuming that your bot is using js) and how to use a db

pearl igloo
#

i use python

radiant estuary
#

how can i create a perma invite with discord.js?

tight plinth
#

Well learn how to use python

nocturne grove
#

@earnest phoenix I don't think it's the nicest way, but solved it for now by replacing a normal space to the message object (just something random), replacing all spaces (\s+) by nothing and then replacing the object back to a normal space

edit: no don't do that lmao

radiant estuary
#

i have it ^^

summer torrent
radiant estuary
#

i have it ^^
but thanks

hardy vector
#

my bots music system stopped working so i try playing a song and it joins the vc channel and i can see the green ring around it is lit up my sound is at max its user volume is at max but no audio i checked logs and nothing

earnest phoenix
#

could be a Discord issue

#

what is the best language to create discord bots (i mean to create complex one's)
also has the ability to free host them

cinder patio
#

you can create 'complex' bots with every language

earnest phoenix
#

how?

#

so any language can does what other language?

#

the libraries are different

#

for sure there is a better library

cinder patio
#

Pick the language you like the most and create a bot with it, there's a library for interacting with the discord API for almost every popular programming language

small zenith
#

-bots

gilded plankBOT
small zenith
#

-bots Fate Harsh#4310

gilded plankBOT
small zenith
#

🤨

#

-bots ⏤͟͟͞★ΞИ | SOYAL#4503

gilded plankBOT
small zenith
#

-botinfo AMY

gilded plankBOT
#

tickNo Please include a bot mention or ID

small zenith
#

-botinfo 716893391560114186

gilded plankBOT
#
AMY
Bot info
ID

716893391560114186

Username

AMY

Discriminator

6561

Short Description

A Moderation, Economy, Verification, Fun, Logging Bot

Library

discord.js

Prefix

/

Total Upvotes

1

Monthly Upvotes

0

Server Count

No server count

Owner(s)

@slow mirage
@small zenith

slender thistle
#

-botcommands @small zenith

gilded plankBOT
#

@small zenith

Hey! Bots aren't given permissions to send responses in this channel. Please use #commands or #265156322012561408 to run commands. In addition, bots with commonly used prefixes cannot read or send messages in any channel. This is done to prevent spam and bot abuse.

small zenith
#

Isnt it allowed here? :)

#

:/*

#

Sorry

earnest phoenix
#

any py devs around?

small zenith
#

im js

earnest phoenix
#

not helping :/

modest maple
#

@earnest phoenix whats up

earnest phoenix
#

can i dm ya?

modest maple
#

sure

austere laurel
#

HI

earnest phoenix
#

-bots

gilded plankBOT
pearl igloo
#

How do you make the discord bot have costum currency and the more they talk the more XP they get? A command is they can check their profile and see their XP and Coins. A normal User should make give [amount] [user], bank [user] or themself without adding a @. And a Admin should can make gift [infinite amount] [user] and take [amount (if its over a amount that the user has, he goes minus)] [user]. And a Jobsystem where the Jobs get everyday more money. And with the command work they can everyday get their coins, that I assigned to their job. And a marry and divorce command would be nice. so if anyone knows it by themself or knows a video, i would find it nice to see it.

turbid bough
#

maby search on fiverr, maby they know

true cosmos
#

-bots

gilded plankBOT
earnest phoenix
#

there's 👏 not 👏 a 👏 yt 👏 tutorial 👏 for 👏 everything 👏
and 👏 you 👏 shouldn't 👏 use 👏 them 👏 in 👏 the 👏 first 👏 place 👏

pearl igloo
#

so how i should do it?

turbid bough
#

go on fiverr?

#

you are asking on how we should make a complete bot for you

earnest phoenix
#

MESSAGE_CREATE / message / messagereceived event depending on the lib you're using, hook into a database (my suggestions are sqlite for small scale, postgres for big scale), from there on you can store any data you want and pull it anytime you want, including your currency and your xp

#

and boom, profit

#

no, sorry

pearl igloo
earnest phoenix
#

and of course you're not going to find something like leveling, that's out of the scope of the library and up to you to implement lol

toxic jolt
#

Why doesn't it detect uppercase and lowercase letters?

smoky spire
#

Because you don't tell it to

toxic jolt
#

Okay but is 8k sentence.

earnest phoenix
#

You need to use awaitMessages.

#

You can learn it from djs "docs"

toxic jolt
#
client.on("message", async msg => {
  const args = msg.content.trim().split(/ +/g);
  let isimk = args.slice(0).join(" ");
 // let asd = isimk[0];
 //isimk = asd.toUpperCase() + isimk.substring(1);

  if (msg.author.bot) return;
  let kanalid = await db.fetch(`${msg.guild.id}_${msg.author.id}_kullanici_kanal_id`);
  if (msg.channel.id != kanalid) return; 

  //////////////////////////////////

  let yask = args.slice(0).join(" ");

  if (db.has(`${msg.author.id}.isim`) === true) {
    if (!yask)
      return msg.reply("**Yaşını yazmalısın. " + db.fetch(`${msg.author.id}.isim`) + "**");
    if (yask) {
      if (isNaN(yask))
        throw msg.channel.send("**Yaşını** `(sayı)` **olarak sadece yaz. **");
      await db.set(`${msg.author.id}.yaş`, yask);
      msg.reply("**Kayıt işlemin başarıyla tamamlandı! " + db.fetch(`${msg.author.id}.isim`) + " iyi eğlenceler dilerim!**\n\n*İsim:* " + db.fetch(`${msg.author.id}.isim`) + "\n*Yaş:* " + db.fetch(`${msg.author.id}.yaş`)
      );
    }
  }

  // if (msg.content.toLowerCase() === erkek.some) {
 // if (msg.content.toLowerCase(erkek.some(isim =>isim.includes()))) {
  if (erkek.some(isim => msg.content.includes(isim))) {
      var sayiiiiii = [];
      for (var x = 0; x < 10; x++) sayiiiiii.push(x);
    
      if (sayiiiiii.some(word => isimk.includes(word))) return msg.reply("**Sadece ismini yaz. Yaşını değil.**");
      // if(isimk.includes(!isNaN(isimk))) return msg.reply("ismini yaz sayı değil")
      msg.reply("Merhaba, " + isimk + ", şimdi **yaşını** (sayı) olarak **yaz.**");

      //if(!isNaN(isimk)) return msg.reply('**Lütfen sadece ismini yaz, yaşını yazma.**')

      db.set(`${msg.author.id}.isim`, isimk);
  }
#

here is my code

earnest phoenix
#

No..

#

I dont mean to i will edit it

toxic jolt
#

here 😄

earnest phoenix
#

...

icy crater
#

how do you get the bot dev role?

unique nimbus
#

Submitting your bot

#

When it gets accepted

#

you get the role

icy crater
#

oh when it gets accepted

unique nimbus
#

You will know by Luca DMing you

icy crater
#

thx

unique nimbus
#

np

fast trench
#

ok so I'm doing a command to create a role but when I answer yes to the mentionable and hoisted question it still sets it to off. Any ideas? https://sourceb.in/a7d3844a75
just ping me if you have a tip or any idea...I'm going be going back and forth between multiple servers. I took the line that says data out and am going to test it

smoky spire
#

Well it's hoist not hoisted

fast trench
#

yeah I changed that...I even console logged responses...it's not even seeing the responses to hoist and mentionable

#

heck now it's not even doing the name or color...it's doing just like if you made a new role

open dove
#

Does anyone know of a list or something showing how much processing power/ram/bandwidth a bot requires based on usage (number of servers/users) and features (whether it does img manipulation/music streaming etc.)?

pearl igloo
#

why i got this error code?

    lvl_start = user[user.id]['level']
TypeError: 'Member' object is not subscriptable```
#

my code is this

    experience = users[user.id]['experience']
    lvl_start = user[user.id]['level']
    lvl_end = int(experience ** (1/4))```
slender thistle
#

What do you pass as user argument when calling the function?

pearl igloo
#

xp

slender thistle
#

What is xp

fast trench
#

nvm got it

stable nimbus
#

How would I get my bot to only accept a response if its numbers? Or if its a decimal?

pearl igloo
#

What is xp
@slender thistle experience

slender thistle
#

What object is it

pearl igloo
#

that the user gets the experience

small prairie
#

Do we get connections in discord.js?

digital ibex
#

the line and the bit under

fast trench
#

shouldn't this delete a role? js const roleToDelete = message.guild.roles.cache.find(r => r.id === args[0]) try { message.delete(); if (message.member.id === message.guild.ownerID) { message.guild.roles.delete(roleToDelete) } else { message.channel.send('You do not have permission to use that command'); } } catch (err) { console.log(err) }

summer torrent
#

no

#

that is <Role>.delete()

fast trench
#

ooh gotcha thanks

#

it worked thanks

summer torrent
sudden geyser
#

make sure you await it btw

wise quartz
#

How can i add a cooldown to my leveling system? I need it to give a specific amount of experience every 1 minute... (GWcodesPython - Python) ping if responded

jagged gulch
#

Does anyone know of a list or something showing how much processing power/ram/bandwidth a bot requires based on usage (number of servers/users) and features (whether it does img manipulation/music streaming etc.)?
@open dove that varies a tonne, it depends on language, library used, and how optomized your code is in general

#

How can i add a cooldown to my leveling system? I need it to give a specific amount of experience every 1 minute... (:GWcodesPython: - Python)
@wise quartz do you want to do it by message, or just constantly give xp every min

wise quartz
#

By message

#

I tried to just asyncio.sleep for 60 seconds after it gives the experience but didn't work 😅

jagged gulch
#

try making a function that you run when a message is sent. This function will check if it has been a minute since the user's last message, if so, add xp

#

im not super familiar with python so I can't provide an example

#

sry

wise quartz
#

Np i'll look into it tho anyone that could provide an example i'd appreciate it.

open dove
#

Ik, but is there at least a very rough guide?

jagged gulch
#

dont think so, but a google search could help

open dove
#

That's why I've come here, the internet is completely empty lol

jagged gulch
#

then I doubt it, sry

open dove
#

Ok, well thanks for responding anyway

jagged gulch
#

simple bots like mod bots shouldn't take that much, but music bots have gotta cache any music thats playing, so that'll take a decent bit of ram

open dove
#

I just mean basic text/data based bots

#

In only a handful of guilds

jagged gulch
#

you shouldn't need more than 1 gig of ram

#

what lang/library do u use?

#

I use node and my simple bot doesn't need that much

open dove
#

dpy

jagged gulch
#

yeah, you'll prolly only need like 1-2 gigs

#

if ur looking for a free VPS try one from google cloud

#

they have a good free trial

open dove
#

Ok great, thanks a lot

jagged gulch
#

np

slender thistle
#

@wise quartz You can create a global dict (a dict attached to the bot object) where the key is user ID and the value is datetime of when their last message was sent

#

if for per-server, maybe something along server_ID: {user_ID: datetime_object}

open dove
#

That's what I do ^^

wise quartz
#

Okay thanks i'll try it

jagged gulch
#

I should really relearn python 😣

open dove
#

Then check if that time now - that value > 30

#

Or however long

wise quartz
#

60

slender thistle
#

then you could do something like if (now - bot.dates[user_id]).minutes == 1

#

Or .seconds, look up the attributes of timedelta object to make sure

wise quartz
#

Aha...

#

A bit complicated for me ngl

#

😅

#

But i'll do my best ty

modest maple
#

@open dove you can get a rouge idea of process usage and load with pstuil

hardy vector
#

my ticket support bot wont work when someone dm's the bot it creates a new ticket in the server but wont send them that a new ticket has been created and wont show what reply the staff member gives them https://hastebin.com/asipelixos.js

sick cloud
#

can you actually use english

#

do you get any errors @hardy vector

hardy vector
#

(node:1003) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
at Client.<anonymous> (/Users/sadashivappakenchannavar/Desktop/support bot/index.js:54:38)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
warning.js:32
(node:1003) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
warning.js:32
(node:1003) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

#

i defined active tho

#

so

sick cloud
#

what's on line 54

hardy vector
#

channel = client.channel.get(active.channelID)

sick cloud
#

your issue is right in front of you

#

client.channel

#

it's client.channels

#

read the docs

hardy vector
#

(node:1035) UnhandledPromiseRejectionWarning: TypeError: client.channels.get is not a function

#

wat

pale vessel
#

you. are. in. discord. js. version. twelve.

hardy vector
#

oh right

#

cache.get

#

when the staff member in the ticket tries to send a message in the ticker the bot wont send it to the person who made the ticket it returns this error

#

(node:1072) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'targetID' of null

amber fractal
#

Whatever is before .targetID is null

turbid pivot
#

how to get client uptime please but as like 1h not 1 or else

wise cosmos
#

Hi I wanna know how I use an api at discord.js?

turbid pivot
haughty night
#

You want the uptime only in hours?

turbid pivot
#

no

#

in all

#

hours mins and seconds

#

but atleast need hours and mins

leaden gust
#

Hey all, quick question for bot dev gurus here, I'm having trouble finding this information anywhere - are role IDs unique across servers?

turbid pivot
#

yes they are

slender thistle
#

Any ID is unique on Discord

leaden gust
#

Just wanted to be sure~ ty ty

haughty night
#

var seconds = client.uptime / 1000
var hours = seconds / 3600

#

etc ect

slender thistle
#

except some really old servers that were created when general channels were "default"

turbid pivot
#

no prob

#

thank you dies

haughty night
#

and then just print that

#

Np

#

ah i forgot to seconds you need to do seconds %= 3600 @turbid pivot

turbid pivot
#

ooh

haughty night
#

w e w

turbid pivot
#

xd thanks

haughty night
#

Np

#

but do that after you declared hours

turbid pivot
#

ik

#

wait no mins

#

ah sh

digital ibex
#

the line and below

haughty night
#

first use html to add text

#

wrap it in a div

#

with a class and move it around

digital ibex
#

o ok thanks

#

would i do it in the body tag or head tag?

#

or outside of both

haughty night
#

in inside the body tag of course

#

As it is the body

digital ibex
#

kk

haughty night
#

Thats where all your html goes as far as <div> <p> etc etc goes

turbid pivot
#

i have a problem

#

i did what u said and it shows really weird numbers

#

saat is hours

#

saniye is seconds

#

idk why it showed up like this

green vale
#

So I'm creating an event logger for my Discord server [message delete, editing messages, bans, etc.] using Discord.js; Every time an event fires, I get an EMBED_FIELD_VALUE error [causing the process to exit] but the embed still sends as intended. Here is the content of one of my events [messageDelete].

client.on("messageDelete", (message) => {
    var embedded = new Discord.MessageEmbed()
    .setColor(randomColour())
    .setAuthor("Logger")
    .setThumbnail(client.user.avatarURL())
    .setTitle("A message was removed.")
    .setDescription(`A message from ${message.author} was deleted.`)
    .addField(`Content`, message.content)
    .setFooter(`Delete event`)
    .setTimestamp()

    message.guild.channels.cache.get("channel id here").send(embedded)
})
turbid pivot
#

it says channel id here

#

what

green vale
#

yes i know

#

I changed that

digital ibex
#

whats the error message

turbid pivot
#

oh

green vale
#

[EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.

#

And yet it sends as intended

digital ibex
#

console.log(message.content)

green vale
#

Yes

#

It sends that as intended

digital ibex
#

interesting

#

log it and see what happens

green vale
#

What do you mean by "log it"? Like, console.log the message content?

haughty night
#

@digital ibex You can use Math.round()

digital ibex
#

yes

haughty night
#

oops

#

wrong ping

digital ibex
#

?

haughty night
#

sorry

#

@turbid pivot

digital ibex
#

oh, ok lol

turbid pivot
#

yes

#

oh

haughty night
#

shit

#

wrong again

#

I need sleep

digital ibex
#

nice

haughty night
#

its seconds.toFixed(0)

#

Im sorry i really need sleep

turbid pivot
#

goodnight ma kachigga

green vale
#

Yeah, it logs the message content and it's the actual content of the message

turbid pivot
#

idk whats kachigga though lol

green vale
#

It wasn't an embed

slender thistle
#

Doesn't toFixed have a problem with rounding

digital ibex
#

it shouldn't error even if its an embed

haughty night
#

So far i didnt have a problem with it

green vale
#

Yes

#

And in the console log

#

Yes, it also happens with all other events too so

turbid pivot
green vale
#

Math.round?

haughty night
#

toFixed(0) doesnt work?

#

It should

autumn linden
#

@turbid pivot ingilizzce yap

#

😄

turbid pivot
#

ya

#

neyi komik

autumn linden
#

Anlamazlar

haughty night
#

Anliyorum

#

👍

turbid pivot
#

k bruh

#

what

#

dies are u turk too?

haughty night
#

Nah, i have turkish friends

#

Learned from them

turbid pivot
#

oh mane

haughty night
#

😂

turbid pivot
#

alr

#

lol

green vale
#

y'all

turbid pivot
#

no

green vale
#

o h

turbid pivot
#

i need help still

haughty night
#

So you used toFixed()?

turbid pivot
#

who

haughty night
#

You

#

I said it to you

turbid pivot
#

wait i didnt knew u said it to me

haughty night
#

😂

turbid pivot
#

var seconds = bot.uptime / 3600
var hours = seconds / 600

haughty night
#

Aight, try it and tell me

#

Should work

turbid pivot
#

heres the code

#

1000 didnt work so i made it 6000

#

600*

green vale
#

what the HECK is going on with my bot

sudden geyser
#

uptime is probably in milliseconds

#

which would be 1000th of a second

turbid pivot
#

wait ms?

green vale
#

I need help, man

#

bruh

haughty night
#

milliseconds

#

What you need help with

#

I cant read minds

turbid pivot
#

lol

haughty night
#

Unfortunatly

turbid pivot
#

what

sudden geyser
#

you can if you have a magic crystal ball

haughty night
#

Im sorry im too poor for that

cinder basalt
#

pls beg

turbid pivot
#

i have a BALL but no magix

cinder basalt
#

is there dank memer

turbid pivot
#

no sir

sudden geyser
digital ibex
#

@haughty night how can i move the text to the bottom?

haughty night
#

margin-top is one option

turbid pivot
#

i need helping

digital ibex
#

i created a div, with p

turbid pivot
#

i didnt try tofixed

haughty night
#

Bro, did you use toFixed

#

Try it then

turbid pivot
#

on whixh

#

secs or hours

haughty night
#

On both

turbid pivot
#

og

#

oh

haughty night
#

If you want to move your div use margin-top: px of %

turbid pivot
#

is it tofized(0)

#

fixed*

haughty night
#

toFixed(0)

#

Dont forget the capital

turbid pivot
#

oh oke

#

ik

digital ibex
#

with margin-top

haughty night
#

Oh the black thing is your div

#

I though it was your nav bar

digital ibex
#

yeah

turbid pivot
digital ibex
#

my navbar is right above it btw

turbid pivot
#

i did it and now its like this

#

why is life so hard

#

like my

#

d

summer torrent
#

use moment

haughty night
#

then us it on your <p>

turbid pivot
#

humanize duration?

#

hoe to use it

#

how*

summer torrent
#

moment is so easy to use

digital ibex
#

wym dieslrae?

turbid pivot
#

no not moment i meant hmnz duration

#

imma look

haughty night
#

you used <p>here is your text</p> inside the div no?

summer torrent
#

moment(time).fromNow() is enough in moment

haughty night
#

Or did you do <div>text</div>?

digital ibex
#

1st one

#
   <div>
      <p class="footer-text">Lost 2020</p>
   </div>```
haughty night
#

yae, then use the margin-top on the class you used for <p>

turbid pivot
#

will humanizeDuration(bot.uptime) work?

#

@earnest phoenix

digital ibex
#

try it

turbid pivot
#

oh ok

haughty night
#

Or you could use ```` display: flex;
justify-content: flex-end;
align-items: flex-end; ```
on your div

#

Which is probably way way better

digital ibex
#

uh

#

it makes it go to the right

#

not the bottom lol

haughty night
#

margin-top? or the last one?

digital ibex
#

last one

turbid pivot
#

@earnest phoenix it works but only shows seconds, can i make it show hours with seconds?

#

its 4700 seconds

#

like that

haughty night
#

yae just use margin-top then

#

To get your div to the bottom

turbid pivot
#

oh now it shows minute

#

1 minute and seconds

#

but seconds show as sec.milisec

#

mk

digital ibex
#

how would i change the margin-top bit on a class?

#

like ```css
footer-text class {

}```?

haughty night
#

footer-text class {
margin-top: 25%;
}

#

Like that

digital ibex
#

kk

haughty night
#

If that is the class on your div

digital ibex
#

wait, i just realised 'footer-text' is my class

#

uhhuh

haughty night
#

<div class="ok">
Would go like this in css

#

.ok{
}

slender thistle
#

align-content maybe, not align-items

#

blind guess ftw

digital ibex
#

ok... the css is: css .footer { margin-top: 25%; } and the html: ```html
<div class="footer">
<p class="footer-text">Lost 2020</p>
</div>

haughty night
#

Oh it goes out of your div

#

Then reduce the margin-top

#

It shouldnt go out of your div with only 25% tho

frigid anvil
#

Im kinda learning to code my first discord bot using visual studio but i got a problem with microsoft extentions could someone help me if i join general vc and screenshare

digital ibex
#

wdym by reduce the margin top

#

don't use visual studio for a bot

haughty night
#

Doesnt your Lost 2020 go outside your div when you used margin-top:25%?

#

Or am i blind?

digital ibex
#

it does

#

but idk what u mean

haughty night
#

reduce like from 25 to 15

#

A lower number

#

How does your css look like now

digital ibex
#

o ok

haughty night
#

Try something like this

.divclass{
    position:relative; 
  }
  .textclass{
    position:absolute;
    bottom:0;
    left:50%;
  }
``` @digital ibex
turbid pivot
#

@earnest phoenix well i read the docs and found nothing helpful, is there no way to delete the decimal?

digital ibex
#

o ok

turbid pivot
#

when?

digital ibex
haughty night
#

That is your div no? It went from there to there

turbid pivot
#

@summer torrent it says 50 years ago

digital ibex
haughty night
#

Then you should put your text in the element thats the gray box

digital ibex
#

thats the background

haughty night
#

Oh, alright then do this

#
.divclass{
    bottom:0;
    position:absolute; 
  }
  .textclass{
    position:absolute;
    bottom:0;
    left:50%;
  }
digital ibex
#

kk

#

um

haughty night
#

You sure thsat gray box is tha background?

#

Like the body

digital ibex
#

yeah

#

its just ```css
:root {
background-color: gray;
}

haughty night
#

Can you make a ss of html code

#

and css

digital ibex
#

kk

#

what part of the html code?

haughty night
#

<body>
.....

</body>

#

everything in that

digital ibex
#

i dont have anything in that yet

haughty night
#

:monkaS:

#

Where is the <div> tag in then?

digital ibex
#

oh wait, i was looking at the wrong file

haughty night
#

You had me scared for a sec

digital ibex
#

mb

haughty night
#

Oh

#

Give the .footer a width and height too

digital ibex
#

kk

haughty night
#

Like width:100% at least

digital ibex
#

why is the height staying the same? when height: 10px; it shows:

haughty night
#

10px is tiny

#

change it to 100px or something

#

or 20%

turbid bough
#

What about em

digital ibex
#

still i changed it to 100px

earnest phoenix
#

/bots

hardy vector
#

i think this is a db issue that one of the fetches is returning null
https://hastebin.com/etugigesog.js
(node:1072) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'targetID' of null
at Client.<anonymous> (/Users/sadashivappakenchannavar/Desktop/support bot/index.js:109:40)

digital ibex
#

what line

hardy vector
#

102

digital ibex
#

then it can't find the user?

vale garden
#

help plz

sudden geyser
#

What version of Discord.js are you using.

earnest phoenix
#

if below 12, remove the cache property
if over 12 what the fuck

jagged gulch
#

^

#

lmao

vale garden
#

lol

jagged gulch
#

i bet its an issue with repl

vale garden
#

its repl so i have no idea

fast trench
#

so this error takes me to #general in this server...why would I be getting this? what perms is it trying to find? js DiscordAPIError: Missing Permissions at RequestHandler.execute (C:\wildcat\node_modules\discord.js\src\rest\RequestHandler.js:170:25) at processTicksAndRejections (internal/process/task_queues.js:93:5) { name: 'DiscordAPIError', message: 'Missing Permissions', method: 'get', path: '/guilds/264445053596991498/invites', code: 50013, httpStatus: 403 }

vale garden
#

i think its below 12

#

im pretty sure

jagged gulch
#

i highly reccomend setting up vsc and devving from that

#

then remove cache

vale garden
#

oh yea i need to remove cache

jagged gulch
#

you should migrate soon tho, they're depreciating v11

#

@fast trench your bot doesn't have perms to do that cmd

fast trench
#

it's not even a command...I put in an invite tracker...and i made sure if the guild id isn't my support server it's supposed to return and not do anything...here's the code

if (member.guild.id === `708514630204522574`) {
  const cachedInvites = guildInvites.get(member.guild.id);
  const newInvites = await member.guild.fetchInvites();
  guildInvites.set(member.guild.id, newInvites);
  try {
    const usedInvite = newInvites.find(inv => cachedInvites.get(inv.code).uses < inv.uses);
    const embed = new MessageEmbed()
      .setDescription(`${member.user.tag} is the ${member.guild.memberCount} to join.
      Joined using ${usedInvite.inviter.tag}
      Number of uses: ${usedInvite.uses}`)
  } catch (err) {
    console.log(err)
  }
} else {
  return;
}```
#

it doesn't crash the bot thankfully but I want it to be gone lmao

fast trench
#

soooooooooooooooooooo

earnest phoenix
#

oooooooooooooooo

vale garden
#

now i have this problem

#
client.user.setActivity(`${prefix} help on ${client.guilds.size} servers`, {
        type: "PLAYING"
    });
    setInterval(function () {
        var u, user;
        for (u in client.users) {
            user = client.users[u];
            if (user instanceof Discord.User)
                console.log("[" + u + "] " + user.username);
        }
    }, 10000);
});```
#

doesnt show prefix

modest schooner
#

This is silly but is it possible for someone to 'DDOS' a bot? I know what I mean isnt exactly DDOSing but I don't know how else to putnit
Because my bot is somehow in way too many servers and can't start up.

vale garden
#

lol

grizzled raven
#

@modest schooner that happens sometimes, maybe just a bad connection?

#

happened to me when i had about 1.7k guilds i think

#

also each message has the server count rising so maybe check if its logging when its fully ready or just maybe a shard's ready

modest schooner
#

ugh, that'd make sense... I dont know what I'm doing. Thank you though

grizzled raven
#

when it happened to me it stopped after an hour or two, so i don treally know

#

also,

#

uh

#

ah

#

does your bot tell you when it disconnects from discord?

#

like do you listen to any disconnect event?

fast trench
#

so this code gives this error even though that channel in the error isn't even in the server I want the code to work in...can I get some help? js if (member.guild.id === `708514630204522574`) { const cachedInvites = guildInvites.get(member.guild.id); const newInvites = await member.guild.fetchInvites(); guildInvites.set(member.guild.id, newInvites); try { const usedInvite = newInvites.find(inv => cachedInvites.get(inv.code).uses < inv.uses); const embed = new MessageEmbed() .setDescription(`${member.user.tag} is the ${member.guild.memberCount} to join. Joined using ${usedInvite.inviter.tag} Number of uses: ${usedInvite.uses}`) } catch (err) { console.log(err) } } else { return; }

DiscordAPIError: Missing Permissions
    at RequestHandler.execute (C:\wildcat\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  name: 'DiscordAPIError',
  message: 'Missing Permissions',
  method: 'get',
  path: '/guilds/264445053596991498/invites',
  code: 50013,
  httpStatus: 403
}```
amber fractal
grizzled raven
fast trench
#

Yes I know but it should be completely ignoring the guild that the perms are missing in...

#

but it should be completely ignoring that server that is giving the error...
the channel that is giving the error isn't in the guild that has the id of 708514630204522574
meaning...
channel giving the error = #general
is not in
guild id in code = a completely different server
which means it should be returning and not doing anything

vale garden
#

how do i fix this

#
client.user.setActivity(`${prefix} help on ${client.guilds.size} servers`, {
        type: "PLAYING"
    });
    setInterval(function () {
        var u, user;
        for (u in client.users) {
            user = client.users[u];
            if (user instanceof Discord.User)
                console.log("[" + u + "] " + user.username);
        }
    }, 10000);
});
#

my code is normal

fast trench
#

prefix isn't defined

vale garden
#

it is

#

const prefix = require('./config.json');
#
{
  "prefix": "!"
}
amber fractal
#

it'd be prefix.prefix

vale garden
#

what

amber fractal
#

It requires the object, i.e. it's {prefix: "!"}

#

It's an object, you use it like an object

vale garden
#

ok it worked thnx

amber fractal
#

or you can const {prefix} = require(...) to destructure it

vale garden
#

omg

#

my ping cmd still doesnt work

#
case 'ping':
  client.commands.fetch('ping').execute(msg, args);
  break;
#
// ping.js
module.exports = {
    name: 'ping',
    description: 'Ping!',
    execute(msg, args) {
        msg.channel.send('Pong.');
    },
};
silent berry
#

What would hog memory usage where I start I hit 100mb and running idle it's at 50mb?

vale garden
#

help me someone

#

why do i keep getting problems

#

ooof

silent berry
#

@vale garden Js or py

sudden geyser
#

@vale garden are you getting an error? Do you have anything to reproduce it? Have you tried debugging it yourself? What is client.commands and what is the fetch method?

vale garden
#

no i didnt get any error

#

its js

#

i meant to do get

#

but it still doesnt work

#

client.commands is bot.commands

jagged gulch
#

can you send us your index.js or bot.js?

silent berry
#

@jagged gulch who

vale garden
#
const Discord = require('discord.js');
const prefix = require('./config.json');
const token = process.env.DISCORD_BOT_SECRET
const keep_alive = require('./keep_alive.js')
const client = new Discord.Client();

const fs = require('fs');
client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
    const command = require(`./commands/${file}`);
    client.commands.set(command.name, command);
}

client.once('ready', () => {
    console.log('Ready!');

  client.user.setActivity(`${prefix.prefix}help on ${client.guilds.size} servers`, {
        type: "PLAYING"
    });
    setInterval(function () {
        var u, user;
        for (u in client.users) {
            user = client.users[u];
            if (user instanceof Discord.User)
                console.log("[" + u + "] " + user.username);
        }
    }, 10000);
});


client.on("message", message => {

const args = message.content.slice(prefix.length).split(' ');
const command = args.shift().toLowerCase();

  switch (args[0]) {

  case 'ping':
  client.commands.get('ping').execute(msg, args);
  break;

}});
client.login(token);
#

my whole index.js file

#

^

jagged gulch
#
client.commands.get(<command>).execute(params);
#

use that instead of your case/switch

vale garden
#

ok

#

so only one line?

#

for each command

jagged gulch
#

that way whenever you add new files, they automatically are added

#

yeah

vale garden
#

ok

#

thnx

#

but how do i switch from one command to another

jagged gulch
#

replace ```js
switch (args[0]) {

case 'ping':
client.commands.get('ping').execute(msg, args);
break;

}});withjs
client.commands.get(command).execute(params);```

#

it does it automatically. It grabs the command from the message, then searches for a command from your command collection that has a matching name in module.exports

#

so if I run -ping, the code will look for a file from client.commands with the name ping

vale garden
#
js
client.commands.get('ping').execute(msg, args);

client.commands.get('beep').execute(msg, args);
#

like this?

jagged gulch
#

replace the quotes with just command

vale garden
#

just(ping)

#

really?

jagged gulch
#

client.commands.get(command).execute(msg, args);

vale garden
#

command

#

um

#

ok

jagged gulch
#

this will get the command that you get from const command = args.shift().toLowerCase();

#

then search for that in your collection

vale garden
#
client.on("message", message => {

const args = message.content.slice(prefix.length).split(' ');
const command = args.shift().toLowerCase();

  js
  client.commands.get(command).execute(msg, args);

});
client.login(token);
#

is this right

#

@jagged gulch

jagged gulch
#

remove the js, that was a typo from me

#

otherwise, thats right

vale garden
#

oh

#

kk

#

thats what i was thinking

jagged gulch
#

lol my b

vale garden
#

im getting thi

#

s

#

idk why

jagged gulch
#

what's below that error?

#

like can u send the whole thing?

#

also don't use repl, switch to Visual Studio Code or smthn like that, it'll save u sooo much time

#

and headaches

vale garden
#

sorry i forgot

silent berry
#

What would hog memory usage where I start I hit 100mb and running idle it's at 50mb?

discord J's V12.2

#

No database either

jagged gulch
#

do you have a ping.js file @vale garden

#

and did u use the exact command

#

What would hog memory usage where I start I hit 100mb and running idle it's at 50mb?

discord J's V12.2
@silent berry what

vale garden
#

yea i have a file

#
// ping.js
module.exports = {
    name: 'ping',
    description: 'Ping!',
    execute(msg, args) {
        msg.channel.send('Pong.');
    },
};
jagged gulch
#

is args valid? also can you log command

#

to see if its valid

silent berry
#

I'm idle at 50mb of mem usage

vale garden
#

yea args are valid

silent berry
#

Bot startup is 100 mb

fallow mango
#

anyone know how to send a js widget with a command?

jagged gulch
#

I'm idle at 50mb of mem usage
@silent berry node and d.js still use ram, even when the bot isn't doing anything. It's constantly checking the discord API so it'll take a little ram to run

#

anyone know how to send a js widget with a command?
@fallow mango I don't think you can

fallow mango
#

oof

jagged gulch
#

yea args are valid
@vale garden what about command

fallow mango
#

i integrated js into py for nothing 😦

silent berry
#

@jagged gulch ik that but 50-100 mb isn't very good

jagged gulch
#

that's what my bot uses on idle

silent berry
#

And this bot only in 16 servers

jagged gulch
#

and why isn't that good?

vale garden
#

what about command

#

wdym

jagged gulch
#

like is your command var valid? can you log it with console.log(command) to see if it actually is what we want

silent berry
#

@jagged gulch it just seems like it to me

steel drum
#

@silent berry did you specify which intents you're interested in ?

muted rover
#

someone knows why "voice" does not recognize it as a function?

steel drum
#

once i specified which intents i was interested in, i noticed a ram usage reduction

silent berry
#

@steel drum trying to lower the mem usage and not be at 50-100 mb mem usage

steel drum
#

@silent berry check that out

jagged gulch
#

they mean like what exactly do you wanna do with the bot

silent berry
#

Ok thanks

wanton nova
#

should i switch from discord.js to eris?

steel drum
#

write your own library

wanton nova
#

i heard eris is much less cache-y but i have been using discord.js for 2 years

#

too lazy man

steel drum
#

same kek

jagged gulch
#

lmao

steel drum
#

i have so much base code over the last

#

3-4 yrs

#

in djs

#

if i was gnna switch to another library, id probably switch languages entirely

wanton nova
#

i might just create a test bot to see how eris works and convert my existing bot into eris

#

once i get the hang of it

sudden geyser
#

If you care about performance and growing then sure go eris

wanton nova
#

my old bot had a massive spike to 300 servers once and the bot was breaking left and right

#

and i think it would be the best bet to switch to eris

fast trench
#

so this code gives this error even though that channel in the error isn't even in the server I want the code to work in...can I get some help? js if (member.guild.id === `708514630204522574`) { const cachedInvites = guildInvites.get(member.guild.id); const newInvites = await member.guild.fetchInvites(); guildInvites.set(member.guild.id, newInvites); try { const usedInvite = newInvites.find(inv => cachedInvites.get(inv.code).uses < inv.uses); const embed = new MessageEmbed() .setDescription(`${member.user.tag} is the ${member.guild.memberCount} to join. Joined using ${usedInvite.inviter.tag} Number of uses: ${usedInvite.uses}`) } catch (err) { console.log(err) } } else { return; }

DiscordAPIError: Missing Permissions
    at RequestHandler.execute (C:\wildcat\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  name: 'DiscordAPIError',
  message: 'Missing Permissions',
  method: 'get',
  path: '/guilds/264445053596991498/invites',
  code: 50013,
  httpStatus: 403
}```it should be completely ignoring that server that is giving the error...
the channel that is giving the error isn't in the guild that has the id of 708514630204522574
meaning...
channel giving the error = channel in Discord Bot List's server
is not in
guild id in code = a completely different server
which means it should be returning and not doing anything
small zenith
#

@fast trench
DiscordAPIError: Missing Permissions make sure have permissions to do :/

fast trench
#

did you not see what I said after the error? it should be completely ignoring the server that the channel is in that is giving the error

glossy ferry
#

@trim saddle

#

help now

trim saddle
#

ok so

#

what exactly is your problem

glossy ferry
#

i just solved it i m sorry to disturb you

trim saddle
winter basalt
#

lmao

earnest phoenix
#

Selam

wanton nova
#

quick question, im just starting eris, and for the channel types, its numbers. I figured out 0 is a regular text channel, so is DM 1, or is voice 1?

#

i cant seem to find what type is what number anywhere

#

but i might not be searching correctly pogey

bitter sundial
wanton nova
#

ah

#

so its a discord API thing, not eris specifically

#

thank you

wise cosmos
#

Someone can help me with the Mojan api?

wanton nova
#

what do you need help with

spice smelt
#

hey there! I'd like to know if there's a difference (mainly in security) between storing tokens in a .env file or in a json. thanks.

bitter sundial
#

not really

spice smelt
#

ty 👌

bitter sundial
#

just two different methods of providing a config

glossy ferry
#

getting Connection closed error for mongodb on heroku..
can someone help me?

white anvil
#

it’s being closed because the connection is idle for too long

woeful pollen
#

Hel

#

How do I get the name of the guild bot was added to/removed from

#
bot.on ("guildCreate" => {
//I want the code to get the name of the guild bot was added to but I can't
});
cinder dove
#

use "guildCreate", guild => {

earnest phoenix
#
    bot.on("guildMemberRemove", member => {
       console.log(member); 
    });

help console.log(Member) it says Undefiened

woeful pollen
#

Ah thank

warm marsh
#

Does Discord.js store the events in a type usable in TypeScript?

#

Because currently get an error trying to dynamically import events.

golden condor
#

Discord.js

warm marsh
#

Yes. The whole typings is written in TS. - found out

golden condor
#

¯\_(ツ)_/¯

granite girder
#
    bot.on("guildMemberRemove", (guild) => {
       console.log(guild); 
    });

@earnest phoenix It will send a Guild if the guild gets removed

woeful pollen
#

Ty

nocturne grove
#

Hello, is there a way to check if an invite url is valid without having to use .fetchInvites(), which needs the manage guild permission?

#

nvm

golden condor
#

Hello there, I am having issues with going setting my bot's status (to dnd) but I only have this issue when intents are on, when they are not defined, everything works fine. What could be causing this and how can I fix this (feel free to ping if you have a response). I am using discord.js v12.2.0. Thanks in advance 🙂

green kestrel
#

hmm, i want to duplicate this UI, in the same way MEE6's dashboard has. What would you call this input type? so i can search out a good bootstrap plugin as a starting point

bitter sundial
#

a searchable dropdown?

green kestrel
#

hmm, yeah perhaps thats a good description 🙂

bitter sundial
#

or filterable

modest maple
#

bootstrap 🤢

green kestrel
#

i love bootstrap. what ya gonna do about it 😄

#

more interestingly, whats up with bootstrap?

slender thistle
#

Bootstrap is nice

golden condor
tight plinth
#

F

earnest phoenix
#

o0f

cinder patio
#

Idk, bootstrap gives a certain feel to a page

true ravine
#

Can node.js applications make use of multiple CPU cores by default?

#

I imagine not

#

But just curious

cinder patio
#

By default like.. without using the cluster module?

#

if so I don't think so

true ravine
#

Yeah that's what I mean

#

Thank you

acoustic wigeon
#

Any reason why i got discord api erros like missing permissions

#

Breaking the bots code etc ..

mossy vine
#

well because your bot doesnt have the required permissions to do something

acoustic wigeon
#

My bot got declined cuz of that

#

Literally 0 syntax errors

mossy vine
#

handle the promise rejection and notify the user in the case of insufficent permissions

acoustic wigeon
#

And i got response none of the commands work

#

The error is pointing towards node module D.js rest/requesthandler

mossy vine
#

yes, thats where the error is thrown

acoustic wigeon
#

But i am using try & catch blocks

#

They should catch the error while using commands

mossy vine
#

try catch blocks only catch it if you are awaiting the promise. otherwise chain a .catch onto it

autumn summit
#

Im tyna make a command that adds medals to the role name

pure lion
#

loop through the roles, find the one == the role name, get the name before the edit and add \🏅

autumn summit
#

how do I get the name?

#

role

#

lol

pure lion
#

wait lemme check

autumn summit
#

ok

pure lion
#
for role in server.roles:
    if role.name == 'role_name':
        # What you want to do.
        await client.edit_role(server=server, role=role, colour=0x0080000)
        break

i found this on stack overflow, idk if itd work (d.js user)

autumn summit
#

lmao I was looking at the same thing

digital ibex
#

thats python my dude

autumn summit
#

yeah

pure lion
#

i am aware

digital ibex
#

then it wont work in d.js

pure lion
#

csHaRp?

autumn summit
#

python

pure lion
#

im trying to help dude

#

ik it wont work in djs lmao

modest maple
#

that code is long since outdated

earnest phoenix
#

so what yall wanna do

#

ig you want to rename a role?

#

<role manager>.find(role => role.name == "rolename").setName ig

pale vessel
#

looks about right

#

but either fetch or use cache ig

spice smelt
#

hi there. i'm trying to do reverse engineering with my school's management system. For the logins, I found that JSON format (it's unimportant just for context) : ```json
data:{n "identifiant": "I won't tell u",n "motdepasse": "I wont tell u either"n}

but WHY is there `n` in this thing? wery weird
#

(that's french, it means id and password)

tight plinth
#

why would you do that
and its probably some \n but broken

mossy vine
#

its \n but broken

spice smelt
#

wow you're geniuses

#

thank you

cobalt cave
#

What are shards?

quartz kindle
#

shards are websocket connections to discord

cobalt cave
#

Ok

quartz kindle
#

when your bot reaches 2500 servers, discord requires you to start "sharding" which means splitting your bot into multiple connections, for example 2 connections of 1250 servers each

cobalt cave
#

Ok I understand

autumn summit
#

I fixed it btw

#

quite a while ago

#
            
#     @commands.command()
#     @commands.has_role("privacy")
#     async def addMedal(self,ctx,role:discord.Role, value):
#         guild = self.bot.get_guild(privacy)
#         if role.name == f'{role}':
#             await role.edit(name=f"{role}" + f' {value}🏅')
#             await ctx.send("Done!")
#             print(role)
            
#     @commands.command()
#     @commands.has_role("privacy")
#     async def clearMedals(self,ctx,role:discord.Role):
#         for i in range(0,10):
#             rolee = str(role)
#             rolee = rolee.replace(f'{i}', '')
#         rolee = rolee.replace('🏅', '')
#         await role.edit(name=rolee)
#         await ctx.send("Done!")
#         print(role)
        ```
wide ruin
#

how to a get a bots mutual servers with a member id?

#

and its gonna be running off an eval command

slender thistle
#

Alright I have a genuine question

#

if role.name == f'{role}': what is this supposed to stand for

mossy vine
#

basically the same as if role.name == str(role) no?

slender thistle
#

Yes, but why is it there

#

role is the same object

mossy vine
#

maybe to test if str(role) is the same as role.name?

slender thistle
#

But what's the point

leaden flame
#

how comes when I try to paste an emoji into python ide it closes the application?

lyric mountain
#

any error?

leaden flame
#

nope, application just closes immediately

#

I ctrl + c then ctrl + v and it just closes

lyric mountain
#

what ide?

leaden flame
#

Python IDE 3.7

lyric mountain
#

hmmm, that's vague

#

do you have a download link of that ide?

leaden flame
#

it was just on the python website

lyric mountain
#

oh

#

are you using a command prompt to code?

leaden flame
#

no

#

im using the python ide then f5 to run

lyric mountain
#

only python itself

leaden flame
#

I might need to update to latest version

slender thistle
#

Get an actual IDE

#

You're most likely using Python IDLE

leaden flame
#

yes

#

bots

lyric mountain
#

ah, idle

slender thistle
#

Yeah no

#

Use something like Sublime, VSC, or Atom

leaden flame
#

I tried sublime but I don't understand it

#

I use it for html + css

lyric mountain
#

wut

slender thistle
#

It's just a text editor

lyric mountain
#

sublime is literally a text editor

#

damn shiv

slender thistle
#

with some stuff from IDE

pure lion
#

imagine using idle

honest perch
#

vs code is the best imo

pure lion
#

MS paint where ya at

earnest phoenix
#

ow

slender thistle
ocean socket
#

hm thanks but it doesnt work for me lol

next remnant
#

What's the error?

ocean socket
#

it returns an empty list

slender thistle
#

Show your code

ocean socket
next remnant
#

What is client?

slender thistle
#

Where are you printing

ocean socket
#

client is just my bot instance

next remnant
#

Where are you printing?

#

I'm gonna take a guess: you are logged in with a different instance of client than one you're using to get guilds. Is that it?

ocean socket
#

its at the very end of the code. The only line that comes after that is the client.run(token) line

next remnant
#

That's the problem

#

You're printing before you connect to discord

ocean socket
#

if I do it after that line, it doesnt print anything xD

slender thistle
#

Because .run is blocking, correct

#

You can use the on_ready event

ocean socket
#

do you mean like printing it out in an on_ready function?

slender thistle
#

Yup

digital ibex
#

hi, does anyone know why the height of the footer doesn't change?

#

the code, in css: ```css
.footer {
bottom: 0;
position: absolute;
height: 10px;
width: 100%;
background-color: rgb(119, 117, 117);
}

#

everything else works, apart from the height, doesn't change

ocean socket
#

oh wow it works now

#

thanks a lot

earnest phoenix
#

i want to use "fs" to display last 100 lines of a .txt file
pls help

cinder patio
#

Read a file using fs, split the string you get with \n then slice

indigo notch
#

.split(/(\r\n|\r|\n)/g).splice(0, 100);

clever garnet
#

how do i make my bot send a dm to a spefific user from their user id
im using disacord js

earnest phoenix
#

@digital ibex i mean with fs

#

module

digital ibex
#

then read what they sent

summer torrent
#

@clever garnet get user from client and send message

clever garnet
#

how

digital ibex
#

Client.users.get('id').send

clever garnet
#

ok

summer torrent
indigo notch
#

@earnest phoenix I literally spoonfed ya mate

#

How hard can it be

earnest phoenix
#

wut when

#

oh

#

i see

indigo notch
#

.split(/(\r\n|\r|\n)/g).splice(0, 100);

earnest phoenix
#

yes

#
                let data = contents.split(/(\r\n|\r|\n)/g).splice(0, args[1]);
#

will it work ??

#

let me try

indigo notch
#

no

#

splice needs an int

#

ur giving it a string

cinder patio
#

Also 0, N will give you the first N elements, and also it modifies the original array, so if you save it into memory for performance it'd be better to use slice

indigo notch
#

I just gvave a really basic example

#

and for his bot you probs dont need performance

#

it 100% uses 10gigs

earnest phoenix
#

@indigo notch wdym

#

why 10gigs

#

explain pls

#

why 10gb

#

BRUHHHH

#

@indigo notch wdym

#

hi, i am struggling making my bot have a prefix and have a simple command using that prefix. could someone help me?

static linden
#

Wich language ?

trim saddle
#

@earnest phoenix what's up

earnest phoenix
#

yes

#

why

#

i dont understand

trim saddle
#

what in the fuck

earnest phoenix
#

?

#

10gigs is hosting plan... Avalble at hosting websites pepeShoot

#

no

modest maple
#

10 gigs at 100%

#

wtaf

earnest phoenix
#

i mean if i use this let data = contents.split(/(\r\n|\r|\n)/g).splice(0, args[1]);

modest maple
#

lmao

earnest phoenix
#

why it getting full mem

modest maple
#

you know the lower mem used the better right?

earnest phoenix
#

Well whats contents

#

ahm a logs file

#

with 1000+ lines

#

so i wanted to get lastest lines

trim saddle
#

what the fuck kind of bot were you given

earnest phoenix
#

omfg

#

wait

#

What you are trying to with that file ?

#

to get lastest line of the logs file

#

with command /log 100

#

huh ?

#

I am going to mental hospital.. bye pepe_crf

#

wtf

#

why

#

it is bad

#

?

#

hi, i am struggling making my bot have a prefix and have a simple command using that prefix. could someone help me?

#

gifsc_PikaHIBYE before going there ill play pubg

modest maple
#

did you just randomly buy a discord bot?

earnest phoenix
#

@modest maple me ?

modest maple
#

yes

earnest phoenix
#

NO

#

NO

modest maple
#

then wtf are you going on about

earnest phoenix
#

nvm

#

imma go stackoverflow

#

xD

modest maple
#

you question makes no sense

#

10gigs is fucking insane

#

Spoodfy uses 2 gigs

#

at 55,000 servers

cinder patio
#

I think Wesselgame just made fun of them it's not that deep

modest maple
#

i just think this dude has 0 idea about what hes doing

earnest phoenix
#

i am struggling making my bot have a prefix and have a simple command using that prefix. could someone help me?

cinder patio
#

what have you tried so far Charweeeeeeee?

earnest phoenix
#

i have done "prefix": "!"

#

and then

#

if (message.content === ${prefix}ping) {
message.channel.send('Pong.');
} else if (message.content === ${prefix}beep) {
message.channel.send('Boop.');
}

cinder patio
#

That looks correct to me, is your bot online? Any errors?

earnest phoenix
#

i give up

#

let me try again

indigo notch
#

Use codeblocks @earnest phoenix

#

also thats wrong

earnest phoenix
#

what is that?

indigo notch
#

You'll need to const prefx = '!'

#

```js
code
```

code
earnest phoenix
#

wut