#development

1 messages · Page 392 of 1

dusty sandal
#

thank

#

thank you @solid cliff

earnest phoenix
#

btw do people use the widget?

dusty sandal
#

how do i find the role id?

earnest phoenix
#

in what lang

dusty sandal
#

js

earnest phoenix
dusty sandal
#

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

earnest phoenix
#

iterate through the collection and find the name of the role?

#

after that you can just grab the id

dusty sandal
#

hmm ok

earnest phoenix
solid cliff
#

MeeEee

earnest phoenix
#

I'm stuck on a command.

dusty sandal
#

i'm sorry but i'm a geniune idiot, i have the role but i can't get the role id number

solid cliff
#

@dusty sandal turn on dev mode, ping role and get id

earnest phoenix
#

How would you make it so when a player says mute (user) it mutes them?

solid cliff
#

@earnest phoenix what u stuck on

dusty sandal
#

ok thx

earnest phoenix
#

I cant find out how to mute people

solid cliff
#

sho code

#

That u attemptd

#

Lul

earnest phoenix
#

I don't have it on me atm

#

I can show it later

#

It went like

#

async def mute (ctx)

dusty sandal
#

i ping the role, but i cant right click to get id

solid cliff
#

Is developer mode onn

dusty sandal
#

yes

earnest phoenix
#

Bot.say ("You are now muted!")

dusty sandal
#

i can copy id of people but not role

earnest phoenix
#

I just need to add a line where it muted them

solid cliff
#

So ur thing is like async def mute(ctx): right

earnest phoenix
#

Yeah

#

So when someone says mute it does it

solid cliff
#

Sooo

#

How would you get the argument for the user

earnest phoenix
#

(user_name) I think

#

I forgot my variables

#

I had them on my script

solid cliff
#

idk how to do this without spoon feeding XD

earnest phoenix
#

hm

solid cliff
#

Rn you just have ctx in your args right

earnest phoenix
#

Mhm

solid cliff
#

How would you add another arg for a user mention

dusty sandal
#

oy @solid cliff this is my error i can't address

earnest phoenix
#

Wait can I contact you later

#

When I have my computer on

topaz fjord
#

@dusty sandal show code

solid cliff
#

Oki @earnest phoenix

dusty sandal
#

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;

solid cliff
#

Idk java but it says "m u t e" is not a snowflake

sand roost
#

How to do a hackban command in d.js

#

?

dusty sandal
#

@topaz fjord this is my code

scenic crest
#

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

dusty sandal
#

so

gilded blaze
#

why does Discord return unsupported grant_type when I set it to authorization_code for OAUTH2?

topaz fjord
#

are you passing the clientid clientsecret code and redirecturi

gilded blaze
#

yes

topaz fjord
#

are you trying to do an oauth in js

gilded blaze
#

no

dusty sandal
#

how do i convert "M U T E" to a snowflake (js)

solid cliff
#

Get role id

dusty sandal
#

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

solid cliff
#

Add a backslash before mention like \@role then copy the numbers

dusty sandal
#

ok thanks

solid cliff
#

That’s another way to do it

dusty sandal
#

so i copy everything after the @ right?

#

or everything inside the <>

solid cliff
#

Just the numbers

dusty sandal
solid cliff
#

idk js rip

dusty sandal
#

finna bust

earnest phoenix
#

mhm

wide venture
#

Is there a way I can tell what permissions my bot is giving me an unhandled promise rejection from?

spring ember
#

Lib?

wide venture
#

hmm

fleet epoch
#

can anyone help me with a small issue with making a node module

spring ember
#

Send code

fleet epoch
#

no no

spring ember
#

Exception

#

Anything

fleet epoch
#

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

spring ember
#

Well I don't know node

fleet epoch
#

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

topaz fjord
#

you dont know how to require...

#

you should probs learn node

little garnet
#

One message removed from a suspended account.

wide venture
#

hmm

#

I am trying to make my bot accept multiple args in a command

#

but I suck at programming

spring ember
#

@wide venture well

wide venture
#

I have so much work before going open source

spring ember
#

Oof

sand roost
#

anybody who could help me with discord.js-lavalink

topaz fjord
#

wut about it

sand roost
#

i just cant get it working

topaz fjord
#

hm

#

show code

sand roost
#

dm

earnest phoenix
#

I want to send a picture of the player but bot is send avatar URL please help me

topaz fjord
#

what lib

earnest phoenix
#

discord.js

topaz fjord
#

do you want to send in embed or message

earnest phoenix
#

message

#

only photo

topaz fjord
earnest phoenix
#

ah no i dont change : avatarURL

topaz fjord
#

wdym

earnest phoenix
#

?

bright spear
#

Put it in the files instead of in the content

earnest phoenix
#

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?

topaz fjord
#

its avatarURL()

#

not avatarURL

#

wait no

#

sorry

earnest phoenix
#

Could you fix it because I do not understand

topaz fjord
#

it should be message.author.displayAvatarURL()

earnest phoenix
#

okey

#

i try

#

message.author.displayAvatarURL is not a function

#

what does it say

fleet epoch
#

ik how to require i said but i dont think using a outside module is the same with making a module???

topaz fjord
#
message.channel.send({
    files: [{
      message.author.displayAvatarURL()
    }]
  })
#

try this

earnest phoenix
#

message.author.displayAvatarURL()
^

SyntaxError: Unexpected token .

#

@topaz fjord

frigid juniper
#

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

solid cliff
#

Make a loop

#

per minute or something

#

If time == 7am

#

Do stuff

topaz fjord
#

use SetInterval

#

and perfectly time it on 7 am

fleet epoch
#

if date() == random varible that has the time, do stuff, then set that varible to the next time the code should trigger

earnest phoenix
#

@earnest phoenix (⁄ ⁄•⁄ω⁄•⁄ ⁄) (Navy.gif)

#

:3

frigid juniper
#

OK thanks

floral summit
#

B

earnest phoenix
#

hey

#

who knoes image editting

#

commands

#

pls show me da wae to do those

quiet bobcat
#

Read rule 7b mmLol

earnest phoenix
#

it may be teach me

#

cuz im not asking for a ready code, am i?

glossy mason
#

What lang? In Python you can use PIL.

weak parrot
#

In C# you can use System.Drawing bloblul

earnest phoenix
#

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("👎")
})
}

weak parrot
#

Idk JavaScript but shouldn't you post one then wait before posting the next one? Maybe that would fix it

earnest phoenix
#

when i used the sleep module it didnt work

#

🤔

topaz fjord
#

Chain them with .then

heady zinc
#

or you may declare the function as async and await the first one ZoomEyes

earnest phoenix
#

thanks, making it async fixed it

#

nevermind

#

fixed it

#

Noice

gusty mantle
#

how do I add an Invite URL generator?

jagged birch
gusty mantle
#

What's this?

bright spear
#

@gusty mantle what lib?

gusty mantle
#

?

dusty sandal
#

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

hushed oyster
#

use a code block to share the code

#

put the code inside "```"s

dusty sandal
#

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

earnest phoenix
#

i cant but lets see if i can understand ur code

dusty sandal
#

ok

earnest phoenix
#

remove permissions?

#

i think that should do it

#

or add a role to da bot that allows it to do so

#

:3

dusty sandal
#

heres what i dont want, it works, but it puts the user id of the person before the "new nickname"

earnest phoenix
#

umm

dusty sandal
#

like @dusty sandal nut

earnest phoenix
#

then look in your code if theres something with an id

dusty sandal
#

theres the argsreult which is used to determine who's nick will be change

earnest phoenix
#

hmmm

#

why dont use ' instead of ´?

#

or is it supposed to be like that

dusty sandal
#

i need to use backtick otherwise it wont read the ${argresult}

earnest phoenix
#

ask better coders than me :c

#

sorry, i cant help

dusty sandal
#

ok thanks

#

thanks for trying

earnest phoenix
#

no prob (tho i did not do anything)

#

have u tryied using debug?

dusty sandal
#

dont know how to do that

floral stone
#
#

My official website is mainly finish, what do you guys think?

abstract mango
#

not too bad

earnest phoenix
#

^

floral stone
#

I'm proud of my skills!

earnest phoenix
#

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

floral stone
#

Shutup

#

@earnest phoenix What menu?

earnest phoenix
floral stone
#

It was Sign in before so ha!

earnest phoenix
#

there was a portal menu lol

floral stone
#

it's called dashboard

#

now

earnest phoenix
#

This is a menu button

earnest phoenix
#
var avatar = message.guild.members.find("username", "Telk")``` whats wrongs with the code
its discord.js
austere meadow
#

whats the error

earnest phoenix
#

it says null when i run the command

#

and i did it in a guild not dm

austere meadow
#

if it returns null it means the member wasn't found under that query

earnest phoenix
#

but my username is Telk

topaz fjord
#

did you try

trim plinth
#

try users instead of members

earnest phoenix
#

ok

trim plinth
#

@earnest phoenix

austere meadow
#

^ maybe you aren't cached in the members collection

earnest phoenix
#

message.guild.users is undefiend

austere meadow
#

client.users

earnest phoenix
#

but i want it only in the guild

austere meadow
#

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

earnest phoenix
#

where the message was sent

topaz fjord
#

try to do message.guild.members.fetch()

earnest phoenix
#

doesnt dat need the id?

topaz fjord
#

then iterate through all users to find a user with the name Telk

#

wait no

earnest phoenix
topaz fjord
#

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

earnest phoenix
#

xD ikr

#

i gtg so brb

terse quarry
#

Is there a more efficent way of waiting then asyncio.sleep()?

#

Maybe something that "persists" even after a restart?

low rivet
#

no

#

youd have to save to db and resume after restart and stuff

terse quarry
#

yeah that's what i thought

#

maybe i'll just save the time and every second check

mental willow
#
@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
earnest phoenix
#

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

solid cliff
#

@mental willow ✅ = \✅, ❌ = \❌

earnest phoenix
#

?

mental willow
#

@solid cliff where do that go?

earnest phoenix
#

hey please help me

solid cliff
#

@mental willow try unicode characters instead of the name of it

mental willow
#

what lib

solid cliff
#

bot.add_reaction('✅')

mental willow
#

@earnest phoenix what libary

earnest phoenix
#

discord.js

mental willow
#

await bot.add_reaction(':white_check_mark: = ✅, :x: = ❌')

#

@solid cliff

solid cliff
#

just unicode

#

lol

mental willow
#

k

solid cliff
#

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.```
mental willow
#

u"\u2713"

jagged birch
#

if(!message.content.startsWith(prefix)) return; @earnest phoenix

mental willow
#

U+274C

cyan orchid
#

So can someone help me?

austere meadow
#

whats up

cyan orchid
#

So I followed this tur

#

Tut

#

But with info I want it to send a DM to the person who did the command

austere meadow
#

the simplest way to send a DM to the author of the message would be to use message.author.send()

cyan orchid
#

So how would I put that?

#

Sait

#

Wait

#

Dosent that just send it in the channel

austere meadow
#

nah

#

you are sending it to the message author

cyan orchid
#

Oh ok

austere meadow
#

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

cyan orchid
#

Oh I get it

#

So instead of using..

#

Brb

woven pendant
#

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?

cyan orchid
#

If (message.content == “sendinfo” {
message.author.send(“stuff here”);
}

earnest phoenix
#

@cyan orchid ur missing a ) after the "sendinfo"

cyan orchid
#

@austere meadow

earnest phoenix
#

also what texteditor are you using?

cyan orchid
#

Visual studio code

#

Oh and yeah

austere meadow
#

@woven pendant what lib are you using

woven pendant
austere meadow
#

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

cyan orchid
#

@earnest phoenix

woven pendant
#

ive tried googling it but cant find much. only stuff for js i think

solid cliff
#

@woven pendant rewrite or async because I know for rewrite I just change Bot to AutoShardedBot

#

Discordpy or api server can prob help 👌

woven pendant
#

thanks. i'll ask there

#

oh and sorry. i missed your question. but im using async :/

earnest phoenix
#

? @cyan orchid

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

earnest phoenix
#

what is the 64 for?

cyan orchid
#

Oops wth

#

If (message.content == “sendinfo”) {
message.author.send(“stuff here”);
}

#

Like that?

earnest phoenix
#

that should work

#

use 3 =

#

so ===

cyan orchid
#

Why that many?

earnest phoenix
#

in js 3 = means equals to !== means not equals too and > is bugger < smaller and stuff

#

u should read js docs

cyan orchid
#

Ok

#

I’m more of a c# person

#

But I don’t think you can use c# for discord bots

earnest phoenix
#

u can

cyan orchid
#

Really?!

earnest phoenix
#

google it

#

u can code it in c#

cyan orchid
#

Oh sweet

earnest phoenix
#

😃 no prob

cyan orchid
#

And how would I do a welcome thinf

#

Like just a simple message like “Welcome @whoeverjoined!”

earnest phoenix
#

u need to look at the guildMemberAdd

cyan orchid
#

Ok

#

And @earnest phoenix I’m so sorry but for this tur

#

Tut

earnest phoenix
#

?

#

it doesnt work or wat?

cyan orchid
#

You can only use the YouTube URL

#

But I want to use like !play yeet

#

Then the music will play

earnest phoenix
#

u will need a yt search

cyan orchid
#

Any good one

earnest phoenix
cyan orchid
#

I use ytdl-core

earnest phoenix
#

ytdl-core wont work to search

#

it only works with links

cyan orchid
#

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

earnest phoenix
#

@cyan orchid u need a api key

cyan orchid
#

???

#

What’s that

earnest phoenix
cyan orchid
#

Oh

low rivet
#

you need a bot token as well

#

do u even understand js?

cyan orchid
#

I know that

#

Not reallt

#

Really

#

I’m very bew

#

New

low rivet
#

then learn js first

#

dont try to make a bot first

cyan orchid
#

Nah

#

My bots nearly how I want it anyway

thin rivet
#
            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;

low rivet
#

ur not gonna get anywhere like that @cyan orchid

cyan orchid
#

@low rivet why?

low rivet
#

because you aren't learning the lang

#

you just want something done

#

you don't want to learn

cyan orchid
#

I don’t really like JS

#

I like c# better

earnest phoenix
#

learning more langs will help you also js is an essentials coding lang to learn

#

for websites it is essential

cyan orchid
#

Really?

#

What about HTML and csss

#

CSS*

little garnet
#

One message removed from a suspended account.

#

One message removed from a suspended account.

cyan orchid
#

What

#

How can you turn your dm off??

little garnet
#

One message removed from a suspended account.

solemn obsidian
#

also just send message

#

if it fails -> dm's disabled

cyan orchid
#

Oh

little garnet
#

One message removed from a suspended account.

#

One message removed from a suspended account.

cyan orchid
#

Don’t think you can

solemn obsidian
#

send message, if it fails then you dont have perms

cyan orchid
#

But I don’t know anything

solemn obsidian
#

there is no other way

earnest phoenix
#

@little garnet u should check the docs also what lib u using?

#

i think if the message errors it means it doesnt have perms

gusty mantle
#

How do I make my bot, Online?

earnest phoenix
#

@gusty mantle pick a language to code your bot in pick a libary to code your bot in and google how to use it

gusty mantle
#

Which one did you pick?

#

@earnest phoenix

earnest phoenix
#

i picked discord.js

#

it is pretty simple

gusty mantle
#

Ok.

little garnet
#

One message removed from a suspended account.

frail kestrel
#

@earnest phoenix === means equal value and type, == is equal to

spring ember
#

by value

frail kestrel
spring ember
#

atleast it's not java where you have to use .equals()

frail kestrel
#

what the frick?

spring ember
#

for non primitive types yes

earnest phoenix
#

=== 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

frail kestrel
#

yes

earnest phoenix
#

@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 notlikeblob

low rivet
#

@cyan orchid then make a c# bot?

topaz fjord
#

Wut

edgy needle
#

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})

Discord

Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!

#

Language : Javascript

gilded blaze
#

holy

elder rapids
#

Too many fields by the looks

topaz fjord
#

How many Fields

elder rapids
#

As a first problem

topaz fjord
#

En embed can only have 25 fields

gilded blaze
#

no he sends in parts

edgy needle
#

no i made it shorter

elder rapids
#

Not what I see

topaz fjord
#

Also shouldn't it be message.author.send

gilded blaze
#

^

topaz fjord
#

Not message.member.send

edgy needle
#

ok

#

the embed is not too long

#

it is just in parts

#

embed and embed2

#

but embed2 wont send

topaz fjord
#

Did you try message.author.send

edgy needle
#

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})

Discord

Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!

spring ember
#

can someone help me draw an avatar on an image in Java?

#

or send an example or smth

dusty sandal
#

wait, can someone show me how to make a two step command for a bot

wise bridge
#

what do you mean?

spring ember
#

Library?

wise bridge
#

also which libary?

dusty sandal
#

js

wise bridge
#

i am out

dusty sandal
#

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;```
wise bridge
#

you want the user to input a name and there you are missing code

dusty sandal
#

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

dusty sandal
#

can anyone give me the link to the part of the discord js website where you can delete messages

low rivet
#

why not search the documentation yourself? GWcfcThonk

dusty sandal
#

i should try that cept im bad at finding things

#

ill do it again

gilded blaze
#

Anyone good with Laravel custom auth?

elder rapids
#

Laravel Thonk

#

I've worked with Laravel quite a bit but I'm unsure about custom auth

gilded blaze
#

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

elder rapids
#

With Laravel I use Socialite for Discord OAuth

gilded blaze
#

oh

#

hmm

#

Do you use Stateless Authentication?

elder rapids
#

One-time session auth?

gilded blaze
elder rapids
#

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)

gilded blaze
#

hmm Socialite doesn't have Discord

hearty tulip
#

uhm where do i need to use this site's api?

elder rapids
#

You have to grab it from another extension

gilded blaze
#

wew

elder rapids
#

Discord isn't directly in socialite, but you need socialite and another discord package for it

hearty tulip
#

:/

gilded blaze
#

what other Discord package?

elder rapids
#

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

gilded blaze
#

oooo

#

k thanks

#

ima look into it

#

Why does it redirect without a client id?

#

I set it in config

#

nvm

#

cache was fucked

spring ember
#
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

elder rapids
#

120 isn't a valid size

inner jewel
#

needs to be power of two

elder rapids
#

max of 2048 it can go

#

(right?)

inner jewel
#

iirc yes

topaz fjord
#

thr sizes are 128, 256, 512, 1024, and 2048

inner jewel
#
Image size can be any power of two between 16 and 2048.```
spring ember
#

thx! saved me

torpid vale
#

Is there a way to do git pull, but not override a certain directory?

earnest phoenix
#

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

oblique kite
#

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

floral stone
#

while not client.is_closed: why?

#

Let me read your code

#

give me a min @oblique kite

oblique kite
#

sure

floral stone
#

Try puting await in front of it.

oblique kite
#

in front of cliet.move_member(member, channel) ?

floral stone
#

await client.move_member(member, channel)

#

yeah

oblique kite
#

okay

floral stone
little garnet
#

One message removed from a suspended account.

floral stone
#

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))```
oblique kite
#

i've added that await

#

now i'm getting this error

floral stone
#
  1. You don't need to return unless you need to return something
oblique kite
#
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```
floral stone
#

The bot doesn't have permission

#
  1. You don't need to return unless you need to return something
oblique kite
#

I gave it the permission, it now moves the members

floral stone
#
  1. You really don't have to check is client is closed, unless you are running the code offline.
#
  1. 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 break once 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

oblique kite
#

alright

inner jewel
#

@little garnet you don't control anything

#

the user controls if their DMs are on/off

little garnet
#

One message removed from a suspended account.

floral stone
#

Enjoy botting! You will make a wonderful bot owner! 😉

inner jewel
#

bot can't

#

bots get no special permissions to change other users' settings

little garnet
#

One message removed from a suspended account.

inner jewel
#

if you want to know if they're enabled or not, you need to try DMing them

little garnet
#

One message removed from a suspended account.

#

One message removed from a suspended account.

solemn obsidian
#

If sending message fails -> dms disabled

floral stone
#

Can't you check permission of a private channel on node.js?

earnest phoenix
#

hmm

inner jewel
#

you can't on any lib

solemn obsidian
#

The setting isnt public

inner jewel
#

^

earnest phoenix
#

' ^ '

#

OwO

#

cool

oblique kite
#

@floral stone how would I implement on_error in code in my example ?

#

How does it work ?

floral stone
#

@oblique kite async or rewrite?

oblique kite
#

async

floral stone
#
@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

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

floral stone
#

I usually use rewrite and is on mobile now

#

sorry

#

let me find you something

oblique kite
#

sure, no problem

floral stone
oblique kite
#

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 ?

cunning oxide
#

I need help running something through an API using args

#

for example

#

i've got two args

#

an IP

#

and a time

floral stone
#

what api

#

which

cunning oxide
#

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

inner jewel
#

urlencode them

#

and concatenate

fleet mason
#

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 ```

inner jewel
#
  1. keys are case sensitive
  2. check the fs module
  3. JSON.parse
cunning oxide
#

but I need that to run it

#

you know

south solstice
#

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)' ' '

inner jewel
#

add an owner id to the builder

south solstice
#

how do I do that? (guide doesn't go over that)

inner jewel
#

builder.setOwnerId("177200577430683648") in this case

south solstice
#

where should I slap that in?

south solstice
#

👌

cyan orchid
#

Hi

#

Wait don’t matter

south solstice
#

Works now, Thanks @inner jewel

floral stone
#

What's the ratelimit for changing bot name?

heady zinc
#

i would say it's the same than for changing your username

floral stone
#

It's a different name.

#

Are botnames sensitive?

cyan orchid
#

How do I make my bot say what it’s playing

#

Like Bot is playing djsjjd

#

If you get the point

#

Like that

floral stone
#

Language

cyan orchid
#

What

floral stone
#

what api i mean

cyan orchid
#

Oh sorry

#

discord.js

#

Isent that a lib

floral stone
#

Sorry can't help ya..

cyan orchid
#

Damn

low owl
#

Have you considered the official Discord Docs?

cyan orchid
#

No

low owl
#

Why not?

cyan orchid
#

Link?

#

I dident know they existed

topaz fjord
#
cyan orchid
#

tanks

gilded blaze
#

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)

cyan orchid
#

@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

earnest phoenix
#

(Client).user.setPresence

topaz fjord
#

@cyan orchid <Client>.user.presence.game https://discord.js.org/#/docs/main/stable/class/Game

untold whale
#

pappu786

abstract mango
#

ok

cyan orchid
#

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?

earnest phoenix
#

@cyan orchid u will need to make a db a command to change the channel name and stuff

cyan orchid
#

what do you mean

#

@earnest phoenix

gilded thunder
#

@untold whale Joshek

vital lark
kind quiver
#

ok fine

#

whats the code for that

#

what did you chanj

vital lark
#

which code?

kind quiver
#

well now it says no u arguments

kind quiver
#

wheres the code that says "no u # Arguments"

#

in console

vital lark
kind quiver
#

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")

vital lark
#
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

kind quiver
#

show code

vital lark
kind quiver
#

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

vital lark
#

spong

earnest phoenix
#

@kind quiver not to be rude but the code has changed

kind quiver
#

i n t h e t e s t c o m m a n d f i l e

earnest phoenix
#

@vital lark reee

vital lark
#

I'm gonna do JS again, sorry if I wasted time.

edgy vale
#

@brittle oyster wait a second or two and edit the number in the message?

keen anvil
#
const [users, template] = await Promise.all([ // error
      request.get(URL),
      fsn.readFile('./resources/batslap/batman.jpg')
    ]).catch(reject);
earnest phoenix
#

wait

#

fsn?

#

fs-nextra?

keen anvil
#

just a small lib I'm using for reading local images and returning buffers

#

and yes

#

lmfao

cyan orchid
#

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

earnest phoenix
#

fs-nextra is made by the one and only @AoDude#8676 he lit af my dude ;p

keen anvil
#

Nice, it seems fast af

#

love it

earnest phoenix
#

that should work

#

so umm

keen anvil
#

that's what I'm saying

#

makes no sense

cyan orchid
#

Anyone....

#

😔

glossy sand
#

wym it makes no sense

keen anvil
#

It makes no sense because It works sometimes, but not in this command

#

url and the file are the same output as other commands

earnest phoenix
#

Whats the actual error?

keen anvil
#

UnhandledPromiseRejectionWarning: TypeError: (intermediate value) is not iterable

#

basically

#

what I'm doing is rewriting from jimp to canvas

earnest phoenix
#

defuq

keen anvil
#

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
glossy sand
#

I believe that's thrown because you're trying to destructure a non-iterable object?

earnest phoenix
#

Promise.all returns an array

#

ohhhhhhhhhhhh

#

Melmsie

#

its rejecting

#

remove the .catch

glossy sand
#

don't chain .catch calls onto awaited promises

#

just handle rejection with a try...catch clause

earnest phoenix
#

excuse me

#

did you just say

#

to use try catch

#

for a promise

solemn obsidian
#

and whats wrong with it?

#

i prefer having one try catch instead of having literally 50 .catch at end doing same thing

earnest phoenix
#

bc, that is dumb

#

@earnest phoenix he's using canvas-constructor so ofc he's also using fsn mmLol

solemn obsidian
#

I wonder why that exists in the first place Thinkies

earnest phoenix
#

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

clever yew
#

I'm using gifencoder and canvas-constructor too

#

👀

earnest phoenix
#

same

glossy sand
#

um you know the canonical way to handle promise rejection in the async/await pattern is try...catch right

earnest phoenix
#

No bot listed? @clever yew

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 agooglethumbsup

earnest phoenix
#

not for us Eris users

keen anvil
#

Ok here's some more info

#

different error now

clever yew
#

I have been fixing some bugs before pushing to production

earnest phoenix
#

ur still getting errors with that?

clever yew
#

Well, I'm still fixing bugs xD

earnest phoenix
#

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

keen anvil
#
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

earnest phoenix
#

told you

clever yew
#

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)

keen anvil
#

@earnest phoenix regular js errors now, not with packages anymore

clever yew
#

And I'm always like

earnest phoenix
#

UnhandledPromiseRejectionWarning: TypeError: (intermediate value) is not iterable isnt a package error

clever yew
#

"How tf do I fix this"

solemn obsidian
#

eris logs errors fine, its your logs that have the error cut

clever yew
#

Not my errors

#

It's somewhere in d.js that cuts the error stack

keen anvil
#

d.js?

#

ohh you're asking because you wanna switch

#

gotcha

clever yew
#

No lol

solemn obsidian
#

d.js prints errors properly too though

earnest phoenix
#

Kyra, Melmsie is the one who wouldnt budge in circuit's guild

clever yew
#

I'm not rewritting the framework and the bot for Eris, plus Eris lacks of many features I need

#

Which is sad

solemn obsidian
#

what is eris missing 🤔

keen anvil
#

budge about what

clever yew
#

Eris has better sharding and music, but d.js has custom structures

earnest phoenix
#

excuse me, d.js master music is better then eris hands down

heady zinc
#

i mean

earnest phoenix
#

other then missing features and the stupid bugs

clever yew
#

They use Hydra's Prism HYPERMEGAULTRAOMEGAGODLUL

heady zinc
#

v12 has custom structures

keen anvil
#

I run a bot on 150k servers, ofc I'm not budging on eris being better if thats what you mean

heady zinc
#

you can't compare v12 with eris

clever yew
#

Well, yes

#

d.js v11.x is bullshit

#

And you know it

heady zinc
#

¯_(ツ)_/¯

clever yew
#

It's like ages old lmao

heady zinc
#

v12 is too

keen anvil
#

so is eris

#

lmfao

earnest phoenix
#

d.js v10.x and v11.x sucks

heady zinc
#

fucking not released after 6 month

clever yew
#

v12 getting all those enhancements and up-to-date API support

cyan orchid
#

@keen anvil what’s your not called

clever yew
#

Whilst v11 users cringe on old and outdated stuff

keen anvil
#

@fair grail @cyan orchid

earnest phoenix
#

its been over a year since v11 released, lul

clever yew
#

Over a year, FTFY

#

Dude

cyan orchid
#

@keen anvil do you use discord.js?

clever yew
#

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

keen anvil
#

no, d.js is not currently good on large bots as far as performance and resource usage @cyan orchid

clever yew
#

Can agree

cyan orchid
#

What do you use then?

keen anvil
#

Eris

earnest phoenix
#

im using 25mb for 53K members, but ok

clever yew
#

d.js uses a PROXY in the router

heady zinc
#

then again some would argue v12 can

earnest phoenix
#

53k members is nothing

heady zinc
#

but eh

cyan orchid
#

What language is that?

keen anvil
#

also, comparing users to mem usage is dumb

clever yew
#

39.2 mb for 87,374 users

earnest phoenix
#

mfw using over a GB

clever yew
#

Can't we just agree d.js caching is dumb? tracershrug

#

I mean

earnest phoenix
#

agreed

clever yew
#

It doesn't even have LRU

keen anvil
clever yew
#

It caches indefinitely

heady zinc
#

d.js just cache everything it can

#

althrough there is options to decrease that ZoomEyes

earnest phoenix
#

no

#

only for messages sure

#

faking guild count obv that user count is way too low!! @keen anvil

clever yew
#

That's why I overloaded some methods to implement LRU on them 👀

keen anvil
#

lmfao

clever yew
#

I still don't need emojis cached, like, wtf

heady zinc
#

emojis cached lul

clever yew
#

What do I need those 1000 "Emoji" objects for? To take 5 mb of RAM?

keen anvil
#

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.

earnest phoenix
#

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

clever yew
#

I dropped RAM usage by a factor of 10 by implementing LRU into d.js v12

#

255 -> 25 mb with 50k users

keen anvil
#

dang

clever yew
#

guild create, Jacz

earnest phoenix
#

thats the one

#

tbf, I dropped 35mb by using lavalink

clever yew
#

Sneyra could get some mem drop with Lavalink

earnest phoenix
#

I wanna see how you'd implement lavalink into Sneyra tbh

keen anvil
#

I need to use lavalink. I've got a second server gathering dust

clever yew
earnest phoenix
#

lol, I have 3 containers of lavalink running rn

#

lmfao

clever yew
#

And then I have to explain people why they shouldn't use == in JS

earnest phoenix
#

that meme explains it very well

keen anvil
#

I should add a "js meme" command

earnest phoenix
#

jsdev meme command

clever yew
#

0 === ToNumber("0") -> true
0 === ToPrimitive([]) -> true
"0" === ToPrimitive([]) -> false

earnest phoenix
#

programming meme cmd, rather

clever yew
#

According to ECMA 232

#

I still don't get what ToPrototype([]) returns lol

cyan orchid
#

Jeez 123 commands

#

I have like 6

#

Who uses discord commando

clever yew
#

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 LUL

cyan orchid
#

I don’t use commando

earnest phoenix
cyan orchid
#

How do I make commands then

earnest phoenix
#

The docs have guides on there

#

I always hear bad shit abt Commando

cyan orchid
#

Ok thanks

#

Yeah I use the switch method

earnest phoenix
#

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)

cyan orchid
#

Is d.js good

#

That’s what I use

#

Discord.js

earnest phoenix
#

last eval results, command responses, all arg results

#

and it never gets deleted

cyan orchid
#

That good or bad

earnest phoenix
#

very bad

cyan orchid
#

So d.js is very bad

earnest phoenix
#

no

#

d.js isn't a bad lib

#

Im talking about d.js commando

cyan orchid
#

Oh ok

earnest phoenix
#

or was when it was nearing death

#

idk if it actually died yet

#

I am great marketer pls use this module jynEHEH

#

(Jokes)

cyan orchid
#

Should I download the master

earnest phoenix
#

yes

cyan orchid
#

Or normal one

#

What’s the difference

earnest phoenix
#

Stable isnt stable,
Master is working

cyan orchid
#

Ok

#

I don’t get this bit

#

Wait

#

I don’t understand those

clever yew
#

Open the terminal

cyan orchid
#

Do I run it in the terminal

#

Oh yeah

clever yew
#

Go to your bot's folder path

#

Run the command

cyan orchid
#

I know hoe to do all that

earnest phoenix
#

you're on the wrong docs

clever yew
#

Also that

#

Since KlasaClientOptions now extends DiscordJSOptions

earnest phoenix
#

k-k-komada 👀

cyan orchid
#

You sure

earnest phoenix
#

go to the main page

#

vue imma kill u

clever yew
#

The routes changed

#

Because stable never had the new docs

#

They're kind of... "emulated"

earnest phoenix
#

i wanna kill jacz

#

i love you to x.x

clever yew
#

(We compiled the docs without modifying the branch and uploaded them to the docs branch)

cyan orchid
#

What

clever yew
#

And don't change the branch

cyan orchid
#

Still the same thing

clever yew
#

Oh god, the Getting Started is soooo old, it still includes Evie's quote

cyan orchid
#

Hmm

earnest phoenix
#

go to the main page

#

then click on docs

#

then where is says stable click on it then click master

cyan orchid
#

Yeah that’s what I did

#

Oh ok

#

Oh and I’m on phone

little garnet
#

One message removed from a suspended account.

little garnet
#

One message removed from a suspended account.

neat falcon
#

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)

earnest phoenix
#

listen to the debug event

neat falcon
#

hmm ok

neat falcon
#

i tried that

#

still nothing

earnest phoenix
#

dafuq

#

create an issue on d.js repo

austere meadow
#

@neat falcon g'day derpy whats going on, are you running v11 exactly or v11.x?

earnest phoenix
#

I'd assume latest v11

neat falcon
#

yes

#

probably

austere meadow
#

probably

#

ok

#

run an npm ls discord.js for me my friend

earnest phoenix
#

or eval require("discord.js/package.json").version

neat falcon
earnest phoenix
#

ok good

austere meadow
#

wait what is stable

earnest phoenix
#

11.3.2

austere meadow
#

oh

#

can you post some of your music code, more specifically when it joins

neat falcon
#

sure

austere meadow
#

thanks mate

earnest phoenix
#

when u play as well

neat falcon
#
         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)

austere meadow
#

alright

#

that video

#

is not available in my country

#

is it available in yours?

neat falcon
#

yes

austere meadow
#

its probably leaving because its reaching the end event immediately

neat falcon
#

though not sure about vps country