#development
1 messages · Page 1788 of 1
vercel
domain?
.com
Thats not free
Anything else?
So I code in python on replit what code do I need to put in to set my bots status to watching xamout of servers that its in
Is there any way I can apply a JS function to all td elements on my HTML page?
is there a way to generate a new bot invite link through code? discord.js
instead of in the website
No there is not
sad
That is discord api sadly
You can use querySelectorAll() and a loop
Thank you shivaco
you sort of can lol
like you just need to fill a patter in a URL
Yes you can I guess but I dont know plus it could be violating discord ToS
I dont know that's why I said COULD
there is a generator website that does exactly the same
and its there for a few years now
i dont know why he wants the ability to "generate" a invite link throu code, but he probably got his reasons, maybe he wants to make it so that it will work for all bot accounts (for a bot invite command)
If they just mean the client user they can use https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=generateInvite
He probably wants it so he can get more people to add his bot
let days = document.getElementsByClassName("dash-cell");
for (let day of days) {
day.addEventListener(
"dblclick",
() => {
document.getElementById("info").innerText = day.toString();
}
)
}
Does this seem reasonable?
correct
🤷♂️ Wondering if there's a better way to do it
this is simple then
string = `https://discord.com/oauth2/authorize?client_id=${botid}&permissions=537159744&scope=applications.commands%20bot`
``` like this would just work
maybe edit the permissions
yeehee my double click doesn't work apparently
So I read the docs they are confusing so I know to change the presence its something like this.
[await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening,name="CursedBotsDev#4324 type :help for commands"))]
Just take away the brackets
How do I change it to watching ×amount of servers it is apart of
guess
anyone here a pro at nextjs?
and material-ui
this is my footer element
import {makeStyles} from "@material-ui/core/styles";
const useStyles = makeStyles(theme => ({
root: {
display: "flex",
flexFlow: "row",
flexWrap: "wrap",
alignItems: "center",
justifyContent: "space-around",
marginTop: 25,
"& > div": {
margin: "0 7px"
}
},
}));
const Footer = ({children}) => {
const classes = useStyles();
return (
<div className={classes.root}>
{children}
</div>
)
}
export default Footer;```
the styles const classes = useStyles(); are not applied on initial loading of the website, but if i navigate to another page the styles show up
actually the className is there, but the css styles for the class are not there
@slender thistle Maybe? js document.addEventListener( "dblclick", ({ toElement }) => toElement.classList.includes("dash-cell") && (document.getElementById("info").innerText = toElement.toString()) );
for some reason my JS script worked in browser, so there's something going on
implement your own double click handler using only single click and let the user be able to change the double click speed
Never mind, I don't think this made any sense KEKW
if(lastClickTime < userDoubleClickWaitTime) {doubleClickAction()}
LMAO
Pointless for a private project
My JS just doesn't work altogether
So it does load, but doesn't work
Ah my loop doesn't even fucking run
HAHAHAHAHA I see what's happening
My table isn't created at the time of running the JS
you ok? @slender thistle
Not exactly
My Dash DataTable gets loaded after my JS
which is an issue
... I don't need JS for this, apparently
How can i provide bot to join a stage channel
me rn on repl:
const Discord = require('discord.js')
paste first line
thats weird
yes
but i don't understand what you are talking about here
and you were??
Nwm 

can someone help me make my level up system not send the level up message everytime someone talks: https://pastebin.com/PFj07kqR im annoyed and stressed at it lol, do i need to add a stop reading function? im startled
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
no code no help
oh nvm

lmao
first and second cancel eachother
var everywhere
yancode
also half of that code is inside that string

terror
something like this needs to be added so you dont keep sending the message over and over again
db.add(`notified_${message.guild.id}_${message.author.id}`, true) const hasAlreadyBeenNotified = await db.fetch(`notified_${message.guild.id}_${message.author.id}`)
tbf it doesn't even need to have a notified field
just send levelup messages when an actual levelup happens
instead of checking old level X new level
like if (msgs === await db.fetch(`level0`)) instead of if (msgs > await db.fetch(`level0`))
that would probably be better
change all of these
perfect
that part alone is a sacrilege against programming
yep, never use switch statements or if/else statements like switch statements
object lookup checks are better
0:10,
1:50,
2:170
...
}```
its stopped it sending the messages over and over but nullified the leveling
move rank = X into the first if condition you had. if (msgs > await db.fetch(`level0`)){rank = 10}
if(msgs == await db.fetch(`level0`)) { message.guild.channels.cache.get(levelUpChannel).send }
Wow that is definitely database abuse 
@onyx hare might want to refactor some of the if statements into object lookupsconst levels = { 10:0, 50:1, 170:2 ... }
0:(message) => (`Well Done ${message.author} You have`),
1:(message) => (`Sweet ${message.author} Has Leveled Up`)
...
}```
const string = "hello world";
module.exports.string = string;
Is there a way to more efficiently export variables in nodejs?
you can do this module.exports = { decode(str) { return unescape(Buffer.from(str, 'base64').toString('binary')); }, encode(str) { return Buffer.from(escape(str).toString(), 'binary').toString('base64'); } }
and then do this to import it ```const {encode, decode} = require('');
string: "hello world",
anotherString: "goodbye world"
}```
I was just wondering if it could be more compact, because I typescript you can just do:
export const string = "hello world";
module.exports = "hello world"
ive just done this, how would i integrate it into the send section
does this work?
i haven't tested
wouldn't you need to do module.exports = {string:"hello world"}
but according to logic and common sense it should work
but module.exports is undefined until it's defined
atleast works in my node cli intepreter
so module.exports.anything should complain about exports being undefined
maybe module.exports is {} by default
also is this right?
it is.
Yes
everything went to hell in the editor when i did this for the level message
if (msgs === await db.fetch(`level0`)){rank = 1} reqXP = (await db.fetch(`level1`)), message.guild.channels.cache.get(levelUpChannel).send(`${levelingMessages:1}`)
oh yeah
that doesn't make sense
oh
${levelingMessages[1](message)}
are you trying to use this?
0:(message) => (`Well Done ${message.author} You have`),
1:(message) => (`Sweet ${message.author} Has Leveled Up`)
...
}```
ya
might as well pass the rank variable to that to that
${levelingMessages[rank](message)}
and for the levels section where do i add ${levels}?
replace the database stuff with something like this const levels = { 10:0, 50:1, 170:2 ... }
get the message count like you are doing
i change
.setLevel(rank, 'Level: ', true)
to
.setLevel(levels, 'Level: ', true)
right?
you'll need to write some logic to find the rank when. that levels object is just to see if the have leveled on that message
i have it like this
const levels = {
0:10,
1:50,
2:170,
3:400,
4:500,
5:750,
6:850,
7:950,
8:1000,
9:1250,
10:15000
}
const levelValues = Object.values(levels).concat(messageCount);
levelValues.sort();
const currentLevel = levelValues.lastIndexOf(messageCount);
that should get you the level
messageCount being the count from the db for that user
right after you get the message count from the DB
this should be switched around
10:0,
50:1,
170:2,
...
}```
and this should change to
const levelValues = Object.keys(levels).concat(messageCount);
levelValues.sort(); // might need to sort like this .sort((a,b)=>(a-b))
const currentLevel = levelValues.lastIndexOf(messageCount); // might need to -1 here```
i just remembered this would nullify
if (msgs === await db.fetch(`level0`)){rank = 1} reqXP = (await db.fetch(`level1`)) as they linked to
```db.set(level0, 10)
db.set(level1, 50)
etc
yeah, you can get that rank without the db
use levels like this when checking to see if they just leveled and need a message sent. if (typeof levels[messageCount] !== "undefined") { //send you have just leveled message ${levelingMessages[levels[messageCount]](message)} }
you can replace all the if/else statements for different messages with if (typeof levels[messageCount] !== "undefined") { //send you have just leveled message message.channel.send(${levelingMessages[levels[messageCount]](message)}); }
its the message count im iffy about how would i count em
this part? ```db.add(messages_${message.guild.id}_${message.author.id}, 1)
seems okay if the db support a count feature like this
yea that part
did you write the add function?
i'd make a for loop that goes to 100 and do db.add(`messages_test`, 1) and see if it gets all the counts
this is what it looks like rn
what is let rank = 0 doing?
that was setting the user rank when the bot is invited to 0
also what is var reqXP = 10 for?
i dont see rank used anywhere
before getting the levelUpChannel you should check to see if they have leveled up
//send you have just leveled message
message.channel.send(${levelingMessages[levels[messageCount]](message)});
}```
0:(message) => (`${emoji} Welcome To our Leveling ${emoji}`) level 0 doesn't happen until after 10 messages so they wont get this message until then
why are you not just using a formula
or a map
or an array
this seems like a stupid way to do it
this is nulled idk why
trying to get to this if (typeof levels[messageCount] !== "undefined") { //send you have just leveled message message.channel.send(${levelingMessages[levels[messageCount]](message)}); }
I can see why
maybe you have a string "0"
not a number
o
Heyo
What do you guys use to get your bot stats?
the only way is to have another bot check on the status of the bot
Like most used commands,
oh, i thought you meant if the bot was online or offline
nope
i now remember why i gave up trying to do a leveling system in the past lol the stress i got from it
use this with google analytics to get some metrics
thx
is it getting close to working?
just work on one part at a time
i think so
(node:8576) UnhandledPromiseRejectionWarning: ReferenceError: messageCount is not defined
does db.add(`messages_${message.guild.id}_${message.author.id}`, 1) return the count?
maybe get the count like this const messageCount = db.add(`messages_${message.guild.id}_${message.author.id}`, 1)
oki
otherwise do a db.fetch
```db.add(messages_${message.guild.id}_${message.author.id}, 1)
const messageCount = db.fetch(messages_${message.guild.id}_${message.author.id}1)
some of the db.fetch calls are missing await
its to much to try n process god i hate being autistic ._.
just get one part working at a time
where does emoji come from?
update thisconst levelingMessages = { 0:({message, emoji}) => (`${emoji} Welcome To our Leveling ${emoji}`), 1:({message, emoji}) => (`${emoji} Well Done ${message.author} You have Reached Level 1 Our First level! ${emoji}`), 2:({message, emoji}) => (`${emoji} Sweet ${message.author} Has Leveled Up To Level 2, You Are Becoming A Pro Chatter! ${emoji}`),
10:0,
50:1,
170:2,
400:3,
500:4,
750:5,
850:6,
950:7,
1000:8,
1250:9,
15000:10
};
const levelingMessages = {
0:({message, emoji}) => (`${emoji} Welcome To our Leveling ${emoji}`),
1:({message, emoji}) => (`${emoji} Well Done ${message.author} You have Reached Level 1 Our First level! ${emoji}`),
2:({message, emoji}) => (`${emoji} Sweet ${message.author} Has Leveled Up To Level 2, You Are Becoming A Pro Chatter! ${emoji}`),
}
db.add(`messages_${message.guild.id}_${message.author.id}`, 1);
const messageCount = db.fetch(`messages_${message.guild.id}_${message.author.id}`);
if (typeof levels[messageCount] !== "undefined") {
//send you have just leveled message
message.reply.send(${levelingMessages[levels[messageCount]]({message, emoji});
}
what
someone should teach these js kids how to use codeblocks
idk why but I'm gonna be so satisfied when uncaught promises kill the process
you can already opt into that with a flag and you should be by default
well im more confused by this alien language
does anyone know how discord embeds urls?
oembed? open graph tags?
og:
As your know, when you type a website address (for ex. https://youtube.com), you also send a Rich Embed message of site automatically. How can I set this for my website?
pog ok
cant get it to work, even changing the url to deal with discord cache
my site's og tags work fine
also yes, you'll need to fight against discord caching
👀 turns out i was not returning any data to users who where not signed in.
hello you all
could anyone teach me a better way for my idea ?
i need to make a border check room, for new members joinning my discord game channel, only after they type role and choose a class like ( warrior, trojan, taoist, or archer ).
they will be able to see all channels
like this: Membros 4 members
MEE6 1 members
ProBot ✨ 1 members
Gold Role 0 members
carl-bot 1 members
^Archers 🏹 2 members
Trojan ⚔ 1 members
Warrior 🗡 1 members
Reaction Roles 1 members
Taoist 🧙♂️ 2 members
9 members
@everyone
@earnest phoenix
Lol
is it possible to get server insight data from discord.js
While you can try to aggregate the data to build a summary, the methods of doing so are infeasible, so no.
Yes, you can have more than one mongodb client.
So how can I access all
Like if I want to fetch prefix then my bot find the guild prefix from all clusters
Jesus christ
bot site for all your needs
How do I make it so my command can only be used in a Guild ID That is in a array, what I have:
const servers = ['839704922248577054', '793938706549309500']
if(!servers === message.guild.id) return message.channel.send(`**__Premium Server Bumped!__**`)
I'm having trouble resizing my ubuntu partition
I created the ubuntu partition in windows disk manager and used unetbootin to install ubuntu, but I can't figure out how to resize the partition directly from ubuntu
can i make it so slash command option choices update dynamatically
sudo apt install gparted && sudo gparted
depending on the channel they are running on
depends on the library you use
if you parse the arguments yourself, you can definitely make them different for each channel
slash commands...
oh
i already can do that with normal messagaes lmao
i feel like discord-devs could help better on that
how tf do slash commands even work
Nah not possible I believe
thats a bruh
then i have to make a prompt again
can you respond to ephemeral messages, like not send, yknow as a prompt
i was gonna say "just dont use slash commands" but i realized that i was the one who recommended using slash commands
lmaoo
technically, yea, like how youre doing now
it should work, but i think buttons would be better for doing that since you dont have to delete anything
You can reply to ephemeral messages
Yes like that
WHICH ONE
Via the reply feature
not sent: /move
not sent: move list
user sends answer
delete answer
send new message so everyone sees
2 messages gone..?
oh cool
so only you see your own reply?
thats a thing?
Nah the referenced message won't be available for anyone but you lol
Your reply will still be seen by everyone
. _.
kekw
thats another message to delete
You can send a followup message, can't you
i mean as i said again, you can also use buttons
smh
Why not use buttons?
use c# lmao
d.js doesnt support it great
wait erwin has buttons and he uses javascrip
dude i already have a js codebase :rage
d.js doesn't support anything good well
lmao
change my mind
i installed dev branch yesterdaey
Oh yeah good luck I'll be praying for you ma'am
turns out detritus supports buttons AND slash commands
lmao
Because Detritus > d.js
he also proved that detritus had less ram usage by showing his magical graph page shit
stop
ing my messages im not the one doing it
lol
Use Detritus
what the fuck
you're not ERwin
They intentionally call it trash so that only pros who actually want to spend their time using real stuff will use it
It's reverse psychology, you see
Ah I see
wait a second...
Smort
you can have buttons with ephemeral messages right?
yes
LMAO
Erwin

LMAO
ou deleteed it
HWWWEEZE
We've been over this for a while.
you fucking deleted it
this is an epic dev moment
never happened
yes ty
fuck kinda rp you guys doing
Keep your kinks in my DMs. 😉
1984
everyone recommending detritus
use c#
glad to see people finally recognize it
Fuck you
when/where
use discord.bf
smh just use npm discord-bot-lib
Now here hoe
discord.bf = discord brainfuck api wrapper
no
not fair, what about me smh
😳 but what about the m o d s
what does it mean i dont get it-
it doesnt even support itself, it uses other third party libs to keep going
wait for your turn smh
new markdown timestamps
KEKW
only available on canary
bruh
im on ptb
ive said this before
use canary
they have MONTHS before the feature comes out
wha
i personally used buttons about a month and a half before theyw ere out
Rules? Oh, how adorable. Rules are to be broken, you silly.~
magic shit
oh okay
they do this for lib devs to have everything ready for when the update comes
break me daddy 😩 ~~
Ok too far Plus wrong channel
😳
youre the one said here/now
I'll break you apart if you keep this up bitch
I'll have you know I'm a Python pro
EW PYTHON
I break shit on a daily basis

#development message refer to this
you did NOT make an emoji with me saying detritus
ITS A FUCKING EMOJI

Yeah that's what I fucking thought, filthy weeb trying to play tough.
WHATS THAT NAME
im speechless
wait why is it Lerwin ?
just speak smh
SUSSY
Hey if i change the name of the bot in the dev portal it will be changed in the gg dashboard know?
not ERwin
server nickname
f
Lerwin is nickname for close friends, specially IRL
@opal plank say Use Detritus again so I can get the right nickname
Use Detritus.js
without reply
fml
Don’t use detritus
OH BOY
Use Detritus.js
TIME FOR A FIGHT
go die
the guy who doesnt know how to use git calling me out, am i seeing this right?

I know how to use for
fuck programming
Git*

Git just doesn’t know how to use me
waht-
Yea I know that just never seen that error before
ooooOOOOOoooooOOOooooOOOooOOOoo beee keybOOOOOAAAAaaAaAArd
its usually when you install shit on VM
just use detritus then
With how much he advertises detritus
client.Ready = true,
client.user.setPresence({
status: "online", // You can show online, idle, and dnd
activity: {
name: `g?help | ${client.guilds.cache.size} Servers`,
// The message shown
type: "LISTENING", // PLAYING, WATCHING, LISTENING, STREAMING,
}
});
client.Manager.init(client.user.id);
client.log("Successfully Logged in as " + client.user.tag); // You can change the text if you want, but DO NOT REMOVE "client.user.tag"
client.RegisterSlashCommands();
};```

plz help
didnt we tell you yesterday?
what
give
reply.
Making your status change every 10s not a good idea
y
plz help
That’s way too fast
or 30s
or etc
then how much
, yeah, you were asking for spoonfeed yesterday here
ok
ping
the code
If at all it’s recommended to do it every 20-30s
same asnwer as yesterday
ok
we are NOT giving you pre-made code btw
Oh boy
If you’re going to ask for code begone
We’ll help you but we won’t give you the code
@earnest phoenix Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:
- proper syntax
- debuging code
- basic features (vars, arrays, objects, functions)
- read and understand docs
- nodejs module system
As much as we d like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.
Here are good resources to learn both Javascript and NodeJS:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie s Accelerated JS: https://js.evie.dev/
Please take a couple of weeks/months to get acquainted with the language before trying to make bots!




the spaces tilt me a bit, but good job
i dont quite like where this is going, me and tim are being meme'd hard
Kekw
tim has a gif saying "Go back to development" and now i got emotes
no space now
Erwin you brought it upon yourself
wait these are private emojis
Oh good
@near stratus #general message
I need to steal your pfp now
sorry for the ping
its kiss-shot-acerola-orion-heart-underblade
you can
#general message source
all my commands are going to be guild based i guess
why not make them global instead?
1h to update
multilingual
Up to 1 hour it says
Then again I never used global commands
my bot has 2 languages
oh
no need to wait up to 1h
ok but my bots commands are guild related
L
yeah + 2 languages
just fake the guild variable
but if u only changing description
so not using global commands
then you can just unfake it
if you're only updating description, you can see them in dms
my bot has 2 languages
i want to show english desc on english servers, and turkish desc on turkish servers
so im gonna have to use guild commands right
just dont have multiple languages boom problem solved
correct

would i get rate limited if i do guild commands lo
just check for rate limits
@opal plank does d.js check for rate limits
yo guild commands update instantly
it doesnt even support slash commands
thats how shit it is

@rustic nova
Smh
just discovered we can edit/delete webhook messages now
await it
how to listen for butotn evnetn??nsk
ok but its void
It can still error, no?
wait buttons can emit interaction event right
what did you expect to get from a reply?
Just await it to be safe
a message
so i can probably msg.createButtonCollector etc
i will
how can i convert [0,1,2,3,4,5,6,7,8,9,10,11,12]
to
[[0,1,2,3,4],[5,6,7,8,9],[10,11,12]]
for buttons f
Any idea if I want to benchmark the cpu usage in nodejs?
so you want to know how hard you can hit the CPU? or just want to know the usage?
isn't there a lodash function for this?
_.chunk([...]);
Python has lodash?
oh i dont do python
Wait no I'm the dumb one
for some reason I thought they were using python so I sent a python answer oop
Just want to know the usage
for react useReducer's 3rd param, can I use a async function??
hi hi
um I have a problem with the discord-xp package, um so the deleteGuild function is not working...
elo
better go to there support server if they have one
Wtf
And?
slash commands are coming out 
My PoInT stAnDs
no it fell dumbass
It basically is
Oh really, lol
As it now it stable enough to be used. I meant the slash/button in djs
d.js had months to implement them
const {client, Discord, MessageEmbed } = require("discord.js");
module.exports = {
name: "ping",
aliases: ["pong"],
category: "Utility",
usage: "ping",
description: "Get the bot's ping!",
async execute(client, message, args) {
let start = Date.now();
message.channel.send({embed: {description: "Looks like the bot is slow.", color: "RANDOM"}}).then(m => {
let end = Date.now();
let embed = new MessageEmbed()
.setAuthor("Ping!", message.author.avatarURL())
.addField("API Latency", Math.round(client.ws.ping) + "ms", true)
.addField("Message Latency", end - start + "ms", true)
.setColor("RANDOM");
message.Reply(embed)
m.delete()
})
}
}```
Its working good but then
Idk
How it comes that the bot even tho that it has administrator rights is not able to delete the channel and is giving me the failed embed?
What does define if a channel is deleteable or not?
reply is lowercase
That's inline reply
hi
Version 12 dont even have inline reply
const { APIMessage, Structures } = require("discord.js");
class ExtAPIMessage extends APIMessage {
resolveData() {
if (this.data) return this;
super.resolveData();
const allowedMentions = this.options.allowedMentions || this.target.client.options.allowedMentions || {};
if (allowedMentions.repliedUser !== undefined) {
if (this.data.allowed_mentions === undefined) this.data.allowed_mentions = {};
Object.assign(this.data.allowed_mentions, { replied_user: allowedMentions.repliedUser });
}
if (this.options.replyTo !== undefined) {
Object.assign(this.data, { message_reference: { message_id: this.options.replyTo.id } });
}
return this;
}
}
class Message extends Structures.get("Message") {
Reply(content, options) {
return this.channel.send(ExtAPIMessage.create(this, content, options, { replyTo: this }).resolveData());
}
edit(content, options) {
return super.edit(ExtAPIMessage.create(this, content, options).resolveData());
}
}
Structures.extend("Message", () => Message);```
@long crow
- a message with a mention prepended to it
Ic
You honestly don't need an extra method for it. Just do ${message.author} Your message here and you get the same functionality
You force yourself to like it if you don't already
If you're asking how to do something like that, top.gg allows Markdown, which supports HTML's <code> tags via the backtick character
how
tell plz
give example that
I'm not sure which part exactly you need help with.
how can i give the upvoters a reward in my discord bot
this?
yeah
How about no lol
do i have no option other than making a webhook and then collecting the data from a channel from my bot? cant i make top.gg send directly in my code
Get your lazy ass to research stuff yourself
All you have to search is Markdown cheatsheet
..
Even my 6 years old brother can do that
:/
An HTTP listener receiving POST requests with vote data
that red text is literally just this like in discord lmao
P.S.
but the guy i watched on youtube did something like this
he placed a listener and the bot listens to messages in a particular channel, in that channel the webhook sends messages, and those messages are used to reward the users
cant i make the webhook send stuff directly to my bot?

Then that guy did some weird ass shit and you shouldn't refer to that tutorial
ok
are you sure you're not confusing discord webhooks with topgg webhooks
lol
All you need is a machine running with 24/7 access to Internet, a webserver running on it (some popular top.gg SDKs provide them for you), which then will handle the incoming requests
can you send me a tutorial pls, i couldnt find a good solution
you cannot decrypt it unless you have the key

idk about webhooks :/
They're webservers
And those are just HTTP listeners on your machine
basically a website
in a nutshell, reverse APIs
instead of you making a request to the website, the website makes a request to you
webhooks are websites
i see nice explanation
Where are you trying to use it?
alright, so what i need to do is, set up a webhook that sends request to my bot?
yes that white but how to red it
top.gg provides a CSS that changes the color of the <code> tags so that's why it's red-ish
this
its red in top.gg
also, how are discord webhooks different than webhooks
you can just open up the webhook in the same apl where the bot is running
because they decided to make it red
oo
thats all
oke
since a webhook is essentially a simple webserver
Those interface with the chat only.
A webhook that LISTENS TO (not SENDS) requests from top.gg
i see, a webhook that listens to requests from top.gg then i can use that webhook to send requests to my bot?
right
Correct
I'm trying to get data from a collection in my mongodb, I used this code
const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true });
client.connect(err => {
const collection = client.db("Main").collection("bots");
client.close();
});
And faced no problems. However, when I actually try to get the data with this code
client.connect(err => {
const collection = client.db("Main").collection("bots");
var data = collection.findOne({ "_id": 0 })
console.log(data)
client.close();
});
I get UnhandledPromiseRejectionWarning: MongoError: Cannot use a session that has end . I tried remove the client.close(); but it then got stuck on Promise { <pending> }
Sounds reasonable, right?
discord's webhooks as they show up in your server's configuration are for receiving webhooks, they are webhook receivers
i see, could you suggest me a tutorial pls
i see isee, i thought webhooks are applications on discord that sends messages in a channel
I'm not familiar with any specific tutorials, since all I used was documentations from my packages about HTTP webservers
yes they are
Which library do you use
you configure discord webhooks to receive them and post them in a channel
only
and asyncpg.py
for db
ooooooooooo
topggpy intensifies
pip install topggpy
speak of the devil, I should push an update to fix the last issue
i didnt get what you mean
then?
then read the docs
but they are not compatible in their formats
We aren't going to spoon-feed you, you gotta do this yourself.
i see, assuming webhook is a websites that makes request to you, it means that i should be able to use a webhook in my code
yes
yes

i want my discord bot to receive webhooks, and what is top.gg
i mean
literally google "webhook python"
in this case it has to be asynchoronous, like aiohttp.web (which topggpy uses to run a webserver) or Quart
not that hard
top.gg is the website this discord server is about lol
where do you want to get webhooks from?
top.gg.py has its own library? which means i wont have to use an external website to create a webhook?
i meant top.gg.py
yes when someone wants, simply want the voters userid
tfw using raw requests to see if a user votes
for that your bot needs to be approved
i am not writing dots because it looks better, its because i have a habit of writing top.gg and. py

how can i do that
Do <br>
ok
In between each line
how to acknowledge a messagebutton interaction
ALL THEN NUTS WERE ON THE BOTTOM OF THIS CUP ISTG I'VE BEEN BACKSTABBED BY A YOGURT
ok who pinged me

You don't ACK buttons
oh no
:/
oh wait I'm dumb
Is there an event, which is called when the bot joins a server?
have you tried responding with callback type 6?
GUILD_CREATE
may be different in your library
Understandable
thx
I m using discord.js
Can be achieved with two blank lines in desc too
is there a function for that in discordjs dev
Don't ask me I don't use trash
okay maam
seriously though idk I don't use JS
(shiv calmeth)
Nah its not trash. It has many new functions. For example the buttons
Which some libraries had support for way before
discord-buttons didnt work for me
@zinc wharf hey

The fact that there had to be a completely different package that modified the original lib's behavior kinda says something
Watch Erwin come in advertising detritus a million times since you mentioned discord.js
Whats up
I'm just shittalking d.js for the weird fuckery it is
lmao

bro why are these nuts at the bottom who tried to hide them there

I have decomplied the apk sir the thing that I sent it iin the variable magic key
Why did you decompile an apk
How can I use async methods for using await in the current context:
var Discord = require('discord.js');
const client = new Discord.Client()
module.exports = {
name: 'message',
execute(message) {
// console.log(`${message.author.tag} in #${message.channel.name} sent: ${message.content}`);
if (!client.application?.owner) await client.application?.fetch();
if (message.content.toLowerCase() === '!deploy' && message.author.id === client.application?.owner.id) {
const data = {
name: 'ping',
description: 'Replies with Pong!',
};
const command = await client.application?.commands.create(data);
console.log(command);
}
},
};
are you still trying to get through that quiz app
async execute(...) { ... }, also why are you creating an entirely new client instance
Why do I feel like that's recreatng a client object
it would've been smarter to do what we advised you, emulate the app and then analyze what's on the screen
show your description
ok
Use break tags
🤦♂️

don't use those if you're gonna add one blank line
it's EITHER:
a) add one blank line between your text to actually add the newline
or
b) add <br> in-between the text lines
lmao
shivaco
I'm alive hi
y
Regretfully
im alive hi <br>
@earnest phoenix just <br>
do it like <br>
this
that?
if i may ask, how old are you lan?
ok
Yes
I love watching this just to do a new line 
why you ask
just want to see if we're the same age
Native markdown new lines (a blank line):
When
The
A break tag since top.gg description allows HTML:
When<br>The
Simple search on google
Rhys what do you expect when I literally told the guy to Google something and he said "can't you just tell me"
Gotta love saying the exact same thing in 3 different ways for a beginner in #development to understand something
I'm just waiting till Lan decided to do a new line in javascript, or C# for example
yep
im convinced they're underage
console.log("my text
woohoo")
y no work
they use python so

what the fuck is this new font for members
Force them to use multiline strings always ezpz
"""smh"""
BLEH
it looks like something out of a minecraft cheat client
my_list[int('''0''')]
fuck it I'm overriding the default font
discord uses like 6 different fonts right now??
I swear it looks like the font of those template apps created back in 2014
Yes
Much better
accessibility 100
inb4 Discord employees either on crack or with ADHD
i struggle reading the new font, can't imagine how it's like for people with reading imperities like dyslexia
I bet the one who chose the new Discord fonts was that Discord employee who implemented light theme
how like that the pic have link invite bot
By using CSS
ye
You can customize the bot page
example?
give plz
i like that
example
ho boy this is gonna be fun
or go to https://w3schools.com
I am not making a 3 hour lesson that you'll end up ignoring

why are they talking about examples like it's their fetish lmfao
What if some devs here act stupid just to be talked shit upon because it's their kink
He wont ignore it, he just wont understand putting <img src=""> for the start
The word "Example" in beginner dev language actually means "Spoon-feed?"
HOW THE FUCK DO YOU ADD A NEWLINE- oh wait I can't do that in a paragraph element
One message removed from a suspended account.

One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Just found your keyboard
Doesn't work when I do return [html.P(f"Value: {active_cell}\n\n{data}")]
neither with \n nor with <br>
hellou
One message removed from a suspended account.
oh mygod wrong messaqge
ew C#
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Don't show that, Lan will ask you how it works. And you'd give him a 500 page document about it, and he still wont understand it
hi i m new to js
i m trying to do command handler but some errors
my codebase is a clusterfuck as-is so he won't be able to re-do it the way I do it
The pros of writing stupid code (:
const client = new Discord.Client()
const fs = require('fs');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./Commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./Commands/${file}`);
client.commands.set(command.name, command);
}
const prefix = process.env.PREFIX
client.on("ready", () =>
{
console.log("Bot is Ready!")
})
client.on("message", message =>
{
const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
if (command === 'ping')
{
client.commands.get(command).execute(message, args);
}
})
client.login(process.env.TOKEN)```
const Discord = require('discord.js');
module.exports = {
name: 'add',
description: 'adds money to an admin',
execute( message, args) {
message.channel.send('pong')
},
}```
i followed discord.js guide
and got error

What is the error
yes
then what's the error
Already asked that lmao
error is on index.js like there undefined execute
When someone shows their code saying they got an error but you have to additionally ask for them to show the error
smh
Doesn't hurt to ask twice
Its stupid. "Hello I have an error" WHERES THE ERROR
@vivid fulcrum sir I have decomplied the apk the key will be in that ?
bruh
maybe
Keys probably obfuscated but good luck
You have two events. Remove the bottom one.
no
The onmessage event should do just fine
unless my understanding of discord.js is wild
Which it may be
nope
Throwback to me yelling at Epic to add client.event
Ready event just indicates that the client is ready, nothing relating to the error; seems like they don't have a ping command in the collection
there is
what the hell
@silk ridge try executing commands dynamically
means ? with if else ?
client.commands.get('ping').execute(message, args);







