#development

1 messages · Page 1735 of 1

opal plank
#

seems like we got another happy customer

prime mist
#

Lol. I don't think I'm going to rewrite by bot anytime soon, maybe for the next project.

clear marlin
#

rewrite it in golang

#

if you do

lament rock
#

@opal plank v9 support for my lib soon™️

#

I also love how the docs say that v9 is available

#

even though it's not released

clear marlin
#

What library..

prime mist
lament rock
#

a cacheless discord.js-like library

clear marlin
#

Ah, that's cool

opal plank
#

DISCORD.JS

#

ALREADY SOUNDS STINKY

lament rock
#

discord.js-like

opal plank
#

caps

lament rock
#

mapped to resemble it's API, but cacheless and does it's best at memory management

clear marlin
#

well yeah discord.js caches literally everything

opal plank
#

stateless bots

#

👀

clear marlin
#

So what is the lib called?

lament rock
#

I need to implement a Fast Cache so that I can avoid duplicate constructed resources

slim heart
#

me working on quite literally the most barebones lib seeing all these people have to actually work on supporting new discord features kek

lament rock
#

it's called ThunderStorm, but it's not on NPM. Only on GitHub

#

There's already a ThunderStorm on NPM :(

opal plank
#

dunno why you want to use v9 since they'll add most of the cool features back in v8

clear marlin
#

Thunderstorm cool

lament rock
#

Threads won't be sent over v8

clear marlin
#

It's a nodejs lib..

#

Welp, is there even a deno discord lib?

lament rock
lament rock
#

if there isn't, make one

clear marlin
#

Lol sure

slim heart
#

Threads are a new Discord feature, only available in API v9. Bots that do not update to API v9 will not receive gateway events for threads, or things that happen in threads (such as Message Create). Threads can be thought of as temporary sub-channels inside an existing channel, to help better organize conversation in a busy channel.

prime mist
clear marlin
#

You did just say you would go

#

Ok so there is a discord deno

opal plank
#

you use them for 5 minutes

#

then stop it

#

probably will be used for reddit-like servers

slim heart
#

they're still important to cover

opal plank
#

they kinda trash tho

slim heart
#

like i wouldn't want censor bot to just ignore messages sent in threads lmao

opal plank
#

hmmm it must be temporary then

lament rock
#

Every day, v6 comes closer to actually being retired, but some "official" clients aren't updated yet. Taking a look at Eris

clear marlin
#

Threads, that's kinda cool. Although is it just for bots?

opal plank
#

no

#

its like staging channels

#

its a feature you'll use for a week

clear marlin
#

Ahh

opal plank
#

and never again remember abot it

lament rock
#

They're temporary channels within channels

clear marlin
#

Its a guilded feature

opal plank
#

ik, i have access to them

clear marlin
#

I've tried that out

lament rock
#

wait what

clear marlin
#

yeah "guilded"

opal plank
#

yeah, both buttons, some other stuff and threads

clear marlin
#

I think

slim heart
#

erwin what do u think abt this?

lament rock
#

Are you using a client mod to enable experiments or did you use the console command

slim heart
#

the console command is client mods

#

btw

opal plank
lament rock
earnest phoenix
#

Erwin the stage channels are good for online classes

clear marlin
#

Lmfao

opal plank
#

sure

slim heart
opal plank
#

like "online classes" servers have more than 500 members to qualify as community server

opal plank
slim heart
#

only discord employees can have experiments without client mods

earnest phoenix
#

Only unmute kiddos when necessary so you dont end up with an eternal fan noise in the meeting

opal plank
slim heart
#

lemme see

opal plank
slim heart
#

cuz even bmg tries to strangle employees into allowing them but they cant lmao

earnest phoenix
#

umm
this channel is for bot development not discord

lament rock
#

We're talking about dev related stuff

earnest phoenix
#

k

#

Is djs still working on slashcommand support

lament rock
#

probably tbh

earnest phoenix
#

w h y

lament rock
#

docs stable search slash doesn't return anything

earnest phoenix
lament rock
#

nada

clear marlin
#

Hey, What are you trying to do? Like configure a webhook when a user buys premium?

slim heart
#

im thinking about whether or not to do a redirect url or a webhook to link a user

clear marlin
#

What is this for?

slim heart
#

a bot

clear marlin
#

Ah

slim heart
#

my concern is if someone uses a different email

earnest phoenix
#

store their user id in a database in a list of premium users

clear marlin
#

that's what he is doing, he said so

lament rock
#

linking with something relatively static is a good idea. Most logins are keyed by email

earnest phoenix
#

how about discord oauth

lament rock
#

could even offer a feature of secondary email or email changing

clear marlin
#

Adding emails, that's what GitHub does

#

So basically you are linking a user's email to the database right?

#

Why not use a webhook

#

What database are you using?

#

@slim heart

slim heart
#

mongo

earnest phoenix
#

are you hosting your app on the cloud

clear marlin
#

Just use a webhook

earnest phoenix
#

because then you can use a serverless function

clear marlin
#

he's tryna use chargebee with mongo

#

So I guess, http webhooks

fathom rampart
#

message.author.presence.status always returning me "offline", but with my other bot it say dnd, does someone know why, and i get all intents

earnest phoenix
fathom rampart
#

yes

#

same when i do message.guild.members.cache.get('id')

#

it say offline

earnest phoenix
clear marlin
#

So you want to get a user's presence status right

fathom rampart
#

yes

#

it work fine on my other bot, but i created a bot to test it, and it doesn't work

#

it's the same code, and intents are enabled

clear marlin
#

Welp looks like there's something wrong with the intents here

lament rock
#

If the message author has the bot blocked, the client won't receive PRESENCE_UPDATE events

clear marlin
#
const Discord = require('discord.js');
const intents = new Discord.Intents();
intents.add('GUILD_PRESENCES', 'GUILD_MEMBERS');

const client = new Discord.Client({ ws: { intents: intents } });

#

Try this too

#

And maybe reinvite your bot

fathom rampart
#

i get this already, idk if something is wrong with that

const client = new Client({ intents: Intents.ALL, fetchAllMembers: true, disableMentions: 'all' });
clear marlin
#

That should work

#

Reinvite bot

oak nymph
#

getting this error while setting up MongoDB, any idea why?

#

Here's the code :

mongo_url = (os.getenv('url'))
cluster = MongoClient(mongo_url)
dab = cluster["discord"]
collection = dab["toggle"]```
clear marlin
#

You are using pymongo?

oak nymph
#

import pymongo
from pymongo import MongoClient

#

dis one

clear marlin
#

Similar to your console errors

earnest phoenix
#

any one say how mention user

#

here

#

in js

opal plank
opal plank
#

what?

earnest phoenix
#

mention user cnt work i do it

#

that you all say

#

i do like that

opal plank
#

why cant work?

earnest phoenix
#

i cnt know

#

probelam

opal plank
#

the lack of english also is troublesome

earnest phoenix
earnest phoenix
opal plank
#

google translate then

earnest phoenix
#

here i want add it

#
 let thing = new MessageEmbed()
      .addField("START PLAYING", song.title, true)
      .setColor("#fffa69")
      queue.textChannel.send(thing);
    };

#

i need add mention user

opal plank
#

use ``

#
`START PLAYING ${user}`
earnest phoenix
#

ok

#
 let thing = new MessageEmbed()
      .addField("START PLAYING ${user}", song.title, true)
      .setColor("#fffa69")
      queue.textChannel.send(thing);
    };
#

here

#

eriht

#

@opal plank cnt work error comes

#

Wtf is that bot name

earnest phoenix
#

sadcat but dont abuse our prime minister

#

i can talk in hindi but i cant help you now because i have online class

earnest phoenix
#

pls na bol

#
Unhandled Rejection at:  Promise {
  <rejected> ReferenceError: user is not defined
      at play (/home/runner/explain/commands/play.js:136:34)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
} reason:  ReferenceError: user is not defined
    at play (/home/runner/explain/commands/play.js:136:34)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
#

ya error a raha

#

ha

#

error padho
user is not defined
tumne user variable ko kaha define kiya hai

#

ara wo nhi

#

embed hie nhi a raha wha

#

error hoga to embed kaise send hoga

earnest phoenix
#

bolo na mention kasa kara

#

tumne user variable ko define nahi kiya hai

#

use define karo

#
    let thing = new MessageEmbed()
      .addField("START PLAYING", song.title, true)
      .setColor("#fffa69")
      queue.textChannel.send(thing);
    };
#

yaha

#

pa karna ha

#

mention

#

user variable define karo

#

ara wahi to nhi ata muja

#

ma noob hu '

#

is liya puch raha na

#

sahi kar da na ps

#

dude is working on a bot but doesn't know how to define a variable

earnest phoenix
#

wha bc

#

this is how you do it:
let variable = smth

#

english ma ya angrajo ka samna apna bhie ka majk urata

#

wha

#

asa nhi kar sakta

#
    let thing = new MessageEmbed()
      .addField("START PLAYING", song.title, true)
      .setColor("#fffa69")
      queue.textChannel.send(thing);
    };
#

embed ma dal d

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

can i spoonfeed for just one time

#

ok

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

bhie

#

ak min

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

@earnest phoenix dm kar sakta bolo

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

yes

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

@earnest phoenix

    let user = message.author.tag;
    let thing = new MessageEmbed()
      .addField(`START PLAYING ${user}`, song.title, true)
      .setColor("#fffa69")
      queue.textChannel.send(thing);
    };

ye lo

#

@sage bobcat what's bothering you turk

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

i am not noob

#

bro

sage bobcat
earnest phoenix
#

tbf you are a noob
but try using this code now

#

@sage bobcat u

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

you do what you want i just give you the code because im tired of avoiding spoonfeeding

oak nymph
clear marlin
knotty obsidian
#

How can I get a file path of a file in the project without specifying the exact path

#

java

#

forgot to mention

#

from Moderation.java to data.json

earnest phoenix
#

@knotty obsidian not sure if this works in java but ./data.json

knotty obsidian
#

ill try

#

no didnt work

proven lantern
earnest phoenix
#

java is an awesome language

proven lantern
#

everything is a pain in Java

earnest phoenix
proven lantern
#

when i have a choice

worldly dagger
#

hi can anyone create a webhook for me

#

pls

solemn latch
#

-needdev

gilded plankBOT
#

You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.

solemn latch
#

👀 wasnt exactly what i wanted it for but sure

worldly dagger
#

is it for free

#

can you people code for me pls

solemn latch
#

nope. you have to hire developers. the vast majority of developers its how they make money to live and whatnot.

worldly dagger
#

ok

#

thanks

#

@solemn latch what are the skills requried for the coding of webhook

solemn latch
#

the ability to program, understanding the very basics of http

clear marlin
#

Understand net/http

earnest phoenix
#

Having spare ctrl, c and v buttons

worldly dagger
#

{
"name": "test webhook",
"type": 1,
"channel_id": "199737254929760256",
"token": "3d89bb7572e0fb30d8128367b3b1b44fecd1726de135cbe28a41f8b2f777c372ba2939e72279b94526ff5d1bd4358d65cf11",
"avatar": null,
"guild_id": "199737254929760256",
"id": "223704706495545344",
"application_id": null,
"user": {
"username": "test",
"discriminator": "7479",
"id": "190320984123768832",
"avatar": "b004ec1740a63ca06ae2e14c5cee11f3",
"public_flags": 131328
}
}

#

i have the code

#

but i do not know how to run it

#

pls tell can i run it through github

clear marlin
#

Is this

#

discord webhooks?

worldly dagger
#

yes

clear marlin
#

Use a programming language like javascript

#

using a discord api wrapper like discord.js

worldly dagger
#

ok

#

can you do

#

if you i can pay you

earnest phoenix
#

THEY EXPOSED THEIR FUCKING TOKEN

#

DELETE THE WEBHOOK NOW

worldly dagger
#

how much rs?

clear marlin
#

No thanks, I don't do hires. I'm fucking busy with my own job.

worldly dagger
#

ok

worldly dagger
worldly dagger
slender thistle
#

Is it really fake

clear marlin
#

It isnt

#

Is it

worldly dagger
#

the webhook token does not work

clear marlin
#

Ok it doesn't look fake

slender thistle
#

I cba to test it kekw

worldly dagger
#

cba means

#

and keke means

#

@earnest phoenix your games lags

#

it was in the discord site

#

they gave an example

slender thistle
worldly dagger
#

yes

#

it will send messages throw other apps to discord

#

see the webhook i gave is a fake

#

CODE NAME POSSIBLE SOLUTION
2020 Request Signing Failed Check user entitlement
2022 Disk Space Low Free up disk space
2023 Disk Permission Denied Choose a new location, or change write permissions on desired location
2024 Uninstall Failed Attempt to manually remove game files from disk
2025 Install Script Failed Restart Discord, attempt to uninstall/reinstall the game, ensure script is correct
2029 Build Not Found Completely close and re-open Discord
2051 Panic! Escalate in the dev server in #dispatch
2058 Too Many API Retries Escalate in the #dispatch channel of the Discord Developers server
2059 Failed to set Registry Key User most likely denied Windows administrator permissions prompt. Try again, and accept the prompt
2064 Failed to Patch File Attempted to patch the game while running: ensure the game process is entirely ended, try restarting Discord, try disabling antivirus
2065 No Manifests Ensure that your manifests are properly selected in the Developer Portal for your SKU
2069 API Error Intermittent API issues. Wait, escalate to #dispatch in the dev server if it persists
2070 Bad Reponse Intermittent API issues. Wait, escalate to #dispatch in the dev server if it persists
2073 Not Entitled Check that your manifests are properly configured in the Developer Portal. Have the user install the game from the Library, not the store page
2076 Two Clients Patching User has multiple Discords open trying to patch the same game; only use one
9001 Unknown Catch-all error code. Escalate to #dispatch in dev server with repro steps/as much info as possible

#

eeerrr codes

#

discord

old cliff
#

whats the codeblock term for regex?

pale vessel
#

What do you mean

elfin shadow
#

autopost still not working?

#

nvm i just read about topggpy

fathom rampart
#

There is my index.js file, i get all intents but the statuts still offline for every user, excepted 2-3 users

const { Client, Intents } = require('discord.js')
const config = require('./config')

const client = new Client({ ws: { intents: Intents.ALL }, fetchAllMembers: true, disableMentions: 'all' })

client.on('message', async message => {
    if(message.author.id !== '242233306488373249') return;

    message.channel.send(message.author.presence.status)
})

client.login(config.token)
clear marlin
#

Welp

#

I can't think of anything

#

Other than the web sockets intents thing

willow mirage
vital radish
#

mdr

earnest phoenix
#

hi

#

does anybody know how to create custom scollbar only for desktop version?

#

i mean not with max-width

earnest phoenix
#

it can also be seen on phone

knotty obsidian
#

So I got this error when running my jar
java.lang.UnsupportedClassVersionError: me/scorpion37/scorp37/Main has been compiled by a more recent version of the Java Runtime (class file version 58.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Anyone knows how can I fix it? (Java)

#

I didn't really change anything besides add a json-simple-1.1 library

vivid fulcrum
#

the java runtime you're trying to run the file with is an older version

#

the file has been compiled with a java version that's newer

#

so it can't run

knotty obsidian
#

but im still using the same versions

vivid fulcrum
#

you aren't

unkempt grotto
unkempt grotto
#

it's been compiled by v58

#

but you are running it on v55

vivid fulcrum
#

the file is compiled with jdk 14, you're trying to run it with jdk 11

clear marlin
#

I mean people want their freaking website to be reactive, i.e., mobile compatible I don't understand why you just want it for desktop? Are you making a desktop app with electron?

worn sonnet
#

is there any open source database like the one mudae bot has?

vivid fulcrum
#

open source database?

#

as in the database code is oss?

#

look into postgres

worn sonnet
#

Oh

#

Like the one Pokémon bot has

#

Claiming and all

clear marlin
#

Open source database is cockroachdb

#

You should go over to GitHub and search it out

worn sonnet
#

https://www.fandom.com/
Any api or way to access data from it?

eternal osprey
#

hey

#

i am trying to set adsense for my website, however it isn't really working out.

#

for some reason it doesn't allow my domain as it is too long?

knotty obsidian
#

When I run my bot on the raspi it always says that the file I copied the path to doesn't exist, why?
the path: /home/pi/DiscordBots/Scorp37
what i entered: File data = new File("/home/pi/DiscordBots/Scorp37/data.json");

(java)

cold meteor
#

Raspberry pi 4?

knotty obsidian
#

Raspberry pi 3b+

cold meteor
#

what i did is manually go to it

#

so open a Cmd

knotty obsidian
#

don

cold meteor
#

type cd DiscordBots/Scorp37

knotty obsidian
#

did

cold meteor
#

Should bring you to your file path

knotty obsidian
#

ye it did

#

so i only need the last part?

cold meteor
#

im not sure if its the same, cuz im using python

#

but java data.json

knotty obsidian
#

oh right

cold meteor
knotty obsidian
#

did File data = new File("java DiscordBots/Scorp37/data.json"); that

cold meteor
#

did it work?

knotty obsidian
#

trying rn

#

hopefully it works

#

been tryna fix it for an hour now

#

welp

#

didnt work

cold meteor
#

Mind hopping into the bot dev channel

knotty obsidian
#

also

#

java DiscordBots/Scorp37/data.json (No such file or directory)

#

wait

#

if the data.json file is a json file

#

dont i do

#

File data = new File("json DiscordBots/Scorp37/data.json");

#

weird thing it works on eclipse

#

nope

#

still nothin

#

this is weird

#

i tried everything lol

#

dunno what it wants from me

#

wha

#

im tryna boot up a json file

#

tables

#

like

#

warning counts

clear marlin
#

can you write everything in one line

#

seems as if your spamming lol

cold meteor
#

hes in vc with me

knotty obsidian
#

lol

#

yeh

clear marlin
#

no vc chat here

knotty obsidian
#

i tried looking it up

clear marlin
#

uhm

knotty obsidian
clear marlin
#

I know that

knotty obsidian
#

oke then

clear marlin
#

lmfao

#

just carry on

knotty obsidian
#

lol ok

#

anyways i ran out of ideas to try

#

the main problem that i cant search it up is because im exporting it into a jar file and then running it on my pi

#

hmm

#

wait now if i do cd /DiscordBots/Scorp37 it says no such file or directory

#

but why did it work before

#

my computer has C:\ while the pi is just /home

#

/home pi?

#

/homepi

#

bash: cd: /homepi/DiscordBots/Scorp37: No such file or directory

#

nope

#

2 only

#

i mean shouldnt effect much

#

they are seperate

earnest phoenix
#

What is clustering?

knotty obsidian
#

is there any other way i cud do it 🤔

#

sudo nano /home/pi/DiscordBots/Scorp37/data.json
worked

#

in the terminal

#

wha

#

oh my friend did it and said i shud use it

#

now my entire project is java

#

yeh ik

#

the thing i do it shud work

#

but it doesnt

#

oi

#

found something

#

i might find how to search it

clear marlin
earnest phoenix
lavish minnow
#

When in doupt stackoverflow it out

knotty obsidian
#

i gtg ill find out myself later

clear marlin
ancient vault
#

pls snipe

#

who tf ghostpinged me

#

@mint thicket

#

someone ghost pinged me

#

do u mind checking audit log?

boreal iron
#

Calm ... nobody cares about a ghost ping

slender wagon
#

Stupid

delicate shore
#

is this inbuilt?

cinder patio
#

yes

delicate shore
#

k thx

worn sonnet
umbral zealot
#

did you... try?

lusty quest
#

the Fandom wiki api is somewhat deprecated, atleast it where the last time ive used it. they migrated to the Mediawiki software, but the API endpoints are a bit fucked.

daring willow
#

You can use iframes, use #development if you have any further questions
but i mean it is put my website into the top.gg bot pagethinkWOT4

umbral zealot
#

yes, you can use an iframe to put your website in the top.gg bot description

sacred juniper
#

I am using BDFD and $addTimestamp doesnt working
What should i do

daring willow
#

👀 ok im noob to html

umbral zealot
#

so go search how to use iframe

#

¯_(ツ)_/¯

daring willow
worn sonnet
# umbral zealot did you... try?

Did u saw the msg?
I found the python API but it's kinda depreciated or not working and I checked rapidapi but no results so.. I asked here

umbral zealot
#

APis aren't in languages

#

APIs are HTTP. They're web requests

worn sonnet
umbral zealot
#

what you found was a python library, but the API itself can be used in any language

worn sonnet
umbral zealot
#

But it's possible there isn't and you need to do it yourself.

#

¯_(ツ)_/¯

worn sonnet
#

I did mentioned in above msg

earnest phoenix
#

I'm looking for a good VPS host, reliable, around 15 €

lusty quest
#

the API is completely fucked, had a command for one of my bots using it and ive had to disable it

#

Digitalocean is decent

worn sonnet
lusty quest
#

for 10€/Month you get quite far

umbral zealot
#

Nothing, there's nothing wrong with asking.

earnest phoenix
lusty quest
#

will be more than enough, the 5€ droplet will work just fine (if you dont do CPU heavy stuff like machine learning)

lyric mountain
#

droplets are quite expensive for long-running tasks

daring willow
#

wow im very smort

#

i just try to put iframe to long description and it work

clear marlin
#

A question for you smart developers. So, I'm planning to add a dashboard to my bot in nodejs. Since golang web servers are effective I'm planning on using that. But I'm a bit confused, how I could use server-side rendering with the golang web server. Like, A user authenticates and I need to get data about the guilds he shares with the bot, but how would I accomplish this with a go, although it ain't my client side language.

lyric mountain
#

not smart developers, you're looking for Go developers

tired panther
clear marlin
#

uh, I said go web server.

lyric mountain
#

still

clear marlin
#

Basically, all I want is to share data between the server and the client.

umbral zealot
#

Well, you're using Go, as a language, so you're looking for a developer that knows Go, specifically.

#

But the basics of sharing data between BE and FE is making an API using HTTP. Or using websockets.

clear marlin
#

Can oauth2's in discord know what guilds a user that logs in shares with the bot/client?

umbral zealot
#

It can see what guilds the user is on yes, with the guilds scope

#

And then you have to compare that to your own bot guilds to see which they share

clear marlin
#

ah, that'd be a bit tricky

#

alright, I think I got this resolved.

sacred juniper
#

I want to use :emojiexample: on my bot but i can see this emoji only if that server have it

#

I couldnt write

#

<:emojiname:emojiID>

zenith terrace
sacred juniper
#

Yea ik

clear marlin
#

Stargirl be like: 20 unique tips to create gifs in seconds!

sacred juniper
#

But i cant see on my bot in other servers because they dont have this emoji

zenith terrace
#

they dont need the emoji

sacred juniper
#

So what I mean is that if the emoji I use in the bot is available on that server, it only appears

solemn latch
solemn latch
#

the server staff gives it to you

zenith terrace
#

does your bot have this permission?

sacred juniper
#

Is it on discord dev portal ?@zenith terrace

lyric mountain
#

that's server config

zenith terrace
#

server role permissions

sacred juniper
#

How can i go this settings @zenith terrace

zenith terrace
#

server settings

sacred juniper
#

It doesnt working

#

I tried but

#

I cant see again

zenith terrace
#

it should work just fine

solemn latch
#

so it shows in the one server from the bot, but not the other?

sacred juniper
#

it appears on the servers where the emoji is located

zenith terrace
#

are you sure you are doing the <:emojiName:emojiID>

sacred juniper
#

Yes

#

%100

lyric mountain
#

show that part of the code

sacred juniper
#

Ok

lyric mountain
#

hm, bdfd

#

but ye, that seems right

sacred juniper
#

My freind uaing same programe

lyric mountain
#

is the emote's name exactly evet1?

sacred juniper
#

It is working

sacred juniper
zenith terrace
sacred juniper
#

It s mean yes in english

lyric mountain
#

also, is that emote from a server your bot's in?

sacred juniper
sacred juniper
#

Idk what is the problam

#

😒

lyric mountain
#

if you fetch that emote by ID does it return something?

sacred juniper
#

What does it mean i dont understand

lyric mountain
#

well, there are really 3 reasons for an emote not to work:
A - the name-ID combination is invalid
B - the emote is from a server your bot's not member of
C - missing Use External Emoji permission

sacred juniper
#

none of

lyric mountain
#

it has to be one of those

#

else it'd be working

sacred juniper
#

unfortunately not anyone

#

I've tried this at least 5 times

#

Maybe B

#

But

#

My friend using same programe with me

#

And he can see

lyric mountain
#

same code <> same bot

sacred juniper
#

But i cant see my

#

He uses BDFD

lyric mountain
#

still

sacred juniper
#

And i am using BDFD

lyric mountain
#

bdfd is a tool, not the bot itself

sacred juniper
#

He writing only :hg:

lyric mountain
#

if your friend's bot is in a server it doesn't mean yours is

sacred juniper
#

And he can see

#

Yea i know but

#

I think it will not ok

#

So

lyric mountain
#

you obviously cant use emotes from a server your bot's not in

sacred juniper
#

anyway thanks for your answers

#

I kbow

#

but a server with my bot

eternal osprey
#

hey!

#

So my bot is in a server with 100k members

clear marlin
#

that's so hawt

eternal osprey
#

why is my bot still displaying that it is serving 33k users only?

quartz kindle
#

are you using guild.memberCount?

eternal osprey
#

uhh not sure let me check

#

no i am using: ${client.users.cache.size}

quartz kindle
#

then thats why

eternal osprey
#

so i have to set it to guild.memberCount?

quartz kindle
#

guild.memberCount contains the total number of members in a guild

#

you have to get the number for each guild and add them all together

eternal osprey
#

but my bot is not only in 1 guild

#

in 93 to be exact.

#

wouldn't that give issues?

quartz kindle
#

you have to get the number for each guild and add them all together

eternal osprey
#

is there like a doc online for this?

quartz kindle
#

do you know how to loop over all guilds?

eternal osprey
#

uhh not sure

#

can't we use reduce?

cinder patio
#

tim tim tim

quartz kindle
#

reduce is another way of looping

quartz kindle
cinder patio
#

I'm working on a way to make chains like array.filter.map.join faster while keeping the same syntax

#

so far so good, already faster than the default implementations

quartz kindle
#

by reusing the same array instead of creating copies?

cinder patio
#

Nope, way clunkier. The syntax isn't exactly the same, you have to do something like this:

const Iter = new FIter().filter(num => num % 2 === 0).map(num => num * 2).join("-").compile();
Iter([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

but basically every call to filter, map, etc. gets put in an array along with the provided functions, and the compile method turns them into a string, which is then given to the Function constructor

#

resulting in O(n) chains

quartz kindle
#

ah so its a compiler for array operations

cinder patio
#

yeah

#

it even allows me to do optimizations, for example the snippet above would compile to:

const l = arr.length;
r = ""
for (let i=0; i < l; i++) {
   if (!(num => num % 2 === 0)(arr[i], i)) continue;
   r += (num => num * 2)(arr[i], i) + i === l - 1 ? "":"-";
}
return r;

But minified

#

Also supports reduce, forEach and count

#

I can make it even faster by parsing the provided functions to eliminate calling them, but I cba right now

digital oyster
quartz kindle
#

ive done similar stuff in another project, for json

#

its pretty much what fast-json-stringify does

cinder patio
#

oo what does it do

quartz kindle
#

you know the fast-json-stringify module on npm?

#

they create a schema-based compiled json stringify

cinder patio
#

I didn't until now, just googled it

quartz kindle
#

the downside is that you have to know exactly how the json you're packing looks like

earnest phoenix
#

which website is best for host

quartz kindle
#

so its not very useful for highly varied json

#

but its very useful for consistently structured json messages, such as in websockets

cinder patio
#

I see, that's really cool

quartz kindle
#

the project im working on is similar, but to a binary format like messagepack

earnest phoenix
#

🥺 any one cnt reply me

#

i like trash

quartz kindle
#

you want to host a website or a bot?

earnest phoenix
#

bot

#

👀

quartz kindle
#

then any vps will do

#

there is no best, just check how much it costs and what it offers

earnest phoenix
#

i want host my visual studio codes i try fist time so i ask

quartz kindle
#

good choices are digital ocean, ovh, vultr, galaxygate, contabo, scaleway and more

earnest phoenix
#

cn you how i procces work

#

from my visual studio codes to host

quartz kindle
#

via sftp

#

and ssh

earnest phoenix
#

👀

quartz kindle
#

a vps is a server that you connect to over the internet, the most popular method is SSH which is like a cmd terminal that sends commands to the server

earnest phoenix
#

because my replit codes crash every time

quartz kindle
#

SFTP is used to send files over SSH, there are extensions for visual studio code that do it for you

earnest phoenix
#

website full name

summer torrent
#

what is S in SFTP

#

FTP is file transfer protocol

quartz kindle
#

the S is literally SSH

earnest phoenix
quartz kindle
#

SFTP (SSH File Transfer Protocol) is a secure file protocol that is used to access, manage, and transfer files over an encrypted SSH transport

slender thistle
#

Safe mmLol

summer torrent
#

Free hosts are bad

earnest phoenix
#

where you host

summer torrent
#

ovh

earnest phoenix
oak nymph
#

Hey guys so I've made a lyrics command that basically sends the lyrics of a song entered by the user, but some songs are of 2000 words and above, I wanna know how do I bypass the limit?
This is my code atm, any help would be appreciated, Thanks!

@commands.command()
    async def lyrics(self, ctx, artist,*, title):
     url = f"https://api.lyrics.ovh/v1/{artist}/{title}"
     response = requests.get(url)
     json_data = json.loads(response.content)
     lyrics = json_data['lyrics']
     emb = discord.Embed(title = f"{title}" , description = f"{lyrics}",color = 0xa3a3ff)
     await ctx.send(embed=emb)```
lyric mountain
#

you don't, simple

earnest phoenix
#

hey

lyric mountain
#

BUT you can send a text file instead

#

since discord has a .txt parser now

#

won't solve the issue

oak nymph
#

nope

#

2048

deep mantle
#

oh

lyric mountain
#

it's total chars per embed that's 6k

oak nymph
#

waittt what abt paginated embed?

deep mantle
#

then nvm

lyric mountain
oak nymph
#

oh

#

how do I do dat?

earnest phoenix
#

pls

oak nymph
#

sure

earnest phoenix
#

yayyy

oak nymph
#

ohhh

#

the .txt way

#

kkkk got ittttt

lyric mountain
#

.txt files are converted to a colapsible (kinda) embed

earnest phoenix
#

I didn't knew that

sterile lantern
#
let isAdmin = function(num){
        console.log(num)
        if(num === ((17179869183 || 8 ) || ('17179869183' || '8')))
return true
        else return false
    } 
    //console.log(isAdmin(interaction.permissions))
    console.log(isAdmin('17179869183'))```
lyric mountain
#

are you two on pc?

oak nymph
#

tho idk the code for it lul

sterile lantern
#

how come the last console.log returns undefined

oak nymph
crystal wigeon
#

anyone know using socketio with react?

lyric mountain
oak nymph
lyric mountain
#

just send the file

#

.txt gets parsed into that

crystal wigeon
#

stupid thing is creating multiple connections on page refresh, cant figure out why, its like sometimes it create 2 connections on page refresh other times it doesnt. been mindfkin me for hours now

lyric mountain
#

just like images get parsed into...well...images

sterile lantern
#

and yes, the number matches

oak nymph
# lyric mountain just send the file

can't do that, returns this error : An error occurred: Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.description: Must be 2048 or fewer in length.

sterile lantern
#

2nd console.log returns false for some reason

lyric mountain
#

you need to send a text file

sterile lantern
#

oop

#

yeah

crystal wigeon
#

oof

oak nymph
earnest phoenix
#

The correct solution to your problem is placing them in an array and see if array includes that number

slender thistle
#

Do HTTP request cookies have to be of type Dict[str, str], meaning both keys and values are strings?

earnest phoenix
lyric mountain
#

so yes, a dict of str str

slender thistle
#

Time to do fucking conversions!

#
    for cookie in list(driver.get_cookies()):
        for key in cookie:
            if not isinstance(cookie[key], str):
                cookie[key] = str(cookie[key])
        session.cookies.update(cookie)

Looks dumb but works

#

Woohoo it doesn't like the cookies I send!

crystal wigeon
#

anyone?

eternal osprey
#

hey @quartz kindle i used what you told me

#

however, now it is even showing 28k users while 1 guild already has 100k users

#

so it is not possible

#

let z = client.guilds.cache.reduce((a, g) => a + g.memberCount, 0) client.user.setActivity(`!help || Serving on ${client.guilds.cache.size} servers, for a total of ${z} users`); this is what i have

lyric mountain
#

not everyone is cached

eternal osprey
#

and there are still 92 guilds left to be checked

#

so it isn't working

quartz kindle
#

how do you know this guild has 100k?

#

how did you measure it

eternal osprey
#

if you go to server settings, discord shows you how much members you have in the server.

quartz kindle
#

is it your server?

eternal osprey
#

not my server, i am just a moderator there.

#

this alone is only one guild, so the total should be around like 200k

#

but my bot is only showing 30k

#

should it still like load up or something

lavish vale
#
@tasks.loop(minutes=30)
    async def update_stats():
        try:
            await self.bot.dblpy.post_guild_count()
            print(f'Posted server count ({self.bot.dblpy.guild_count})')
        except Exception as e:
            print('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
    update_stats.start()
    ```
#

it is saying self is not defined for some reason

#

it is below def init

#

and all the other events and commands in the cog work

#
NameError: name 'self' is not defined
Failed to post server count
NameError: name 'self' is not defined
Failed to post server count
NameError: name 'self' is not defined```
deep mantle
#

to the function

lavish vale
#

ah

#

alright ill try

slender thistle
#

Is this in a cog

lavish vale
#

yes

slender thistle
#

Why is the update_stats.start() at the bottom of it then

#

Refer to that function as self.update_stats in the cog's init and start it there

lavish vale
#

self is still not defined

#

ok

slender thistle
#

And as nyos said, pass self to the function

#

How did you pass it

lavish vale
#

async def update_stats(self):

slender thistle
lavish vale
#

eh

#

ill just

#

go ahead and

#

put the function in main.py without self

lyric mountain
#

that's...not how it works

eternal osprey
#

Is it because the bot needs some time?

earnest phoenix
#

hi

#

I have an simple database module

#

I write a code for subtract

#

with fs

#

but when I try it, it do data null

lyric mountain
earnest phoenix
lyric mountain
#

then you need a database

#

because this statement is controversial

eternal osprey
#

that's what tim said

earnest phoenix
eternal osprey
#

as i first used client.users.casche

lyric mountain
lyric mountain
#

which is, unless your bot's life depends on it, a reeeeeeally bad idea

earnest phoenix
#

any one say some bot hosting website

misty sigil
#

ovh? gcp? azure? aws?

lyric mountain
#

none

earnest phoenix
#

not replit,heroku

#

and glitch

#

pls

solemn latch
#

any vps provider

earnest phoenix
#

how long should i wait to approve my bot

#

??

lyric mountain
earnest phoenix
#

😦

earnest phoenix
solemn latch
earnest phoenix
#

😮

#

k thx

oak nymph
#

Ok so the lyrics command works now, I just wanna know how do I make it so that ppl can enter the artist name without including the "-" that'll be used in the url, any help would be appreciated, Thanks!py @commands.command() async def lyrics(self, ctx, artist,*, title): url = f"https://api.lyrics.ovh/v1/{artist}/{title}" response = requests.get(url) json_data = json.loads(response.content) lyrics = json_data['lyrics'] file = open("lyrics.txt", "w") file.write(lyrics) file.close() await ctx.send(file=discord.File("lyrics.txt"))

oak nymph
#

@lyric mountain do uk how to do it brotha?

earnest phoenix
#

galaxy gate

solemn latch
oak nymph
#

not rly no

#

github students.

lyric mountain
lyric mountain
oak nymph
oak nymph
#

or the student developer pack

solemn latch
#

like their static sites?

oak nymph
#

I got a free domain and hosting service from it xD

oak nymph
#

they give u a bunch of things for free

lyric mountain
#

or yeah, urlencode it

tired panther
#

100$ digital ocean credits

#

or mircrosoft azure, they even offer free 1gb vms, you just have to pay some cents for the public static ip

solemn latch
lyric mountain
#

just keep in mind that you can only go so far while free

#

bottleneck is really low

oak nymph
#

the domain has tricks doe

#

u can move the domain to a new registrar and get 1 year extension

#

even two years for some services

lyric mountain
#

we're talking about bots

#

not sites

oak nymph
oak nymph
tired panther
#

there are free domains like .tk, .ga, .wtf

oak nymph
#

yas

lyric mountain
#

and wtf aint free afaik

tired panther
#

how much will top.gg cost, when its a so high price on .co blob0w0 Pika_Think

lyric mountain
#

that's purchase price

#

renewal price is a lot lower

#

so as long as veld keep top.gg, it'll stay cheap

tired panther
solemn latch
#

ill put in a buy offer for top.gg for $15. an offer veld cannot refuse.

lyric mountain
#

imagine if there was a site called pot.gg but instead of listing bots it listed drug dealers

solemn latch
#

angeryBOYE someone owns it, nothings on it though

lyric mountain
solemn latch
#

👀

lyric mountain
#

that's google's html testing grounds ig

#

or was, that site's copyright dates 2010

oak nymph
tired panther
#

veld should buy this xD

earnest phoenix
#

My nitro end I Spend all of money in game

tired panther
boreal iron
#
function whatTheFuck(arg)
{
    if(!arg || arg.length != 32) return null;

    return new Promise((resolve) =>
    {
        resolve("test");
    });
}

async function getBanStatus(arg)
{
    let status = await whatTheFuck(arg);
    
    console.log(status);
}

getBanStatus(process.argv[2].trim());

why the fuck doesn't it log the promise?

solemn latch
#

you want it to return the promise?

#

can delete await and remove the async from the getBanStatus function.
it should log the promise then.

#

or keep the async if you really wanted.

boreal iron
#

nope, that will return Promise { <pending> }

solemn latch
#

thats what you wanted?

cinder patio
#

Looks fine to me

solemn latch
#

why the fuck doesn't it log the promise?
👀

boreal iron
#

why the fuck does my console log it's still pending

cinder patio
#

whut

boreal iron
cinder patio
boreal iron
#

yeah I know I got a different result

cinder patio
#

Something else is causing it then, it's not from the snippet you posted

boreal iron
#
function topSecretName(be_guid)
{
    if(!be_guid || be_guid.length != 32) return null;
    
    const socket = dgram.createSocket("udp4");
    const buffer = Buffer.from("..6.." + be_guid, "ascii");
    
    console.log(be_guid);
    
    return new Promise((resolve) =>
    {
        socket.on("message", (message) =>
        {
            const result = message.toString().slice(4);
            
            if(result) resolve(result.replace(/global ban /gi, "")); else resolve(false);
        });
        
        socket.send(buffer, 2324, "x.x.x.x", (response) =>
        {
            if(response) socket.close();
        });
    });
}
#

The promise should be resolve(result.replace(/global ban /gi, ""))

#

that's a ban status string

cinder patio
#

you might want to resolve the promise in the socket.send callback as well?

solemn latch
#

is it logging null?

sturdy dock
#

If I'm already using prepared statements for MySQL is there any additional sanitization I should be doing for user input? mysql2 lib for js.

boreal iron
#

I'm still getting Promise { <pending> } calling the topSecretName() function

cinder patio
#

show the code where you console log it

boreal iron
#

that's the same as the example above

lyric mountain
#

but...mysql?

#

you're asking for data corruption

sturdy dock
#

yeah i'll probably switch later on

cinder patio
sturdy dock
lyric mountain
#

ps are already escaped and guaranteed to be the same type as the field

#

so like, if the field is a string then ps will always be a string

sturdy dock
#

gotcha, that's what i was wondering

#

thanks!

lyric mountain
#

obv it'll error if conversion is impossible

sturdy dock
#

if a user tries to enter a char that isn't supported in utf-8 it would just refuse the query right

lyric mountain
#

but with strings there's no prob

boreal iron
# cinder patio are you sure
function topSecretName(be_guid)
{
    if(!be_guid || be_guid.length != 32) return null;
    
    const socket = dgram.createSocket("udp4");
    const buffer = Buffer.from("..6.." + be_guid, "ascii");
    
    return new Promise((resolve) =>
    {
        socket.on("message", (message) =>
        {
            const result = message.toString().slice(4);
            
            if(result) resolve(result.replace(/global ban /gi, "")); else resolve(false);
        });
        
        socket.send(buffer, 2324, "x.x.x.x", (response) =>
        {
            if(response) socket.close();
        });
    });
}

if(!process.argv[2]) process.exit(1);

async function getBanStatus(be_guid)
{
    let status = "test";
    
    status = await topSecretName(be_guid);
    
    console.log(status);
}

getBanStatus(process.argv[2].trim());
lyric mountain
#

for example

#

if you plan having utf-8 chars in any given field, you MUST set the length to be 191 or less

sturdy dock
#

oh hmm

#

yeah i'll probably be moving to postgresql soon without utf8 so hopefully i wont have to deal with that

lyric mountain
#

postgres doesn't have utf8 issues

#

only mysql

sturdy dock
#

yeah that figures

cinder patio
#

Promise is never going to resolve if you close the connection, you'll never receive any messages

boreal iron
#

yeah makes sense but the connections, the same code is working fine in my bot but not in that file wtf

#

doesn't resolve ...

#

means the connection works

lyric mountain
#

technically, that code will both work and don't work

#

because async

boreal iron
#
    return new Promise((resolve) =>
    {
        resolve("...");

funny... even if so there's no console log @cinder patio

lyric mountain
#

if send receives the response before on, it'll fail

boreal iron
#

ignore the socket, that works

#

oh... I found the issue lol

#

got a process.exit(); after getBanStatus(process.argv[2].trim());

cinder patio
#

bruh

boreal iron
#

yeah I should have scrolled down KEKW

#

It's exactly behind the status bar of notepad

#

nvm

boreal iron
cinder patio
#

agreed

oak nymph
#

Hey guys, so I made a news command using the news api, it works but the only problem is that it spams the news in embeds ;-; Here's a screenshot for reference and here's the code : py @commands.command() async def news(self, ctx): open_bbc_page = requests.get(main_url).json() article = open_bbc_page["articles"] results = [] for ar in article: results.append(ar["title"]) for i in range(len(results)): em = discord.Embed(title="Here's the trending news", description = f"{(i + 1, results[i])}",color = 0xa3a3ff) await ctx.send(embed=em)

umbral zealot
#

Well it's doing what you're asking

opal plank
#

could use webhooks or shorten that all into a single message

umbral zealot
#

"for each result, send a new embed"

opal plank
#

webhooks have embeds payload

#

so you can send multiple embeds in one message

oak nymph
#

yea I tried to join it but didnt work

lyric mountain
#

which is dumb not to have somthing like that for normal bot accs

oak nymph
#

hmm

lyric mountain
#

like, why webhooks can do it and bots cant?

opal plank
#

cuz skids know how to use d.js better than webhooks

#

also spam

umbral zealot
#

Doesn't discord.py have a way to just add additional fields to existing embed objects?

#

something like embed.addField() ?

oak nymph
#

it does

lyric mountain
#

I meant multiple embeds

opal plank
#

cant you just

str = 'These are the news \n';
for news in results:
str+=news
?

umbral zealot
#

So use that in your loop, then send it outside of the loop

opal plank
#

is that even valid syntax? 1 sec

lyric mountain
#
news = (news arr)
str = "\n".join(news)
cinder patio
#

Hmmm... so like I said earlier on I'm working on this compiler for array operations in js... these two pieces of code do the same thing, but the second version is 3 times faster!!!

 l = arr.length;
 gp8 = "";
  for (i = 0;; i < l; i++) {
    _ = arr[i];
    if (!(_ % 2 === 0)) continue;
    gp8 += ((_ = _ * 2) + (i == l - 1 ? "" : "\n"));
  }
  return gp8;
  let res = "";
  const len = data.length;
  for (let i=0; i < len; i++) {
      const item = data[i];
      if (item % 2 !== 0) continue;
      res += item + (i === len - 1 ? '':`\n`);
  }

Any ideas why the second would be faster?

oak nymph
#

I tried dat

oak nymph
slender thistle
opal plank
#
str = 'These are the news \n';
for news in results:
  str+=news
em = discord.Embed(description = str);
await ctx.send(embed=em)
lyric mountain
#

you need to chunk the news

opal plank
#

wouldnt this work?

lyric mountain
#

like, send a new embed every X accumulated news

slender thistle
#

Don't call it str

oak nymph
umbral zealot
opal plank
slender thistle
#

You're overriding the datatype name if you name it str

#

smh

opal plank
#

lmao

#

imagine having protected keywords

opal plank
slender thistle
#
>>> str = 2
>>> str
2
opal plank
#

confused py hater noises

cinder patio
umbral zealot
#

are you sure reduce() wouldn't be faster? did you try?

slender thistle
#
>>> str
2
>>> int
6
>>> bool
5

You can easily overwrite the datatype classes

#

Which is what you want to avoid unless you know what you're doing

umbral zealot
#

Because to be clear, you'd only need a single reduce() loop to do all 3 of these thigns

opal plank
umbral zealot
#

and on top of that, you would not need any "External" variables like res and len

opal plank
#

(massive sarcasm)

#

aight back to coding

slender thistle
sudden geyser
#

Where languages are like "here's the formal name (String); use another name instead (str)" Python does a 180

lyric mountain
#

if a python does a 180 it's called ouroboros

sudden geyser
#

that's a 360

lyric mountain
quartz kindle
#

out of scope variables are also slower than block level local vars

oak nymph
#

oh damn its 1:37 am here, didnt even realize ;-;

sudden geyser
#

am or pm

oak nymph
#

I clearly stated am

sudden geyser
#

oh didn't see

oak nymph
#

lul

opal plank
#

can i get the next iteration of a setInterval?

#

trying to look at proto but dunno if this si what im looking for

#

like, in how many ms it'll fire

lyric mountain
#

get the next iteration?

opal plank
#

yeah

#

how many ms till the next iteration

lyric mountain
#

ah, remaining time

opal plank
#

yeah

vivid fulcrum
#

store the time it executed at in the callback function

#

then just calculate Date.now() - the time

opal plank
#

im pretty sure the function itself has it

#

to avoid doing that

quartz kindle
#

node has special props in its timers

opal plank
#

in its proto at least i see some stuff

quartz kindle
#

pure js doesnt

opal plank
#

well, it is node, any way to get it?

umbral zealot
cinder patio
#

interesting

umbral zealot
#

reduce is real magic, tbh

quartz kindle
#

timer._idleStart against process.uptime() * 1000

cinder patio
#

I'll see if the compiled function can have a reduce instead of a loop

quartz kindle
#

something like timeleft = (process.uptime() - interval._idleStart) % interval._repeat

#

here timeleft = a._repeat - (process.uptime() * 1000 - a._idleStart) % a._repeat

opal plank
#

I'll try, ty

cinder patio
#

This is really weird because in the following benchmark:

const filterReduceNums = new FIter<number>().filter(num => num % 2 !== 0).reduce((acc, num) => acc + num, 0).compile(); // compiled function

filterReduce.add("FIters#filter#reduce", () => {
    filterReduceNums(data);
});

filterReduce.add("Array#filter#reduce", () => {
    data.filter(num => num % 2 !== 0).reduce((acc, num) => acc + num, 0);
});

The normal filter + reduce is like 12 times slower!

#

but only reduce is faster than filter + reduce?

lyric mountain
#

invert the order now

quartz kindle