#development
1 messages ยท Page 1215 of 1
1 sec
so what happens after timeout
@modest smelt an exception is raised,asyncio.TimeoutError
ok
So you'd wrap the wait_for in a try branch
I hope you are familiar with try-except in Python
@drifting wedge paste it on hastebin
@slender thistle yes!
Don't know, pastebin or sourcebin
@modest smelt
try:
user_answer = wait_for(...)
except asyncio.TimeoutError:
send("Time expired!")```
very vague pseudocode :p
ok
FIX YouR iDNenTs pleaSe
1 sec ig
@slender thistle just one more question
not outside of it
do i have to import anything
asyncio, yeah
for the asyncio.TimeourError
ok
so import asynco
import asyncio, right>
right?*
Or do from asyncio import TimeoutError and just use the TimeoutError itself
yeah
either works
ugh
user = message.author;
console.log(user.joinedAt);```
returns `undefined`
message.member
not message.author
@ionic shard
let joined = message.member.joinedAt
okay but problem is
i do it like this
if (args[0]) {
user = message.mentions.users.first();
if (!user) { return message.reply('**Error:** Invalid user.'); }
whois(user, message);
} else {
user = message.author;
whois(user, message);
}```
if the guy wanna look for tagged user or himself
whois is a function, which the above code is written in...
oh wait
so i just gotta do message.user.joinedAt?
i mean message.member.joinedAt will always return my join date
nah thats returning undefined
Please for the love of Allah use Help for class names
You have both a class and a function help under the same name
cap h?
@ionic shard ._.
First letter capital whenever creating a class

ye
oh my false
done
@pale vessel :))
@ionic shard btw u can convert the date with
let joined = new Date(message.member.joinedAt)
so shoulf i change the name of the class?
@drifting wedge Help or helpcog
just anything that isn't already used
yes it will work
Also did you really fix indents
it's already a date object, use member.joinedAt.toLocaleString()
yeah that ^^^^^^^^^^^^^^^^^^^^
for ext import
myabe they should make 2 channel of development development-py development-js :))
is it the file name//
sorry what
๐ค
file name i tinhk
You don't import anything manually
you use load_extension on files
load_extension accepts a string
and how are you loading the extensions
for i in exts:
client.load_extension(i)
In good lord's name
Can you send the full traceback
I'm not even sure if that's the right file anymore
?
Can you send the full traceback
Send the screenshot of the terminal where the error is
does anyone know how to get a unix timestamp in __ miliseconds from the current time in nodejs?
i need to fix
it
I have a major error in my bot
TypeError: cannot read property 'MessageEmbed' of undefined
nvm fixed my thing
show code
module.exports = {
name: 'allcommands',
description: 'SHows a list of ALL Commands. (Includes hidden/advanced commands)',
execute(message, args, Discord) {
const { Client, CategoryChannel, MessageEmbed } = require("discord.js")
const AllCommand = new Discord.MessageEmbed()
.setThumbnail(`${client.user.displayAvatarURL()}`)
.setTitle('All Commands')
.addField('Commands', '`<avatar` `<ban` `<kick` `<myavatar` `<warn` `<randomnumber` `<ping` `<hug` `<die` `<channelinfo` `<roleinfo` `<userinfo` `<hi` `<invite` `<allcommands` `<corona` `<gay` `<infections` `<botinfo` `<waifu` `<say` `<whatsnew`')
message.channel.send(AllCommand)
},
};```
this is one of my commands
this error happens with every command that sends embeds
this is not needed
without it same error
did you pass Discord to the execute function?
remove that first
sure it doesn't error, but it clutters the code
i should remove discord from execute()?
you shouldn't since you're using it inside the command
but you should remove it and declare it instead
passing Discord when you can just require it yourself is pointless
okay here
- remove Discord from execute
- move that const { Client... } to the top of the file, outside module.exports
- change Discord.MessageEmbed() to just MessageEmbed()
by the way, you don't need all of those, just this: const { MessageEmbed } = require("discord.js")
does anyone know a library like node-schedule that can schedule in unix?
or does node-schedule support unix?
So, it crashes when using youtubeAPI to search the link, at the second search it says: cant read undefined or whatever.
but when im using just the args[1] to push the song it does work, any idea? Ty 
do i import cog file na,e
name
or class name
file name right?
.help
wrong char sr
@pale vessel will add CLient in the const {} = ...
because i have client in the code so
Discord.Client, the one you're requiring is for initializing a new client
if you mean the client itself, use message.client
still says the same error
TypeError: cannot read property 'MessageEmbed' of undefined
i gave some tips
discord isn't defined
can you scroll up
this is literally the most basic thing ever
const { Client, CategoryChannel, MessageEmbed } = require("discord.js")
const AllCommand = new Discord.MessageEmbed()
```?
but, it's in a command handler (command.js or something...)
and please, only require MessageEmbed
i can guarantee that you won't need the other ones
finally worked tysm
my question just get ignored 
well you didnt show any code
Should I make my own API
how can i get all body.names?
instead of using body[0].name or body[1].name
thx
@quartz kindle
hey @quartz kindle (our saviour) what does process.argv mean?
saw that in a snake game
the command that was used to start the process i guess
it should be node the args only
when running the code i can put more stuff after node shit.js and it will do some process.argv stuff to it
so
basically process.argv means all the arguments i gave in the console?
whats this error
404 not found
404 not found
god that hd resolution
any help? it is bulling me
It rebooted my bot
i am so jealous
@earnest phoenix the url doesnt exist
javascript
no one will open a txt
why would you say pastebin out of all services
hastebin is best
@earnest phoenix send it in pastebin
@honest perch https://pastebin.com/c4LV86Dm
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.
(node:29384) UnhandledPromiseRejectionWarning: Error: 404 Not Found
at _response.transport.finalizeRequest.call.then (/root/node_modules/snekfetch/src/index.js:195:23)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:29384) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
which url
the resource is not found or unavailable, check the url
there is no url
snekfetch
at RequestHandler.execute (c:\Users\1370979\Desktop\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)```
@earnest phoenix yes, process.argv gives you all arguments you used in the console, including "node" and your script name
what will happend if we console.log(process) ?
it will show you the full process object
including all its enumerable properties, getters and methods
oh no
nvm
@abstract aspen
wait who is he
so how can i get two bodies side by side?
bodies ? side by side ?
Like in the example you took.
where
body.map(item => item.name)
I want two body inside
{"name":"TEST","time":1452184828000},
in a embed ?
or what
yeah
side by side
yeah
all names and times
let embed = new MessageEmbed()
.addField("SOmething", something, true)
.addField("SOmething", something, true)
message.channel.send(embed)
: /
${body.map(body => body.name && body=> body.time).join("\n")}
no bro..
i dont understand what do u mean
:0
like this
side | side ?
enter this adress
uhuh ?
all bodies will be taken from here.
${body1.map(body1 => body1.name).join("\n")}
:0
do you know the request module?
so you can do
let string = `${body1.name} | ${body1.time}` ?
side by side
@earnest phoenix ?
@earnest phoenix ik the request module
${body1.map(body1 => body1.name | body1.time).join("\n")}
no
we need to adjust to this
can someone help me
body1 => ${body1.name} | ${body1.time}
-ask2ask
smh
@modest smelt dont ask to ask just ask
so ?
is there a way to send 2 underscores next to eachother like this _ _ from a bot without them disappearing
basically
it is a search command
the bot gives 3 values to search from
the user picks one of them
the code i sent is just for the search command
3 value
and so what happens
is
that it runs
and then it says that the user doesn't have an account
so u need to messageAwait()
https://pastebin.com/A7KGgujP any help, please?
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.
@modest smelt wait what doenst have acc ?
w8
so this is the code
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.
for the search command
and i store files of the user
in json files
so it is their id
.json
so id.json
and it reads the fule
file*
it first checks if the user has a file
if the user does, then only it gives the optionss
but mine gives the options (that means the user has file), but then it says that the user doesnt have file
how would you make your bot send a message in every guild and channel it has access too
im using js 12.2
that sounds like it would be really spammy
k
its so my bot can send a message across all channels its in when it is about to go offline
@urban olive ever channel in every guild ?
it has access to yes
i think it would be better to just send one message per guild if u want that
writing it in every single channel is a bit overkill
client.guilds.forEach(guild => {
guild.channels.forEach(channel => {
channel.send("Message")
})
})
if you have any problem not my problem
@urban olive ^^
how do u send text in asterisks without it becoming italics *like this* from a bot
thanks
@modest smelt except Exception as e and then print(e)
See what error you're getting
wdym
@slender thistle here is the new link: https://pastebin.com/6PWATuRE
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.
What's readFromFile
its a definition
@humble gyro or @woeful pike How can the bot can come active
@urban olive what happned ?
?
u got to run the code
@earnest phoenix is there a way to do the same thing but with underscores? i tried using the same method and it didnt work
node bot.js
i know but i wanna do it with underscores _like this_ instead of asterisks
using \_ in the bot doesnt work
wait let me check
like instead of *this* i want _this_
thanks, it worked
Hey ๐ I'm french so my english it's no perfect ... I have the bot "Invite Manager" and he is off line (he doesn't work) Can you help me please ?
@everyone
everyone pings dont ping
@slender thistle
?
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.
so in that code
what was the error again
issue
go to line 15
everything works until line 15
and then it suddenly goes to line 57 and 58
what is e?
the exception that was raised
so basically this: python await ctx.channel.send(f"{ctx.message.author.mention}, you don't have a balance yet. Get one by doing ``e!setup``.")
?
except Exception as e:
await ctx.channel.send(f"{ctx.message.author.mention}, you don't have a balance yet. Get one by doing ``e!setup``.")
```so is this the code?
and then send
eto the channel
how do i get the hydrohenry part at the beginning to be empty date?
so what should i do
embed.addField(`Ad Geรงmiลi`, `${body1.map(body1 => body1.name + ' (' + moment(body1.changedToAt).format("DD MMMM YYYY - HH:mm") + ')').join("\n"),false)
im confused on what u r sayin
name 'check' is not defined
If you can somehow get the user's auth yourself, sure
Or you could just link the vote page as hyperlink and redirect the user there
name 'check' is not defined
@modest smelt Did you create a function namedcheck
Wonders of d e b u g g i n g
so this was the code
searchedplace = await client.wait_for('message', check=check, timeout=30)
the api call to https://top.gg/api/vote uses a csrf token
so what does check do?
it basically checks if that user is typing right?
like its that user
It's a function that must return True or False
so this would be the code
No, it checks every message sent (that's seen by the bot) for the condition
<a href: "https://top.gg/bots/{bot_id}/vote"; target: "blank";>VOte for my bot</a>
i dont understand what u mean
like if the bot asks put a number from 1 - 10
then it would check if it is 1 - 10
wait_for waits for a message
and the function check
is called whenever a message is sent
if the function returned True, the code would go on
if not, the bot would keep waiting
ah
until it times out
maybe i could put https://top.gg/bots/{bot_id}/vote in an iframe and modify the size of the iframe and focus on the button
ok so i fixed that!
so now the problem is the next part
i say the name of the place i want to search
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.
so this is the new code
so now when i want to search a place
it automatically says that it is not a valid place and says the embed saying Noob next time mention a place
@slender thistle
@proven lantern i remember when my first bot got approved, there is a "widget" that you can add it to youre website, only add a href and probably thats it, or you can make yours from 0
because i want to pick 3 of the palces
places*
@slender thistle
use this link. i can edit the pastebin: https://pastebin.com/78VhQcWQ
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.
uhhhh
qwe
What
Why are you stringifying the message object
and not getting its .content property
You shouldn't just rely on stringifying everything
well, unless you are REALLY sure it will work
because discord.Message's __str__ doesn't return the content
alright
This is me calling str() on a Message object
nginx: [emerg] host not found in "*VPS IP here:443" of the "listen" directive in /etc/nginx/sites-enabled/cosmicbotlist.tk.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failed```ple help
ok @slender thistle
dont that just mean that there isnt a host
no
lmao why
fine
hey
How long does it take for my bot to get verified ?
4 weeks i think
4+ weels
ye
if str(searchedplace) == which_places[0] or str(searchedplace) == which_places[1] or str(searchedplace) == which_places[2]:
could just replace this with if searchedplace.content in which_places:
i was expecting like 1hr
oh
i did if searchedplace in which_places , forgot the .content
@left sentinel look at #logs
ok
look how many there are
every second a new one comes up or an edit appears
so it will take time
@slender thistle what next?
even after i respond with the correct one, it says that i have picked one that is not there
@left sentinel i have been w8ing for around 3 - 4 weeks
and my bot not been accepted yet...
@slender thistle even after i respond with the correct one, it says that i have picked one that is not there
ye
๐ญ
@left sentinel what language?
English
like what language did u code your bot in?
English
?
Wait do u mean program?
yes
lol
Ok i use discordjs
ah
saaame
and sometimes discord bot maker
no
no.
@left sentinel
wGAT
u want to look at my bot?
lol
Did you update the pastebin
shiv do you nginx ๐
dont forget to censor the url
i do >:(
So uhm... I host my bot on heroku, although my music commands don't work.
I added these buildpacks and tried
my music commands are made with youtube_dl and ffmpeg
when deploying it - it does install it on the build log
i would not use heroku to host a music bot
does it even work?
I see
I guess that feature will be left out then.
I made a bot which basically can do like a bit of everything. How can i host one though?
on a vps
if the search word does not exist, it gives an error like this on the console how do i solve this.
undefined:1
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Request._callback (C:\Users\axe12\Desktop\autimatic bot\commands\bilgi\minecraft_skin.js:34:21)
at Request.self.callback (C:\Users\axe12\Desktop\autimatic bot\node_modules\request\request.js:185:22)
at Request.emit (events.js:315:20)
at Request.<anonymous> (C:\Users\axe12\Desktop\autimatic bot\node_modules\request\request.js:1154:10)
at Request.emit (events.js:315:20)
at IncomingMessage.<anonymous> (C:\Users\axe12\Desktop\autimatic bot\node_modules\request\request.js:1076:12)
at Object.onceWrapper (events.js:421:28)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1220:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
if(!res)?
I'm using the api. can i do such a thing
Throwbin is a website where you can store text online for a set period of time.
https://api.mojang.com/users/profiles/minecraft/' + args[0]
if it doesn't match, i want to send a message back.
if(!res) would work iirc
not quite
youโd use the in operator
to check if it returns an error or the response expected if u made it good.. if that makes sense
then use try catch?
i used
You could try working with the HTTP status code
If the timestamp is not a number, too big or too small the HTTP status code 400 (Bad Request) is sent with an error message looking like this:```
if (status.code === 204) message.channel.send(error)
nginx: [emerg] host not found in "*VPS IP:443" of the "listen" directive in /etc/nginx/sites-enabled/peepeepoopoo.tk.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failed```pleas hep
Show us the config line
non censored url
shut
peepeepoopoo.tk.conf line 2
dice i fucking told you

ok brb
better
listen *104.243.32.11:443 ssl http2;```
pee pee poo poo lol
just listen to 443 ssl
listen 443 ssl;
okay
listen [::]:443 ssl http2;
```line 3
that http2 option at the end may work - never used it like that - Cloudflare does that for me 
mhm, IPv6 - Hold on
Ok no idea about IPV6 but that looks correct
just nginx listen 443 ssl or something
or does it error on that line?
we have cloudflare
yeah he has 2 entries for IPv4 and IPv6
listen 443 ssl - ipv4
listen [::]:443 ssl - ipv6
one question, why do people use cloudflare?
I use it to hide my IP addresses
And cloudflare is so big by now, you'll actually see a performance boost (load times)
iโve heard that it doesnโt make a difference, only worsens their site
never used it myself
The first thing is their widespread cache servers, you'll connect to your closest cloudflare server instead of to my server in france
if you live in the US for example you'll connect to a cloudflare server in the US, instead of travelling over to the EU which would give you 100ms+ pings
mmnm
@pure lion No work?
Then you have no caching
You still connect to cloudflare servers, but cache is disabled
no work
And Cloudflare doesn't care about that?
They only forward your connection, it's actually less performance loss for them
i doubt
still
no work
@pure lion Show us more of your config, line 1-5
ddos protection
^this is the best thing
etc etc
Yeah, true
as long as you leave the orange cloud on 
The best thing are those setups:
www and root domain are cloudflare protected
subdomain (server.) or something which points to the server, cloudflare off
And then they wonder how their IP gets leaked

That problem I wrote there is a convenience problem
mhm
Cloudflare only supports HTTP/HTTPS ports and wont redirect SSH traffic for example
@misty sigil @misty sigil @misty sigil @misty sigil @misty sigil @misty sigil @misty sigil @misty sigil @misty sigil
so if you want a neat server.mydomain.com that you use to connect to your SSH, it wont work
i almost fixed it
but im ratelimited
idiot
by certbot
certbot rate?- u are good
:D
gj Dice
so if you want a neat server.mydomain.com that you use to connect to your SSH, it wont work
@nimble kiln And if I don't use the domain for SSH?
I guess I shouldn't care?
If you dont need to reach your server directly over any domain then it doesnt matter
where do i put the root of the document :D
oop now I'm out
no
Only ever proxy passed with apache ๐ฆ
come back
Ok I'll try to help
yaaaaaaaaaaaaaaaaaaay
I'll find out at some point if anything is broken now ยฏ_(ใ)_/ยฏ
okay so
location / {
proxy_pass http://127.0.0.1:8080;
include nginxconfig.io/proxy.conf;
}
includes 
uwu
show the contents of proxy.conf? ๐
okay
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
# Proxy headers
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
# Proxy timeouts
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
yes
What happens when you visit your domain
does everything go up in flames? Or some HTTP errors?
ok nice
:)
maybe
is nginx-default-bla.html in that directory?
we're using express fyi
^^
oh express
hence the proxy pass
did nothing
show me your whole config for that domain
dont forget to remove the domain name ๐
yes
i wont
oh ok
its peepeepoopoo.tk
yeah ๐
server {
# listen *104.243.32.11:443 ssl http2;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name peepeepoopoo.tk;
# SSL
# ssl_certificate /etc/letsencrypt/live/peepeepoopoo.tk/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/peepeepoopoo.tk/privkey.pem;
# ssl_trusted_certificate /etc/letsencrypt/live/peepeepoopoo.tk/chain.pem;
# security
include nginxconfig.io/security.conf;
# logging
access_log /var/log/nginx/peepeepoopoo.tk.access.log;
error_log /var/log/nginx/peepeepoopoo.tk.error.log warn;
# reverse proxy
location / {
proxy_pass http://127.0.0.1:8080;
# include nginxconfig.io/proxy.conf;
}
# additional config
include nginxconfig.io/general.conf;
}
# subdomains redirect
server {
# listen *104.243.32.11:443 ssl http2;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name *.peepeepoopoo.tk;
# SSL
# ssl_certificate /etc/letsencrypt/live/peepeepoopoo.tk/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/peepeepoopoo.tk/privkey.pem;
# ssl_trusted_certificate /etc/letsencrypt/live/peepeepoopoo.tk/chain.pem;
# return 301 https://peepeepoopoo.tk$request_uri;
}
# HTTP redirect
server {
# listen *104.243.32.11:80;
listen 443 ssl http2;
listen [::]:80;
server_name .peepeepoopoo.tk;
include nginxconfig.io/letsencrypt.conf;
location / {
return 301 https://peepeepoopoo.tk$request_uri;
}
}
uh
kek
you're not accessing your domain over www.peepeepoopoo.tk, are you?
nope
good
what do
no >:(
i need them
okay
/var/log/nginx/peepeepoopoo.tk.error.log; too
empty
๐
Get me a teamviewer/anydesk session and let me click around, I can't help like this ๐
get rid of the proxy pass
and make it a proper domain first
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}```
let it point to a local directory with root - add an index.html file to the root directory with any content
eror?
not proxy passing
nginx: [warn] conflicting server name ".peepeepoopoo.tk" on 0.0.0.0:443, ignored
h
if you have certbot redirect enabled, disable CF HTTPS redirect
cant we just do full encrypt on cf?
what do you want to achieve
Do you want to not care about the certificate on your machine?
If you're using certbot, and keep renewing the certificates on your server, then yes. Use Full
we'll try both
actually
"Trusted CA or Cloudflare Origin CA"
LetsEncrypt is a Trusted CA i believe
So (strict) should work, my bad
Noice
what's is the preferred language for a bot? js or py ?
@warm prairie There is no preferred language, because it depends on your personal preference
I guess javascript is more widespread, so you'll find more examples online
If you like writing in python more, then go with python
I was looking to learn more python so was thinking of rewriting my bot in py
I tried the same and gave up 
Python is not a nice language in my opinion
same
I totally got used to JS by now, switching to python was hard
Their documentation also is.. special. (discord.py)
JavaScript is easy for beginners, Java is the most efficient and most used in the big bots (250k+ guilds)
My career is in JS (Typescript) development basically so I'm hope I like JS lol
JavaScript is easy for beginners, Java is the most efficient and most used in the big bots (250k+ guilds)
@twilit rapids that comma confuses me
You're talking about Java in the second half, or JavaScript?
xD
Java
ok good
really? most of the big bots are in Java?
It says Java not JavaScript
that's interesting
Groovy, Rythm, Hydra, Zerotwo, etc...
didn't even know discord had a Java SDK

jabbascuriputo
Hey, can someone help me real quick? It's about a bot running with python, I haven't worked on it in over a year and a half, it stopped working recently, I figured out the issue is with the discord.py thing being outdated, now it's giving me the error "AttributeError: module 'discord' has no attributes 'channel'" and I can't figure out how to fix it
No results for jabbascuriputo - Showing results for javascript 
lmao
scriptcoffee
@gentle wolf what are you trying to do?
scriptkiddy
how do i make it so that those who vote for my server get a role?
servers do not have an api yet
See the role rewards panel
ive seen some servers do it
Just
Get the bot running again?
He's supposed to just
React to stuff people say in the chat, send stuff into a certain channel etc
You're trying to do discord.channel somewhere
Yes!
@gentle wolf what was your previous discord.py version before you updated?
See the role rewards panel
@slender thistle wheres that
Server Edit page I believe
that might be the issue
0.16.12
there were big changes between 0.16 and 1.0
VEEERY big changes
Yeah probably!
What do I need to change discord.channel to for it to work? Or do I need to rework the whole bot?
even bigger than discord.js's v11 to v12
xD
you'll probably need to rework a major part of your bot
check their documentation and changes guide
There's a migration guide you could refer to
Great
Thank you tho!
Oh? I'll look for that
hey could somebody help me witth my not working filtering system.
i do have this
async function get_country_by_skytext(text) {
let countries = [result1[0].current] // list all your countries
let result = await get_data(countries);
return result.filter(entry => entry.current.skytext === text)
}
bot.on('message', message => {
if(message.content.startsWith(prefix + 'Sunny')) {
get_country_by_skytext('Sunny');```
it doesn't send me anything?
var current1 = result1[0].current; ```
this is the result1
where is result1 coming from tho
weather.find({search: 'Germany', degreeType: 'C'}, function(err, result1) {
if (err) message.channel.send(err)```
weather-js package
and you want to use weather.find only once and then always get results from the same search?
i actually do have 40 more countries

judging only by the pieces of code you provided, it shows a very wrong order of operations, would need to see more code to understand what is actually going on
used to it
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.
good luck
pastebin
error when user uses /skin <shaped text>.
if (response.statusCode === 204) {
^
TypeError: Cannot read property 'statusCode' of undefined
at Request._callback (C:\Users\axe12\Desktop\autimatic bot\commands\bilgi\minecraft_skin.js:28:24)
at self.callback (C:\Users\axe12\Desktop\autimatic bot\node_modules\request\request.js:185:22)
at Request.emit (events.js:315:20)
at Request.start (C:\Users\axe12\Desktop\autimatic bot\node_modules\request\request.js:753:10)
at Request.end (C:\Users\axe12\Desktop\autimatic bot\node_modules\request\request.js:1505:10)
at end (C:\Users\axe12\Desktop\autimatic bot\node_modules\request\request.js:564:14)
at Immediate.<anonymous> (C:\Users\axe12\Desktop\autimatic bot\node_modules\request\request.js:578:7)
at processImmediate (internal/timers.js:456:21)
C:\Users\axe12\Desktop\autimatic bot>```
DUDE
ex: [ฬฒฬ sฬฒฬ ][ฬฒฬ eฬฒฬ ][ฬฒฬ lฬฒฬ ][ฬฒฬ aฬฒฬ ][ฬฒฬ mฬฒฬ ]
erwin
i told you that i would learn and apply it to my own code
after i was done with filtering
this here is very very wrong
you should never have an event listener inside another event listener
what you should do, is define a certain amount of time for which these results are valid, and cache them accordingly
for example
How do I make sure that only English letters are used when using commands?
ex: a b c d e f g ...
but first, may i complete my filtering?
sorry daddy

this is the whole reason i was telling you two days ago to learn promisification
so you can await it and not deal with this callback hell
this has gone at least 20 steps over tho
calling it hell is an understatement
@eternal osprey here's how it should be done
- someone uses a weather command
- check if the results already exist in a variable
2a. if they do exist, check how old they are
2aa. if they are old, use the search function again and update the variable with newer results
2b. if they dont exist, use the search function and save the results in the variable - get the results from the variable
- send the response
this should be done using async functions and await
otherwise its impossible to get it done correctly
90% of your code can be reduced into less than 10 lines
using arrays, loops and async await
however weather-js is over 3 years old and doesnt support async await syntax, so you will need to promisify it
yes, keep going
if i see 2 callbacks or more, more than 10 variables, and more than 1 addField() method on your embed imm slap you irl
be warned
how to i make a ticket bot with discord.js
Promise.all([]) @eternal osprey
@dire obsidian as i was saying
const Discord = require ('discord.js');
const client = new Discord.Client();
const prefix = "=";
client.login('{my token}');
client.once('ready', () => {
console.log('Bot is now appearing online!');
client.user.setActivity('=help | TixxiTicket', { type: "WATCHING"})
});
client.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'help'){
message.channel.send('test')
} else if (command == 'ping'){
message.channel.send('Pong!')
}
});```
this is all i know how to do as i learnt today, but i want a ticket bot
oh, hmmm, i think you first need know more abaut that (discord.js)
why?
because i will not give you all the code
once i learned will you?
well, im not a profecional
as i say you can read the guide, see examples
but if you want learn, dont copy paste ok?
i know most of it and im not going to copy and paste
nice!
(text)[link]
that
as i remember
oh wait nvm
i dont remember xd
that doesn't work lol
xd let me
it's text
What exactly am I doing wrong here? Shouldnt this fetch the last 2 messages and do those reactions?
//eval
message.channel.messages.fetch({ limit: 2}).then(() => {Promise.all([
message.react(':apple:'),
message.react(':tangerine:'),
message.react(':grapes:'),
])})```
For now it only reacts on one message
@earnest phoenix tahnks, usually im kanda lost somethimes
how can i code a bot such that it takes an argument of a channel
and welcomes people in that channel?
in discordpy
please help
how i can to use nitro emojis in my bot
?
<:emoji:id> where emoji is the name of the emoji and id is the emoji id
then your bot doesn't share the server with the emoji
how i can do it
do what


