#development

1 messages · Page 1268 of 1

earnest phoenix
#

and this is why there is node json auto builders

slender thistle
#

Sigh

earnest phoenix
#

@whole scarab he gave u a example of json

#

Can someone help me ._.

#

not an answer key

slender thistle
#

Just add a comma after every value except the last one

#

Why? Because JSON

#

@earnest phoenix are you sure you're not sending excessive number of requests with your code

earnest phoenix
#

Only 1 request

next heath
#

DSL has manage roles permission

#

but the edit page still error

#

anyone try this function?

whole scarab
#

@slender thistle, please help me to solve the problem! (yellow circle and arrow part)
It says, "⚠️ String does not match the pattern of "^(?:@[a-z0-9-~][a-z0-9-.~]*/)?[a-z0-9-~][a-z0-9-.~]*$"."

slender thistle
#

What the fuck

next heath
#

@whole scarab using lower string

whole scarab
#

What is lower string?

next heath
#

f not F

slender thistle
#

Why does it require lowercase string

whole scarab
#

I don't know why!

#

ㅠ.ㅠ

earnest phoenix
#

because its node

#

idk man node be weird

trim saddle
#

doesn't node already make a package when you run npm init

earnest phoenix
#

and this is why there is node json auto builders
@earnest phoenix

whole scarab
earnest phoenix
#

so whos going to say it

hollow fjord
#

@whole scarab lowercase only i think

#

just read the error

#

read the regexp

#

pattern

slender thistle
#

You know

#

They might not be familiar with regex if I had to tell them to add commas after values

hollow fjord
#

oh

#

true

#

well i mean

#

theres nothing to be ashamed of

#

@whole scarab now u know: commas after values in json

slender thistle
#

Indeed. It's the hesitation to re-ask that's bugging me in this case

hollow fjord
#

how do global emojis work?

whole scarab
#

and the next step is

#

Step 8: Open your computer’s “Command Prompt” and navigate to your Discord bot folder

#

but I use MacBook Air

slender thistle
#

Through some integration with Discord in server settings afaik

hollow fjord
#

oh rip go to terminal new terminal

#

in vs code

#

at the top

whole scarab
#

Step 8: Open your computer’s “Command Prompt” and navigate to your Discord bot folder
@slender thistle, please help me to do step 8

hollow fjord
#

@whole scarab press the terminal button at the top

#

next to run and to the left of help

#

then click new terminal

#

then do node bot.js whatever it is your instruction thing says to do

#

it should start the bot

earnest phoenix
#

or like node .

#

to just like start the module in the folder

whole scarab
#

@whole scarab press the terminal button at the top
@hollow fjord, but I use MacBook Air!

hollow fjord
#

@whole scarab shouldnt matter

winter basalt
hollow fjord
#

it wont matter, node runs the same.

astral yoke
#

why would send not work in this

#
channelid.send```
#

you dont just send code and leave

#

send code when your here

#

especially like that flood one

modest smelt
#
@client.event
async def on_message_edit(before, after, message):
  idofguild= str(message.guild.id)
  for path in pathlib.Path(idofguild).iterdir():
    if path.is_file():
      if path.name== "channels.json":
       with open(path, "r") as json_file:
        datd= json.load(json_file)
        channeldeleted= datd.get('audit_log_channel')
    embed = discord.Embed(
        timestamp=after.created_at,
        description = f"<@!{before.author.id}>**'s message was edited in** <#{before.channel.id}>.",
        colour = discord.Colour(0x00FF00)
        ) 
    embed.set_author(name=f'{before.author.name}#{before.author.discriminator}', icon_url=before.author.avatar_url)
    embed.set_footer(text=f"Author ID:{before.author.id} • Message ID: {before.id}")
    embed.add_field(name='Before:', value=before.content, inline=False)
    embed.add_field(name="After:", value=after.content, inline=False)
    channel = client.get_channel(channeldeleted)
    await channel.send(embed=embed)```not working? error: ```Ignoring exception in on_message_edit
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
    await coro(*args, **kwargs)
TypeError: on_message_edit() missing 1 required positional argument: 'message'```
#

for some time

whole scarab
#

I go to the terminal already, what should I type now?

modest smelt
#

@astral yoke do u know?

#

the reason

astral yoke
#

i dont know i dont use advanced code like that

whole scarab
#

@astral yoke, I go to the terminal already, what should I type now?@c

astral yoke
#

i dont know py

modest smelt
#

ok

earnest phoenix
#

@modest smelt u are missing a parameter in the function call

#
TypeError: on_message_edit() missing 1 required positional argument: 'message'```
modest smelt
#

@modest smelt u are missing a parameter in the function call
@earnest phoenix yes ik

#

how to fix that?

earnest phoenix
#

check the api

#

for the event

modest smelt
#

how do i find that?

#

command?

#

@earnest phoenix

earnest phoenix
#

let me check here

modest smelt
#

kk

earnest phoenix
#

read up

#

it takes only the two params

modest smelt
#

which ones?

earnest phoenix
#

before and after

modest smelt
#

before and after

#

yes ik

#

but i want it so that, it will send in a specific channel

earnest phoenix
#

wait what

modest smelt
#

and i need to get the guild id for that

#

and i need to pass message as one of the params

earnest phoenix
#

well u cant make the api do that

#

unless u edit it

#

in some way

modest smelt
#

how?

#

do u know

earnest phoenix
#

idk man

modest smelt
#

dang

#

@earnest phoenix one question

#

for the guild id can i do ctx.guild.id?

earnest phoenix
#

i think so

#

unless if ctx is the message which idk

modest smelt
#

ok

modest smelt
earnest phoenix
#

that is api docs on the command context type

#

read up on them

#

go see where u can get the guild type from

modest smelt
#

how will that help?

earnest phoenix
#

yeah

modest smelt
#

no i figured out how to do that

earnest phoenix
#

reading the docs is one of the best things u can do

modest smelt
#

ctx.message.guild.id or message.guild.id

#

ig

#

@earnest phoenix do u know if there is a discord py server? and if yes can u send invite link?

earnest phoenix
#

there is one

#

i dont have the invite link

modest smelt
#

oh

pale vessel
whole scarab
#

@astral yoke, I go to the terminal already, what should I type now?

severe timber
#

how do we get developer role?

hollow fjord
#

@whole scarab type node bot.js

whole scarab
#

command not found

pale vessel
#

install nodejs first

restive furnace
#
1. Recommended, but optional: Learn how terminals work
2. Install nodejs
3. node yourbotmainfile.js```
whole scarab
#

command not found

earnest phoenix
#

are u on a vps / sshed into a device or can u access google?

#

cause theres curl or nodejs's website

restive furnace
#

i assume youre on debian based vps: sudo apt install nodejs

#

(if ur on ubuntu 18.04 or older, you need to use curl)

#

(otherwise you get nodejs 8)

earnest phoenix
#

he said macos before

#

so

modest smelt
#

i have a message

#

how do i get the channel's id where it was sent?

#

@earnest phoenix

earnest phoenix
#

jesus lmao

modest smelt
#

sry ur the only python dev ik

obtuse niche
#

I do python too

modest smelt
#

can u help?

obtuse niche
#

😋

modest smelt
#

i have a message
how do i get the channel's id where it was sent?

earnest phoenix
#

im a just send this

#

because legit if u took the time to read it

obtuse niche
#

Well im not close to my pc so not rn i can help u in 8 hours

earnest phoenix
#

u could probally find ur answer

#
ctx.message.channel.id```
restive furnace
#

you can literally do ctx.channel.id

#

channel is shortcut of ~message.channel`

earnest phoenix
#

I'm tryna to use Firebase Cloud Fucktions to host my botum and oh boi it is a fucking awesome

#

Can anyone help me please??

misty sigil
summer acorn
#

ban method keeps giving me the Response: Internal Server Error error

#

the code is not modified, so it's not a code issue

earnest phoenix
vernal rivet
#

That looks like it's using a Stopwatch package if it's made in d.js

ionic shard
#

is this the right way to check for perms?

        if (!message.guild.me.hasPermission(permission)) return 2;```
vernal rivet
#

Ahhh if permission variable is a string then yes it is

ionic shard
#

yes it is

vernal rivet
#

Then yes

ionic shard
#

using it as a func so i can later do

        const perm = 'ADMINISTRATOR';
        const hasPerm = func.hasPermission(perm, message);

        if (hasPerm == 1) return func.errEmbed(`Missing permission \`${perm}\``, message);

        if (hasPerm == 2) return func.errEmbed(`Missing permission \`${perm}\``, message);
vernal rivet
#

I would put that in a else if but it doesn't need to be

ionic shard
#

what in else ?

vernal rivet
#

Else if?

ionic shard
#

if (hasPerm == 1) {}
else if (hasPerm == 2) {}

vernal rivet
#

Mhm. It doesn't have to be, but else if basically check if the first if is false, then it checks it's condition, if it is true it doesn't produced to the next else if, or else statement. If statements check only it's condition, then continues. You can think of else if like a switch case.

ionic shard
#

well I have return in both ifs so it wont continue anyway?

vernal rivet
#

Mhm that's why I said it doesn't have to be, but for code style it's good practice to use else if over two if statements that is checking a similar condition.

ionic shard
#

okay

#

thanks ill use else if

vernal rivet
#

Np

#

The only time you would use if statements in a series is if you are creating a check. It really depends on what is needed to do. You can find a lot about else if and if statements online and find when it's good to use else if and two ifs.

summer torrent
#

@summer acorn show code

#

it is probably you are using string instead of object for reason

#
- .ban('reason')
+ .ban({ reason: 'ads'})```
summer acorn
#

no?

#

That's not the issue?

vernal rivet
#

?

summer acorn
#

@summer torrent

vernal rivet
#

What's the error?

summer acorn
#

my error is Internal Server Error

vernal rivet
#

You should be using the ban method on the GuildMember Type

summer acorn
#

no?

#

that could only ban if the member is in the server

#

let's say someone sends nsfw and then leaves, that method wouldn't be able to ban them as they wouldn't be a member of the server

shadow flame
#

Anyone help me

#

Please fix my discord screen share

ionic shard
#

this aint discord-tech-support

tight plinth
#

@summer acorn what method do you use exactly

gilded lily
#

Hi, my code isn't working

summer acorn
#

@tight plinth message.guild.members.ban(user.id)

gilded lily
#
const Discord = require('discord.py')
summer acorn
#

that is js

slender thistle
#

Can't it be message.guild.ban

summer acorn
#

kekw

gilded lily
earnest phoenix
#

const Discord = require('discord.py')
@gilded lily please see a doctor

tight plinth
#

@summer acorn fetch the member and ban it

honest perch
#

npm I python

gilded lily
#

lol I was jk sorry

summer acorn
#

Lumap, the error is not in my code

tight plinth
#

yes ik

summer acorn
#

it's an Internal Server Error

slender thistle
#

Is it a 500 or 400 status code?

tight plinth
#

but try a different method

summer acorn
#

the issue is in the requestHandler in djs

restive pebble
#

@gilded lily wtf

summer acorn
#

hold on, let me actually check the djs code real quick

earnest phoenix
#

it's an Internal Server Error
@summer acorn the server is just mimicking the human body at 3 a.m. iirc

gilded lily
tight plinth
#

@summer acorn that error is triggered by discord, it's not discord.js fault

#

wait for them to fix their servers ig

summer acorn
#

it has persisted for like 3 days kekw

earnest phoenix
#

<@&330168063729074177> hewwo

tight plinth
#

@summer acorn you know what to do then

#

support time

earnest phoenix
river thistle
#

@earnest phoenix ?

#

hewwo

restive pebble
summer acorn
coarse hearth
#

does anyone knows how to add a server count to a webpage for html or something

tight plinth
#

@summer acorn did you contacted support/trying to update d.js

summer acorn
#

no

#

I don't see other bots having the issue

vocal idol
#

My bot what time verified

snow tendon
#

who knows :D

carmine summit
#

uh

#

what is the average verification time?

#

ive waited 5 weeks

#

5 weeks and 2 days

snow tendon
#

5-6 weeks

earnest phoenix
#

@carmine summit 7+ weeks

carmine summit
#

omg

#

ok

silver lintel
#

{ date: { date: '9:41am 25-Sep-2020 (UTC 0)', reason: ' hsufsdujfd' } }
got this, and using quick.db: db.delete(`${user.id}.modlog[0]`);, it deltes it and makes it null, how to delete that whole thing istead of just leaving null

tight plinth
#

null is like undefined

restive furnace
#

null = nothing

#

(in some languages its 0, aka nothing)

silver lintel
#

how would i remove it then

#

or do i havew to use some sort of pop thing

eternal sandal
#

Not sure if I should ask here or in #support, so feel free to redirect me.
I'm helping someone get a nice look going for their bot's top.gg page, but stuff is going wrong and breaking.
Does it have to be pure CSS/HTML? Since the page got pretty much wiped when I tried repositioning and rebuilding some stuff with a few lines of JS

restive furnace
#

@silver lintel null = literally nothing

eternal sandal
#

Running the same code on the console works perfectly fine though

#

null is like undefined
@tight plinth Not at all, undefined means no pointers to and from what you request, null is an empty object that means no value

silver lintel
#

when i do db.ge(`${user.id}.modlog[0]`);, it comes with null

restive furnace
#

null is nothing

silver lintel
#

ok

restive furnace
#

(ping) Not at all, undefined means no pointers to and from what you request, null is an empty object that means no value
glad that some languages came into idea to use nullptr instead of undefined.

eternal sandal
#

Very glad

tight plinth
#

@tight plinth Not at all, undefined means no pointers to and from what you request, null is an empty object that means no value
@eternal sandal in both cases you can do js if (!value)which returns true with undefined and null so

#

they are kinda the same

#

not exactly but u get it

restive furnace
#

and if we r talking JS, its probably reference than pointer

eternal sandal
#

in both cases you can do

if (!value)
``` which returns true with undefined and null so

That also returns true on an empty string, numerical 0 and any other object that represents no value other than a memory pointer or an empty object. Are you saying those are all the same as undefined?

#

I'll take my question to support though. It's getting kinda drowned out here and it does specifically have to do with top.gg

tight plinth
#

@eternal sandal well almost all objects they are either null/empty returns false. 0 is false and 1 is true btw, like in binary

restive furnace
#

0b00000000 is false in binary iirc

#

0b00000001 is true iirc

eternal sandal
blazing ravine
#

sup

tight plinth
#

@restive furnace yep

blazing ravine
#

i need help

tight plinth
#

@blazing ravine ok

blazing ravine
#

how i can use rich presence ;d

tight plinth
#

read docs ig

restive furnace
#

just use eazyrp if ur not going to make a game

blazing ravine
restive furnace
#

if u want bot status change, then hold on

eternal sandal
#

I just gave you a list of stuff that returns false, I think I can make an educated guess on what returns true.
Which, when casting to boolean values (true/false) is any number that is not 0* or evaluates to that and any object that contains one or more bytes of data.

  • Some languages evaluate negative numbers to false as well
restive furnace
#
  • Some languages evaluate negative numbers to false as well
    languages which does not have signed integers
eternal sandal
#

Now I'm back to attempting to make this top.gg page look good without any lines of JS because that apparently gets blocked

restive furnace
#

what

#

just use CSS n HTML

eternal sandal
#

Isn't that exactly what I just said?

restive furnace
#

but who needs JS to make the page beatiful

eternal sandal
#

Having issues with not getting it to break everything though

#

but who needs JS to make the page beatiful
I lowkey do when the existing HTML/CSS is just a hot mess

blazing ravine
#

who can help me pls

earnest phoenix
#

are you logging in

eternal sandal
#

Have you tried setting the timestamp to a future point in time?

blazing ravine
#

not logged but

earnest phoenix
#

you need to login

#

lol

blazing ravine
#

xd

#

no idea my first time using rich presence

#

how t oconnect ?

#

bot id or ?

forest dock
#

anyone got a good website to make a bot for discord?

restive furnace
#

@blazing ravine open discord.exe on ur pc/or what ever os ur on

sudden geyser
#

anyone got a good website to make a bot for discord?
@forest dock are you looking for a bot maker (like discord bot maker)?

forest dock
#

umm im not really sure lol. i just need a reliable app/website to create a bot for a discord server im in. if you recommend a bot maker then ill happily listen

restive furnace
#

botghost is fine - for private use

#

but you dont learn anything from that

sudden geyser
#

The only one that comes to mind is DIscord Bot Maker.

#

You have less control when you use a bot maker, but if you want to go ahead, go ahead.

forest dock
#

ill check that out

#

thanks

sudden geyser
#

There's also bot ghost (like free said) but that one's a bit eh

earnest phoenix
#

lmao imagine using a bot maker

slender thistle
#

Imagine not being respectful of people's decisions

sudden geyser
#

It's fine to use a bot maker if all you need is something simple (aka giving up control) and don't want to take the time to learn programming. I think a lot of people just hold a grudge against it because:

  • They know how to code, and seeing someone else use a bot maker gives them a superiority feeling.
  • It's not cut out for full on production use.
thin turret
#

Why dont they just invite a bot

#

🐸

sudden geyser
#

depends on what it does

earnest phoenix
#

Imagine not being respectful of people's decisions
@slender thistle well i wasn't being disrespectful was i?

sudden geyser
#

lmao imagine using a bot maker

earnest phoenix
#

i was imagining that's all

slender thistle
#

The way you phrased it does sound like you are straight up shitting on bot makers

earnest phoenix
#

or it's just banter

#

¯_(ツ)_/¯

#

i respect "their" decision

drifting wedge
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: PermissionError: [Errno 13] Permission denied: 'output.png'

#

error im getting

#

can any1 exkoain it?

#

tbh also botghost works

#

explain*

obtuse niche
#

Didnt even know bot makers exist. Gonna check it out

faint prism
forest dock
#

thanks

faint prism
restive furnace
#

lol

drifting wedge
#

is this a flippin thing?

#
if arg =/= 'true' or 'false':```
west agate
#

how do i make sort a .json file in discord.js? sorry if i don't make sense im new to this

drifting wedge
#
  1. dont use json
#
  1. idk sorry
faint prism
slender thistle
#
if arg =/= 'true' or 'false':```
excuse me?
#

what's that even supposed to do

eternal sandal
#

how do i make sort a .json file in discord.js? sorry if i don't make sense im new to this
@west agate What do you want to sort the JSON on? You could use a sort function and overwrite the object, though usually JSON shouldn't be sorted since it's key-value pairs rather than indexed or sorted collections

faint prism
#
  1. dont use json
    @drifting wedge JSON is fine for immutable data
#

Like a config file that doesn't change

eternal sandal
#

JSON is also fine for carrying data across instances

slender thistle
#

it's fine for mutable data too technically as long as you know your shit

drifting wedge
#

Like a config file that doesn't change
@faint prism fair

eternal sandal
misty sigil
#

no

#

if you know your shit you can use a db

west agate
#

@west agate What do you want to sort the JSON on? You could use a sort function and overwrite the object, though usually JSON shouldn't be sorted since it's key-value pairs rather than indexed or sorted collections
@eternal sandal like a leaderboard

drifting wedge
#

i mean dont use json if ur editing it a lot

faint prism
#

it's fine for mutable data too technically as long as you know your shit
@slender thistle you mean to reading and writing to it constantly lol

misty sigil
#

LEADERBOARD

#

ON JSON

eternal sandal
misty sigil
slender thistle
#

What if I want to make a very minimalistic script and don't want a database

faint prism
#

Use a database

slender thistle
#

I'm not saying R/W to it constantly

misty sigil
#

then use a file based db

#

such as SQLite

slender thistle
#

yeah I give up on trying to defend JSON databases

faint prism
#

Good

west agate
#

oh..

misty sigil
#

good

west agate
#

okay then

misty sigil
#

you should never have tried defending them

woeful pike
#

there are uses for json database, I don't think discord bots fit that category though

faint prism
#

It's a serialized object, not a replacement for databases

slender thistle
#

I sure as fuck don't want a database to update my credentials every few minutes/hours though

faint prism
#

If you're json database is just a collection or array of some mutable data/records, you need a proper database.

slender thistle
#

what if it's a JSON full of strings as keys and integers as values

misty sigil
#

still pls no

eternal sandal
#

yeah I give up on trying to defend JSON databases
for DBs, there's much better formats than JSON.
But for small bits of data where a DB is overkill, JSON can be fine. I run a private bot from my bedroom where I store data like reminders and what servers it's in so I can quickly load it in and kill the file I/O process instead of setting up a full DB connection. Arguably I could run SQLite, but I'm actually trying to keep it free of external dependencies

faint prism
#

what if it's a JSON full of strings as keys and integers as values
@slender thistle Are you rewriting the file multiple times per second?

slender thistle
#

I sure as fuck don't want a database to update my credentials every few minutes/hours though

faint prism
#

that might be spaced out enough to work.

#

But it isn't a secure format to store creds

#

and since it does update you probably just need a database

misty sigil
#

I wouldn’t use it to store anything tbf

tidal marlin
#

Is there a way to check if user has open dms?

slender thistle
#

i can just re-request my credentials again and store them again

#

@tidal marlin only by sending a DM and catching an exception

faint prism
#

I can see using it to dump data between process restarts ig

slender thistle
#

Yup

tidal marlin
#

So it's basically an error without way to do else

slender thistle
#

I used to cache my access token but had to restart my process all the time during testing

eternal sandal
#

And that's literally all I use it for

slender thistle
#

which is a bit bleh

eternal sandal
#

So it's basically an error without way to do else
@tidal marlin wrap it in a try-catch block to not die on errors

tidal marlin
#

¯_(ツ)_/¯

misty sigil
#

I use json to dump my db cache every few minutes

slender thistle
#

A JSON "databse" is fine for very basic shit so I don't see where all the "never use json for db" comes from, even if the user doesn't seem dumb enough to handle simple stuff like writing to/reading from a file multiple times within a second

misty sigil
#

why is it fine

tight plinth
#

there are uses for json database, I don't think discord bots fit that category though
@woeful pike for discord bits the only time where you use jdon db os to store things like prefix, token or other static stuff

slender thistle
#

I get security etc etc but let's talk about very basic scripts

faint prism
#

I use json to dump my db cache every few minutes
@misty sigil That'd be slower to query than a db though

misty sigil
#

I don’t use json for the db cache

#

smh

slender thistle
#

I'm not saying it's "fine" exactly. I'm just saying it may work just fine for a basic script.

faint prism
#

whoops my bad stan

#

I get security etc etc but let's talk about very basic scripts
@slender thistle what, where security is irrelevant?

misty sigil
#

the db cache is in RAM

slender thistle
#

Pretty much you could say so

#

I did use JSON for my school assignment script at some point and I fucked around with it just fine

eternal sandal
#

I use JSON for bot config (token, other data that's immutable for the bot) and tiny bits of info that I only need to read once when starting.
And then I have this JSON file for my RSS reader that couples a webhook link to an array of RSS feeds since it's a really lazy approach to run

tidal marlin
#

Anybody did nosql caching?

misty sigil
#

I do

tidal marlin
#

What db?

misty sigil
#

mongo

tidal marlin
eternal sandal
#

The JSON never gets written over by the bot, except for restart data dumps IF there was a change

tidal marlin
#

Can you tell me how do I start?

#

Like I can't figure out what to do after getting db data

misty sigil
#

I just shove stuff into ram with a timeout to remove it

faint prism
#

The JSON never gets written over by the bot, except for restart data dumps IF there was a change
@eternal sandal That sounds like a valid use

misty sigil
#

That is a valid use

tidal marlin
#

Matt, I don't know how to obtain certain user from that cache

#

That's why bot is so slow

eternal sandal
#

stan please stop talking, I'm reading all your messages in Clarkson's voice and it's making me laugh too hard

tidal marlin
#

Oh no

#

Anyway

misty sigil
#

It’s goes from 2ms to 0ms with cache

tidal marlin
#

My ms is over 2k

#

Up to 3k

misty sigil
#

what

#

What db do you use tf

tidal marlin
#

I really need to figure out how to get certain user from db without requesting

#

The same as you

misty sigil
#

Where hosted

trim sequoia
#

ş

tidal marlin
#

Germany

opal plank
#

speaking of cache my Twitch cache is finally behaving after yesterday's patch

#

whatever was happening before, one of the premature fixes i attempted worked

narrow cloak
opal plank
narrow cloak
placid iron
#

What does token link to?

#

@hoary hill first of all you would have to have a code block so that it is monospace text

rustic nova
#

Still, "Bot token"
Why.

placid iron
#

Then make sure the text of the left are padded so they gave the same width

#

You can code block in an embed

violet mesa
#

?

placid iron
#

Unfortunately you can't get your result without code block (or it would be difficult and not look good)

violet mesa
#

how?

placid iron
#

@violet mesa have a list of them

rustic nova
#

How is nobobdy getting worried on the "Bot token" Thing

placid iron
#

["!","?"]

violet mesa
#

yes

placid iron
#

Like that

violet mesa
#

yep

rustic nova
#

Ohh

violet mesa
#

do i like

namethatillchooselater = ["prefix1", "prefix2"]
bot = commands.Bot(command_prefix=namethatillchooselater)

@placid iron like that?

placid iron
#

Yeah

violet mesa
#

ok cool thx

opal plank
#

yeah no

#

im farily certain discord is the opposite of git

#

(text)[link]

placid iron
#

@hoary hill oof yeah you can't use link thing in code block.. uhhhhh you could just have the left text in code ?

opal plank
rustic nova
#

Hyperlinks don't work on codeblocks btw

placid iron
#

guilds | 666

#

Like that maybe?

opal plank
#

thats that then

placid iron
#

You could remove the | perhaps as there is already the border

opal plank
#

cache.size

#

boom

placid iron
#

Idk how it would look

#

Oki

opal plank
#

is that a bad or good thing?

#

make only owner be able to add it in the portal

#

¯_(ツ)_/¯

#

cant have private bots on dbl

#

you shouldnt be coding on your main branch btw

#

branch it off to a different bot, never test in production

zenith terrace
#

^

#

Always have a test bot

placid iron
#

^

opal plank
#

again

#

make a new bot

#

use the same code

#

¯_(ツ)_/¯

#

lazy devs never get anywhere

placid iron
#

😩

slender thistle
#

7-8 weeks ETA review be like

umbral zealot
#

I don't understand how someone would make a test bot in development, add it to DBL, then wonder why it's in a lot of servers. MarioFP

placid iron
#

Me: code in prod so that whole population are testers and bugs get found quickly

opal plank
umbral zealot
#

Me: SSG'es into my VPS through vscode to live edit the bot as it runs

#

Fix bugs right into production wooh!

opal plank
#

its gateway payload

zenith terrace
opal plank
#

i dont think you should be patching nor hacking libraries to do that unless you clearly know what you doing[

dusty tulip
rustic nova
#

Lol

umbral zealot
#

I still remember when I wanted to make a bot that could takes notes when you called it. But you can't call bots. (or you couldn't back then)

dusty tulip
#

;-;

opal plank
#

?

#

no

rustic nova
opal plank
#

its not 'code to make indicator'

#

its the identification payload

#

dont fuck with stuff you dont understand

umbral zealot
#

@dusty tulip coding a bot right on mobile? Bad idea. 100% absolutely horrible idea.

dusty tulip
#

Uhh.....

opal plank
#

mainly those 'undocumented' and 'grey' areas i do on my testing bot, such as live streaming with the bot

dusty tulip
#

I have to wait 1 year again

#

Ok bye

rustic nova
#

Not impossible to code on phone, but definitely so much pain

umbral zealot
#

Coding on mobile is horrible, don't do it
Mobile devices like your handheld phone are not appropriate devices to create code. Phones:

  • Are way too small. You can't see the whole line, or it's too small, or you scroll for days. Your eyes will suffer from this.
  • Don't have a proper keyboard. Yeah there's a "hacker keyboard" but it's still going to be a painful endeavour to write proper syntax.
  • Have horrible editors. There's some crap IDEs out there but they barely function to a level that's useful.
  • Can't run a lot of bot code, and it's hard to do that in the first place. You can't run databases, sqlite, ffmpeg, canvas, or anything requiring more than core javascript. And running Termux is a pain in the ass, and it can't access your files (or your editor can't access the termux storage) without some intense technical gymnastics. That's if you have an Android, not an Apple phone, which can't even get that far.
  • Getting help is hard because nobody wants to see your damn badly cropped screenshot showing your 25 facebook notifications from your mom inviting you to play farmville, or your 9% battery charge.
  • Can't easily interact with online services like github to save/manage your code or upload it to your host.

If you really think you can code on a phone, you are horribly insane. That's your prerogative, but don't drag us into your insanity, we don't want anything to do with it.

opal plank
#

cuz discord gonna enjoy a lot seeing that you are using undocumented shit for your bot

placid iron
#

Dude may only have a phone

umbral zealot
#

It pains me that we can't create tags in any bots

opal plank
#

i do save my tags

#

¯_(ツ)_/¯

umbral zealot
#

how useful would it be eh?

umbral zealot
#

I recall that was specifically the reason why I was using a selfbot - and particularly the reason why I was the only one with a special permission to use one on discord-developers until they finally added my Etiket bot to it and removed the special perm

placid iron
#

This chat do be toxic tho

tulip token
#

can someone help me

#

it sends this in my slowmode

#
    }
    ^

SyntaxError: Unexpected token '}'
    at wrapSafe (internal/modules/cjs/loader.js:1054:16)
    at Module._compile (internal/modules/cjs/loader.js:1102:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at C:\Users\Lenovo\Desktop\Yassin Folder\Games\more\bot23\handlers\command.js:5:23
    at Array.map (<anonymous>)
    at C:\Users\Lenovo\Desktop\Yassin Folder\Games\more\bot23\handlers\command.js:4:59```
faint prism
#

@umbral zealot Other than the actual coding part. You can do almost anything you need to on a ubuntu machine to host a bot from a phone

umbral zealot
#

"other than the coding part" lol

placid iron
#

Voltrex did it, it's bad but it you only have a phone it's perfectly acceptable

#

I wouldn't shit on someone for it

tulip token
#

hello?

opal plank
#

or get $3 and a vpn

umbral zealot
#

I mean it really depends. my own enmap module can't run on android because termux doesn't have a C++ compiler, so there's definitely limitations

opal plank
tulip token
#

you guys are already ignoring me ;-;

opal plank
#

@tulip token state your question

umbral zealot
#

@tulip token that's a syntax error there's not much we can do about it. you need to figure out what } or ) or whatever you're missing in your code, by looking through it

tulip token
#

ok

opal plank
#

use IDE

umbral zealot
#

Whatever editor you're using, clicking on any (and I mean any) separator token such as parentheses, square brackets, curly braces, double and single quotes, will automatically highlight the one that matches it. The screenshot below shows this: the bottom curly brace is selected, and it shows the one on top by surrounding it with a square. Learn this, and how different functions and event handlers "look" like. Even in long bits of code, this works.

opal plank
#

VSC usually tells you where the error is at

umbral zealot
faint prism
#

I mean it really depends. my own enmap module can't run on android because termux doesn't have a C++ compiler, so there's definitely limitations
@umbral zealot tbh I could probably write it as a xamarin app if I wanted a c-lang like C# :)

#

But then oh boy that's introduce a lot of issues

snow tendon
#

@tulip token go to command.js

umbral zealot
#

I mean overall, every instance I've seen of someone writing a bot on mobile was horrible for us to help them debug anyway, like, a shitty screenshot of half your code? eh.

faint prism
#

Like backgrounding and stuff

tulip token
#

ok

snow tendon
#

line 4 or 5

tulip token
#

ok

faint prism
#

I mean overall, every instance I've seen of someone writing a bot on mobile was horrible for us to help them debug anyway, like, a shitty screenshot of half your code? eh.
@umbral zealot I just have a crontab pull GitHub repo occasionally and code from my desktop

opal plank
#

i wonder if you could get a cheap vps or something and install a vm on it to at least run VSC

faint prism
#

can someone help me
@tulip token you have a syntax error

opal plank
#

coding on mobile, on pc

drifting wedge
#

how can i run code if 2 things are not true

#

so like else:

#

what is that do?

faint prism
#

coding on mobile, on pc
@opal plank hosting on mobile, coding on pc

drifting wedge
#

for example if 'true' == arg:

else:

opal plank
#

yeah

snow tendon
#

@opal plank I can make my bot like this right?
@hoary hill yep

#

with

#

rich precence

tulip token
#

@tulip token you have a syntax error
@faint prism bro i was just making a new command and then the error appears the code was working from a week now it doesnt'

opal plank
#

0Exe im fairly certain py has an AND operator

sonic lodge
#

a syntax error is fairly easy to fix

#

you seem super bothered by it lol

snow tendon
#

client.user.setStatus("idle");

#

only 1 line code

#

:D

opal plank
#

if statement and statement do thing @drifting wedge

#

i recall py being a bit weird for my taste

placid iron
#

@drifting wedge py if not(thing1 or thing2): print("runs")
I belive this should work

#

Not or is the same as not and not I think

opal plank
#

he wants an AND operator iirc

#

if a AND b : run
else : something

placid iron
#

Run if 2 false things

drifting wedge
#
if not arg == 'true' or 'false':```
#

?

sonic lodge
#

you have a boolean as a string.?

opal plank
#

why invert it?

#

thats my question

drifting wedge
#

its complicated

opal plank
#

how can i run code if 2 things are not true

#

not that

drifting wedge
#

but i just need to run something if arg is not true or false

opal plank
#

this

placid iron
opal plank
#

indeed

#

if 2 things are not true

#

not if any of them are not true

drifting wedge
#

if both

#

no if both of them are not

opal plank
#

for BOTH you'd need AND

drifting wedge
#

both ok

faint prism
#

if (!boolA && !boolB)

drifting wedge
#

&&?

prisma oriole
#

use ‘and’

sonic lodge
#

if not boolA and not boolB

faint prism
#

and operator in some languages

placid iron
#

I did say

prisma oriole
#

idk if py has && prolly does

placid iron
#

Not ( thing or thing) is not thing and not thing

#

Bruh

prisma oriole
#

i just recall and from my 5 mimutesnofmpython

faint prism
#

I'd use what POOLED said

prisma oriole
#

yes

placid iron
sonic lodge
#

what happen?

placid iron
sonic lodge
#

yeah that works too

placid iron
#

PepeHands but they shit on me because it doesn't have and bruh

sonic lodge
#

oh right it should be and

placid iron
#

Nah

#

not bool and not bool == not (bool or bool)

sonic lodge
#

o

placid iron
#

And well, personal preferences but I prefer my method because it has less nots.

drifting wedge
#

@placid iron u use bd?

#

better discord?

placid iron
#

nah

#

amoled mode for mobile (android only)

umbral zealot
#

yeah that's the best mode, I love it

opal plank
#

👀

drifting wedge
#

who is like the biggest bot dev here?

#

ah

#

general my bad

opal plank
#

me

long hare
#

toast

autumn aspen
#

WTF

#

Why cant I post?

placid iron
#

server invite link in the code?

violet mesa
#

is it possible for me to do dm commands if yes how?

long hare
#

you mean a bot to send you a dm with commands?

placid iron
#

@violet mesa send the result to the author. in python this is ctx.author.send()

autumn aspen
#

is it possible for me to do dm commands if yes how?
@violet mesa dude I literally post it

long hare
#

or your bot

violet mesa
#

no i mean u can do a command in dm

placid iron
#

ah

violet mesa
#

yeeee

long hare
#

you can

autumn aspen
#

yes but its hard

long hare
#

are you using python?

violet mesa
#

yep

long hare
#

alright

#

ask someone else from here

placid iron
#

mostly it should just work if its a DM and it doesnt look for server stuff in the command

violet mesa
#

1 sec ill try

autumn aspen
#

BRI

#

BRO

opal plank
#

remove links

placid iron
#

does your bot have a ping command @violet mesa ? try that in a DM and it should work

autumn aspen
#

ah lmao

midnight brook
#

how do i change the background color of the detailed description box on bot page? im not familiar with html

violet mesa
#

ok thx but how do i do a command that only works in dmes if thats possible (sorry for alot of questions😅 )

placid iron
#

that is possible

autumn aspen
#
const Discord = require('discord.js');
const { prefix, token } = require('./config.json');



bot.on('message', message => {
    if (message.content === '/help') {
        
        
        
        

        const embed = new Discord.MessageEmbed()
            .setColor(0xfff06e)
            .setTitle('Help')
            .addField('General Commands', `myavatar`)
            .addField('Moderation Commands', `kick, ban`)
            .addField('Support', `Invite me = [Here]()\nServer = [Here]()`)
            .setFooter('Report Bot | Only MOD Commands is can be requested by the MODs')
            .addField('User:', `:arrow_down:`)
            .addField('You are:', message.author.username)
            .addField('Requested in', message.guild.name)
            message.channel.send(embed)
            
              

    }
});

Why does my command handler dont work?
@opal plank

opal plank
#

check channel type

placid iron
#

nah

opal plank
#

cuz thats not a command handler

drifting wedge
#

how can i make atom give my discord a rich status?

autumn aspen
#

cuz thats not a command handler
@opal plank then what is it

opal plank
#

'dm', 'text' 'voice'

#

channels have a type annotation in them

#

thats just a command

#

ran on an event

#

thats it

violet mesa
#

ill just do one that works eather way

placid iron
opal plank
#

if it py?

violet mesa
#

i guess i can do suggtions in discord and dms

placid iron
#

you can limit it to DMs easily without any checks in your own code

violet mesa
#

it is py

placid iron
#

let me just find the docs link

opal plank
#

then ignore me

autumn aspen
#

Yes but I want it to put in a help.js so it can work? @opal plank

violet mesa
#

wait

opal plank
#

no

autumn aspen
#

how can I fix a command handler?

opal plank
violet mesa
#

can i send all dms to me so i see the suggtions

opal plank
#

by reading the docs and guides

violet mesa
#

or a diffrent way

opal plank
#

mass dm'ing?

#

sounds sketchy

placid iron
violet mesa
#

hmm

placid iron
#

do you use the @dense frostmmands before your commands? bruh

violet mesa
#

how can i send all dmes to me
???

#

so i can see suggtions

#

threw dmes

#

dms

placid iron
#

uh

#

so

violet mesa
#

not all dmes only suggtions

placid iron
#
donut = bot.get_user(415821990583336973)
await donut.send(things_to_send)```
#

as easy as that

#

just put that where you want to send a DM to you

violet mesa
#

things_to_send cause be arg and then it will give me answers sweet!!!! tysm!!!!!!!!!!!!!!!!!!!!

#

❤️

placid iron
#

yup, could be a string arg

#

np

violet mesa
#
async def suggest(ctx, *, args)

do u need to add anything here?

placid iron
#

: at the end

#

but other than that it is fine

violet mesa
#

ok

#

yep

hushed axle
#

How do I make dashboardpeepothink for my bot

slender thistle
#

basIc PYtHoN

placid iron
#

python be like:
works good

#

has large ints

drifting wedge
#

How do I make dashboard:peepothink: for my bot
@hushed axle a dashboard is simple

#

its a website that edits a database

#

and your bot uses the same database

slender thistle
#

python:
be like:
me = Criminal()

drifting wedge
#

print('im cool dabidebabidae')

slender thistle
#

I wouldn't go as far as saying dashboard is simple

drifting wedge
#

I wouldn't go as far as saying dashboard is simple
@slender thistle the way it works is simple

#

not to make one

#

@placid iron how long did urs take?

placid iron
#

dashboard makes me go AAAAAaaaAAAaaHHHH but it is worth it

slender thistle
#

Sure, the principle is simple. The realization is more painful

placid iron
#

my one isnt even finished

drifting wedge
#

dashboard makes me go AAAAAaaaAAAaaHHHH but it is worth it
@placid iron also u use mongo?

#

it works doe?

placid iron
#

yeah

#

sqlite moving to postgresql

drifting wedge
#

ah

#

wait if i make a dashboard

#

its html/css?

hushed axle
#

peepothink Can some one help me make a dashboard I never learn python

drifting wedge
#

a bit of ts/js to make it look nice ig?

#

-lp

placid iron
#

yeah and then the backend in whatever you want

drifting wedge
#

yo luca back me up

#

-learnpython

#

@gilded plank wow thanks

placid iron
#

@hushed axle you can code the backend in whatever you want

slender thistle
#

you don't specifically need Python

#

Backend can be done in any language that supports HTTP requests

drifting wedge
#

ya

opal plank
#

It starts with simple html. Then you make buttons. Then you make css, and think, ey, this aint so bad.
Then js comes in.
then middlewares
then logins
then database calls
Then not having await in code and getting into callback hell
Then cookies
rate limits
And then you realize how stupid of an idea that was

drifting wedge
#

like pyton

hushed axle
drifting wedge
#

its a python knockoff

slender thistle
#

sorry what

drifting wedge
#

lol

#

idk

#

it just sounded funny KEKW

hushed axle
#

peepothink hmm I will trypeepothink

drifting wedge
#

okeh just make a robot

#

how do i add atom as a discord game?

placid iron
#

but hey

#

wait

#

atom may have a discord plugin

#

like VS code

drifting wedge
#

i dont like vs code cuz i cant ZOOM IN

sonic lodge
#

uh you can?

placid iron
#

CTRL + =/+

opal plank
#

Ctrl + =

sonic lodge
#

what kind of advanced code editor doesn't have the ability to zoom

opal plank
#

Ctrl + -

drifting wedge
#

i just use atom

#

cuz yes

#

also cuz yes

#

i mean i dont think it matters

#

both are great

#

just preference

opal plank
#

both are good but vsc better mmulu

drifting wedge
#

they all have all the features

#

why?

#

dont awnser

#

i just like atom

opal plank
drifting wedge
#

cuz it has a cool ass name

earnest phoenix
#

Why sometimes msg.member is null?

if(msg.member.hasPermission('MANAGE_CHANNELS')){
^

TypeError: Cannot read property 'hasPermission' of null

opal plank
#

@earnest phoenix likely a dm

tranquil sandal
#

nice

drifting wedge
#

guys look at my profile

earnest phoenix
#

oh okay

drifting wedge
#

like presence

#

im cool yes? ok thanks

tranquil sandal
#

atom editor :V

opal plank
#

If i say the same thing its tagged as advertising

drifting wedge
#

?

opal plank
#

guys look at my profile

#

i hate that i cant display multiple presences

drifting wedge
#

facts

opal plank
#

and JUST get the streaming status

knotty sigil
#

Can someone tell me why when somebody leaves my server from his own will I receive in the logs that he got kick

honest perch
opal plank
#

Why are the embeds the same?

#

also there is a slight chance of delay in your thing btw

#

i had some tests before with mass kick bots for raids, if multiple operations are done at once you might get the wrong person

earnest phoenix
#

How do I get a string to be used as upper or lower case?
ex: test = tEsT

opal plank
#

alternating or random?

earnest phoenix
#

random

#

ex: /avatar noT eRwiN

opal plank
#

thats random not alternative

earnest phoenix
#

sorry:D

opal plank
#

let str = '';
for(let letter in string) random() > 0.5 ? str += letter.touppercase : str += letter.tolowercase

#

something like that

#

thats one smort one liner btw

short siren
knotty sigil
#

so that means i can't know for sure who kicked him

opal plank
#

that bit he got

#

you need to fetch from logs

#

though theres a delay iirc

#

i remember reading on DAPI why it takes a couple minutes to fetch it

#

specifically for Pollr

#

you could fetch last 5 after 5 minutes, and check for any entries with that use id

#

then check for the message type

#

(ban/kick)

#

i might actually do that now tbh

#

kinda bored

split hazel
#

it's not that delayed, its mostly the bans that are from experience

short siren
#

Are you trying to check who kick them if they use an external bot or manually? If the answer to those is no and you just want to log it when they use the kick command on your own bot which I doubt then you could just build it into the kick command.

opal plank
#

i might try a fixed setInterval

#

speedy

#

how long is it from ur experience?

split hazel
#

discord needs some consistency 😫

#

I usually had it to wait a couple hundred ms then fetch multiple entries with the same type and filter them until I get the correct log, if not post ??

opal plank
#

i may actually do a function with a timeout with an await in it for 5 minutes, each 1 minute delay

split hazel
#

bans sometimes take ages to log

opal plank
#

think it'd be longer than 5?

split hazel
#

I wasn't able to predict it

#

but roles/kicks are almost instant from experience

opal plank
#

do you remember back of your head the rate limits for fetching logs?

#

i might grab 10 or 20 accounts and attemp to mass ban them all and get a mean from all of them with a constant fetch in the audit

split hazel
#

don't know them you should test

opal plank
#

aight, imma go do that

#

ty speedy

split hazel
#

but it should be pretty fair

opal plank
#

i sure hope d.js handles ratelimiting internally for audits

split hazel
#

it handles all with a rate limit header if I'm correct

opal plank
#

same thing was said in the other libs ive used

#

and then this

#

not in the mood to debug ratelimits anymore

#

im done with that stress

#

'its all handled internally until you join 150+ streams, then it kills itself'

thick gull
#

make your own lib

split hazel
#

very scalable

opal plank
#

the worst part is that i NEED that big chunk to stress test my cache

#

need to make sure there arent any leaks, which are MUCH more apparent with a huge load of entries

#

anyhow, imma go code

earnest phoenix
#

anybody here can help me in oauth

#

huh

slender thistle
#

Just ask your question

#

Anyone who is able to help will respond

earnest phoenix
#

i am making request !

#

but its showing pending and it not making user join guild

#

huh

#

See YT

#

and learn coding

#

somebody answer me

rocky hearth
#

what version of ecmascript does node12 supports?

umbral zealot
#

I mean... did you, like, resolve that promise?

#

¯_(ツ)_/¯

earnest phoenix
#

@umbral zealot its pending

#

..

umbral zealot
#

ok but did you resolve it

earnest phoenix
#

how to reslove

umbral zealot
#

do you understand how javascript promises work?

rocky hearth
#

probably not

umbral zealot
earnest phoenix
#

@umbral zealot do you know how to make user join guild via Oauth

blissful coral
#

Read up on promises

umbral zealot
#

No need to ping me I'm right here

#

and no, I don't know.

earnest phoenix
#

;-;

blissful coral
#

Bot ghost isn’t even coding xD

#

And you cannot get approved to top gg with bot ghost

earnest phoenix
#

yup

blissful coral
#

Ok

#

No need to get aggressive.

earnest phoenix
#

Extreeme you know Oauth

drifting wedge
blissful coral
#

@earnest phoenix not really no

drifting wedge
#

in a cog, event how can i get the guild id?

blissful coral
#

What language?

drifting wedge
slender thistle
#

which event

silent cloud
#

Yo guys

drifting wedge
#

a lot of them

silent cloud
#

I have an error at this line

#

queue.channel.leave();

drifting wedge
#

all im passing is self and member

silent cloud
#

Have error in leave word

umbral zealot
#

what error

silent cloud
#

Oh thats you, hi xd

#

Wait i check

slender thistle
silent cloud
#

queue.channel.leave();

#

If i make a channel const

#

It in leave word error

umbral zealot
#

it doesn't say there's an error in leave

#

it says queue is undefined.

silent cloud
umbral zealot
#

well, it's still undefined

#

you're declaring it, but probably that guild doesn't have a queue

silent cloud
#

._.

#

This part it taked from github

#

And....

#

I doesnt saw const queue

#

(more)

opal plank
#

well this is basic js

#

you need to declare things

#

if it doesnt exist, define them

silent cloud
opal plank
#

i guess?

silent cloud
#

Logic :D

#

But

opal plank
#

though that only brings a number(string)

#

not the guild itself

silent cloud
#

What u need to give for queue(2) const?

#

I rename it to any name

opal plank
silent cloud
#

Wait i give you code

opal plank
#

thats why

#

'string' doesnt hhave a get() method

#

nor does queue exist

#

client.queuer isnt a thing

silent cloud
#

Message.querer.get?

opal plank
#

learn a bit of objects in js first

#

specifically this

silent cloud
#

I learned js a long time ago, then gave it up, now I'm back

#

But

opal plank
#

you have not

silent cloud
#

Wtf is going on

opal plank
#

you dont know what an object is

silent cloud
opal plank
#

'string'.get() isnt a thing

#

you havent checked the docs to see what client properties has

#

nor have you added one yourself

#

and you clearly arent reading the errors thrown by yoiur compiler

#

you lack almost everything you need to make a bot

#

Read the docs i sent you

earnest phoenix
#

For discord.js.. is there a way to only update a certain permission without removing all the others

opal plank
#

@split hazel 11 minutes

split hazel
#

11 minutes for what

opal plank
#

bans

split hazel
#

bruh

opal plank
#

jesus christ 11 minutes checking for bans?

split hazel
#

its completely random and unpredictable

opal plank
split hazel
#

sometimes its instant sometimes its like 30 minutes

violet mesa
#

im doing ban command only work for people with perms to ban ```python
@commands.has_permissions(Ban=True)

opal plank
#

i though the randomness would be much smaller

earnest phoenix
#

damn.. its rlly annoying when ur getting ignored

opal plank
#

its really annoying not be patient

modest smelt
#

how to check if a user is a bot?

misty sigil
#

<user>.bot in d.js