#development
1 messages · Page 392 of 1
btw do people use the widget?
how do i find the role id?
in what lang
js
ok thx
still lost, it doesnt say how to find the role id or i cant find it or understand it if i did find it
iterate through the collection and find the name of the role?
after that you can just grab the id
hmm ok
Who knows how to code discord.py python?
MeeEee
I'm stuck on a command.
i'm sorry but i'm a geniune idiot, i have the role but i can't get the role id number
@dusty sandal turn on dev mode, ping role and get id
How would you make it so when a player says mute (user) it mutes them?
@earnest phoenix what u stuck on
ok thx
I cant find out how to mute people
I don't have it on me atm
I can show it later
It went like
async def mute (ctx)
i ping the role, but i cant right click to get id
Is developer mode onn
yes
Bot.say ("You are now muted!")
i can copy id of people but not role
I just need to add a line where it muted them
So ur thing is like async def mute(ctx): right
idk how to do this without spoon feeding XD
hm
Rn you just have ctx in your args right
Mhm
How would you add another arg for a user mention
@dusty sandal show code
Oki @earnest phoenix
ok
const { Command } = require('discord-akairo');
class MuteCommand extends Command {
constructor() {
super('mute', {
aliases: ['mute'],
args: [
{
id: 'member',
type: 'member'
}
],
clientPermissions: ['MANAGE_ROLES'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild'
});
}
exec(message, args) {
if (!args.member) {
return message.channel.send("**MEMBER NOT FOUND**");
}
return args.member.addRole(['M U T E']).then(() => {
return message.channel.send(`**${args.member} was muted!**`);
});
}
}
module.exports = MuteCommand;
Idk java but it says "m u t e" is not a snowflake
@topaz fjord this is my code
say I wanted to make a little TCP clients/server chat app because why not, what'd be the best way to secure/encrypt the data being sent between the two? any links would be appreciated
so
why does Discord return unsupported grant_type when I set it to authorization_code for OAUTH2?
are you passing the clientid clientsecret code and redirecturi
yes
are you trying to do an oauth in js
no
Get role id
like i said, i dont know how to do that
i can't right click on the role by pinging
like i can for users
Add a backslash before mention like \@role then copy the numbers
ok thanks
That’s another way to do it
Just the numbers
i used the numbers but i get this
idk js rip
finna bust
mhm
Is there a way I can tell what permissions my bot is giving me an unhandled promise rejection from?
Lib?
hmm
can anyone help me with a small issue with making a node module
Send code
no no
my friend wont tell me how to use fs for my module im trying to make
ive seen other modules do it so ik its possible
Well I don't know node
i have no code to show though, just requiring the fs module into my code (ik how to require) to use it correctly
using it for making a module is diffrent than using it to make a project i think
One message removed from a suspended account.
hmm
I am trying to make my bot accept multiple args in a command
but I suck at programming
@wide venture well
I have so much work before going open source
Oof
anybody who could help me with discord.js-lavalink
wut about it
i just cant get it working
dm
I want to send a picture of the player but bot is send avatar URL please help me
what lib
discord.js
do you want to send in embed or message
https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=send look at this part in docs it shows how too
ah no i dont change : avatarURL
wdym
?
Put it in the files instead of in the content
hey guy im turkish
please change
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
message.channel.send({
files: [
message.author.avatarURL
]
})
}
how to send without url picture?
Could you fix it because I do not understand
it should be message.author.displayAvatarURL()
okey
i try
message.author.displayAvatarURL is not a function
what does it say
ik how to require i said but i dont think using a outside module is the same with making a module???
message.author.displayAvatarURL()
^
SyntaxError: Unexpected token .
@topaz fjord
Hello, I'm wondering if someone know how to send a message every day like at 7AM using a bot ? I know that I need to make a schedule and send a message when its time but the module schedule won't work with asyncio...
My lib is discord.py
if date() == random varible that has the time, do stuff, then set that varible to the next time the code should trigger
OK thanks
B
Read rule 7b 
What lang? In Python you can use PIL.
In C# you can use System.Drawing 
anyone know how to fix this? sometimes one emoji before, sometimes after (discordjs)
my code: ```javascript
if(command == "vote"){
msg.delete()
msg.channel.send(**Voting:** ${msg.content.slice(prefix.length+5)})
.then(function (message){
message.react("👍")
message.react("👎")
})
}
Idk JavaScript but shouldn't you post one then wait before posting the next one? Maybe that would fix it
Chain them with .then
or you may declare the function as async and await the first one 
how do I add an Invite URL generator?
A permissions calculator for Discord.
What's this?
@gusty mantle what lib?
?
how would i change someone's nickname with a bot
like i do "$username nickname" and it changes the person's nick to "nickname"
here's my code const { Command } = require('discord-akairo');
class NickCommand extends Command {
constructor() {
super('nick', {
aliases: ['nick'],
args: [
{
id: 'member',
type: 'member'
}
],
clientPermissions: ['MANAGE_NICKNAMES'],
userPermissions: ['MANAGE_NICKNAMES'],
channelRestriction: 'guild'
});
}
exec(message, args) {
if (!args.member) {
return message.channel.send("**MEMBER NOT FOUND**");
}
let args1 = message.content.split(' ').slice(1);
var argresult = args1.join(' ');
return args.member.setNickname(`${argresult}`).then(() => {
return message.channel.send(`**${args.member}'s nickname was changed to **.`);
}).catch(error => {
message.channel.send("`I couldn't change that person's nick since I don't have enough perms to do so!`");
});
}
}
module.exports = NickCommand;
thank you
and if you have an answer ping me plz
theres got to be someone here who can help me
ok
class NickCommand extends Command {
constructor() {
super('nick', {
aliases: ['nick'],
args: [
{
id: 'member',
type: 'member'
}
],
clientPermissions: ['MANAGE_NICKNAMES'],
userPermissions: ['MANAGE_NICKNAMES'],
channelRestriction: 'guild'
});
}
exec(message, args) {
if (!args.member) {
return message.channel.send("**MEMBER NOT FOUND**");
}
let args1 = message.content.split(' ').slice(1);
var argresult = args1.join(' ');
return args.member.setNickname(`${argresult}`).then(() => {
return message.channel.send(`**${args.member}'s nickname was changed to **.`);
}).catch(error => {
message.channel.send("`I couldn't change that person's nick since I don't have enough perms to do so!`");
});
}
}
module.exports = NickCommand;```
can someone help me with a command that will change someone's nick
this does change the person's name but it gives their user id right before the new nick
any one can help
plz?
can any one help me do a change nickname command
i cant but lets see if i can understand ur code
ok
remove permissions?
i think that should do it
or add a role to da bot that allows it to do so
:3
heres what i dont want, it works, but it puts the user id of the person before the "new nickname"
umm
like @dusty sandal nut
then look in your code if theres something with an id
theres the argsreult which is used to determine who's nick will be change
i need to use backtick otherwise it wont read the ${argresult}
dont know how to do that
My official website is mainly finish, what do you guys think?
not too bad
^
I'm proud of my skills!
I just think if the only thing the navbar has is a menu button, it defeats the purpose of having a navbar. So the menu button should just be by itself rather than in a redundant navbar
@floral stone oooooof u changed it to Login
what happen to PORTAL
It was Sign in before so ha!
there was a portal menu lol
var avatar = message.guild.members.find("username", "Telk")``` whats wrongs with the code
its discord.js
whats the error
if it returns null it means the member wasn't found under that query
but my username is Telk
did you try
try users instead of members
ok
@earnest phoenix
^ maybe you aren't cached in the members collection
message.guild.users is undefiend
client.users
but i want it only in the guild
if you want to search through the entire user collection
only in one guild?
if you aren't in that guild it will just return null
where the message was sent
try to do message.guild.members.fetch()
doesnt dat need the id?
do message.guild.members.fetch({ query: 'Telk' })
or am i being stupid
mfw im looking im master docs
I cant fucking read the d.js docs
stupid theme
Is there a more efficent way of waiting then asyncio.sleep()?
Maybe something that "persists" even after a restart?
@bot.command(pass_context=True)
async def poll(context):
message = context.message.id
await bot.add_reaction(':white_check_mark:')
await bot.add_reaction(':x:')```
i am trying to get this bot to add specific reactions to the command messages
ping me please
hey guy i say "f*help" but my bot responds and my bot prefix is "m!"
let commandfile = bot.commands.get(cmd.slice(prefix.length));
if(commandfile) commandfile.run(bot,message,args);
please help me
@mental willow ✅ = \✅, ❌ = \❌
?
@solid cliff where do that go?
hey please help me
@mental willow try unicode characters instead of the name of it
what lib
bot.add_reaction('✅')
@earnest phoenix what libary
discord.js
k
You can quickly obtain the <:name:id> format by putting a backslash in front of the custom emoji when you put it in your client.
Example: \:python3: would give you the <:name:id> format.
When adding reactions, you can either send the unicode for standard emojis, or send name:id, not <:name:id> for custom emojis.```
u"\u2713"
if(!message.content.startsWith(prefix)) return; @earnest phoenix
U+274C
So can someone help me?
whats up
So I followed this tur
Tut
𝐄 𝐗 𝐓 𝐑 𝐀 𝐓 𝐇 𝐈 𝐂 𝐂 READ BEFORE POSTING A COMMENT! Please do not ask for spoon feeding in the comment section, feed yourself! Comments that simply dump all c...
But with info I want it to send a DM to the person who did the command
the simplest way to send a DM to the author of the message would be to use message.author.send()
Oh ok
it's a bit hard to explain to a beginner but basically you have a TextChannel which is anything like a guild channel and stuff like that
and then you have a User object
both of those objects have a send method
where you can either send a message to a channel or a user
when i start my bot it gives the error "40111, sharding required". i realise this obviously means i need to use sharding but i have no idea how to use it. could anyone help me please?
If (message.content == “sendinfo” {
message.author.send(“stuff here”);
}
@cyan orchid ur missing a ) after the "sendinfo"
@austere meadow
also what texteditor are you using?
@woven pendant what lib are you using
ah sorry can't help you there
maybe look up a guide for it on google? ive seen some people on github who've done that
can't remember where though
@earnest phoenix
ive tried googling it but cant find much. only stuff for js i think
@woven pendant rewrite or async because I know for rewrite I just change Bot to AutoShardedBot
Discordpy or api server can prob help 👌
thanks. i'll ask there
oh and sorry. i missed your question. but im using async :/
? @cyan orchid
You asked what text editor I used
And is that how I could do it?
If (message.content == “sendinfo”)64 {
message.author.send(“stuff here”);
}
Is that how I could do it
what is the 64 for?
Oops wth
If (message.content == “sendinfo”) {
message.author.send(“stuff here”);
}
Like that?
Why that many?
in js 3 = means equals to !== means not equals too and > is bugger < smaller and stuff
u should read js docs
u can
Really?!
Oh sweet
😃 no prob
And how would I do a welcome thinf
Like just a simple message like “Welcome @whoeverjoined!”
u need to look at the guildMemberAdd
Ok
And @earnest phoenix I’m so sorry but for this tur
Tut
name^s 𝐉𝐞𝐟𝐟 READ BEFORE POSTING A COMMENT! Please do not ask for spoon feeding in the comment section, feed yourself! Comments that simply dump all code and ...
You can only use the YouTube URL
But I want to use like !play yeet
Then the music will play
u will need a yt search
Any good one
i know a thing you can dig thru https://www.npmjs.com/package/telk-music search for the source code
I use ytdl-core
const Discord = require('discord.js');
const music = require('telk-music');
const client = new Discord.Client();
const token = "<bot_token>" //dont show this to anyone!
client.on('ready', () => {
console.log(Music Bot is now ready!);
});
music(client, {
apikey: 'ytapikey', //dont show this to anyone!
prefix: '-',
global: false,
maxQueueSize: 100,
deletemsg: false,
searchmsg: 'FINDING `{song}` . . . please wait',
addedmsg: 'I HAVE Added {song} to the queue!',
playmsg: '🎶 Dont rage. . . im now playing {song}!',
loopmsg: 'LOOOP has been turned {toggle}!'
});
client.login(token);
Will this work
I know I have to install the packages
@earnest phoenix I’m sorry
This is the last one
@cyan orchid u need a api key
Google Cloud Platform lets you build, deploy, and scale applications, websites, and services on the same infrastructure as Google.
Oh
this.client.userConf.set(message.guild.id + message.author.id, { points: result, bankpoints: userConf.bankpoints, backpack: userConf.backpack });
why is this not working, it doesn't replace points
my current points is 200
it should subtraact 125
also the result variable is parseInt(userConf.points) - 125;
ur not gonna get anywhere like that @cyan orchid
@low rivet why?
because you aren't learning the lang
you just want something done
you don't want to learn
learning more langs will help you also js is an essentials coding lang to learn
for websites it is essential
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Oh
One message removed from a suspended account.
One message removed from a suspended account.
Don’t think you can
send message, if it fails then you dont have perms
But I don’t know anything
there is no other way
@little garnet u should check the docs also what lib u using?
i think if the message errors it means it doesnt have perms
How do I make my bot, Online?
@gusty mantle pick a language to code your bot in pick a libary to code your bot in and google how to use it
Ok.
One message removed from a suspended account.
@earnest phoenix === means equal value and type, == is equal to
by value
would be beneficial if you read this:
https://www.w3schools.com/js/js_comparisons.asp
atleast it's not java where you have to use .equals()
what the frick?
for non primitive types yes
=== checks types
== doesnt
so you can do
"12" == 12 but if you used === that wouldnt work
i forgot sowwy but it is always better to use === cause types most of the time are important
Dont use != or ==
just stupid to
yes
@earnest phoenix agreed people sometimes mistake id as numbers but it is a string
well, BigInt is coming (like not far anymore) but it'll be 123n for bigint so 
@cyan orchid then make a c# bot?
Wut
can anyone tell me why it wont send embed2?
Code:
if(msg == prefix + 'help') {
// message.replay
message.channel.sendMessage('** Sent a DM to you with all the commands! ');
const embed = new Discord.RichEmbed()
.setColor(0x954D23)
.addField(" __ Update Changelog", "- Added A few new commands, Updated Help Command __, Commands are no more case sensetive now you can type y!help,y!HeLp and y!Help and they will all work**")
.addField("* Prefix", "y! ")
.setTitle("General Commands:", "List :")
.addField("y!help", "Will give the current command list")
.addField("y!ping", "Will show the ping time for the bot")
.addField("y!say [text]", "Will make the bot say something")
.addField("y!server", "sends a link to the official Yumi server")
.addField("y!announcement [text]", "Will make the bot say an announcement and tag everyone*(Note:Make Sure the user has a role named announcement to use this command![This command will soon only be available to Premium Members only!])")
.addField("y!purge <number of messages> - removes the amount of messages specified!(User must have a role named Admin to use this command!)")
.addField("** Fun Commands **", "List :")
.addField("y!avatar", "displays a image of the user wich is metioned avatars")
.addField("y!roll", "rolls a random number from 1 to 6")
.addField("y!cat", "Will send a random cat image")
.addField("y!virus", " injects a virus into your pc")
.addField("y!genji", " gif of genjis ultimate")
.addField("y!freewifi hey kids...do you want some free wifi?")
.addField("__ Dragon Ball Z Commands: __", "List :")
.addField("y!ssj", " Go Super Saiyan")
.addField("y!ssj2", " Go Super Saiyan 2")
.addField("y!ssj3", " Go Super Saiyan 3")
.addField("y!ssj4", " Go Super Saiyan 4")
.addField("y!ssjgod", " Go Super Saiyan God (Red Haired Normal)")
.addField("y!ssjgodssj", " Go Super Saiyan God (Blue Haired Upgraded)")
.addField("y!ui (Ultra Instinct)", " Go Ultra Instinct") .addField("y!masterui (Ultra Instinct Mastered)", " Go Mastered Ultra Instinct")
message.member.send({embed})
const embed2 = new Discord.RichEmbed()
.setColor(0x954D23)
.addField("__ Youtube Commands: __", "List :")
.addField("y!youtube", " Links The YT channel of the bots creator")
.addField("y!inoob", " Links The YT channel of the bots owners friend")
.addField("y!March23", " What Happen on March 23?")
.addField("Official Yumi Server Commands : y!apply", " apply for staff,v!register")
.addField("Auto Replys : Dab (No.Just No) [More Coming Soon!]")
.addField("** Join The official Yumi Server Here : https://discord.io/yumi-server **")
message.member.send({embed2})
Language : Javascript
holy
Too many fields by the looks
How many Fields
As a first problem
En embed can only have 25 fields
no he sends in parts
no i made it shorter
Not what I see
Also shouldn't it be message.author.send
^
Not message.member.send
ok
the embed is not too long
it is just in parts
embed and embed2
but embed2 wont send
Did you try message.author.send
i did
still it wont send embed2
the code for embed2 is
const embed2 = new Discord.RichEmbed()
.setColor(0x954D23)
.addField("__ Youtube Commands: __", "List :")
.addField("y!youtube", " Links The YT channel of the bots creator")
.addField("y!inoob", " Links The YT channel of the bots owners friend")
.addField("y!March23", " What Happen on March 23?")
.addField("Official Yumi Server Commands : y!apply", " apply for staff,v!register")
.addField("Auto Replys : Dab (No.Just No) [More Coming Soon!]")
.addField("** Join The official Yumi Server Here : https://discord.io/yumi-server **")
message.author.send({embed2})
wait, can someone show me how to make a two step command for a bot
what do you mean?
Library?
also which libary?
js
dam
basically this is what i want to do:
me: $nick @user
bot: what do you want @user's new name to be?
me: John
bot: User's name has been changed to John.
can anyone help me with this?
here is the existing code i have
class NickCommand extends Command {
constructor() {
super('nick', {
aliases: ['nick'],
args: [
{
id: 'member',
type: 'member'
}
],
clientPermissions: ['MANAGE_NICKNAMES'],
userPermissions: ['MANAGE_NICKNAMES'],
channelRestriction: 'guild'
});
}
exec(message, finna) {
if (!finna.member) {
return message.channel.send("**MEMBER NOT FOUND**");
}
let args1 = message.content.split(' ').slice();
var argresult = args1.join(' ');
return message.channel.send(`What do you want ${finna.member}'s new name to be?`).
}
}
module.exports = NickCommand;```
you want the user to input a name and there you are missing code
i know im missing code for the username to be changed
i had it work somewhat previously, however, the user id of the person would also become a part of their nick
can anyone give me the link to the part of the discord js website where you can delete messages
why not search the documentation yourself? 
Anyone good with Laravel custom auth?
Well I get the user through Discord oauth, but idk how to log them in using their info
I see Auth::login()
but I need a user model
which i don't know how to create based on discord user data
With Laravel I use Socialite for Discord OAuth
One-time session auth?

Well stateless
I mean no
I actually have a session
But I also don't use the one-time session auth (full oauth flow) but I never renew the session anyways (or it might but I'm unaware because it's handled by socialite)
hmm Socialite doesn't have Discord
uhm where do i need to use this site's api?
You have to grab it from another extension
wew
Discord isn't directly in socialite, but you need socialite and another discord package for it
:/
what other Discord package?
The one thing I didn't like with it though is I had to edit the actual Socialite-Discord package in the vendor to change scopes (because I didn't find a way to modify scopes without email) or I'm dumb at socialite/socialite discord
oooo
k thanks
ima look into it
Why does it redirect without a client id?
I set it in config

nvm
cache was fucked
code:
HttpURLConnection conn= (HttpURLConnection) new URL(avatarurl+"?size=120").openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0");
conn.getResponseCode();
BufferedImage image = ImageIO.read(conn.getInputStream());```
I get bad request 400 pls help
120 isn't a valid size
needs to be power of two
iirc yes
thr sizes are 128, 256, 512, 1024, and 2048
Image size can be any power of two between 16 and 2048.```
thx! saved me
Is there a way to do git pull, but not override a certain directory?
hmm
does someone know how to make the programm detect when a specific reaction is clicked?
@earnest phoenix Which library?
discord.js
Read on that
okay thanks
wait, there is poop thing flying all over the place?!?!?
Yes
._.
discord.js decided that poop flying all over the place would help people learn discord.js better
I personally agree
😂
I have a problem that I've been trying to fix for several hours.
My javascript file seems to run twice every time I try to start it, I tried reinstalling node and even recoding the entire thing, and it worked for 5 minutes, then went back to running the js file twice again.
I also tried running the same code on another one of my bots to see if the code was a problem; the code works fine on the other bot, and it doesn't run twice.
I'm all out of ideas, so if anyone has any idea where I could look for more help, please send me a DM or ping me here.
https://cdn.discordapp.com/attachments/272764566411149314/430084640586596353/unknown.png
Hi everyone, I just started to get the hang of Discord Bots and the discord.py library.
I have an issue with this function (http://discordpy.readthedocs.io/en/latest/api.html#discord.Client.move_member). The bot doesn't move the member. I have checked the permissions and still nothing. Here's the whole function:
@client.command()
async def move():
await client.wait_until_ready()
while not client.is_closed:
for server in client.servers:
print("\nServer name: {}\n".format(server.name))
channels = []
print("Voice channels: ")
for channel in server.channels:
if str(channel.type) == "voice":
print("Voice channel: {}".format(channel.name))
channels.append(channel)
for member in server.members:
if not member.bot:
print("\nServer member: {}".format(member.name))
print("Server member game: {}".format(member.game))
if member.game != None:
for channel in channels:
if str(member.game) == str(channel.name):
try:
client.move_member(member, channel)
print("{} moved to {} voice chat".format(member.name, channel.name))
except "HTTPException":
print("Failed to move member")
except "Forbidden":
print("Grant permission to move members")
else:
print("game: {} | voice chat: {}".format(member.game, channel.name))
return
What can I do ?
The function doesn't throw any exceptions either
while not client.is_closed: why?
Let me read your code
give me a min @oblique kite
sure
Try puting await in front of it.
in front of cliet.move_member(member, channel) ?
okay
One message removed from a suspended account.
I'm going to simply your commands aswell.
@client.command()
async def move():
await client.wait_until_ready()
for server in client.servers:
print("\nServer name: {}\n".format(server.name))
channels = []
print("Voice channels: ")
for channel in server.channels:
if str(channel.type) == "voice":
print("Voice channel: {}".format(channel.name))
channels.append(channel)
for member in server.members:
if not member.bot:
print("\nServer member: {}".format(member.name))
print("Server member game: {}".format(member.game))
if member.game != None:
for channel in channels:
if str(member.game) == str(channel.name):
try:
await client.move_member(member, channel)
print("{} moved to {} voice chat".format(member.name, channel.name))
except "Forbidden":
print("Grant permission to move members")
else:
print("game: {} | voice chat: {}".format(member.game, channel.name))```
- You don't need to return unless you need to return something
Traceback (most recent call last):
File "D:/PycharmProjects/Movey/main.py", line 62, in move
await client.move_member(member, channel)
File "D:\PycharmProjects\Movey\venv\lib\site-packages\discord\client.py", line 3135, in move_member
yield from self.http.move_member(member.id, member.server.id, channel.id)
File "D:\PycharmProjects\Movey\venv\lib\site-packages\discord\http.py", line 196, in request
raise Forbidden(r, data)
discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\PycharmProjects\Movey\venv\lib\site-packages\discord\ext\commands\core.py", line 50, in wrapped
ret = yield from coro(*args, **kwargs)
File "D:/PycharmProjects/Movey/main.py", line 64, in move
except "HTTPException":
TypeError: catching classes that do not inherit from BaseException is not allowed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\PycharmProjects\Movey\venv\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "D:\PycharmProjects\Movey\venv\lib\site-packages\discord\ext\commands\core.py", line 374, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "D:\PycharmProjects\Movey\venv\lib\site-packages\discord\ext\commands\core.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: catching classes that do not inherit from BaseException is not allowed```
The bot doesn't have permission
- You don't need to return unless you need to return something
I gave it the permission, it now moves the members
- You really don't have to check is client is closed, unless you are running the code offline.
- Don't while loop unless you need to. Your for statements should work without the while loop. If you do need to use a while loop, make sure to
breakonce done.
Finally, HTTPException and Forbidden can be esailly handled in on_error and on_command_error events. You can keep if you like, but I remove the HTTPException just in case.
@oblique kite
alright
One message removed from a suspended account.
Enjoy botting! You will make a wonderful bot owner! 😉
One message removed from a suspended account.
if you want to know if they're enabled or not, you need to try DMing them
One message removed from a suspended account.
One message removed from a suspended account.
If sending message fails -> dms disabled
Can't you check permission of a private channel on node.js?
hmm
you can't on any lib
The setting isnt public
^
@floral stone how would I implement on_error in code in my example ?
How does it work ?
@oblique kite async or rewrite?
async
@bot.event
async def on_command_error(ctx, error):
# Your code
``` That's the rewrite version, I'm not sure what the function args are for that but it should be basically the same
@oblique kite
and for example I have this "move" function and another "kick member" function, both functions could throw on_error if the bot doesn't have permissions for them, right ?
how would I print 2 different messages, each for it's own function, using the on_error event ?
@floral stone
sure, no problem
okay, lemme see
ok, so I define the on_error function and add my function name as the event parameter or the name of the exception raised ?
I need help running something through an API using args
for example
i've got two args
an IP
and a time
i want to run it through something like http://127.0.0.1/test.php?key=keyhere&port=[port]&method=[method]&time=[time]
so like
all of those args
i dont rly know the term for this or something
but basically im trying to get my bot to open that
and run that
without having to run that through the client and them getting access to my API key, etc
guys if i have a nested json file eks```
}
"Xkijux" : {
"id" : "...",
"role" : "admin"
},
"someone" : {
"id" : "...",
"role" : "mod"
}}
how do i call it in the js file? because [callName].xkijux.id dosent work ```
- keys are case sensitive
- check the fs module
- JSON.parse
now that I'm focusing on my bot again, lemme post my error I'vebeen getting after following a portion of theModeration boguide
' ' 'Exception in thread "main" java.lang.IllegalArgumentException: Owner ID was set null or not set! Please provide an User ID to register as the owner!
at net.dv8tion.jda.core.utils.Checks.check(Checks.java:27)
at com.jagrosh.jdautilities.command.impl.CommandClientImpl.<init>(CommandClientImpl.java:108)
at com.jagrosh.jdautilities.command.CommandClientBuilder.build(CommandClientBuilder.java:71)
at main.ModBot.main(ModBot.java:26)' ' '
add an owner id to the builder
how do I do that? (guide doesn't go over that)
builder.setOwnerId("177200577430683648") in this case
where should I slap that in?
👌
Works now, Thanks @inner jewel
What's the ratelimit for changing bot name?
i would say it's the same than for changing your username
How do I make my bot say what it’s playing
Like Bot is playing djsjjd
If you get the point
Like that
Language
What
what api i mean
Sorry can't help ya..
Damn
Have you considered the official Discord Docs?
No
Why not?
tanks
So I use Auth to manually log in a user with data Socialite returns, but when I try to use Auth::user() it is null (Laravel - PHP)
@topaz fjord can you help me with my q ?
How do I make my bot say what it’s playing
Like Bot is playing djsjjd
If you get the point
that one
dose anyone know how to do it
(Client).user.setPresence
@cyan orchid <Client>.user.presence.game https://discord.js.org/#/docs/main/stable/class/Game
pappu786
ok
anyone know how to do a kick and ban in discord.js
and dose anyone know how to make your bot and you be able to set a welcome channel
bot.on('guildMemberAdd', member => {
const channel = member.guild.channels.find('name', 'member-log');
if (!channel) return;
channel.send(`Welcome to the server, ${member}! I hope you have a great stay.`);
});
thats what i have but i want it so you can do this: k!setwelcome
then that sets it so that channel is the welcome channel
@austere meadow u know how?
@cyan orchid u will need to make a db a command to change the channel name and stuff
@untold whale Joshek
which code?
well now it says no u arguments
null check everything
something on line 18 is null
e.g.
ctx.send(EmoteUtils.SUCCESS, ctx.getAuthor().getName() + " wanted me to say: " + args + "");
if ctx == null
System.out.println("ctx is null")
if ctx.getAuthor.getName == null
println("author name is null")
2018-04-01 21:13:38 [Thread-0] INFO xyz.yuibot.discord.YuiBot - Setting current gamemode...
2018-04-01 21:13:50 [JDA MainWS-ReadThread] ERROR net.dv8tion.jda.core.JDA - One of the EventListeners had an uncaught exception
java.lang.NullPointerException: null
at xyz.yuibot.discord.command.core.TestCommand.execute(TestCommand.java:18)
at xyz.yuibot.discord.command.CommandManager.handle(CommandManager.java:65)
at xyz.yuibot.discord.listeners.EventListener.onGuildMessageReceived(EventListener.java:30)
at net.dv8tion.jda.core.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:373)
at net.dv8tion.jda.core.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:84)
at net.dv8tion.jda.core.handle.MessageCreateHandler.handleInternally(MessageCreateHandler.java:90)
at net.dv8tion.jda.core.handle.SocketHandler.handle(SocketHandler.java:37)
at net.dv8tion.jda.core.requests.WebSocketClient.onDispatch(WebSocketClient.java:1051)
at net.dv8tion.jda.core.requests.WebSocketClient.onEvent(WebSocketClient.java:911)
at net.dv8tion.jda.core.requests.WebSocketClient.handleEvent(WebSocketClient.java:890)
at net.dv8tion.jda.core.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:1089)
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:368)
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:270)
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:990)
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:749)
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)``` @kind quiver
it doesn't say nothing is null
show code
august u need to show me the code u have actually changed
this doesnt help me at all
ive seen this code
i need to see what u just wrote for those checks
spong
@kind quiver not to be rude but the code has changed
i n t h e t e s t c o m m a n d f i l e
@vital lark reee
I'm gonna do JS again, sorry if I wasted time.
@brittle oyster wait a second or two and edit the number in the message?
const [users, template] = await Promise.all([ // error
request.get(URL),
fsn.readFile('./resources/batslap/batman.jpg')
]).catch(reject);
just a small lib I'm using for reading local images and returning buffers
and yes
lmfao
Hi so I have a bot and I have made it be able to DM help info, but I can use commands in the DM
I’m using discord.js
If some one could help that would be great
fs-nextra is made by the one and only @AoDude#8676 he lit af my dude ;p
wym it makes no sense
It makes no sense because It works sometimes, but not in this command
url and the file are the same output as other commands
Whats the actual error?
UnhandledPromiseRejectionWarning: TypeError: (intermediate value) is not iterable
basically
what I'm doing is rewriting from jimp to canvas
defuq
const [avatar, author, batman] = await Promise.all([
Jimp.read(URL[0]),
Jimp.read(URL[1]),
Jimp.read('./resources/batslap/batman.jpg')
]).catch(reject)
``` this works just fine
I believe that's thrown because you're trying to destructure a non-iterable object?
Promise.all returns an array
ohhhhhhhhhhhh
Melmsie
its rejecting
remove the .catch
don't chain .catch calls onto awaited promises
just handle rejection with a try...catch clause
and whats wrong with it?
i prefer having one try catch instead of having literally 50 .catch at end doing same thing
bc, that is dumb
@earnest phoenix he's using canvas-constructor so ofc he's also using fsn 
I wonder why that exists in the first place 
oh
@clever yew made canvas-constructor
everyone that uses the module uses fsn lmao
:p
ik
it's a great module
it is
unless ur using gif encoder
well actually
thats not true
yeah now that im thinking abt it
and how it works
I need to start making some gif cmds
same
um you know the canonical way to handle promise rejection in the async/await pattern is try...catch right
No bot listed? @clever yew
Also, the fs-nextra thing isn't because canvas-constructor, it's because klasa
For now, I'm planning to upload my bot during this week 
not for us Eris users
I have been fixing some bugs before pushing to production
ur still getting errors with that?
Well, I'm still fixing bugs xD
I've never ran into an error tbh
im gonna assume its an error from the request.get
or the file path not being correct
const [user, author, template] = await Promise.all([
request.get(URL[0]),
request.get(URL[1]),
fsn.readFile('./resources/batslap/batman.jpg')
])
output of URL is ['avatar url', 'avatar url']
Error is UnhandledPromiseRejectionWarning: Error: 400 Bad Request
told you
Does Eris have the decency to print the full stack error rather than just this? Because I opened the files from pm2-logrotate and found a bunch of thosejs (/home/Royal/node_modules/discord.js/src/rest/handlers/RequestHandler.js:79:65) [2018-03-31 23:15:40] at then (/home/Royal/node_modules/snekfetch/src/index.js:218:21) [2018-03-31 23:15:40] at <anonymous> [2018-03-31 23:15:40] at process._tickCallback (internal/process/next_tick.js:118:7)
@earnest phoenix regular js errors now, not with packages anymore
And I'm always like
UnhandledPromiseRejectionWarning: TypeError: (intermediate value) is not iterable isnt a package error
"How tf do I fix this"
eris logs errors fine, its your logs that have the error cut
No lol
d.js prints errors properly too though
Kyra, Melmsie is the one who wouldnt budge in circuit's guild
I'm not rewritting the framework and the bot for Eris, plus Eris lacks of many features I need
Which is sad
what is eris missing 🤔
budge about what
Eris has better sharding and music, but d.js has custom structures
excuse me, d.js master music is better then eris hands down
i mean
other then missing features and the stupid bugs
They use Hydra's Prism 
v12 has custom structures
I run a bot on 150k servers, ofc I'm not budging on eris being better if thats what you mean
you can't compare v12 with eris
¯_(ツ)_/¯
It's like ages old lmao
v12 is too
d.js v10.x and v11.x sucks
fucking not released after 6 month
v12 getting all those enhancements and up-to-date API support
@keen anvil what’s your not called
Whilst v11 users cringe on old and outdated stuff
@fair grail @cyan orchid
its been over a year since v11 released, lul
@keen anvil do you use discord.js?
I have joined the Komada team on mid-March 2017, and we were using d.js v12 master
Nowadays we're still using d.js v12 master
no, d.js is not currently good on large bots as far as performance and resource usage @cyan orchid
Can agree
What do you use then?
Eris
im using 25mb for 53K members, but ok
d.js uses a PROXY in the router
then again some would argue v12 can
53k members is nothing
but eh
What language is that?
also, comparing users to mem usage is dumb
39.2 mb for 87,374 users
mfw using over a GB
agreed
It doesn't even have LRU
It caches indefinitely
no
only for messages sure
faking guild count obv that user count is way too low!! @keen anvil
That's why I overloaded some methods to implement LRU on them 👀
lmfao
I still don't need emojis cached, like, wtf
emojis cached 
What do I need those 1000 "Emoji" objects for? To take 5 mb of RAM?
We went from v11 to eris around 20k servers and dropped mem usage by 80%. Only changing core code to the new lib, nothing else.
one problem, you get emojis on guild update or whatever that event is called so you cant just fetch emojis
(Actually you can thru rest api but thats not implemented)
but like i haven't ever used client.emojis or Guild#emojis ever
I dropped RAM usage by a factor of 10 by implementing LRU into d.js v12
255 -> 25 mb with 50k users
dang
guild create, Jacz
I wanna see how you'd implement lavalink into Sneyra tbh
I need to use lavalink. I've got a second server gathering dust
Also
And then I have to explain people why they shouldn't use == in JS
that meme explains it very well
I should add a "js meme" command
jsdev meme command
0 === ToNumber("0") -> true
0 === ToPrimitive([]) -> true
"0" === ToPrimitive([]) -> false
programming meme cmd, rather
But if Number(resolvable), where resolvable is ToPrototype(T), then [] resolves to 0, [2] resolves to 2, therefore 1 == [1] should be true
Which it is
But just, why
@cyan orchid If you wanna shut down memory usage, stop using Commando 
I don’t use commando
How do I make commands then
Commando is like d.js caching but 1000000x worse
isn't it made by the d.js devs
(What im trying to say is, commando fucking caches everything)
That good or bad
very bad
So d.js is very bad
no
d.js isn't a bad lib
Im talking about d.js commando
discord.io is a bad lib
Oh ok
or was when it was nearing death
idk if it actually died yet
for klasa to get started read here: https://klasa.js.org/#/docs/main/master/Getting Started/GettingStarted
for creating commands with klasa see here: https://klasa.js.org/#/docs/main/master/Piece Basics/CreatingCommands
I am great marketer pls use this module 
(Jokes)
Should I download the master
yes
Stable isnt stable,
Master is working
Open the terminal
I know hoe to do all that
you're on the wrong docs
k-k-komada 👀
The routes changed
Because stable never had the new docs
They're kind of... "emulated"
(We compiled the docs without modifying the branch and uploaded them to the docs branch)
What
@cyan orchid Just enter here: https://klasa.js.org/#/docs/main/master/Getting Started/GettingStarted
And don't change the branch
Still the same thing
Works to me https://vgy.me/GHpucW.png
Oh god, the Getting Started is soooo old, it still includes Evie's quote
Hmm
go to the main page
then click on docs
then where is says stable click on it then click master
One message removed from a suspended account.
One message removed from a suspended account.
Hello, my Discord Bot keeps leaving the voice channel as soon as it joins and doesn't give me an error.
I am using node-opus, discord.js v11 and ytdl-core on Ubuntu 16.04.4 LTS
(i have ffmpeg installed btw)
listen to the debug event
hmm ok
@neat falcon g'day derpy whats going on, are you running v11 exactly or v11.x?
I'd assume latest v11
or eval require("discord.js/package.json").version
ok good
wait what is stable
11.3.2
sure
thanks mate
when u play as well
let stream = yt("https://www.youtube.com/watch?v=NY__VTIUsiU", { audioonly: true });
const dispatcher = connection.playStream(stream);
dispatcher.on('debug', e => { console.log(e)});
dispatcher.on('end', () => {
voiceChannel.leave();
msg.channel.send("Left the voice channel.");
});
(ignore debug)
yes
its probably leaving because its reaching the end event immediately
though not sure about vps country

