#development
1 messages · Page 1899 of 1

can you give me a high level overview of what you are doing?
you might need to change some ways you do things
Its my way to load slash commands
what is the high level overview of your bot and the commands?
what is the purpose?
Manage guilds
how are you commands currently organized?
["1","2","3"].includes("1")
{"1":true,"2":true,"3""true}["1"]
why do you need to change those commands dynamically?
Bc i want it like it
i think they are going to force you to make some changes
/moderation ban:@user kick:@user nuke:@channel
i'd create a moderation command with options
ban, kick, and nuke as options
sounds good
can I have nested sub commands to any level?
![string1, string2, string3].includes(variable); // boolean indicating if the array does not include the variable
then y we need subcommand group? How it is different?
/cmd
/cmd sub
/cmd sub sub
3 different commands with the same root basically
Whats happening here, im confused
why does i stop at 11
and just loops forever
shouldn't u let i = 0?
what does funcs.rand do?
noice
what is nitro?
Nobody falls on this
x
Not for poors like us lol
the dlscord scam was very well made
So flex website
looks like the sites i made when i first started
@scenic kelp
They cant hack me when i click on it lol
does it have capatcha?
on submit
Idk just got ss and quit
I mean, there could have been a page before that one which logs the token
doubt
you used discord's browser after all
that domain doesn't have an oauth token
No discord ask me everytime for log again
unless you gave it one
So my discord isnt open in browser np
back to problems, why is x[i] 0 always undefined
it's never defined
x[i] = "something"
you should be a pro now
really? const wont work in a for loop
forof
for farofa it'll work, just not for normal for
for (const thing of arrayOfThings) {
console.log(thing)
}```
arrayOfThings.map((thing, index)=>({}))
for(let i = 0; i < 1: i++) {
console.log(i)
}
ye, normal for
...he needs the index
arrow func is less optimized than for
and using let is not that big deal
x[i] 0 works
better for running on more than one processor
but it returns undefined when added to b
js is monothread
Itll increase i until it reaches 1 but it never reach 1 lol
the problem can be split up
and monothreaded in parallel
for loop is locked to the processor
if you try to parallel an array op you'll end up with unsorted results
and in his case it must be ordered by index
so normal for is the best here
And you cant use const in for
so use a reduce function
...arrow func
async function() => {
}
still arrow, but now the whole result is unordered
embrace the arrow
never use var
can u use explicit types in js
not even microsoft is supporting ie5 anymore
wouldn't that be aweful
static typing is way better, no need to figure out what type a var is during debugging
and ctrl + space becomes useful
when you're debugging the issue caused by using types
the ide will point it first
I mean, it's not normal to call .walk() on let plane = new Plane()
with types you know where the issue is beforehand
God you're obnoxious
leave god out of this
Somebody's blaming Kuhakuwaagabunkuu? I'm in!
only if u hate oop
Damn... got so exciting
oop on top
@earnest phoenix Hi Bro
@reef stump hi?
I struggle to live without types now, going back to js stuff once you’ve done ts is such a pain
(And most other statically typed languages)
@earnest phoenix The Rolex Bot Is Your Bot
Yes
@earnest phoenix Can You Send Me Your Project A Bot
Yes of cors
@earnest phoenix Dm
Anyone know how to tell the type of an array in ts? I currently use the typeof operator but it returns object when used on an array. I’d prefer for it to return either Array<T> or T[]
I suppose I could look at the first element of the array, and take the type of that
you have to look at the individual element types
there's no of "an array of things" in js, it's just an array object or something else
Yeah I’m now realizing that’s probably the best solution
just use typescript 
I am
ok so you're probably going to just need to check array[0] or array.every(someTypePredicate)
I think the solution is to check if the value is an array, check the first element’s type, then interpolate a string of like Array<${typeof(arr[0])}>
Something like that should work just fine
what are you trying to do in the first place
For an eval command, just trying to set an embed footer to whatever type the returned value from the eval is
Not that I can’t tell by looking at it, just looks better than seeing Type: object when it’s clearly an array
Even though it’s not wrong
I see
@ripe prairie ^^^
TypeError [INVALID_TYPE]: Supplied data.type is not a valid MessageComponentType.
what is this
type is deprecated
yay got it working at last
finally got some nice connection pooling going, with background queues too... i threw away one implementation because making the threading safe was doing my head in
so i simplified 😄
Imagine thread safety in C++
its not too hard if you dont over engineer
Least*
no
at last
at least means "at least it works" and the other is like "at last, it works"
Didnt know
now you do 😄
Yep thx lol
Good 👍
is that pg_stat_statements?
or like a version of that in whatever db you're using
oh cool
theres how it works, i commented it
theres a few ways of solving the problem, but the other approach i tried i couldnt keep stable so i didnt want to unleash it on live
the other approach was a full async-style system where each query had a feedback lambda attached
doesn't the busy flag need to be atomic for something like this?
oh I guess the struct is the only one accessing it?
ok that makes sense
if theres a race, and two try at once, the second to try has to wait for the first
so its not the end of the world, just slightly sub optimal
the same can happen if all the connections are busy at the same time anyway
I haven't done cpp in so long and definitely haven't messed with threads. All of this is pretty wild to a baby rust user like me even though a lot of the concepts are similar
cool that you built your own thing on top of that. I'm guessing you're keeping stats of these in prometheus or whatever too?
ah ok
i'll probably stash it to redis or something
it would make sense to stash mysql stats in mysql, but then if mysql is underperforming, or down...
so a case of not stashing all my eggs in one basket lol
isn't the idea of analytics that you store data separately from the infrastructure it's coming from?
but it's a pain to go make a whole new db for that if you don't already have a system for it
i tend to store mine in the same place
just because i then dont have to manage another system or a third party service for it
fair
https://triviabot.co.uk/botstats/ i normally put normal bot stats here
Add trivia quiz games to your discord server with this free to use bot from Brainbox.cc. Featuring over 100,000 questions, nitro prizes, team play, leaderboards, quickfire rounds, community rewards, a user friendly dashboard, there is nothing quite like this bot. Invite now!
but i dont think i'll report sql low level info there
yeah probably too detailed for a high level overview like that
3.6 GB ram usage for 110000 servers! Impressive how good C++ is at managing memory.
na it's impressive how good brain is at managing memory
you could easily have a discord.js moment making a bot in C++ if you're not paying attention to memory usage
he definitely doesn't use that
actually decently simple if you declare things thread_local
Looks like there are ways to generate static (compile-time) reflection for typescript
In the end, I ask myself — should I use decorators and metadata at Typescript? And for now, I answer NO
Can someone help me with this command?
async def meme(self, ctx):
content = get("https://meme-api.herokuapp.com/gimme").text
data = json.loads(content,)
meme = discord.Embed(title=f"{data['title']}", Color = discord.Color.random()).set_image(url=f"{data['url']}")
await ctx.reply(embed=meme)```
ERROR WHEN COMMAND IS RAN
```Ignoring exception in on_command_error
Traceback (most recent call last):
File "D:\PYTHON\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)```
You might want to provide more error info since it seems the stack was excluded
thats all it throws at me
@drowsy crag
fixed
P.S. it's strongly recommended to use async stuff along with async frameworks
Instead of requests, use aiohttp
Or node-fetch
Gm developers
@rose warren ^
Ty
way too lazy :/
Is it lazy or skill issue
lazy lazy, I've already did it in my v12 help command
Why make a bot then 
considering that findOneAndUpdate is deprecated, what should I use?
it's not deprecated...
is there a way i could randomise the two items in the html collection
bruh = klasa[i].textContent.slice(0, -1);
console.log(bruh);
yes free nitro
@small plume @solemn latch
Rip, I'm dumb
How to make bot in vc 24/7 with repl...?
const collector = channelwise.createMessageCollector(filter, { time: itemms1, max: 2});```is this max : 2 a thing in djs v12?
hey
how can i convert this time to "mm:ss"
lol
any example?
seconds = milliseconds / 1000
how can I reset my slash commands?
I see slash commands that I removed
minutes = seconds / 60
press / and wait five seconds until discord checks if you deleted a command
console.log(moment(data.result[0].from).format("mm:ss"))```
i tried this but
its giving "00:00"
not worked
😦
are you talking about deleted commands still showing in your discord app OR asking how to delete a command
Deleted commands in code, but still there in discord
kicked and reinvited, worked
I dont see anymore double commands lol
kinda school technician
to filter a user is interaction.user.id.cache.includes('user id')?

interaction.user.id is a string
there is no cache property on there
without cache?
what are you filtering for
for my id 🙂
!inter.user.id === owner
i did this
owner is a variable inside my config.json
if ( inter.user.id !== owner||!inter.member.permissions.has('MANAGE_MESSAGES')) return inter.reply('non hai il permesso di usare questo comando!');
this should work, right?
that say they don't have permission if their id is not the owner's and they don't have manage messages permission
try it and see
that is right
is a purge command
I want to use it also where I have no permission 🙂
wtf
My bot is in more than one server and I dont have the permission to delete message with /purge everywhere.
So it is correct to check for permissions for normal user or that I am using the command 🙂
You’re checking if the member who uses the command has the required permissions not if your bot has them.
That's the point, I want to check for users
Anyone who’s not "owner" - whatever this var is declared as - can’t use the command anyways
If that’s the Discord server owner you don’t actually need a permission check as he always has all permissions
but is with an OR
but the owner is the bot owner, so me
You should have said that earlier
my bad :/
And why do you need to check your own permissions?
If you’re in the guilds your bot is in anyways you will need to check if the bot has the permission to execute the action in the first place or the API will return an error.
so I should check if the bot have the permissions to delete messages inside the guilds for not returning an err?
Yeah since you’re the only one who is able to use this command you don’t have to check your own permissions tho.
Return that permission error if the bot is missing them.
If you have these permissions in a guild but your bot doesn’t, executing the command will do nothing other than returning an API error
return reject(new DiscordAPIError(request.path, data, request.method, res.status));
^
DiscordAPIError: Unknown User
at RequestHandler.execute (c:\Users\Desktop\gauntlet-v2\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
method: 'get',
path: '/guilds/885526328437276723/members/0',
code: 10013,
httpStatus: 404
}
Process exited with code 1
```why is this constantly happening?
if (minigame1.members.size === 5){
const answers1 = JSON.parse(fs.readFileSync("./answers1.json", "utf8"))
let channelwise = guild.channels.cache.find(r => r.id === "894180338023145474")
message.channel.send("**The game room is full! Please be patient and wait till the game ends to join again!**").then(m => m.delete({timeout: 600000}));
channelwise.send("Hello Everyone! Welcome to the *Knowledge* test!\n**First game: write the answer of the upcoming question in this chat! You have 20 sseconds only!**")
let de = result.Sheet1
var randomItem = de[Math.floor(Math.random()*de.length)];
let question = randomItem.A
let answer = randomItem.B
let realanswer = answer.toLowerCase()
const embed1421 = new Discord.MessageEmbed()
.setColor("RANDOM")
.setFooter("Provided by Gauntlet Bot!")
.setTimestamp()
.setDescription(`Question: **${question}**. Please write the answer down in the chat!`)
let hey = await channelwise.send(embed1421)
console.log(answer)
const filter = m => m.author.id != client.user.id;
const collector = channelwise.createMessageCollector(filter, { time: 20000 });
collector.on("collect", async m => {
if(m.content.toLowerCase() == realanswer){
let op;
answers1.userids.push(m.author.id)
fs.writeFileSync("./answers1.json", JSON.stringify(answers1))
m.author.send(":white_check_mark: **You have passed the knowledge test, time for the next challenge...!**")
}else{
m.author.send(":x: **This answer was wrong!**")
}
})
}
```
like where do i catch wherer it's coming from
you are trying to fetch a member that doesn't exist
and PLEASE don't use JSON for a database
where am i using fetch?
idk
@solemn latch
also when ur using djs v13 the timeout option for <Message>.delete() is gone
You mean the timeout property
None of your promises are catching errors.
You may wanna add catch() to your promises in order to be able to see where an error is coming from.
Can u say about auto connect vc in music bots????
is VoteDataDict included in vote event (python top.gg wrapper) https://topggpy.readthedocs.io/en/latest/api.html#event-reference
help pls?
iirc A records cannot point to a different domain like repl.co
only CNAME works
but most browsers will automatically add www in the url so it probably doesn't matter
What are the best places to host and/or code a bot? I'm just curious what you think as I just started my world of coding :).
the best place is a paid host
@earnest phoenix yo what
Depends on your budget
Personally I use https://mvps.net for my bot VPS as its £3 a month for 2gb ram
MVPS is a European VPS company which aims to offer high quality VPS services by using high performance hardware. Get your cheap VPS for only 3 EUR!
The record's target is an IP address 🤦♂️
Contabo is only £5.99 a month for 8GB ram but unless you commit to a minimum term, you have to pay upfront a small amount
they want to target to repl so
He said:
The Alias of my website doesn’t work…? i use replit
i use replit
His CNAME record points to the right target
apparently their repl is offline on the www one
VPS?
the normal one works
His DNS cache probably just wasn't up to date
virtual private server
basically a virtual PC
a virtual computer made to run programs
I write my code in codesandbox then deploy it to vercel's vps
is vercel a vps tho
nope
alr
I code using Replit then I copy over to my VPS
Interesting
I code using jetbrains
you use github actions for the copying part?
🤫 shh
or just straight up copy and paste
code, copy, paste in VPS
RDP allows copy paste between PCs
Is there any places you guys learned code stuff or is it made easier? Or tutorials?
imagine transferring thousands of lines through copypaste
I see
I learnt most just by gathering information along the way. Looking at Stackoverflow code helps
and w3schools
those are the things I used
That reminds me I got cs homework 
damn python makes no sense
oh, intellij now has tutorial for ide
Its mostly minor bits of code
like 25 lines
etc
inaudible laughing noises
intellij has had that for a while now
I heard there's a new invention, I think it's called SELECT ALL but sshhhh, it's pretty new, don't tell somebody.
I remember a few months ago I installed intellij and it asked if I wanted to do the tutorial
compress all files and decompress on vps
¯_(ツ)_/¯
which is cool cuz I don't need to teach people how to use it anymore lul
although my old college will probably stick to eclipse
eclipse is eh
yuck
I didn't really like it
idk what people see in eclipse
I prefer jetbrains over everything
nor netbeans
simplicity maybe?
I tried to make a minecraft java mod in eclipse
didn't go well
i do that when copying a lot of files
I've heard eclipse is supposed to be easier to use
damn just git push and then git pull
I think I had a program on my computer for code
visual studio code?
I mean, given the obscene amount of tools and integrations intellij has I'd say eclipse is harder to use
like, imagine not having clear and simple vcs integ
I use it when im messing with kotlin
Likely
all of them have iirc
I can confirm, VSC
so you can simply connect to your database in the ide and look at the tables and its content
though I still prefer dbeaver most of the times
What's the most beginner friendly?
what?
define "beginner friendly"
language, editor?
depends on language
Depends on your language tbh.
intellij
I'm most familiar with Java :')
nothing beats intellij when it comes to java
Vscode is really useful for every language but it has its limitations compared to a dedicated ide
I see, thank you
ye intellij is amazing
Really any jetbrains product is better than vscode or likewise
unless you meant javascript, in which case I say intellij too kekw, but only if u get ultimate version
module.exports.run = async ( inter ) => {
let aiuto = new discord.MessageEmbed()
.setTitle('**Ecco i comandi di NOVABOT**')
.setDescription('tutti i comandi sono slash, quindi il prefisso è **/**')
.addField('CATEGORIA DIVERTIMENTO', '/divertimento', false)
.addField('CATEGORIA MUSICA', '/musica', false)
.addField('CATEGORIA GESTIONE', '/gestione', false)
.addField('CATEGORIA MONETE', '/monete', false)
.setFooter('**NOVABOT**')
await inter.reply({ embeds: aiuto})
}
module.exports.help = {
name: 'aiuto'
}```
why this doesnt work?
ultimate has webstorm built-in basically
Last time I used js was last week when I had to take the beginner course to programming in my cs class
What's the easier language to learn?
I thought I was scary importing ../../../../../../../../file.js
javascript was born to be the middleman between user and java for browser
javascript
depends on your personal preference for the most part
but now it is its own lang with frameworks and stuff
java is pain on steroids
js is said to be easier to learn than java tho
but some people just understand certain things more than others
why this doesnt work? 😦
why no error
doesn't reply or...?
I bet you it doesn't even run the code inside it
add console.log("works!") on the first line inside import
So should I continue js for my next project?
up to you
we can't choose for ya
js is definetely easy
though if you know the language and don't feel like learning another then stick with what you know
for me it was java, never got used to dynamic stuff
Awright, this all definitely really helped me, thanks-
know what, learn both java and javascript
I've heard of html
mmmm I dislike js now that i've met go
no log, but I dont get why
are you using a computer for discord
it's not entering that code then
show where u call it
I mostly use mobile lol
by
do not tell me you code on mobile
What's supposed to happen
{
name: 'aiuto',
description: 'lista dei comandi'
},```
this is in my dataHandler for slash commands
For now, yeah
It's cause there is an app that makes it easier
it shows you the entire HTML the discord website uses
breh
Ah I see
It's the best I can do for now, it has free hosting 👉👈
although discord is not the best place to test that
Array="amogus"; logged me out when I had 2FA and no phone access
Oh wait
I don't get why it doesn't enter the code 😦
It's the inspect command, isn't it?
I used to use it on roblox to make me look rich LOL
try running with a debugger
what ide u use?
Roblox has gotten smarter, it seems
nothing beats discord's console spam
Visual Studio Code
I don't understand a word that says 😎
queue bUt VSc Is nOt An IDE
just press F12 on discord and go to console
the "wait a minute" message starts spamming as soon as you click console
"Hold up" lmao
Uncaught TypeError: this.options.embeds?.map is not a function
hmmmm...what is this.options?
IDK
this is the code that I'm trying to execute
no library and no this.options
idk what to say, if it didn't log then the error isn't there
but i get the work inside the command
I put it on top of the embed
And I got the work in console
async function sendWeb(name, av, message, Channel, msg){
let channel = message.guild.channels.cache.get(Channel)
if(!channel.permissionsFor(message.client.user.id)
.has('MANAGE_WEBHOOKS')
)
return message.channel.send({
embeds: [{
title: 'Invalid Permission',
description: `**I dont have permission to Manage Webhooks**! ${
channel.name
}`,
color: 'RANDOM'
}]
});
let webhook = await message.guild.channels.cache.get(Channel).fetchWebhooks();
let webhok = webhook.find(x => x.name === 'DEMON-CHAT-BOT');
if (!webhok) webhok = await message.guild.channels.cache
.get(Channel)
.createWebhook(`DEMON-CHAT-BOT`, {
avatar: av
})
console.log(webhook)
await webhok.edit({
name: name,
avatar: av
});
await webhok.send(msg).catch(err => {console.log(err)});
await webhok.edit({
name: `DEMON-CHAT-BOT`,
avatar: message.client.user.displayAvatarURL({ dynamic: true })
})
}```
why its not working
the hell is that formatting
webhok and webhook and Channel
why do people start bot development before learning programming
Because it's exciting
not worth the head scratching
maybe you'll be able to answer that yourself 🤔
An ambitious first project can teach you a lot of concepts
making a discord bot and wanting to support it for the forseeable future is nothing short of ambitious
being aggressive in optimization can also lead you down a dark path
Is there any way to share my codes in vsc
I'd just put it on a private github
use git to collab
Why
because it's the best code controller
What if i dont have money lol
it's free
Well. Git is free. As for hosting… Welp. Sucks
first search result
that was literally what I said as well
@drowsy crag that ad ^
Ok thanks
anyone know how to send a message to a channel when you only have the channel id in d.py?
channel = bot.get_channel(id)
await channel.message.send(msg)
channel = client.get_channel(channelid)
await channel.send("msg")
@earnest phoenix
^^
Or Tyrones response
thank you
this won't work
Why
channel.message.send isn't a thing
u can also make an organization and create a private repo for it
I just googled and sent the result i know only pyhton's name lol
Then don't respond to a python related question
what kind of library has channel.message
error: (node:1573) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined
code: ```module.exports = {
name: 'afk',
description: 'makes u afk',
execute: async(client, message, args) => {
const memberid = message.author.id ;
let reply = args;
if(!reply) {
const reply = 'No reason was provided'
}
/*const data = await schema.findOne({ USER: message.author.id });
if(data) return ;*/
const newData = new schema({
USER: memberid,
REPLY: reply,
})
newData.save();
.......```
can anyone help me why is message.author.id arising error
You mean message.member.id? If the message was sent in DMs there won't be a member property
Also if it was a system message I think
Why would you want to do that?
i mean "author" id by mistake copypasted wrong code now corrected , my bad
Only reason I can think of is that messageisn't really a message object, can you console log it?
u mean shall i log the message?
yup, console log message at the start of the function
ok trying
logged
i ran <prefix>afk abc and it only logged the args ?
Well there you go, client is actually your message object
how to fix that ? i want to get the id of the message sender
shall i remove client from execute: async(client, message, args)?
yup, or actually provide the client as the first argument of the function, but that'll probably break the rest of the commands, you don't really need to provide the client to the function, you can access it with message.client
ok lemme test
Where does everyone host their bots?
thank you so much , it worked
Let's say I have a React functional component:
function Counter() {
const [count, setCount] = useState(0);
// ...
}
To increment the count state, is there any difference between:
setCount(count + 1);
And
setCount(c => c + 1);
no
there are a lot of ways
some populars can be like
dedicated server, websites like glitch or replit, or github+ heruko or just local host
there's probably a reason why the arrow function method exists tho
everyone here makes discord bots with code
Thats not what my question was
My question was where do you DEPLOY the bot
on a vps
https://reactjs.org/docs/state-and-lifecycle.html#state-updates-may-be-asynchronous
In your case, there's no async code, won't matter
now I know why my modals are opening twice
actually, it was
I dont see how
Q: "Where does everyone host their bots?"
A: "dedicated server, websites like glitch or replit, or github+ heruko or just local host"
Yes
Look what they replied to man
I replied to "everyone here makes discord bots with code"
Which is not the question I had originally asked
The answer is the link I sent or what kuu said
I like DO apps because theyre really simple to deploy straight from github
Just plug in your master branch and it deploys on a new PR/Push
Can use any framework. There are a few natively supported ones but anything that's not directly supported, you can use a dockerfile
No Jenkins needed for simple applications
tbh, even for vps deploying from github is ez, just git pull and you're done
AND you get a free static HTML website
If it's just HTML files, you pay nothing
I use DO Apps to host generated doxygen files
github actions make me wet
I like to avoid interfacing directly with server infrastructure if I can
I want to be able to avoid using bash when deploying
I like bash for how flexible it is when dealing with pre-init scripts and automated tasks
that's exactly what windows lacks
I mean, windows DO have pshell/batch, but they're so half-assed that they take more time figuring out what you're doing than writing scripts
pshell takes the mess to a whole new level
And to clarify, I dont have any issue with bash spceifically, I just dont want to interface with a shell to deploy a server; I want the act of merging to master to trigger the deployment. Infrastructure should be an abstraction to an application developer, IMO
it's not like in linux where u use scripts for trivial stuff just for the sake of lazyness
ik, but it's not as flexible
How so?
bash on windows runs sandboxed
Well there's WSL, and there's also cygwin and mingw
WSL is the subsystem component but afaik cygwin and mingw run natively
Well there's nothing "official" about bash, exactly
I like posh better than bash because it deals with everything as an object rather than a stream of data
bash is official to unix
I'm not sure that's true
bash was created by gnu
UNIX is a brandname by AT&T but it appears to be managed by opengroup now?
Though supposedly Linux is certified Unix Compliant according to some rando website
I mean if you take a *nix system like MacOS, they shipped an ancient version of BASH without GNU extensions until they decided to switch to zsh
oh no
i keep getting an error running this code and opening in browser server_ip:8080 :
const http = require('http')
http.createServer(function(req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.write('miao');
res.end();
}).listen(8080);```
this is the error:
@drowsy crag
Why 3.8.5.4?
thats the public ip lol
its an aws linux instance, im not too familiar with this kind of stuff
i've tried several things
In the Internet addressing architecture, the Internet Engineering Task Force (IETF) and the Internet Assigned Numbers Authority (IANA) have reserved various Internet Protocol (IP) addresses for special purposes.
Yeah looks valid
thats a good ip
it could be public ip as far i know
thats the perfect dns server IP
could'nt
It looked so suspiciously small that I assumed it was a fake local IP lol
Are you sure the instance is running? I can't ping it
Pinging 3.8.5.4 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 3.8.5.4:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)
Ping should work regardless of the application running on it
yes, its running, thats why i cant figure out wtf im doing wrong
can you ssh into it?
yup
Weird
C:\Users\colli>curl 3.8.5.4:80
curl: (7) Failed to connect to 3.8.5.4 port 80: Connection refused
C:\Users\colli>
C:\Users\colli>curl 3.8.5.4:8080
curl: (7) Failed to connect to 3.8.5.4 port 8080: Timed out
``` appears to be something there. 80 is refused but 8080 times out
Works on my localhost when I run your code locally
yes localhost worked just fine
yes i temporarily closed the 80
but 8080 is theoretically open, so idk
This is EC2, correct?
You may need to add inbound port rules
For HTTP traffic, add an inbound rule on port 80 from the source address 0.0.0.0/0.
Replace 80 with 8080
yes i already have done that
:/
It's normal that everytime that I update the code for a slash commands it need like 5 minutes to update?
yea
that's boring
slash commands are trash :/
How can I put buttons in my bio like @ Mac or @ Top.gg Gamer ?
For now, RPC is in a private beta. We are not currently accepting any new developers into the program at this time.
rip
I havent read them because I'm going to smoke a cigarette, is it javascript?
its an api, it has no language.
really? cool
I have to host it in any way?
locally, on your system.
dont smoke kids
anyways does anyone here have any experience with reinforcement learning (ml)
client.on(intractionCreate
if(int.isButton) {
if(int.customId === ticketOn_${int.guild.id}) {
await int.reply("Hello")
}
And i have sent a button with custom id = ticketOn_guildid
But it didnt work
didn't u forgor quotes?
if (int.customId === `ticketOn_${int.guild.id}`) {
await int.reply("Hello")
}
if you mean curly braces, I didn't forget
isButton is a function not a property
I mean quotes (backticks in this case)
I was lazy to type that
then try this ^
Probably too lazy to type, too 
Then what i do?

For chck if user clicked button
client.on('interactionCreate', async (int) => {
if (!int.guild) return;
let lang = await db.get("botLang" + int.guild.id) || "english";
if(int.isCommand) {
const command = client.slashCommands.get(int.commandName);
if (!command) return;
await command.run(client, int, lang).catch(async(err) => {
console.error(err);
await int.reply({ content: 'There was an error while executing this command!', ephemeral: true });
});
}
if(int.isButton) {
console.log("Something is going on")
if(int.customId === `ticketOn`) {
console.log("button worked")
await int.reply("Hello")
}
}
});client.on('interactionCreate', async (int) => {
if (!int.guild) return;
let lang = await db.get("botLang" + int.guild.id) || "english";
if(int.isCommand) {
const command = client.slashCommands.get(int.commandName);
if (!command) return;
await command.run(client, int, lang).catch(async(err) => {
console.error(err);
await int.reply({ content: 'There was an error while executing this command!', ephemeral: true });
});
}
if(int.isButton) {
console.log("Something is going on")
if(int.customId === `ticketOn`) {
console.log("button worked")
await int.reply("Hello")
}
}
});
It’s a function not a property
Same goes for isCommand
Function not property
Is this the same text 2 times or do add multiple event listeners?
Simple event listener
ye, same text 2 times as it seems
I feel like I’m speaking Turkish lol
I just double click ctrl v
Ah alright
Why lol
Nvm told you your issue already
you could, like, delete the second part then
^
I mean, it's pretty easy to indentify what is a function and what is a property
i am very sorry this is off-topic but Is Somehost.xyz Safe ?
I dont think user ever had reply did it? 👀 https://discord.js.org/#/docs/main/stable/class/User
Then change your property to be a function
I just googled
Whats different between property and function
And i didnt get result
So i am ignorant about it rn lol
Basically Properties are used for Design of your class. You can get it is when you are design a page of your class like design a web page there u have properties of the page, controls etc. So the properties are used for design. And function are for executing some action.
Doesn’t need to do something
function x() {
}
Yes
That’s a function correct
How would you define a car called X
*var
Thanks auto correct
const X = x
X
Wrong
Finally
👍
isButton is a function aka. as method in this case
Means interaction.isButton()
i did it, tysm
remember that for javascript everything is a boolean
so bla.someFunction will be true if it exists
even if you completely ignored whatever that function is
So if i do it with () itll be more true?
if u do with () it'll not be more true, but it'll actually execute the function
And the function actually checks if it’s really a button somebody clicked on or not
Returns a bookean
Fuck you auto correct
it does not change anything
if(int.isButton()) {
console.log("button worked")
if(int.customId === `ticketOn`) {
await int.reply("Hello")
}
}
hi, does anyone know if Trick'cord Treat is open source? (https://support.discord.com/hc/en-us/articles/360057167253-Halloween-Bot-2020)
errr...a what?
interaction.reply() will send a reply to the channel
What do you mean by not user
Does reply() still exist anyways in v13
Doesn’t look v13 accurate
Tyrone used tickets
Still don’t get what’s the issue is
The bot can only reply to the original interaction
He can’t reply to you since you didn’t send anything
That’s not how follow up messages work
You can just send a message to the channel
Replying to the original interaction message ID
Which will ping you
If that’s what you wanna do
confusing
Tyrone used ping is a system message by Discord not something you can reply to
Replying to it will send a reply to the message being displayed as result of the ping command
That’s how it works 
is VoteDataDict included in vote event (python top.gg wrapper) ?https://topggpy.readthedocs.io/en/latest/api.html#event-reference
Hay @boreal iron do you know how to make DMs to a bot work?
It’s just a normal channel
Cuz right now I realized you can only reply if a bot sent you a message
Wdym?
You can click on the bot and it appears this small profile box
It includes a text field to send a message to the user or bot
If I send a message to a bot it only triggers message create if the bot has messaged the person after startup and then it doesn't work again when you restart the bot unless you send another message
You mean it messes the event if it’s offline and come back online?
Scam
Receiving the event while it’s offline?
The event will not be triggered unless the bot has dmed the user
And then it all gets reset when you restart the bot and the event goes back to not being triggered
Huh the event should always be triggered if somebody sends a message to the bot
The bot doesn’t need to reply or send a message in the first place
Not sure if that needs a specific intent tho
But I don’t think so
I just copied the whole list
Anyways whenever your bot receives a message it will trigger the event
But it doesn't
Don’t know a reason why it shouldn’t
Sounds like a discord issue or something I’m not aware of
Maybe Kuhawkabunkaugu has an idea
@lyric mountain
@spark flint i am using repl for my bot coding , can i host my bot on somehost.xyz ?
BTW sorry for ping
I need so confusing contructor help
a
you move the code over to somehost.xyz
inter.reply( { embeds : [aiuto] } ).then(sent => setTimeout(() => sent.delete(), 2000))
why this doesnt work?
It's a parent class for both Server/BotVoteData
So yes, it is included
Just not on its own
const text = inter.options.getString('testo').join("+");
how can I fix this?
Idk how to fullfill blank spaces with '+'
Join is concating items of an array to a string
What you’re looking for is replace()
Using a regex to replace all spaces
replace(/ +/g, "+")
Must be a regex with accurate flags to replace all spaces not only one
It will also replace multiple spaces with one + only
👍
Can also use \s
For all whitespace
Yeah if you wanna include each whitespace type that makes sense
Don’t think TABS or line feeds are a thing a client can enter in Discord but Unicode whitespaces are a thing
You can enter tabs
I mean they won’t be delivered as content
They will end up being a normal whitrspace
weird
I just checked and either the client strips it or the server strips it. Likely that the server strips it since it strips a lot from content
Lemme check if my bot can send tabs
the server strips it
I mean they can be used in code blocks
Anyone got any good ideas for smthn to make?
For bots, you could do a:
text based rpg.
natural language chat bot
or maybe look at other things people need for their servers
Ah ok so it is being delivered
It's being stripped to 2 spaces
im thinking of a command like app, or a other app.
Can’t test it atm unfortunately
@lament rock
I have no clue what a unicode tab is or why that's relevant or who even uses such a thing if regular tabs exist
In my slash commands, it says: DiscordAPIError: Missing Access
Totally new to Slash Commands.
Nevermind, it was in the OAUTH2 link
anyone here a pro with the next dynamodb v3 nodejs library? i am getting an error with this code.
idk js just python
noice
very helpful. take my reddit gold
yes
I'd prob read tutorials
@client.command()
async def rank(ctx):
user = ctx.message.author
with open('users.json', 'r') as f:
users2 = json.load(f)
lvl = users2[str(user.id)]['level']
embed = discord.Embed(
title = "做得好!!",
description = f"你有 {lvl} social credit!",
color = discord.Colour.green()
)
embed.set_thumbnail(url=ctx.author.avatar_url)
await ctx.send(embed=embed)
Ok, So I get this error upon executing the command and im not sure why. (yes, I know json is not the best way todo this. Its for a single server, so im sure its probaby fine)
I see
{"765628740402282517": {"experience": 138, "level": 3},
here is an example of how it is formatted
i have tutorials and examples pulled up
{"765628740402282517": {"experience": 138, "level": 3}, "630472664510627850": {"experience": 42, "level": 2}, "490263061991653396": {"experience": 18, "level": 2}, "836111723999526942": {"experience": 12, "level": 1}, "462912345325174804": {"experience": 42, "level": 2}, "720648253372366898": {"experience": 12, "level": 1}, "801905232266788894": {"experience": 168, "level": 3}, "677524295735443479": {"experience": 6, "level": 1},
"165860118548840448": {"experience": 6, "level": 1}}
``` it all seems correct
™️
Seems correct to me as well. It is properly formatted and balanced. But a JSON decode exception wouldn't be thrown unless the json.load is actually parsing the string passed to it or the path supplied is incorrect. Idk python much, so I can't be of much help and I'd possibly suggest looking up the error on google and tutorials for the json module
The weird thing is if I define the variable not in the command it works just fine
But that does not update every time you do the command



