#development

1 messages · Page 1382 of 1

opal plank
#

too much effort for someone who's basically already drunk

stark abyss
#

~~aren't you always drunk ~~

opal plank
#

maybe

slender thistle
#

Erwin: "I'm poor"
Also Erwin: says "I'm drunk" almost every time he's in chat

opal plank
#

EY the booze is given to my by my neighbors and friends

#

bold of you to assume i have money to buy booze

#

barely got any for food

slender thistle
#

Well I'm not sure how I didn't think of that

stark abyss
slender thistle
#

I thought you kept spamming money at beer cans

opal plank
#

would if i could

stark abyss
opal plank
#

the day i have money to buy booze everyday my coding productivity will skyrocket

#

ya'll shall address me as bill gates 2

stark abyss
#

That's little too rich

opal plank
#

never hurts to dream high

#

anyway, talking about food made me hungry

#

cya

stark abyss
#

bye

quartz kindle
#

@opal plank btw, you could just make it this no?```ts
let channel:Discord.TextChannel = await client.channels.fetch(args[5]).catch(x => null), linkContent:Discord.Message;
if(channel) linkContent = await channel.messages.fetch(args[6]).catch(x => null);
console.log(linkContent)

opal plank
#

shhhhhhhh

#

dont judge my code

quartz kindle
#

xD

opal plank
#

its perfect as is

#

everybody knows you get paid more for the more lines you put

quartz kindle
#

i know, i gave it a perfect 5/7

opal plank
#

more = more money

#

perfect 5/7

#

indeed

#

couldnt be better

stark abyss
#

lol why is there :

opal plank
#

dev challenge, make my code better

quartz kindle
#

because typescript

stark abyss
#

oh

opal plank
stark abyss
#

that's strange

opal plank
stark abyss
#

but typescript is javascript is it not?

opal plank
#

typescript screeches at you for doing that shit

solemn latch
#

Its better javascript

opal plank
#

js be like: nah, i'll run it

stark abyss
#

lol

opal plank
stark abyss
#

don't insult my language HinaPensive

opal plank
#

your language sucks natively

#

sorry

solemn latch
#

Should be using scratch

opal plank
stark abyss
quartz kindle
#

js forces you to be pessimist

#

you have to think of all possible ways your code could fail

#

and prevent them all

#

ts makes you an optimist, you dont check anything because ts will check for you

stark abyss
#

tim backing me up pepeHappy

solemn latch
#

Yes, pessimism best way to view life

stark abyss
#

Oh btw thank you for that code Erwin I finally figured it out after so long nani

opal plank
#

no problemo

#

js forces you to use jest or some other of testing tool to get the bugs coming so you can patch them.
ts checkes MOST(ts isnt perfect, a lot of stuff will fly by) of the stuff before it even compiles, so you'll spend much less time actually debugging code

solemn latch
#

Luckily, errors are fun. Doing things properly isnt

opal plank
#

that affects your user experience

pale vessel
#

masochist

opal plank
#

its much better to do stuff from the get go rather than have users flood your ticket systems or bug trackers with bugs

solemn latch
#

And thats why I'm struggling to get past 50 guilds with my bot

#

If I put a quarter of my time i spend in this server on my bot my bot would be amazing.

opal plank
#

if i were drunk 50% more of my day my productivity would triple

#

lets hope shiv doesnt see that, he'd bonk me

stark abyss
#

Lol I have a bot that has like 250 guilds but i m pretty sure 50% of them are fake lol

opal plank
#

for(let a of guilds.cache) if(guild.memberCount < 5) guild.leave() mmulu

stark abyss
#

oh

quartz kindle
#

im pretty sure half of my guilds dont even know what the bot does or why they have it

stark abyss
#

^

opal plank
#

mine is the other way around, im strict about which guilds have my bot

stark abyss
#

Activity is mostly dead

slim umbra
#

im pretty sure half of my guilds dont even know what the bot does or why they have it
@quartz kindle lmao

opal plank
#

imagine having a auto leave system based on activity mmulu

slim umbra
#

my bot is mainly people who kno how to use it

#

but then there are people who ask

stark abyss
#

Why would you wanna limit your bot's guild though is it because it's not verified?

slim umbra
#

well

#

people may want to only have better guilds using it

stark abyss
#

oh

solemn latch
#

Would result in me having 0 guilds erwin

opal plank
#

cuz im not interested in fake growth, why would i care about how many guilds my bot is in if half of them are dead servers or bot hells?

solemn latch
#

Inb4 my bot leaves my support server

stark abyss
#

True but wouldn't it help grow ?

high berry
#

when im creating a table of contents for the long description, the links dont direct to the headers properly on top.gg but do on any other markdown viewer

opal plank
#

im one of the few people who follow what discord said. its not about that badge, its also not about the numbers

#

my main advertising is on twitch

#

i couldnt care less if discord gets bigger or not

stark abyss
opal plank
#

¯_(ツ)_/¯

quartz kindle
#

@high berry top.gg markdown sucks

opal plank
#

tis about the journey and quality of the bot.
quality > quantity

quartz kindle
#

they add target="_blank" to all your markdown urls

high berry
#

oh

#

is there any way to fix it?

quartz kindle
#

manually rewrite them as html instead of md

high berry
#

damn ok

quartz kindle
#

icba doing it lol, so all my links are broken in top.gg

high berry
#

i dont know much html

#

how would i format it?

fair rover
#

@stark abyss why did you ping me

stark abyss
#

Sorry where?

fair rover
#

Idk I just got a noti with your name

stark abyss
#

Are you sure?

fair rover
#

It might not of been you

stark abyss
#

I don't have a memory of pinging you

fair rover
#

My names user tho so

#

Some one could’ve accidentally pinged me

stark abyss
#

Possible

#

that's the last ping, wasn't me

fair rover
#

Oh well that makes sense

#

Thanks for finding it

earnest phoenix
#

this doesn't work?

@client.command()
async def age(ctx, idnumber):
    idnumber= int(idnumber)
    person = client.get_user(idnumber)
    await ctx.send(person.created_at)

It says:

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'created_at'
runic flare
#

?

pale vessel
#

person is None

earnest phoenix
#

how is it None?

#

it fetches a user

pale vessel
#

pretty sure that gets the user from the cache

earnest phoenix
#

kk

pale vessel
#

you should use fetch_user() instead

#

it's a coroutine

earnest phoenix
#

roles in line 81 is undefined

dusky sundial
#

Howcome whenever I try to run my bot on the VPS I bought it gives me

AttributeError: module 'discord.ext.commands' has no attribute 'Cog'
#

And yes, I do have the latest version of discord.py, or atleast that's what it tells me when I try to upgrade it

dusky sundial
#

Nevermind, apparently it had an old ass version of python pre-installed and I didn't bother to check it

fierce ether
#

any js developers want to help with a bot, paid.

sturdy gazelle
#

im interested

blissful coral
#

Take this elsewhere

sturdy gazelle
#

so i know there is api abuse for changing ur bots status too often and i have a restart command which changes the status to restarting, pls wait and then on ready, it always changes to thinking about connect-4 and then on fully completed init it goes to playing connect-4. in all this takes about 3 seconds, but sometimes when connection is slow or computer is bogged down can take a lot longer. and ofc, only i can do this command and my question is: is this considered api abuse?

prisma oriole
#

I wouldn't consider it API abuse since you are only changing the status 3 times, all of which happen in a relatively short time and not just a continuous 'spammy & abusive' manner.

sturdy gazelle
#

pog

blissful coral
#

before you ask

#

kid from support

#
const embed = new Discord.MessageEmbed()
.setTitle(`This is a title`)
message.channel.send(embed)
west crow
#

let channel:Discord.TextChannel = await client.channels.fetch(args[5]).catch(x => null), linkContent:Discord.Message; if(channel) linkContent = await channel.messages.fetch(args[6]).catch(x => null); console.log(linkContent)

#

let channel:Discord.TextChannel = await client.channels.fetch(args[5]).catch(x => null), linkContent:Discord.Message;
if(channel) linkContent = await channel.messages.fetch(args[6]).catch(x => null);
console.log(linkContent)

blissful coral
#

?

steel canyon
blissful coral
#

through a command...

normal sage
#

Can someone link me a good tutorial on making discord dashboards in discord.py?

steel canyon
#

through a command...
@blissful coral how ?? idk coding ;v

#

sorry tag

blissful coral
#

Suggest you learn it then before trying to make a discord bot

steel canyon
#

Suggest you learn it then before trying to make a discord bot
@blissful coral idk when i can learn :(

#

bye

opal plank
rustic nova
#

August 30th

#

2018

#

Well there's probably newer Tutorials

timber frost
#

Just me or did images that are attached to embeds disapear/stop working? I know that my code works because it was working before and the messages that sent before had their images disapear and getting the embed to send again it doesn't show the image and there are no errors.
edit: just as I though its discords side

proven vector
#

was just about to ask this, ive had images attached to embeds stop working as well

vale garden
#

yea thats happening to every bot and on every server

proven vector
#

thats fun, good to know im not doing something wrong on my end

slim umbra
#

yeah dapi is fuck rn

lament meteor
#

where do u add the intents u need for djs?

pale vessel
#

under ws in clientoptions

#

ws.intents

lament meteor
#

ah

severe gyro
#

screeches
don't you dare send an invite link here

lament meteor
#

@pale vessel what intent does user roles being cache go under?

pale vessel
#

guilds i guess

#

but by default member roles are provided as IDs

blissful coral
#

@clever mortar No

lament meteor
#

yea thats fine

#

i need the guild ids

#

cuz im using it for the patreon premium shit

blissful coral
#

Take your bullshit server advertisement elsewhere

#

Thank you <3

weary torrent
#

Oi @blissful coral

Just bc u have nitro and u have boosted this server. And... Ur a bot developer dodent mean u can be a rude little fucking shithead.

#

Thanks

earnest phoenix
#

what

coral trellis
#

@clever mortar Don't advertise

#

Ya'll need to chill

neon heart
#

how to solve the automatic response when we type the bot prefix, for example, my bot prefix is ​​'m!' when I send the prefix, my bot responds

blissful coral
#

Homie what

#

Lmao

severe gyro
#

slice the message and check if second half is empty?

neon heart
pale vessel
#

yeah

blissful coral
#

How does nitro have anything to do with me talking in a channel not wanting to deal with someone’s bs

#

Your adding fuel to the fire

#

Suggest you drop it

neon heart
pale vessel
#

like if (!message.content.slice(prefix.length).trim()) send()

neon heart
#
let cmd = args.shift().toLowerCase();```
#

in here?

severe gyro
#

assuming there will be " " is kinda non-flexible

pale vessel
#

from what i'm seeing, cmd could be "", which is falsey. you can try doing if (!cmd) return doSomething(); after declaring cmd

neon heart
#

umm ok wait

delicate shore
#

Alright so I am about to ask something which I know will make you laugh at me

drifting wedge
#

Why would I need ngnix?

#

I have flask

#

Like can I just have flask?

delicate shore
#

If a user puts 1:20 I want my bot to convert it into seconds
Which will be 80 seconds

drifting wedge
#

In a vps, if I run it, it doesn’t appear lol

delicate shore
#

If a user puts 1:20 I want my bot to convert it into seconds
Which will be 80 seconds
Is it possible ?

#

I mean yea it is

#

But idk how

lament meteor
#

how the frick do u get everyone with a certain role in a guild

severe gyro
#

you can have flask, but nginx allows you to flexibly add stuff to it, like isolating your flask from the real world (and running it locally, proxying requests through nginx) and/or putting https over it

pale vessel
#

@delicate shore you can split it by : and count the values yourself or use a parser

delicate shore
#

so like
time = args(0).split(:)

#

kuje this

lament meteor
#

flaze halp me pls

#

intents are killing my api

pale vessel
#

you need to cache members lul

#

do you have the guild members intent?

lament meteor
#

yea?

pale vessel
lament meteor
#

does it have to be a presistent cache?

pale vessel
#

eh

#

i don't think so

delicate shore
#

@delicate shore you can split it by : and count the values yourself or use a parser
@pale vessel Can you elaborate a bit 😉

lament meteor
#

also its a private bot

#

so i can use the guild intents without verification iirc

drifting wedge
#

How can i make flask show the page contents with html?

#

Like in a vps

neon heart
#

@pale vessel all right, the problem has been solved. Thankyou

pale vessel
#

assuming you already did checks (make sure it's a number, etc.), you can probably use something like string.split(":").reduce((acc, element, index) => acc + (index == 0 ? element * 60 : element))

delicate shore
#

Oh

#

Thanks

#

But i have a question

pale vessel
#

only works for x:xx durations though

delicate shore
#

okk

#

why we did string.split

#

can't we do args.split

pale vessel
#

you can, if args is a string

delicate shore
#

yes it is

pale vessel
#

you can replace string with args then

delicate shore
#

kk

#

Thanks

#

Can u use isInteger()

#

to check if args is a number

#

Oh but

#

It will fail

pale vessel
#

you can use args.split(":").some(x => isNaN(x)) where it checks whether one of the element is not a number or not

delicate shore
#

Ooh

#

It'll return true and false and then I can add an if statement ok

#

Thanks

pale vessel
#

yeah

#

you need to make sure that args.split(":").length is 2 otherwise the function won't work properly

weary torrent
#

Any here have any useful bot code??
That they are ok with sharing??

In the coding language pydroid.3

#

If so pls dm me xxd

earnest phoenix
#
  1. pydroid isn't a language MegaThonk
  2. no spoonfeeding ig
sudden geyser
delicate shore
#

Alright thanks

pale vessel
#

it's probably an array then

delicate shore
#

I am just using message.content

#

or should i stringify it

pale vessel
#

can you show your code?

timber frost
#

your args need to be your message content but with your prefix cut out

pale vessel
#

what is args?

timber frost
#

you need to define args

delicate shore
#
    const args = message.content.toLocaleLowerCase().slice(config.prefix.length).trim().split(/ +/g);
    const command = args.shift();```
#

This is how i define it

timber frost
#

huh

pale vessel
#

well you did use message.content but you split so it becomes an array

#

you have to join it back using array.join(" ") before splitting it again

#

and for this, you should change it to just if (args.split(":").some(x => isNaN(x))) return ...

delicate shore
#

oh

#

yikes

#

Thanks

timber frost
#

This is how I define my args

const args = message.content.slice(matchedPrefix.length).trim().split(/ +/);
pale vessel
#

!== "true" will never work since true is not a string

timber frost
#

toLocaleLowerCase() isnt this supposte to be toLowerCase()

pale vessel
#

it will work if you use != since it's not strict but i recommend you to just use if (!something) or if (something) instead of using !== true or === false

delicate shore
#

I still get the error args.split not a function ;-;

#

This is how I define my args

const args = message.content.slice(matchedPrefix.length).trim().split(/ +/);

I think our is pretty similar

timber frost
#

yeah, I dont shift my args to lowercase tho since somethings are cap sensitive for me

pale vessel
#

what did you use?

#

make sure it's something like args.join(" ").split(":")

delicate shore
#

no

#

I used args.split()

pale vessel
#

you can't split an array, you split a string instead

delicate shore
#

Oh

pale vessel
#

join an array so that it becomes a string again and split it by :

delicate shore
#

I need to learn javascript
And that too A LOT

#

OMG OMG OMG OMGO OMGO @pale vessel I LOVE YOU

pale vessel
#

y r u gae

stark abyss
#
    for(let a of client.guilds.cache){
      console.log(a)
      if(client.guild.cache.memberCount < 5) guild.leave() 
    }    ```TypeError: Cannot read property 'cache' of undefined
delicate shore
#

y r u gae
No homo

stark abyss
#

opps

#

it's guild**s**

#

fixed

languid inlet
#

I got my music bot hosted

feral aspen
#

Hello

#

I am trying to make this code where if a user does the !say <@role>, it would return;

#
const client = new Discord.Client({
    allowedMentions: { parse: [] }
});```
#

Does this work?

#

or what am I supposed to do.

#

I want it where if someone does the say command and mentions the role, it would not work.

#

or instead, how can I add an if statement in the command to not allow roles mention

#

?

golden condor
#

You can filter out mentions

feral aspen
#

How?

#

I did this ```js
const embedErrorTwo = new Discord.MessageEmbed()
.setDescription("❌ You're not allowed to ping everyone or here.")
.setColor(colors.cyan)

    if(message.content.includes("@everyone") || message.content.includes("@here")) return message.reply(embedErrorTwo)
golden condor
#

That wouldn't be how that would work I don't think

feral aspen
#

It does work

golden condor
#

oh

feral aspen
#

It works absolutely fine.

golden condor
#

Well

#

Look for anything that includes <@& at the beginning

#

<@&304313580025544704>

#

That is the mod role mention for this server

pale vessel
#

nice example callum

feral aspen
#

What is the &

pale vessel
#

it indicates a role

feral aspen
#

Oh

golden condor
#

^^

earnest phoenix
#

yep

feral aspen
#

so js if(message.content.startswith("<@&") return;?

golden condor
#

no

feral aspen
#

or am I dumb

earnest phoenix
#

<@ user
<# channel
<@& role

feral aspen
#

or is it includes.

golden condor
#

It's .includes

feral aspen
#

ahh

#
if(message.content.includes("<@&")) return;
golden condor
#

Yes

feral aspen
#

Ill try it out.

#

Thanks!

#

It works @golden condor thank you! 🙂

golden condor
#

Np

earnest phoenix
#

how can i ban a user with reason ?
like, to ban someone we use user.ban() but what should we use to ban someone with reason

#

ping me if you know how

#

guys guys how can i send my bot codes to my phone to start the bot

golden condor
#

You can use GitHub

earnest phoenix
lethal grail
#

I need help, where do I store my prefix and token data?

#

and what code should I use?

#

discord.js v12 btw

golden condor
#

Database

#

For prefix

#

Unless you have one prefix for all servers

lethal grail
#

Database
@Callum#7067 hmm I only have an index.js folder

#

I'm new to js

#

@golden condor

royal herald
#

Uptime?

#

what

quasi zephyr
#

My commands How do I do it v12?

lethal grail
#

anyone know the "ping" function in js?

royal herald
#

@lethal grail client.ws.ping?

earnest phoenix
#

client.ws.uptime @royal herald

royal herald
#

@earnest phoenix what?

earnest phoenix
#

what is a command uptime :D?

royal herald
feral aspen
#
if(muterole.highest.position > message.guild.me.roles.highest.position) return message.channel.send("NO")
``` Is this a correct way to check if the Muted role is higher than the bot, it would return?
royal herald
#

he deleted it @earnest phoenix

earnest phoenix
#

Ok

royal herald
#

@feral aspen what is muterole. can you send muterole pls?

feral aspen
#
const muterole = message.guild.roles.cache.find(role => role.name === "Muted")
#

I want the bot to check that if the muterole is higher than the bot, it would return;

royal herald
#

hm yeah its true

feral aspen
#

It doesnt work

#

Cannot read property 'position' of undefined

royal herald
#

wait a minute brb

feral aspen
#

Yea, anyone?

royal herald
#

oh i find it

#

@feral aspen

feral aspen
#

Yes?

royal herald
#

use
try{
and catch for Muted role is higher than the bot

feral aspen
#

Bro.

#

I did this ```js
if(muterole.highest.position > message.guild.me.roles.highest.position) return message.channel.send("NO")

royal herald
#

like this:

try {
//code bla bla stuff
    }catch(e){
message.channel.send("i cant cuz the role is higher then me")
console.log(e)
}
#

@feral aspen try my code then try ur code

feral aspen
#

I am trying to do it the easier way

royal herald
#

oh

feral aspen
#

And no need for try thing, cause it would add either way but in reality it won't add.

#

I am trying to make an if statement for this

#
if(muterole.highest.position > message.guild.me.roles.highest.position) return message.channel.send("NO")
``` This doesnt work cause it keeps erroring me out `Cannot read property 'position' of undefined`
neon heart
#

maybe you can use

if(message.guild.me.roles.highest.comparePositionTo(muterole) < 0)
quasi zephyr
#

Bulamadım v12 yükseltmeyi

feral aspen
#

It doesnt work

royal herald
#

.member.roles.highest @feral aspen

feral aspen
#

👍

lethal grail
sage creek
#

Idk im noob and use botghost

stiff walrus
#
client.on('message', async (message) => {
    if (message.author.bot) return;
if (message.content.startsWith( 'n!' + 'oylama')) {
        if (!message.member.hasPermission('ADMINISTRATOR')) return message.channel.send('Oylama açmak için yetkin yetmiyor.');

        let pollChannel = message.mentions.channels.first();
        let pollDescription = args.slice(1).join(' ');

        let EmbedPoll = new Discord.MessageEmbed()
        repVoteEmbed.setTitle(':exclamation: Nova Bot | Oylama')
        repVoteEmbed.setDescription(pollDescription);
        repVoteEmbed.setColor('RANDOM')
        pollChannel.send(EmbedPoll);
    }
})```
#

(node:9728) UnhandledPromiseRejectionWarning: ReferenceError: args is not defined
at Client.<anonymous>
at Client.emit (events.js:327:22)
at MessageCreateAction.handle Bot\node_modules\discord.js\src\client\actions\MessageCreate.js3114)
at Object.module.exports [as MESSAGE_CREATE] Bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacketBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js44422)
at WebSocketShard.onMessage Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage
Bot\node_modules\ws\lib\websocket.js:825:20)
(Use node --trace-warnings ... to show where the warning was created)
(node:9728) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:9728) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

#

that's the error

#

what should i do

willow yoke
#

What is the rate limit for changing the name of the voice channel by the current bot?

earnest phoenix
#

@stiff walrus define args

#

hm
@lethal grail you're not using temperate literals

willow yoke
#
const args = message.content.slice(prefix.length).split(' ');
crystal wigeon
#

hey guys so

#

i got a server on gcp with min ram 3.75GB and 10GB space. but when multipel people are using the bot it lags

#

can we load load balance ??i dont think so becasue both the vms will have same bot token

#

im thinking about upgrading the memory, but what if 7GB is alos not enough and it still lags for players?

lethal grail
#
const config = require('./config.json');
const client = new Discord.Client();

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('message', msg => {
  if (message.content === `${prefix}ping`) {
    message.channel.send(`Pong! ${client.ws.ping} ms.`);
  }
  
  if (message.content === `${prefix}serverinfo`) {
	message.channel.send(`This server's name is: ${message.guild.name}`);
}
});

client.login(`token`);```
none of the commands are responding
willow yoke
#

@lethal grail ❌message ⭕msg

#

ok?

lethal grail
#

I don't get it?

#

New to js, sorry

willow yoke
#
//Use msg instead of message because it is defined as msg here
client.on('message', msg => {
  if (msg.content === `${prefix}ping`) {
    msg.channel.send(`Pong! ${client.ws.ping} ms.`);
  }
  
  if (msg.content === `${prefix}serverinfo`) {
    msg.channel.send(`This server's name is: ${msg.guild.name}`);
}
});
crystal wigeon
#

are you getting the logged in console log?

lethal grail
#

nothing in the console log

crystal wigeon
#

are you not getting logs from the client.on("ready")?

stiff walrus
#

i am trying to make avatar command but the command is working only for self i mean:

n!avatar @blalblalal

but that is not working just n!avatar.

  } else {
      const embed = new MessageEmbed()
      let User = message.mentions.users.first()
      Embed.setImage(message.author.displayAvatarURL({dynamic : true}))
      Embed.setColor("RANDOM")
      Embed.setAuthor('Avatarınız burada.')
      Embed.setFooter(message.member.displayName + 'tarafından istendi.')
      Embed.setTimestamp();
      return message.channel.send(Embed)
  }
 }```

what should i do?
warm marsh
#

You're only check if a user is mentioned nothing else.

#

You have no fall back if the mention is invalid.

worthy pine
#

put an or statement there?

crystal wigeon
#

any good server config suggestions?

lethal grail
#

when hosting to heroku, do I have to put the node modules folder in the github?

worthy pine
#

no

#

heroku installs them automatically

lethal grail
#

sweet, thanks.

worthy pine
#

np

rustic nova
wheat valve
#

How would you get a users' server join date and account created date, and format that into MM/DD/YY? I use discord.js. Please ping me with responses

rustic nova
#

and cant find the creation one

earnest phoenix
#

can i get the names of software/app for making making ?

rustic nova
#

both return a Date

#

which you should be able to work with

earnest phoenix
#

thank you so much

rustic nova
wheat valve
#

Thank you!

gentle lynx
#

client.con.query(SELECT * FROM levels, (err, result) => {
if (err) console.log(err);
console.log(result);
});

#

how can I loop through result

rustic nova
#

@sand dune guild.cache as far as i know

gentle lynx
#

nvm xd

rustic nova
#

i don't code in js, but that's how i remember it

opal plank
#

@sand dune @rustic nova guild extends message when its in a guild, it does not have cache since its not part of the manager.
tldr, guild exists if the message came from a guild(dm and other text channels may not have guild member)

rustic nova
#

ohh alright

#

yeah again, i don't code with discordjs and just mostly refer to the documentation

crystal wigeon
#

does anyone know how the damage in a battle system is calculated?

rustic nova
#

but thanks for clarifying

quick ridge
#

this photo's resulation is 640x640
How can i get this part in this code

ctx.drawImage(image, 0, 0, ctx.canvas.width, ctx.canvas.height);
 let imageData = ctx.getImageData(ctx.canvas.width, ctx.canvas.height , ctx.canvas.width, ctx.canvas.height).data;```
rough knot
#

Anyone know how to make a dashboard for the bot?

#

Like change prefix

#

and send a message trough it

rustic nova
#

with php, css and html (maybe js)

rough knot
#

Kk

#

Will try later

rustic nova
#

and oauth2.0 from discord if you wish your users to be able to login through it

rough knot
#

ok, thz

#

thx

boreal iron
#

Yeah using PHP to send cURL requests without libs etc. is the easiest way for this case.

#

Discord API is easy to use

quick ridge
#

do you guys know something about my problem

boreal iron
#

Just a few lines of code including the form checks

rough knot
#

Any tutorials

#

Cause im new to that

#

Im new to php

rustic nova
#

Yeah using PHP to send cURL requests without libs etc. is the easiest way for this case.
i got that far too, but kinda gave up when i read the oauth2.0. Working with refreshing tokens isn't really for me and i should get into that later on

boreal iron
#

Yeah there are a lot of examples how to use PHP to send cURL requests to the Discord API

rough knot
#

Any tutorials on how to make a dashboard?

rustic nova
#

You will need to have a bit of pre-experience in working with html and css. So i suggest getting into that first before starting to make a dashboard

boreal iron
#

This will get harsh without any knowledge of HTML and CSS and some JS (for cosmetics)

rough knot
#

I can html and css

#

and js

earnest phoenix
#

is there any database for discord.js better than quick.db ?

rough knot
#

Idk

earnest phoenix
umbral zealot
#

Literally every single database out there

rough knot
#

Like FIREBASE

umbral zealot
#

But, what specific issue do you have with quick.db ?

#

might help direct you to the right one

earnest phoenix
boreal iron
#

I can html and css
@rough knot If so just use a simple admin (dashboard) template to start with

rustic nova
earnest phoenix
#

@umbral zealot In future if i switch to repl.it then what will i do ?

rough knot
#

Simple admin

rustic nova
#

There are js libraries that make oauth2 easy though

umbral zealot
#

If you switch to repl.it you can literally just use the repl.it database

#

It's super simple

quick ridge
earnest phoenix
#

🤔 thats a good idea

rustic nova
earnest phoenix
#

ok btw wither supports quick.db ?

rustic nova
#

@quick ridge

umbral zealot
#

what's wither? lol

rough knot
#

this photo's resulation is 640x640
How can i get this part in this code

ctx.drawImage(image, 0, 0, ctx.canvas.width, ctx.canvas.height);
 let imageData = ctx.getImageData(ctx.canvas.width, ctx.canvas.height , ctx.canvas.width, ctx.canvas.height).data;```

@quick ridge maybe make a variable that sends that pic to the code?

earnest phoenix
rough knot
#

THAT PRICE

quick ridge
#

@quick ridge
@rustic nova yep sorry

rough knot
#

HOLY

umbral zealot
#

Ah. uhm... I have literally no damn clue lol

#

you'd have to ask them that question

earnest phoenix
#

my friend gift me a wither discord bot hosting :))

rough knot
#

this photo's resulation is 640x640

How can i get this part in this code

ctx.drawImage(image, 0, 0, ctx.canvas.width, ctx.canvas.height);
 let imageData = ctx.getImageData(ctx.canvas.width, ctx.canvas.height , ctx.canvas.width, ctx.canvas.height).data;```

@quick ridge maybe make a variable that sends that pic to the code?

earnest phoenix
#

@umbral zealot btw how can i make leaderboard command in quick.db

umbral zealot
#

I mean that looks like one of those ephemeral temporary hostings that'll probably disappear in a few months. Has all the hallmarks fo it

#

lol I don't support quick.db 😛

earnest phoenix
#

thats not fair

quick ridge
#

@quick ridge maybe make a variable that sends that pic to the code?
@rough knot i dont think so

umbral zealot
quick ridge
#

I just want to get that part of the photo, there is already a canvas module to count the pixels

rough knot
#

or upload it to f.ex imgur and get it from imgur?

#

oh, maybe edit the pic?

earnest phoenix
#

@umbral zealot enmap is developed by you ?

umbral zealot
#

Yep 😄

earnest phoenix
#

pepowot noice

rough knot
#

xD

rustic nova
#

But this development

quick ridge
#

oh, maybe edit the pic?
@rough knot yes I want this too but i dont know how can i do

queen needle
#

in quick.db just use js <db>.all().filter(data => data.ID.startsWith(the first part or the variable name as it appears in quick.db).sort((a,b)=>b.data-a.data)

rough knot
#

I can fix it rn

#

@quick ridge

quick ridge
#

its good for me 😄

rough knot
#

Edited

#

@quick ridge

umbral zealot
#

Wouldn't it be board in da house

rough knot
#

idk

#

I didnt type

#

I only resized it

quick ridge
#

i dont need this pic

#

the red here

#

in code

#

ctx.drawImage(image, 0, 0, ctx.canvas.width, ctx.canvas.height);
let imageData = ctx.getImageData(ctx.canvas.width, ctx.canvas.height , ctx.canvas.width, ctx.canvas.height).data;

rough knot
#

So ima remove it?

vale garden
#

hi i have this code

@bot.command(brief = "Provides you with free coins on a daily basis")
@commands.cooldown(1, 86400, commands.BucketType.user)
    try:

     bal = db.get(User.id == str(cmd.author.id))['bal']
     increment = random.randint(500, 1250)
     new_bal = int(bal) + int(increment)

     db.update({'bal': new_bal}, User.id == str(cmd.author.id))

     await cmd.send(f"You have received {increment} coins.. and you now have {new_bal} coins in total!")

    except:
      await cmd.send('You are on cooldown.')

and when the cooldown occurs for a user, i get this error on the console

raise CommandOnCooldown(bucket, retry_after) discord.ext.commands.errors.CommandOnCooldown: You are on cooldown. Try again in 86396.79s

does anyone know how i can display this in the channel

quick ridge
#

No I just want to take the hatched area

rough knot
#

?

#

hi i have this code

@bot.command(brief = "Provides you with free coins on a daily basis")
@commands.cooldown(1, 86400, commands.BucketType.user)
    try:

     bal = db.get(User.id == str(cmd.author.id))['bal']
     increment = random.randint(500, 1250)
     new_bal = int(bal) + int(increment)

     db.update({'bal': new_bal}, User.id == str(cmd.author.id))

     await cmd.send(f"You have received {increment} coins.. and you now have {new_bal} coins in total!")

    except:
      await cmd.send('You are on cooldown.')

and when the cooldown occurs for a user, i get this error on the console

raise CommandOnCooldown(bucket, retry_after) discord.ext.commands.errors.CommandOnCooldown: You are on cooldown. Try again in 86396.79s

does anyone know how i can display this in the channel
@vale garden try cmd.channel.send

vale garden
#

uh

#

cmd is the context so why would that work

rough knot
#

true

vale garden
#

ik that the mistake is in the except: block

#

i mean most probably

#

that is the case

rough knot
#

Replace it with ur client variable name

vale garden
#

replace what with that

rough knot
#

like const bot = new

vale garden
#

no i mean what do i replace with the client var

rough knot
#

,

vale garden
#

wat

rough knot
#

?

vale garden
#

,?

rough knot
#

Wdym

no i mean what do i replace with the client var
@vale garden

vale garden
#

yea so you said ,

#

whats ,

#

lol

stiff walrus
#
const Discord = require('discord.js');
const client = new Discord.Client();
const {prefix, token} = require('./config.json');

const { MessageEmbed } = require('discord.js');

//Bot aktif etme kısmı, durumu ve konsola mesajı
client.on('ready', () => {
    client.user.setActivity('Kodlanıyor... | prefix: n!', { type: 'PLAYING' })
    console.log('Bot aktif edilmiştir. Hizmete hazır!');
    console.log(prefix);
    console.log(token);
});

client.login(token);````

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module  

thats the error what should i do
earnest phoenix
stiff walrus
#

help please

rustic nova
rough knot
#

U havent maked a token or a prefix variable

#

@stiff walrus

strong escarp
#

guys

#

help me

stiff walrus
#

U havent maked a token or a prefix variable
@rough knot how

rustic nova
#

help me
@strong escarp hm

strong escarp
#

oops not here

slender thistle
#

@green kestrel Is %0.2f a valid format specifier for a float value that needs to be truncated/rounded to 2 decimal places? (C++)

clever vector
#

Hey developers

#

Anybody online here?

pale vessel
#

do you have any question?

#

if so just ask

#

😩

clever vector
#

Yeah wait

umbral zealot
#

One of your commands does not have an exports.help object.

clever vector
#

Any more problem? cause its got

umbral zealot
#

one of them definitely does not.

#

Make sure all the files in your ./commands folder are actually commands that are fully formed in their structure, and make sure also that all your files are saved

clever vector
#

ok

#

wait a sec is it because i split the help command to other like commands and guide?

umbral zealot
#

no idea, I'm just reading off this specific error, because that's all you provided.

green kestrel
#

@green kestrel Is %0.2f a valid format specifier for a float value that needs to be truncated/rounded to 2 decimal places? (C++)
@slender thistle yes

#

but if youre using that style of of format specifier, you are no doubt using sprintf(), which is really unsafe

#

consider instead using fmt::format, a library that is type safe, secure, stable and uses python style format specifiers

#

in that its {0:.2f} i think

slender thistle
#

Frankly, I don't care about safe-unsafe here. And I gave up on formatting the string entirely

#

But thanks for the info

#

(Trying to explain C++ to someone who doesn't have knowledge in programming is hard)

opal plank
#

shiv going c++ but not typescript

#

imma bonk you

green kestrel
#

oh dear

#

why teach a newbie C++, WHY shiv WHY

#

do you like to punish yourself? lol

opal plank
#

shiv going to cry assembly tears

green kestrel
#

mov al, [tears]

opal plank
#

lul

earnest phoenix
#

my cs course started with cpp this year when nobody except me and another mate had any prior programming experience

#

it's interesting to say the least

green kestrel
#

yeah they often do that in programming courses, it seems like its a thing to make people quit

#

when most of the people on the course dont even know what a variable is

opal plank
#

cant wait for shiv to have a taste of haskell

#

behold true pain

#

DOM and haskell are things im never touching again in my life

#

period

green kestrel
#

people using haskell for serious development:
people NOT using haskell for serious development: absolutely bloody EVERYBODY

opal plank
#

haskell has to be some of the worst nightmares one could hope to find

#

@green kestrel ever tried monads?

#

but not quite

tribal siren
#

so i got this problem

#

i wanna divide the set slowmode into hours, minutes and seconds

#

let's suppose that our slowmode is always bigger than 3600 seconds

slender thistle
#

why teach a newbie C++, WHY shiv WHY
@green kestrel Not my choice. I blame his uni

tribal siren
#

hours is Math.floor(slowmode / 60)

slender thistle
#

I'm his go-to guy for anything related to programming lmfao

tribal siren
#

how to do minutes?

umbral zealot
#

There's tons of code online for this, stackoverflow probably would be the top result for "javascript how to print ms in hours minute and seconds" , or you can use a library like ms or datefns

quartz kindle
#

total minutes would be / 3600

#

or / 60 / 60

#

if you want only remainder minutes, you can use mod 60

tranquil basin
#

What is a Command Handler ?

#

and is it Important

quartz kindle
#

a function or system that handles and processes commands

umbral zealot
#

Yes, where commands are separated one per file.

quartz kindle
#

its not important, its just a way to process commands that makes it easier to maintain

umbral zealot
#

It makes development easier in the long term since your commands are more self-contained.

tranquil basin
#

Thx

tribal siren
#

total minutes would be / 3600
@quartz kindle ok thank you

#

i will try rn

cinder patio
#

Modern C++ is quite easy

#

but yeah I'm not getting ANYWHERE NEAR haskell anytime soon

brisk valve
#

hi

delicate shore
#

how to write upvotes

#

after that

umbral zealot
#

What do you mean by "how to write upvotes"

delicate shore
#

Like Normally it just says 460

boreal iron
#

Just the word or the whole element

delicate shore
#

but in groovy it says 460 UPVOTES

boreal iron
#

Oh

#

Using CSS ::after tag

#

and content: ' Text'

#

On the numbers element

umbral zealot
#

yeah they definitely tweaked the CSS 😂

green kestrel
#

@green kestrel ever tried monads?
@opal plank nah I quite like having two thanks

boreal iron
#

Works with other elements as well

delicate shore
#

On the numbers element
@boreal iron
I'm not good at CSS can u explain a bit more
Because I can't find number 's element through I inspect element

boreal iron
#

Sure ... being at PC in a few minutes

delicate shore
#

Alright thanks :)

#

Btw what's id for vote and invite button

#

I mean class

sudden geyser
#

this
holding the tears in for my java

quaint basin
umbral zealot
#

You wait.

#

Bot verification takes up to 5 weeks

quaint basin
#

ohh ok thanks

boreal iron
#
#points::after { content: 'VOTES'; }
#

Btw what's id for vote and invite button
.titleandvote .votebutton

#

(class)

earnest phoenix
#

Im a question pls, how to get a value from json, example i need get dpk.depencies. etc .. i need get discord.js version, or is a string in json package

#

How to get ?

crude shoal
#

how to dl mango bot for timer??

umbral zealot
#

no idea

#

wtf is a "mango bot for timer"

boreal iron
#

Wow that's weird English...

#

@earnest phoenix JSON.parse() and JSON.stringify() is what you need

#

didn't really understand what you need exactly but yeah

crude shoal
#

i think its a bot that sets timer for pokemon?

umbral zealot
#

You think?

#

You are asking us how to get something and you're not even sure what it is? lol

#

You might have us confused with google, darling.

boreal iron
crude shoal
#

ayt ayt

earnest phoenix
#

@boreal iron I need get value here

#

I need get 'discord.js'

cinder patio
#

object["discord.js"]

earnest phoenix
#

i'm bad xD

#

THX

#

❤️

delicate shore
#

@delicate shore
@boreal iron
Hey thanks a lot :)

#

Btw

#

How can I make the logo rotate

past crypt
#

i cant do npm i quick.db

#

whe?

timber frost
#

need a little help I need to make an array sort of like this:

"USERID": {
  "time": 77777,
},
"USERID: {
  "time": 77777,
}

idk how to create an array like this, I only really know to how do it across scripts and simple arrays. thx in advance

delicate shore
#

Does this look good

#

Or so much red ?

boreal iron
#

rotate? You mean animated?

#

spinning?

vale garden
#

hi

delicate shore
#

Yes

vale garden
#

@delicate shore its fine based on the theme you are going for

boreal iron
#

@timber frost Well to be exact, what u wrote is not an array

vale garden
#

lol its an object

boreal iron
#
[
  {
    "USERID": { "time": 77777 }
  },
  {
    "USERID": { "time": 77777 }
  }
]
#

that would be one

timber frost
#

hmm, I just dont know how to create it

boreal iron
#

@timber frost Creating arrays like this is simple. Just use array.push(mixed val)

#

Just push your object into the array

#

array.push(object);

#

That's it already

timber frost
#

wow, really that simple, this is my first time trying this. But I didn't expect it to be this easy

#

well thx

#

anyways back to 2am coding

pale vessel
#

wait fake that's illegal

#

[{}, {}, {}]

boreal iron
#

@delicate shore Well even is CSS3 allows animations, it's not really supported on any browser today or mobile device, but you can of course spin it

#

shhh the police is not around

delicate shore
#

Alright

boreal iron
#

wait fake that's illegal
imma to lazy to add the { } around... just copied his text

#

just imagine they are THERE KEKW

quartz kindle
#

since when do browsers not support css animations?

earnest phoenix
#

that information is straight up incorrect

#

lol

#

the only browser that would potentially not support CSS3 animations would be IE11

pale vessel
#

just imagine they are THERE KEKW
and what do you mean by this

earnest phoenix
#

which i don't even allow IE11 users to visit my site like get a real browser KEKW

boreal iron
#

god damn... imma to lazy to add the { } around... just copied his text

#

shhh god bless IE

#

the one and only true browser lmao

#

@delicate shore

#bot-img div
{
  animation-name: spinning;
  animation-duration: 5000ms;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

@keyframes spinning
{
  from
  {
    transform:rotate(0deg);
  }
  to
  {
    transform:rotate(360deg);
  }
}
#

Or... just use the img element if your pic is transparent

#

#bot-img img to spin the image only

#

[...] is invalid
updated it just for your, since sarcasm is unknown to you

rustic nova
#

Your pfp like

delicate shore
#

Thanks fake

boreal iron
#

since when do browsers not support css animations?
@quartz kindle Just wanna prevent him of doing stuff like this

quartz kindle
#

lmfao

earnest phoenix
#

Lmaoo

quartz kindle
#

remember google's barrel roll?

boreal iron
earnest phoenix
#

Still a thing

quartz kindle
#

just google "do a barrel roll"

boreal iron
#

nope but I can imagine

#

aye

quartz kindle
#

it is still a thing

earnest phoenix
boreal iron
#

I mean ... looks totally legit not confusing in any way

quartz kindle
#

also, remember reddit's "ooer intensifies"?

boreal iron
#

ouch

quartz kindle
#

i love these pages

#

but reddit killed them with their new design

#

they only work in old reddit

boreal iron
#

imagine having an epileptic seizure looking on such a shit lmao

quartz kindle
#

if you play league, check /r/shurima in old reddit

boreal iron
#

huh... that proves I'm too old

opal plank
#

@quartz kindle gib help pliz

boreal iron
#

not on reddit and actually don't really know what it is tbh

quartz kindle
#

nu

opal plank
#

plez

#

i thought VALUES was the proper way to add prepared statements

quartz kindle
#

@boreal iron boomer?

opal plank
#

to make sure there are no escaped characters

boreal iron
#

@boreal iron boomer?
@quartz kindle GOD DAMN... don't even know what that means, got called like this a lot of times already

quartz kindle
#

Lol

boreal iron
#

yay, pinged myself

#

imagine getting old ooooof

quartz kindle
#

Baby boomers are the demographic cohort following the Silent Generation and preceding Generation X. The generation is generally defined as people born from 1946 to 1964, during the post–World War II baby boom

boreal iron
#

lmao not that old

#

but I feel like 70 some times

quartz kindle
#

xD

#

you're not that old tho, are you? like are you 40+?

boreal iron
#

nah

#

close to 30

quartz kindle
#

then you're likely still a millenial, like me

boreal iron
#

nope not born in the 21th century

quartz kindle
#

Millennials, also known as Generation Y (or simply Gen Y), are the demographic cohort following Generation X and preceding Generation Z. Researchers and popular media use the early 1980s as starting birth years and the mid-1990s to early 2000s as ending birth years, with 1981 to 1996 a widely accepted defining range for the generation.

boreal iron
#

I swear! Stop pasting wikipedia results

quartz kindle
#

lmao

pale vessel
#

ok boomer

quartz kindle
#

ok millenial

boreal iron
#

all these new words... oof

dense nest
#

If i made a table, lol=['hi', 'ok'] can I insert things into it

boreal iron
#

I feel like 70 again... lel

#

table?

#

u mean array

quartz kindle
dense nest
#

Array

#

Yes

quartz kindle
#

@opal plank what lib

#

is that

boreal iron
#

God bless NoScript

dense nest
#

Lol

boreal iron
#

you can push elements into the array using array.push(mixed value) @dense nest

opal plank
#

@quartz kindle postgres lol

#

pg

#

not postgres

#

postgres is another one

quartz kindle
#

should work lol

#

but you dont need VALUES() if you're only using a single value

#

just do channel_id = $1

#

also, do the same for guild_id

boreal iron
#

eww

#

follow the correct syntax

#

don't be lazy

tribal siren
#
    const welcomeChannel = member.guild.channels.cache.find(channel => channel.name === 'welcome-bye')
    const embed = new Discord.MessageEmbed()
      .setTitle('"WRTN" - Warning System Online')
      .setDescription(`Внимание! ${member} поднимается на крышу клана __"We Rule The Night"__ \n \n Двери на крышу открываются...`)
      .setColor('#7150FF')
      .setImage('https://thumbs.gfycat.com/AltruisticInfantileBovine-size_restricted.gif')
    welcomeChannel.send(embed)
})```
#

why does this not work?

boreal iron
pale vessel
#

ye

tribal siren
#

no

#

that's not possible to name a channel Welcome-Bye

pale vessel
#

unless it's a vc

tribal siren
#

ye

boreal iron
#

well idk but okay, if so can't help u, dunno djs

pale vessel
#

are you sure that the event even triggered?

#

do you have the guild members intent?

tribal siren
#

yes

quartz kindle
#

if the problem was the channel, you would get a "cant get property send of undefined" error

boreal iron
#

only if the djs has no other channel called welcome-bye in the cache

quartz kindle
#

its the guild cache, so its unlikely

boreal iron
#

ah alright, well as I said not really familiar with djs

drifting wedge
#

how would i connect a bot with like 2 servers?

#

and prevent overlap?

#

also how many gigs per shard?

#

of ram

quartz kindle
#

hmm?

#

you want to shard a bot with 2 servers?

drifting wedge
#

no

#

i mean im intrested

#

but not really

#

i wanna know how many shards per gig of ram doe

quartz kindle
#

it depends on a lot of things

#

you're using dpy?

eternal osprey
#

hey guys

#

i am pulling some info from a site

drifting wedge
#

you're using dpy?
@quartz kindle yep

eternal osprey
#

i am pulling the latitude and longittude coordinates of a place.

#

however, it returns these: Egg 0Marcus Garvey, Malcolm X, Family and Friends Mural 040.685989 0-73.938893

#

look at the coordinates. They have 0's in front?

lyric mountain
#

why don't u use google maps' api?

eternal osprey
#

as i am pulling pokemon go raids

lyric mountain
#

ah

eternal osprey
#
 "gym_name":"Saint Ignatius Church",
        "cell_id":"9926596584236122112",
        "ex_raid_eligible":"0",
        "sponsor":"0",
        "lat":"40.666762",
        "lng":"-73.95341",
        "raid_spawn":"1603484824",
        "raid_start":"1603488424",
        "raid_end":"1603491124",
        "pokemon_id":"0",
        "level":"5",
        "cp":"-1",
        "team":"3",
        "move1":"-1",
        "move2":"-1",
        "is_exclusive":"0",
        "form":"0",
        "gender":"0"
     }```
#

the info the site shows

lyric mountain
#

sure

eternal osprey
#

let me show a bit of the code?

lyric mountain
#

what's the issue?

eternal osprey
#

the coordinates are showing random 0's in front

#

040.685989 0-73.938893

#

like this

lyric mountain
#

are you getting the json value correctly?

#

that looks like a dangling concat

eternal osprey
#

i am pretty sure

#

i am indeed using concat

quartz kindle
#

@drifting wedge it depends on what dpy caches, what intents you use, what your bot does, if it has music or not, and many other things. it could easily be anywhere from 100mb to 1gb ram per shard

drifting wedge
#

@quartz kindle is like 150 servers per shard fine?

#

bot is small

#

400 servers ish

#

and i got the ram

quartz kindle
#

you dont need shards or that

#

recommended amount is 1000-1500 servers per shard

drifting wedge
#

@quartz kindle i did shards already

#

like might do 1-2 shards then

lyric mountain
#

that code is really confuse

drifting wedge
#

we got ram

quartz kindle
#

if you use dpy's autoShardedClient, it should create a new shard every 1000 guilds

drifting wedge
#

if you use dpy's autoShardedClient, it should create a new shard every 1000 guilds
@quartz kindle o ok

#

but i can set shard count too

#

might just set it to 1-2 rn\

quartz kindle
#

you wont gain any benefit from it, but sure, not losing anything either

drifting wedge
#

ehh

#

alr

#

ill prob set it to one then

#

cuz 1 shard is fine lol

eternal osprey
#

anyone that could help me if there is any time left ?

lyric mountain
#

I'm trying to understand it

quartz kindle
#

@eternal osprey can you show an example of the data you receive that includes these 0s?

eternal osprey
#

i can console.log the results. Hold on

quartz kindle
#

the example you showed doesnt have 0s

eternal osprey
#

Egg 0Marcus Garvey, Malcolm X, Family and Friends Mural 040.685989 0-73.938893

#

look at the coordinates at the end

#

0

earnest phoenix
#

which site where you can buy vps's uses netplans

eternal osprey
#

it should be: Egg 0Marcus Garvey, Malcolm X, Family and Friends Mural 40.685989 -73.938893

earnest phoenix
#

because my digitalocean droplet doesn't

lyric mountain
#

netplans?

earnest phoenix
#

netplan/01-netcfg.yaml

lyric mountain
#

what's a netplan?

#

like, bandwidth usage?

earnest phoenix
#

type of network configuration

lyric mountain
#

never hear of, but in VPSs you normally configure such stuff as you would do in a normal pc

earnest phoenix
#

i want to add a lavalink ip-rotator

#

but i can't restart my interfaces file

#

it doesn't apply

#

i rebooted my vps

#

but still didn't apply

whole knot
#

Hey, does someone know why I get the OperationalError: no such column: True error when I deploy this bot on Heroku? My code:

        pvcCategory = await guild.create_category(name='Private voice channel', overwrites=overwrites)
        pvcTextChannel = await guild.create_text_channel(name=f'channel management', category=pvcCategory)
        e = discord.Embed(color=self.bot.color)
        e.timestamp = datetime.utcnow()
        e.set_author(name="Commands for the private voice channel:")
        e.add_field(name="`!pvc invite`", value="Invite a member to your voice channel.", inline=False)
        e.add_field(name="`!pvc kick`", value="Kicks a member out of your voice channel.", inline=False)
        e.add_field(name="`!pvc open`", value="Opens your voice channel for everyone.", inline=False)
        e.add_field(name="`!pvc close`", value="Closes the voice channel for everyone.", inline=False)
        e.add_field(name="`!pvc name`", value="Changes the name of your private voice channel.", inline=False)
        e.set_footer(text=self.bot.user.name, icon_url=self.bot.user.avatar_url)
        await pvcTextChannel.send(embed=e)
        pvcVoiceChannel = await guild.create_voice_channel(name=f"Create your channel!", category=pvcCategory)
        # f"[0/{MAX_PERMIT_CHANNEL}]", category=pvcCategory)

        cur.execute(f"INSERT INTO `{ctx.guild.id}`(setup, category, textchannel, voicechannel) VALUES({True}, ?, ?, ?)",
                    (pvcCategory.id, pvcTextChannel.id, pvcVoiceChannel.id))
        conn.commit()
        cur.close()
        e.description = "**The private voice channels were successfully created.**"
        await ctx.send(embed=e)
quartz kindle
#

@eternal osprey is that from console.log(name, + "\n" + raid.gym_name, + "\n" + raid.lat, + "\n" + raid.lng);?

lyric mountain
whole knot
#

Is it wrong how I did it? 😅

lyric mountain
#

why {True} and not true?

eternal osprey
#

yes @quartz kindle

#

i can also just create a new variable and just delete the first character of each string

#

but i am just curious of why it happened?

lyric mountain
#

also, are you sure it's a boolean column?

eternal osprey
#

i can use substring(1) right?

whole knot
#

You mean

VALUES(true, ?, ?, ?)",
```?
lyric mountain
#

yes

whole knot
#

Let me try that

#

Maybe I am missing something

halcyon linden
#

Hi

#

Does anyone know how I can make my bot send a message to the main channel of a server when it joins? I mean, the thank you message for inviting the bot

eternal osprey
#

message.channel.send

#

make sure you define the channel

rustic nova
#

i'd suggest using the system channel for that

eternal osprey
#

bro nvm

quartz kindle
#

@eternal osprey can you console.log(raid)?

eternal osprey
#

i am stupid

#

@quartz kindle i just did substring(1)

#

so the 0's are gone.

lyric mountain
#

substring is just a dirty fix tho

#

like, it could bring issues later on

rustic nova
lyric mountain
#

@whole knot try 1 instead of true

#

see if it solves anything

eternal osprey
#

just wondeing

#

why is my setinterval still not working?

#

it just times the bot out for 10 seconds

#

and then send all the messages in queue like a fucking train

lyric mountain
halcyon linden
#

No xD, is not message.channel.send

rustic nova
#

use the textchannel you get from systemChannel and send a message into that channel

eternal osprey
#

so i am basically intervalling nothing?

lyric mountain
#

not exactly

whole knot
#

Will try this

halcyon linden
#

It was guildCreate, they already told me

lyric mountain
#

you see, every single time someone uses "!raids" it'll add another interval to the queue

halcyon linden
#

Thanks a lot!

eternal osprey
#

yeah

lyric mountain
#

and since it's anon, you'll never ever be able to cancel it

drifting wedge
#

how can i make tooltips look nice?

#

in html?

halcyon linden
#

Make them look like a discord embed

eternal osprey
#

hmm okay

whole knot
#

@lyric mountain Somehow this fixed it, I guess. Thanks a lot! ❤️

lyric mountain
#

also, setInterval is not millis-precise

eternal osprey
#

yeah ofc.

#

but right now if i use !raids

#

the bot does nothing for 10s (my interval time)

#

and then sends alll the messages at once

lyric mountain
#

@whole knot the issue is that "true" and "false" doesn't exist in most databases as valid values (except for comparison)

eternal osprey
#

i want each message to be sent every 10s

lyric mountain
#

all "boolean" columns are actually binary

#

so 1 = true, 0 = false

whole knot
#

I will keep that in mind, thanks 😄
I was just wondering because deploying it local worked

lyric mountain
#

and then sends alll the messages at once
@eternal osprey it'll not work like that actually

#

if I use the command 3 times, it'll create 3 repeaters

eternal osprey
#

owh fuck

lyric mountain
#

each having a delay of 60000 millis

#

which is 60 seconds

eternal osprey
#

yeah i know.

#

that's definitely not what i wanted.

lyric mountain
#

imagine if someone uses it 30 times

#

or 50

#

definitely it'd blow the railway

eternal osprey
#

yeah

lyric mountain
#

I suggest using cron for such stuff

eternal osprey
#

never worked with it?

#

npm package?

lyric mountain
#

yeah

#

but here's a simple interval example

delicate shore
#

Hola

lyric mountain
#
servers = yourGuldConfigArray //just for example
...
onStart(() => { //idk how the things are named
  setInterval(() => {
    servers.forEach(sv => {
      if (sv.notify)
        (/*get the server by the id*/).sendMessage("stuff");
    })
  }, 60000)
})
delicate shore
#

Anyone need help

lyric mountain
#

something close to that

#

idk how things are named, so take that with a grain of salt

eternal osprey
#

hmm okay

#

thanks! I will try my best

rustic nova
#

//idk how the things are named
Same

lyric mountain
#

basically you'll create a single repeater, then you'll get guilds which are configured to receive notifications

#

for each guild with notif = true you'll send the message

eternal osprey
#

why would i want to receive the guilds notification?

#

this is only for one guild

lyric mountain
#

it's simpler then, just use the guild's ID instead of the array

eternal osprey
#

hmm okay i got ya

lyric mountain
#

you just need to, instead of creating one repeater for each command, create a single/universal repeater which will call raid info for guilds with notif = true

eternal osprey
#

okay, will do!

#

thanks man!

lyric mountain
#

np

#

about the cron stuff I've mentioned before, it works based on current time

#

like, regardless of when you start the code, it'll run based on clock

#

if I set it to run every 10 mins, it'll run at 14:10, 14:20, 14:30, etc

#

even if the bot is started at 14:09

leaden rover
#

This command:

    @commands.command(name="subreddit", alias="sr")
    async def subreddit(self, ctx, subreddit):
        """EVEN EVEN EVEN EVEN random crap now fight me irl"""
        if reddit.subreddit == subreddit.over18:
            await ctx.send('The subreddit is 18+. I can\'t send anything from there...')
        else:
            submission = reddit.subreddit(f"{subreddit}").random()
            embed = discord.Embed(title=f"{submission.title}")
            embed.set_image(url=submission.url)
            await ctx.send(embed=embed)```
Won't send anything, what is wrong with it? Is it the `subreddit.over18`?
lyric mountain
#

wouldn't reddit.subreddit return stuff like IdiotsInCars or NeverTellMeTheOdds?

leaden rover
#

OH yeah

#

wait what?

lyric mountain
#

if I understood correctly, you're comparing a string to a boolean