#development

1 messages ยท Page 604 of 1

lusty dew
#

I always wondered

west spoke
#

I'm just using a example that would reference a different type of code

lusty dew
#

in python can you do

#

import ./commands/help.js

west spoke
#

Yeh

lusty dew
#

provide a path

#

Mk

west spoke
#

Wait

#

Not using js

#

Not compatible

lusty dew
#

Ye I know

#

Lol

west spoke
#

x3

lusty dew
#

I didn't mean to put .js

west spoke
#

Yeh I'ma start using that as separate commands soon

lusty dew
#

I am just used to using js more then py

uneven scarab
#

so i need a command handler to do custom commands?

lusty dew
#

wait no

west spoke
#

No

#

Custom commands you make from scratch

#

Like profile customization, you strip off the command prefix and name

uneven scarab
#

but how is my question

west spoke
#

And have the rest be put in it

lusty dew
uneven scarab
#

i mean custom commands like you can add with nightbot

west spoke
#

Oh

lusty dew
#

Oh uhm

west spoke
#

That's gonna be p hard tbh

lusty dew
#

Ye

#

You have to be able to save it in a db or something

west spoke
#

Ye

lusty dew
#

then when they try and use that command call it from the db

west spoke
#

I'd recommend firebase or s3

uneven scarab
#

Imma just look at YT lol

west spoke
#

Bad idea

#

Tbh

lusty dew
#

Yea

uneven scarab
#

why

west spoke
#

Either outdated, or irrelevant

lusty dew
#

Not really

west spoke
#

Waste of time honestly

#

Meh

lusty dew
#

It isn't that it is outdated or irrelavant

#

you'd just be copying the whole thing

#

and not knowing what it does

west spoke
#

Wouldn't learn

#

Yeh

lusty dew
#

cause they don't explain it

west spoke
#

Likely

uneven scarab
#

i can now do the case stuff off by heart

west spoke
#

^

lusty dew
#

Ye

#

Pretty much what I said but a lot more

#

xD

west spoke
#

Yeh

lusty dew
#

Question though

#

Can't you make JS and Python work together?

west spoke
#

Honestly if you want users to be able to make custom commands

#

I thinkb

lusty dew
#

iirc mee6 does that

#

they use python and js

west spoke
#

But you might have to install packages and tie in API

fiery stream
#

ohh hi

west spoke
#

They may use separate scripts for different commands

lusty dew
#

Do you have a question Jazz

west spoke
#

^

lusty dew
fiery stream
#

actually if u can answer the is a question

#

there*

west spoke
#

What is it, and what lang

fiery stream
#
    var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
    var timestamp = time; // UNIX timestamp in seconds
    var time2 = new Date();
    time2.setTime(timestamp*1000); // javascript timestamps are in milliseconds
    var dayOfWeek = days[time2.getDay()];
    return time2.set(timeID, dayOfWeek);
  }```
#

the function isnt working

uneven scarab
#

=>

west spoke
#

^

uneven scarab
#

arrow function?

fiery stream
#

problelm is

#

location.js:101 Uncaught (in promise) TypeError: time2.set is not a function

lusty dew
#

Hm

west spoke
#

time2 = (API for this?)

#

Idk

lusty dew
#

dpm

west spoke
#

Idk much about js

uneven scarab
#

is this JS

west spoke
#

But I trY

#

It is

lusty dew
#

don't you need to define what timeID is?

west spoke
#

It definitely isn't py

uneven scarab
#

okay

#

I still dont know shit

fiery stream
west spoke
#

Error message isn't correct if it was py

fiery stream
#

thats all code

west spoke
#

Wait

#

Is this for a bot

lusty dew
#

window

#

I don't think this is for a bot

fiery stream
#

not really

lusty dew
#

mk

#

Well let me take a look at it

west spoke
#

Then... Go to stack idk

#

xd

fiery stream
#

thats rude

lusty dew
#

You can ask other development questions here

fiery stream
#

lmao

lusty dew
#

This isn't just for bots

#

I have asked html questions here

west spoke
#

Idk

fiery birch
west spoke
#

^

lusty dew
#

I have asked plenty of other questions unrelated to bot development

fiery birch
#

thats the intent of the channel, but i mean people can ask other things too

lusty dew
#

Never got yelled at

west spoke
#

Yeh

#

Tru

#

But I mea-- know what I never help so I'ma just g o

lusty dew
#

i am not sure what api he is using

#

tbh

west spoke
#

^

fiery stream
#

anyone know whats the prob

lusty dew
#

No sorry.

earnest phoenix
#

This code is throwing errors. I'm still using Discord.js, but I followed the script on the official documentation website

west spoke
#

What's the error message

lusty dew
#

oof notepad ++

earnest phoenix
#

also i know notepad++ isn't the best but at least i'm not using the original notepad like i was before

west spoke
#

...

#

K idk oof

fiery stream
#

off

lusty dew
#

You are sending it wrong

#

it isn't

fiery stream
#

@earnest phoenix new isnt needed

lusty dew
#

message.channel.send(${message.author}, attachment)

earnest phoenix
#

it's on the official documentation page that it's needed

lusty dew
#

attachment is a string

#

and so is message.author

#

so you concatenate it

fiery stream
#

i can say that for sure new isnt needed

#

what is it suppose to reply

lusty dew
#

and why don't you just put the url

#

in a string

#

instead of using attachment()

west spoke
#

meh

earnest phoenix
#

It's supposed to tag the user who sent the command and send the "father i crave cheddar" image

west spoke
#

...

#

Why

fiery stream
#

const attachment = "";

west spoke
#

Just

#

Why

fiery stream
#

thats all u need

lusty dew
#

Yea

earnest phoenix
fiery stream
#

const attachment = "";

#

try that

lusty dew
#

Don't use attachment()

fiery stream
#

that should workd

#

only const attachment = "";

lusty dew
#

and you are using ir wrong anyway

#

it isn't

#

attachment()

#

it is

earnest phoenix
lusty dew
#

new Discord.Attachment(file, name)

#

new Discord.Attachment(file, name)

earnest phoenix
#

I'm taking these from the official website. I've never done Discord.js before today

fiery stream
#

can u send all code in haste bin

west spoke
#

Learn the language before creating a bot

#

@fiery stream no

fiery stream
#

blur your token

#

@west spoke

lusty dew
#

Well.

fiery stream
#

what

lusty dew
#

If I am looking at this right

#

you need a file anyway

west spoke
#

Don't spoon-feed

lusty dew
#

not a url

fiery stream
#

@west spoke what u mean by that

lusty dew
#

But I could be looking at this wrong

west spoke
fiery stream
#

ohh i was just gonna say i know what u mean

west spoke
#

xd

fiery stream
#

lol

earnest phoenix
zealous veldt
#

gotem

earnest phoenix
#

;-;

#

i've been working on this mess of a bot all day

lusty dew
#

I was just going by the docs

#

lol

earnest phoenix
#

that's the official documentation

lusty dew
#

By what documentation>

#

?*

earnest phoenix
lusty dew
#

No?

earnest phoenix
lusty dew
#

Ah mk

#

you are using that

#

Lol

earnest phoenix
#

trying to use it

#

but i have no clue what the hell im doing

lusty dew
#

do you even have

#

that part

earnest phoenix
#

at the very top of my code

lusty dew
#

if you already have client defined

#

then you don't need to include client

#

Show full code

#

Not partial

earnest phoenix
#

so i dont have the exact text apparently

#

one sec

#

it doesnt have my bot token or anything

lusty dew
#

I am not downloading that

earnest phoenix
#

you wanted the full code

#

its just an updated version of the file that i sent a few hours ago

lusty dew
earnest phoenix
#

and no, i dont expect you to write it for me

lusty dew
#

Put your code in one of those links

#

and save it

earnest phoenix
lusty dew
#

then send the new url

#

Hmph

earnest phoenix
#

yes i know it looks horrible

#

because i have no experience with coding

#

most of this was done from a tutorial

west spoke
#

learn how to code in that language before making a bot

#

Just a tip

lusty dew
#
        let img = new Discord.Attachment = ('./resources/cheddar.png');
    message.channel.send(`${message.author}` + img});
earnest phoenix
#

i think that has an invalid left side assignment?

#

is that what its called?

#

the "new discord.attachment" part

lusty dew
#

Hm wait what

#

Odd....

#

I thought you would remove the = by Discord.Attachment mmLol

earnest phoenix
#

I only know how to make a basic message send script

last maple
#
let body = {"url":"https://media.tenor.com/images/7aec1c8df8b5653666483320ed50fdd8/tenor.gif"}
return message.channel.send(body.url);

Or you can try that (but I think you need superagent)

#

But replace the link by the link of the picture

earnest phoenix
#

I'm using Discord.js, would that work?

lusty dew
#

mean yes

#

but you don't have to put it in an object

#

you could just make it a string

#

Which is what I tried telling you earlier but you were so set on the Attachment thing

earnest phoenix
#

As I said I have No Fucking Clue how to use javascript or discord.js other than basic stuff

#

and stuff learned from a tutorial

lusty dew
#

I literally gave you it as well

#

and making a string is pretty basic

#

it is literally doing

#

let something = ""

earnest phoenix
#

is it defining a variable?

lusty dew
#

let something

#

something is the variable

#

and you are assigning it a value by doing =

#

the value you are assigning it is a string

#

so the string is stored into the variable to be used somewhere else

#

๐Ÿ‘€

earnest phoenix
#

bruh can i steal that

lusty dew
last maple
#

Yup

lusty dew
#

Jkjk

earnest phoenix
#

thank

last maple
#

Np

#

Btw, idk how to edit a message with the bot :/

#

Edit his message (like to do a ping command)

lusty dew
#

well

#
message.channel.send("Hello").then(msg => {
msg.edit("Goodbye")
})
#

is one way to do it

last maple
#

Thanks x)

lusty dew
#

iirc

#

let me check

#

lol

#

Yea it is

last maple
#

x)

earnest phoenix
#

I Cannot Get The Loli Command To Work

#

So It Has Been Abandoned

last maple
#

oof

#

But why it doesn't work ?

#

:/

#
if(messageArray[0] === "!loli") {
    let body = {"url":"https://media.tenor.com/images/7aec1c8df8b5653666483320ed50fdd8/tenor.gif"}

    let loliEmbed = new Discord.RichEmbed()
    .setDescription(`FBI OPEN UP !!!`)
    .setImage(body.url)
    .setColor("#d604cf")

    return message.channel.send(loliEmbed);
}

@earnest phoenix Try this code

#

You can replace "!loli" by what you want

lusty dew
#

This is considered spoon feeding

#

and looking at their code

#

it would be

#

if(command === `${prefix}loli) {...}

last maple
#

But, command = messageArray[0]

#

x)

lusty dew
#

No

#

They don't even have

#

messageArray[0]

#

defined

#

so it would error

last maple
#

ah x)

#

sorry

#

I've lost

#

Then...

#
let messageArray = message.content.split(" ");

if(messageArray[0] === "!loli") {
    let body = {"url":"https://media.tenor.com/images/7aec1c8df8b5653666483320ed50fdd8/tenor.gif"}

    let loliEmbed = new Discord.RichEmbed()
    .setDescription(`FBI OPEN UP !!!`)
    .setImage(body.url)
    .setColor("#d604cf")

    return message.channel.send(loliEmbed);
}
#

Try this one

lusty dew
#

My guy

#

Stop

last maple
#

Ok, ok

lusty dew
#

You are spoon feeding

#

and that code won't work

#

I mean it would but they already have command defined

#

so it would be pointless to define messageArray

last maple
#

Ooh ok

late hill
#

wtf where's the ; ๐Ÿ˜ก ๐Ÿ˜ค

lusty dew
#

; isn't really needed in js

late hill
#

Aware

earnest phoenix
#

I tried repairing it but I don't think it works in Discord.js

lusty dew
#

It does

#

Show me how you are trying to do it

late hill
#

In your lastest hastebin you have 4 message listeners

#

why

lusty dew
#

Oh shoot

#

Didn't even notice that

#

Yea why are you using 4 message events

#

you only need one

earnest phoenix
#

this is what im doing with it

#

i changed the thing that triggers the command and stuff

#

probably incorrectly, but meh

lusty dew
#

Only use one message event for one

#

not 4

late hill
#

Can I just

#

Suggest not using notepad

#

thanks

earnest phoenix
#

I'm using it because i'm used to the interface

#

I used it back in 7th grade

#

At least I'm not using Windows notepad like I was

lusty dew
#

It has no linter though

#

use vs code

#

or something

late hill
#

Understanding the interface of most editors shouldn't be that hard

lusty dew
#

even atom is better then notepad++

late hill
#

Unless you're like my grandma or something, I'm sure you'll be fine

earnest phoenix
last maple
#

gg

lusty dew
#

Mk still

#

Use a program that has a linter

#

not notepad++

earnest phoenix
#

I'll consider it. Probably won't switch today, but will switch eventually.

idle basalt
#

use your eyes to lint ๐Ÿ™Œ

lusty dew
#

if you don't you are setting yourself up for failure xd

#

imo at least

#

a linter is helpful

#

and syztum I tried that once

#

it sucks

#

my eyes stopped working

idle basalt
#

lul

lusty dew
#

they had to update and I hated the new update

#

๐Ÿ‘€

idle basalt
#

my eyes only downgrade pepehands

lusty dew
#

Lol

#

I want some safebooru

#

Lel

earnest phoenix
#

Is there a link here rhst would help me make a bot that i added to my discord make posts automatically for daily things?

exotic badger
#

Use a loop with a 3600*24 second sleep period

earnest phoenix
#

Ok can i dont know anything about discord formatting and im using just my phone is there a way to do it on my phone or no? Lol basically can you dumb that down for me

languid dragon
#

you dont make a bot on mobile

#

not without extreme difficulty

fiery stream
#

๐Ÿ‘‹

earnest phoenix
#

Im not making a bot im taking a bot already built and trying to automate it

fiery stream
#

Thats easy if in python

earnest phoenix
#

Will subscribing it to certian channels work

fiery stream
#

Yep with db

lusty dew
#

Stop

fiery stream
#

I didnt mean to send it

earnest phoenix
#

whenever i do <:emojiname:emojiid> ofc replacing the values, it doesn't show the emoji, am i doing it wrong

zealous veldt
#

hmm

hushed quarry
#

works for me

#
  • does the bot have access to the emoji?
  • does the bot have permission to use external emotes?
amber fractal
#

Wait how that async eval tho

zealous veldt
amber fractal
#

is that seriously it?

#

I've been trolled

zealous veldt
#

Guide to Making Your Bot Appear Online on Discord Bot List after the Outage
Due to the outage/server orphaning that occurred earlier today and affected this guild, most bots on the website show as offline, regardless of whether the bot is actually offline. Details on how to fix it are below.

For sharded bots
If your bot is sharded, all you have to do restart the shard that this guild is running on.

For non-sharded bots
If your bot is not sharded, restarting the bot should fix it.

Note that the change will not be visible on the site immediately due to our caching.

earnest phoenix
fiery birch
#

shut up owobear

amber fractal
earnest phoenix
#

:c

#

Im being cyber bullied

lusty dew
#

Is there anyway I can shorten that?

#

I crossed out stuff I thought was nsfw

amber fractal
#

Jesus why tho

lusty dew
#

Lol

#

Wym why?

amber fractal
#

first off it's nsfw 2nd it's furry porn smh

#

anyways what do you need shortened

lusty dew
#

The tags

#

I want to shorten the tags

#

It is too big making the embed too huge

amber fractal
#

๐Ÿคฆ but how do you want to shorted them

#

like how many tags

lusty dew
#

Like 10-15 and at the end have view the rest of the tags here

#

I can link the url myself

amber fractal
#

I'm guessing whatever it is that you're using, please don't tell me, has an array of tags?

lusty dew
#

Ye

#

It is an array

amber fractal
#

<Array>.length = (some length)

#

then just join it like regular

lusty dew
#

Ah mk

#

Thanks

amber fractal
#

idk why I helped, but np

lusty dew
#

Lmao

#

At least I crossed out anything nsfw

west spoke
#

@lusty dew 2girls is nsfw

#

Btw

lusty dew
#

Not really

west spoke
#

Aaand raspbian can't install pip

lusty dew
#

It can be 2 girls on a park bench

west spoke
#

Great

lusty dew
#

for all you know

west spoke
#

Ok stop trying to make It innocent

lusty dew
#

Lol

#

And google your problem

amber fractal
#

It cant be innocent

lusty dew
#

Shhhh

amber fractal
#

You didnt do a good job at crossing it out

uneven wren
#

hey, i wonder if anyone can direct me to the proper documentation for programming and setting up a donate button for the site. just dm me.
my bot looks like its starting to blow up and my wife is gonna blow up if i dont add that button soon lel.

lavish abyss
#

Hey guys, can anybody help me with cronjobs for my bot right quick?

oblique edge
#

@lavish abyss if you provide a little more detail, then sure

lavish abyss
#

I got it sorted out, the directory did not have execute permissions, i just did sudo chmod +x DIRECTORYNAMEHERE

#

@oblique edge ^

oblique edge
#

ah ๐Ÿ‘

lusty dew
#

can someone help me with cheerio lol

#

it looks so weird

hollow hamlet
#

hello everyonee!!

#

i need help with making a bot

#

how i can Set up in a bot 24/7 ??

lusty dew
#

VPS

soft cove
#

how does one shard a bot? Like a Discord Bot sharding book for dummies

hollow hamlet
#

i want to know how i can create set a 24 / 7 bot

#

permanent online,

soft cove
#

Virtual Private Server

#

thats how to get your bot online 24/7

hollow hamlet
#

ohhh okay...

#

i need to pay?

soft cove
#

some yes

lavish abyss
#

google "Google Cloud compute" @hollow hamlet

soft cove
#

some no

lusty dew
soft cove
#

ok thanks

lusty dew
#

Yea

#

Np

soft cove
#

i have a question, mind if i DM you?

lusty dew
#

Why not state it here?

soft cove
#

nvm

#

ok

#
/*
    The following code goes into it's own file, and you run this file
    instead of your main bot file.
*/

const Discord = require('discord.js');
const Manager = new Discord.ShardingManager('./YOUR_BOT_FILE_NAME.js');
Manager.spawn(2); // This example will spawn 2 shards (5,000 guilds);

where would i put something like this?

#

like what file

lusty dew
#

in a file called

#

shardManager.js

#

but I would read

#

this

#

it gives you a better rundown

soft cove
#

ok

short trellis
#

how to confirm email to add bot

oblique edge
#

@hollow hamlet if you dont want to pay, you can host the bot locally, but then you run into limits with your own infrastructure

lusty dew
#

Rip your cpu

#

and mem

oblique edge
#

Ehhhhh

#

Depends on the bot

lusty dew
#

Not really

#

depends on how many servers it gets into

#

Lol

oblique edge
#

And that

lusty dew
#

Whos bot is that?

#

I forgot how made that bot

#

Lol

hollow hamlet
#

i'm back

#

Okay... let me see...

#

so, if i can do the bot online 24/7 local but i need to stay my pc online 24/7?

oblique edge
#

or another device 24/7

hollow hamlet
#

okay,,,, i see,

#

or.. i need to pay for a VPS

oblique edge
#

correct

hollow hamlet
#

how much cost the service?

unique nimbus
#

Mine costs 3 euros a month however its EU only

lusty dew
#

use a vpn when buying it

#

jkjk

hollow hamlet
#

but vpn is for the internet e_e

#

or not only?

slender thistle
#

Small VPS are 1-5 USD/EUR, check pins for some good hosting websites

unique nimbus
#

I use Scaleway

hollow hamlet
#

okay i see

oblique edge
#

I self host on my home server, and when I expect a potential issue with my home infrastructure, I just start the bot up on my personal server at our datacenter

dusky olive
#

How does the discordbots api knows how much servers the bot is in?

idle basalt
#

you tell it

dusky olive
slender thistle
#

Bot developers send server count to DBL

earnest phoenix
#

@hollow hamlet localhost are good

#

stay your pc online doesn't cost anything

#

and if you have a good connection the bot stay online 24h/7j

lusty dew
#

Rip cpu and mem though if your bot gets too big

earnest phoenix
#

For that you get a vps then ^

lusty dew
#

Lel

earnest phoenix
#

My bot only has 193 guilds but ye

#

Its on a vps since 50 guilds xd

hollow hamlet
#

but, I have to pay the electricity bill at the end of the month
the bot doesn't give me the money to pay :b

hard tendon
#

Again I got a problem xD

#

here is the code

hollow hamlet
#

or i can generate money if my bot are online?

hard tendon
#

Problem: Nothing writes in the file and the embed does not appear in the chat

#

any ideas why?

#

any1?

hollow hamlet
#

i'cant help you with your problem @hard tendon sorry,

#

Try to search your problem in google

hard tendon
#

I did

#

nothing came up

hollow hamlet
#

or duck duck go, or Bing

#

you tried Duck duck go or bing?

earnest phoenix
#

dont use json as a database problem solved

hollow hamlet
#

๐Ÿ˜† ๐Ÿ‘

earnest phoenix
#

so, i'm working on a say command for my Discord.JS bot with canvas, and one problem that I am running into is that if you want to @ someone it will write it as <@!ID>... Ik why this is, i just don't know how to fix it

#

my bot is @snow haven

hard tendon
#

simple

#

what are u using discord.js or?

earnest phoenix
#

Discord.JS

hard tendon
#

cool

#

so can u show me the code

earnest phoenix
#

not much... but considering that this is my first try I'm rlly happy with what I got so far

hard tendon
#

at what line does it display the id of the user

#

what ilne is that in the code

#

I cant seem to find it

spring ember
#

you can do ```js
await client.fetchUser(id)

earnest phoenix
#

It's just when the user gets @ed

#

bs.say anymention @earnest phoenix

#

oh wait

#

XD

spring ember
#

Mentions are in the message properties

earnest phoenix
#

ahh, so will this work with the ping in any position?

spring ember
#

message.mentions.users / message.mentions.members

#

Depends on the type you want

#

Yes it will

earnest phoenix
#

It's mainly just so if someone wants to ping someone their name can show up

#

(node:8917) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined

#

even if i put in message.mentions.users / message.mentions.members

spring ember
#

It doesn't have anything to do with my suggestion

#

The error

earnest phoenix
#

await client.fetchUser(id)

spring ember
#

Oh

#

I meant you first fetch the id

#

Somehow

earnest phoenix
#

ehhm might just drip it

#

*drop

quartz kindle
earnest phoenix
#

thonkku i've been looking at the wrong docs page

quartz kindle
#

you can use the built in regex expressions to scan your message, and then get the user from the members collection

earnest phoenix
#

thats probs a better idea than parseing the info

#

ok, that worked ๐Ÿ‘Œ

#

thx

earnest phoenix
#

I'm havin a problem which makes it say "channel.send is not a function" smh

#

and it's only on some things

lusty dew
#

Show code

#

And full error

#

@earnest phoenix^^^

earnest phoenix
#

o

#

its when invited to guild btw

lusty dew
#

Mk show code and error

earnest phoenix
#
let channel = guild.channels.first();
let embed = new Discord.RichEmbed()
.setTitle("ex")
.setDescription("Hi");
if(channel) channel.send(embed);
#

and

lusty dew
#

I can already see the problem

unique nimbus
#

Shouldn't there be a ; after setTitle

earnest phoenix
#
TypeError: channel.send is not a function
#

gg

#

nah

lusty dew
#

No

#

That will stop the bottom line

#

And it will error

#

And

#

It Is message.guild.channels

#

But may I ask

earnest phoenix
#

its on guild join

lusty dew
#

What channel are you trying to send it to

earnest phoenix
#

not command

#

:3

latent willow
#

It's probably a voicechannel you try to.send() on

lusty dew
#

Oh

#

@latent willow didn't think about that

#

Lol

earnest phoenix
#

oof

#

ima try that

#

xD

latent willow
#

You'd have to filter the first text channel you have perms to write in if you wanna do that
But pretty sure in that case it just wasn't a type text channel

earnest phoenix
#

will only try send if its text type now >):

#

if no perm then it says DiscordAPIError: Missing permissions tho

latent willow
#

Catch it :>
Or check if the bot has perms before sending the embed

earnest phoenix
#

yeah catchin as well ๐Ÿ˜‰

#

made so it checks type cuz it would make sence there's no .send in voice channel so

#

but thx evrywan

#

+10iq

dusky olive
#

Instead of a number

#

Some bots got that

earnest phoenix
#

thats certified

#

i think

dusky olive
#

Oh tnx

calm token
real portal
#

uh

#

you must use

#

and paste code in this marks

#
const x = 666
calm token
#

Aaaaah okay !!!

#
const
#

Ohw

#

thanks

real portal
#

and now question... why on phone this not working uhh

calm token
#

:/

#

idk

real portal
mossy vine
#

because discord needs to support the app for many platforms, and highlighting is not available on mobile

real portal
#

:(

west spoke
#

Ye unfortunately

#

that's why you use embed images with the color

#

ez way

earnest phoenix
#

@calm token

#

you can use "css" for all text green

calm token
#

Yes ?

#

Really ?

earnest phoenix
#

and diff for red text

#
- red text (with '-')
+ Green text (with '+')
thx diff
calm token
#
Hello
zealous veldt
#

Not here please

calm token
#

Okay sorry

earnest phoenix
#

ok

#

verify my bot please ๐Ÿ˜‚ ;-;

grim aspen
west spoke
#

^

#

...

half spear
#

Would an urban dictionary command be allowed if it only works in NSFW channels?

earnest phoenix
#
            if (message.author.id !== AuthorID) return message.channel.send('Command Only for Bot Owner !')
``` its ok ?
#

(nodejs)

#

Hello

#

can somebody help me please

#

i have an OUATH2 /@me get request error 401

#

i cant get it with the access_token

#

what are you using to code the bot?

#

discord.js

#

You need to be specific so people can help you, dear.

#

ok

#

const json = await responsey.json();

      const fetchDiscordUserInfo = await fetch('http://discordapp.com/api/users/@me', {

headers: {
Authorization: Bearer ${json.access_token},
}
});
const userInfo = await fetchDiscordUserInfo.json();

#

i have this code and i want to get the user info and put it to a variable called userInfo

#

and i get 401 error

slender thistle
#

https

earnest phoenix
#

oh

#

really??

slender thistle
#

Try it out

earnest phoenix
#

let me try ok

grim aspen
#

@earnest phoenix for what command? yes it's ok, because it finds the owner id and if the person with the incorrect id tried to use the command, it would send that message to that person

earnest phoenix
#

it didnt work @slender thistle

#

@grim aspen for protect eval cmd

grim aspen
#

it would be correct

#

ok*

earnest phoenix
#

@earnest phoenix

`const json = await responsey.json();

      const fetchDiscordUserInfo = await fetch('https://discordapp.com/api/users/@me', {

headers: {
Authorization: Bearer ${json.access_token},
}
});
const userInfo = await fetchDiscordUserInfo.json();
`i have this code and i want to get the user info and put it to a variable called userInfo
and i get 401 error

grim aspen
#

next time put the code in the code bracket ^

earnest phoenix
#

ok ๐Ÿ˜‚

#

or stop copypasting the same snippet 400 times

#

ok but it was just 2 times

#

why would u mention me I know jack shit about proper coding i only know basic messaging and embed messages

#

ok

#

sorry bro

#

it's fine

#

provide your entire method

#

just giving fair warning because I'm new to discord.js

#

ok

#

also hate to interrupt but how do you tag a mentioned user in a discord.js message

#

i know how to do command author but not mentioned user, and google is giving me outdated responses

mossy vine
#

<@userid>

slender thistle
#

@earnest phoenix Bearer -> Bot

earnest phoenix
#

but how to collect the user ID?

#

ok let me try shivaco thanks

mossy vine
#

message.mentions

#

read the docs for more on that

earnest phoenix
#

no lol bearer is for oauth, stop helping without reading whats the problem

#

which docs? the official documentation?

mossy vine
#

yes

#
slender thistle
earnest phoenix
#

it didnt work bro

#

wait i forgot to change

#

sorry

#

still didnt work

#

yes /api/users/@me is an endpoint available to both lol @slender thistle

#

bot tokens are for bots

slender thistle
#

I get 401 when using Bearer

earnest phoenix
#

yes

#

@earnest phoenix i told you probide your entire method

#

me too but i still get when i try bot

#

@earnest phoenix what does it mean lol

#

i am really new to oauth2

#

provide your entire function

#

low iq hours

#

ueah

#

@slender thistle because bearer is for oauth. you need an access token

#

ohh

#

a little question

#

how can i get access token @earnest phoenix

#

i am using json.access_token

#

(defined json)

#

noone?

#

ok...

#

after the user authorizes your app your user will get redirected to your website with a url param named code, exchange that for an access token by calling /api/oauth2/token

#

stop being impatient jesus christ

#

sorry ๐Ÿ˜‚

#

let me try

#

i understanded the issue @earnest phoenix the code is ok but i cant get the access_token

#

it gives undefined

#

print out the response and see what you get

#

ok

#

undefined

#

i still get undefined @earnest phoenix

#

please ping me when you read my message

#

because i know memory leaks are bad

unique nimbus
#

I don't know js but I think that you got a leak because you don't have enough Listeners

#

however idk

mossy vine
#

oh god

#

oh god no

#

@earnest phoenix please dont tell me you have a client.on('message' ... for every command

earnest phoenix
#

I realized what it meant just after I sent that

#

I have the command types sectioned off

#

very stupidly

#

How do I write it into my code to increase listener allowance

mossy vine
#

you should have 1 message event, and check for commands in there

earnest phoenix
#

yeah i just put them all together

#

i am An Idiot

#

i just did a lot of screaming because i forgot one of the client.on things

pale compass
#

I have a question because I made a slots command that works and you get the coins etc. but sometimes the command does not respond and nothing comes.
CODE: https://hasteb.in/agejexop.js

idle basalt
#

probably because youre using json as a database

there should be an error though

pale compass
#

Why have I done so many commands with JSON making the operation perfect.

idle basalt
#

youre right. json is a perfect database and is not at all prone to corruption based on your immense wealth of experience

mossy vine
#

actually, the reason it can get corrupted is if you read and write at once

#

which can be avoided if youre smart enough

west spoke
#

asyncio.sleep(0.9)

#

Ez

idle basalt
#

maybe its because youre trying to use english but the english language if statement is weapped in the german if statement

unique nimbus
#

it shouldn't be that

idle basalt
#

yea but thats very hard to avoid cyber, especially on a discord bot that has multiple users

west spoke
#

Or use a db like s3 or firebase

#

Can also be used to link to a website

#

Since it writes and then does literally nothing until the next command

blazing crypt
#

how do you set the bots Playing Game bit
in discord.js

hushed quarry
blazing crypt
#

Thanks!

hushed quarry
grim aspen
#

i was wrong on that one

lofty hamlet
#

Hi :

#

My code has a problem

#

My bot his reactions

mossy vine
#

so whats the problem?

lofty hamlet
#

Bah it's logical he must not react to his own reactions lmao

idle basalt
#

setGame is deprecated, use setActivity instead

dull bobcat
#

dafuq eyeskang

green dome
#

Just wondering, are you allowed to store data coming feom Discord in an external database? I was thinking about user id's for example.

unique nimbus
#

It depends what data

#

some requires consent

#

if its for bot usage like economy its fine

green dome
#

I was just wondering in general

#

Currently I don't need it, but I might in the close future

unique nimbus
#

I store peoples ids so I can get the economy data from my folder spam

green dome
#

Ok great! Thanks!

late hill
#

ID's are fine

unique nimbus
#

yes

late hill
#

avatars aren't I believe

green dome
#

Good news, I don't think I'll need a lot more

lofty hamlet
late hill
#

Oh

#

I see your problem

lofty hamlet
#

?-?

#

Me ?

late hill
#

Yes

#

You're overwriting message

#

So message.author will be your bot ^^

lofty hamlet
#

?-?

late hill
#

Which means only the reactions from your bot will count

lofty hamlet
#

๐Ÿค”

late hill
#

In other words

#

Don't name 2 things message

lofty hamlet
#

How can I do then?

late hill
#

Change the name

lofty hamlet
#

Of ?

late hill
#

..

#

You have a message event yes

#

In which you have the variable "message"

#

In your .then() you're also calling that message

#

Don't do that

#

Give it another name

lofty hamlet
#

Oh ok i go test

#

Thx

#

How i can @late hill ?

late hill
lofty hamlet
#

You can edit and explain me ? '-'

late hill
#

Do you understand the problem

lofty hamlet
#

Hum yes

#

I would like to understand

late hill
#

..

#

ok uhh

lofty hamlet
#

?

late hill
#

You're storing the message sent by your bot

lofty hamlet
#

Owo

late hill
#

in message

unique nimbus
#

same

late hill
#

As you can see by the highlights

#

Your filter check uses that message

#

And not the message from the user using the command

lofty hamlet
#

Ok

late hill
#

So what you should do

#

Is rename message in your .then()

lofty hamlet
#

I want a reactiob to the message of my bot

#

But my bot take his reaction

late hill
#

Yes

lofty hamlet
#

Ok

late hill
#

That's what I'm explaining

#

It takes his reactions

#

Because your filter

#

Checks the author of the message that the bot send

#

Your bot is the author of the messages it sends

lofty hamlet
#

AHhhhhh ok

#

And how i can patch this ?

late hill
#

Rename message everywhere inside your .then()

#

Except for in the filter

#

And in your bottom timeout function

#

Because you're using reply in there

lofty hamlet
late hill
#

You should reply to the user, not the bot

#

use message inside the timeout for the replies

#

Or the bot will reply to itself

lofty hamlet
#

But wow look

sinful lotus
#

@late hill fckin weeb

late hill
#

Yes you forgot to change one

lofty hamlet
#

๐Ÿค”

late hill
lofty hamlet
#

Oh yes

#

Ok

#

MY BAD

late hill
#

@sinful lotus thanks uwu

sinful lotus
#

not to mention Kiss X Sis smh

#

nice development bg

late hill
#

xd

lofty hamlet
#

I love you @late hill โค

#

Thanks you

late hill
#

๐Ÿ˜ณ

unique nimbus
#

I ship

lofty hamlet
#

@late hill for an embed how i can?

#

message.channel.send(embed); .then(anothermessage => { ?

late hill
#

uhh

#

Don't put ; before .then

lofty hamlet
#

Ok no it's good

fleet mason
#

anyone know how i can read a js file and get the data from items ?

items = {
    "-1": ["Empty slot", 0, -1, 0, 0, 0, 0],
    8757: ["Sheath0", 27, -1, 0, 0, 0, 5],
    3285: ["Ivory Wyvern Key", 10, -1, 46, 0, 0, 100],
    3284: ["Draconis Key", 10, -1, 46, 0, 0, 200],
    3323: ["Marid Pet Skin", 10, -1, 92, 0, 0, 2e3],
    24837: ["Bagston Pet Skin", 10, -1, 138, 0, 0, 2e3],
    24840: ["Goldy Pet Skin", 10, -1, 184, 0, 0, 2e3],
    . . .
lofty hamlet
#

I found

late hill
#

module.exports = items @fleet mason ?

fleet mason
#

the js file is from a website link so then i would have to download it

late hill
#

what

#

The website gives you that?

fleet mason
late hill
#

I mean using eval() on it would work

#

But if that page returns some weird stuff

#

It could fuck stuff up

#

Don't know which would be a safer way

fleet mason
#

true

amber fractal
#

you could

#

ctrl a

#

ctrl c

#

ctrl v

#

then it's in your files

west spoke
#

Was async shut down?

slender thistle
west spoke
#

Ye

slender thistle
#

rewrite has been released

west spoke
#

Literally nothing works

#

Ik

#

But my bot was made in async

slender thistle
#

What do you mean by "nothing works"

#

Do you get any errors?

west spoke
#

Many

slender thistle
west spoke
#

?

#

No?

slender thistle
#

You did

west spoke
#

K what version do I need

unique nimbus
#

rewrite

slender thistle
#

Just basically pip install discord.py==0.16.12 iirc

unique nimbus
#

async died

#

its literally gone

#

you cant use it no more

west spoke
#

...

slender thistle
#

you won't get support for it, but it works

unique nimbus
#

people was moving because they couldnt use it

slender thistle
#

Are you sure they moved because rewrite was added on PyPi instead of async

unique nimbus
#

rewrite is here

slender thistle
#

async is not completely dead

unique nimbus
#

and async got yeeted

#

or will be yeeted

slender thistle
#

You can install and use it, but don't expect people in d.py server to help you with it

west spoke
#

Ik

unique nimbus
#

If it doesn't work at all

#

then rewrite is the only option

west spoke
#

It works

#

I did a sample =pi command and it does work

#

Now to try it on my backup

#

Ye everything works

unique nimbus
#

oof

#

Neko I would recommend going to rewrite at some point

slender thistle
#

How can request.form in Flask be empty (lierally just a dot)? thonkku

west spoke
#

I will

earnest phoenix
#

hey so i just want to suggest to people not using it to use visual studio code because 1) dark theme, and 2) It automatically completes brackets

#

i got suggested it yesterday

#

and fuck i love it

unique nimbus
#

get a room smh

#

jkjkjk

earnest phoenix
#

๐Ÿค”

earnest phoenix
#

hey i just want to thank the people who helped me figure stuff out yesterday

#

I managed to add a ton of commands and I figured out more coding stuff

#

so thank you! :D

idle basalt
#

basically every single editor has a dark theme and autocompletes brackets

earnest phoenix
#

not notepad++

west spoke
#

Or wordpad

idle basalt
#

theyre not really editors though

west spoke
#

They are

earnest phoenix
#

notepad is made for code

west spoke
#

Change my mind

earnest phoenix
#

notepad++*

west spoke
#

I use wordpad for html

idle basalt
#

literally every actual editor does these things. brackets, vsc, atom, any of the jetbrains, etc

#

notepad is like cmon man

west spoke
#

Since Google drive's html editor is now PAID

#

I miss that stuff ;-;

zealous veldt
#

ahpyhrt WebStorm with VIm bindings

oblique edge
#

so home server is back online

#

well, power button pushed

#

once os is bootred, Vigor should be up

zealous veldt
#

Yikes

oblique edge
#

ah

#

so that was the issue

#

I should honestly just replace the drive at this point

icy gyro
#

I heard someone call worldpad an editor and I am here to enact karma for your unholy deeds

lavish otter
west spoke
#

@icy gyro it is. Change my mind.

fiery birch
#

word processor =/= editor

earnest phoenix
#

wordpad is an editor

#

just not an IDE

fiery birch
#

it just isn't an ide what

#

oh i misread

#

kek

earnest phoenix
#

wordpad is basically a chinese copy of ms word except its still backed by ms

junior summit
#
    ^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
    at VoiceConnection.emit (events.js:178:17)
    at VoiceWebSocket.ws.on.err (C:\Users\chill\Desktop\Chill Bot\discord-bot\node_modules\discord.js\src\client\voice\VoiceConnection.js:363:32)
    at VoiceWebSocket.emit (events.js:189:13)
    at VoiceWebSocket.onError (C:\Users\chill\Desktop\Chill Bot\discord-bot\node_modules\discord.js\src\client\voice\VoiceWebSocket.js:156:10)
    at WebSocket.onError (C:\Users\chill\Desktop\Chill Bot\discord-bot\node_modules\ws\lib\event-target.js:128:16)
    at WebSocket.emit (events.js:189:13)
    at WebSocket.finalize (C:\Users\chill\Desktop\Chill Bot\discord-bot\node_modules\ws\lib\websocket.js:185:12)
    at ClientRequest._req.on (C:\Users\chill\Desktop\Chill Bot\discord-bot\node_modules\ws\lib\websocket.js:635:10)
    at ClientRequest.emit (events.js:189:13)
    at TLSSocket.socketErrorListener (_http_client.js:392:9)
    at TLSSocket.emit (events.js:189:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)``` i got this?
fiery birch
#

show code and stuff

junior summit
#

like but where

fiery birch
#

hastebin i guess

junior summit
#

no like what part

fiery birch
#

idk

#

im prolly not able to help tbf, but to help others see the issue who can actually help

dusky marsh
#

@junior summit add an error event

client.on('error', () => console.error)
junior summit
#

i did

bright spear
#

wordpad is word but free and old

west spoke
#

Yeah but it was what i was using before I sacrificed 5 gb using vsc

#

And only for html

#

Already have the python ide

junior summit
#

How do i fetch a guilds name

earnest phoenix
molten yarrow
#

@junior summit message.guild.name
Depends where u define it

earnest phoenix
#

Hello guys/girls, just wondering how I can inject my custom emojis into some of my bots responses/embeds

*Python bot
Discord.py

bright spear
#

@earnest phoenix in chat type \:emoji: to get the id, then paste that into your bot code

earnest phoenix
#

Then I should be able to just place it where I would like it?

#

Even if it's a custom one it will follow with the bot correct?