#development

1 messages ยท Page 1498 of 1

earnest phoenix
#

I don't think it works

pale vessel
#

they're using the command client I guess

earnest phoenix
#

@bot.event

#

I'm new

#

like I said ๐Ÿ˜ญ

near stratus
#

okay, hear me out

pale vessel
#

ah

near stratus
#

You'll need 2 webhooks
One for Discord and one for top.gg

#

Are we clear ?

#

@earnest phoenix ?????????

earnest phoenix
#

wait 2 webhooks?

#

๐Ÿ˜

#

I'm already confused about one webhook

near stratus
#

you'll need either a discord bot client or discord webhook

#

since you just started keep going with a bot client

earnest phoenix
#

I was thinking of making a bot tho?

#

can is how you a example

#

of someone who made something

#

for me to look at?

#

he coded it

near stratus
#

Also,
You will need a database
or at least a JSON file

#

wait a second

earnest phoenix
#

can i send you the code

#

in dms?

#

or here?

near stratus
#

send in DM

#

I'll check

pale vessel
#

@crimson vapor we need jason.db for python

crimson vapor
#

hmm

#

do you know python?

earnest phoenix
#

Message isn't abc.Messageable MegaThonk

velvet jolt
#

bruh

#

imagine saying

#
message.send()
instead of 
ctx.send()```
#

smart people

earnest phoenix
#

Right, doesn't make sense

velvet jolt
#

that aint even gonna work

pale vessel
#

resend the message 5Head

velvet jolt
#

ctx = context

#

ctx has 3 letters message has 7

earnest phoenix
#

Context is Messageable, Message isn't kekw

velvet jolt
#

u can use

#
await message.channel.send()```
in 
```py
on_message event```
#

not in normal commands tho

earnest phoenix
#

Wdym, that'd work in commands as well, if you name the ctx parameter message KEKW

velvet jolt
crimson vapor
#

thats js

#

and py

#

lol

velvet jolt
#

smart dude

velvet jolt
pale vessel
#

ctx.channel
ctx.message.channel
thinkowo

velvet jolt
pale vessel
#

does ctx inherit message properties or only messageble abc

crimson vapor
#

py is the jack of all trades, but good at none

#

js is good for browsers

pale vessel
#

i doubt that's true

earnest phoenix
#

ctx.channel returns ctx.message.channel

pale vessel
crimson vapor
#

ik

#

thats why I said good for browsers

velvet jolt
earnest phoenix
velvet jolt
pale vessel
#

so something like ctx.pin() exists?

#

that sounds weird but it makes sense

earnest phoenix
#

dang y'all

#

he got tired and went to sleep

#

who wanna help me next? lol

pale vessel
#

norizon can

earnest phoenix
#

loooool

#

norizon
๐Ÿ˜›

#

you ready to get annoyed?

#

Nope, it doesn't have all the property the Message has, but it does have the original Message object

pale vessel
#

ic

earnest phoenix
#

What are you trying to do, Ashleyy

#

trying to

#

connect webhook

#

to topgg

#

and get it to

pale vessel
#

i see now

earnest phoenix
#

send name of the person who voted to be sent in discord chat

#

like this

#

I see, do you wanna use dblpy or not

#

I can't

#

use it

#

You can set up the webserver yourself or use dblpy and just input the port and stuff which is easier

#

Can you help?

#

I'm trying to figure iut out

#

dang

#

What have you got so far

#

you made one before?

#

ugh

#

lemme show

#

@earnest phoenix is it smnart to show

#

the ip address?

#

in here?

#

No

#

this is all I got

#

I'd use aiohttp

#

huh?

#

what does that do?

#

wait

#

you made that bot in python?

#

same thing, because if you're using flask, you need to thread it afaik, not sure

#

wait

#

i don't know what that is bruh

#

i'm soo new to this

#

๐Ÿ˜ญ

pale vessel
#

norizon have mercy lmao

earnest phoenix
sacred trout
#

how do i make a check if the member is kicked or not?

#

@earnest phoenix

earnest phoenix
#

audit logs (?)

#

oh

#

ye

#

lol

sacred trout
#

umm

#

bruh

#
@commands.has_permissions(kick_members=True)
async def kick( ctx,member: discord.Member,*, reason=None):
    try:
        embed = discord.Embed(title=f"User Kicked!",colour=discord.Colour.green())
        embed.set_thumbnail(url=member.avatar_url)
        embed.add_field(name="**user Kicked**",value=f"**{member}**", inline=False)
        embed.add_field(name="**Kicked by**" ,value=f"**{ctx.author}**", inline=False)
        embed.add_field(name="**Reason:**",value=f"**{reason}**", inline=False)      
        await ctx.send(embed=embed)
        await member.send(embed=embed)
    except:
        pass
    responses = ("https://tenor.com/view/mod-admin-you-kick-fight-gif-14702799", "https://tenor.com/view/kick-woman-lol-gif-8979171")
    await ctx.send(choice(responses))
    await member.kick(reason=reason)```
#

in this

#

how do i make the bot check if the member is kicked or not

earnest phoenix
#

oh, if that kick raises HTTPException, then it's not kicked

sacred trout
#

umm

#

wha????

tight plinth
#

if you get an error in the await member.kick then the member is not kicked

sacred trout
#

wtf?

tight plinth
#

ok

tight plinth
#

did you wrote this code

#

or did you copy pasted it from somewhere in the internet

sacred trout
#

the kick code?

tight plinth
#

yes

sacred trout
#

umm i started it by coping it then i added the embed and try except me=yself

#

myself*

tight plinth
#

yeah that's the problem

sacred trout
#

lol

tight plinth
#

if you don't know what the code does you can't fix it

#

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

sacred trout
#

i mean ik what it does

#

and how it does

earnest phoenix
velvet jolt
#
try:
except Exception as err:
print(err)
await ctx.send("the member its still here for some reason.")```
tight plinth
#

if you know what each and every line of your code does then you're supposed to know how to handle erroes

earnest phoenix
#

indentation KEKW

sacred trout
velvet jolt
sacred trout
#

uh

velvet jolt
#

anyway that should work

sacred trout
#

how did you add colorful letter in this

earnest phoenix
#

```py
```

velvet jolt
#

if the member its an admin or the guy who's trying to kick its not an admin

sacred trout
#

lmao

tight plinth
#

```language
CODE```

velvet jolt
#

or u can do

pale vessel
#

```engllish

tight plinth
#

yes

sacred trout
#
await ctx.send("bruh")```
tight plinth
#

you got it flaz

sacred trout
#

danm

earnest phoenix
velvet jolt
#
@has_permissions(ban_members=True)```

```py
error handler even
error.missingrole```
sacred trout
velvet jolt
tardy hornet
#

what are the % that it wont work

tight plinth
sacred trout
velvet jolt
tardy hornet
#

OkAy

earnest phoenix
#
const aWillToLive = false 
velvet jolt
earnest phoenix
tight plinth
#

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

velvet jolt
#

?tag tits

earnest phoenix
#

tias

#

asdasod

velvet jolt
#

lol

earnest phoenix
#

Every dev server most likely does kekw

#

oh he was talking about bot christmasthink

sacred trout
#
except Exception as err:
print(err)
await ctx.send("the member its still here for some reason.")```bruh
#

do i add it in the kick command or make a separate func

velvet jolt
#

๐Ÿคฆโ€โ™‚๏ธ

#

for that i told u to learn some basic first

sacred trout
#

;-;

velvet jolt
#

theres tutorials about python on youtube

sacred trout
#

ik

velvet jolt
#

check them out

sacred trout
#

but can you please tell this???????/

#

plox

velvet jolt
#

๐Ÿคฆโ€โ™‚๏ธ

#
try:
ban function
except Exception as err:
print(err)
await ctx.send("learn python")```
sacred trout
#

wha????????????????? lol

#

bruh

#

DO I MAKE ANOTHER FUNC OR ADD IT IIN IT

#

๐Ÿ˜ฆ

#

i suck lmao

earnest phoenix
#

it's inside your kick function, try to kick the member using the kick method, if that raises an error, the except block would be run

sacred trout
#
    try:
        embed = discord.Embed(title=f"User Kicked!",colour=discord.Colour.green())
        embed.set_thumbnail(url=member.avatar_url)
        embed.add_field(name="**user Kicked**",value=f"**{member}**", inline=False)
        embed.add_field(name="**Kicked by**" ,value=f"**{ctx.author}**", inline=False)
        embed.add_field(name="**Reason:**",value=f"**{reason}**", inline=False)     
        await ctx.send(embed=embed)
        await member.send(embed=embed)
    except Exception as err:
        await ctx.send("nop3")```
#

something like this?

tardy hornet
#

i tried to do like in the docs

#

that when someone votes it will send a message

#

and i dont understand why it isnt working

sacred trout
#

what????///

crimson vapor
#

does py have object deconstructon?

sacred trout
#

but it didn't work ;-;

#

@velvet jolt

tight plinth
#

so i have a string like this: "Hi {user}, and welcome to {server_name}!". My goal is to detect all the things between the {} and to replace them by something in the string. How can i do that with js?

crimson vapor
#

hmm

velvet jolt
#

bruh

#

im out of this

sacred trout
#

bruh

velvet jolt
#

ur supposed to do

tardy hornet
#
const votechannel = bot.channels.cache.find(channel => channel.id === "795623007472975872")
dbl.on('vote', vote => {
  votechannel.send(`${vote.username} just vote for the bot in top.gg!`)
})

i know it wont work, but?? HyperThinkRotate

sacred trout
#

to do

crimson vapor
velvet jolt
#
@bot.command()
async def command(ctx, member:discord.Member)
function here```
tight plinth
crimson vapor
#

yeah but I mean

tight plinth
crimson vapor
#

there are only a set amount right

tardy hornet
#
const votechannel = bot.channels.cache.find(channel => channel.id === "795623007472975872")
dbl.on('vote', vote => {
  votechannel.send(`${vote.username} just vote for the bot in top.gg!`)
})

will it work??? HyperThinkRotate

tight plinth
#

the user will be able to put as many {} as he want

crimson vapor
#

so you could replace {user} with Lumap#0001

#

oh what it would be

tight plinth
#

but the {} in themself are preset

crimson vapor
#

yeah

earnest phoenix
sacred trout
#

still waiting for kami's reply loal

crimson vapor
#

its not very efficient but it would work to just do that

tight plinth
#

aka {user} will work bc i programmed it but {rgvgf} won't

crimson vapor
#

yea

sacred trout
#

how do i do it with the kick method?

pale vessel
#

Like js "{user} {user} {server}".replace(new RegExp("{user}", "g"), "Lumap#0001")You mean?

tight plinth
#

i guess yeah

#

lemme try that

haughty vortex
#

hey

pale vessel
#

yeah you have to use new RegExp() with g flag so that it replaces all occurrence

haughty vortex
#

but my message handler is never executed

#

any idea why ?

pale vessel
haughty vortex
#

:p

#

it logs "initialized commands"

#

but the message handler doesn't seem to have been added

crimson vapor
#

is this ts or js?

haughty vortex
#

js

crimson vapor
#

js

haughty vortex
#

js + jsdoc

crimson vapor
#

you can use export default in js?

haughty vortex
#

yes

#

that's a part of the spec

crimson vapor
#

never knew that

haughty vortex
#

lol

#

I'm using babel to have access to these features

#

private class properties, export/import, etc

crimson vapor
#

hmm

pale vessel
#

#discord

haughty vortex
#

nah, #services

crimson vapor
#

idk babel

haughty vortex
#

you should learn it

#

it's fun

#

so any idea why it doesn't wanna work ?

crimson vapor
#

nope

haughty vortex
#

it all references correctly but it doesn't work

#

๐Ÿ˜ข

tardy hornet
#
const votechannel = bot.channels.cache.find(channel => channel.id === "795623007472975872")
dbl.on('vote', vote => {
  votechannel.send(`${vote.username} just vote for the bot in top.gg!`)
})

didnt work ๐Ÿค”

pale vessel
#

why not

tardy hornet
#

because

#

idk

crimson vapor
#

shouldn't you fetch the channel?

tardy hornet
#

is it then

#

?

#

?????? ๐Ÿค”

crimson vapor
#

vote is undefined

earnest phoenix
#

How to check if number provided by user is negetive number ?

crimson vapor
#

js?

earnest phoenix
#

yes

velvet jolt
#

check if the number has - in it no?

eternal osprey
#

hey

#

i tried running my music bot on my vps

haughty vortex
#

I figured out my issue lol

#

my dependency injector was fuckered

eternal osprey
#
2|index  | TypeError: fields.flat is not a function
2|index  |     at Function.normalizeFields (/root/Music-bot-master/node_modules/discord.js/src/structures/MessageEmbed.js:450:8)
2|index  |     at MessageEmbed.setup (/root/Music-bot-master/node_modules/discord.js/src/structures/MessageEmbed.js:78:91)
2|index  |     at new MessageEmbed (/root/Music-bot-master/node_modules/discord.js/src/structures/MessageEmbed.js:18:10)
2|index  |     at embedLikes.map.e (/root/Music-bot-master/node_modules/discord.js/src/structures/APIMessage.js:166:40)
2|index  |     at Array.map (<anonymous>)
2|index  |     at APIMessage.resolveData (/root/Music-bot-master/node_modules/discord.js/src/structures/APIMessage.js:166:31)
2|index  |     at TextChannel.send (/root/Music-bot-master/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:166:62)
2|index  |     at Object.exports.run (/root/Music-bot-master/commands/w-filters.js:17:21)
2|index  |     at module.exports (/root/Music-bot-master/events/message.js:16:9)
2|index  |     at Client.emit (events.js:198:13)
```
#

runnin it on my pc works great

#

on my vps it is giving me this problem

haughty vortex
#

flat() was introduced with node 11

#

below that you'll get errors

eternal osprey
#

how do i update?

crimson vapor
#

install node 14

haughty vortex
#

no idea lol

earnest phoenix
#

Looking good?

eternal osprey
#

there is too much space in the rigght of the embed

#

you only use 1 side

earnest phoenix
#

Hm

earnest phoenix
#

How much should I make image size?

#

they're on ios discord on a tablet

#

lol

#

it's just how embeds look

#

Yea true ^^^

#

you can make the embed look better by removing the footer entirely and extracting the dominant color in the image and making that the embed color

crimson vapor
#

imo the requested by is just ugly

eternal osprey
#

uhhm i tried updating nodejs on ubuntu vps

#

but it doesn't work

#

is there even a nodejs version higher than 10 for ubuntu?

crimson vapor
#

14

#

well

#

15

#

but use 14

earnest phoenix
#

15 best cause native AbortController uwu

crimson vapor
#

what is AbortController?

earnest phoenix
#

allows you to send signals to abort promises

crimson vapor
#

o

earnest phoenix
#

super useful

eternal osprey
#

but how would i do that?

earnest phoenix
#

and node-fetch supports it very well

eternal osprey
#

like, how would i install the latest version

crimson vapor
#

node-fetch is pog

eternal osprey
#

sudo apt install nodejs tried this many times

#

only thing i get is nodejs is already the newest version (10.19.0~dfsg-3ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 123 not upgraded.

crimson vapor
#

because thats not how you do it

earnest phoenix
#

doesnt node have an install document

crimson vapor
#

it does

earnest phoenix
#

I'm still trying to figure it out simp

rocky hearth
#

is it possible to recursively call an anonymous function in js?

tardy hornet
#
const votechannel = bot.channels.cache.find(channel => channel.id === "795623007472975872")
dbl.getVotes().then(votes => {
  if (votes.find(vote => votechannel.send(`${vote.username} just voted for the bot in top.gg!`))) console.log("someone has voted!!!")
});

i think it will work now

crimson vapor
#

test it

pale vessel
crimson vapor
#

oh no

#

whats that link

pale vessel
#

what

crimson vapor
#

you fucked a loli

#

tf this

pale vessel
#

no

#

what

earnest phoenix
#

illegal

pale vessel
#

fine i'll change it

tardy hornet
#

didnt work

pale vessel
#

well yeah

#

what are trying to find

tardy hornet
#

when someone votes

pale vessel
#

getVotes() returns an array of users that voted

tardy hornet
#

it will send a message in the "votechannel"

pale vessel
#

but it returns all users that voted

tardy hornet
#

then how do i do that

pale vessel
#

and it's not live either

#

you need to use the webhook

#

getVotes() is rest

tardy hornet
#
dbl.webhook.on('vote', vote => {
  votechannel.send(`User with ID ${vote.user} just voted!`);
});```
#

then like that?

#

@pale vessel

pale vessel
#

yeah

tardy hornet
#

i dont need to define stuff now?

#

like https

pale vessel
#

well, define votechannel

#

and make sure you set up the webhook correctly or the event won't trigger

eternal osprey
#
 Error: The module '/root/moderationklaar/node_modules/canvas/build/Release/canvas.node'
0|index    | was compiled against a different Node.js version using
0|index    | NODE_MODULE_VERSION 64. This version of Node.js requires
0|index    | NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
0|index    | the module (for instance, using `npm rebuild` or `npm install`).
0|index    |     at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)
0|index    |     at Module.load (internal/modules/cjs/loader.js:863:32)
0|index    |     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
0|index    |     at Module.require (internal/modules/cjs/loader.js:887:19)
0|index    |     at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:80:39)
0|index    |     at require (internal/modules/cjs/helpers.js:74:18)
0|index    |     at Object.<anonymous> (/root/moderationklaar/node_modules/canvas/lib/bindings.js:3:18)
0|index    |     at Module._compile (internal/modules/cjs/loader.js:999:30)
0|index    |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
0|index    |     at Module.load (internal/modules/cjs/loader.js:863:32)
``` uhhh
molten yarrow
#

canvas doesnt work on node 15

tardy hornet
#

@pale vessel

#

const dbl = new DBL(yourDBLTokenHere, { webhookAuth: 'password', webhookServer: server });

#

that

#

?

eternal osprey
#

i am usin node version 12

pale vessel
#

are you using @quasi shale-gg/sdk?

#

br

tardy hornet
#

yes

pale vessel
#

use the test button on your webhook page to test the vote event

molten yarrow
eternal osprey
#

can i maybe delete the node modules folder and install it again?

eternal osprey
#

how

molten yarrow
#

its tells you in the error :3

sacred trout
#

please help me

crimson vapor
#

you you need to reinstall node

eternal osprey
#

npm rebuild

sacred trout
#
    except Exception as err:
        print(err)
        await ctx.send("loal")```
eternal osprey
#

i tried that 3 times

#

Still same errors

sacred trout
#

how do i add this is my kick command?

molten yarrow
#

you sure its node 12?

earnest phoenix
#

learn python

sacred trout
#

bruh ;-;

eternal osprey
tardy hornet
eternal osprey
#

pretty sure that i am usin v12 right now

tardy hornet
#

like that tho?

sacred trout
#

plox help

molten yarrow
#

node -v

crimson vapor
sacred trout
#

v14.15.3

crimson vapor
#

embed needs to be inside the webhook.on

tardy hornet
#

????

#

o

pale vessel
#

you need to use vote, which is only available inside the event callback

eternal osprey
pale vessel
#

logic

molten yarrow
earnest phoenix
#

@sacred trout do you know how try and except works

sacred trout
#

umm yes but in this case idk how

#

loal

earnest phoenix
#

bruh same concept

sacred trout
#

idk i am CoNfUsEd

tardy hornet
#

now this is good?

sacred trout
neon heart
earnest phoenix
#

I told you, you're handling errors raised from send method, instead of the kick one

#

ban*

sacred trout
#

so how do i do that :9

earnest phoenix
#

by learning python christmasthink

sacred trout
#

bruh

#

plox tell

earnest phoenix
#

it's pretty self-explanatory ya know,

except: do something else
sacred trout
#

yse

#

yes

earnest phoenix
#

so what are you failing to get then

sacred trout
#

so in try i am trying to send the msg to the user

#

and in except i am not send the msg and straight up kicking him

tardy hornet
#

dbl.webhook.on('vote', vote => {
TypeError: Cannot read property 'on' of undefined

earnest phoenix
#

nah, not only sending the msg to the user, you're also trying to send a message in that channel where the command was invoked

sacred trout
#

that's in try

#

but in except i am doing nothign

earnest phoenix
#

you're sending a message kekw

#

how is it doing nothing

sacred trout
#

pass

#
    except:
        pass```
earnest phoenix
#

What are you on???

pale vessel
#

smash or pass

earnest phoenix
sacred trout
#

how am i send a msg in except

pale vessel
#

Like you normally do?

sacred trout
#

bruh

pale vessel
#

bruh

sacred trout
#

bruh

earnest phoenix
#

sotp

crimson vapor
#

flaze you still don't have school right?

pale vessel
#

no

#

yea

earnest phoenix
#

noyes

crimson vapor
#

when does your school start?

pale vessel
#

20

sacred trout
#

except Exception as err: print(err) await ctx.send("loal")

crimson vapor
#

20 days or 20th?

earnest phoenix
#

???

crimson vapor
#

or

#

just 20?

earnest phoenix
#

20 jan kekw

sacred trout
#

@earnest phoenix how do i add it bruh

earnest phoenix
#

At this point, I'd tell you to learn python

sacred trout
#

lol

tardy hornet
#

pls

#

dbl.webhook.on('vote', vote => {
TypeError: Cannot read property 'on' of undefined

pale vessel
#

dbl.webhook is undefined

umbral zealot
#

well dbl.webhook is undefined

sacred trout
#

@earnest phoenix bruh can you help with the code plox

pale vessel
umbral zealot
# sacred trout <@456226577798135808> bruh can you help with the code plox

Before you make a Discord Bot, you should have a good understanding of the language you want to use to write it. This means you should have a basic understanding of the following topics:

  • Proper Syntax
  • Debugging Code and Errors
  • Basic Language Features (vars, arrays, objects, functions)
  • Reading and Understanding Documentation
  • The import or module system for your language.

As much as we'd like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning the language.
We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.

Here are good resources to learn the language through tutorials, videos, or books:

https://automatetheboringstuff.com/ (for complete beginners to programming)
https://learnxinyminutes.com/docs/python3/ (for people who know programming already)
https://docs.python.org/3/tutorial/ (official tutorial)
http://python.swaroopch.com/ (useful book)
see also: http://www.codeabbey.com/ (exercises for beginners)

Please take a couple of weeks/months to get acquainted with the language before trying to make bots!
learnpython pyfirst

earnest phoenix
#

I could've straight up spoon fed you, but that won't help you. Also against this server rules ig

#

Why does he react kekw

sacred trout
#

idk

#

now?

earnest phoenix
#

now learn python

sacred trout
#

see this

umbral zealot
#

See everyone agrees you need to go learn the language.

sacred trout
#

umm i agree to that as well lol

earnest phoenix
#

then do it ๐Ÿ—ฟ

umbral zealot
#

There are meny things wrong here. lol

sacred trout
pale vessel
#

๐Ÿ—ฟ

earnest phoenix
#

It works witbout

Doing

This

Shit

Aswell

radiant kraken
#

why are there two <html>

earnest phoenix
#

yes I have eyes, fortunately

umbral zealot
sacred trout
#

oh

tardy hornet
#

how isnt it defined

earnest phoenix
#

@radiant kraken oh ye ur damn right ๐Ÿคฆ

#

@radiant kraken nvm its beacuse its onother page

tardy hornet
#

i think i know why 1s

earnest phoenix
pale vessel
#

@tardy hornet follow the tutorial correctly

shrewd creek
#

hey peeps its my first time coading a discord bot

#

i am struck at a place

earnest phoenix
#

I recomend u bdfd then @shrewd creek

umbral zealot
earnest phoenix
#

~~botghost โœ… ~~

#

@earnest phoenix ew

#

Yikes

#

Yikes

shrewd creek
#

yea its almost done just need to add one feature

#

status = ['Jamming out to music!', 'Eating!', 'Sleeping!']

haughty vortex
#

LTS is usually less secure

crimson vapor
#

because its the best

haughty vortex
#

uh

tardy hornet
#

in

shrewd creek
#

i use this status to vari

haughty vortex
#

that's not a valid reason lol

crimson vapor
#

14 gives access to more features

tardy hornet
#

i put the bot top.gg token right?

pale vessel
haughty vortex
#

what? no it doesn't

#

wtf

crimson vapor
#

wait

pale vessel
#

you mean 15

crimson vapor
#

not 14?

#

nvm

pale vessel
#

because it's the latest lmao

slim heart
haughty vortex
#

my brain

shrewd creek
#

status = ['Jamming out to music!', 'Eating!', 'Sleeping!','putting mokka/making lame jokes']

@bot.event
async def on_ready():
change_status.start()
print('Bot is online!')

i want to add this function to the status

#

(activity=discord.Game(name=f"{len(bot.guilds)} servers!"))

haughty vortex
#

also npm 7, N-API 7, AbortController, QUIC, unhandled rejection throws, and V8 update

#

ez

tardy hornet
#

where do i get it

earnest phoenix
#

you set it

crimson vapor
tardy hornet
earnest phoenix
#

You put the one you set on your code

molten yarrow
tardy hornet
#

it dose not matter how i name it right?

earnest phoenix
#

as long as they match

haughty vortex
#

if you didn't read it before, I suggest you do

earnest phoenix
#

guys how to generate random (Number+Text) with limit of 4 to 6 chars

shrewd creek
#

can any body help me in this section

bot = commands.Bot('#', description='Yet another music bot.')
bot.add_cog(Music(bot))
status = ['Jamming out to music!', 'Eating!', 'Sleeping!',(activity=discord.Game(name=f"{len(bot.guilds)} servers!"))]]

@bot.event
async def on_ready():
change_status.start()
print('Bot is online!')

@tasks.loop(seconds=20)
async def change_status():
await bot.change_presence(activity=discord.Game(choice(status)))

without that bold part its working but i really want that bold part...

tardy hornet
#

im just, not gonna do it, too hard for me i guess, that webhook thing

earnest phoenix
#

uh you can make it lambda: f'{len(bot.guilds)} servers' and check if that's callable or not, if so, call it so that it returns that string, otherwise just set it right away

shrewd creek
velvet jolt
earnest phoenix
#

well the task is started after the bot is ready, it should return the right number

velvet jolt
earnest phoenix
#

don't do shit in on_ready kekw

velvet jolt
#

trying to notivate people to learn python

velvet jolt
#

cuz the things make sense when u know already

#

@earnest phoenix imagine that i have several for loops in my on_ready event

earnest phoenix
#

guys how to generate random (Number+Text) with limit of 4 to 6 chars

earnest phoenix
velvet jolt
velvet jolt
#

stuffs

earnest phoenix
#

spaghetti loops

earnest phoenix
earnest phoenix
velvet jolt
#

@earnest phoenix im mostly working on economy bots

#

so

earnest phoenix
#

Same

velvet jolt
#

im using many things

earnest phoenix
#

Want to generate random transaction id

velvet jolt
#

also my last work its a bot based on Tanki Online (multiplayer 3D shooter) and imagine that i replaced cogs with functions that im calling from other files

#

functions = better than cogs

#

change my mind

crimson vapor
#

py?

velvet jolt
#

ye

crimson vapor
#

damn

velvet jolt
#

lol

stuck pike
#

Any good free hosting

velvet jolt
#

imagine not adding len(bot.guilds) in the list

stuck pike
#

Can work till 100 server

velvet jolt
#

but adding it in the code line instead

earnest phoenix
velvet jolt
#

heroku its good

velvet jolt
velvet jolt
#

you can get the codes from a github repo and run them

#

but if you're using a database to save stuffs then idk

earnest phoenix
velvet jolt
#

ik

earnest phoenix
#

!help

#

oops sry

velvet jolt
#

ah yes

#

all the bots that were in dpy server (made by users got kicked)

#

=/

stuck pike
#

Works?

velvet jolt
#

idk. heroku aint that good at saving data in the database

#

neither any free host

#

u should look for a paid 9ne

#

one

stuck pike
#

Repl it?

velvet jolt
#

like google platform it gives you 500$ as a bonus for registration

velvet jolt
rose warren
#

There are really cheap vps plans out there

earnest phoenix
rose warren
#

$2 a month

stuck pike
#

@earnest phoenix Servers?

earnest phoenix
#

@stuck pike what?

velvet jolt
#

yes, repl.it its good but u have to use its db if want to work with data else no

stuck pike
#

@velvet jolt the problem is im just 14 and I come from w retarded country

velvet jolt
#

lol

umbral zealot
#

quick.db on repl.it wouldn't work because your entire database would be viewable by anyone.

rose warren
#

Open source TrollFace

stuck pike
#

Lawl imagine stealing my data

umbral zealot
#

There is no good free host that's sufficient for your needs.

velvet jolt
#

lol

stuck pike
#

Imagine calling a plan hacher plan

velvet jolt
#

repl*

umbral zealot
#

If you can subscribe for $7/month on repl.it you can pay $5/month for a full private VPS on literally any decent hosting provider.

earnest phoenix
rose warren
#

For $7/month you can get a good enough VPS for way more than 100 servers

velvet jolt
#

but google gives u free 500$ if you register on Google cloud

velvet jolt
#

all.u need its a credit card / debit

velvet jolt
stuck pike
#

Hm

#

My quick db only saves Prefixes tho

velvet jolt
#

bring uptimerobot to ping your flask server evvery 5 minutes and it should run 23/7 (free uptimerobot checks every 5 minutes and that equals in a bit of downtime)

#

@stuck pike then use repl.it's database to store prefixes

#

its easy

earnest phoenix
#

Why is my purge command not working?

crimson vapor
#

whats the error?

velvet jolt
#

@earnest phoenix delete that bro

#

else everyone will go on your profile and check ur repl

earnest phoenix
#

Lol

#

But whatโ€™s wrong with the coding?

velvet jolt
#

use lightshot instead

#

idk

#

im not good in js

earnest phoenix
#

Lemme send uh

velvet jolt
#

python its still better

stuck pike
#

Wait the people who know my replt acc can see my console or code?

earnest phoenix
stuck pike
earnest phoenix
#

@stuck pike yes

#

Anyone help why itโ€™s showing an error?

velvet jolt
stuck pike
#

Yea js

#

Js better lib vro

velvet jolt
#

@earnest phoenix check if the bot has manage messages perm

#

@stuck pike python its better

#

also

#

glitch its good for js projects

#

= a js hoster

stuck pike
#

Because I have a sponsor

velvet jolt
#

try making one by yourself

stuck pike
#

After 100 server he pay me 5$

velvet jolt
#

๐Ÿคฆโ€โ™‚๏ธ

stuck pike
#

For hosting

velvet jolt
stuck pike
#

Hm

earnest phoenix
#

@velvet jolt but whatโ€™s the problem you see?

velvet jolt
#

no clue mate

#

sry

#

i have no clue how does js works

earnest phoenix
#

Hm whatโ€™s so good about python?

velvet jolt
#

everything

#

its easy to learn and not that complicated

crimson vapor
#

imo its very confusing

velvet jolt
#

even nasa uses it KEKW

earnest phoenix
#

Lol

crimson vapor
#

I prefer ts and js

earnest phoenix
velvet jolt
#

bbruh

stuck pike
stuck pike
velvet jolt
#

pythong,C# and C = gods

stuck pike
velvet jolt
stuck pike
velvet jolt
#

no ty

earnest phoenix
#

pythong sounds like a good lang indeed

velvet jolt
#

I'd rest on python

umbral zealot
#

pythong lang is best lang

earnest phoenix
#

In .replit file
language = "go"
start = " "
What should I write in start?

velvet jolt
#

thats my man

umbral zealot
stuck pike
umbral zealot
#

I've never had to touch that file

stuck pike
#

Lawl

velvet jolt
velvet jolt
umbral zealot
velvet jolt
stuck pike
#

Idk why haruko doesn't work for me

#

It brings bot up but never works

stuck pike
velvet jolt
#

heroku?

stuck pike
#

Yea heruko

velvet jolt
#

u need to config the env

#

in heroky's site

#

just search on google and u will find

stuck pike
#

O

#

Lemme see

velvet jolt
#

i mean theres a secret place where u have to put your bot's token

stuck pike
#

My bot hitted 8k members lol

umbral zealot
#

Hosting on kerohu isn't that hard.

velvet jolt
#

not in the github repo

stuck pike
#

My bot isn't even online 1 hour a day lmfao

velvet jolt
#

self host = best

umbral zealot
velvet jolt
stuck pike
#

Again promoting own site hehe @umbral zealot

stuck pike
velvet jolt
stuck pike
#

Bot is in 31 servers and 8k users

#

I have full color management

velvet jolt
#

check that site to see how u should config heroku

velvet jolt
stuck pike
#

I had a Discord bot 51 servers

#

But I forgot the account password

velvet jolt
#

lol i have one in 91 servers

stuck pike
#

Of the acc

velvet jolt
#

but i aint gonna verify it

stuck pike
#

Y

velvet jolt
#

cuz im not trusting discord with my id

stuck pike
velvet jolt
#

id (irl document)

umbral zealot
#

sus

velvet jolt
#

i mean bruh

#

y are u even asking for ur id?

#

its not like a 10 y/o kid could code a discord bot

umbral zealot
#

Because they want you to be legally responsible for the bot that has access to potentially millions of user's data

#

it's got nothing to do with your age

#

It's a trust relationship. Discord trusts you with data for millions of users, you trust them with one thing: your real ID.

velvet jolt
#

what type of data?

#

users's ids?

#

its just discord ids

#

nothing more

umbral zealot
#

No it's a lot more than that

earnest phoenix
#

not only that

velvet jolt
#

never heard about that

#

what more is in there?

umbral zealot
#

You get every single message, channel, role, user's avatars and names

#

You can do a lot from shit you can scrape off Discord.

stuck pike
umbral zealot
#

And if you get Presence data? You can literally know someone's waking schedule on discord, what music they listen to, what games they play...

#

You already trust Discord with all that information.

stuck pike
#

Started coding when I was 11

umbral zealot
#

Discord wants to trust that you won't do nasty shady things with the information of millions of others.

velvet jolt
#

๐Ÿค”๐Ÿค”

velvet jolt
#

ok. u convinced me

#

imma go to show em my id

stuck pike
#

My parents think I waste time on pc for 8 hours day

velvet jolt
stuck pike
#

And I actually code 8 hours

velvet jolt
#

lol

stuck pike
#

Lol I just make daily fixes

#

Other project

#

Making portfolio websites

#

Website*

stuck pike
# velvet jolt lol

Uk my teacher was teaching what Is database and it works plus html. I asked him sir should I use sql or mongo he said "Go read books don't google these stuffs it's for big kids "

#

I was like :

umbral zealot
stuck pike
#

@umbral zealot I live in retarted country

#

God help me

umbral zealot
#

I wouldn't know, I don't understand what you're babbling on about

#

Maybe keep random conversations to #general ?

velvet jolt
#

lol imagine learning coding and stuffs at school instead of self learn

umbral zealot
#

I know you like asking what host to use like every other day but still.

stuck pike
#

M just saying school = suck

velvet jolt
stuck pike
velvet jolt
stuck pike
#

Same

#

In my class teacher teach to make Hello world in Qbasic

earnest phoenix
#

who looking to bot reviewes

stuck pike
#

Wot?

earnest phoenix
#

?

stuck pike
#

What are u trying to say

earnest phoenix
#

?

#

yes

umbral zealot
#

That's nice dear.

crimson vapor
#

I also did that

velvet jolt
stuck pike
umbral zealot
#

Verification takes 1 week or more.

stuck pike
#

Yea

#

Nps

earnest phoenix
umbral zealot
#

"bro". Well that means you're turkish.

hushed ledge
#

But my bot has only Turkish laungauge support.

umbral zealot
#

"bro" is turkish, "sir" is indian. ๐Ÿ‘

umbral zealot
stuck pike
#

@umbral zealot wait uk India

stuck pike
#

I m from India lawl @umbral zealot

umbral zealot
#

ok sir

stuck pike
#

No u sir

neon heart
#

if possible to send dm message when someone vote my bot without webhook service but with dbl bot webhook service and get the user id from the embed data?, i has get the data but I am not sure to use this method

stuck pike
#

O

rustic nova
neon heart
#

hmmm ok

fossil canyon
#

Can someone help me make login using discord? (On my webpage)

stuck pike
#

Use auth

earnest phoenix
rustic nova
shrewd creek
#

does anyone know how to limit a command to the bot owner??

earnest phoenix
#

compare author ids

shrewd creek
#

@bot.command(name='servername', help='This command displays the no of servers in which its on')
async def servers(ctx):
if ctx.message.author.id =='my id'
await ctx.send(bot.guilds)

earnest phoenix
#

you're comparing an int to a string, there's no need to omit ids, all ids are public data

#

and also, what norizon sent

shrewd creek
#

thx guys

#

ill look in to the link

earnest phoenix
#

for future reference, message is redundant there, you could've done ctx.author

gilded olive
kind thicket
#

I've been trying to make my bot send the outcome of this:

ccxt.sortBy(Object.values(tickers), "quoteVolume", true).map(ticker => ({ price: ticker['last'].toFixed(3) }))

Though I have been able to console.log the outcome:

[ { price: '1048.330' } ]
fossil canyon
kind thicket
#

i've been trying to improve my bot for like 4 hours straight and my brain is fried

earnest phoenix
#

the request needs to have an Authorization header in the format of Bearer <access token here>

distant cobalt
#

I had 2 variables for this. One of them is the warnReason and the other is warnUser. How do i exclude the mention from the warnReason?

cinder patio
#

remove the first argument from the args array

#

assuming you have a command handler

distant cobalt
#

Yes i have a command handler

distant cobalt
opal plank
#

shift?

distant cobalt
#

using args.shift?

opal plank
distant cobalt
#

oki

#

oki

rose warren
#

Could someone point me towards the docs for rate limits on sending messages to a channel for bots?

cinder patio
#

you could also use slice

#

slice is probably better

opal plank
#

why is that?

distant cobalt
#
const warnUser = message.mentions.users.first()
const warnReason = args.join(' ')
warnReason.shift();``` is this right?
opal plank
#

no?

earnest phoenix
opal plank
#

warnReason isnt an array anymore

#

cuz you joined it

earnest phoenix
#

Do you not have google where you live

cinder patio
#

Because shift modifies the entire array - all elements' indexes are changed and that makes it slow

opal plank
#

hmmm i see

distant cobalt
opal plank
#

imma keep that in mind

#

learn js would be good

opal plank
#

also clicking the link i said or read what googleFeud just sent

distant cobalt
#

I think i clicked the link

rose warren
cinder patio
#

you have to read it

opal plank
#

there isnt a set ratelimit

#

though, give me one second

#

i have some guides

rose warren
#

Hmm

#

Ok

opal plank
#

this

distant cobalt
#
const warnUser = message.mentions.users.first()
const warnReason = args.join(' ')
warnReason.slice(warnUser.length).trim().split(/ +/);``` how about this?
opal plank
#

since its in the official api server, i assume its being updated and maintened

distant cobalt
opal plank
#

just read

opal plank
distant cobalt
#

ok

opal plank
#

THOUGH

#

nono

rose warren
#

If I send 1 message every 5 seconds I should be safe right?

opal plank
#

that would work, my bad

distant cobalt
#

so, how can i turn warnReason into an array

opal plank
#

the reason is

#

both me and feud were suggesting you remove the first element

#

but .slice() is also valid for a string

#

warn use is an object though

distant cobalt
#

Erm

opal plank
#

toString() would probably be doable, but not accurate all the time

#

so its better to manipulate it in the array

#

rather than in the string

cinder patio
#

Use the slice method on the args array, and then use join to turn it into a string

distant cobalt
#

ok

cinder patio
#

and if you want to remove the first element, give slice 1, not the length of the array

distant cobalt
#

Okay

#

like slice(1)?

#

or slice[1]

cinder patio
#

first one. slice is a function

distant cobalt
#

Oki

open flicker
#

How can I get the nickname#tag of the person who changed the name of the guild? guildUpdate
I hope I wrote what I want correctly

distant cobalt
#

It worked thanks @cinder patio @opal plank

fair axle
#

I have a problem about node.js

fair axle
#

I want to use variable in json object but I can't

open flicker
quartz kindle
#

{[time]:"123"}

fair axle
#

Thank you

earnest phoenix
#

Which database is good for a bot with dashboard?

lusty quest
#

any will work. i use currently MongoDB

opal plank
#

each database has its pros and cons

quartz kindle
#

i use sqlite

fair axle
#

Me too

opal plank
#

i use postgres/cassandra

earnest phoenix
mellow kelp
#

๐Ÿ‘๏ธ

fair axle
#

@quartz kindle

#

same problem

cinder patio
#

data[time]

quartz kindle
#

?

fair axle
#

thanks again

#

solved

quartz kindle
#

that should work lol

mellow kelp
#

um so

earnest phoenix
mellow kelp
cinder patio
#

ws

opal plank
#

socket.io at this point is almost a framework from what i recall

gusty quest
#
embed.thumbnail.url: Not a well formed URL.``` my code: ```.setThumbnail(`https://vacefron.nl/api/ejected?name=${message.author.username}&impostor=true&crewmate=red`)```
opal plank
#

it has some really handy shit already ready to pop out of the gate

mellow kelp
#

hmm guess i could learn more using ws

quartz kindle
earnest phoenix
#

Ok

opal plank
#

now here's an idea for those who code client mods out there

#

block by role

#

never again will you have to see whitenames randomly spewing nonsense mmulu

old cliff
#

Hmm

earnest phoenix
#

const Discord = require('discord.js');

const client = new Discord.Client();

const prefix = '/'

client.on('ready', () => {
console.log('bot is ready!')
});

client.login('token')

old cliff
#

38.7 secs ?

earnest phoenix
#

sup

earnest phoenix
opal plank
#

oh, aight

old latch
#

okay

opal plank
#

so, whats the issue?

old latch
#

what's wrong with that code then?

old cliff
#

Nothing