#development

1 messages · Page 1618 of 1

opal plank
#

either be patient or buy a faster pc

hoary vine
#

there we go

#

its installed

opal plank
#

restart ur terminal

hoary vine
#

OH MY GOD ITS NOT WORKING

opal plank
#

then restart ur pc

hoary vine
#

why

opal plank
#

well then dont

#

whats the point of asking for help if you arent going to listen?

hoary vine
#

i dont wanna restart

earnest phoenix
opal plank
#

just restarting your terminal should be enough, but a lot of apps require a system reboot to apply changes

#

specially when they change shit in registry

#

then dont restart ur pc, figure out another way to make it work

#

good luck

sterile lantern
#
let inventory = `${bot ? "Bot" : ""}` + `${item2 ? "Item2" : ""}`

works but if you have both bot and item2 it just does
BotItem2
i tried putting \n for item 2 but then if you dont have bot theres a space

hoary vine
#

what

Error: Cannot find module 'discord.js'
Require stack:
- C:\Users\Lenovo\Desktop\me\me\New bot\My_Bot.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\Lenovo\Desktop\Kids Stuff\Riot\New bot\My_Bot.js:1:17)   
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {    
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\Lenovo\\Desktop\\me\\me\\New bot\\My_Bot.js'
  ]
}```
sterile lantern
#

download discord.js

hoary vine
#

how

sterile lantern
#

well install rather

#

npm i discord.js

#

in terminal

#

or wherever you run your commands

hoary vine
#

oh i did it

opal plank
#

im gonna hit them with the learn first before they do it

rustic nova
opal plank
#

cuz i can see them coming here every 2 seconds asking why it doesnt wrk

opal plank
# hoary vine oh i did it

Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:

  • proper syntax
  • debuging code
  • basic features (vars, arrays, objects, functions)
  • read and understand docs
  • nodejs module system

As much as we d like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.

Here are good resources to learn both Javascript and NodeJS:

Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie s Accelerated JS: https://js.evie.dev/

Please take a couple of weeks/months to get acquainted with the language before trying to make bots!

hoary vine
#

OMG

#

TYSM

#

MY BOT IS ONLINE

misty sigil
#

fun

hoary vine
#

@misty sigil TYSM

misty sigil
#

what

earnest phoenix
#

dementia

hoary vine
#

I GOT IT ONLINE

#

Learn to code a Discord bot with JavaScript using Node.js.

🔗 Written Tutorial - https://www.devdungeon.com/content/javascript-discord-bot-tutorial
🔗 Unicode Emojis - https://unicode.org/emoji/charts/full-emoji-list.html
🔗 Official Documentation - https://discord.js.org

Tutorial by Dev Dungeon. Check out their YouTube channel: https://www.youtu...

▶ Play video
solemn latch
#

lol

misty sigil
#

lmao

sterile lantern
#

i mean if i checked if each inventory value was false, it would work

#

but then thatd require checking for each item

#

so idk

earnest phoenix
#

ternary is supposed to be used for short hand operations so you don't have to type out a full if else

#

if you're going to scale this

#

you're better off using if else/switch

sterile lantern
#

yeah im using it for something short

#

the only issue is spacing

earnest phoenix
sterile lantern
#

o

#

but if they dont have item 1 and have item 2

#

it'll be

#

Inventory:

Item2

#

instead of
Inventory:
Item2

earnest phoenix
sterile lantern
#

wait

#
let inventory = `${bot ? "Bot" : ""} ${item2 ? "\nItem2" : ""}````
#

this worked

#

lol

#

nvm it didnt

#

i have both items

regal sleet
#

@sterile lantern

#

i want to make my bot online

earnest phoenix
#

pray to discord gods

sterile lantern
#

LMFAO

earnest phoenix
#

your prayer will be answered in 3-5 business days

sterile lantern
#

^

hoary vine
#

how do i make it so the bot sends a message?

sterile lantern
#

Alright bud

#

And start reading

#

OR

quartz kindle
#

wtf js

#

explain yourself

hidden lynx
#

lol that even works with that n hahah

earnest phoenix
#

why’s everyone here JS

proven lantern
#

JS won the program wars back in 1995

hidden lynx
#

xD

earnest phoenix
#

JS is fat

#

python better

hidden lynx
#

don't think so

earnest phoenix
#

i do

#

what’s all this { “embed”: }

#

like

hidden lynx
#

you call that Syntax. that's sth python doesn't know

earnest phoenix
rich steeple
#

You guys do js or python?

hidden lynx
#

js

rich steeple
#

Noice

sudden geyser
#

both

ebon rock
#

@rustic nova

rustic nova
#

just ask here

#

and wait for someone

strong sinew
#

bot.guilds.size.toLocaleString() is coming out as 0. Anyone have any ideas why? And no, its not because the bot is in 0 guilds Fixed it

earnest phoenix
#

@rustic nova how do I exist

rustic nova
#

you breathe

earnest phoenix
#

you sound like a baby sitter buddy

rustic nova
earnest phoenix
#

like a good one

earnest phoenix
strong sinew
#

cause I can

#

intents are on mate

grizzled raven
earnest phoenix
#

🤌

earnest phoenix
strong sinew
#

I use v11

earnest phoenix
#

oh

strong sinew
#

:P

earnest phoenix
#

you should get v12

strong sinew
#

neh, to many cache's

earnest phoenix
#

understandable have a great day

strong sinew
#

I'll update when discord forces me to

hoary vine
#

How do I fix this? I forgot

solemn latch
#

disable requiring code grant on your bots discord page

rustic nova
#

best is to not send your full bot url @hoary vine ThumbsUp

hoary vine
#

Thanks

rustic nova
#

you sent your bot url, that's what i mean

hoary vine
#

And

#

??

#

@rustic nova

rustic nova
#

yeah it's considered advertising, though i think that was in context of help was it?

hoary vine
#

Ok

#

Sorry

solemn latch
#

well, it was an unrelated help question

rose warren
#

Anyone else getting sharding problems?

mental nexus
#

Can't delete bots from top.gg listing? I've emailed the support team but have not heard back. Is this a known issue?

rustic nova
true swallow
earnest phoenix
quartz kindle
rose warren
#

D:

#

Whyyyyyy

quartz kindle
#

do you have fetchAllMembers:true?

rose warren
#

My code has been working fine. Where would that be set? In client options?

pallid quail
#

I misread that as
"How do I add a bot?"
"Cry."

quartz kindle
#

but if you dont then its not the reason

#

do you do any kind of heavy work on start?

#

like loading data from a database

#

or from files

rose warren
#

I don't have fetchAllMembers set. It logs into the db on ready.

#

And loads the command files

#

Basic stuff

quartz kindle
#

try logging the debug event

#

client.on("debug", console.log)

rose warren
#

That the problem?

#

Sorry for the ss

#

I can't get to my computer right now

quartz kindle
#

you logged in more than 1000 times in a single day

rose warren
#

What? 👀

#

How on earth?

quartz kindle
#

you probably got stuck in an error loop

#

login crash login crash

rose warren
#

Open ticket?

quartz kindle
#

no

rose warren
#

Wait?

quartz kindle
#

you have to wait 21 hours before you can login again

rose warren
#

Omg

quartz kindle
#

do you have error logs?

#

are you using pm2?

rose warren
#

Yeah

#

I'm gonna have to pull them up

quartz kindle
#

ye

#

pm2 log --lines=1000

rose warren
#

Ugh... It's because of an unavailable guild

#

Shard 4 got caught in an error loop

quartz kindle
#

rip

icy skiff
#

hi Tim

mighty ember
#

is the website STILL broken?!?!?!

icy skiff
mighty ember
#

🤦

#

it's been a week

icy skiff
#

yeas

mighty ember
#

will the ever fix it? (not actually ever, just in the next month)

icy skiff
#

there is no ETA atm

woeful pike
#

the website isn't completely broken, just specific features we want to take time to fix without breaking more stuff

#

just extra frustrating for creators rn

#

which I can understand

mighty ember
opal plank
#

xetera

woeful pike
#

go for it

opal plank
#

while you're here

#

erm

#

might've found something

#

erm.... interesting

#

to say the least

#

idk if this is still on the "migration"

#

but a string on a user image is kinda weird

lyric mountain
#

Looks like a placeholder

woeful pike
#

i mean those aren't pictures so it makes sense that they aren't draggable

opal plank
#

thats what im assuming

#

but figured i'd ask

woeful pike
#

it shouldn't be completely transparent tho

opal plank
#

it just seems odd that its a string instead of a placeholder image

woeful pike
#

doesn't seem too weird to me

opal plank
#

a T as a default image?

lyric mountain
#

Placeholders are based on user name prob

#

T

#

Tsumugi

opal plank
#

what bugs me is that its a string tho

#

if its not a bug its whatever, ignore me if thats the case

#

but i would've assumed placeholders would be default images

#

and not strings

lyric mountain
#

Dynamic placeholders

#

There probably should be a background color to maintain aesthetic

lyric mountain
quartz kindle
#

xexexexexexexe

mighty ember
#

going to make a website... first step: learn how to program javascript and HTML, second step: learn how to make a website

#

definitely going to take a while

lyric mountain
#

Or just jump to js + react

earnest phoenix
#

hey help me
Can't add bots

opal plank
#

cough cough npm i boilerplate cough cough

earnest phoenix
mighty ember
woeful pike
#

idk maybe it's something to iterate on later but not at all important rn

lyric mountain
#

React ain't html

mighty ember
#

exactly

#

i know nothing about either

#

only python for my bot

lyric mountain
#

Use flask then smh

opal plank
mighty ember
lyric mountain
#

Are you healthy erwin?

#

Maybe it's corona

opal plank
#

definitively corona

blissful coral
#

erwin is gonna die

#

elder age

quartz kindle
#

yes

#

corona beer

earnest phoenix
#

hello wheres the place to ask about topgg page? i want to ask something

robust fern
#

yo is there where i can ask for help on code discord.js

#

oh wait yes

#

lmayo

#
if(warnings === 3) {
            const mutingrole = db.get(`muterole_${message.guild.id}`);
            if (!mutingrole) return message.channel.send('There is no mute role, set one using the command `<setmuterole <role id>`');
            
            var role = message.member.roles.cache.find(role => role.name === mutingrole);
            
            if(mutingrole) user.roles.add(mutingrole);

            message.channel.send(user + 'has been muted')
        }```
lol js code lmayo ok bye

TypeError: Cannot read property 'add' of undefined user.roles.add how do i add roles. tryign to make a warn command and it doesnt add role
#

tbh the var role is just there

robust blade
#

how do you find out how many users is using ur bot?

odd stratus
river panther
#

can someone explain how to do slash commands to me?

brittle haven
#

how to do webhook upvote messages

teal hare
#

What is comand Mute (BDScript)

odd stratus
river panther
#

is this somewhat correct for slash commands?

latent heron
#

i got it to work the way i wanted it to

river panther
#

bruh

#

you pushed mine up

#

-.-

river panther
latent heron
#

yeah

#

this is just a chatting channel for bot dev

#

i have stuff i like to share too lol

river panther
#

ok ok, can you tell me if i am correct there or not?

latent heron
#

idk djs lol

river panther
#

oh

#

sadness intencifies

fallow hill
#

Sorry

fervent stirrup
#

Spanish md pls devs

swift cloak
#

how to get 2 terminals open for aws?

#

is that possible?

river panther
#

can someone help me with application.commands scope

pale vessel
latent heron
#

i can, that is just testing code

#

will organize it later in a bit

swift cloak
#
            if(message.content === `<@!${client.id}>` || message.content === `<@${client.id}>`)
earnest phoenix
latent heron
#

the last used one, correct

#

This is a clever solution (at least I think it is) where instead of checking for if a webhook is present in every channel, I check for the bot integrations list for a webhook

#

then i re-brand it and change it to a new bound channel

earnest phoenix
#

So you're not deleting the one named Transword

latent heron
#

well i am

#

it's a little hard to explain without seeing how it is processed

earnest phoenix
#

If I were to check if it exists, I'd do any(hook.name == 'Transword' for hook in webhooks)

If I were to delete the one named Transword,
hook = discord.utils.get(webhooks, name='Transword'); await hook.delete() if hook else None

1liner ftw

latent heron
#

thank you for sharing your approach

#

anyhow, i will be working on the message listening event today for how the messages will be converted and translated

boreal iron
#

Since content isn’t trimmed even using a space behind the mention will not trigger your statement

swift cloak
#

wait

#

ok sorry i fixed

#

check my code again

boreal iron
#

If you wanna know if the whole messages includes that mention, then use message.content.trim().includes(...)

swift cloak
#

yep i know

#

i just want a direct mention

crimson vapor
#

msg.content.replace(/[<@!>]/g, '') === ID is what I do KEKW

boreal iron
#

Shhh

swift cloak
#

thats more complicated tbh

old cliff
#

No

#

Thats simple

#

Regex

swift cloak
#

just check if the content includes a mention

old cliff
#

Yes

#

message.mentions.users.first()

swift cloak
boreal iron
#

Regex is a mystery for the most people @crimson vapor

swift cloak
crimson vapor
old cliff
boreal iron
#

lmao

swift cloak
crimson vapor
#

I search: "regex for X" and pick and test the first one

boreal iron
swift cloak
old cliff
#

Just do a regex check

#

If you wanna use mention as prefix

#

Wait let me send my regex from my secret code

swift cloak
boreal iron
#

Once again u wanna check if the content include that mention or if the whole message is the mention only? krabby

#

Working with match groups and conditions in regex is “complicated”

swift cloak
#

if you want to check the whole message just do js message.content.includes()

#

but i just want a direct mention

boreal iron
#

You wanna check if the mention is your client id?

swift cloak
#

yes

#

but i got it alr

boreal iron
#

If so message.mentions.first().id === client.id is your way

old cliff
#

new RegExp(`^(<@!?${client.user.id}>|${escapeRegex(prefix)})\\s*`);

boreal iron
#

Doesn’t make sense to search or split strings if a property with the mentions already exists

old cliff
#

Check google for escapeRegex function

crimson vapor
#

what the fuck

#

is this

inner token
#

Is there anyone that know if its possible to apply for a higher youtube api quote limit for my bot or google doesnt accept?

old cliff
#

Qhat ?

old cliff
crimson vapor
#
if(msg.content.includes(client.id) && (msg.content.length = 22 || msg.content.length = 21)) // do shit```
old cliff
#

What if you randomly write bots id somewhere and it executes code ?

crimson vapor
#

bro ik

boreal iron
#

Happens if you’re still awake at a time you should sleep okeh

crimson vapor
#

its the weekend tho

#

no sleep till tired

old cliff
#

Its saturday and I have to study

#

For exams

crimson vapor
#

ah rip

boreal iron
#

Well I’m working 7 days a week.. so doesn’t count for me

crimson vapor
#

oh yikes

old cliff
#

Not a self promo tho

boreal iron
#

At least optimized for mobile

old cliff
#

Worked hard on that

boreal iron
#

Well entering a link and hitting enter reloads the site without a JS scroll down event to get to the select element of the link again?

#

Just show the select link type element before hitting the button and scroll down to the result again via JS after sending it

river panther
#

guys, is the discord developer's license good?

old cliff
#

I didnt get it

#

The link creation is on a different page

#

The home page just redirects to that page with the entered link

#

As data

boreal iron
#

Well then scroll down to the select element if JS detects scroll down is needed

#

It redirects me as u said and I’m back on top of the page after entering the link and confirming the form

#

Need to scroll again...

old cliff
#

Ok

#

Will try to fix

boreal iron
#

Quite easy for example using jQuery

old cliff
#

Will just use #section tags

boreal iron
#

Yeah that’s a method, too

#

Based on you’ve built the site of course

old cliff
#

I found a little bug which breaks the ui on mobile a bit after creating a link

boreal iron
#

Not that I could take a look at the source code on my mobile device

spare portal
#

im trying to get the mentioned user to just their username, but it keeps showing the id

whoToCheck = msg.content.substring(10);
mention = msg.mentions.users.first();
  if(whoToCheck === "") {
    whoToCheck = msg.author.username.toLowerCase();
  } else if (whoToCheck === mention) {
    whoToCheck = mention.username; /* supposed to change, e.g., @CrashRocks1419#1750 to just CrashRocks1419 */
  } else {
    whoToCheck = msg.content.substring(10);
  }

how can i make just the username show in the title?

drifting shell
#

how do bots get notifs for when channels post new content on youtube, is it just a periodic query or is it a post you can get from youtube

boreal iron
#

Or since you defined it already mention.username

spare portal
boreal iron
#

Oh nvm I see...

drifting shell
#

for whoevers question the rounding thing was

#

actually use this instead Math.ceil((N+1) / 10) * 10;

boreal iron
tight nimbus
#

yup

boreal iron
#

The username property includes the tag, not the nickname property for members

spare portal
#

so it would be

whoToCheck = msg.content.substring(10);
mention = msg.mentions.members.first();
if(whoToCheck === "") {
  whoToCheck = msg.author.username.toLowerCase();
} else if (whoToCheck === mention) {
  whoToCheck = mention.user.username;
} else {
  whoToCheck = msg.content.substring(10);
}
boreal iron
#

Nope

spare portal
#

oh

boreal iron
#

mention.user.username doesn’t exist as property

#

wayToCheck = mention.nickname;

spare portal
#
whoToCheck = msg.content.substring(10);
mention = msg.mentions.users.first();
if(whoToCheck === "") {
  whoToCheck = msg.author.username.toLowerCase();
} else if (whoToCheck === mention) {
  whoToCheck = mention.nickname;
} else {
  whoToCheck = msg.content.substring(10);
}
boreal iron
#

*whoToCheck I mean...

old cliff
boreal iron
#

Hooo.. oh god no

#

Never use client sided JS bullshit for forms

tight nimbus
boreal iron
#

At least not to check the user inputs

#

And using JS over PHP... god no

tight nimbus
spare portal
boreal iron
tight nimbus
#

wait crash, read to Fake

spare portal
old cliff
#

Ok lol

boreal iron
#

Is the user cached?

#

Looks like not

drifting shell
#

how do bots get notifs for when channels post new content on youtube, is it just a periodic query or is it a post you can get from youtube?

primal sorrel
#

Are webhooks working now ?

tight nimbus
#

Crash, because only not use

const mention =
      msg.mentions.members.first() ||
      msg.guild.members.cache.get(args[0]) ||
      msg.member;

FaKe, is that correct?

drifting shell
#

I know that

#

I was just saying is it something youtube can send to you, or is it something you request from them

boreal iron
#

Just guessing common big APIs will never send something to you... it has to be fetched always

#

That’s the reason why limits existing

drifting shell
#

that was my guess

#

just wanted to confirm it mmLol

spare portal
#

according to my friend you can't ping in an embed title

boreal iron
#

If args would be the mention including the <!@ ... string you won’t be able to search the cache including that string and the id

cinder patio
#

if there's a mention the first condition will work though

#

looks fine to me

tight nimbus
#

the second condition is for ID

boreal iron
#

Hmm but it’s needs to be the id or exact name to trigger the second condition

tight nimbus
#

yap, The first is for a mention, second for the ID, and third if no have mentions

boreal iron
#

Yeah as I said it depends on how and what he enters

tight nimbus
#

yap

boreal iron
#

If he’s still getting the id only as result the user isn’t cached

#

That’s his only issue

earnest phoenix
#

yea?

boreal iron
#

That’s why I said he can take the mention.id and search the cache or fetch the member

tight nimbus
#

yeah, is better

#

but will "optimize" the code with that

boreal iron
#

Yeah but your suggestion will still not work if he mentioned a user which isn’t cached for whatever reason

#

That would require to search the cache or force a fetch

tight nimbus
#

not all members are cached?

boreal iron
#

Huh depends if you’ve enabled it or it

#

And sometimes some things aren’t getting cached properly for reasons okeh

#

That’s the reason you can force a fetch

tight nimbus
#

woah, interesting

boreal iron
#

I don’t need caching for example and disabled it

tight nimbus
#

is better?

boreal iron
#

Always depends on your purpose of course

#

My bot just requires to fetch external APIs and my databases and doesn’t need any cached user data, roles, emojis etc.

#

If your bot has to deal with users, permissions, roles etc. it won’t make sense to disable just to fetch it all the time u need it

cinder patio
#

My bots used to cache only roles and permission overwrites

tight nimbus
#

yeah, same... My bot use to roles and emojis

blissful coral
#

It all depends on what your doing

boreal iron
#

Aye to be more detailed I’m caching the same only caused by a few privileged commands users with specific permissions can use only

tight nimbus
#

woah

boreal iron
#

Same as Feud...

#

Anyways time to get some sleep doggowave

slender thistle
#

Sleep well

tight nimbus
#

Nights man weirdsip

boreal iron
#

😘

blissful coral
#

gn guys

safe creek
#

which is better? an sql db or mongo db? caz i have both extenetions to do with both of them on vsc installed and want to know which one is best iin terms of memory

#

and stuff

opal plank
#

specially postgres

safe creek
#

oooh ok

cinder patio
#

It really depends on the data you're storing

opal plank
#

i think i got a a couple hundread million entries on postgres and its using less than 2gb

#

but the tables are quite huge

safe creek
#

well im storing bans, warns etc and having an eco system so

cinder patio
#

You can use either one

opal plank
#

redis might be a worthy candidate if you worried about size

#

specially for memory

safe creek
#

yes please

opal plank
#

as in ram

#

not physical mem

safe creek
#

how good is it in perfomancce?

opal plank
#

fast

#

like

#

REALLY fast

safe creek
#

and do i have to install it?

opal plank
#

redis is meant to be abused

safe creek
#

im using a 32bit laptop so

opal plank
#

its linux only, so keep that in mind

safe creek
#

oh

opal plank
#

you'll need to install a vm for it

safe creek
#

well then i cant

opal plank
#

i got it running on windows

#

you sure can

#

im on windows

#

and using redis on a vm

#

wls

safe creek
#

well im on a shitty 32bit laptop

#

so

opal plank
#

doest matter

#

should work just fine

safe creek
#

bit you gotta think

opal plank
safe creek
#

i got to host it locally right?

opal plank
#

no, i got both

#

i got a development server(locally) and a production server(on a server)

safe creek
#

because i dont want to run something locally more than i have to

#

i dont have as erver so

opal plank
#

my point being, you can run it locally

safe creek
#

oh ok

#

ye but i cant really as my disk is shit

#

its a hdd andd not ssd

opal plank
#

even more reason to use redis

safe creek
#

so that gets capped pretty easy

opal plank
#

since its memory persistent

safe creek
#

hmm

#

so many dbs

#

xd

opal plank
#

you gotta do research on what you need tbh, its use case

#

right ool for right job

#

redis is amazing cuz its meant to be abused

safe creek
#

ye

opal plank
#

it can hold 40k queries per sec

#

let me see if i can find it

lusty quest
#

redis is crazy fast, but for a cold storage i would still use SQL or NoSQL
and redis maybe for caching

opal plank
#

@lusty quest @safe creek

safe creek
#

wow

opal plank
#

redis can handle up to 200k ops per second

#

which is ABSOLUTELY overkill

lusty quest
#

i know

opal plank
#

like i said, right tool for right job

safe creek
#

wow they love being slapped on the ass eh xd

opal plank
#

stuff like top.gg would profi a bunch of using redis

#

so did my leviathan thing

safe creek
#

true

#

looks pretty good

opal plank
#

but like i said, its completely up to your app

#

i wouldnt recommend going this overkill unless you got a reason to do it

safe creek
#

but how preservant is it with my comps stuff

#

will it effect me alot or no

opal plank
#

the reason why i recommended redis for you is to use your ram instead of your disk write speed

#

not because it can do a lot of ops

lusty quest
#

i have MongoDB storing stuff and then redis as a cache to not hammer Mongo with a request on each message

opal plank
#

ram is faster than disk

safe creek
#

true

opal plank
#

by a mile

safe creek
#

ye

#

ik

lusty quest
#

also Mongo dont cache in ram unless you get a License

opal plank
#

so you could use the fact that redis uses ram to take care of your slow disk write/read speeds for memory

safe creek
#

i still need to switch my hdd with an sdd and upgrade from 32bit to 64

#

but i gotta pip install so much again then

lusty quest
#

what are the specs of your laptop? maybe getting a Raspberry Pi would be smarter

cinder patio
#

you could also use a cloud db like mongoDB atlas

opal plank
#

you could alternatively keep stuff in memory instead of using a db

river panther
#

is dual booting good?

opal plank
#

use a normal db for persistent data, load in memory lazily

river panther
#

i have windows right now, so ig maybe i also download ubuntu

safe creek
#

if so give me 2

opal plank
#

you dont need dual boot to abuse both

#

you can always use wsl

#

and install a vm

lusty quest
#

or run VMs

river panther
#

ok ok

#

which one is better?

#

oracle?

safe creek
lusty quest
#

for creating VMs or running WSL over a VM?

opal plank
#

here we go, windows and ubuntu together

river panther
#

idk shit abut vms and stuff

opal plank
#

imma send you the same tutorial i used

#

one secv

lusty quest
#

i have a Ubuntu VM running in my FreeBSD NAS, its quite easy if you understand how

#

but WSL is way easyer

opal plank
river panther
#

ok ok ok ok ok

#

also, did you guys understand how to use slash commands?

lusty quest
#

i dont use them

opal plank
#

the ONLY reason i installed the GUI locally is that i absolutely despise tree navigation from terminal

river panther
opal plank
#

ls cd ls cd something etc

safe creek
#

just need a sdd instead of an hdd

opal plank
#

its so annoying

#

tree nagivation from terminal is a pain in the ass imo

lusty quest
opal plank
#

so im happy with remote desktop

#

im gonna be very frank

safe creek
lusty quest
#

ive tryed remote desktop on linux, but terminal is king

opal plank
#

im unable to work with anything below 12Gb ram

safe creek
#

when we have time

#

but my disk is hdd and not sdd

#

so it has a hard time with the disk

opal plank
#

shouldnt matter

#

that matters mostly when gaming

safe creek
#

but it does

opal plank
#

it dont

lusty quest
#

if you cant figure out how to navigate in a terminal install midnight commander

safe creek
#

because it cant handle vsc, discord and 1 - 2 chrome tabs

opal plank
#

i absolutely doubt you're going to be capping your write/read speeds running a simple db

safe creek
#

so

#

i mean with everything else open then i will

lusty quest
#

how old is the laptop?

opal plank
#

then at that point why not invest in a raspberry pi?

safe creek
#

idk we bought it from some guy in france from ebay

safe creek
lusty quest
#

well better go for a RPI and you will be better set

safe creek
#

mmmk

opal plank
#

though if you plan on upgrading your pc, there wont be much gain apart from electricity

lusty quest
#

but you might want to invest also into a External HDD or SSD for the PI bcs the SD card will die fast if you have everything running off it

opal plank
#

if you plan on selfhosting a bot, you'll need to keep your pc on 24/7

#

alternatively you could pay 5-10$ a month for a vps

safe creek
#

my battery broke so i habve to keep my cord in

opal plank
#

which would solve all of your issues

safe creek
#

plus it dont matter

#

since in the uk we have thexse keys

#

we put money on

#

to get electric

#

so we dont really pay bills? depending where you live

#

and if the house uses them or not

#

so electric is np

opal plank
#

just remember electricity isnt the only issue

#

if you're using your laptop as host

safe creek
#

yes ik

opal plank
#

you'll need to keep it on 24/7

#

so, bye bye battery

safe creek
#

im hosting my bot and laptop

opal plank
#

cuz it'll keep on the outlet 24/7

safe creek
#

i dont have a battery

opal plank
#

that'll destroy your batter in a couple days

safe creek
#

its broken

#

so

opal plank
#

just pointing it out

safe creek
#

i have to use my cable

#

so im ok

opal plank
#

you wont be able to use, whats literally the only gain from a laptop, which is portability

lusty quest
#

get a RPI, will use way less power and will probably run better

safe creek
#

ye but

#

i can always stop it here and then

lusty quest
#

if you dont need the RPI anymore install a pihole on it and block ads with it

safe creek
#

why block ads?

#

oh

#

wait

lusty quest
#

they are sometimes annoying

safe creek
#

yup

lusty quest
#

also pihole will block tracker

safe creek
#

a tracker?

#

never expected to track a hole ngl

lusty quest
#

some apps send telemetry data back, Pi Hole will block the DNS requests for those

#

so they run into a void and never reach its destination

safe creek
#

i see

opal plank
#

AdBlock™️

old cliff
#

Just use ghostery

lusty quest
old cliff
#

How do I set it up ?

#

I have 3 spare pi 3s

latent heron
#

@slender thistle i've wasted almost 2 hours debugging the webhook code

#

just to realize my server is having a random 500 error moment with not letting me make them hollow

#

i had to test making webhooks myself and even i wasn't allowed

#

FFS discord

lusty quest
#

you could install it on a VPS and use it to block ads on your Phone on the go

old cliff
#

Nise

#

Nice

lusty quest
#

but you might have to whitelist here and there some websites, if you get a DNS resolving error for a page you want to visit you have probably to check if it got blocked by the pihole

old cliff
#

Does it block nsfw sites too ?

lusty quest
#

if you blacklist them yes

#

you can also blacklist all the YT urls for Rickrolls

misty sigil
#

loggers

old cliff
#

Time to set up pi a hole

misty sigil
#

I’ll be unrickrollable

lusty quest
#

they still can upload the videos here on discord

#

also gifs exist

misty sigil
#

I’ll blacklist those too

lusty quest
#

you cant or discord wont work

old cliff
#

You cant blacklist my rickroll api

lusty quest
#

you can

#

if it uses an URL you can block it

old cliff
#

It gives random rickroll vids and gifs from random sites

sour summit
#

does anyone know what's the thing called to disable discord.js-commando default error respond

#
client.registry
  .registerDefaultTypes()
  .registerDefaultGroups()
  .registerDefaultCommands({
    help: false,
    prefix: false,
    ping: false,
    _eval: false,
    unknownCommand: false,
    commandState: false
  });
latent heron
#

well it works

#

and i mean

#

been trying to fight this astoundingly stupid bug for hours now for whatever reason it keeps looping

#

the bot thinks that it has the translation role of the server im using even though it doesn't

sour summit
#

wtf

latent heron
#

my current workaround is introducing a boolean variable that goes from a false to true state once the bot finishes its first translation request to my API

#

that way it literally is unable to access the same iteration process

#

but now i've realized that webhook rate limits are nasty blobpain

#

i'm really happy that the automatic toggle on/off command works and that the formatting of webhooks is working perfectly

#

and as soon as i can get rid of the loop problem, i can do last-minute code cleanup and it will be exactly the way i want it to be

wanton dust
#

`import discord
from discord.ext import commands

client = commands.Bot(command_prefix= '+')

@client.event
async def on_ready():
await client.change_presence(status=discord.Status.online, activity=discord.Game('BACK2BACK ESPROTS'))

#PERFORM STUFF.....

general_channel = client.get_channel(814085894561857546)
await general_channel.send('HELLO I AM OFFICIAL BOT OF BACK2BACK ESPORTS!')

@client.event
async def on_message(message):

if message.content == 'what is the version':
general_channel = client.get_channel(814085894561857546)
await general_channel.send('The version is 1.0!')
if message.content == 'Hi':
general_channel = client.get_channel(814085894561857546)
if message.content == '+info':
general_channel = client.get_channel(814085894561857546)
await general_channel.send('HI I AM OFFICIAL BOT OF BACK2BACK ESPORTS CURRENTLY I AM UNDER DEVELOPMENT')
if message.content == '+embed':
general_channel = client.get_channel(814085894561857546)
myEmebed.set_header("BACK2BACK ESPORTS")
myEmebed = discord.Embed(title="INFO OF SERVER",description="OWNER OF BACK2BACK ESPORTS IS DOPE",color=#b42222)
myEmbed.set_footer("THIS IS A ESPORTS SERVER ORGANIZING T-3,T-2,T-1 CUSTOMS")
myEmbed.set_author(name="B2B𒉽DOPE")
await general_channel.send(embed=myEmebed)`

wanton dust
agile lance
#

How could I make my bot return 300k instead of 300000? Code:

db.fetch("balance."+message.author.id);

#

Or atleast have comma’s

latent heron
#

string format

slender thistle
#

Poor you

#

What the fuck

tawny valve
#

Lol

latent heron
#

on avg the rate limits on webhooks are 35 mins

#

i want that to further exemplify my feeling of pain

tawny valve
#

Lol

slender thistle
wanton dust
# slender thistle 1) For hex you do 0x, not # which is comments in Python 2) There's no "header" ...

`import discord
from discord.ext import commands

client = commands.Bot(command_prefix= '+')

@client.event
async def on_ready():
await client.change_presence(status=discord.Status.online, activity=discord.Game('BACK2BACK ESPROTS'))

#PERFORM STUFF.....

general_channel = client.get_channel(814085894561857546)
await general_channel.send('HELLO I AM OFFICIAL BOT OF BACK2BACK ESPORTS!')

@client.event
async def on_message(message):

if message.content == 'what is the version':
general_channel = client.get_channel(814085894561857546)
await general_channel.send('The version is 1.0!')
if message.content == 'Hi':
general_channel = client.get_channel(814085894561857546)
if message.content == '+info':
general_channel = client.get_channel(814085894561857546)
await general_channel.send('HI I AM OFFICIAL BOT OF BACK2BACK ESPORTS CURRENTLY I AM UNDER DEVELOPMENT')
if message.content == '+embed':
general_channel = client.get_channel(814085894561857546)

myEmebed.set_header("BACK2BACK ESPORTS")
myEmebed = discord.Embed(title="INFO OF SERVER",description="OWNER OF BACK2BACK ESPORTS IS DOPE",color='b42222')
myEmbed.set_footer("THIS IS A ESPORTS SERVER ORGANIZING T-3,T-2,T-1 CUSTOMS")

await general_channel.send(embed=myEmebed)`

slender thistle
#

What's the error lol

#

I said 0x instead of # and you made it a string

latent heron
#

can we talk about how this code literally doesn't work

slender thistle
#

Still didn't fix the header part

signal wagon
#

if (error):
don't()

slender thistle
#

Also why are you using commands.Bot without even using its commands extension

proud rain
#

i need help developing my bot

latent heron
#

youtube

proud rain
#

hmm?

#

the server this bot is in one is confusing @latent heron

#

i need help

latent heron
#

this isn't the support server

proud rain
#

Hm?

latent heron
#

this isn't the support server

pale vessel
#

this isn't the support server

#

go to their bot page and select "Get Support"

#

because site's broken 🧠

proud rain
#

wheres the support botton

latent heron
#

on the website

proud rain
#

i cant find it

pale vessel
#

what's the bot name?

proud rain
#

My bot?

#

NCP HELPER

#

@pale vessel

opal plank
#

of course you wont find your own bot

#

its not approved

proud rain
#

i cant summit it

pale vessel
#

oh were you talking about your own bot

opal plank
#

what do you even need help with?

pale vessel
#

well never mind then

opal plank
#

@proud rain

proud rain
#

I’m stuck on this

#

Server this bot is in

opal plank
#

what about it?

#

you dont need it

#

its optional

proud rain
#

What’s this

#

Then

opal plank
#

then

#

read it

lost heath
#

what did you write on other bot owners

opal plank
#

theres 2 errors

#

not one

#

read what it says

#

and like it says

proud rain
#

My cousin is the other owner

opal plank
#

ID's

#

not tags

#

724425056469647430

proud rain
#

Ohh

opal plank
#

this is ur id

proud rain
#

Ohh

#

Really

opal plank
#

right click yourself

#

copy id

flat pelican
#

Screenshots are crying rn

opal plank
#

@flat pelican if only windows had native screenshots natively

flat pelican
#

it has?

opal plank
#

ctrl + prtScreen

#

snipping tools

#

theres plenty of options

proud rain
#

i cant press copy id

flat pelican
#

Just pressing prntScreen should take the entire screen

lost heath
#

or windows + shift+ s

#

or without shift. cant remember

opal plank
#

ctrl + prtSrn / ctrl + v here

#

or snipping tools

#

its installed by default

proud rain
#

What’s prtsrn

lost heath
#

i just use shareX. easier that way

opal plank
#

i said natively

proud rain
#

What’s that?

lost heath
opal plank
#

without needing for external tools

#

i use sharex too

#

but windows has screenshotting tools by itself

lost heath
#

yea. windows shift s

proud rain
#

xx

#

x

#

x

#

hmm?

spice hearth
opal plank
#

nothing, ignore it

#

its likely not related to their issue

#

the issue is just not reading what the popup says

proud rain
#

can you copy my id please

opal plank
#

i did already

proud rain
#

so i can copy it

opal plank
#

already did

proud rain
#

put it in here

spice hearth
#

724425056469647430

opal plank
#

already did

cinder patio
#

188836645670223872 no this is the right one

spice hearth
#

haha

#

724425056469647430
@proud rain

opal plank
cinder patio
opal plank
#

anyhow, back to work

wanton dust
#

`import discord
from discord.ext import commands

client = commands.Bot(command_prefix= '+')

@client.event
async def on_ready():
await client.change_presence(status=discord.Status.online, activity=discord.Game('BACK2BACK ESPROTS'))

#PERFORM STUFF.....

general_channel = client.get_channel(814085894561857546)
await general_channel.send('HELLO I AM OFFICIAL BOT OF BACK2BACK ESPORTS!')

@client.event
async def on_message(message):

if message.content == 'what is the version':
general_channel = client.get_channel(814085894561857546)
await general_channel.send('The version is 1.0!')
if message.content == 'Hi':
general_channel = client.get_channel(814085894561857546)
if message.content == '+info':
general_channel = client.get_channel(814085894561857546)
await general_channel.send('HI I AM OFFICIAL BOT OF BACK2BACK ESPORTS CURRENTLY I AM UNDER DEVELOPMENT')

if message.content == '+embed':
general_channel = client.get_channel(814085894561857546)

myEmbed.set_header("INFO")
myEmebed = discord.Embed(title="INFO OF SERVER",description="OWNER OF BACK2BACK ESPORTS IS DOPE",color=0xd34545)
myEmbed.set_footer("THIS IS A ESPORTS SERVER ORGANIZING T-3,T-2,T-1 CUSTOMS")

await general_channel.send(embed=myEmebed)`

proud rain
#

How do I get an approval @opal plank

opal plank
#

also imma go work now

wanton dust
#

😂

proud rain
#

Ok

slender thistle
#

I SAID SET_HEADER DOESN'T EXIST

#

Also

#

What's the error

opal plank
#

qt above

slender thistle
#

No

opal plank
#

!no

#

shiv

#

before i go to work

#

i just want to say i might die

proud rain
#

👉👈

opal plank
#

i may or may not have drank over 2 and a half liters of energy drinks

humble tangle
#

i can help you

cinder patio
#

you're not sane

humble tangle
#

what is your problem ?

proud rain
#

What happens when my bot does get approved? @opal plank

opal plank
proud rain
#

Lol

willow mirage
#

What did this called in the Permissions.FLAG ??

proud rain
#

😂

humble tangle
willow mirage
#

...

#

d.js

humble tangle
#

ahh

#

idk

proud rain
#

Does it notify @opal plank me?

opal plank
#

yes

#

next ping i'll bonk u

#

im serious

humble tangle
#

how can i add my bot here ?

willow mirage
humble tangle
proud rain
#

On my email?

opal plank
#

aight fuck it, bye

willow mirage
#

...

proud rain
#

Lol 😂

proud rain
humble tangle
#

i am discord dev btw

#

i got aprouved by BFD

molten yarrow
willow mirage
#

it doesn't have

#

...

opal plank
#

wdym it doesnt?

molten yarrow
opal plank
#

the arrows should help spotting it

molten yarrow
#

i hope so :3

opal plank
#

anyway, back to work

amber quiver
#

someones needs help? Wow I took a looooooooonnnnnnnnnnnnnnnnggggggggg break from bot development

willow mirage
#

i wanted like

#
<Channel>.permissionsFor(<Bot>).has("MANAGE_CHANNEL")
#

to manage only this channel

opal plank
#

unrelated to your issue

willow mirage
#

waitWhat :)?

sour summit
#

how do i set a custom error handler for discord.js commando

opal plank
#

you asked for permission

#

for the flag

willow mirage
#

yeah

opal plank
#

you never asked how to get permissions in guild or channel specifically

opal plank
willow mirage
#

this pic is in the a specific channel

#

to manage channel

#

not channels

opal plank
#

same thing

#

just check specifically in the channel

willow mirage
#

so they are same things?

opal plank
#

me.permissionsIn(<channel>).has(<perm>)

willow mirage
#

ok

wanton dust
#

`import discord
from discord.ext import commands

client = commands.Bot(command_prefix= '+')

@client.event
async def on_ready():
await client.change_presence(status=discord.Status.online, activity=discord.Game('BACK2BACK ESPROTS'))

#PERFORM STUFF.....

general_channel = client.get_channel(814085894561857546)
await general_channel.send('HELLO I AM OFFICIAL BOT OF BACK2BACK ESPORTS!')

@client.event
async def on_message(message):

if message.content == 'what is the version':
general_channel = client.get_channel(814085894561857546)
await general_channel.send('The version is 1.0!')
if message.content == 'Hi':
general_channel = client.get_channel(814085894561857546)
if message.content == '+info':
general_channel = client.get_channel(814085894561857546)
await general_channel.send('HI I AM OFFICIAL BOT OF BACK2BACK ESPORTS CURRENTLY I AM UNDER DEVELOPMENT')
if message.content == '+embed':
general_channel = client.get_channel(814085894561857546)

 myEmbed = discord.Embed(title="INFO OF SERVER",description="OWNER OF BACK2BACK ESPORTS IS DOPE",color=0xd34545)
 myEmbed.set_header("INFO")
 myEmbed.set_footer("THIS IS A ESPORTS SERVER ORGANIZING T-3,T-2,T-1 CUSTOMS")
 await general_channel.send(embed=myEmbed)`
slender thistle
#

How many times have I told you that set_header doesn't exist?

agile lance
#

How could I make my bot return 300k instead of 300000? Code:

db.fetch("balance."+message.author.id);

slender thistle
#

Also

#

What are the errors that you're getting

#

You posted your code multiple times and literally only said "error happening"

opal plank
#

not necessarily telling you to use the package, but perhaps check their codebase

rocky hearth
#

can I access static property of a class from an instance or this in js

safe creek
#

i feel i have done this completely wrong

#
    m = "<@!>"


    @has_permissions(ban_members=True)
    @commands.command()
    async def unban(self, ctx, *, member, m):
        banned_user = await ctx.guild.bans()
        member_name, member_descriminator = m.split("<@!>")

        for ban_entry in banned_user:
            user = ban_entry.user

            if (user.name, user.descriminator) == (member_name, member_descriminator):
                await ctx.guild.unban(user)
                embed = discord.Embed(title=f"{user.mention}unbanned by {ctx.author.id}"),
                await ctx.send(embed=embed)
                return```
#

is this even partly correct?

slender thistle
#

No

safe creek
#

i knew it

slender thistle
#

member.split

#

You don't need the m

safe creek
#

oh ok

pale vessel
#

wait you can compare lists and tuples?

slender thistle
#

Hold on

safe creek
#

so what about m = blah blah

slender thistle
#

Not even

slender thistle
safe creek
#

because ive tried it like this ```py
@has_permissions(ban_members=True)
@commands.command()
async def unban(self, ctx, *, member):
banned_user = await ctx.guild.bans()
member_name, member_descriminator = member.split("<@!>")

    for ban_entry in banned_user:
        user = ban_entry.user

        if (user.name, user.descriminator) == (member_name, member_descriminator):
            await ctx.guild.unban(user)
            embed = discord.Embed(title=f"{user.mention}unbanned by {ctx.author.id}"),
            await ctx.send(embed=embed)
            return```
slender thistle
#
>>> one, two = 1, 2
>>> (one, two) == (1, 2)
True
slender thistle
#

😛

safe creek
#

strip

#

omfg

slender thistle
#

and what are you using

safe creek
#

i put split

slender thistle
safe creek
#

omfg

#

thanks, i might be back by my own stupidity

pale vessel
#

how do you get discrim by splitting like that

safe creek
#

idk dont ask

pale vessel
#

you can't

#

huh

safe creek
#

ive never used split or strip before so

pale vessel
#

if you want the id use strip("<@!>")

safe creek
#

yes ik

#

i already know i put split by accident

#

and didnt realise till now

pale vessel
#

you won't get these though

#

you'll only get the id

safe creek
#
    member_name, member_descriminator = member.strip("<@!>")
ValueError: too many values to unpack (expected 2)```
pale vessel
#

can't you just use member.id

#

make member discord.Member

safe creek
#

mmmk so which member?

#

i have many members in the command

#

please elaborate

pale vessel
#

use type annotations

agile lance
opal plank
#

yw

agile lance
#

Needed it because its hard to read say "10848291"

safe creek
pale vessel
#

Yes

safe creek
#

mmk

#

adding a db is gonna be a nightmare

#

for me anyway

#

im somehow mentioning a user called @daring fjord

#

who tf is that?

pale vessel
#

clyde

safe creek
#

oh

#

huh

#

ok so t works but

#

it cant find the user with the id

#
discord.ext.commands.errors.MemberNotFound: Member "@rugged ice" not found.
safe creek
#

yeah i found that out

#

it apparently couldnt find the user whos banned with that id tho i copied the correct id?

pale vessel
#

oh because it's a user

safe creek
#

yay time to wait another 5mins for the bot to properly shutdown

pale vessel
#

either discord.User (probably won't work if the user isn't cached) or parse the user yourself

safe creek
#

ill try using discord.User and if that odesnt work i give up on the command for the moment

pale vessel
#

parsing seems easier, you already got it

safe creek
#

mhm but

#

it wouldnt work

pale vessel
#

it should just be id = member.strip("<@!>")

#

and compare the id with the bans

safe creek
#

that wouldve been nice to know a bit sooner tbh.... :/

#

so what do i do with the member: discord.User?

#

just replace : discord.User with an colon and the id thingy?

#

also

#
  File "c:\Users\forth\OneDrive\Documents\kigles\cogs\moderation.py", line 66, in unban
    member_name, member_descriminator, id = member.strip("<@!>")
ValueError: too many values to unpack (expected 3) ```
slender thistle
#

Well yeah

#

.strip returns just a string

slender thistle
#

Erase it

safe creek
#

mmmk

#

well ive erase the : discord.User part

#

so im left with member

#

@slender thistle

slender thistle
#

member is now a string, supposedly mention

#

member = member.strip(...)
member is now an ID

safe creek
#

im confused on what to do now as i was litterally just told to add discord.Member but then replace memeber with user but then add id = strip("<@!>")

#

mmmk

#

so

#

delete the other member stuff or?

pale vessel
#

remove user also

safe creek
#

i already did

#

please just let shiv help me

slender thistle
#
async def unban(self, ctx, member):
    member = member.strip("<@!>")

    ...
safe creek
#

mmmk ty

#

also

#

should i just leave if (user.name, user.descriminator) == (member): like that

#

oh wait nvm

snow urchin