#development

1 messages · Page 741 of 1

modest maple
#

yh that aswell

vital lark
#

C# or C++

modest maple
#

mostly C languages tbh

peak bloom
#

like godot, love2d, etc

earnest phoenix
#

triple A titles are mostly cpp

peak bloom
#

ye

modest maple
#

cuz CPP is pretty much the basis for everything

#

and just about everything has it

grim aspen
#

like right now i'm working on a brick breaker like game on python with turtle

peak bloom
#

performance matters a lot in a game, that's kinda the main reason lol

modest maple
#

yh

earnest phoenix
#

unity is good but it's still not quite there with c#

modest maple
#

i mean in python i would use Pygame

earnest phoenix
#

it's not as performant as UE for example

modest maple
#

cuz of just its universal usefull ness

#

not for a large game

peak bloom
#

UE is so many leagues better than unity it's kind of absurd

modest maple
#

but for basic games it does fine

empty owl
#

how do I make my own screenshot app, i saw my friend using one that puts the pic under his website

modest maple
#

for what

empty owl
#

like basically instantly

modest maple
#

in waht language

#

xD

empty owl
#

idkk

earnest phoenix
#

just use sharex

modest maple
#

i mean you could do it in python

vital lark
#

you make a screenshot app by google how do i make a screenshot app and get redirected to sharex

earnest phoenix
#

your friend is also probably using sharex with a custom uploader

empty owl
#

oh

#

ok

late latch
#

Hello world.

modest maple
#

hosit

earnest phoenix
#

console.log('hello back');

trail reef
#

print(“Wassup?”)

unique nimbus
knotty steeple
#

this is epic

atomic quarry
#

(node:185) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit

earnest phoenix
#

@sick cloud make it randomize number placement every click

vital lark
#

@atomic quarry it's saying that you might get a memory leak

atomic quarry
#

Is there a way to fix it?

empty owl
#

why dont you use a command handler

#

@atomic quarry

atomic quarry
#

Uuuhhh the last time I tried that I fcked up my code and had to cmd+z alot

empty owl
#

you are using client.on 11 times?

earnest phoenix
#

oh! i guess you learned javascript and came back!

modest maple
#

Welcome to why you don't copy and paste

vital lark
#

@earnest phoenix wdym Thonk

modest maple
#

We told him to go away and learn js

empty owl
#

lol

modest maple
#

After his 'bot code'

empty owl
#

but use a if statement

modest maple
#

Was just copy and pasted that we found the original tutorial of

earnest phoenix
#

^

empty owl
#

oof

#

thats an actual working command handler

earnest phoenix
#

sugma

modest maple
earnest phoenix
#

printf requires a format string @white cobalt i believe

white cobalt
#

Hey, i have small problem with my discord bot (.js) im running on Linux

I have command what plays music and it worked before, but now but just ignores that he should play music and then about 1 minute later leave server

#

No errors btw does anyone know?

vital lark
#

what

sick cloud
#

@earnest phoenix it's a school thing smh

earnest phoenix
#

@sick cloud is it electron?

sick cloud
#

no it's not

#

it's python

earnest phoenix
#

o

amber fractal
#

Yo on d.js, is there any way to get a regular status and not the custom status? I'm trying to see the user's activity.type, but it's undefined as it gets the custom status on d.js master

earnest phoenix
#

this custom status thing is breaking almost all libs since statuses are now supposed to be interpreted as lists/arrays lol

amber fractal
#

lol

#

But I can make a request myself and get the data myself then still right?

#

I'll look into it but thanks

atomic quarry
#

// User's message will be deleted after 1500ms
handler.onCommand("?t").deleteInvocation(1500).then((message) => {
message.channel.send(@everyone [T] Training! Come to the Training Center for a chane at a Promotion!! https://www.roblox.com/games/4368863292/Mano-County-Training-Center);
});

#

would that work?

earnest phoenix
atomic quarry
#

Wow

fluid basin
#

@amber fractal its seems to be a websocket event so I think you might need to modify the library

amber fractal
#

I'm making a custom request

#

You mean presence update dont you

fluid basin
#

yeah I suppose

earnest phoenix
#

presence is ws only

#

unfortunately

amber fractal
#

Ah

#

That's kinda feelsbad

#

Well I guess I can modify the library

earnest phoenix
#

there's been an issue open on discord api docs for ages to make the api return the presence in rest requests

#

but discord devs are discord devs

#

so fuck the community we need money

amber fractal
#

@zealous veldt

zealous veldt
gilded plankBOT
#

🤐 Muted uchiha_Itamar#9302 (@little totem)

tacit stag
#

how do i send friend request as the bot in discord.js

sudden geyser
#

you don't

vital lark
#

you can't

tacit stag
#

okay. so no way to friend my own bot?

amber fractal
#

not anymore

tacit stag
#

oof

earnest phoenix
#

@earnest phoenix thats a very high effort meme

tacit stag
#

Question: in discord.js, i am using fs.readdir to run files in my designated "./commands" folder. I have tried using fs.writefile within these commands, but it never seems to write to that file, whereas it does within my main 'index.js' file.

#

is there a way i can run fs.writefile within my command files? I can provide my code if needed

vital lark
#

what

#

I don't get what you mean

tacit stag
#

i guess i will provide code, sorry for the lengthy explanation

#

This is in my index.js file, which reads my directory ('./commands'), and allows the commands (and aliases) to be used later

fs.readdir(`./commands/`, (err, files) => {
  
  if(err) console.log(err);
  
  let jsfile = files.filter(f => f.split(".").pop() === "js");
  if(jsfile.length <= 0) {
    console.log(`\x1b[31m`,"[LOGS] Couldn't find Commands!");
  }
  
  jsfile.forEach((f, i) => {
    let pull = require(`./commands/${f}`);
    bot.commands.set(pull.config.name, pull);
    pull.config.aliases.forEach(alias => {
      bot.aliases.set(alias, pull.config.name);
    });
  });
});

Further in my code, it runs this command in the bot.on(message) event. (bot = client)

if(!message.content.startsWith(prefix)) return;
  let commandfile = bot.commands.get(command.slice(prefix.length)) || bot.commands.get(bot.aliases.get(command.slice(prefix.length)));
  if(commandfile) commandfile.run(bot, message, arguments);

This method allows me to run commands in a seperate folder for orginization, and is less messy.

Now, when the command runs, for some reason, using fs.writefile() to save data to a json file doesnt work

#

write file method, which works in my main file, but not in the command files:

fs.writeFile("../quotes.json", JSON.stringify(quotes), (err) => {
  if (err) console.log(err);
});
#

apologies for the lengthy code and explanation, i try to be thorough, but let me know if you have a question

earnest phoenix
#

${message.author.avatarURL} what am i doing wrong here

#

not even the author username works

#

async?

#

and yea how shall i get the files from stuffs like kick.js ban.js etc

surreal sage
restive furnace
#

2 min??????

surreal sage
#

yep...

#

#!help

#

#!ping

restive furnace
#
  • its starboard
#

not bot hell

surreal sage
#

fucking wait for it

#

ih

restive furnace
#

bruh but he wont answer here

surreal sage
#

ofc

surreal sage
#
 if (command === "eval") {
            if(message.author.id !== botConfigs.ownerID) return;
            let args = message.content.split(' ').splice(1).join(' ');
            let codemsg = args;
            args;
            console.log('executed: ', codemsg);
            message.reply("**You've executed the following code -->** ```" + codemsg + "```");
    };``` i got this but it does not execute `args`
vital lark
#

args is an array

surreal sage
#

how to fix

vital lark
#

maybe split it by ' ' using Array#join

surreal sage
#

where?

vital lark
#

oh wait

surreal sage
#

?

vital lark
#
            let codemsg = args;
            args; // remove this```
surreal sage
#
    if (command === "eval") {
            if(message.author.id !== botConfigs.ownerID) return;
            let args = message.content.split(' ').splice(1).join(' ');
            let codemsg = args;
            console.log('executed: ', codemsg);
            message.reply("**You've executed the following code -->** ```" + codemsg + "```");
    };```
vital lark
#

also what does the console say when you executed the command

surreal sage
#

Do i have to change anything

#

ye ofc

#

but where and how and what

vital lark
#

in let codemsg = args

surreal sage
#

so i have to do args()

vital lark
#

no

#

read the usage of what I linked you...

surreal sage
#

eval(args)?

vital lark
#

yes

surreal sage
#

lets test

#

with ; at end? lol

vital lark
surreal sage
#

gonna do ok

vital lark
#

preference if you wanna add semicolons

surreal sage
#

ye i do

#

great

#

thanks man

vital lark
#

no problem Salute

surreal sage
#

and im gonna do the eval later on the executed thing

#

Now it works!

#

yay?

#

is there a way to view the last message in the console

vital lark
#

wdym "last message"

surreal sage
#

like you saw youve executed blahblahblah, i want there the log of the command

#

so i did console.log(test)

#

ik ''

#

then it will show up the output in the message

#

in the `````````

vital lark
#

maybe it store it in a variable before your command code and fetch it from there?

surreal sage
#

message.channel.send(fetch.console) this or something?

iron gale
#

@quiet dome

#

@earnest phoenix

earnest phoenix
#

wuw

surreal sage
#

nvm

earnest phoenix
west drum
#

hmmm

earnest phoenix
#

Is having a website required for certification?

#

No

#

k thanks for telling me

surreal sage
#

Howwwww

#

@glacial mango

glacial mango
#

How what

surreal sage
#

the js

#

can u send that line

glacial mango
#

new line with text here```

#
new line with text here```
surreal sage
#

did not work

glacial mango
#

copy and paste

surreal sage
#

like this? if (command === "eval") { if(message.author.id !== botConfigs.ownerID) return; let args = message.content.split(' ').splice(1).join(' '); let codemsg = args; console.log('executed: ', codemsg); message.reply("**You've executed the following code -->**"); message.channel.send('```js' + codemsg + '```'); eval(args); };

glacial mango
sudden geyser
#

all you're doing is displaying your input

#

but not the output?

surreal sage
#

restarting rn

#

this is what comes with this

sudden geyser
#

Add a linebreak after ```js

surreal sage
#

gonna tr

#

shows error

#

/home/container/bot.js:576 message.channel.send('```js\' + ^^^^^^^^^^^ SyntaxError: Invalid or unexpected token at Module._compile (internal/modules/cjs/loader.js:721:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules

#

@sudden geyser

sudden geyser
#

You're escaping the end of a string

glacial mango
#

How do I add a letter (k) to a number?
So 6 will be 6k

sudden geyser
#

But a linebreak has a n after the backslash

#

Just do num + "k"

#

but you should know it's in that range

surreal sage
#
message.channel.send('```js\n' + codemsg + '```');``` this?
#

message.channel.send('js\n' + codemsg + '');

#

ops

sudden geyser
#

try it out and see

surreal sage
#

anyone knows how to get the code out of a txt file on the web? some http request

earnest phoenix
#

message.mentions.users.first().username stopped working for some reason

#

It was working before

sudden geyser
#

did you mention anyone

earnest phoenix
#

Yes

#

I did

sudden geyser
#

then what's specifically not working? are you getting an error?

earnest phoenix
#

Nooe

#

Nope

#

No errors

#

Nothing sends

sudden geyser
#

it's hard to help when having no context. Maybe it's something bigger than just that (e.g. problems with another file). Source code?

earnest phoenix
#

It happens to all the commands that has this
let user = message.mentions.users.first() || message.author;

#

And when i try to input user.username it doesn’t return anything

sudden geyser
#

then it may be something like your listener file. If you console.log(user) do you get a user instance?

earnest phoenix
#

Yes i do

sudden geyser
#

source code?

surreal sage
#

anyone knows how to delete the source message of a command?

User:
   !test
Bot: *removes "!test"* You just said test!```
mossy vine
#

message.delete()

surreal sage
#

im using it... hmmm

#

i was using js message.delete; lol

#

now message.delete();

grizzled raven
#

function

surreal sage
#

it works...

grizzled raven
#

so ()

surreal sage
#

but not in this server

#

(node:11) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions

#

thats the problem here

#

no prob in other server.

#

jsut fixed

late hill
#

Yes

surreal sage
#

just*

late hill
#

Maybe your bot is missing permissions in this server

surreal sage
#

it does

late hill
#

so it can't delete

surreal sage
#

(node:11) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions

late hill
surreal sage
#

i just said it before you said maybe missing perms

#

what will happen if i do proccess.exit() on a vps

mossy vine
#

the process wil exit..

surreal sage
#

and does not kill everything?

mossy vine
#

it kills the process

surreal sage
#

im gonna try..

modest maple
#

How bout

#

Reading the docs

#

And using try catch

#

🤔

mossy vine
#

if you dont have a process manager or something to restart it, it wont restart it

#

lol try catch

#

does anyone actually use that

surreal sage
#

yeah nothing special

#

executed: process.exit()
[Pterodactyl Daemon] Server marked as OFF
[Pterodactyl Daemon] ---------- Detected server process in a crashed state! ----------
[Pterodactyl Daemon] Exit Code: 0
[Pterodactyl Daemon] Out of Memory: false
[Pterodactyl Daemon] Error Response:
[Pterodactyl Daemon] Server process detected as entering a crashed state; rebooting.
[Pterodactyl Daemon] Server marked as STARTING
[Pterodactyl Daemon] Checking size of server data directory...
[Pterodactyl Daemon] Disk Usage: 21M / 1000M
[Pterodactyl Daemon] Ensuring file permissions.
[Pterodactyl Daemon] Running server preflight.
[Pterodactyl Daemon] Starting server container.
:/home/container$ node bot
[Pterodactyl Daemon] Server marked as ON

mossy vine
#

who wouldve thought

surreal sage
#

just restarts with my vps

#

just restarts my vps*

#

anyone knows how to refresh the status like: 1 min servers 1 min votes and repeat

#
client.on("ready", async function() {
    if (botConfigs.statusType === "PLAYING" || botConfigs.statusType === "WATCHING" || botConfigs.statusType === "LISTENING") {
        client.user.setActivity(botConfigs.gameStatus, { type: botConfigs.statusType });
    } else {
        client.user.setActivity(botConfigs.gameStatus, { type: "PLAYING" });
    }
});``` this is my code for it rn
mossy vine
#

read up on setInterval

earnest phoenix
#

@sudden geyser there are multiple commands that has the problem

sudden geyser
#

I tried it myself (on master) and it worked as expected. If you're getting a user instance, it's doing what's expected.

compact raft
#

i have made an bot but how to give commands

modest maple
#

Read the docs and learn the language

#

Problem solved

empty owl
#

@compact raft uh

#

u listen for a message

#

Filter the message if it starts with something

#

Then execute a certain action

#

That’s how

#

Also which oak

#

lan

compact raft
#

that one in discord application so

empty owl
#

Which

#

lang

compact raft
#

Just made nothing advance

empty owl
#

what

#

So what do you have now

compact raft
#

only bot who just look a bot do nothing

empty owl
#

Sooo it’s not even online

#

Right

compact raft
#

right

surreal sage
#

anyone has a guide or video to do a bugreport command/script?

empty owl
#

and learn a programming lang

#

@surreal sage you could get a args then send an args in another channel

compact oriole
#

@surreal sage Make it yourself lol

empty owl
#

simple one

surreal sage
#

ok sigh okookokokoko

compact oriole
#

Copy Pasta

empty owl
#

@surreal sage just grab a say command and tweak it

surreal sage
#

y ik

empty owl
#

ok

surreal sage
#

well i thought about webhooks

summer acorn
#

I don't get it

let UserIDrp = Object.keys(db.server.configs.rolePers[User.id]);
                        db.server.configs.rolePers[User.id] = UserIDrp.splice(i,1);
"rolePers": {
        "266162824529707008": [
          "0"
        ]
      }

That 0 was a role id before it got spliced
I know that splice modifies it, and I want to remove it.

empty owl
#

I don’t get it isn’t a question

compact oriole
#

@summer acorn You posted that already

#

Dont post it again lol

summer acorn
#

Yes, but I realized it was actually a channel for it.

#

Which I didn't see.

empty owl
#

What’s dB

compact oriole
#

Database

#

if im correct

empty owl
#

which

compact oriole
#

¯_(ツ)_/¯

empty owl
#

mm ok

summer acorn
#

Either way, my question is, why does that splice just change it to 0, I want the object gone.

#

And yes, db = database

empty owl
#

I don’t understand your code either

compact oriole
#

^

earnest phoenix
#

avoid using json files as a database

summer acorn
#

json works for me

compact raft
#

my bot id ```javascript
647689857166213134

summer acorn
#
} else if (addRemove.toLowerCase() === 'remove') {
                if (!db.server.configs.rolePers) {
                    db.server.configs.rolePers = {};
                }
                if (!db.server.configs.rolePers[User.id]) {
                    db.server.configs.rolePers[User.id] = [];
                }
                if (db.server.configs.rolePers[User.id]) {
                    for (i = 0; i < Object.keys(db.server.configs.rolePers[User.id]).length; i++) {
                        if (db.server.configs.rolePers[User.id][i] === role.id) {
                            let UserIDrp = Object.keys(db.server.configs.rolePers[User.id]);
                        db.server.configs.rolePers[User.id] = UserIDrp.splice(i,1);
                            //delete db.server.configs.rolePers[User.id][i];
                            fse.writeFile(`./databases/${message.guild.id}.json`, JSON.stringify(db, null, 2))
                            return message.reply(`Successfully removed ${role.name} as a permanent role from ${User.tag}`);
                        }
                    }
                }

Perhaps that will help understanding my code?

earnest phoenix
#

json files, or files in general, aren't meant to be used as a database

compact oriole
#

Json has data corruption, slowness as its getting bigger and so many problems

earnest phoenix
#

what is the best method to do a music bot in js

summer acorn
#

Well, it works for me.

compact oriole
#

It wont in some point xd

fluid basin
#

@earnest phoenix lavalink?

empty owl
#

Use sqlite

summer acorn
#

And besides, I do have backups in both the code and locally, in case anything corrupts.

earnest phoenix
#

ok

empty owl
#

ytdlcore?

fluid basin
#

or you can do the standard but buggy ffmpeg and opus

empty owl
#

There tutorials on yt I think

compact oriole
#

lavalink is probably best

summer acorn
#

Either way, my question isn't about the database, it's why splicing the last object just changes it to 0.

empty owl
#

What’s the og array

#

or string

summer acorn
#

The original array is blank until a role persist is added using a command.

earnest phoenix
summer acorn
#

So let's say, role ids

earnest phoenix
#

gonna check lavalink

fluid basin
#

@summer acorn yeah learn some JS tbh

earnest phoenix
#

I've aleready do one witth ytdl-core but it sucks

empty owl
#

what are you trying to do ? @summer acorn

summer acorn
#

I am literally using JS, and I checked that, but nothing on there said anything about the last object

#

I am trying to completely empty the array

fluid basin
#

yeah

#

ik

compact oriole
#

learn it

fluid basin
compact oriole
#

can you read @summer acorn

fluid basin
#

db.server.configs.rolePers[User.id] = UserIDrp.splice(i,1);

summer acorn
#

the array has 1 element, which then gets removed, the array will be []

fluid basin
#

look what I sent you

#

that img

empty owl
#

What are you even trying to do

summer acorn
#

An array containing the deleted elements. If only one element is removed, an array of one element is returned. If no elements are removed, an empty array is returned.

empty owl
#

So

fluid basin
#

An array containing the deleted elements.

empty owl
#

what are you trying to do

compact oriole
#

^^^^^^^^

fluid basin
#

db.server.configs.rolePers[User.id] = An array containing the deleted elements.

summer acorn
#

I want to remove the objects from the array

fluid basin
#

fp

summer acorn
#

I don't want the deleted elements

fluid basin
#

yeah

#

then dont add that equal

#

simple right?

#

its simple as this: UserIDrp.splice(i,1);

summer acorn
#

Oh wait, I think I see...

#

Well, I've not really used arrays to modify stuff, all the much. I mainly use objects like

"userid": {
"item1": {
"itemthing1": "data",
"itemthing2": "data"
},
"item2": {
"itemthing1": "data",
"itemthing2": "data"
}
}
#

So yeah, I am used to using delete to delete stuff

compact oriole
#

ok?

summer acorn
#

And I am pretty slow in my head, plus partly blind sometimes. So sorry if I caused any frustration.
Thanks for the help though.

empty owl
#

no problem

earnest phoenix
#

(lavalink)

surreal sage
#

how to disable a error log by a certain cmd

compact oriole
#

Glitch eww

earnest phoenix
#

@earnest phoenix do you have a lavalink server running

#

good idea

#

lavalink client is not a lavalink server

#

no i dont have

#

so i need one

#

well you need to

#

yes

surreal sage
#

how to disable a error log by a certain cmd

compact raft
#

hi

earnest phoenix
#

though a lavalink server plus a discord bot is probably too heavy for glitch

compact oriole
#

yea

#

glitch only has 1 port too

earnest phoenix
#

lavalink alone depends on JRE and hits 600mb+ ram usage

surreal sage
#

hello?

#

how to disable a error log by a certain cmd

earnest phoenix
#

you're annoying

surreal sage
#

for a certain*

earnest phoenix
#

stop repeating your question

surreal sage
#

stop skipping me

compact raft
earnest phoenix
#

bitch u aint in a queue lol

#

so i go to the classic but buggy ffmpeg opus

#

i think

compact oriole
#

We skip you because you're a fucking copy pasta kid who wants everything spoonfed

#

Stop asking

surreal sage
#

CDeveloper stepped in queue.

earnest phoenix
#

??????

#

lol

#

@earnest phoenix pretty much

#

using ffmpeg is still pretty heavy

compact oriole
#

Lavalink is the best option, in my opinion

earnest phoenix
#

if you can try to find native audio manipulation libs

#

but I don't have money for a vps

#

so...

#

I'm forced to use glitch

#

(I can't self host)

#

i avoid lavalink cause it's really badly optimized and slow as hell

surreal sage
#

is there a way to disable error logs or move them into a file?

fluid basin
#

but its rather stable imo

earnest phoenix
#

so

#

ytdl-core?

#

even if it sucks

#

and i avoid using ffmpeg because every time you need to run a new instance of the same base code

fluid basin
#

@surreal sage be more specific, what kind of error and why does those errors appear

earnest phoenix
#

ytdl core is just a package to get info on a youtube video

surreal sage
#

Well there is no error, If there comes a error i dont want it to show up or move the error into a file

fluid basin
#

also did they fix the ytdl-core bug yet

#

hmm

earnest phoenix
#

you still need something to process the data from ytdl core

surreal sage
earnest phoenix
#

handle your errors correctly

#

check if you can do x before doing x

empty owl
#

@surreal sage give ur bot admin in ur server

surreal sage
#

no not that

earnest phoenix
empty owl
#

ok

surreal sage
#

if there comes a error, i dont want it to show up

earnest phoenix
#

it's old

#

that's not the solution

fluid basin
#

@surreal sage try to look for where the error is happening, and wrap the code involved in a try...catch

restive furnace
#

discord.js-lavalink gut

surreal sage
#

idk much about catch statement

#

or what else

earnest phoenix
#

don't avoid errors and don't try catch them

instead do your best to prevent them

fluid basin
#

you could intercept all using process.on unhandledRejection method @surreal sage

surreal sage
#

well these are simple no permission errors

#

idk that thing

fluid basin
#

if they are simple

#

then find it

surreal sage
#

well nvm

#

then

earnest phoenix
#

hence why i said to check if you can do x before doing x

compact oriole
#

and do it yourself

restive furnace
#

try {
code
}
catch(e) {
console.log(e)
}

earnest phoenix
#

stop

#

try catching everything is not the solution

fluid basin
#

possibly happens when you try to DM someone without DMs on

#

or when you try to modify server/channel settings without enough perms

earnest phoenix
#

h

#

you're costing your memory because you're lazy instead of fixing the error

#

npm install discord.js ffmpeg-binaries opusscript ytdl-core --save

#

found this on a tutorial

#

try catch clauses put a lot more load than an if check

#

well, I'm gonna do that

restive furnace
#

at rn i have 0 try catch but 10 checks

#

xd

surreal sage
#

uhhh help

#

my page html frame does not load

compact oriole
#

Cant you do anything?

surreal sage
#

this

#
  1. button does not show up 2. some text does not
earnest phoenix
#

k newproblem

#

the bot assume that themusic is finished but it never started

#

joining-disconnecting the voice channel

#

fuck

#

either use markdown or html, i'm guessing the parser has a stroke and filters out some stuff @surreal sage

fluid basin
#

@earnest phoenix cuz everything is broken

#

thats why

earnest phoenix
#

I gave up

fluid basin
#

ytdl-core still broken?

earnest phoenix
#

ye

#

wait

#

my bot has play music commands

#

(deleted)

fluid basin
#

oh nice its fixed

#

ytdl-core isnt broken

earnest phoenix
#

but still in github repo

fluid basin
#

but there tons of broken stuff

earnest phoenix
#

skid

surreal sage
#

How to ban players from your bot.

Step 1. Create a json (any name)
Step 2. Go to your main bot file (javascript only)
Step 3. Add const banlist = require("./(name).json")
Step 4. Add these things to your command:

if (message.author.id !== banlist[users]) then {
    return;
} else {
    <code>
}
};```

Step 5. Add your banned user ids in to the json with a title of "users"
Step 6. See if this is almost the same:
```js
const Discord = require('discord.js');
const client = new Discord.Client();
const banlist = require("./banlist.json");

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('message', msg => {
  if (msg.content === 'ping') {
    if (message.author.id !== banlist[users]) then {
    return
} else {
     msg.reply('Pong!');
  }
};
});

client.login('token');``` *Not sure if works*
#

i typed that all on my own god damnit

restive furnace
#

lul

surreal sage
#

yeah ik

restive furnace
#

optimizitation

surreal sage
#

does not make a big change

#

my fingers hurt rn

restive furnace
#

if u have tons of cmds, it does make change.

#

big one.

surreal sage
#

yeah.. lol

#

do you think this works lol?

restive furnace
#

yes if you make banlist.json like this

surreal sage
#
{
    "users": [



    ]
}```
restive furnace
#
   users: ["id1, "id2"]
}```
surreal sage
#

or like mine

restive furnace
#

and make banlist.users into banlist[users]

surreal sage
#

changed it

sudden geyser
#

oh my the syntax errors

restive furnace
#

probably do this banlist[users].forEach(u => { if (u === message.author.id) return })

sudden geyser
#

there's no way to break a foreach loop (except erroring)

surreal sage
#

im gonna make a test cmd for this

restive furnace
#

probably do this ```
blacklisted = false;
banlist[users].forEach(u => {
if (u === message.author.id) blaclisted = true
})
if (blacklisted === true) return

#

fixed code

tepid mica
#

How much time does it take to verify

#

Bot

restive furnace
#

1-2 weeks

surreal sage
#

~1 week

tepid mica
#

Ooh

sudden geyser
#

superhero or just,

  • Make a banlist file with a users prop listing all users
  • Use a some loop in your if condition
empty owl
#

what

surreal sage
#

i have some nice features i think, well eval is a big one

west raptor
#

@restive furnace could just do banlist.users.includes(id)

#

which returns a bool

#

no need to do a for each

#

also not to mention that code is flawed anyways

empty owl
#

A

lavish kayak
#

#logs I Am add My Bots I made the necessary explanations Pls Confirm 🙂

earnest phoenix
#

Can anyone help me in making vote info webhook

earnest phoenix
#

ask your question

amber fractal
#

you'll be looping over unnecessary stuff if it's found

restive furnace
#

spoonfeed urs code

#

ik its unnecessary

amber fractal
#

I'm not spoonfeeding, I'm saying this is not the way you want to do that

topaz fjord
#

can't you use [][] for that

#

@amber fractal

#

I'm think I'm being stupid tho

amber fractal
#

Imma be real with you I've never done [][] and have no idea what [][] does

topaz fjord
#

2d array

amber fractal
#

ooooh

#

I dont think you can do it like that in js

#

I know that's how you do it in java

topaz fjord
#

Wait

#

You can use .find I think

amber fractal
#

Well .includes would probably be the best

surreal sage
#

help if(client.user.guildCreate) then { SyntaxError: Unexpected token { at Module._compile (internal/modules/cjs/loader.js:721:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:829:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3) < Error
Script: js if(client.user.guildCreate) then { role.setColor('#FF1493') };

amber fractal
#

do you do js

sudden geyser
#

bruh

amber fractal
#

because it isnt lua.

surreal sage
#

what

amber fractal
topaz fjord
#

then isn't a thing

#

inb4 comes from block coding

surreal sage
#

oh

amber fractal
#

You wrote 99% of it in js and 1% of it in lua

surreal sage
#

what do i have to do then?

#

then

topaz fjord
#

Remove then

#

That's all

surreal sage
#

then?

#

oh ok

amber fractal
#

it simply doesnt exist

#

just delete it

topaz fjord
#

If only

earnest phoenix
#

that whole snippet is just a bunch of bad practices

surreal sage
#

yeah im a roblox dev too

topaz fjord
#

Wait

#

What does client.user.guildCreate even do

surreal sage
#

idk

earnest phoenix
#

creates a guild

surreal sage
#

client.guildcreate?

#

no

#

if client user joins guild

pearl jasper
#

Is enmap good for server config?

amber fractal
#

It doesnt do anything.

pearl jasper
#

Per*

amber fractal
#

That's not how you listen for events

surreal sage
#

its client.guildCreate

amber fractal
topaz fjord
#

That's not even a thing

surreal sage
#

is it?

topaz fjord
#

That's not how events work

amber fractal
earnest phoenix
#

you're confusing guildCreate and createGuild

topaz fjord
surreal sage
#

oh lol

earnest phoenix
#

createGuild is a method used for creating guilds

topaz fjord
#

@amber fractal please use <>

surreal sage
#

Guild Create

earnest phoenix
#

guildCreate is an event for when a guild is sent through the ws but it's not completed

surreal sage
#

starting bot rn

#

works..

amber fractal
#

I like the embed tho

topaz fjord
#

Lots of space on mobile

amber fractal
#

It works, it wont do anything.

earnest phoenix
#

bots can create guilds if their guild count is under 10

amber fractal
grizzled raven
#

would disabling the messagereactionadd event affect reaction collectors?

amber fractal
#

that may also be helpful

surreal sage
#

well it doesnt change the role color of the bot

amber fractal
#

You should probably learn js syntax first

grizzled raven
#

cough

#

would disabling the messagereactionadd event affect reaction collectors?

#

i assume not

#

as collectors have their own oncollect event

#

but just in cade

surreal sage
#

nvm

amber fractal
grizzled raven
#

i knew it

#

😤

#

honestly what did i expect

restive furnace
surreal sage
#

is there a way if your bot joins a server his role color automaticlys change?

topaz fjord
#

Listen to the guild create event

grizzled raven
#

@surreal sage @topaz fjord no they cannot

surreal sage
#

rip

grizzled raven
#

you can create a role on the guild the bot was added to and change that color

#

but

surreal sage
#

yeah...

grizzled raven
#

you cant change the bots colour

surreal sage
#

yeah rip

grizzled raven
#

because its its highest role

surreal sage
grizzled raven
#

to change the color of a role

#

but the bot cannot change its own role, as its its highest role

#

and noone can edit their highest role

amber fractal
#

unless it's the server owner

#

which it wont be

sudden geyser
#

or if their top role is colorless

raven axle
#

is it something with the css

languid dragon
#

by getting good at CSS

#

yes it is

raven axle
#

what would be the classes or id?

languid dragon
#

make them yourself or find them yourself

raven axle
#

lol

surreal sage
#

are there max lines for a top.gg page?

#

for the detailed desc

unique nimbus
#

I don't think so

surreal sage
#

cuz mine does not load fully

surreal sage
#

what are shards???

fluid basin
#

something that you don't really need until your bot has 2.5k servers

surreal sage
#

what does it do?

fluid basin
#

well basically its something to help both discord and your bot deal with larger amounts of messages/commands etc

surreal sage
#

ok

earnest phoenix
#

it's to reduce load one connected client gets

#

instead you get to split the client into shards

#

each shard is on a specific guild and that guild is distinctive to one shard only

stable breach
#

+help

surreal sage
#

is it possible to retrieve the console and put it in a embed?

opal halo
#

@stable breach ^

stable breach
#

k sorry

restive furnace
#

@surreal sage yes

#

everything is possible if enough knowledge

surreal sage
#

something with console.?

#

let console_view = console.??????

#

@restive furnace

restive furnace
#

Im not sure, but many of guys did it.

surreal sage
#

i found this: ```js
(function(console){

console.save = function(data, filename){

if(!data) {
    console.error('Console.save: No data')
    return;
}

if(!filename) filename = 'console.json'

if(typeof data === "object"){
    data = JSON.stringify(data, undefined, 4)
}

var blob = new Blob([data], {type: 'text/json'}),
    e    = document.createEvent('MouseEvents'),
    a    = document.createElement('a')

a.download = filename
a.href = window.URL.createObjectURL(blob)
a.dataset.downloadurl =  ['text/json', a.download, a.href].join(':')
e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null)
a.dispatchEvent(e)

}
})(console)```

#

can this work?

#

nope

west raptor
surreal sage
#

i already tried

#

and saw it did'nt work

quartz kindle
#

What youre trying to do is not possible

#

Unless you access your system's logs

restive furnace
#

It is possible if u use shell plugin, or save logs into a file.

quartz kindle
#

Yeah, but not the way hes trying

#

@surreal sage youre trying to approach this the wrong way

#

You want to send the eval result to the message, right?

#

You dont console.log it and then somehow get it from the logs... You simply log it AND send it as a message

surreal sage
#

nvm

cobalt mesa
#

.addField("Propriétaire du serveur", message.guild.fetchMember(message.guild.owner.user).then(owner => {owner.tag})) is this line correct for caching the owner and putting his tag in the embed ??
please mention me if you have a solution

#

ps : it's a bot made with discord.js

modest maple
#

most people will only see the actual mention if they share a server with them

cobalt mesa
#

your answer is for whom because if it's for me I don't understand

modest maple
#

if you mention someone who doesnt share a server with the user who called the command, it will apear like @frosty sinew instead of the actual tag e.g @cobalt mesa

#

most of the time ^^

late hill
#

But he's not even doing that

#

He wants to display the tag as username#discriminator

#

Anyway

#

I don't think that's right

unique nimbus
late hill
#

Not sure what exactly you get when checking the owner if uncached in discord.js

unique nimbus
#

oh shit

late hill
#

But it'll probably just be undefined

#

Which means that you can't use it to fetch the owner either

#

guilds have an ownerID property

#

Which will always be there

#

You can use that to fetch the owner

twilit rapids
#

If it's uncached it's null

cobalt mesa
#

i got an error when i execute my command and the owner is uncached

late hill
#

yes

#

Use the ownerID property

twilit rapids
#

^ You can fetch the user object with the ID, which then won't be undefined

cobalt mesa
#

and I was told that with fetchMember I could get the owner

late hill
#

Checking the docs, you could apperently even use the guild itself aswell

#

as discord.js userResolvable thing will change it to the owner of the guild

cobalt mesa
#

sorry i'm french i don't understand

twilit rapids
#

You can use <Guild>.ownerID to get the guild's owner ID

#

Which you can use to fetch the User object so you have access to all info

cobalt mesa
#

but with the id I can't get the tag? Nope ?

twilit rapids
#

When you fetched the member, you have access to all info including the tag

cobalt mesa
#

ah ok

twilit rapids
#

You just have to await the promise fetch returns

#

Either with await or .then()

cobalt mesa
#

and suddenly it would be necessary that I put what in the field of the embed ??

twilit rapids
#

fetch the user outside the embed

#

then just use your normal code

cobalt mesa
#

to fetch the user outside the embed how do i do please

twilit rapids
#

what version of djs are you using

cobalt mesa
#

11.5.1

earnest phoenix
#

the version is irrelevant

#

this is basics

twilit rapids
#

fetching is different in versions

earnest phoenix
#

how to store a value into a variable

rugged minnow
#

Ok, quick, newbie question, whenever I try to get the presence.status

The idle shows as idle
The dnd shows as dnd
The online shows as idle, why?
(discord.js)

twilit rapids
rugged minnow
#

For some reason on my bot it does

craggy herald
#

is anyone else having issues re-connecting their bot?

twilit rapids
#

Yes

#

Discord has been down for around 50 minutes

rugged minnow
craggy herald
#

yeah i know that

#

but everyone else seems to be able to re connect and i can't

rugged minnow
#

I tried refreshing the project since I’m using glitch

#

It somehow worked

twilit rapids
#

Can you show us the code you are using for that?

rugged minnow
#

Sure, one sec

late hill
#

You could have disabled certain events that would prevent those from updating

#

Other than that, who knows what happens if Discord is being poopy and they timeout

#

Discord isn't entirely stable atm so that could be a reason

rugged minnow
#

I mean, I separated each file, this one shouldn’t have anything that could prevent it from updating

cobalt mesa
#

to fetch the user outside the embed how do i do please
😅 just a variable ??

rugged minnow
#

It was doing that even before the downtime

late hill
#

Disabling ws events is done in client options

#

But if you're not familiar with any of those it probably means you didn't do that

rugged minnow
#

Yep, it’s the first time I’m using the “presence”

twilit rapids
#

He's talking about modifying client options

late hill
#

I mean you can test again

rugged minnow
#

Oh, then no

late hill
#

Does it work now

surreal sage
#

can i add a presence to a bot from a game?

rugged minnow
#

Let me test it one se

twilit rapids
#

@surreal sage no

surreal sage
#

rip

late hill
#

If it works fine now, there's a very good chance that the presence update just timed out and caused it not to be updated before

surreal sage
#

well its possible with human bot

#

thing

twilit rapids
#

But that's breaking ToS

surreal sage
#

yeah...

rugged minnow
surreal sage
#

ik

late hill
#

oof

twilit rapids
#

Works fine on my end

rugged minnow
#

Weird indeed

#

Wait, I’ll try to refresh the bot

twilit rapids
#

Doubt that will work

rugged minnow
#

Yep

#

It didn’t work

willow wraith
#

I made a log showing that they give a role how I do it writes the role he received.

modest maple
#

#readthedocs

trail reef
#

^^^^^^^^^

#

also ctrl+f

#

'Tis a great thing

willow wraith
#

I don't see the room.

earnest phoenix
#

omg

#

look this

twilit rapids
earnest phoenix
#

ok ;v

rugged minnow
#

Solved the problem in the easiest way possible

#

just delete the line

twilit rapids
#

Creative thinking I see

earnest phoenix
#

there are no errors if there are no lines of code

empty owl
#

heyo

rugged minnow
#

there are no errors if there are no lines of code

This could potentially be someone’s motto

empty owl
#

how would I add a opt in opt out command of a map

#
 opt = db.fetch(`opt_${person.id}`)
 while (opt === 0) {
    person = XD[Math.floor(Math.random() * XD.length)];
     console.log(person.id)
    if (opt === null || opt === 1) {            
        break;
    
    } 
}```
#

im trying to add a command that rerolls if opt === 0

#

for refrense 0 === opt out

#

1 === opt in

late hill
#

what

#

Why is there a while

empty owl
#

to reroll if someone wants to opt out

#

@late hill

west spoke
#

There is no need to

empty owl
#

wdym

west spoke
#

why have a while loop

#

if you can just check on the command run

empty owl
#

But it has a chance

#

Of pinging someone opted

#

ping me a response I feel like crap so I’m going to sleep

earnest phoenix
#

message.mentions.users.first().<property> doesn't return anything

vital lark
#

@earnest phoenix you gotta null check

#

check if they mentioned a user

crisp turtle
#

Is there any better way of capitalizing the first character of a string in js?

vital lark
#

I would of used String#slice over String#substr

valid frigate
#

why

#

that just overcomplicates his problem

vital lark
#

@valid frigate I don't think there is a problem

#

I think he wants suggestions to make it better

valid frigate
#

oh well

#

google moment

google moment

#

peace

earnest phoenix
#

@vital lark i defined it as
let user = message.mentions.users.first() || message.author

vital lark
#

hmm

sudden geyser
#

Using regex sounds redundant/slower

#

The way it was done already gets the job done well (unless you want to make a function out of it)

valid frigate
#

same website

#
const lower = 'this is an entirely lowercase string';
const upper = lower.charAt(0).toUpperCase() + lower.substring(1);
#

efficient, simple, no regex

#

oh shit i forgot no spoonfeeding

earnest phoenix
#

lol

sudden geyser
#

nah it'll probably be fine (except those mod eyes eyesLeft )

valid frigate
#

they probably dont care because i gave advice and thats the end of it

earnest phoenix
#

can you do nested mongo db queries

amber fractal
#

wym

earnest phoenix
#

like this but replacing the map with a query

amber fractal
earnest phoenix
#

sorta sorta not

#

ill just programmatically do it

slender mountain
#

Wait, you werent doing it programmatically before? spurdo

earnest phoenix
#

somehow I can check if the bot is running or not? because i would get such a small status.bot web where you can see it running or not and pinging etc just the question is that it can be requested somehow

#

discord js

compact raft
#

when i type node bot.js
the terminal say's

internal/modules/cjs/loader.js:964
    throw err;
    ^

Error: Cannot find module 'winston'
Require stack:
- H:\DISCORD BOT\GULAM-BOT\bot.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:961:17)
    at Function.Module._load (internal/modules/cjs/loader.js:854:27)
    at Module.require (internal/modules/cjs/loader.js:1023:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (H:\DISCORD BOT\GULAM-BOT\bot.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1128:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:983:32)
    at Function.Module._load (internal/modules/cjs/loader.js:891:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ [3
opal halo
#

well what's winston?

earnest phoenix
#

Winston

compact raft
#
var Discord = require('discord.io');
var logger = require('winston');
var auth = require('./auth.json');
// Configure logger settings
#

can i remove that's

opal halo
#

it doesn't know what winston is

compact raft
#

ohh

#

after removed

internal/modules/cjs/loader.js:1184
    throw err;
    ^

SyntaxError: H:\DISCORD BOT\GULAM-BOT\auth.json: Unexpected token � in JSON at position 3
    at parse (<anonymous>)
    at Object.Module._extensions..json (internal/modules/cjs/loader.js:1181:22)
    at Module.load (internal/modules/cjs/loader.js:983:32)
    at Function.Module._load (internal/modules/cjs/loader.js:891:14)
    at Module.require (internal/modules/cjs/loader.js:1023:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (H:\DISCORD BOT\GULAM-BOT\bot.js:3:12)
    at Module._compile (internal/modules/cjs/loader.js:1128:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:983:32)
#

but token is Correct

opal halo
#

Is this discord.js?

compact raft
#

yeah

opal halo
#

did you make a const to specify the bot?

#

yes?

#

no?

compact raft
#

hmmm

#

Yes

earnest phoenix
#

How can I make a webhook to know who voted my bot

wheat jolt
#

Give us the json

#

Without the token

#

I mean, replace it with BOT_TOKEN or something like this

opal halo
#

@compact raft show me how you did it

earnest phoenix
#

@compact raft give the ss of ur json

wheat jolt
#

@opal halo it's a problem in auth.json

compact raft
#

package.json

{
  "name": "GULAM-BOT",
  "version": "1.0.0",
  "description": "This is My First Bot",
  "main": "bot.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "AKRAM DESHWALI",
  "license": "ISC",
  "dependencies": {
    "discord.io": "https://github.com/woor/discord.io/tarball/gateway_v6",
    "discord.js": "^11.5.1"
  }
}
wheat jolt
#

I said auth.json

earnest phoenix
#

@compact raft auth.json

wheat jolt
#

Not package.json

earnest phoenix
#

Lol

wheat jolt
#

Or I didn't said

#

Sowwy

compact raft
#
{
“token”: "NjQ3Njg5ODU3MTY2MjEzMTM0.XeupPw.hZ8S4Lhfjp0r95j-xxxxxxxxxx"
}
opal halo
#

no I meant like const Bot =

wheat jolt
#

The commas are wrong

compact raft
#

no

wheat jolt
#

Yes

#

Use these

#

"

earnest phoenix
#

@compact raft yes use "

opal halo
#

you have to specify the bot

wheat jolt
#

@opal halo don't get involved in this if you don't know what to do

opal halo
#

i do

earnest phoenix
#

@wheat jolt🤣

wheat jolt
#

The error doesn't say anything about the bot

earnest phoenix
#

@opal halou don't

wheat jolt
#

It's an unexpected token in auth.js

#

The commas were wrong

#

The only accepted commas in .json s are these: " "

earnest phoenix
#
"token": "BOT_TOKEN"
}```
#

Use this

wheat jolt
#

Yup

earnest phoenix
#

@compact raft

compact raft
#

after use this @earnest phoenix

logger.remove(logger.transports.Console);
^

ReferenceError: logger is not defined
wheat jolt
#

This is an error from your .js

earnest phoenix
#

Hm

wheat jolt
#

The auth.json was fixed

#

But logger isn't defined

#

Send your codd

#

Code

earnest phoenix
#

@wheat jolt lol full code 🤣

#

somehow I can check if the bot is running or not? because i would get such a small status.bot web where you can see it running or not and pinging etc just the question is that it can be requested somehow
discord.js

opal halo
#

you removed the logger part with winston thing remember?

compact raft
#

@earnest phoenix

var Discord = require('discord.io');
//var logger = require('winston');
var auth = require('./auth.json');
// Configure logger settings
logger.remove(logger.transports.Console);
logger.add(new logger.transports.Console, {
    colorize: true
});
logger.level = 'debug';
// Initialize Discord Bot
var bot = new Discord.Client({
   token: auth.token,
   autorun: true
});
bot.on('ready', function (evt) {
    logger.info('Connected');
    logger.info('Logged in as: ');
    logger.info(bot.username + ' - (' + bot.id + ')');
});
bot.on('message', function (user, userID, channelID, message, evt) {
    // Our bot needs to know if it will execute a command
    // It will listen for messages that will start with `!`
    if (message.substring(0, 1) == '!') {
        var args = message.substring(1).split(' ');
        var cmd = args[0];
       
        args = args.splice(1);
        switch(cmd) {
            // !ping
            case 'hi':
                bot.sendMessage({
                    to: channelID,
                    message: 'Hello!'
                });
            break;
            // Just add any case commands if you want to..
         }
     }
});
earnest phoenix
#

.io

#

??

wheat jolt
#

uncomment logger

#

and yes

restive furnace
#

if copy pasting then u get those errors

wheat jolt
#

it should be discord.js lmao

steel heath
earnest phoenix
#

😅 😅

steel heath
earnest phoenix
#

O

opal halo
#

LOL

restive furnace
#

there is lol

#

single file discord modile

compact raft
#

anyone can provide full code

earnest phoenix
#

@restive furnace oh

wheat jolt
#

shouldn't be different than d.js?

earnest phoenix
#

@compact raft -_-

wheat jolt
#

uncomment the logger thing

#

@compact raft

compact raft
#

i want to make my bot to send dm to who i said

opal halo
#

well what is winston supposed to be?

wheat jolt
earnest phoenix
#

@compact raftu copy pasted the code?

wheat jolt
#

lol

opal halo
#

oh

compact raft
#

@earnest phoenix YEah

opal halo
#

he said this was discord.js

earnest phoenix
#

🥴

opal halo
#

not .io

wheat jolt
#
var Discord = require('discord.io');
var logger = require('winston');
var auth = require('./auth.json');
// Configure logger settings
logger.remove(logger.transports.Console);
logger.add(new logger.transports.Console, {
    colorize: true
});
logger.level = 'debug';
// Initialize Discord Bot
var bot = new Discord.Client({
   token: auth.token,
   autorun: true
});
bot.on('ready', function (evt) {
    logger.info('Connected');
    logger.info('Logged in as: ');
    logger.info(bot.username + ' - (' + bot.id + ')');
});
bot.on('message', function (user, userID, channelID, message, evt) {
    // Our bot needs to know if it will execute a command
    // It will listen for messages that will start with `!`
    if (message.substring(0, 1) == '!') {
        var args = message.substring(1).split(' ');
        var cmd = args[0];
       
        args = args.splice(1);
        switch(cmd) {
            // !ping
            case 'hi':
                bot.sendMessage({
                    to: channelID,
                    message: 'Hello!'
                });
            break;
            // Just add any case commands if you want to..
         }
     }
});
compact raft
#

🙏

wheat jolt
#

use that

#

@compact raft

earnest phoenix
#

Try @compact raft

wheat jolt
#

@opal halo then he didn't knew what he was saying

earnest phoenix
#

@wheat jolt which line u fixed?

wheat jolt
#

uncomment the line where he defined logger

opal halo
#

I realize that

earnest phoenix
#

Oh

compact raft
#

@wheat jolt
using this
getting this error

internal/modules/cjs/loader.js:964
    throw err;
    ^

Error: Cannot find module 'winston'
Require stack:
- H:\DISCORD BOT\GULAM-BOT\bot.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:961:17)
    at Function.Module._load (internal/modules/cjs/loader.js:854:27)
    at Module.require (internal/modules/cjs/loader.js:1023:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (H:\DISCORD BOT\GULAM-BOT\bot.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1128:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:983:32)
    at Function.Module._load (internal/modules/cjs/loader.js:891:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'H:\\DISCORD BOT\\GULAM-BOT\\bot.js' ]
}
wheat jolt
#

before: js //var logger = require('winston');
after: js var logger = require('winston');

earnest phoenix
#

Do

wheat jolt
#

npm i winston

#

on the console

#

in the cmd

#

or whatever os you have

earnest phoenix
#

Hmm

#

@restive furnace u can help me in dbl webhook?

#

🥺

compact raft
#

@wheat jolt installing

restive furnace
#

@earnest phoenix which lang

earnest phoenix
#

@restive furnace js

restive furnace
#

if js i couldnt get it working

wheat jolt
#

node.js*

earnest phoenix
#

@restive furnace why?

restive furnace
#

idk

wheat jolt
earnest phoenix
#

-_-

#

@wheat jolt u know?

compact raft
#

@wheat jolt

{"message":"Connected","level":"info"}
{"message":"Logged in as: ","level":"info"}
{"message":"Gulam - (647689857166213134)","level":"info"}
wheat jolt
#

know what

restive furnace
#

Bot cannot be made on js w/out node.js so here js means node.js

wheat jolt
#

your bot works

earnest phoenix
#

@compact raft it's connected now

#

See ur bot

#

😅

compact raft
#

Yeas Bot is now Online

earnest phoenix
#

@compact raft hmm

#

Now it will work

wheat jolt
#

it says connected

#

ofc it's online

earnest phoenix
#

@restive furnace help me in webhook

compact raft
#

But when i say hi the bot didn't respond

#

@wheat jolt yes online but that command is not worked

#

let me given permission

wheat jolt
#

!hi

#

not hi

earnest phoenix
#

@compact raft ur server link where u are testing ?

#

In DM

wheat jolt
#

not here

earnest phoenix
#

@wheat jolt u know??

#

How to make dbl webhook work

#

😅

wheat jolt
#

what do you mean

restive furnace
#

@earnest phoenix ^

compact raft
#

OFFLINE AGAIN

wheat jolt
#

you don't need to use caps

#

it can be fixed

#

did it threw an error?

#

@earnest phoenix about your status page, you should use statuspage.io or make yourself a status page system where you can change the bot's status, add incidents or whatever you want

earnest phoenix
#

@wheat jolt you can make a code for it too

wheat jolt
#

as I said, he can make himself a statuspage system

#

or

#

also, @earnest phoenix you have Client.status

#

which will give you the status of your Discord bot

compact raft
#

@earnest phoenix thans my bot is now Online in my server and respond as coading

wheat jolt
#

k

compact raft
#

Now can that bot Online Everytime?

restive furnace
#

vps <

compact raft
#

@restive furnace ?

#

can i set my bot to welcome every new member