#development
1 messages Β· Page 1392 of 1
Tim, your name though
"Him"
Elitezen posted you a guide
how do you insert an image in markdown
markdown? are you talking about your botpage or where?
is using webhook the only way to do something when a user vote?
@little meteor yes
ty
markdown? are you talking about your botpage or where?
@rustic nova just plain old markdown
uno momento
@rustic nova thats me
lmao
message.guild.members.cache.get("705731402972528690").send("hi")That would work
@cosmic roost
can you give me the complete code?
@rustic nova just plain old markdown
@earnest phoenix https://stackedit.io/ use this for making your markdown. Quite useful
Full-featured, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.
@cosmic roost
can you give me the complete code?
@hard anchor no spoonfeeding mate
@earnest phoenix https://stackedit.io/ use this for making your markdown. Quite useful
@rustic nova thanks
Full-featured, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.
Tim reversed is Mit. Your mind has been blown
@earnest phoenix here ```js
client.on('message', message => {
if(message.content === ${prefix}8ball){
if(!args[2]) return message.reply("Please type a full question");
let replies = ["Yes.","No.","i don't knowπ€","Ask again later","I'm Busy","No."];
let result = Math.floor((Math.random() * replies.length));
let question = args.slice(1).join(" ");
message.channel.send("Answer is "+replies[result])
}
});```.
someone tell me how i make my discord.py bot send random responses?
Tim reversed is Mit. Your mind has been blown
@sudden geyser god now i have to clean the floor because it's covered in shrapnel of my mind
grab the mop
lmao
Blasep I think you can use the random module's choice function. ```py
import random
random.choice(["yes", "no", "maybe"]) # one of the three```
wdym stuff like Math.random aren't really "random" but "psuedo-random"??
There's no such thing as randomness.
It's the seed that counts.
For example, Python's random module is seeded by default as the current time.
but what do I say to the bot?
so they can be predictable so non-random?
wdym
@coral trellis
It can be if you reverse engineer it, but it's usually good enough.
is that why cloudflare uses a big block of lava lamps for randomness

@earnest phoenix fucking stop
@zinc fable
not funny
boomer humor
Sorry there you go
thanks :3
thanks 
you have only one { open but closes 2x
TypeError: comFile.run is not a function
what is the meaning of this?
i just made a simple music bot
@earnest phoenix although nothing is random, some implementations have their use cases. For example, Java's java.util.Random class uses a 48-bit seed based on a modified version of the linear congruential formula. However, Java also has the java.security.SecureRandom class, which uses unpredictable seeds.
You are trying to call comFile.run, which is not a function, so you cannot call it
module.exports = {
name: "ping",
description: "pong",
usage: "ping",
execute: async function execute(message, args, client) {
let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();
pingEmbed = pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${pingMessage.createdTimestamp - message.createdTimestamp}\`ms`).setTimestamp();
return pingMessage.edit({
embed: pingEmbed
});
}
};```
huuhhhh
wait what
https://hatebin.com/joluicyguh this is the code i just wrrote
well, a part of it.
yeah i see
what should i do to get rid of the error?
remove the execute and replace it by run?
change execute to run, your message event trying to run the run() function in all commands
However, Java also has the java.security.SecureRandom class, which uses unpredictable seeds.
they made unpredictable shit on predictable computers that don't even use an outside service like a big ass bunch of lava lamps???
nice, got ignored.
your token is invalid
@molten yarrow nope
thats not what "unexpected token" means lol
nope, its valid. its proved by the fact that the bot goes online for a split second.
oh oke my bad than :3
nope, its valid. its proved by the fact that the bot goes online for a split second.
@lethal grail bro it can go online for a split second then crash because the error stuff is loaded AFTERclient.loginis executed (iirc from your code)
hmm okay it worked
but i tried !play (link) but it sadly did nothing
not even logged anything
D.js Guild
*guide
You knew what he meant, no need to correct him
what does iirc mean?
so i basically tried !play (linl) and even !play (title) https://hatebin.com/tuvhpjkhqf
nothing worked
ingrone
"If I recall correctly"
change the else if to if only
@earnest phoenix brother have fucking patience
@lethal grail bro it can go online for a split second then crash because the error stuff is loaded AFTER
client.loginis executed (iirc from your code)
@earnest phoenix and how do i resolve that
That's not the problem here
fix the error code
"Unexpected token" is a JavaScript error
i only explained you why it can still go online
can you tell which line the error was thrown on?
@eternal osprey you did'n have code to play url
they made unpredictable shit on predictable computers that don't even use an outside service like a big ass bunch of lava lamps???
@earnest phoenix yes
@lethal grail your execute function has 2x execute is that normal?
@neon heart what do you mean
@earnest phoenix yes
@sudden geyser HOW π DA π FUCK
@molten yarrow yep it is
actually
lemme try remove it to see how it goes
it might just work
It doesn't matter
idk how your command handler build up tho
but if i run it in mine i get an error on it
@eternal osprey like use ytdl-core to play song url
orchit what did you mean by you have no code to play?
const connection = await channel.join();
queueConstruct.connection = connection;
play(queueConstruct.songs[0]);```
there is a play function implemented in it
add queueConstruct.songs[0].url
checked using my editors anti syntax feature and nothing popped up
meh should i just try learn python
is sharing a link not allowed
is sharing a link not allowed
@unborn ridge it is allowed as long as it does not take you to smth that breaks #rules-and-info
wix sucks ngl
its ok
i use a base website made by nouridio
cause i dont know html
wix is overpriced for their bullcrap
module.exports = {
name: "ping",
description: "pong",
usage: "ping",
execute: async function execute(message, args, client) {
let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();
let pingMessage = await message.channel.send(pingEmbed);
pingEmbed = pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${message.createdTimestamp - pingMessage.createdTimestamp}\`ms`).setTimestamp();
return pingMessage.edit({
embed: pingEmbed
});
}
}```
diffrent code this time
@lethal grail umm why are you setting the timestamp twice for the same embed
one is for the message
its a ping command-
another is for the pingMessage
Is there any better way of translating your bot other than a giant as if/else if statement?
no they're still doing setTimestamp twice on pingEmbed
hm?
They're setting a new timestamp after it being sent
first here:
let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();
then here:
pingEmbed = pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${message.createdTimestamp - pingMessage.createdTimestamp}\`ms`).setTimestamp();
They're setting a new timestamp after it being sent
@pale vessel ytho?
i dont see anything wrong with that tho
Who knows, maybe that 100 milliseconds matter
the ping command sends the message latency as well as the websocket latency
Whats the error?
Remove that extra );
so, anyone know the problem of the ping command?
I am idiot right ?
@earnest phoenix no
I am idiot right ?
@earnest phoenix no you are just not experienced with programming
nobody here is an idiot
we all started somewhere
except for among us ig it exploded out of nowhere
first here:
let pingEmbed = new Discord.MessageEmbed() .setColor("RANDOM") .setDescription("Pinging...") .setTimestamp();then here:
pingEmbed = pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${message.createdTimestamp - pingMessage.createdTimestamp}\`ms`).setTimestamp();
@earnest phoenix its an edited mesaage
2 embeds
1st embed stays for around for very little time
doesn't the timestamp get set according to the message's?
module.exports = {
name: "ping",
description: "pong",
usage: "ping",
execute: async function execute(message, args, client) {
let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();
var pingMessage = await message.channel.send(pingEmbed);
return pingMessage.edit({
embed: pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${message.createdTimestamp - pingMessage.createdTimestamp}\`ms`).setTimestamp();
});
}
}
```try this
Show your full code @earnest phoenix
Close your event
Add }); under a new line
Fix your indentation also
This should be indented, so that it won't confuse you
module.exports = { name: "ping", description: "pong", usage: "ping", execute: async function execute(message, args, client) { let pingEmbed = new Discord.MessageEmbed() .setColor("RANDOM") .setDescription("Pinging...") .setTimestamp(); var pingMessage = await message.channel.send(pingEmbed); return pingMessage.edit({ embed: pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${message.createdTimestamp - pingMessage.createdTimestamp}\`ms`).setTimestamp(); }); } } ```try this
@πππΎ not any better
whats the issue?
@lethal grail Instead of escaping, you can try using js "WebSocket latency: `" + client.ws.ping + "ms`\nMessage latency: `" + (message.createdTimestamp - pingMessage.createdTimestamp) + "ms`"
Anyone knows BCFD?
Anyone knows BCFD?
@west oyster Baltimore City Fire Department
Why even use a bot making app

There's no fun in coding a bot then
Hmm
Why even use a bot making app
^
cap
prob the bare basics
Let them use whatever the fuck they want
Literally make a bot yourself when it requires javascript 
shittiest version of java
not saying hes not allowed to I'm saying theres no fun in making a bot if u use an app
bruh what is that code tho ngl
@lethal grail
module.exports = {
name: "ping",
description: "pong",
usage: "ping",
execute: async function execute(message, args, client) {
let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();
message.channel.send(pingEmbed).then(msg => {
return msg.edit(pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${msg.createdTimestamp - message.createdTimestamp}\`ms`).setTimestamp()
);
})
}
}
ty
Not tryna be mean or anything but I think thats the ugliest looking code I've ever seen
Not tryna be mean or anything but I think thats the ugliest looking code I've ever seen
@tulip ledge def def
One last thing, when i equip something, i use .filter to make the equipped weapon get deleted from the userweapons array, if there is more than one weapon with the same name it delete all of them, so, what can i do for make the code delete only one of the weapon with the same name?
Oh shit I can help with this I'm making an RPG bot
Oh shit I can help with this I'm making an RPG bot
@tulip ledge Ty!
@north birch What I'd suggest doing is either using .find or using unique ID's for every weapon and saving that in the database or do what I'm doing:
[
{
name: "sword",
damage: 10
},
{
// other items
}
]
huh?
@north birch What I'd suggest doing is either using .find or using unique ID's for every weapon and saving that in the database or do what I'm doing:
[ { name: "sword", damage: 10 }, { // other items } ]
@tulip ledge I'll try .find first,
Have you tried #development message ?
What's the issue @lethal grail
where do i put that?
As the description
its probably not even a problem with a ping command, something in index.js but lemme try
Nah, it's in the error
what does your log say?
module.exports = class PingCmd extends Command {
constructor(client) {
super(client, {
name: "ping",
aliases: [
"p"
],
description: "Test my ping!"
});
}
async run(message) {
let start = Date.now();
let msg = await message.channel.send(":ping_pong:");
msg.edit(`:ping_pong: ${Math.round((Date.now()-start-this.client.ws.ping)*100)/100}ms\n:blue_heart: ${Math.round(this.client.ws.ping*100)/100}ms`);
}
}
Here's my ping command if u need it
It has something to do with you not escaping the ` correctly
oh
@molten yarrow
I see no issue in escaping the backticks tho
Oh
I see now
ur using a ; insinde the .edit when you're returning
As you can see
i removed it already
oh
It's a scope
oh you right tho
Rip idk how to use .find lmao
Nice i was reading a wrong docs lol
Ok, idk what to do next, i tried:
const found = armi.find(newloadout => newloadout != armaequip);
But it's equal to using filter lmao
does it return what u need?
Yes, the name of the weapon, but there are two weapon with the same name
you can use .filter()
it matches your need more i think
.filter() return the filtered array with only same items
it's there a method to limit the find to 1 items?
posting an incorrect shard count is not allowed, is it allowed to shard an unnecessary amount of times and post the correct values?
would send in #support but didn't feel safe doing that
you can use .filter() and then just use .shift() or .pop() to get the last item in the array or the first one
probably more like api
msg.channel.send(Embed).then((msg) => {
msg.react('β').then((r) => {
msg.react('βΆ');
const backwardsFilter = (reaction, u) => reaction.emoji.name === 'β' && !u.bot;
const fowardsFilter = (reaction, u) => reaction.emoji.name === 'βΆ' && !u.bot;
const backwards = msg.createReactionCollector(backwardsFilter, { idle: 30000 });
const fowards = msg.createReactionCollector(fowardsFilter, { idle: 30000 });
});
});
can anyone help me with this?
Error?
u don't need 2 collectors
i don't know why it only collects reactions from the author of the message
u don't need 2 collectors
@restive furnace you're right
but still i don't think that it would solve the problem
First of all you can just have 1 collector
const filter = (reaction, u) => reaction.emoji.name === 'β' || reaction.emoji.name === 'βΆ' && !u.bot;
const collector = msg.createReactionCollector(filter , { idle: 30000 });
collector.on("collect", (reaction, user) => {
console.log(reaction)
});
Oh I see why
a filter needs a return
Its a function
uhhh ur snippet doesn't work either/works every time even it was any other emoji
why wouldn't it work then
(reaction.emoji.name === 'β' || reaction.emoji.name === 'βΆ') && !u.bot
well I usually just ["..."].includes(reaction.emoji.name)
Oh shoot I forgot the paranthesees
a return where?
You don't need a return
ok nvm then I'm being an idiot again
You only need it if it's a const filter = (reaction, u) => {}
Wait, you're ChickenDev?
?
maybe
yea
yes
Nice
I changed my name
I feel coppied
Well not rlly
ik lol
You only need it if it's a
const filter = (reaction, u) => {}
@pale vessel that's what i have
BILLION when
U have const filter = (reaction, u) => //code it's different
i can be TRILLION
U have
const filter = (reaction, u) => //codeit's different
@tulip ledge yeha, i just realized that
no please don't
so then what's the solution?
yes

you forgot to define module.exports
how do you set properties of objects?
obj.value = {}
basically you forgot the =
How to see who created the channel? (Discord.js, channelCreate event)
Yeh I think u can check the audit logs and filter on the channel
and I would also change
execute()toexecute: () =>
@crimson vapor Both work anyways
Same, I do it your way too
makes more sense tbh
since you are setting execute to a function
instead of just adding a function with the name execute to it
I'm that weird guy who uses execute() as a method in classes and execute: () => for objects dont ask me why
Dont know haven't tried the other way
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/aiohttp/web_protocol.py", line 275, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 523, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
``` anyone know know how to fix it ?
why is the collector not working? 
whats your code?
its a package error
are you 2 talking with me ?
kinda
yes
ooh
where do you use http in the code?

I don't know any python
try logging self and data
and seeing if it returns anything unexpected
I don't know python very well either, I did start with python but went to JS immediatly
nah I learned a bit of node js and thats all
i see
but we can try to help you debug, then its up to u to find a fix as we won't find a fix
just enough to understand how to make stuff
you dont need to know python to understand that error
Yes, but we can't fix the code
Thats what I'm saying
we can help them debug
just not help them fix the code
alright
sorry for bothering, but nobody knows how to solve my problem where the collector only collects the reactions of the author of the message?
do you have a filter on the collector?
yes
show the filter
const Filter = (reaction, u) => reaction.emoji.name === 'βΆ' && !u.bot;
const collector = msg.createReactionCollector(Filter, { idle: 30000 });
someone literally few minutes ago sent you working snippet
how can i dm users after they react to a specific message? dpy ping with responses pls
@full mortar u still need a return for your Filter
Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/aiohttp/web_protocol.py", line 275, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 523, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: invalid HTTP method ``` anyone know know how to fix it ?
@little meteor fixed
it was a stupid error 
???? can anyone help me ?
module.exports = async (client, oldChannel, newChannel) => {
const fetchGuildAuditLogs = await newChannel.guild.fetchAuditLogs({
limit: 1,
type: 'CHANNEL_UPDATE'
});
const latestChannelUpdated = fetchGuildAuditLogs.entries.first();
const { executor } = latestChannelUpdated;
const logs = client.channels.cache.get('769656303747727360');
const embed = new MessageEmbed()
.setAuthor("Channel Updated")
.setThumbnail(executor.avatarURL())
.setColor("#000000")
.setDescription(`Before : ${oldChannel.name} \nNow : ${newChannel} ${newchannel}\nBy ${executor.tag}`)
.setTimestamp()
.setFooter(newChannel.id, newChannel.guild.iconURL());
logs.send(embed)
};```
any errors?
@full mortar u still need a return for your Filter
@molten yarrow that wasn't only if i useconst filter = (reaction, u) => {}?
@full mortar yes and u use it xD but never added it
just add a return in it
its still reacting only on author?
i change it to const filter = (reaction, u) => { return reaction.emoji.name === 'β' && !u.bot};
its still reacting only on author?
@molten yarrow yes
weird
Use media queries @low orbit
weird
@molten yarrow yeah
im making a bot
how to find out who send the message
im using discord.net
c#
float them left?
no im saying float: left
i cant really help you without seeing your current CSS
sure
although if it's private you probably shouldnt be showing it to me either lol
how can i dm users after they react to a specific message? dpy ping with responses pls
@drifting wedge https://discordpy.readthedocs.io/en/latest/ext/commands/api.html?highlight=wait_for#discord.ext.commands.Bot.wait_for
no @earnest phoenix , you need to use an event, not wait for
@bot.event
async def on_raw_reaction_add(payload)``` <https://discordpy.readthedocs.io/en/latest/api.html?highlight=on_raw_reaction#discord.on_raw_reaction_add>
why? what message are you comparing to?
When you use wait for it gets ugly when it comes to reactions
i mean, it depends on what he's trying to achieve
on_raw_reaction_add alerts you regardless of the cache state
no matter what you're doing, it would be best to use the event
no matter what you're doing, it would be best to use the event
@wraith haven no?
Ofc there are exceptions
my translare command isnt working properly
it works sometimes and doesnt sometimes
but as a general rule of thumb, the event is the best way to do it
This is because he's trying to send a user a message when they react to they it.. which means that message can last years.. which wait_for is not ment for @earnest phoenix
from googletrans import Translator
from discord.ext import commands
class Utility(commands.Cog):
def _init_(self, client):
self.client = client
@commands.command()
async def trans(self,ctx,arg,lang):
translator = Translator()
translated = translator.translate(f"{arg}", dest=f"{lang}")
await ctx.send(f"{translated.text}")
def setup(client):
client.add_cog(Utility(client))
ye
wdym, you can use raw_reaction_add on wait_for
hm?
I've said all I can, I cant change ur mind Β―_(γ)_/Β―
if it was a command, and he's trying to check if the user reacts to what the bot sent, why not?
that's vague Β―_(γ)_/Β―
show code?
from googletrans import Translator
from discord.ext import commands
class Utility(commands.Cog):
def _init_(self, client):
self.client = client
@commands.command()
async def trans(self,ctx,arg,lang):
translator = Translator()
await ctx.send(translator.translate(f"{arg}", dest=f"{lang}").text)
def setup(client):
client.add_cog(Utility(client))
it works 50% of the time
the other 50% it throws this exception
@drifting wedge https://discordpy.readthedocs.io/en/latest/ext/commands/api.html?highlight=wait_for#discord.ext.commands.Bot.wait_for
@earnest phoenix but like there would be many reactions
@steep socket try using only 1 instance instead of creating it each command invokation
hey my node js bot always throws this error after about 8 or so hours how do i fix it?
it still happens :(
oh
thanks!
https://pypi.org/project/translate/ found another library i will try it out
discord.js v12
Hey! Is there a way to make bot take information from website and put it into embed? I would like to make Minecraft Hypixel stats bot. Please help.
Sure but that has nothing to do with discord.js itself
In that discord.js can provide data, but it doesn't have features to "put on a website"
you'd have to create an API within your nodejs code for that
Is there any tutorials on youtube how to do it?
There`s tutorials on youtube on it yes, but it's about web development & design, not about bots.
There are two main ways of getting info from a website:
- If the website has an API, you can get the data from there via HTTP requests.
- If the website doesn't have an API, you can try web scraping the website. Always use 1) if the website has an API.
Thank you.
But if their API is so shitty then you have to scrape 
Alright
[2020-11-17 18:29:02.651200] Connected. Logged in as Lester#3371
[2020-11-17 18:29:04.654874] Ready!
She ainβt on yeet
what?
@undone tundra https://www.heroku.com/
oh nvm
ty
Iβm tryna send my code so you can proof check it
using heroku is discouraged for discord bots
@bronze bramble you can post code to https://hasteb.in/ (paste, save, give us the URL). make sure not to include your token
using heroku is discouraged for discord bots
False. Heroku is fine for bots, it works perfectly well if you have a CC registered, the only thing it can't really do is save data to disk.
Why? Channel IDs aren't secret.
Well because Iβll need to ensure that isnβt the error
We can't do anything with them
although he should appear online
If you modify the code in any way, you might introduce an actual problem to the code
There's room for improvement, as Elon would say.
Haha, Iβm always in the middle of his 10 year plan
Ah well. I can't help with that. I don't do python. π
So you have a bot in python but you don't know python... 
how did you write this then
Yay
Thanks. Iβll give you a run down of what she does, if you can help me get her started back up for the community, Iβll be in debt
So you have a bot in python but you don't know python...
@umbral zealot thats a pretty epic gamer move..
You should learn python from scratch and make a basic bot first
I probably should, I just donβt have time at the moment
So just write a bot in a language you know
@bronze bramble u canβt have custom statuses
I understand that but it might get worse
Expecting some people online to fix your code that you didn't write is a pretty shit move if you ask me.
Like u canβt have prefix var
Is this ur code?
Itβs shared, my friend @somber verge quit working on it
Use cogs
I mean Iβd have to familiarize with code base
hi moo π
Hi Woo π
oops wrong channel
@pure lion 
"M" + "W" + 2 * 3 * "o"
So the situation is, i developed the bot as far as the ideas, the theming and central purpose
I payed him, or tried to but he refused citing it was experience for him
now he doesnβt do bot dev, and so she is outdated and broken
never pay anyone
~Dice, 2020
oh yeah, intents update probably broke a lot of it.
I have a few ideas how to make it popular again, it attracted a lot of people
Just need a dev willing to do minor updates now and again, I can strike an agreement
Ah yes, you're an idea person, not a developer. Someone else does all the work then. π
Is this not acceptable here? I have a creative imagination, communities soak it up
They hate me for stopping the flow of content I had going with it
Find someone that asks "Hey does anyone have any ideas what to put in my bot?"
there's always someone saying that somewhere out there.
it was fun for everyone
Ya see, that isnβt any fun
not unless I have a love for its central purpose
"Creative people" usually have no idea the amount of actual work that has to go into developing things.
the problem here, is most bot devs already have things they are working on.
That is true
I have 2 major projects now, and atleast 10 small projects on my plate, and i just got bot reviewer
And the sentiment goes, who said this, btw, something done best will be done by yourself
I mean no, you can absolutely have teams of people. That's a thing
Iβll just make time, Iβm really focused on other hobbies and my career
and yeah, I like collabing with teams
Except, what doesn't work is someone that literally is only there to throw ideas, and someone else that has to do all the actual work the "creative" thinks about.
You see, Iβm willing to learn
Creative people are also the worst damn managers, trust.
Very, Iβll watch listen and entertain while someone is working with me
0exe was looking for more team members awhile back, not sure if he filled them up.
interesting
I just need structure
Everyone here is full of ideas and knowledge, as am I, except I have little understanding in this topic, but at least I have a core idea for motivation
I havenβt found a learning website I liked yet, but Iβm a wonderful apprentice
first, start with it what language you want to learn
well look look up something like "python crash course" or "python books"
Great
from google ^
once you get into it and being intrested in learning, docs are so amazing.
the discordpy docs are really good.
if a docks is bad, do not lean the codig
my mind is to young for this
ok what library did you use to create your bot
discord.js? idk anything
discord.js-light by Tim
not you @lilac lodge
wdym by screenshot it
go to your bot click edit got to where you created your library and screenshot it and show me
or do that
and https://hasteb.in/ ?
i mean it is discord.js i dont know what else there is
Why do you want a screenshot of it anyway
so i can help him
this link, gets you to the Docs
discord.js docs bad
no discord.js docs fine, your connection bad.
discord.js docs bad
@honest perch ctrl+f5 the page
nope
but go there you should be able to get it online and a few commands
that sounds like a personal problem you should fix personally.
works fine for me so it must be your connection Β―_(γ)_/Β―
oh i have had that before its easy to fix
my connection is fine thanks
clearly not
clearly is
oof
works fine for me must be ur connection Β―_(γ)_/Β―
and yet. it works fine.
ok ima be reading this for a bit
and yet my connection is fine
have you reloaded the page at least?
its been happening for months
yikes
Yes @earnest phoenix that's what they're doing.
can confirm, the link is working
chrome loads it fine
i dont know i never use chrome
So the problem is firefox, not the docs being bad. Good that we agree on that.
@lilac lodge click on GUIDE up there if you want a good guide on how to get started and more
json itself works
ok ty
Firefox bad.
firefox good
firefox is fine for me
not really
why did u censor the url tho?
wait
was meant to censor bookmarks
LOL
oooooofa
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://raw.githubusercontent.com/discordjs/discord.js/docs/stable.json. (Reason: CORS request did not succeed).
Big brain misly
ig it's the same bug that happens when you're going to the bathroom then u open the fridge
"wait, what was I going to do?"
carrots
firefox development is slower than discords
unless the provider whitelist ur agent, cors will block your request
it was a pain to deal with when I built my bot's site
module.exports = {
name: "ping",
description: "pong",
usage: "ping",
execute: async function execute(message, args, client) {
let pingEmbed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDescription("Pinging...")
.setTimestamp();
pingEmbed = pingEmbed.setTitle("Pong!").setDescription(`WebSocket latency: \`${client.ws.ping}\`ms\nMessage latency: \`${pingMessage.createdTimestamp - message.createdTimestamp}\`ms`).setTimestamp();
return pingMessage.edit({
embed: pingEmbed
});
}
};```
that was accidental
i mean, incognito fixes it
Well, you didn't define a pingMessage variable, @lethal grail
odd thing is, it used to work before
and firefox does some weird request things sometimes
and its a pain
try it and see
if I vote i wont be able to vote
I see
if I vote i wont be able to vote
@earnest phoenix use "test" button
HuH?
there are two buttons in ur bot's config page in top.gg
"save" and "test"
ah, wait
Guys
Whoβs a bot dev and willing to let me edit theyβre bot with the,
Them
no one
no one will l;et you touch there bot code
90% of the people here, and no one
Ok
respectively
Itβs fine
unless u want to research the code
pingMessage is not defined
in this case my bot is open-source
there are more OS bots here too
but pretty sure noone will accept modifications to prod code
Can you tell me hot to make ur bot verified
On my bot it says unknown table error because it doesn't own a table. How can I change the owner of my table to my bot using Postgres?
how would I send a message to a user who voted
"unknown table" isn't about missing permissions
brUh
...?
brUh
you didnt define client
or just message.client to get the client
NaN = not a number
can u run console.log(typeof(client.ws.ping))
after message.channel.send
it's either dividing by 0 or it's returning something unparseable
yeah
oh and you added client wrong tho
you can add it to execute (client, message, args) {
yeah he creating new Client
remove the client on top and add mine
you have 1x } to much
np
keep your index clear xD
oh
:3
he passing it to function already, need only to add it above
@molten yarrow what's the point though? There's no advantage to passing it as a parameter overmessage.clientfrom what I've seen.
It's just what the tutorial does bruh
there isn't, what's being passed in the parameters is the reference, so it won't matter which way u get the client
oh my
don't create 11 listeners
you index probably has more than one client.on("message") event
where are you adding the listeners?
you index probably has more than one client.on("message") event <<<<<
this
a listener
you only need one
11 actually

bruh
make sure you don't have a client.on("message") added inside any other file, like in a command or some other event.
Hey does anybody know how to tmake my mysql connection not time out?
kills my bot every 8 hours. working with discordjs
change the timeout on your mysql connection
take a look at your mysql library on how to do that
use connection pool
hi, when someone join my server my bot crash and send this error :
Well, member.defaultChannel isn't valid and doesn't make sense
defaultChannel is not a thing.
Never understood what connection pools work but I copied something from stackoverflow π
got removed on v12
hi, when someone join my server my bot crash and send this error :
@earnest phoenix your accessing the member object. You can do member.guild.id to check if the server is your support server and say hello by doing something like:
` client.channels.cache.get('channelid').send('e')
general rule of the thumb is that each query should have its own connection
but on a large scale
that impacts performance
that's where pooling comes in*
So, basicly alot of data processed in one query/connection instead of multi connections? Sort of thing?
well yes and no
so what should i do
but basically connection pooling splits the stress of queries into multiple connections
once a query is done, the connection is returned back in the pool
by what should i replace member.defaultChannel.send(...)
Ah
by what should i replace member.defaultChannel.send(...)
@earnest phoenix my guy. I sent a message about that already
client.channels.cache.get('channelid').send('e') that
Make your bot check a database for a channel ID and send the welcome message there
but i want him to send message on all the servers
make the welcome channel customizeable by user
and if no channel is saved return
once a query is done, the connection is returned back in the pool
@earnest phoenix so more pools or whatever more connections can be processed at once?
@regal creek
hey im trying to make a website for my bot, i was wondering if anyone knows of an api or html thing i can use
I mean there's millions of resources out there on how to learn web design
you'll have to be a bit more precise.
make the welcome channel customizeable by user
and if no channel is saved return
@molten yarrow how pls
you'll have to be a bit more precise.
@umbral zealot i mean like a way to show the guild count on the website
you have to start by making a web server that can retrieve that information
and ifgure out how to make a website
then figure out how to query the server
If you thought making bots was hard, boy do I have news for you about websites... π
Uncaught TypeError: Cannot read property 'send' of undefined
Process exited with code 1
i have this error when someone join a server and my bot crash
Uncaught TypeError: Cannot read property 'send' of undefined
Process exited with code 1
i have this error when someone join a server and my bot crash
@earnest phoenix send code

@earnest phoenix send code
@thick gull what should i change or add pls
member.defaultChannel is not a channel
Literally what we said... what, an hour ago? lol
previously i had that
Client.on("guildMemberAdd", member => {
console.log("Un nouveau membre viens de nous rejoindre");
member.guild.channels.get('753704150851649559').send("" + member.displayName + ", bienvenue a toi. \nNous sommes dΓ©sormais " + member.guild.memberCount + " sur le serveur ");
member.send("Bienvenue sur le serveur bg")
member.roles.add('587660184638455809').then(mbr => {
console.log("Le rôle a été attribué avec succès pour " + mbr.displayName);
}).catch(() => {
console.log("Le rΓ΄le n'a pas pu Γͺtre attribuΓ©");
});
member.roles.add('738220068017668138').then(mbr => {
console.log("Le rôle a été attribué avec succès pour " + mbr.displayName);
}).catch(() => {
console.log("Le rΓ΄le n'a pas pu Γͺtre attribuΓ©");
});
});
Client.on("guildMemberRemove", member => {
console.log("Un membre viens de nous quitter");
member.guild.channels.get('753704150851649559').send(member.displayName + ", nous a quittΓ© trop tΓ΄t π");
});
You simply can't send to a "default channel" beacuse that's not a thing
so, find an alternative, for example, figuring out how to ask the server admins what channels they want, if they even want one, and saving that to a database.
should i let that member.guild.channels.get('753704150851649559').send("
only if your bot is in one single server and will never be in more.
Then you can't do that, no. you can't hardcode a channel ID
so, find an alternative, for example, figuring out how to ask the server admins what channels they want, if they even want one, and saving that to a database.
This is what you should do.
Check out https://enmap.evie.dev/complete-examples/per-server-settings for an easy-ish way to do it.
so i have to change the old one by that :
client.settings.ensure(member.guild.id, defaultSettings);
let welcomeMessage = client.settings.get(member.guild.id, "welcomeMessage");
welcomeMessage = welcomeMessage.replace("{{user}}", member.user.tag)
member.guild.channels
.find("name", client.settings.get(member.guild.id, "welcomeChannel"))
.send(welcomeMessage)
.catch(console.error);
});
You have to READ
and UNDERSTAND
don't just shovel code. actually read and understand what this does and says.
you'll have more than this one bit of code. this is an entire setup for your bot.
hey im trying to get my bot to check if a specified user is a bot for the mod commands if (message.mentions.members.first().bot) return message.channel.send(botdm); this is my code but it doesnt work and i dont get any errors anyone know what is wrong with it?
@earnest phoenix also to get your bot to send a welcome message on multiple servers you will 1. Need a database and 2. Need a set channel command
@main trench your code doesn't work because GuildMember (.members.first()) does not have a .bot property (from the User class). You probably meant to do .members.first().user.bot, which will be a boolean.
You may be able to shorten your expression to message.mentions.users.first().bot so you're only looking in a collection of mentioned Users instead of GuildMembers.
aight
I need help with something, I'm using CSS for my bot's description, but somehow it uses it for the entire page.
How do I fix this?
@normal sage
just rename your ids or classes
o ok ty
or use classes and ids if you're just styling elements using their tag name
yeah thats what im doing
so, which library for which language is the most efficient? Like which one should I choose when I want to get away with the bot running on something low spec like a raspberry pi
so, which library for which language is the most efficient? Like which one should I choose when I want to get away with the bot running on something low spec like a raspberry pi
@elfin vortex thats a little bit too wide of a question to ask, unless we talking pre-historic hardware, you should have no issue whatsoever running it with the major languages
js, c, cpp, py, even go should give you no problem at all hosting it on a pi
how do you customise your page like this https://top.gg/bot/655390915325591629
css
do i edit it in the widgets section?
but isn't that for description only?
whole page
you need to learn css/html
so, no, there are not docs on how to do it. But you can learn those 2 from a ton of difference sources
yea i know abit of css and html but i need to know the button's class / id name no?
oh ty
okay i am here
ye
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
console.log(`User with ID ${vote.user} just voted!`);
});```
i domt need this anymore?
no delete
done
copy all that I sent, but changing the Auth string to yours
ignore const ref
and everything after
so i copy your screen from const data included to ref excluded?
yes
where do i put thos lines?
until u have the line from userID
there says es.onmessage
so clear inside the es.onmessage
and get that inside
so in my site i'm using flex and justify-between to spread 3 elements evenly in a div, how do i make one of the 3 elements (the middle one mainly) larger so it takes more space up then the others
You can help them and guide them but do not just give them all the code
Because then they do not understand how it actually works
can someone help me,
@earnest phoenix just add a catch
@sick cloud You would assign it a class aswell and then edit it's margins and sizes
@ocean cedar what u r pasting is basically variables getting info from the .json
Or if you are attempting to move it alone and not the other stuff you can use align-self
it's flex so i don't think margins would help
i see i see
how does align self work
@earnest phoenix just add a catch
@blissful coral can i add this
let error;
function writeOut(message) {
if (!error) {
error = require('internal/console/global').error;
}
error(message);
}
i'm using tailwind so it's docs on align-self are here: https://tailwindcss.com/docs/align-self
@sick cloud align-self takes properties of justify-content and then align-items
the type, so u can verify if it's an upvote, and the Auth, to check if it's yours @ocean cedar
and only applies them to the single element within the div you assign it
so how would i use it in my case roughly
i just need to make the middle item have a bigger area
.user is just the user's id, so it goes into a variable called userID @ocean cedar
<div class="flex justify-between">
<div>1</div>
<div>2 (should take up more area)</div>
<div>3</div>
</div>
that's roughly my markup
i see
changing the width does nothing
after u have those variables just add the code to access your database
check the user if it exists in your database
@sick cloud For the div 2 have `<div class="whateverclassforit">info</div>
So you can edit the single one only
and then what css do i need to apply to it
then give them what u want
i'm still a noob on anything flex basically lol
width and height I think if I remember what worked for me
@ocean cedar hope u read those up there ^
i read and finished to copy it too
any of these?
so now i have to add the database check and give the reward
inside the index right?
well, I use the vot info to give my users, if they have a profile, 150G
@ocean cedar inside the if statement u just copied
right after defining userID
access the DB, make the changes and close the If
Now apply it to the single element
okay
Pretty sure
hmmm
Weird
```if(authorization === xxxx) {
if(type != upvote) return;
userID = data.event.body.user;
}```
inside that if
here?
i have no idea really
yeah, inside
so after if(type != upvote) return;
after userID
Btw, is your code private?
ah okok
Because....well, hard coded auths and tokens are a security leak
Because....well, hard coded auths and tokens are a security leak
@lyric mountain this is for a simple upvote data system
he gets the info, and checks the auth
Still
the auth is custom on DBL Bot settings
I could fake requests if I got my hands on that auth
Custom auth is no less important than, say, discord token
just change it :)
same as the token, regenerate
and yeah, my code on github is private
no one will ever get it
You don't even imagine how much collateral damage people could cause in the time between leak and regeneration do you?
unless I show it by myself
Anyway, stay safe
I do, but I leaked an auth for the voting POSTs
and my bot doesn't get any other data than upvotes @lyric mountain
Dddos
u cant, it's in pipedream
not in the bot host
:v
pipedream goes down, but the bot is up
:^)
I prefer not to risk anyway
dw, my good heart often doesn't fuck me up
(node:7524) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
at Function.normalizeFields (/rbd/pnpm-volume/54fb0ce3-0b97-49df-b8c9-469660dcfa5a/node_modules/discord.js/src/structures/MessageEmbed.js:450:8)
at MessageEmbed.addFields (/rbd/pnpm-volume/54fb0ce3-0b97-49df-b8c9-469660dcfa5a/node_modules/discord.js/src/structures/MessageEmbed.js:266:42)
at MessageEmbed.addField (/rbd/pnpm-volume/54fb0ce3-0b97-49df-b8c9-469660dcfa5a/node_modules/discord.js/src/structures/MessageEmbed.js:257:17)
at commands.forEach (/app/others/help.js:104:25)
at Array.forEach (<anonymous>)
at Object.execute (/app/others/help.js:103:22)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:7524) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7524) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:7524) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Emoji
at RequestHandler.execute (/rbd/pnpm-volume/54fb0ce3-0b97-49df-b8c9-469660dcfa5a/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:7524) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
help
how to fix
update node.js
are you hosting on glitch?
yea
how to change
@outer perch MessageEvent is not defined
Ok is there a way so that discord.py can upload a image that a user sends at the same time
there is a way
hi guys should i add this to fic the error :
let error;
function writeOut(message) {
if (!error) {
error = require('internal/console/global').error;
}
error(message);
}
lets see ^^
stop taking and copy pasting code without understanding what it does
take a second out of your day to read your error
you can't fix it, you can't force a user to accept DMs
no but just to have a small messsage on the cosole log like user can't receive dm
@earnest phoenix What library are you using
if I was on my pc chillin'
Because honestly what you are doing here looks way over the top
thank you really a lot
Because honestly what you are doing here looks way over the top
@blissful coral ?
wich bot did you develop?
@earnest phoenix What library are you using
@blissful coral
wich bot did you develop?
@ocean cedar me?
yes
@earnest phoenix
one other random question
how does z-index work
because my 3 elements kinda overlap when the browser is resized so i want to bring the middle element "forward"/over the top of them
no, but rewards are assigned correctly
give it a bigger z-index value, however z-index only works for "floating" elements, such as position:absolute
it doesnt work for inline stuff



