#development
1 messages · Page 704 of 1
Hmm.. Do you guys know how to make a bot stay online? I can't figure out how to set up Heroku.
?
I didn't see that as rude.
I just forgot to thank you lol.
I needed alternative ways.
It's fine.
Unless 13 is considered a teenager.
wanna friend up lol?
Hello guys if I host my music bot online musics are ending immediately am not getting any error can some one help me why it is
But if I play through my system its running good
Wait let me look again
it worked on my pc
So you install node-ous
Now it's working????
After hosting
It's ok no pblm.. plz don't voilate any rules
Okay I got your point what are the packages you are using,
the ones i gave u in the link
?
Bot s okay dude mine but the song if I choose it will end immediately
npm install discord.js opusscript
npm install discord.js node-opus
Okay dude
I told you not to install both lol...
The preferred audio engine is node-opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose node-opus. Using opusscript is only recommended for development environments where node-opus is tough to get working. For production bots, using node-opus should be considered a necessity, especially if they're going to be running on multiple servers.
Read the docs
Thanks guys
Would someone like to help me with posting my bot server count to a website? I use mobirise to make my website
If you are posting server count to dbl, you can literally copy paste the dbl widget link
Right, I am a really dumb person, and cannot see the problem I have made now:
res.json({status: "Success", members: g.members.array(), roles: g.roles.array(), emojis: g.emojis.array(), channels: g.channels.array()})
TypeError: Converting circular structure to JSON
Guess .array() doesnt remove circular references
Try .map(t => true)
Instead of .array()
Djs v12 has .toJson() as well, idk about v11
Another way to deal with circular references is to use util.inspect
There's some good modules that solve circular json
Does anyone know how to create a simple background task in discord.py (1.0) that just runs once then ends? All the tutorials and docs I find are for the old version
Uh, Somethings worng. Im Discord.js Version 11.5.1.
args[0] is or was the first Argument after the Command. Till Yesterday it was like this but now its args[1]. Now the Arguments Are weird. I dont use LowerCase but i can type it however i want. Also i dont have to type out the Provided Argument.
WTF
code? Confused on what you're asking
Ok thanks you very much @quartz kindle
However I put the rigth token and there is still an error
Hello, I would like that my bot thank all the people who vote for him, for that I followed this doc:
https://discordbots.org/api/docs#jslib
but I can not find anything, it does not work, someone could enlighten me on how to do?
wut does that mean?
you dont need the () when declaring a class
whats the problem in that file
aaaaaaand whats the error
That's not how you make a class
@lunar crystal then you are still doing it wrong
class Class{}
Have have u red that?
have you read what i said
you dont need the () when declaring a class
yeah, so why are you still posting that file when it doesnt have the error you posted before
the error?
you know the full stack trace isnt required
F to late
oh my god
we have already told you how to fix it
node_modules/discordrep.js's main file has that error
Idk what kind of module doesnt have tests because that would never work
looking at the source linked on the npm page of the package doesnt seem to have that error tho
Does it have any recent commit?
10 days ago, no sign of such issue
Its inital commit doesnt have that error
[discord.py] how to set the category on create_text_channel? i tried category = channel id but nope, channel name but nope
category arg requires a CategoryChannel instance (can be easily gotten with get_channel or utils.get iterating through either guild.channels or guild.categories)
Ok @quartz kindle
In EJS is it possible to have like a loading screen sort of thing? so that its not just sat their loading for a bit on a new thing?
@slender thistle thanks
@slim heart loading screens are only possible with multiple requests
Ie request the loading screen, then request the content via ajax or redirect
hm ok thanks
It's still not working I don't know why 😬
How hard is it to create a music bot?
Depends on your experience.
I've never created a music bot as I didn't want to bother, but I'd call it intermediate.
I learned scripting yesterday and i already got a bot working with a few commands but i need a music bot
And?
if you started learning coding yesterday, you have a loooong way to go before making a music bot
That isnt a question
but it was a bit more to my question above
if you dont know what you are doing, very hard
ok
Depends on how you good you want it really
I would say getting videos and playing them isn't that difficult
@lunar crystal
You're putting those extra <> in it?
Youre not supposed to
It should be .login("token") like .login("ienrnfkskmrnfjcndksi")
No it was just for the exemple sorry
And youre still getting incorrect login details?
From my discord develloper portal
Nope there is both
Which part of the developer portal? The bot section?
^^
it's not the client id or client secret
Yep
I have just Copy / paste the token and that's all
Ha you mean the command ok
You mean that I have to change this ?
No, that is correct
Its the token that is wrong
Make sure you copied and pasted it correctly, that there are no accidental changes after you pasted it, regenerate it and try copying it again
Change the content in ('')
Like
('N3blablabla.blablabla')
Chabge N3blablabla.blablabla to the new token @lunar crystal
I see a guild.createChannel but I dont see a method to remove one, anyone wanting to point me in the right direction?
i'm assuming you're in discord.js
That's correct
wrong one
wait yes it is
Cheers
Ok... this is more a question
me and peter are using the same version of my api (1.1.6.0) but his isnt working the same way as mine.
any reason?
And yes that method is valid https://github.com/LazyNeko1/nbapi/blob/master/versions/nbapi-1.1.6.0/__main__.py
Are you sure you don’t get the same error as Peter if you run the same code?
@west spoke
I ran the same thing (top embed)
It was just installed
We were both on 1.1.6.0

Okay so im now getting this error again but its related to a complete different section than before..
bot.on("messageUpdate", function(oldMessage, newMessage){
if(oldMessage.content == newMessage.content) return
const user = newMessage.author;
let logsChannel = oldMessage.guild.channels.find(channel => channel.name === "message-logs");
if(!logsChannel) return
let messageEditEmbed = new Discord.RichEmbed()
.setTitle("⚠️ A message was edited!")
.addField("Sent by User", user)
.addField("Before", oldMessage.content) <=== This is line 67
.addField("After", newMessage.content)
.addField("Edited In", oldMessage.guild.channels.get(oldMessage.channel.id).toString() + ` (${oldMessage.channel.id})`)
.setFooter(`Author ID: ${user.id}| Message ID: ${oldMessage.id}`, bot.user.avatarURL)
.setColor("#FFFF00")
return logsChannel.send(messageEditEmbed)
});
anyone able to help me fix this at all
Test this @earnest phoenix
Wait
bot.on("messageUpdate", function(message, editedMessage){
if (message.author.bot) return;
if (message === editedMessage) return;
if (message.channel.type !== 'text') return;
let guild = message.guild;
let logsChannel = guild.channels.find(channel => channel.name == "message-logs");
if(!logsChannel) return
let messageEditEmbed = new Discord.RichEmbed()
.setTitle("⚠️ A message was edited!")
.addField("Sent by User", user)
.addField("Before", `${message}`)
.addField("After", `${editedMessage}`)
.addField("Edited In", message.guild.channels.get(message.channel.id).toString() + ` (${message.channel.id})`)
.setFooter(`Author ID: ${user.id}| Message ID: ${message.id}`, bot.user.avatarURL)
.setColor("#FFFF00")
return logsChannel.send(messageEditEmbed)
});```
@earnest phoenix
Without the <=== This is line 67
okay thank you @earnest phoenix will try this
You're welcome
One message removed from a suspended account.
i need some css help,
the two red boxes are two seperate divs only have float: left; in order for them to be like seperate, the inside boxes are divs as well which float left inside the div
Im trying to move the second div to the blue box but nothing i seem to do can do it?
move it where?
At the blue box
^
@slim heart have display block and remove the float
`}
// eslint-disable-next-line no-mixed-spaces-and-tabs
const role = message.guild.roles.find(r => r.name === 'LEOPARDCLAN');
if (message.content.toLowerCase().includes('^leopardclan')) {
message.author.addRole(role);
message.channel.send('Role LEOPARDCLAN added!');
}`
Hey whats wrong with this code?
.toLowerCase().includes(a string with an uppercase) 
what are u running
javascript
command
so what do i change to
i will just find role id. its ok
thats not the issue
?
how I can send a buffer as an attachment in discord.js
I tried
await m.edit(`**Statisticile jucătorului ${statsJSON.nickname} :**`, {
files: [{
attachment: buffer,
name: 'file.jpg'
}]
})
but the message doesn't have any image attached
@wheat jolt
What’re you doing now
You have to define attachment in file of MessageOptions
ah
That works even tho it can just be file: BufferResolvable
Do {file: buffer}
Probably discord
🤷
I don’t think you can edit with new files
Hello,
how do people do commands with custom graphical user profiles in nodejs?
node-canvas?
]]moreinfo @wheat jolt
If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.
I am using node-canvas and I don't get any error
@wheat jolt what is stats.avatarURL
I said I have a problem with filling text
stats.avatarURL it's just an url to an image
Which one of the 5
What if you just try "test" first instead of objects and shit
i tested it
at the first line
and it's not printing the text
you can see that I put that '10.50' string
this is the output
and there needs to be 10.50
is there anyone here that knows react and such well enough to convert https://figicons.com (which only supports react) into something that'd work with normal html?
if(r.body.longdesc < 2048){
var longdescc = r.body.longdesc
} else {
var longdescc = "Trop longue"
}```
.addField("Description Longue: \n", `\`\`\`${longdescc}\`\`\``)```
reason: Cannot send an empty message
please help me i don't understand
Anybody can help me?
@sick cloud js ok or pure css?
...
where is your send code lol
I don't see anything that produces that error message
its where you send the message to the channel
const embeddesc = new Discord.RichEmbed()
.setTitle("Bot Descriptions")
.setColor("#36393f")
.addField("Petite Description: \n", `\`\`\`${r.body.shortdesc}\`\`\``)
.addField("Description Longue: \n", `\`\`\`${longdescc}\`\`\``)
.setFooter("DBL API " + new Date().getFullYear())
.setTimestamp()
message.channel.send({embeddesc});```
Exemple with koya: https://discordbots.org/api/bots/276060004262477825
const embeddesc = new Discord.RichEmbed()
.setTitle("Bot Descriptions")
.setColor("#36393f")
.addField("Petite Description: \n", `\`\`\`${r.body.shortdesc}\`\`\``)
.addField("Description Longue: \n", `\`\`\`${longdescc}\`\`\``)
.setFooter("DBL API " + new Date().getFullYear())
.setTimestamp()
message.channel.send({embed: embeddesc});```
this should work
np
@fluid basin js is fine
well, the icons are xvg, and i'm pretty sure fa uses js?
it isn't possible to use js i guess?
here
idk I just did it with the webfont method
using fonts
much faster and easier I suppose
I mean you can always try it yourself
just change the font size and the size should change
how do you use them as a font?
hi everyone i have some issue about ram usage im filtering lefted users from client.users and bots too why still i have almost 10k cached members and again why ram usage still increasing | please ping me if you have any clue
because d.js caches everything
users, members, presence states, voice states, channels, roles, emojis
its not an easy feat to optimize djs but its certainly doable, i made a library that modifies djs and uses 50-60mb ram with 1600 guilds / 200k users (uncached), at the cost of losing some features
Any one know who to make music bot in python programming language
although I dont recommend uncaching members / users now unless you are sure you wont hit the ratelimit
so i just wanted to try simple commands and from some reason its not working... can anyone tell me what is the problem?
is there an error in the console?
no
its sending this msg so it means everything is fine, the bot is online on discord too but commands dont work
i see why
console.log(args)
prefix.lenght
🔼
wait... what do i need to do?
length
Spell
http://prntscr.com/pdceoi it's not detecting what people say
yeah, it sometimes do be like that
tnx! its finally working
Log stuff when it fails
@sick cloud see the html file for examples, just put the css and the font files together (basically everything in the zip except the html)
If you logged args it could've been fixed easier
logged? like build in visual studio?
im realy new to visual studio code so i dont know too much about it
Like console.log
oh
It would've showed you args was incorrect
tnx :>
:+1:
oh ok
Hello
@quartz kindle https://discordapp.com/channels/264445053596991498/272764566411149314/628537818926546966 how can i disable these things
there are ways, but they have side effects
for example, disabling role caching, will break all functions that check for permissions
disabling channel caching will break receiving and sending messages
so you need to deal with those effects accordingly
can i use v12 is it published?
yes
okay i will upgrade it
keep in mind that v12 has many changes from v11, so you will need to change your code
so how sweep works
.sweep(function)
i cant find v12 docs
master is v12
@spark kelp i just showed you lol, select master
One message removed from a suspended account.
One message removed from a suspended account.
@earnest phoenix debug your code. you didn't even send all the relevant code, so there's not much we can do to help
post the relevant code here
for instance, what is serverQueue
no, just the relevant code
any functions that correspond to the next command
did you write it yourself
No this is not my code this is code send for me 1 person
if it's not your code, and you don't know how to debug and code, then yeah you'll have a hard time here
you're expected to know how to code coming to bot development
at least the basics
are you able to write basic code?
I try dispatcher.skip
it ends the whole queue and leaves
This is not helped
it doesn't skip it
Yes I know
Ok
stupid keyboard
mine is the same
did you try adding another song to the queue while it's playing?
and then skipping it
@grim aspen
I am trying
I am add 2 aongs
Songs
And try skip
1 time: all songs skiped
2 time: I replace end to skip = nothing he doesn't skip
any ideea why this isn't writing text on my canvas?
I am using node-canvas and I don't get any error
im trying to add music option to my bot but everytime i tell him to play something he is dies(and i need to turn him "on" again)
The only important thing is the switch case 'play'
hastebin?
hastebin
whats that?

are you getting any errors
well if he dies there should be an error
How do I set it up?
let me check real quick
@south kernel what do you mean?
thats the error i get when i tell him to join
@twilit rapids Rules bot
What is a "Rules bot"?
I got it of discord bots and it took me here if I need help
hot wrongserver
This server is NOT the support server for ANY bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of DBL.
^
timo
Yes?
i gonna ask it here cuz you are already here, how do i get the bot developer role?
@narrow kettle message.member,voiceChannel.join() there's a comma
Submit your bot to the site, and once it's approved you get the role
comma?
r,v
site... you mean the discord bot site?
damn it, second time i have a typo...
@quartz kindle and the other who help me, Thanks you very much 😄
you included everything but the error
i sent the code too
unless i missed something?
anyone got any idea how to fix the error?
no because you didnt even send the error
That's a stacktrace
thats just the stack trace and a different error caused by the error you didnt include in the screenshot
just found out i missed it yeah
sorry didnt check, was stupid of my self
is this one fine?
D.js version?
yes
...
playStream
That didnt answer my question
Wow I didnt see that lol
Yeah capitalization matters
Also on master, it's just play
Which is why I asked for the version 
wait.., what should i do to fix it then>
i made the it from s to S
oh wait so i just need to do play instead of playstream?
we'd know if you told us your d.js version
tnx guys it worked, is there anyway to make the sound better tho?
the sound is like, worse then groovy and bots like that
but its not realy bad
just not good
Higher bit rate
how do i change the bit rate?
On stable? No idea
do you have any idea how to do that it would check its a link?
yep saw that tnx
But I wouldnt say it will make a huge difference
got any idea how to make it check its a link? (args2)
Regex
oh
a good regular expression, gl making one tho
Wow thats helpful
Or you can do a simple startsWith("http") 
tnx guys
1.3k character regex xD
And know, now how do I do to create my own prefix
wdym
Sorry what is "wdym" ?
what do you mean
I don't know the english word, you know each bot has got his own prefix like !
or s/
Anyone here use pydroid3? Please dm me I am trying to set up a bot and I can't do it
var servers = {};
const queue = new Map();
var serverQueue = queue.get(message.guild.id);
const sddsc = new Discord.RichEmbed()
.setTitle("Musique")
.addField("Aucune musique", `:asterisk: Aucune musique en joue !`)
if (!serverQueue) return message.channel.send(sddsc);
return message.channel.send(`:arrow_right: En joue : **${serverQueue.songs[0].title}** !`);
}```
nowplaying command
Don't said the played music
I have already the embed
In the play command i have add a music...
Maybe you have, but if the code above is ran when you're checking the current music
It'll set queue back to a new map
Which will be empty
Is the play command in the same file
Do I have to put the orders in the same file?
No
You just have to initiate the queue as a new map once
Mmmh
How to make this?
You can put the queue as a module export
and then access it from anywhere rly
You could extend your client object and add the queue to that
const pqueue = require("./play.js")
message.channel.send(`:arrow_right: En joue : **${pqueue.serverQueue.songs[0].title}** !`);```
Bunch of options
Working?
Can someone confirm if it's correct ?😄
@lunar crystal yes
Depends on what's in play.js
talking about the prefix 🙂
The serverQueue is present
@earnest phoenix Ok thank u
Np
PREFIX = "7!"
^
Not PREFIX "7!"
Ok thank u 😄
YouTube with graphikart etc...
youtube is not always a good place to learn lol
Oh
they quickly get outdated, some give you bad practices and give you code without explaining correctly
make it globally available, or save it in the main file and pass it as a parameter
why not?
The custom prefix...
const client = new Discord.Client();
Yes i know this lol
client.queue = new Map();
const queue = new Map();
client.queue = queue;
Thank you
lol wut
@earnest phoenix we are making queue belong to client, so that there is only one global queue
so everytime you need to access it, you have to get it from client
I'm confused why the thing you said didn't work though
so you should replace all your queue.something by client.queue.something
Okay good :)

he probably tried doing ```js
client.queue = new Map();
queue.add()```
Yeah that would make sense
Oh okay
@livid pier deleting bulk messages wont exceed the api, as long as it doesnt go past 1000
a quick question, what happends if i dont put a limit?
where
for deleting msgs with bulk
rtd
args[1] > 100 ? 100 : args[1] <= 0 ? 0 : args[1]
also how can i make the bot answer with a random answer(after i tell him what answers he has, he choose a random answer)
tnx btw
because you have an annoying username to mention
95ec is hard?
ask dbl mods 🤷
Meh.
Fair.
Also @narrow kettle probably want to parseInt your args value so that it's a number not a string.
let amount = !isNaN(args[1]) ? parseInt(args[1]) : null;
Anyone knows how to add views thing in the music bot?
what
youtube video views?
yeah
depends on everything you're using for your music bot
using youtube's official api statistics.viewCount => https://developers.google.com/youtube/v3/docs/videos#statistics
Aight thanks
btw ty hash, didnt see it
Np.
guild is not defined
Yeah but how do I fix it?
I'm kinda retarted, can you show me that on my code?
👍
How to replace certain characters in an argument?
context?
Wait
logs 3 = define a logs channel
But i do type: >logs 3 name_fo_channels
And i want to identify the channel for define the logs channel
logs 3 #example
Example with a channel here:
logs 3 #logs
@valid frigate
No
if (toenable === "3") {
const newlogs = args.slice(1).join(' ')
const newlogschannel = newlogs.replace(/[^\x00-\x7F]/g, "");```
:/
Dany it's kind of hard to understand what you're trying to get. Could you explain it possibly clearer?
One message removed from a suspended account.
I have to type the channel name to define it but I would like to be able to identify it instead @sudden geyser
because output is undefined?
Did you define data @sage bobcat
One message removed from a suspended account.
One message removed from a suspended account.

How to delete characters you don't want in an answer?
Imagine that the answer is <154> and I only want to keep 154
Or simply <string>.replace("<#","").replace(">",""") but in javascript
No
It's a python replacement
But
I want to do this in javascript for my bot
For my logs channel
Hi, I'm looking for a host for my bot can anyone recommend me any?
Free?
""" is for multiline strings
But i'm not coding in python..
@earnest phoenix you were answered in general
I want to do a similar thing for define my logs channel
<div class="quicklinks">
<a href="#">Calender</a><br>
<a href="#">Galleries</a><br>
<a href="#">Newsletter</a><br>
<a href="#">Contact</a>
</div>```
```css
.quicklinks {
background: #e3eaf2 url(./assets/qlink_arrow.png) no-repeat scroll 209px 23px;
border-left: 4px solid #cddbe9;
color: #001133;
display: block;
font-family: 'Montserrat', sans-serif !important;
font-size: 20px;
font-weight: bold;
height: 70px;
line-height: 20px;
margin: 0;
text-transform: uppercase;
position: relative;
text-align: center;
text-decoration: none;
width: 246px;
letter-spacing: 1.2px;
}```
@snow urchin bot can't be in a group dm
Anyone know how to get the text aligned
@slender thistle can you do a similar thing in js?
@earnest phoenix one of my friends managed to do it before, using that code
String.trim
@snow urchin a bot can't be in a dm group.... Don't try...
Even if it's possible in stable, all user methods are going to be deprecated in master or when v12 comes out
Does anyone know how to solve my issue
@earnest phoenix Yes more if it's paid and not so expensive
@earnest phoenix ???
Host
For my bot
check pins
Wait i will use a tranlate app 😓
Can't they use .trim to remove something from a string
trim removes whitespaces
When I want to define a channel of logs on my bot I have to mark the name of it(the name of the channe)
But
I want to be able to mention it
Example:
logs set #logs
the mention will appear in it's format, not in the name of the channel
I am obliged to do
logs set logs
@earnest phoenix but it's possible to remove <#> after
With code
just use a replace with a regex
What's the exact regex for replace <#>
the one i sent
Okay thank you ^^
\D matches all non-numbers
Okay good
/g for global
Yes
replace all matches with ""
no...
Oh...
Oh okay sorry 
`var p = args[0].replace(/\D/g,"")
message.channel.send(p)`
Thank you very much
😊
👍

@broken shale you're using a fixed height and a fixed line-height
your height is 70, while your line-height is 20
either make line-height equal to height, or use padding instead of both
you dont even need to define height, you can just use line-height or padding, and remove the height rule
you also dont need position:relative
rite so i have this db for prefixes, and same for log channels
prefix = await db.fetch(`db.prefix.${message.guild.id}`)
and the code to set prefix is simply
db.set(`db.prefix.${message.guild.id}`, args[0])
and it works fine cause I can use the prefix that i set just fine, then when I go to use it in my nodejs express file the same code as above to fetch the prefix, returns undefined, and I have NO IDEA why
app.get("/getInfoDASH", async function (req, res) {
let parts = url.parse(req.url, true);
let query = parts.query;
prefix = await db.fetch(`db.prefix.${query.guild_id}`)
Any idea wat am doing wrong?
I have this bit of code ```js
fs.readdir("./commands/", (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
if (!file.endsWith(".js")) return;
let props = require(./commands/${file});
let commandName = file.split(".")[0];
console.log(Attempting to load command ${commandName});
client.commands.set(commandName, props);
});
});
fs.readdir("./events/", (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
const event = require(./events/${file});
let eventName = file.split(".")[0];
client.on(eventName, event.bind(null, client));
});
});``` but it's spitting out Cannot find module './events/commands', it's supposed to look for files, not other folders, for example i'd have a guildMemberAdd.js in the ./events/ folder, not another folder
you cannot call ./events/commands because it doesn't end in a .js file, so node assumes you're trying to use a module from node_modules iirc
try using ./events/commands/cmd.js
wasn't exactly it, but you did make me realize that I needed an if (!file.endsWith(".js")) return; in the fs.readdir events section, thanks :)
@valid frigate requiring ./events/commands will either try to require ./events/commands/index.js or ./events/commands.js
?
just a fyi
I need help making a bot
can i get some help with haveing my bot send links because I have it set to send a link and it doesn't send it
it justs skips it
Me to I need help
what
dad faq 3 @midnight glade
Click the link to get more information on the question:
3) How do I make a bot?
@earnest phoenix that is a little vague
read what the bot said
What about it
Yeah, you can do things like ```js
message.channel.send("https://google.com")
@earnest phoenix
@midnight glade it tells you how to make a bot?
@midnight glade did you read what the bot said? also dont go around dming people
Oops
And what exactly do you need help with
I can send a screenshot of the code that's supposed to send the link I think I'm using discord js
twist smh
👀
lmao
👀
they think
when I look at discord js I think it's just normal JavaScript so I get them to confused
🤦
I’m soooooosooo confused
what are you confused about? also how old are you?
Jesus
?
do you know what programming/coding is?
making a bot requires knowledge of programming
I’m 12
rip
I just want a bot
come back when you're 13
Rip
lol
@eternal mesa
?
Beaned
-b 622188328128872488 Under 13
Banned XILΣD☫FAZE☔🌧#7063 (@midnight glade)
he now knows what beaning is
@earnest phoenix JavaScript and Java are 2 very different things just so you know
um welp this shows I don't know very much about coding anyways here's the picture
and your question is? lol
first off its not a valid link for invites
if its about the link
i think it is
it is
after the gg do a /
not a dot
ok but it just skips over the link also i put in the Slash
it's like it's not there
do you have link preview disabled in your discord settings?
I'm on mobile so I don't know
but it does show another link when I do the command to show my bots invite link
so other links work but that one doesnt? wtf
but the bots invite link is just on its own
I don't get why it doesn't do the server invite
this is going to be a really stupid question. have you added that link in your code since restarting your bot
make sure you save the file as well
^
I made sure to save the file and I just restarted the bot and it still doesn't do the invite link
check your streamer mode settings
I'm using discord mobile so I don't think it has streamer settings
I'm an idiot I added the link to a different command
Lol
sorry for wasting your time
Guys how do I make a bot?
Thanks
I wrote my script and copied my token in and everything, but when I go to run it I get
NameError: name '*****************************' is not defined
I'm using python and a bot template from the internet
bot templates are not usually right, https://discordpy.readthedocs.io/en/latest/ read here to get started
the script for the bot itself looks fine
is the star spam supposed to be a string
client.run(NjI4NzI4MTczNjIxODA1MDc2.XZPfvg.FuJ3mkyGKYmwXJ07nvTZu8AkCp0)
NameError: name 'NjI4NzI4MTczNjIxODA1MDc2' is not defined``` is a bigger look at the error (I regenerated after I got the error so this token's no good for people look to steal 👀
go reset your token
nvm
Its a string
strong 
search up python string.
@sudden geyser shut your moth
okay my mouth moth can no longer open
Tnx
you think something before 147 is bad?
I found a page of python strings, not sure I follow what i need from it
OOOOOOOOOOhhh
I feel so dumb
I was missing the quotation marks
you shouldn't have to define the token
idk but i added quotation marks between the parenthesis and it worked
Says bots online
How do I add it to my server lol
a simple google works 
its ya boy with another question about the same code, js fs.readdir("./commands/", (err, files) => { if (err) return console.error(err); files.forEach(file => { if (!file.endsWith(".js")) return; let props = require(`./commands/${file}`); let commandName = file.split(".")[0]; client.commands.set(commandName, props); }); }); Basically, say I have multiple folders to categorize commands, like ./commands/moderation, and ./commands/informational, would I do another forEach kind of deal, similar to how all of the files are recieved in the ./commands/ but for folders, or is there a different way to go about this that would be better?
basically yeah add another
Not really answering your question (sorry), but you might want to change if (!file.endsWith(".js")) return; to something that checks if the file is a directory
the logic is plain simple:
forEach folder in /commands
forEach command in /commands/-folder-
load command
^ this
would there be an advantage to changing that bit of code up, like is it faster, less prone to failure or something, etc. @zealous veldt
Well, there are nested directories, no?
lol
2 questions: 1) Is there a way to have a bot output a link, but the link is shortened to some text, like "www.google.com" => "google"? 2) Is there a way to do something when a link is hovered, like show an image?
You can use markdown inside of embeds to make text a link
but hovering is out of your control
ah ok. lemme see if i can find how to use markdown within discord.js
It's not different for discord.js
discord text formatter is a markdown formatting engine
so if you send text with markdown, discord will handle it
I tried [url="https://somelink.com"]Link[/url], and <a href="https://somelink.com">Link</a>
Those didnt work
@zealous veldt
and in an embed using [https://google.com](Google), this did not work either
wait
ah ok. makes sense since the url would attempt to use the brackets
is there a way to create a non-static one? like so: `[${siteName}](${siteURL})`
I tried this, and it didn't work
@zealous veldt
thats because you have ` around it
cancelling it out
[`${name}`](${url})``` would work
okay. lemme test
That didnt seem to work. Basically I am creating an embed, and heres the whole code line: javascript .addField("**Link:**", `[${site}](${url})`, true)
Even putting backticks on the inside didnt seem to work
I guess the next best thing is: javascript '[' + site + '](' + url + ')'
but that doesnt seem to work either
no that does
i misspelled something lol
show what the first one puts out
my reload command wont work
if(!args[0]) return message.channel.send(`${emote.cross} Invalid Arguments **${prefix}help reload** for more information!`)
let commandName = args[0].toLowerCase()
try {
delete require.cache[require.resolve(`./${commandName}.js`)] // usage !reload <name>
bot.commands.delete(commandName)
const pull = require(`./${commandName}.js`)
bot.commands.set(commandName, pull)
} catch(e) {
return message.channel.send(`Could not reload: \`${args[0].toUpperCase()}\``, e.message)
}
message.channel.send(`${emote.tick} Successfully reloaded the command \`${args[0].toUpperCase()}\`!`)
console.log(`Reloaded \`${args[0].toUpperCase()}\`!`)```
actually dw
i got it
is .setColor("") broken?
]]moreinfo
If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.
const mongoose = require("mongoose");
const botconfig = require("../botconfig.json");
mongoose.connect(botconfig.database, { useNewUrlParser: true }, err => {
if (err) console.error(err);
console.log(mongoose);
});
const RP = require("../models/rp.js");
exports.run = async (neko, message, args) => {
const user = message.mentions.users.first() || message.author;
RP.findOne(
{
serverID: message.guild.id,
userID: user.id
},
(err, bio) => {
if (err) console.error(err);
if (!bio) {
const NewBio = new RP({
bio: args[1],
userID: user.id,
serverID: message.guild.id
});
NewBio.save().catch(e => message.channel.send(e));
}
if (bio) {
const Bio = new RP({
username: user.username,
userID: user.id,
bio: args[0]
});
Bio.update().catch(e => console.log(e));
}
}
);
};
module.exports.help = {
name: "setbio",
aliases: []
};
so i tried some ways now to update something if it already exists. None of them worked. Please Help
Send the error
@zealous veldt you can set the text it says when you hover over a link
in markdown
@earnest phoenix there is none :/
What’re discord tokens digested in?
well uh can any1 help me?
I’m browser oauth how would do I redirect back to something after a login? Like rather than using sessionStorage, is there a way to pass on query through discord oauth
use your redirect uri
is it against tos to have a google command?
No







