#development

1 messages · Page 1338 of 1

earnest phoenix
#

which means?

abstract coyote
#

did you capitalise it maybe? or did u define bot

#

check on the top for const client

earnest phoenix
#

i used

#

client

#

where

#

Show

abstract coyote
#

can you show?

earnest phoenix
#
const client = new Discord.Client();

const prefix = ';';
const fs = require('fs');

client.commands = new Discord.Collection();

const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
    const command = require(`./commands/${file}`);

    client.commands.set(command.name, command);
}
#

ping.js

#

different file

#

yes

abstract coyote
#

yeah

earnest phoenix
#

you need to pass a client to the function

abstract coyote
#

or define it again

earnest phoenix
#

and name it properly inside it

abstract coyote
#

but functions better

misty sigil
earnest phoenix
#

i have mentioned client

#

for ping

dense spruce
#

that's my unwarn.js


const { Guild } = require('discord.js')

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

moment.locale('fr')

module.exports = {
    run: async (message, args, client) => {
        if (!message.member.hasPermission('MANAGE_MESSAGES')) return message.channel.send('Vous n\'avez pas la puissance de unwarn un membre (trop faible)')
        const member = message.mentions.members.first()
        if (!member) return message.channel.send('Impossible de unwarn du vide (trop bête)')
        if (!client.db.warns[member.id]) return message.channel.send(new Discord.MessageEmbed()
        .setDescription(`**${member.user.tag}** est clean (bien joué champion)`)
        .setColor('#0082ff'))
        const warnIndex = parseInt(args[1], 10) - 1
        if (warnIndex < 0 || !client.db.warns[member.id][warnIndex]) return message.channel.send('Ce warn n\'est pas dans ma banque de données (oups)')
        if (message.guild.id !== `${client.db.guildid}`) return message.channel.send(`Ce warn n\'a pas été donné sur ce serveur (triche pas)`)
        const { reason } = client.db.warns[member.id].splice(warnIndex, 1)[0]
        if (!client.db.warns[member.id].length) delete client.db.warns[member.id]
        fs.writeFileSync('./db.json', JSON.stringify(client.db))
        message.channel.send(new Discord.MessageEmbed()
        .setDescription(`**${member.user.tag}** a été unwarn. Raison : ${reason}`)
        .setColor('#0082ff'))
    },
    name: 'unwarn',
    guildOnly: true
}```

and this is my db.json :
```{"warns":{"659057892640555029":[{"reason":"test","date":1603269338321,"mod":"635914452734312449","guildid":"639799184643325981","guildname":"DraquoDrass"},{"reason":"testt","date":1603211089299,"mod":"635914452734312449","guildid":"639799184643325981","guildname":"DraquoDrass"}]},"tickets":{},"cakepoint":{}}```
earnest phoenix
#
    name: 'ping',
    description: "This is a ping command!",
    execute(message, args){
        message.channel.send(`Pong 🏓 Latency is ${Date.now() - message.createdTimestamp}ms. API Latency is ${Math.round(client.ws.ping)}ms`);
    }
}```
pale vessel
#

mongo is not good for beginners
@earnest phoenix wot

hybrid roost
#

Ugh

#

Help me too please

#

Hey. I need to crate channel and set premissions overwrites.

var overwrites = new ds.Collection;
        var memberPremissions = new ds.Permissions;
        var memberOverwrites = new ds.PermissionOverwrites;
        var everyoneOverwrites = new ds.PermissionOverwrites;

        memberPremissions.add("READ_MESSAGE_HISTORY");
        memberPremissions.add("VIEW_CHANNEL");
        memberPremissions.add("SEND_MESSAGES");

        memberOverwrites.allow = memberPremissions;
        everyoneOverwrites.deny = memberPremissions;

        overwrites.set(msg.guild.roles.everyone.id , everyoneOverwrites);
        overwrites.set(clanData.memberRole.id      , memberOverwrites);

        console.log(overwrites);

        msg.guild.channels.create(clanData.name, {type:'category', reason:'new guild', permissionOverwrites:overwrites});

sooo, there are error:

node:11828) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
permission_overwrites[0].id: This field is required
permission_overwrites[1].id: This field is required
    at RequestHandler.execute (D:\Projects\Maid\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:11828) 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:11828) [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.
earnest phoenix
#

or define it again
@abstract coyote if you define it again it will be a different instance of the same bot

abstract coyote
#

oh crap yeah

#

sorry lol!

earnest phoenix
#

@hybrid roost read the error please

#

it's literally explaining you why the error occured AND how to fix it

carmine summit
#

ofcores

hybrid roost
#

I am already read it

#

permission_overwrites[0].id: This field is required
permission_overwrites[1].id: This field is required

#

I know

carmine summit
#

have you defined clanData.name??????

hybrid roost
#

but where

earnest phoenix
#

the file path is above

#

with the line

hybrid roost
#

have you defined clanData.name??????
@carmine summit yep

carmine summit
#

@carmine summit yep
@hybrid roost Show me

hybrid roost
#
var clanData = {
            name: args[0],
            owner: funcs.getID(args[0]),
            ownerRole:  await msg.guild.roles.create({data:{name:args[0] + "'s leader", position:0}, reason:'new clan'}),
            memberRole: await msg.guild.roles.create({data:{name:args[0] + "", position:0}, reason:'new clan'}),
            rating : 0
        }

carmine summit
#

k

#

bye

#

erwin is here

opal plank
#

So, i got a big string with a couple constraints and this format
Name: <name>
Email: <email>
Subject: <text>
Message: <message>

Any cheesy and smart way to split that?
The fields can be multi line, so i cant split on \n alone.
thought of some loops with startsWith() 4 times and split('\n') with breaks and replaces but there has to be some better and more optimal way of processing that.
Anyone got any ideas?
https://cdn.discordapp.com/attachments/272764566411149314/768348857209323530/unknown.png

#

unfortunately due to the nature of the API, i only have access to the string and not the fields themselves before they are merged into a single output ASakashrug

slender thistle
#

Think regex might work?

opal plank
#

i was thinking about that too

#

match, clone it and then replace the original string match with empty string

#

but that also sounds like an unoptimized way[

#

and can fail if someone types in the wrong keyword at the wrong time

carmine summit
#

@hybrid roost Can you console overwrites

hybrid roost
#

I am already show it. And i understood my mistake

#

memberOverwrites.id = clanData.memberRole.id;
everyoneOverwrites.id = msg.guild.roles.everyone.id;

I've got to set role's ID in PremissionsOverwrites

carmine summit
#

righ

#

t

boreal iron
#

@opal plank Does the sender need to manually write Name:, Email: etc into the message?

opal plank
#

no

#

those are the fields inputted

#

what comes AFTER them, yes, is inputted by the user

#

but that format should always be the same

boreal iron
#

You said you wanna explode those 4 lines

opal plank
#

i need to parse them

carmine summit
#

str.split('\n')???

boreal iron
#

Hmm okay and what would you expect to fail (by the input side)?
Using an email which isn’t a real one etc?

opal plank
#

The fields can be multi line, so i cant split on \n alone.

#

theres no fail

boreal iron
#

Oh didn’t see that

opal plank
#

i need to extract the field inputs and parse them

#

i was thinking of split(\n) => for(let a in array) {
switch(a.startsWith()) {
case: name { doo thing// }
}
}

or perhaps a break for loop

carmine summit
#

str.replace(/\\n\\n/g, '\n')
??????

opal plank
#

regex seems like an option too, this isnt used as frequently where i would sweat with a non-greedy regex

#

@carmine summit are you trying to help me?

carmine summit
#

yes?

opal plank
#

the heck am i suppose to do with that?

carmine summit
#

idk

#

wdym by multiline?

boreal iron
#

Even then regex would take much longer since it checks each possibility

opal plank
#

replacing 2 consecutive newlines with a newline?

#

what?

#

yeah, thats why i was thinking about a for loop

slender thistle
#

which one of those can be multiline? just the message?

carmine summit
#

I thought what you mean by multiline is multiple newlines

slender thistle
#

or literally any field?

opal plank
#

technically all of them

#

while i doubt some dumb fuck would do that, i must not underestimate human stupidity

fluid basin
#

I hear regex blurry_eyes

boreal iron
#

lmao

slender thistle
#

Mm I do love my name entered as
Assanali
Mukhanov

opal plank
#

what is your name?
User:I am GhlUkish, the destroyer of worlds, the one who brings the ragnarok within the fortnight, he, whom with great power, will bring perish in the world

boreal iron
#

I guess what ur tried to do Erwin, but if the case wasn’t found in ur switch element it would mean to be a new line

fluid basin
#

uh @opal plank sample input & output?

#

I could write a quick simple regex

boreal iron
#

If so you would need to add the case to the previous field

opal plank
#

well yeah, my idea was to add add the line to a temporary string each iteration

#

so i'd be adding them until i find the next line, which then i'd remove them

boreal iron
#

Does it need to be a string?

opal plank
#

wdym?

boreal iron
#

Probably adding it an array and increasing the array key only if the case is not default

#

Would add a default case aka new line to the previous field

#

And at the end use the array to create the string

opal plank
fluid basin
#

ah

#

splitting and checking the start is pretty optimal imo

boreal iron
#

Let me get to the PC real quick

opal plank
#

the problem is multi lined fields

boreal iron
#

Gonna write an example

fluid basin
#

though there could be false positives

opal plank
#

thats why i was thinking of using startsWith()

#

split on newlines

#

even if someone has the word Message: in their fields, it'll be harder to pass as false positive in the beggining of a new line

fluid basin
#

but realistically name, email and subject shouldn't be multiline

opal plank
#

while i doubt some dumb fuck would do that, i must not underestimate human stupidity

carmine summit
#
name = str[0].replace('Name: ', '')
email= str[1].replace('Email: ', '')
subject = str[2].replace('Subject: ', '')
message = str[3].replace('Message: ', '')```No regex
#

ok bye

#

i feel dumb

opal plank
#

ah, yes, i see you took into account the multiline i said

untold ember
#

hello

#

Bot awaiting approval - Please be patient, we humans take time to verify bots!

#

??

opal plank
#

wait 8+ weeks

untold ember
#

when is it approved

opal plank
#

8+ weeks

#

next year

carmine summit
#

@opal plank Is it efficient?

untold ember
#

too much

opal plank
#

then bye

#

@carmine summit its wrong, so it wont work

carmine summit
#

yeah its wrong

#

What is wrong?

untold ember
#

ok i will wait

#

@opal plank

opal plank
#

multiline fields

carmine summit
#

wtf is multiline?

#

ah

opal plank
#

now what?

carmine summit
#

uh

boreal iron
#

Once again the user doesn’t input Name:, Email: string etc? Just “answers”

carmine summit
#

why not

#

'/nEmail: '

opal plank
#

yes, just answers @boreal iron

boreal iron
#

Ok writing...

opal plank
#

@carmine summit false positives

carmine summit
#

false postitives????

opal plank
#

Message: Please contact me at my work Email: something something

#

that'd catch it

carmine summit
#

BRUH

#

I ran out of ideas now

#

¯_(ツ)_/¯

opal plank
#

i got working code but its super long

carmine summit
#

paste

opal plank
#

hassle

#

i did what i told you

carmine summit
#

:<

opal plank
#

switch with startsWith

#

on default: append string to temporary string(account for multiline)

#

once it finds a match it pushes the temp string content onto the object and replace the original

gaunt scarab
#

who to verify if message author has role

#

?

opal plank
#
Name: some
name here
Email: some other email@here
but some idiot put another alt email here
Subject: How to do stuff like this
but there are too many newlines or a big ass text
Message: Well, this is
the easy part

Take that as input, and turn it into and object with the following format: ```js
{
name: '',
email: '',
subject: '',
message:''
}

Thats the goal
earnest phoenix
#

hi

#

whenever i give a command

#

why the mesage get deleted

carmine summit
#

(/\\nEmai: (.*)\\nSubject: /)
ehhhh???

#

right, you hate regex

boreal iron
#

ok don't nail me down on it but the direction should be a good one I guess

#
let result = { name: '', email: '', subject: '', message: '' };
let last_case;

split('\n') => for(let input in array)
{
    switch(input.startsWith())
    {
        case: 'name:'
            result.name = input;
            last_case = 'name';
            break;
            
        case: 'email:'
            result.email = input;
            last_case = 'email';
            break;
            
        case: 'subject:'
            result.subject = input;
            last_case = 'subject';
            break;
            
        case: 'message:'
            result.message = input;
            last_case = 'message';
            break;
            
        default:
            result.last_case = result.last_case + input;
            break;
    }
}```
#

@opal plank

tulip ledge
#

Is there a way to end a collector? Like collector.end?

fluid basin
#

collector.stop

earnest phoenix
#

why the command executed gets deleted?

#

pls tell

carmine summit
#

@boreal iron False positives?

opal plank
#

@boreal iron wouldnt last_case be fucked for every other field with newlines?

#

but yeah, you going on the same direction i was

boreal iron
#

New lines would not hit "case" in your switch, so they would hit the "default"

opal plank
boreal iron
#

And they would be added to the last case

opal plank
#

yes, but they all would be merged

boreal iron
#

Doesn't matter how much new lines there are

#

result.last_case = result.last_case + input; not sure if that's the correct method anyway

opal plank
#

yes, but you are not clearing it after iterations

#

or matches

#

actually you are

carmine summit
#

ok

#

this is too advanced for me

opal plank
#

hmmmm

#

lemme try something

boreal iron
#

huh why not?

#

yeah try it, I can't atm

#

still didn't understand, if the user is anwsering the questions, how do u trigger if he has to answer the next question?

slender thistle
#
myMap = new Map()
for (elem = 0; elem < l.length; elem++) {
    let fieldName = l[elem].split(": ")[0];
    if (["Name", "Email", "Subject", "Message"].includes(fieldName))
        myMap.set(fieldName, l[elem]);
Map(5) { Name"Name: Eee Aaa", Email"Email: yolo@gay.at", Subject"Subject: I'm alive", Message"Message: You are", undefined"undefined\nalready dead." }
boreal iron
#
  1. question: name
  2. question: email

How do you trigger if the client entered a name and wanna add another line, he still responses to the 1. question?

slender thistle
#

got a bit

earnest phoenix
#

any npm that you can add a image in a image to make image generations

fluid basin
#

canvas/canvacord

boreal iron
#

Think we have different understandings what he started with, lol, Shiv

opal plank
#

@boreal iron thats all returning from a form in HTML from a different API

boreal iron
#

ahhh okay

#

then it makes sense, thought u hammer it into Discord

opal plank
#

the forms they use dont have a limiter on newlines

#

its all a simply input form

boreal iron
#

okay, okay understood

opal plank
#

i got an idea that im trying

#

hopefully it should be fairly small

boreal iron
#

if so, my solution is not sweet but should work

#

U should problably check for result.message.length == max length

#

Not to abuse the system as spam

#

if needed

opal plank
#

yeah i'll do that after i parse it though

boreal iron
#

aye, after the switch

opal plank
#

cuz that'll be sent into embed form

#

so i need to check before sending it

boreal iron
#

oh yeah, then it's a good thing to check it

slender thistle
#

Hey Erwin

opal plank
#

sup

slender thistle
#
for (elem = 0; elem < l.length; elem++)
{
    let field = l[elem].split(": ");
    if (["Name", "Email", "Subject", "Message"].includes(field[0]))
    {
        myMap.set(field[0], field.slice(1).join(" "));
        var fieldName = field[0];   
}   
    else
        myMap.set(myMap.get(fieldName), myMap.get(fieldName) + "\n" + l[elem])
}
Map(5) { Name"Eee Aaa", Email"yolo@gay.at", Subject"I'm alive", Message"You are", "You are""You are\nalready dead." }
``` jackshit but may give you an idea
boreal iron
#

Just another idea I could give u is to use PHP to process ur HTML form, check and validate each value and send it to ur API after
since PHP is server-sided only, it can not be manipulated, like a maxlength="" tag in HTML field inputs for example

opal plank
#

its not my api nor my website though

#

thats the issue

#

i need to work with the output, thats about it

boreal iron
#

that would also solve ur issues with new lines as well

#

ahh ok

opal plank
#

i'll give that a try too @slender thistle

boreal iron
#

gonna get something to eat real quick, brb

gentle lynx
boreal iron
#

u may wanna report back if it works out or not

opal plank
#

aight

slender thistle
#

why the fuck is last fieldName Message

#

but I'm getting a You are key

#

referring to

myMap = new Map()
for (elem = 0; elem < l.length; elem++)
{
    let field = l[elem].split(": ");
    if (["Name", "Email", "Subject", "Message"].includes(field[0]))
    {
        myMap.set(field[0], field.slice(1).join(" "));
        var fieldName = field[0];
    }
    else
        myMap.set(myMap.get(fieldName), myMap.get(fieldName) + "\n" + l[elem])
}
console.log(fieldName);
console.log(myMap)
fluid basin
#

why the fuck is last fieldName Message
@slender thistle it is not?

slender thistle
#

js outputs Message as the last value

fluid basin
#

I think because splitting a not found string gives the original string back

#

yeah last field name should be message

unkempt marsh
#

how can i make that function async
@gentle lynx getDefense: async ID => {

gentle lynx
#

ty

opal plank
#

i got it

#

startsWith() switch() and a temp string

#

and some replaces sprinkled

#

ty @boreal iron @slender thistle @fluid basin

#

i see Name somehow got fucked

earnest phoenix
#

c
r
i
n

#

crin?

boreal iron
#

Well good it’s solved

fluid basin
#
const keys = ['Name:', 'Email:', 'Subject:', 'Message:'];
const out = str.split('\n').reduce((v , s) => { s.startsWith(keys[v.i + 1]) ? v.f[keys[++v.i]] = s.replace(keys[v.i], '') : v.f[keys(v.i)] += `\n${s}`; return v}, {f: {}, i: -1})```
boreal iron
#

Yeah I actually forgot to add \n behind the last_case +

fluid basin
#

wait this code might not work

earnest phoenix
#

How to know if messages are more than 14 days behind?

fluid basin
#

@opal plank mind trying my one uhem wait its two liner code?

umbral zealot
#

@earnest phoenix messages should have a timestamp/created at property depending on your library so you can tell

earnest phoenix
#

oh

#

i use discord.js

umbral zealot
#

Ok so message.createdAt and message.createdTimestamp are the properties you want

opal plank
fluid basin
#

but... but its shorter

opal plank
fluid basin
#

and I thought you wanted a shorter one >.>

opal plank
#

i'll give it a try in a bit

#

since format is the same, i'll change it afterwards

#

i wanna get a prototype going soon

earnest phoenix
#

Ok so message.createdAt and message.createdTimestamp are the properties you want
okok

#
let dateMasseges = message.createdAt - message.createdTimestamp > 14```
umbral zealot
#

uh... no you don't use both, you use one of them depending on what you need to do

#

they're both the same value, just different formats

earnest phoenix
#

ohh

#

ok

#
let dateMasseges = message.createdAt - message.createdTimestamp > 14```

this?

#

Bruh.

#

they're both the same value, just different formats

fluid basin
#

same but different, just like people

earnest phoenix
#

Nice example.d

boreal iron
#

What do wanna compare to each other? Message created time - current timestamp?

#

It would be current timestamp - message created time anyways, to be correct

earnest phoenix
#

same but different, just like people
hmmm

slender thistle
#

@opal plank

Name: yolo
I'm gay
Name: hi this is fake name

👀

boreal iron
#

hey, don't abuse my name

next flax
#
  setInterval(function(){
let statuses = [
`with tr!help | ${client.guilds.cache.size} Guilds `,
`with tr!help | ${client.users.cache.size} Users`,
"with tr!help or Mention Me"
]
let status = statuses[Math.floor(Math.random() * statuses.length)];
client.user.setPresence({
   activity: { name: status, type: "PLAYING" },
   status: "dnd"
});
}, 180000)
{
let vc = db.get(`vcchannel_${member.guild.id}`);{
if (!vc) return;  
channels.join(vc);
}
console.log(client.commands.size)

  console.log('I m ready to Go | Thunder is OP')
}
})```
opal plank
#

@slender thistle lul

next flax
#

why doesnt this vc thing work

fluid basin
#

thats why you should sanitise user input

earnest phoenix
#

Date.now() - message.createdAt so, that's true? @boreal iron

opal plank
#

ready doesnt emit guild @next flax

fluid basin
#

date.now is timestamp

#

createdAt is date

#

not a timestamp

boreal iron
#

huh idk djs, dunno if it's a string or timestamp

earnest phoenix
#

:/

boreal iron
#

message.createdAt

#

string or timestamp?

fluid basin
#

Date

boreal iron
#

oh lol he answered it already

next flax
#

ready doesnt emit guild @next flax
@opal plank is their anything i can do then?

boreal iron
#

then you have to use message.createdTimestamp

#

if that's an existing property

earnest phoenix
#

isn't that same thing

opal plank
#

@next flax dont use guild, guild doesnt exist there

boreal iron
#

assuming it is a timestamp as the name message.createdTimestamp says, not a string

next flax
#

so what? waitWhat

opal plank
#

just... dont use it

#

get guild from some other method

#

like client.guilds.cache

earnest phoenix
#

are you using qwerty keyboard HC_Thinking

fluid basin
#

you arent really supposedly to manipulate snowflakes directly

opal plank
#

which i do lmao

fluid basin
#

unless you really know what you're doing

opal plank
#

i convert snowflakes into timestamps manually

fluid basin
#

yeah but but

opal plank
#

for creation date

#

playing with bigInts is fun

fluid basin
#

conversion isnt manipulation btw

opal plank
#

well, yeah

#

though that requires manipulation

#

snowflake => creation timestamp has some annoying math involved

fluid basin
#

nah just shifting bits

opal plank
#

huh?

#

not even

next flax
#

client.channels.get(vc).join();

boreal iron
#

However (Date.now() - message.createdTimestamp) > xyz should be the right one u can go with @earnest phoenix

next flax
#

will be ok?

#

or try and see

opal plank
fluid basin
#

yeah i know

opal plank
#

its not just shifting bits though

fluid basin
#

just right shift 22 bits

#

and add epoch

opal plank
#

yeah

slender thistle
#

learning-csharp.might-be-super.fun
I'm dead

opal plank
fluid basin
opal plank
#

i absolutely hate Ts for this one

#

watch this

#

explain pls?

#

lower than es2020, is using esnext

fluid basin
opal plank
#

oh, and i imported the lib too manualy

#

just to check

#

still error'ing

fluid basin
#

lower than ES2020

surreal sage
#

I need ideas for a utility bot

opal plank
#

it IS 2020

fluid basin
#

yeah the specs are out

opal plank
#

esNext is at 2021 i think

#

actually

#

no, its in 2020

fluid basin
#

I need ideas for a utility bot
@surreal sage make it utilizable

surreal sage
#

what

next flax
#

is their a way by which bot will auto join voice channels when restarted

earnest phoenix
#

yes

fluid basin
#

yea

opal plank
#

get channel from cache

#

join()

#

ezpz

fluid basin
#

use events

#

aka ready

#

well

opal plank
#

on 'ready' => client.channels.get(id).join()

next flax
#

client.channels.cache.get(vc).join();
@next flax ?

opal plank
#

thats about it

fluid basin
#

yuh

next flax
#

but then

earnest phoenix
#

Yuh?

next flax
#

how will quick.db fetch those channels

boreal iron
#

u may wanna save the last vc the bot was in, if he has been moved into a different one for example (is that even possible in Discord) idk

#

short TeamSpeak flashback

long yew
#

does anyone know how to

#

Create a program in python that asks for the length and width of 2 rectangles then display the areas of the rectangles and stating which is larger.

next flax
#

u may wanna save the last vc the bot was in, if he has been moved into a different one for example (is that even possible in Discord) idk
@boreal iron no

fluid basin
#

math @long yew

boreal iron
#

alright, then it's not needed :D

next flax
#
  setInterval(function(){
let statuses = [
`with tr!help | ${client.guilds.cache.size} Guilds `,
`with tr!help | ${client.users.cache.size} Users`,
"with tr!help or Mention Me"
]
let status = statuses[Math.floor(Math.random() * statuses.length)];
client.user.setPresence({
   activity: { name: status, type: "PLAYING" },
   status: "dnd"
});
}, 180000)
{
let vc = db.get(`vcchannel_${member.guild.id}`);{
if (!vc) return;  
channels.join(vc);
}
console.log(client.commands.size)

  console.log('I m ready to Go | Thunder is OP')
}
})```

see this

long yew
#

math @long yew
@fluid basin but idk the code

fluid basin
#

then learn programming

long yew
#

i never did python before

#

only java script

#

and java

fluid basin
#

yeah learn python then

long yew
#

how does one learn it

fluid basin
#

i believe conditionals, IO are the basics of a language

long yew
#

this is for a homework

fluid basin
#

@slender thistle u have any good resources for this person?

#

I personally would recommend w3schools

slender thistle
#

uhhhhh

#

How much time do you have to hand the assignment in?

long yew
#

a few hours

pale vessel
#

lol

fluid basin
#

hey shiv I know what ur thinking

slender thistle
#

.....

fluid basin
#

spoonfeed bad

long yew
#

it is due today

#

lol

slender thistle
#

Not really, I don't mind helping out with a bit of spoonfeed

boreal iron
#

Feeling about to call the -dotpost command

tribal dove
#

is anyone over here a bot dev?

long yew
#

i did that earlier

bright meadow
#

yes

#

me

long yew
#

for another task

bright meadow
#

i mean

#

yes me i am bot dev

tribal dove
#

@bright meadow

long yew
bright meadow
#

no JDA

tribal dove
#

java?

long yew
#

hard stuff

slender thistle
#

Anyway, I assume you don't need error handling, so:

  1. Use the input function to require user input. Convert the results to float.
  2. I don't remember the formula for the area of a rectangle, so Google it and apply a bit of common sense. Save the areas in separate variables
  3. Use the areas variables and if statements. if area1 > area2: print("area1 is larger")
long yew
#

python

bright meadow
#

yes java

tribal dove
#

ok

fluid basin
#

anyone got uncensored hentai API? 👉👈
@hoary hill bruh

bright meadow
#

xd

long yew
#

Anyway, I assume you don't need error handling, so:

  1. Use the input function to require user input. Convert the results to float.
  2. I don't remember the formula for the area of a rectangle, so Google it and apply a bit of common sense.
    @slender thistle ok thanks
next flax
#

iara is discord partner cool

fluid basin
#

well theres the infamous nekos.life api

tribal dove
#

yes java
@bright meadow which bot did u make?

slender thistle
#

I may be able to help out with more details in case you are stuck

tribal dove
#

@bright meadow which bot did u make?

fluid basin
#

well theres the infamous nekos.life api

#

@long yew i see you have another task there

bright meadow
#

@bright meadow which bot did u make?
@tribal dove I made @earnest phoenix, @earnest phoenix, @Idle Pokémon#0461 and I'm hosting and contributing @earnest phoenix

next flax
#

is their a js package which provides 18+ uncensored content ?

#

no hentai

fluid basin
#

I guess google exists

#

plus apis are more common than packages

next flax
#

k

slender thistle
#

Are you familiar with SQL queries

#

why is Delphi yelling "missing operator" at me

fluid basin
#

what

#

I cant russian

#

XD

#

gimme the original query

#

@slender thistle

viral iris
#

hello

boreal iron
#

can you post the whole query string?

long yew
#

@long yew i see you have another task there
@fluid basin yea

viral iris
#

i transfer my bot to a team how do i remove it

next flax
#

u cant

slender thistle
#

well, all the crap between apostrophes but prepend SELECT * FROM my database_name WHERE

viral iris
#

@next flax me?

fluid basin
#

uh show coddum

long yew
#

width = float(input('Please Enter the Width of a Rectangle: '))
height = float(input('Please Enter the Height of a Rectangle: '))

Area = width * height
print("\n Area of a Rectangle is: %.2f" %Area)

#

i got that

#

done

#

for one rectangle

fluid basin
#

that isnt a complete query btw shiv

zealous sable
#

Yes @viral iris you cannot remove the bot from a team once you add it

slender thistle
#
    begin
        s:='';

        if (Checkbox1.Checked) and (Edit1.Text <> '') then
        begin
            s := s + z + 'Fio LIKE ''' + Edit1.Text + '%''';
            if (z = ' ') then z := ' AND ';
        end;


        if (Checkbox2.Checked) and (Edit2.Text <> '') then
        begin
            s:= s + z + 'Tab LIKE ''' + Edit2.Text + '%''';
            if (z = ' ') then z := ' AND ';
        end;

        if (Checkbox3.Checked) and (Edit3.Text <> '') then
        begin
            s:= s + z + ' nachisleno >= ' + Edit3.Text;
            if (z = ' ') then z := ' AND ';
            if (Edit4.Text <> '') then s := s + z + ' nachisleno <= ' + Edit4.Text;
            if (z = ' ') then z := ' AND ';
        end;

        if (Checkbox4.Checked) and (Edit5.Text <> '') then
        begin
            s:= s + z + 'dolg => ' + Edit5.Text;
            if (z = ' ') then z := ' AND ';
            if (Edit6.Text <> '') then s:= s + z + 'dolg <=' + Edit6.Text;
            if (z = ' ') then z := ' AND ';
        end;
    end;
    //ShowMessage('Select * from Zarabotnai_plata where '+s);
    Form1.ADOQuery1.SQL.Clear;
    Form1.ADOQuery1.SQL.Add('Select * from Zarabotnai_plata where'+s);
    Form1.ADOQuery1.Open;
fluid basin
#

@long yew yea, so do the second one now?

slender thistle
#

:^)

long yew
#

@long yew yea, so do the second one now?
@fluid basin idk how

slender thistle
#

it's "complete enough" in the other parts but not where I'm relying on Checkbox4

lean pike
#

Hi, Guys I have a question, are the bot apps that contain the Nsfw feature verefied or not

fluid basin
#

oh gosh

#

never build a sql query with unsanitised input

tribal dove
slender thistle
#

I couldn't give two fucks about sanitized input in this private project

#

maybe, just ask your question

fluid basin
#

ah lol

#

are you missing a space

#

after where

boreal iron
#

Not sure if that's strict mode, but there's a double space

slender thistle
#

err

viral iris
#

need help please
i transfer my bot to a team how do i remove it

slender thistle
#

I don't think so

zealous sable
#

You can’t

#

For the millionth time John

viral iris
#

but i won't

boreal iron
#

' AND ' + ' nachisleno >= '

zealous sable
#

What do you mean you won’t?

long yew
#
width = float(input('Please Enter the Width of a Rectangle: '))
height = float(input('Please Enter the Height of a Rectangle: '))
width2 = float(input('Please Enter the Width of a Rectangle: '))
height2 = float(input('Please Enter the Height of a Rectangle: '))

Area = width * height
Area2 = width2 * height2
print("\n Area of a Rectangle is: %.2f" %Area)
print("\n Area of a Rectangle is: %.2f" %Area2)```
#

this ok?

zealous sable
#

You CANNOT remove your bot from the team you added it to.

slender thistle
#

z is the AND part, FakE

fluid basin
#

as in, on the second last line

viral iris
#

@zealous sable what if i remove the team?

slender thistle
#

ah, no, no missing spaces

tribal dove
#

delete ur application

#

then remake it

fluid basin
slender thistle
#

z is by default a space, actually

fluid basin
#

owh

#

can you print s before executing it?

#

or log it

boreal iron
#

I do even see 2 spaces in ur error message

long yew
#

how do i make it say which is larger?

slender thistle
#

give me a second

boreal iron
#

' nachisleno

zealous sable
#

As webswinger said @viral iris I believe you will need to make a new bot application if you want it out of the team

viral iris
#

whyyyyyy

fluid basin
#

yup unfortunately

tribal dove
#

u wil not loose ur code

#

nothing much

slender thistle
#

do you think dolg <=5 might be invalid?

tribal dove
#

it will take 5mins

#

at max

fluid basin
#

maybe you can contact discord support

tribal dove
#

which will take more than 5 mins

fluid basin
#

nah <= is a valid operator

#

it might be missing the space

slender thistle
fluid basin
#

and that gives you the missing operator error?

slender thistle
#

mhm

#

only the dolg part

boreal iron
#

just make sure the spaces are set correctly:

Form1.ADOQuery1.SQL.Add('Select * FROM Zarabotnai_plata WHERE '+s);
s:= s + z + 'nachisleno >= ' + Edit3.Text;
if (Edit6.Text <> '') then s:= s + z + 'dolg <= ' + Edit6.Text;

slender thistle
#
        if (Checkbox4.Checked) and (Edit5.Text <> '') then
        begin
            s:= s + z + 'dolg => ' + Edit5.Text;
            if (z = ' ') then z := ' AND ';
            if (Edit6.Text <> '') then s:= s + z + 'dolg <= ' + Edit6.Text;
            if (z = ' ') then z := ' AND ';
        end;
#

I doubt spaces are the issue

boreal iron
#

just make sure the spaces are set correctly:

long yew
#
width = float(input('Please Enter the Width of a Rectangle: '))
height = float(input('Please Enter the Height of a Rectangle: '))
width2 = float(input('Please Enter the Width of a second Rectangle: '))
height2 = float(input('Please Enter the Height of a second Rectangle: '))

Area = width * height
Area2 = width2 * height2
print("\n Area of the Rectangle is: %.2f" %Area)
print("\n Area of the second Rectangle is: %.2f" %Area2)
#

how do i compare them to find out if area or area2 is bigger?

slender thistle
#
Fio LIKE 'uwu%' AND Tab LIKE 'owo%' AND nachisleno >= 2 AND nachisleno <= 5 AND dolg => 1 AND dolg <= 7
#

this is the final string used as a filter

fluid basin
#

just read it

slender thistle
#

AAAAAAAAAAA USE F-STRINGS OR .FORMAT

long yew
#

OHHHHHHH

boreal iron
#

just make sure the spaces are set correctly:

Form1.ADOQuery1.SQL.Add('Select * FROM Zarabotnai_plata WHERE '+s);
s:= s + z + 'nachisleno >= ' + Edit3.Text;
if (Edit6.Text <> '') then s:= s + z + 'dolg <= ' + Edit6.Text;

Just added a space after WHERE since a string is required anyways or the query will fail
Space before nachisleno >= doesn't make sense anyways it in this example
And the one you solved by dolg

long yew
#

thanks so much

slender thistle
#

the query won't fail for that, FakE

#

z is set to a space by default and it's appended at first

boreal iron
#

oh alright, didn't see that

#

yeah, saw it now

slender thistle
#

inb4 there's some unknown to god zws

boreal iron
#

didn't notice this fact, because I dont see u have defined z anywhere to be a whitspace

slender thistle
#

... which isn't the issue

#

ah yeah, forgot to copy that part

boreal iron
#

GOT YOU!!

slender thistle
boreal iron
#

The russian error message said something about an irregular syntax (xxx operator) ...

slender thistle
#

not irregular

#

missing operator

boreal iron
#

did the missing space in dolg solve the issue now?

restive furnace
#

just make sure the spaces are set correctly:

Form1.ADOQuery1.SQL.Add('Select * FROM Zarabotnai_plata WHERE '+s);
s:= s + z + 'nachisleno >= ' + Edit3.Text;
if (Edit6.Text <> '') then s:= s + z + 'dolg <= ' + Edit6.Text;
@boreal iron use prepared statements, thank you

slender thistle
#

Negative

boreal iron
#

what does the finished query look like if the error occours?

slender thistle
#
Select * from Zarabotnai_plata where dolg => 2 AND dolg <= 5
long yew
#
width = float(input('Please Enter the Width of a Rectangle: '))
height = float(input('Please Enter the Height of a Rectangle: '))
width2 = float(input('Please Enter the Width of a second Rectangle: '))
height2 = float(input('Please Enter the Height of a second Rectangle: '))

Area = width * height
print("\n The Area of the first Rectangle is: %.2f" %Area)
Area2 = width2 * height2
print("\n The Area of the second Rectangle is: %.2f" %Area2)

if Area > Area2:
  print(" The area of the first rectangle is bigger than the second")

if Area2 > Area:
  print(" The Area of the second rectangle is bigger than the first")```
boreal iron
#

Oh found the issue

long yew
#

finshed it

#

shivaco is it correct?

boreal iron
#

hehe gimme a second to show u

slender thistle
#

shivaco is it correct?
@long yew did you try it?

long yew
#

yea

#

how do i make the spacing neater?

boreal iron
#

@slender thistle dolg = INT ?

slender thistle
#

Remove the space after \n (newline) in the strings

#

yup, dolg is int

boreal iron
#

ok yeah found it, one sec

long yew
#

ty

boreal iron
#

@slender thistle

#

Select * from Zarabotnai_plata where dolg => 2 AND dolg <= 5

#

It should be >= not =>

#

Wrong operator

slender thistle
#

I want to kill the person who wrote it

boreal iron
#

s:= s + z + 'dolg => ' + Edit5.Text;
to
s:= s + z + 'dolg >= ' + Edit5.Text;

next flax
#

i saw this

#

before a few min

#

in a server

slender thistle
#

ahhhhh

#

it workssss

#

thanks mate

boreal iron
#

Now reveal my bot!

#

Or I'm gonna delete my answer

#

And you dont know the solution

slender thistle
#

Declined for banned owner mmLol

boreal iron
earnest phoenix
#

Anybody play Growtopia Private Server??

boreal iron
#

anyways, sometimes it's such a small thing...

slender thistle
#

wrong server to look for help with that server anyone familiar with it

#

ikr, I was stuck on this for hours already

reef carbon
#
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.
```I'm getting internet server error when I try running my django app with apache2. Does anyone know why?
boreal iron
#

know how that feels,

sudden geyser
#

[git] I have this Rust file I'd like to commit to git, but in the file, I:

  • Added missing documentation.
  • Created a macro to follow DRY - don't repeat yourself.
  • Edited some output text to include the maximum number of something (x/y => 79/100).

The issue isn't necessarily the source code, but rather how to write a good commit message. Should I try breaking the changes into separate commits? Should I try being more abstract on the subject line (for the changes), then explaining the other changes in the body?

For reference, I've been reading this guide on how to write a good git commit message: https://chris.beams.io/posts/git-commit/.

boreal iron
#

More information about this error may be available in the server error log. What does the apache error_log say?

reef carbon
#

let me check

long yew
#

The staff at a local company raise money for charity. The company will top up any money raised using the following rules:
• Any money raised less than £1000 gets a £100 bonus
• A value between £1000 and £2000 will get doubled
• For any value over £2000 the first £2000 is doubled.
Create a program that will ask for the amount raised and display the bonus added and the new total raised.

#

anyone know what to do?

reef carbon
sudden geyser
#

@long yew it's just simple math

slender thistle
#

@sudden geyser

Should I try breaking the changes into separate commits?
It would be easier to keep track of the changes in separate commits, in my opinion, and that's more convenient in my cases

sudden geyser
#

if less than 1k, bonus is 100. If between 1k and 2k, multiply. If over 2k, return 2k

long yew
#

if less than 1k, bonus is 100. If between 1k and 2k, multiply. If over 2k, return 2k
@sudden geyser im not good at python

sudden geyser
#

Read up on if conditions and basic operators like the multiply one (*). The assignment is to create a program to solve the problem, so it wouldn't be good if I were to give you a demonstration.

long yew
#

ok

#

thanks

slender thistle
#

Again, apply input, but this time convert it to int datatype

#

Then once you do that, apply if statements (conditions)

boreal iron
#

Instead of explaining u what's written on the website, just Google, wsgi no module named encodings which should solve ur issue quickly

#

stackoverflow should contain ur solution

slender thistle
#

Interesting

fluid widget
#

way i cant add my bot to any server

sudden geyser
opal plank
#

okay, legit wtf

#

doesnt axios use data as body?

sudden geyser
#

I think so

boreal iron
#

Probably Presence Intent or Server Members Intent : NOTE: Once your bot reaches 100 or more servers, this will require Verification and whitelisting.

opal plank
#

can someone explain how the f postman does whats its suppose to but axios doesnt? i assume data is the body of the request, but aparently not

restive furnace
#

don't use axios wesmart

viscid gale
#

basically

reef carbon
#

@boreal iron Do you know what's causing my issue?

opal plank
#

yeah its suppose to be data

#

wtf

boreal iron
#

Haven't got it post my data to my PHP file, too, just got a 400 bad request, too

#

idk, axios sucks

slender thistle
viscid gale
#

wow

#

that url lmfao

opal plank
#

axios definetly work

viscid gale
#

yea but differently to what u think

fluid basin
#

why do people use axios so much

earnest phoenix
opal plank
#

i think i got over 100 requests coded in my bot with it

#

axios is good

fluid basin
#

theres like node-fetch

opal plank
#

though im clearly doing some dumb shit

viscid gale
#

why do people use axios so much
@fluid basin i have no clue

fluid basin
#

which is great if you're coming from browser

viscid gale
#

there is node fetch indeeeeeeed

earnest phoenix
viscid gale
#

also xmlhttprequest is long but intuitive to me :l

opal plank
#

anyway

fluid basin
#

snekfetch

boreal iron
#

theres like node-fetch

Uh... good idea tho, gonna test it out

fluid basin
#

@opal plank did you check axios docs

opal plank
#

right here

still cliff
#

👀

fluid basin
#

examples may be wrong/misleading sometimes

#

wait wtf it doesn't have an api reference

#

nanitf

earnest phoenix
fluid basin
#

well...

#

this is what I see though

#

axios.post(url[, data[, config]])

opal plank
#

welp

#

aparently you arent suppose to use data for the message payload

#

nothing to do with the axios docs

slender thistle
fluid basin
#

they don't say how is data serialised

#

whats the full error message even

opal plank
#

its not axios fault

#

its mine

boreal iron
#

axios.post(url[, data[, config]])

opal plank
#

i know

boreal iron
opal plank
#

data doesnt need to be in there

boreal iron
#

aye

fluid basin
#

well yeah

#

I saw

boreal iron
#

did add that wrongly as well

#

life can be easier sometimes not being lazy lel

fluid basin
#

so I assume it is working now? @opal plank

opal plank
#

yeah

#

data should not have been there

fluid basin
#

if you want data to be there, you have to follow the full syntax

#

like method and url both in the object

quartz kindle
#

i dont get why people like axios

opal plank
#

cuz its gud

#

all the cool kids use axios

fluid basin
#

lol tim same

#

all cool kids use request

quartz kindle
#

cool kids use bent

#

:^)

fluid basin
#

ah yes bent

opal plank
#

||people who use request are outdated and also like using var, you prehistoric mofos||

boreal iron
#

That's racist, give axios a chance, too!

fluid basin
#

nah

boreal iron
#

just because it's uglier

fluid basin
#

request has the good thing of auto-converting the response to the intended type

#

and plus it supports chunks and compression

quartz kindle
#

90% of the time you will be using these libs to interact with a specific api or service

#

therefore its much better to write purpose specific code

fluid basin
#

although bent's response type/status checker seems kinda weird to me

#

well its great for consuming apis where the response is known

opal plank
#

not generally my case, i use axios for tons of different apis

fluid basin
#

but not really for scraping/reading site data

opal plank
#

theres twitch, oauth, discord, my own api, localhost requests, some janky af shit i found out while digging for trash api, and some others

bleak crypt
#

Im looking for a bot that selecting a random voice channels (with a user in it). For a different way to giveaway to people.

earnest phoenix
#

i heard top.gg was a place to find bots

vocal sluice
#

Im looking for a bot that selecting a random voice channels (with a user in it). For a different way to giveaway to people.
@bleak crypt search it up on the website

sick fable
#

raise TypeError('Callback is already a command.')
TypeError: Callback is already a command.

[Program finished]

#

Wtf is this?

opal plank
#

@earnest phoenix it....is....though....

earnest phoenix
#

sarcasm

bleak crypt
#

@vocal sluice I can not find a bot that does this

opal plank
#

oh, i didnt see the msg above

slender thistle
#

show your code Sloth

opal plank
#

@bleak crypt #development is probably not the right place to look for bots

sick fable
#

show your code Sloth
@slender thistle ok

bleak crypt
#

How much does it cost to code your own bot?

sick fable
#
@commands.has_permissions(manage_channels=True)
async def lock(ctx, channel: discord.TextChannel = None):
        channel = ctx.channel
        overwrites = {ctx.guild.default_role: discord.PermissionOverwrite(send_messages=False)}
        await channel.edit(overwrite=overwrites)
        await ctx.send("Succesfuly Locked the channel!")```
slender thistle
#

You can learn coding for free

sick fable
#

Wait

bleak crypt
#

I prefer someone code it for me. How much would it cost me?

sick fable
#

I foun an error

slender thistle
#

-hardrequest

gilded plankBOT
#

You seem to have asked for a very specific bot/feature. You likely won't find it on the site if you haven't searched already. You can try and put a request on Fiverr or Freelancer.

opal plank
#

or if you feel like being countless hours of pain, selflearning is an option

slender thistle
#

depends on what type of features you want and how much the developer is willing to charge.

sick fable
#

I prefer someone code it for me. How much would it cost me?
@bleak crypt for me it would cost me for a nitro classic

#

And what's type of features you want?

#

@slender thistle help meee

bleak crypt
#

@sick fable Plenty of different features

sick fable
#

@bleak crypt Like?

bleak crypt
#

@sick fable Just a moment..

slender thistle
#

I foun an error

doesn't explain what the other error was

help meee

sick fable
#

😳

#

I really don't know what the first error was

slender thistle
#

Are you sure that's the part that errors out

#

send full traceback

sick fable
#

K

#

raise TypeError('Callback is already a command.') TypeError: Callback is already a command.

[Program finished]

#

That's it

bleak crypt
#

@sick fable First of all. How much would it cost to host a discord bot?

slender thistle
#

is that all

#

wtf

sick fable
#

Lol wait

opal plank
sick fable
vocal sluice
#

lol

boreal iron
#

What the environment variable to load a ca cert in nodejs?

sick fable
#

@sick fable First of all. How much would it cost to host a discord bot?
@bleak crypt it would cost around two dollars a month and I found one website which host's bot for free

umbral field
#

proly scam tbh

#

to good to be true

abstract coyote
#

Don't do free hosts, they are unreliable and can steal data like your token.

umbral field
#

yep

#

if you have a spare pc just set up a vps

abstract coyote
#

Check out something like Pebblehost

#

they got a very cheap discord host

#

or yeah a vps

sick fable
#

Oh

abstract coyote
#

you can also host other projects with the vps

umbral field
#

ye

abstract coyote
#

i think ReviveNode has a pretty cheap vps

sick fable
#

raise TypeError('Callback is already a command.')
TypeError: Callback is already a command.

Anyone gonna help me or nah? 😦

abstract coyote
#

show code?

slender thistle
#

show your full code

umbral field
#

is Callback a var

slender thistle
#

If you are unsure you can help, please don't blindly guess

sick fable
#

show your full code
@slender thistle bruh, that's what I just sent previously

slender thistle
#

one command isn't full code

umbral field
#
@commands.has_permissions(manage_channels=True)
async def lock(ctx, channel: discord.TextChannel = None):
        channel = ctx.channel
        overwrites = {ctx.guild.default_role: discord.PermissionOverwrite(send_messages=False)}
        await channel.edit(overwrite=overwrites)
        await ctx.send("Succesfuly Locked the channel!")```

@sick fable this?

abstract coyote
#

if the code is too big, put it in a pastebin

sick fable
#

My codes reach 500 lines above

#

@umbral field yes

umbral field
#

ok

sick fable
#

My codes reach 500 lines above
@sick fable @slender thistle

slender thistle
#

if the code is too big, put it in a pastebin

vocal sluice
abstract coyote
#

if the code is too big, put it in a pastebin

sick fable
#

Lmaoo k

umbral field
#

this is proly a stupid question but in my index.js where would i put this code
client.user.setActivity('-user_invite', { type: 'PLAYING' }).catch(console.error);
doesn't it go after the first console.log?

sick fable
#

@slender thistle dm'ed

#

Just check it out and let me know the errors by dm'ing me

slender thistle
#

line 86

abstract coyote
#

btw sloth if ur token is in there thats not very smart

sudden geyser
#

It would be easier to keep track of the changes in separate commits, in my opinion, and that's more convenient in my cases
@slender thistle the only issue I see with breaking up commits is if the code doesn't work because of it / is outdated.

sick fable
#

@slender thistle k

slender thistle
#

You applied the command decorator twice

sick fable
#

Oh

#

Thanks carry_writtenheart

#

I fixed it

slender thistle
#

@slender thistle the only issue I see with breaking up commits is if the code doesn't work because of it / is outdated.
@sudden geyser Well, most of the time I apply changes regarding one feature/issue (say, fixing a random error), save a commit, apply other changes, then apply another commit to ensure they are "separated"

boreal iron
#

hey shiva, may you can help me right now...

slender thistle
#

Take my opinion with a grain of salt, though. I don't use Git enough to really deem my opinion "correct enough"

boreal iron
#

reason: unable to verify the first certificate do you know how to set the cacert.pem in nodejs, the environment var doesn't exist

slender thistle
#

in nodejs
I'm out xd

#

Not familiar with node.js at all

boreal iron
#

Can translate the error into russian if that helps KEKW

slender thistle
#

I speak English well enough to understand it KEKW

boreal iron
#

nvm will find out somehow

umbral field
#

node.js is not understandable to you... pretty ez ngl

barren cipher
#

Hi,
My bot got approved today but when I search my bot's name in the search tab my bot dosent shows up

fluid basin
#

search seems broken

open rune
#

really?

#

I search for mudae and I got it

#

@barren cipher maybe you can find it manually on "New bot" tab

#

OMG WRONG MENTION

long yew
#

how does one do that

tulip ledge
#

So I'm working on this way to fight mobs, now I have this issue, the fighting sequence is handled in a FightHandler (wich is a class) the class is called when the command is called. Now ofcourse I don't want multiple fights in the same channel or multiple fights by the same user thats why I have this piece of code at the top of my fight command

    if(this.client.activeUsers[message.author.id]) return message.channel.send("You already have a fight running, please end the fight before starting a new one.")
    if(this.client.activeChannels[message.author.id]) return message.channel.send("Couldn't find any monsters in this channel, try a different one.")

Now the issue is, if they do the fight command to start their battle everything goes fine, but when they do the command again it stops collecting messages for their previous fight, making it so they can't end the fight. This probably has to do with the return keyword but I don't know a different way to do it, does anyone have a solution?

sudden geyser
#

how does one do that
@long yew do what, the screen clipping tool?

long yew
#

what is wrong with that

#

@long yew do what, the screen clipping tool?
@sudden geyser the question but i read it wrong

wary flame
#

Convert string to int before trying to use it as int

#

input returns a string

#

You cant compare a number with a string

long yew
#

fixed?

wary flame
#

Probably

long yew
#

ok thanks

#

have any clue how i can do the rest?

faint prism
#

Are you all doing his homework? lol

slender thistle
#

not specifically float

#

you can use int

#

Apply common sense please

faint prism
#

when dealing with money, you'll typically use a high-percision floating value

long yew
#

i dont know python

#

i dont even know what int means

slender thistle
#

to see if x is between 1000 and 2000 you can use the mathematical equivalent

faint prism
#

integer

#

means whole-number

#

float means floating-percision. Basically the ... part in 3.1415...

#

Since a computer can't store something that repeats infinitly

long yew
#

ohhh

faint prism
#

So it is precise up to how ever you want it to be

slender thistle
#
>>> l = []
>>> x = 0.1
>>> while x <= 1:
...     l.append(x)
...     x += 0.1
...
>>> l
[0.1, 0.2, 0.30000000000000004, 0.4, 0.5, 0.6, 0.7, 0.7999999999999999, 0.8999999999999999, 0.9999999999999999]
#

Float precision!

faint prism
#

how many bits does py use for precision?

#

ig I could google it

#

oh a double

long yew
#

wow

#

so is that wrong?

slender thistle
#

right

faint prism
#

because and < b but what is b less than? You don't specify

slender thistle
#

a < x < b

returns True if a < x and x < b

#

use that knowledge to your advantage

long yew
tulip ledge
#

So I'm working on this way to fight mobs, now I have this issue, the fighting sequence is handled in a FightHandler (wich is a class) the class is called when the command is called. Now ofcourse I don't want multiple fights in the same channel or multiple fights by the same user thats why I have this piece of code at the top of my fight command

    if(this.client.activeUsers[message.author.id]) return message.channel.send("You already have a fight running, please end the fight before starting a new one.")
    if(this.client.activeChannels[message.author.id]) return message.channel.send("Couldn't find any monsters in this channel, try a different one.")

Now the issue is, if they do the fight command to start their battle everything goes fine, but when they do the command again it stops collecting messages for their previous fight, making it so they can't end the fight. This probably has to do with the return keyword but I don't know a different way to do it, does anyone have a solution?

queen crescent
#

how can i put these panels on different rows if they dont fit inline on the viewers screen?

barren cipher
#

@barren cipher maybe you can find it manually on "New bot" tab
@open rune try searching Zhane

sacred cypress
#

@queen crescent
If you use flexbox (display: flex;) you can wrap them in flex-wrap: wrap that way if the it doesn't fit the screen it will switch to column format

queen crescent
#

ty

sacred cypress
tulip ledge
#

anyone knows a solution for my issue?

queen crescent
#

pc it shows all 3

sacred cypress
#

Have you tried using element inspect to see where the fuck the other 2 panels went?

queen crescent
#

there not there at all

sacred cypress
#

My first assumption would be that you have fixed height on the panel-container and so it won't allow them to fit under each other because of that.

#

But, use devtools, they exist for a reason

queen crescent
sudden geyser
#

Now the issue is, if they do the fight command to start their battle everything goes fine, but when they do the command again it stops collecting messages for their previous fight, making it so they can't end the fight. This probably has to do with the return keyword but I don't know a different way to do it, does anyone have a solution?
@tulip ledge are you removing the user from the object once the fight is over, or is nothing happening? If it had something to do with returning, it would send a message in the channel like the code you shared.

open rune
#

@barren cipher ok

#

got it

queen crescent
sacred cypress
#

Your page has a max height

#

Remove it

queen crescent
#

thats part of the header

#

still doesnt work without it

sacred cypress
#

And ill take a look

queen crescent
#

can i send u the domain instead so u can view source?

pale vessel
#

yes

earnest phoenix
queen crescent
earnest phoenix
#

is there any free hosters with a glitch bot

tulip ledge
#

@sudden geyser I don't think u get what I'm doing, yes I'm removing the user and channel from the object the return is whenever you do a second fight. So basically doing !fight works, but if u do !fight again before the first fight is done it returns sending the message and that makes it so u can't finish ur previous fight

sudden geyser
#

I understand now, can you share your source code via hastebin

jovial nexus
#

huh

tulip ledge
#

mmmh... I'm rlly protective of my code

jovial nexus
#

why is this happening?

sudden geyser
#

If you don't want to share, that's fine. It's just harder to help.

queen crescent
#

@sacred cypress oh yh i fixed it but for some reason the cards are massive now

sudden geyser
#

Anyway, the fight being left in an undefined state (doing !fight before the second fight makes it so the user can't finish the first) is likely due to what you were saying about returning early. However, I can't see your source code to figure out where it's coming from. Some where in your code base, you're exiting the scope and not allowing to listen for more messages. One example would be returning in the outer scope rather than in the collector listener.

tulip ledge
#

so should I return in the collector?

#

doesn't work

quartz kindle
#

you're doing something that is affecting the state of the previous fight before the return line

tulip ledge
#

Tim, I trust u can I send u my source code in DM's?

quartz kindle
#

ye

jovial nexus
quartz kindle
#

close code 1000 is a generic error, aka "unknown error"

#

usually is something wrong with the connection

#

nothing you can really do about it

jovial nexus
#

so it reconects with no reason?

quartz kindle
#

@tulip ledge do this: start a fight, then send any message that is not one of the fight moves

#

then try using a fight move

#

does it still work?

tulip ledge
#

lemme try

#

Oh no it doesnt lol

quartz kindle
#

you set isProcessing to true in the collector, then if the message is not a fight move, it returns, but the isProcessing is never reset back to false

tulip ledge
#

oh wow yeah

#

It's working now 😄 thank you so much! ❤️

#

You always amaze me, your brain is literally on a different level lol

quartz kindle
#

lmao

modest smelt
modest smelt
#

ok

pale vessel
fervent goblet
#

so i have a music bot written with Discord.js. I want my bot to remain the VC for a short period of time instead of leaving. How do i make stay?

untold sand
zealous sable
#

no

vast shell
#

no

misty sigil
#

No

#

its shit

fervent goblet
#

question: So i have a music bot written with Discord.js. I want my bot to remain the VC for a short period of time instead of leaving. How do i make stay?

 async play(guild, song, message) {

        const serverQueue = await this.queue.get(guild.id);

        if (!song) {
            let leaveEmbed = new MessageEmbed()
                .setTitle("Queue Empty")
                .setDescription("I left the voice channel because no one played a song.")
                .setColor("PURPLE")
            message.channel.send(leaveEmbed);
            this.manager.destroy(guild.id);
            this.queue.delete(guild.id);

currently i have this it immediately leaves

zealous sable
#

Code the bot yourself

stoic girder
#

Yep, there's a million of tutorials.

untold sand
#

But I dont where I can start learning python :C

zealous sable
stoic girder
zealous sable
#

https://discord.js.org/#/ - javascript (if u want to use js)

untold sand
#

Ty guys ❤️

zealous sable
#

🙂

untold sand
#

What its more easy, python or js

upper belfry
#

İ cant do my bot pls help!!!

drowsy socket
native quiver
#

I am hosting on something.host and it keeps saying "<p>The owner of this website (discord.com) has banned you temporarily from accessing this website.</p>"

zealous sable
#

I would always say use JavaScript

#

But thats just personal preference

#

@native quiver Sounds like you need to contact something.host

native quiver
#

ok

upper belfry
#

İ dont now what is Java script

zealous sable
#

@upper belfry Please explain further your issues

stoic girder
#

@upper belfry do you have any experience with programming in general?

upper belfry
#

İ am turkish bro i cant understand so much 😂

#

My English is meh

zealous sable
#

You need to be able to use a coding language to code a bot.

drowsy socket
#

If i use python or something like discord.py , my computer just gonna say “ err pip (and something else that i forgot the name ) doesn’t exists blbl

untold sand
#

I am hosting on something.host and it keeps saying "<p>The owner of this website (discord.com) has banned you temporarily from accessing this website.</p>"
@native quiver Oh, dont worry. Aris it's trying to fix this. He will buy another hosting service.

native quiver
#

ok

#

i guess i should use repl.it for the time being

zealous sable
#

@drowsy socket You need to install python onto your computer

untold sand
#

i guess i should use repl.it for the time being
@native quiver repl.it its a 💩

upper belfry
#

Mmmmm..... Ok .....i cant finded the answer so...ok...

drowsy socket
#

I tried but the situation is complicated to explain

upper belfry
#

İs there translate or something?

zealous sable
stoic girder
#

@upper belfry Basically you need to learn a language like Javascript or Python. There is a million of tutorials online for free. Maybe even in your language.

zealous sable
#

Not sure tho

#

Install python there @drowsy socket

drowsy socket
#

I have a question about the ping on #support . Am i allowed to use ghostbot for my bot ? I don’t understand the ping about the “ clone “

zealous sable
#

Clone means you cannot copy the code of another bot

stoic girder
#

@upper belfry Temel olarak Javascript veya Python gibi bir dil öğrenmeniz gerekir. Ücretsiz olarak çevrimiçi olarak bir milyon öğretici var. Belki kendi dilinizde bile.

upper belfry
#

What is javaScript and Python

stoic girder
#

ez google translate

zealous sable
#

For example if I made an exact copy of MEE6 etc

#

Or someone elses bot

stoic girder
#

they're programming languages

drowsy socket
#

Clone means you cannot copy the code of another bot
@zealous sable oh okay

stoic girder
#

for

#

programming

#

duh

upper belfry
#

Thank you brooo

stoic girder
#

np

native quiver
#

@native quiver repl.it its a 💩
@untold sand wdym

untold sand
#

Btw, there are Spanish python/js tutorials ??

zealous sable
#

Im sure youtube will have some

untold sand
#

Ty

modest smelt
#

would this be correct syntax: @has_permissions(manage_channels = True)?

stoic girder
#

@untold sand Well generally all free hosting solutions aren't the best. Repl.it/Glitch will work but if you need something more serious, you'll need to pay.

modest smelt
#

I use aws for free

stoic girder
#

Depending on your knowledge you could get a server that's ready for Discord bots, or a VPS which you can customize to your liking.

modest smelt
#

would this be correct syntax: @has_permissions(manage_channels = True)?

slender thistle
#

NO

stoic girder
#

@modest smelt AWS has a 12 month trial or there's some really free plan?

drowsy socket
#

Oop-

slender thistle
#

YouTube videos for Discord bots

#

please no

modest smelt
#

would this be correct syntax: @has_permissions(manage_channels = True)?

drowsy socket
#

Sorry-

modest smelt
#

can someone please help me.

slender thistle
#

yes it would

modest smelt
#

ok