#development
1 messages · Page 328 of 1
event.guild I presume
@north fog that is a correct way to make an event
client.on("message", message => {
if(message.content.startsWith(prefix + "get")) {
message.channel.send(guild.ownerID); //owner id
}});```
correct
for owner id
var owner = event.guild.ownerID
if(owner === event.message.author.id)
{
// step 5
}
else
{
// send a m,essage to the channel and say that you're not allowed to do it
}
I'm using allman for JS now
I'm beyond caring
😉
Deni, I got a question, do you know any coding (just to be sure) like javascript ¿
@shrewd field you should also get a linter... it'll help u to detect sum brackets nightmare.
i know coding @north fog
and @shut remnant i have linter
hye
403
this gives me
var owner = event.guild.ownerID
if(owner === event.message.author.id)
{
// step 5
}
else
{
// send a m,essage to the channel and say that you're not allowed to do it
}```
its message.guild.id
event is not defined
ok
you would know that, if you looked at the documentation Deni
know what
how to do anything you ask
it also depends how you declare the fields
they tell you everything you need to know
ok
^
he is
yes lizard
const owner = message.guild.owner gives you the owner
if you want the id do owner.user.id
ok
get command person's id
get guild owner
check if command sender's ID === guild owner ID
if it isn't, error
if it is, do what we said earlier for getting IDs
i want this lizard
ok so then check if the author's id equals the owners id
if(message.author.id === owner.user.id) {
// stuff
} else {
other stuff
}```
where i put this ^^
you don't
ok
Deni its guild.owner
that's not how you get the owner
he has a var defined called owner
_> oh god back to step 1 again
const owner = message.guild.owner gives you the owner if you want the id do owner.user.id
Deni, you can always try to look in the Discord API guild, there is a channel dedicted for Discord.js (and many more library's) you should try to look/ask there
i suggested that 2
there are more people that can help you, here is a mix of everything that try to help, its nice, but does not work always
^
guys
In d.py
I had a elif message.content.startswith("Help") command but I've made a $help [command name]
Well it sends the $Help command text
How can I fix it?
I know I need to use ctx.send but it doesn't work
(rewrite)
If somebody is able to help me than thanks
Well, I only know discordrb, but let me try: You need to pass the message.content split from the help to $help as far as I get it.
Just out of curiosity, if you're using discord.py, are you not using the built in help command?
do you know how does this streameur to make appear the people who speak on his stream? (It uses discord)
discord overlay ¿¿
I tried to find but impossible
It was most likely something custom that tracked the voice events for them and used a web source that had the html/js to handle it and make it look like it belonged with his overlay
It may sound complicated, but it's actually easier than it looks
a bot could track the voice events and handle it fairly easily
Discord streamkit @dense seal
I have seen but I doubt that this is just this simple plugin. Are you sure @fickle solstice ?
Hi @everyone I'm a newbie and I try to create my own bot but I've got a strange error :/
@wide basalt what did you set the ID to?
it needs to be the client ID which can be found in the application at the top
you need to go get the ID from the page @scenic crest screenshotted
well you need to go on the page to get the ID
what you have is called a "Discriminator"
it's something else
this value right here goes into the first input
IDs are unique -- discrims are not
thanks a lot but where is the page ?
then click on the application, or create a new one if you have to
IMPORTANT: If you create an application, make sure to add a bot user to it!
Thanks you 😃
Can you guys help me?
a public bot or double OAuth for the user bot @scenic crest ? 😃
@wide basalt don't make a userbot
they are against the Discord ToS
and sure @barren brook
public bot no oauth requirement
Ok so
you said I needed to add a bot user ? x)
Can you help my developer of discord with a command that Is hard @scenic crest
I can try
Ok dm me for a link
ooo thats what you mean @wide basalt
sorry I misunderstood
and nah why can't we talk here
it's easier
ig not then .w.
in which language do you develop bot ?
english
lol
Java and Kotlin
python for me
JS and Python are easy
I only develop bots in swift
weirdo
Rude
Nobody in C# ?
whew
Swift is actually really nice kek
discord.net, no
yes
replace "YOUR_ID_HERE" with your client ID
@wide basalt
can you send the link you used?
double check the client ID
div {
background-image:
url("https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png");
}
so anyone
no
ive done that but it doesnt work
Do it to the .profile
body { }
Maybe add !important
Body will make the image distorted and shit actually anywhere
If height and width isn't added and what not
split
body { background-image: url("https://i.imgur.com/SvnuN4M.png"); }
it comes out like that in text
Ok now add important
Before the ; add !important
<style>
body {
background-image: url("LINK TO DIRECT IMAGE HERE");
}
</style>```
Here
Add that to your description just add the link
@topaz fjord
oh i see ty
Can I have a script,For a ! support so that a HR can gi ti the server to help?
My friend is a trusted and I know him as a friend putside of discord and he works with me and I want him to put a command in thst I cant do so is there a way to do so?
Well you can allow them to turn off the bot pretty easy, to allow them to turn it on would require them having a way to talk to whatever is running the bot
To allow them to turn off the bot you just need to make a command that checks if the user ID of the person calling the command is equal to the ID of your friend, then calls logout or whatever your library uses
Ok,How do I do the command like the script for it?
What language is your bot?
I forgot can you tell me the languages to remember?
As said
or even knowing any languages
True. Explaining how a library works is difficult if I have to explain the language underlying the library at the same time. It's best to learn the language first then learn the library
How to learn the library?
learn a programming language first
then learn a library
for discord
then make a bot
then implement features you want
What are the languages?
Just about any works, but Python and Javascript are two favorites
there is no comprehensive collection of "the languages"
however, there are a limited subset you may like to use
that are the best for discord
Ill give a script to have you tell me the language.
There are a whole lot of programming languages. If feeling vindictive, I could recommend Piet or Malbolge
const Eris = require('eris');
var bot = new Eris('YOUR TOKEN')
bot.on("ready", () => { // When the bot is ready
console.log("Ready!"); // Log "Ready!"
});
bot.on('message', (message) => {
if(message.content.startsWith(";support")) {
bot.createMessage(msg.channel.id, "Insert stuff");
}
});
bot.connect();
Is the script.
Ok,Im quit good at javaScripts.
One sec...
Ok
Yep that's JS
So how do I add the scripts?
@lime falcon how do I add a script as I am trying to make the bot
wrong wrong wrong
?
I have Javascripts.
do you have node?
No. I dont think so,I get the scripts from a friend of mine.
does your friend know how it works?
Yeah.
you need to get node.js first
really?
Did you just....
Ohh
not literally send a GET http://node.js
Ill go on laptop at 7:30 EST.
@barren brook Why are you trying to code on a phone anyway >_<
everyone knows that discordblocks for android is the best development environment on mobile phones for making discord bots
same
thanks
Ima ask my mom for my laptop.
LMAO
how do i write an email to discord
you and that 7 year old are violating the Discord terms of service
yeah right
If you're such a good Roblox scripter, why don't you use lua instead of JavaScript @barren brook
Anyone interested in helping with my bot? You need to be good with working on stuff using many API's OR you can help with the back end database systems... I'm making a bot that acts as a bridge between Discord, normal phone calls, SMS and many other messaging platforms such as Telegram, Email, WhatsApp, Facebook Messager, a Socket.IO chatroom, IRC, and more. We're using twilio for SMS and voice calls right now, but we're open to change. We haven't decided on a database yet, so if you'd like to use a certain database, be prepared to explain the pros and cons of it as well as why it will fit our needs better than another option. Knowledge of server-side JavaScript is required. DM me on Discord (moose#3054) or email me: cooper@moosehub.xyz
interested.
Eh.. too busy with KawaiiBot, Hatsuse Izuna, my own site, work... Etc
👀
What happened with KawaiiBot you got it back now?
@inner jewel What do I do now?
hmm
i guess that's jdk 9
downgrade?
If I downgrade, can I also change the version of the project?
I meant like JDA for the project
unless you dont do that
JDA was built for java 8
kk
downgrading to it won't affect jda
make a folder "src/main/java/space/passthemayo/testbot"
wait for it to mark as sources root
(should show up a blue icon)
¯_(ツ)_/¯
anyone good with js can help me
if (!message.member.voiceChannel) return message.channel.send('You are not in a voice channel!');
if (!serverQueue) return message.channel.send('There is nothing playing that I could skip for you.');
serverQueue.connection.dispatcher.end('Skip command has been used!');
return undefined;
(node:36060) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
it skips twice then when i try to skip again i get this
Add a slight delay to your play function
Dunno if java9 related but my bot use 800mb more ram :/

🤔
lol
800mb wtf 
@wanton plover do jda or d4j evrn support j9
shouldn't we kick mister 10 year old
If coded properly everything support j9
you fetch them
like this
when i do for example "logs" it gives me the type of the audit log that happened a while ago
@bitter sundial
this is what i mean
^^
I don't get what you mean
i mean
if i type
-logs
i will get the target of the last made audit log
huh
tonkuu
so are you wondering how to make that command
or a specific part in it that you don't understand?
how to make it
so first of course you fetch it (see what I linked above)
ok how to fetch
look at the docs
i dont understand what this http://prntscr.com/gtmmrc means
it's optional
and how to make it
so what to do
like this
@bitter sundial i have this what to do
message.guild
message.guild
ok
this is what i got
i want it to say what is the last audit log entry that happened
you can't put it inside the reply
you have to call the function
wait for the promise
huh
get the last one and send what you want from that
what do u mean by call the function and wait for promise
what is a promise
get what last one
calling function fn means fn()
and waiting for promise means using then or await in an async function
When will someone look at my bot?
never
or await
:c
message.channel.send().then(()=>{})
@lapis beacon #commands or #265156361791209475 k thxbye
^
with this how can i make a command that gives me the last audit log entry that was made
message.channel.send().then(()=>{})
sometimes it's better to learn by doing
but if it's your first lang then deffo learn it first
look
the thing is
i dont know how
if i know how i would start trying then if i dont succeed i will come here ok
you don't know because you haven't learned the language
you should study that more and you could understand the docs and know what you're doing better
we can't just spoonfeed you and code your bot for you
can u give me
there's a button for it
http://google.com/ is a good one
depends your learning style
sry ur right, google is too advanced
if you want to learn by doing, codecademy's good
ok what else
since javascript is also a web-based sript, most of the basics could be learnt from https://www.w3schools.com/js/default.asp
in some hours or maybe a day
wait
wasn't you the guy who got banned on d.js for not knowing js and always want spoonfeed
i remember 
huh


-help
use !help it's better
How do I bot
I went roblox bot any bot mekar plz halp
ok
the command for it is`
client.user.username
huh
tonkuu
@Tossdsnkku#0950ssss.
that is how you get a username yes
except it is your bot's username
huh
i want the member
the human
not the bot how
with what i define this http://prntscr.com/gtp1me
If you read the docs you would have understood some of this
Are you trying to get the author of a message or from a user ID?
No
If you did you’d see how to set it
Get the author of the command used
message.author
message.author.username
when i do that i get message is not defiend
because it is outside the event listener
how can i get it inside like this
you move the embed calls
?
what is
That embed builder
yeah most libraries have it now
May have to add something to my lib like that 🤔
You dont have that in your lib wew
v
You have a lib? 
It's mostly for internal use
Hell I dread the day people start using it.
xd
same
I don't have enough time to fully support it
Especially since it was mostly designed for us and our uses
Why it's lowlevel. On the teir of DIO
We provide high-level support via another lib.
How do i add a command to change the bots name in node.js???
@earnest phoenix library?
node.js (discord.js)
I have never used js but do you have to wrap the (message.author.username) instead of without the brackets 
Wat
I use a bot
@earnest phoenix you have: const client = new Discord.Client()
or
const bot = new Discord.Client();
He was talking about the message event
what if he has const somethingelse = new Discord.Client()?
msg.channel.send(`Hello there!`)
},```
:^)
what has this channel turned into
Its turned into #265156361791209475
how can i explain....
This channel has turned into the 24/7 Deni helpline
@earnest phoenix to change the nickname is: client.user.setUsername('username here')
no
I want it to change its global name for events like i put a halloween name
Yes
const args = message.content.split(" ").slice(1);
const client = new Discord.Client();
client.user.setUsername(args.join(" "))
},```
Is that to change the name
yes
Thx
check the docs
i didi did
He never checks the docs 
BECAUSE IT IS AN ID

Literally right next to it
@shrewd field read the docs before asking questions please
ok
All your answers are probably there
which part of the docs
RichEmbed
..
whatever class that you need docs from
in this case it’s RichEmbed as tonkku said
ok
The discord.js docs are the best i have seen how can you not understand it >_<
@shrewd field you can only do it with the old embed system
what
nvm
Hey guys, I'm trying to figure how to make an on/off toggle for commands per server. How would I accomplish this?
@earnest phoenix are you using some kind of data storage yet
In Python, forgot to add that
I can do JSON storages
That's as far as my knowledge has taught me
I personally hate it for mass storage but it's your pick
so this is what I'd do
in the per guild storage file
have an array of disabled command names
and in your command executor
if the command name is inside of the disabled command names array
then the command is disabled
Okay I see what you mean
That's doable then, I just wasn't too sure where to start but that gives me a good foothold of what I should do
Thank you <3
nws ❤
https://i.imgur.com/mDKllvq.png I like using class structures with json its so good and easy since public objects are saved to json and private objects can still be used in functions for temp data
@welcomeset.command(pass_context=True)
async def toggle(self, ctx):
"""Turns on/off welcoming new users to the server"""
server = ctx.message.server
self.settings[server.id]["ON"] = not self.settings[server.id]["ON"]
if self.settings[server.id]["ON"]:
await self.bot.say("**I will now use welcomeimg.**")
await self.send_testing_msg(ctx)
else:
await self.bot.say("**I will no longer use welcomeimg.**")
fileIO("data/welcome/settings.json", "save", self.settings)
Would this seem right?
ok haha
is "ON" in JSON?
yea
I have an ON and OFF in the json, with guild ID's in the corresponding list
okay
I'll correct that then
oki doki, thought I'd check in for corrections before I ran it c:
Quick question: is it possible for user ID's and guild ID's to ever conflict?
no
Alright, thanks
"Snowflake" type implied that but I didn't see it stated, so wanted to double check
Just do message.author.tag
how do i warp this in a timeout
const dispatcher = serverQueue.connection.playStream(yt(song.url))
.on('end', reason => {
if (reason === 'Stream is not generating quickly enough.') console.log('Song ended.');
else console.log(reason);
serverQueue.songs.shift();
play(guild, serverQueue.songs[0]);
})
.on('error', error => console.error(error));
dispatcher.setVolumeLogarithmic(serverQueue.volume / 5);
serverQueue.textChannel.send(`🎶 Start playing: **${song.title}**`);
}
He is offline
He’s not in the server?
No not invis people see look at my status and ping me
@prime cliff
so anyone have an idea
Oh
idk why its not working then
to wrap the .on in a timeout
I have a developing question.
Sure
I want to know as I know how to make a bot I just I have scripts but I dint know how to put the scripts in...
What language are the scripts
Java.
lel
What one of the java scripts?
Umm... (I dont really think I can ansee that question)
what
He cant see the extenstion @inner jewel
also want to know as I know how to make a bot I just I have scripts but I dint know how to put the scripts in... what is this supposed to mean?
@barren brook

I would like to say,I use node.js. If thats the answer to the question.
kk

Ya.
Send the code
So the script?
node.js isn't java btw
Yea
java and javascript are completely different languages
I Javascript.
Send the script
Ok.
'help': (msg) => {
const helpMsg = [
`Prefix is `${keys.prefix}``,
`(Any message)`,
];
msg.author.send(helpMsg.join('\n'));
msg.reply(`Message sent to ur DM's!`)
},
um
Um?
that is not proper js
^^^
Let me try fixing it.
1st of all, its not an array and u use []
const helpMsg = [
`Prefix is \`${keys.prefix}\``,
`(Any message)`,
];
msg.author.send(helpMsg.join('\n'));
msg.reply(`Message sent to ur DM\'s!`)
}, ```
ok
nope
'help': (msg) => {
const helpMsg = [
`Prefix is \`${keys.prefix}\``,
`(Any message)`
];
msg.author.send(helpMsg.join('\n'));
msg.reply(`Message sent to ur DM\'s!`)
} ```
u dont put a comma at the end of the array
do i want it to randomize the messages in the array?
yes
Um; Should I go to it?
yes
Ok.
pls learn basic-er javascript
Ok.
or use lua
ew
because roblox scripting uses the same language
I'm also a roblox scripter.
another roblox scripter....
const Discord = require('discord.js')
const fs = require('fs')
const moment = require('moment')
exports.run = (client, message, args) => {
if (userData[sender.id + message.guild.id].lastDaily !=moment().format('L')) {
userData[sender.id + message.guild.id].lastDaily = moment.format('L')
userData[sender.id + message.guild.id].money += 500;
let embed = new Discord.RichEmbed()
.setAuthor('Daily Reward', client.user.displayAvatarURL)
.setDescription('You got $500 added to your account')
} else
.setAuthor('Daily Reward', client.user.displayAvatarURL)
.setDescription('You already collected your daily reward! You can collect your next reward ' + moment().endOf('day').fromNow() + '.')
message.channel.send({embed})
}
im getting an error for the .
for .setAuthor
after the } else
i dont know what i can do
ecks dee
nice indentation
needs some visual studio code™
xD
i do use visual studio
code
now
i fixed that but i failed here
const Discord = require('discord.js')
const fs = require('fs')
const moment = require('moment')
exports.run = (client, message, args) => {
let userData = JSON.parse(fs.readFileSync('Storage/userData.json', 'utf8'))
let sender = message.author
let embed = new Discord.RichEmbed()
if (userData[sender.id + message.guild.id].lastDaily != moment().format('L')) {
userData[sender.id + message.guild.id].lastDaily = moment().format('L')
userData[sender.id + message.guild.id].money += 500;
let embed = new Discord.RichEmbed()
fs.writeFile('Storage/userData.json', JSON.stringify(userData), (err) => {
if (err) console.error(err);
})
embed.setAuthor('Daily Reward', client.user.displayAvatarURL)
.setDescription('You got $500 added to your account')
} else
embed.setAuthor('Daily Reward', client.user.displayAvatarURL)
.setDescription('You already collected your daily reward! You can collect your next reward ' + moment().endOf('day').fromNow() + '.')
message.channel.send({embed})
}
the embed isnt showing and im not getting any money eitehr
help
step one
dont store data that is frequently changed or accessed in json
Well he copied and pasted
and this is money
/balance
anidiots guide doesnt have that
just a points based system
link?
omg
xD
To me it looks like it
What are you trying to fix
its not sending the embed or adding any money
no error
wait nvm
{"258970604005359616343572980351107077":{"money":1000,"lastDaily":"Not Collected."}}
TypeError: Cannot read property 'lastDaily' of undefined
its not a vaue
Make it eaiser
Do lastDaily = 1
Means they have got it
0 is false
Plus
What is that id or giant string
258970604005359616343572980351107077
What is that
thats senderid + guildid
Why combine it
idk
its for
guilds
so it can seperate it so when i do a command that shows global highest
and guild highest
Dont combine it then
wut
now im trying to add subfolders
let commandFile = require(./commands/administration/${command}.js) || require(./commands/developer/${command}.js) || require(./commands/information/${command}.js) || require(./commands/moderation/${command}.js);
how could i loop this
im trying to loop it with fs
setInterval
You can loop with normal js
i dont know how to loop them
not fucking fs
setInterval forEach For loop @earnest phoenix
example?
Nope
.-.
Im not going to spoon feed
Im helping just not spoon feeding
^^^^^^
lol 6 bots
@timber jungle
@trail wing
hi
guys how can i make a command that responds with the owner name
i tried this but doesnt work http://prntscr.com/gtyt2n
remove member
idk i will try
i want the owner of the guild
nope
it is an error
tonkku
@bitter sundial
what do u think
you are sending an empty message
RTFM
i did
what do u mean object
do you not know what an object is in coding
come on dude that is basic stuff
🤦
then what
just do research
on what an object is
not gonna spoonfeed
what is super basic stuff
ok
announcement code error http://prntscr.com/gtz4mn client.on(message, message => { if (message.content === "/announce") { let modRole = message.guild.roles.find("name", "Moderators"); if(message.member.roles.has(modRole.id)) { let announcement = args.join(" "); const embed = new Discord.RichEmbed() .setColor(0x00AE86) .setTimestamp() .addField(New Announcement by ${message.author.username}, ${announcement}) client.channels.find("name", "bot_testing_room_2").sendEmbed(embed); message.channel.sendMessage(👌 Annoucement sent to #bot_testing_room_2) } else { message.channel.sendMessage("**Error:** \n You dont have permission 'Moderators' to announce") } )};
please
use codeblocks™
^
@tawny lava can you fix it
¯_(ツ)_/¯
client.on(message, message => {
if (message.content === "/announce") {
let modRole = message.guild.roles.find("name", "Moderators");
if(message.member.roles.has(modRole.id)) {
let announcement = args.join(" ");
const embed = new Discord.RichEmbed()
.setColor(0x00AE86)
.setTimestamp()
.addField(New Announcement by ${message.author.username},${announcement})
client.channels.find("name", "bot_testing_room_2").sendEmbed(embed);
message.channel.sendMessage(:ok_hand: Annoucement sent to #bot_testing_room_2)
} else {
message.channel.sendMessage("**Error:** \n You dont have permission 'Moderators' to announce")
}
)};
new?
.addField(New Announcement by ${message.author.username},${announcement})
this is the problem
um
I just told you what's the error
or you can fix it yourself
.addField(`New Announcement by ${message.author.username},${announcement}`)
my code knowledge is not very good
How do you write so?
error code How do you write so?
```js
// your code
```
🤦
😦
if (message.content === "/announce") {
let modRole = message.guild.roles.find("name", "Moderators");
if(message.member.roles.has(modRole.id)) {
let announcement = args.join(" ");
const embed = new Discord.RichEmbed()
.setColor(0x00AE86)
.setTimestamp()
.addField(`New Announcement by ${message.author.username},${announcement}`)
client.channels.find("name", "bot_testing_room_2").sendEmbed(embed);
message.channel.sendMessage(:ok_hand: Annoucement sent to #bot_testing_room_2)
} else {
message.channel.sendMessage("**Error:** \n You dont have permission 'Moderators' to announce")
}
)};```
// your code
do you have the possibility to make a statement ready for me
okey change
you're missing something in that line
Something vital
how so?
Think
you're missing something important
lmao
enough is not causing either
?deneme
send multiple embeds 
^^
🤦
Look I take the code of the other guy
const embed = new Discord.RichEmbed()
.setColor(0x00AE86)
.setTimestamp()
.addField(`New Announcement by ${message.author.username},${announcement}`);
const embed2 = new Discord.RichEmbed()
.setColor(dick)
.setTimestamp()
.addField('xd');
msg.channel.sendEmbed(embed)
msg.channel.sendEmbed(embed2)
I don't use D.JS so
const embed = new Discord.RichEmbed()
.setColor(0x00AE86)
.setTimestamp()
.addField(`New Announcement by ${message.author.username},${announcement}`);
const embed2 = new Discord.RichEmbed()
.setColor(dick)
.setTimestamp()
.addField('xd');
msg.channel.send({embed})
msg.channel.send({embed: embed2})
Oh yeah sendEmbed is Deprecated
ye
-bots @earnest phoenix
@open oar 
avatar looks like a japenese porno
it is
Cannot read property 'toString' of undefined idk how fix this :/ its my old old OLD code mine when was d js 8.10 and i trying test stuff make read api from txt file
if anyone up help
wat
AHH.. this partnership cog is going to be the death of me lmao
const Discord = require('discord.js')
exports.run = (client, message, args) => {
let member = message.mentions.members.first()
let content = message.content.split(' ').slice(1).join(' ')
if(!member) return message.reply('Please mention a member.')
if(!content) return message.reply('Please enter something.')
message.member.setNickname(content)
}
im getting an error
of privilege too low
but the bot has higher role than user
use member.setNickname instead of message.member.setNickname
@earnest phoenix if you're the guild owner they cannot modify your nickname regardless of role hirarchy
that's still a fact though
ik
sure @ebon helm
like everything

