#development

1 messages · Page 636 of 1

barren brook
#

would it be tos if the bot message the owner so the owner knows?

amber fractal
#

It would need their consent

opaque eagle
#

2.2 Restrictions. You shall not, and shall not permit any person, directly or indirectly, to (i) reverse engineer, disassemble, reconstruct, decompile, translate, modify or copy the API or SDK, other than as explicitly permitted hereunder (except to the extent the foregoing restriction is expressly prohibited by applicable law notwithstanding this limitation), (ii) create derivative works of the API or SDK or any aspect or portion thereof, including without limitation, source code and algorithms, (iii) distribute or otherwise disseminate the API or SDK by any means or in any form, except as an integral part of your Applications; (iv) use the API or SDK in connection with any Applications that include any malware or other harmful code or that facilitate spamming in any way; (v) circumvent any limits or any privacy or access controls (or attempt to do so); or (vi) include any advertisements or other promotions within the functionality enabled by the API or SDK. Except as expressly set forth in this Agreement, Discord reserves all rights in or the API and SDK.

https://discordapp.com/developers/docs/legal

Discord Developer Portal

Integrate your service with Discord — whether it's a bot or a game or your whatever you wildest imagination can come up with.

barren brook
#

hmm how would i be able to get an invite to join there server

amber fractal
#

Without consent? You wouldnt

opaque eagle
#

^

#

You shouldn't be joining the servers of your users.

barren brook
#

i was going to make a roleplay pizza bot

amber fractal
#

why would you need to join their server then

opaque eagle
#

That's like if Samsung or LG can barge into ur house without ur consent just cuz u own their tv

amber fractal
#

If for some reason you really need to, you can force them to accept a ToS before using the bot tho mmLol

#

But I wouldnt accept that tos

barren brook
#

ill work around it. its fine.

amber fractal
#

👍

smoky garden
#

how do i make my bot change name and avatar like in #bids

earnest phoenix
#

Webhook @smoky garden

#

Its not real bot

smoky garden
#

ohh ok

#

nvm then

smoky garden
#

then how do i do it in webhook?

stark beacon
#

Quick Q on BOT Rules.

Bots will be kicked from the server if they:
    • Send join messages/mass messages/advertisements in direct messages

Does this apply if the BOT does a join message when it first joins a server?

And if that is fine, what is the common route of doing this? Just grabbing the first channel in the list and sending the greeting message there?

opaque eagle
#

I'm pretty sure "join messages" means when u DM a new user who joined a server

#

And if u join a new server why would u send a welcome message in DMs

loud salmon
#

yea the initial join message from a bot doesnt apply

#

there isnt really a set method

#

some people do that

#

other bots look for a channel that has the word "bot" that they have access to

stark beacon
#

By "join" I believe it is technically in Discord.js terms called client.on('guildCreate'

#

and okay, thank you!

#

I just want to have it post a first-time join message about itself and how to see the command list

loud salmon
#

yee

#

thats fine

rugged kelp
#

Hmmm think3d

#

Who help me ?

#

Please

night imp
#

wUser is not defined @rugged kelp

rugged kelp
#

Yes

night imp
#

make sure you typed it correctly

rugged kelp
#

How to fix ?

night imp
#

and that you have wUser = something

rugged kelp
#

This is the code

#

warn.js

#

it goos

#

here

#

is not good on warnlevel.js

#

@night imp

night imp
#

use await on line 13

rugged kelp
#

let wUser = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0])

#

@night imp

copper cradle
#

you defined wUser and you used it after the line where you defined it

#

duh

#

you can't to this

#
console.log(e)
let e = something
#

put that if statement somewhere below line 13

#

@rugged kelp

rugged kelp
#

where /

copper cradle
#

line 13

#

below line 14

rugged kelp
#

this console.log(e) let e = something ?

copper cradle
#

no

#

it was an example

rugged kelp
#

and ?

#

Im noob: )

copper cradle
#
if (!warns[wUser.id]) warns[wUser.id] = {
warns: 0
};
#

put that below line 14

rugged kelp
#

Oh

#

1 sec

copper cradle
#

wait

#

do it

rugged kelp
#

It;s good ?

copper cradle
#

ye

#

but

#

you removed the old one right?

#

lemme explain

rugged kelp
#

Yes

copper cradle
#

ok

#

this is logic order, you can't have something that doesn't exist

#

like what you did

rugged kelp
#

yeah

#

Im noob : )

#

Srry

#

xD

copper cradle
#

xD

#

do u speak spanish?

rugged kelp
#

No : (

copper cradle
#

hmm

rugged kelp
#

Im from Romanian

copper cradle
#

nice

rugged kelp
#

Probably Romanian

#

¯_(ツ)_/¯

#

= ]

copper cradle
#

nice

rugged kelp
#

...

#

OwO

#

wait

#

nope :/

#

owo

copper cradle
#

hmm

#

go to warnlevel.js

rugged kelp
#

nononon

#

wait

#

is wsUser

#

xD

copper cradle
#

ew

#

but still

rugged kelp
#

xD

copper cradle
#

leave the if statement below the line I told you

rugged kelp
#

uups

copper cradle
#

BRUH

#

remove that

#

you leaked your token

rugged kelp
#

1 sec

copper cradle
#

oof

rugged kelp
#

what ?

#

you talk with me ?

copper cradle
#

nono

#

the other guy

#

he leaked his token

warm flame
#

@earnest phoenix stop leaking your token, just leave it blank when asking for help

rugged kelp
#

lol

#

= ]

#

Done @copper cradle

#

Thanks blobdance

earnest phoenix
#
import net.dv8tion.jda.core.accounttype;
import net.dv8tion.jda.core.JDABuilder;

import javax.security.auth.login.LoginException;

import jdk.nashorn.api.scripting.JSObject;
import jdk.nashorn.internal.objects.Global;
import jdk.nashorn.internal.runtime.ListAdapter;

public class main extends ListAdapter {
    main(JSObject obj, Global global) {
        super(global);
        // TODO Auto-generated constructor stub
    }

    public static void main(string[] args) throws LoginException {
        JDABuilder builder = new JDABuilder(accounttype.bot) ;
        String token = "K" ;
        Builder.SetToken(token);
        Builder.addeventlistener(new main());
        builder.buildAsync();
    }


@Override
public void onMessageReceived(MessageReceivedEvent event) {
      system.out.printin("We Recived Message From " +
         event.getauthor().getname() + ": " +
         event.getMessage().getContentDisplay()
        );
    if(event.getMessage().getContentraw().equals("!ping")) {
        event.getchannel().sendmessage( "pong!").queue();
    }
}
}
copper cradle
slender thistle
#

Let them regenerate it

copper cradle
#

well

#

¯_(ツ)_/¯

rugged kelp
#

¯_(ツ)_/¯

inner jewel
#

deleting messages in bot-hell is as useful as trying to dry an ocean with a lighter

copper cradle
#

lmao

warm flame
#

pretty much, already told them to regen it in #topgg-api when they first leaked it

#

¯_(ツ)_/¯

inner jewel
#

the messages you delete in bot-hell get logged as well

#

and you'll have to keep going until the messages get too big to send

warm flame
#

ye, easier for him to just regen

copper cradle
#

I'm doing my homework so I'm not really paying attention to what I do ¯_(ツ)_/¯

amber fractal
#

Post your question

hushed quarry
#

]]ask2ask

covert turtleBOT
#

Dont ask to ask
Just ask your question
it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time by just asking the question.

amber fractal
#

it cant send an empty message...

#

but where

#

is the problem

sinful lotus
#

you are sending an empty message. console.log if what you are sending is actually defined or not undefined

#

ofc your send message cause it cant send an empty message

#

yeah defined by variables

#

but is that defined variable have a data?

hushed quarry
#

comment out all send message calls and uncomment them one at a time until you see which one causes it

sinful lotus
#

defined variable !== data in variable

#

make sure that variable you are sending isnt undefined or null

#

await those if you want to wait for it before proceding

earnest phoenix
#

Does anyone know how to connect your program/script with the bot

sinful lotus
#

rest, websockets

earnest phoenix
#

?

sinful lotus
#

thats some ways you can connect your script with your bot

earnest phoenix
#

So where do I stick the script?

sinful lotus
#

first of all what is this script first?

earnest phoenix
#

A paypal invoice script that makes invoice

sinful lotus
#

Im saying websocket and rest if the script is something like a stuff coded in another language

earnest phoenix
#

The bot will send invoices

sinful lotus
#

yes how do you run the paypal invoice script?

#

on your bot or on another process?

earnest phoenix
#

Bot

#

And I have no idea how to connect the script with the bot

sinful lotus
#

How do you run it on your bot but have no idea on how you connect it?

#

is it a process separated from your bot

earnest phoenix
#

Yes

sinful lotus
#

if its a process separated from your bot

#

you need to make a "rest" or "websocket" server

#

where in that will run in your local host

#

when an invoice is received, send the data via the websocket connection if you decided to use that
then your bot will receive the data then send it

earnest phoenix
#

ok

#

I would find vids on how to create it then, I hired a dude to make a script that could send invoices, but he didn't clearly explain what I should do

sinful lotus
#

good luck

earnest phoenix
#

Yeah, and non of the video is helping...

sinful lotus
#

I cant expect you to learn about websockets at first but start with a simple one

#

there are examples there

earnest phoenix
#

Maybe if I show you the script will it be easier for you to help?

pallid zinc
#
message.channel.send('blabla')
message.react('👍')
}```
#

Why this react command

sinful lotus
#

I cant code a ws server nor a ws client for you @earnest phoenix due to the ff reasons

  1. I have my own responsibilities to work on
  2. It's not as fast as you think and it can be time consuming
  3. You can learn it with yourself if you only have the will to do so
#

First thing is first, why not view the source code of the Invoice Bot and check how he sends the invoices?

#

If you know that then you can start on doing the WS server

#

then on your another bot, make a WS client

pallid zinc
#

Can you help me

#

??

sinful lotus
#

because you make it react on the message

#

that you sent

#

not on the bot's message

pallid zinc
#

But it react on commamd

sinful lotus
#

because you are telling the code to react on command

pallid zinc
#

How to react on bot message

sinful lotus
#

msg.channel.send() returns the message sent by bot

earnest phoenix
sinful lotus
#

and its a promise

pallid zinc
#

Ok

sinful lotus
#

make it react on the sent message in msg.channel.send

#

or if you are that oppossed on making a ws server and client then hire a developer

pallid zinc
#

Unexpected token

sinful lotus
#

means your syntax is wrong

pallid zinc
#

Hmm

sinful lotus
#

do you know how promises work?

pallid zinc
#

One example plzz

#

No

#

I am new

#

To js

earnest phoenix
#

try learning basic js before making a bot...

sinful lotus
earnest phoenix
#

do a free online course or guides

sinful lotus
#

msg.channel.send is a promise

#

look down on promise consumers

#

thats how you deal with promises

earnest phoenix
#

no

sinful lotus
#

no not like that

#

as I said

earnest phoenix
#

oh god

sinful lotus
#

open that link

#

look down on promise consumers

#

thats how you deal with msg.channel.send promise

#

the syntax is there

#

all you need to do is a little analyzation so you would learn

pallid zinc
#

msg.channel.send().then(msg => {
msg.react
})

sinful lotus
#

there you got it

earnest phoenix
#

yea

pallid zinc
#

Ok

earnest phoenix
#

also do you know what async is?

#

might make ur code more tidy

#

if u use async/await

pallid zinc
#

Thanks

#

Yup I know async

earnest phoenix
#

yeah you can use await fn() instead of fn().then() as well

#

so it be nice

pallid zinc
#

I use .then

#

And it work fine

#

Thanks

earnest phoenix
#

yes it does. if you're fine with that that's fine

queen bone
#

anybody using canvas ? can you guide me on how i can load custom fonts ?

earnest phoenix
#

@queen bone what languages

queen bone
#

js

pallid zinc
#

I use js

#

j ??

#

Ohh

#

I know

#

Ask

earnest phoenix
#

use canvas-constructor is better than canvas

queen bone
earnest phoenix
#

uw

#

css

pallid zinc
#

Use canvas

#

Harder then canvas-constructor

earnest phoenix
#

Yes

queen bone
#

ok but how do i add any fonts, i want beautiful fonts

earnest phoenix
#

Look canvas documentations meowoh

pallid zinc
#

What u use canvas or canvas constructor

earnest phoenix
#

he use canvas i think

pallid zinc
#

Use don't use anything

#

Lol

#

That's why he don't know anything about it

minor beacon
#

Hi

earnest phoenix
#

Hi

#

You need help? @minor beacon

pallid zinc
#

Nope

#

@minor beacon

queen bone
#

Success menjs Canvas.registerFont('Audiowide-Regular.ttf', { family: 'Audiowide'}); ctx.font = '50px "Audiowide"';

pallid zinc
#

Ok

earnest phoenix
#

@queen bone discordjs?

queen bone
#

yes men

earnest phoenix
#

You can use canvas-constructor is better than normal canvas

pallid zinc
#

Not better

#

It's is easier

earnest phoenix
#

It works like an embed

pallid zinc
#

Like

earnest phoenix
#

Its better

pallid zinc
#

Addtext

#

Addimage

queen bone
#

yes i saw its easier than canvas

earnest phoenix
#
.toBufferAsync()```
earnest phoenix
#

How can I fix the error “Something took too long to do”? It seems like the error came from the login function. Lib: d.js

#

@earnest phoenix you have forgot to clear a interval or something

#

or a timeout

sinful lotus
#

I dont think thats interval or timeout

#

it pretty much means something got stuck and d.js cancelled it

earnest phoenix
#

i saw setTimeout in the error

#

but I can’t edit it as the code is in the d.js file

sinful lotus
#

you dont need to fix that

#

some errors just happens

#

unless you have a really bad code

earnest phoenix
#

I think this error make crash the bot

#

it worked before

sinful lotus
#

just handle the error pretty much

#

internet is a scary place

#

everything will not work perfectly lmao

#

thats why you handle it

earnest phoenix
#

does .catch works on .login?

#

Yes

sinful lotus
#

only on that function

#

not your whole code

earnest phoenix
#

will be fine by itself after some time?

sinful lotus
#

if it happened on client.login() then I would prefer to restart the bot and try again

#

if you run your bot with pm2

earnest phoenix
#

the error happens again

sinful lotus
#

a simple process.exit() will do if client.login errors

#

then check your vps or provider

earnest phoenix
#

maybe the connection

sinful lotus
#

if you are hosted on glitch or heroku

#

then thats your problem

#

free hosting is not for public services so either you pay or suffer on that error again and again

earnest phoenix
#

ok then

sinful lotus
#

there are tons of cheap servers out there

earnest phoenix
#

any example for cheap vps that I can afford with $10.

sinful lotus
#

VPS S SSD is a great value for its price

twilit rapids
#

Potato approves

earnest phoenix
#

wow thats kind of expensive for me

#

3.99 EUR = 18.68 MYR

sinful lotus
#

thats already a bargain

#

you said under 10 dollars

earnest phoenix
#

ik

#

i mean i can afford

sinful lotus
#

3.99 euro is around 4.47 dollars

#

so its below your 10 dollars budget

earnest phoenix
#

ok then guess i will find something else

sinful lotus
#

I doubt you will find a 1 dollar hosting

#

there might be but the specs are subpar

queen bone
#

use aws free for a year

earnest phoenix
#

Should I get Linux or Linux KVM?

sinful lotus
#

KVM is better

#

OPENVZ are usually overselled

earnest phoenix
#

ok thanks

nocturne hazel
#

Anybody know how i can make the reddit api's "random" feature return an image?

mossy vine
#

if its not an image it should be the link to the post

#

@nocturne hazel ^

nocturne hazel
#

Ok. But how can you pull the data itself?

mossy vine
#

use an http library to make the request, and use JSON.parse() to convert it to an object

nocturne hazel
#

Alright. Thanks.

#

Would superagent work well ?

mossy vine
#

any library that can make an http request would work

#

which one you use depends on your use case and preferences

sinful lotus
#

usually node fetch

#

dont need to install anything cause d.js uses that

rugged kelp
#

Yes go ik

sinful lotus
#

then why did you ask

rugged kelp
#

Idk :)))))

#

Because im lazy xD

loud salmon
#

we dont spoon-feed here @rugged kelp

rugged kelp
#

Ik sorry :>

earnest phoenix
#

hey guys

#

i have a problem with my dm code

#

it sends a message to a certain user from the server

#

not mass dm ofc, just a message

#

and it always sends like this weird id or whatever it is in front of the message

#

like this one

#

this is the code

#

 case 'dm':
            if (!message.member.hasPermission("MENTION_EVERYONE")) return message.reply('Nu ai permisiuni')
            msg = message.content.toLowerCase();

            if (message.author.bot) return;
            if (!args[1]) return message.channel.send('ce? cine? cui?');

            mention = message.mentions.users.first();

            message.delete();
            mentionMessage = message.content.slice (9);
            mention.sendMessage (mentionMessage);
            message.author.send ('gata!');

        break;
#

The ID at the start is how the bot tags someone

#

and can it be removed?

warm marsh
#

yeah

#

replace it

earnest phoenix
#

You need to slice the id

#
  • 3
warm marsh
#

Or use regex and remove

#
/^\d+\>s*/
earnest phoenix
#

mentionMessage = message.content.slice(message.author.id.length + 3)

#

3 = <@>

warm marsh
#

But the id isn't in full by the looks of the image

earnest phoenix
#

Yes its bc he slice 9

#

id has 11 number

warm marsh
#

oh

#

id contain 18

earnest phoenix
#

yes 18

warm marsh
#

mention.sendMessage

#

what language ?

#

or lib

earnest phoenix
#

discordjs

warm marsh
#

Isn't sendMessage dep?

earnest phoenix
#

No its .send

warm marsh
#

Yeah

#

sendMessage is deprecated

earnest phoenix
#

sendMessage is deprecated

#

yes

warm marsh
#

Yes

earnest phoenix
#
            if (!message.member.hasPermission("MENTION_EVERYONE")) return message.reply('Nu ai permisiuni')
            msg = message.content.toLowerCase();

            if (message.author.bot) return;
            if (!args[1]) return message.channel.send('ce? cine? cui?');

            mention = message.mentions.users.first();

            message.delete();
            mentionMessage = args[1].join(' ') 
            mention.send(mentionMessage);
            message.author.send ('gata!');


        break;``` @earnest phoenix
#

I have changed the mentionMessage

warm marsh
#

Will throw error?

#

args[0].join(' ')

earnest phoenix
#

args[1]

#

I have edited

warm marsh
#

won't change the error.

earnest phoenix
#

Yes

#

It change

warm marsh
#

How?

#

It's still a string inside an array

earnest phoenix
#

He count number of word

#

Look wait

#

-test args[0] args[1]

warm marsh
#

Yeah

#

will return two strings

earnest phoenix
#

the args[0] is the mention

#

and args[1] all after the mention

warm marsh
#

Ok

earnest phoenix
#

TypeError: args[1].join is not a function

warm marsh
#

Yeah

#

remove mentions from args

#
messageToReply = args.join(' ').replace(/\<@\d+\>/, '');
#

so returns a string

fallow steppe
#

I started using Java Scripting. Anyone has the script to start with?

warm marsh
#

Javascripting?

#

You mean JavaScript?

#

or Java.

earnest phoenix
#

i am new in coding and a little stupid

#

i did this

#
   case 'dm':
            if (!message.member.hasPermission("MENTION_EVERYONE")) return message.reply('Nu ai permisiuni')
            msg = message.content.toLowerCase();

            if (message.author.bot) return;
            if (!args[1]) return message.channel.send('ce? cine? cui?');

            mention = message.mentions.users.first();

            message.delete();
            mentionMessage = message.content.slice (message.author.id.length + 3);
            mention.sendMessage (mentionMessage);
            message.author.send ('gata!');

        break;
warm marsh
#

Works?

earnest phoenix
#

better than before but there are still 3 digits

#

like this

#

824> test

warm marsh
#

lmao

#

don't use message.content

#
 case 'dm':
            if (!message.member.hasPermission("MENTION_EVERYONE")) return message.reply('Nu ai permisiuni')
            msg = message.content.toLowerCase();

            if (message.author.bot) return;
            if (!args[1]) return message.channel.send('ce? cine? cui?');

            mention = message.mentions.users.first();

            message.delete();
            mentionMessage = args.join(' ').slice(21);
            mention.send(mentionMessage);
            message.author.send ('gata!');


        break;```
#

or replace with regex

#

your choice.

earnest phoenix
#

now it works yeah

#

i changed the 21 to 24 tho

warm marsh
#

For the spaces?

earnest phoenix
#

from 824> test became 24> test

#

so i changed 21 to 24

warm marsh
#

you still using message.content?

earnest phoenix
#

and it erased all

#

yeah mmLol

#

still message.content

warm marsh
#

What's your prefix?

earnest phoenix
#

any letter

#

i use V

warm marsh
#

because it has to delete Vdm @daring fjord message

#

it has to delete Vdm @daring fjord

#

that's why should use your args array

#

args.join(' ') should be the mention @daring fjord and message

#

without prefix and command name Vcommand

earnest phoenix
#

yeah i get

rugged kelp
#

@warm marsh Romanule : )

warm marsh
#

Romanule ?

rugged kelp
#

Where are u from ?

warm marsh
#

Scotland.

rugged kelp
#

OK : )

fallow steppe
#

@warm marsh Java Script

warm marsh
#

Ah

#

Fair

#

What do you need help with?

fallow steppe
#

I need the scripts I must start with ( aka enter bot token and informations )

mossy vine
#
warm marsh
#

Yeah

grim aspen
fallow steppe
#

I know how to get token, just looking on how to start with js

warm marsh
#

The guide I sent shows you how to get up and running.

#

try that.

mossy vine
#

@modern sable

earnest phoenix
#

tf

loud salmon
#

@elder veldt fucking stop

peak quail
#

is this api abuse ? ``` for(let channel of guild.channels.array()){
channel.overwritePermissions(/blah/)
}

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

peak quail
#

hmmm

earnest phoenix
#

Of course it would be API abuse. You're granting a bot with permissions that they have not been given and there is obviously a reason as to why they do not want the bot to have those permissions.

hushed quarry
#

if it's every server, yes it's abuse, if it's your own server or one you were given consent to do that in, sure you can do it

earnest phoenix
#

If you were given consent, just tell them to give the bot administrative permissions to save yourself the effort.

#
TRENTToday at 4:04 PM
Of course it would be API abuse. You're granting a bot with permissions that they have not been given and there is obviously a reason as to why they do not want the bot to have those permissions.```

that's malicious intent, not api abuse
#

it really depends on the context

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

e.g it's acceptable when creating a mute role and you need to update permission overwrites on channels

#

otherwise, probably not

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

no, he's doing that with every channel of the guild

#

my code contains that too, for mute roles

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

the code shown does it in only one guild

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

how would you know that?

#

code shown just shows a placeholder in the permissions

west raptor
#

doesnt say he is

sage bobcat
#

One message removed from a suspended account.

west raptor
#

no it doesnt

#

what

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

west raptor
#

yes that's how you change permissions

sage bobcat
#

One message removed from a suspended account.

west raptor
#

no? not really

earnest phoenix
#

my code for creating a mute role, it isn't malicious intent

#

neither is the code above

#

That's for a muted role which the bot creates. It would be different if the bot was granting itself permissions that it has not been given.

west raptor
#

I doubt they had any malious intent speaking they asked if it was API abuse

warm marsh
#

Who said he was giving his bot permissions, He could just be overwriting permissions for a role aka muted

rocky gyro
slender thistle
#

When your webhook is running, that event will be emitted once someone has voted for your bot

rocky gyro
#

rn i have something like this, but idk how to register my on_dbl_vote function to be linked to the dblpy.on_dbl_vote event

slender thistle
#

It is already registered

rocky gyro
#

but it isn't working

slender thistle
#

Are you sure your port is open and you are forwarding it?

rocky gyro
#

gonna check out

rugged kelp
#

How to add background in my bot list ?

earnest phoenix
#

Add CSS to the long description.

rugged kelp
#

Do you have a model

#

?

west spoke
#

Learn css

#

Ez

rugged kelp
#
<head>
<style>
p {
  color: red;
  text-align: center;
} 
</style>
</head>
<body>

<p>DSJDAJDFJDSA!</p>
<p>These paragraphs are styled with CSS.</p>

</body>
</html>
#

With this ?

west spoke
#

Yes now why'd you use a template from w3

#

Not exactly gonna work on dbl but mk

#

I would just write your desc in plain text before doing html tbh

rugged kelp
#

It's good ? : )

#

How to add background ? think3d

#

black color

#

o found

slender thistle
#

I'd really suggest learning HTML before using it on your bot page tbh

grim aspen
rugged kelp
#

It's not good 😦

grim aspen
#

^^^ please

rugged kelp
#

oooffff

#

idk how ://////

limpid raptor
#

🤔

west spoke
#

Oh my fucking God close those paragraphs

limpid raptor
#

What da...

#

Fuck ;-;

west spoke
#

You dont put background styles in body

#

LEARN HTML REEEEEEEEEE

limpid raptor
#

And you never end the <p>

#

Just once at the end

west spoke
#

At least they figured out a bad way of doing newlines...

grim aspen
ashen snow
#

@west raptor hi, I updated @steep mist to not respond to bots

west raptor
#

okay

ashen snow
#

I think you can unmute it now

split hazel
#

Roman copying code won't help you

#

It's like copying a sentence from another language and you don't understand it

rugged kelp
#

Now how to add black background ?

grim aspen
rugged kelp
#

:/

#

Idk

#

-_-

warm flame
#

please just read some guides and tutorials, we won't hold your hand in helping you make stuff

rugged kelp
#

: (

earnest phoenix
#

my bot's gonna sleep rest of month

#

time to recreate from another account

west spoke
#

I just realized how dumb I am

#

All I needed to do was run my bot from the bot's directory...... hh

#

Hoist

slender thistle
west spoke
#

bruh

#

Why eggplant....?

earnest phoenix
#

his husband is thanos

slender thistle
west spoke
#

Anyways soooooop gonna deal with the hoist

#

?

#

great name

slender thistle
#

yeet notr

covert turtleBOT
west spoke
quiet topaz
#

(javascript) how do I check if an array constains a string?

west spoke
#

Check if number string is in the array

split lantern
#

Array#includes?

quiet topaz
#
 if (!letter2[i].indexOf(zahl,0))
#

wont work

#

let zahl = [1,2,3,4,5,6,7,8,9,0]

west spoke
#

if (1 in zahl)?

slender thistle
#

array.includes ig

quiet topaz
#

ok, I try

#

ok, thanks

grand wing
#

Hey !
Somebody knows how to create a website using discord.js

earnest phoenix
#

You can't create a website using a language for Discord :/

unique nimbus
#

You need to use HTML/CSS

#

or php

earnest phoenix
#

You can, however, create a website with JS but you would need HTML as well.

unique nimbus
#

idfk

west spoke
#

But it will only be local I believe

#

It wont have a custom url tho.

grand wing
west spoke
#

@grand wing
AWS S3,
AWS route 53

#

Google those two

#

Research them

earnest phoenix
#

That isn't much of a website.

west spoke
#

Ik

#

But it's what I do to host my website

grand wing
#

But how can i do a website like that

west spoke
#

HTML

#

Learn how to code in it, then go from there

grand wing
#

I know for that but using discord api

earnest phoenix
#

If you want to do a website exactly like that, it's really simple xD

west spoke
#

Ye

#

You cant make a website using discord api...

grand wing
#

What is that so ⬆

west spoke
#

Wdym

#

You cant use d.js api to host a website

grand wing
#

I'm french so if u can stop to use abrevaitions 😅

west spoke
#

Nope

grand wing
#

Not to host

#

Just to vreate a website

west spoke
#

Html

#

Hypertext markup language

grand wing
#

For the moment i d'int host it

earnest phoenix
#

You can't write a website in discord.js

west spoke
#

^

earnest phoenix
#

It's a language for Discord, it's even in the name.

west spoke
#

Ye

amber fractal
#

uh it's not a language

#

it's an api wrapper

earnest phoenix
#

Node

#

whatever it is

dusky marsh
#

lel

#

its a library

west spoke
#

Js, java, node, etc

amber fractal
#

html/css your way to websites

west spoke
#

Yeh

earnest phoenix
#

node/library is the same thing, I thought. Anyway, you would need to use HTML and CSS for a website. For something more complicated, you can use JavaScript as well.

west spoke
#

Yeh

#

I use js for my posts section

near igloo
#

html is ez

unique nimbus
#

Everyone has their strengths

pallid zinc
#
</html>```
near igloo
#

hyper text markup language

pallid zinc
#

Hyper text markdown language

near igloo
#

<HTML>
<HEAD>
<TITLE> BAD TRASH </TITLE>
</HEAD>

#

WHAT EVER HTML IS EZZ

pallid zinc
#

Any help u want

near igloo
#

YEAH

west spoke
#

<!DOCTYPE html>
<head>
<script></script>
<style></style>
</head>
<body>
<p>Text, and other stuff</p>
</body>
</html>

earnest phoenix
#

Hi guys

#

I made my own database just with text files and it works good

#

if anyone wants the code just tell me

near igloo
#

what is this for <!DOCTYPE html>?

earnest phoenix
#

no

near igloo
#

,me wanna code

earnest phoenix
#

for discord.js

near igloo
#

mean?

earnest phoenix
#

if you want to code

near igloo
earnest phoenix
#

my name is not w3schools

near igloo
#

i know how to code an html document

earnest phoenix
#

nice

near igloo
#

wut the webpage looks intresting

earnest phoenix
#

I didnt code that

uneven yacht
#

Hello How Can I Put My Bot Into The List?

earnest phoenix
#

uw

#

guys I just made my own database

#

I use .txt files

dusky marsh
#

using a txt file as a database is an awful idea

earnest phoenix
#

I know

#

but I couldn't get any other db to work

#

but it works

dusky marsh
#

sqlite is local and works way better

earnest phoenix
#

I got so many errors and bot crashes using .txt files but its all good now

#

also why is it a bad idea to use .txt files

mossy vine
#

first of all, are you using node.js and fs

earnest phoenix
#

becuz it is

amber fractal
#

c o r r u p t i o n

mossy vine
#

fs will corrupt your files if you try to read and write at the same time, which is extremly likely to happen with a discord bot

earnest phoenix
#

yes

#

If anything, i make my code write files, then read them

#

for example, if I want to warn a user, I give the username as an argument, then my program names a text file to that user, and adds text to it

#

its temporary, don't worry

mossy vine
#

i wonder if using something to queue reads/writes would get around that

earnest phoenix
#

oh i see. So you are saying that if someone in another server were to try to warn a user and I would try to get that user's warnings, the bot would crash?

mossy vine
#

no

#

im saying is that if you fuck up async code and make fs write and read a file at the same time, it will corrupt it

earnest phoenix
#

async?

mossy vine
#

i dont know about file reading/writing in general and i should probably learn more about it, but in theory queueing them should work

#

asynchronous code

earnest phoenix
#

oh ok

mossy vine
#

i highly suggest you watch this great video by Fireship, explaining what async/await is

earnest phoenix
#

thanks

#

I'm so confused

mossy vine
#

yes, its not a simple thing

#

i reccommend you write very little code at first (10 lines max) to understand it

#

and just experiment it

#

its definitely the best practice for learning any new concept

earnest phoenix
#

I'm not that advanced. I still don't know a thing

#

Is it ok if i DM you my code with text files

mossy vine
#

i cant help right now, sorry

earnest phoenix
#

are you on mobile

mossy vine
#

no

#

just busy

earnest phoenix
#

k

#

Ill just dm you so I don't forget. You probably know this stuff way better than I do

queen bone
mossy vine
#

you can literally use any rest api with nodejs

#

get an http library, make a GET request to the api, and parse the returned data

queen bone
#

thank you very much , now i will dig into it

earnest phoenix
#

Why can't I have a single prefix? spongery

pale marsh
#

Wdym?

earnest phoenix
#

It works with every simbol

#

And it shouldn't

pale marsh
#

Share your code then

earnest phoenix
#
bot.on('message', message => {


    let args = message.content.substring(PREFIX.length).split(" ");

    switch (args[0]) {
        case 'ping':
            message.channel.sendMessage('pong');
            break;
#

further down are other commands

quartz kindle
#

you're not checking if a message starts with your prefix

earnest phoenix
#

should i make a

if (!message.content.startsWith(PREFIX)) return;
``` ?
dusky marsh
#

ye

quartz kindle
#

yes, thats one way to do it

earnest phoenix
#

Thank you

#

How to code a discord bot?:
1) Choose the language you already know or you will learn to not search on google or development.
2) Code your bot using libraries.

#

:D

pale compass
earnest phoenix
#

if the winner = message.author.bot return

#

before the message.channel.send

quiet topaz
#
document.onkeydown = function (event) {
    var key = event.key
    switch (key) {
        case "1":
       alert('test1')
        case "-":
            alert('test2')
        case "*":
           alert('test3')
            
    }

why this don'T works for me anymore?

pale compass
#

I have it, thanks

mossy vine
#

has anyone actually managed to corrupt a json file with fs on purpose? if so can i have some example code for uh reasons

hushed quarry
#

just write to a file multiple times simultaneously

quartz kindle
#

i've corrupted it not on purpose lmao

mossy vine
#

im currently doing read and then write like 26k times

#

works perfectly :c

hushed quarry
#

it will eventually corrupt

#

just don't do it

mossy vine
#

dont do what

hushed quarry
#

use a json to store data

mossy vine
#

not planning to

quartz kindle
#

if you throw an error in there that breaks the json object, fs will write an empty file

#

thats what happened to me

mossy vine
#

if writeFile gets an error i log it and do a process.exit()

#

but the thing is i literally cant get it to break with who knows how many thousand read/writes

#

regardless if anyone has a js script that can corrupt a file with writeFile/readFile with 100% reliability, please tell me

pale compass
#

Code: https://hasteb.in/depizake.js
How can I write that if the winnerCount is smaller than the people who reacted (- 1 because the bot should not be winner) then comes a message

hushed quarry
#

@queen bone commands in #commands please, but avoid common prefixes like -

queen bone
#

oops haha

dusky marsh
#

Is making a method in a class async valid?

late hill
#

language?

mossy vine
#

it is

#

assuming youre talking abuot js

late hill
#

^You just can't have an async constructor I believe

mossy vine
#
class myClass extends whateverTheFuck {
    constructor(idk) {
        this.idk = idk
    }
    
    async returnThatValue() {
        //do async stuff
        //oh yeah, and also return that value
        return this.idk
    }
}```
dusky marsh
#

coolio, thank you

vital nest
#

I have a quick and maybe stupid question, but when making a discord bot should I use the delete() function tol remove parsed JSON data after the info is posted, or does this have any impact on the bots ram usage?

#

it seems like the longer my bot is up and running the more memory it uses

#

so if theres a better way at reducing it, the help/tip would be appreciated 😃

wide ruin
#

shops = {'>balloon stall': {'file': 'tbobb/balloonstall.txt', 'title': 'Balloon Stall', 'color': discord.Color(0xff8888)}, }

#

if mcontent in shops: print(str(shops[mcontent['title']]))

#
Traceback (most recent call last):
  File "C:\Users\rcfra\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\client.py", line 227, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\rcfra\AppData\Local\Programs\Python\Python37-32\tbobb.py", line 123, in on_message
    print(str(shops[mcontent['title']]))
TypeError: string indices must be integers```
hushed quarry
#

mcontent is a string

wide ruin
#

what should it be?

hushed quarry
#

a dictionary

wide ruin
#

im looking in a dictionary with the name of that string, mcontent

#

how do i do that?

hushed quarry
#

shops[">balloon stall"]["title"]

wide ruin
#

can i do shops[mcontent]["title"]?

hushed quarry
#

yeah that should work

wide ruin
#

ok thank

earnest phoenix
#

Is jshint integrated with VSCode?
And if anyone knows, how do i disable it?

vital nest
#

whats the best way to send a message to a certain channel (by channel id)

split lantern
#

Lang?

vital nest
#

javascript, using discord.js

#

i tried using this client.channels.get(channelID).send(Text)

#

but nothing happened when I swapped in my values

split lantern
#

you did .get('123') and not .get(123) right?

vital nest
#

yes its in quotes

split lantern
#

If there was no error and no message the code didnt run

vital nest
#

yeah, thats what im thinking now, but im confused as to why its not

split lantern
vital nest
#

the only reason im confused is because all my other commands work, but i copied and edited an existing one to change the message, no error when its loaded or anything either

split lantern
#

Otherwise you can also show your code and let us have a look

warm marsh
#

the bot has permission to see the channel?

mossy vine
#

@warm marsh bots can see this channel, just cant talk

warm marsh
#

Wasn't talking about this channel...

#

Was talking about the channel they're having issue with

vital nest
#

yes it has access to it

mossy vine
#

Sry i cant read i thought you said this channel

#

But if it wouldnt have perms it would throw a discord api error

split lantern
#

Wanna show your code

vital nest
#

one second

mossy vine
#

You should put a console.log in the command to verify that it does actually get loaded and ran

vital nest
#

it does, it loaded the command fine, but never would run it, i got it working now, im not sure what I changed it anything

#

thanks for the help guys!

earnest phoenix
#

Does anybody know how to explain async

pale marsh
#

I read this article once

#

About a pro chess player playing like 10 other players

scarlet phoenix
#

Go bake a pizza, then get me a glass of water
VS.
Go put the pizza in the oven then get me a glass of water while it bakes

pale marsh
#

The pro player takes 10 seconds to think of a move while the other players each take a minute

#

So instead of playing each player till the end of the game they would move to the next while the other player thinks of a move

#

Takes less time

#

Async in a nutshell

mossy vine
#

@scarlet phoenix okay, that is honestly the best explanation ive ever seen, not just because it includes pizza

earnest phoenix
#

oh ok

pale marsh
#

Well yeah same thing. I made it harder on myself explaining it mmLol

scarlet phoenix
#

Lol i heard it somewhere way back like 10 years ago or something

earnest phoenix
#

Im like in middle school and im trying to cram all of this in my brain just for the fun of it

scarlet phoenix
#

It hasnt aged one bit

pale marsh
#

Nope

#

Because chess is eternal

#

Unless you mean the pizza one lmao

earnest phoenix
#

yeah that one lol

pale glen
#

quick question to devs that deal with reactions on embeds -
My bot has a feature that requires it to delete reactions Im getting this:

(node:9231) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions

but when I go into the permissions on my server the manage reaction switch is on

quartz kindle
#

hey guys, i have an interesting question: im experimenting with image compression for discord and the tradeoff is basically twice the time to send for 3-4x lower file size.
not compressed -> image size 230kb, time to send ~350ms, total time to send ~350ms
compressed -> time to compress ~400ms, image size 61kb, time to send ~250ms, total time to send ~650ms
which one would you pick?

pale glen
#

compress lol

#

its half a second

quartz kindle
#

true, but it kinda takes away the feeling of a "blazing fast bot"

#

lmao

#

but yeah, im probably gonna move to compressed

pale glen
#

if its under a second its fine

quartz kindle
#

im a performance addict

pale glen
#

we all are

#

but u should be a storage optimizer addict as well

earnest phoenix
#

I need a little explanation for promises

#

so whenever I get a promise rejection warning, I may be able to resolve one by 'faking' the promise

#

o wait nevermind

fiery stream
#

ayyy how do u run lua on windows

opaque eagle
fiery stream
#

how much time did that take you to make

#

idk and i installed lua but it still says lua: command not found

quartz kindle
#

did you restart your pc?

fiery stream
#

i dont know if i installed a correct thing or not

#

seems correct

#

but it didnt had anything about path

pale glen
#

question:
can someone invite my bot to their server by modifying the bot invite URL to have "permissions=0" on the link instead of the permissions the bot requires

fiery stream
#

https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/luaforwindows/LuaForWindows_v5.1.4-46.exe this is what i installed

pale glen
#

thus having the bot in their server without the proper permissions?

fiery stream
#

@quartz kindle is that correct ^^^^^^^^^^^^?

#

idk im confused

quartz kindle
#

i found this

#

this is listed in the lua official website

#

@pale glen yes

fiery stream
#

uh oh

#

^^^^^^^^^^^^^^^^ that one?

quartz kindle
#

seems to be basically the same thing, it does say it includes a bunch of shit, even a lua editor lol

#

anyway try restarting pc

fiery stream
#

okay ill see after restart

#

imma restart now

earnest phoenix
#
message.channel.awaitMessages().then(collected => {
collected.first().delete();
}
``` Does this deletes the first message it collected?
fiery stream
#

@quartz kindle THAT didnt help

#

Ops caps sorry

#

command not found

#

wierd i had to do lua.exe main.lua

opaque eagle
#

I'm supposed to get 233168, but I'm getting 234168, off by 1000. Ruby Code: ```rb
sum = 0
i = 0

until i >= 1000
i += 1
sum += i % 3 == 0 || i % 5 == 0 ? i : 0
end

puts sum```

#

Ok I figured out what's wrong... it worked fine after I changed 1000 to 999... but why tho?

dusky marsh
#

just remove the = before the 1000 @opaque eagle

#

you want up to 1000 but no including it

#

wait

opaque eagle
#

Did that, still the same problem```rb
sum = 0
i = 0

until i > 1000
i += 1
sum += i % 3 == 0 || i % 5 == 0 ? i : 0
end

puts sum```

#

Also idk how that would help, since that would count 1k

dusky marsh
#

change the > to a =

#

im dumb sometimes lmao

opaque eagle
#

Still same

#

Idk why, but replacing 1000 with 999 worked

earnest phoenix
#

i = 1000 is not the same as i == 1000

dusky marsh
#

youre true

opaque eagle
#

Also quick question, would you say go is faster than ruby or vice versa?

sullen yacht
#

I have a question. On the github documentation for the d.py lib of dblpy on the webhook example i was wondering if you NEED py self.dblpy = dbl.Client(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000) in order to use py @commands.Cog.listener() async def on_dbl_vote(self, data): logger.info('Received an upvote') print(data)? I only ask this because on the without webhook, the on_dbl_vote() isn't on there.

slender thistle
#

If you don't specify port, the webhook won't start

sullen yacht
#

So you need a webhook in order to get information like on votes and stuff?

slender thistle
#

Webhook will just receive the vote info when someone upvotes your bot

sullen yacht
#

Oh right okay that makes sense

#

Thank you

slender thistle
fiery stream
#

ayyy

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

fiery stream
#

lol

#

rip your bot

#

Is it possible to run pi-hole in digital-ocean???...

balmy lantern
#

how do you change the invite link on the website?

#

needa set some perms to it

sinful lotus
#

edit your bot's invite in edit

balmy lantern
#

Awesome found it, thanks

pallid zinc
#

how much time it take to approve

#

its almost a week

slender thistle
#
  1. Wrong channel
  2. Up to a week, can be two
fiery stream
#

btw he should know he already got bot developer role

pallid zinc
#

yup

#

last time it take 1 week

earnest spear
#

hey guys i'm trying to make a tic tac toe game in python and i'm wondering how one makes a check_win(board, marker) function?
for a 2d array

pale glen
#

huh

#

tic tac toe is finite and really small

#

just hardcode all the win scenarios

#

assuming board is :
123
345
789

#

wins are 123, 345, 789, 137, 248, 359, 149, 347

#

check if all of those squares contain the same symbol: O or X

#

if one of those combinations do theres a winner, otherwise there isnt

fiery stream
#
.get("https://official-joke-api.appspot.com/jokes/random", { 'headers': { 'user-key': "" } })
.then(res => {
    console.log(res.data.setup + res.data.punchline)
    response = res.data.punchline
})
.catch(err => console.log(err))
``` how do i do header userkey help
copper cradle
#

just use superagent

#
let txt = (await superagent.get('https://official-joke-api.appspot.com/jokes/random')).body.setup;
let txtt = (await superagent.get('https://official-joke-api.appspot.com/jokes/random')).body.punchline; 
#

you don't need any of that stuff

#

just this and you're good to go

balmy lantern
#

well really theres only 8 ways to win, if your playin on a normal 3x3 board, and if you set each square to a number then it should be super easy like
ik this is in like js form, but i assume its the same style-ish
if (win = '123') return 'you won'
if (win = '456') return 'you won'
if (win = '789') return 'you won'
if (win = '147') return 'you won'
etc

#

lol me and shakyra had the same idea lol

#

um lil late tho

queen bone
earnest phoenix
#
message.channel.awaitMessages()
.then(collected => {
collected.first().delete();
});
``` Does it delete the first message is collected?
fiery stream
#

@copper cradle that link was for testing

#

Im making a game data website

#

Where you can see the data of game how good the game is m stuff

#

@queen bone if u figure out oxfords api tell me how u did it

queen bone
#

sure will

fiery stream
#

Lol im using other api rn its bad

balmy lantern
#

Is there a way to see what place your bot is in the tags?

slender thistle
#

Tags?

sinful lotus
#

not everyone will give your bot perms

earnest phoenix
#

i just started it tho, and it instantly spammed my console

sinful lotus
#

it means your bot has no perms somewhere

earnest phoenix
#

i need to get a servers cmd so bad

sinful lotus
#

its like you are trying to do somethinf you cannot do

#

for example you do msg.channel.send() on a channel your bot cant send message to

#

ofc that would spam that

earnest phoenix
#

one sec

#

thats what it spams

prime cliff
#

Add console logging to see which server is running the command

sinful lotus
#
TypeError: Supplied parameter was neither a Role nor a Snowflake.
    at GuildMember.addRole (C:\Users\benta\Desktop\BubbleBOT\node_modules\discord.js\src\structures\GuildMember.js:454:38)
    at module.exports (C:\Users\benta\Desktop\BubbleBOT\Events\guildMemberAdd.js:5:10)
#

there you have the error

#

Events\guildMumberAdd line 5

earnest phoenix
#

one sec getting a hastebin

sinful lotus
#

add a null check

earnest phoenix
#

how

#

im a noob

sinful lotus
#

if (!variable) return

#

change the variable to your actual variable

earnest phoenix
#

its channel perms

#

cant do nothing about thay

#

that*

sinful lotus
#

not the error

#

it clearly says TypeError: Supplied parameter was neither a Role nor a Snowflake.

earnest phoenix
#

well

sinful lotus
#

then thats permissions

#

Im just answering you based on what info you give me

earnest phoenix
#

yeaah thats fine

pallid zinc
#

It simple mean your bot don't know when to add role and when to welcome

earnest phoenix
#

it does

pallid zinc
#

Nope

earnest phoenix
#

it works on my server

#

yes it does

#

lol

pallid zinc
#

Hmm

sinful lotus
#

yes but you cant expect other servers to do the same

#

thats how you develop a bot

earnest phoenix
#

yeah

sinful lotus
#

its not because it works on your server means it will on others

pallid zinc
#

No command and no variable

earnest phoenix
#

well the welcome channel is just #welcome

#

is set for leave and welcome

sinful lotus
#

yes but what if they dont have welcome channel

#

did you think about that?

earnest phoenix
#

im ading things slowly

#

i had to re write it

#

since it was being a turd

#

anyways thanks for helping

sinful lotus
#

yep thats how you basically fix that

#

make sure you take account what will happen

earnest phoenix
#

good luck for main mod dude

sinful lotus
#

and check if you can actually do it

earnest phoenix
#

Does anyone here know the insides of ML? I was trying to make a model based on spam links yesterday but Node got very slow and i now need to implement it in a faster runtime which has no libraries for that

sinful lotus
#

thank you GWahreeVampyYay

earnest phoenix
#

np

sinful lotus
#

ml?

earnest phoenix
#

can i use author in awaitmessages?

pallid zinc
#

Weeb is good

earnest phoenix
#

Machine Learning

sinful lotus
#

yes on paramaters of await messages

earnest phoenix
#

max: 1,
author: message.author

#

is this legal

sinful lotus
#

I think it should be on function

#

not params

earnest phoenix
#

dang

sinful lotus
#

unfortunately I dont work with AI yet

#

so I cannot help you on that part

#

but if you just want to avoid spam bots

#

you can analyze their name and the message they send

slender sphinx
#

well, hello @earnest phoenix

earnest phoenix
#

Well, okay, i hope articles will help, thanks anyways...

#

I already do

#

@slender sphinx BAHAHAH