#development

1 messages · Page 745 of 1

topaz fjord
#

npm cache verify then

#

both work

green kestrel
#

Yeah the things you need to do are in the error

dense patio
topaz fjord
#

now try to run your install again

dense patio
#

just npm install right?

topaz fjord
#

yes

dense patio
#

same thing

#

why would it say this

topaz fjord
#
rm -rf node_modules/
npm cache verify
npm install
#

try those one after another

dense patio
#

the first one sent nothing

topaz fjord
#

it's supposed to

dense patio
#

well

#

what should it say

topaz fjord
#

it should remove the node_modules directory

#

after running it, ls shouldn't show a node_modules dir

#

after doing that run the next one

#

and the next one after that

dense patio
#

same errors

green kestrel
#

What's lodash?

topaz fjord
#

there is another fix

#

reinstall both node and npm

dense patio
#

ok

#

how do i make myself a su

vital lark
#

oh

green kestrel
#

As root add your non root user to the group sudo

dense patio
#

how do i do that

green kestrel
#

I can tell you but I can't type it... Am on mobile

topaz fjord
#

edit /etc/sudoers

#

or add youself to the sudo group

green kestrel
#

Struggled to type the cp/chown earlier lol

#

It keeps auto correcting Linux commands

topaz fjord
#

I usually uncomment the wheel group and add my user to it

dense patio
#

i don't know how to do any of that

#

hey @vital lark can you dm me?

vital lark
#

why

dense patio
#

i need to ask you for a favor

vital lark
#

why not just ask me here?

dense patio
#

ok so

#

i like your pfp

vital lark
dense patio
#

lol yeah

#

@green kestrel so i reinstalled nodejs and npm

#

it said this after npm

dense patio
#

apt-mark showhold returned nothing

green kestrel
#

Did you apt-get update as first thing you did?

#

Otherwise it's looking at an old list

dense patio
#

i did not

topaz fjord
#

it needs sudo

dense patio
#

oh yeah

#

still says the same thing

#

well, apt-mark showhold says nothing

#

god why can't it just work

solar whale
dense patio
#

wait, this is advertising

prime cliff
earnest phoenix
dense patio
#

bamboo

earnest phoenix
#

o woop

dense patio
#

@green kestrel do you know of any other way i can do this

#

because this is not working

quartz kindle
#

do you have root access?

topaz fjord
#

tim got cert

#

nice

quartz kindle
#

wut

topaz fjord
#

oh this is different tim

#

nvm

quartz kindle
#

lul

topaz fjord
#

@quartz kindle but yes he did

#

but then he created a new account

#

cause someone told him to for security reasons

quartz kindle
#

ah

topaz fjord
#

no

#

get out

woeful depot
#

yes

#

no

topaz fjord
#

you commie

quartz kindle
#

wtf

topaz fjord
#

@flat pelican hello yes come come

woeful depot
#

its your mom

#

lol

topaz fjord
#

no u * infinity

flat pelican
#

uhm

#

@woeful depot nice

topaz fjord
#

dream banned him

flat pelican
#

you got a fancy ban hammer, enjoy

topaz fjord
#

@west raptor no lurk

flat pelican
#

lol

#

Sorry I was reviewing bots

topaz fjord
#

it's fine

flat pelican
#

Thanks Dreamuwu

quartz kindle
#

he put the bot link in the redirect uri twice lol

west raptor
#

@topaz fjord builder pinged me

dense patio
#

what

#

@topaz fjord do you know of anything better i could do

#

to actually get the damn bot online

prime cliff
#

Yes git gud

quartz kindle
#

whats your actual problem?

dense patio
#

nothing works.

#

i keep doing everything they told me to do

#

and i haven't gotten anywhere

#

additional details: hosting bot on digital ocean
using filezilla to view the files
using mobaxterm to connect to command line

quartz kindle
#

you created a new user correct?

dense patio
#

yes

quartz kindle
#

you logged in with it?

dense patio
#

yes

quartz kindle
#

log out, log in with root, add user to sudoers

dense patio
#

already did

quartz kindle
#

logged back in with user and sudo still doesnt work?

dense patio
#

i don't believe that's the issue

#

it appears npm isn't being installed

quartz kindle
#

i mean, i scrolled a bit up and you were saying you were still getting access denied even with sudo

#

anyways, if you wanna jump to npm, how did you install node?

dense patio
#

sudo apt-get install nodejs

quartz kindle
#

what version did that give you?

#

did the install complete successfully?

vital lark
#

did you just straight up do that

#

or did you follow the instructions on Node.js' website

#

also do node -v

dense patio
#

v13.3.0

#

current

quartz kindle
#

thats the latest major version, i dont recommend using it

dense patio
#

how do i get the LTS one

quartz kindle
#

i suggest using nvm to install node

#

you can get nvm from their github

dense patio
#

how do i install that

quartz kindle
#

run one of those

green kestrel
#

The second

dense patio
#

well i already did the first

#

is there harm in doing both

quartz kindle
#

doesnt matter which one

#

doing both is just installing it twice lol

dense patio
#

yeah i figured

quartz kindle
#

now you can use nvm install LTS or nvm install 12.13.1

dense patio
quartz kindle
#

log out and log in again

dense patio
#

ok

earnest phoenix
#

Sorry for the inconvenience but the longer it will take for my bot to be tested.

#

And I'm sorry if I have a lack of spelling out there, I don't usually write in English much.

empty owl
#

what

#

@earnest phoenix

earnest phoenix
#

la cague ;-;

empty owl
#

what langs do u speak

blissful scaffold
#

On average it takes around a week before your bot gets tested

#

There is a big queue and mods are checking them all one at a time

empty owl
#

lmao mine didnt get checked even thought the quota

#

xd

blissful scaffold
#

maybe the waiting time is longer now

empty owl
#

lo

amber fractal
#

So I'm trying to subscribe to a youtube webhook and Idk if I'm just retarded or not. I keep getting the error Invalid value for hub.mode but my stuff seems to me correct...

  "hub.callback": "http://xxx.xx.xxx.xxx:xxxx/x",
  "hub.topic": "https://www.youtube.com/xml/feeds/videos.xml?channel_id=x",
  "hub.verify": "async",
  "hub.mode": "subscribe",
  "hub.verify_token": token,
  "hub.secret": secret,
  "hub.lease_seconds": 864000
}``` I don't know what else `hub.mode` could be. (I did try `unsubscribe` same issue and capitalized)
#

and yes it is structured like that, idk why but it wants hub.x instead of just x

#

Or it is that way with twitch's webhooks

frosty trellis
#

seems right

#

idk why it wont work

amber fractal
frosty trellis
#

oooffff

empty owl
#

somereason when i do commands in a big server, i doesnt work but when I do it for mine, it does

amber fractal
#

any errors?

empty owl
#

no

#

if it had no perms it would error right

amber fractal
#

It would.

#

Do no commands work?

empty owl
#

idk

#

wai

#

how do u get an invite from a random guild that ur bot is in

#

nv

#

nvm

broken ruin
#

Hello

#

anybody there ?

vital lark
#

hi

ruby onyx
#

o h

vital lark
#

what is your problem?

ruby onyx
#

could anyone help me out? how do i add some statistics from my discord bot into html? i know it's possible w/ javascript but i'm not sure how

vital lark
#

need some context pls

ruby onyx
#

uhhH HH h

#

not sure how i can explain better,,uhh essentially, i'm trying to get text (like an api) from my discord bot into the website

#

(from a url)

vital lark
#

like on your bot page?

#

or just a plain website

ruby onyx
#

bot page

#

yeah

vital lark
#

oh, you can't use JavaScript unless your a certified developer

knotty steeple
#

iframe mmLol

ruby onyx
#

lmao i tried iframe

#

too much work :(

knotty steeple
#

l a z y

ruby onyx
#

: )

#

so i can't really do it?

vital lark
#

no, sorry

ruby onyx
#

ah, it's all good

#

waitwaitwati

#

certified developer on like

knotty steeple
#

yes

ruby onyx
#

o h

#

i'm trying to get it on my own website

#

i misunderstood

broken ruin
#

look at this code :
var newSongs = musicbot.queues.get(msg.guild.id).songs.map((video, index) => (`**${video.position + 1}:** __${video.title.replace(/\\/g, '\\\\').replace(/\`/g, '\\`').replace(/\*/g, '\\*').replace(/_/g, '\\_').replace(/~/g, '\\~').replace(/`/g, '\\`')}__`)).join('\n\n');

i got the error musicbot.queues.get(...).songs.map is not a function

#

anybody have a solution ?

#

in discord.js

knotty steeple
#

its not a function

#

you cant map songs

sudden geyser
#

are you sure songs is an array or has a map method

broken ruin
#

yes

sudden geyser
#

check again

broken ruin
#

var songs = typeof obj == "object" ? Array.from(obj.songs) : [];

sudden geyser
#

aka log musicbot.queues.get(msg.guild.id).songs to your console and see if it's truly an array.

broken ruin
#

Ok

young forge
#

Can someone help me?

#

I did the node mybot.js command in terminal

#

but it keeps saying this

#

"(node:78909) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.
at WebSocketConnection.client.ws.connection.once.event (/Users/student/Desktop/Discord Bot/node_modules/discord.js/src/client/ClientManager.js:48:41)
at Object.onceWrapper (events.js:286:20)
at WebSocketConnection.emit (events.js:198:13)
at WebSocketConnection.onClose (/Users/student/Desktop/Discord Bot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:390:10)
at WebSocket.onClose (/Users/student/Desktop/Discord Bot/node_modules/ws/lib/event-target.js:124:16)
at WebSocket.emit (events.js:198:13)
at WebSocket.emitClose (/Users/student/Desktop/Discord Bot/node_modules/ws/lib/websocket.js:191:10)
at TLSSocket.socketOnClose (/Users/student/Desktop/Discord Bot/node_modules/ws/lib/websocket.js:850:15)
at TLSSocket.emit (events.js:203:15)
at _handle.close (net.js:606:12)
(node:78909) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:78909) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code."

#

Can someone help me?

earnest phoenix
#

Your bot token isn't correct

young forge
#

It should be.

#

I copy and pasted it.

#

Oh.

earnest phoenix
#

Regen the token

young forge
#

Oops.

earnest phoenix
#

🤷‍♂️

#

Mmmh

young forge
#

I realized I did something stupid

earnest phoenix
#

?

young forge
#

I was using the client ID

earnest phoenix
#

Oh

#

Lol

young forge
#

Thanks for existing!

#

That's all I needed.

earnest phoenix
#

Np

storm wagon
#

yo does anyone have some good starting points (blueprinting, flowcharts, references) for making a starboard in discord.py?

grizzled raven
#

database

#

i would say something else, but it would probably just confuse you

vital lark
#

also working with the reactions api

compact raft
#

hello

#

i need some help

#

anyone here

vital lark
#

what do you need help with

#

just saying you need help without displaying anything isn't gonna get you anywhere to fix the problem

compact raft
#
  if (command === "clear") {
    // This command removes all messages from all users in the channel, up to 100.

    // get the delete count, as an actual number.
    const deleteCount = parseInt(args[0], 10);

    // Ooooh nice, combined conditions. <3
    if (!deleteCount || deleteCount < 2 || deleteCount > 100)
      return message.reply(
        "Please provide a number between 2 and 100 for the number of messages to delete"
      );

    // So we get our messages, and delete them. Simple enough, right?
    const fetched = await message.channel.fetchMessages({ limit: deleteCount });
    message.channel
      .bulkDelete(fetched)
      .catch(error =>
        message.reply(`Couldn't delete messages because of: ${error}`)
      );

  }

this is my code but i want to send a little message like > 20 Messages Deleted

vital lark
#

add a then chain

#

before the catch chain and after the bulkDelete function

earnest phoenix
#

Just add js .then( message.channel.send(`Deleted ${deleteCount} messages! `) ) after .bulkDelete(fetched)

vital lark
earnest phoenix
#

@compact raft

compact raft
#

let me check

vital lark
#

also that code you posted isn't gonna work

#

you need to make it into an arrow function

compact raft
#

yes worked @vital lark

vital lark
#

ok

compact raft
#

@earnest phoenix using this i'm getting error like Unexpected token :

earnest phoenix
#

@compact raft SRY, retry

compact raft
#

ok

#
  if (command === "clear") {
    // This command removes all messages from all users in the channel, up to 100.

    // get the delete count, as an actual number.
    const deleteCount = parseInt(args[0], 10);

    // Ooooh nice, combined conditions. <3
    if (!deleteCount || deleteCount < 2 || deleteCount > 100)
      return message.reply(
        "Please provide a number between 2 and 100 for the number of messages to delete"
      );

    // So we get our messages, and delete them. Simple enough, right?
    const fetched = await message.channel.fetchMessages({ limit: deleteCount });
    message.channel
      .bulkDelete(fetched)
    .then(message.channel.send(`Deleted ${deleteCount} messages! `)
      .catch(error =>
        message.reply(`Couldn't delete messages because of: ${error}`)
      );

  }

error at );

mossy vine
#

which one

compact raft
#
when i comment this line then worked
/// .then(message.channel.send(`Deleted ${deleteCount} messages! `)
mossy vine
#

and whats the error

earnest phoenix
#

You forgot a )

slender thistle
#

2 opening parentheses but only one closing parenthesis, no?

compact raft
#
);
      ^
SyntaxError: missing ) after argument list
earnest phoenix
#

Yes

#

You forgot a )

compact raft
#

can i use this

    .then(message.channel.send(`Deleted ${deleteCount} messages! `))
earnest phoenix
#

Yes

compact raft
#

@earnest phoenix but Deleted ${deleteCount} messages! not sent?

earnest phoenix
#

?

#

It should

compact raft
#

only message deleted like previously.

earnest phoenix
#

He first delete messages, then send a message with the number of messages deleted

compact raft
#

no

#

only deleting messages

earnest phoenix
#

Log?

#

Any error?

warm marsh
#

.then(deleted => message.channel.send(Deleted ${deleted.size});

green kestrel
#

what determines wether or not a mention starts with <@ or <@! ?

compact raft
#

no

green kestrel
#

my bot wasnt scanning for the one with ! in it, resulted in some interesting breakage, because overnight my client suddenly started sending the second form

compact raft
#

@warm marsh Doesn't work

warm marsh
#

@compact raft you need to make your .then into an arrow function for it to send.

#

Hold on

#

What version of djs?

compact raft
#

11.5.1

warm marsh
#

Okay

#

Try using ```js
message.channel.bulkDelete(fetched).then(console.log).catch(console.log);

#

See if get anything in console

compact raft
#

console empty

warm marsh
#

Did messages get deleted?

compact raft
#

yes

warm marsh
#

Mhh

#

Try assigning to a variable, ```js
let deleted = await message.channel.bulkDelete(fetched);
console.log(deleted);

#

Although that shouldn't change anything.

compact raft
#

@warm marsh message deleted but deleted not showing

warm marsh
#

It's probably something simple.

#

Show the entire file

compact raft
warm marsh
#

Could you use pastebin I'm on my phone.

compact raft
#

yes

#

can i share pastebin link here

warm marsh
#

Yeah

compact raft
#
// command
 if (command === "clear") {
warm marsh
#

Are you missing a closing quote anywhere?

compact raft
#

i think no.

warm marsh
#

Do you have message.channel uncommented above let deleted?

compact raft
#

let me chech

#

Nothing Found

warm marsh
#

Idk why it doesn't post.

earnest phoenix
#

you're using deleteCount but you don't define it anywhere

warm marsh
#

deleteCount is defined at start of command

earnest phoenix
#

ah i see now

compact raft
#
    // get the delete count, as an actual number.
    const deleteCount = parseInt(args[0], 10);

here defined

earnest phoenix
#

you're mixing async and synchronous code in the commented part

#

i can't tell what's your intention

warm marsh
#

Is the pastebin broke for you cry?

earnest phoenix
#

nope

warm marsh
#

All I see is full blue so cant see what's commented or not

earnest phoenix
#

and that's why pastebin sucks

#

ads, light theme, bloatware

warm marsh
#

Yeah I thought hastebin shut or something so recommended pastebin

compact raft
#

where i put that code?

warm marsh
#

What code?

compact raft
#

whole file

warm marsh
#

No where just send command code

compact raft
#
  if (command === "clear") {
    // This command removes all messages from all users in the channel, up to 100.

    // get the delete count, as an actual number.
    const deleteCount = parseInt(args[0], 10);

    // Ooooh nice, combined conditions. <3
    if (!deleteCount || deleteCount < 2 || deleteCount > 100)
      return message.reply(
        "Please provide a number between 2 and 100 for the number of messages to delete"
      );

    // So we get our messages, and delete them. Simple enough, right?
    const fetched = await message.channel.fetchMessages({ limit: deleteCount });
    message.channel
    let deleted = await message.channel.bulkDelete(fetched);
console.log(deleted)
      //.bulkDelete(fetched)
      .then(message.channel.send(`Deleted ${deleteCount} messages! `))
      .catch(error =>
        message.reply(`Couldn't delete messages because of: ${error}`)
      );

  }
earnest phoenix
#

oh gof

#

god

warm marsh
#

Remove everything after the console.log

#

The .then is uncommented so it should throw an error?

compact raft
warm marsh
#
// This command removes all messages from all users in the channel, up to 100. // get the delete count, as an actual number. const deleteCount = parseInt(args[0], 10); // Ooooh nice, combined conditions. <3 if (!deleteCount || deleteCount < 2 || deleteCount > 100) return message.reply( "Please provide a number between 2 and 100 for the number of messages to delete" ); // So we get our messages, and delete them. Simple enough, right? const fetched = await message.channel.fetchMessages({ limit: deleteCount }); message.channel let deleted = await message.channel.bulkDelete(fetched); console.log(deleted);```
compact raft
#

🧐

warm marsh
#

That should be everything inside the braces {}

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

compact raft
#

🧐

#

@sage bobcat is it

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

warm marsh
#

Oh fair

#

Did hastebin change domain name or something then?

sage bobcat
#

One message removed from a suspended account.

warm marsh
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

warm marsh
#

Oh

lofty lagoon
#

hello I try to make a discord bot but when I try to add it to the bot it say there is a error

#

there is the code

sage bobcat
#

One message removed from a suspended account.

lofty lagoon
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

mossy vine
#

first of all

#

token leak

#

second or all

#

unclosed ()

sage bobcat
#

One message removed from a suspended account.

lofty lagoon
#

where

mossy vine
#

also are you coding on a phone

sage bobcat
#

One message removed from a suspended account.

modest maple
#

3rd point

#

Don't copy and paste code

lofty lagoon
#

I code on phone

sage bobcat
#

One message removed from a suspended account.

mossy vine
#

dont do that

#

@sage bobcat yes, you can build node for android

sage bobcat
#

One message removed from a suspended account.

lofty lagoon
#

someone can help

modest maple
#

Bruh

#

They told u the error xD

late hill
#

ok

mossy vine
#

this is why you dont code on mobile

#

because you dont have any tools for debugging your code

lofty lagoon
#

@sonic trench is made on mobile

#

@mossy vine

mossy vine
#

and?

#

im not saying you cant, im saying that its a worse idea than cutting your leg off

lofty lagoon
#

oh ok

late hill
#

stop posting your token and fix your syntax error

lofty lagoon
#

where is the error

mossy vine
#

WHERE NODE SAYS THE ERROR IS

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

lofty lagoon
#

ok

late hill
#

If only there were tools that could help you with simple syntax errors

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

fluid basin
#

hmm does linting help with syntax Thonk

lofty lagoon
earnest phoenix
#

if only you would use an actual IDE and an actual platform to write the code on

fluid basin
#

time to compile vsc for mobile

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

late hill
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

lofty lagoon
#

k

fluid basin
#

I mean

sage bobcat
#

One message removed from a suspended account.

fluid basin
#

good coding habits are important

#

esp in languages like python

sage bobcat
#

One message removed from a suspended account.

fluid basin
#

where one single space can cause your code not to run properly

lofty lagoon
sage bobcat
#

One message removed from a suspended account.

mossy vine
#

LMAO

fluid basin
#

yes im talking about the importance of indentation

sage bobcat
#

One message removed from a suspended account.

fluid basin
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lofty lagoon
fluid basin
#

it is but

sage bobcat
#

One message removed from a suspended account.

late hill
#

You shouldn't need help with this

#

Look at your code

sage bobcat
#

One message removed from a suspended account.

late hill
#

and figure it out

fluid basin
#

yes and properly indent everything

#

it will be so obvious to know where you missed out on things

quartz kindle
#

For every ( or { you have, there should be a } or ) to close it out

#

Right now you have missing closures

#

Places where you opened an { or an ( and didnt close them

#

Look carefully

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

ty for token

pseudo whale
#

LMAO

sage bobcat
#

One message removed from a suspended account.

pseudo whale
#

OOF

earnest phoenix
#

¯\_(ツ)_/¯

sage bobcat
#

One message removed from a suspended account.

pseudo whale
#

Huh

quartz kindle
#

Thats not even fixed

sage bobcat
#

One message removed from a suspended account.

fluid basin
#

@quartz kindle how is it not

#

oh wait

earnest phoenix
#

How can i get the Permissions that the bot has, and list the permissions that it dont has?

fluid basin
#

lol

quartz kindle
#

Missing a ) lmao

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

From client(

fluid basin
#

@earnest phoenix depends on your library and permissions of what

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

Lmao

earnest phoenix
#

@fluid basin client permissions

Discord.js v12-dev

quartz kindle
#

But let him figure out

fluid basin
#

yeah client permissions of what

#

in DBL?

quartz kindle
#

Dont just givehim the code lol

fluid basin
#

or some other rando server

#

or some random channel

#

yeah permissions are always channel based

#

unless its role permissions

earnest phoenix
#

i mean the Role permissions

fluid basin
#

yeah what permissions

earnest phoenix
#

jez stop spam

fluid basin
#

yeah then you find the server that has that role

earnest phoenix
#

and?

fluid basin
#

read the docs

#

should be role.permissions

earnest phoenix
#

ok

fluid basin
lofty lagoon
#

it work thx you

#

it's online!!

fluid basin
#

well permissions are annoying sometimes

#

gotta bitshift it

#

just google permission calculator discord and it should tell you how it is calculated

modest maple
#

damn DV spoonfeeding 101

#

havent seen that error before xD

compact raft
#

i'm not getting helped

modest maple
#

actually have no idea what ur error is

#

so cant rlly help u

#

like re send issue

sage bobcat
#

One message removed from a suspended account.

lament meteor
#

whats his issue?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

modest maple
#

ah yes

#

then hes the solution:

#

Learn the basics of your programming language rather than copy and paste

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sudden geyser
#

What's the issue they're having?

modest maple
#

their Copy and Paste code isnt working and they didnt send the stack trace so its kinda hard to tell

sudden geyser
#

They're trying to call .then on the console.log() method, which returns undefined.

compact raft
#

@sudden geyser RIGHT

sudden geyser
#

You need to call .then on a promise (or remove it and do it normally). Your .then function would not work either. You should search up how to correctly use promises.

compact raft
#

ok

#

Thanks @sudden geyser

flat pelican
#

@lofty lagoon Please reset your bot’s token if not done

#

It’s dumb to post your token publicly

green kestrel
#

wooo a bot token

#

time to have some fun... nah only joking lucky for you

weak parrot
#

I have this assignment for PHP and I cannot figure out why it returns 1 at the end of the arrays values. Anybody see something I'm not?

function printArray($item, $key)
{
    echo "<br>$key" . ":" . "<i>$item</i>";
}
$playlist = array(
    array("genre" => "hiphop", "auteur" => "John Williams", "titel" => "My Girl"),
    array("genre" => "Jazz", "auteur" => "John Coltrane", "titel" => "New York"),
    array("genre" => "hiphop", "auteur" => "Shakira", "titel" => "Obsession")
);
$playlist2 = array(
    array("genre" => "Latin", "auteur" => "Caetano Veloso", "titel" => "Cafe Atlantico")
);
//Stap 1
echo "<h3>Lab 03</h3>",
" ---- Stap 1: Mijn playlist",
array_walk_recursive($playlist, "printArray");
//Stap 2
$playlist = array_merge($playlist, $playlist2);
echo "<br><br>",
" ---- Stap 2: Track toevoegen",
array_walk_recursive($playlist, "printArray");
green kestrel
#

array_walk_recursive returns 1

#

iirc

#

btw, dont know if you know but any modern php lets you use [] instead of array() to declare an array

#

a lot easier to read and faster to type

weak parrot
#

It's for an assignment we need to copy pretty much 1 for 1 what's in/being learned by the book most of the time

green kestrel
#

ah ok

weak parrot
#

Also array_walk_recursive didn't return an extra 1 in a previous assignment which is why it's confusing me

green kestrel
#

yeah i see what it is, when array_walk_recursive returns, it can return true or false

#

so youre echoing the return value of array_walk_recursive as well as calling your key print function repeatedly

#

true can be coerced into a 1, but false coerces to a null or empty

#

because php 😛

#

so it may be that in your last assignment, array_walk_recursive was returning false

#

not sure what would make it 'fail' though

weak parrot
#

Yeah but in this example

    function printArray($item, $key)
    {
        echo "<br>$key" . ": " . "<i> $item </i>";
    }
    $boeken = array(
    array("titel"=> "Stoner", "auteur" => "John Williams",
        "genre" => "fictie", "prijs" => 19.99),
    array("titel"=> "De cirkel", "auteur" => "Dave Eggers",
        "genre" => "fictie", "prijs" => 22.50),
    array("titel"=> "Rayuela", "auteur" => "Julio Cortazar",
        "genre" => "fictie", "prijs" => 22.50),
    );
    echo "<br>---- Opgave 21: Boeken recursief doorlopen";
    array_walk_recursive($boeken, "printArray");

It doesn't return anything extra

green kestrel
#

youre not echoing array_walk_recursive there

weak parrot
#

Oh wait you're right

green kestrel
#

in your previous code its like:

echo "foo",
array_walk_recursive($arr, "somefunc");```
weak parrot
#

Yeah that fixed it. Sorry I'm extremely tired atm as I haven't slept 😩

green kestrel
#

and on that note array_walk_recursive is a function i never use that i probably should

#

np 🙂

modest maple
#

dumb question cuz im dumb

#

how does one use Perl with html

#

xD

green kestrel
#

with extreme caution

#

😛

#

perl is unfriendly

modest maple
#

i have Zero idea what im doing with Perl xD all ik is that i have a Generation script

green kestrel
#

you'd probably use the CGI cpan module

modest maple
#

and no idera how to implement it

green kestrel
#

the other choice is mod_perl, but ive not personally used it, it needs specific apache configuration

#

and its ...well, its ugh.

flat pelican
#

get the role object

#

and do role.mention

#

¯_(ツ)_/¯

#

is it js?

#

or py?

#

idk how it works for js

modest maple
#

see

#

Python better

#

jk jk

#

<3

flat pelican
#
#For Python
client.get_role(roleID).mention```
restive furnace
#
<@&roleid>```
earnest phoenix
#

@&

#

🙂

#

<@&roleid> *

fluid basin
#

or you could just use your library to get the role mention

#

it should work

amber fractal
#

In js, it's .toString()

mossy vine
#

theyre both self explanitory

#

they tell you what they mean pretty well

#

The node to be removed is not a child of this node.

#

(Bad Request)

#

-owner @flat sedge

gilded plankBOT
mossy vine
#

so it is

#

it returning 400 on the edit page is your fault entirely

#

i dont fucking know without looking at the code

#

let me just magically guess

compact oriole
#

he setup express wrongly lol

#

retard fetch is for get requests

mossy vine
compact oriole
#

oh

#

your bot has Not enough parameters, so the problem is Not enough parameters

#

well it doesnt have enough

#

as thats the only reason it would return 400

#

no shit

fluid basin
#

yeah well and you didnt add anything for it to do if it has enough

#

so it will get stuck on loading forever or timeout whichever comes first

restive furnace
#

better to start from basic stuff example making that it returns guild count etc. and then move into these things

mossy vine
#

it will return a basic 200 ok iirc

fluid basin
#

there isnt any res functions being called

#

so it just waits

#

you've got to send 200 on express for a 200

compact oriole
#

or just res.send

fluid basin
#

yeah res.send is 200

compact oriole
#

or res.status(200)

#

either one works

fluid basin
#

you check the numeric letters?

#

or split by dash if thats the only separator

cinder patio
#

split by -

fluid basin
#

I mean regex is the easiest

#

if you're using JS

cinder patio
#

const [name, index] = str.split("-");

for example. index will be undefined if there is no index

fluid basin
#

yeah that also works

mossy vine
#

500?

fluid basin
#

2xx is for ok stuff
3xx idk (redirects?)
4xx is client errors
5xx is server errors

mossy vine
#

1 1xx Informational response
2 2xx Success
3 3xx Redirection
4 4xx Client errors
5 5xx Server errors

knotty steeple
#

1xx some response
2xx success
3xx i put you here
4xx you fucked up
5xx i fucked up

earnest phoenix
#

copystrike

sudden geyser
#

3xx: Go away.

restive furnace
#

better auth methods? app.get("/s", function(req, response) { if (!req.query.auth) return response.status(401).json({"401":"Not enough parameters."}); if (!req.query.auth === 'SuperHero:Yahuu') return response.status(402).json({"402":"Wrong Creditentals"}); const cred = req.query.auth; response.status(200).json({guilds: "0", users: "0", chans: "0"}) // response.sendFile(__dirname + "/views/index.html");});

sage bobcat
#

One message removed from a suspended account.

restive furnace
#

wait lemme format it

fluid basin
#

gosh

#

imagine coding in one line

restive furnace
#
app.get("/s", function(req, response) { if (!req.query.auth) return response.status(401).json({"401":"Not enough parameters."}); if (!req.query.auth === 'SuperHero:Yahuu') return response.status(402).json({"402":"Wrong Creditentals"}); const cred = req.query.auth; response.status(200).json({guilds: "0", users: "0", chans: "0"}) // response.sendFile(__dirname + "/views/index.html"); });```
#

github copying bad

sage bobcat
#

One message removed from a suspended account.

fluid basin
#
app.get("/s", function(req, response) {
   if (!req.query.auth) return response.status(401).json({
    "401": "Not enough parameters."
   });
   if (!req.query.auth === 'SuperHero:Yahuu') return response.status(402).json({
    "402": "Wrong Creditentals"
   });
   const cred = req.query.auth;
   response.status(200).json({
    guilds: "0",
    users: "0",
    chans: "0"
   }) // response.sendFile(__dirname + "/views/index.html");});```
#

done

modest maple
fluid basin
#

no its just formatted

#

i mean why would you use get params

restive furnace
#

its express

fluid basin
#

ik

#

you can use authorization header if you want though

#

seems better to me imo

#

and it does support user pass style

restive furnace
#

k, lemme try

vital lark
#

params are /get_info/:id

valid frigate
#

oops wrong channel

vital lark
#

queries are ?q=aaa

earnest phoenix
#

that's very insecure

restive furnace
#

ik, so i was thinking how i could do generating uuids and then update it on the site tooå

tidal stone
#

Yo guys, did discord change the way on desktop on how to call a user? My bot finds users tagged with @ on mobile but on desktop it's not able to find them anymore? is it still discord_username and discord_id?

#
        const amount = args[2];
        const username = args[1];
        if(username.includes('@')) {
            var username_id = username.substring(2, username.length-1);
        }
        let userAddress = await Users.findOne({ where: { discord_id: username_id }});
        if(!userAddress) return msg.channel.send('Wrong username, try another one!');
        userAddress = userAddress.address;
        let reciever = bot.users.find('id', username_id);
        if(!reciever) return msg.reply('Wrong username, try another one');```
#

Thanks for looking and maybe knowing what changed...

fluid basin
#

hmm sometimes mentions starts with <@! and sometimes <@

#

idk whats the difference but you have to check I guess

#

which isnt handled in your current code

leaden void
#

Hey guys do you have a good C++ IDE for game programming ?

vital lark
#

hmm

#

@green kestrel think this is your cup of tea 🍵

green kestrel
#

This happened to my bot too

#

You need to search for both <@!id> and <@id> too now

#

Both are mentions

vital lark
late hill
#

yes

#

the ! is for when they have a nickname

green kestrel
#

Microsoft visual studio community

#

For game dev in c++

tidal stone
#

@green kestrel it always worked like this, its since today it suddenly only worked on mobile

#

Would it require big changes?

late hill
#

the ! is for when they have a nickname

#

Always been like that

#

Or at least for a very long time

#

I doubt it's a new change to mobile

tidal stone
#

Mmhm odd

#

Weird

#

So if i add ‘!n

#

‘!@‘

#

Should be ok?

late hill
#

<@!userid>

tidal stone
#

Okay thank you

late hill
#

Whatever library you're using probably has stuff you can use for mentions

#

So you don't even have to check like that anymore

tidal stone
#

Its old code ;p

green kestrel
#

@late hill no they changed the desktop client today

#

I noticed another change that came with it, the input box primitively previews markdown you enter

#

So if you put *test* it will italicize the word test in your input box

#

Or at least, I got the affected update today, woke up to 300 entries in my dB with mentions in them

trim rapids
#

Hey so Im using discord JS
where do I find Boats.postStats('SERVER_COUNT'

#

do I leave that empty?

placid iron
#

@hushed quarry i think can that occour ( returning None for get_user() ) if they have blocked the bot?

leaden void
#

i'm too lazy to solve this damn problem with visual studio code

#

"update the include path"

#

when i write #include <iostream>

mossy vine
#

is there a quick fix available?

hushed quarry
#

@placid iron there are unlimited possibilities

#

there is not enough information

earnest phoenix
#

bit shift

#

to the left

#

So the flag that was 1 becomes 0?

mossy vine
#

no

earnest phoenix
#

:/

mossy vine
earnest phoenix
#

Ty

#

Wow this is hard

#

it's really not

mossy vine
#

its simple until its the first time you see it is in a competition and end up getting 0 points because you couldnt understand it on the spot

#

i mean what

earnest phoenix
#

lol

#

big mood

#

Bruh

mossy vine
#

we had to figure out what 32 bit assembly code does with given inputs

#

with jumps and shifts and shit

earnest phoenix
#

I don't really understand this system but it doesn't matter x)

#

play around with byte shifting

#

it's fun and you'll get it pretty quickly

mossy vine
#

unless you have to do it without a computer to see if you are even right

earnest phoenix
#

Without computer, i can dead with this

#

that's big mood

wispy vine
#

yo um how do i... like upload a script... of a .py... to a bot??

mossy vine
#

thats not how it works

wispy vine
#

thats what i mean how do i

mossy vine
#

your python scripts connects to discord with the token you give it

#

you dont have to upload the script anywhere

earnest phoenix
#

i had a competition in CS where we had an octal that had to be shifted to the right by 4 bits which means conversion which means no calculator

mossy vine
#

we didnt have calculators either

#

but at least the inputs were easy

#

hardest one was 42

wispy vine
#

isnt it something like discordpy.token = "sht goes here"

mossy vine
wispy vine
#

well googl's your friend xD

mossy vine
#

so is yours

wispy vine
#

true

earnest phoenix
#

what is up with my english today

#

i feel retarded

wispy vine
#

i talk faster than average therfore i fumble my words

#

(i called a penguin pengin, e.g.)

mossy vine
#

(can we try to stay on the topic of development tho, as we are in #development)

wispy vine
#

ok ok

slender thistle
#

any variable

#

What variable do you use for your client object

wispy vine
#

import discord

class MyClient(discord.Client):
#stuff here

client = MyClient()
client.run('my token goes here')

slender thistle
#

Yes

wispy vine
#

k thx

slender thistle
#

The token string is where you put your token

wispy vine
#

yeah

late hill
#

Oh

#

I see

#

It's using <@!userid> for any mentioned user now?

wispy vine
#

why is ma bot offline?

mossy vine
#

have you tried running the script

late hill
#

I mean if you previously had your bot set up so that it would work with nicknames that used @! then nothing should rly change to functionality

wispy vine
#

havent yet, just a sec

#

k done

#

aw poop

#

no thingy called discord

placid iron
#

@hushed quarry it was a yes no question...

hushed quarry
#

the answer is no

upper ember
#

@mossy vine I see you chilling in TOP DOT GEEEEEE GEEEEEE

mossy vine
#

@upper ember can you fuck off

upper ember
#

gladly

wispy vine
#

who dis dude @upper ember

upper ember
#

why my nickname is status ad mmLol

wispy vine
#

guys how do u do sudo in windows i forgot xD

slender thistle
#

Do you need it

wispy vine
#

yes

slender thistle
#

All you need is pip

wispy vine
#

example: sudo pip install --upgrade pip

modest maple
#

um

#

dude

slender thistle
modest maple
#

^^

west spoke
#

...

modest maple
#

@wispy vine do u actually know the basics of python?

earnest phoenix
#

hey guys! is there a way for bots to set their own custom statuses?

#

or is that restricted to user accounts only?

#

yes

#

(discord.js)

modest maple
#

no

#

not atm

earnest phoenix
#

and no, i'm not talking about client.user.setPresence

#

OH

#

ok nvm

#

im talking about the custom statuses recently implemented

#

yeah no

modest maple
#

no

mossy vine
#

user accs only for now, unless you have the patience to fuck around with inspecting and replicating api calls by users

earnest phoenix
#

oh damn

#

@mossy vine yeah pal i think that's a quick and easy way to get your bot termed

#

clearly its not available for bot users for a reason

#

at least i'd assume so

modest maple
#

depends

earnest phoenix
#

i mean, the update has been out for neraly a month now

#

and there is yet to be support for it in discord.js

mossy vine
#

yagpdb did it once, but im not saying its a good idea

modest maple
#

nothing wrong with Editing / building your own Module / lib

earnest phoenix
#

yeah, but i think there's a reason why bots don't have it

#

otherwise discord.js would have already added support

#

in a beta/stable build

#

considering the update has been out nearly a month now as aforementionedf

modest maple
#

its a bit hit or miss

#

but mostly cuz its hard to work with

empty owl
#

I guess they never miss huh

earnest phoenix
#

so, I know how to make a command that gives an output in text and all such. but if i wanted to make a make a marry command with json file and have that handle logging data for who married who, how would i set it up to send it to there and when some one "divorced" someone to have it removed?

#

lengthy...

slender thistle
#

Discord haven't made an official statement afaik so better not get shit headed your way

earnest phoenix
#

@earnest phoenix why are you using json

modest maple
#

DATABASES EXIST

earnest phoenix
#

and not a more maintained method of database

#

e.g mysql or mongoose

#

cos i dont like mongodb

#

mysql

#

and i am using Heroku

#

jake did say that bots are planned to get custom status but god knows when

#

glitch has mysql

#

just saying

#

¯_(ツ)_/¯

modest maple
#

glitch bad

earnest phoenix
#

depends on your usage scenario

#

i use it for one-server bots

#

that dont require

#

data storage

placid iron
#

@empty owl 😑

earnest phoenix
#

for actual bots that require datastorage, i upload them to my vps

#

hmm... ok so ill try mysql, but then again question still stands

#

uhhh

modest maple
#

go old school

#

pen and paper

#

and just

#

plan it out

earnest phoenix
#

work it out

modest maple
#

xD

earnest phoenix
#

yeah

#

plan it

modest maple
#

what i do

earnest phoenix
#

and then write the code

#

from that

#

thats what literally every competent dev does haha

#

well, most competent devs

#

you can still be competent and not do it

#

¯_(ツ)_/¯

slender thistle
#

Case to case basis be like

modest maple
#

wait till u do big projects xD

earnest phoenix
#

ok-

#

ya know

#

i've never actually made a bot for the public to use

#

will sqlite work?

#

literally all of my bots have either been for private use

#

or something else

#

e.g a test

#

😎

#

ew

#

my bot doesn't go online

#

why?

#

well firstly

modest maple
#

cuz u arnt running the code?

#

idk

earnest phoenix
#

check if the token is valid

#

secondly check if there are any errors

#

i feel like discord broke the gateway again

#

and thirdly idk

modest maple
#

discord have

#

well break

earnest phoenix
#

run the code

modest maple
#

they limited the rate of logins

#

cuz API is getting shat on again

earnest phoenix
#

i puted the token , but when i re enter in settings , it disappear...

modest maple
#

i puted the token?

earnest phoenix
#

@earnest phoenix what? are you using an application?

#

or are you genuinely coding? as I hear that is something an app does

placid iron
#

This is some juicy chat right now

modest maple
#

they left

earnest phoenix
#

i use DBD

#

Discord Bot Designer

#

we don't offer support with bot makers

modest maple
earnest phoenix
#

go complain to the developer

#

yeah, I recommend not using that... and as they said

summer torrent
#

Anyone get a "Socket hang up" error?

earnest phoenix
#

the gateway is having issues

modest maple
earnest phoenix
#

all you can do is sit and wait it out, possibly throw a tantrum

#

Sounds like a good idea

sudden geyser
#

Doesn't look any different from usual

modest maple
sudden geyser
#

come on, it's Discord

modest maple
stray wasp
#

lovely

placid iron
slender thistle
#

back at latency = sin(x)

surreal sage
#

does this work? i dont see any typo but i want to be sure before i test it lol js if (command === "eval" || command === "execute") { if(message.author.id !== botConfigs.ownerID) return; let args = message.content.split(' ').splice(1).join(' '); console.log('executed', args); message.delete(); eval(args) .then(m => m.delete(10000)) let evaled = eval(args) if (typeof evaled != 'string') { evaled = require("util").inspect(evaled) const embed = new Discord.RichEmbed() //fields .addField('Input :inbox_tray:', '' + args + '') .addField('Output :outbox_tray:', '' + evaled + '') .setColor('#ff1493') .setAuthor(`Axyx's EVAL Command`, 'https://cdn.discordapp.com/avatars/636812729222692880/a334d8a64b9081a9484ab14848898169.png') const embedmessage2 = message.channel.send(embed) embedmessage2 } }

modest maple
#

<Insert Try it and see video here>

surreal sage
#

lol

#

is the domain gone???

#

:/

sudden geyser
#

try it out and see (also copy and paste)

surreal sage
#

stop

#

it

#

i dont like that

#

i dont like you like that but i dont so you have to stop

sudden geyser
#

okay notlike

surreal sage
earnest phoenix
#

saying copy and paste doesn't mean that a person is being a dick

surreal sage
#

you do if you keep naming me like that

marble juniper
#

I can't even call this

#

spoon feeding

earnest phoenix
#

they literally told you to try it and see in a creative way

#

???

placid iron
#

@surreal sageso mad that he didn't do vocals for that one

marble juniper
#

the code works

#

you would know that it works if you would know how the code works

earnest phoenix
#

^

modest maple
earnest phoenix
surreal sage
#
            const embed = new Discord.RichEmbed()
            .setTitle('ERROR')
            .setColor('#ff0000')
            .catch(err => message.channel.send(embed))``` if theres a error. would it post this embed?
#

im a bit new to .catch(err)

pseudo whale
#

Yes

mossy vine
#

thats completely wrong

#

what the fuck

earnest phoenix
#

you're catching on the embed

mossy vine
#

^

earnest phoenix
#

lol

pseudo whale
#

Lol

earnest phoenix
#

think like a computer when you program

#

it's going to do what you tell it to do in order

surreal sage
#

so i have to like if a eval goes wrong: err => evaled?

#

or js .catch(err) { //code }?

mossy vine
#

oh god

surreal sage
#

try catch?

mossy vine
#

you are confusing Promise.catch and try-catch

earnest phoenix
#

oh no

surreal sage
#

try catch

#
try {
.catch(err) {

}
}```
earnest phoenix
#

please read this

surreal sage
#

thx

earnest phoenix
surreal sage
#

does my full code need to be in try { and catch err not in that?

earnest phoenix
#

rtfd

surreal sage
#
.catch(error => message.reply("Error. Contact an administrator."));```
earnest phoenix
#

i think you should read what cry said too

#

but yes, if whatever before that returns a promise then yeah

#

but you should learn proper error handling, and i'm very curious how you have been doing it the whole time without actually knowing what you were doing

surreal sage
#
    try {
    if (command === "eval" || command === "execute") {
    if(message.author.id !== botConfigs.ownerID) return;
        let args = message.content.split(' ').splice(1).join(' ');
        if(args === null) {
            message.reply('Please specify the code...')
        }
        console.log('executed', args);
        message.delete();
        eval(args)
        .then(m => m.delete(10000))
        let evaled = eval(args)
        if (typeof evaled != 'string') {
            evaled = require("util").inspect(evaled)
            const embed = new Discord.RichEmbed()
            //fields
            .addField('Input :inbox_tray:', '```' + args + '```', true)
            .addField('Output :outbox_tray:', '```' + evaled + '```', true)
            .setColor('#ff1493')
            .setAuthor(`Axyx's EVAL Command`, 'https://cdn.discordapp.com/avatars/636812729222692880/a334d8a64b9081a9484ab14848898169.png')
            const embedmessage2 = message.channel.send(embed)
            embedmessage2
        }
        }
    }
    catch (err) {
        const embed = new Discord.RichEmbed()
            .setTitle('ERROR')
            .setColor('#ff0000')
        message.channel.send(embed)
    }```
earnest phoenix
#

i would put the try before the actual eval and not the command checking/whatever is above

surreal sage
#

so: js if (command === "eval" || command === "execute") { try { if(message.author.id !== botConfigs.ownerID) return; let args = message.content.split(' ').splice(1).join(' '); if(args === null) { message.reply('Please specify the code...') } console.log('executed', args); message.delete(); eval(args) .then(m => m.delete(10000)) let evaled = eval(args) if (typeof evaled != 'string') { evaled = require("util").inspect(evaled) const embed = new Discord.RichEmbed() //fields .addField('Input :inbox_tray:', '' + args + '', true) .addField('Output :outbox_tray:', '' + evaled + '', true) .setColor('#ff1493') .setAuthor(`Axyx's EVAL Command`, 'https://cdn.discordapp.com/avatars/636812729222692880/a334d8a64b9081a9484ab14848898169.png') const embedmessage2 = message.channel.send(embed) embedmessage2 } } } catch (err) { const embed = new Discord.RichEmbed() .setTitle('ERROR') .setColor('#ff0000') message.channel.send(embed) }

#

?

earnest phoenix
#

sorry i should've been more specific, put the try right before the eval

surreal sage
#

try BEFORE or after?

#

before?

earnest phoenix
#

wait a minute

#

uh

#

message.delete();

#

then you do eval(args)

surreal sage
#

whats wrong?

earnest phoenix
#

then you try to delete an eval thinking it's a message ???

surreal sage
#

message.delete deletes the msg of the user

earnest phoenix
#

eval(args).then(m => m.delete(10000)) this line

surreal sage
#

ok

#

foxus on the try ok

#

is it ok or is it wrong?

earnest phoenix
#

dude you have more problems than just 1

surreal sage
#

where is the prob?

earnest phoenix
#

but if you want to ignore those problems, then put the try BEFORE the eval

surreal sage
#
    try {
    if (command === "eval" || command === "execute") {
    if(message.author.id !== botConfigs.ownerID) return;
        let args = message.content.split(' ').splice(1).join(' ');
        if(args === null) {
            message.reply('Please specify the code...')
        }
        console.log('executed', args);
        message.delete();
        eval(args)
        let evaled = eval(args)
        if (typeof evaled != 'string') {
            evaled = require("util").inspect(evaled)
            const embed = new Discord.RichEmbed()
            //fields
            .addField('Input :inbox_tray:', '```' + args + '```', true)
            .addField('Output :outbox_tray:', '```' + evaled + '```', true)
            .setColor('#ff1493')
            .setAuthor(`Axyx's EVAL Command`, 'https://cdn.discordapp.com/avatars/636812729222692880/a334d8a64b9081a9484ab14848898169.png')
            const embedmessage2 = message.channel.send(embed)
            embedmessage2
            .then(m => m.delete(10000))
        }
        }
    }
    catch (err) {
        const embed = new Discord.RichEmbed()
            .setTitle('ERROR')
            .setColor('#ff0000')
        message.channel.send(embed)
    }```
tacit stag
#

is discord down?

surreal sage
#

no

tacit stag
#

one of my bots wont go online

surreal sage
#

update

earnest phoenix
surreal sage
sudden geyser
#

It could be Discord or a problem with your code

surreal sage
#

yeah....

tacit stag
#

looks like it connected finally, just took like 4 attempts at reconnecting

surreal sage
#

works

#

that script just works lol

pseudo whale
#

@tacit stag Discord api is being weird again. A lot of bots are down

tacit stag
#

gotcha.

modest maple
#

welcome to the basics of JS

west raptor
#

I had a few disconnects but they all resumed

#
#[command]
fn prefix(ctx: &mut Context, msg: &Message, args: Args) -> CommandResult {
    if args.is_empty() {
        msg.reply(&ctx, "You did not input a prefix")?;

        Ok(())
    }

    let new_prefix = args.current().unwrap();

    crate::db::update_prefix(msg.guild_id.unwrap().0 as i64, new_prefix.to_string());
    
    Ok(())
}``` having issues with the `Ok(())` in the if statement `settings.rs(14, 9): expected (), found enum std::result::Result`
#

removing the if statement entirely fixes the issue

#

as well as just removing the Ok(())

#

but if im not returning anything inside that if statement it will just continue on

#

and panics at new_prefix if nothing is provided

lapis merlin
#
client.on('message', message => {
    // mensagem em dm
    if (!message.guild) return;
    // comando    
    // uns bgui aew
    const user = message.mentions.users.first();
    // membro mencionado true
    if (user) {
        // pega os bagui de user
        const member = message.guild.member(user);
        // membro guild true
        if (member) {
            member.kick('salva no audit log').then(() => {
                // funfo
                message.reply(`Usuário expulso com sucesso: ${user.tag}`);
            }).catch(err => {
                // um erro
                // bot no perm,
                // user no perm in role 
                message.reply('Eu não tenho permissões suficientes!');
                // Log the error
                console.error(err);
            });
        } else {
            // nao ta na guild
            message.reply('Esse membro não está nesse servidor!');
        }
        // sem mençao
    } else {
        message.reply('Mencione um usuário!');
    }
});```
west raptor
#

what

lapis merlin
#

help me

west raptor
#

with..?

marble juniper
#

where is the problem

#

please explain what you need help with

lapis merlin
#

I want to deprive this command only for users with permission KICK_MEMBERS

#

,-,