#development
1 messages · Page 782 of 1
I can put more equals if you want
i am right clicking the emoji column nothing is popping up
then Zerp you would have to post the emoji and manually copy it
but i can't post it because it's a gif emoji and i don't have nitro
you could always have someone post it for you
can you do it?
I do not have nitro. Nor do I want to spend 10 dollars a month for it, if someone in ur server does then they can do it
any1 have nitro and wanna post a random emoji from my test server?
get your client to post it for you
bot
but i need the emoji id to use it
is that discord.js syntax?
how can I relocate words in string? for example:
February 2 => 2 February
can I have the full line of that code?
String.split(" ").reverse().join(" ")

because of its
or nott
it cant be changed.
@grizzled raven that is completly reversing the string
i can't find anything related to "find" in the documentation
no its not
bruh
Hello world, how are you => you are how world, Hello
@obtuse wind well what does that bring
when u got more than 2 words that gets to a problem
Dont have more than 2 words
well all he asked was to reverse that string specifically
Alright
if he wanted more, he couldve specified more
@uneven wyvern it is a bit more efficient, sometimes if you just have message.channel.send(embed); it says your embed is empty and cannot be sent.
client.emojis.find(e => Function)
where does is it in the documentation?
let emote1 = bot.emojis.find(e => e.name === `emote name`)
console.log(`${emote1} has been found`)
try that
are you in discord stable?
"discord.js": "11.5.1",
let server01 = bot.guilds.find(s => s.name === `server name`)
let emote01 = server01.emojis.find(e => e.name === `emote name`)
console.log(`${emote01} has been found???`)
try something like that and see if you can find the emoji
because bot.emojis will only map it
i think i got it
lemme test to see if i can send it in chat with my bot
oh
really?
the "a" too ? :ppHop:
let server01 = bot.guilds.find(s => s.name === `server name`)
let emote01 = server01.emojis.find(e => e.name === `emote name`)
console.log(`${emote01} has been found???`);
message.channel.send(`Aloha, ${emote01} how are you today???`)
like something like that if you put it in a command
yeah copy those numbers
animated
ahh
@everyone can someone send me a discord.js file for a music bot
@fervent osprey Read the rules
also dont try @ everyone
and dont beg for code
ty

i wasn't beging for nout mate just asking for some help as im new to java and python wasnt expecting to be spoon fed either just some help would be much appreciated
send me a discord.js file for a music bot
that is not asking for help
that is asking for code
hmm what's the scope of that function @obtuse wind
i also advise not doing a discord bot when your new to the language
can i store the value into a var?
like
var emote = {emote01}
wait nvm
just need to make let -> var
or not
ive already done a few
huh
oh I would help further but I just got on work
I'll have to help you program later, just DM me @earnest phoenix
cough
anyone have a plan how to get the emoji from other servers ? i talk about a command like "?biggeremoji EMOJI FROM OTHER SERVER" ?
and how to get the emoji id?
but from args? 🤔
you would have to make an emoji regex or something like that
you dont have to have an extension iirc
just the id alone will return the correct format in the cdn url
oh ok
and here's a tag from discord.js about emoji regex
Regular expressions to parse Emojis:
Unicode: https://github.com/twitter/twemoji/blob/v12.0.1/2/twemoji.js#L228
Custom:/<?(a)?:?(\w{2,32}):(\d{17,19})>?/https://discordapp.com/developers/docs/reference#message-formatting
if (emoji.animated == true) {
embed.setImage(`https://cdn.discordapp.com/emojis/${emoji.id}.gif`)
message.channel.send(`animated`)
}
if (emoji.animated == false) {
embed.setImage(`https://cdn.discordapp.com/emojis/${emoji.id}.png`)
message.channel.send(`Not animated`)
//}
message.channel.send(embed)
``` this just works for guild emojis
Discord.Util.parseEmoji("emoji")
var emojiid = args[0].split(":")[2]; // only get ID part from emoji
if (emojiid == undefined){
return message.reply("An error occur while executing. this emoji is a default / non knowed emoji")
}
emojiid = emojiid.replace('>', "")
var emojiname = args[0].split(":")[1]; // only get ID part from emoji
//emojiid = emojiid.replace('>', "")
console.log(emojiid)
var embed = new MessageEmbed()
.setTitle(`Emoji got! name from the emoji is: ${emojiname}`)
.setColor("GREEN")
.setTimestamp()
.setImage(`https://cdn.discordapp.com/emojis/${emojiid}.png`)
message.channel.send(embed)
``` worked good. but bcs the default emojis (🤔) Cant be get and return an undefined i made the if.
is there anyway to generate a url invite link for your bot using the discord.js library?
yeah
there is nothing to generate
well i didn't really mean generate, but rather just fetch a url
like discordapp.com/oauth2/authorize?client_id=<id>&permissions=<number>&scope=bot
quite literally put your client id in a invite link and you're done
@lean palm yes
LOL how convenient, docs are so helpful
confused how i didn't see that earlier lol
Which should I use to create a bot, Eris or discord.js?
whatever you want
Like, which has more features and better interaction?
in my opinion, discord.js
Also, can discord.js download videos then play them using YTDL, or does it only allow streams?
you plan to use ytdl (youtube downloader) to play videos and discord.js (a discord api wrapper) to download them 
I'm making a music bot here.
Not my point, but ok
discord.js allows music files, if thats what you're asking
and ytdl should support downloading (i mean, just pipe the stream to a file)
You need FFMPEG for a music bot ytdl-core and something else
sanity
How can I make the bot react to a message that it sent but with a custom emoji? In discord.js
my discordjs music bot is buggy. idk why it midway trough the track it pauses. stops or crashes
if (!song) {
console.log("this?1");
message.member.voice.channel.leave();
message.client.queue.delete(message.guild.id);
return;
}
``` this crashes ...
idk why though
You need FFMPEG for a music bot ytdl-core and something else
you don't need ffmpeg, it's just commonly used
yes it can tho?
probably count the number of newline characters in a file
ikr, i just realized something else was causing the problem of me trying to get the amount of lines in my file in my code
or nvm
function linesCount(filename) {
var i;
var count = 0;
fs.createReadStream(filename)
.on('data', function(chunk) {
for (i=0; i < chunk.length; ++i)
if (chunk[i] == 10) count++;
})
.on('end', function() {
// console.log(count);
return count;
});
}
the console.log(count) works but it returns "undefined"
functions return immediately
events are not sync
you need to either wrap everything into a promise or use a callback
just gonna use a simplier way
how do you find how many times it says "\n" in a string
im looking at this rn:
var fs = require('fs');
filePath = process.argv[2];
fileBuffer = fs.readFileSync(filePath);
to_string = fileBuffer.toString();
split_lines = to_string.split("\n");
console.log(split_lines.length-1);
thats one way yes
keep in mind that using readFileSync will attempt to put the entire file in memory before proceeding, which will not work for very large files
also you dont need to convert buffer to string if you use readFileSync with the utf8 option
just txt files btw and wdym
wait im dumb, i think there's another simplier way i could've done it
fs.readFileSync(filePath,"utf8")
Hi How to Register
i alr fixed
using a require(), is there a way for the file ran by require() give information to the base file?
like:
require("somefile.js"),somehow_add_something_here_to_recieve_a_variable_back
message.channel.send(variablefromfile);
using functions and return values?
Object and gather props?
i know this sounds ugly but i guess the only solution is global vars
I don't know if i am asking in the right channel, but is there a bot that can pull data from a XML file and create an embed with a custom command? idk if this is what i should be approaching. Or an API. (I have absolutely no clue)
Basically I want to pull info about an item in a game and display it in an embedded post.
Why does discord.net return a collection for attachments per message? I cant even figure a way to attach multiple files without it being multiple messages
it is possible to receive more than one attachment
is it possible for a user to send more than one per message?
Yes
Android client allows users to send multiple attachments at once
Doubts about the iOS one
I think bots can also send more than one file per message, but it depends on what library you use
ahhh ok i didnt know mobile had a different system... Thank you!
I use 2 different libraries for different bots and I noticed that one does support multiple attachments while the other doesnt
sadness because i can't ditch the filename_{attachNumber} scheme
just use 0 if you don't care about maybe multiple files 😛
hmmm i could, i might... But then again mass-uploading files from mobile would be neat, especially for uploading custom scripts
you can send multiple files at once on iphone
Cute
they were wondering ^
how do you cache/store console.logs
you dont
make your own logger
that way you can control the string before it actually goes to console.log
hey where y can find a code to make a logger?
@terse vine wdym
what is that?
code yourself
I just want a guide
which library
to know how can i code it
I've seen some people make things that logged console.logs using require()...
discordjs
djs
- please change your nickname
- https://anidiots.guide/getting-started/getting-started-long-version
use this
this is more updated and maintained by the community not an idiots guide
@earnest phoenix thank you so much bro ☺️
np
Im using the got module, but it wont run on my raspberry
Ive made sure everythings up to date
is there a replacement I could use for it?
let letterNumber = /\[^0-9]/+-*();
if (inputtxt.value.match(letterNumber)) {
// success
} else {
// fail
}
im trying to make only 1234567890+-*/() allowed in an argument in a discord bot...
You need to escape special characters like /, +, (), etc. with a backslash.
I recommend using a site like: https://regexr.com
Because mssage.guild.member(message.author) doesn't exist.
@obtuse wind
@obtuse wind I think what you want is message.member.hasPermission('MANAGE_MESSSAGES')
@tiny tinsel message.guild.member is a function
which resolves a member object from a user or other object
so technically hes not wrong, he just couldve used message.member to save time
@grizzled raven What no.
message.guild.member is a GuildMember object.
I think you are confusing yourself with fetchMember.
Oh wait no you're right I didn't know.
Returns the GuildMember form of a User object, if the user is present in the guild.
So the issue is user is probablyt not part of the guild.
I still dont get how id use voting when my bot is sharded
cuz i cant really but it into my main file as then it would make 2 instances of dbl and get mad about the port already being used 
that seems baddd
A DB seems sorta overkill for me for vote checking unless you want to store them for the long run. If you only need them for the short run just save them in JSON
Also storing votes and stuff isn't really a bad idea Daaku
You should provide more information on what you're even trying to do
Having it running on just one shard could work completely fine depending on what you're trying to do
In fact, it seems that's the only issue you're mentioning
And I can't think of any reason why you'd want to put multiple listeners for the vote webhook
Check /app/package.json: command not found. Is a start script missing? https://glitch.com/help/failstart/help me in this error
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::3235
at Server.setupListenHandle [as _listen2] (net.js:1270:14)
at listenInCluster (net.js:1318:12)``` help me in this error
Your port is already in use
Use a different port?
Pick one between 80 -65500
TypeError: giveaways.launch is not a function getting this error
what do i need to enter here?
The ip address of your bot
it isnt the address of the bot
it's the web location of the web server, would it be an ip or a named domain
True, but smokey doesn't even know what a webhook is so I don't think he will get a separate web server on a different machine
so what do i need to do to create this webhook?
Get the library and the documentation should explain how to use it
I reviewed all the documentation
just think if it DBL doing a POST request on a server of your choice
do you know POST?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
@delicate zephyr
Heyo, I'm trying to do error handling in JS but it doesn't really work.
Is error handling in js different qua logic than eg C# or so?
const local_url = "http://127.0.0.1:5000/", mail = "mail@mail.mail";
let token = null;
console.log("Retrieving token...");
try {
token = mySE.gen_token(local_url, mail);
} catch (e) {
console.log("An error occured!");
console.log(e);
}
console.log("Retrieved token:\r\n" + token);
console.log("defukk");
Retrieving token...
Retrieved token:
undefined
defukk
D:\code\5INFO\sem2\ICT-Electronica\mySE\API wrappers\JavaScript\mySE\meSE.js:28
if (reqValue["statusCode"] !== 201) throw new UnauthorizedError(reqValue["error"]);
Shouldn't it raise the error instantly, because now it seems like it raises it after the program is done running?
is mySE.gen_token async ? @ruby talon
or a promise since its undefined
but I doubt it is because its logging undefined
so probs mySE.gen_token(local_url, mail); is borked
Promise, already looking at docs.
hey in webhook password what i should put
ur choice
SpiritIsTheBest is always a good password, but you can have any password you want as long as it's the same on your top.gg bot page and your bot self
means its own choice
123mySeCuRePass is a great passsword.
Hello, I am new to Discord and heard you can develop Bots on here, I'm a JavaScript Developer, is there an API for that?
Ok, what's the Best Version to use?
How to make bot online
in glitch
anyone can help
?
plesse
node main.js
Im a Java dev, so I can't really help with JS questions
But I think almost half of the bot devs here are JS devs
@earnest phoenix it really depends, if your goal is to have the newest features use master, it's not going to be as reliable but you'll have new features. if you want a stable build which is known to not crash etc use stable
@earnest phoenix are you using d.js?
But I think almost half of the bot devs here are JS devs
true, and for a very specific reason lol
@earnest phoenix The newest Version is v12?
yup
@earnest phoenix cause JS is good
no
javascript doesn't require much thinking, or logic really, and discord.js does a lot for the end user because most of their userbase is idiotic
And JS is good is my opinion
Lmao
@sterile minnow it's easy
interpreted languages will never measure up to compiled ones and that's facts
🤷♂️
Yeah. I can JS, PY, JAVA, HTML and CSS. But main is JS
did you just confuse Java with JS? 😛
@blissful scaffold the only reason I use js is because its not that strictly typed
or in general not that strict
it can be a quick whip of code in some scenarios
I prefer strictly typed languages
which saves me effort
I use other langs for specific work loads
for example why use js if you plan to do cpu intensive code
But I can see the uses of a losely typed language
or if you really need to do a blocking thing
then use a lang with actual threads
and probably connect it via ws or rest on your js code
thats how I roll my bot
i think JS really needs an easy way to make/use multiple threads
probs never gonna happen
workers are kinda like that but js is single threaded still
maybe only for the backend/node version else websites will start using 100% of your cpu in no time
like you can call it multithreaded
but at the same time its not really
thats how js workers farce rn
js is very good for frontend work
i can't recommend it more over any other language
but for backend... not so much
it fails to perform up to standards
I dont know much about JS, I use it sometimes for frontend stuff but always with the help of Google
as a bridge for backend it can be but it just adds more work
like what if you want to do this specific thing, and js do it slowly
you can use workers at that point but still its js
so yeah
probably just use a better language if you hit that point
JS is good for 90% of the bots, but if you really want to do something cpu intensive then it's better to switch to another language
i feel like people choose js for backend because they're lazy to do more than 20 lines of code which isn't really... good, you should focus on performance, security, diversity etc etc, not the simplicity of it
thats me ^
but my bot doesnt really need to much js processing other than calculating time
and outputting images and stuff
so js would be fine for it
until I think it needs a new rework
guys who wants to see my code its massive
no
massive one file
massive code files are for devs who hate themselves
Okay thank you!
if you change your bot token on the discord developer page then you also need to update the token in your bot
where?
do NOT share your bot token ever
if you change your bot token then you need to update your token in your bot
discord uses the bot token to identify your bot, only your bot needs to know the token
also never put your token on github or any other version control tool
convert your token to a qr code and tattoo it on your arm
I heard yesterday about a guy who tattooed a QR code for a youtube video on his arm... And then his video got flagged for copy right claims and youtube removed the video
lol
discord and qr codes don't go hand in hand
the qr code login has no protection whatsoever so if someone gets the qr code they have full access to your account
im starting to think discord cut back on their budget for developers so they only hire amateurs
if someone scans YOUR discord QR code then YOU get access to their account
you give away your account if you scan a QR code of someone else
just tattoo a rickroll qr code on your arm
673160436363034626
Rom.
0743
My first bot to be released. i made an multi funtional bot it has fun commands, moderator commands, some info commands too!
discord.js
?
1
0
No server count
@snow pine
1 upvote🤔
665501346262155266
Davetçi
5673
Gelişmiş Türkçe davet botu. Ayarlanabilir özellikler, davet takip sistemi ve dahası için sunucuna davet et!
discord.js
!
3
2
No server count
@sacred widget
How to make a music bot in djs v12 without lavalink
@earnest phoenix What the feick is lavalink
?\
@earnest phoenix ytdl or anything else to get a music stream/file
@snow pine if you dont even know maybe dont even try to help??
Youre gonna have to be more specific than that
As an old client of mine would often say: "the problem lies between the chair and the keyboard"
my cup of tea?
Your cup of tea
pebcak?
data.memberData.workStreak = 0;
}
let toWait = Date.now() + 21600000;
data.memberData.cooldowns.work = toWait;
data.memberData.markModified("cooldowns");``` when i use command 2nd time it shows me use after 5hrs i want to decrease to 10mins how i do help
Do you understand your own code
i want 10mins in ms
im not going to do math for you
Do you want a little trick to make those times easier
just remember that there are 1000ms in 1 second
It's code, it can do math
10 * 60 * 60 * 1000 // wow it's 10 hours and I don't need a calculator to see that
You should know what you're supposed to change
bruh
And assuming you're 13+ you should also have the knowledge to be able to convert minutes to milliseconds
too much spoonfeeding is not good, you are already told what you need to change
is that the equivalent of 1 day
oh the cooldown is 1 hour
What's different to Typescript and JavaScript?
its a superset of javascript, sort of like a massive framework. you code in typescript and then your code gets "built" into javascript by a pseudo-compiler
or something like that, i dont use it myself
typescript is like writing safe javascript without having to worry about writing safe javascript
How to avatar command photo size text/link/command ?
@earnest phoenix What library do you use?
and Dart, i cant help you as idk what language you are using, I am guessing py
maybe it's dart? but I have no idea what might be wrong without an error log
@earnest phoenix oh god i just saw that, right
you are not actually awaiting any response
you cannot send a list
you are not actually awaiting any response
2)
you cannot send a list
for l in learned_things:
if message.content==l:
message.channel.send([answer(l),answerproved(l)]) <--- "Point 1 & 2"
else:
print(message.content)
learn(message.content,answer(message.content))```
we gonna ignore himtryna send a list aswell without awaiting anything
and what even are these functions
read the error
What library is recommended for a Moderation bot?
any errors?
no
@earnest phoenix args[0] is not a number
can soneonehelp me
@earnest phoenix at client.login() don't put the token there make a folder with the name config.js
Along with the prefix of the bot.
you don't need to do that
@earnest phoenix show your log
@earnest phoenix I know what I'm talking about I use glitch
@earnest phoenix https://discordapp.com/developers/docs/reference#message-formatting
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
not config.js
write it to the env file
because the env file is protected
other files are not
Ok
but anyway thats not the problem
@quartz kindle No he Mirku can just make the glitch project private.
what is server.js?
can you use custom emojis in embed author?
no
aw
Value "unban" is not snowflake.
do you guys know how to reduce the buffer jpeg quality on node-canvas?
For image/jpeg, an object specifying the quality (0 to 1), if progressive compression should be used and/or if chroma subsampling should be used: {quality: 0.75, progressive: false, chromaSubsampling: true}. All properties are optional.
oh ok, thanks
You would need a database or api for that
you should do research - it's complicated
you need a webserver, you need to choose if you want to have server side rendering or client side, do you want an SPA, do you want login etc etc
2|alpha | at WebSocketShard._cleanupConnection (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketShard.js:718:31)
2|alpha | at WebSocketShard.<anonymous> (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketManager.js:248:15)
2|alpha | at WebSocketShard.emit (events.js:321:20)
2|alpha | at WebSocketShard.destroy (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketShard.js:692:12)
2|alpha | at WebSocketShard._send (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketShard.js:640:12)
2|alpha | at WebSocketShard.processQueue (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketShard.js:666:12)
2|alpha | at WebSocketShard.send (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketShard.js:628:10)
2|alpha | at WebSocketManager.broadcast (/root/alpha/node_modules/discord.js/src/client/websocket/WebSocketManager.js:333:53)
2|alpha | at ClientPresence.set (/root/alpha/node_modules/discord.js/src/structures/ClientPresence.js:21:22)```
confused y i am getting this error
TypeError: Cannot set property 'onmessage' of null
you try to set the property onmessage on a non existing object
its related to setting your bot's presence it seems
means??
What does your code look like where you set your bot's presence?
Hey, I’m trying to give a compression value to the buffer in a node-canvas, if I manually put the value it works just fine, if I try to use a variable like “args[0]” it doesn’t seem to work
Is there a way to fix it?
my bot status is in config.js @blissful scaffold
show us the lines of code where you set the bot status
{
name: '"help on {serversCount} servers',
type: "LISTENING"
},
{
name: "@Alpha Bot#4739 help",
type: "PLAYING"
}
],```
I have 0 knowledge about JS libs, so I will leave this for someone else ^^
hm
well i dont use discord.js
but i always used just the number 0/1/2/3
aka streaming/playing/listening/watching
Can any give me some tips
@earnest phoenix You shouldn't be passing two statuses to the User.SetPresence() function.
(Try passing only one object).
@earnest phoenix status array is not what you feed directly to your presence, right?
im pretty sure hes not, hes just swapping between them
makes sense if they are in array
¯_(ツ)_/¯
how do i do a kick thing
which kick thing
anyways what im trying to sya, that object is wrong as a presence thing
like how do i make a kick command for a certain rank
its correct as a game within presence thing
which lib are you using @tawny lantern
Visual studio
@earnest phoenix @cosmic cairn
.setPresence( { game: status[0] } )```
should be how youre putting it in, right?
you first want to check if the member's roles contains the role you want to allow kicking for; https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=roles
after that get the guild member from the arguments and use this method https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=kick
How do i do that
@tawny lantern do you have programming background of any sorts?
i have the role ready
@potent ivy basically for discord.js
client.user.setPresence({
game: {
name: `nothing`,
type: `WATCHING` || `PLAYING` || `LISTENING` || `STREAMING`
},
status: `dnd` || `idle` || `online` || `invisible`
});
no
@cosmic cairn well yeah then its what i said, the only problem he could have are either:
- hes feeding an array to the game object, instead of a random element from an array
- hes feeding element of that array directly to setPresence, rather than to game field of setPresence
tho lmao at those d.js types
looks more like psudocode than actual code (i'd expect something like Discord.GameTypes.WATCHING rather than just a blunt string lol)
@rugged minnow make sure you're passing a number and not a string
@earnest phoenix friend me so we can do it in dms i need additional help
okay so when it says Collection<Snowflake, Role> what does it mean
that... it's a collection
What do i put in it tho
keyed by a snowflake (id) and has a value with the role object
a collection is like a Map, which is similar to an array/object, just a bit more complex
So i put my discords admin role in it and other roles
so essentially, when it says a Collection, it means it returns a list of things. in this case, a list of roles indexed by role id
So i put my discords admin role in it and other roles
you can't edit properties directly
Snowflake = ID
in this case it is a collection/map of role objects listed by their ID/snowflake
This is sorta falling into the spoonfeeding category.
lmao
a collection is not a list/array
ok, so you should basically learn a little bit javascript first
it will save you a lot of trouble in the future
because discord.js is made with javascript, and everything related to it uses javascript, you cant use it effectivelly if you dont know a minimum of javascript
that doesnt mean you have to type that literally
it's just telling you what type of data it is
SO WHAT DO I PUT IN IT LIKE IV BEEN ASKING
please dont make me go to google
Irony
follow some JS tutorials please, even basic tutorials should work for this
now look
we dont give code here, we teach people how to code
._.
@earnest phoenix What do you think you're doing?
@weak parrot
@weak parrot ads
anyways
im trinying to post something'
@modern sable
yall are here to help
we are not here to be your code monkey @tawny lantern
They tryna advertise
nah i was pointing at the videos on the channel
@gilded plank b @earnest phoenix ads for hacked accounts, spam in multiple channels, offering "free chegg" (whatever that is) in #general
Banned Glove#8319 (@formal mountain)
free chegg? wtf
XD
I googled it, even google can't help me answer what a "free chegg" is
so free chegg is like ebook piracy probably
Now we know why no one here knows how to program, they use their cheggs to cheat on their coding hw
https://conquestsim.io/upload/stoic-elbow-483.png is this the only way channels will be represented in discord?
ie <#id>
I mean, it's the only way they're represented in their tag form.
But you could match the ID too with \d
yea i mean i just ended up doing
const filteredChannel = message.content.replace(/[<#>]/g, '')
client.channels.fetch(filteredChannel)
.then(() => channel reachable)
.catch(() => Channel unreachable)```
if a regular id gets passed into that would be fine
is there still a default channel these days?
or should i just require owners to setup bot on add
its already filtered down to that arg
👍
but like i said is there still a default channel these days?
not afaik
alright ill just make sure to make abundantly clear to setup the bot
@earnest phoenix or look through all the channels on join and send a message in the first channel it can speak in or a common channel name like general
That's what I do
Can someone hook me up with a public NSFW api?
I've been looking for hours>
Hey, anyone can help me I don't know why my bot plays a song but not complete that song and leaves the channel.
Library: Eris, Version: 0.11.2
highwatermark?
if you use ytdl
take a look on highwatermark option
or it should be on eris issues
if its not open, search for it on closed
Hmm
I believe I encountered that issue in past
and highWaterMark option on play fixed it
Thanks I just shifted in Eris from D.js
What do I do if the "nod ." command isn't working in VSC
you don't nod?
This is my first time making a bot and it said to install nod / VSC. But code in VSC
And this is the error
"nod : The term 'nod' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1
- nod .
-
+ CategoryInfo : ObjectNotFound: (nod:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException"
you mean node
Yes
do you have node installed?
I do
have you tried again but this time instead of doing nod ., do node .
node mainFile.js
Where do I put that command?
console
That doesn't work
It's wanting to turn on, because it'll switch from powershell to node for about 2 seconds
does your bot have an index.js, or an app.js?
if so then do node index.js or the same for whatever you called it
Honestly man, I'm new to this. So I don't know where to check that
What is the name of your main file
I'll just post the code so you guys can tell me if there's something wrong
const Discord = require('discord.js');
const bot = new Discord.Client();
const token = 'Token';
bot.on('ready',() =>{
console.log('This bot is online');
})
bot.login(token);
okay and that is in a file correct?
Yes
so what is the name of the file
index
and make sure youre in the correct dir
^
node index.js doesn't work either
what does it say
Error?
Nothing
It just switches to node for about 2 seconds and goes back to powershell
you got everything installed?
Yes
are you running this in a text editors powershell or an actual powershell window
Yes
ok
restart it
So save and restart
have u saved the file?
Yes
also u need to run node index.js in the actual vsc console section
which is accessed by ctrl+shift+` i believe
That's the point I'm at
ok that's weird
did you install node after opening the editor
or click terminal > new terminal > 'your bot folder'
Oh
because vsc doesnt recognize new environment variables without a restart
Thank you @dusky marsh
I've wrote the script 5 different times and restarted it, but this restart it worked
ye np 😄
VSC seems wonky 
ikr
vim is a hungry black hole you cannot escape
Does my laptop have to be on all the time for the bot to be online?
if it runs from your laptop yes
Big oof
heroku can deploy it for free for up to 1,000 or so hours a month
or pay few bucks for real hosting
you can get for 2€ or less a good hosting for bot that doesnt have over 5 shards
Can you send me a link? @restive furnace
Just google, there is tons, but example you can use hostinger
or https://google.com/search?q=Contabo almost every uses that
Thank you
hmm. i have a fully hosted website through dreamhost and i wonder if i can host my bot there
i use vultr for bot hosting, i got $50 free credit when i signed up (had to deposit $5 to get the account working tho)
I have no idea where I’d even look on my dreamhost account to see if that’s viable
Is there a method to see every guild a member is in>?
Using DiscordJS
nope
only through oauth
does anyone else here have any features in place in their bot globally to control or limit abuse and attacks by malicious users?
i just had someone try to flood my bot with malformed embeds from selfbots
it didnt work but i did notice it.
does anyone else here have anything like rate limiting of their commands, honeypots, alerts to bot owners for failed processing, etc?
is there any standard recommended approach beyond just 'respect discords rate limits'?
i did something but i havent actually tested it yet
i put a check for the message queue in my message event, if the queue is bigger than 5, ignore command
that way if the bot is spammed with 100 commands, only 5 will register
i made this after my bot was spammed by raiders which caused it to queue um hundreds of responses and keep sending replies for hours due to rate limits
at /root/alpha123/helpers/functions.js:58:32
at new Promise ()
at Object.supportLink (/root/alpha123/helpers/functions.js:56:16)
at Help.run (/root/alpha123/commands/General/help.js:85:92)
at module.exports.run (/root/alpha123/events/message.js:224:17)
at processTicksAndRejections (internal/process/task_queues.js:97:5)``` getting this error when run help command
Whatever your trying to get the property "me" from is undefined
i got it
i want like this
when i run work command it shows me like thius
here is my codes https://sourceb.in/1b565b1e77
Try just logging Discord.Util.parseEmoji(award[i])
means
Use console.log()
And check what exactly happens when you try to parseEmoji
with the value you provide
I think the name might straight up be the emoji
oh
show the config for the emojis

ohk
yy i have added proper ids
Assuming the parseEmoji thing works, you have the name of the emoji
You're doing this with it name.split("_")[1];
In an attempt to get the letter
But your emoji names are not in that format at all
which format i have to put my emoji name
Do you understand what name.split("_")[1] does
that would return a, yes
Show the config you used this time
ohk wait
ok
check if Discord.Util.parseEmoji(award[i]).name actually returns the name like you're expecting it to
What you could also do that would allow you to just skip this parseEmoji stuff entirely, is just creating a second array with the default emojis
So that all you have to do is index the right one
means??? @late hill
its work
thx
Lol you use Atlanta source

Don't delete your screenshot i'm not stupid...
And if you want help
whats atlanta source?
is this a bad thing, asks a non-djs user
and added my own codes also
@green kestrel https://top.gg/bot/557445719892688897
@earnest phoenix Atlanta work with d.js v12(master)
ah its a bot fork, ok
no not fork
i just re write
just take some help form his codes
Just type in shell : npm i discord.js/discordjs
You lie but okay :)
nope
@earnest phoenix come to #commands i will show my bot
You have deleted tout screenshot When i have said "Lol you use Atlanta source"
@toxic jolt use a timeout
I could not. Can you help me? @earnest phoenix
Yeah
Thanks
setTimeout(callback, msToWait)
function leavewola() {voiceChannel.leave();}
setTimeout(leavewola, 30000);```
:)
Or spoonfeed
thanks man
Thats fine
Np
Thanks, @amber fractal and @earnest phoenix ❤️
question
why does my bot do this?
https://riku.club/sQEVH.png
i set it as ${member}
but it shows the ID instead
Could be that the user isn't cached for you
Try mentioning the user yourself and then check again
Or there is no member with the given ID
at some point in the past it showed proper welcome
Then member would be undefined @blissful scaffold, which wouldn't result in an ID
I don't know if riku uses a member object or manually puts an ID in the member variable
But you are probably right
using the member object in the event
also yes pinging them fixes it
Yeah so it's caching
Which is user side and there's nothing wrong with your code/bot
dont see other bots having that issue so im gettin confusedd
ah ok
yeah i looked in other ppls welcome channel and it all shows so i think my client just weird
Discord caching is a mystery
discord is a mystery
i really wonder what is going on inside of the heads of the head management and discord devs because whose idea was it to have this atrocious update
They're probably drunk 24/7
yeah i dont like this
they literally just stole the features from keybase and poorly merged them

I tried to make a second bot for testing new commands but it messed up my original bot... I fixed it tho


@earnest phoenix not the place for it & read faq
read the message link i sent you
i sent it for a reason
How would you get a user’s nickname for a specific server...
Discord js
Try member.nickname
Thx
get the guild you need from https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=guilds
get the member from https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=members and then you can access the nickname prop
@earnest phoenix What library do you use?
@digital ibex discord.js
discord.js

@zinc condor try ${member.toString()}
it will
/home/lumap/Desktop/pichu-rewrite/node_modules/discord.js/src/client/Client.js:39
} catch {
^
SyntaxError: Unexpected token {
``` I'm getting this error with djs v12, why?
We'd need a bit more code I think
not much to go off of
other than it doesn't expect the bracket
@south sky thanks it worked 
3|alphabot | at compileFunction (<anonymous>)
3|alphabot | at wrapSafe (internal/modules/cjs/loader.js:1060:16)
3|alphabot | at Module._compile (internal/modules/cjs/loader.js:1108:27)
3|alphabot | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
3|alphabot | at Module.load (internal/modules/cjs/loader.js:993:32)
3|alphabot | at Function.Module._load (internal/modules/cjs/loader.js:892:14)
3|alphabot | at Module.require (internal/modules/cjs/loader.js:1033:19)
3|alphabot | at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
3|alphabot | at require (internal/modules/cjs/helpers.js:72:18)
3|alphabot | at /root/alpha123/alphabot.js:33:28
3|alphabot | at Array.forEach (<anonymous>)
3|alphabot | at init (/root/alpha123/alphabot.js:30:14)
3|alphabot | /root/alpha123/events/.ready.js.swp:1
3|alphabot | b0nano 2.9.3
3|alphabot | ^^^```
help me in this error
ooh yeah
// Welcomer
client.on('guildMemberAdd', member => {
// Send the message to a designated channel on a server:
const channel = member.guild.channels.find(ch => ch.name === '┌📓・welcome');
// Do nothing if the channel wasn't found on this server
if (!channel) return;
const verchannel = member.guild.channels.find(ch => ch.name === '✔・verify');
const rulechannel = member.guild.channels.find(ch => ch.name === '├📗・rules');
const wowemoji = client.emojis.find(emoji => emoji.name === "wow");
const welcomeEmbed = new Discord.RichEmbed()
.setColor("#FF99DA")
.setAuthor(`Welcome to Weeb Safari, ${member.displayName} ◈`)
.setDescription(`
Welcome ${member.toString()}
• Please be sure to ${verchannel}
• Follow the ${rulechannel}
• And have fun ${wowemoji}`)
.setThumbnail(member.user.displayAvatarURL)
.setTimestamp()
.setImage('https://riku.club/EjLHj.gif')
.setFooter(`${member.guild.memberCount} Members`, `https://riku.club/ErT8G.png`);
// Send the message, mentioning the member
channel.send(welcomeEmbed);
});```
this is current
for now its a single server bot
me?
Assuming you want to ping the person get the id and I think you can wrap it in <@id>
how i find that
wym
stacktrace already tell you where
o
I want to ping the person and show the tag of the person aswell
like user#1111
or do i need literally everyone to cache everyone else(impossible) for that
i didn't find anything like that
I need help resolving the Promise.id
if(command === 'setup') {
message.guild.createChannel('Logs', {
type: 'text',
permissionOverwrites: [{
id: message.guild.id,
deny: ['VIEW_CHANNEL'],
}]
})
.then(message.channel.send(Promise.id))
.catch(console.error);
it should be somwhere on your compiler something
check that .ready.js.wp
not even sure why that exists
no that folder name doesn't exists
@earnest phoenix did you get an answer?
Maybe, the syntax of try/catch (that I use anyways) is
// code
}catch(e){
// stuff
}```
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch if you want to update again this syntax should work
put your timeout outside
the timeout should start running when the person uses the command the first time
yeah but i have 2 timeouts
why do you need two ?
then put the voting logic there
cooldown.add()
checkIfVoted.then(v => {
if(voted) {
setTimeout(1500)
} else {
setTimeout(3000)
}
})```
im doing that alreadfy
you're doing it only if cooldown exists
and before setting it
you're checking for cooldown.has() before setting the cooldown, so when the person uses the command, it has the cooldown added, but not the timeout set
hi, someone to talk about problems in the discord? i need help
state your problem
help me in #topgg-api
the only thing who appear for me in the browser version is the fast reaction, nothing more
i can't see the edition points
to edit messages
Heya ! Someone made a bot for me, it's basically a bot that plays music, thanks to YT playlists, and it stays in the vc 24/7 even if no one is there.
Problem is, when I put a playlist it almost always says this.
How can I do to make it work ?
Try and make a cooldown to stop overloading.
if someone did it for you, get him to fix it as well
Ye but I tried with multiple sizes of playlist, even a playlist with 5 songs doesn't work
Ok, I'll ask him, thanks
No problem :) try and add a 10s cooldown too
Ok
@quartz kindle
?
you're setting the cooldown again
you need an if else
also, you probably dont want to use hasVoted multiple times
@earnest phoenix hasVoted sends a request to DBL then waits for it. thats why its a promise


