#development

1 messages ยท Page 1068 of 1

hazy sparrow
sonic lodge
#

looks like you tried setting your bot's presence to something other than a string

hazy sparrow
#

should i put it in a template literal?

sonic lodge
#

no, you can .toString() it and it'll be fine

hazy sparrow
#

ah ok

#

ty for the help

stark abyss
#

Whatโ€™s the discord rate limit for unverified bots and what happens if hit it

lusty quest
#

the ratelimits are different for the endpoints. the punishment is a lockout. the lockout is dynamic depending on how much you hit the limit

earnest phoenix
nimble hazel
#

If I were to create a guildMemberAdd for displaying the channels user count, what variable would I use? cause guild.memberCount doesnt work

sudden geyser
#

You mean the guild's member count?

nimble hazel
#

yes

sudden geyser
#

Also the first parameter for the event is a guild member instance. So you're probably looking for <GuildMember>.guild.memberCount

nimble hazel
#

okay thanks

earnest phoenix
torn ravine
#

@earnest phoenix use an embed

#

they look kinda nice

#

my example is a bad example of an embed but Iโ€™m fixing it

earnest phoenix
#

how do I make an embed?

jolly quail
#

In js?

earnest phoenix
#

I'm gonna be using discord bot maker from now on so I guess that's a yes

jolly quail
#

See Discord.RichEmbed()

#

In the docs

earnest phoenix
#

See Discord.RichEmbed()
@jolly quail In v.12 its MessageEmbed()

jolly quail
#

Ig I'm not using v12 then?

earnest phoenix
#

Ohh right

#

Sorry

jolly quail
#

Idk

#

Is richembed deprecated?

#

In v12

#

Or it still works?

earnest phoenix
#

Deprecated

#

helloo?

dusk sphinx
#

Is anyone here using discord bot designer app

crimson vapor
#

Can't say I know of anyone here using it

earnest phoenix
#

does anyone know how to use embed for discord.js ?

crimson vapor
#

yea, what are you trying to make an embed of

earnest phoenix
#

like

#

when someone says

#

help

crimson vapor
#

ok one sec

earnest phoenix
#

im very new to using js

#

this is my like 4th bot

crimson vapor
#

yea also that

earnest phoenix
#

i tried

#

im just

#

confuuseddd

crimson vapor
#

u have any other questions we can help

earnest phoenix
#

ok

#

I can hab

#

OK ๐Ÿ˜„

#

but can i dm you?

#

Sure.

#

Ok

restive pebble
#

setUrl

#

if discord.js

earnest phoenix
#

ok

night bridge
#

can we use bot.guilds.cache as database?

west skiff
#

what library are you talking about?

barren basin
#

Does someone know what the following error means and how to solve the issue?

||(node:8604) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
at RequestHandler.execute (node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:8604) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). ||

restive pebble
#

it means

west skiff
#

you probably meant to use a code block (```) not spoilers (||) btw

restive pebble
#

the message ur fetching

#

dosent exist

#

or has been deleted

earnest phoenix
#

is this bad?

#

the top part

west skiff
#

are you scrolled all the way up?

#

if you are id balance the padding at the top and bottom of that header

earnest phoenix
#

it stays at top

west skiff
#

ok then yeah i'd balance the oadding

earnest phoenix
barren basin
#

@restive pebble it has been deleted on discord or in my code ?

restive pebble
#

discord

west skiff
#

the api is responding saying it doesnt have that message

barren basin
#

So i can do nothing ?

restive pebble
#

u cannot

barren basin
#

ok, thank you for your help

hazy sparrow
#

why does

taggedUser.roles.add('563606400853606410')

work but not

taggedUser.roles.add('Muted')
west skiff
#

because there can be multiple roles with the same name

#

So the library requires a specific ID

hazy sparrow
#

there isnt in my server

#

only 1 role

fierce wolf
#

wait how to add your own emoji on the embed, like it's permanent?

west skiff
#

if you want to go through the roles list yourself and find one with a specific name you can but most libraries require you to refer to resources with IDs

hazy sparrow
#

i use d.js

earnest phoenix
#

can i gte help with my dek-profile cmd

#

How may i help you?

#

well i have a black line around the pfp

#

i want to get rid

#

Show me.

#

Oof, i cant help you with this, i am sorry.

#

ok

hazy sparrow
#
 if(taggedUser === message.members) {
                `you can't mute yourself`
            }

this isnt working and just doing what's next which is

 newEmbed.setTitle(`:bowyesmark: *** ${taggedUser.user} was muted.***`)
            .setColor(0x43b581)
         taggedUser.roles.add('563606400853606410')
        message.channel.send(newEmbed)
        } 
       
earnest phoenix
#

dek-profile

#

add return

#

It will end the function

hazy sparrow
#

ah ok

earnest phoenix
#

Also use message.reply

night bridge
#

Hirio : can we use bot.guilds.cache as database?
tictac : what library are you talking about?
@west skiff discord.js library

earnest phoenix
#

is there a admin here?

#

@earnest phoenix is dm advertising

#

Dw

#

Dmed the moderator

pale vessel
#

hot discord you got there

earnest phoenix
#

Is that

#

BetterDiscords

#

yes why?

#

is it bad..???

mild salmon
#

Good morning. I'm new here. Can you help me with some topic? Is there any perfomance difference between a bot written in Python and a bot in Java?

earnest phoenix
#

oh..

#

so should i remove it?

#

uhm..

#

no reportp ls

#

report pls

#

i didnt know

slender thistle
#

@mild salmon

Java is a compiled programming language, but rather than compile straight to executable machine code, it compiles to an intermediate binary form called JVM byte code. The byte code is then compiled and/or interpreted to run the program.

Python, on the other side, is interpreted. So, in terms of performance, Java would win

mild salmon
#

@slender thistle thank you, in theory, if I compile Python using PyFreeze o Pyinstaller, to a .exe, can I get the same perfomance?

slender thistle
#

Hm, I never worked with either, but if they compile the source code straight to machine code, they should at least be equal in performance

stiff stream
#

how do i make that the lost part will be empty

#

and will not say undefine

slender thistle
#

Add a zero-width space

#

Or try not to use a field if possible

mild salmon
#

Yes, they can compile the source code in Python straight to machine code. I've used it for some applications.

stiff stream
#

if i wont use this its says undefine

mild salmon
#

wait... is that javascript?

stiff stream
#

yes

mild salmon
#

๐Ÿ˜ฎ wow!

stiff stream
#

๐Ÿคฏ

#

so?

#

any one know>?

slender thistle
#

Then, yeah. The difference should be around equal if not greater, but I guess benchmark tests will help you more than my guesses :p

stiff stream
#

ok

earnest phoenix
#

You need to enter a value in the value, Embed field value cannot be empty. @stiff stream

#

Or add zero width space

#

C++ or java

stiff stream
#

k

Or add zero width space
@earnest phoenix

#

ty

mild salmon
#

I guess this is the best bot client

earnest phoenix
#

"\u200b"

stiff stream
earnest phoenix
#

"\u200b"
This adds the Zero Width Space if you don't have any value to send in the embed, Else value = your value.

stiff stream
#

so

#

like this?

gleaming bane
earnest phoenix
#

yes

stiff stream
#

ty

gleaming bane
#

i cant load quick.db

stiff stream
#

@earnest phoenix but now its look like this

#

i want it to mention the user not the id

#

what to do?

mild salmon
#

Can you recomend me some good documetation for Python or JavaScript? I'm senior in JS and semi in Python, but I don't know anything about bots.

pallid zinc
#

Make it message.author.id

stiff stream
#

me?

pallid zinc
#

Yup

stiff stream
#

k

pallid zinc
#

Like
<@${message.author.id}>

pale vessel
#

just `${message.author}`

earnest phoenix
#

Can you recomend me some good documetation for Python or JavaScript? I'm senior in JS and semi in Python, but I don't know anything about bots.
@mild salmon
https://discordpy.readthedocs.io/en/latest/
https://discord.js.org/#/docs/main/stable/general/welcome

pale vessel
#

it's a string

pallid zinc
#

just `${message.author}`
Not working for him

pale vessel
#

it should

pallid zinc
#

Scroll a bit

pale vessel
#

weird

mild salmon
earnest phoenix
#

${message.author.mention} @stiff stream

#

e

pale vessel
#

that's eris

#

on discord.js it would be .toString()

#

not sure on v11 though

earnest phoenix
#

i cant load quick.db
@gleaming bane i got that problemo too

#

I can fix it maybe

restive pebble
#

what is error lol

earnest phoenix
#

Run these npm shit in yoir Linux console in the exacr same order idk about other Operating systems:

#

npm i bindings
npm i quick.db
Yeah that's literally fixed my own 100000000 errrorrrs smh

#

Also why does message.guild.members.cache.random() return a user ID in v12 instead of a username#tag like in v11

night bridge
#

can someone gimme guide about limited time input?
Example :

Me : -poll
Bot: Input Poll Title! // 30 Second Limit, Max Input 1
Me : Poll title
Bot: Input List of Poll // 30 Second Limit, Max Input 1
Me : True, False
Bot: Time Limit of Poll // 30 Second Limit, Max Input 1
Me : 30 Second
Bot: Embed (Pool Title, True, False) // Result of Pool with Time Limit
#

i tried discordjs to use message.channel.awaitmessage() but the limit but it not working

pure lion
#

Show the awaitmessages code

restive pebble
#

{time:1000}

gleaming bane
#

@earnest phoenix bro..

#

you awesome

dull badger
#

Guys can help me?
I have a bot and im new at coding.
I want to make [prefix]invite command (it sends bot's invite link)

misty sigil
#

what code do you have

dull badger
#

@misty sigil whut?

misty sigil
#

what code do you have so far.

#

and what language / library

dull badger
#

Im using glitch

misty sigil
#

need lib mmulu

earnest phoenix
#

DiscordJS or eris or whatever

dull badger
#

Just gimme command

#

Discordjs

misty sigil
#

do you have a message listener?

dull badger
#

No

misty sigil
#

do you have any code

dull badger
#

Wanna see bot?

misty sigil
#

send code yes

dull badger
#

@earnest phoenix bruh

misty sigil
#

lol

#

its happened before

dull badger
#

Lol

#

Did any big brain person send token? @misty sigil

#

Bruh

misty sigil
#

cant talk about that further tho mmulu

jolly quail
#

Yeah happened some times

earnest phoenix
#

yeyeyeyye I made a js music bot

#

2|Boat | HTTPError [AbortError]: The user aborted a request.
2|Boat | at RequestHandler.execute (/home/amy/Boat/node_modules/discord.js/src/rest/RequestHandler.js:107:21)
2|Boat | at processTicksAndRejections (internal/process/task_queues.js:97:5) {
2|Boat | code: 500,
2|Boat | method: 'get',
2|Boat | path: '/gateway/bot'
2|Boat | }

#

can anyone help?

#

not your fault

modest maple
#

For once

earnest phoenix
#

5xx errors are not your fault and instead the host's

#

well not your host, the host of whatever you're trying to connect to

viscid grail
#

how do you get emojis by id in discord js v12

tight plinth
#

<guild>.emojis.cache.get("id")

earnest phoenix
#

So

#

If i use discordjs light i have to fetch everything

dull badger
#

When i use

#

This command

#

There is a text

#

UNDEFINED

modest maple
#

๐Ÿ˜ฉ

dull badger
#

Me noob

earnest phoenix
#

Its vecause

#

because

#

.addField()
Have 2 aregument

stiff stream
#

hey

earnest phoenix
#

Wait it clal arguement right?

#

Or parament

#

Idk

dull badger
#

So?

earnest phoenix
#

So the first one is title

#

And the second one is description

stiff stream
#

someone know how do i make that if they react the bot will DM the person that react something?

earnest phoenix
#

i would suggest you to use .setDescription()
In this case

#

someone know how do i make that if they react the bot will DM the person that react something?
@stiff stream listen to an event

dull badger
#

K

earnest phoenix
#

Thats call

#

Reactionadd

#

Thingu

#

Idk

#

Listen for that event

#

Btw the message that will trigger the event need to be cached

lusty quest
#

@dull badger you can use addField but you need to supply a Title and a Text for the field ("title","Textfield")

earnest phoenix
#

is it possible that djslight borks channel permissions

#
    if (!voiceChannel) return message.channel.send('Please join a voice channel before playing a song.');
    if(voiceChannel) voiceChannel = await message.guild.channels.fetch(voiceChannel.id)
    const permissions = voiceChannel.permissionsFor(message.client.user);
    console.log(permissions)```

this is returning ``Permissions { bitfield: 0 }``
lusty quest
#

you need to cache permissions

earnest phoenix
#

i am fetching the channel though

#

how do i fetch permissiosn

lusty quest
#

or try permissions.has

earnest phoenix
#

?

#

voiceChannel.permissions undefined

lusty quest
#

ohh sorry this was for the member object

#

but try enabling the caching of permissions it doesnt impact the ram usage this much

summer acorn
#

So, currently sharding for the first time, should I post to dbl in the index file or the bot file?

earnest phoenix
#

but try enabling the caching of permissions it doesnt impact the ram usage this much
@lusty quest how?

#

This is all I have

lusty quest
#

enablePermissions: true in your client constructor

earnest phoenix
#

No such option

lusty quest
#

are you on V3?

earnest phoenix
#

yep

#

maybe its cacheOverwrites?

lusty quest
#

idk then. i guess wait for tim

pure lion
#

client({enableChannels:true})

earnest phoenix
#

im fetching it

pure lion
#

I think that caches all of every channel object

earnest phoenix
#

i dont want to cache it

pure lion
#

Oh

earnest phoenix
#

im alr fetching

#

My issue is permissions

lusty quest
#

if you fetch the channel it does the same

earnest phoenix
#
    let voiceChannel = message.member.voice.channel;
    if (!voiceChannel) return message.channel.send('Please join a voice channel before playing a song.');
    if(voiceChannel) voiceChannel = await message.guild.channels.fetch(voiceChannel.id)
    const permissions = voiceChannel.permissionsFor(message.client.user);
    console.log(permissions)```
#

Output: Permissions { bitfield: 0 }

lusty quest
#

i think you have there a error

#

you fetch the channel from the variable you define

earnest phoenix
#

nono its valid

#

i just didnt send the whole code

summer acorn
#

I am sharding for the first time. Should I post stats to DBL in the index file where I shard or the bot file where the client will be?

lusty quest
earnest phoenix
#

there fixed

lusty quest
#

ok this makes more sense

#

@summer acorn idk my bot is to small for sharding. but i guess the Bot file is fine

summer acorn
#

I mean, I don't know to be honest.

earnest phoenix
#

im so confused ngl

lusty quest
#

i would just try and see if it will try and send it for every shard or not. if it does put it in the index file

pure lion
#

@summer acorn
index.js: sharding shit
bot.js: bot

#

Wait you already knew that

#

*dies*

earnest phoenix
pure lion
#

Await the join, not the fetch

#

let connection = await message.member.voice.channel.join()

#

You don't need to fetch the perms that way either, just check if it can't join and where

earnest phoenix
#

I want to check the perms

#

Forget the join

pure lion
#

I'm not at my pc rn so I can't get the exact code but add some if statements to check the perms of the bot

lusty quest
#
    const voiceChannel = msg.member.voice.channel;
        if (!voiceChannel) return msg.channel.send('I\'m sorry but you need to be in a voice channel to play music!');
        const permissions = voiceChannel.permissionsFor(msg.client.user);
``` this works in V12, but havent tested it in d.js-light
#

then i just check if the permission for connect and speak are there or not

earnest phoenix
#

Doesnt work

lusty quest
#

wait nvm its the same code

pure lion
#

Bru

earnest phoenix
#

smh

#

djs-light aint so fun ๐Ÿ˜ฆ

lusty quest
#

i know tim is online on his support server

earnest phoenix
#

kk lemme join

pure lion
#

Invite me too x)

#

e

hazy sparrow
#

me tooo

#

i need tim in my coding life

misty sigil
#

im in tim's server

earnest phoenix
#

guys how can i make a global function?

#

uhh

#

@slender thistle

#

can someone gimme guide about limited time input?
Example :

Me : -poll
Bot: Input Poll Title! // 30 Second Limit, Max Input 1
Me : Poll title
Bot: Input List of Poll // 30 Second Limit, Max Input 1
Me : True, False
Bot: Time Limit of Poll // 30 Second Limit, Max Input 1
Me : 30 Second
Bot: Embed (Pool Title, True, False) // Result of Pool with Time Limit

@night bridge me needs help too me wants to figure out how to use awaitmessage

restive pebble
#

global function @earnest phoenix

#

export it

#

export default function(){}

#

and import it

earnest phoenix
#

uhhhhh

#

how?

#

Is it possible to use variables inside a regex?
For example

this.match(/.{someNumber}/)```
restive pebble
#

u use js?

#

or ts?

earnest phoenix
#

yes

#

js

restive pebble
#

ok

#

module.exports.function_name=()=>{}

#

and require it

earnest phoenix
#

what does name replace with the name or smth?

west skiff
#
new RexExp(`.{${someNumber}}`)```
#

@earnest phoenix

earnest phoenix
#

Hmm lemme try

#

@west skiff what if i want it global, global match

west skiff
#

you could google it.

#
new RexExp(`.{${someNumber}}`, 'g')```
earnest phoenix
#

Hmm let's see

restive pebble
#

hmm

earnest phoenix
#

and require it
@restive pebble how do i require it?

restive pebble
#

u dont know how to require

#

sounds pro

earnest phoenix
#

it a function tho

restive pebble
#

const function = require('./filename')
function.functionName()

earnest phoenix
#

like

const kek = require('../functions.js')
restive pebble
#

yes

#

can i make an api with react?

cinder patio
#

React is used for UI

earnest phoenix
#
if (message. content. includes ("kekw") {
message. channel. send (":K"+"E"+"K"+"W:");
}
#

Doesn't the formatting infuriate you

misty sigil
#

YES

#

and you didn't close the damn if ( bracket

restive furnace
#

ugh that code

#

message. channel. send ("hi")

low marsh
modest maple
#

Lol good luck with that

#

You're using a virtual server with Windows os?,๐Ÿค”

low marsh
#

yes

modest maple
#

That seems unbelievably dumb

low marsh
#

nah it's not if u don't know why I have to use windows

lusty quest
#

some games got some flaky Linux Servers. so this would be one point

pure lion
#

:l

low marsh
#

I am hosting several Game Servers with a Server Manager I coded in C# with a beautiful GUI ^^

modest maple
#

then hf installing the visual studio bloat

low marsh
#

well I did

#

but I'm still getting the error

#

xD

jagged sun
#

Hey, does anyone know how I can get any user that first reacts to a message? discord.js

earnest phoenix
#

its simple

jagged sun
#
            const filter = (reaction, user) => {
                return [':gift:'].includes(reaction.emoji.name)  && user.id != 485178809285476368
            }
            message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
                .then(collected => {
                    const reaction = collected.first()
                    console.log(reaction)

                    if (reaction.emoji.name === ':gift:') {
                        msg.reply('You got a gift!')
                    } else {
                        msg.channel.send('F')
                        return
                    }
                })``` That's what I got now
hazy sparrow
#

"Its simple"

jagged sun
#

its simple
@earnest phoenix How do I do it?

earnest phoenix
#

your code seems broken

restive furnace
#

@low marsh u dont have windows sdk? read the errpr

earnest phoenix
#

try this

#
.catch(collected => {
    message.channel.sendMessage("timout error");


const filter = (reaction, user) => ['๐Ÿ˜‚'].includes(reaction.emoji.name);



    embedMessage.react('๐Ÿ˜‚');

    embedMessage.awaitReactions(filter, {
      max: 1,
      time: 60000,
      errors: ['time']
    }).then(collected => {

    const reaction = collected.first();

    if (reaction.emoji.name === '๐Ÿ˜‚'){
      message.channel.sendMessage("Yay.");

    }    
  });    
});
jagged sun
#
  '485178809285476368' => ClientUser {
    id: '485178809285476368',
    username: 'Eve',
    discriminator: '3009',
    avatar: 'd3c23eed5c04fa62d17c22265619ef18',
    bot: true,
    lastMessageID: '734011356126380115',
    lastMessage: Message {
      channel: [TextChannel],
      id: '734011356126380115',
      type: 'DEFAULT',
      content: '',
      author: [Circular],
      member: [GuildMember],
      pinned: false,
      tts: false,
      nonce: undefined,
      system: false,
      embeds: [Array],
      attachments: Collection [Map] {},
      createdTimestamp: 1595072344572,
      editedTimestamp: NaN,
      reactions: [Collection [Map]],
      mentions: [MessageMentions],
      webhookID: null,
      hit: null,
      _edits: [Array]
    },
    verified: true,
    email: null,
    localPresence: { status: 'online', game: [Object], afk: false, since: 0 },
    _typing: Map {},
    friends: Collection [Map] {},
    blocked: Collection [Map] {},
    notes: Collection [Map] {},
    premium: null,
    mfaEnabled: false,
    mobile: null,
    settings: ClientUserSettings { user: [Circular] },
    guildSettings: Collection [Map] {}
  },
  '339109941023604736' => User {
    id: '339109941023604736',
    username: 'Toby',
    discriminator: '9857',
    avatar: null,
    bot: false,
    lastMessageID: '734011354180223026',
    lastMessage: Message {
      channel: [TextChannel],
      id: '734011354180223026',
      type: 'DEFAULT',
      content: '-help',
      author: [Circular],
      member: [GuildMember],
      pinned: false,
      tts: false,
    }
  }
}``` So what I got now is the list of reactions from all users. But I wan't to get the ID of the second one. (In this case user Toby, ID 339109941023604736)
sick cloud
#

reactions.find

jagged sun
#

@sick cloud how?

hazy sparrow
#

can i make something like if the command is !lolthisisatestcommandtoexplaintoyouguys the bot either replies a or b or c but the chance to reply a is 1/2 and b is 499/1000 and c is 1/1000

#

is there a way to do that?

earnest phoenix
#

something like this maybe

#
var chance = Math.random();
if (chance < 0.5) {
  //50 % chance of something
}
else if (chance < 0.7) {
}
else { }
quartz kindle
#

isnt 499/1000 basically the same as 1/2?

haughty night
#

Almost yes

tame shuttle
haughty night
#

Might as well make it 1/2

quartz kindle
#

in any case just do ```js
if(c < 0.001) {}
else if(c < 0.499) {}
else {}

hazy sparrow
#

ty!

#

i could also do like this?

const cf = Math.floor(Math.random() * (1000 + 1));

if cf === 1 {}

if cf > 1 {}

if cf < 1000 {}
#

I don't really know if it will work

harsh badge
#

@low marsh if you are still using windows, I suggest you check chocolatey.org it will save you

pale vessel
#

-1+1 is redundant

#

it's useless

hazy sparrow
#

okay then

#

@pale vessel what about now

pale vessel
#

close the floor

hazy sparrow
#

oh yea

#

now?

pale vessel
#

Math.floor(Math.random() * 1001) + 1

jolly quail
#

const cf=Math.floor(Math.random()*1000);
if(cf===0){c}
else if(cf<500){b}
else{a}

#

How's this?

pale vessel
#

this will give you at least 1

#

maximum value would be 1000

hazy sparrow
#

okay so it will be


const cf = Math.floor(Math.random() * 1001) + 1

if (cf === 1) {}

else if  (cf > 1) {}

else if (cf < 1000) {}
jolly quail
#

Hmm if ordering would be wrong?

pale vessel
#

yes, that's good

jolly quail
#

is the if ordering correct?

hazy sparrow
#

alright ty

jolly quail
#

Wth

#

Last block will never be accessible

#

Last else if i mean

pale vessel
#

if it's 1000 it can?

hazy sparrow
#

hmm

#

so i switch block b and c?

jolly quail
#

Uhmm cf>1 will take everything

#

Except 1

pale vessel
#

the formula is Math.floor(Math.random() * MAX + 1) + MIN

#

ic what you mean

jolly quail
#

if(cf===1){}
else if(cf<=500){}
else{}

#

This is correct

pale vessel
hazy sparrow
#

what if i witch it

const cf = Math.floor(Math.random() * 1001) + 1

if (cf === 1) {}

else if (cf < 1000) {}

else if  (cf > 1) {}
jolly quail
#

if(cf===1){}
else if(cf<=500){}
else{}
@jolly quail @hazy sparrow

pallid zinc
#

@hazy sparrow if its less then 1000 it means its greater then 1

jolly quail
#

Ya again the same problem as before bro

hazy sparrow
#

;-;

jolly quail
#

Third part will be unreachable

hazy sparrow
#

wha

#

whats a codeing

jolly quail
#

Not an English word :p

#

@hazy sparrow try that

hazy sparrow
#

ok lemme try

jolly quail
#

else only works if previous if failed condition... So if u write if(cf<1000) first it'll take most(almost all) of the cases and u won't ever get to the last statement

#

const cf= Math.floor(Math.random()*1000)+1;
if(cf===1){c}
else if(cf<=500){b}
else{a}

hazy sparrow
jolly quail
#

Ya

#

a will almost never come

earnest phoenix
#

does this work:

bot.on("guildJoin");
jolly quail
#

1/1000 chance

hazy sparrow
#

yea

#

but b and c isnt "that" random

earnest phoenix
#

lmao

jolly quail
#

It's random xD

hazy sparrow
#

i got b 4 times in a row

jolly quail
#

Not such a big deal

earnest phoenix
#

make an array with 100 words and add in the a b and c accordingly to the percentage you want

hazy sparrow
#

i hope so

jolly quail
#

U can get 4 heads in a row

#

1000 words

#

Lol

#

Cuz he requires a to be 1/1000

earnest phoenix
#

Hi !

hazy sparrow
#

the reason i wanted is because i wanted my coinflip command to have a chance to land on side

#

bruh

jolly quail
#

Bro u r wrong then

#

XD

hazy sparrow
#

its 1/6000 chance for side in real life

jolly quail
#

Other two should have equal probability

hazy sparrow
#

how

jolly quail
#

Heads and tails should get equal

#

Obviously

#

Ur just subtracting a small portion of probability from either heads or tails not both

hazy sparrow
#

so heads is 2998/6000 and tails is 2998/6000 and side is 2/6000

#

thats one way to do it

jolly quail
#

Yep

#

Exactly

#

XD

#

No no

#

Add them up

#

Probability isn't 1

hazy sparrow
#

6000

jolly quail
#

2999/6000

#

2999/6000

#

2/6000

hazy sparrow
#

oh yea

jolly quail
#

Lol

#

Anyway no one cares abt that

hazy sparrow
#

XD

jolly quail
#

Cuz we require heads or tails

#

Personally i won't prefer any other option

#

No matter how low the chance

hazy sparrow
#

how about a chance that we will throw it so hig that a plane will hit it

#

or a bird will catch it

jolly quail
#

How about a chance that coin is already biased

low marsh
#

@low marsh u dont have windows sdk? read the errpr
@restive furnace I installed it now,same error win10 sdk

hazy sparrow
#

biased?

jolly quail
#

Resulting in heads 75% of the time

#

That's biasing example

hazy sparrow
#

bad

jolly quail
#

Yep

low marsh
#

@low marsh if you are still using windows, I suggest you check chocolatey.org it will save you
@harsh badge does it fix my issue?

jolly quail
#

Casinos use that

#

:p

#

They want profits xD

hazy sparrow
#

lmao

jolly quail
#

51% chance of losing

#

U will always get profit

#

And the player will think 50% chance of winning

hazy sparrow
#

everyone wants profit

jolly quail
#

In reality it is 49%

#

That's a good strategy xD

#

To earn money

hazy sparrow
#

theres another way

quartz kindle
#

@low marsh you just need to install build tools

hazy sparrow
#

make the chance to lose 100% and just tell "you're just unlucky"

quartz kindle
#

npm install -g windows-build-tools from an admin powershell

jolly quail
#

Ya no one will play that

#

๐Ÿคฃ

#

Ur casino will shut down instead

hazy sparrow
#

but they cant proove thay the machine will always make them lose

#

that*

jolly quail
#

U think ppl r fool? XD

#

Who'll play a game when no one is winning

hazy sparrow
#

true

harsh badge
#

@low marsh see what Tim wrote, that will fix your issue, that is what chocolatey does for you and other things that you might need, check their website

hazy sparrow
#

Ur casino will shut down instead
@jolly quail atleast they will profit a little

knotty patio
#

Bruh

jolly quail
#

Opening casino will make it a loss

#

Casinos r not free xD

#

U have to invest

hazy sparrow
#

just build your own casino with trash

jolly quail
#

Just build casino commands on discord

#

Bots

hazy sparrow
#

oh yea XD

wheat hornet
#

why discord dm everyone

low marsh
#

npm install -g windows-build-tools from an admin powershell
@quartz kindle so I can uninstall VS again? :D

jolly quail
#

why discord dm everyone
@wheat hornet just the developers

wheat hornet
#

ya but it ruined my fucking sleep

jolly quail
#

Ask discord

hazy sparrow
#

why do you check discord when you are sleeping

earnest phoenix
#

This is not on the topic of development please move elsewhere.

hazy sparrow
#

just ignore and chack later

jolly quail
#

Ikr

wheat hornet
#

notification

hazy sparrow
#

ok zoro

jolly quail
#

๐Ÿคฃ

hazy sparrow
#

lol

wheat hornet
#

lmao

warped wind
#

I want the Connection between the public bot and the bot prime
Public bot and Prime in one project credits,level,profile,...

#

But the second token is the one that works
The first only works if you put it in the second

#

help me please

unborn haven
#

guys could u invite my new bot to ur servers i really want to be verified

#

am i allowed to send links?

warm marsh
#

No.

#

That's advertising.

robust moth
#

process.memoryUsage().heapused
This is for how much memory is used

jolly quail
#

Rule 4

#

๐Ÿ™„

#

@unborn haven

unborn haven
#

thx

warped wind
#

process.memoryUsage().heapused
This is for how much memory is used
@robust moth what ??

finite plover
#

How does one get all the emoji in a message but as images?

hazy sparrow
#

why does this work

if(!message.member.roles.cache.has('562486904935940106')){}

but not this

if(!message.member.roles.cache.has('Muted')){}
unborn haven
#

actually

#

thats weird

warped wind
unborn haven
#

in my discord.js it allows me just to type "mute"

digital ibex
#

bow pro

hazy sparrow
#

?

digital ibex
#

its searching for an id, not name

unborn haven
hazy sparrow
#

okay? how do i make it search for a a name

digital ibex
#

use find

pure lion
#

I cba to scroll up but ffs you beat me to it

hazy sparrow
#

like

if(!message.member.roles.cache.find('Muted')){}
digital ibex
#

<Guild>.roles.find((e) => e.name === 'name here')

hazy sparrow
#

ah

#

ty

digital ibex
#

no

#

thats not how find works

#

ok

unborn haven
#

?

jolly quail
#

@hazy sparrow u should learn basics once i suggest..

pure lion
#

:l

jolly quail
#

having problems with find and even if-else isn't good

pure lion
#

Cool

hazy sparrow
#
message.member.roles.find((e) => e.name === 'Muted')
// like this?
unborn haven
#

pls

digital ibex
#

can u not

hazy sparrow
#

having problems with find and even if-else isn't good
@jolly quail i dont have any problems with else if

pure lion
#

Lol imagine only having admin perms

#

x)

digital ibex
#

idk try it

harsh badge
#

@robust moth process.memoryUsage().heapTotal / 1024 / 1024

jolly quail
#

U didn't know the correct usage of if else before xD

pure lion
#

if (retar) return console.log('retar')

hazy sparrow
#

before

restive willow
#

does anybody else using discord.py have an issue with high memory usage? my vps is using like 900mb rn

jolly quail
#

Yeah minutes ago

#

Oof

digital ibex
#
Illegal return statement
pure lion
#

I'm going to ping a mod if you don't stop @unborn haven

jolly quail
#

Just do it

unborn haven
#

ok i stop : (

pure lion
#

x)

restive willow
#

if you need to advertise here, that really says a lot about the quality of your bot lol

#

your personality, too

unborn haven
#

haha no its actually ok-ish good

digital ibex
#

do u realise, everyone with the bot dev role is advertising their bot here eyesFlipped

unborn haven
#

i just dont know how to make it public

pure lion
unborn haven
#

ok

restive willow
#

do u realise, they don't post it in chat, and definitely not in the development chat eyesFlipped

pure lion
#

Bottom.hh

digital ibex
#

no butok

restive willow
#

hahaha

unborn haven
#

i might sound stupid but how do i find the bot's website

restive willow
pure lion
#

The what

digital ibex
pure lion
#

htps

unborn haven
#

ye in that web

pure lion
#

htps: SLS token

unborn haven
#

but if i want to upload my bot it asked me for a website url

digital ibex
#

skip it

unborn haven
#

can i?

digital ibex
#

yes

unborn haven
#

i might sound really stupid this time but whats the bot's prefix?

#

i know what prefix is in code but

#

whats bots prefix?

restive willow
unborn haven
#

?

quartz kindle
#

the prefix you gave it

brittle ruin
#

i need help setting up discord server list bot

#

how do i do it?

earnest phoenix
#

alright, i am chaning to discord.js-light, what do i need to know?

#

My code: https://sourceb.in/71c61e04be
how can i make it like @earnest phoenixs where you do
text stuff | <user> because i want mine to like be easier and not contain the mention in the text only if it is in the text type stuff

tight plinth
#

You can read the docs for it in the readme @earnest phoenix

earnest phoenix
#

HOLY

#

It reduced my ram usage by 50%

#

how can i get someones id from when they join my patreon?

restive pebble
#

@earnest phoenix split message content "|"

low marsh
#

I'm using javascript const dispatcher = connection.play(`${streamLink}`) to stream it to the VC. But it does not work on my Server,he connects but there is no sound. Anyone a Idea?

earnest phoenix
#

@earnest phoenix split message content "|"
@restive pebble how

restive pebble
#

nub

#

split

#

@low marsh u sure its an playable stream?

earnest phoenix
#

My code: https://sourceb.in/71c61e04be
how can i make it like @earnest phoenixs where you do
text stuff | <user> because i want mine to like be easier and not contain the mention in the text only if it is in the text type stuff
@earnest phoenix like typing just their name or nickname?

#

both

restive pebble
#

omg

earnest phoenix
#

message.guild.members.cache.find(x => x.user.username.toLowerCase() === args.join(' ').toLowerCase()) || message.guild.members.cache.find(x => x.nickname !== null && x.nickname !== undefined && x.nickname.toLowerCase() === args.join(' '))

#

wait

#

name

#

;-;

#

dude

#

lol

low marsh
#

@low marsh u sure its an playable stream?
@restive pebble yes,it's working on my local pc

restive pebble
#

just split it and check it

low marsh
#

I'm streaming a m3u8 link

earnest phoenix
#

just split it and check it
@restive pebble bro how

restive pebble
#

message.content.split("|")

earnest phoenix
#

ok where put

restive pebble
#

u know what split does?

earnest phoenix
#

no

#

never used i think

restive pebble
#

i dont think m3u8 sources are supported

rich yacht
#

i hate v12

low marsh
#

but it's working on my local pc xD

hexed oyster
#

I enjoy making bots, and up until now I have used discord.js, but with the API update coming Iโ€™m thinking about learning to make bots using the straight api. Is there a good video to help start me out?

low marsh
#

ฤฑ hate v12
same

rich yacht
#

i love you v11

restive pebble
#

dude

#

u can stream many sources on pc

earnest phoenix
#

@earnest phoenix i use regex, my own regex facepalm

restive pebble
#

mp4 to mp3 to opus to mpeg lots of

earnest phoenix
#

@earnest phoenix i use regex, my own regex :facepalm:
@earnest phoenix huh

restive pebble
#

split the message

#

it wil return an array

#

then enjoy

earnest phoenix
#

Splitting the message isn't a good idea actually

#

uhhhhhhh

restive pebble
#

voltrex is typing so wait @earnest phoenix

earnest phoenix
#

ok....

#

<message that has a |> | <user>
This is why

Hmm | bro | <User>``` it will take `bro` instead of the user if use split
#

Is there a way to know if my bot was disconnected?
an event or something (djs)

restive pebble
#

for vc?

#

or ws?

earnest phoenix
#

voice

summer torrent
#

there is a shardDisconnect event iirc

restive pebble
#

disconnect

#

event

summer torrent
#

voiceStateUpdate

earnest phoenix
#

<message that has a |> | <user>
This is why

Hmm | bro | <User>``` it will take `bro` instead of the user if use split

@earnest phoenix uhh ok

restive pebble
#

voiceStateUpdate

earnest phoenix
#

what do I look for in voiceStateUpdate

restive pebble
#

and match the bot

#

id

low marsh
#

+-- UNMET PEER DEPENDENCY @discordjs/opus@0.3.2
why tf

rocky bronze
#

Can anyone help me please?

earnest phoenix
#

<message that has a |> | <user>
This is why

Hmm | bro | <User>``` it will take `bro` instead of the user if use split

@earnest phoenix so can you help fix that

#

@earnest phoenix voiseStateUpdate then check if the old voice channel of the bot is available and the new one is null or undefined

restive pebble
#

@earnest phoenix

#

do this

earnest phoenix
#

kk

pure lion
#

||I'm just starting out with C# and I'm getting an error when debugging:
could not copy: (//filepath) to bin/debug/netcoreapp3.1/test_1.exe. Exceeded retry count. Failed. File is locked by: "Test_1 (14948)

so ye idk what to do||

restive pebble
#

connection.on("disconnect")

pure lion
#

X)))))

summer torrent
pure lion
#

e

restive pebble
#

if the bot is disconnected on song end

#

it will work

#

if someone forced disconnected

#

still works

earnest phoenix
#

@earnest phoenix regex only way
Mention:
<args>.join(" ").match(/\w*\s\|\s\<?(@|@!)(\d{17}|\d{18})\>/)
ID:

<args>.join(" ").match(/\w*\s\|\s?(\d{17}|\d{18})/)```
Username:

<args>.join(" ").match(/\w*\s|\s\w*/)```
Here are the regex i made for checking them, but you gotta do the splitting and stuff yourself

#

i develop pancakes

fierce wolf
#

hi, how to put your own emoji at the embed like it's totally permanent in there?

low marsh
#

any idea how to fix this?
UNMET PEER DEPENDENCY @discordjs/opus@0.3.2

earnest phoenix
#

That isn't something you need to worry about.

low marsh
#

but my bot doesn't work anymore

#

that's the point

earnest phoenix
#

Are you getting an error other than that?

low marsh
#

nope

#

I'm streaming radio channels with a m3u8 link

#

and it's working on my local windows pc

#

but when I try it on my windows vserver it does not work

#

the bot joins,but there is no audio output

earnest phoenix
#

Ohh. then maybe you do need that, sorry for my bad assumption. go ahead and run npm i @discordjs/opus

low marsh
#

hmm

digital ibex
#

im pretty sure u cant use npm in bash

low marsh
#

I can

#

^^

digital ibex
#

doesn't work in an ubuntu terminal anyways

low marsh
#

I think there is a problem with VS Build Tools on my server

#

@earnest phoenix installed build tools,installed node-pre-gyp and @cosmic surgejs/opus:

#

@quartz kindle do u have any idea?

#

smth is broken here

earnest phoenix
#

Tim probably does know but please try not to ping users for support.

#

I'm unfamiliar with discord.js, Maybe for the time being it would be better to ask in the official discordjs server.

low marsh
#

hmm

tight plinth
#

@low marsh what's your error exactly

low marsh
#

there is no error

#

but it does not stream audio

#

and idk why

tight plinth
#

Probably a problem with ffmpeg, your host or your code

#

Is ffmpeg installed?

low marsh
#

yes it is

#

also added to PATH

tight plinth
#

How do you host your not?

#

*bot

low marsh
#

wym with host

tight plinth
#

From what device/service do you run it?

low marsh
#

from my Windows Server 2015 using the cmd with: node index.js

#

xd

tight plinth
#

Hmm

#

Then it's probably your code being shit

#

Can you send your play command code?

low marsh
#

no,because it's working on my local PC and I have this problem since I updated to DiscordJS 12 and discordjs/opus

tight plinth
#

Hmm

#

Then it's a problem with your server

#

Does every other command work?

low marsh
#

yep

#

and yt streams are working too

earnest phoenix
#

hm

#

i get free stuff from my dads pedo van

tight plinth
#

i get free stuff from my dads pedo van
@earnest phoenix excuse me

low marsh
#

to stream the m3u8 I'm doing javascript const dispatcher = connection.play(`${streamLink}`)

tight plinth
#

@low marsh where did you get your windows server?

low marsh
#

I rent this server from hetzner lol

tight plinth
#

Never heard of it

#

Try using contabo

#

They rent very cheap and good Linux vps

low marsh
#

hetzner is a huge hosting company lol

tight plinth
#

Like 3 or 4$

#

Well I never heard of it

low marsh
#

Hetzner Online GmbH is an Internet hosting company and data center operator based in Gunzenhausen, Germany.
It should not be confused with its former South African namesake and partner company xneelo (formerly Hetzner (Pty) Ltd) โ€” the two are separate companies registered and ...

earnest phoenix
#

@earnest phoenix excuse me
@tight plinth what

#

its yummy candy

digital ibex
restive furnace
#

(free)

misty sigil
#

return

#

one word

hazy sparrow
#

but where

misty sigil
#

return, it stops the code, so place it before it sends the perm thing thing

chrome olive
#

Hi, I have an array and I want to check if there are for example 2 same elements.
ex:

const array = [1, 1, 2, 3];
// I want to remove 2 elements (1) but first I want to check if there are 2 of 1
hazy sparrow
#

ah ok

#

return, it stops the code, so place it before it sends the perm thing thing
@misty sigil why before?

chrome olive
#

he just said

jolly quail
#

Line 15

#

Almost

sudden geyser
#

You could use filter and count how many elements equal X (1), but that's kind of inefficient on large arrays.

misty sigil
#

return message.channel.send("You do not have permission to mute people.");

hazy sparrow
#

ah line 15

#

ty

jolly quail
#

before bracket

#

Add return;

low marsh
#

so I tried streaming a mp3 link,this does not work either

obtuse jolt
tulip ledge
#

I want to make it so that when you click on this div it opens and closes, Tim, OfficiallyLost and I already tried to add an event listener by running a QueryAll on the divs with that class but that didn't work does anybody have a different solutiion?

#

Please @me if you have a solution

sudden geyser
#

@obtuse jolt if you're talking about after you authenticate and get redirected to the index.php part, it's responsive and easy to use.

#

I assume this is a template though

obtuse jolt
#

Would it be better to move where the guilds are listed?

#

Yeah I have only done authentication so far

#

Login logout etc

#

And guild listing which is 50% done

wintry wing
#

is there any way (in discord.js) to add up more time to the timer in the reaction collector?

obtuse jolt
#

to make it wait longer?

wintry wing
#

yes

obtuse jolt
#

Yes hold on

wintry wing
#

Ok

amber fractal
#

without cache ofc

#

with cache about 300ms

sudden geyser
#

is there any way (in discord.js) to add up more time to the timer in the reaction collector?
@wintry wing create a reaction collector instance and simply use the resetTimer method

obtuse jolt
#

in a message collector you can add .MessageCollector(stuff, { time: 60000 })

#

Would that work

#

In reaction collector?

sudden geyser
#

that's for how long to run the collector for

#

I think they're asking like how to add more time to it

wintry wing
#

I'm not using v12 though.

obtuse jolt
#

Yeah but if you add maxMatches: 1

#

It ends it after 1

#

Iโ€™m not using v12

wintry wing
#

I was talking to Lite

#

and

#

I'm unsure if thatll work in a reaction collector

sudden geyser
#

ah in v11 resetTimer isn't available. There are a few ways you could get around it (e.g. just setting the timer to run for a long time, creating a new collector every time you want some more collected, etc.) Though I recommend you upgrade to v12.

obtuse jolt
#

Yeah

#

It confuses me

#

A lot

#

Tho

wintry wing
#

im planning on upgrading to v12 due to the whole new discord api thing

obtuse jolt
#

You can use intents on v11

sudden geyser
#

I don't think you can

obtuse jolt
#

You can but you canโ€™t use the words

#

You have to use the numbers

#

And if you edit the v11 code you can change it from discordapp to discord

wintry wing
#

yeah but

#

nvm

quartz kindle
#

someone will probably make a fork of djs v11

#

if there isnt one already

sudden geyser
#

why though, that sounds like more work than necessary

quartz kindle
#

because people refuse to update to v12

earnest phoenix
#

i dont

sudden geyser
#

have it break!

quartz kindle
#

once discord's changes go through and v11 breaks, people will start complaining and demanding a fix

#

then someone will make a fork and give it to them

restive pebble
#

ok

#

cool

quartz kindle
#

free popularity points

restive pebble
#

lol

sudden geyser
#

free contributions on github as well

earnest phoenix
#

heyo

#

i have a question

#

how to downgrade to discordjs v11?

restive furnace
#

mehh just use some api wrapper which doesn't upload breaking changes in every major version, or even minor versions

#

if you're too lazy to mitigate from v11 to v12

#

or smth

#

how to downgrade to discordjs v11?
@earnest phoenix why you wqnt tho

earnest phoenix
#

meh

restive pebble
#

just do the opposite of their guide saying upgrading to v11 to v12

earnest phoenix
#

Ah i see

sonic lodge
#

why do you want to downgrade

earnest phoenix
#

wtf i accidently download v13

sonic lodge
#

there is no v13?

quartz kindle
#

and i accidentally built a shelf

hazy sparrow
#

no errors in the console

pure lion
#

Where is taggedUser

earnest phoenix
#

So not sure the best way to handle this, I want customizable news pages on the app im building, and it uses Vue. I have a socket.io server that supplies the news feed among other things on the site, would serving something like this:

   {title: "Test", date: "July 19th, 2020", author: "AJ Nicoloff", microdesc: "Just another test", article: "<p style='font-size: 22px !important;'>Test</p> <p>Here</p>"}

as v-html="news.content"

which is unescaped content, be dangerous?

hazy sparrow
earnest phoenix
#

it's not user supplied content, it's purely my own content that I provide and have to manually update

pure lion
#

Log taggedser

hazy sparrow
#

okay

earnest phoenix
#

Oh so you are NEW New to javascript

#

Its console.log

#

Not consolelog

jolly quail
#

Oof

hazy sparrow
#

okay

jolly quail
#

Ya learn basics

#

@hazy sparrow

#

๐Ÿ™„

hazy sparrow
#

console.log wasnt working

jolly quail
#

Hmm

sudden geyser
#

bow pro do you have a good understanding of JavaScript

jolly quail
#

Show more code

#

That ,

sonic lodge
#

looks like it's inside an object

hazy sparrow
#

yes it is

sonic lodge
#

that's not gonna work

hazy sparrow
#

okay

jolly quail
#

This is ur first time trying js

#

I guess

hazy sparrow
#

nope

#

something like

#

7th

earnest phoenix
#

Please don't try and make a bot if you don't have a basic understanding of javascript

jolly quail
#

Hmm

earnest phoenix
#

Especially if it's going to be public facing

hazy sparrow
#

its not gonna be public

quartz kindle
hazy sparrow
#

im using it to learn JS

earnest phoenix
#

@quartz kindle I was just looking at that

#

What I got from it was as long as it's a trusted source it should be alright

restive pebble
#

is react good

earnest phoenix
#

personally I like Vue more than react

#

I find react to be overly complicated

#

not hard, but overly complicated

restive pebble
#

oh ok

#

i want to make websites

serene kelp
#

how do you validate a locale

#

like en-US is good, but pt- is not

earnest phoenix
#

You should be able to check validity against it

serene kelp
#

ok i'll check it out

#

hey it works ๐Ÿ˜„

#

thank you

earnest phoenix
#

np! mdn is always a good place to look for random bits

restive pebble
#

so i was saying

#

i want to make web ui

#

like dashboard stuffs

#

not for bot

earnest phoenix
#

I'd just use Vue

#

Make it a single page application

restive pebble
#

is vue better or react

earnest phoenix
#

its all up to personal choice

restive pebble
#

oh

earnest phoenix
#

I love vue but hate react

restive pebble
#

okk

#

vue is easy?

earnest phoenix
#

It's actually really easy to get into yeah

restive pebble
#

oh thx

#

ill try it

earnest phoenix
restive pebble
#

oh

#

idk bulma lol

tranquil sable
#

Anyone got any idea why this wont work

#

It should respond with Automatically translating messages from English to Chinese Traditional for #chtemp.

sudden geyser
#

Try logging data.cmd.to.valid[0] to see what you get

tranquil sable
#

so change const forNames = data.cmd.for.join to const forNames = data.cmd.for.valid[0]

sudden geyser
#

langExceptions, langTo
You need to access the property of the langExceptions object. Like myObject.myProperty or myObject["myProperty"]

tranquil sable
#

sorry, im a tad confused

quartz kindle
#
obj = {
  a:10,
  b:20
}

console.log(`${obj.a}`) // "10"
console.log(`${obj["a"]}`) // "10"
console.log(`${obj, a}`) // ???
tranquil sable
#

wouldn't that require me to predefine it, so if i defined it as obj.a but user uses b then it would respond with the wrong value

copper cradle
#

no

quartz kindle
#

you already predefined langExceptions

#

you just need to use them correctly

copper cradle
#

langExceptions[langTo]

#

do that

#

ez

tranquil sable
#

ok, deploying now i will test

plain ore
#

Can someone help me

#

I'm not able to make the music code for the bot because I use cell phones

#

Someone there know explain to me

warm cloud
#

music doesn't work on phones

#

get a laptop

#

end of story

tranquil sable
#

nope, still responds will no variable

plain ore
#

Okay

digital ibex
#

how r u trying to get the zh-TW message, @tranquil sable ?

tranquil sable
#

From here, zh-TW is not a support language, so fr would return French, gr would return German, but zh-TW is not is not in the ISO of support languages, so im trying to create an exception, so if someone puts zh-TW it will still give a response and not be blank.

#

i tried the above and did langExceptions[langTo] but that did not work

#

is that what you mean @digital ibex

digital ibex
#

u can use if/else

silent berry
#

is it supost to be highestrole or roles.highest in the code

if (message.content.startsWith(`${prefix[0]}kick`)|| message.content.startsWith(`${prefix[1]}kick`)) {
    try {
    if (message.channel.type == "dm") return;
    if (!message.member.hasPermission("KICK_MEMBERS")){
      message.channel.send("You need kick permissions to kick people!")
    }
    if (!message.member.hasPermission("KICK_MEMBERS")) return;
    var reason = message.content.split(' ').slice(2).join(' ')
if (!reason) return message.channel.send(`Please provide a kick reason!`)
    if (message.member.hasPermission("KICK_MEMBERS")){
      var member= message.mentions.members.first();
      if (message.member.roles.highest == member.roles.highest) {
        message.channel.send(`No kicking people with the same roles as you!`)
      }
      if (message.member.roles.highest.position < member.roles.highest.position) {
        message.channel.send(`No kicking people with higher roles than you!`)
      }
if (message.member.roles.highest == member.roles.highest) return;
if (message.member.roles.highest.position < member.roles.highest.position) return;
      member.kick(`Kicked for the following reason: ${reason}.`).then((member) => {
message.channel.send(`Kick for the following reason: ${reason}`);
      }).catch(() => {
          message.channel.send("I can't kick people with an equal or higher role than me!");
      });
#

v12

#

d.js

earnest phoenix
#

why is my emoji offcenter

#

in the title

silent berry
#

@earnest phoenix can you send me the embed code for that? seeing it mihgt help me more, i think it is off center because it is not in the same heading.

earnest phoenix
#

sure

#
return await msg.channel.send({
    embed: {
        title: "![no](https://cdn.discordapp.com/emojis/734078044058157056.webp?size=128 "no") Missing Permissions",
        color: 0xFF0000,
        description: "You do not have permission to execute this command."
    }
});```
silent berry
#

hold on

earnest phoenix
#

ty

silent berry
#

@earnest phoenix is it like that for all embeds

earnest phoenix
#

any emoji i put in the title does this

silent berry
#

ima see if it does it with my bot @earnest phoenix

earnest phoenix
#

ok

sudden geyser
#

it's off center because that's how discord structures it for some reason

silent berry
#
if (message.member.roles.highest == member.roles.highest) 

errroed out to

 TypeError: Cannot read property 'roles' of undefined
at Client.<anonymous> (/home/container/bot/bot.js:345:50)