#development
1 messages · Page 1478 of 1
te 2nd one
so now its like this
client.on("ready", () =>{ console.log(Logged in as ${client.user.tag}!`);
client.user.setPresence({
status: "idle", // You can show online, idle... Do not disturb is dnd
game: {
name: "Into The Light", // The message shown
type: "LISTENING" // PLAYING, WATCHING, LISTENING, STREAMING,
}
});
});
`
Isn't the game property deprecated
look at the docs
i did and i ran some commands from it
only accepts activity not game
and i cant run any codes on the chromebook
client.on("ready", () =>{
console.log(`Logged in as ${client.user.tag}!);
client.user.setPresence({
status: "idle", // You can show online, idle... Do not disturb is dnd
activity: {
name: "Into The Light", // The message shown
type: "LISTENING" // PLAYING, WATCHING, LISTENING, STREAMING,
}
});
});
there
do that
ok
activity, not game
if you make it streaming you may need to provide a link
game is deprecated
yeah
but they want listening
ah
syntax error
lol
lol i didnt make the mistake
lol ok
Tysm
did that work?
wait u said line 210
did it work?
wait weher do i put the a' lol
ok
ok
|| ||
can someone help me with make a bot
ur going to need someone to host it for you tho
dont worry u can use
It is a syntax error
thats what i use
ok
oh
but when i make a music bot its works but we cant hear it

oh
make sure u dont have it muted lol
no isnt muted
Wait wtf
oh
hey it say sintax error
Where
Learn how to code-
Inside that link I have posted I have my HTML code I'm simply just trying to get text in the middle of the image
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.
echo bot
i use node.js
Look right above it that one should make it center
you should really not be using glitch for hosting bots
i use uptimerobot
its really good
there active 24/7
for free
^ unless your paying, bots on glitch are pretty much against tos, since uptime robot is against glitch tos.
if you are paying, glitch is too expensive.
yeah, repl is ok
but glitch, like we where talking about its not ok.
I belive so yeah.
You can with uptime robot
Which they allow and seemingly openly support.
Or Google f1 micros are a really good free choice.
No shady uptime robot stuff
Yeah
Hi, this event doesnt work, it doesnt dump the server ID in the json, how can I fix this, thanks, famous8
@bot.event
async def on_guild_join(guild):
with open('.//cogs//prefixes.json', 'r') as f:
prefixes = json.load(f)
prefixes[str(guild.id)] = '--'
prefixes.append
with open('.//cogs//prefixes.json', 'w') as f:
json.dump(prefixes, f, indent=4)
Why do you have two slashes in the file path?
does sqlite automatically create a db file after u delete the old one
yes
cuz I delete my old db but it comes back again but there’s no code that makes a db file
o
so if u just have “require quick db” it makes one?
It creates one if it doesn't exist, unless you tell it not to.
yes when u run the bot
yes
whe u node
I thought it was a command that’s why
hm so why is it named json.sqlite
bc I have it formatted in json?
What the fuck that what
but dont work
say is not defined
that Discord line is not doing anything
the name of the command says "clear"
the args check does not return
code review™️
also, will throw an error and crash if the bot does not have permissions to delete the message
is it possible to change name of quick db
rn it’s json.sqlite
I want it called data.sqlite
dont think so, last time i checked it was hardcoded
why are you creating a new Client inside your command?
remove it :3
oh k
same for the const Discord = require("discord.js") line
have you coded in javascript before
im still learning
this is my first bot 
also you checking if saywhat < 1
if you use say 0
it will tell return the Didnt provide text line :3
ahh
you can check with if (!saywhat) return //your code
delete the Discord line, its not necessary
ah ok
it's better to use args.slice(1).join(' ');
those three dots is your ide telling you it's never used
now?
looks nice now
ty yall
it will still error if no permissions

to avoid errors you need to catch
yep true :3
what if i remove "message.delete()" then?
message.delete().catch(error => console.log(`could not delete message because of ${error}`))```
same for .send()
message.channel.send().catch(error => console.log(`could not send message because of ${error}`))
but why is he using args.slice(1).join(" ") now? it removes the first arg
it depends on the command handler
but for many people, the first arg is the command itself
yeah his handles it already i think
try removing .slice(1)
can you show your command handler code?
the part where is does command.execute(message, args)
your command handler is not designed correctly
show the full code for the message event
remove all the if elses
Thats a hella hardcoded command system
and just do this ```js
const cmd = client.commands.get(command);
if(cmd) cmd.execute(message, args);
these two lines effectively replace all your if elses
and work for an unlimited number of commands
That hurt my brain to look at
oof
aside from that, the args look correct
oof then i dont understand why when i have that catch it makes the bot dont say
sorrie for that epic english
can you try adding it again?
as i thought
it was probably just some delay in the code updating
btw the catch should also be in the first .send() (on the if(!saywhat) line), otherwise it will still error if the bot has no permissions to send messages and tries to send one
now?
guild: 59454
x: 'weekly',
role: '6942002496'
users{
<MYID>: 300
}```
this is probably basic Javascript but how do I get pk from a id that is in users
is that possible
I am trying to figure out how to organize my information/data
Are you working with an array of objects?
Like [{ pk: ... }, { pk: ... }]
oh you changed it
I- Idek what I am doing I don't have anything as of now but I want to putthings in db in a organized manner
What field does pk represent though? Is it 300?
pk = guild, idrk tbh i am unsure how to organize my information
I have guildID and then users in it right and then I also have information that is same for each user in that guildID
<clanID>: 59454
due: 'weekly',
entryFee: 5000,
fee: 20000,
role: '6942002496'
users{
<ID=P025#2022>: 300
<ID=Starkwood#2002>: 500
}```
this is what I have 4 of the things are same of each user

only working "you did not give the bot a question"
what is that 6th line even supposed to do
that line is for when you dont ask a question @stark abyss
but your reason doesn't make sense
if you are checking if they put something or not just do if(!args[3]) return ----
3 is an example you do that
How do I remove everyone who has a certain role?
The bot is being only used in one server so the role and the role id will be the same.
@stark abyss now?
RichEmbed is no longer a constructor
you must use MessageEmbed();
@agile steppe
also, use if(!Reason) return message.channel.send('Some message');
cause the questions is the var Reason, use !Reason
to make it have more sense
now
you need to require Discord
you must define discord inside the block
learn js first
now?
discord.js uses some relatively advanced js concepts
otherwise, declare discord as a global const
wouldn't recommend global variables
i think it's better 
just require it when you need it
i said const
i mean declare it out of any block to use "Discord" any time.
ya
imports and requires at the top of the file
sad still aint workin :/
hi so i am making a work command and you have to type a specific code in order to get money, the only part is that the money adding wont work and it is unreachable. here it is
how should i fix it
ok
you shouldn't use return to send a message if you are not trying to cancel the command.
or something like that
ok
now does it works?
yes thanks alot
np
ok this is getting sad i have another problemo: so with the code when i type wrong code it wont register as wrong code so it says its right code how do I fix that? here where it should be doing that here
i think you got the boolean wrong
it should be negative
and why are using array.includes?
just compare the captcha with the content
hmmmmm it still wont work
for which tho? if i use it for the wrong message it only does wrong
Use if..else instead of doing the operation twice and use strict equality operator instead of Array.prototype.includes()
ok
...
thanks it worked :D
i need help!!!
how can ii make my hug command to take random gifs from reddit or other platform?
Use the reddit api
thanks
You might want to consider a different api since reddit can return nsfw images
oh right, 2020 II is coming.
something weird is happening
none of the thumbnails for my embeds are loading
they'd work like yesterday
and i modified nothing
and its not working
it's for all my embeds
also this is bad because my bot is about to be reviewed for the 2nd time
wait nevermind
it's a glitch
it works now
December 32, 2020
lol
This is probably not the best approach
But im not sure if scrapping is better than cookie gen
Why my bot is.just showing this many less number of user connected i have been added my.bot in my.both 2k member server
Pls help.me 
Lang and lib?
English pls
Language and library?
My friend coded bot
@gilded olive Il tell u in some.time
Alr
how do i remove underline from href?
text-decoration: none;
show css
just css a { text-decoration: none; }?
nice
rn making a knockoff imgur lmao
?
I also need 1 Lil help
I added.my bot in my both 3k msmber server
But it still showing this many less users
Pls help
did you enable member intent in discord developer? All user isn't cached if member intent is disabled
@pearl trail 2m let me see
@pearl trail In which tab
General info
Oauth2
Bot
how are you fetching member count ?
@earnest phoenix wait..
and make sure your bot is in below 75 guilds
now ?
restart your bot
hmm, you turn on your bot in command prompt?
idk
hmm, so ask your friend to restart your bot
k
or maybe try to use this command again. might be cached automatically ¯\_(ツ)_/¯
oh okay
alr
it must be working if the code is
client.users.cache.size
Read the discord.js.org docs
<channel>.name should work
Or at least someone told it'll work
db.updateOne({ guild }, {
$pull: { feeds: { $elemMatch: { screen_name: "discord"} } }
})```
this is my code. But it doesn't remove item from array 🤔 no errors
I just use $pull: { feeds: { screen_name: "discord" } }
you even have stack trace, just follow it to see the source of problem
i gotta frame that quote somewhere 
does a proxy for a MERN stack works also in production? so that i can prevent external calls to the Backend API (by not opening the Port externally)?
idk if google wants to troll me RN or im just tired but i cant find a clear answer
pog
F
F
F
Are you using quick.db?
@earnest phoenix yes
I don't understand from Quick.db
@earnest phoenix tamam
if(command === prefix + `registeredusers`){
if(message.author.id !== '436136191922798592')return;
if(registered === undefined){
message.channel.send(`${message.author}, no one in the list. Try again later.`)
return;
}
message.channel.send(registered).catch(console.error())
}```
Its weird. If i type: !registeredusers is says:
ObjectParameterError: Parameter "filter" to update() must be an object,
getting this error
you try to send a empty message
help me
Why its isn't working?
yes
this causes the error
bcs registered is never defined
spamming wont get you attention, only warnings or a kick
ObjectParameterError: Parameter "filter" to update() must be an object,
getting this error
@lusty quest Okay thank you
yes bcs it expects an object to filter
can you help me i dont know how to do
MongoDB?
yup
use findOneAndUpdate({Key:value},{your update})
okkk
What databases do people usually use? :> for discord bot developing
but how to update 2 user?
update many
amount+ and amount -
depends, if you want run one localy quickdb is popular (but somehow a pain in the ass according to the amount of questions you see here) mysql, postgres and Mongodb are also extremely popular
did you use Mongoose or something else?
i can give you pointers
its almost correct
you just need to use a object to filter
ObjectParameterError: Parameter "filter" to update() must be an object, got 773509714465390612
What’s the best from mysql, postgres and mongo?
depends. i used mysql and switched to MongoDB recently
Sir Superbrain
Do you like mongo more?
makes scaling easyer
since you can shard it pretty easy
the marked area needs to be an object
like a unique key in your database.
if you dont know send a snipped of your schema here
ok
but mysql got better in engine caching
please rewrite and give
did you refer the Wallet to a member? bcs there is only a guild id
or is id the Discord user id?
userid
ok
Hello I would like to make a new design to make it more welcoming because the one now it and a little can ugly I will not hide it and I would like to make design like that on the 2 photo included video if you could help me how to make its would be awesome ^^
i want a user to pay another user
membersDB.update({id:fromID}, { $inc: { wallet: -amount } }),
see the difference?
just make sure fromID is the userid from the user you want to take it from
is it discord user id?
if the id in your schema is it yes
i suck frontend so sorry
Hello I would like to make a new design to make it more welcoming because the one now it and a little can ugly I will not hide it and I would like to make design like that on the 2 photo included video if you could help me how to make its would be awesome ^^
did you know some css?
well you probably want to know it to do such stuff
i saw the pictures the first time
lean CSS. but idk exactly where to set it in your Bots long Description, there is a Markdown tag for it iirc
Yes, I know there's that.
I just use the CSS a few times
It was for color except that's it's skinny
i need help ... the bot does not respond to commands and does not log any errors .. I deleted discord.js and reinstalled what should I do?
your command handler?
My English is not good, I don't understand what you're saying, can you explain?
oh
or your prefix is bugged
You are awesome. Finally worked


well there is the issue why the commands wont fire
did you use github to share the code?
nope
rip then
I'm trying something for a minute and I'll come
ok i took care
@lusty quest thank you so much
My friend completely erased the place where I drew it, and these commands did not load and did not run.
yea without command handler you wont run any command
thx
@lusty quest I am not able to create user if he doesnt exist
?
if it exist it works fine
use upsert in your update query
where
did you know MongoDB basics?
sorry but i am not very pro in mongoose
i know
basics
but i still find difficult to use
bcs you only create a object but never insert it into a database
you get the idea maybe, somewhere in the future
in your if(!dataBank) state you only create the object but never save it
oh
you can also set a default for the starting money if you havent
I already did 10
oik
why memberDB?
its emembers
you dont really need to store the db call
the syntax looks right did you check that you look into the correct Database
Thanks buddy worked
i forgot to findOne/Match if it exist (ToID)
@lusty quest Sorry for ping but one last query
can i ask?

membersDB.updateOne({id: toID}, { $inc: { "wallet.1.balance" : amount } })
``` try this
not sure but you maybe can replace 1 with $
its creating 2 wallet
is the path correct?
how does the document looks now?
schema?
yes
but it wont update?
they all have 2 balance
try wallet.balance instead of wallet.$.balance
ok
format error
well then the other one is correct
can you recode above
need to search some stuff up myself then. havent used this in a while
membersDB.updateOne({id: fromID}, { $inc: { wallet.balance: -amount } }),
``` should be correct
I have searched many questions on nested objects, but all I found where related to array[s].
I am looking for a updating simple nested object in mongoose.
From here http://mongoosejs.com/docs/guide.
ok
'wallet.balance'
still an error?
same error?
so its something completely different
hmm
but nested not working
strange, all i can find suggests the code from the stackoverflow page should work
how to identify if the server is boosted or not in js
^
is anyone familar with custom domains and linking to dashboard?
use your current name server provider and point the domain to your servers ip
help
im using local host right now, how do i change to domain @lusty quest
did you have a static Ip adress from your ISP?
im using go daddy and it has none
whats isp
Internet Service Provider?
yeh what about it
yea you have no idea about what i talk, i dont think you will understand what to do
well it requires that you answer the question if you got a Static IP from your ISP
if not get a VPN that gives you a static IP
its static
then bind the Domain to the IP
use your name Server provider to set a A record pointing the Domain to your IP
you said you use GoDaddy?
idk never used goDaddy
wait whats host?
your server?
and points to is domain?
yes
switch the ip with the domain and try again
the opp way around?
how make bot read embeds in python can't find it on google
read like message.content
if(message.embed.title("hello"))
something like that
in python
will it pickup embed title because i think it will take "title" as variable
i didn't make one just collecting knowledge
wait you are sending that embed from a other bot right? right?
and i need to check if a specific word is present in title so what should i do
shouldn't it be like
if 'world' in message.content
if the title is not exact it won't work ig
yup
Hi does anyone know how to download the PyNaCl library for bot to play music with voice? Coz I tried with pip install on terminal and it backfired for some reason
I have the commands in my bot
But I cannot play music
Like on terminal...I downloaded...then it said upgrade pip to 20.3.smth then I upgraded...then I pasted the code to download the PyNacl library again...but it just said request already satisfied...
I tried to make my bot work thinking it was just me
But it was still not working
Let me pm u pics of what I see on terminal and the error shown by my bot
I coded a command which sends Dig pics and i dont want it to send .mp4 extension. I will send my code too if anyone is willing to help me
import json
@client.command()
async def dogpic(ctx):
url = "https://random.dog/woof.json"
ans = requests.request("GET" , url)
x = ans.json()
a = (x['url'])
await ctx.send(a)```
well
the api returns them as a jpg?
not '.mp4' in x['url'] or not x['url'].endswith('.mp4')
Yea, it sends both mp4 and gif formats
Including jpg too
Uhh can you tell me again?
Nvm it worked
Thanks
import requests
import json
@client.command()
async def dogpic(ctx):
url = "https://random.dog/woof.json"
while True:
response = requests.get(url)
response_json = response.json()
image_url = response_json['url']
if not image_url.endswith('.mp4'):
break
await ctx.send(image_url)
i wrote it meanwhile 😊
😊
shouldn't use requests, it's blocking
shouldn't use requests, it's blocking
@sick fable fair point
check out httpx
it has an async http client
@wintry stream yea
but i wouldnt worry about it yet if you have low traffic
I am making to make code for my bot to come online from 2 days but its sucking me ik other commands but can anyone tell me and give me source code which i can use and telll me use of EventListener and awaitReady
plz help
anyone knows the codes for making my bot track messages and store them in the bot's server itself?
can send source code if possible>
?
@dire loom discord.js or py?
Yikes I don’t know the exact code for it
But it mostly using the on message event and then you can do client get channel to send message in
sounds like a privacy breach
I am making to make code for my bot to come online from 2 days but its sucking me ik other commands but can anyone tell me and give me source code which i can use and telll me use of EventListener and awaitReady
plz help (java)
;-;
anyone plz
not many here use java
what many use?
javascript, python
non english in #general-int
If anyone knows then plz ^^
look into the docs of your api client (if you use one)
i do not
why? they usually make it easyer
can you send me the help command in discord.js and config.json ?
thanks
For TS: I have a class named Piece
and I'm returning its subclasses (not instances) from a function
How do I let ts know about this?
I mean how do I set the return type?
What’s better? AWS or Google Cloud or Azure?
can you please send me with full informations because this isn't in order
start the guide at the start
i guess it boils down to personal preferences
okey
Like I am setting MongoDB for my bot right now
And having some problems with choosing cloud service
all 3 of them will be fine
What do you use?
ik
Mongo doesn’t have digitalocean 
i host the Mongo instance myself lol
Oh
i also need guide gimme plz of java
Java wrapper for the popular chat & VOIP service: Discord https://discord.com - DV8FromTheWorld/JDA
so i have a problem
i made a event guild server add
so it sends welcome message whenever a peep join
but my bot is public
and i need it to only work for my support server
{
if (client.guilds.id ==! '645650731789058099') return ;
const wlcmmsg = new Discord.MessageEmbed()
.setTitle(`${member.user.username} has joined the server!!`)
.setColor('#9b6dff')
.setThumbnail(member.user.avatarURL())
.setDescription(` Hey There,welcome in Akemi support server enjoy your stay.Check Rules and dont forget to say a HI  in general chat,use -invite to invite Akemi `)
.setTimestamp()
client.guilds.cache.get("645650731789058099").channels.cache.get("791657334240968706").send(wlcmmsg)
})
it sends of all 21 servers
!==
i have a problem with commands help can you sead another pls in discord.js and config.json
lmao
else stuff correct lmao
Looks alright.
we are not allowed to spoonfeed you, and ive send you an entire guide for it
there is nothing there which explains use of event listener
i have no idea about jda and have like you to google the stuff, where its most likely that the 1st or 2nd hit is what you need
const ms = require('ms');
const Discord = require('discord.js');
module.exports = {
name: "embedc",
description: "Starts a giveaway",
async run(client, message, args) {
if (!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send('You are not allowed to start giveaways');
let channe = message.mentions.channels.first();
if (!channe) return message.channel.send('Please provide a channel');
let giveawayDuration = args[1];
if (!giveawayDuration) return message.channel.send('Pleae provide a valid title');
let giveawayWinners = args[2];
if (!giveawayWinners) return message.channel.send('Please provide a valid discription');
const e = new Discord.MessageEmbed()
.setTitle(giveawayDuration)
.setDescription(giveawayWinners)
.setColor('RANDOM')
message.channe.send(e)
whats wrong
pls the start of the error trace
wdy,
usually the first few lines of the error contains the information to solve the issue
sorry sended wrong one
yea but i think i see what your issue is
message.channe.send is wrong
i made that as a const
channe is not a thing
Hi I want to create a rank card type without any 3rd party npm package. I would like to know if it's possible or not?
node does not have a built in graphics drawing module, so you have to use a third party one
the node-canvas module simulates the same canvas API as the one built into browser JS
Ok got it.
Pretty sure if you pass it null instead of a string, it resets it
sending Server informations to the top.gg website
needed for listed Discord servers there
new Date().toLocaleString('en-GB', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour12: false, timeZone: 'Europe/Copenhagen' })
how to make this also say the hour?
It onyl sais: Friday, December 25, 2020
Is it possible to call a file that I have stored on my device in a Python script?
en-GB 
what's that
english great britain
just add hour and minute to it?
o
with css
uwu
i just told you lol
css = cascading style sheet
its a scripting language that defines styling for html pages
:0
css is one of the only languages whose answers on google will mostly not work
big brain
no actual math calculates what determines a "try"
what that does in reality is generates a random int
prints it
delcares "tries" as an int of 3
you do a while True: which is bas enough
you wait for a message with no checks which is bad
and you should look into
if:
#code
elif code:
#code
else:
#code```
and remove that while True
and also add the check kwarg into wait_for so you don't listen to every message
I'd use for else instead of while True
"then though"?
in that first if
well first else actually
you can declare that tries is now 2 or whatever you want
guys how to sort data in mongoose and display highsest first on lowest last
Mongoose should have a sort parameter
thats what i dont know. I am mediocre
idk 
def check(m):
return m.content == "whatever" and m.channel is ctx.channel```
await bot_instance.wait_for('message', timeout=30.0, check=check)```
I'd put those in a try/except
def check(m):
return m.content == "whatever" and m.channel is ctx.channel
try:
await bot_instance.wait_for('message', timeout=30.0, check=check)
#code
except asyncio.TimeoutError:
pass```
whatever should be whatever you are checking
i just put that there as an example
should work yea
Feel ya
there is a way to get around this tho @earnest phoenix
I'll show ya in a bit brb
nvm it wouldn't be useful in your case
Guys, who use Mongo. Can you explain what is the difference between cluster, database and it’s collections? 😂😂
Like i read about them, still don’t understand
A string never be equal to type
pool.query(`UPDATE claninfo SET entryFee = ${entryFee}, fee = ${fee}, role = ${role}, WHERE clan = ${clanID};`, (err) => {
if(err) return console.log(err + " | clan exist query")
})
error: syntax error at or near "," | clan exist query
where is this error

you should sanitize your input
but they all are numbers
or are they?
yeah i made sure they are numbers before
you should still sanitize everything that is a parameter in your query
It's a good practice
okay got it
you should remove this comma ig
i'm not sure
no it occurred even when it wasn't there
clusters are the top level thing, clusters can hold multiple databases, databases can hold multiple collections and collections can hold multiple documents
Hi
The new bot commands integration for in chat
(/)
Is that out yet?
And how does it work?
yes it's in beta
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
thx
they're not that useful though
Is it out on d.js yet?
i think not
no
someone mentioned it's planned for v13
you can still set it up yourself tho
yea true
kk
its like typescript for commands but its worse than js
Slash commands are kinda a superfluous and redundant thing
Like, if it had been like this from the very start
But now we all have our own handlers very finely adjusted
nothing is worse than js
except maybe windows 7
php
python
Windows 8
Windows 8 is for mobile users who don't own a mobile
win7 though
9th circle of hell
@earnest phoenix i have ubuntu on my pc too
but i dont use it
reee
cuz i fucked up the partition with very less storage
how do i increase
Legend says hell is ruled by that paperclip dude from xp
i just use win10 and the work i have to do on linux i do with WSL2
fucking hell why do i always select the wrong reactions
Reactionlepsy
/windows\d/sucks
use wine on linux
don't get me wrong
win7 was AMAZING for its time
but it's heavily outdated now
and that's why we should use vista
How to differentiate win7 from win vista: purble place
lmfao
but fr though there's no reason to not use win10 now
it's stable
kind of
but they're slowly rewriting it to include 10x features
they've also been open sourcing a ton of shit so there's hope
win 7 is outdated
no reason to use win 10
im tired
:(
fixed
<p href='https://gooogle.com'; class="button";>browser</p> ```
anyone have any idea about this button when i try to click the button it wont take me to google.
That's a paragraph
it has to be an anchor tag
oh
Also, semicolon in html tags?
oh and attributes don't have a ;
Hi tired, I'm dad!
If you're tired, who threw a tire at you?
Have u tried it?
yeah it doesnt make any button
@ancient crow it is supposed to make a clickable text link
Semicolon
@ancient crow there is no closing tag for the anchors
And semicolons
there is but thats output
Also, you can just use markdown for urls
thats not how an html tag works 






