#development
1 messages ยท Page 1346 of 1
yes
variable declaration doesn't dictate what the variable is being assigned to. only after the declaration
prefix is no longer a string, but an array of strings, so you have to treat it differently
^^^^^
oh
also noticed it be easier to just have to be a string, and lowercase the message in the if statement.
but i guess we are going down the array of string path
so with the array const this will not work anymore
if(!message.content.startsWith(prefix) || message.author.bot) return
`const args = message.content.slice(prefix.length).split(/ +/)`
`const command = args.shift().toLowerCase()`
if(command === 'ping'){
client.commands.get('ping',).execute(message, args)
Are you following anidiots.guide?
looks like it
could also be discord.js guides
Gyus link to create the bot with phone
oh realy
even the comma
Okay, well. here's what you should try first.
First delete the !message.content.startsWith(prefix) || from the if statement at the top, and create another if statement below. This will serve as a test deciding if the message starts with the prefix or not.
Try applying what I showed you above with the || statement. Don't worry about arrays and all that if you don't understand how they work.
ok
hey I have a webhook server setup on a repl with a public domain. it successfully receives posts from top.gg but now I need help getting that post data into my python bot.
no, that tests if the author is a bot
oh oki
class TopGG(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.manager = Manager()
self.sticher = Stitcher()
self.dbl_token = config('DBL_TOKEN')
self.webhook_auth_token = config('ALICE_WEBHOOK_AUTH_TOKEN')
self.dblpy = dbl.DBLClient(self.bot, self.dbl_token, webhook_path='https://alice-webhook-server.highelf.repl.co/dblwebhook', webhook_auth=self.webhook_auth_token, webhook_port=8000)
@commands.Cog.listener()
async def on_dbl_test(self, data):
print(data)
how do u do that ^^^^
Does your python bot run on the same webserver? If not, you'll need a way for the repl to contact the python script or database
@trail orchid
think of if statements like checks. thats the best way to describe what safe is asking for. || is an or operator, means you are saying if this or that is true, then then execute. this means bots can access your bot commands because the message has the prefix in it.
Hy guys how to create bot with phone plss
research the twilio api
research the twilio api
@trail orchid what
Okay, so you'll need a way for them to interact, you can have the webhook be hosted along with the heroku script, that way it's the same process and will be able to interact within the script, or you can have a database hosted somewhere and the webhook edits the database.
what why who when
so should I create a separate python script in my bot project that creates a flask server ruynning locally?
it's the string after IP and port
so should I create a separate python script in my bot project that creates a flask server ruynning locally?
@trail orchid you could, maybe try that and see if that's what would work best.
some guy yesterday told me I needed to create it on repl but I'm now thinking I can have topgg post directly to my heroku app
yeah, thanks guys!
client.once('ready', () => {
console.log('im online!!')
})
client.on('message', async message => {
if (message.author.bot) return
const command = args.shift().toLowerCase()
if(command === 'pepeping', 'Pepeping'){
client.commands.get('ping',).execute(message, args)
}else if (command == 'pepepray', 'Pepepray'){
client.commands.get('pray').execute(message, args)
}else if (command == 'pepeprayspam', 'Pepeprayspam'){
client.commands.get('prayspam').execute(message, args)
}else if (command == 'hmm'){
client.commands.get('hmm').execute(message, args)
so like this? (i still have to finish all tho)
Well like, you can have it any way you want, but obviously everyone has a different tech stack to solve different problems and all that
Well if you were to host the webhook separately, you might as well scrap dblpy and use Flask/Sanic/Django/aiohttp.web
@quiet arch what is name of site ok application for create a bot discord pls
unless I missed the part where you said that already
Or*
wdym?
client.once('ready', () => {
console.log('im online!!')
})client.on('message', async message => {
if (message.author.bot) return
const command = args.shift().toLowerCase() if(command === 'pepeping', 'Pepeping'){ client.commands.get('ping',).execute(message, args) }else if (command == 'pepepray', 'Pepepray'){ client.commands.get('pray').execute(message, args) }else if (command == 'pepeprayspam', 'Pepeprayspam'){ client.commands.get('prayspam').execute(message, args) }else if (command == 'hmm'){ client.commands.get('hmm').execute(message, args)so like this? (i still have to finish all tho)
@quiet arch you might want to check out javascript tutorials on how comparing strings works.
^^^
rn my plan is to create a new python script that runs a flask server in conjunction with my bot
so when I host everything on heroku I have both my bot and flask server running
At least use Sanic's async server
why is it bad?
@trail orchid what is name of site ok application for create a bot discord pls
is it really not async?
It's not
@quiet arch you might want to check out javascript tutorials on how comparing strings works.
@tame kestrel okay
u have one for me?
@trail orchid what is name of site ok application for create a bot discord pls
@tardy moth https://code.visualstudio.com/
Sanic is similar to Flask, you might want to give it a try
@quiet arch https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics
yeah I like flask because it's extremely simple
It has an async server I used to attach to my bot
and this a very simple task
mdn is my favorite guide
okay awesome
@quiet arch https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics
@tame kestrel thx
thank u safe and panda for helping me
so just to get this clear, I create a sanic web server on the same domain my bot is hosted on and then post to that domain?
hehe but still
Err, well
You shouldn't program on a phone @tardy moth
if you want to try phone development maybe https://repl.it/ the website will help you
I thought you wanted to host your bot along with the webserver?
I don't quite understand, what's the point of the dbl library
To simplify using the top.gg API and hosting a webhook, as everything is handled internally and all you have to do is process the end data
but how does it simplify it if I have to host the webserver locally anyway
one thing that it does do
is autopost
my guild count
which is extremely helpful
but for receiving data, on the fly, it doesn't seem helpful
You don't have to handle authorization manually, or actually running the webhook yourself
Eh, yeah. It's optional
Yeah, you can either use dblpy or do it manually
in this case me yelling at you to use Sanic

the difference seems like a few lines of code lol
if(!message.content.startsWith('pepe', 'Pepe') || message.author.bot) return
will this work tho?
wait oh shit
I think I'm just starting to understand this
are you saying that dblpy creates a webserver for me when I initialize the client?
(on my local machine of course)
When you set the webhook_x arguments, yeah
Only webhook_port required in order to actually run it, the other two args have default values (webhook_auth being an empty string and webhook_path being /dblwebhook)
okay well for testing this
I am running the bot on my local machine
so how can I expose my machine to the topgg api
I know i can use ngrok
Port forwarding and making sure your firewall isn't blocking requests
? shouldnt it still work on your local machine
but I'm not sure how that works here
ngrok secure introspectable tunnels to localhost webhook development tool and debugging tool
Huh, interesting
cant u just start the ngrok and use the port it gives u for local host
yeah
oh const stands for constand that i didnt think of that ๐
that's what I'm thinking
if it gives you 4040 use that in the py script, and then send the webhooks to the ngrok open port
Guys you don t have vedio for create bot
-faq 3
No videos, only text guides
Guys you don t have vedio for create bot
@tardy moth This channel is for technical questions with programming, if you need help please follow the link above or just google it
i think i fixed my problem
String.toLowerCase()
@quiet arch that if statement you sent, will not work, it will complain. String.startsWith() takes one parameter.
wait whut?
it won't but it'll only check for pepe
no thats old
client.on('message', async message => {
const BotPrefix = "pepe"
if(!message.content.toLowerCase().startsWith(BotPrefix) || message.author.bot) return
const args = message.content.slice(prefix.length).split(/ +/)
const command = args.shift().toLowerCase()
now i have this
and it works
dont use an OR operator in that if statement
it's for a return, why not
ye
wait i am being dumb, your returning. and your condition is checking a NOT in there
hey could anyone tell me why my !checking command is not working? ```js
if (message.content.startsWith === '!check') {
var userId = message.mentions.members.first();
var userInvites = message.guild.fetchInvites().then(invites => invites.find(invite => invite.inviter.id === userId));
var useAmount = userInvites.uses;
if (useAmount === undefined) {
message.channel.send("<@" + userId.id + ">" + ` has 0 invites`);
}
else {
message.channel.send("<@" + userId.id + ">" + ` has ${useAmount} invites`);
}
}
idk whats wrong with it
string.startsWith() is a function
use ```backticks like so``` @quiet arch
what flaze said
oh thx
if you want color formatting
```js <- put the name of the lang here
console.log()
```
String.startsWith() is a function, that returns a boolean value. you don't need to use an equal operator there
hmm
no scroll up and see my other msg
ye so backtics ``` like this right?
you could
but your making sure that the message is only the command and prefix.
nvm got it ๐
what does your message event look like?
const BotPrefix = "pepe"
if(!message.content.toLowerCase().startsWith(BotPrefix) || message.author.bot) return
const args = message.content.slice(BotPrefix.length).split(/ +/)
const command = args.shift().toLowerCase()
{
if(command === 'ping'){
client.commands.get('ping').execute(message, args)
}else if (command == 'pray'){
client.commands.get('pray').execute(message, args)
}else if (command == 'prayspam'){
client.commands.get('prayspam').execute(message, args)
}else if (command == 'hmm'){
client.commands.get('hmm').execute(message, args)
}else if (message.content == 'pepedog'){
const subreddits = ['memes', 'dankmeme']
const random = subreddits[Math.floor(Math.random() * subreddits)]
const img = await randomPuppy(random)
console.log(img)
const Meme = new Discord.MessageEmbed()
.setImage(img)
.setTitle(`From the luveley doggos`)
.setURL(`https://reddit.com/r/${random}`)
message.channel.send(Meme)
}else if (message.content == 'pepememe', 'pepemeem' ){
const subreddits = ["memes", "dankmeme", "me_irl", "meme", "woooosh"]
const random = subreddits[Math.floor(Math.random() * subreddits.length)]
const img = await randomPuppy(random)
console.log(img)
const Meme = new Discord.MessageEmbed()
.setImage(img)
.setTitle(`From r/${random}`)
.setURL(`https://reddit.com/r/${random}`)
message.channel.send(Meme)
}```
type js after the backslashes please
why are you encasing your commands in a lonely {}?
@quiet arch
you cant use , to do OR Operators.
client.on('message', async message => {
const BotPrefix = "pepe"
if(!message.content.toLowerCase().startsWith(BotPrefix) || message.author.bot) return
const args = message.content.slice(BotPrefix.length).split(/ +/)
const command = args.shift().toLowerCase()
{
if(command === 'ping'){
client.commands.get('ping').execute(message, args)
}else if (command == 'pray'){
client.commands.get('pray').execute(message, args)
}else if (command == 'prayspam'){
client.commands.get('prayspam').execute(message, args)
}else if (command == 'hmm'){
client.commands.get('hmm').execute(message, args)
}else if (message.content == 'pepedog'){
const subreddits = ['memes', 'dankmeme']
const random = subreddits[Math.floor(Math.random() * subreddits)]
const img = await randomPuppy(random)
console.log(img)
const Meme = new Discord.MessageEmbed()
.setImage(img)
.setTitle(`From the luveley doggos`)
.setURL(`https://reddit.com/r/${random}`)
message.channel.send(Meme)
}else if (message.content == 'pepememe', 'pepemeem' ){
const subreddits = ["memes", "dankmeme", "me_irl", "meme", "woooosh"]
const random = subreddits[Math.floor(Math.random() * subreddits.length)]
const img = await randomPuppy(random)
console.log(img)
const Meme = new Discord.MessageEmbed()
.setImage(img)
.setTitle(`From r/${random}`)
.setURL(`https://reddit.com/r/${random}`)
message.channel.send(Meme)
}
oh yey thx
you cant use , to do OR Operators.
@vernal rivet where?
@quiet arch try reading https://anidiots.guide/first-bot/your-first-bot to see how you can use features in js to improve your bot a bit, and maybe get a better grasp on how JS works
@eternal osprey
okay
change
else if (message.content == 'pepememe', 'pepemeem')
to
else if(message.content == 'peepmeme' || message.content == 'pepemeem')
nice
OR operators checks if either condition is true. if so, then it return true. else it returns false. you can't use , to express a OR operator as it is not a OR Operator. only || is. and they have to be both conditions, that returns a boolean value. example:
// false true
if(1 == 2 || 2 == 2)
{
console.log("2 equals 2");
}
do i love markdown sometimes
that beacuse it needs to be pepe pepememe
but that will never execute
Listen Pepe, we won't give you the answer you're looking for, as programming on your own project is what you should be doing.
If what we've given you so far isn't clicking, I would try reading tutorials and learning more about how javascript works, and what tools they give you to solve problems.
do interactive courses, those usually help people the most
reading online has always worked for me
same
okay
Everyone learns in different ways, so do some research on that, and try solving little javascript puzzles and then try approaching your problem again
@quiet arch https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics
@tame kestrel ok ill read this thank u all for your help tho
kore and I are happy to lead you in the right direction, but that guide and the anidiots.guide website will help you a lot.
Oh sorry, Panda LOL
Koreaboo
you're fine, not many people call me kore, so it took me a second to realize who you were referring to
I end up reading like the first few letters of anyone's username haha
lol i do that some times
what do they mean with this?
It means if you do 5 === 4 in your code, you get false
Because 5 is not equal to 4
Am I allowed by the top.gg rules to beg for upvotes in user's DM after they finish their application process in DM?
If the user initiated the application process with a command, yes, you can mention votes somewhere during the command or at the end of it
As long as youre not sending them a message without them doing anything, youre fine
Yep, that's it.
I had it send a message for discordbotlist.com before but removed it before my bot got reviewed here, wasn't sure is it a problem.
Should be fine
@quiet arch congrats ๐
thx
Does anyone know how to blur an image from canvas or any other automation process?
i know some bots have it but how would you make like your bots pfp on its page round?
yea\
Is a /seen command possible?
Where you do /seen @Person and it shows when they was last online.
no
@vocal sluice find the css class for the img on the top.gg page then overwrite it in your bot's description, set the border-radius to 50%
technically it is possible, but it takes a lot of work
yeah
you need to find a class above it though
then you can select the children
give me a sec
do you know what 50% is for pixel?

user.setNickname(args.slice(1).join(" "))
.catch((err) => {
return message.channel.send("I do not have permission to change this user's nickname");
})
.then(message.channel.send(`:white_check_mark: | Successfully changed **${user.user.tag}'s** nickname to **${args.slice(1).join(" ")}**`));
``` its sending both messages
Out of context star posts are the best
@silver lintel using return in a callback won't return out of the function you're calling the method in
aka
:0
use await/async or .then().catch(), nevermind the second option will work too
thanks
Hello! I have a simple question (I guess) but I couldn't find anything on the internet or in the documentation. How do you convert a tag (Cl00e9ment#3679) to an ID (347315660679938060) or an user object using discord.js, thanks
Why it's not possible ? Discord API doesn't provide a mean to do this ?
it doesn't
ty tim
Is there a reason for this ? Because Discord itself can definitely do it
there's no reason and no it can't
the official client works off the user cache too
if the user isn't in your cache you won't mention them or get their id
When you add a friend you provide a tag and Discord can find the user
that's an API endpoint exclusive to users only
It's not a big deal if it's not possible. I was just curious why
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=users
https://discord.js.org/#/docs/main/stable/class/UserManager?scrollTo=cache
use filter on the cache to filter for the user with the username and the discriminator, then just first() it, something like this
UserManager#cache.filter(user => user.username === username && user.discriminator === discriminator).first()
this works off the cache and it's the only way to do it
Who know write in BDscript?
this works off the cache and it's the only way to do it
@earnest phoenix OK thanks. You said that Discord itself couldn't do it. As I said, when you add a friend, you provide a tag and Discord can find the user. Is there something that I missed ?
like i said that's an endpoint exclusive to users only
it's also an endpoint to add a friend not to look up users
so you're at the mercy of discord
Ah ok. I was talking about Discord as the Client/Server. So the server can do it, there isn't a technical limitation. It's sad that we don't have access to it. Thanks for your explanations
ah alright
yeah unfortunately there's so many features that are locked to users only
at the same time if you look at it from a security perspective, it's the best
if it was available to bots it would get spammed, bots would keep on targeting users, just so much abuse overall
@subtle kiln if the user in question shares guilds with your bot, and you know which guild they are in, you can
otherwise its like cry said
@subtle kiln if the user in question shares guilds with your bot, and you know which guild they are in, you can
@quartz kindle OK so if I search the user in a particular guild it would works 100%?
there is an endpoint/gateway call to search for a guild member by a query string, that returns all members whose usernames match the string
its not an exact username#tag search, but you can search by username
and then filter the results
Nice, thanks a lot. I will do that
Can anyone help me figure out why my cooldown error is not sending whenever the message is on cooldown and someone tries to activate it?
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
await ctx.send("Command on Cooldown")
That's just what I have so far
This is exactly what I see other people have, but it doesn't send a message in Discord whenever the command goes on Cooldown
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
await ctx.send("Command on Cooldown")
@storm basin looks good to me, you must be doing something else wrong
@commands.cooldown(1, 5, commands.BucketType.user)
I just tacked that on to one of my working commands
that also looks good
I wonder what else it can be
only thing i can think of is that you arent importing commands?
The command works
i mean from discord.ext import commands
Yeah I have that
The command and cooldown works
It just doesn't send a message whenver I try to use the command when it's on cooldown
can you send your entire script
not here but in pastebin
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.
@storm basin
or hastebin
python is like greek to me
@zinc sierra it's basically pseudocode though lol
@hollow sedge I sent it in a DM
Ignore the weird ass commands I have
@hollow sedge
Wait
I think I'm stupid
Let me try something
OH MY GOD
I'VE BEEN TRYING TO FIX THIS FOR LIKE 2 HOURS
DAMMIT
I completely forgot I already had on_command_error somewhere else in the file
๐คฆ
When you asked me to copy it over I looked it over and noticed it
so i fixed your problem :)?
Thanks for your help
lol
Yeah
Don't do that
What happens if you need windows-build-tools but dont use windows
or hastebin
@faint prism personally i'd wait for pastebin pro to open back up
why would you need it
since hastebin doesn't have private/permanent hastes
There was another site I knew which had its own API for pastes and had permanent pastes but I forgot the name sadly
there's a sus version of pastebin that has pro open
but it's ran on an ip so thats a nope
since hastebin doesn't have private/permanent hastes
@trim saddle Then use a proper repo. I'd say the point of those platforms is quickly sharing large amounts of text. For permanence, just use a repo
can anyone give me any tips on making some sort of handler that allows my bots commands to be disabled and enabled
use a database
im using a mongodb rn and atm im using a really messy way of doing it
yea i know im just tryna tidy up
right now i just have a schema with a boolean for every command the bot has but it doesn't seem like a good way of doing it
discord py?
js
๐คท
just use discord py ๐
jk use whatever u want
@charred geyser https://discord.js.org/#/docs/commando/master/commands/builtins
well if you want to remove a command then maybe you should do that
well i have one but i want to make it a lot better
yeah
flaze, no, thats an over kill
@vernal rivet how else are you going to make it persistent
ok good, don't use a db for commands. but anyways its actually pretty simple. what structure are your commands
one sec
they need a database to keep track of disabled commands
Collection is much better for holding commands. using a db for them is kind of a overkill. unless your talking about something else then yes use a db. 
not really
module.exports = {
name: "name",
category: "category",
description: "description",
run: async (client, message, args) => {
//command
}
};
lik this
do you mean disable per user or bot-wide
@hollow sedge i mean per server ig
yeah you have to use a db for that
yea
oh ok, so your doing module structure.
oh your trying to do it for each server. i mean db would be the best, but you don't really need a good db tbh. a local sqlite file will work
i have a mongo db
now you're telling a db would be best xd

@pale vessel thats cause he didnt make it clear where he wanted to disable it

yeah sorry i should have been clearer
you're fine. yea i mean you could use mongodb, idk how fast it is. the reason why i say a local sqlite would work is that it would be faster to use and get data from, rather than a remote db. as you are probably going to have it get data from the db constantly in the message event, so it is better to go with an option that will not take too much time. but it really is up to you.
depends on how you want to implement it, and how it will work. but the solution would probably have a if check in the message event, that checks if the guild has that command disabled or not, if so, then return. that is probably the best way to do it.
np
ill see what i can figure
yert
enmap would be a good idea to use, or quick.db. both work as a local db. me personally like enmap more than quick.db, but i know that quick.db is easier to understand than enmap.
How often can the topic be changed before Discord kicks in with the rate limits?
tbh i never actually thought about that lipd. the answer could be on google if you have checked yet.
How to start run.bat file on Glitch.com
Using package.json
i don't think you can do that happy. from what my knowledge is, that glitch is a pain to deal with. you could probably use process.cwd to execute it, but you would need to call on a js file to do that.
wait not cwd
hold on, let me read something

But that resets sqlite dbs everything so you can't use enmap with that
Heroku is also 100% free
Yep
I try
I also know free hosts but posting server links is not allowed
Hey what uh coding app do you guys recommend?
vsc, sublime text
pc application, vscode
They will work for Discord Bots?
i use npp even
Vscode is downloading
O,o why npp
just works for me
npp tbh is gross ngl
some people don't like hearing that
The code editor/IDE you use may also depend on what you're doing. For example, Python has PyCharm, but for the most part, having a code editor like Visual Studio Code is satisfactory.
i mean you use what you want, but like why ;-; npp is just gross to look at in my opinion
idk, solarized doesn't look that bad
vscode is just the go-to-go text editor most people use
plus it's portable
very
i'm not convincing anybody at least, you can use whatever you want to code, as long as it works
Hey could I have a mentor? (I guess you would call it) this is my first time doing this me and my brother are having a competition who can 1.make it first and 2. make it best. He already has one and has started but I havent started and dont have a mentor?
don't use windows notepad though
i mean i recommend vscode for newer people. i don't think npp or atom is good one for newer people to use
yeah, i didn't suggest npp to them since it's not good for most people
i know you didn't
all right
Hey Korean... Since clearly you use/have used vscode. Could you maybe help me make the bot? this is my first time doing this me and my brother are having a competition who can 1.make it first and 2. make it best. He already has one and has started but I havent started and dont have a mentor?
All Modules Are There But There Is A Problem
you can't use duration.format() without a plugin
if you want to use py, then idk if there is guides for d.py
@earnest phoenix install https://www.npmjs.com/package/moment-duration-format
I downloaded vscode
are you wanting to use Javascript or Python?
Python I think?
depends on what language you want to code in, make sure you learn the basics first or setting up a bot will be hell
do you know python basics?
I downloaded it on an old computer just never got to it
if not, i suggest learning it first (https://www.w3schools.com/python/ for example)
So 1st step I am guessing. Go back and learn a coding language
yes
||i sure hell don't know python. i programmed in it before, and absolutely hated it, so i am just much help when it comes to py||
take your time
don't code a bot without knowing the programming language since it'll make it worse
^^^^^^
Okay yeah my brothers helper is just telling him what to type n stuff
knowledge is like 80% of what programming is tbh
Thanks I will read this tomorrow that way I can actually pay attention
80% knowledge 20% errors
yert.
@pale vessel The thing you sent I dont see where to learn a coding "language"
Do I just press next?
yert
Does Discord take all Coding Languages?
its an api, so yes?
Oh okay
Does Discord take all Coding Languages?
@icy jolt Just to clarify, since discord provides us with websockets, we can use code to talk to discord. It doesn't really matter the language, some languages have an easier time with websockets, while others need some help.
Okay, Thank you!
you could technically make a bot with a batch script 
Would the code language affect how the bot works?
only up to the point of the capabilities of the language. any "proper" language should have no real limitations of what you can do
^
it will be easier to use a language with an updated api wrapper though
my bots written in emojicode
https://www.emojicode.org/docs/guides/compile-and-run.html
^ joking btw
Seems like a fun way to start programming tho
Have I ever made a mistake here?
is there an error?
yea
what is it
can you show me the code
seems like your old code should've worked too
Yes unfortunately
@pale vessel Ok, I found the problem, fixed it, thanks for the help
๐
yes

@earnest phoenix Why the mass pinging
Please be patient, it's not everyone's responsibility to help you.
What do you need help with
Looks fine to me
What's the problem
What are you trying to say yes to
I just boosted the server
npm init -y creates a file called package.json in the folder your PS is at.
So from there, you can install npm packages, and create a few files to get started
Since you're in this server, I assume you would like to create a discord bot, let me pull up some guides to help you out
That statement, the PS C:/Files > Thing is where your shell is located
It's like files on your system, so like right now, you're located in your downloads folder, inside a folder called New Folder
You can also look up tutorials on how to use cmd or powershell online.
Please read through the links I gave you and see if you can try making a bot yourself, come here when you need help
im trying to send a leaderboard in a codeblock like this
anyone know what lang i should use for coloring
Can someone figure out how to use pipes or a similar type of communication between two child processes in NodeJS
just use the built-in process IPC using child_process#fork
Has anyone used the discord.js in the browser
@earnest phoenix I usually don't tell people to use a different guide or anything, but seriously consider using the https://anidiots.guide/ tutorial, they walk you through node.js and all that from the ground up
The guide you have pulled up looks like an article with as much words as possible in order to get google traffic
i skimmed through it and it didnt make since
well what do you expect
also good one
https://anidiots.guide/getting-started/getting-started-long-version
Start here to setup node.js
https://anidiots.guide/first-bot/your-first-bot
Start here to start your bot development
You should restart, if you don't know what you're doing then you won't get far treading in unknown territory.
read the error, it seems like the /var/lib/apache2 wasn't empty or something
Yes
check whats inside that folder, if it's something you don't want, rm it
I want it to forcefully remove
@delicate shore
check whats inside that folder, if it's something you don't want, rm it
@tame kestrel I don't want anything
In dat
rm -r /var/lib/apache2
check if it exists, maybe it just cleaned itself up?
?
Why are you trying to do that in ps? If you want to make your program through command line, then use either nano, vim, or vi
I mean are you new to programming?
you need a text editor to write code
False
wdym 'false'
Ok then I recommend you look into using an application called visual studio code. Vscode as what most people call it, is a lightweight text editor. It's what most of us use when we are programming. It's much better for newer people to use this than nano or vim
You don't exactly need a text editor to make a program pool. Anything that allows you to edit a file and put text in can be used to program. It's not efficient but it works
Ok ok ok. One thing at a time, let me grab laptop so I can keep up
while you do that please educate me and tell me why you said 'false' lol
I already explain why
lol
when
Technically anything can be used to program something. As long it can edit the the text in a file it can be used to program. Its not efficient but it works
including notepad 
but you can do it through a console. touch command is a thing, and you can use nano and vim. i prefer vim over nano any day of the week except sundays, cause thats my me day
anyways
ok first question
yessir
oofers
but yes that is the one
bruh where is the fucking backlit button on my laptop. i know it exist, but where is it
i don't click it

np
found it
fuck it was fn + space bar 
uhhhhhhhhhh sure, we can go with that
are you here to program or talk about magic ๐
i mean, the channel's called #development

ok ok ok, back on topic. so you had another question for me
ok, so i will explain stuff, but it be very beneficial if you where to read about some of the stuff talk about here, and about the language. but let me know if i am going full on programming talk, as i sometimes forget who i am talking to might not understand what i am saying
you don't
so the thing is that you make the program. You don't throw code at it and expect it to work. thats kind of like throwing your game disc at your console, and expect it to play the game.
you have to write instructions for it. very detail instructions
oofers
because the bot is being ran locally. actually your making the bot. your program is the bot. the bot in discord is a shell. but in programming your bot is the program
ehhhhh not really. i mean in a way yes, but not really. you are putting code in it, but your actually just calling on the bot's token, and telling it what to do.
you're fine
did you read the guide
i mean most people put it in a .env file.
mhm, thats because its not a command that ps knows.
flaze thats a good question
Why was i mentioned
ok, so powershell is not what you will use to write the program. ps was only to make the package.json file, and to install the packages that you need. thats all it does, minus running your program
vscode is what you will be using to write your program
Sigh message was removed
yes
but you will be seeing it, or at least command prompt, but thats when you are ready to run the bot, or test it.
tbh it is. at least for me it is
Hmm could probably make a bot in Powershell tbh
you're fine, there is no reason to apologize about that. we all start somewhere. heck, when i started, i took the hard way out. ||i started on cpp, the language that most people would say is bruted to learn as your first langauge||
you can
but you would need to use nano, or vime
vim*
no?
i mean you could use the touch command
I mean you could make a ps1 script
oh right thats a thing
lmao
fucking ps being like this
I'm not talking about editing the bot via a powershell terminal. I'm talking in the scripting language
fucking ps and it shit. why can it be like command prompt
They made it to succeed it really
anyways you make a file called index.js and then read the guides
oh look neat
https://github.com/EvotecIT/PSDiscord
WAIT ACTUALLY
THE FUCK
oh wait
thats justj a webhook stuff
i thought it was to make a bot with LMAO
I mean, looks like nobody has done it yet
But it's just api calls
so, you could do it, and make a library for it
true
what it said
sounds about right.
Command-Line Interface = CLI
editor is vscode
CLI would be your powershell
what guide are you looking at?
ok, what does your index.js file look like?
hover your cursor over the section in red it should say something
what does it say?
oh? is your file extension ts or js?
is line 4 the client.login()?
yea no keep it js
oh is it in the problems section?
can you ss only that section?
i just want that line
do you not have a snippt tool?
oof lol
so your problem is a syntax error.
- Not specifying that text as a string
- Wtf is that
- No token
they should be encased in "", or `` or ''
the token is removed because it was hard coded in. not in a .env file
also 
yea your good
actually thats a shitty answer, don't read that
Hi
hello
@lofty musk it takes 4-5 business days for your bot to be reviewed
@earnest phoenix It's obvious you don't know Javascript. Which is kinda tough to make a Discord bot *in Javascript without knowing that
i mean thats quicker than my life
i created my bot on Sep, 17th 2020 and i want to know when my bot can get reviewed by discord, to get bot verified tick?
i created my bot on Sep, 17th 2020 and i want to know when my bot can get reviewed by discord, to get bot verified tick?
@lofty musk apply for verification
@lofty musk it takes 4-5 business days for your bot to be reviewed
@shy steeple IDC i already know THAT
YEs
i mean there is some progress
but i'm asking
What
For what
cause i can't apply yet
It takes 5 weeks
it took my bot like 2 monthes i believe
@faint prism whats the issue
@earnest phoenix You don't know Javascript's syntax. That's the issue
grammar
my bot is in 103 guilds but i can't verify it yet because it says application isn't ready yet (not old enough)
At least make an effort to learn the language before doing a Discord bot
I recommend w3schools
console.log("something); // Incorrect
console.log("something"); // correct
Well uh is there a book
@earnest phoenix yeah, but even better there are tons of websites and resources online like this
https://www.w3schools.com/js/default.asp
even discord markdown doesn't like that 
plenty of resources really
thats more than the days i seen sun light, which is close to 0
event.on("something"), () =>
{
console.log("wrong");
}
event.on("something", () =>
{
console.log("right");
});
have you looked at discord.js' example
where it has this
lol
People take classes for learning programming languages
Wont hurt to read the documentation at least
is it ok if i am using allman brace style in js
i think its fine right auger?
Also fine
is it ok if i am using allman brace style in js :milk_think: i think its fine right auger?
@vernal rivet a bit against convention but fine lol
LOL
no. It takes like 6 weeks to get approved and added here
cause it is
That's when you read the error log
If there isn't an error, you're missing code or have a logic error
or you didn't run the bot
uh
why u type node mybot.js there
client.login("your_bot_token")
then open terminal in vsc, new terminal, and type node mybot.js there
oh
oh yes, cencored
or you can do ctrl + shift + c to open command prompt
your require statement needs discord.js to be a string
both work
usually you would use " for strings, and ' for chars, but in javascript it doesn't matter, as they are for either one.
they are new to programming
yes..
change the const client = new discord.client(); to const client = new Discord.client();, because you use const Discord = require('discord.js')
save the project...
your code is right
^
but in error log, it said
const discord = require(discord.js) without ' ' between discord.js
nonono
if you see the white dot at the top it means it is unsaved
i would recommend watching some YouTube vids. there are some good ones out there that will teach you how to get started.
Discord.Client
caps, yes...
case sensitive
caps is important ;-;
Client
const client = new Discord.Client();
no no
without ' '
you also need to fix lines 9&10
you dont have either of those defined.
if you want it to be what the message contains, it needs to be a string.
you have to save it
before you run it.
every time you change something. you have to save it.
you need to go watch videos on how to create the bot. they will help you a lot on everything you need to do to get started.
client.on("message", async message => {
``` if you want it Asynchronous , if not delete the async
const command = args.shift().toLowerCase();
if(command === "ping") {
const m = await message.channel.send("Ping?"); m.edit(`Pong! Latency is ${m.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(client.ping)}ms`); }
});```
test
yes, like that
have you save the project? why the error is still in new Discord.Client();
client.on("message", async message => { ``` if you want it Asynchronous , if not delete the async
it needs to be 100% like that
also after you save. rerun it. the error is showing uncapitalized letters, which doesn't match your code
change all 8th line to client.on("message", async message => {
line 12
})
so, it like
if (message.content.startsWith("hi")) {
message.channel.send("hewo");
}
});```
no,
yes if it is not defined anywhere else
dude honestly go watch some videos. its been an hour in this channel of just trying to get the basics up and running. it will help you alot
no error?
yes
yes
i mean this in the nicest way. this isnt a page for us to write you bot for you. ik its challenging for some but it shows you are very new to this.
there are endless sources that can help you online. youtube is a great start if youve never done anything like this before. they will get into detail on how to get started with everything, after that you can decide what you want your bot to do.
also be careful to never show your bots token in here, since you have it in your main file rn
everyone who have your bot token, can use your bot...
and they wont be using it for a good cause..
I can't seem to get my help command to work all of a sudden... I can't post code here, since its over 2k characters...
hastebin
Do I use Help_command=None or bot.remove_command(help)
Good idea
But hastebin won't let me save :/

I'd use bot.remove_command
U forgot to close ur if statement with another }
The }) closes ur async message function
np
is there a code already put out there for having a command that could restart a bot (coded in python)
its message.content
not
message.context
const table = sequelize.define('add', {
string:{
type: Sequelize.STRING
}
})
table.findAll().then(e => {
console.log(e[0].dataValues)
for(let i = 0; a < e.length; i++){
console.log(`element ${i} : ${e[i].dataValues}`)
}
})
why do i get element 1 : [object Object] on the for loop, but i get actual data values from console.log(e[0].dataValues)
imma not working with templates, but I'm not sure u cant log a string and object in the same template, but this should work:
const table = sequelize.define('add',
{
string:
{
type: Sequelize.STRING
}
});
table.findAll().then(e =>
{
console.log(e[0].dataValues);
for(let i = 0; i < e.length; i++)
{
console.log(`element ${i} :`);
console.log(e[i].dataValues);
}
});
and btw for(let i = 0; a < e.length; a++) should be for(let a = 0; a < e.length; a++) or for(let i = 0; i < e.length; i++)
yeah, i got a typo
whatever u like more more, lel
Hello! I am trying to figure out how to call upon these models and update them individually in mongo.db (js)
Now This is the whole model:
const newTeamScores = new mongoose.Schema({
teamDawn: {Number, default: 0},
teamDusk: {Number, default: 0},
})
module.exports = new mongoose.model('teamScores', newTeamScores)
And This is how I am trying to save them
newTeamScores.teamDawn = args[1]
await newTeamScores.teamDawn.save()
Could Anyone Help Me? (This is a Index.js Only File BTW)
Please Ping Me :3
it works fine on my beta bot in 2 servers, but on my main bot in 600 guilds its slow. im using atlas btw
@low orbit can you share the code you are using to fetch the prefix
What would happen if you didn't use await
Apart from that I'm not really sure, my db with thousands of documents fetches fine in seconds
mongoose supports promises
i feel like this is a really silly question but can i get the guild id with something else other than message.guild.id?
like what
everything that has something to do with guild like member and presence have the guild property
Well I was trying to get the guild id in the ready event which obviously doesnt have any messages
maybe thats not even possible idk
there's no context
The ready event contains all guilds in a guilds array
not everyone makes their own wrapper
they're probably using discord.js which doesn't provide anything in the ready event
the djs ready event is not the gateway ready event
exactly
how start launcher.py file on glitch.com

ok
error
SyntaxError: invalid syntax
Can anyone help me? #development message
Is that where the syntax error is occurring @earnest phoenix
Send the code around it
If I have an auth code that expires, what HTTP response code will I get back if I try to fetch from the api?
I'm running a bot on 3 shards, 3,200 guilds. I noticed the CPU on my VPS is going crazy. Any ideas why? It never got this loaded pre-sharding.
@slender thistle dm
@tame kestrel Depends on the API ur speaking about. I would return code 401 based on ur example.
@tame kestrel Depends on the API ur speaking about. I would return code
401based on ur example.
@boreal iron I forgot to mention it's discord's api. I guess since it'll be a dead code, It'll be unauthorized like you said
I guess they respect the "industrial standards" which would be 401 in this case, since it's unauthorized
Makes sense
I dont know why but my <style> tag doesn't work in detailed description
@earnest phoenix I don't know what the fuck is wrong with your code
lol
but the one you sent me doesn't have invalid syntax
@slender thistle do you know why I can't use the style tag in long description ?
did u close the tag?
show how you're entering the rules
did u close the tag?
Yep
<style>
body {
border: 1px solid black;
}
h1 {
color: blue;
}
</style>```
Sa
using this for text but does not work @slender thistle (do i have to use inline styles) ?
I am gonna send 4 screenshots here be ready
It gives an error
Here
Where as sub domains work
Clear your cache on ur mobile device, works well for me

I should probably delete link it might count as self promotion
nice website
Thnx
Does anyone know a way of filtering YouTube videos with the Data API for NSFW content if I already have the ID (so I can't use safe search)?
Why does the style tag doesn't work in my long description 
@stone meteor Use Developer Tools in your browser, see what styling overwrites yours
^
TypeError: Cannot set property 'casino' of undefined```
@slender thistle nothing overwrites it but still it won't work ( inline styling is working )
I may be doing it wrong but I would like to separate the commands in different folder how to do?
Does discord.js have support for OAuth?
@delicate shore thx for your IP
@willow mirage
Bruh
It's GitHub ip n
It's Public always
Does discord.js have support for OAuth?
or do i need to use discord-oauth package?
@earnest phoenix nice site
@earnest phoenix https://www.npmjs.com/package/passport-discord
i suggest using this as its for passport
i mean my non exisnt website is nice
@wicked pivot if u make ur loadcommands a function u can use fs to check if the file in ur commands folder is a directory, then u just run the function again but on that directory
I succeeded thank you anyway, now I try to do a clean help with this
What syntax is used to send a custom emoticon? I tried <:name:id> with no luck. It just displays as :name: ๐ค
What syntax is used to send a custom emoticon? I tried
<:name:id>with no luck. It just displays as:name:
@full flower you have to puta:before the name so<a:name:id>iirc
@earnest phoenix hmmm, weird, it still displays as :name: ๐ฎ
does the bot have permission to use external emotes in the server?
ooh that could be it! permissions! let's see
ah, @earnest phoenix I thought that was it. Though, the bot has administrator permissions... It still isn't working
oh... about that hard problem, it wasnt solved owo.. the code i had worked better cuz at least it was accurate :{
ok this following question is logically difficult(for me at least)
now i tried a 1 kyu problem(don't ask me y xD) and i chose the chess challenge
https://www.codewars.com/kata/5985ea20695be6079e000003
below shows an example of what my code gives, then what was an expected outcome
the problem im facing is that although i can successfully place down queens that do not check each other, i cannot place ENOUGH safe queens in the board
Q.....
..Q...
....Q.
.Q....
...Q..
......
....Q.
..Q...
Q.....
.....Q
...Q..
.Q....
to the chess dudes out here, any advice?
thanks in advanced
oh they r dudes who could help huh
i didn't ping u guys btw
should i make a tic tac toe game or a game like coinmaster by quantumcat?
hmm since that question is gonna remain unanswered for a while(meaning i prob gotta learn the answer for myself as that is one of the hardest challenges on codewars), i'll ask something that can be answered
is it possible to have an embed that acts like an iframe?
like embed to an ngrok host that you have connection with so you could have a live hosting?
just how an iframe would load another page, not just info from another page, can embeds load a page itself?
hi plz help
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the better-sqlite3@7.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2020-10-25T11_41_10_029Z-debug.log
exit status 1
im getting this error for some reason in my new bot
while installing better-sqlite3
I just got ghost pinged in here
When you run a puppeteer instance, do script tags on pages get run?
what r u trying to do
there is page.evaluate, where script gets run sorta like in browser eval function
bruhhhhhhhh
@earnest phoenix pinged u guys
;] can't delete my msg
LMFAO
the cap is real
srsly r they ppl that can help with my problems tho?
there is page.evaluate, where script gets run sorta like in browser eval function
@viscid gale no i mean like if there are script tags on the page does it block them from being executed (security protection) or does it run them automatically or do i have to manually tell it to block/run them?
@viscid gale no i mean like if there are script tags on the page does it block them from being executed (security protection) or does it run them automatically or do i have to manually tell it to block/run them?
@earnest phoenix if the script tag gets sent by the server, they get executed. if they get created USING javascript, they dont run
ok
time to take revenge on glitch for wrecking my stuff by having it run massive scripts
how on earth do u not know how servers work??
||just kidding||
I have got pinged here; what happened ?
a problem that seemingly nobody can logically solve or explain
#development message
also scroll up i said who pinged u
@vale garden paste the debug log in here



