#development

1 messages · Page 372 of 1

rough pelican
#

are the ids

hushed oyster
#

wait

#

the background color should already be white

rough pelican
#

its

#

not

#

its #eee

#

some ugly grey color

hushed oyster
#

try just

#
.botpagebutton {
    background-color: white !important;
}```
rough pelican
#

nep

hushed oyster
#

well

#

I can't figure it out

rough pelican
#

me neither

#

its broken or some shit for me

#

d

#

lol

earnest phoenix
#

For some reason my FFMPEG keeps uninstalling for my host

rough pelican
#
#createdby {
    content: 'Developed By:'
}
#

is this a thing in css?

austere meadow
#

content?

#

content is a thing in css

#

and that should work

#

cascading style sheets its used for designing webpages

hushed oyster
#

@digital stratus DMs

uncut slate
#

content is only a thing on pseudoelements

#

afaik

earnest phoenix
#

{if boolean join == true
say "Hy {Playername} "}

#

I can' t code very well...

uncut slate
#

what

earnest phoenix
#

Sorry i am french x)

restive silo
#

well if you cant code very well then learn it

earnest phoenix
#

X)

heady zinc
#

ban all french people kthxbye

earnest phoenix
#

Lol

#

🤣🤣🤣🤣🤣🤣

restive silo
#

@heady zinc no shitpost in here lol

#

ty

neat falcon
#

OwO what's this

heady zinc
#

OOOOOOOOF

neat falcon
#

Same

restive silo
#

or Banhammer

heady zinc
#

i mean

#

¯_(ツ)_/¯

neat falcon
#

yes

restive silo
#

Paradox pls i dont wanan do this KonataCry

#

stop it now or next one gets mute FeelsModMan

drowsy yarrow
#

well if youre referring to this monstruosity

{if boolean join == true
say "Hy {Playername} "}

I kinda agree its shitpost with code here

neat falcon
#

what lib is that

uncut slate
#

lang I'm guessing you mean

drowsy yarrow
#

idfk the french guy posted

neat falcon
#

yes aetheryx

#

lib looks like js but idk

heady zinc
#

i don't think that is any actual lang

neat falcon
#

it's a mess

uncut slate
#

"lib looks like js" ?????

#

what

drowsy yarrow
#

It is an actual lang

heady zinc
#

even python looks better than that Thonk

neat falcon
#

because if == true

drowsy yarrow
#

Its the "Spaghetti Code" lang mmLol

uncut slate
#

🤦

restive silo
#

Could you actuall stop bashing that code for no reason now

#

thanks

heady zinc
#

hey its ugly that's a valid reason

drowsy yarrow
#

🆗 sir GWczeHowdy

heady zinc
#

but i mean yeah what lang is that thonkku

uncut slate
#

ask ur friend, he's french

drowsy yarrow
#

Spaghetti Code my guess would be JS

heady zinc
#

i will never have any french friends ffs

#

this is just not JS

#

i mean nothing looks like it

neat falcon
#

oof

uncut slate
#

doubt it's JS

#

does it really matter though, guys

neat falcon
#

needs to be a new lang

heady zinc
#

well i thought he asked for help with it

#

so yeah knowing what lang is it could help lul

restive silo
#

could we actuall stop now discussing which lang this code is and go on, aslong as he doesn't provide any usefull info we cant help anyways

neat falcon
#

hmm

#

ok

earnest phoenix
#

System.out.print "trolololololololololololo"

#

Sorry but i less the System.out.print ...

restive silo
earnest phoenix
#

Forget it not less sorry

#

I m french...

#

X)

#

You are bad with me 😦

restive silo
#

okay so this chat is for actuall developemnt discussion/help, if you just meme around or cant properly speak english you should move to #memes-and-media

earnest phoenix
#

...

#

package fr.discord.bot;

    import net.dv8tion.jda.core.JDA;
    import okhttp3.*;
    import org.json.JSONObject;

    import java.io.IOException;

    public class PostStats {
        
        private static final OkHttpClient CLIENT = new OkHttpClient();

        public static void toDiscordBots(JDA jda, String api_key) {
            System.out.println("Posting servercount to discordbots");

            String url = "https://discordbots.org/api/bots/"+jda.getSelfUser().getId()+"/stats";

            JSONObject data = new JSONObject();
            data.put("server_count", jda.getGuildCache().size());

            RequestBody body = RequestBody.create(MediaType.parse("application/json"), data.toString());

            Request request = new Request.Builder()
                    .url(url)
                    .post(body)
                    .addHeader("User-Agent", "DiscordBot " + jda.getSelfUser().getName())
                    .addHeader("Authorization", api_key)
                    .build();

            try {
                Response r = CLIENT.newCall(request).execute();
                System.out.println("Posted server count, response: " + r.body().string());
            } catch (IOException e) {
                e.printStackTrace();
            }

        }
    }

``` I don't understand, how that fonction
#

require 'discordrb'

bot = Discordrb::Bot.new 'email@example.com', 'hunter2'

bot.message(with_text: 'Ping!') do |event|
event.respond 'Pong!'
end

bot.run

restive silo
#

@earnest phoenix okay so the fun is over now, if you continue posting code with no context in here and meme around i will mute you

earnest phoenix
#

Sorry :/

drowsy yarrow
#

How do you add an item to an array I forgot lmao

restive silo
#

you can look it up there noxSpooks

gusty topaz
#

I wonder about bot best practises, if I have no permission to send the help document in the current text channel, should I silently fail or use the DMs?

trim plinth
#

¯_(ツ)_/¯

gusty topaz
#

or should I default to DMs

#

and use the channel as fallback

trim plinth
#

preference i'd say but it is useful to alarm a guild if your bot doesn't have the correct perms to avoid confusion

gusty topaz
#

hmmm

#

I will default to the text channel

#

use DMs as fallback

#

and silently fail if I cannot send in either

trim plinth
#

yeah, defaulting to dms is extremely annoying so I suggest setting your bot's default to text channels

gusty topaz
#

right

#

okay

#

thanks for input

#

😃

trim plinth
#

yw

floral stone
#

I use default for dm

drowsy yarrow
#

same

supple shale
#

send nude

opaque zinc
#

Hello! How can i get through JDA amount of online users? Any method?

earnest phoenix
#

from guild?

opaque zinc
#

Yes

earnest phoenix
#

sec

#

guild.getMembers().stream().filter(user -> user.getOnlineStatus() == ONLINE).toArray().length

opaque zinc
#

Thank you very much!

earnest phoenix
#

np~

inner jewel
#

no need to use toArray

#

you can and should just use count()

#

it won't create a temporary unneeded array

#

@opaque zinc @earnest phoenix

earnest phoenix
#

noted

#

ty~

#

was not aware

modern kelp
#

@fathom zodiac

#

@fathom zodiac

#

@fathom zodiac

#

p!help

gusty topaz
#

Use

#

Testing channels

#

Your does not have permissions to talk here

modern kelp
#

@fathom zodiac

glossy sand
#

@modern kelp what in the name of

#

are you doing

south finch
modern kelp
#

😢

glossy sand
#

@modern kelp get out of here if you aren't going to stay on topic

modern kelp
#

k

neat falcon
#

how do i see if discord message contains something

uncut slate
#

message.content.includes

neat falcon
#

thanks

odd dome
#

Is it possible to see if the user voted today using dblapi.js?

umbral pelican
odd dome
restive silo
#

yes it is with the "days" field on the Get Bot's Votes endpoint

odd dome
#

@restive silo thanks

restive silo
odd dome
earnest phoenix
#

This might sound stupid but how do I send a message in a text channel

uncut slate
#

msg.channel.send (depending on your lib)

earnest phoenix
#

Like when a guild is added then in this channel it sends a message

#

Ik how to do that

uncut slate
#

guild.channels.useAMethodToGetTheChannelYouWant().send(...)

earnest phoenix
#

useAMethodToGetThrChannelYouWant wow that’s long

#

guild.channel.find(‘18849939187384’).send(...) ????

#

@uncut slate

uncut slate
#

sure

#

.get

earnest phoenix
#

ok

#

Thx

#

D-invite

#

Woops

#

Wrong discord

#

How do I define send @uncut slate

uncut slate
#

you don't

#

it'll exist if the channel exists

earnest phoenix
#

It says Cannot read property or send of undefined

#

Of

#

Does it matter if I put it around speech marks? @uncut slate

uncut slate
#

what?

earnest phoenix
#

If I put the channel id in speech marks does it matter

uncut slate
#

what's a speech mark

earnest phoenix
#

#

uncut slate
#

no, it doesn't matter unless you have '"

earnest phoenix
#

So it has to be ‘

uncut slate
#

no

earnest phoenix
#

What can I use for the id

#

Cause it says cant read property of send

uncut slate
#

if the guild you're running .get(ID) doesn't have that channel in it, it won't find the channel

earnest phoenix
#

It has the id

#

Wait nothing around the numbers)

#

?

#

Guild or text channel

uncut slate
#

what are you asking

drowsy yarrow
#

guys how to make bot

earnest phoenix
#

whats wrong with this

  // This event triggers when the bot joins a guild.
  console.log(`New guild joined: ${guild.name} (id: ${guild.id}). This guild has ${guild.memberCount} members!`);
  guild.channels.get("413075117338525696").send(`New server added:\nGuild name:\n${guild.name}\nID:\n${guild.id}\nMember count: ${guild.memberCount}`);
  client.user.setGame(`on ${client.guilds.size} servers`);
});```
glossy sand
#

@drowsy yarrow get out of here

drowsy yarrow
#

okay sorry ┬─┬ ノ( ゜-゜ノ)

uncut slate
#

if that guild doesn't have that channel, it'll throw

earnest phoenix
#

It does

#

I just made it

#

And it check the I’d was correct 2 times

uncut slate
#

it's not

#

🤔

earnest phoenix
#

How isn’t it

#

How is it not there

#

I copied it he id

#

The

uncut slate
#

if that throws "cannot read property send of undefined", that channel doesn't exist on that guild

#

unless you're screwing with the cache or something

earnest phoenix
#

Where do put the guild

uncut slate
#

what do you mean "where do put the guild"

#

what are you trying to do

earnest phoenix
#

I want it to send a message in my choice of Text channel

uncut slate
#

then just do client.channels.get(id).send(...)

earnest phoenix
#

No error and said nothing hing

uncut slate
#

I blame PEBKAC

drowsy yarrow
#

I blame aetheryx

uncut slate
#

(╯°□°)╯︵ ┻━┻

earnest phoenix
#

Why it not send message

uncut slate
#

pebkac

earnest phoenix
#

Wat

uncut slate
#

patat

earnest phoenix
#

That’s makes no sense to me

uncut slate
#

I don't know why it didn't send it

#

if it didn't log an error, assume the code wasn't ran

earnest phoenix
#

So how do I run it

#

It’s always ran

drowsy yarrow
#

show code m8

earnest phoenix
#
  console.log(`New guild joined: ${guild.name} (id: ${guild.id}). This guild has ${guild.memberCount} members!`);
  client.channels.get("413075117338525696").send(`New server added:\nGuild name:\n${guild.name}\nID:\n${guild.id}\nMember count: ${guild.memberCount}`);
  client.user.setGame(`on ${client.guilds.size} servers`);
});```
#

Nothing wrong with it

uncut slate
#

what are you doing to trigger it

earnest phoenix
#

When a guild is joined

uncut slate
#

no but, how are you triggering it yourself

earnest phoenix
#

Idk

#

Trigger it

#

Make it triggered

uncut slate
#

??

#

no, you're telling me it didn't send it

#

what did you do to expect a message

earnest phoenix
#

What

#

U mean

#

It triggers when it joins a guild

#

@uncut slate

uncut slate
#

yeah, sure

#

but how are you testing it

earnest phoenix
#

I’m adding it to my guild then removing it

trim plinth
#

no need to remove your bot every time

earnest phoenix
#

And when it joins is triggers a error or nothing

trim plinth
#

just restart it

uncut slate
#

no? @trim plinth

trim plinth
#

?'

uncut slate
#

for guildCreate events you need to kick and reinvite the bot, or use eval to emit the event synthetically

trim plinth
#

o ok

earnest phoenix
#

I don’t have eval

uncut slate
#

what's the error

earnest phoenix
#

Idk how to add it

#

Nothing

#

Or

#

Send is indefined

#

@uncut slate

uncut slate
#

then your client doesn't have that channel cached or the ID is wrong

earnest phoenix
#

cached what you mean

uncut slate
#

google

old bridge
#

would Java work for bot

uncut slate
#

sure

old bridge
#

ok

#

ill need to start soon

#

would eclipse work?

uncut slate
#

sure, whatever you prefer

old bridge
#

ok

vast slate
#

hey

old bridge
#

btw has therebeen java things in this channel?

uncut slate
#

We don't get many Java questions, no

rough pelican
#

Hello, would anyone here like to be a bot-tester for @dense inlet. Helping will result in extra permissions and perks on my bot.

uncut slate
rough pelican
#

ok

#

:3

#

what would be the proper channel?

restive silo
rough pelican
#

ok

drowsy yarrow
#

how do you get a user object out of a mention

#

(d.js)

pale light
#

msg.mentions.members.first().user or something similar GWjiangoOmegaLUL

drowsy yarrow
#

seems legit

unique star
#

msg.mentions.users is a thing

#

lol

earnest phoenix
#

.

drowsy yarrow
#

Do collections have a .first() method

uncut slate
#

yeah

bright bone
#

How can I create music commands, with queues and those things? Discord.js

trim plinth
#

Is it ethical to have my bot create a 'Muted' role on server join or should I make it so that the server has to make the Muted role because I'm currently having trouble making my bot create a role so I was wondering if I could just make it so the server has to make the Muted role (I would like some input on this)

elder rapids
#

Server admins should setup the role

trim plinth
#

mk, ty

trim plinth
#

ok so I have this code but it brings back a promise rejection when I run it (this is an unmute command)

#

im bringing the error one sec

pale light
#

MANAGE_ROLES_OR_PERMISSIONS is not a valid permission string GWjiangoOmegaLUL

trim plinth
#

OOF

#

ok ignore this

pale light
#

thats the error right 👀

trim plinth
#

most likely

#

ty for pointing out my bullshit

pale light
#

lol

#

np

trim plinth
#

ok that wasn't the error lol

pale light
#

what is "Muted"

#

show full code

#

where do you define muted

trim plinth
pale light
#

do you have a role named Muted

#

👀

trim plinth
#

yes

#

and if I don't it returns a message saying so

#

the mute command works fine for some reason though

#

which is weird

#

wAIt

#

I spot a fuckup in my code once more

earnest phoenix
#

:/

frail terrace
#

related to development: how do I heccing use log

trim plinth
#

¯_(ツ)_/¯

versed cliff
vital lark
#

what is the error?

earnest phoenix
#

^

versed cliff
#

('unexpected indent', ('/home/maxguest2002/Documents/Bot/cogs/natsu.py', 48, 12, ' await self.bot.say("ฅ^•ﻌ•^ฅ 🐱 {} ,Miaw ฅ^•ﻌ•^ฅ ".format(author.mention))\n'))

#

and am using python 3.6

toxic hearth
#

Guys, how can I get total permissions count for my bot in some guild?

restive silo
#

Which lib

earnest phoenix
#

wat lang?

#

Anwsers. . . what do u mean?

toxic hearth
#

Custom, php

low rivet
#

so.. no lib..?

fleet mason
#

let helpcommand = args.slice(0).join(" ");
  if(helpcommand === "invite") {
    message.channel.send("It works");
    return;
  }
  if(helpcommand === 0) {
    message.channel.send("...");
    return;
  }
}```
#

how do i define the 0

#

like if i just type !test

earnest phoenix
#

wait. .

#

wat do u want???

#

oh. . .

#

u want it like this
!help <type of command>?
@XkijuX#6667

fleet mason
#

yea @earnest phoenix

#

but i want !help alone to aslo type something

#

so how do i define the `null`

earnest phoenix
#

ok. . .

#

🤔

#

try to use

if(!args[0]) return message.channel.send(":x: Memes enter a type of command pls")
if(args[0] === "help") return message.channel.send("Usage: !help - Opens this menu")```
fleet mason
#

It works thx

earnest phoenix
#

😃

#

@XkijuX#6667 u want a better one?

#

it will help a lot

fleet mason
#

ok

#

how would that be

earnest phoenix
#
var typeofhelp = args[0].toLowerCase(); //this will make the command not CaSe SEnsiTiF
//example: !help HELP it will swicth the "HELP" -> "help" making this much nicer
if(!typeofhelp) return message.channel.send(":x: Memes enter a type of command pls")
if( typeofhelp === "help") return message.channel.send("Usage: !help - Opens this menu")````
fleet mason
#

ahh i see

#

i forgot about the case sensitive

#

@earnest phoenix but whats the difference between using var and let

earnest phoenix
#

im not sure

fleet mason
#

ok

toxic hearth
#

@low rivet yeah, no lib

fleet mason
#

@earnest phoenix why do i get this error TypeError: args.slice(...).toLowerCase is not a function at Object.exports.run (C:\Users\sande\Desktop\mybot\commands\test.js:3:33) at Client.client.on.message (C:\Users\sande\Desktop\mybot\mybot.js:28:17) at emitOne (events.js:116:13) at Client.emit (events.js:211:7) at MessageCreateHandler.handle (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34) at WebSocketPacketManager.handle (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65) at WebSocketConnection.onPacket (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:330:35) at WebSocketConnection.onMessage (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:293:17) at WebSocket.onMessage (C:\Users\sande\Desktop\mybot\node_modules\ws\lib\event-target.js:120:16) at emitOne (events.js:116:13)

earnest phoenix
#

u dont need to cut the args

uncut slate
#

you're trying to use toLowerCase on an array

earnest phoenix
#

also. . . u need to hv 2 vars

fleet mason
#

forget that

#

this is the errorTypeError: Cannot read property 'toLowerCase' of undefined at Object.exports.run (C:\Users\sande\Desktop\mybot\commands\test.js:4:26) at Client.client.on.message (C:\Users\sande\Desktop\mybot\mybot.js:28:17) at emitOne (events.js:116:13) at Client.emit (events.js:211:7) at MessageCreateHandler.handle (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34) at WebSocketPacketManager.handle (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65) at WebSocketConnection.onPacket (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:330:35) at WebSocketConnection.onMessage (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:293:17) at WebSocket.onMessage (C:\Users\sande\Desktop\mybot\node_modules\ws\lib\event-target.js:120:16) at emitOne (events.js:116:13)

#

if(!typeofhelp[0]) return message.channel.send(`These are the commands you can use \`8ball, invite, logo, member, ping, plans, request, say, setgame\``);

#

that line is the problem

#

it wont understand the tolowercase function

earnest phoenix
#
var help = args[0].toLowerCase();```
#

it should just be like dat

gleaming summit
#

Can anyone help me with forEach?

restive silo
#

ask away

earnest phoenix
#

this is #development ask any dev question @gleaming summit 😃

gleaming summit
#

oh

#

Thanks

#

Wait a sec

frail kestrel
#

@versed cliff python is VERY strict on indentation

gleaming summit
#

I want to send message to all guide

#

but how

earnest phoenix
#

guide??

gleaming summit
#
var messageToBroadcast = args.slice(0).join(' ')
  const guild = member.guild
  const channel = guild.channels.find(c => c.permissionsFor(guild.me).has("SEND_MESSAGES"))
  guilds.forEach(c => c.permissionsFor(guild.me).has("SEND_MESSAGES") {
    channel.send({embed: {
      color: 3447003,
      title: 'broadcast',
      description: `${messageToBroadcast}`
    }})
  })
#

guild

#

mistake

#

But other guy said to me

earnest phoenix
#

🤔 the only way u can do it as i remember is find a channel and send it

gleaming summit
#

forEach was incorrect

restive silo
#

.has() returns an boolean

gleaming summit
#

🤔

frail kestrel
versed cliff
#

@frail kestrel Thanks

frail kestrel
#

push the circled bit back to where author = is

restive silo
#

@gleaming summit your syntax is a bit strange

earnest phoenix
#

@restive silo is || does it mean or or and? in js

gleaming summit
#

Yea. I didn't learn JS

frail kestrel
#

|| means or

#

&& is and

restive silo
#

|| means or

earnest phoenix
#

u copy/paste??

frail kestrel
#

ye

earnest phoenix
#

ok ty

frail kestrel
#

o

#

you could've asked me xd

earnest phoenix
#

@gleaming summit if u didnt learn js u mean u copy/paste?

restive silo
#

@gleaming summit then you need to learn it instead asking in here Thonk

gleaming summit
#

nope

#

I made that code

earnest phoenix
gleaming summit
#

I didn't copy/pasted

#

So I make a code by some other codes

#

I can write some codes

#

like

#

simple

#

things

earnest phoenix
#

pls send the message in 1 sentence pls. . .

gleaming summit
#

k

frail kestrel
#

lol

#

🔫 😂

#

ok i'll stop

restive silo
#

okay so i give you the actuall best tip i can give anyone in here rn, if you dont understand javascript completly, making a good Discod bot will be a pain in the ass and you will actuall not get quite far.

earnest phoenix
#

🤔 u will only get to an auto responder 😆

gleaming summit
#

But I am understanding York's guide.

earnest phoenix
#

ok. . .

restive silo
#

yea because he made it for idiots but you should still know all of the basics to improve yourself

gleaming summit
#

k

earnest phoenix
#

or read the docs

restive silo
#

because yorks code might be simple but is not the best way at all

earnest phoenix
#

unless youre me

gleaming summit
#

🤔

earnest phoenix
#

u get eaten @earnest phoenix

restive silo
#

it has a lot of redundant/useless stuff or other stuff you shoulnd't do

gleaming summit
#

ok

#

So I must learn es6 or es5?

restive silo
#

you dont "must" learn es6 or es5 rather learn the basics of JS

gleaming summit
#

My learning way

  1. guide
  2. docs
  3. learn some stuff
#

Because I am applying.

restive silo
#

what are types, what are functions, what are clasess, what does the sytax of an if/try catch/witch statement looks like

#

you should learn that rather than looking at examples

gleaming summit
#

k

#

So I have to learn and understand it?

restive silo
#

yes

gleaming summit
#

k

#

Which is required?

#

ES5 or ES6

restive silo
#

all

gleaming summit
#

first thing to learn

#

I can find ES5 guide for my native

restive silo
#

ES5 and ES6 is just a specified JS version what introduct new stuff

#

doesn't change the basics

gleaming summit
#

oh

#

Then notcare?

#

Everyone says there is no forEach in ES5

restive silo
#

nah not yet you learn basic Js first then you learn the newer syntax

gleaming summit
#

k

restive silo
#

forEach is there since ES1

gleaming summit
#

🤔

restive silo
#

forEach is aswell in ES5

#

ForEach is even in ES2017

earnest phoenix
#

hey yukine, do you know lavalink decently?

restive silo
#

nah never used it devin

earnest phoenix
#

oof

gleaming summit
#

Then why people uses for instead of forEach?

restive silo
#

because for is syncrous while forEach is asyncrous

gleaming summit
#

oh

#

right

#

Then gonna learn

restive silo
#

a for loop is blocking the current script execution while a forEach isn't

gleaming summit
#

It can be take manytime.

#

Many help for me

restive silo
#

should take around 1-2 weeks if you wanna learn everything

gleaming summit
#

k

#

I'll change my learning cycle

restive silo
#

JS is pretty easy in comparison to other languages

gleaming summit
#

I learned web part first.

#

I think JS is so difficult for me 😭

#

ok

#

I am gonna learn it

#

bye

restive silo
earnest phoenix
#

the basicsof js is not dat hard tbh

restive silo
#

depends on your pre knowledge of other programming languages and programming at all

earnest phoenix
#

python is the most basic if im not wrong

terse pier
#

Python is nicer, than JS

restive silo
#

okay so i dont wanna start that shitty argue again so let us just not do that now 👏

fleet mason
#

@earnest phoenix ```exports.run = (client, message, args) => {

//et helpcommand = args.slice(0).toLowerCase().join(" ");
var help = args[0].toLowerCase();

if(!help[0]) return message.channel.send(These are the commands you can use \8ball, invite, logo, member, ping, plans, request, say, setgame``);
if(help[0] === "test") return message.channel.send("Usage: !help - Opens this menu");

if(help === "invite") {
message.channel.send("It works");
return;
}
}

#

it wont work

earnest phoenix
#

who mention me?

#

oh. . .

#

wats the error?

#

u dont need the [0] in the help

#

so

if(!help) return uhaushdioajdioajdaiojdaio```
fleet mason
#

thats not the problem

#
    at Object.exports.run (C:\Users\sande\Desktop\mybot\commands\test.js:4:20)
    at Client.client.on.message (C:\Users\sande\Desktop\mybot\mybot.js:28:17)
    at emitOne (events.js:116:13)
    at Client.emit (events.js:211:7)
    at MessageCreateHandler.handle (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:330:35)
    at WebSocketConnection.onMessage (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:293:17)
    at WebSocket.onMessage (C:\Users\sande\Desktop\mybot\node_modules\ws\lib\event-target.js:120:16)
    at emitOne (events.js:116:13)```
frail kestrel
#

[0] is indexing

#

actually

#

what r u trying to do

#

For your error, it doesn't know what you're doing with slice(0)

#

toLowerCase is like

#

tf r u using me for?

fleet mason
#

@frail kestrel no because thats a comment //

frail kestrel
#

0 w0t

fleet mason
#
var help = args[0].toLowerCase();
frail kestrel
#

w0t line does it say

fleet mason
#

im only using the var help

#

not thr let

frail kestrel
#

show full error

#

I wanna see

#

what line

fleet mason
#

var help = args[0].toLowerCase();

#

TypeError: Cannot read property 'toLowerCase' of undefined
at Object.exports.run (C:\Users\sande\Desktop\mybot\commands\test.js:4:20)
at Client.client.on.message (C:\Users\sande\Desktop\mybot\mybot.js:28:17)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:330:35)
at WebSocketConnection.onMessage (C:\Users\sande\Desktop\mybot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:293:17)
at WebSocket.onMessage (C:\Users\sande\Desktop\mybot\node_modules\ws\lib\event-target.js:120:16)
at emitOne (events.js:116:13)

frail kestrel
#

what's args defined as

fleet mason
#

const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();

austere meadow
#

first of all

#

ok

#

args is undefined

#

or args[0] is

fleet mason
#

yea

#

the args = 0 so i want it to run this command. if(!help) return message.channel.send(`These are the commands you can use \`8ball, invite, logo, member, ping, plans, request, say, setgame\``);

#

but when i have the tolowercase()

#

it wont handle that theres nothing there

austere meadow
#

why don't you just do .split(" ");?

#

instead of using regex

fleet mason
#

because its caps sensetive

austere meadow
#

what

#

split(" ") will do exactly what you are doing right now

fleet mason
#

//let helpcommand = args.slice(0).join(" ");

austere meadow
#

ive never used regex in split so im not sure if it even works

fleet mason
#

that worked

austere meadow
#

oh

#

so its just the toLowerCase?

fleet mason
#

yea

austere meadow
#

ah okay

fleet mason
#

it wont handle a null

austere meadow
#

sorry about that

fleet mason
#

np

austere meadow
#

when you are doing args.slice(0), args is still an array

#

so you are doing toLowerCase on an array

fleet mason
#

it workes with the !command [the command i want to run]

#

that works

#

but the !command dosnt

austere meadow
#

is it because you are doing slice(0)

#

slice removes the indexed item from the array

fleet mason
#

ok

austere meadow
#

try it without that maybe blobthumbsup

fleet mason
#

like thisvar help = args[0].toLowerCase();

austere meadow
#

is args[0] a string?

fleet mason
#

let helpcommand = args.toLowerCase().join(" ");

#

that didnt work

austere meadow
#

ideally, args would be an array like ["test", "argument"]

#

then args[0] would be "test"

fleet mason
#

yea

#

im not sure what to do now XD

earnest phoenix
#

xD

#

i dont rlly use command handlers(cause im bad)

#

who here lavalinks for eris

frail kestrel
#

n0pe

austere meadow
#

i lavalink but not for eris

#

but whats up

#

we can lavalink together

restive silo
frail kestrel
#

W E C A N L A V A L I N K T O G E T H E R

fleet mason
#

let helpcommand = args.slice(0).join(" ");
let member = message.mentions.members.first();
let guild = message.member.guild;
let Role = guild.roles.find('name', 'Muted');


if(helpcommand === "1") {
  message.channel.send("it works");
  message.member.addRole(Role);
  return;
}
}```
#

how can i make the mentioned person get the role

#

because now i get the role

earnest phoenix
#

use

let aaaa = message.mentions.users.first();
if (!aaaa) return message.channel.sendMessage("fuk off")
aaaa.addRole(do this urself);```
fleet mason
#

XD

#

nice save

heady zinc
#

das spoonfeed

earnest phoenix
#

🤔 ok next time ill give less information :/

fleet mason
#

i like how he gives info and i learnes from it because i try to understand the code he put out and then i edit it to fit in my code

austere meadow
#

dont use sendMessage :/

#

its deprecated

#

why is it even a thing in v11

#

its been deprecated for years

vague latch
#

send('string')

heady zinc
#

iirc its not even in v11.3

restive silo
#

@austere meadow it was removed in 11.3 already

austere meadow
#

oh

#

thank god

restive silo
#

ikr

austere meadow
#

ok btw

heady zinc
#

i heard d.js's v12 was soon btw

austere meadow
#

perfect time to discuss

#

about v12

#

ok soon is never

#

but

#

internal sharding

heady zinc
#

seems like internal sharding will be merged

austere meadow
#

that PR

#

interests me

#

mhm

earnest phoenix
#

soon = never best qoute

restive silo
#

@heady zinc well it will still take some time since hydar wanted to look over it himself first

heady zinc
#

leeks zoomeyes

earnest phoenix
#

OwO

austere meadow
#

WHAT

#

THATS NOT SOON

earnest phoenix
#

i wonder wat it will add thou

austere meadow
#

winter is ages away

restive silo
#

that aren't real leeks

heady zinc
#

smh

#

winter is now for me mmLol

earnest phoenix
#

its the end of the year

heady zinc
#

but yeah comparing to when it was announced

#

it is soon xD

austere meadow
#

okay true

#

what is internal sharding actually for?

earnest phoenix
#

idk

austere meadow
#

ive never really fully understood it

restive silo
#

i should leek staff chat HyperMegu nah it will still take some time since V12 also includes AutoFetch and caching improvemnts (external caching and stuff)

heady zinc
#

do the same thing than eris

austere meadow
#

is there any eta on those caching improvements wearyblob

heady zinc
#

what about the thing about extending d.js's classes in v12

restive silo
#

you can shard without using of the ShardingManager and everything is done internally so you code like its a 1 process thing but its sharded internally

earnest phoenix
#

u know i hate downloading node-opus

#

it spams console xD

restive silo
#

@heady zinc already done

austere meadow
#

^ i use that

heady zinc
#

is it

austere meadow
#

its neat

heady zinc
#

it looks cool

restive silo
#

it is cool

heady zinc
#

guess i'll implement it to eris

restive silo
#

👏 do that

austere meadow
heady zinc
#

sexy af

austere meadow
#

oof

#

it is

restive silo
#

i mean i extend D.js classes on stable already but i overwrote ptototypes what is edgy imo

austere meadow
#

ahh

heady zinc
#

that's what i do with eris

restive silo
#

not the best thing to do

heady zinc
#

not

restive silo
#

no u

heady zinc
#

b-but

trim plinth
#

h o w t o r u n a b o t o n h e r o k u (I tried 3 times so far but I have had trouble 👀 )

drowsy yarrow
#

r u n i t o n g l i t c h

restive silo
#

could you both stop writing like that

#

thanks

fleet mason
#

speak london

cobalt wadi
#

So, I have no idea what just happened, but I was learning to make a bot in C# recently. I ran it twice without incident, it did exactly what I programmed it to do.

trim plinth
#

ok

cobalt wadi
#

Today I ran it, and shortly after, it banned everyone from the server for reason "rekt", changed the server name to "be here if gay" and other things, things I definitely didn't program it to do

#

No-one had access to the bot's programming but me, I was running it on my computer, and the only ones with admin were me and the bot.

#

Thankfully it was not an important server, but has anyone heard of anything like this?

#

Oh, it also sent me DMs that, when I tried to look at them, caused Discord to crash.

trim plinth
#

did you leak your token

austere meadow
#

^ that is most likely what happened

trim plinth
#

mm yeah this stuff doesn't happen like magic so you leaked your bot token

#

reset your token on your bot's application page and paste the new token into your code

cobalt wadi
#

I did put the bot up on a github about 10 minutes before this happened, might someone have just happened upon it?

trim plinth
#

PFFF

#

that is what happened

#

don't ever post your token on github

#

just

#

don't

deep parrot
#

^

#

Peeple are quick on that

trim plinth
#

just reset your bot's token on the application page

cobalt wadi
#

lol, okay thanks guys

trim plinth
#

that is the best option

#

yw

earnest phoenix
#

He must hv... hosted the bot on Heruko and put the token xD

earnest phoenix
uncut slate
earnest phoenix
#

omg

#

kkk

#

I need to sort this out.

#

python nods js 😂

#

Also that embedded YT video at the bottom is so triggering

#

Just make it invisible

#

There are no people who do not like music I'll keep it so they can pause it

restive silo
#

well that information is kinda misleading since these apps/libs/projects/langs aren't partnered with you

#

@earnest phoenix

#

use something like "Powered by"

#

dunno

earnest phoenix
#

'-'

#

ok

#

fixed @restive silo

next bluff
#

Are there some restrictions on what CSS you can use on your bot page? The CSS I used didn't seem to work

restive silo
#

I dont think they are GWchadThinkeyes but there are terms on what needs to be on that edited site

prime geyser
tawny lava
#

very readable

#

line 30

next bluff
#

Hmm I wonder if the display: none's are a problem

prime geyser
#

Thanks @tawny lava, the ( !

austere meadow
#

https://please.zbot.me/FMkNlQCV.png
anyone here good with SandySounds or lavalink? ive been getting Voice connection timeout and i remember getting the issue before and being able to fix it, but ive been trying for a few hours now and i just can't really understand why this is happening, any thoughts or help would be appreciated blobthumbsup

earnest phoenix
#

havent been using it for a whilte rusty u know

low rivet
#

@prime geyser the error is that your token is on github GWjustinEyesReverse

next bluff
earnest phoenix
#

@prime geyser bad idea. . .

#
     var helpembed = new Discord.RichEmbed()
          .setColor("#01B0F0")
          .addField("Carnet de liaison | aide", " ")
          .addField("Utilitaires", " _")
          .addField(prefix + "timetable", "Affiche votre emploi du temps")
          .addField(prefix + "help", "Vous affiche ce menu")
          .addField(prefix + "stats", "stats du bot")
          .setFooter(basefooter)
      message.channel.sendEmbed(help_embed)
#

pls. . .

#

helpembed
and
help_embed

low rivet
#

discord.js?

earnest phoenix
#

he is using discord.js

#

and heruko

low rivet
#

a field can't have no value, add a 0 width space

earnest phoenix
#

and dat. . .

#

@low rivet wanna hv fun?

low rivet
#

no..? GWcfcThonk

earnest phoenix
#
  1. @prime geyser dont have ur token on github
  2. Hope ur server hasnt. . . been grief(i didnt touchy ur token)
  3. Hope ur bot doesnt hv perms to delete channels on the servers it is on. . .
drowsy yarrow
#

how do you add a user to a role on d.js master

earnest phoenix
#

🤔

#
message.author.addRole();```
#

well u do watever is in the ()

#

Anyone can teach me how to detect messages being deleted(making logs) using discord.js

heady zinc
#

@prime geyser hey fam, just to let you know that, as your real bot token was on github, i went ahead and got it reset, no need to thank me kthxbai

tawny lava
#

@earnest phoenix that won't work since you can't add roles to users, only guildmembers

#

and listen to the messageDelete event

prime geyser
#

@heady zinc @earnest phoenix @low rivet who of you 3 has used my token for post 🔞 images ?

earnest phoenix
#

i said. . . i didnt touchy ur token

#

also 4JR didnt

heady zinc
#

well who posted your token is the question here

#

why tf did you do that

prime geyser
#

It's you, @heady zinc ?
I have posted that because I don't know how to use other.

heady zinc
#

????????????????????

#

you posted it because you don't know how to be smart?

prime geyser
#

How to hide my token on GitHub, I don't know other possibilities.

heady zinc
#

well you don't put your files on github in the first place?

#

or remove the token from them ???

prime geyser
#

So it's you or not ? @heady zinc

heady zinc
#

that is not the question here

#

you are 100% the one to blame for what your bot posted

#

honestly why french people are that much retarded

prime geyser
#

Ok so it's you

glossy sand
#

@heady zinc rule 3

heady zinc
#

its not discrimination

glossy sand
#

riiight

heady zinc
#

no nsfw stuff

#

okay right it is discrimination

#

buutt

#

as i am french

#

its k

prime geyser
#

Do'you want I signal you to the web police @heady zinc ?

quiet bobcat
#

uhm what does wew do?

#

It looks alot like a token

heady zinc
#

it is one

quiet bobcat
#

Should it be protected

heady zinc
#

i just connected and disconnected with it 1000 times

quiet bobcat
#

idk eris

heady zinc
#

to get it reset

quiet bobcat
#

ok

heady zinc
#

afaik eris take the token in the constructor and not in the connect method

quiet bobcat
#

Alright

prime geyser
#

@heady zinc I signal you to the web police if you don't tell me the verity

Je vais te signaler à la police du web si tu ne me dis pas la vérité

uncut slate
#

bruh

heady zinc
#

holy fuck

low rivet
#

what

heady zinc
#

how can i not discriminate here

#

im fucking done

low rivet
#

lol if u leaked your own token, don't blame people for using it

heady zinc
#

i even spent 5 minutes in protecting the guilds with a reset

#

you should be grateful

#

(╯°□°)╯︵ ┻━┻

glossy sand
#

@prime geyser hello Web Police here

#

this is entirely and without dispute your fault

prime geyser
#

For posting 🔞 images on a servers on miners has here, I can blame pepole.

@low rivet

uncut slate
#

what

low rivet
#

what?

glossy sand
#

@uncut slate leaked his token voluntarily and he's blaming other people for what they did with it

prime cliff
#

That engrish 😂

earnest phoenix
#

. . . 1. never post ur token on github

uncut slate
#

yeah I've been here, but what the fuck do 18+ images have to do with it

low rivet
#

lol i didn't even use the token GWcfcThonk

earnest phoenix
#
  1. do u even know how to use heruko?
uncut slate
#

heruko

low rivet
#

how is this related to heroku

weak parrot
#

Heroku bloblul

earnest phoenix
#

it was actualy a clone

heady zinc
#

lemme translate from french

uncut slate
#

no shit 🤔 @earnest phoenix

earnest phoenix
#

but dat time he took to remove all the FredBoat xD

heady zinc
#

"i can blame people as they posted nsfw images on servers with underage members"

low rivet
#

ez... find and replace

prime geyser
#

Ok so I leave this server. @heady zinc, if you want some explications, go in PM. Bye bye everyone.

uncut slate
#

bye bye

heady zinc
#

i mean

#

k

#

¯_(ツ)_/¯

weak parrot
#

K

low rivet
#

so if u leaked your own discord user token, someone used it and abused, and your account got disabled, that's a good reason for a un-disable?

#

anyway bye :/

#

:kek:

heady zinc
#

f

low rivet
#

LOL

#

just block ez

weak parrot
#

.....

earnest phoenix
#

"do u know heruko has a function. . . to keep ur token safe"

uncut slate
#

why do you keep saying heruko

glossy sand
#

block them and be done with it

earnest phoenix
#

idk

heady zinc
#

ehh how could i block my fellow french

low rivet
#

still don't get why he blames others for leaking his own token when there's a bunch of guides that says not to and blames the people who warn him on his token being ab00sed

glossy sand
#

there's not a compelling reason to continue this Drama™

low rivet
#

ok haha bye

earnest phoenix
drowsy falcon
#

im using superagent api and it shows "await is not defined"

#

can someone help?

#

ok nvm

#

got it

weak parrot
#

👍

earnest phoenix
#

How much ram should I get for my server if my bot’s going to have the capability of playing music?

restive silo
#

oof

#

depends on how much servers it is on

#

but i guess 1GB should it be atleast

earnest phoenix
#

1gb would be okay with how many servers?

#

(Oh and I got an unlimited budget-I’m getting one from the school I’m attending)

restive silo
#

wait if your budget is unlimited take like 16gb or some shit

heady zinc
#

it depends on the lib too

#

if you use d.js take a 100GB server mmLol

#

if eris take a 1-2gb

restive silo
#

???

#

Paradox blobstop

#

you can edit the default d.js caching options and reduce that by 70% if you actuall need anyways

heady zinc
#

lemme meme alone

#

ffs

restive silo
#

but yea d.js takes more ram than eris ofc

#

👀 because it caches like everything HyperMegu

heady zinc
#

every ducking baguette in the world is cached zoomeyes

gusty topaz
#

D.js boats can run even with outages because they cache heartbeat events

#

And future messages

#

D.js is magic

uncut slate
#

d.js is trash

glossy sand
#

my eris bot has never gone down because of an outage before

uncut slate
#

same

restive silo
#

excuse me

#

could we not start that discussion in here

#

ty

uncut slate
#

fair

restive silo
#

also if discord is down how is your eris bot not ?!?!

#

is it connected to another discord server or what

uncut slate
#

I think he means as in, it recovered

restive silo
#

oh that

#

i mean my d.js bot also doesn't need any restart with an outage because i use the disconnect event Thonk

#

disconnect event emit => process.exit() => pm2 restarts

glossy sand
#

insane

restive silo
#

more like making actuall usage of events

heady zinc
#

doesn't d.js automatically reconnect

restive silo
#

it tries like 15 times and then stop to not spam

heady zinc
#

then why do you need to restart thonkku

restive silo
#

well the "stop" is permanent for that i could aswell just call .login() again but restart is esier when i use pm2 anyways

torn nebula
#

Why this not Working Now?

drowsy yarrow
#

-> sneekfeetch

torn nebula
#

?

earnest phoenix
#

Also, why add a interval?

torn nebula
#

ya i forgot to remove even
it still says something went err undifined

earnest phoenix
#

JS?

torn nebula
#

s

earnest phoenix
#

s?

torn nebula
#

yes

earnest phoenix
#
Language: JavaScript
Library: Discord.js
Note: client variable may be different for you
Code:
// Default modules :^)
const { stringify } = require('querystring');
const { request } = require('https');

const update = () => {
  const data = stringify({ server_count: client.guilds.size });
  const req = request({
    host: 'discordbots.org',
    path: `/api/bots/${client.user.id}/stats`,
    method: 'POST',
    headers: {
      'Authorization': 'API TOKEN',
      'Content-Type': 'application/x-www-form-urlencoded',
      'Content-Length': Buffer.byteLength(data)
    }
  });
  req.write(data);
  req.end();
};

client.on('ready', update);
client.on('guildCreate', update);
client.on('guildRemove', update);
torn nebula
#

Hmm so Sneekfecth Don't work?

earnest phoenix
#

Not that I know

gusty topaz
#

waaait

#

x-www-form-urlencoded?

earnest phoenix
#

Just do it the way it has it there

#

Lol, idk I use that to do my server count

gusty topaz
#

change content-type to application/json

#

you dont need content-length

#

and dont stringify data

torn nebula
#
  snekfetch.post(`https://discordbots.org/api/bots/stats`)
    .set('Authorization', 'YOUR DISCORDBOTS.ORG API TOKEN')
    .send({ server_count: client.guilds.size })
    .then(() => console.log('Updated discordbots.org stats.'))
    .catch(err => console.error(`Whoops something went wrong: ${err.body}`));

this works or not?

gusty topaz
#

yes

torn nebula
#

this Not Working what Wrong in this

gusty topaz
#

maybe change this.client.guilds.size

#

to the reference of your guild amount

torn nebula
#

no client will be undifiend

gusty topaz
#

I said

#

CHANGE IT TO YOUR REFERENCE

#

also

#

what error are you getting

torn nebula
#

Undefiened

gusty topaz
#

idunno

torn nebula
#

ok np Thx

#

Fixed

mental geyser
#

I am trying to update my discord.js version and I am hosting my bot on Heroku

#

How would I do this

worn ridge
#

Does anyone know how to make the bot 'watching' something (in python)

drowsy yarrow
#

yes it was removed from the docs

#

it will be removed from the API soon I suggest not using it

worn ridge
#

Oh ok, thx

scenic crest
#

@worn ridge watching has activity type ID 3

#

but yeah use at your own risk

worn ridge
#

👍

upper pumice
#

Guys , can anyone help me? When my bot say @here he dont mention everyone. OBS : Im using eris.

worn ridge
#

Try <@here>

drowsy yarrow
#

Just fucking mention @everyone already

worn ridge
#

I think you have to use @stuck marsh (channel id)

upper pumice
#

Hmmm

#

Let me try

#

No :/

worn ridge
#

Did you try <@here>?

upper pumice
#

It was this

#

yes I tryed

languid dragon
#

eris has a disabled everyone/here feature

#

another dev was having the same issue, im not sure how you enable it tho so, yeet

worn ridge
#

Maybe try this <@&id>

heady zinc
#

you can enable everyone and here within the constructor

#

or override the default settings in the parameters that createMessage() takes

drowsy yarrow
#

ouch my eyes

heady zinc
#

fuck your eyes tbfh

drowsy yarrow
#

no u

heady zinc
#

oof

#

oh well i guess

#

@upper pumice pong ^

versed cliff
#

need help ! :('invalid syntax', ('/home/maxguest2002/Documents/Bot/cogs/natsu.py', 76, 24, ' await client.send_message(message.channel, "📨 Help as been send in Private you can go check!")\n'))

#

python 3.6

zealous veldt
#

please use code blocks when sending code

versed cliff
#

is diponible on ubuntu ?

earnest phoenix
#

how do i make a timer like after this time do this?

zealous veldt
#

what language?

earnest phoenix
#

js

glossy sand
#
setTimeout(someFunction, 1000);
#

takes a function and a number of milliseconds

#

yes, functions in the global scope are bad, but that's js for you

earnest phoenix
#

ummm

#

I'm finally changing my bots name

#

xD

#

this is gonna be wrong but this?
client.user.setPresence({ game: { name: `D-help | ${client.guilds.size} servers`, type: 0 } }); setTimeout(, 1000); client.user.setPresence({ game: { name: `hi`, type: 0 } });

glossy sand
#

yes that's absolutely wrong

earnest phoenix
#

Are you trying to change the presence after a certain amount of time?

glossy sand
#

setTimeout runs the callback you pass it asynchronously

earnest phoenix
#

yes

glossy sand
#

it doesn't actually pause execution or whatever it is you're trying to do

earnest phoenix
#

Why not make an array of states for the presences, then make a counter = 0, if the presenses[counter] = 2, in your case, then restart it

#

makes no sense to me

#

That's not exactly how it is

#

And it's very easy

#

i dont mess with that sort of thing

#

Lol

#

Welp, I guess I can't help then xD

#

:(

inner jewel
#

also

#

you cant update it every second

earnest phoenix
#

ik

inner jewel
#

it's 5/60s

earnest phoenix
#

i want it to change every 5 mins

#

but idk how

#

1000 ms is 1 second

#

300000

inner jewel
#

5 * 60 * 1000

earnest phoenix
#

300000 is 5 mins

glossy sand
#

ok you probably want to use setInterval(func, time)

earnest phoenix
#

how

glossy sand
#

if you pass it a function and a number of milliseconds, it'll run that function every time milliseconds

earnest phoenix
#

i get that but the rest means nothing to me

glossy sand
#

what

earnest phoenix
#

idkIdk(idk, 300000)

#

thats what it look like to me

glossy sand
#

setInterval is a function on the global scope

#

it accepts two parameters

#

the first is a function

#

the second is a number

earnest phoenix
#

how do i use it

glossy sand
#

when you call it, it schedules a task to execute a function f every n milliseconds

#

for parameters setInterval(f, n)

earnest phoenix
#

so setIntercal(client.user.setPresence({ game: { name: D-help | ${client.guilds.size} servers, type: 0 } }), 300000)

#

idk

rough pelican
#

intercal lel

#

xd

earnest phoenix
#

im bad

glossy sand
#

no that won't do at all

#

do you know how to define a function lol

earnest phoenix
#

no

#

i dont

glossy sand
#

uhhhhhhhhhhhhh

#

you just go

#
function() {
    // some code here or something
}
earnest phoenix
#

:(

glossy sand
#

that's called a "function expression"

hushed oyster
#

do you know how to code

glossy sand
#

it's a literal that produces a value of type function

earnest phoenix
#

0-0