#development

1 messages ยท Page 348 of 1

shrewd field
#

Jk

languid dragon
umbral pelican
languid dragon
#

When you actually read your code how I displayed above, if you genuinely put effort into making ur code clean and readable, you'd find that you'll actually find the mistakes you make.

You come to #development expecting people to just point out your silly mistakes so you can continue on to the next thing?

trim steppe
#

Please install eslint, and validate that you have no errors before posting here

#

If you post any more code that is easily noticed and can be easily fixed there will be consequences

tawny lava
#

he's actually banned from most servers cuz of that

barren brook
#

I have a question,Im a bigginer scripter and I watched a video but it confused me can you help?

languid dragon
#

What lang?

barren brook
#

JavaScript

languid dragon
#

1 moment

barren brook
#

Ok

languid dragon
#

http://nodeguide.com/beginner.html
https://nodejs.org/en/
https://developer.mozilla.org/en-US/docs/Web/JavaScript
https://discord.js.org/#/
Here are some common documentations and guides to get you started

  1. Start with figuring out Node.JS (you need that to run any server-side javascript)
  2. Head over to Discord.JS to see how you can use Javascript to interact with Discord API
  3. If you're not too sure about how to code at all, go to the official documentation and/or look up basics on Javascript for help to get started.
barren brook
#

I know how to use node.JS and discord.js

#

But with node.JS I have trouble

languid dragon
#

I have a question,Im a bigginer scripter and I watched a video but it confused me can you help?

#
  1. You gave me no context
  2. I have no idea what you're having trouble with
  3. ????????
barren brook
#

Ok so I watched a video but it confused me and it's about putting commands in a bot

restive silo
#

I know how to use node.JS
But with node.JS I have trouble
WaitWhat

umbral pelican
languid dragon
#

You're still being extremely vague.

barren brook
languid dragon
#

Ok so I watched a video but it confused me and it's about putting commands in a bot
Still doesn't really tell me what your issue is lmao

barren brook
#

Ok so it put in a

#

Client id and stuf f and that's were it confused me

languid dragon
#

yeah, uh, still making no sense mmLol

barren brook
#

I have a Idea for you to understand

#

Watch the 10 min video?

#

Here

#

I'll DM it

restive silo
hardy lark
#

Question: Is the 0th shard entirely DM's or does it handle some private messages, too? Using Discord.py.

inner jewel
#

all DMs are handled only on shard 0

#
  • it has it's share of guilds too
hardy lark
#

^ That last part is what I was wondering. c:

#

I was wondering if it was only DM's or not. Thank you, Natan! โค

neon pasture
pseudo inlet
#

yo peeps im new to python i want to make an accurate ping command but i dont know how to

#

hlep

fervent goblet
#

measure the current time in ms

#

send typing to the channel

#

measure it again

#

turn both into ms with *1000

#

then do secondtime-firsttime

#

and then yo got ur ping

thorny hinge
#

So I have
delete require.cache[require.resolve('../commands/${cmd}.js')];
Trying to reload a command but it has no effect GWvictoriaNotLikeBlob

spiral trail
#

Can you host bots on Windows Vista? ๐Ÿ˜‚

#

@earnest phoenix Well, I have this shitty(sorry for my language) laptop from 2007, and it isn't doing in a good job
I think it mentioned something about out-of-date scripts?

#

lol

#

๐Ÿค” "doing in a good job" I need to work on my grammer, for real.

#

Anyways, back to my craptop thingy

#

JS

#

I did npm install Discord and all dat

#

Oh?

#

I also had to npm install cleverbot

#

I have it on the bot's file

#

Funny thing, my charger for my 2013 laptop works on the 2007 laptop! WOW, congrats modern technology!

#

ikr

#

Yes, I know

#

meh

#

I don't believe you

#

plugs out charger to be safe

#

Alright

#

I have it layying around somewhere

#

I am using a desktop now

#

I have three computers sitting here

#

My desktop is from this year, I think

#

was released in Aug 21st
I got it on Nov 12th

#

SyntaxERROR: Block-scoped declarations

@earnest phoenix

#

OH hell yeah

#

Kids Coding :p

vital lark
#

aw hell yea, is that Google I see? @earnest phoenix

crisp warren
#

why do people think coding is mix and matching blocks together

#

that's almost nonsense

vital lark
#

^

crisp warren
inner jewel
#

discord blocks scratch

crisp warren
#

Block them

vital lark
#

no u

crisp warren
earnest phoenix
#

Does anyone know how to set up a message collector?

#

@vital lark Also for a banmultiple command

vital lark
#

what

earnest phoenix
#

Like of course it would have filters

vital lark
#

I never used a message collector, so I don't know.

earnest phoenix
#

Your mention I mean

#

From befoorreee

#

On why I should use a forEach statement

#

:p

earnest phoenix
#

i wish i knew how to code

#

but i never got into it

#

i did learn some html and web stuff from a class tho

#

just basics, not much more

quiet bobcat
#

Watch some tutorials

crisp warren
#

from treehouse or udemy

fervent goblet
#

Yo in njs you don't have to assign a type to a variable right?

#

not like a var can only be a string

#

or only a random other thing

young cradle
#

Yes, you do not have to, unless you use strict or it is TypeScript

fervent goblet
#

fuck strict

#

I'm not gonna bully maself

#

xD

young cradle
#

strict can be useful if you know how to use it properly

#

But well, TypeScript exists, so there is no need to use it when there's something better

fervent goblet
#

fuck ts

restive silo
#

TS is usefull af

languid dragon
#
  1. With node.js in order to seperate a file into multiple files you need to use modules.
  2. You can require one module into another module by using const file = require('dir/to/file.js')
  3. The file should look as such:
module.exports = {
    something : "value",

    another : false,

    execute : function(){

        // do things here

    }

}
  1. The above is an object so you would call anything in here like file.something / file.another and/or file.execute()
  2. https://nodejs.org/api/modules.html
pulsar kestrel
#

what does the something and another thing mean?

languid dragon
#

so in a javascript object it has indexes and values

#

something, another and execute

#

are indexes

#

thats what you call on to get the values

#

"value", false and function()

#

so after including a module you'd call it with the variable "const file = require..."
"file.something" would = "value"

pulsar kestrel
#

Alright awesome, thanks a ton!

#
function(input) {
console.log(input);
}```
sinful meadow
#

message.channel.send

#

g.send(h)

#

functionname(message.chanel,"dsjadhsakjdsa")

thorny hinge
#

Any npm modules that can read times like "3h" "5m" etc?

sinful meadow
#

@thorny hinge

#

let g = new Date()
g.getHours()

#

kappa

thorny hinge
#

k

sinful meadow
#

did you not know of it

#

lmao

thorny hinge
#

So if someone says like $$remindme 3h whatever itll read the "3h"

sinful meadow
#

No

thorny hinge
#

Rip

slim solar
#

Please?

#

how is it done for when dude mm DM my bot it him that I can use the commands in DM?

north fog
#

i think it depends on the command handler otherwise on the lib you use

indigo sun
#

w

slim solar
#

@north fog discord.js

north fog
#

then I can't help you, I dont know discord.js and dont use js for bots ;/

slim solar
#

@north fog ok thanks you

#

how is it done for when dude mm DM my bot it him that I can use the commands in DM?

fervent goblet
#

ez

#

what lib?

quiet bobcat
#

What @slim solar

#

Do you mean to not make commands work in dms?

slim solar
#

@fervent goblet discord.js

#

@quiet bobcat yes

quiet bobcat
#

ezpz

slim solar
#

@quiet bobcat you can help me?

quiet bobcat
#

if(!message.guild) return;

crisp warren
#

How to make commands not work in dms

#

Return it right after if it is not dm

#

Inside a message event listener

quiet bobcat
#

Yes like on every command

slim solar
#

@quiet bobcat for help commands ?

quiet bobcat
#

What?

slim solar
#

No

#

@quiet bobcat thanks

#

YOU

#

I LOVE
UOU

quiet bobcat
#

If you want help commands to work then dont put it there

weak parrot
#

Lol

quiet bobcat
#

No problem lol

upper ember
#

I have little issue here, I am using Discordlist.org API, and about the server count, if bot don't share this info with discordbots.org it's write "undefind" how do I change it to "This bot not publish this info on Discordbots.org" for example?

north fog
#

replace it ยฟยฟ

languid dragon
#

what

elder brook
#

,

quiet bobcat
#

How do I see all of the guilds my bot is connected to?

#

Their names and ids

sinful meadow
#

Map them @quiet bobcat

quiet bobcat
#

Ok

hardy lark
#

Nvm. Just had to install from the GitHub repo

#

๐Ÿคท

shy rose
#

@thorny hinge by complete fluke i was about to make something like that as in was minimising discord to open atom if you find anything lemme know

topaz fjord
#
> register-scheme@1.0.0 install C:\Users\waa\Desktop\RPC\node_modules\register-scheme
> node-gyp rebuild


C:\Users\waa\Desktop\RPC\node_modules\register-scheme>if not defined npm_config_node_gyp (node "C:\Users\waa\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )```
#

anyone know why i get this

#

just started a new project

#

and when i try to install some npm packages it gives that

vital lark
#

How do I make a stream and make the stream listen to the voice channel?

wise nexus
#

for discord? @vital lark

#

what are you using to stream?

#

or you mean for the bot

#

ffmpeg

vital lark
#

ye

wise nexus
#

then something called node-opus

wise nexus
#
yumi.user.setActivity(`Version: ${yumi.currentCommit} | !y.Help`);
                    ^

TypeError: yumi.user.setActivity is not a function what is new setGame?

#

nevermind

#

discord js docs for the win

sinful meadow
#

its set presence lmao @wise nexus

tawny lava
#

Set activity is a thing too iirc

sinful meadow
#

See

#

no one uses that

#

lmao

wise nexus
#

presence didnt work for me

#

it was setGame

sinful meadow
#

Well no shit you have to give it a game @wise nexus

#

you cant just put setPresence("Succ a ducc")

#

Does anyone know about shards???

wise nexus
#

yumi.user.setActivity(Version: ${yumi.currentCommit} | !y.Help);
^

#

i changed setact to setgame and it worked

#

so its gucci

fervent goblet
#

Succ a dicc

#

and @sinful meadow what lang/lib?

sinful meadow
#

d.js

fervent goblet
#

what do you want to know about shards?

#

how to shard?

sinful meadow
#

I know that

#

But grabbing information on them

#

As in how many servers on 1 shard

fervent goblet
#

do u know how to grab that shard?

#

then you should be able to just use shard.servers

#

or .guilds

sinful meadow
#

i tried

#

guilds doesnt work

#

and

#

servers returns undefined

fervent goblet
#

shard.process.servers

#

try that

sinful meadow
fervent goblet
#

k idk then

#

xD

sinful meadow
#

rip

young cradle
#

@sinful meadow use the broadcastEval method

sinful meadow
#

Ive legit never messed with shards @young cradle

young cradle
#

You could literally search the docs for broadcastEval

#

<Client>.shard.broadcastEval();

sinful meadow
#

That doesnt help if ive never messed with it

#

xDDD

young cradle
#

You put a string inside it, it evals on every shard, returns a promise with an array of what each shard returned to you

#

Again, could read docs, and if did not understand, read it on d.js's repo

#

It's just an eval that is evaluated on each child process

sinful meadow
#

Ah

#

i see

crisp warren
#

w3schools vs Mdn

young cradle
#

For webdev or application development?

#

But well, in general, MDN. Webdev I personally prefer w3schools, but MDN

wise nexus
north fog
#

whats error ยฟยฟ

wise nexus
#

no it doesn't check wether or not a type of currency is available

#

it just doesn't excute

north fog
#

make an array with arivable currency's ยฟยฟ

wise nexus
#

rip

#

well

#

hjasdl'hjfklsdajf

#

i didnt think about that

north fog
#

๐Ÿ‘

wise nexus
earnest phoenix
#

ok

#

yea it has its own permission system with mongodb

#

and he called mongodb wrong

crisp warren
#

wtf

neon pasture
#

I need some help, I want all my tokens in a json file. How can I select them?

crisp warren
#

why are you using mongodb

neon pasture
#

using javascript

earnest phoenix
#

why do you not use mongodb

crisp warren
#

what do you mean select them @neon pasture

#

@earnest phoenix cuz it's useless? ???

neon pasture
#

take them out of the json file

crisp warren
#

ez

earnest phoenix
#

how else do you store data

#

other then terrable json files

neon pasture
#

ik, but it's just the same as normal?

crisp warren
#

if normal meaning requireing it from the file

#

yes

neon pasture
#

o lol

crisp warren
#

@earnest phoenix JSON isn't terrible

#

what do you mean storing data

#

wtf do you even store

earnest phoenix
#

it is for huge amounts of data which is constantly being querried

crisp warren
#

what do you store

earnest phoenix
#

shitloads of objects regarding gamedata and positioning of npcs ect

neon pasture
#

I have +100K rows in my database ๐Ÿ˜

fervent goblet
#

storing game data?

#

you're insane

#

thats useless

neon pasture
#

No, I have a level system

fervent goblet
#

and a waste of db space

earnest phoenix
#

why is it useless to save data

fervent goblet
#

saving the presence data is useless

neon pasture
#

it's not

earnest phoenix
#

^

neon pasture
#

you can use it to make better games

crisp warren
#

@neon pasture Just to clearfy

JSON

{
"bitchbot":"Mx.your.token",
"dembot":"Mz.another.token"
}

JS

client.login(require('./tokens.json').bitchbot)
earnest phoenix
#

bitchbot

#

thats bitchen

neon pasture
#

using eris :p

#

but thanks

earnest phoenix
#

bot.connect

#

then

#

lol

crisp warren
#

@earnest phoenix What are you storing in your Mongo

fervent goblet
#

^

#

lol

crisp warren
#

finnaly you got rid of your dumb nickname

#

@earnest phoenix What are you storing in your Mongo@earnest phoenix What are you storing in your Mongo@earnest phoenix What are you storing in your Mongo@earnest phoenix What are you storing in your Mongo@earnest phoenix What are you storing in your Mongo@earnest phoenix What are you storing in your Mongo@earnest phoenix What are you storing in your Mongo@earnest phoenix What are you storing in your Mongo

earnest phoenix
#

user data, position of units, position of ai's, values regarding strength of items in person backpacks ect

crisp warren
#

???

#

wtf

earnest phoenix
#

IT IS A GAME

crisp warren
#

o ur making a game bot

#

you didnt tell me

earnest phoenix
#

I DID

crisp warren
#

nope

earnest phoenix
crisp warren
#

oh i didnt see it

#

thats why i asked again

#

sorry

#

my bad

earnest phoenix
#

es ok

#

i still ly

crisp warren
#

:^)

#

you should use SQL isntead of Mongo cuz mongo dumb

earnest phoenix
#

sql dum

#

mongo bae

crisp warren
#

wtf

#

gtfo

earnest phoenix
#

i do alot of stuff in the mean stack which sort of created a bias

#

its bitchen

crisp warren
#

what lib do you use

#

discord.js?

#

going to tag u if u dont reply

#

@earnest phoenix ๐Ÿ“

#

@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“@earnest phoenix ๐Ÿ“

earnest phoenix
#

omg

#

eris

#

@crisp warren @crisp warren @crisp warren @crisp warren @crisp warren @crisp warren @crisp warren @crisp warren @crisp warren

crisp warren
#

fukkk

earnest phoenix
#

lol why fuk

#

i used discord.js for a long ass time

#

then moved to eris

#

because eris IS SUPERIOR

neon pasture
#

@earnest phoenix you are my man.

#

Eris is way better then discord.js

mighty barn
#

:o

earnest phoenix
#

heck yea it is

#

look at that memory and cpu usage

#

thanks eris

#

lysm

#

how dare you slander mongodb and then continue to use json files @crisp warren >:c

crisp warren
#

no one said i us json for database

#

i use sql

earnest phoenix
#

sql

#

SQL

#

nonsql superior

#

@crisp warren why is sql better then non sql like mongo

crisp warren
#

cuz

#

sometimes you cant explain something

earnest phoenix
#

mongo = bae

#

rest of MEAN stack = super bae

jovial grail
#

๐Ÿ’” angular, but I was with you until there

earnest phoenix
#

why

#

angular, sockets, and express with like handlebars = best site

jovial grail
#

react is the way for most folks these days, state flow = god

earnest phoenix
#

i need to look into react

#

i always have figured its something simlar to electron but i havent done much research into it

jovial grail
earnest phoenix
#

mk i will once i get home

#

i only recently began getting into web development like that, pretty much all my work has been with node and serverside scripts

#

been using handlebars, express, sockets, mongodb, and alot of html and css for small projects so far

fervent goblet
#

wtf?

#

react isn't similar to electron

#

how the hell did you get that idea

earnest phoenix
#

i dont know i just litterally never looked into it before

lethal sun
#

im devin a utility bot. what should i add

earnest phoenix
#

bot.on guildMemberAdd

#

k

#

cool

#

its callback is the member and guild

#

@earnest trout here plice

thorny hinge
#

How can I record a vc then write an mp3 and send it to the user in d.js?

earnest phoenix
#

U can't ๐Ÿ˜

lethal sun
sinful meadow
#

That can lead to bad things @thorny hinge

#

Just letting you know

#

And it can also be against the tos

lethal sun
#

theres a bot that records a voice channels then converts it to a mp3 files then sends the file to the usser

sinful meadow
#

Doesnt matter

#

If the user doesnt not give consent on recording his audio

#

Or voice

#

its against the tos

fervent goblet
#

yeah

#

it shouldn't be done

thorny hinge
#

@sinful meadow the user is gonna use a command to start recording..

#

Then they get an mp3 of themself

sinful meadow
#

Doesnt matter still @thorny hinge

#

What if there is more then 1 person in the channel

#

And they dont give consent

thorny hinge
#

Shrug idk

#

Eh it's probably too hard anyways

fervent goblet
#

@woven echo is privacy invasion

lethal sun
#

^

scenic crest
#

it's offline

fervent goblet
#

ikr

#

shi๐Ÿ…ฑ๐Ÿ…ฑy ๐Ÿ…ฑoat

thorny hinge
#

I'll just scrap the vc record command GWbinMmlol

earnest phoenix
#

i write everything in jsfuck

#

:^)

#

(joking of course i dont actually write in jsfuck)

fervent goblet
#

u use brainfuck

#

aka my brain contents

earnest phoenix
#

jsfuck != brainfuck

sinful meadow
#

jsfuck !== brainfuck

#

fixed the code

#

lmao

earnest phoenix
#

if you want to be that strict parent i guess yea

thorny hinge
#

How can I reload a file? I wanna be able to reload commands in js. Im pretty sure mayo had a link but he got banned lul

sinful meadow
#

@thorny hinge

#

make it so it deletes the cached data of the file

#

then reaquires it

earnest phoenix
#

Delete cached data sonniboi ใ€Š3

thorny hinge
#

I tried it but it didnt work @sinful meadow

sinful meadow
#

rip

thorny hinge
#

Like it had no effect

earnest phoenix
#

Instead of requiring a file maybe just fs read it?

#

Vlearing require cache shouldve worked ๐Ÿค”

sinful meadow
#

fs reading is trash

earnest phoenix
#

where is the discord asm x86 library

sinful meadow
#

Ask tonkku

thorny hinge
#

So how do I reload the file? @sinful meadow

sinful meadow
#

1 sec

#

@thorny hinge

#

this

#

This is were i started

#

Scroll down to find it

#

then study it

thorny hinge
#

```delete require.cache[require.resolve(./commands/${command})];

```

#

thonk

sinful meadow
#

Thats just for deleting

naive stag
#

my bot is somehow offline in every server even though it is running, on startup it now does this even though it has worked with no code changes in the past for a long time..

Loaded data!
Saved Data!
18:29:53.705 [HttpClient@293122976-18] INFO sx.blah.discord.Discord4J - Websocket Connected.
18:29:53.726 [HttpClient@293122976-17] INFO sx.blah.discord.Discord4J - Shard 0 websocket disconnected with status code 1006 and reason "Disconnected".
18:29:53.730 [HttpClient@293122976-17] INFO sx.blah.discord.Discord4J - Beginning reconnect for shard 0.
18:29:53.732 [HttpClient@293122976-17] INFO sx.blah.discord.Discord4J - Performing reconnect attempt 0 for shard 0.
18:29:54.262 [HttpClient@40118552-32] INFO sx.blah.discord.Discord4J - Websocket Connected.
18:29:54.264 [HttpClient@40118552-30] INFO sx.blah.discord.Discord4J - Shard 0 websocket disconnected with status code 1006 and reason "Disconnected".
glossy sand
#

@naive stag have you recently updated your d4j version?

naive stag
#

no, I havent changed the jar for ~ a week and it worked up to today

quasi marsh
#

And what if you would try to update

#

1006 is a reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that the connection was closed abnormally, e.g., without sending or receiving a Close control frame.

#

I mean it does seem like a D4J problem

umbral pelican
#

might be cloudflare

quasi marsh
#

Than why would it only affect this one person's bot?

#

Sounds strange to me

umbral pelican
#

d.js had a similar issue a while ago iirc thonk

thorny hinge
#

It only takes up some

glossy sand
#

uhhh

#

literally width: 100%?

sinful meadow
#

@umbral pelican Do you know how to use regexp?

glossy sand
#

everyone knows regex

sinful meadow
#

i dont

glossy sand
#

then learn

#

it's a useful skill

sinful meadow
#

@glossy sand well could you help me lmao

glossy sand
#

maybe

sinful meadow
#

Im trying to make an anti invite link

topaz fjord
#

Please help me

sinful meadow
#

Annnd i wanna use regex

topaz fjord
#

I need help with rpc

umbral pelican
topaz fjord
#

It keeps saying invalid client id

glossy sand
#

(?:https?://)discord\.gg/[A-Za-z]+

#

or something

topaz fjord
#

But my client is is right :/

inner jewel
#
(https?://)?discord(app(\.|\s*?dot\s*?)com\s+?/\s+?invite\s*?/\s*?|(\.|\s*?dot\s*?)(gg|me|io)\s*?/\s*?)([a-zA-Z0-9\-_]+)```
glossy sand
#

that last character class

#

why not just use [\w\-_]

inner jewel
#

ยฏ_(ใƒ„)_/ยฏ

alpine vector
#

^ you should probably also change com\s+? to com\s* in case of whitespace

sinful meadow
#

How can i remove permissions from a channel

quasi marsh
#

Lang?

sinful meadow
#

d.js

quasi marsh
#

Then I can't help you

#

Sorry

#

Would this help?

#

Seems pretty easy

sinful meadow
#

Doesnt help

#

Im trying to remove not overwrite

quasi marsh
#

And if you'd send an empty options value?

sinful meadow
#

Tried

quasi marsh
#

Seems like it's JSON so {}

#

Ah

sinful meadow
#

does nothing

neon pasture
#

sql.all(`SELECT * FROM queues WHERE guild ="${msg.channel.guild.id}"`).then(row => { row.forEach(element => { return element.title; }); });
Why doesn't this work?

north fog
#

is the sql connection working ยฟยฟ

#

correct table name, correct colmn name ยฟ

stone kiln
#

^

north fog
#

btw, looking again to the code, it will return only 1 title, but the return is in a lambda (not sure if that works like you want it)

wise nexus
crisp warren
#

cool

scenic crest
#

why does java's regex parer stackoverflow

glossy sand
#

because it doesn't have proper tail recursion support

#

but i would think it's a symptom of your patterns being too complicated

fervent goblet
#
Output was:
Setup.wxs
C:\Users\jori\Desktop\dev\js\react\f2\builds\out\Setup.wxs(2) : error CNDL0108 : The Product/@Version attribute's value, '!(bind.FileVersion.justmaffies-todo-list.exe)', is not a valid version.  Legal version values should look like 'x.x.x.x' where x is an integer from 0 to 65534.
C:\Users\jori\Desktop\dev\js\react\f2\builds\out\Setup.wxs(2) : error CNDL0010 : The Product/@Version attribute was not found; it is required.
   bij Squirrel.Update.Program.<createMsiPackage>d__21.MoveNext()<---

System.Exception: Your package version is currently 1.0.0.0, which is *not* SemVer-compatible, change this to be a SemVer version number
   bij Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String packagesRootDir, Func`2 releaseNotesProcessor, Action`1 contentsPostProcessHook)
   bij Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean generateMsi, String frameworkVersion, Boolean generateDeltas)
   bij Squirrel.Update.Program.executeCommandLine(String[] args)
   bij Squirrel.Update.Program.main(String[] args)
   bij Squirrel.Update.Program.Main(String[] args)
#

no YOU can get aids

earnest phoenix
#

no more going online for color

#

!

mighty barn
#

ye lol

fervent goblet
#

lol

abstract mango
#

@fervent goblet it wants semantic versioning compatible stuff

#

change it to 1.0.0

fervent goblet
#

That says it must be x.x.x.x

#

4 nums

earnest phoenix
#

xxx

#

Same

vital lark
#

ip: xxx.xxx.xxxx.x

stone kiln
#

&&&

vital lark
#

?.?.?.?

vestal horizon
#

About to submit my bot to the bot list and am unsure of this Bot Prefix field. There aren't any commands to call on my bot so not sure how this is applicable to me. Maybe I'm misunderstanding this bot prefix field?

glossy sand
#

out of curiosity, what does your bot do?

vestal horizon
#

It's a secret word bot. So it's storing an array of secret words and it reads all messages sent to chat as it does it it's ticking a counter until the "secret word" is said. Once the secret word is said in chat it embeds a message saying "you said the secret word" and resets the secret word and counter.

#

It's based on all the secret words from Pee Wee's Playhouse

glossy sand
#

you ought to implement a help command of some sort

#

it's good practice

#

just in case someone wants to know what the bot is doing

vestal horizon
#

i suppose. in my mind i wanted the bot to be passive and not have people interact with it. it makes sense with the theme of the bot because you don't know the secret word so it should be a suprise when it's said.

fervent goblet
#

auto response to certain words

#

it won't get accepted

vestal horizon
#

why's that?

fervent goblet
#

annoying

vestal horizon
#

i get that but isn't up to the owner of the discords anyways whether or not they want the bot?

#

it only picks one word to auto respond to each time. you could break it by just posting all the words at once but isn't that the same as calling a bot over and over?

fervent goblet
#

well

#

auto responders, thats its only feature

#

seems useless to the mods here

vestal horizon
#

not break, i mean "cheat" it

fervent goblet
#

and it has unprefixed responses

#

unprefixed responses are a nogo

weak parrot
#

Well unprefixed responses do get muted in this server but they are allowed

#

So calling it a nogo is also not entirely true

vestal horizon
#

aren't the majority of bots submitted useless? how many music and anime generating bots does anyone need?

fervent goblet
#

okay

#

so redis has sadd

#

but how about sremove?

umbral pelican
#

srem

fervent goblet
#

oh srem

#

๐Ÿ˜ƒ

floral hill
#

hay all..
im locking for a clock bot , somthig intrntional. can u help me?

fervent goblet
#

I can help you learn english maybe

#

jesus

floral hill
#

@fervent goblet This is not my main language, I thought you would understand it alone, without explaining it.

#

jesus

fervent goblet
#

no I only speak english, dutch, sarcasm, meme and idiotic

floral hill
#

So how did you not understand it alone?

weak parrot
#

Nah he can just be a dick at times ignore it xD

floral hill
#

Now I'm using a translator to make it easy for you, it's ok ๐Ÿ˜ƒ

fervent goblet
#

u calling me a dick timo?

#

then I am at least your dick BlobAwkward

#

xD

weak parrot
#

Lol

fervent goblet
#

I'm starting to look like cf

floral hill
#

@weak parrot It's okay, not all of them were born with a basis for manners, can you help me?

fervent goblet
#

no he cant

#

he doesn't speak african either

weak parrot
#

Sadly no I don't know many other bots on the list

fervent goblet
#

a clock bot

#

could you explain more about it?

#

in english

vestal horizon
#

sounds like you're looking for a bot you can call to display the time from a specific time zone?

floral hill
#

I have a server with many people from all over the world. In order for us to coordinate events together we need a global clock or at least know what time each user has

#

@vestal horizon yes

fervent goblet
#

that would be too easy to integrate into a bot

#

well, if I have enough unique ideas for a bot I'm gonna make a new public bot

#

I'll count this as one

floral hill
#

@fervent goblet Why do I have a feeling that it will be something disturbed?๐Ÿ˜‰

fervent goblet
#

?

#

its gonna be a normal bot

#

which might slightly display my rick and morty addictions ๐Ÿ˜‡

quasi marsh
#

@vestal horizon you could have a setting that enables it per server

#

Don't know if your bot does anything else

vestal horizon
#

@quasi marsh sorry not sure i know what you mean

quasi marsh
#

Well, for the unprefixed responses

#

Allow to disable/enable them on a per server basis

#

So it could be disabled here

#

And enabled for someone who actually wants it

vestal horizon
#

unless you're cheating (typing every word from the secret word array) the bot the responses won't come up very often. it only chooses one word from the array to respond to at random.

elfin depot
#

would this work in my bot

neon pasture
#

@amitai007#7895 a reminder bot?

umbral pelican
#

bot dev role
asking if a copy pasted ping command will work

elfin depot
#

k

thorny hinge
earnest phoenix
#

so i started working on a chat application for a school project

#

need UI opinion

#

dm me if yar can

topaz fjord
#

rpc works bois

#

only took a day

#

or 6

earnest phoenix
#

does it work or work work

topaz fjord
#

click my name

#

and look at my profile

quasi marsh
#

I don't see anything

earnest phoenix
#

^

quiet bobcat
#

Can somebody help me? I'm trying to get uptime in hours, minutes and seconds. Any way to do that?

#

Im using discord.js

earnest phoenix
#

@quiet bobcat take a look at moment duration format bpk module

bitter sundial
#

client.uptime has the time it's been up in milliseconds
then just implement some math to calculate hours etc

earnest phoenix
#

Sorry, bpk = npm

quiet bobcat
#

ok

earnest phoenix
#

You can format what Thonkku said.

quiet bobcat
#

Yeah but how do I make it so it doesnt go over to one hour when only 30 minutes have passed

#

and how do I limit minutes to 60 and seconds to 60?

bitter sundial
#

use modulus

quiet bobcat
#

ok

sinful meadow
#

@quiet bobcat format them

#

for example client.uptime/1000

quiet bobcat
#

ok

bitter sundial
#

Math.floor((client.uptime/1000) % 60) will get you seconds

#

Math.floor((client.uptime/1000/60) % 60) minutes

#

Math.floor(client.uptime/(1000*60*60)) hours

sinful meadow
#

Why floor it? @bitter sundial

bitter sundial
#

well you dont want decimals right

sinful meadow
#

you could round it lmao

bitter sundial
#

that produces false results after .5

sinful meadow
#

True

#

Question what is days then @bitter sundial

#

???

#

shit

#

Math.floor(client.uptime/(1000*60*60*24))

#

?

bitter sundial
#

what about it

sinful meadow
#

Is that days?

bitter sundial
#

yea

#

but you then need to add % 24 to the hours to not let it overflow

sinful meadow
#

i totally guessed that lmao

#

Sooooo wait

#

This will auto fix?

#

1 sec

#

Soooo this Math.floor((client.uptime/1000/60) % 60)

#

It wont go over 60?

#

it will go back to zero?

bitter sundial
#

do you not know what a modulus is

sinful meadow
#

~facepalms~

thorny hinge
#

Lmao

sinful meadow
#

Nvm i was just having a derpy moment lmao

thorny hinge
#

If someone did like "tempban <user> 3h" how can I read the "3h" and change it to ms? Is there an npm package for that?

#

I can't seem to find one

sinful meadow
#

Nope you would have to make it

thorny hinge
quiet bobcat
#

I use a package called ms

#

It works fine for me

thorny hinge
#

It reads 3h 5m etc? @quiet bobcat

quiet bobcat
#

Think so

#

It atleast reads 3h

#

its if it reads 3h 5m

thorny hinge
quiet bobcat
#

It converts to ms

#

and converts from ms

#

so I guess

thorny hinge
#

Thanks man

quiet bobcat
#

np

next wedge
#

anyone can help me?

earnest phoenix
#

same thing on one of my bots

inner jewel
#

don't send photos of the screen

#

send code

next wedge
#

kk

#

๐Ÿ˜ข

#

Discord.ExecuteAndWait(async () =>
{
// lel rip bot XDDDDDDDDDD

             await Discord.Connect("TokeN xd", TokenType.Bot);
                Discord.SetGame("[type ~help I type ~webpage]");


            });
#

no errors but doesn't start ๐Ÿ˜ฆ

#

error code 4012

#

๐Ÿ˜ข

#

}); The ; part is red after the launch :(

#

๐Ÿ˜ญ

#

help pls

sinful meadow
#

idk

next wedge
#

D:

sinful meadow
#

Wait let me ask someone

#

@weak parrot

next wedge
#

O.K

sinful meadow
#

Hey babe we need you

next wedge
#

๐Ÿ˜‚

sinful meadow
#

Just wait he might come lmao

next wedge
#

k

weak parrot
#

What?

sinful meadow
#

He come lmao

#

@weak parrot @next wedge needs you

#

You know c# right?

weak parrot
#

Sorta I guess xD

sinful meadow
#

Well for a bot lmao

next wedge
#

:D

sinful meadow
#

@next wedge ask

next wedge
#

k

sinful meadow
#

Send the code also

#

lmao

next wedge
#

k

weak parrot
next wedge
#

``Discord.ExecuteAndWait(async () =>
{
// lel rip bot XDDDDDDDDDD

             await Discord.Connect("TokeN xd", TokenType.Bot);
                Discord.SetGame("[type ~help I type ~webpage]");


            });`` The `` ;`` part is red after launch and i get the error code 4012 :/
#

0.9.6

weak parrot
#

Hmm

next wedge
#

๐Ÿ˜ข

weak parrot
#

Cause the error is saying that the gateway version is no longer supported of invalid let me boot up one of my old 0.9.6 bots and see if I get the same if I don't get the same error I'll be able to help you more

next wedge
#

ok :)

#

yesterday my bot worked normaly but today im get this error code :/

weak parrot
#

Hmm

#

Well Discord.net 0.9.6 was supposed to get shutdown months ago but my old 0.9.6 bot also still ran fine so

next wedge
#

lol

weak parrot
#

Let me check if it still runs though

next wedge
#

:/

#

well i need to update?

weak parrot
#

A minute I just started up my server xD

next wedge
#

xd

#

invite me pls xd

weak parrot
#

No I meant like my server as in a PC

next wedge
#

oh k XD

#

๐Ÿ˜›

#

๐Ÿ‘Œ

weak parrot
#

Ugh this is taking long

next wedge
#

i have time :D Too many time

weak parrot
#

Welp mine starts up but it doesn't want to connect to the Discord gateway so I'd suggest you remake your bot in Discord.net version 1.0.2 or higher

next wedge
#

uh

#

:/

#

thx for the help

weak parrot
#

Sorry for the bad news but it seems like they really stopped supporting 0.9.6

next wedge
#

eh rip

#

xd

#

yes

#

yes

#

lot of erros now

#

:D

weak parrot
#

Yeah a lot has changed going from 0.9.6 to the newer versions

next wedge
#

yeah :/

#

๐Ÿ˜‚

quiet bobcat
#

How do I make multiple sub commands in one command? Like !example test

sinful meadow
#

#Args mate

quiet bobcat
#

ok thank you

sinful meadow
#

Args are the first thing that comes after a command @quiet bobcat

#

For example

#

d <==== Arg 1

quiet bobcat
#

yeah

#

@sinful meadow how do I check if arg 1 = test?

sinful meadow
#

if(args[1] === "codingsucksass"){ //DO SHIT} else { //DO OTHER SHIT }

quiet bobcat
#

alright

#

thank you

sinful meadow
#

You have to define args yourself

quiet bobcat
#

Yeah

sinful meadow
#

Its not default

quiet bobcat
#

Already defined

#

I defined it before

distant sparrow
#

@earnest phoenix

public class GuildCountUtil {
    public static void sendGuilds(JDA jda) throws IOException {
        String url = "https://discordbots.org/api/bots/" + jda.getSelfUser().getId() + "/stats";
        int serverCount = jda.getGuilds().size();
        //int shardId = jda.getShardInfo().getShardId();
        //int shardCount = jda.getShardInfo().getShardTotal();
        String query = "{\"server_count\": " + serverCount + "}";
        String token = jda.getToken();
        String charset = java.nio.charset.StandardCharsets.UTF_8.name();

        URLConnection conn = new URL(url).openConnection();
        conn.setDoOutput(true);
        conn.setRequestProperty("Accept-Charset", charset);
        conn.setRequestProperty("Content-Type", "application/json");
        conn.setRequestProperty("Authorization", token);

        OutputStream output = conn.getOutputStream();
        output.write(query.getBytes(charset));
        output.close();
    }
}
#

it's a modified version of one of the examples

#

oh

#

hm

#

that example uses the wrong thing for a token

#

<.>

#

that should maybe be removed from the #312614469819826177 channel since it's making people post their bot's token instead of the api token for discordbots

earnest phoenix
#

he meant token as in discordbots token

distant sparrow
#

no, look up in the code

#

it specifically does jda.getToken()

earnest phoenix
sinful meadow
#

Maybe he has his token as getToken()

#

lmao

#

Not his bots token

#

idk

distant sparrow
#

doubt it, that returns the bot's token

#

in JDA

sinful meadow
#

He could have made another function

#

Or something

distant sparrow
#

would be a hell of a coincidence

#

lol

earnest phoenix
#

I need help with my bot...
Ut is coded in JavaScript

It is a bot that posts random riddlesintothe server chat and the first person to guess the correct answer wins!
Here is the starting code but it keeps coming up as my name being tagged because of message.reply...

//Riddle List:
var riddlelist = {
  "riddle" : "What goes up but never comes down?",
  "answer" : "Age",

  "riddle" : "Testing?",
  "answer" : "Yes"
}

//Riddle One
if(command==="riddle") {
  var randomriddle = riddlelist[Math.floor(Math.random() * riddlelist.length)];
  return message.reply(randomriddle)
}
#

wait toString maybe? hmm

sinful meadow
#
var riddlelist = {
  "What goes up but never comes down?",
 "Age",
 "Testing?",
 "Yes"
}

#

lmao

#

The string that is extra is useless

earnest phoenix
#

oh

distant sparrow
#

I'm confused now.. I'm definitely using the correct key now for updating my bot's server count but it's still not displaying

earnest phoenix
#

No but theyare the answers to it

#

@sinful meadow yes but where would i put the answers to the riddle?

sinful meadow
#

No

earnest phoenix
#

?

quiet bobcat
#

@distant sparrow what lang?

distant sparrow
#

Java

#

using JDA

quiet bobcat
#

ok

#

dont know then

distant sparrow
#

lol

#

working now

quiet bobcat
#

ok

inner jewel
earnest phoenix
#

Anyone please?

sinful meadow
#

Hey i dont know i dont fuck with a shit language @inner jewel

inner jewel
#

[] not {}

earnest phoenix
#

oh okay

inner jewel
#

@earnest phoenix

earnest phoenix
#

thank you:)

inner jewel
#

{} = key/value pairs
[] = list

earnest phoenix
#

Everything else correct?

#

Other than that syntax?

#

Whatever it is

inner jewel
#
const riddleList = [
    {
        riddle: "...",
        answer: "..."
    },
    {
        riddle: "...",
        answer: "..."
    }
]```
earnest phoenix
#

Oh okay thank you lmao

#

Would that work for a JSON file too? If i require it?

inner jewel
#

yes

earnest phoenix
#

Alrighty cheers ๐Ÿ˜ƒ

earnest phoenix
#

Is it possible for me to find a riddle API that i could use instead?

elfin depot
#
if (message.content.startsWith(prefix + 'ping')) {
    message.channel.send('Pinging...').then(sent => {
        sent.edit(`Pong! Took ${sent.createdTimestamp - message.createdTimestamp}ms`)
    } else```
#

why am i getting this error

languid dragon
#

Because you're missing a ) after argument list

#
  1. You haven't closed off your .then
  2. the sudden "else" makes no sense, unless you cut half your code
  3. As the SyntaxError suggests, after } you need ) HMMM
elfin depot
#

it works

languid dragon
shrewd field
#

hey

#

does anyone know why do I get this error

#
{ DiscordAPIError: Cannot send an empty message
    at item.request.gen.end (C:\Users\Win\Desktop\github\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:71:65)
    at then (C:\Users\Win\Desktop\github\node_modules\snekfetch\src\index.js:218:21)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  name: 'DiscordAPIError',
  message: 'Cannot send an empty message',
  path: '/api/v7/channels/374201746462998528/messages',
  code: 50006 } Promise {
  <rejected> { DiscordAPIError: Cannot send an empty message
    at item.request.gen.end (C:\Users\Win\Desktop\github\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:71:65)
    at then (C:\Users\Win\Desktop\github\node_modules\snekfetch\src\index.js:218:21)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  name: 'DiscordAPIError',
  message: 'Cannot send an empty message',
  path: '/api/v7/channels/374201746462998528/messages',
  code: 50006 } }```
#

because I don't get anything it says

languid dragon
#

Lmao

#

It says

#

You cant

#

Send an empty

#

Message

#

Its not rocket science

shrewd field
#

ok

#

this is my code

#
  let clean = text => {
        if (typeof (text) === "string")
            return text = text
                .replace(/`/g, "`" + String.fromCharCode(8203))
                .replace(/@/g, "@" + String.fromCharCode(8203))
               
        else
            return text;
    }
    if (message.content.startsWith(prefix + "eval")) {
      if(!message.author.id === message.guild.ownerID) return;
        try {
            let code = args.join(" ");
            let evaled = eval(code);

            if (typeof evaled !== "string")
                evaled = require("util").inspect(evaled);

            message.channel.send(clean(evaled), {
                code: "xl"
            });
        } catch (err) {
            message.channel.send(`\`ERROR\` \`\`\`xl\n${cted}`)
}
message.channel.send("hi")
}```
#

how is this empty

languid dragon
#

Clean(evaled) probs

shrewd field
#

so

#

what is the fix then

#

or

#

where could i put a message

languid dragon
#

I know a good fix for that

sinful meadow
#

Ken

languid dragon
sinful meadow
#

Do you remember the download for the discord developers version? @languid dragon

languid dragon
#

Yes i do

sinful meadow
#

That doesnt help

#

Lmfao since you cant really find it

languid dragon
#

If theres a download link on the internet

#

You can find it with google

sinful meadow
#

Nope

languid dragon
#

Yep

sinful meadow
#

Not when its hidden

languid dragon
#

I fucking guarantee if i got up and googled it

#

Id find it

mighty barn
#

Then How's anyone supposed to find it

sinful meadow
#

Nope go ahead and try @languid dragon

#

If you find it let me know

languid dragon
#

Its 1am

sinful meadow
#

But ive searched

languid dragon
#

Search harder mmLol

#

@sinful meadow try googling discord public test builf

#

Build*

sinful meadow
#

i dont want the damn test build lmfao

languid dragon
#

Where exactly did you hear of this version?

sinful meadow
#

I saw it a looooong time ago in this chat

languid dragon
#

Donuts screenshot lmao?

sinful meadow
#

Someone posted a link to it

#

and now i cant find it

languid dragon
#

Right

inner jewel
sinful meadow
#

Already got it lmao

#

Great timing lmao

sinful meadow
#

@weak parrot Hey mate

#

mind helping me?

weak parrot
#

What do you need help with?

sinful meadow
#

Im doing this c# thing

#

and im wanting to make a list view

#

and it to add or display the text of a guild i have selected with a dropdown menu could you help me?

weak parrot
#

Wait what exactly do you mean? Like a menu you can search trough? Or just list that shows info?

sinful meadow
#

Like it has the drop down menu

#

of all the guilds

#

and i can choose a channel

#

and send a message in it

weak parrot
#

Well I do know how to make a list that shows all guilds but for channels in those guilds and how to send messages to em is something I have never tried

#

I do have a server with other C# developers though I have no idea if they have any experience doing this either I do know CF and DeStilleGast might have something like that

sinful meadow
#

@weak parrot

#

How can i add all the guild names to a list??

#

I tried this

#

and it doesnt work

#
            foreach (var Guild in Client.Guilds)
            {
                //metroComboBox1.Items.Add(Guild.Name);
                richTextBox1.AppendText(Guild.Name + "\n");
            }
#

i tried both

weak parrot
#

Welp I'm not behind my computer so I can't check the methods

sinful meadow
#

rip

weak parrot
#

@stone kiln can you help him?

stone kiln
#

i got tagged?

sinful meadow
#

Yea can u help me

#

๐Ÿ˜›

stone kiln
#

give me a sec

#

gonna try to think how it was again out of my head

#
        [OwnerOnly]
        public async Task ListServers(int page = 1)
        {
            page -= 1;

            if (page < 0)
                return;

            var guilds = await Task.Run(() => _client.Guilds.OrderBy(g => g.Name).Skip((page) * 15).Take(15)).ConfigureAwait(false);

            if (!guilds.Any())
            {
                await ReplyErrorLocalized("listservers_none").ConfigureAwait(false);
                return;
            }

            await Context.Channel.EmbedAsync(guilds.Aggregate(new EmbedBuilder().WithOkColor(),
                                     (embed, g) => embed.AddField(efb => efb.WithName(g.Name)
                                                                           .WithValue(
                                             GetText("listservers", g.Id, g.Users.Count,
                                                 g.OwnerId))
                                                                           .WithIsInline(false))))
                         .ConfigureAwait(false);
        }

is how i have it @sinful meadow

sinful meadow
#

any more of a basic version lmfao

#

Since all im trying to do is add it to a lable/richTextbox

stone kiln
#

let me think

vital lark
#

`varc

stone kiln
#
         public async Task ListServers(int page = 1)
        {
            var guilds = await Task.Run(() => _client.Guilds.OrderBy(g => g.Name)

            await Context.Channel.EmbedAsync(guilds.Aggregate(new EmbedBuilder().WithOkColor(), (embed, g) => embed.AddField(efb => efb.WithName(g.Name)
        }```
#

@sinful meadow how is that

#

@vital lark this is csharp not JS

vital lark
#

idc

#

var sucks

sinful meadow
#

for some odd reason i cant use async and await @stone kiln

stone kiln
#

oh right

vital lark
#
exports.run = async(additions) => {

}
stone kiln
#
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;

namespace BotNameGoesHere.Common
{
    public class AsyncLazy<T> : Lazy<Task<T>>
    {
        public AsyncLazy(Func<T> valueFactory) :
            base(() => Task.Factory.StartNew(valueFactory))
        { }

        public AsyncLazy(Func<Task<T>> taskFactory) :
            base(() => Task.Factory.StartNew(taskFactory).Unwrap())
        { }

        public TaskAwaiter<T> GetAwaiter() { return Value.GetAwaiter(); }
    }

}```
vital lark
#

EW

stone kiln
#

@sinful meadow you need to do that

vital lark
#

Java is betterโ„ข

stone kiln
#

...

#

pls go

vital lark
#

no

stone kiln
#

@sinful meadow and when you have done that in the list command do

using BotNameGoesHere.Common;
// rest of code
vital lark
#
using MyAss.Category.Common;
```did I do it right master @stone kiln
stone kiln
#

depends if you have the file listing specified

elfin depot
#

why am i keep getting this error

glossy sand
#

presumably you don't have a module called "return-deep-diff" installed

#

@elfin depot well first of all, you can start by not DMing me unsolicited

elfin depot
#

yeah that was the problem

glossy sand
#

second of all, you can learn how npm works

elfin depot
#

thx @glossy sand

#

i got it

#

it worked

#

now this error

#

wtf

glossy sand
#

ok obviously you just cloned someone else's bot and have no idea how to use it

#

am I correct in this assumption?

earnest phoenix
#

How would I compare a created_at attribute to see which one is older in discord.py?

glossy sand
#

@earnest phoenix I would assume it's a datetime object

elfin depot
#

its not cloned

#

im watching tutorils

glossy sand
#

I mean if you followed it exactly and your code doesn't run, it must be a faulty tutorial

elfin depot
#

@glossy sand can u still help me

glossy sand
#

npm install --save discord.js

elfin depot
#

okay

#

IT WORKED!

#

THX @glossy sand

vital lark
#

god

undone plover
#

how would I split up a message say if its more than 2000 character? (please tag me in ur responce)

vital lark
#
if (thing.length > 2000) {
   // code
}```
#

thing is the variabled placed by []

#

like args

glossy sand
#

@undone plover you could create an array, loop through each 2000-char block of your message text and append the blocks to the array, then send each element of the array in sequence

#

the only problem is that you might end up breaking the message text somewhere awkward like mid-word

#

but breaking words is nontrivial so I'm not gonna go into that

undone plover
#

that seems like way more complicated then it has to be

inner jewel
#

split on spaces

glossy sand
#

suppose it's a >2000 char message with no spaces in the first 2001-character block

vital lark
inner jewel
#

then: (pseudocode) length = 0 s = "" strings = [] for(word in words) { if(length + word.length + 1 > 2000) { strings.push(s); s = "" length = 0 } length += word.length s += word + " " } if(s.length > 0) strings.push(s)

glossy sand
#

that doesn't work if you happen to have a 2001 char word

gilded blaze
#

bot.user.setPresence({ game: { name: "test ~~ " + Version, type: 3 }, })
why does this still show playing

vital lark
#

It's probs not implentated to Discord.js yet.

#

ask Hydra Wink

gilded blaze
#

rip

elfin depot
#

what am i doing wrong here

vital lark
#

it's .send()

#

.sendMessage() isn't used anymore.

rich kiln
#

@vital lark well it wouldnt return a error

vital lark
#

@rich kiln .createMessage() is Eris, .send() is discord.js

rich kiln
#

channelid isnt defined :^)

vital lark
#

@elfin depot is channelid defined?

rich kiln
#

@vital lark i used to use djs.

vital lark
#

ok

rich kiln
#

sendMessge wouldnt return a error.

elfin depot
wise nexus
#

for discord js its bot.channel.send

elfin depot
#

new error

wise nexus
#

its .then

elfin depot
#

k

vital lark
#

@elfin depot Defined channelid

#

it's in the fucking code

#
bot.channels.get('325648177178869760').send('message'); // 325648177178869760 is mod-log here.
elfin depot
#

then is getting me a error

wise nexus
#

show output

elfin depot
wise nexus
#

lol

#

do you

#

omg

vital lark
#

Define bot

#

bot is your Discord.Client()

elfin depot
#

k

#

wai

wise nexus
#

bot = new Discord.Client()

vital lark
#

it can be bot client self etc

#
const bot = new Discord.Client();
elfin depot
#

client.on('guildMemberAdd', member => { let guild = member.guild; client.channels.get('383355658705305620').send(Please welcome ${member.user.username} to the server!); });

#

better

wise nexus
#

if bot was replaced by client then yes

elfin depot
#

so will that work now

wise nexus
#

it should

elfin depot
vital lark
#

It worked for tho

#

wait

wise nexus
#

same for me

quiet bobcat
#

I'm trying to make a guild list command for my bot. Anyone got any idea of how to do that?

vital lark
#

this was YumiBoat's old guildCreate event: ```js
bot.on('guildCreate', guild => {
postServerStats();
try {
bot.guilds.get(${guild.id}).channels.find('name', 'general').createInvite({ maxUses: 5 }).then((inv) => {
bot.channels.get('358052869515116548').send(`
YumiBoat joined a new guild!

     \`Guild Name\`: ${guild.name}
     \`Guild Members\`: ${guild.memberCount}
     \`Guild ID\`: ${guild.id}
     \`Guild Owner\`: ${guild.owner.user.tag}
     \`Now at\`: ${bot.guilds.size}
     \`Invite\`: https://discord.gg/${inv.code}
  `);
});

} catch(e) {
bot.channels.get('358052869515116548').send(`
YumiBoat joined a new guild!

     \`Guild Name\`: ${guild.name}
     \`Guild Members\`: ${guild.memberCount}
     \`Guild ID\`: ${guild.id}
     \`Guild Owner\`: ${guild.owner.user.tag}
     \`Now at\`: ${bot.guilds.size}
     \`Invite\`: \`${err.name}:${err.message}\`
  `);

}
});