#development

1 messages ยท Page 388 of 1

low rivet
#

Permissions is the permissions object, click on it and you'll see info about it

nimble merlin
#

I'll just define it to make it easier

low rivet
#

yep

nimble merlin
#

Can the destination server be server=ctx.message.server.id??? or does it have to be name?

low rivet
#

ctx.message.server

#

a Server object

nimble merlin
#

oh ok lol

maiden mantle
#

Mine says discord isn't a module, even though I've done all the installing and stuff, as well as typing out the correct code.

low rivet
maiden mantle
#

Yes, I'm also a beginner at this so I literally cannot function

low rivet
#

learn python

maiden mantle
#

The module's the only error. ๐Ÿค”

low rivet
#

learn python still

#

if u dont know python, don't bother playing around with discrod.py

maiden mantle
#

๐Ÿ‘Œ

low rivet
#

make something simple in python

edgy needle
#

can someone help with 24/7 bot activity?

nimble merlin
#

await self.bot.create_role(name='Muted', permissions=perms, server=server, color=0xFFFFFF) Why would that, output with this: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'int' object has no attribute 'value'

spring ember
#

@edgy needle vps

edgy needle
#

ia there a free one

#

at least to be online 90% of the day

#

@spring ember

torpid vale
#

@edgy needle language?

edgy needle
#

java

spring ember
#

I use a vps

edgy needle
#

is google cloud good?

#

cuz i typed in vps and that showed up

spring ember
#

Ovh is really cheap for small ones

#

I think it costs money tho

#

Google cloud

edgy needle
#

also Donish

spring ember
#

?

edgy needle
#

if you code java

spring ember
#

Yep

edgy needle
#

can you help me later

#

?

spring ember
#

Sure send whatever here

zealous forge
#

If you are looking for VPS. Here is a good list

#

https://www.scaleway.com/- Incredibly cheap but powerful VPSes, owned by https://online.net/, based in Europe.
https://www.digitalocean.com/ - US-based cheap VPSes. The gold standard. Locations available world wide.
https://www.ovh.co.uk/ - Cheap VPSes, used by many people. France and Canadian locations available.
https://www.time4vps.eu/ - Cheap VPSes, seemingly based in Lithuania.
https://www.linode.com/ - More cheap VPSes!
https://www.vultr.com/ - US-based, DigitalOcean-like.

edgy needle
#

cuz im on a ue4 , and other 3ds shits course rn

spring ember
#

Oh fuck

edgy needle
#

so will you be online later

#

dont ask how i got on discord

spring ember
#

I recommend joining the jda server

edgy needle
#

jda

#

?

spring ember
#

Java Discord Api, are you sure you are using Java and not JavaScript?

edgy needle
#

im using java

#

bot.on(message, (message) => {
// im too lazy to type in a acc code so ya
});

quiet bobcat
#

that's javascript though

low owl
#

Dude

edgy needle
#

wut

#

i did not know that was javascript

spring ember
#

Yeah thats javascript

edgy needle
#

dunnnnnnn

low owl
#

Java and Javascript have nothing to do with each other. Except they share a similar name

spring ember
#

Sorry I can't help you with js

quiet bobcat
#

I can though

#

What do you need help with?

#

If you want 24/7 uptime for js the best one imo is glitch. https://glitch.com/ @edgy needle

spring ember
#

How do I get the free .me domain from github student?

edgy needle
#

is glitch free? @quiet bobcat

quiet bobcat
#

Yes

edgy needle
#

but how do i use it?

quiet bobcat
#

๐Ÿค”

edgy needle
#

ik i type node . to start the bot i n terminal

quiet bobcat
#

node .?

#

uh, don't personally use glitch but I know it's good

#

I don't remember how to

#

Look up a tutorial perhaps

edgy needle
#

ok

#

ty

quiet bobcat
#

np

spring ember
#

How do I get the free .me domain from github student?

spring ember
#

Nvm

gilded thunder
#

How can I change the default help message in discord.py?

nimble merlin
#

Is there a way to find out whether a user is a supporter/admin/dev of the dbl website....similar to how you find if a bot is certified?

low owl
nimble merlin
#

ok, thanks ๐Ÿ˜ƒ

#

oh yea...so there is....thanks!

#

I also want to make my own database on a similar concept but for a bot within the support server that isn't public soooo, i'll work on that

frigid sierra
#

what's the permission type for removing reactions?

#

manage messages?

quiet bobcat
#

Think so

frigid sierra
#

yeah, it was ๐Ÿ˜›

quiet bobcat
#

๐Ÿ‘Œ

#

How do you persist timers with rethinkdb so timers can run after the process exists?

#

or is it even possible?

tidal grove
#

hi

spring ember
#

You are in a static function / not a class method @tidal grove learn python

undone hearth
#

Does anyone know how to get the avatar url of a user when they join or leave a server?

spring ember
#

language?

nimble merlin
#

embed.add_field(name='Name:', value='{}'.format(user.name) if user.id == '269758783557730314' or '402045095832059904' '{}![SAdmin](https://cdn.discordapp.com/emojis/424650130600361994.webp?size=128 "SAdmin")'.format(user.name) elif user.id == '404748176801923102' '{}![SMod](https://cdn.discordapp.com/emojis/424650237303586816.webp?size=128 "SMod")' else '{}'.format(user.name), inline=True) How come this fails, what did I do wrong?

inner jewel
#
value='{}'.format(user.name) if user.id == '269758783557730314' or '402045095832059904' '{}![SAdmin](https://cdn.discordapp.com/emojis/424650130600361994.webp?size=128 "SAdmin")'.format(user.name) elif user.id == '404748176801923102' '{}![SMod](https://cdn.discordapp.com/emojis/424650237303586816.webp?size=128 "SMod")' else '{}'.format(user.name)```
#

if user.id == '269758783557730314' or '402045095832059904' '{}:SAdmin:'.format(user.name)

nimble merlin
#

???

nimble merlin
#

You do know that because it's a custom emoji...we cant simply use :SAdmin: because we need to have the emoji ID wrapped in <>

topaz fjord
#

If it's a custom emoji

#

You need to provide the id

nimble merlin
#

I HAVE!!!

#

OK so why is it giving a syntax error????

#

Or have I formatted the oneliner wrongly???

#

ohhhhhhhhhh

inner jewel
#
class User:
    def __init__(self):
        self.id = "123"

user = User()

print("a" if user.id == "456" or "789" else "kek")```
nimble merlin
#

๐Ÿ˜ณ

inner jewel
#

this will always print a

#

guess why

nimble merlin
#

because the emoji isn't with the formatted user name ๐Ÿ˜ณ

hardy moon
#

My bot

inner jewel
#

wrong

topaz fjord
#

No u

nimble merlin
#

???

inner jewel
nimble merlin
#

wait, we can't use an or satement within an if statement?

#

that's annoying....

topaz fjord
#

You should learn python

nimble merlin
#

YEA....I FIGURED!!!

#

I am learning it you know

#

finding decent online courses that are free isn't exactly easy!

topaz fjord
#

Let's rephrase

#

Learn before you do it

inner jewel
#
print('{}'.format(user.name) if user.id == '269758783557730314' or user.id == '402045095832059904' else '{}![SAdmin](https://cdn.discordapp.com/emojis/424650130600361994.webp?size=128 "SAdmin")'.format(user.name) if user.id == '123' else '{}'.format(user.name))```
#

this works

hardy moon
#

@inner jewel Can you help me ? I would add commands to my bot

inner jewel
#

"a" if a else "b" if b else "c"

nimble merlin
#

OK! Thank you...

topaz fjord
#

how to add commands

nimble merlin
#

You don't need to commentate

topaz fjord
#

Not u

#

The other person

nimble merlin
#

ohhh.......

#

my bad....

hardy moon
#

@topaz fjord you are a economic class Turtle

nimble merlin
#

wait a sec....

#

??help

#

ok...that worked

#

a bot just DMed me.....hmmmm

quiet bobcat
#

bots can read messages but they can't send messages

nimble merlin
#

oh yea....you can't mute a bot's DM

spring ember
#

do !help

nimble merlin
#

!help

quiet bobcat
#

rip

nimble merlin
#

arrrhhhh

#

shuttttt

spring ember
#

and close your ears oops too late

nimble merlin
#

shhiittt

topaz fjord
#

No im public

nimble merlin
#

My poor CPU ๐Ÿ˜ข

#

Never again....

regal jay
#

Amy! Queue reminding me

#

Omg

#

๐Ÿ˜‘

#

Where is amy

#

๐Ÿ˜† ๐Ÿ˜†

quiet bobcat
#

Amy who?

undone hearth
#

@spring ember JavaScript using discord.js

spring ember
#

Sry JS is not my expertise

nimble merlin
#

How do I mention a role in my embed?

spring ember
#

Title?

nimble merlin
#

field

spring ember
#

Normally <@id>

nimble merlin
#

tried that...just outputs the id surrounded by <@ and >

spring ember
#

Oh role?

nimble merlin
#

yes

spring ember
#

<@&id>

nimble merlin
#

is the & supposed to be there?

spring ember
#

Yes

undone hearth
#

@spring ember Do you know how to get a users avatar url in an embed?

nimble merlin
#

k

spring ember
#

Nope

undone hearth
#

is sad

spring ember
#

Not in js

#

Read the docs

undone hearth
#

i did

gilded blaze
#

Like get an avatar from an embed or put one in?

undone hearth
#

@gilded blaze to get a users avatar url and put it in the thumbnail in an embed in js

gilded blaze
#

ahh

#

Lib?

trim plinth
#

in discord.js you would use displayAvatarURL

gilded blaze
undone hearth
#

@trim plinth i dont want it displayed tho, i want it to show the avatar

spring ember
#

?

undone hearth
#

@gilded blaze i know, i read what it says and it didnt help

gilded blaze
#

displayAvatarURL accounts for if they have no avatar

#

it gives you a link

undone hearth
#

ok.... ill try.......

trim plinth
#

@undone hearth it shows the avatar if you put it in a embed thumbnail or image

spring ember
#

@nimble merlin I understand it works

nimble merlin
#

yes

#

thank you! ๐Ÿ˜ƒ

spring ember
#

Np

undone hearth
#

@trim plinth still doesn't work....can we call or something?

trim plinth
#

show your code

undone hearth
#
bot.on('guildMemberAdd', member => {
    
    let membernum = member.guild.memberCount;
    let log = member.guild.channels.find(\name`, "log");
    if(!log) return member.guild.owner.send({embed: {
        color: 16711680,
        title: "Channel Error",
        description:`โ›” Could not find log. There needs to be a channel named #log for DevBot to welcome and bye bye members.`,
        fields: [
        ],
        footer: {
        text: "DevBot, made by MrDogeBro"
        }
      }
    });

    let welcomechan = member.guild.channels.find(`name`, "welcome");
    if(!welcomechan) return member.guild.owner.send({embed: {
        color: 16711680,
        title: "Channel Error",
        description: `โ›” Could not find welcome channel. There needs to be a channel named #welcome for DevBot to welcome and bye bye members.`,
        fields: [
        ],
        footer: {
        text: "DevBot, made by MrDogeBro"
        }
      }
    });

    let server = member.guild;

    welcomechan.send({embed: {
        color: 65392,
        title: "Gained User",
        description: `Welcome ${member} to the ${server}. Enjoy your stay! We now have ${membernum} members!`,
        image: {
            url: member.displayAvatarURL,
        },
        fields: [
        ],
        timestamp: new Date(),
        footer: {
        text: `DevBot, made by MrDogeBro`
        }
        }
        });

    log.send({embed: {
        color: 65392,
        title: "User Joined",
        description: `${member} joined`,
        image: {
            url: member.displayAvatarURL,
        },
        fields: [{
            name: "User ID:",
            value: `${member.id}`
        },
        ],
        timestamp: new Date(),
        footer: {
        text: `Server now has ${membernum} members | DevBot, made by MrDogeBro`
        }
        }
        });
});```
#

@trim plinth ^^^

spring ember
#

Hasteeebiiin

undone hearth
#

???

trim plinth
#

membernum Thonk

undone hearth
#

?

trim plinth
#

wait nvm

undone hearth
#

k

inner jewel
#

why do you escape `

undone hearth
#

?

trim plinth
undone hearth
#

didnt mean to

#

my bad

#

thats not in the code @inner jewel

trim plinth
#

it has no use in the code or in the code here

undone hearth
#

?

trim plinth
#

escaping ` has no use

#

unless you are putting ` in temperate literals

nimble merlin
#

hmmmm

hushed oyster
#

looks like py

nimble merlin
#

it looks like Python

#

yea

hushed oyster
#

i can help

trim plinth
#

yeah thats py

hushed oyster
#

is it just not sending the message?

nimble merlin
#

What won't work??

hushed oyster
#

i think i know why it wouldn't send the message

#

oh

nimble merlin
#

try replacing the emoji with it's id so if you do :(emoji): in a discord chat it will output with something....copy that and replace the emoji with it

hushed oyster
#

???

#

no don't do that

abstract crystal
#

no

nimble merlin
#

???

abstract crystal
#

this is a for loop generator

hushed oyster
#

that isn't how add_reaction works

nimble merlin
#

oh

hushed oyster
#

you have to put in the actual emoji

nimble merlin
#

oh yea...dun doi..i'm thinking of something else

#

ignore me, IK nothing lol

hushed oyster
#

hmm

#

wait

#

try await client.get_all_members()

nimble merlin
#

is this rewrite or async?

hushed oyster
#

looks like async

abstract crystal
#

@hushed oyster no, you need len(client.get_all_members())

nimble merlin
#

embed.add_field(name="Member Count", value=len(ctx.message.server.members), inline=True) That's what I have

abstract crystal
#

this is for a guild

nimble merlin
#

but idk about a for loop

#

just replace server to guild then

hushed oyster
#

no

abstract crystal
#

not the point

nimble merlin
#

?

hushed oyster
#

you don't understand

nimble merlin
#

oh

hushed oyster
#

he is trying to get every member of every guild

abstract crystal
#

he wants all users

hushed oyster
#

you're trying to get every member of that guild

nimble merlin
#

Oh....

slender thistle
#

Well...

yourvar = 0
for server in client.servers:
    yourvar += len(server.members)

?

hushed oyster
#

no

abstract crystal
#

yes

hushed oyster
#

no??

nimble merlin
#

??

abstract crystal
#

not the optimal way

slender thistle
#

Or are we getting just one server's members?

hushed oyster
#

oh wait

#

yes

nimble merlin
#

lol

abstract crystal
#

i do it like this: ```python
for s in client.guilds:
member_count = member_count + int(s.member_count)
channel_count = channel_count + len(s.channels)

#

oooooh

hushed oyster
#

but guilds isn't in async

nimble merlin
#

so I was right the first time

hushed oyster
#

replace guilds with servers

nimble merlin
#

gtg

#

cya

abstract crystal
#

then why are you using client, anyways

#

or what is your client var?

#

can you show the whole function?

earnest phoenix
#

one server's member count

len(ctx.message.server.members)

all of them

len(set(bot.get_all_members()))```
#

hope that helps

abstract crystal
#

@brittle oyster are you using discord.Client or discord.ext.commands.Bot?

#

yup, so you have an on_message function?

#

which passes on a discord.Message variable

#

so you want a len(message.server.members)

#

yes

#

exacly

hushed oyster
#

no

abstract crystal
#

well it has to be a string

#

but yes

hushed oyster
#

but that's only for the guild

#

not for every guild

abstract crystal
#

what exacly do you want?

#

for a current server or for every server that has your bot?

#

ooooh

hushed oyster
#

so that's wrong

abstract crystal
#

do you want a sum or by every guild

hushed oyster
#

guild is server

abstract crystal
#
Guild 1: 50 users
Guild 2: 60 users
...
#

like this?

hushed oyster
#

or like 110 users

#

using the bot

hardy moon
#

How I can add commands to my bot ?

hushed oyster
#

ok so

#

you would do len(client.get_all_members())

abstract crystal
#

wait

#

the first isn't that mine?

hushed oyster
#

yes

hardy moon
#

How I can add commands to my bot ?

hushed oyster
#

he wants a sum of all users

#

instead of await client.send_message(channel, len(message.server.members)) do await client.send_message(channel, len(client.get_all_members()))

abstract crystal
#

well so you don't spam the api one solution would be: ```python
embed_string = "Users by guild:\n"
for s in client.guilds:
embed_string += f"Guild {s.name} has {int(s.member_count)} users.\n"

await client.send_message(channel, embed_string)

hushed oyster
#

he doesn't want it guild by guild though

#

he wants a sum of all total members

abstract crystal
#

okay

#

well then use my solution above

hushed oyster
#

oh

#

this is very confusing

abstract crystal
#

yup

edgy needle
#

does any here code js?

abstract crystal
#

not rly

edgy needle
#

rip

abstract crystal
#

someone sure does

#

yes because it's a generator

#

you can't use a len() on it

#

yes

earnest phoenix
#

how would i get an avatar as a png with a size of 1024, i have this but its not working

 msg.author.displayAvatarURL("png,1024")```
abstract crystal
#

check the docs

#

discord.js?

earnest phoenix
#

there isnt anything there

#

yeah

#

it just shows displayAvatarURL()

elder rapids
#

Is 1024 even available...

earnest phoenix
#

yeah it is

elder rapids
#

Last I checked the highest Discord does is 512

#

ofc you can put 1024 but it will return 512

earnest phoenix
hardy moon
#

How I can add commands to my bot ?

earnest phoenix
#
#

if your using that library read docs

hardy moon
nimble merlin
#

Is there a way to stop my bot from responding to other bots without changing the prefix???

elder rapids
#

oh I see now Discord only returns highest resolution of uploaded image Thonk

#

if you pick a size that's higher

hardy moon
#

Wait

earnest phoenix
#

yeah but how do i do the command?

hardy moon
#

' is a prefix ?

abstract crystal
#

or max of 1024 @elder rapids

hardy moon
#

'help

#

No

abstract crystal
#

not here

elder rapids
#

but he just showed 2048 Thonk

quiet bobcat
#

uh idk what it is for python but for d.js it's if(message.author.bot) return to stop from responding to other bots

hardy moon
#

@nimble merlin You can use this prefix

#

'

elder rapids
#

I knew there was a max

#

I thought 512 was it

abstract crystal
#

huh got to check that out

nimble merlin
#

@hardy moon Doesn't work like that

hardy moon
#

Ah

earnest phoenix
#

i just get a webp still

elder rapids
earnest phoenix
#

msg.author.displayAvatarURL("png,1024") <---- doesnt work

nimble merlin
#

Just because I changed the prefix, doesn't mean that it won't respond to other bots

abstract crystal
#

msg.author.displayAvatarURL(format="png", size=1024)

earnest phoenix
#

oh damn

elder rapids
#

It's as simple as not running the command if Author.Bot is true

nimble merlin
#

oh ok

#

so if Author.Bot=True: return??

#

or would it be ctx.message.author.Bot=True...

elder rapids
#

sure if that works in your language

nimble merlin
#

lol

#

ok fair enough

#

i'll give it a try

abstract crystal
elder rapids
#

mmmkay

nimble merlin
#

is there not an easier way...I don't want to have to put that at the beginning of 48 different commands

#

make that about 60....

elder rapids
#

Um

#

You don't have to

#

What the hecc are you doing that requires that

nimble merlin
#

hahahaha

#

wait...what?

elder rapids
#

I have one if statement in my message receive that checks for bot being false

#

If it's false it will then proceed to find the command used and execute it

nimble merlin
#

does your commands use startswith???

elder rapids
#

Yes I have a StartsWith in my message receive to check prefix

nimble merlin
#

mine use @dusk verge.command

abstract crystal
elder rapids
#

After that I split the arguments

nimble merlin
#

ok

elder rapids
#

first argument is the command

abstract crystal
#

he is using Bot framework and every command is it's own func

elder rapids
#

oh god

nimble merlin
#

in my opinion, it's easier

elder rapids
#

Can't you just do what I do in C# which is just for looping all the commands which is put into a table and then check

earnest phoenix
#

helpp

#

admin

abstract crystal
#

?

nimble merlin
#

nope...

earnest phoenix
#

web admins

abstract crystal
#

not here

nimble merlin
#

why web admins???

abstract crystal
nimble merlin
#

why not just DM/ping a mod?

earnest phoenix
#

How can I insert my bot on the site

nimble merlin
#

...

abstract crystal
nimble merlin
#

bot.add_check(Author.Bot=False) That wouldn't work, would it?

abstract crystal
#

read

#

it wants a function

nimble merlin
#

oh

#

hmmm

abstract crystal
#

so what would you want:
-> make a function that checks if a user is a bot, if is a bot return False if is a user return True

nimble merlin
#

ok

#

would something (remotley) similar to bot.add_check(is_author_bot) work??

#

probably not...

abstract crystal
#

and what is your is_author_bot function?

nimble merlin
#

nvm...

#

i'll check the async docs....

earnest phoenix
#

the avatar thing still giving a webp

frail harness
#

smh

abstract crystal
#

JackTEK: you don't have to, you need to write your own

frail harness
#

just get avatar url

earnest phoenix
#

yeah

frail harness
#

it has a jpg

#

or it should

earnest phoenix
#
msg.channel.send(msg.author.displayAvatarURL(format="png", size="1024"))
frail harness
#

m9

#

why no put the image url in an embe

abstract crystal
#

@earnest phoenix replace .webp with .png

#

lul

nimble merlin
#

@abstract crystal i'll try (and probably fail)

#

but oh well

earnest phoenix
#

wym

frail harness
#

put the image in an embed

earnest phoenix
#

i will, just need to get it first

#

๐Ÿ˜

frail harness
#

the url?

#

check docs

abstract crystal
#

why do you want .png soooo baad

earnest phoenix
#

because the webp sucks

#

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

elder rapids
#

You do know webp is a better format than png

earnest phoenix
#

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

elder rapids
#

It's better for network

#

better compression

earnest phoenix
#

its not the proper size though

#

either

elder rapids
#

But why do you need 1024 so bad

abstract crystal
#

รดh javascript msg.channel.send(msg.author.displayAvatarURL(options={ format: "png", size: 1024 }))

#

mybe that

elder rapids
#

and is the original item you're fetching even the size of or higher than 1024

earnest phoenix
frail harness
#

nah it's just your avatar

elder rapids
#

^

earnest phoenix
#

yes i made my avatar, its a 1000x1000

frail harness
#

oh

earnest phoenix
#

i made it its 1000x1000

elder rapids
#

It's your avatar that looks like that

#

Discord doesn't return an image higher than the resolution of the image

earnest phoenix
#

thats the file

#

๐Ÿ˜

frail harness
#

that you made

earnest phoenix
#

yes

frail harness
#

discord compressed it

elder rapids
#

Maybe Discord did something to it

abstract crystal
#

@earnest phoenix check the code i wrote

frail harness
#

and then resized it

#

@abstract crystal they're using d.js

earnest phoenix
#

it didnt work

frail harness
#

oh

abstract crystal
#

rip

frail harness
#

that was in d.js

earnest phoenix
#

yes

abstract crystal
#

i'm not d.js dev sooo

earnest phoenix
#

ah

frail harness
#

lol im not either

earnest phoenix
elder rapids
#

lol same I don't program d.js

nimble merlin
#
bot.add_check(check)``` I assume that this works since no error is given
frail harness
#

solution: switch to d.py

earnest phoenix
#

lmao

elder rapids
#

That's not a function though Jack

nimble merlin
#

....

elder rapids
earnest phoenix
#

i know nothing about python

frail harness
#

smh

nimble merlin
#

same....clearly

frail harness
#

here's an example check func

elder rapids
#

Don't spoonfeed

nimble merlin
#

ok....

elder rapids
nimble merlin
#

^

abstract crystal
frail harness
nimble merlin
#

ty

earnest phoenix
#

figured it out

elder rapids
#

A spoonfeed zoomeyes

earnest phoenix
#

its supposed to be json

frail harness
#

and then you put that as a decorator on commands

abstract crystal
#

ahhh

frail harness
#

no, it's an example

abstract crystal
#

well

#

json

earnest phoenix
#
msg.channel.send(msg.author.displayAvatarURL({format:"png",size:"1024"}))
nimble merlin
#

I see

abstract crystal
#

i was almost right

#

welp

earnest phoenix
#

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

frail harness
#

he'll have to write his own check commands for other perms

#

oh nice

hardy moon
#

I want this : EctoBot dblCertified

upper ember
#

anyone can help me host static html page on Ubuntu/CentOS?

hardy moon
#

No sorry

glacial lance
#

use apache to host one

upper ember
#

I don't know ๐Ÿ˜‚

#

always used IIS

glacial lance
#

ubuntu: sudo apt-get install apache2
centos: sudo yum install apache2

upper ember
#

and?

hardy moon
#

Anyone can help me ? My friends try to add my bot but it don't works (error 403)

upper ember
#

just put the html file in var/www/html?

glacial lance
#

yes

upper ember
#

and connect the domain of course

#

that's it?

glacial lance
#

yes

upper ember
#

oh

#

that easy?

glacial lance
#

what did you expect..?

upper ember
#

idk

#

install 8382 packages

#

move 8317831 files

#

download 7382372 softwares

nimble merlin
#
    def predicate(ctx: commands.Context):
        check = ctx.message.author.Bot
        if check.author_bot:
            return True
        return False
    return commands.check(predicate)``` I guess that that *might* have worked since all of my cogs loaded and I got no syntax error
glacial lance
#

you just need apache/nginx and move files to that folder

upper ember
#

what's better centos or ubuntu?

#

for host static html file

#

index.html owo

elder rapids
#

I don't think it matters

glacial lance
upper ember
#

wait, I will need to type ls /var/www/html/ ?

hardy moon
#

How I can add commands to my bot ?

upper ember
#

in the console?

#

@hardy moon message.channel.send("I don't know")

glacial lance
#

between CentOS and Ubuntu, CentOS would be better, due to less pre-installed stuff.
Tho Debian would be even better, commands are almost the same as Ubuntu

hardy moon
#

@upper ember ?

upper ember
#

so use CentOS or Debian?

elder rapids
#

imo I prefer Ubuntu (Debian)

#

Really your own preference tbh

glacial lance
#

Debian, but your choice, I personally use it, that's all I will say

upper ember
#

I will just use Ubuntu... I never used CentOS.....

#

or debian

elder rapids
#

It's better to use an OS that you would feel more comfortable with using also

glacial lance
#

use Debian if you're considering Ubuntu at least

abstract crystal
#

@hardy moon you have to add it, because you are the owner of the application

upper ember
#

what are the differences?

earnest phoenix
#

I prefer debian

hardy moon
#

@abstract crystal thx

glacial lance
#
Debian and Ubuntu are the most influential Linux distributions ever. ... Asked to explain the difference between the two distributions, most users would describe Debian as an expert's distribution, and Ubuntu as a beginner's.

Here you go, easy explained

abstract crystal
#

@upper ember nginx lul?

upper ember
#

alright

#

so I will use Ubuntu, I am beginner with linux ๐Ÿ˜‚

hardy moon
#

@abstract crystal How long it takes to list my bot ? I have created his at 16:00

glacial lance
#

oh, then use Ubuntu for sure

abstract crystal
#

if you really want, take it to dms and maybe i can do it for ya

#

@hardy moon depends

hardy moon
#

Oh

#

Ok

nimble merlin
#

If a bot will not respond to itself even though it outputs with the exact requirements for a command, does that mean that it will not respond to other bots?

hardy moon
#

Thx

abstract crystal
#

@nimble merlin no because it treats them as usual users

elder rapids
#

wot

abstract crystal
#

you have to check it

nimble merlin
#

Wait, is that a: yes it will respond or a no it won't respond???

abstract crystal
#

yes it will respond

nimble merlin
#

that's annoying

elder rapids
#

wait what

nimble merlin
#

wait....so, even though I added a function for it, it will still respond?

elder rapids
#

You added a function for author.bot check right

nimble merlin
#

well a check and function

#

yes

elder rapids
#

It should ignore all bots including itself because it should be identified as a bot to the lib also

abstract crystal
#

your function doesn't work

nimble merlin
#

I just used a say command to test it...that was all

#

you know that how exactly??

upper ember
#

sudo apt-get install apache2

#

@glacial lance

#

is it ok?

elder rapids
#

yes yes it is

nimble merlin
#
    def predicate(ctx: commands.Context):
        check = ctx.message.author.Bot
        if check.author_bot:
            return True
        return False
    return commands.check(predicate)``` So this doesn't work???
upper ember
#

alright

#

lol

nimble merlin
#

what?

abstract crystal
#

wait a sec

nimble merlin
#

hmmm

#

ok

glacial lance
#

@upper ember yes

nimble merlin
#

Incase you are attempting to try it in #commands the bot is muted

abstract crystal
#

@nimble merlin bot in lower case

nimble merlin
#

should it be in lower case??

#

yes

#

yes it would be

abstract crystal
#

yes

nimble merlin
#

gtg for shower

#

aye

#

cya

abstract crystal
#
DigitalOcean

A 'LAMP' stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server.

elder rapids
#

They're not installing the full LAMP stack

#

They're just doing apache and hosting a static page

upper ember
#

already done @abstract crystal

abstract crystal
#

okay rooDuck

#

nice site

elder rapids
#

What template system are those docs ๐Ÿ‘€

upper ember
#

tyty

#

its like mix of 3 templets

elder rapids
#

care to tell me them?

abstract crystal
elder rapids
#

thx

abstract crystal
trim plinth
#

hmmm

upper ember
#

http works
https doesn't

elder rapids
#

You have an HTTPS url in an HTTP page

#

Mixed-content is not rendered for Discord

upper ember
#

ok

#

so how do I change the url to https from http?

elder rapids
#

Either force HTTPS with HSTS or idk

upper ember
#

I think i force HTTPS...

elder rapids
#

Considering you link to images.discordapp.com you can't go to HTTP

#

I believe they use HSTS (or force HTTPS through other means)

upper ember
#

what...?

#

just tell me how do I fix that? ๐Ÿ˜‚

elder rapids
#

By making HTTP go to HTTPS

upper ember
#

how?

elder rapids
#

HTTPS internet yo

abstract crystal
#

force redirect HTTP to HTTPS

upper ember
#

how do I do that?

elder rapids
#

If you go behind CloudFlare it's easy to setup HSTS

upper ember
#

I am using cloudflare

elder rapids
#

Then do that

upper ember
#

how?

inner jewel
#

under crypto

upper ember
#

where can I find this page?

#

cloudflare?

inner jewel
#

yes

upper ember
#

what now?

#

I am in cloudflare

elder rapids
#

Go to the crypto tab

upper ember
#

ok

#

done

#

what now?

elder rapids
#

Read the page ๐Ÿ˜‚

#

And what Natan showed you

upper ember
#

I turn on "always use https"

#

not works...

#

and I enabled HSTS

elder rapids
#

Discord caches embeds

elder rapids
#

and those settings can take a bit to refresh throughout

inner jewel
#

^

upper ember
#

this one should be like that?

elder rapids
#

If you don't have HTTPS on your backend server then choose flexible

upper ember
#

ok

#

works

#

ty

worldly aurora
elder rapids
#

Urole is null

worldly aurora
#

Well, how do I fix that this error doesn't show? lol

trim plinth
#

try this @worldly aurora ```js
const Urole = oldRole.guild.channels.find("name", "logs");

worldly aurora
#

Okay, lemme try

solemn obsidian
#

You need to actually check if the channel exists in the first place, not all servers have #logs

trim plinth
#

that too ^

worldly aurora
#

@solemn obsidian Ikr bro lmfao

solemn obsidian
#

wrong scope

worldly aurora
#

well, lmfao

trim plinth
#

it should be in the event

solemn obsidian
#

oldRole doesn't exist on startup

trim plinth
#

@worldly aurora it should be inside the roleUpdate event, not at the start of the file

worldly aurora
trim plinth
#

also theres no point in having async there

worldly aurora
#

well, all my other events have it too

#

but there isn't any "send" issue

inner jewel
#

you only need async if you use await

trim plinth
#

^

worldly aurora
#

well

#

the command actually works

#

but it always shows up send of null

earnest phoenix
#

hi can anyone help me

neat falcon
#

do u know discord.js

trim plinth
#

or know JS ^

earnest phoenix
#

^

#

There are plenty of places to learn JS, this place is not one of them.

neat falcon
#

^

idle mountain
#

there's docs for discord.js and javascript as well

#

i'd suggest you read them

earnest phoenix
#

This chat is used for development, not for spoonfeeding or teaching basic principles of programming. If you know JS, then reading the discord.js docs should not be a problem as the docs are well written and laid out @earnest phoenix

neat falcon
#

DM the mod who muted it @frigid juniper

frigid juniper
#

Oh ok thanks

earnest phoenix
#

hello

#

can someone show me how to do a welcome message with discord.js

quiet bobcat
#

Solace just told you no @earnest phoenix

earnest phoenix
#

; - ;

ruby dust
#

atomic (bool) โ€“ Whether to atomically add roles.what does that mean exactly?

abstract crystal
#

from discord.py (should apply): Whether to atomically add roles. This will ensure that multiple operations will always be applied regardless of the current state of the cache.

inner jewel
#

there are two ways to add/remove roles

#

one you set the roles, which depends on the cache and can cause race conditions

#

one you add/remove a specific role, a single role per request, but it's independent from the cache

#

the first endpoint allows adding and removing multiple roles in a single request

earnest phoenix
#

?

earnest phoenix
#

anyone know how to get colors for d.js embeds

bright spear
#

Never ask if anyone can help, instead just post your problem and all of the information @brittle oyster

earnest phoenix
#

like the 6 digit ones

bright spear
#

@earnest phoenix use a hex to decimal converter

earnest phoenix
#

kk ty

bright spear
#

Yw

earnest phoenix
#

depends what it gonna do in it

olive ridge
#

If I make meh bot constantly change the role color to get a rainbow effect, will it show up on the role?

elder rapids
#

That's API abuse

barren berry
#

^

idle grail
elder rapids
#

ummm specifically what

idle grail
#

It keeps coming up

#

i defined message

#

it worked before

elder rapids
#

Oh unknown message

idle grail
#

now it suddenly stopped working

elder rapids
#

I see it's on a delete message command (like clear)

#

How do you do it

idle grail
#

do what

elder rapids
#

Because Discord API is returning unknown message

idle grail
#

Oh

#

command code?

elder rapids
#

yes

idle grail
#
  delete: {
    a: ["clear", "purge", "del"],
    d: {
      desc: "Deletes the specified number of messages",
      usage: ":(number of messages to be deleted)",
      perms: "message",
    },
    f: (message, mess) => {
      if (Number(mess) <= 100 && Number(mess) > 0){
        let channel = message.channel;
        message.delete().then((message) => {
          channel.bulkDelete(parseInt(mess), true)
            .then((messages) => {
              embed.setAuthor(`Deleted ${messages.size} messages`, message.guild.iconURL);
              embed.setFooter("");
              message.channel.send(embed).then(message => message.delete(3000));
            }).catch(reason => {
              embed.setAuthor("I was not able to delete all specified messages due to API Limitations.", message.guild.iconURL);
              embed.setDescription(`\`\`\`diff\n- Reason:\n${reason}\n\`\`\``);
              embed.setFooter();
              message.channel.send(embed);
            });
        });
      } else {
        message.reply(ej.wrong + " Please provide a number โ‰ค 100 and > 0");
        return;
      }
    },
    t: 3,
    del: true,
  },```
#

OH

#

Wait i think i got it

elder rapids
#

Didn't even need to tell you much

idle grail
#

yeah it works now

elder rapids
#

Rubberduck debugging is great

idle grail
#

Lol

#

free code

#

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

elder rapids
#

nah I won't use that, no use to me

olive ridge
#

it is

#

api abuse?

#

i kri

worldly aurora
#

lmfao

west current
#

So in Discord.js, if a bot tried to DM a member who's DM is turned off it'll give a warning, how do I avoid that?

gilded blaze
#

try catch

trim plinth
#

@west current try and catch is good

upper ember
#

I have domain (luki.xyz)
I bought it on namecheap,
I host website using this domain (using digitalocean Ubuntu vps),
can I do like luki.xyz/captures/nsjs72.png (become sharex custom uploader) without delete the website?

topaz fjord
#

with delete?

upper ember
#

Without*

topaz fjord
#

you will have to make a backend

#

api ish

earnest phoenix
elder rapids
#

@upper ember You can fully do that by either integrating it into the site or if it's another process that hosts a webserver (on a different port) you can proxy it

upper ember
#

First option

#

How do I do that?

#

And how long it will take? blobjoy

elder rapids
#

๐Ÿคท

topaz fjord
#

what do mean?

#

making the image server?

west current
#

@trim plinth Thanks for the help, I already got the problem fixed.

trim plinth
west current
#

SInce there was await in there, it wouldn't work if I used try{} and catch{}

#

I need to do .catch()

#

My bad for the ping

earnest phoenix
earnest phoenix
#

help

#

my

#

Microsoft Visual Studio is not working

#

i paid 700USD

#

for that VS

solemn obsidian
frozen bough
jagged birch
#

any idea why this is happening when I try to install a npm package?

npm ERR! path C:\Users\Dylan\Desktop\test\node_modules\discord.js
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Dylan\Desktop\test\node_modules\discord.js' -> 'C:\Users\Dylan\Desktop\test\node_modules\.discord.js.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent```
#

i dont have a discord.js folder, trying to install it again.

#

I re installed nodejs too

earnest phoenix
#

If u can download it from GitHub

bleak sapphire
#

can anyone help me rn?
Basically this never happened before
I tried to run my help command which is ts help then i got this message

Ignoring exception in command help
Traceback (most recent call last):
  File "C:\Users\Matt GT\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "C:\Users\Matt GT\Desktop\Discord Server\Tesla\bot.py", line 49, in help
    await bot.say(embed=embed)
  File "C:\Users\Matt GT\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 309, in _augmented_msg
    msg = yield from coro
  File "C:\Users\Matt GT\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\client.py", line 1152, in send_message
    data = yield from self.http.send_message(channel_id, content, guild_id=guild_id, tts=tts, embed=embed)
  File "C:\Users\Matt GT\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\http.py", line 200, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: BAD REQUEST (status code: 400)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Matt GT\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "C:\Users\Matt GT\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 374, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Matt GT\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: BAD REQUEST (status code: 400)
#

the code for the help command is too long so i cant paste it

#

there are way too many commands

#

it happened while i was working on the bot
i added some new commands

low owl
#

discord.errors.HTTPException: BAD REQUEST (status code: 400)

bleak sapphire
#

what is it?

low owl
#

Research?

bleak sapphire
#

oh i guess the message was too long

low owl
#

Probably, Embeds have special limits for example

bleak sapphire
#

ye

#

ok good it works now

#

ty so much

earnest phoenix
#

r/dankmemes 2

gilded thunder
#

How can I put commands into catergories in discord.py or replace the default help command?

#

Preferrably custom help.

floral stone
#

self.bot.remove_command("help")

#

@gilded thunder

gilded thunder
#

Thanks, then I just make a command with the contents?

#

And it follows the pm_help=True rule still?

upper ember
#

how do I setup this page to be the 404 page?
https://luki.xyz/404.html

karmic parcel
#

what are you using?

earnest phoenix
#
app.use(function(req, res) {
    res.status(404).sendFile(__dirname + '/404.html');
});```
something like that i think
#

if ur using express

karmic parcel
#

that's why I asked what they're using

earnest phoenix
#

ik

karmic parcel
#

uh the only thing that's missing is the next param, I think that's supposed to be standard for middleware

#

@upper ember henlo

upper ember
#

apache @karmic parcel

#

@earnest phoenix I'm not using express

karmic parcel
upper ember
#

@karmic parcel I created this file on /var/www/html

#

I wrote in it only ErrorDocument 404 /404.html

#

I have 404.html file on /var/www/html/

#

and that's not working

karmic parcel
#

do you have it serving html or does it start serving /www/

upper ember
#

wdym?

karmic parcel
#

uh, your document root is set to /var/www/html?

upper ember
#

no..

karmic parcel
#

well what's it set to then?

#

the ErrorDocument field should be relative to it

karmic parcel
#

You can probably set it in the config file for the site

#

instead then

#

try looking at /etc/apache2/sites-available/default

#

unless you modified it

naive terrace
#

i need some help

hardy moon
#

Yesterday I created a bot but it remained diconnected all night and it has been declined can someone tell me how to let him connected ?

frozen bough
#

do you use a vps?

keen anvil
#

You need to have a server or vps that keeps it online

#

via pm2 or screen (most popular options)

upper ember
#

^^^^^^^

hardy moon
#

Thx

edgy needle
#

can someone help me?
i want to make my bot send all the help messages and once but it sends them one by one
example.
y!help
2 seconds later
y!ping
and so on..
language : JS

hardy moon
#

sorry, bad message

#

I created my robot, now how do I make it to connect?

edgy needle
#

the code is :
message.member.sendMessage('y!help - displays a list of commands')
message.member.sendMessage('y!ping - tests the ping of the bot')
but when i try
message.member.sendMessage('y!help - displays a list of commands
y!ping - ')
it does not work

#

@hardy moon connect?

hardy moon
#

the bot is offline

#

my bot

edgy needle
#

What language?

hardy moon
#

french

inner jewel
#

@edgy needle use \n for line breaks

edgy needle
#

Code language

inner jewel
#

thing.send('a\nb\nc')

#

would send a b c

edgy needle
#

i want them all at once

inner jewel
#

use a single send call

#

and line breaks

hardy moon
#

I created my bot now, I haven't a code language

edgy needle
#

^ makes no sense

inner jewel
#

on the discord page? @hardy moon

nimble merlin
#

So, I want my bot to add an emoji next to a users name in a few commands (like info etc) if they are a supporter, author, admin, mod etc etc....but I can't think of an efficient db setup for this (setting the status requires a command BTW) does anyone have any pointers or tips for an efficient system that actually works in discord.py async????

hardy moon
#

I'm french, I'm VERY bad at english

#

@inner jewel yes

inner jewel
#

you need to choose a programming language for your bot, then choose a library and write code for it

hardy moon
#

wait

edgy needle
#

@inner jewel /n does not work

inner jewel
#

because you used /n

#

it's \n

edgy needle
#

oh

earnest phoenix
#

mm

#

its \n mah boiยจ

hardy moon
#

@inner jewel Have you get my bot link ?

earnest phoenix
#

em

edgy needle
#

it work ty

#

now i dont get 35 dms

earnest phoenix
#

xD

#

you could use embed thingy tho

inner jewel
#

@hardy moon do you even have code for your bot?

hardy moon
#

no

earnest phoenix
#

eh

inner jewel
#

you need to write the bot

#

and then add it here

earnest phoenix
#

-_-

hardy moon
#

how ?

earnest phoenix
#

you can use node if you want

#

just google

inner jewel
#

do you know any programming languages?

earnest phoenix
#

discord.js is pretty easy @hardy moon btw

hardy moon
#

hum..........no (u)

#

ok thx

nimble merlin
#

...

inner jewel
#

just no

#

youtube tutorials should be avoided

edgy needle
#

@earnest phoenix do you use js?

earnest phoenix
#

well

inner jewel
#

they're easily outdated

earnest phoenix
#

maybe

inner jewel
hardy moon
#

thx

earnest phoenix
#

mostly I do because I don't wanna work too much atm

#

also the first link is idiots guide

nimble merlin
#

I REALLY hate to be (kind of a hypocrite) cocky but you REALLY shouldn't be trying to create a bot unless you at least have a reliable source of language info....

hardy moon
#

@inner jewel Can you give me your ID in private message ? That way I'll give you acces to my bot and you can help me because I understand nothing xD

prime cliff
#

Lol

fleet socket
#

Hi, I am really new to discord bots. I wanted a bot that functions by reading specific stats off a website. The website offers API keys (please click here to see them https://coinmarketcap.com/api/) already with the formatting and information I was looking for. But where do I go from here.

#

Here is a picture of a functioning bot that is working, nobody in the discord can tell me where it came from.

tame rivet
#

you need to make a GET requests to the site's api using the language of your choice

fleet socket
#

Ok it has GET on the site

tame rivet
#

ye

#

so what programming language do you use?

fleet socket
#

Can we keep this in laymans terms. I am kind of dumb with this stuff

tame rivet
#

okay

#

there are 2 main types of http requests

#

GET for getting data

#

and POST for sending data

#

you need to use the GET type inside your language to get the data you want

#

what programming language are you using? (e.g. javascript, python, c)

fleet socket
#

I dont know how to program. I didn't know it would be that intensive

#

but I think I found one a second ago, that runs what I am looking for

tame rivet
#

otherwise you'll have to learn how to code

fleet socket
#

@tame rivet What about the link I found? Could that be moved into its own bot under the first folder

spring ember
#

dude you should learn how to code first

#

I see that's python

#

learn it

tame rivet
spring ember
#

yep

earnest phoenix
#

my question is do you know any coding languages?

#

hi i got a question

#

?

#

basically

#

i am making a bot

#

and

#

i want a help command

#

with an embed

spring ember
#

language?

earnest phoenix
#

how do i do embeds?

spring ember
#

first thing

earnest phoenix
#

discord.js

spring ember
#

umm damn it

quiet bobcat
#

https://anidiotsguide_old.gitbooks.io/discord-js-bot-guide/content/examples/using-embeds-in-messages.html

earnest phoenix
#

ty

spring ember
#

everyone using js and I am jda

quiet bobcat
#

np

earnest phoenix
#

message.channel.send({embed: {
color: 3447003,
description: "A very simple Embed!"
}});

#

wait

#

how can i do it as a command?

#

ik how

#

use RIchEmbed it is much more simple

quiet bobcat
#

does it work in v12 though?

#

ik v12 is dev but...

earnest phoenix
#

I dmed him how

#

or dming

spring ember
#

?

nimble merlin
abstract crystal
#

hmmmmm hyperhmm

nimble merlin
#

lol

#

I'm allowed to use them

#

Last I checked...there were no copyright/TOS rules against it

abstract crystal
#

whatever you say

nimble merlin
#

lol

earnest phoenix
#

Oh you're going through with the ideaa

#

Nice

nimble merlin
#

huh???

earnest phoenix
#

You wanted to make the dbl thing right?

nimble merlin
#

Sorry if I don't remember something...my mind is like jellow (or whatever americans call it) right now

#

yes

earnest phoenix
#

Yee

nimble merlin
#

I remember the convo now ๐Ÿ˜„

earnest phoenix
#

:3

nimble merlin
#

โค

#

๐Ÿ˜ƒ

earnest phoenix
#

๐Ÿ’™

#

I gtg now

#

Bye

nimble merlin
#

ok cya

abstract crystal
#

technically some of these emotes are used on the website and technically they are covered by copyright and TOS

#

but not sure lul

nimble merlin
#

Should I bother asking???

abstract crystal
#

idk really

nimble merlin
#

If i'm breaking a rule...I would remove them....although I would have to make new emotes but oh well