#development

1 messages ยท Page 429 of 1

buoyant oak
#

aye okay

inner jewel
#

you don't need to pay extra for mysql in any vps

quasi marsh
#

And you can just install mysql yourself anyway

neon schooner
#

^

inner jewel
#

all of them allow you to install mysql yourself

quasi marsh
#

If they allow you to pay it's not for the software but them handling the install and everything

inner jewel
#

aka starting a docker container

buoyant oak
#

okay I checked DigitalOcean, but I can't find the API for python tho

inner jewel
#

just look for sql

#

any sql library should work for mysql

floral stone
#

api? @buoyant oak

buoyant oak
#

damn this server stuff is so confusing

floral stone
#

you use packages to install stuff like mysql and python

buoyant oak
#

droplets?

floral stone
#

it gets easier

buoyant oak
#

yea

#

oaky

#

okay*

neon schooner
#

a droplet is their word for vps

buoyant oak
#

ahh

neon schooner
#

a single droplet in a digital ocean

#

Or something iirc they said

buoyant oak
#

ooo

#

damn

#

thats some communist thought

#

okay

#

thank you guys sooo much

neon schooner
#

No problem!

tulip coral
#

I wrote a command for my bot that uses the Steam API

#

Apparently the issue with it was actually a steam api issue

#

contacted them and they pretty much told me : not our problem

gentle parrot
#

lol

tulip coral
#

Ima be timing the 10 hours extra waiting time, gonna need to figure out a wait to make it so I don't need to Task.Delay for 10 hours

#

It's more like 1 hour but I can't see myself Task.Delay that long, the bot is gonna die if everyone uses my confirmation system

#

anything that makes the bot wait for 1 hour sounds like a pain

#

Gonna need to modify the full command

#

and work around the database

oak nova
#

Not to sound in a rush, but how long does approval usually take? (Mine was in since Thursday)

inner jewel
#

from 1h to 1 week

oak nova
#

oh,

#

eh, alright.

tulip coral
#

It all depends on how many bots are in the queue

#

and how many web mods are currently on it

sick cloud
#

Yeah, it just depends on when your bot was submitted, its position in the queue and how busy the moderators are ๐Ÿ‘€

earnest phoenix
#

hello all.. do you know const map = new Map();

"new Map();" mean? whats npm model?

trim plinth
#

it's a map

grizzled isle
#

Like key value pair

trim plinth
#

example: mapThing.set("thing", value)

earnest phoenix
#

so that the "Map" can work, do I have to input in package.json?
or new js?

trim plinth
#

no

#

it's already in js itself

#

no setup needed

earnest phoenix
#

ohhhh okkk, thankyou so much (:

trim plinth
#

np

earnest phoenix
#

but, Activity Log say "Map" is not defined.. :/

trim plinth
grizzled isle
#

@earnest phoenix if you are storing data and/or editing key/values then you should use Enmap.

trim plinth
#

@earnest phoenix show your code where you're using Maps Thonk

sick cloud
#

use codeblocks u.u

trim plinth
#

yes

earnest phoenix
#
        if (!serverQueue) return message.channel.send('There is nothing playing.');
        return message.channel.send(`
__**Song queue:**__
${serverQueue.songs.map(song => `**-** ${song.title}`).join('\n')}
**Now playing:** ${serverQueue.songs[0].title}
        `);```
#

const queue = new Map();

#

when i skip some song, after that not playing any music again

#

Activity Log said "undefined"

trim plinth
#

yeah that's because the queue probably ended

earnest phoenix
#

but there are 5 more songs.. red dot mark on const queue = new Map();

#

๐Ÿ˜‚

trim plinth
#

oof

#

hmm

sick cloud
#

Is there a way to check how many servers your in through a bot or an external API?

austere meadow
#

there isn't anything specifically crafted for that purpose, but the Discord OAuth2 screen (when an application is asking for access to see what guilds you are in) will show you all the guilds you're in
other than that not really

night imp
#

count them ๐Ÿค”

#

max is 100 so shouldn't be too hard

sick cloud
#

Too lazy really, and alright ๐Ÿ‘€

#

I could just login to my web dashboard and check

sick cloud
#

Are there any good guides on adding grids to your website? I'm using totally custom css, and unlike a framework it doesn't have a grid, so I'm a little stuck since I need grids ._.

mental solstice
#

Like a datagrid.. or like a 4x4 square to put text in

sick cloud
#

like a layout thing, on the left side a login form, on the right side a register form ยฏ_(ใƒ„)_/ยฏ

#

50/50

mental solstice
#

3 divs.. 1 outer width 100%.. display inline.. 2 inner with width 50%.. display inline-block

#

Been a while since i mess with css.. but something like that

sick cloud
#

Oo okay, thanks

mental solstice
#

Maybe float the first inner div left, and the second right (if necessary)

sick cloud
#

I'll have a mess around with it, thanks though blobsmilehappy

mental solstice
#

๐Ÿ‘ google is your friend too, probably not as thorough as my answer.. but it will do ๐Ÿ˜‰

upper zodiac
#

Anyone here know how to use weebly api so my bot will update a command if the website updated. I use discord bot maker. Also how to make it show 3 latest

sick cloud
#

@earnest phoenix try not to post offtopic comments in channels if they aren't related to the topic or an active question ๐Ÿ‘€

fluid basin
#

yikes DBM

#

Well never used it before, so I have no idea

abstract mango
#

dbm is mostly just javascript

#

so you could make a webhook thing compatible with weebly and a seperate api for your bot's command (that the bot command itself requests from)
i'm making it sound easy, but hey this is probably what you have to do

stray wasp
#

message.client.user.hasPermission("ADMINISTRATOR")

#

Anyone able to tell me how I can refence the bot instead of member

#

message.member.hasPermission("ADMINISTRATOR")

fluid basin
#

d.js? @stray wasp

quiet bobcat
#

Do you want to see if the bot has the admin perm?

stray wasp
#

sorry yes.

quiet bobcat
#

Yes it's d.js

stray wasp
#

discord.js

fluid basin
#

Oh okay

#

Its just simply message.guild.me.hasPermission("ADMINISTRATOR")

stray wasp
#

oh god

#

i'm stupid

#

sorry.

quiet bobcat
#

is that a thing?

fluid basin
#

For d.js yes

quiet bobcat
#

I didn't know about that

stray wasp
#

neither haha

fluid basin
#

Always good to refer to the docs

stray wasp
#

thank you willi.

fluid basin
#

Np :D

low rivet
stray wasp
#

Anyone know why Intellisense isn't working really, I'm not getting all the possible things to be able to do with a variable like client.

young fox
#

I don't know if this is a stupid question but can I buy my bot Nitro? I would love him to have an animated profile picture

stray wasp
#

nope.

young fox
#

Ah dangit

stray wasp
#

yeah

restive silo
#

@stray wasp because you are in new files and pass arguments but since you only use JS and not Typescript intellisense doesn't know what types are all of these variables

tame maple
#

dbl.postStats(client.guilds.size, 0, 0) gives errors

#

const DBL = require("dblapi.js");
const dbl = new DBL(mytoken)

#

everything is defined

stray wasp
#

@restive silo sorry I don't understand.

restive silo
#

okay so you are not in your main file anymore where your variables are defined

#

intellisense doesn't know what are the types of these varaibles

#

since you use plain Javascript

#

and not a transpiler like Typescript what includes typings

stray wasp
#

what can I do to fix this?

restive silo
#

use Typescript is the only real "Fix"

stray wasp
#

darn't js is broken damn

restive silo
#

no its not broken

stray wasp
#

alrighty well thank you.

restive silo
#

but it has no type definition in it

tame maple
#

are wbehooks working again?

slender thistle
#

Should be.

tame maple
#

im using glitch so how can i use the wbehooks

#

i am running the ping code on the 3000 port

#

and glitch only allows 1 port

tidal sparrow
#

Whats the thing on how to get emojis?

#

<โœ443164018924847116>

#

go it

earnest phoenix
#

anyone help me

slender thistle
#

with..?

native narwhal
#

Would be helpful (if not required) if you specified what you need help with in the message you express you need help in

earnest phoenix
#

how to create a webhook and if people mention me, bot it immediately tell

native narwhal
#

We won't give you code (In case that is what you wanted) besides you have not specified the language nor what you have already tried or anything else regarding the issue

tame maple
#

apparently the webhooks arent working

earnest phoenix
#

ok

native narwhal
#

Are they not?

earnest phoenix
#

is not working dude

delicate rover
#

cant say for the vote button, but the test vote button is working for me

native narwhal
#

๐Ÿค”

earnest phoenix
#

try mention me

#

then i will send ss

#

just mention me

#

@native narwhal

native narwhal
#

I'd rather you not ping me, thanks

earnest phoenix
#

ok

#

sorry

#

i m using it

#

in my code bot

#

but is not working

slender thistle
#

Did you just expose your token? Or what's that long-text thing? retardEyes

earnest phoenix
#

its webhook @slender thistle

native narwhal
#

It's the Discord webhook link thingy

slender thistle
#

Whoops, my bad. Sorry.

restive silo
#

thats still a token, you should maybe reset it

#

even if a webhook has no real permissions

earnest phoenix
#

yup

native narwhal
#

Was just about to say

restive silo
#

you should never expose any token

#

so i recommend resetting it

earnest phoenix
#

ok thanks

abstract mango
#

webhooks do have a few permissions, fyi

#

they can do at everyones

restive silo
#

oh they can?

#

interesting

#

yea

abstract mango
#

ye

native narwhal
#

Hmmm

restive silo
#

another reason to not expose token

abstract mango
#

that happened once in a server, person abused webhook to at everyone in a server lol

native narwhal
#

Oh wow

tame maple
#
app.get("/weebhuk", (req, res) => { 
console.log(req.body)
  if (req.body == undefined) { res.send(400, 'Not Recieved') } else {
  res.send(200, 'Webhook successfully received');
  }
})
#

using express

#

and when i put my url in the dbl webhook section it doesnt send a request

#

i tested it a couple of times

maiden geyser
#

try this

tame maple
#

i didnt see any difference

maiden geyser
#

app.get("/weebhuk", (req, res) => {
console.log(req.body)
if (req.body == "undefined") { res.send(400, 'Not Recieved') } else {
res.send(200, 'Webhook successfully received');
}
})

#

there try this one

tame maple
#

no lmfao

#

thats not a problem

#

it works with me posting curl requests

maiden geyser
#

oh

#

.

tame maple
#

also undefined doesnt have to be in ""

#

undefined , null etc

maiden geyser
maiden geyser
topaz fjord
#

It's should be app.post

#

@maiden geyser

gleaming summit
#

I need some help with Discord.JS

#

TypeError: message.channel.permissionsFor is not a function

#
message.channel.send(guilds)
    .then(condition => {
      client.guilds.forEach(guild => {
        client.users.get(guild.ownerID).send(nt.arguments.slice(0).join(' '))
        guilds = guild.name + '\n'
      })
      guilds = guilds + '\nSent notification to ' + client.guilds.size + ' guilds.'
      condition.edit(guilds)
    })
#

Why that error is appearing?

vital lark
#

It can be a Discord.js problem

gleaming summit
#

Um..

#

So no problem in my code?

mental solstice
#

your issue isnt in that code?

vital lark
#

Probs not

gleaming summit
#

That code makes error output

mental solstice
#

permissionsFor.. where are u calling that

gleaming summit
#

I didn't called that anywhere

#

I cannot find it

#

Um

#

I found but ppl didn't talk me this is prob

#
if (message.channel.permissionsFor(message.author).has('MANAGE_GUILD')) { permissions = 2 } else { permissions = 0 }
mental solstice
#

well its telling u that, that function doesnt exist

abstract mango
#

yeah

gleaming summit
#

Is there other way to get perssions of author?

abstract mango
#

.has isn't a method on the permissionsFor thing, unless that's vanilla JS

mental solstice
#

maybe that?

gleaming summit
#

Okey.. I'll see docs first

#

Hm

#

And permissionFor

mental solstice
gleaming summit
#

Deprecated

mental solstice
#

not the one above

gleaming summit
#

May I write if condition like message.author.hasPermission('MANAGE_GUILD')

#

?

mental solstice
#

might need message.member

gleaming summit
#

Wait a sec

#

I am gonna test

#

TypeError: Cannot read property 'hasPermission' of null

#

Oofs

#

๐Ÿค”

mental solstice
#

did u use author or member

gleaming summit
#

member

#
if (message.member.hasPermission('MANAGE_GUILD')) { permissions = 2 } else { permissions = 0 }
#

Author is not working

mental solstice
#

and its definitely message.. not msg? or something else

gleaming summit
#

It's message

#

Because

#

Um

mental solstice
#

is message.member.permissions.has('MANAGE_GUILD') a thing?

gleaming summit
#

I tried

#

But it returns err

#

TypeError: Cannot read property 'permissions' of null

#

wait a sec

#

I'll check the output of permissions

#

It returns bit

mental solstice
#

debug and see if u can find it in the collection

gleaming summit
#

I read the docs and found 'has' will search bitfield has permission

#

But I cannot solve yet

mental solstice
#

is it a role?

#

just reading.. that hasPermission is a role function.. not GuildMember

gleaming summit
#

I found

#
message.member.permissions.has('MANAGE_GUILD')
#

This returns me boolean

west raptor
#

in discord.js I get any error saying permissions are to low while the Bot has administrator

gleaming summit
mental solstice
#

Dream, check your hierarcy

gleaming summit
#

@mental solstice Thank you

mental solstice
#

if your bot role is below the role of whoever u may be trying to change.. you will get an error

#

np #$%##

gleaming summit
#

lel

mental solstice
#

:p

gleaming summit
#

hm

#

lel

#

IDK why it returns NULL

#

but

#

it is ok

mental solstice
#

property of null.. so its saying the member is null?

gleaming summit
#

I think it is creating a report about ALL objects

#

I'll try blobking bots first

#
if (message.member.permissions.has('MANAGE_GUILD')) { permissions = 2 } else { permissions = 0 }
    if (message.author.id === '324541397988409355') permissions = 4
    const prompt = prompts[message.content.split(' ')[0].slice(endpoints.prefix.length).toLowerCase()]
    const notAllowed =
      (message.author.bot)
      || (message.channel.type === 'dm')
      || (!message.content.startsWith(endpoints.prefix))
      || (!prompt)
      || (permissions < prompt.worker.permissions)
    if (notAllowed) { return }
    const nt = {
      arguments: message.content.split(' ').slice(1),
      i: _application.translations(prompt.language)
    }
    prompt.worker.execute(client, message, nt)
#

Oh

#

@mental solstice Why error is appearing was I didn't blobk bot first

#

But I got new problem if I add more if conditions

#

*optimization

west raptor
#
(node:3337) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Privilege is too low...
#

i still get this

#

ive tried everything

gilded blaze
#

Are you changing guild owner?

west raptor
#

no

#

a nickname

#

;-;

#

to put [AFK] in their username for the server

gilded blaze
#

Your bot has to have a role that is higher than the others role and it has admin/managenicknames

west raptor
#

oh

#

oof

#

let me see

#

nope

#

still

#

bot has the highest role in the server

gilded blaze
#

Who are you trying to nick?

west raptor
#

the user that does !afk

#

it replys aying it changed

gilded blaze
#

are u running !afk

west raptor
#

yes

gilded blaze
#

are u the server owner

west raptor
#

yea

gilded blaze
#

Well that is the issue

#

Server owners are always on the top

#

Can't change that

west raptor
#

damn

#

that sucks

gilded blaze
#

yes

mental solstice
#

@gleaming summit what new error?

gleaming summit
#

@mental solstice Completly solved

#

I didn't think that I didn't removed bot things

#

You were right

mental solstice
#

now if only i could get my wife to say that ๐Ÿค” ahah jk.. glad youre situated

gleaming summit
#

๐Ÿ˜‰

mental solstice
#

using VSCode is nice, because u can run debugger which allows u to watch variables, and step through code at breakpoints

gleaming summit
#

ah..

#

But too long time to go

#

I used Atom since my first code. :p

quasi hearth
#

im wondering how you can determine if content is nsfw or not, since i want to add a feature to my bot that could request data that is nsfw if the user decides to request that

inner jewel
#

check if the channel is nsfw

quasi hearth
#

i mean the content. since the feature can request both non-nsfw and nsfw content

inner jewel
#

add a nsfw argument

quasi hearth
#

i don't understand

floral stone
#

what language

quasi hearth
#

discord.js

floral stone
#

isn't there something like channel.nsfw?

waxen spoke
#

I think he's asking about user content, not a channel

quasi hearth
#

^

waxen spoke
#

short answer, no theres no way to tell

mental solstice
#

Keywords is about the only way

waxen spoke
#

unless you use image recognition and language filters

quasi hearth
#

ok

maiden geyser
#

how do i add commands to my bot?

restive silo
#

depends on your library/framework

maiden geyser
#

(python)

#

so... what do i do?

trim plinth
#

are you using async or rewrite

maiden geyser
#

rewrite

trim plinth
#

ok I'd suggest using the commands framework thing that comes with discord.py

#

aka using cogs

maiden geyser
trim plinth
#

kek

maiden geyser
#

what?

trim plinth
#

you can do either python -m pip install -U discord.py[voice] for voice support or just python -m pip install -U discord.py for no voice support in a command prompt/terminal

maiden geyser
trim plinth
#

that is downloading it ๐Ÿคฆ

maiden geyser
#

can u not give me the html

trim plinth
#

wdym

maiden geyser
#

how do i download it

trim plinth
#

I just told you, that is downloading it zoomeyes

maiden geyser
#

๐Ÿ™„

#

i dont get that

trim plinth
#

how do you not get that Thonk

maiden geyser
#

because i dont python -m pip install -U discord.py[voice]

trim plinth
maiden geyser
#

?

trim plinth
#

no why are you saying that in discord

native narwhal
#

I am confused

maiden geyser
#

where do i say it

#

python?

trim plinth
#

you run the command in a cmd prompt

native narwhal
#

In a command prompt

maiden geyser
#

ooohhhhhhh

#

thank you

trim plinth
#

I said that before GWnkeHYPEREYES

maiden geyser
#

'python' is not recognized as an internal or external command,
operable program or batch file.

trim plinth
native narwhal
#

Try py

#

Instead of python

maiden geyser
#

ok

#

no what

#

oh nvm

#

i installed it where do i find it

trim plinth
#

you dont

maiden geyser
#

?

trim plinth
#

now you just open up a python file and do import discord or from discord.ext import commands if you're using the commands extension for cogs

maiden geyser
#

ok thank you for your time and help

ruby dust
#

actually both

trim plinth
#

personally I only did one GWaobloChildPepeShrug

maiden geyser
#

k

trim plinth
#

didn't import discord and it went fine

#

anyways np

maiden geyser
#

i made my command on visual code but my bot is still offline

trim plinth
#

did you run the code

maiden geyser
#

how do i do that......

trim plinth
#

google it

vestal grail
#

depends on your library

trim plinth
maiden geyser
vestal grail
#

python <mainfile>.py

maiden geyser
#

?

vestal grail
#

the command to run the bot

mental solstice
#

Tgm.. use terminal in VSCode

vestal grail
#

I have never used vscode for python

#

I never use python on windows

#

and never use vscode on linux

mental solstice
#

How do u run python code in linux?

#

Command line in terminal?

maiden geyser
#

Tasks are only available on a workspace folder.

vestal grail
#

yeah just the command line

#

or f5 in horrible idle

mental solstice
#

Might be something in there to set up a workspace

vestal grail
#

not sure that you would host your bot through visual studio code

#

but hey, whatever you want

mental solstice
#

It has a built in terminal

#

Oh.. not sure that you would* nevermind :)

#

But its easier to test from the ide

earnest phoenix
#

so

quasi marsh
#

How much ram does Glitch give you?

earnest phoenix
#

ill check

quasi marsh
#

Because your guild cache is most certainly in RAM

earnest phoenix
quasi marsh
#

what's the ram usage of your bot currently?

earnest phoenix
#

uhh i dont know how to get that

quasi marsh
#

run an htop

earnest phoenix
#

?

quasi marsh
#

htop command

earnest phoenix
quasi marsh
#

lists processes

earnest phoenix
quasi marsh
#

Would it work if you took your bot offline and hosted it locally

#

I can't find anything on Glitch's ram

earnest phoenix
#

idk

#

ill check

quasi marsh
#

But I can't think it's 30GB/container

earnest phoenix
#

yeah i think thats for a few servers

#

put together

maiden geyser
#

i have my commands but my bot is still offline and dosnt work

mental solstice
#

Do you have python installed?

maiden geyser
#

yes

#

..

earnest phoenix
#

I'm trying to run it on my pc @quasi marsh

mental solstice
#

Open terminal.. navigate to project directory and use the python command to run it.. idk what the commands are.. never used python

maiden geyser
#

ok

#

gtg

earnest phoenix
#

but the same stuff isn't working

#

idk how i

#

must have not installed everything

quasi marsh
#

I guess

earnest phoenix
#

ah also what's the current node version

quasi marsh
#

10?

earnest phoenix
#

i'm on 6.11.4

quasi marsh
earnest phoenix
#

rip let me get that

#

then run

#

how am i on 6

shy verge
#

does node have 64bit ints yet

earnest phoenix
#

No

#

u mean BigInt

inner jewel
#

64 bit != bigint

quasi marsh
#

Neither does python it just converts to long implicitly

shy verge
#

then what is a bigint

earnest phoenix
#

well i have prepared : String(guild.id)

shy verge
inner jewel
#

arbitrary precision numbers behave fairly differently from 64bit

earnest phoenix
#

uhh ok

inner jewel
#

eg a large enough computation will freeze everything

#

while for 64bit it'd at most overflow

#

try 99999999999 pow 9999999999 with bigint

earnest phoenix
#

nah im good

#

im just installing node v8

#

from v6

#

bcz i used to use an online host

#

now testing on pc

trim plinth
#

I'd suggest v10 but that's your choice GWaobloChildPepeShrug

earnest phoenix
#

i rarely use node on my pc

trim plinth
earnest phoenix
#

Oof node requesting access through shitty windows defender

#

uhh i just downloaded my bot file in min

quasi marsh
#

Also, well @earnest phoenix sharding is pretty much for receiving events

fervent oyster
#

@trim plinth oof well the latest version I have access to is v8

quasi marsh
#

Sending a message is done with the HTTP api and doesn't require sharding

trim plinth
#

oof

earnest phoenix
#

oh

#

so what's the problem

fervent oyster
#

@trim plinth apt-get isn't always 100% up to date

trim plinth
#

The last time I used apt-get it gave me node v4 GWyogurtKek

inner jewel
#

the rest api isn't even aware of what a shard is

quasi marsh
#

I wouldn't know what the problem is, but it's not sharding related I can tell you that

earnest phoenix
#

oof

fervent oyster
#

They are up to v8, but the node command doesn't like to do anything with apt-get

earnest phoenix
#

i hav no idea what to do

#

like it works fine

#

in old server

#

s

fervent oyster
#

So I had to manually install node

earnest phoenix
#

but when u add it to a new server

#

it goes unknown channel on message.channel

fervent oyster
#

What library are you using?

earnest phoenix
#

d.js

#

i asked on their help server but it's useless

fervent oyster
#

Then I have no idea, I use d.io

earnest phoenix
#

lul

fervent oyster
#

And sometimes jda

earnest phoenix
#

also on glitch @quasi marsh , while sharding: ```js

(node:5758) UnhandledPromiseRejectionWarning: Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.

topaz fjord
#

i install directly from repo

quasi marsh
#

Wait

topaz fjord
#

for node

quasi marsh
#

You are sharding?

earnest phoenix
#

i tried

#

in glitch

quasi marsh
#

Don't shard

earnest phoenix
#

with a testing bot

#

in 1 server

quasi marsh
#

Yeah as I said, Glitch isn't meant for things like this

earnest phoenix
#

yeah

fervent oyster
#

I use pm2's clustering

earnest phoenix
#

oh well

restive silo
#

n-no

waxen spoke
#

clustering != sharding

#

lol

fervent oyster
#

I know, it just splits the load onto my cores

#

It helps with performance

#

For me at least

spring ember
#

Guru don't shard one server

earnest phoenix
#

lul dw

#

can i cluster then?

restive silo
#

w-why would you cluster

fervent oyster
#

I would but take my advice with a grain of salt cuz Idk what the difference is between clustering and sharding

inner jewel
#

clustering is eg splitting work into multiple worker processes

#

sharding is a discord thing

fervent oyster
#

Ahh

#

Ok

waxen spoke
#

I'm not 100, but I'm pretty sure using pm2 clustering won't actually cluster the way you want

fervent oyster
#

Hmmmm

waxen spoke
#

are you running a bot that is clustered like that right now?

fervent oyster
#

Yes

waxen spoke
#

use htop to check the cores

fervent oyster
#

Mkay

#

Ssh to the rescue

#

They are all about level at 8%

#

@waxen spoke yeah, they are all pretty much level

maiden geyser
#

my bot is offine?

#

why?

quasi marsh
#

Because you're not running it?

maiden geyser
#

but I pressed run

#

what do I need to do?

quasi marsh
#

Have you checked that the run button actually starts the script?

maiden geyser
#

um. how do I check that

#

.

#

.

#

.

#

.

#

.

#

.

#

.

#

.

#

.

#

.

#

.

#

.

#

.

#

oops

quasi marsh
#

don't

quiet bobcat
#

stop

quasi marsh
#

do that

quiet bobcat
#

please

maiden geyser
#

i mcfallen

#

so how do i do it

quasi marsh
#

Differs from IDE

#

What do you use

maiden geyser
quasi marsh
#

Open the terminal

maiden geyser
#

what terminile??

quasi marsh
#

Should be a button in the view tab

maiden geyser
#

integrated terminal?

quasi marsh
#

Yes

maiden geyser
#

k

covert roost
#

Hey, not sure if i should as this here but...

Anybody wanna collab on a bot? Ive been wanting to do it but cant find anybody :p i dont care how experinced you are

I use visual studio and programm with python

maiden geyser
#

i will

#

and i use the same things

#

dm me the details

covert roost
#

Ya yeet sweet

#

@maiden geyser thonk u

delicate zephyr
#

@broken crypt

#

What lang and lib?

native narwhal
#

discord.js he said in shitpost ๐Ÿ˜‚

delicate zephyr
#

bot.guilds.size

broken crypt
#

thanks

violet wyvern
#

Hi, I need help

#

How do you use the Discord Bot Api?

spring ember
#

Well what language

floral stone
#

What's the limit for adding reactiions>?

mental solstice
#

discord allows 4 per second.. i know c# lib throttles it to 1 per second

shy verge
mental solstice
#

yeah, the response headers take 1 second? something like that, and d.net enforces that.. "preemptive rate limit"

inner jewel
#

response headers are in seconds

shy verge
#

I think you're talking about D#+

#

That lib hardcodes their ratelimit

#

D.Net caches requests and dynamically throttles them

#

afaik

mental solstice
#

Nope, ive went rounds with these guys been in the discord api d.net for a long time..

shy verge
#

hmmm

mental solstice
#

My bot was adding 3 reactions to a message and it always triggered the preemptive

#

They have made a push request for opting out of the premptive ratelimit

#

Anywho @floral stone if you use the discord endpoint for adding reactions, you can send 4 per second

earnest phoenix
#

hello.. anyone know string code for deny everyone connect voice?

#

example : deny:0x400 is can't view channel

floral stone
#

@mental solstice not me, the bot

mental solstice
#

yes.. the bot too

earnest phoenix
#

it just errors in console

sick cloud
#

I don't think you need the if or return, but thats weird anyways ๐Ÿ‘€

topaz fjord
#

why are you doing if in a catch

#

catch, only triggers when an error happens

earnest phoenix
#

I decided to do it because I thought it was like .catch() and I thought thats why It wasn't triggering

#

but

#

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

#

But still that doesn't make much difference.. it still doesnt work..

ruby dust
#

in discord.py, how do I check if a user has a specific role in a different server?

earnest phoenix
#

First off, you would get that guild

mental solstice
#

Does your bot have permission to react LoseJoe

earnest phoenix
#

here idk discord.py im pretty sure its like d.js so

#

ye it does

#

it just gives me the purpose error i put into my command

#

to test it

#

in logs

patent reef
#

discord.utils.get() iirc

earnest phoenix
#

wot @patent reef

patent reef
#

I mean you have to get the server first

sick cloud
#

Um, any reason why this is erroring on run?

        let startTime = new Date().getTime()

        const canvas = Canvas.createCanvas(700, 300);
        const ctx = canvas.getContext('2d');

        const bg = await Canvas.loadImage('./background.jpg');
        ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);

        const attachment = new Discord.Attachment(canvas.toBuffer(), 'image.png');
        msg.channel.send(`Generated image in \`${~~(startTime - msg.createdTimestamp)}ms\`!`, attachment);
hot sleet
#

@sick cloud maybe you have to recheck inputs

sick cloud
#

recheck what inputs?

hot sleet
#

yeah

sick cloud
hot sleet
#

as i read the error is in inputs steam error while reading from inputs

#

oh

#

okay

#

GG

sick cloud
#

๐Ÿ‘Œ

hot sleet
#

that will be better if you use test bot

sick cloud
#

huh?

solid cliff
#

Why does my lavalink just randomly stop playing or won't play anything until restart

covert roost
#

So i program in python client.event
I've been trying to figure out how to program the command where you do ?info @someuser
and then it says:
status
id
highestroll
joined discord at
joined guild at

Can anybody help me with this program?

earnest phoenix
#

uhh

#
data.shift().splice(-1,1)``` doesnt work?
#

(trying to remove an element from the front And back of the array

uncut slate
#

.shift() returns the first element

#

is data an array of arrays?

earnest phoenix
#

nope

#

I thought it removed the first element

#

im so dumb smh

uncut slate
#

it does, it removes the first element but it returns it

#

you could do data = data.slice(1, -1)

earnest phoenix
#

so

#
data.slice(1, -1).splice(-1, 1)```?
#

whats the difference between slice and splice wth

uncut slate
#

no literally what I sent you

#

data = data.slice(1, -1)

#

.splice modifies the original array, .slice returns a modified version, and the args are different

covert roost
#

can anybody help me

#

?

tulip snow
#

How do you install canvas?

#

I tryed but everytime it gives errors

sick cloud
earnest phoenix
#

Tony, What if its hosted and you don't know the platform?

trim plinth
#

why would you not know what platform your host is on

#

besides if you're using a free host like glitch or heroku

#

(glitch uses ubuntu afaik)

floral stone
#

I figured out a way to make graphic in python using html/css

sick cloud
#

@earnest phoenix well it says all requirements for all platforms on the link q.q

covert roost
#

I guess nvm... my question just keeps being pushed away

sick cloud
#

@covert roost Isn't there a discord.py Discord server or something? You could ask there.

covert roost
#

Hmm. Dm me mea link please

trim plinth
#

couldn't you also ask in the discord.py channel in dapi

solid cliff
#

@covert roost use commands from discord.ext

tulip snow
#

@sick cloud How did u fix the error while reading from input stream thing?

upper zodiac
#

How to remove my bot token from github and re-apply

sick cloud
#

@tulip snow I ended up fixing the file path. it was .jpg not .png

#

@upper zodiac Uh.. edit whatever file the token is in on GitHub, then resubmit your bot.

upper zodiac
#

My bot token at github cause there's something wrong when i hosting it but now it's okay but forgot to delete the bot token from github

sick cloud
#

Well thats easy to fix, as I just said. eyesLeft

tulip snow
#

What host are you using?

upper zodiac
#

@sick cloud urm at the application page?

sick cloud
#

@upper zodiac? Go to GitHub, remove the token (from whichever file your token is in), then go back to discordbots.org/newbot and resubmit your bot.

upper zodiac
#

Can i just delete all these

sick cloud
#

๐Ÿ‘€

upper zodiac
#

How to delete all these ^

sick cloud
#

I guess so, er..

#

Repository > Settings > Danger Zone > Delete > Yes/Confirm

upper zodiac
#

Hmm where to find repository page

#

Ouh nvm

sick cloud
#

iirc

upper zodiac
#

Ouh okay thanks

sick cloud
#

๐Ÿ‘Œ

upper zodiac
#

Thanks for your help

#

Done

#

Wutt i need to type back all the thingssssss

#

Y tho

hot sleet
#

@sick cloud

upper zodiac
#

Ouh luckily i can copy paste from my web

hot sleet
#

can you give me youe Canvas code

sick cloud
#

@hot sleet No.. learn yourself .-.

hot sleet
#

PLEAAAAAAAASE

sick cloud
hot sleet
#

๐Ÿ’‹

#

WHy

#

okay

#

give me ant platform or video to learn it

sick cloud
#

Because its better for you to learn. Google node-canvas tutorials or something.

hot sleet
#

any*

#

kk

#

thanks for search key

sick cloud
#

No problem ๐Ÿ‘Œ

upper zodiac
#

Is it okay for just deleting it but not resetting the token bcs my pc not with me, i can't edit the token in bot app

#

No one take my token โœŒ

sick cloud
#

As long as your token isn't public anymore it'll be fine.

shy verge
#

.gitignore

native narwhal
#

Once public always public, you can't trust that no one has the token after it being public ๐Ÿ‘€

shy verge
#

you can use bfg tho

#

and reset token

native narwhal
#

Apparently they can't reset it or something ๐Ÿ‘€

upper zodiac
#

Nope, i have no github visit.

sick cloud
#

I know how to use awaitMessages, but is there a way to do it multiple times? I'd like to collect multiple arguments, aka a setup wizard:

me: !setup
bot: hi! enter a prefix:
me: !
bot (edits original message): awesome, what do you want me to call you?
me: steve
bot (again, edit): okay steve, thats all!

Something like that at least, I'd be awaiting messages 4 or 5 times, and putting awaitMessages inside awaitMessages inside.. la la la, its pretty spaghetti codeish ๐Ÿ‘Œ
Is there a cleaner way to do it (using discord.js)?

small mango
#

custom function

#

Make yourself a prompt function

night imp
#

use a collector and respond to each

#

Await is just for a single while collectors are ready to mingle

sick cloud
#

๐Ÿ‘Œ

#

I'll look into it, thanks.

ruby dust
#

in discord.py, what is a way to check to who the bot application belongs to?

spring ember
#

Umm just save a variable

#

You cannot access application info I think

ruby dust
#

I'm pretty sure it's possible, at least by bot's token

#

cause I know rhyno's music bot has that

spring ember
#

Umm

#

Isn't it in the docs?

#

Otherwise I really recommend asking in the d.py server

ruby dust
#

I'm trying to avoid asking there, thanks

spring ember
#

Oh ok

#

Lemme take a look at the docs

#

Rewrite or async?

ruby dust
#

rewrite

slender thistle
#

Make your bot through a programming language. Which one to choose is up to you.

austere meadow
#

this is gonna be complicated but
does anyone know how to turn an array of objects into a single object that has keys that are indexed in ascending order, where the value is the original object in the array?
so say i have

[ 
{ yes: true, no: false }, 
{ yes: false, no: true, blue: "who" }
]

and i want that to be converted to

{ 
    1: {
        yes: true,
        no: false
    },
    2: {
        yes: false,
        no: true,
        blue: "who"
    }        
}
fluid basin
#

OwO

#

Oh wait im blind

native narwhal
#

๐Ÿคฆ

fluid basin
#

And yes lets see

#

@austere meadow nodejs?

austere meadow
#

yeah

fluid basin
#

Aight

#

Well

native narwhal
#

You want the array to become a map essentially?

austere meadow
#

oh true

#

could convert the array to a map then back to an object

old glade
#

Heyo. Can someone explain to me what is sharding and how it works ?

fluid basin
#
let arr = [] //add your array
let obj = {};
arr.forEach(o => {
  obj[arr.indexOf(o)] = o;
});
#

Not too optimised but should work @austere meadow

native narwhal
#

Instead of using arr.indexOf(o) just declare an index value outside of the array and increment that

austere meadow
#

thats fine, ill give it a go, cheers for the help blobsmilehappy

fluid basin
#

Yeah true

#

Was thinking of that

austere meadow
#

and yeah ill do that

fluid basin
#

Aight

native narwhal
#

Way way way way way better than using indexOf

austere meadow
#

forEach has an index counter anyways so its good

native narwhal
#

Yeah

fluid basin
#
let arr = [] //add your array
let obj = {};
for (let i=1; i<=arr.length; i++) {
  obj[i] = arr[i-1];
}
#

Not too sure if this works

#

@native narwhal @austere meadow

austere meadow
native narwhal
#

It would need to start at 0 otherwise it would skip the last index

#

I mean it should be a number

austere meadow
#

it should be

native narwhal
#

Maybe keys can't be numbers?

austere meadow
#

hmm

native narwhal
#

Why do you need it to be a number?

austere meadow
#

oh you're right i think

#

i have one for badge and weapon, as well as background

#

thats why i need a separate object for them

#

however i could probably split them up like exports.Backgrounds = { GWchadThinkeyes

#

wait

#

im really confused
if keys can't have numbers why can i assign a number to a key here

#

and it's still working

spring ember
#

use for of and not for each or yukine will be angery

#

why do you need to convert it anyway?

native narwhal
#

The only question I have is why if you are just going to use numbers as the keys do you use a map/object containing all of them when you can just use an array?

austere meadow
#

you make a valid point

#

@spring ember because i want an easy and dynamic way to convert my badges (which are stored in an array) to this format

native narwhal
#

๐Ÿ˜‚

#

I would get it if the key was the id

austere meadow
#

i think i was just having an object overload on the day i made this

native narwhal
#

But in this case it doesn't seem to be

spring ember
#

but the key is number

#

ew no

austere meadow
#

well ok long story short i was really tired and i wanted to get it over and done with
ideally the numbers should be the id of the item, but they aren't

#

and it doesn't really matter too much

spring ember
#

also number is a bad idea

native narwhal
#

Hmmm

austere meadow
#

so i'll either convert it to an array or an object with the right key

spring ember
#

I remember putting my id as a number then printing it and it came out differently

austere meadow
#

i dont know which would be better but im leaning towards objects

spring ember
#

umm depends what do u need to do

austere meadow
#

objects would make it easier for me to access in the long run

#

so i don't need to iterate over the entire array to find an item

#

because the idea behind it is that all items in my bot are stored here, and if i wanted to easily look up an item for some reason, i can do it here

native narwhal
#

If you are going to get the items by their id often than go with a map/object

austere meadow
#

is a map more efficient than an object

#

i find that using maps is annoying

native narwhal
#

A map and an object works the same way in JavaScript but I have no idea how they differ internally

austere meadow
#

alright then

native narwhal
#

I think they work the same way at least

austere meadow
#

yeah i dont think it'd make a huge difference anyways

fluid basin
#

Yes keys must be strings

spring ember
#

object is a map

native narwhal
#

An object is a dictionary not map :P

spring ember
#

yeaaah

#

ok

wintry arch
#

Anyone who have some 15mins and who can create a bot for me with just 1 feature auto responder?

spring ember
#

not development related

wintry arch
#

๐Ÿ˜Ÿ

spring ember
#

there are many bots with autoresponder

native narwhal
spring ember
#

it's not a beginner

#

it's someone asking for someone to make a bot for but I edited it anyway

wintry arch
#

I don't know a single coding

spring ember
#

use dyno or mee6

#

these bots offer what you want

wintry arch
#

๐Ÿ™ yea I know but they have other features too and i want just 1 feature any way I read somewhere that they( this server) creates , makes , develops bots but came to know that u only make bots for something u can get means u need something to make a free bot.

earnest phoenix
#

oof

#

this server is a place devolopers can add their bots..

#

kinda like advertising their bots but ye

covert roost
#

Primezord, try looking up a video or somthing i watched videos to help create my bot..

The programming is pretty simple if you understand how to code

One thing my friend told me was "codeing is not about memorizing its about understanding and not to just dive into bot proggamming but to understand how to use that language of code first"

Which were a problem for me...
I code with python in visual studios
And i kinda memorizad how to put in text to randomize and normal text

My commands are more if this then that :
elif
await

Its kinda simple but i dont know abkut autorelsponse bots... but i think you should try it yourself!

wintry arch
#
var mystring2 = "JavaScript discord ppl.";
document.write(mystring1 + mystring2);```
#

Damm got confused I should have gone to HTML first

#

Instead of Js

trim plinth
#

you should use let and const instead of var

heavy rock
#

Can someone rate this? And give feedback

void mantle
#

@austere meadow How long does it take get my bot certified? I've been waiting for 2/3 weeks now ๐Ÿ˜ฐ

austere meadow
#

read #announcements, Oliy will continue certification apps on the 22nd of june

potent quarry
#

Blake?

void mantle
#

๐Ÿ‘

potent quarry
#

Do u know whats the beat way to get an bot online?

#

Mines is crashing when i got him online

austere meadow
#

what does the error say

potent quarry
#

None

#

Its juat crashing

austere meadow
#

show me the console

potent quarry
#

I am doing with discord api

#

Console?

#

Wich

austere meadow
#

do you have any idea what you're doing

potent quarry
#

Noop

#

๐Ÿ˜‚

austere meadow
potent quarry
#

Not at all

#

Ok thx

austere meadow
potent quarry
#

Ok

void mantle
#

this one is gud

potent quarry
#

K

ruby dust
#

is if role in member.roles: a good way to check if a member has a specific role in the server?

abstract crystal
#

yes

ruby dust
#

thanks

shrewd hedge
austere meadow
#

Math.floor() or Math.round()

#

if you want specific decimals still, you can use .toFixed([number of decimals]);

shrewd hedge
#

Oh thanks

#

Hey who changed my nick

#

I'm not a hoister, it's my username lol

trim plinth
#

you can ask them to change it to something else

shrewd hedge
#

Ok thanks

ruby dust
#

how do you use on_member_update exactly? I don't understand the before and after parameters

uncut slate
#

before is the member before the update happened

#

after is the member after the update happened

ruby dust
#

I understand that, but I don't udnerstand how I can use it

#

lets say I wanna do something when a specific role was assigned, how would I do that?

shy verge
#

i assume the before and after are just simple member objects

#

unless roles are weird and dumb with your lib (I assume py) you can just get roles from those member objects

ruby dust
#

that doesn't explain much

floral stone
#

before.avatar_url returns the avatar of a user before while

#

after.avatar_url returns the new avatar after updating it

#

before and after are member objects

shy verge
#

you're trying to do something with role data, right?

#

just get roles from member object

floral stone
ruby dust
#

I know that already, but how would I do that in action? like an example code would be helpful

floral stone
#

and that'll return the name and roles before they changed

#

they are member objects, the before and after parameters. That's what you asked, what are those

ruby dust
#

I probably worded incorrectly, I'm just tired today

floral stone
#

What do you want to know exactly?

ruby dust
#

how would the code look like in action, pretty much

floral stone
#

I don't have a sample

shy verge
#
@bot_event
async def on_member_update(before: Member, after: Member):
    if before.roles.has(something): await doStuff()

idk anything about py so go ahead and translate this into real python

floral stone
#

you don't need to do :Member for the params

shy verge
#

i have type ocd

#

and I really like intellisense so

#

dynamic calls disgust me

floral stone
#

whatever

turbid gale
#
async def on_member_update(before, after):
    if before.roles != after.roles:
        await channel.send("Roles have updated for {}".format(after))```
#

that's a simple example

#

you'd have to define the channel though

slender thistle
#

Deive is not that newbie in Discord.py. Let's hope he realises that. KappaBond

old glade
#

guys

#

Can someone explain to me what sharding is and how it works ?

inner jewel
#

you split your connections to discord

old glade
#

how do I do that ?

#

with several tokens ?

trim plinth
#

no

#

it depends on your lib

old glade
#

.py

#

didn't found anything about sharding in the doc

#

maybe it's not supported by the lib

quasi marsh
#

Are you on async?

old glade
#

yup yup

quasi marsh
#

If so I recommend refactoring to rewrite

old glade
#

tell me why good sir

#

i'm all ears

quasi marsh
#

And instead of discord.Client() you can use AutoShardedClient

#

Or AutoShardedBot for cmd extension

old glade
#

discord.autoshardedclient() ?

#

never heard of this

quasi marsh
#

Go to the docs and replace latest with rewrite

#

Tho, you'll need to refactor a lot

#

Since the syntax is different

#

But it's a lot better

shy verge
#

also old py is old, I wouldnt be surprised if half of it was deprecated

old glade
#

I see

#

so the rewrite lib is newer ?

shy verge
#

Yes

#

And objectively better

old glade
#

I see

#

never thought the standard lib was "old"

floral leaf
#

Does anyone have their bots using a queuing system for message sending?

quasi marsh
#

Well not implicitly, discord py will keep track of ratelimits

floral leaf
#

Its great so when you reach a limit it'll just wait till the limits over to send the next message

quasi marsh
#

Explicitly

floral leaf
#

Ah

quasi marsh
#

No it'll stop just before the limit

floral leaf
#

I use a custom fresh library for mine

quasi marsh
#

You don't want to hit the limit

floral leaf
#

I mean for mine

#

yah ik

#

I meant for the time

#

Like sending too fast

#

It has a throttle but I guess I only did that because I dont use a library thats pre-built

#

lol

quasi marsh
#

Check the headers for the ratelimit

#

They are dynamic

floral leaf
#

I already do that I was just asking

quasi marsh
#

Keep in mind that parameters are counted

floral leaf
#

If anyone else is using a queue system

quasi marsh
#

So posting in channel x does not affect posting in channel y

floral leaf
#

right

quasi marsh
#

Discord py will wait when the limit is about to be reached

#

Quite nice

floral leaf
#

I meant it for discussion btw.. I actually already do all that ^^

#

brb going out for lunch ๐Ÿ˜ƒ

quasi marsh
#

Enjoy

earnest phoenix
#

Im trying to redirect the user as soon as they added the bot

abstract mango
quasi marsh
#

Have you added the uri in your bot application

abstract mango
#

that as well ^

earnest phoenix
#

what do you mean with bot application?

mental solstice
#

Does your website required specific headers?

earnest phoenix
#

it doesn't

#

I could send it but I don't want to risk getting punished for ads

mental solstice
#

Well you already did sort of... ban this man!

#

Nah jk. Someone had a similar issue a day or 2 ago

#

I wonder if its the same thing

topaz fjord
maiden geyser
#

yes i did

#

jk

earnest phoenix
#

No I didn't

low garden
#

ok, a little info... I re-apply tomorrow. My bot goes offline for problems, tons of bugs and fixing, so i decided to put it online with the [DEV] bot.

shy verge
#

ok?