#development

1 messages · Page 1196 of 1

karmic compass
#

Try

#

async (message) instead of async message

carmine summit
#

im confused on where i should put async

#

pls help

solemn leaf
#

@maiden relic

#

so wait

#

ment.customActivity.prototype.find

worthy glacier
#

how do i have it so the $set field updater in the docupdate is able to be changed by the (key) variable that is used in the command instead of being set to a rigid thing

#

TLDR: i want the command to be able to edit fields in a document

solemn leaf
#

@restive pebble

#

^^

#

ment.customActivity.prototype.find

left delta
#

how can I use an iframe
for my bot site

#
<link href="https://modesta.alexflipnote.dev/css/modesta.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" href="https://dagbot-is.the-be.st/style.css" type="text/css">
<iframe id="botiframe" onload="setCampaignIframe('');" src="https://dagbot-site.herokuapp.com">
</iframe>
#

doesn't work

#

Thats all I [asted

restive pebble
#

@solemn leaf ment.activities.find(fn)

solemn leaf
#

find is undefined

#

Cannot read property 'find' of undefined

#

wait

#

activities

#

is

restive pebble
#

user.activities.find

#

not member

#

or if u using member add member.user

solemn leaf
#

let ment = message.mentions.users.first();
let user = message.mentions.members.first()

#

@restive pebble

restive pebble
#

oh rip

#

ment.presence.activities

solemn leaf
#

LMSO

#

@restive pebble

restive pebble
solemn leaf
#

yeah but why cant I do

#

ment.presence.customactivity

#

it was part of the thing

restive pebble
#

its an array

solemn leaf
#

then

#

[0[

restive pebble
#

then u will only get first presence

#

and its not ment.presence.customactivity it should be ment.presence.activities

solemn leaf
#

ment.presence.activities.customactivity

(<CustomActivity name='testing' emoji=None>, <Spotify title='Jack & Diane' artist='John Mellencamp' track_id='43btz2xjMKpcmjkuRsvxyg'>, <Activity type=<ActivityType.playing: 0> name='Visual Studio Code' url=None details='Editing userinfo.js' application_id=383226320970055681 session_id=None emoji=None>)
#

@restive pebble

restive pebble
#

thats not js

solemn leaf
#

fine

#
[{"name":"Custom Status","type":"CUSTOM_STATUS","url":null,"details":null,"state":"testing","applicationID":null,"timestamps":null,"party":null,"assets":null,"flags":0,"emoji":null,"createdTimestamp":1598585890329},{"name":"Spotify","type":"LISTENING","url":null,"details":"Havana (feat. Young Thug)","state":"Camila Cabello; Young Thug","applicationID":null,"timestamps":{"start":"2020-08-28T04:04:02.870Z","end":"2020-08-28T04:07:40.176Z"},"party":{"id":"spotify:485987127809671168"},"assets":{"largeText":"Camila","smallText":null,"largeImage":"spotify:ab67616d0000b2736eb0b9e73adcf04e4ed3eca4","smallImage":null},"syncID":"1rfofaqEpACxVEHIZBJe6W","flags":48,"emoji":null,"createdTimestamp":1598587444786},{"name":"Visual Studio Code","type":"PLAYING","url":null,"details":"Editing userinfo.js","state":"Workspace: discordjs2","applicationID":"383226320970055681","timestamps":{"start":"2020-08-28T03:42:11.453Z","end":null},"party":null,"assets":{"largeText":"Editing a JS file","smallText":"Visual Studio Code","largeImage":"565944799576719366","smallImage":"565945770067623946"},"flags":0,"emoji":null,"createdTimestamp":1598586131594}]
#

that is the json.stringifyt

earnest phoenix
#

The hell

#

That's also not a string

#

JSON.stringify makes it a string

restive pebble
#

yes string

#

or else it would be like largeImage not "largeImage"

solemn leaf
#

ment.presence.activities.CUSTOM_STATUS.state

#

?

restive pebble
#

no

#

its array

#

u have to find it

earnest phoenix
#

what are we even discussung

solemn leaf
#

ment.presence.activities.CustomStatus.find()

#

wait so

#

activities[0]

earnest phoenix
#

umm yeah

solemn leaf
#

activities[0].status

earnest phoenix
#

wait CustomStatus is not a property of the first object in the array

solemn leaf
#

activities[0].state

earnest phoenix
#

maybe

#

try it and see

solemn leaf
#

nope

earnest phoenix
#

f

#

beuh

solemn leaf
#

okay

restive pebble
#

[0].details

solemn leaf
#

I removed the status

#

I mean state

earnest phoenix
#

CustomStatus is not a property of the first object in the array
And so is not status

#

Read the first object in the array

solemn leaf
#
{"name":"Custom Status","type":"CUSTOM_STATUS","url":null,"details":null,"state":"testing","applicationID":null,"timestamps":null,"party":null,"assets":null,"flags":0,"emoji":null,"createdTimestamp":1598585890329}
#

so

#

wait

earnest phoenix
#

is there any property called status

solemn leaf
#

I meant state

earnest phoenix
#

???

solemn leaf
#

"state":"testing"

earnest phoenix
#

Oh you mean dnd and online states

solemn leaf
#

no?

#

I want this text

earnest phoenix
#

Well...

solemn leaf
carmine summit
#
client.on("presenceUpdate",  (oldPresence, newPresence) => {
    if (!newPresence.activities) return false;
    newPresence.activities.forEach(activity => {
        if (activity.type == "PLAYING") {
          const guild = newPresence.guild;
            let announcement = `Ebrywan ${newPresence.user.tag} just started streaming`;
            let channelID = client.channels.cache.find(channel => channel.name.toLowerCase() === "streaming");
            if (channelID) channelID.send(announcement);
            console.log(`${newPresence.user.tag} is streaming at ${activity.url}.`);
            let streamingRole = await guild.roles.cache.find(role => role.name === "temp");
            console.log(newPresence.user)
            newPresence.user.tag.addRole(streamingRole)
            console.log(`${streamingRole.name} added to ${newPresence.user.tag}.`).catch(console.error)
        };
    });
});```
where do i put async???
earnest phoenix
#
var someObject = {
  someProperty: "someValue"
}
someObject.someProperty; // "someValue"
restive pebble
#

solid understanding of js basics

#

pls

earnest phoenix
#

@carmine summit put async keyword at the start of the callback function

solemn leaf
#

why would you need to return false

earnest phoenix
#

that makes the callback function async

restive pebble
#

its false

#

then

earnest phoenix
#

it's a boolean

carmine summit
#

@carmine summit put async keyword at the start of the callback function
where exactly?

earnest phoenix
#
var someObject = {
  someProperty: "someValue"
}
someObject.someProperty; // "someValue"

@solemn leaf read this and then try to figure out how to grab property X from object Y

solemn leaf
#

?

#

I was

earnest phoenix
#

in your case you want to grab property status from object smth

solemn leaf
#

so

#

let status = ment.presence.activities {
"states":
}

earnest phoenix
#

no

#

no

#

the first element of the array returns an object

solemn leaf
#

let status = {
"states":,
}

carmine summit
#

@carmine summit put async keyword at the start of the callback function
where exactly?

earnest phoenix
#

you can just add .someProperty

dusk vault
#

sigh

earnest phoenix
#

where exactly?
@carmine summit the callback function is the stuff you gave as a second argument in the client.on() function

#

so

#
client.on("smth", async () => {});
#

the callback function is now async

#

happy trails

#

sigh
@dusk vault ik i suck at explainations

dusk vault
#

no not you

#

haha

earnest phoenix
#

and people suck at learning actual coding before developing bots

dusk vault
#

^^^

#

that was what i was sighing at lmao

restive pebble
#

arrow function

dusk vault
#

arrow fns = bliss

earnest phoenix
#

no

#

no

#

no

#

no

dusk vault
#

async arrow functions = all i ever want in life

#

haha

earnest phoenix
#

the hell

#

dad jokes

#

i didn't laugh

dusk vault
#

hum?

earnest phoenix
#

yeah that

carmine summit
#
client.on("presenceUpdate",  async (oldPresence, newPresence) => {
    if (!newPresence.activities) return false;
    newPresence.activities.forEach(activity => {
        if (activity.type == "PLAYING") {
          const guild = newPresence.guild;
            let announcement = `Ebrywan ${newPresence.user.tag} just started streaming`;
            let channelID = client.channels.cache.find(channel => channel.name.toLowerCase() === "streaming");
            if (channelID) channelID.send(announcement);
            console.log(`${newPresence.user.tag} is streaming at ${activity.url}.`);
            let streamingRole = await guild.roles.cache.find(role => role.name === "temp");
            console.log(newPresence.user)
            newPresence.user.tag.addRole(streamingRole)
            console.log(`${streamingRole.name} added to ${newPresence.user.tag}.`).catch(console.error)
        };
    });
});
``` The async error still exists
dusk vault
#

lol

earnest phoenix
#

wait what

#

there are more arrow functions

#

make all of them async

carmine summit
#

where exactly?

dusk vault
#

noni

restive pebble
#

what async error

dusk vault
#

you dont need all to be async

carmine summit
#

await is only valid in async

dusk vault
#

just the function that contains await

#

thats all

#

because async functions return promises

ionic shard
#

Guys im using an api which returns promises and i need to put the data returned from promises into an embed, right now im nesting promises but i think its not the best way to do it? can u link me something which can help me not nesting 4-5 promises

torn ravine
#

await

dusk vault
#

async/await or .then.catch

#

your choice

carmine summit
#

whereeee

dusk vault
#

or deasync smirk

#

jk

#

deasync is shit

#

lmao

carmine summit
#

im confused as to where im going to put "async"

dusk vault
#

Here

marble juniper
#

using await is better than .then

#

change my mind

dusk vault
#

not going to change your mind

#

;p

#

fully agree

#

hot tip: .catch can be replaced with try/await/catch

carmine summit
#

btw i solved the async problem

dusk vault
#

gg

carmine summit
#

my new problem is newPresence.user.tag.addRole(streamingRole)

#

it gives error

dusk vault
#
#

docs :p

carmine summit
#

docs sucks

dusk vault
#

uh ok

#

i refer to them every day and it fixes 90% of my issues lol

carmine summit
#

I learn by experience

marble juniper
#

unless they can't read docs @dusk vault

carmine summit
#

as only 10% of what you read, you remember

dusk vault
#

for me Djs.org is what fuels my experience

marble juniper
#

same

earnest phoenix
#

you don't have to remember the docs??

#

that's a heavily stupid argument

#

exactly like epixio said, refer to them when you need to

#

if you don't understand documentation it's a sign of a greater problem, i.e lack of knowledge

dusk vault
#

there's documentation for that too

#

aka MDN

carmine summit
#

cannot read property "add" of undefined

#

bruh

dusk vault
#

What's the code

robust mural
#

Wondering if this is allowed. My bot uses channels that are intentionally set up to deny join permissions so the only way people can join that specific channel is by asking the bot to move them. But the only way the bot can move them if they don't have join permission is to be admin, unless I am mistaken. Is this allowed for the purposes of adding it to the bot list?

dusk vault
#

Wdym?

#

Voice channels?

robust mural
#

Yes

dusk vault
#

it requires the members to have ADMINISTRATOR?

robust mural
#

No, the bot

dusk vault
#

Oh

#

The bot needing administrator is fine I think, but I'd ask in #support

robust mural
#

😂 🤣

#

A mod just told me to ask it here

dusk vault
#

lmfao

#

why tho

carmine summit
#

cannot read property "roles" of undefined

dusk vault
#

cannot read property "add" of undefined
@carmine summit Did you debug it?

#

cannot read property "roles" of undefined
@carmine summit Did you debug it?

carmine summit
#

debug?

dusk vault
#

You know what debugging is right?

marble juniper
#

bet not

dusk vault
carmine summit
#

.catch(console.log(err)

dusk vault
#

uh

#

that doesnt work

carmine summit
#

nvm

dusk vault
#

I cant help you unless you show the code notlikenoot

carmine summit
#
const role = await client.guild.roles.cache.find(role => role.name === 'temp');
            console.log(newPresence.user)
            var member = newPresence.user.tag
            member.roles.add(role)
dusk vault
#

client.guild doesnt exist

carmine summit
#

oh

dusk vault
#

you mean message.guild or msg.guild

#

i assume

fringe axle
#

client.guild doesnt exist
@dusk vault it exist

marble juniper
#

no

sudden geyser
#

no it doesn't

dusk vault
#

client.guilds not client.guild

marble juniper
#

no with a chance of 100%

fringe axle
#

Oh, he forgot the s

dusk vault
#

no he didnt

carmine summit
#

message is not defined

#

BRUH

dusk vault
#

he needs a guild not a guildmanager

fringe axle
#

Ah

dusk vault
#

message is not defined
@carmine summit what variable holds the Message object

#

msg?

carmine summit
#

nope

dusk vault
carmine summit
#

its automatic, if the bot finds a user that has the "streaming" status

#

it will yeet the code

marble juniper
#

how is ur message variable called lol

dusk vault
#

lol

marble juniper
#

ok

dusk vault
#

You know what im thinking

#

Wait for it

#

DOCUMENTATION

carmine summit
#

BRUH

#

no docs

#

pls

#

i hate docs

#

i hate reading

winter basalt
#

learn to

dusk vault
#

How you gonna make a bot

#

If you hate reading

carmine summit
#

i read and then i dont understand

marble juniper
#

what are you doing rn

#

reading too

sweet ruin
#

listen mate

carmine summit
#

eh

sweet ruin
#

you arent gonna be baby fed here

dusk vault
carmine summit
#

yes, yes I am

marble juniper
#

docs is like one of the most important things

#

I smell spoonfeed

sweet ruin
#

not by me.

dusk vault
#

Not by me

fringe axle
#

Not by me

marble juniper
winter basalt
#

not by anyone

carmine summit
#

._.

solemn leaf
#
    let ment = message.mentions.users.first() || message.guild.users.cache.get(args[0]) || message.author
    let user = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.member

this right?

marble juniper
fringe axle
dusk vault
#

we got better things to do then answer what's written in detail on https://discord.js.org

marble juniper
#

the docs could answer any discord.js question

#

go search in there first

#

and maybe afterwards stackoverflow

#

or the other way around

dusk vault
#

or mdn

#

for js stuff

marble juniper
#

and if you really don't know

#

then go here

#

ig

dusk vault
#

learnxinyminutes

#

or freecodecamp

#

lol

marble juniper
#

but not like "oh im too lazy to read the docs cuz thier boring"

dusk vault
#

also the channel topic bloblul

earnest phoenix
#

How do I make a bit on mobile

dusk vault
#

NO DONT DISTRACT ME

#

AHHHHHHHHH

earnest phoenix
#

Bot*

dusk vault
#

lol

earnest phoenix
#

Tell me and I wont

marble juniper
#

did he say bot on mobile

dusk vault
#

You can use a VPS and an SFTP/SSH client

winter basalt
#

1st step prepare for headache

dusk vault
#

To write a bot on "mobile"

marble juniper
#

Ig you could

#

ik an app that lets you use node.js

#

as well as install npm packages

dusk vault
#

i think only android supports that

marble juniper
#

yes

#

I use android

#

android gang

dusk vault
#

rip

marble juniper
#

if u really want to code on mobile

#

and ur not on ios

solemn leaf
#

why does this error if I have a custom status set

ocean violet
#

Cos you didn't check whether the user is really listening to spotify or not

dusk vault
#

hopefully your bot is gonna be verified

#

by oct 7

marble juniper
#

tO GEt ThE BadgE

#

jk

dusk vault
#

the badge

#

is gone

#

lol

ocean violet
#

Discord is gonna speed up as there will be less bots applying

dusk vault
#

rip me

marble juniper
#

I said

#

jk

dusk vault
#

ik

carmine summit
#

ummm i havent found the solution in docs

marble juniper
#

h o w

drifting wedge
#

Does spotipy work well?

carmine summit
#

orrrrr I don't know how to read 😛

drifting wedge
#

Like can I use it as a music thing?

marble juniper
#

he is just waiting for that spoon

#

what were you trying to find @carmine summit

#

ig nothing then

solemn leaf
#
`${moment.utc(ment.joinedAt).format('dddd, MMMM Do YYYY, HH:mm')}`

why does this return the current time?

leaden lake
solemn leaf
#

@earnest phoenix

#

if (user.user.presence.activities.find(a => a.type === "CUSTOM STATUS"))

earnest phoenix
#

don't ping me

#

i am in school rn

solemn leaf
#

ah sorry

earnest phoenix
#

well technically attending zoom classes but you could say i am in school

#

should i learn C#

solemn leaf
#

what do you program?

earnest phoenix
#

A ranking system

#

the font file cannot be parsed

#

check the font file

#

yeah

#

show the code here

#

don't show a picture of me show your actual code of the font file

#

ok give me a sec

solemn leaf
#

code can you help real quick

earnest phoenix
#

code can you help real quick
@solemn leaf with what

solemn leaf
#
`${moment.utc(ment.joinedAt).format('dddd, MMMM Do YYYY, HH:mm')}`

why does this return the current time?

earnest phoenix
#

Hmmmm

#

ment.joinedAt the current time

solemn leaf
#

im trying to get when they joined the server

earnest phoenix
#

will are be able to give me economy bot infrastructure?

carmine summit
#

newPresence.roles.add(roleer)
cannot read property "add" of undefined...

earnest phoenix
#
const Discord = require("discord.js");
const client = new Discord.Client();
const Canvacord = require("./package_modules/canvacord");
const fs = require("fs");

client.db = require("quick.db");
client.canvas = new Canvacord();
client.commands = new Discord.Collection();
client.cooldown = new Discord.Collection();
client.config = {
    TOKEN: "Token",
    prefix: ">",
    cooldown: 15000
};

fs.readdir("./commands/", (err, files) => {
    if (err) return console.error(err);
    files.forEach(f => {
        if (!f.endsWith(".js")) return;
        let command = require(`./commands/${f}`);
        client.commands.set(command.help.name, command);
    });
});

client.once("ready", () => {
    console.log("Ready!");
});

client.on("error", console.error);

client.on("warn", console.warn);

client.on("message", async (message) => {
    if (!message.guild || message.author.bot) return;
    xp(message);
    if (!message.content.startsWith(client.config.prefix)) return;
    let args = message.content.slice(client.config.prefix.length).trim().split(" ");
    let command = args.shift().toLowerCase();
    let commandFile = client.commands.get(command);
    if (!commandFile) return;
    commandFile.run(client, message, args);
});

function xp(message) {
    if (!client.cooldown.has(`${message.author.id}`) || !(Date.now() - client.cooldown.get(`${message.author.id}`) > client.config.cooldown)) {
        let xp = client.db.add(`xp_${message.author.id}`, 1);
        let level = Math.floor(0.3 * Math.sqrt(xp));
        let lvl = client.db.get(`level_${message.author.id}`) || client.db.set(`level_${message.author.id}`,1);;
        if (level > lvl) {
            let newLevel = client.db.set(`level_${message.author.id}`,level);
            message.channel.send(`:tada: ${message.author.toString()}, You just advanced to level ${newLevel}!`);
        }
        client.cooldown.set(`${message.author.id}`, Date.now());
    }
}

solemn leaf
#

codeblocks

earnest phoenix
#

sorry

warm marsh
#

It's back ticks

earnest phoenix
#

ARGHHHHHH

solemn leaf
carmine summit
#

newPresence.roles.add(roleer)
cannot read property "add" of undefined...

#

let roleer = await guild.roles.cache.find(role => role.name === 'temp');

earnest phoenix
#
const Discord = require("discord.js");
const client = new Discord.Client();
const Canvacord = require("./package_modules/canvacord");
const fs = require("fs");

client.db = require("quick.db");
client.canvas = new Canvacord();
client.commands = new Discord.Collection();
client.cooldown = new Discord.Collection();
client.config = {
    TOKEN: "Token",
    prefix: ">",
    cooldown: 15000
};

fs.readdir("./commands/", (err, files) => {
    if (err) return console.error(err);
    files.forEach(f => {
        if (!f.endsWith(".js")) return;
        let command = require(`./commands/${f}`);
        client.commands.set(command.help.name, command);
    });
});

client.once("ready", () => {
    console.log("Ready!");
});

client.on("error", console.error);

client.on("warn", console.warn);

client.on("message", async (message) => {
    if (!message.guild || message.author.bot) return;
    xp(message);
    if (!message.content.startsWith(client.config.prefix)) return;
    let args = message.content.slice(client.config.prefix.length).trim().split(" ");
    let command = args.shift().toLowerCase();
    let commandFile = client.commands.get(command);
    if (!commandFile) return;
    commandFile.run(client, message, args);
});

function xp(message) {
    if (!client.cooldown.has(`${message.author.id}`) || !(Date.now() - client.cooldown.get(`${message.author.id}`) > client.config.cooldown)) {
        let xp = client.db.add(`xp_${message.author.id}`, 1);
        let level = Math.floor(0.3 * Math.sqrt(xp));
        let lvl = client.db.get(`level_${message.author.id}`) || client.db.set(`level_${message.author.id}`,1);;
        if (level > lvl) {
            let newLevel = client.db.set(`level_${message.author.id}`,level);
            message.channel.send(`:tada: ${message.author.toString()}, You just advanced to level ${newLevel}!`);
        }
        client.cooldown.set(`${message.author.id}`, Date.now());
    }
}

solemn leaf
#

god dam

#

stop with the big code

#

use hastebin

earnest phoenix
#

⋯⋯

leaden lake
earnest phoenix
#

How can I build the economy bot or is there any infrastructure or something?

solemn leaf
#

wait

#

why are you running this command

#

in your index

#

if you have a command handler

earnest phoenix
#

?

#

wait ⋯⋯

solemn leaf
#

this looks like a command handker

#

fs.readdir("./commands/", (err, files) => {
if (err) return console.error(err);
files.forEach(f => {
if (!f.endsWith(".js")) return;
let command = require(./commands/${f});
client.commands.set(command.help.name, command);
});
});

#

this looks like a command

#
function xp(message) {
    if (!client.cooldown.has(`${message.author.id}`) || !(Date.now() - client.cooldown.get(`${message.author.id}`) > client.config.cooldown)) {
        let xp = client.db.add(`xp_${message.author.id}`, 1);
        let level = Math.floor(0.3 * Math.sqrt(xp));
        let lvl = client.db.get(`level_${message.author.id}`) || client.db.set(`level_${message.author.id}`,1);;
        if (level > lvl) {
            let newLevel = client.db.set(`level_${message.author.id}`,level);
            message.channel.send(`:tada: ${message.author.toString()}, You just advanced to level ${newLevel}!`);
        }
        client.cooldown.set(`${message.author.id}`, Date.now());
earnest phoenix
#

yes it is

warm marsh
#

No, that's just for loading all files inside a dir to a map.

earnest phoenix
#

🤔

solemn leaf
#

so why would you put it in there

#

unless you doing that to only save

earnest phoenix
solemn leaf
#

whihc would be okay

warm marsh
#

What?

earnest phoenix
#

unless you doing that to only save
ya

solemn leaf
#

okay

lament meteor
#

why did u store your node modules into google drive

solemn leaf
#

^^^

earnest phoenix
#

dont ask

solemn leaf
#

I mean you can

lament meteor
#

i wont...

earnest phoenix
#

I ask 21 djs friends

lament meteor
#

its just a waste of storage

solemn leaf
#

alts

#

cough cough

earnest phoenix
#

THEY WANT TO DOWNLOAD MY CODE

#

and ahh

solemn leaf
#

who?

#

oh

earnest phoenix
#

I upload it to drive 😂

solemn leaf
#

git

earnest phoenix
#

oh

#

i cant use computer you know

#

Is there anyone here?🤔

#

⋯⋯

#

GRATE

lament meteor
#

?

#

what do u need

earnest phoenix
#

wow

#

Here

#
const Discord = require("discord.js");
const client = new Discord.Client();
const Canvacord = require("./package_modules/canvacord");
const fs = require("fs");

client.db = require("quick.db");
client.canvas = new Canvacord();
client.commands = new Discord.Collection();
client.cooldown = new Discord.Collection();
client.config = {
    TOKEN: "Token",
    prefix: ">",
    cooldown: 15000
};

fs.readdir("./commands/", (err, files) => {
    if (err) return console.error(err);
    files.forEach(f => {
        if (!f.endsWith(".js")) return;
        let command = require(`./commands/${f}`);
        client.commands.set(command.help.name, command);
    });
});

client.once("ready", () => {
    console.log("Ready!");
});

client.on("error", console.error);

client.on("warn", console.warn);

client.on("message", async (message) => {
    if (!message.guild || message.author.bot) return;
    xp(message);
    if (!message.content.startsWith(client.config.prefix)) return;
    let args = message.content.slice(client.config.prefix.length).trim().split(" ");
    let command = args.shift().toLowerCase();
    let commandFile = client.commands.get(command);
    if (!commandFile) return;
    commandFile.run(client, message, args);
});

function xp(message) {
    if (!client.cooldown.has(`${message.author.id}`) || !(Date.now() - client.cooldown.get(`${message.author.id}`) > client.config.cooldown)) {
        let xp = client.db.add(`xp_${message.author.id}`, 1);
        let level = Math.floor(0.3 * Math.sqrt(xp));
        let lvl = client.db.get(`level_${message.author.id}`) || client.db.set(`level_${message.author.id}`,1);;
        if (level > lvl) {
            let newLevel = client.db.set(`level_${message.author.id}`,level);
            message.channel.send(`:tada: ${message.author.toString()}, You just advanced to level ${newLevel}!`);
        }
        client.cooldown.set(`${message.author.id}`, Date.now());
    }
}

lament meteor
#

the font file its loadin is fucked

fluid basin
#

please use hastebin gosh

#

its unicode™️

leaden lake
solemn leaf
#

why

#

is this erroring

#

it says it expected finish?

#

or finnal

sonic lodge
#

there needs to be a catch and / or finally block

solemn leaf
#

thank

#

why does this always run

#
        if (args.join('').toLowerCase().includes('token')) {
            return;
        }
golden condor
#

It doesn't

#

You never send a messsge

earnest phoenix
#

idling around here waiting for someone to ask for help

#
        if (args.join('').toLowerCase().includes('token')) {
            return;
        }

@solemn leaf that's actually a smart idea

#

what the hell

misty sigil
#

no it isn’t

earnest phoenix
#

you can put code blocks inside quotes in discord pc

solemn leaf
#

?

earnest phoenix
#

in my opinion it is

misty sigil
#

what if other code includes token

solemn leaf
#

wait it is a good idea?

swift sand
#

I have a question. Maybe you can help? I am building a server on discord and I want to use bots to control rooms. Where do I learn about bots and how to use them?

misty sigil
#

just don’t eval your token

solemn leaf
#

@misty sigil dude all my code requires the token from the config file

earnest phoenix
#

you learn them through...

#

docs

solemn leaf
#

and only index requires config

earnest phoenix
misty sigil
#

yes

#

because it tells you to learn js before making a bot

earnest phoenix
#

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

swift sand
#

Thanks Users

misty sigil
#

WHICH EVERYONE SHOULD DO

golden condor
#

Guys why are you telling him to learn js if he already has some code that's just being a dick

misty sigil
#

not him

golden condor
#

O

misty sigil
earnest phoenix
#

callum has lost his mind ig

golden condor
#

understandable have a nice day

delicate shore
#

I always get rate limited by YouTube
When I use YouTubeV3 API

earnest phoenix
#

cuz

delicate shore
#

How to solve it

golden condor
#

Because there is a daily quota

earnest phoenix
#

if they don't rate limit

misty sigil
#

don’t use the api

earnest phoenix
#

they'll die

golden condor
#

And if you go over said quota

misty sigil
#

use a lava link server

#

or ffmpeg

delicate shore
#

I don't know how to use Lavalink

misty sigil
#

or something like that

#

or something like that

solemn leaf
#

@delicate shore apply for more or buy more

earnest phoenix
#

don’t use the api
@misty sigil MEE6 does for music searching and stuff

delicate shore
#

or ffmpeg
@misty sigil
We can search with it ?

misty sigil
#

well they can pay for more quota can’t they

solemn leaf
#

no you need link

swift sand
#

Use jsguide?

slender thistle
#

They probably have their quota increased, yeah

golden condor
#

Every music bot breaks YouTube tos and if YouTube addressed it then every YouTube bot will die

solemn leaf
#

yes

misty sigil
#

@delicate shore there’s a search module too

solemn leaf
#

give

earnest phoenix
#

Every music bot breaks YouTube tos and if YouTube addressed it then every YouTube bot will die
@golden condor WHAT THE HELL

solemn leaf
#

now

delicate shore
#

@delicate shore there’s a search module too
@misty sigil
Can u gimme link thanks

solemn leaf
#

@misty sigil NOW

earnest phoenix
#

tjhe fuck

misty sigil
#

what

thick gull
#

I used the run button on code sample on Google’s website and it said I hit daily quota

earnest phoenix
#

we won't spoonfeed

misty sigil
#

just look it up

golden condor
delicate shore
earnest phoenix
golden condor
#

no it just scrapes

delicate shore
#

I used this but it sucks

golden condor
#

If you are rate limited there then you're fucked my friend

solemn leaf
#

can you do that

#

with that

golden condor
#

h

solemn leaf
#

opp

#

soo

misty sigil
#

nice

solemn leaf
#

also dont try that token lmao

#

I already regened

misty sigil
#

evalled.replace(config.token, "no")

#

or something

solemn leaf
#

I stringified

#

it

leaden lake
solemn leaf
#

I would have to read the output

#

and do what I did at the top

#

but immma

#

go to my testing server

earnest phoenix
#

dude

solemn leaf
#

so I dont have to keep regen my token

earnest phoenix
#

don't repeat the same questions @leaden lake

carmine summit
#

What I wanted is to set a role for a user if he/she starts streaming, and send a message in #streaming. But I keep getting this error that TypeError: Cannot read 'add' of undefined

```js

client.on('presenceUpdate', (oldMember, newMember) => {
const guild = newMember.guild;
const streamingRole = guild.roles.cache.find(role => role.id === 'streamer');
if (newMember.user.bot) return;
if (newMember.user.presence.activities.streaming) { // Started playing.
let announcement = Ebrywan ${newMember} just started streaming;
let channelID = client.channels.cache.find(channel => channel.name.toLowerCase() === "streaming");
if (channelID) channelID.send(announcement);
newMember.roles.add(streamingRole)
console.log(${streamingRole.name} added to ${newMember.user.tag})
}
});```

earnest phoenix
#

it won't make us respond faster

misty sigil
#

evalled.replace() replaces it tho iirc

slender thistle
#

uhm

earnest phoenix
#

@carmine summit roles is undefined

carmine summit
#

uhm

slender thistle
#

@leaden lake You can literally remove the first few lines where you do the manual request

thick gull
#

so I dont have to keep regen my token
@solemn leaf make eval owner only..?

earnest phoenix
#

newMember.roles.add

solemn leaf
#

it is

thick gull
#

then why are you

earnest phoenix
#

the hell

thick gull
#

trying to hide token

misty sigil
#

Then just don’t eval your fucking token

restive pebble
#

@carmine summit its not member that is user

thick gull
#

just don’t eval token

earnest phoenix
#

Aki doesn't trust himself

restive pebble
#

newMember.member

earnest phoenix
misty sigil
solemn leaf
#

I dont lmao

thick gull
#

or don’t have an eval

#

like me

leaden lake
#

@slender thistle so how to do the request ?

solemn leaf
#

eval is fun

slender thistle
#

You already have update_stats that runs every 3 minutes

carmine summit
#

newMember.member
ill try this

restive pebble
#

it wont work

#

u have to get guild id

leaden lake
#

it runs the request I typed higher in the code ?

earnest phoenix
#

yeah

eager granite
#

Eval is the best way to get hacked

restive pebble
#

bots can be in many guilds and how can u add role to user just my member

earnest phoenix
#

fetch the guild then run .members.cache.get(userID).roles.add

#

example:

slender thistle
#

You're sending the same type of request twice. Except your manual request with requests doesn't actually send the proper request

#

Oh, good lord, that's for getting the stats

earnest phoenix
#
bot.guilds.cache.get("X").members.cache.get("Y").roles.add("Z");

@carmine summit

restive pebble
#

cool

#

u have to find the role also

earnest phoenix
#

umm yeah

carmine summit
earnest phoenix
#
let role = bot.guilds.cache.get("W").roles.cache.find(X => {X.name == "streamer"});
thick gull
#

strea,er

earnest phoenix
#

lol

#

_ _

#

floating

leaden lake
#

@slender thistle but my error is in this line await self.dblpy.post_guild_count()

slender thistle
#

I'm blind

earnest phoenix
#

yeah

slender thistle
#

Just remove the self.guild_count() parameter

earnest phoenix
#

^

#

i dont even know what you're saying but i like that

#

the hell

slender thistle
#

post_guild_count will automatically get length of client.guilds and post it

earnest phoenix
slender thistle
#

Passing a function that does the same is pointless

thick gull
#

it has gained sentience @earnest phoenix

#

how could you

carmine summit
earnest phoenix
#

the hell

misty sigil
#

bruh

thick gull
#

the robots are coming after us

earnest phoenix
#

what the fuck

#

"W"

misty sigil
#

it needs to be your guild ID

thick gull
#

he copy pasted the code

#

😔

earnest phoenix
#

i wont help then

carmine summit
#

why tho

misty sigil
carmine summit
#

it needs to be your guild ID
how to i do this

thick gull
earnest phoenix
#

the Run button is not showing Stop and when I press it it says your program is already running please stop it first but how do I stop it if the Stop button is showing Run

even tried typing process.exit(); in the node repl but it didn't do anything

#

LEARN

#

ACTUAL

#

CODE

#

BEFORE

#

MAKING A BOT

slender thistle
#

Tone it down

earnest phoenix
#
misty sigil
#

no

thick gull
#

CODE
NINE ONE THREE

slender thistle
#

We're here to help, not yell at people

misty sigil
earnest phoenix
#

the hell

slender thistle
#

If you're not willing to actually help, stay away from this channel.

earnest phoenix
#

w3schools doesn't have Discord tutorials

carmine summit
#

no
please

thick gull
#

he means learn js

misty sigil
#

it has js tutorials

slender thistle
#

-id

gilded plankBOT
#

An ID is a unique number which is used to identify a user, bot, channel, or message. To obtain an ID, right click on it and click "Copy ID"; this can be done from mobile by holding down.

Should you not see the option to acquire an ID, you need to enable "Developer Mode" which can be done from your user settings, under "appearance".

slender thistle
#

Get your server's ID

leaden lake
#

logger.info('Posted server count ({})'.format(self.dblpy.guild_count())) so must I delete on this line ? bc on the await self.dblpy.post_guild_count() I don't have any self.guild_count()

misty sigil
#

and copy paste it in there

earnest phoenix
#

replace the "W" "X" and all that jazz with the proper ids

slender thistle
#

I'm having a breakdown here, give me a second @leaden lake

earnest phoenix
#

you'll need to escape the streamer role to get the role id

#

wait wha-

leaden lake
#

do you want I send my entire code ?

slender thistle
#

I asked you to remove the self.guild_count() there

#

self.dblpy.guild_count() is fine because it gets the guild_count method from the DBLClient class

earnest phoenix
carmine summit
earnest phoenix
#

attack of the Read Evalute Process Loops

carmine summit
#

why tho

earnest phoenix
#

show code

#

did you put the correct ids in the correct places

carmine summit
#
client.on('presenceUpdate', (oldMember, newMember) => {
  console.log(newMember)
    const guild = newMember.guild;
    let role = client.guilds.cache.get("69987*****25936680").roles.cache.find(X => {X.name == "streamer"});
    if (newMember.user.bot) return;
    if (true) { // Started playing.
        let announcement = `Ebrywan ${newMember} just started streaming`;
        let channelID = client.channels.cache.find(channel => channel.name.toLowerCase() === "streaming");
        if (channelID) channelID.send(announcement);
        newMember.member.roles.add(role)
    }
});```
earnest phoenix
#

tf

#

***** why

carmine summit
#

its

#

cencored

#

or idk

earnest phoenix
#

bruh why

#

guild ids aren't private info

carmine summit
#

why would you want my guild id

earnest phoenix
#

because

#

there could be errors

slender thistle
#

@leaden lake Please reset your top.gg API token

leaden lake
#

I regen ?

earnest phoenix
#

and give it to me KEKW

slender thistle
#

Also, are you running the cog under a bot that isn't listed on top.gg?

carmine summit
#

699877474925936680

#

here

leaden lake
#

I try the cog on a bot not listed on topgg, but the key is from a bot listed on topgg

earnest phoenix
#

@carmine summit running a quick docs search brb in a second

slender thistle
#

That's the problem

#

The module gets .user.id of the bot object that you pass in DBLClient

#

and since there's no bot listed under that ID, the top.gg API returns a 403 error

leaden lake
#

okay so let's try this code on my py file of my bot right lmao

misty sigil
#

if the js lib had that I’d be annoyed lmao

slender thistle
#

const response = await this._request('post', 'bots/stats', data, true);

#

you're telling me I could just send a request to bots/stats under a token and it would work?

#

Fucking Christ

earnest phoenix
#

LMFAO

#

how do post requests work tho

slender thistle
#

They're just like GET except you can have request body with POST

earnest phoenix
#

YAY MY PROGRAM TURNED OFF

slender thistle
#

Nice

misty sigil
#

it’s a get but with bodies

earnest phoenix
#

spammed the run button repl.it fucked up

#

then my program crashed

#

😃

leaden lake
#

@slender thistle Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\client.py", line 312, in _run_event await coro(*args, **kwargs) File "c:/Users/Shaal0wFR/Desktop/Bot Discord/Unconnected Bot [FINISH]/unconnectedbot.py", line 155, in on_message await message.delete() File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\message.py", line 762, in delete await self._state.http.delete_message(self.channel.id, self.id) File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\http.py", line 221, in request raise Forbidden(r, data) discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

earnest phoenix
#

lemme go setup some mongodb stuff and restart my bot

slender thistle
#

Yeah, that's...

#

an issue with permissions for your bot

#

🤔 An error when trying to delete a message. Are you trying to delete someone else's message or your bot's?

leaden lake
#

someone else's

#

you wan to see the code ?

slender thistle
#

Does the bot have MANAGE_MESSAGES permission in that channel?

#

Not really

solemn leaf
#

wait

#

that was stupid

leaden lake
solemn leaf
#

nvm

earnest phoenix
#

Can I be more lazy to move from quick.db to mongodb?

class db {
    get(stuff){
        stuff = stuff.split(".");
        let dbName         = stuff[0];
        let collectionName = stuff[1];
        return client.db(dbName).collection(collectionName);
    }
}
solemn leaf
#

dont

#

think that worked

slender thistle
#

"that channel" = wherever you're trying to delete the message from

worthy glacier
#

this code returns the record if the field in my document exists. How do i have it return if it doesnt find a document with a field with that input

thick gull
#

@golden condor your calling

#

abcdb™️

leaden lake
#

idk, server owners can change permissions, but I put the administrator perms

slender thistle
#

findOne should return a falsey value if a document wasn't found @worthy glacier

fluid basin
#

use findOne and async/await

slender thistle
#

idk, server owners can change permissions, but I put the administrator perms
@leaden lake that's the case here. The bot doesn't have the permission to delete other users' messages

leaden lake
#

how to fix the problem ?

carmine summit
#

@carmine summit running a quick docs search brb in a second
@earnest phoenix 🤔

worthy glacier
#

so how do i have it exit if it fdins that falsey value?

fluid basin
#

just print an error or something when that happens

leaden lake
#

it's impossible to fix the problem

slender thistle
#

Correct

worthy glacier
slender thistle
#

The good workaround is actually checking for the bot's permissions before trying to delete a message

fluid basin
#

find returns a cursor, not the output

slender thistle
#

use findOne and async/await

fluid basin
#

you can check the size with countDocuments as well

#

instead of fetching the actual document

worthy glacier
#

im checking for a field

#

inside a doc

slender thistle
#

Would findOne be more performant than countDocuments though? 🤔

leaden lake
#

so I must to check if the bot get the manage messages perms, and if he don't, what must I do ?

pure lion
#

Catch the error and return

slender thistle
#

simply return or something

fluid basin
#

actually not really shiv, findOne still returns the document anyways

#

so if its not indexed/cached, it will still need to obtain the document itself

earnest phoenix
#

@slender thistle just asking Can u accept my bot ?

slender thistle
#

But it returns when a first occurence is found, no?

leaden lake
#

okay

earnest phoenix
#

:((

slender thistle
#

which is basically the reason for my assumption

slender thistle
#

-upto @earnest phoenix

gilded plankBOT
#

@earnest phoenix

The average up-to-date approval times are stated here.

This does not mean it will take the same amount of time someone else's bot took to be reviewed and does not mean your bot is guaranteed to be reviewed within that time frame.

There is no exact time for how long bot approval will take.

There is a queue and you're not first, nor are you last.

slender thistle
#

Oh, you can limit it

earnest phoenix
#

bruh i know

fluid basin
#

should be the same for the python driver as well

slender thistle
#

Yeah, that would make more sense then

fluid basin
#

@earnest phoenix yes ok great, short answer is you don't get to choose nor the mods get to choose

slender thistle
earnest phoenix
#

k

worthy glacier
#

so how do i have it work as long as the key exists in the document

#

with whatever value for the key

earnest phoenix
#

Anyone knows how to import a folder in Glitch?

misty sigil
#

by uploading it?

earnest phoenix
#

lol

#

Where?

#

How?

#

btw dont use glitch

#

if u make it to 24/7

misty sigil
#

also if you’re using glitch for bot hosting then just don’t

earnest phoenix
#

u will get ban

#

I wanna find my app site, ip?

thick gull
misty sigil
#

read this: any """""""""""free""""""""""" hosting is either:

  1. not intended to be used as hosting for bots
  2. not actually suitable for hosting for bots
  3. not actually free
  4. will get your token stolen
  5. all of the above
earnest phoenix
#

So how can I have my bot online 24/7 for free?

misty sigil
#

You don’t.

earnest phoenix
#

heroku

misty sigil
#

you need to pay for a VPS

earnest phoenix
#

but only for 22days

misty sigil
#

@earnest phoenix heroku isn’t 24/7

earnest phoenix
#

yes it is

#

Or you can host on your pc

#

well every 24h it restart

misty sigil
#

Not 24/7 is it

earnest phoenix
#

ok ok

misty sigil
earnest phoenix
#

24/24

thick gull
#

Or you can host on your pc
this is a viable solution for me:)

earnest phoenix
#

Same here

#

By computer i mean raspberry pi

thick gull
#

woah you mean bot dev™️ hayper the bot dev™️ home hosts bots that hayper the bot dev™️ devs?

leaden lake
earnest phoenix
#

TM ??

#

whatbisbthat

thick gull
#

@earnest phoenix what pi model do you recommend

earnest phoenix
#

Your bot type?

thick gull
#

uh

#

just random shit I find cool™️

earnest phoenix
#

can we use pi to mine bitcoins ?? just asking

#

Yeah but super inefficient

misty sigil
#

yes but it’s stupid inefficient

thick gull
#

mining bitcoins is very unprofitable cause it costs too much electricity

#

:)

earnest phoenix
#

lol

feral aspen
#

Ahhhh

thick gull
#

unless you have a massive setup you’re not gonna get anywhere mining

earnest phoenix
#

@thick gull model 3, model 4 should be enough

thick gull
#

mk

#

ty

earnest phoenix
#

hwo much is one pi 4

feral aspen
#

A - C - E

earnest phoenix
#

wut

feral aspen
#

You dont have a hosting company to host your bot?

earnest phoenix
#

heroku

feral aspen
#

Why Heroku Man?

#

I dont recommend it.

earnest phoenix
#

idc about restart in every 25h

misty sigil
#

Heroku isn’t meant to host bots

earnest phoenix
#

tell me why it is bad

feral aspen
#

Cause first

#

No one uses it

earnest phoenix
#

they bannwd me for bots

misty sigil
#

read this: any """""""""""free""""""""""" hosting is either:

  1. not intended to be used as hosting for bots
  2. not actually suitable for hosting for bots
  3. not actually free
  4. will get your token stolen
  5. all of the above
feral aspen
#
  1. Not recommended, bot token is ALWAYS GETTING STOLEN
earnest phoenix
#

dont use herohu

feral aspen
#

and save as Matthew Said

thick gull
feral aspen
#

*same

misty sigil
#

Get it then you twit

thick gull
#

sorry I don’t have money

earnest phoenix
#

So what will happend if i get my token from databsd

thick gull
#

😔

feral aspen
#

Your bot gets hacked

#

then we all say goodbye to the bot

#

unless you make a new token

misty sigil
#

So what will happend if i get my token from databsd
@earnest phoenix it’ll still be in plaintext in the ram

thick gull
#

and your account probably

earnest phoenix
#

smu

#

again

#

every month

#

3€

#

smh

feral aspen
#

Bro

thick gull
#

?:(?

earnest phoenix
#

imma go back to my vps

thick gull
#

im so confused

feral aspen
#

I host my bot for only $2 dollars with 1GB storage and 600 mb ram

earnest phoenix
#

whre

feral aspen
#

GoFreshStart

#

Here.

earnest phoenix
#

imma get notes drom that

fluid basin
#

theres free decent hosting services that are legit and free

feral aspen
#

Like what.

fluid basin
#

GCP free tier

#

¯_(ツ)_/¯

earnest phoenix
#

ye google cloud is good

feral aspen
#

No.

misty sigil
#

low disk speed

earnest phoenix
#

all of us are broke

misty sigil
#

low ram

earnest phoenix
#

but free :))

misty sigil
#

just pay for a $3 / mo VPS

earnest phoenix
#

does aws good ?

misty sigil
#

put some investment into your bot smh

fluid basin
#

but matt its good enough for a simple bot

elfin tulip
#

Hello can i get help?

feral aspen
misty sigil
#

but you’ll have to move

feral aspen
#

This is freshstart

fluid basin
elfin tulip
#
const client = new Discord.Client()
const Gamedig = require('gamedig');
const {MessageEmbed} = require('discord.js');

let e = new MessageEmbed();

Gamedig.query({
    type: 'fivem',
    host: '185.80.130.73'
}).then((state) => {

    e    
        .setColor("#00FF00")
        .setDescription("HAHA: {maxplayers}");
    return message.channel.send(e);

}).catch((error) => {
    console.log("Server is offline");
});```
#

I have problem with this code

#

;\

feral aspen
#

What is the error

elfin tulip
#

ReferenceError: Discord is not defined

earnest phoenix
#

gamedig ?

elfin tulip
#

Yes

fluid basin
#

well the thing is not everyone are serious bot makers or willing to maintain their bots for an extended period of time

earnest phoenix
#

never heard about it

feral aspen
#

Cause

#

It's const Discord = new Discord.Client()

earnest phoenix
#

oh ye

#

No

#

he need requite it

fluid basin
feral aspen
#

Yes, cause some tutorials that he follows can be different

fluid basin
#

and compare that of yours

feral aspen
#

can be

golden condor
#

@golden condor your calling
@thick gull wut

earnest phoenix
#

It is not

feral aspen
#

const discord, const bot, const client, const [botname], const [yourname]

earnest phoenix
#

Discord = Siscord.Client

#

It is require

#

Ah nvm

feral aspen
#

oof

#

I was wrong

earnest phoenix
#
const {MessageEmbed, Client} = require("disocrd.js")
const client = nee Client()
thick gull
#

@thick gull wut
@golden condor code was using quickdb and mongo

slender thistle
#

@leaden lake No, not really. I suggest you use message.channel.permissions_for(message.guild.me).manage_messages. That will get you the permissions in the specific channel

earnest phoenix
#

nee

#

yeee

feral aspen
#
const Discord = require("Discord.js")
const bot = new Discord.Client()
earnest phoenix
#

smae

feral aspen
#

Like that

earnest phoenix
#

same

#

discord*

#

beuh i am on mobile

#

i cant type

feral aspen
#

Ok?

earnest phoenix
#

but gusy understand iy

leaden lake
#

okay thx

earnest phoenix
#

imma use heroku until my bot get accepted

#

hehehe

potent ferry
#

Hi, what is the type of the announcement channel for liste them ?

#

there is : "text", "voice" and "category"

pale vessel
#

news

#

what library are you using?

potent ferry
#

discord.js

leaden lake
#

@slender thistle my bot doesn't want to upload the svg file. It only upload the png file. And the png file doesn't want to show me the server count

potent ferry
#

ok

#

it's working nice

versed valve
#

hi

#

can anyone help me

pale vessel
versed valve
#

how to make my bot online always

pale vessel
#

get a cheap vps and use a process manager

versed valve
#

im making my own bot for my server

potent ferry
#

you can just run the code everytime but you computer must be on

versed valve
#

@pale vessel can u explane it how. because im new in it

#

i will do the live in the general vc

#

will u explain me?

pale vessel
#

i'm busy right now, sorry

versed valve
#

@everyone can anybody help me??

earnest phoenix
#

rule 1 also

restive pebble
small prairie
#

still works

#

nice

strange raven
#

what is that ⬆️

ivory seal
#
    at RequestHandler.execute (C:\Users\user\Desktop\Setup Bot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  method: 'get',
  path: '/users/2732563712136970290',
  code: 10013,
  httpStatus: 404
}``` error which i am getting any help?
solemn leaf
#

@small prairie 8b

small prairie
#

What?

ivory seal
#

huh pls help

small prairie
#
    at RequestHandler.execute (C:\Users\user\Desktop\Setup Bot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  method: 'get',
  path: '/users/2732563712136970290',
  code: 10013,
  httpStatus: 404
}``` error which i am getting any help?

@ivory seal the ID of the user is wrong?

#

oh wait

#

bot doesnt have that user accessible?

ivory seal
#

wdym

#

should i send my code here

#

i have put correct tokens

#

i figured it out nvm

sterile thicket
#

hey, how do I find in which args[n] a specific word .includes()?

golden condor
#

you could use a loop?

sterile thicket
#

any other easiest way?

pale vessel
#

use findIndex()

#

[1,2,3].findIndex(x => x == 1); // 0

sterile thicket
#

Yep, that's what I was looking for, thnks

earnest phoenix
#

spoonfeed

thick gull
#

how does pagination work someone teach brain small

slender thistle
#

An array of paginated contents/elements

thick gull
#

so does it basically cut a string every x letters and then puts it in an array? so like command 2 would be the 2nd part in it?

slender thistle
#

For example, if you want to paginate an array like [1, 2, 3, 4, 5, 6] through each 3rd element, you would want to get [[1, 2, 3], [4, 5, 6]]

thick gull
#

Okay

slender thistle
#

Oh, a string

#

Yeah

thick gull
#

Idk I’m just thinking about stuff right now lol

slender thistle
#

I assume JS?

thick gull
#

Yeah

golden condor
#

array[0][2]

pale vessel
#

k

slender thistle
#
let s = "mycoolstring"
let i = 0;
let l = [];
while (i <= s.length) {
    l.push(s.substring(i, i+4));
    i += 4;
}
console.log(l)
``` try this
#

4 in this case is by how many characters to paginate the string

#

I'll be honest, I don't know whether to use while or for loops in such cases 🤔

#

Oh, wait, you can just add 4 to i in JS' for

#

What's that IP

elfin tulip
#

ReferenceError: players is not defined

#

Its normal ip :\

opal plank
#

Is it urs?

elfin tulip
#

No

opal plank
#

Then its fine

elfin tulip
#

Thats game server ip lol

opal plank
#

Its weird to see ips nowadays and not domains

elfin tulip
#

Some server dont have domains some have

fierce arch
#

Yo I'm using mysql in python but just want to ask - Do I need to await my execute functions?
like await db.execute or just db.execute

ivory seal
#

how can the bot change the name of a guild?

fierce arch
#

Depends what lang you are using

ivory seal
#

node.js

honest perch
#

Let me ask you what you need this for

ivory seal
#

umm i am Trying to make a setup bot

#

so u invite it and it sets up ur server in an easy way

thick gull
#

@slender thistle thanks <3

#

oof discord double message

slender thistle
#

Preferably just leave the message that pinged undeleted so that I don't have to dig through guesses and snipes to guess why I got pinged mmulu

wheat jolt
#

hyperlinks can be used only in embeds?

slender thistle
#

Yes, embed description and field value

wheat jolt
#

ah ok

#

thanks

ivory seal
#

nvm i got it

dusty compass
#

Hi guys 👋

#

i want code's

quartz kindle
#

good luck finding them

earnest phoenix
#

I'm here

#

Take me

topaz saddle
#

i wants coder yes

wheat jolt
#

var m = await msg.channel.send(`**${msg.member}, Am găsit următoarele video-uri:**\n${videos.map(v => `**${videos.indexOf(v) + 1}.** ${bot.util.escapeHtml(v.title).replace('**', '\**')}`).join('\n')}`);

shouldn't this escape v.title?
https://alex.is-bad.com/JBFT9if.png

#

between that P and i there's a **

pale vessel
#

use .replace(/\*/g, "\\*")

#

you need two \

#

regex allows it to replace multiple occurrences

wheat jolt
#

thank you so much

topaz saddle
#

hello :) is there a faster way of running my discord bot, instead of running it - it is online - i find a bug - i have to fix it - i close my vsc and restart it so the bot goes offline?

honest perch
#

Why close vsc

#

Just ctrl c and launch it

topaz saddle
#

oh ok ty

#

i was pressing cmd c, thats why i couldnt reset pepowot

earnest phoenix
#

i wants coder yes
@topaz saddle lmfao i was joking

topaz saddle
#

same here

#

i didnt even know what i was saying

#

xd

earnest phoenix
#

we bamboozled each other

topaz saddle
#

yus

earnest phoenix
#

whitenames

topaz saddle