#development
1 messages · Page 1398 of 1
What kind of uses does R have
@frank crescent if you just want to code in python I'd recommend pycharm but if you wanna learn other languages like Golang java c or js keep using vscode
I do plan to learn other languages
And I was actually thinking of switching to
Atom
Atom is like vscode
With multiple language support via plugins
why is my bot not approved
how can i make it approved
because it hasn't been approved yet
but how do i approve it
it can take a while. a mod reviews it
This guy
ah ok
you'll need to be patient
setInterval(() => {
const tdvApi = require('tradingview-scraper');
const tv = new tdvApi.TradingViewAPI();
var array = ['719362069975138354', '331222209299349504']
async function alertPrice() {tv.getTicker("aapl")}
alertPrice().then((resp) => {
for (var i = 0; i < array.length; i++) {
console.log(resp)
console.log(array[i]);
}
});
}, 5000);``` resp is returning as undefined please help i dont know what else to ask
Do you have the error message
and that's not solving the issue I pointed out originally
because you don't return anything. An async function is going to return a Promise
The value in this context will just be undefined
@frank crescent if you want to backup your code or make it so that you can code your bot anywhere put your bot onto a private github repo
What's that
a good question to ask is: why
ay thanks g i got it working 🤝
I keep back ups of my code
So generally
What would you guys say is a good next step for me as a python programmer
B]
No problem, but the original issue with your problem was with promises and resolving on time. To solve this, I suggested you use async/await like this: js setInterval(async () => { for (...) { let resp = await tv.getTicker("appl"); // resp will be the value of what the promise holds. // ... } }, 5000)
4 Slice, in my opinion, if you already know Python, put your knowledge to the test by working on whatever project you're working on. If you know it, but still want some help, look at some resources to learn it, like the three I gave above. You should focus on what's relevant right now rather than what's relevant later because you'll eventually get there.
thank you for your time and help dude
I have a question?
what are some good commands that can help make people want to use our bot?
That's more of an issue with what you want your bot to be about rather than how to get people to use your bot. None of us are analytics, but at most, we can say you need to make something unique and a good way of presenting it to users.
Is it possible to profit from a bot
yes
But what about a bot itself
Yeah but the revenue comes from the extra perks you'd need to buy
Yeah
Yes. If you have some way of a user making transactions and the user wants to, you make money off it.
probably not discord.
Pygame is pog
Why is pygame so pog
it's also used as anything
it's a universal language
you can pretty much do anything with it nowadays
So why learn other languages?
not everything
Python gang ✊
It's about choosing the right tool for the job.
if you really want to you can use python for everything but every language has its advantages and disadvantages
JavaScript is very popular as well but sucks in a lot of departments.
same applies to any language with bindings
some languages are better for certain things
the i/o event driven infra of nodejs made it really popular as a backend web server
see python a lot more popular in client sided apps
Can someone summarise json to me quickly
Yeh
My guy Jason
Sometimes json is used as a config file oh god fuck Minecraft config json files
i found it odd that they use json files quite often
i mean nothing wrong with it but just a bit unusual
for a program like that
@frank crescent basically Minecraft datapacks uses json files to mod the game
and Minecraft forge mods uses either yml, cfg or a json
Gn Toaster

😦

how do i make my bot send a message when it gets invited into a server
do kinda like
Thanks for inviting me. blah blah
guildCreate event
mmmk ty
Don’t u sleep sometimes Tim?

its 2:15 am here
Well have a good one
Before my code was running but I put what's green and it doesn't do anything anymore, I don't know what to do, suggestions?
actually is a bit more complicated
collected.first().users.cache.first()
but it wont work if your bot already reacted
Hablas español?
you'll likely need to collected.first().users.cache.find(user => user.id !== client.user.id)
no
How often do you guys see people trying to get the user count for their bot nowadays?
hmm?
Before privileged intents for members
oh user count?
Yeah
I mean, anytime someone brings it up, I tell them it's against the ToS and not to do it and they won't get any help with it - that's the only valid response.
I'd imagine pretty often
lmao i see tons of people complaining about how their user count is suddenly wrong
even on discord.js's github
Oh! Sorry i missed that edit
I was confused initially as well. When my bot got verified, I'm pretty sure they declined my privileged intent request just so I can list users by niceness. They basically told me to just store it in my database :P
You don't need privileged intents to get a member or user count.
Which makes sense, easier on discord
guild.memberCount still exists, just wont be updated without server members
I'm not sure what you mean by that.
but you can fetch it.
How can i do what a message be deleted after 3 seconds of my bot?
how can i rank a mongodb database
like get a list of the user's by sorting thru the guild id?
the one you get at login
sounds like there wouldn't be much difference in the end
the difference is mostly irrelevant, but its still a difference xd
You have got to be seriously obsessed with insignificant details if that difference is relevant to you.
yup
but memberCount will remain unupdated in the long run
you need to fetch approximateCount periodically and use it instead
async def ping(ctx):
await ctx.send("Pong!")(latency = float)``` it works but it only says pong and no latency
theres no errors being shown either
lol
i go sleep now for real
Bb
async def ping(ctx):
await ctx.send("Pong!")(latency = float)```
it works but it only says pong and no latency
theres no errors being shown either
did i miss something?
How about adding the latency inside your send() function? 
"coding is easy"
Fuck off
😆
lol
Hey guys!
I wanna ask a question
Cus someone is asking that
Can we use apps to make bots and verify it on top.gg?
What do you mean "use apps" ?
yes you can
Do you think that the bots using Bot designer for discord will get verified in top.gg?
I don't think so
It will if you actually write commands and content for it. But if all you do is make a clone of the default app and submit it, it'll be denied because what would even be the damn point?
Any recommendations on an API to use to get the current weather conditions of an area?
const client = new discord.Client();
client.on('ready', message => {
console.log('I am ready')
})
client.on('message',message =>
if(message.content === '+ping')
message.channel.send('Hi, You pinged me?')
}
})```
I added this code..but id why the bot isn't coming online..whenever I start code..the bot comes online..but nto this time..
do you even have a client.login() line?
I saved the file...and the bot is still offline
Did you run the file?
It doesn't as that I guess...And, I just started making bots a day ago!
Note that glitch is not an appropriate place to host bots as you cannot maintain them there 24/7
Yes..name is index.js only!
Ahhhhh
Ok...I'll figure something out! Thx for help!
Someone tag me when they respond to this
👍
Is there anything wrong with all of these? https://www.google.com/search?q=API+to+use+to+get+the+current+weather+conditions+of+an+area
It’s a search, not a recommendation
So.. what you're saying is, you don't want to bother doing any research or testing on your own.
openweathermap is fine. It's recommended... literally by the search algorithm of google.
I would rather use one that has been tested by other developers by Discord and has proven to work
If they're on the front page of google search, they've actually been proven to work.
Many of the popular ones actually work /shrug
And "other developers on Discord" isn't relevant - the fact that you're doing this from Discord has no impact on the quality of the results you'd get from an API.
Well, it’s my second API
The first one worked flawlessly and I would like to keep that streak going
Sorry that I want to be careful
No you want others to be careful for you, and trust their word over actually testing things yourself.
why would you trust other random devs over your own data?
Seriously though, openweathermap is a great API
It's not at the top of the results by chance, y'know.
I hear the accuweather api is fantastic.
let channeMen = message.guild.channels.cache.find((x) => (x.name === "general")) // Let the bot send the embed to channel called general.
How do I prevent the bot from sending it if there's 2 channel with the name general?
Instead of using .find, use .filter and check if the .size (.filter returns a new collection, so it has a size property) is equal to 2.
If you'd like to save on a bit of performance, you could short-circuit it by making it stop as soon as you find two channels (save a variable and increment it for each pass, see if a second one passes and break).
Hi im new at bots and coding and can someone help me with the script whenever i try to run it "SyntaxError: Identifier 'Discord' has already been declared" can someone help?
are you declaring Discord twice?
How if the channel is more than 2, like it's 5+ 🤔
Then filter every channel and check if the .size is equal to N (N representing the number of channels it should be, like 5)
a declaration looks like this.
const Variable = 0;
^ are you doing something something like this twice for Discord.
@earnest phoenix
uuuh lemme check
Alright, thanks
@solemn latch like this "const Discord"
yeah
if not idk
oh yea
you can only declare something once
do you have a third declaration?
lol, are you copy pasting code from somewhere?
ah
and im confused 
are you also declaring Discord multiple times?
discord and Discord are separate variables
What is your issues you got?
I need help with my bot. This is my first bot and when i try to run it "SyntaxError: Identifier 'Discord' has already been declared" pops up
@steep sun
You're using discord.js right?
yep
Did you find anything in your code like:
const Discord = require("discord.js")
const Discord = require("discord.js")
I had 4 but deleted 3
Does it still shows some errors?
is message.channel.delete valid in d.js v12?
idk
Does your bot goes online?
Maybe yes
You can search up for them in the npm website
@hazy sparrow No, use message.delete();
I do it
But nothing good unu
Well, maybe there isn't...
that deletes the message, not the channel
What you wanna exactly do?
i wanna make a command which deletes a channel and remakes it with the same topic, permissions, etc but i cant find how to delete the channel
Yes, but it depends on what .channel is.
Yes
does djs have a clone method?
Is it a TextChannel? Yes, you can delete it.
I don't think so (maybe). What do you need to clone for?
But he wanna restore it
yeah text channel obv
oh I see
It does have a .clone method: https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=clone
i just wanted to ask how to delete a text channel
so its just message.channel.delete?
@hazy sparrow
In this video we go over how to create a delete channel command. We also cover how you can make voice channels automatically create and delete themselves depending on how users join them.
🖥️ Source code:
http://wornoffkeys.com/github/Worn-Off-Keys-Discord-Js?from=_nAg4efu0hs
📺 Discord.JS Playlist:
https://www.youtube.com/playlist?list=PLaxxQQa...
See that one
thanks!
No problem
@earnest phoenix have you ctrl S
yes
LOOKING FOR A Bot Web Developer, I Have A Large Bot But Need a Website DM me or reply to this!

One message removed from a suspended account.
let chx = db.get(`welchannel_${member.guild.id}`);
let msx = db.get(`welmessage_${member.guild.id}`);
let data = canva.welcome(member, { link: "https://wallpapercave.com/wp/wp5128415.jpg" })
if (!chx || chx === undefined)
return;
const attachment = new Discord.MessageAttachment(
data,
"welcome-image.png"
);
client.channels.cache.get(msx).send(msx,attachment)
}
);
hi
pls
help
client.channels.cache.get(chx).send(msx,attachment)
^
pls

pls
it is
😶
in certain cases the interpreter can get confused where you want to end the line if you're not using them
happened here before
which obviously messes up your logic flow and potentially gives you a mental breakdown
Hey, I have
.whole-thing {
background-color: '3E3B3B';
color: 'white';
font-family: 'Oswald', sans-serif;
}```
And ```html
<div class='whole-thing'>
//stuff here
</div>```
But the background color isn't applied and nor is the text color, anyone know why?
id: [id1, id2]
I gave you the general idea. Now, whether to use it should be judged by you
hey, i need help with https://www.battlemetrics.com/developers/documentation#link-GET-player-/players
headers: {
"Authorization": "Bearer "
},
}, (error, response, body) => {
console.error('error:', error);
console.log('statusCode:', response && response.statusCode);
console.log(JSON.parse(body).data)
})
```
this is my current code. How do I add additional parameters?
right
what's the prob?
I think.... you can add parameters but it hasn't no function
(Sorry for my en, im not english)
ehm, what do you mean by it hasn't no function?
I have asked this question several times. I have been stuck now for almost a week. Still can’t figure out this problem:
https://hatebin.com/knkauwpabw
look at the code, line 52. TypeError: Cannot read property 'toLowerCase' of undefined
I have logged everything for the people asking
console log options.name then tell me whats the result
(if you have logged, show previous one)
okay I will do it when I am on pc, and then I will show everything
hello
does anyone know how i can put this error instead of except statement
raise CommandOnCooldown(bucket, retry_after)
discord.ext.commands.errors.CommandOnCooldown: You are on cooldown. Try again in 86397.04s
except CommandOnCooldown: isnt working
except discord.ext.commands.errors.CommandOnCooldown: isnt working either
hey,
idk if this is the related channel but i have a question:
'Detailed description of your bot' part in add bot, i have pasted my python code, is this what to do?
if it is, indentation sucks, will it work anyways?
Anyone know how to make a rob command?
wdym, like a bank bot?
i need help to bot me
If you wanted to use a bot, what fun commands would you want to use?
!getrect <user>
please help me to settings bot me
do you mean bank bot?
is that english?
Yes
can i get to know how to make regxp for special character's
yes
well u need to create a bank interface where the money of every user is stored(text file etc.), and what language btw
English
then u need a randomizer that gives True or False
no i mean coding language
and you must edit that text file
umm.. hello?
Hello
what coding language
BDScript
ive never heard of that but nvm,
u need to create a bank interface where the money of every user is stored(text file etc.),
then u need to edit the money values according to what user they are robbing(like !rob Justaknightoof, -5$ from justaknightoof and +5$ to 111nk111 etc.)
'Detailed description of your bot' part in add bot, i have pasted my python code, is this what to do?
if it is, indentation sucks, will it work anyways?
anyone gonna answer?
no
Detailed description of your bot doesn't mean your code lol
It mean to explain what your bot did, and how to use it and stuff
well i saw the numbered lines and stuff so i pasted code lmao
you can use markdown on your detailed description
can i get to know how to make regxp for special character's!
Is it possible to change background colour of a bot description using css?
@junior wharf you have to keep bot online lol
And is it possible to make gradient animation in a bot description?
oh man thats a big f
my day is ruined
sad pig noises
i dont think so, discord has an app and css wont work in there
bu if u mean gif/emoji
then yes
Xddd
hey @torpid whale
I have asked this question several times. I have been stuck now for almost a week. Still can’t figure out this problem:
https://hatebin.com/knkauwpabw
look at the code, line 52. TypeError: Cannot read property 'toLowerCase' of undefined
this was the question
i am logging it right now. Sorry i was eating.
How to do
options.name is undefined
why does message.channel.send(message.guild.owner)
Return me with null sometimes.
Inserting bot token...
Anyone?
2020-11-21T10:50:19.489473+00:00 app[worker.1]: Traceback (most recent call last):
2020-11-21T10:50:19.489485+00:00 app[worker.1]: File "bot.py", line 166, in <module>
2020-11-21T10:50:19.489676+00:00 app[worker.1]: client.load_extension(f'cogs.{filename[:-3]}')
2020-11-21T10:50:19.489679+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 664, in load_extension
2020-11-21T10:50:19.489925+00:00 app[worker.1]: self._load_from_module_spec(spec, name)
2020-11-21T10:50:19.489927+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 624, in _load_from_module_spec
2020-11-21T10:50:19.490168+00:00 app[worker.1]: raise errors.ExtensionFailed(key, e) from e
2020-11-21T10:50:19.490188+00:00 app[worker.1]: discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.Moder' raised an error: TypeError: __init__() missing 1 required positional argument: 'client'
help me
guys
@earnest phoenix don't interrupt someone's question.
for fuck sakes wait for your turn
Oh so should i save it in a variable first and then send the message?
¯\_(ツ)_/¯
@earnest phoenix yeah exactly
Like
`let owner = message.guild.owner;
message.channel.send(owner)`
K thank you
2020-11-21T10:50:19.489473+00:00 app[worker.1]: Traceback (most recent call last):
2020-11-21T10:50:19.489485+00:00 app[worker.1]: File "bot.py", line 166, in <module>
2020-11-21T10:50:19.489676+00:00 app[worker.1]: client.load_extension(f'cogs.{filename[:-3]}')
2020-11-21T10:50:19.489679+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 664, in load_extension
2020-11-21T10:50:19.489925+00:00 app[worker.1]: self._load_from_module_spec(spec, name)
2020-11-21T10:50:19.489927+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 624, in _load_from_module_spec
2020-11-21T10:50:19.490168+00:00 app[worker.1]: raise errors.ExtensionFailed(key, e) from e
2020-11-21T10:50:19.490188+00:00 app[worker.1]: discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.Moder' raised an error: TypeError: __init__() missing 1 required positional argument: 'client'
help
me
only russian
@earnest phoenix no-one is going to
Check line 166 in your bot.py file
166 client.load_extension(f'cogs.{filename[:-3]}')
/([^A-Za-z0-9]+)/g includes any char which isn’t a letter or number even a whitespace
I have asked this question several times. I have been stuck now for almost a week. Still can’t figure out this problem:
https://hatebin.com/knkauwpabw
look at the code, line 52. TypeError: Cannot read property 'toLowerCase' of undefined```
ty
options.name returns undefined once i log it
Is args defined?
Ok
What’s happening here then?
@eternal osprey what line on the link, line 52 is an event
@eternal osprey options is an array not an object
is there a good way of .catch()ing errors within synchronous functions in javascript
options[0].level exists as property but not options.level
i am stuck at the name.options
hm alright
You declared options on top of your script being an array of two objects
hmm a bot just dmed me
lmao
whahaha lol
That’s the reason why disabling DM is an option, an important one
it only dmed once tho
lel
ye doesnt dm anymore
if the bot leaves a server (not kicked), will the guildDelete event be called?
if you broadcast eval with a sharding manager with kurasuta can you only use variables defined in the function? like can i do this ```js
let h = true
broadcastEval(client => h ? client.users.cache.size : 0)
not iirc, use broadcastEval and declare the variable there
okay just making sure
also does anyone know the difference between the different api versions?
like if i switch from v7 to v8 would anything bad happen
Yeah anytime the bot leaves a guild
No matter how
hmm, then the <Guild>.me must be null
in js
guild.me will still exist
because djs only deletes the guild from the cache after a small delay
The event just includes the guild ID which the bot has left
can u help me
i send the code in a txt file
heck i have token in that file
i deleted
lmao
regenerated
not just guild id though, but the guild itself
discord sends you the guild id in the event, but discord.js will give you the full guild instance from the cache
Which API wrapper should I use for a bot I need to write? My options rn are some JS wrapper (probably discord js), discordgo, or serenity-rs
@turbid parcel the one in the language you are most comfortable in
Well dunno about djs but as I said you will receive the ID only by the API
dm me and help me i got an error plssssss
what is the error
plss
lmao
lol
bruh i got other error
,.,.,..,,.
¯_(ツ)_/¯
in vsc i have 0 problems
but when i start the bot i got this err
install a linter bro, you're messing with the syntax itself
must i add a ;?
may or may not be
i have alerady added a ;
Why does my bot take a long time to connect?
error Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.
Depends on the context.
Do you call the function play() or declaring it?
@open flicker do you have fetchAllMembers:true?
yes
let args = message.content.substring(PREFIX.length).split(" ");
switch (args[0]) {
case 'play':
function play(connection, message){
var server = servers[message.guild.id];
server.dispatcher = connection.playStream(ytdl(server.queue[0], {filter: "audioonly"}));
server.queue.shift();
server.dispatcher.on("end", function(){
if(server.queue[0]){
play(connection, message);
}else {
connection.disconnect();
}
});
}
if(!args[1]){
message.channel.send("You Need To Provide A Link")
return;
}
if(!message.member.voiceChannel){
message.channel.send("You Must Connect To A Voice Channel To Play")
return;
}
if(!servers[message.guild.id]) servers[message.guild.id] = {
queue: []
}
var server = servers[message.guild.id];
server.queue.push(args[1]);
if(!message.guild.voiceConnection) message.member.voiceChannel.join().then(fuction(connection),{
play(connection, messaget);
})
break;
}
})
bot.login(token);
do you have server members enabled in the dev portal?
do you have GUILD_MEMBERS intent enabled if you're using intents?
@high spear $serverCount
Ty
Np
@glad violet
remove this comma
i will got an error if i remove
but if I remove fetchAllMembers: true then I do not have the correct statistics in serverinfo
Gonna stop using this clear command, here it is if someone wants to use it
feel free
ok
@glad violet the comma is wrong, but what you wrote is also wrong
you wrote fuction
instead of function
its message not messaget 😕
oups
xd
but again the same problem
YES IT WORKS NOW
i do it function and deleted the comma
and no more errors
BRUHHHH now i got this
no in the description you can only use html and markdown
@sterile ridge https://shields.io/category/build
We serve fast and scalable informational images as badges
for GitHub, Travis CI, Jenkins, WordPress and many more services. Use them to
track the state of your projects, or for promotional purposes.
hes talking about server count lol
thanks
um
on the top.gg page
yes
server count on top.gg
using the top.gg api
nothing to do with description
yeah lol
ok
wtf is that url
lmao
BRO I GOT THIS ERROR
Idk who’s creating such ugly params
@glad violet install it
well u haven't instaled it
client.on("guildCreate", async guild => {
let finalowner = guild.owner;
const helpembed3 = new Discord.MessageEmbed()
.setColor("GREEN")
.setTitle(`Thanks For adding me in ${guild.name}`)
.addField(
"Need Support?",
"[My Support Server]()"
)
.addField(
`Wanna know everything about me?`,
"[My Website]()"
)
.addField(
"Wanna know my commands?",
"[My Command List]()"
)
.addField(
`Love me :love:!`,
"[Upvote me on top.gg!]()"
)
finalowner.send(helpembed3);
})```
Why error
how?
@glad violet npm install ytdl-core
@glad violet go to package.json and press on add package
then write the name out ytdl-core
hes not using glitch/replit
oh my bad i tho it was glitch
what's the problem?
can I use something else instead of fetchAllMembers?
depends, what do you need?
when i type &play bot crashes and throw this err
@glad violet
oh no no, no copy and paste, change the message to msg
i need all users from a specific server and show them in serverinfo
cuz otherwise it isn't defined
Just a quick question related to the top.gg website - what is the css value we have to change to edit our bot's page's background colour/image?
@glad violet message.member.voice.channel
i have it !message.member.voiceChannel
@sinful cloud right click the area you want to edit, inspect element
look into the existing css values for that and edit those
@glad violet voiceChannel is old and outdated
its voice.channel now
yep i found it, thanks man
ok
bro tim you're on a development helping spree
im bored
Hi bored
it joins in the voice channel but it dont play music and i got this message in cmd
you should stop following outdated tutorials
playStream was removed like 2 years ago
its connection.play()
ffmpeg isn't a npm module i think
Did you install ffmpeg (not the js module)
yes
...........
Why would we ask you to install it if it has malware
^^
how to votelock a command
100%
100 what ?
install ffmpeg 100%
lets test the bot
oh
votelock? Try to explain
bruh i must do npm install opus
@discordjs/opus
@delicate shore votelock plss
there is opus
@discord. js/opus ig
oh no
wow
why it pinged
im sorry.. not intended
@discord. js/opus
ig
without dot ig
oh
@discordjs/opus
Try once again to explain
Understandable this time
On the website yes
but others (who didnt vote) cannot use the command
Ah okay
bro it is
@discordjs/opus and opus
we (devs) lock the command only for voters
reading api docs blew my brain so my brain ded
An exclusive command just for voters would have been a good explanation
But I got it
oof
im not that good in english
my first language is different
sorry
Well then you have to use a webhook service for example to receive a request if someone has voted and then store the user id in a database for example
excuse me?
nah
thats a selfbot embed
its white
not blu
@drowsy sentinel #development message go brr
How do you know tho
i couldnt copy the text on mobile
Yup
I'm pretty sure it's an embed generator.
I took the time to dip my feet in the pit of hell using inspect element and found this link: https://rauf.wtf/embed/Click+Here+To+Make+An+Embed?&author=Rauf%27s+Embed+Generator&color=04FFF3&url=https://test.rauf.workers.dev/
yea
though I feel it should be discouraged as it's hard enough to tell
any yt tutorials pls my brain cells ded
tutorials... lmao
thats actually smart
i sitting at pc from 23 hrs straight cuz of programming
the website generates og data that discord uses to generate web embeds
the embed above (#development message) is definitely a self bot embed
i can generate a similar embed: https://embed.rauf.wtf/thxxxxxxxxxxx?&color=F90606
but its blue titled
so that is definitely a selfbot.
yes that one's a selfbot
I might be blind
hello so im trying to make eject cmd like in among us and when i mention someone with 2 part name it split up, and link doesnt work when it split out
https://vacefron.nl/api/ejected?name=Among Us&impostor=false&crewmate=white
message.channel.send(https://vacefron.nl/api/ejected?name=${user.username}&impostor=${imposter[index]}&crewmate=${colors[index2]});
this is code
how to fix that then
There's probably a URL encoding utility in whatever language you're using
Otherwise, you could just replace space with +
encodeURI()
what
`const imposter = ["true", "false"];
const colors = ["brown", "blue", "yellow", "cyan", "red", "white"];
module.exports = {
name: 'eject',
description: "this is a eject command!",
execute(client, message, args){
const index = Math.floor(Math.random() * (imposter.length - 1) + 1);
const index2 = Math.floor(Math.random() * (colors.length - 1) + 1);
let user = message.mentions.users.first() || message.member.displayName;
if (!user) {
return message.channel.send('Who do you want to eject from ship?');
}
message.delete()
message.channel.send(https://vacefron.nl/api/ejected?name=${user.username}&impostor=${imposter[index]}&crewmate=${colors[index2]});
}
}`
what to do
now
to fix
that
Encode the string
still
But yeah
Just URL encode all your inputs
I'm sure you can stackoverflow it if you can't figure out how
i want that bot
'
message.channel.send(`https://vacefron.nl/api/ejected?name=${user.username}&impostor=${imposter[index]}&crewmate=${colors[index2]}`);
``` here

🐒
Because your name is weirder

huh
once again: encodeURI(string)
No
pls
No unicodes
?
oh wait nvm it's not you
🙂
const botid = ["763418289689985035","@ember harbor,<!@763418289689985035>"]
if(botid.some(word => message.content.includes(word))){
message.channel.send(`Hey there ! I think I just got mentioned , or atleast my ID did XD. Anyway , My prefix for this server is ${prefix} . ${prefix}help for my commands`)
}
My bot still doesn't respond
are u trying to get response on Bot mention?
Yes
if (message.mentions.has(bot.user)) { }
message.mentions.has(bot.user) || message.content.includes(bot.user.id)
let res = await afetch("https://nycpokemap.com/raids.php?time=" + new Date().valueOf())
let data = await res.json();
const getName = id => nameList.filter(el => el.i === id)[0].n;
let raids = data.raids.filter(raid => getName(raid.pokemon_id).toLowerCase() === options.name.toLowerCase() && raid.level >= (options.level ? options.level : 5))
const reactionEmoji1 = message.guild.emojis.cache.find(emoji => emoji.name === 'valor');
const reactionEmoji2 = message.guild.emojis.cache.find(emoji => emoji.name === 'mystic');
const reactionEmoji3 = message.guild.emojis.cache.find(emoji => emoji.name === 'instinct');```TypeError: Cannot read property 'toLowerCase' of undefined
huh
Told you your issue already
Options is an array of objects which means you can’t access options.name since it doesn’t exist
huh really?
orry i did not see that!
try to do
message.channel.send.string.toLowerCase
https://mystb.in/GordonSlowlyShare.python
I got this error :
if not None in resultbypass or resultbypass[0] :
TypeError : argument of type 'NoneType' is not iterable
Can anyone help me to solve this ?
string.toLowerCase
@glad violet what does that have to do with my code
wait
okay thx
also resultbypass is None
let res = await afetch("https://nycpokemap.com/raids.php?time=" + new Date().valueOf())
let data = await res.json();
const getName = id => nameList.filter(el => el.i === id)[0].n;
let raids = data.raids.filter(raid => getName(raid.pokemon_id).string.toLowerCase() === options.name.toLowerCase() && raid.level >= (options.level ? options.level : 5))
const reactionEmoji1 = message.guild.emojis.cache.find(emoji => emoji.name === 'valor');
const reactionEmoji2 = message.guild.emojis.cache.find(emoji => emoji.name === 'mystic');
const reactionEmoji3 = message.guild.emojis.cache.find(emoji => emoji.name === 'instinct');
replace the code with this @eternal osprey
resultbypass is a tuple @slender thistle
make a backup first
but why using .string
You need to specifiy the key if options still needs to be an array, e.g. options[0].level would exist as property
Clearly not, seeing that error
You provided the full code earlier
yeah
I saw options in an array of objects
const options = commandLineArgs([
{ name: "level", alias: "l", type: Number },
{ name: "name", alias: "n", type: String }
])
``` this yeah
Thus a property options.name does not exist
Which means it’s an array
Yeah
Not an object inside an object what you actually tried to do
use .string to work
@glad violet no
it has nothing to do with that
i actually tried it but it does not work.
aha
in your case
Nah just create an object not an array
try .string()toLowerCase
(node:2632) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'name' of undefined
What the fuck
?
wut
let raids = data.raids.filter(raid => getName(raid.pokemon_id).toLowerCase() === options[0].name.toLowerCase() && raid.level >= (options[0].level ? options[0].level : 5))```
'String'.toLowerCase() // 'string'
ok
Please tell me where .string()toLowerCase is helpful
or where it will actually work

yeah i am just getting confused more by @glad violet
..........
Dunno what the function commandLineArgs does
Just console.log(options) please to see how you can access it
yeah that'strange
Means there’s something wrong with your const options
At least with the function I mentioned
yeah
why do u even use command-line-args?
So what does commandLineArgs actually looks like
Why don’t u just split your message and use the result (array) as arguments?
hmm uhh okay
could you give an example on how that would look
because what mesage should i split>
Well just splitting the message.content
but i am not sending any message at the beginning?
or wait
you mean after the command call
if (message.content = "!raids") {
That must be part of your command
gotcha
yeah why?
but i can also call using --name egg --level 6
would start the function too
What a weird command handler
how i can download a video of youtube and send the file in .mp4? 🤔
thats not a command handler, thats his commandLineArgs
its not options.name in your case its args[]
sorry what
Obviously I’m speaking about the command handler and not the arguments, but thanks for the useless comment
Oh enabling my magic glass ball, yeah I can see this now too
@earnest phoenix brother don't interrupt someones questions. Please.
just wait for your turn
yeah but now i lost the fucking conversation
in your collected cb :3
who
you
bro shut the fuck uo
?


