#development

1 messages · Page 746 of 1

west raptor
lapis merlin
#

:3

marble juniper
#
if (spoonfeed) return
west raptor
#

dont spoonfeed

marble juniper
#

ok

#

my bad

west raptor
#

.includes doesnt exist on permissions anyways

marble juniper
#

hasPermission

west raptor
#

deprecated

marble juniper
#

ok

#

well whatever

west raptor
#

refer to the link i sent

#

Permissions#has

earnest phoenix
#

on 11.5.1 it's not deprecated

surreal sage
#

?

earnest phoenix
#

you have to check if the user is inside the blacklist

surreal sage
#

well

earnest phoenix
#

this way you're comparing two entirely different objects

surreal sage
#

!== something else

#

well to do if not in

#

likr that beeg_yoshi

earnest phoenix
#

wat

surreal sage
#

whats like eauals but just the opposite

#

equals

earnest phoenix
#

you mean... negation?

surreal sage
#

ye...

earnest phoenix
#

negation is almost the same everywhere

#

!

surreal sage
earnest phoenix
#

i already told you

#

learn js...

#

you can't compare that

#

they're not the same object

#

you have to check if the user's id is inside of the blacklist

#

as it's an array

surreal sage
#

so: js if(message.author.id === black.list[message.author.id]) { return; }

earnest phoenix
#

again

#

ok

#

that's not how indexing works

west spoke
#

good lord

#

I don't know what lang that is exactly

#

but wow

rotund crater
#

eek

earnest phoenix
#

it's javascript

rotund crater
#

i thought this was to help if something went wrong but its just a server

west spoke
#

Wdym

#

this channel is to help with problems with bot coding

rotund crater
#

yee its not with bots its with putting my server up but it wont let me

#

if that made sense

modest maple
#

Neko i love the docs

#

u did a good job with thyem

west spoke
#

thank

modest maple
west spoke
#

if you wanna help add a issue onto the github and I'll add it

#

since I dont understand how the other stuff workk

surreal sage
#

for blacklist use this? ```js
const arrayOfUsersIds = ['id, id, id'];

for (let i = 0; i < arrayOfUsersIds.length; i++) {
if (message.author.id === arrayOfUsersIds[i]) return message.reply('You are on the blacklist!');
};```

knotty steeple
#

are you really looping to check if someone is on a black list

#

oh

#

god

#

no

modest maple
#

I refer u to the Try it and see documentation 101-455-42 section C:

earnest phoenix
#

you should stop help vampiring and do what you're told to do

knotty steeple
#

like

#

learning proper js

surreal sage
#

nvm then

knotty steeple
#

thats not an array thats a string

#

well a array with 1 entry

surreal sage
#

2

knotty steeple
#

nope

#

one

surreal sage
#

oh no

#

yeah const ids = ['id', 'id']

vital lark
#

ur saying that x === y which is wrong

#

use Array#includes

earnest phoenix
#

it actually is 1 entry

#

you surround everything with quotes

#

so

surreal sage
#

yeah const ids = ['id', 'id']

earnest phoenix
#

this would also be easier if you learnt basic js before jumping into creating a discord bot

knotty steeple
#

^

modest maple
#

i believe

#

we have told you this

#

atleast 10 times now

knotty steeple
#

they have

#

multiple times

#

ive seen it

modest maple
#

ik ive told him atleast 4

#

or maybe 5

surreal sage
#

nvm

#

il try on my own

knotty steeple
#

just

#

learn

#

please

earnest phoenix
#

learn js while your at it

west spoke
surreal sage
#

stfu

knotty steeple
#

its better for everyone

#

???

#

rule 1

surreal sage
#

ok sry

#

just let me do my things

earnest phoenix
#

we're being honest

modest maple
earnest phoenix
#

learn js or your coding life will be hell

west spoke
#

@surreal sage You should learn the language before you start on a discord bot. Little smol tip, but it seems to help

modest maple
earnest phoenix
#

^

surreal sage
#

i know some basic js ok

knotty steeple
#

i mean i myself learned js by making a discord bot

west spoke
#

That's fine

knotty steeple
#

bUT

west spoke
#

but things such as what you are trying you should try out in a basic file first

#

Before it goes into your bot

surreal sage
#

y ik

west spoke
#

and keep experimenting with it

#

until it works

earnest phoenix
#

the amount of times we've told you this is ridiculous. the next time you ask a question here without knowing basic js and wanting the answer to your code i will ask the mods to mute you

knotty steeple
#

i coded py at 11

#

completely forgot everything about it

west spoke
#

@earnest phoenix be nice

earnest phoenix
#

we have been nice

#

for so long

west spoke
#

keep being nice

earnest phoenix
#

it's hard when the end user doesn't listen

west spoke
#

at least it's not a whitename that doesnt understand english

#

that's a plus, alright? Heh

earnest phoenix
#

yeah lol

west spoke
#

good lord

rugged minnow
#

Ok so, Quick question, I use guild.owner to get the owner, but I don’t want to tag it

modest maple
#

u mean mention it

#

or without the #2432

rugged minnow
#

Whenever I try to use guild.owner.username or guild.owner.tag it returns nothing

#

Just a TypeError, cannot read propriety of null

earnest phoenix
#

the user's uncached

rugged minnow
#

Do I have to put it in a variable?

knotty steeple
#

^^

#

fetch the user

#

then get the username

rugged minnow
#

Ok, thanks

green kestrel
#

So, does anyone else here use a separate private server that just has you and your bot on it to store public emojis your bot uses?

#

If you don't do that where do you put your bots emojis?

earnest phoenix
#

If I used emotes in my bot I'd use a private server probably

green kestrel
#

Or do you not have any for your bot e.g. logos, throbbers...

earnest phoenix
#

I do

#

@green kestrel

green kestrel
#

So this would be a good legitimate approach?

earnest phoenix
#

if you have a lot of emojis ye

#

or if u just want to have it in another server

#

totally your choice

green kestrel
#

It's not that I would have a lot it's just I can't spare slots on my official server

earnest phoenix
#

yeah

green kestrel
#

Although my official server does have all animated slots free

earnest phoenix
#

well i think of it as kinda like i want the emojis for my bot to be used mainly by my bot, and i want my discord server emojis to be used mainly by my discord server

#

if that makes any sense

green kestrel
#

Yup

#

Bots can't create guilds can they

sudden geyser
#

they can under 10 guilds

green kestrel
#

Hmm, it's way too late for that now then lol

#

Can I transfer ownership of a guild to a bot?

sudden geyser
#

Probably not

green kestrel
#

Basically I don't want that emoji server cluttering up my list. The only other approch is to make a separate discord account for it

sudden geyser
#

But the bot can

green kestrel
#

Hmm, sporks dev is only in 3 guilds, it could create the emoji guild

#

But then how can the live bot be invited to it

#

Inviting has to pass captcha

earnest phoenix
#

join the server it created and invite it yourself and then leave perhaps

green kestrel
#

I think I'm best just creating a second discord for the emoji server and inviting the bot to it

#

Yeah if I had administrator I could do that

#

Or I can just make the server myself and transfer ownership to the bot

sudden geyser
#

Are you sure you can transfer ownership to a bot? I know the bot can, but not sure about normal user accounts (or without using a selfbot).

amber fractal
#

You cant transfer an application, you can put it on a team then give someone ownership of the team tho

west raptor
barren moss
#

If I put my bot's website, but it's still work in progress and only have a navbar, will I still be able to put it, or will my bot get deleted or the website will be denied??

earnest phoenix
#

neither

#

the important thing is that your description is not junk

round garden
#

What's the most performance efficient way to do this in Mongoose? ```js
await Settings.findByIdAndDelete(guild.id).catch(console.error)
await bot.redis.del(settings-${guild.id})

await Leveling.deleteMany({ guildID: guild.id }).catch(console.error)

await CaseModel.deleteMany({ guildID: guild.id }).catch(console.error)

const customCommands = await CustomCommands.find({ guildID: guild.id })
if (customCommands) {
    for (const customCommand of customCommands) {
        await bot.redis.del(`customCommands-${guild.id}-${customCommand.name}`)
    }
    await CustomCommands.deleteMany({ guildID: guild.id })
}```
amber fractal
#

this

#

what's this

round garden
#

The code

#

What else would it be?

west raptor
#

I think they mean what are you doing exactly

earnest phoenix
#

@amber fractal this is cause its a class

#

Or function

west raptor
#

again

#

they meant what are they doing

earnest phoenix
#

I'm blind; Sorry lol

distant plank
#

I have this error very often, and it makes the bot stop

TypeError: Cannot read property 'addRole' of null

Code

role = message.guild.roles.find(r => r.name === "•-Vicioso-•");
message.member.addRole(role);
earnest phoenix
#

handle your errors properly

#

also you probably don't filter out dms

amber fractal
#

@earnest phoenix I meant he said this

#

oh wait I didnt read mmLol

round garden
#
        const user = await Leveling.findOne({
            guildID: message.channel.guild.id,
            userID: message.author.id
        }).lean()

        const [rank, top10] = await Promise.all([
            Leveling.find({
                guildID: message.channel.guild.id,
                xp: { $gt: user.xp }
            }).countDocuments(),
            Leveling.find({
                guildID: message.channel.guild.id
            }).sort('-level -xp').limit(10)
        ])```
```js
        const levels = await Leveling.find({
            guildID: message.channel.guild.id
        }).sort('-level -xp').lean()

        const rank= levels.findIndex(data => data.userID === message.member.id)

        levels.slice(0, 10)
``` What one is the best to find a users rank and the top 10 people in the server? (Mongoose)
modest maple
#

Which ever system orders the data on total xp and just selects the top 10

#

You want in reality to go with the system that takes the least time / reasorces

vital lark
#

@round garden I recommend using a for loop

#

by recursiving the Model by an array, making another array for the top 10 people, then add data from the model array to the array you want

#

until you reached 10

amber fractal
#

you could get all of them then just filterone sec

#

didn't mean filter

empty owl
#

Sort is hella weird

modest maple
#

@vital lark why in god's name would you use a for loop going through the entire DB just to get top 10!?

vital lark
#

looping the entire DB

#

I'm saying looping the model

#

models and dbs are different in mongoose

#

also there is Math#min so... sipp

amber fractal
#

@empty owl wym

modest maple
#

I don't rlly know how mongoose works so fairs

amber fractal
#

It works as intended

placid iron
#

victory

#

very nice

#

things be working as they should

empty owl
#

yes

#

it doesnt sort?

#

why 1, 1000

#

tehn 30

west raptor
#

anybody that uses serenity: is it possible to show subcommands in additional help messages? i have a set subcommand.. ```rs
#[command]
#[sub_commands(set)]
fn prefix(ctx: &mut Context, msg: &Message) -> CommandResult {
let guild_id = msg.guild_id.unwrap().0 as i64;
let pf = crate::db::get_guild(guild_id).prefix;
msg.channel_id.send_message(&ctx.http, |m| {
m.content(format!("The current prefix is {}\nTo set a prefix run prefix set <prefix>", pf))
})?;

Ok(())

}

#[command]
fn set(ctx: &mut Context, msg: &Message, args: Args) -> CommandResult {
let guild_id = msg.guild_id.unwrap().0 as i64;
let new_prefix = match args.current() {
Some(p) => p.to_string(),
None => {
msg.reply(&ctx, "Please input a prefix to set")?;

        return Err(CommandError::from("no prefix given"))
    }
};

crate::db::update_prefix(guild_id, new_prefix.to_string());

Ok(())

}``` and im not really sure how to show it in the help command

#

it currently only shows: prefix Group: settings Available: In DM and guilds

#

(this is the default help command, i havent bothered making a custom one)

amber fractal
#

@sudden geyser I mean all I'd think you'd need is { "hub.callback": "http://xxx.xx.xxx.xxx:xxxx/x", "hub.topic": "https://www.youtube.com/xml/feeds/videos.xml?channel_id=x", "hub.verify": "async", "hub.mode": "subscribe", "hub.verify_token": token, "hub.secret": secret, "hub.lease_seconds": 864000 }

#

the callback works because it sends the request that tells me the mode is invalid

#

just dont know what the problem with the mode is

west raptor
#

hmm I don't see an issue

#

a SO post im looking at right now has subscribe as the mode also

amber fractal
#

yeah idk

#

I provide my api key too, I dont think it's actually needed though

west raptor
#

that's really weird hmm

amber fractal
#

does it not want it as application/json?

west raptor
#

does unsubscribe give the same result?

#

uh

amber fractal
#

Yeah

west raptor
#

im not sure actually

amber fractal
#

it's not well documented

sudden geyser
#

so every other key-value prop works except for hub.mode?

west raptor
amber fractal
#

I might want to die

#

one sec

empty owl
#

for guildMemberAdd

Can I do
if (member.id === -&:$!;&3) return member.kick() for auto kick

west raptor
#

uh

#

what

#

-&:$!;&3???

#

what's even happening here

earnest phoenix
#

^

#

That doesn't exactly make sense there

sudden geyser
#

r/ihadastroke

#

it's probably a place holder

#

You can do that, but you could also make an array of user IDs. It's your choice as long as it gets the job done efficiently.

west raptor
amber fractal
#

lmao

west raptor
#

oh nice

#

what language is this in btw

amber fractal
#

It's in js

#

I think I know why it's spamming tho

#

Hooray no more spam, still invalid mode though

west raptor
#

hmm

#

lol i just came across your SO question

amber fractal
#

Lol

#

I'm terrible at asking questions, but I don't know what other info I could give

#

Well I'll figure it out sooner or later

west raptor
#

it looks like application/x-www-form-urlencoded is the correct content type tho

amber fractal
#

I would just use their form thing, but it unsubscribes after a set amount of time so I just wanted to do it programmatically

#

time to see what the creators have

#

Well I'm just broken then

distant plank
#

I have a small function in a module, which gets a random number, but the problem is that every time the flame gives me the same number,
What I can do?

//index.js
const vars = require(`./vars/vars.js`);
let workwin = vars.workwin

//vars.js
exports.workwin = Math.round(Math.random() * (150 - 50) + 50)
dusky marsh
#

You're exporting a variable that is already declared

#

Try exporting a function that returns the random number and use that instead

distant plank
#

Do I change the variable in vars.js for a function? @dusky marsh

west raptor
#

export a function that returns Math.round(Math.random() * (150 - 50) + 50)

distant plank
#

something like that?

exports.workwin = function(){
return Math.round(Math.random() * (150 - 50) + 50)
 }
#

@west raptor

west raptor
#

I would use an arrow function instead

distant plank
#

=> ?

west raptor
#
exports.workwin = (...) => {
  // ...
}```
distant plank
#
exports.workwin = () => {
return Math.round(Math.random() * (150 - 50) + 50)
 }
west raptor
#

yes

distant plank
#

I tried it

#

xD

summer torrent
#
Error: Client network socket disconnected before secure TLS connection was established
``` how to fix this?
wheat jolt
#

So I have function where I execute a SQL query with https://npmjs.com/mysql but I can't return a value from a row

#

because it's returning the .query function, not my function

#

Does anyone know how I can do it?

compact raft
#

hi @everyone

#

anyone there

royal herald
mossy vine
#

str is undefined

royal herald
#

how can fix it?

quartz kindle
#

Console.log commandNames

royal herald
#

the code;

#

`const Discord = require('discord.js');
const ayarlar = require('../ayarlar.json');

var prefix = ayarlar.prefix;

exports.run = (client, message, params) => {

if (!params[0]) {
const commandNames = Array.from(client.commands.keys());
const longest = commandNames.reduce((long, str) => Math.max(long, str.length), 0);
message.author.sendCode('asciidoc', = Komut Listesi =\n\n[Komut hakkında bilgi için ${ayarlar.prefix}yardım <komut adı>]\n\n${client.commands.map(c => ${ayarlar.prefix}${c.help.name}${' '.repeat(longest - c.help.name.length)} :: ${c.help.description}).join('\n')});
if (message.channel.type !== 'dm') {
const ozelmesajkontrol = new Discord.RichEmbed()
.setColor(0x00AE86)
.setTimestamp()
.setAuthor(message.author.username, message.author.avatarURL)
.setDescription('Özel mesajlarını kontrol et. 📮');
message.channel.sendEmbed(ozelmesajkontrol) }
} else {
let command = params[0];
if (client.commands.has(command)) {
command = client.commands.get(command);
message.author.sendCode('asciidoc', = ${command.help.name} = \n${command.help.description}\nDoğru kullanım: + prefix + ${command.help.usage});
}
}

};

exports.conf = {
enabled: true,
guildOnly: false,
aliases: ['h', 'halp', 'help', 'y'],
permLevel: 0
};

exports.help = {
name: 'yardım',
description: 'Tüm komutları gösterir.',
usage: 'yardım [komut]'
};`

compact raft
#

hello

i'm getting issue on split

  let args = message.content.substring(10).split(`<@${mn.id}>`);

this is not split mensions

royal herald
#

@quartz kindle I threw the code. can you take a look?

quartz kindle
#

Mention can be !@id if member has a nickname

#

@royal herald commandNames has a non-string value, console.log it so you can see what is it

royal herald
#

the error at ;const longest = commandNames.reduce((long, str) => Math.max(long, str.length), 0); @quartz kindle

compact raft
#

dm look like

077738170725xxxx> test 1
this

restive furnace
#

@compact raft btw u dont need to censor ids cuz everyone can see them

compact raft
#

i want ot hide mension
and
need showing only message

royal herald
#

@restive furnace const longest = commandNames.reduce((long, str) => Math.max(long, str.length), 0); help pls

restive furnace
#

@compact raft its same as id... but justw ith <@(!)id>

compact raft
#

What is (!)

mossy vine
#

nickname

wheat jolt
#

Does someone know how I can return a function from another https://npmjs.com/mysql query function?

fluid basin
#

what are you trying to do?

#

at least show us your code or smth

rugged minnow
#

i'm having problems with a fetch from a website

#

it returns this

#

i'm using node fetch

vital lark
#

it's saying that the url your making a request doesn't exist anymo4e

rugged minnow
#

but when i try to manually access the webiste it works

#

for manually i mean by myself, from my pc

charred loom
earnest phoenix
#

read the error

charred loom
#

:)))

#

Do you think I'm stupid?

earnest phoenix
#

i didn't say it you said it

modest maple
#

This is the 4th time you've been told this altho for different errors

#

Actually more than that but we'll ignore it

lunar crystal
#
  console.log('Ta race')
});

client.on('message', message => {
  if (message.content === prefix + 'count') {
    guild.createChannel(`${message.guild.member.count}`,{type: 'text'})
    .then(console.log)
    .catch(console.error);
  }
})```
#

guild is not defined

earnest phoenix
#

my bot cant send the gif emoji in the embed

#

i have the the emoji id

lunar crystal
#

Yeah gif doesen't work in embed I believe

earnest phoenix
#

if you dont know what you're talking about, don't help

#

Guild.createChannel

#

iirc animated emojis are in a <a:name:id> format @earnest phoenix

#

Message.guild.createChannel

#

@lunar crystal

toxic jolt
earnest phoenix
#

Your bot need to be approved

#

It's automatic

lofty lagoon
knotty steeple
#

@toxic jolt did your bot get kicked

earnest phoenix
#

It's config.json,not confige.json

knotty steeple
#

nope

#

can you send your config file @lofty lagoon

#

without token if you have the token in it

earnest phoenix
#

(the content of ur config file)

lofty lagoon
knotty steeple
#

you forgot a comma

#

end of second line

earnest phoenix
#
{
"token": "token",
"prefix": "G/"
} 
knotty steeple
#

dont directly show him how

lofty lagoon
#

oh ok

knotty steeple
#

yes so thats what u need to do

mossy vine
#

its the only way you can help a copypaste dev

earnest phoenix
#

@earnest phoenix spoonfeeder

#

Ik

lofty lagoon
#

but where is the spoon

earnest phoenix
#

WZIT

#

5% OF BATTERY

#

@lofty lagoon it means he gives you all so solutions

#

DAFUK

lofty lagoon
#

I know what is a spoon feeder

earnest phoenix
#

oh

#

I need help too
I want to make a "Clyde" command. You send text, clyde "say" it. How to do dat

knotty steeple
#

with some

#

image

#

or

earnest phoenix
#

Image

knotty steeple
#

ok

#

whenever you need help

#

say the language

#

or library pls

earnest phoenix
#

Js

#

Discord.js

knotty steeple
#

so you can use canvas

earnest phoenix
#

you can't

#

clyde is clientside

#

you can mimic it with a webhook

knotty steeple
#

thats why i asked if they wanted to make it with an image or something

#

to make it look like that

wispy vine
#

guys, this is the right token but why is it erroring out?

  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\http.py", line 258, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\http.py", line 222, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 401 UNAUTHORIZED (error code: 0): 401: Unauthorized

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\||ur not getting my name||\Desktop\programming\Qubic Discord Bot\run to run bot.py", line 11, in <module>
    client.run('||no ur not getting my token||')
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\client.py", line 598, in run
    return future.result()
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\client.py", line 579, in runner
    await self.start(*args, **kwargs)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\client.py", line 542, in start
    await self.login(*args, bot=bot)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\client.py", line 400, in login
    await self.http.static_login(token, bot=bot)
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\discord\http.py", line 262, in static_login
    raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.```
earnest phoenix
#

@wispy vine can I see ur bot code? (hide the token plz)

wispy vine
#

class MyClient(discord.Client):
    async def on_ready(self):
        print('Logged on as {0}!'.format(self.user))

    async def on_message(self, message):
        print('Message from {0.author}: {0.content}'.format(message))

client = MyClient()
client.run('||not getting my token||')```
earnest phoenix
#

if you get a 401 you don't have the right token

#

if you say you do have the right one, you still don't

wispy vine
#

but it's right

#

i regend 3 times

earnest phoenix
#

Bot token ≠ client token

wispy vine
#

WHAT????

#

ive been putting in the whole time!

earnest phoenix
#

client secret is used for oauth authorization

#

and

#

told you

wispy vine
#

wheres the client token?

earnest phoenix
#

bot token*

#

go to the bot tab

#

on your app

wispy vine
earnest phoenix
#

bot tab

#

on left hand side

wispy vine
#

ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

earnest phoenix
#

Yes

#

yes

wispy vine
#

aw finally!

#

thx guys

earnest phoenix
#

Np

wispy vine
#

YAY!!

earnest phoenix
#

Woow

wispy vine
#

lol MEE6 just greeted Qubic xD

compact raft
#

thanks @earnest phoenix for giving solution everytime.

earnest phoenix
#

@wispy vine mee6 greets everyone on join / leave whatever

#

even if its a bot

wispy vine
#

i know, it's just weird that Qubic is a bot

knotty steeple
#

mee6 is dumb

wispy vine
#

not rly

earnest phoenix
#

Mee6 is dumb yes

wispy vine
surreal sage
#

how to let a bot join a voice channel? js voiceChannel.join() i know this but what more?

sudden geyser
#

well, did it join the voice channel?

surreal sage
#

no

#

im thinking about this: js message.author.voiceChannel.join()

#

but that does not work

sudden geyser
#

The user instance does not have a property named voiceChannel

surreal sage
#

how can i fix? do i have to make it with const/let? as value the id?

sudden geyser
#

The channel needs to be a voice channel; it's in the docs

knotty steeple
#

what do you have defined as voiceChannel

surreal sage
#

ik im there

#

nothing

#

how can i

knotty steeple
#

^

surreal sage
#

im there lol

sudden geyser
surreal sage
#

this? message.author.voiceConnections?

sudden geyser
#

user =/= member

surreal sage
#

message.guildMember.voiceConnections?

knotty steeple
#

yea

#

do that

#

try it and see

surreal sage
#

that didnt work

#

it could'nt defined voiceConnections

sudden geyser
#

In order to get a guild member instance/object, you can get the property from the Message object.

surreal sage
#

so: js const guildMember = message.author const voiceChannel =guildMember.voiceConnections() voiceChannel.join()?

#

"not a function"

#

on GuildMember

sudden geyser
#

A user instance is the Discord user. A guild member instance is the Discord user and data from that guild.

surreal sage
#

message.member.voicechannel?

sudden geyser
#

voiceChannel should be capital

surreal sage
#

ik

#

my eval cmd has max text so i got to make a simple eval commands that just executes

sudden geyser
#

ok

surreal sage
#

that didnt work lol

#

it did

#

but i forgot to upload

sudden geyser
#

are you in a voice channel

surreal sage
#

y but i uploaded the wrong file :)

#

SyntaxError: Unexpected identifier

#

nvm

#

typo

#

does not work...

#

the code

#

then nvm

earnest phoenix
#

@compact raft np

#

I'm trying to do this ```js
client.user.setStatus('idle')
.then(console.log)
.catch(console.error);

#

(no error message in log)

#

(js)

#

I'm basically forced to use js client.user.setPresence({ game: { name: 'MY DEV IS WORKING ON ME' }, status: 'dnd' }) .then(console.log) .catch(console.error);

sudden geyser
#

I mean, the 2nd way is better imo

#

The first way works for me

fluid basin
#

might be due to this:

This can however happen if you change your status too quickly (Maybe due to you testing around with statuses or setting an update on too short of an interval).

In that case the API starts to rate limit your bots and subsequently the library does not send the request until the specified limit is over.

Edit: You can try and log the rateLimit event for debugging purposes to find out if this is actually the cause.
https://github.com/discordjs/discord.js/issues/3352#issuecomment-504220719

wispy vine
#

how would i delete a message (in discord.py)? i have it stored in a variable called message. would i do like message.delete() or something? (no linking http://tryitands.ee/)

sudden geyser
#

try it out and see (I'm sorry)

knotty steeple
fluid basin
#

tbh check the docs lol, always read up things before blindly asking

modest maple
#

never call a variable message

#

NEVER

wispy vine
#

OK WHY?

modest maple
#

its a good way to fuck so many things up

knotty steeple
#

how so

modest maple
#

because you'll overwrite the message object

knotty steeple
#

what

sudden geyser
#

but that's only in that scope, correct?

wispy vine
#

no, its in onMessage():

fluid basin
#

not if you dont define the message object as message

modest maple
#

if you talking about on_message(message):

#

thats an object

fluid basin
#

I use on_message(chillfish8)

modest maple
#

i bet you do

#

only true pro's use the chillfish8 object

sudden geyser
#
if "discord.py" in chillfish8.content:
  chillfish8.channel.send("why hello there")```
wispy vine
#
        print('Message from {0.author}: {0.content}'.format(message))
        if message.author == client.user: #if it is the bot who wrote it, then don't reply, or it will turn the shard into a crappy piece of glass, then smash it with a shotgun (yes im weirD)
        return

    if message.content == '~command_here':
        response = "response here"
        await message.channel.send(response)
        #i can haz delete message plzzz```
sudden geyser
#

wut

modest maple
#

@wispy vine wholy moly slow down there boy

fluid basin
#
# read the docs, they're useful and tells you how to delete
wispy vine
#

k

modest maple
#

what the fuck is with the 0.author xD

#

and the 0.content

#

xD

#

why that version of formatting

wispy vine
#

cuz i can

#

what, do u want %s?

#

that gives me bad memorys shudder

modest maple
#

no but uknow

#

f strings exist

modest maple
#

not to mention

fluid basin
#

tryitandsee

modest maple
#

why even both having self,

#

when it wont get used xD

wispy vine
#

i hav bad habit

earnest phoenix
#

im making a serverinfo conmand but you can also provide a id and then it tells you info about the guild. is that even allowed?

#

ik shitty gramma

modest maple
#

i sence a copy and paste @wispy vine

#

and no thats what pancake does

wispy vine
#

uh no

sudden geyser
#

If you mean provide the ID of a different guild, no unless that guild opts in OR it's locked to devs only for getting other guilds

modest maple
#

if you get the guild object

#

you can grab the data from there

earnest phoenix
#

ik but i asked if thats allowed

fluid basin
#

I don't see any reason why not

#

if its a feature of your bot

earnest phoenix
#

Ok

#

let guild = this.client.guilds.get(args[0]) || message.guild

when i provide an id it falls back to message.guild!?

sudden geyser
#

Yes.

You can also ask an online mod for a reliable answer

earnest phoenix
#

Ok uh anyone can help me?

sudden geyser
#

with what

modest maple
#

they told you the awnser

earnest phoenix
#

uh ok

charred loom
fluid basin
#

cannot read property 'id' of undefined

charred loom
#

yes

fluid basin
#

yes

charred loom
#

I read 🙂

#

what to do?

modest maple
#

define id

#

👏

charred loom
#

how :))

modest maple
#

by reading the docs

#

and not asking us to fix every single error you get

sudden geyser
#

it's defined. The property before .id is undefined

charred loom
#

ok

fluid basin
#

C:\Users\Vrasilla\Desktop\Projects Discord\ResorceBot Pro\commands\moderation\unban.js:11:37

charred loom
#

yes, i read!

#

line 11

modest maple
#

Just as a quick note for you

#

i would consider going back to basics

#

after this is the 18th time you have asked us to explain an error to you

#

and how fix

fluid basin
#

learn debugging

#

how to debug?

#

use console.log

#

very useful

modest maple
fluid basin
earnest phoenix
charred loom
#

I did not understand

modest maple
#

then learn basics

#

xD

earnest phoenix
#

when copy and pasters cant solve errors...

charred loom
#

...

#

help me or no

modest maple
#

learn to de bug

#

and learn basics

charred loom
#

SyntaxError: await is only valid in async function

#

from debug console

placid iron
#

basically

#

await can only be put in front of async fuctions. (mostly discord fuctions)

knotty steeple
#

ur using await but you arent in an async function

placid iron
#

just remove await from the line

charred loom
#

And what do they put?

#

?

modest maple
#

they told you whats wrong

#

either make it an async function

#

or remove await

charred loom
#

i removed await

earnest phoenix
#

@placid iron tf

#

@charred loom show your code

charred loom
placid iron
#

@earnest phoenix whatcha on about?

earnest phoenix
#

dont remove await If its required

placid iron
#

well duh

charred loom
#

Well I removed it

#

ok

modest maple
#

right dude

#

u gotta learn

#

u gotta give the full error

#

not just the last set of lines

#

that "unhandled error" is cuz your not handling your errors right so its crashing

#

but its not the actual error

charred loom
#

It's the same, I showed you that I rested await

lunar crystal
#

I put an imgur link in an embed but the image doesn't appear, why ?

charred loom
mossy vine
#

have you tried reading the error

cerulean salmon
#
  if ( (message.mentions.members != undefined ) && (message.author.id != client.user.id)) {
    var k = message.mentions.users.array();
   console.log("mentioned : " + k.length) 
}

i tried to check if the bot is mentioned or not ,but when i mention the bot ,i don't get it in the array
like if i mention 2 people + the bot itself in console it show array length is 2

modest maple
#

ITS THE SAME ERROR AS LAST TIME OMFG DUDE

#

sorry for the salt but dude

#

not u sehrik btw

earnest phoenix
#

Oh no that guy is back with the same error

charred loom
#

@mossy vine
:)) why do you think me so stupid?

modest maple
#

BECAUSE 6 of your 21 requests to have a basic error explained to you is the same freaking error

#

youre just ignoring what people tell you

west raptor
#

@cerulean salmon you shouldn't need != undefined

#

on the first check

earnest phoenix
#

@loud salmon help vampire above

#

help me

cerulean salmon
#
  if (
    (message.mentions.members  ) && (message.author.id != client.user.id)) {
    var k = message.mentions.members.array();
   console.log("mentioned : " + k.length) 
    // cmd.reply("Hello")
    if (is_mentioned(k)) {
      // cmd.reply("u mentioned me")
      // cmd.channel.send("mentioned by " + cmd.author)
      message.reply(cm_message(1));
    }

  }

@west raptor same result
the wired things is ,the bot is currently on 2 server
its working on one server but not working on another server 😐

loud salmon
#

Hey @charred loom, this is just a polite warning. We are here to help you with certain problems, but the one you keep having trouble with can be solved with simple knowledge of the actuall programming language you are in. Please take the time to read the following message: https://discordapp.com/channels/264445053596991498/272764566411149314/504585329869586432
as well as this website: http://slash7.com/2006/12/22/vampires/

If you continue to ask questions that could easily be solved by learning the language, then you will be punished.

#

-ask2ask @earnest phoenix

gilded plankBOT
#

@earnest phoenix

Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

loud salmon
#

@earnest phoenix done bb GWcentrallHUGS

earnest phoenix
lapis merlin
earnest phoenix
#

Your Description of your Bot of cause @lapis merlin

west raptor
#

Detailed description as it says

loud salmon
#

commands, how to use it, documentation, etc

lapis merlin
#

oh

#

okay

west raptor
#

frick spider

earnest phoenix
#

Anyone can help me now please

west raptor
#

beat me to it

#

lurker >:(

loud salmon
#

lol nerd @west raptor

west raptor
#

wow ok

loud salmon
#

wat

#

do you prefer I call you valid

west raptor
#

wait no

loud salmon
#

welp

#

too late

west raptor
#

fuck

earnest phoenix
#

Anyone can help me now please
what was your issue? the bot not appearing in user mentions?

#

what is "it" and where

sudden geyser
#

you keep posting the same thing

earnest phoenix
#

how to get last word of a message in discord.js

#

split the content by space and take the last item out of the array

#

@earnest phoenix let guild = ...

modest maple
#

isnt .endswith() a thing

earnest phoenix
#

ah yeah

#

i missed that one

#

lol

#

but

#

that just checks if it ends with

#

it doesn't get the last string

modest maple
#

i guess

#

but if ur checking for somthing

toxic jolt
#

@knotty steeple man my bot why kicked?

fluid basin
#

@earnest phoenix content.split(' ').pop()

toxic jolt
#

i how to add in server

fluid basin
#

not too complex

knotty steeple
#

ask a mod to add it back

earnest phoenix
#

oh

toxic jolt
#

ok thx

knotty steeple
#

since ur a bot dev and thats ur only bot i assume it got kicked

modest maple
fluid basin
#

also be sure to know why it got kicked, you can check that in #mod-logs and make sure you fixed it

modest maple
#

its not gonna come back unless u disable that for this server

fluid basin
#

if not history will repeat itself

earnest phoenix
#

https://prnt.sc/qarsua i need to remove the userid from the message now
i'm making a dm command(owner-only)

const args = message.content.split(" ").slice(2);
      const dm = args.join(" ");
    
    const userid = message.content.split(' ').pop()
     
    
       const user = client.users.get(`${userid}`);
    
     if(!user) return;
    if(message.author.id !== ownerID) return;
     
 
    user.send(dm)
    message.reply('Sent!')```
this is discord.js
Lightshot

Captured with Lightshot

modest maple
#

whats le bug

earnest phoenix
#

just want to remove the userid at the end of dm

modest maple
#

well if youre splitting it

#

just remove that element of the array

fluid basin
#

assign it to a variable

#

first

earnest phoenix
#

why not just accept the id first and then not care about the rest

fluid basin
#

and then pop it

#

yeah thats an easier alternative

#

but similar logic applies

#

just a matter of shifting or popping

earnest phoenix
#

this way it's more intensive on the cpu

#

accepting the id first is basically just "hey get me the first item out of the array k bye"

#

micro optimization ™️

#

how can i check if channels are locked for @everyone?

#

i use v12-dev

sudden geyser
#

get the channel overwrites (<Channel>.permissionOverwrites) for the everyone role and use the has method to see if the everyone role has SEND_MESSAGES

knotty steeple
#

hi

#

i know you can put routes in other files instead of the main file

#

for expressjs

#

but how do you do that because i forgot

surreal sage
#
client.fetchUser(message.guild.ownerID,false).then(user => {
        message.channel.send(user.tag)
})``` how to convert this so it works in my script without using eval?
earnest phoenix
#

wat

surreal sage
#

no

#

that does not work that script when using in normal script

#

scripts

#

how to fix

knotty steeple
#

so your copying something and want to know how to make it work

surreal sage
knotty steeple
#

ok nice

surreal sage
#

no

#

i have this script for long

#

and i didn't copy

unique nimbus
#

Read the docs

#

Please

surreal sage
#
const user = message.guild.fetchMember(message.guild.ownerID)``` this?
unique nimbus
#

try it and see

#

I forgot the url

#

😔

surreal sage
#

lol

unique nimbus
#

yes

#

do that

surreal sage
#

ok

#

does not reply

#

(fetch)

#

ah

#

Error: Invalid or uncached id provided.

earnest phoenix
#

fetchMember is broken

#

use client.fetchUser and pass the result of that to fetchMember

surreal sage
#
client.fetchUser(message.guild.ownerID,false).then(user => {
        message.channel.send(user.tag)
})``` i got this...
#

this works in eval but not in my script

#

how do i fix?

earnest phoenix
#

you provided no context

#

so i don't know

#
const Discord = require("discord.js");
const bot = new Discord.Client();
const config = require("../assets/config.json");

exports.run = async (client, message, args) => {
  if(message.author.id != config.owner) return;
  
  function findEmoji(id) {
    var emoji = this.emojis.get(id);    
    const temp = this.emojis.get(id);
    if (!emoji) return null;
    if (!temp) return null;

    var emoji = Object.assign({}, temp);
    if (emoji.guild) emoji.guild = emoji.guild.id;
    emoji.require_colons = emoji.requiresColons;

    return emoji;
}
        let getemojis = [
        client.shard.broadcastEval(`(${findEmoji}).call(this, '469480312389369857')`),
        client.shard.broadcastEval(`(${findEmoji}).call(this, '469482201126273044')`),
        client.shard.broadcastEval(`(${findEmoji}).call(this, '469482498431123466')`),
        client.shard.broadcastEval(`(${findEmoji}).call(this, '492061158971408414')`)
        ];
  return Promise.all(getemojis).then(emojiArray => {
          const foundEmoji = emojiArray.find(emoji => emoji);
            if (!foundEmoji) return message.reply('Je n\'ai trouvé aucun émoji.');
    
            return client.rest.makeRequest('get', Discord.Constants.Endpoints.Guild(foundEmoji.guild).toString(), true)
                    .then(raw => {
                        const guild = new Discord.Guild(client, raw);
                        const emoji = new Discord.Emoji(guild, foundEmoji);
            const embemo = new Discord.RichEmbed()
            .setTitle("Émoji")
            .setDescription(`e1: ${emojiArray[0].toString()}\ne2: ${emojiArray[1]}\ne3: ${emojiArray[2]}\ne4: ${emojiArray[3]}`)
        return message.reply(embemo);
                    });
        });
  }
#

Oh can i find the emojis and use in embed?

#

How*

fluid basin
#

@knotty steeple g00gle

#

scroll all the way down

#

wowow nice embed

earnest phoenix
#

:/

sudden geyser
#

I'm pretty sure you're stringifying a function in that broadcastEval call

earnest phoenix
#
Émoji
e1: [object Object],
e2: [object Object],
e3: [object Object],
e4: [object Object],
#

The result

#

:/

sudden geyser
#

oh nvm it's valid

round garden
#
        const user = await Leveling.findOne({
            guildID: message.channel.guild.id,
            userID: message.author.id
        }).lean()

        const rank = await Leveling.find({
          guildID: message.channel.guild.id,
          xp: { $gt: user.level }
        }).countDocuments()``` Is there an easier way to calculate a users rank? (Mongoose)
earnest phoenix
fluid basin
#

wot const foundEmoji = emojiArray.find(emoji => emoji);

#

and pretty sure you dont need to request each emoji using http

earnest phoenix
#

I don't know, I've almost never used sharding and I can't get the 4 emotions that way.

fluid basin
#

are you just trying to print the emojis or what

earnest phoenix
#

Yes in the embed

#

But

#
Émoji
e1: [object Object],
e2: [object Object],
e3: [object Object],
e4: [object Object],
#

:/

#

When I use the function to retrieve only one emoji it works, but not otherwise

fluid basin
earnest phoenix
#

:/

fluid basin
#

woat

earnest phoenix
#

I just use the emoji id

fluid basin
#

yeah

#

exactly

#

that was what I was thinking

#

wtf

earnest phoenix
#

Oh okay

fluid basin
#

lemme try it first

earnest phoenix
#

Okay

#

Ty

knotty steeple
#

@fluid basin im not finding what i want

#

smh

fluid basin
#

you sure?

#

oof

earnest phoenix
#

I am in the lateral safety position

knotty steeple
#

thank

fluid basin
#

@earnest phoenix ok ive kinda got the code working

earnest phoenix
#

Okay

fluid basin
#

basically just map the foundEmojis array

earnest phoenix
#

Mmmh okay

fluid basin
#
emojiArray = emojiArray.map(emoji => `<${emoji.animated ? 'a' : ''}:${emoji.name}:${emoji.id}>`);

// then use emojiArray as usual
const embemo = new Discord.RichEmbed()
            .setTitle("Émoji")
            .setDescription(`e1: ${emojiArray[0]}\ne2: ${emojiArray[1]}\ne3: ${emojiArray[2]}\ne4: ${emojiArray[3]}`)
        return message.reply(embemo);
                    });```
#

kinda confusing

#

idk what the docs was trying to do

#

try that @earnest phoenix

earnest phoenix
#

My goal is to have all 4 emojis in the embed...

#

Okay

fluid basin
#

but why only 4 though

earnest phoenix
#

For an embed

fluid basin
#

?? i dont see the purpose of that but well

earnest phoenix
#

For users status

#

(node:10118) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined

#
const Discord = require("discord.js");
const bot = new Discord.Client();
const config = require("../assets/config.json");

exports.run = async (client, message, args) => {
  if(message.author.id != config.owner) return;
  
  function findEmoji(id) {
    var emoji = this.emojis.get(id);    
    const temp = this.emojis.get(id);
    if (!emoji) return null;
    if (!temp) return null;

    var emoji = Object.assign({}, temp);
    if (emoji.guild) emoji.guild = emoji.guild.id;
    emoji.require_colons = emoji.requiresColons;

    return emoji;
}
        let getemojis = [
        client.shard.broadcastEval(`(${findEmoji}).call(this, '469480312389369857')`),
        client.shard.broadcastEval(`(${findEmoji}).call(this, '469482201126273044')`),
        client.shard.broadcastEval(`(${findEmoji}).call(this, '469482498431123466')`),
        client.shard.broadcastEval(`(${findEmoji}).call(this, '492061158971408414')`)
        ];
  return Promise.all(getemojis).then(emojiArray => {
          const foundEmoji = emojiArray.find(emoji => emoji);
            if (!foundEmoji) return message.reply('Je n\'ai trouvé aucun émoji.');
    
            return client.rest.makeRequest('get', Discord.Constants.Endpoints.Guild(foundEmoji.guild).toString(), true)
                    .then(raw => {
                        const guild = new Discord.Guild(client, raw);
                        const emoji = new Discord.Emoji(guild, foundEmoji);
            emojiArray = emojiArray.map(emoji => `<${emoji.animated ? 'a' : ''}:${emoji.name}:${emoji.id}>`);

// then use emojiArray as usual
const embemo = new Discord.RichEmbed()
            .setTitle("Émoji")
            .setDescription(`e1: ${emojiArray[0]}\ne2: ${emojiArray[1]}\ne3: ${emojiArray[2]}\ne4: ${emojiArray[3]}`)
        return message.reply(embemo);
                    });
        });
  }
fluid basin
#

oh

#

gawd

#

need modify the findemoji func

earnest phoenix
#

Hmmm

#

I don't understand what there is to change.

fluid basin
#

wait what how

earnest phoenix
#

I still don't understand how to use these 4 emojis in an embed.

fluid basin
#

oh

#

gotta check for null gdi

#
emojiArray = emojiArray.filter(e => e).map(emoji => `<${emoji.animated ? 'a' : ''}:${emoji.name}:${emoji.id}>`);```
#

change to this

earnest phoenix
#

But

#

This is possible lol

split lantern
#

Ye nvm

earnest phoenix
#

(node:10208) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined

#

Again

#

return client.rest.makeRequest('get', Discord.Constants.Endpoints.Guild(foundEmoji.guild).toString(), true)

fluid basin
#

can you console log emojiarray slice 4 before the emoji

#

and also just remove that

earnest phoenix
#

keep in mind that your bot won't be able to display or use the custom emoji if it's not in the guild where the custom emoji is in

fluid basin
#

dont think you need it

earnest phoenix
#

Okay

#

I need this

fluid basin
#

no I think it prints as long as your bot is in that guild no matter which shard @earnest phoenix

#

afaik

earnest phoenix
#

return client.rest.makeRequest('get', Discord.Constants.Endpoints.Guild(foundEmoji.guild).toString(), true).then(raw => {

#

yes that's what i was saying

fluid basin
#

yeah which is fine

#

since hes getting the id

earnest phoenix
#

the thing i was pointing at was the possibility that the user is a nitro user which used an emoji from a guild the bot is not in

#

The bot is in the guild

#

....

fluid basin
#

hes finding the emoji ids

#

hardcoded

#

so yeah

#

predefined

earnest phoenix
#

:/

fluid basin
#

so its fine actually

earnest phoenix
#

ah i see

fluid basin
#

ahh that rest chunk isnt needed tbh

earnest phoenix
fluid basin
#
return Promise.all(getemojis).then(emojiArray => {
    emojiArray = emojiArray.filter(e => e).map(emoji => `<${emoji.animated ? 'a' : ''}:${emoji.name}:${emoji.id}>`);

    const embemo = new Discord.RichEmbed()
            .setTitle("Émoji")
            .setDescription(`e1: ${emojiArray[0]}\ne2: ${emojiArray[1]}\ne3: ${emojiArray[2]}\ne4: ${emojiArray[3]}`)
        return message.reply(embemo);
                    });
        });
earnest phoenix
#

Okay

fluid basin
#

if there is any errors

#

add console.log(emojiArray.slice(0, 4)) before const embemo = ...

earnest phoenix
#

Okay

fluid basin
#

and tell me the output

earnest phoenix
#

Ty

#

Yes

fluid basin
#

hmm?

earnest phoenix
fluid basin
#

oof

#

something went wrong there

#
return Promise.all(getemojis).then(emojiArray => {
    emojiArray = emojiArray.filter(e => e).map(emoji => JSON.stringify(emoji));

    const embemo = new Discord.RichEmbed()
            .setTitle("Émoji")
            .setDescription(`e1: ${emojiArray[0]}\ne2: ${emojiArray[1]}\ne3: ${emojiArray[2]}\ne4: ${emojiArray[3]}`)
        return message.reply(embemo);
                    });
        });```
#

try that

#

weird

earnest phoenix
#
[ '<:undefined:undefined>',

  '<:undefined:undefined>',

  '<:undefined:undefined>',

  '<:undefined:undefined>' ]
fluid basin
#

why isnt id defined

earnest phoenix
#
Émoji
e1: [{"guild":"427409812112932864","deleted":false,"id":"469480312389369857","name":"enligne","requiresColons":true,"managed":false,"animated":false,"_roles":[],"require_colons":true},null]
e2: [{"guild":"427409812112932864","deleted":false,"id":"469482201126273044","name":"occuper","requiresColons":true,"managed":false,"animated":false,"_roles":[],"require_colons":true},null]
e3: [{"guild":"427409812112932864","deleted":false,"id":"469482498431123466","name":"pasderanger","requiresColons":true,"managed":false,"animated":false,"_roles":[],"require_colons":true},null]
e4: [{"guild":"427409812112932864","deleted":false,"id":"492061158971408414","name":"streaming","requiresColons":true,"managed":false,"animated":false,"_roles":[],"require_colons":true},null]
#

:/

#

it's because of that filter

#

i'm pretty sure atleast

#

no it's not

#

what's your code right now?

#

Wait

#

when you're mapping the emojiArray

#

emoji is actually an array

#

so to get the readable format

#

emoji[0].propertyWhichYouNeed

#

Mmmh

#

Oh just emoji[0]. etc...?

#

yup

#

if you see your output above emoji is actually an array

fluid basin
#

wot

#

so id does exist

earnest phoenix
#

yes it's just an object inside of an array

#

Okay

#

for some ungodly reason

fluid basin
#

then why tf

earnest phoenix
#

[emoji object, some other object that always seems to be null]

#

(node:11164) UnhandledPromiseRejectionWarning: ReferenceError: emoji is not defined

#

what's your code

fluid basin
#

i mapped it to a string at the start

#

but its not working somehow

earnest phoenix
fluid basin
#
return Promise.all(getemojis).then(emojiArray => {
    emojiArray = emojiArray.filter(e => e).map(e => `<${e.animated ? 'a' : ''}:${e.name}:${e.id}>`);

    const embemo = new Discord.RichEmbed()
            .setTitle("Émoji")
            .setDescription(`e1: ${emojiArray[0]}\ne2: ${emojiArray[1]}\ne3: ${emojiArray[2]}\ne4: ${emojiArray[3]}`)
        return message.reply(embemo);
                    });
        });```
earnest phoenix
#

that's close ^

#

@earnest phoenix you're doing it in the wrong place

#

look at the snippet above

#

Oh

fluid basin
#

idk whytf it isnt working

earnest phoenix
#

except e needs to be e[0]

#

so you access the actual emoji object

#

No

deft forum
#

Помогите

#

Мне

earnest phoenix
#

e1 this is for said emoji 1

deft forum
#

Кто русский

fluid basin
#

yeah okok just try my code

earnest phoenix
#
Émoji
e1: <:undefined:undefined>
e2: <:undefined:undefined>
e3: <:undefined:undefined>
e4: <:undefined:undefined>
#

what's your code

fluid basin
#

@deft forum english here please, we cant understand you
If you just want to talk or chat then use #memes-and-media

#

oh wtf

#

OH

#

ME DUMB

#

FK ME

#
return Promise.all(getemojis).then(emojiArray => {
    emojiArray = emojiArray.filter(e => e).map(e => `<${e[0].animated ? 'a' : ''}:${e[0].name}:${e[0].id}>`);

    const embemo = new Discord.RichEmbed()
            .setTitle("Émoji")
            .setDescription(`e1: ${emojiArray[0]}\ne2: ${emojiArray[1]}\ne3: ${emojiArray[2]}\ne4: ${emojiArray[3]}`)
        return message.reply(embemo);
                    });
        });```
#

NOW

#

IT SHOULD WORK

deft forum
#

Help me add a bot to the server

earnest phoenix
#
const Discord = require("discord.js");
const bot = new Discord.Client();
const config = require("../assets/config.json");

exports.run = async (client, message, args) => {
  if(message.author.id != config.owner) return;
  
  function findEmoji(id) {
    var emoji = this.emojis.get(id);    
    const temp = this.emojis.get(id);
    if (!emoji) return null;
    if (!temp) return null;

    var emoji = Object.assign({}, temp);
    if (emoji.guild) emoji.guild = emoji.guild.id;
    emoji.require_colons = emoji.requiresColons;

    return emoji;
}
        let getemojis = [
        client.shard.broadcastEval(`(${findEmoji}).call(this, '469480312389369857')`),
        client.shard.broadcastEval(`(${findEmoji}).call(this, '469482201126273044')`),
        client.shard.broadcastEval(`(${findEmoji}).call(this, '469482498431123466')`),
        client.shard.broadcastEval(`(${findEmoji}).call(this, '492061158971408414')`)
        ];
  return Promise.all(getemojis).then(emojiArray => {
    emojiArray = emojiArray.filter(e => e).map(e => `<${e.animated ? 'a' : ''}:${e.name}:${e.id}>`);

    const embemo = new Discord.RichEmbed()
            .setTitle("Émoji")
            .setDescription(`e1: ${emojiArray[0]}\ne2: ${emojiArray[1]}\ne3: ${emojiArray[2]}\ne4: ${emojiArray[3]}`)
        return message.reply(embemo);
                    });
}
earnest phoenix
#

Okay

fluid basin
#

show output

earnest phoenix
#

OH

#

NICE

fluid basin
#

@earnest phoenix yeah my brain isnt working well, thx haha

earnest phoenix
#

I LOVE U

fluid basin
#

oh well I just realised

#

you did 4 broadcast eval statements

#

could have combined them into one by modifying the findemoji function and passing an array instead

#

thats why it returns null

earnest phoenix
#

Oh okay

#

I take notes

#

And THANK YOU

fluid basin
#

and it does seem that just nice your shard that the emojis were on is shard 0

#

idk if that will break the code in the future

#

np

earnest phoenix
#

Yes

#

The emojis is in the shard 0

fluid basin
#
return Promise.all(getemojis).then(emojiArray => {
    emojiArray = emojiArray.filter(e => e.filter(ee => ee)).map(e => `<${e[0].animated ? 'a' : ''}:${e[0].name}:${e[0].id}>`);

    const embemo = new Discord.RichEmbed()
            .setTitle("Émoji")
            .setDescription(`e1: ${emojiArray[0]}\ne2: ${emojiArray[1]}\ne3: ${emojiArray[2]}\ne4: ${emojiArray[3]}`)
        return message.reply(embemo);
                    });
        });```

that should solve the problem
#

in future

#

if the shard is not 0

earnest phoenix
#

And the server for test is in the shard 1

#

Okay ty

fluid basin
#

yeah ik

#

np

earnest phoenix
#

^^

mossy shuttle
#
bot.on("message",message=>{
 setInterval(() => {
bot.channels.get("655144818799804448").send(bot.users.get("592021274361069568"))
}, 1200000)
})
#

Hi I want my bot to mention in me in a channel every X time

#

why is not working

west raptor
#

what

#

you're sending a user?

modest maple
#

^^

#

User.mention isn't it?

west raptor
#

hmm i think

#

No

#

@mossy shuttle you can format it as such .send("@mossy shuttle")

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

west raptor
#

oh yes

#

sorry

#

i meant to just copy the id

mossy shuttle
#

yep thanks

#

hi again

#
bot.once("ready", () => {
    setInterval(() => {
        bot.channels.get("655144818799804448").send('<@' + 592021274361069568 + '><@' + 230676840052817920 + '>')
    }, 60000)
})
#

why is not working properly

#

its mentioning my friend the 2nd ID but my ID is just shown not mentioning me

sudden geyser
#

try adding a space between the > and <@

prime cliff
sudden geyser
#

You could also just use templates

native geode
#

why not just do .send("<@yourid>\n <@friendid>")

#

you don't really need the + 's i don't think unless im stupid

mossy shuttle
#

@prime cliff cause im noob in js haha

#

@sudden geyser you mean > space <@

#

at the 2nd id?

sudden geyser
#

Well not even a template

#

Just one string like <@userID> <@userID>

prime cliff
#

Just do '@untold widget@smoky plume'

mossy shuttle
#

okk

#

problem solved, thanks

mossy shuttle
#

hi again

#
bot.once("ready", () => {
    setInterval(() => {
        bot.channels.get("655470156751044639").send('**Hey, dudes** <@id1> <@id2> **go !bump, damn.**')
    }, 60000)
})
#

how to add in the same message a shorcut to a channel

#

by using the channel id

#

I mean, the bot will send every X time that message in a channel but I want it to send the shorcut to a channel in the same message

amber fractal
#

sounds like spam and api abuse

mossy shuttle
#

why would be abi abuse

#

if there are even more bots that has reminders

#

but I want to make it for myself

earnest phoenix
#

that's not a reminder

#

a reminder occurs once

mossy shuttle
#

@earnest phoenix well so mine its okay or

#

why is tatsumaki having remindme then

#

if its not allowed

modest maple
#

it is

earnest phoenix
#

because that triggers once

modest maple
#

but it only reminds you once

earnest phoenix
#

so does r.danny's

#

so does dyno's

#

so does mee6's

modest maple
#

they dont autopost every X times

earnest phoenix
#

yours loops and constantly pings which is a form of spam

mossy shuttle
#

well its reminding only once