#development
1 messages · Page 635 of 1
who help me to do a mention prefix in discord.js?
better prefix
?
var prefix = ‘!’
if (message.content.startswith(prefix + ‘command name here’)){
//run code here
}```
Oh ok
if(command === "command name"){
//command code
}
I can’t get into my laptop rn to show you but start a message collector with a timer of 10000 milliseconds
Alright, one second
I don’t get what you are trying to do, but ok
I try
He wants to be able to use his bots mention as his prefix
Along side a normal prefix such a /
But don't work XD
He wants it so you can do @some-random-bot ping and some-random-prefix ping.
^^
I haven't looked into the change log of 11.5.2 so I am looking if anything in that stuff has changed before I can give an answer.
thanks 😃
Is it possible to have an embed field with only a name and no value?
Nope
You could do ** ** as value to make it look empty.
But you can put an invisible character line below.
you can make the value a zws
I just set the description of it to achieve that
The blank space looks untidy though.
@sinful lotus hello buddy
It's a space where there's supposed to be text. It's not really made for an empty space
** ** works fine
luca said>>>>
Your bot was declined. Reason: Your bot doesn't have a (working) help command or obvious point of entry. Please make sure your bot has a help command or has an explanation in the bot description.
So make a help command or something
then
¯_(ツ)_/¯
^^
I'll try that, thank you.
but it has help command with command explanation
Can't use a bot that doesn't have a help or list of commands
then re-submit
Well then you didn't make it obvious what that is
it has
If they can't find it they can't use it lol. Just mention the help command on your bots description
but in another way
Well then mention that in the description
^
Yup
Was the help command unavailable during the submission?
If so, you picked a bad time to work on it.
noope
If your bot got declined, better ask the mod that declined it so that you will get more context on why it was declined
or at least make it respond when it is mentioned
does editing a BOT bump it to last place in the queue?
Haha okay 😛
but i highly doubt it does
I could see it either way, just wasn't sure
Unless you remove your bot its position in the queue is the same
Hello, i have a problem :
client.users.get("302502292215693313").send("cc");
And return :
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
Can u help me ?
Should you await anything?
@plucky sun python?
No discord.js
Ah
I didnt notice that 
😢
is get() awaitable?
If so await it first then send() on the result
Python?
Discord.js
Yep, python
They work for single line commands iirc in the console
Works just fine whenever
Even in classes and stuff?
I saw what was wrong. Its good
thanks 😃
You mean send a message?
I would really advise against sending your logs to a channel
If you wanna log certain things like your bot joining/leaving a server, etc then it's fine
Yeah idk about all logs. But I do have errors sent to a channel so I can easily see if something breaks
But if you're gonna log messages or commands I suggest to do that in the console if you don't wanna use a lot of bandwidth/get ratelimited if there's heavy usage on your bot
@plucky sun this error happened when the bot cant dm a user or when the id isn't valid
@woven sundial console log?
You mean error?
So my bot keeps going restarting when using music command, It used to work before coded bot with sharding.
Also the dispatcher doesn't set inside my map. discord.js
I'm gonna use Shard, but I have global values.The values must be synchronous.
Because they are used to intervene in SQL.
What can I do?
Is there a detailed example? (nodejs (discordjs))
So let’ say I’m hosting my bot on Heroku using github. How do I get stuff to save
someone will answer you if they can no need to mention that no one has answered your question in 5 messages
ok thx and sorry
how to use a lot of data as command
"prefix" : ["!", "#", "&&"]
in json file
this doesnt work
Json doesn't work like that
i read that i can use multiple values for one
i just dont know how to
create a data per server
i cant do that
you can
im currently hosting on heroku and it doesnt allow
oh
oof
ill host on gcloud later
Are you in python?
js
ah
y did you ask
Store it as a string
for my bot I did
G = ["G-", "g-", "@uncut widget ", "lazynekoisacutie "]
idk how it is in js
but yes
well you got a point
It's the same in js
i may store my prefix in file
not in config
but does json files work like i want?
No
Do what I did idk
^
ill do that
and i saw i can actually
but its like
json["prefix"][value]
I have multiple prefixes in a json file but i think heroku doesn't give permissions to fs to write file
but i dont want it
i got my answer thanks
Np
Why does the dbl website show a different server count every time you reload?
okay, Its showing 1785, I reload its showing 1780
and its my bot, It did not leave 5 servers, I can see in the logs
just saying but this is the same on every bot
So ping a website mod, maybe website mods can help you
@onyx summit DBL's infrastructure is sharded
and sometimes, some shards aren't up to date
making the count slightly inaccurate, but still close enough to be reliable
^ paradox has the rights words
is this also the reason why the upvote count is different in the card preview and in the bot page?
yes indeed
Hey, has anyone used Redis? If so can you briefly explain what it actually does and how to use it? @ me backs so i'm notified, thank you.
Object storage
It probs reset
pls help I'm using discord.js and I try to make my bot connect to a voice channel and when I try to connect it says '.name is not defined' when it clearly is defined in the discord js documentation. Ideas?
console.log(user.voiceChannel.name)
ping me if you have a suggestion - I wont get mad
@earnest phoenix The way you wrote it is NOT defined in the documentation
msg.author.voiceChannel isn't a thing https://discord.js.org/#/docs/main/stable/class/User
author a.k.a "user" has no voiceChannel properties
you want to do msg.member.voiceChannel.name https://discord.js.org/#/docs/main/stable/class/GuildMember
@high lava Thanks! I was thinking that msg.author would return the name of the person who wrote it, and adding .voiceChannel would return the name of the voice channel that the author is in, if he is in one
also user was a variable - forgot to say that
Well author itself doesn't return anything. You have to use its properties to get anything out of it. But author doesn't have the .voiceChannel property so you wont be able to get any Voice info out of it
can you get .id?
Also, are you IN a voice channel?
You have to be in one before it can return a name
Technically author returns a User object*
no, but that shouldn't matter. It shoud return undefined instead of a crash
If you don't handle it, then there's nothing you can do
What's the code of the command you're using?
If it's not too big
in what though?
now im confused
it works now, but you were right
it does crash if it cant read the name of the voice channel
thanks!
np
Although I'm still confused about how where you're using console.log, but as long as it's fixed. lol
Im using console.log() as a temporary debuging method. I will remove it if it works. 😀
Gotcha. I'm guessing you don't have a check to see if the user is in a channel first though. Try doing that to avoid errors if possible.
It should be as simple as ```js
if (!msg.member.voiceChannel) return msg.channel.send('Please connect to a Voice Channel.');
K
also, one more thing. I put a .catch() block with another console.log() and this is what it did:
Install FFMPEG
wha?
with npm install FFMPEG?
no
You'd have to do it in windows
I can't. No admin perms
It says promise rejection warning. So what I think is happening is that my catch block isn't doing what it's supposed to
it just says that
The real problem is that FFMPEG isn't installed and defined in the PATH of windows
K one sec
werid. I dowloaded ffmpeg via npm install ffmpeg in the exact folder where I run my API. It doesn't work
ok well I have to go. Good Night
How do i make a mention prefix i tried this https://sourceb.in/87d1d18f23.js but it didnt work
What?
Can I set size of .setThumbnail
Hello Mods?
Yes?
whats is Guild IDs
On the website? Like when filling out your bot application?
no
Then what do you mean?
Do not register the bot to add it to your page
Hey, so im new at using enmap as a db for my bot and when i run a guild prefix command my default prefix is undefined, i would really appreciate help from you guys.
I think you have a default settings somewhere?
Like, when it joins a guild it sets the prefix for it
Yea
Change your code, so it reacts to a prefix in your config, then you can use eval to set the prefix for every guild into the default settings. Then change the code again so it reacts to what is is supposed to
^
yes
this happened to me
(not using that db)
but I did that and it worked just fine
Yeah, you now probably have guildSettings.prefix as prefix, change that to /config.prefix
then do ```js
client.guilds.forEach(guild => /Whatever the code for adding something to the db is/)
ofc if you're using JS (I think)
and if you named your client client
client.guilds.forEach(g => client.guildSettings.set(g.id,clien. defaultSettings));
.>
No, You probably have this somewhere
const guildConfig = bot.guildSettings.get(msg.guild.id)
And then somewhere
guildConfig.prefix
e.g.
if (msg.content.indexOf(guildConfig.prefix) !== 0) return;
^
let configfile = client.guildConfigurations.ensure(message.guild.id, defaultGuildConfigurations)
And i used configfile.prefix
Yeah alright
Not the same way as u defined it
i used that
then change configfile.prefix to client.config.prefix (You must have a config file set up and defined)
Then run the eval to change it in every server
Then replace it with configfile.prefix again
In how many servers is your bot
lol
Do you have it set up that when it joins a guild, it set's the guild settings to the default settings
lmfao
Ye
that emote
Kick what
the bot
The bot?
the bot
the both
lmao
No no, kick the bot and re add, don't change any of the code
Oh ok
Since it's only in one guild
Do you have it set, so when the bot joins a guild, it set's the guild settings to the default settings?
In your guildCreate event.
hmm nope
Ah okay
Then, when that is done, kick the bot and re-add it to your server
And then you are all good to go
hm how do u reset to default when the bot joins the server
In the guildCreate event, set the guild settings to the default settings
client.settings.set(member.guild.id, defaultSettings);?
yeah
Show the code of the guildCreate event and your message event.
then, did you kick the bot from your guild and re added it?
That's possible
arrays are designed for that
well because i cant store data in other ways due to my hosting
ill try this then
but keep in mind that that wont store things permanently
I am writing again. I'm sorry.
A little urgent.
I'm gonna use Shard, but I have global values.The values must be synchronous.
Because they are used to intervene in SQL.
What can I do?
Is there a detailed example? (nodejs (discordjs))
Shard?
yes
What do you mean by Shard first
i think they mean sharding
sharding yes
I'm new to this.
I would use sharding but couldn't find enough resources.
What type of sharding are you using
I will use. I don't even know what to use yet.
I am stuck because my global values are very high and I have sql.
What do you recommend I do?
You can use internal sharding wich means everything still runs in 1 process
Yes it works but I want to use sharding to solve the slowness.
For example, 1 shard per 100 guilds
tbh sql supports sharding
also sharding means more memory usage
do you have a server that can handle sharding?
Right now, I don't intend to increase the number of shards too much.
I change the server if there is a problem. I can switch to paid servers.
I see, but I would clear one misconception
javascript is not slow
a single process can handle more than 4k guilds
if you have issues with slowness, and the guild count on process is not even close to 2.5k
I would recommend reviewing your code instead
its not slow, node is simply resource heavy
yes or the cpu/ram of the host
also get rid of the habit of using free servers for something public
yes thats another factor
It may be, but I want to solve it already. For the future.
If you want to solve the issue of slowness
what is the latency of your bot?
this is the things you need to ask your self.
- am I doing too much loops?
- am I doing a lot of un-needed things? (basically stuffs that you do even you dont need to)
- Is my host sufficient for my bot?
- Am I doing a resource heavy setInterval? or forgetting an interval?
- Is my bot's internet fine?
Node.js Runs on a single thread
Latency is the amount of time it takes for an event to be performed. @earnest phoenix
yes
a simple
while (true) console.log('1')
will break your bot functionality
it will not execute any code because its stuck there
causing delay if internet is bad
Oh, I'm dumb. You were asking what his bot's latency is, not what the definition is.

When a bot is loaded in a guild, there is a slight slowdown in the other.
The reason might be sql queries but I wanted to try using shard.
The bot's internet is no problem. but sql ...
dont use free servers, they underperform and are not made to run bots, rather they are there to run small websites
heroku
just move the bot in paid if thats the case
also another thing, how many sql you do on join?
A command has a min 3-4 sql query.That's one of the reasons for slowing down when there's a very guild query.
which is, again, because you are using free servers
yes
3-4 queries per command is a bad practice tbh
minimize your sql queries
If you want to check a value then cache the data in memory, then only call update queries when those values change
if possible just use one query
then we cant do anything about it,
4 sql statements is too much for a single event
either do some caching
then background storing
or optimize the code itself
its impossible that you cant optimize it in my opinion
hmm
I'il check back.
also check if you're able to use transactions instead of individual queries
and do it in async if you can
put the picture of gif as link
I have the link
.setFooter(`TEXT HERE`, 'IMAGE LINK HERE')
Hello
I have a question
I export my Glitch app to Github
And I have a question, Glitch do automatic repos?
no it just gets the project from github
glitch is also a repo
can anyone help me implement a custom prefix system in my bot?
What library are you using?
discord.js
Are you using its command manager?
Maybe that'll help https://www.youtube.com/watch?v=SZxwE8DOnTs
This series contains some errors. A new series is on the way to right these wrongs. T 2019 Discord.js Series: https://www.youtube.com/playlist?list=PLdnyVeMc...
That is custom prefix.
okay, ill give that a watch
Custom prefix means that the user in a server, could set a prefix whatever he/she prefers
oof
TSC is more for basic stuff imo.
I doubt you would have problems on KeyV
would i put the example in the main file or
Well yeah if you understand how to c0de
?
keyV is just like a map
@rustic obsidian yeah but js is very easy for beginners
and that would depend on your code

It is easy yes
I cant just say slam that on your code
no :'(
epp we are getting quite offtopic now
Oh wth this is not off-topic
u don't necessarily need to use anything to store prefixes beyond a json file
it's only if you need to run the bot on a server that it's useful to have a proper database
KeyV is just a convenient way to write key/value pairs to a database
JSON file as storage is never been good
If JSON was recommended for read and write I would be using that
but the problem it isnt
use mysql or mongodb
so just use a database, there are lots to choose from
common choice for no sql db
db are free
DBs are free
What is the best language to format a codeblock: ```lang ``` with for doing a queue?
except some
@warm marsh css ?
you dont have a server?
heroku lol
Ok
the worst of the worst
Thanks!
tbh that limits what you can do
just use what you have right now you dont have a choice
you can find a lot of exemples on google, and pick up one for codeblock
mongodb is not that bad
lol
its fine on its own right
i wonder if they will approve my bot this year
i want to see if the database crashes
^
if mongo db is bad or horrible
some big bots wont even use it
but the fact some big bots use it
means its fine on its own right
how do people actually afford to maintain servers for discord bots
I paid for it the first months it was live
Does anyone know if you can use some sort of trickery to prevent a thumbnail in a Discord embed taking up a whole column of space that it doesn't need?
so, there's more room for text....
you can't alter how anything displays on end user's screen
simply don't include a thumbnail
it doesn't contribute to anything anyways
oh well, I was hoping you could set some sort of height restriction
//defining the guild, imported from another file
const guildSchema = new mongoose.Schema({
id: String,
channel: String,
tracking: Array,
messages: Array
})
const guild = mongoose.model('guild', guildSchema)
module.exports.guild = guild
//use code
let g = new guild({ id: guild.id, channel: '589092182657335433', tracking: ['321242389106786314'], messages: [ m.id ]})
throwing guild is not a constructor
no clue why
worked with an extremely similar example when the schema was in the same file as its used in
new guild(. You don't just create a guild object...
Does anybody in here plays roblox I have a question
@young girder #memes-and-media
can bots fetch and interact (specifically: editing and deleting) with messages that have been sent before the bot came online?
Yes
so i would just use my librarys regular message fetching function, and i could interact with the message object it returns?
Yes
This might be a retarded question but I cant seem to find out why is it saying (JS) Identifier Expected
^^^```
At where the errors are
that doesnt seem right at all
why you have a DOT there
and wrong type of brackets/paretheses
Cause the directory of the file is response.data.stocks.1.description
plus if stocks isnt a function it wont even work
Im using axios
then do
response.data.stocks[args[0]].description
assuming stocks is an array
and args[0] is the element you want
Aight Ill try thanks
if (message.content.startsWith("!stock")) {
let args = message.content.split(" ").slice(1);
axios.get("https://api.torn.com/torn/?selections=stocks&key=1vpH5bIwSDLfkwX7")
.then(function (response) {
console.log(response)
console.log("StockID Command Executed")
let q = response.data.stocks.[args[0]].name
let w = response.data.stocks.[args[0]].acronym
let e = response.data.stocks.[args[0]].director
let r = response.data.stocks.(args[0]).current_price
let t = response.data.stocks.(args[0]).market_cap
let y = response.data.stocks.(args[0]).total_shares
let u = response.data.stocks.(args[0]).available_shares
let i = response.data.stocks.(args[0]).forecast
let o = response.data.stocks.(args[0]).demand
let p = response.data.stocks.(args[0]).requirement
let a = response.data.stocks.(args[0]).description
message.channel.send({ embed: x })
.catch(function (error) {
console.log(error)
})
.finally(function () {
});
})
}
});
This is the whole command btw
yeah youve got some editing to do there
also if you arent even using .finally then theres no reason to have it
Aight
in discord.js does presenceUpdate fire when someones status (online/idle/dnd/offline) changes?
appearently yes
await asyncio.sleep(10)
await client.change_presence(activity=discord.Game(name='e!help :)'))
await asyncio.sleep(10)```
This is too fast for be approved?
Why not a while loop with asyncio.sleep
At least make it 15-20
Hell, 30 to be safe
Here is a weird question but is there a way I can take my bots member and server count and display it on a website?
So I can go onto a website and it shows me the member and server count live.
My bot is using discord.py
sure, turn your app into a web app
this will allow you to host the bot and the website in the same environment, allowing you to choose which data you expose to the website
how would I go around doing that?
research it
i don't use python so i wouldn't know
in .net we use asp.net for webapps
ok thanks for the help ill research this
me bot is here!!!
yayy!
sry
(:
@twilit rapids yes i did it’s still undefined
Tnks Soup

xyber your solution worked perfectly thanks
👍
Hello, I am trying to connect my bot to a voice channel, but it says that ffmepeg is not installed, even though it is and I installed it with npm install ffmepeg-binarys and npm install ffmepeg-static like it says in the discord.js documentation
try @latest on the end
ok wait one sec
it looks like its taking a while to install. Ill be back in 5m
Okay
its been 10 mins fam
who can help me with canvas
Js? @earnest phoenix
I can help you if its in js
Just ask
Imo installing ffmpeg on Windows is a pain in the ass
I just downloaded it and added it to the PATH of my computer
I did it without admin perms. Illuminati Confirmed 🔺
Wait thats because I only did it for my account, but then why does it still say 'FFmpeg not found' when I clearly installed it on my account, and the program is looking within my account?
?
get the guild using its id
you have the id arg
all you need to do is to get the guild via its id arg in client.guilds
He's not understanding, I would help in spanish, but if I move to #memes-and-media someone will send us here and 🔁
You can do that in #memes-and-media if they really can't speak English
yes I think thats the best course of action as well
.fetch is a promise
you need to await it
and then you can handle the message it returns
what do you want to do
could you elaborate?
also thats wrong
its better to do this like
I am just trying to make it react to the message
but you didnt do a reaction code on resolved promise
I dont see any react there yet
Still aint working
what is your code
Its logging the message object but aint reacting
Sec
let reactionMessage = await reactionMessageChannel.messages.fetch(collected);
// It is a valid id, it logs in console (https://i.imgur.com/OSTgwJW.png)
await reactionMessage.react(reactionCollected);
Yes it is running async
what is reactionCollected
Its a reaction
ReactionEmoji I think to be exact
I can make it consoe log if U want
what reaction ?
try doing a simple code first
try to do msg.react() so that it will react to your eval msg
and see if that works
I see no reason for it to not work tho
cant test it on my bot due to the fact I dont cache emojis
unicode emojis works fine to me
Can we add a bot?
https://discordbots.org/bot/new @grim pond
I did not understand
You don't understand me, I think my brother, I'm an angry man Turkish petty officer
I don't know?
Take it to #general or #memes-and-media, thank you
I know what you mean. You want to know more about the requirements to add a bot to DBL; however, that is more appropriate for #general.
Look, the only thing left of the glitch ub site is where can I open it?
By the way, my English is how I am normally Turkish
I am failing to understand what you are asking. I would advise requesting for assistance in #memes-and-media with the language you speak.
What is the reason I can't add DBL Bot but I can't add it for some reasons?
Again, this is not a question for #development. Please take it to #general or preferably, head over to #memes-and-media and ask the same question in your language.
Let me see your code
Ok
You must use 2 parameters
For exemple js .addField("The title of the field", "The description of the field")
Oh no 😂
incidentchannel.send{banEmbed};
If the error is "RichEmbed field values must not be empty"...
oh
let banEmbed = new Discord.RichEmbed()
with ; ?
let banEmbed = new Discord.RichEmbed();
no
Your bUser isn't defined when you type the command

no
Restart the bot and type ">ban @Anybody"
Just.. the let bUser = message.mentions.users.first() || message.guild.members.get(args[0])
Okay
:D
let kUser = message.mentions.users.first() || message.guild.member(args[0])
Yeah
And if it hasn't reason, you havn't do that
Does guild.member even exist 
🤔
: )
let kUser = message.mentions.users.first() || message.guild.member(args[0]); or without ; ?
without
with
xd
As you want
Personnaly i never use ; x)
kuser.... is not a function xD
'Cuz message.guild.member(kUser).hasPermission("nanana")
xD
?
where to put ``message.guild bla bla xD
Where you has your "kUser.hasPermission"
Yeah
if(message.guild.member(kUser).hasPermission("MANAGE_MESSAGES")) return message.channel.send("**Aceasta persoana nu poate primii kick :cowboy:**");
It's good ?
Yes
:)
😂
Thanks 
Bitte ~
😂

Wait i must go
K
Why it shoudn't work ? :)
you're sending an empty message
if(!message.member.hasPermission("ADMINISTRATOR")) return message.reply("Sorry, you don't have permissions to use this!");
let text = args.join(" ");
message.delete();
message.channel.send(text);
?
estas tentando escrebir una messagen vacia, no estas mandando nada para discord
you're not sending anything to discord
well, what do you want to send?
with: Use >Say (message)
This series contains some errors. A new series is on the way to right these wrongs. T 2019 Discord.js Series: https://www.youtube.com/playlist?list=PLdnyVeMc...
Does anyone know why a bot could constantly be restarting itself at random times and also not restarting? It is running on a VPS which is definitely not faulty at all and even though the VPS is online, the bot isn't. When we restart the VPS, the bot comes online but doesn't respond to any commands, but it sometimes will respond to a ping with over 50k ms. After it has been online for a while, it will switch itself off while the VPS is still online and even while the bot is appearing offline, it sometimes sends extremely delayed responses to the ping command with over 100k ms. This does not happen all the time nor has it happened before yesterday; yesterday was the first time we experienced it and it was around this time, I don't understand how this could be two days in a row at the same time. It also is definitely not the code because we are running the exact same files with the exact same code on a test bot which is on a separate host.
Are there any errors logged in the console?
No
@earnest phoenix hard to tell since idk the code of the bot.
I have a thing in mind tho, does the bot work decently when you have a vps connection open and running? @earnest phoenix
When it is online and stable, it is 100% with pings of less than 100ms.
i've had issues like that and normally its due to blocking code and or the bot being spammed somewhere
might not apply here though
Maybe if I provide a link to view more info about the bot, it'd be easier to help.
https://discordbots.org/bot/582537632991543307
This is all we get from a debug event.
https://hasteb.in/emihidis.sql
@earnest phoenix which region is it hosted in
it could be that discord servers are having a shit in the region
you should test exchanging data with other websites other than discord
We tried running the bot on multiple hosts in which each host is in a different region.
same result?
Same issue occurred.
Hey
it's code that's faulty probably
Who help me please? : )
We have a test bot as well and the test bot is running the exact same files with the exact same code which is perfectly fine.
@rugged kelp the message you are trying to send does not have any content.
dunno if it's relevant, however discord can increase ratelimits for users that hit them very often
hence why they're dynamic
could be that
And what code for this ? @twilit rapids
That's a good point.
What do you mean?
For message
But would that prevent it from turning on?
There is no code to send an empty message.
@earnest phoenix does it have a visual interface?
not exactly sure, maybe there's something about reconnecting to the gateway that clears the ratelimit?
Follow up question from my stuff above^^
unlikely, but possible
No visual interface. We use an SFTP to manage files and there is a dashboard to restart the VPS and see stats.
Does it record the vps or something like that?
It shows how many resources we are using, that's it.
@rugged kelp
Split message (prefix + command) then get the rest by getting the splitted message by var[1]
its irrelevant, the issue occurs over multiple hosts, and the dashboard is for the machine, not the process
Yeah
Dont care it's simple coding
if there's different behaviour with same files but different accounts, it's more than likely discord did something on their end to the account
Idk how to put : (
you should try emailing them
granted there's 80% of chance that the discord support team won't help you and will redirect you to somewhere else but it's worth a shot
for .js
ok
We've sent an email but no response yet. Though, similar bots have reached an extreme amount of rate limits frequently and are running fine.
🤷 i can't explain that, pretty much no one knows how discord's backend works however it's speculated that first there's an automatic system to increase ratelimits then it's done manually
It's really confusing, hopefully Discord will be able to help. Thanks anyway.
big bots like rythm, dyno and mee6 have their ratelimits modified to fit the amount of usage, don't know for any other ones
@west spoke You found ? 
No, I said I dont use js
There is something called Google btw
Try again
@rugged kelp What do you want to do?
Send message?
Yes
this should work if you set your args right
@rugged kelp i give u code above??? it works fine...
What ?
``if(!message.member.roles.some(r=>["Administrator", "Moderator", "Admin", "Mod", "Owner"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
let text = args.join(" ");
message.delete();
message.channel.send(text);``
return message.reply("Sorry, you don't have permissions to use this!");
let text = args.join(" ");
message.delete();
message.channel.send(text);```
This is my code
And i need to send a message with: Use >Say (Message)
if(!message.member.hasPermission("ADMINISTRATOR")) return message.reply("Sorry, you don't have permissions to use this!");
const sayMessage = args.join(" ");
message.delete();
if(!sayMessage) return;
message.channel.send(sayMessage);
And message ?
?
And what message ?
what u mean how? 😂
use ur keyboard? xD
embed.author.icon_url: Not a well formed URL.``` What does this mean???
discord.js
if (message.content.startsWith('s)filewrite')) {
prefix = "s)filewrite"
args = message.content.slice(prefix.length).split(' ');
arg1 = args[1]
prefix = "s)filewrite " + arg1
args = message.content.slice(prefix.length).split();
fs.writeFile(arg1, args, function(err) {
message.delete(message)
if (err) throw err;
});
return
}
When I make a file using this command, it adds a extra space to the beginning. How do I fix it?
@shy turret args = message.content.slice(prefix.length).trim().split(' ')
so..
if (message.content.startsWith('s)filewrite')) {
prefix = "s)filewrite"
args = message.content.slice(prefix.length).trim().split(' ')
arg1 = args[1]
prefix = "s)filewrite " + arg1
args = message.content.slice(prefix.length).trim().split(' ')
fs.writeFile(arg1, args, function(err) {
message.delete(message)
if (err) throw err;
});
return
}
yes
that should work
.trim() removes any whitespace at the start and end of a string
wait no
not for the first opne
only the second one
thx
but args make hi,hi on the file if i run s)filewrite hi.txt hi hi
one argument is fine but 2 or more isn't
let me try soemthing
something*
nope i failed
if (message.content.startsWith('s)filewrite')) {
prefix = "s)filewrite"
args = message.content.slice(prefix.length).split(' ');
arg1 = args[1]
prefix = "s)filewrite " + arg1
args = message.content.slice(prefix.length).trim().split(' ')
fs.writeFile(arg1, args, function(err) {
message.delete(message)
if (err) throw err;
});
return
}
i fixed it
if (message.content.startsWith('s)filewrite')) {
prefix = "s)filewrite"
args = message.content.slice(prefix.length).split(' ');
arg1 = args[1]
prefix = "s)filewrite " + arg1
args = message.content.slice(prefix.length).trim().split()
fs.writeFile(arg1, args, function(err) {
message.delete(message)
if (err) throw err;
});
return
}
Final code
is the typical approval queue a few days or is it like a couple of weeks? 😛
ahh coolio
It will take time especially as its summer holidays
yea yea no worries was just curious! Must have glazed right over that part in the FAQ
]]faq 2 -clean
Click the link to get more information on the question:
2) How long is approval?
um... one question. Does my description have to be in english?
No
However it is helpful to provide an english translation of it
So that moderators can review it easier
i should yeah. thanks
I need help trying to get an generate a invite link by finding a channel This is what i have so far ```
let invitechannel = bot.guild.channels.find(ch => ch.name === 'General');
invitechannel.createInvite()
.then(invite => console.log(Created an invite with a code of ${invite.code}))
.catch(console.error);
let a = new Discord.RichEmbed()
.setTitle('Order')
.setDescription(Sent by ${message.author.tag})
.addField('Order Is', Content, true)
.addField('Total member count', message.guild.memberCount)
.addField('server name', message.guild.name)
.addField('Order ID', x)
.addField('Icon', message.guild.iconURL)
.addField('Invite Link', invitechannel)
.setColor(0x00ff00)
.setFooter('created at:')
.setTimestamp(message.createdAt);
message.author.send('Your order has bin Sent for 5$! You should see a friend request or Dm from our worker soon. At the end you can do i-tip to tip them')
Channel.send(a)```
let invitechannel = bot.guild.channels.get
let invitechannel = bot.guild.channels.find(ch => ch.name === 'General');```
let me fix that
also I just want to let you know generating an invite without the knowledge of the server owner is against the ToS
Is it
Yes






