#development

1 messages · Page 1319 of 1

next flax
#

hm

#

is repl.it and uptime robot a good combo for hosting a big discord bot

#

like which is in 100 servers

earnest phoenix
#

no

#

repl is a testing environment

#

At best it's good for hosting smol stuff

next flax
#

how to fetch music from sound cloud

#

nd how to make afk command

earnest phoenix
ivory seal
#

hi my code is

        {max: 1, time: 30000}).then(collected => {
                // only accept messages by the user who sent the command
                // accept only 1 message, and return the promise after 30000ms = 30s

                // first (and, in this case, only) message of the collection
              let giveawatchannel = collected.mentions.channel.first()
               console.log(giveawatchannel);
                        
            })```
I am trying to get userinputs like a prompt, this gives me a error saying ``Cannot read property 'channel' of undefined``
earnest phoenix
#

@ivory seal collected.mentions is undefined

#

collected is a collection not a normal message iirc

#

So do collected.first() if you want the first message from the collectiob

#

The collector has a limit of one message so you're 100% sure that the first element in the collection is the only message

ivory seal
#

yes

earnest phoenix
#

You're directly doing collected.mentions there mate

ivory seal
#

oh what should i do otherwise

earnest phoenix
#

literally what i said

#

collected => collected.first()

#

channel => channels

ivory seal
#

ok but i want to get a channel

earnest phoenix
#

read my messages again

ivory seal
#

im not sure i understand

#

let giveawatchannel = collected.first()

earnest phoenix
#

{max: 1, time: 30000} => { max: 1, time: 30000, errors: ["time"] }

next flax
#

how to fetch music from sound cloud

ivory seal
#

wait so i should change errors?

earnest phoenix
#

@ivory seal just add what we said, not replace the whole thing

next flax
#

nd how to make afk command

earnest phoenix
#

@next flax soundcloud has an API iirc

next flax
#

name

earnest phoenix
#

idk

#

Google

#

you won't believe it

#

SoundCloud API

rapid canopy
#

name
@next flax alo

pale vessel
#

it's closed for now iirc

next flax
pale vessel
#

that's just the package

next flax
#

u own chip right

#

@pale vessel

pale vessel
#

no

#

that would be kyoso

misty sigil
#

reminds me of that one spy line

young flame
#

that moment discord updates

tacit sundial
#

is the opportunity to get early verified badge over?

young flame
#

hmmmm?

slender thistle
#

Yes

earnest phoenix
#

@earnest phoenix hi

#

You need to specify the main file

#

In the package.json

#

then only node . will work

next flax
#

my bot is going offline after 2-3 min on repl.it i hosted on uptime robot too

earnest phoenix
#

i dont have much experience with repl.it but i do know it's a free host

#

free hosts are very unreliable

next flax
#

code went offline he know much about repl.it

misty sigil
#

don’t use free hosting

earnest phoenix
#

^^^

#

take a look at pins for some suggestions

misty sigil
#

see the pins in here

young flame
#

code went offline he know much about repl.it
@next flax i mean

#
  1. if your gonna use free hosting please find a detailed video on it
  2. if your "free hosting" failed then use a legitimate way of hosting
earnest phoenix
#

my bot is going offline after 2-3 min on repl.it i hosted on uptime robot too
@next flax try fixing the errors

next flax
#

their arent

#

any

earnest phoenix
#

then use something legit ig

young flame
#

yes there is

#

lol

earnest phoenix
#

I personally use heroku but it isn't too good

next flax
#

code said uptime robot is good for pinging replit every 5 minutes

misty sigil
#

The error is using free hosting

earnest phoenix
#

gives only 500 mb :(

next flax
#

I personally use heroku but it isn't too good
@earnest phoenix its paid now

misty sigil
earnest phoenix
#

@earnest phoenix its paid now
@next flax nope I added my credit card so it's free

young flame
#

code said uptime robot is good for pinging replit every 5 minutes
@next flax its supposed to be set to 25

next flax
#

@next flax nope I added my credit card so it's free
@earnest phoenix noice

young flame
#

but oki

misty sigil
#

i have a feeling they’re gonna steal your money if you use too much resources

earnest phoenix
#

But the saddest part it gives only 500 mb ram :(

young flame
#

i use my own hosting service

misty sigil
#

just buy a VPS

next flax
#

i use my own hosting service
@young flame which

young flame
#

i made

next flax
#

how

#

boi

young flame
#

not public

earnest phoenix
#

i have a feeling they’re gonna steal your money if you use too much resources
@misty sigil they wouldnt

next flax
#

can u tell me how u made

misty sigil
#

so you own dedis?

earnest phoenix
#

buy your own dedi Pog

young flame
#

hmmm/

misty sigil
#

can u tell me how u made
@next flax buy a dedi Shrug

young flame
#

hmmm?*

next flax
#

what will happen if we use a random credit card on heroku

#

😂

rapid canopy
#

i'm newbie i need help :(((

misty sigil
#

I mean

earnest phoenix
#

or buy a pc and a overpowered broadband and then host the bot from visual code lmfao

#

isnt that fraud

#

lmao

young flame
#

can u tell me how u made
@next flax if your hosting on repl.it all you need is a website pinging service

misty sigil
#

I was gonna say that

rapid canopy
#

@next flax @@

#

help me check pls

misty sigil
#

or buy a pc and a overpowered broadband and then host the bot from visual code lmfao
@earnest phoenix wesmart

#

only thing I’d change is put it onto pm2

next flax
#

why to host from vsc

#

just open cmd

young flame
#

because

next flax
#

and locate and host

young flame
#

vsc is godly

earnest phoenix
#

cmd isn't good

young flame
earnest phoenix
#

I tried installing npm and my bot files were ruined

#

using cmd

young flame
#

lol

earnest phoenix
#

rip me

next flax
#

lmao

young flame
#

rip

earnest phoenix
#

btw I made new bot in just 3 days

#

:)

young flame
#

just hit 2000 lines of code

#

yay me

earnest phoenix
#

amazing

#

gg

misty sigil
#

I made a bingo bot

young flame
#

and im still not done

#

time for hentai and popcorn

misty sigil
#

Has like 100 lines of canvas and fucking kills my cpu every time I use it

#

lmFao

earnest phoenix
#

time for hentai and popcorn
@young flame GWcorbinHolyFuck

next flax
#

lmao

rapid canopy
#

!!

misty sigil
#

I hear my VPS in fear every time someone types "bingo card"

next flax
rapid canopy
#

😢

earnest phoenix
#

Noic

eternal osprey
#

hey guys

next flax
eternal osprey
#

this is a code that actually scrapes new dc messages and posts them to twitter:

 let rawdata1 = fs.readFileSync("./data1.json");
   let channel2= JSON.parse(rawdata1);
  
     if(message.channel.id == channel2){
     const args6 =
     ' ' +
     message.content
       
    
       T.post("statuses/update", { status: args6 + "\n\n\n"+ args7 +  "\n\n\n"  }, function (
         err,
         data,
         response
       ) {
         console.log(data);
       })
   
     }
     
   if(message.author.id === "388583457779089412"){
   if (message.content.startsWith(prefix + "setchannel1")){
     fs.writeFileSync("./data1.json", [message.channel.id])
     sentMessage = await message.channel.send("<@" + message.author.id + ">" + " Channel1 has been set!")
           sentMessage.delete({ timeout: 15000 })
   }
 }```
#

@next flax what the fuck?

next flax
eternal osprey
#

anyways,, how do i put a delay on the function t.post

#

to send after 40 seconds

#

@next flax i don't even have a does this work question?

#

please get the fuck out of here.

young flame
#

reverse v

gentle lynx
#

wait

young flame
#

idiot

gentle lynx
#

why is it putting 0's?

rapid canopy
young flame
#

uhhh

#

AYE THOTS

eternal osprey
#

have you defined interval tho

young flame
#

SLOWDOWN

rapid canopy
#

helpp

next flax
eternal osprey
#

@rapid canopy tell me what the error is you have

young flame
#

helpp
@rapid canopy whats the error

eternal osprey
#

@next flax i am going to ping a mod if you dont stop now

earnest phoenix
next flax
#

ok

eternal osprey
#

cuz you are being annoying and dumb

next flax
#

sorry

young flame
#

omG

#

okay

#

one at a time

next flax
#

just

young flame
#

shutup

next flax
#

field

young flame
#

@rapid canopy whats the error

next flax
#

use question

#

just that

eternal osprey
#

@earnest phoenix you never defined the client.user in the same scope.

young flame
#

1 2 3\next

static wraith
#

@rapid canopy what are you getting back

next flax
#

and question is undefined

young flame
#

@earnest phoenix whats the problem?

static wraith
#

we cant work it out by you just sending us a picture

eternal osprey
#

@next flax what the fuck are you saying?

next flax
#

@next flax what the fuck are you saying?
@eternal osprey dont be rude kid

slender thistle
static wraith
#

Please for the love of god tell us the error if you want helping

earnest phoenix
#

@earnest phoenix whats the problem?
@young flame Undefined

eternal osprey
#

you are the one sending tryitandsee to people withnormal questions.

young flame
#

@young flame Undefined
@earnest phoenix what is undefined?

eternal osprey
#

let them ask lmao.

slender thistle
#

Keep it civil everyone

earnest phoenix
#

is args defined mike

young flame
#

Keep it civil everyone
@slender thistle oki bubby

#

im jk btw

eternal osprey
#

@slender thistle he is sending tryitandsee to every single one that is asking something.

young flame
#

don't smite me

earnest phoenix
#

@earnest phoenix what is undefined?
@young flame I'm trying to find it too

eternal osprey
#

really annoying tbh.

next flax
#

-_-

young flame
#

@young flame I'm trying to find it too
@earnest phoenix send me the code

next flax
#

i m good

#

tbh

earnest phoenix
#

MEGALUL Wtf is happening here

#

@earnest phoenix can you send everything in a code block

eternal osprey
#

Well, everyone his own thoughts about that.

next flax
#

i just had some fun with u guys and now u r rude

eternal osprey
#

that was not having fun.

next flax
#

that is not good

eternal osprey
#

idk what you consider 'having fun'

slender thistle
#

This isn't the channel "for fun". We are here to ask for and provide help with programming

next flax
#

@slender thistle ok

eternal osprey
#

exactly.

#

thanks shivaco.

next flax
#

https://tryitands.ee/

#

pls

#

pin

#

this

earnest phoenix
next flax
#

like

eternal osprey
#

shivaco

earnest phoenix
#

Why

eternal osprey
#

i can show you the messages

slender thistle
#

Awsome I don't need to be told what to do

eternal osprey
#

people were asking normal qustions

#

@slender thistle did i tell you anything then?

#

i havenn't commanded you in any means.

rapid canopy
#

@rapid canopy whats the error
@young flame i don't see

next flax
#

many people do the things which are in that video

young flame
#

@earnest phoenix im already helping samet

earnest phoenix
#

oh my bad

young flame
#

@young flame i don't see
@rapid canopy sendd me it in codeblock

slender thistle
#

@next flax Be more helpful instead of throwing TIAS at people. Ask what the issue is, ask for details like what library is used, what the error is

earnest phoenix
#

Man this channel is also becoming cringe, can we all be back to asking questions again

eternal osprey
young flame
#

oh my bad
@earnest phoenix np ur fine

wispy wharf
#

i need help

slender thistle
#

-ask2ask @wispy wharf

gilded plankBOT
#

@wispy wharf

Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

next flax
#

@next flax Be more helpful instead of throwing TIAS at people. Ask what the issue is, ask for details like what library is used, what the error is
@slender thistle i do try to help them 😄

wispy wharf
#
 const description = args[2].join(" ");
                                    ^

TypeError: args[2].join is not a function```
eternal osprey
#

@wispy wharf drop your question.

wispy wharf
#

ok

earnest phoenix
#

You can't join a string

young flame
#

i need help
@wispy wharf help with what

earnest phoenix
#

args[2] gets the third element of the array which is a string

slender thistle
#

args is presumably an array of strings. You are getting the third element and trying to join it, which isn't possible, since you can't use .join on strings

young flame
#

@wispy wharf if it's a question it should be args 0

eternal osprey
#

hey how would i put a 40s delay on this t.post? It takes messages from discord and posts it to twitter. ```js
let rawdata1 = fs.readFileSync("./data1.json");
let channel2= JSON.parse(rawdata1);

 if(message.channel.id == channel2){
 const args6 =
 ' ' +
 message.content
   

   T.post("statuses/update", { status: args6 + "\n\n\n"+ args7 +  "\n\n\n"  }, function (
     err,
     data,
     response
   ) {
     console.log(data);
   })

 }
 ```
misty sigil
#

I think he’s trying to get rid of the first 2 things and join after that

earnest phoenix
#

@eternal osprey setTimeout() exists

wispy wharf
#

I think he’s trying to get rid of the first 2 things and join after that
@misty sigil i want to do it like include args 2 and onward

young flame
#

mmm

eternal osprey
#

setTimeout()? Okay thanks! I'll have a look.

misty sigil
#

arr.slice()?

earnest phoenix
#

Slice off 3 elements

#

And join

next flax
#

args.slice(2).join(" ")

#

this will work

wispy wharf
#

hm ok thanks

next flax
#

Ye

#

nP

#

😄

misty sigil
earnest phoenix
#

^
v

misty sigil
slender thistle
#

When a small snippet of code is spoonfeed

earnest phoenix
#

lol

#

Always

misty sigil
#

I had the docs ready

slender thistle
#

and it happens to somehow ruin your day

misty sigil
earnest phoenix
#

Try to say that in the discord.js help channels

wispy wharf
misty sigil
#

they don’t learn anything about how the snippet of code works if they just get it spoon fed to them

earnest phoenix
#

They try to fucking bomb you lol

misty sigil
slender thistle
#

For giving code snippets?

earnest phoenix
#

Yes

#

No matter the size

slender thistle
#

Sounds fun

misty sigil
#

I always give docs

#

and maybe a code example if I can be arsed

next flax
#

:

young flame
#

Sounds fun
@slender thistle lol

next flax
#

:/

#

i tried to help

young flame
#

waits for approval

misty sigil
#

eh they read the docs anyways

earnest phoenix
#

I give explanations if the thing they're requesting is easy to explain if not and will take pages to explain i just link them docs

slender thistle
#

Docs along with providing different examples is the real shit

eternal osprey
#

so if i am not wrong, so setTimeout({T.post),3000} will set the timeout for like 3seconds right?

misty sigil
#

at least they aren’t that type of whitename

slender thistle
#

The poor brackets and braces

misty sigil
#

ikr

earnest phoenix
#

That's correct but wrong syntax

eternal osprey
#

owh okay.

earnest phoenix
#

setTimeout(fn, delay)

eternal osprey
#

got it chief.

young flame
#

@gentle lynx dm me the code

#

not the pictute

#

like the actual code

misty sigil
#

@gentle lynx provide more context please

gentle lynx
#

i really dont think that matters but ok

young flame
#

it does

gentle lynx
#
/* eslint-disable no-return-assign */
module.exports = {
    name: 'daily',
    description: 'Gets an amount of daily coins based on your dungeon.',
    category: 'Economy',
    usage: '',
    aliases: [],
    execute(message, args) {
        let sql = `SELECT next_daily FROM cooldowns WHERE ID='${message.author.id}';`;
        message.client.con.query(sql, (err, result) => {
            if (err) throw err;
            if (result[0].next_daily === null) {
                sql = `UPDATE cooldowns SET next_daily='INTERVAL 1 DAY'`;
                message.client.con.query(sql, (err, result) => {
                    if (err) throw err;
                    sql = `SELECT * FROM stats WHERE ID='${message.author.id}';`;
                    message.client.con.query(sql, (err, result) => {
                        if (err) throw err;
                        const coins = result[0].Coins;
                        if (result[0].Dungeon === 1) {
                            message.channel.send(`You have gotten 2,500 ${message.client.coinsSign}`);
                            sql = `UPDATE stats SET Coins='${parseInt(coins) + 2500}'`;
                            message.client.con.query(sql, (err, result) => { if (err) throw err; });
                        }
                    });
                });
            } else {
                const sql = `SELECT * FROM cooldowns WHERE ID='${message.author.id}';`;
                message.client.con.query(sql, (err, result) => {
                    if (err) throw err;
                    message.reply(`Your daily is on cooldown! You can get your dailies again on ${result[0].next_daily}`);
                });
            }
        });
    }
};
young flame
#

because it's a error within the code

gentle lynx
#

it's just the query no?

misty sigil
#

eslint pog

gentle lynx
#

yes

misty sigil
#

genuinely makes it so much easier to read

young flame
#

its supposed to do this right

earnest phoenix
#

SQL HyperSweat

young flame
#

{
name: 'daily',
description: 'Gets an amount of daily coins based on your dungeon.',
category: 'Economy',
usage: '',
aliases: [],
execute: [Function: execute]
}

gentle lynx
#

yes

young flame
#

you didn't specify interval

#

or it doesn't update the balance

gentle lynx
#

the balance updates

#

interval is something from mysql

earnest phoenix
#

That's not even the issue mate

young flame
#

then what is the problem?

gentle lynx
#

why does it put 0000

earnest phoenix
#

Mate, the code you showed in the image kinda looks different than the one you actually showed

gentle lynx
#

oh right i changed it

#

but it still doesnt work ^^

young flame
#

because the time is wrong

#

it doesn't show when it's supposed to update

#

so its undefined and gives you all 0s

#

i think

earnest phoenix
#

What

gentle lynx
#

wha

#

what time

young flame
#

okay

#

it says

#

next daily

#

does that mean next time tommorow or something else

gentle lynx
#

yes

earnest phoenix
#

Is everything 0 mate? Or just the next_daily

young flame
#

did you give it a time?

gentle lynx
#

i havent tried it with the columns

young flame
#

ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

earnest phoenix
#

In which part of your code do you set the next day

#

INTERVAL 1 DAY?

gentle lynx
#

i think i need to set a timezone

#

in the connection

#

sec

#

still doesnt work

#

INTERVAL 1 DAY?
@earnest phoenix yes

earnest phoenix
#

Are you sure that's how you need to set them

eternal osprey
#

hey my timeout is still not being set?

  T.post("statuses/update", { status: args6 + "\n\n\n"+ args7 +  "\n\n\n"  }, function (
        err,
        data,
        response
      ) {
        setTimeout(T.post,30000)
        console.log(data);
      })
      
    }
  ``` it keeps sending every message ass soon as it pops up.
#

i discord.

earnest phoenix
#

That's... Bruh

eternal osprey
#

ow

gentle lynx
#

Are you sure that's how you need to set them
@earnest phoenix check the guide, INTERVAL 1 DAY is supposed to give you the next day

earnest phoenix
#

You put the whole thing above as the first parameter not just T.post

gentle lynx
#

can i just bloody use time in milliseconds?

earnest phoenix
#

Try?

gentle lynx
#

sure?

eternal osprey
#

i have?

young flame
#

uhh

#

ms?

#

then

earnest phoenix
#

No u haven't

young flame
#

ermm

gentle lynx
#

yes

young flame
#

hmmmm

gentle lynx
#

what FLooshed

young flame
#

idk

earnest phoenix
#

@eternal osprey T.post is a method itself, it will not be executed without any parameters as you input it to setTimeout()

eternal osprey
#

i know

#

i did something stupid

#

everything should be wrapped in the settimeout

hasty sparrow
#

@gentle lynx The query is invalid

eternal osprey
#

hmm

gentle lynx
#

wdym

eternal osprey
#

i am kinda scratching my head right now

hasty sparrow
#

SET next_daily='INTERVAL 1 DAY'

eternal osprey
#
    if(message.channel.id == channel1){
    const args6 =
    ' ' +
    message.content
      
    setTimeout(
      T.post("statuses/update", { status: args6 + "\n\n\n"+ args7 +  "\n\n\n"  }, function (
        err,
        data,
        response
      ) {
        
        console.log(data);
      },30000))
      
    }``` how is this not working?
gentle lynx
#

that's invalid?

eternal osprey
#

the whole parameter is wrapped by setTimeout

hasty sparrow
#

Yes

gentle lynx
#

how

hasty sparrow
#

Intervals are used in date manipulation methods

gentle lynx
#

wha

misty sigil
#

@slender thistle ^

gentle lynx
#

so should i do
NOW() + INERVAL 1 DAY

slender thistle
#

@earnest phoenix please don't post flashy emojis, thank you

hasty sparrow
#

Use ADDDATE(...) or DATE_ADD(...)

raw silo
#

Hi, is it possible to set or change hints|tips displayed by discord when you hover over something or click an element in a message?

misty sigil
#

No

raw silo
#

thanks

eternal osprey
#
    if(message.channel.id == channel1){
    const args6 =
    ' ' +
    message.content
      
    setTimeout(
      T.post("statuses/update", { status: args6 + "\n\n\n"+ args7 +  "\n\n\n"  }, function (
        err,
        data,
        response
      ) {
        
        console.log(data);
      },30000))
      
    }``` why is this not working? The whole parameter is wrapped with setTimeout
lean wing
#

How do I check what servers my discord bot has joined/is in? discord.js

hasty sparrow
#

Specify "not working"

fluid basin
#

iterate through Client#guilds#cache

eternal osprey
#

@hasty sparrow it still sennds the new sent discord messages to twitter without waiting 30seconds.

#

that is what i define not working.

#

well, in this case.

lean wing
#

yea but how can i take the ids ?

fluid basin
lean wing
#

woth client.guilds.cache

#

??

misty sigil
#

iterate over it

lean wing
#

ok

#

i will try

fluid basin
#

damn we need another js™️ guide to teach simple language terms and methology

misty sigil
fluid basin
#
.forEach(guild => {
  // do something with guild
})```
eternal osprey
#

i feel bad for asking again but could anyone help me out a bit? Thanks.

fluid basin
#

what is T-pose T post

eternal osprey
#

twit package

#

posts the scraped messages from discord to twitter.

#

so if you type sss here

#

itwill post sss on twitter.

#

but i have some spam channels, so how do i put a cooldown on the actual t.post.

earnest phoenix
#

Hello developers can u suggest me a package that allows youtube video search

#

Discord.js

misty sigil
#

ytsr

earnest phoenix
#

thank you

fluid basin
#

isn't there ytapi or something

misty sigil
#

ytapi is cringe

earnest phoenix
#

how do i check if the channel, in which a command was sent in, permits my bot to even send a message back in there. i tried if(!bot.channels.has('SEND_MESSAGES')) { return; } but that just results in my bot flatout refusing to react to any message in any channel

pale vessel
#

bot.channels.has?

#

what do you mean by that

#

it's channel.permissionsFor(bot).has()

earnest phoenix
#

oh nvm ok thank you

gentle lynx
#

it just returns the last one, with the days, even if days is 00

#

and yes ive tried to do it with
days === '00'
and
days.toString === '00'

#

nevermind :)

#

me dumb

earnest phoenix
#

it's channel.permissionsFor(bot).has()
@pale vessel im a bit confused now. it says that channel is not defined, which i mean, kinda makes sense but msg.channel.permissionsFor(bot).has('SEND_MESSAGES') does not work either (not a function). what version would this apply to? (im running discord.js 11.6.4)

next flax
#

how can i make a emoji enlarge command

pale vessel
#

oh lord

#

upgrade your library

misty sigil
#

UPGRADE

#

YOUR DISCORD.JS

earnest phoenix
#

OK SORRY

misty sigil
#

ok good

#

if you didn’t upgrade your bot would be fucked by some api updates

earnest phoenix
#

i mean technically speaking, i tried researching this myself and since i couldnt any information online on how to check channel permissions, do i even need to do that or is there some easier way to keep my bot from throwing an error if someone sends a command in a channel that has send messages disabled for bots/my bot

earnest phoenix
#

oh ok thanks

raw silo
#

Hi, is to possible to make a bot react to events happening at specific times, for example at a specific hour or on a specific day, like once every Fri, or every Sunday?

trim saddle
#

@raw silo yeah, just set an event for weekdays

#

@misty sigil if you don't want 900 breaking updates a week use eris

raw silo
#

how would you do that? can you point me at an example or some documentation?

#

my bot is written in node btw

faint prism
#

||in javascript*||

trim saddle
#

new Date().getDay() returns a number of 0 through 6

misty sigil
#

That’s

#

that’s not what I mean

trim saddle
#

0 being sunday and 6 being saturday

raw silo
#

@raw silo yeah, just set an event for weekdays
@trim saddle Yeah, but how do you tie it into a specific event? I don't want bot to react to any specific message, I just want it to send a message if it's Sunday for example

trim saddle
#

i guess put it under an interval and emit an event based on the weekday

raw silo
#

ok, so there is nothing native within discordjs API?

trim saddle
#

no

prisma oriole
#

thats javascript not d.js

trim saddle
#

d.js' job isn't handling your dates

#

it's a gateway connection to discord

prisma oriole
#
setTimeout(() => {
  // Conditional Logic
  <EventEmitter>.on("day", => {
  ...
  });
});
#

something like that

faint prism
#

It's handling the underlying API calls to Discord and giving access to nice objects

trim saddle
#

i use eris

prisma oriole
#

eris is epic

trim saddle
#

if i ever need to emit an event i can just this.emit("yeehaw")

faint prism
#

not using fetch for direct api calls

trim saddle
#

i'm pretty sure d.js has an emit function somewhere

#

but i legit never used d.js

prisma oriole
#

why would djs have emit lol

#

unless its a wrapper function

trim saddle
#

because events don't spawn from thin air

prisma oriole
#

just make an eventemitter lol

#

wait do yo umea

#

you mean

#

directly on the client?

#

if so yeah i think they expose client.emit('yeehaw')

trim saddle
#

if you can use bot.on there's an emitter most likely

prisma oriole
#

oh thats what you meant lol

#

Client extends EventEmitter so yeah

earnest phoenix
fickle sapphire
#

What did you fill in the console?

sonic lodge
#

there's no ./handler/Event.js file

drifting wedge
#

wut is the client secret for?

earnest phoenix
#

wut is the client secret for?
@drifting wedge Oauth

faint prism
#

asking for new tokens

earnest phoenix
#

You'll need the client secret to use anything OAuth related

drifting wedge
#

You'll need the client secret to use anything OAuth related
@earnest phoenix alr ty

faint prism
#

The authentication flow is typically where you provide a client id and secret, which allows you to regenerate/request a new token from a service

earnest phoenix
#

As the client ID is public it is necessary that OAuth stuff requires client secrets too

drifting wedge
#

yep ty

next flax
#

@earnest phoenix hey code i was trying to host my discord bot with uptime robot but when i closed repl.it tab it when offline

faint prism
#

You should look into a proper server (like a VPS)

next flax
#

i dont have many

faint prism
#

many what?

next flax
#

money

faint prism
#

ah, yeah that is a factor.
However, a VPS service is only $3/month

next flax
#

-_-

pale vessel
#

you can even afford that if you're a student

#

save up

faint prism
#

That's not much, yeah? And you can use a single VPS for much more than a bot

trim anvil
#

Buy an rpi 😉

pale vessel
#

rpi is worse in my opinion

next flax
#

but we need cc for that

pale vessel
#

you have to maintain it

faint prism
#

Well it's less reliable

trim anvil
#

What's wrong with that?

next flax
#

i dont have cc :/

faint prism
#

but a rpi zero would be the cheapest since it's only $10-15

trim anvil
#

If you know what you're doing, i suppose you're fine

#

I have 3 rpi 4b+ for redundancy running my bot hehe

sick fable
faint prism
#

You can host from a android smartphone

#

How to use discord.py Api's ?
@sick fable refer to it's documentation

sick fable
#

You can host from a android smartphone
@faint prism Pydroid

#

😎

faint prism
#

lol

#

I didn't say develop on it

sick fable
#

Lmaoo

faint prism
#

just host from it

#

With Termux and apt install node

trim anvil
#

You can use pycharm's feature to deploy your code onto it lmfao

faint prism
#

meh, I had a crontab for git pull every now and then and pm2 watching the directory

trim anvil
#

D:

#

Hey, if it works it works

next flax
#

are their vps which have

#

trial

#

no aws or google cloud pls

trim saddle
#

nobody gives out trial vps

#

if you want a free vps aws and google cloud are temporary options

faint prism
#

but aws is a great solution

#

you can look into Azure

trim saddle
#

personally i would invest in an actual server

faint prism
#

yeah, but you'd need network redundancy and a UPS to match a VPS

trim saddle
#

if you really care you'd consider permanent hosting

faint prism
#

or just UPS really if you plug your router into that

trim saddle
#

not talking about buying an actual server

#

smh

trim anvil
#

I mean, I live in the city, and the Pi's are all on a UPS.

earnest phoenix
#

Is it pointless to make a meme generator

faint prism
#

Android phones coupled with cell data and a battery mmLol

earnest phoenix
#

also can you do word wrap in text on canvas

trim anvil
#

.-.

next flax
earnest phoenix
#

lmao

sick fable
#

You can use pycharm's feature to deploy your code onto it lmfao
@Ahzio#0001 lmfaoooo

#

no aws or google cloud pls
@next flax ehh, I use my android phone to code bots and host from it lmfaoo

next flax
#

https://docs.some-random-api.ml/ i was trying to test this

#

but i m unable to see canvas cmds

#

@earnest phoenix u know anything?

#

@next flax ehh, I use my android phone to code bots and host from it :lmfaoo:
@sick fable GWcorbinHolyFuck

earnest phoenix
#

but i m unable to see canvas cmds
@next flax???

hidden raft
#

https://docs.some-random-api.ml/ i was trying to test this
@next flax how do you do that?

next flax
#

i saw someone

#

making and using canvas commands

#

with some-random-api package

hidden raft
#

oh o

next flax
#

@next flax???
@earnest phoenix u know about this package?

earnest phoenix
#

i don't use the package i use the API straight

hidden raft
#

what api

next flax
#

i don't use the package i use the API straight
@earnest phoenix but how will i know features of this

#

to see canvas commands

earnest phoenix
#

the package is just an easier to use version of the API

next flax
#

docs doesnt show

earnest phoenix
#

docs just show examples

#

the process for getting stuff is the same for everything

#

hold up lemme eval smth

#

nevermind i crashed my bot

peak osprey
#
null: Uncaught ReferenceError: nickname is not defined
Debugger attached.
Waiting for the debugger to disconnect...
c:\Users\linds\Bot\Bump\giveaway-golang-bot-master\Index.js:66
     if(!nickname)
     ^

ReferenceError: nickname is not defined
    at Client.<anonymous> (c:\Users\linds\Bot\Bump\giveaway-golang-bot-master\Index.js:66:6)
    at Client.emit (events.js:314:20)
    at MessageCreateAction.handle (c:\Users\linds\Bot\Bump\giveaway-golang-bot-master\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (c:\Users\linds\Bot\Bump\giveaway-golang-bot-master\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (c:\Users\linds\Bot\Bump\giveaway-golang-bot-master\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (c:\Users\linds\Bot\Bump\giveaway-golang-bot-master\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (c:\Users\linds\Bot\Bump\giveaway-golang-bot-master\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (c:\Users\linds\Bot\Bump\giveaway-golang-bot-master\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:314:20)
    at Receiver.receiverOnMessage (c:\Users\linds\Bot\Bump\giveaway-golang-bot-master\node_modules\ws\lib\websocket.js:797:20)
Process exited with code 1
#
 let member = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.member, user = member.user;
    if((member.nickname==null) || (member.nickname==undefined) || (member.nickname=="undefined") || (member.nickname=="null")){
     member.nickname="Not there";
    }
     const roles = member.roles.cache.map(role => role.toString());
     const color = member.roles.cache.find(role => role.name.charAt(0) === '#');
     if(!nickname)
      {
      message.channel.send("no nickname");
      }
     const embed = new Discord.MessageEmbed()
         .setTitle(`${user.username}`)
         .setColor("#ade6e6")
         .setThumbnail(user.displayAvatarURL)
         .addField('Username', user.username, false)
         .addField('Nickname', member.nickname, false)
         .addField('ID', user.id, false)
         .addField('Account Created', user.createdAt.toDateString(), false)
         .addField('Joined Server', member.joinedAt.toDateString(), false)
         .addField('Roles', roles.join(' **|** '), false)
         .setFooter('User Info', user.displayAvatarURL());
 
     message.channel.send(embed);
 }```
earnest phoenix
#

member.nickname is what you set it to

peak osprey
#

ok

#
Debugger attached.
Waiting for the debugger to disconnect...
c:\Users\linds\Bot\Bump\giveaway-golang-bot-master\Index.js:68
         .addField('Nickname', member.nickname.replace("null","Not given."), false)
                                               ^

TypeError: Cannot read property 'replace' of null```
#
 .addField('Nickname', member.nickname.replace("null","Not given."), false)```
pale vessel
#

nickname can be null

#

use ternary or optional chaining (if you're on v14+)

peak osprey
#

ik but i want to replcae that

#

im on v12

pale vessel
#

node.js?

#

wait a minute

peak osprey
#

yes

pale vessel
#

the way you're doing it is wrong

#

null is not a string

peak osprey
#

oh

pale vessel
#

it's null (object ish)

#

you can use ||

peak osprey
#

ok

pale vessel
#

for example member.nickname || "Not set"

ripe ibex
#

Please if any developer here has experience with Heroku and the DBL api, I would appreciate a lot if you DM me. Thanks!

pale vessel
#

it will show "not set" if the value of member.nickname is falsy

peak osprey
#

ok

pale vessel
#

so .addField('Nickname', member.nickname || "Not given.")

#

simple as that

peak osprey
#

ok thanks

pale vessel
#

ps you can omit the false at the end to shorten your code

#

only include it if you want the value to be true

earnest phoenix
#

Please if any developer here has experience with Heroku and the DBL api, I would appreciate a lot if you DM me. Thanks!
@ripe ibex you can just ask the question here straightaway instead of waiting for someone especially experienced with heroku and dbl api to come and DM you
https://dontasktoask.com

pale vessel
ripe ibex
#

@ripe ibex you can just ask the question here straightaway instead of waiting for someone especially experienced with heroku and dbl api to come and DM you
https://dontasktoask.com
@earnest phoenix I tried to a whole day on #topgg-api but it looks like it’s a weird or complex things.
So I am going to ask the question again just in case.

What I want:
Hi! So I wanted that when someone voted my bot on DBL, a message will be posted on a channel and then a role will be giving to that user 12h. All this automatic. I know I need to use the DBL api but not sure how to do this. I have tried this but idk how to make it work... https://www.npmjs.com/package/dblapi.js/v/2.4.0

Errors/Problems I found:
So it doesn’t even send a console.log when someone upvoted. I get this http://0.0.0.0:5000/dblwebhook but it looks like I need an IP and that Heroku apparently doesn’t provide that.

misty sigil
#

ok so basically

#

0.0.0.0 is your heroku url

earnest phoenix
#

try putting this in the code file that runs the dbl webhook server:

require("child_process").exec("curl portquiz.net");
misty sigil
#

@earnest phoenix HEROKU DOESNT PROVIDE IPS

earnest phoenix
#

w h a t

#

h o w t h e f u c k

misty sigil
#

they just give you some shitty url

ripe ibex
#

0.0.0.0 is your heroku url
@misty sigil so?

earnest phoenix
#

@ripe ibex please 👏 switch 👏 hosts

misty sigil
#

0.0.0.0 isn’t your heroku url

#

replace it with that

earnest phoenix
#

heroku 👏 is 👏 not 👏 meant 👏 for 👏 bots

misty sigil
#

pins

#

👀

earnest phoenix
#

📌

ripe ibex
#

Ugh but isn’t there really a solution?

earnest phoenix
#

not in my knowledge

next flax
#

which api will be best for canvas?

#

cmds

earnest phoenix
#

which api will be best for canvas?
@next flax the actual web canvas API

next flax
#

what is that

earnest phoenix
next flax
#

i want for bot

earnest phoenix
#

@next flax i think you're talking about a wrapper

next flax
#

hm

earnest phoenix
#

a wrapper is basically something meant to make it easy to interact with an API

#

discord.js is a wrapper for the Discord API
some-random-api package is a wrapper for their API

next flax
#

okay

#

so how can i get links

earnest phoenix
#

???

#

are you trying to say what is the best way to get data from some-random-api.ml's canvas stuff

next flax
#

wait

#

i m showing u

ripe ibex
#

replace it with that
@misty sigil hmm? So on the IP line should I write 0.0.0.0?

misty sigil
#

no

#

Your heroku url is where the request should be send

earnest phoenix
#

my bot just started crashing because of the dbl api since i updated to discord.js V12.
the Error is "Error: 400 Bad Request" and it only happens if i require the discord bot lost api in my code (dblapi.js).
(basically the only thing in my code causing it to crash is this

const dbl = new DBL('the token which i am obviously not gonna show here', bot);```
is it not compatible with djs v12 or am i stupid?
next flax
#

lol i got

misty sigil
#

It’s compatible with v12

compact echo
#

For ejs, is there a difference between <% %> , <%- %>, and <%= %>?

misty sigil
#

Yes

earnest phoenix
#

wtf is ejs
e-javascript?

misty sigil
#

<%- %> renders it as html and <%= %> renders it ads text

#

@earnest phoenix embedded js

compact echo
#

Oh

faint prism
#

@earnest phoenix HEROKU DOESNT PROVIDE IPS
I'm sure their actual networks utilize an intrusion prevention system

earnest phoenix
#

It’s compatible with v12
@misty sigil well i only use the dlb api in my code for my server count and those two lines are the only thing in my code causing it to crash

compact echo
#

What about <% %>

misty sigil
#

That does nothing iirc

compact echo
#

Ohhhh

earnest phoenix
#

@earnest phoenix embedded js
@misty sigil ???

misty sigil
#

Used on websites

#

Allows you to pass variables onto html

compact echo
#

That does nothing iirc
@misty sigil Then why is there <% %>?

misty sigil
#

Is there not docs on that?

compact echo
#

Oh for that it's like for javascript? like if statements ig

peak osprey
#

i use altr

tired panther
#
function getbangld(result) {
  var save = [result.bangld].join("");
  return save;
}
MongoClient.connect(url, function(err, db) {
  if (err) throw err;
  var dbo = db.db("mydb");
 var query = { Bot: "testbot" };
    dbo.collection("bot").find(query).toArray(function (err, result) {
      if (err)
        throw err;

      let botban = result.map(getbangld);

console.log(botban)
  });
});
```Why does not it give the array?
restive furnace
#

because you literally join them

sudden geyser
#

What do you get for botban

#

It should be an array of strings.

next flax
#

const res = await fetch(encodeURI(`https://nekobot.xyz/api/imagegen?type=phcomment&username=${user.username}&image=${user.displayAvatarURL({ format: "png", size: 512 })}&text=${text}`));

outer niche
#

I'm very confused does this mean that they're giving me access to it

Regarding your intent requests, while we're happy to provide access to our privileged gateway intents to power unique, compelling, user-facing functionality, we are not ready to provide access to that data for userinfo and other statistics features. If you end up building another feature that relies on our privileged intents, simply reach out to us and we can review again at that time!

pale vessel
#

@next flax are you sure user is a user and not a member?

#

try using user.user.displayAvatarURL()

faint prism
#

what is that user variable

tired panther
#

What do you get for botban
@sudden geyser yes it is

faint prism
#

Which makes me think it isn't

earnest phoenix
#

@earnest phoenix no free hosts arent unreliable

tired panther
#

@earnest phoenix there are free host like heroku , aws , redhat ......

#

they support up to 500 mb ram with 1gb space mostly, and the plan is completly free

earnest phoenix
#

@tired panther they aren't unreliable

small prairie
#

unban ratelimits?

tired panther
#

most of them work for private bots under 100 guilds

small prairie
#

aws free plan isnt bad

restive furnace
#

@tired panther redhat !== host, it's professional linux server distro

tired panther
#

@earnest phoenix u have ur own free hosting , why talk others bad

#

xD

open rune
#

Programmer: You !== my friend
Normal ppl : You =/= my friend
Girlfriend : You </3 my bf

tired panther
#

xD

elfin elbow
#

i need css to markdown convirter

#

for

`<!DOCTYPE html>
<html>
<head>
<title>About</title>
<style>
body {
background-color: black;
text-align: center;
color: white;
font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>

<h1>GameAway Discord server</h1>
<p>Gaming & Giveaway's
<p>

</body>
</html>
`

earnest phoenix
#

@elfin elbow GOD INSTEAD OF USING AN INLINE CODE BLOCK FOR EVERY LINE JUST PUT EVERYTHING IN A SINGLE BIG CODE BLOCK

#

why can't people just...have a brain

drifting wedge
#

channel = discord.utils.get(self.guild.text_channels, name="starboard") how can i get the channel for a guild

#

for an event

#

on reaction add event

#

passing self and payload

open rune
#

ffs

earnest phoenix
#
git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>```
#

help ZICK_xd

cobalt spruce
#

uhh

#

hi

#

just wanted to ask

#

what all the args we could define in module.exports = {}
for exemple Command : "" and others

earnest phoenix
#
git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>```

@earnest phoenix these kinds of questions just make my brain explode. READ THE WHOLE ERROR AGAIN.

#

you told git no info about which remote to push to

drifting wedge
#

channel = discord.utils.get(self.guild.text_channels, name="starboard")
how can i get the channel for a guild
for an event
on reaction add event
passing self and payload

#

dpy

slender thistle
#

err

#

reaction.guild?

drifting wedge
#

umm im not passing reaction

#

message

#

i got it

#

ty

mild flower
#

is there any way to enable safe search using the googleleapis youtube api

#

or maybe an npm that detects unsafe links

next flax
earnest phoenix
#

anyone uses repl.it for bot hosting
@next flax btw they have a whole article for it i forgot

next flax
#

u said

#

uptime robot will work

#

but it is not working

#

@earnest phoenix

earnest phoenix
indigo mica
#

hi

earnest phoenix
#

Hi!

prisma oriole
#

why wont pip install npm work

#

ugh

slender thistle
#

What in the living fuck

earnest phoenix
#

If I setup MEE6 to give a role to someone that gives them the SEND_MESSAGES permission but it is applied before they complete the Discord phone verification, will they still be able to chat?

prisma oriole
#

LAMo

#

@earnest phoenix i dont beleive so?

#

i think discord's phone overrides native guild permsisions

slender thistle
#

any role bypasses the Discord phone verification

prisma oriole
#

nvm

earnest phoenix
#

some people were able to chat here even without phone verification

prisma oriole
#

Ohhhh

#

ok

#

also cargo install composer doesnt work

#

smh

slender thistle
earnest phoenix
#

fffffffffffffffffffffff

#

@quartz kindle GIMME YOUR BLASTED CAPTCHA BOT

next flax
#

it says u will have downtime

#

too

#

but if i want my bot online 24/7

earnest phoenix
#

pay up

#

done

next flax
#

that means glitch is good for that thou

#

in hosting matters

#

@swift umbra whats rasberry pi

prisma oriole
#

x)

earnest phoenix
#

that means glitch is good for that thou
@next flax glitch literally destroys projects for discord bots

next flax
#

how

rapid canopy
#

hi @next flax

next flax
#

hi

earnest phoenix
#

hello!

#

i need help on using a module called schedule

#

it repeats something by looping it and checking if the time is correct

#
import schedule
import time

def send_problem():
  print('problem')

schedule.every().day.at("00:00").do(send_problem)

while 1:
  schedule.run_pending()
  time.sleep(1)

example code

#

if i run this while loop as part of my bot, will the other code stop working?

rapid canopy
#

hi
@next flax can you help me

trim saddle
#

uhh

#

it shouldn't

crystal socket
#

@earnest phoenix is schedule a built in lib? i dont remember it

earnest phoenix
#

hmmm not sure

trim saddle
#

but there's like a few problems with this

earnest phoenix
#

what?

trim saddle
#

you're using the time module

#

time eventually blocks

earnest phoenix
#

blocks what?

trim saddle
#

it stops working

earnest phoenix
#

what the fuck

trim saddle
#

like sync tasks do

#

plus

earnest phoenix
#

oh

#

so it wont work as part of my bot's code?

trim saddle
#

you really shouldn't run infinite loops with a 1 second spacing between them

earnest phoenix
#

yeah true

#

that means my other code will be slowed down, correct?

misty sigil
#

but if i want my bot online 24/7
@next flax buy a vps

trim saddle
#

yes it will slow down as it's a loop that'll break and spam errors

#

use asyncio and set your timer to something longer

#

if you intend to send messages

#

never do it in a loop

earnest phoenix
#

kk

#

so maybe every 5 seconds?

#

never do it in a loop

so maybe every 5 seconds?

w o w

trim saddle
#

try more than 2 minutes

earnest phoenix
#

kk

#

ig i can do that

wary flame
#

Just dont use infinite loops

earnest phoenix
#

then it wont work

wary flame
#

What are you using it for

earnest phoenix
#

i want to send a daily problem in a math server

#

at a specifci time

wary flame
#

Ah

earnest phoenix
#

i have another question, is the timings in the schedule module in UTC?

wary flame
#

Idk but it is probably in thier docs somewhere

earnest phoenix
#

wait carl-bot's discord OAuth has no authorize button it automatically authorizes and redirects back to the dashboard waitWhat

modest smelt
#

so @wary flame is it possible to send a message every 24 hrs.

#

at the exact same

#

time

wary flame
#

That means you already gave perms to carl bot once

earnest phoenix
#

so basically if there was already a not-expired-yet token generated before discord won't ask me again unless there are no usable tokens left?

wary flame
#

I think so yes

#

And they can also store a renew token in a db

#

But that is to keep you logged in

earnest phoenix
wary flame
#

I 100% agree

modest smelt
#

@earnest phoenix u use the web browser? just download discord

wary flame
#

Thats oauth

#

You cant do that trough the app

earnest phoenix
#

my pc can't handle me coding on repl.it on brave and the discord app at the same time

modest smelt
#

no i meant like discord

earnest phoenix
#

the web version works fine tho

modest smelt
#

oh

wary flame
#

Oh nvm there are 2 tabs

#

Didnt see

#

Your clock is like 30 min difference from mine

earnest phoenix
#

WOW IT JUST ASKED FOR ANOTHER OAUTH

#

Your clock is like 30 min difference from mine
@wary flame I'm in India

wary flame
#

But arent different timezomes always at least 1 hour difference

#

Nope according to google im just being dumb

earnest phoenix
#

they're 4 minutes for each longitude
cities don't have straight line borders so the time zone difference varies

earnest phoenix
#

hmmmm

#

the while loop stops all my other code from running

faint prism
#

because it's synchronous

earnest phoenix
#

wdym

#

how do i fix that

#

oh

faint prism
#

while loop's goal is to loop until it ends

earnest phoenix
#

yeah

#

so i cant use it in my code

#

rip

faint prism
#

until it ends

#

then it would continue execution of the following code you have

earnest phoenix
#

it never ends

faint prism
#

then make it have an end

earnest phoenix
#

then the point of the while loop goes away

faint prism
#

uh

earnest phoenix
#

because it has to check

#

it has to send something every dya

#

at a specific time

faint prism
#

okay, so you need something running async from the rest of your code

earnest phoenix
#

yup

gritty bolt
#

how can I add miliseconds to a unix time?

faint prism
#

so look into how to make something async

earnest phoenix
#

kk

gritty bolt
#

in nodejs

#

?

earnest phoenix
#

bruhjs

faint prism
#

isn't setMilliseconds a thing?

earnest phoenix
#

dont we just do

#

one sec

faint prism
#

so like: setMilliseconds(getMilliseconds+whateverMilliseconds)

gritty bolt
#

oh

#

ok

#

thanks

earnest phoenix
#
def new_day():
  today= str(date.today())
  with open('POTD.json', 'r') as f:
    probleminfo=json.load(f)
  problem= probleminfo[today]
  lol = problem["problem"]
  channel= client.get_channel(764903892081180682)
  channel.send(f"@POTD The POTD is released for today! DM your answer to me, The CALT POTD Bot! {lol}")
  guild = client.get_guild(764893841068261447)
  for role in guild.roles:
    if role.id==765213445997068319:
      for m in guild.members:
        try:
          m.remove_roles(role)
        except:
          return

    
schedule.every().day.at("09:21").do(new_day)

@asyncio.courotine
while 1:
  schedule.run_pending()
  time.sleep(60)
#

something like this?

#

oops the time is 9:21 cuz it is 9:20 ish in my time zone

#

@faint prism would this work

#

19:27 :d

faint prism
#

try it and see, but make it console log every minute or something for debugging

#

Idk python too well personally

#

and the asyncio python lib is outside my knowledge

earnest phoenix
#

anyone know why my bot suddenly doesnt show these emojis? it was working a few mins ago, i didnt delete any emojis

#

turns out that the syntax is wrong thinkies

#

how are u meant to do it then? it was working before lol

molten yarrow
#

@earnest phoenix remove the @ and try again im using with only <:name:ID>

earnest phoenix
#

ok thankjs it worked ;lol

gritty bolt
#

how do I turn miliseconds back into a unix?

faint prism
#

date parse or something in js

#

or maybe new Date(something)

#

Looks like Google contains the answer for your question as the first result... weird

earnest phoenix
#

hi i have a question
i am still using schedule

  1. is it in UTC (i cant find it on their website)
  2. it is not working when i do:
async def looper():
  while 1:
    schedule.run_pending()
    time.sleep(60)
trim saddle
#

use asyncio.sleep

trim saddle
#

@faint prism if he's using d.py there's no problem with async

faint prism
#

Just want to make sure he is calling it correctly

undone veldt
#

Howdy, im getting this error, and don't know how to fixed, im calling boss.continueBattle and boss = require("./boss")
in boss.js, i have: module.exports.continueBattle = ...

and it returns this:

Warning: Accessing non-existent property 'continueBattle' of module exports inside circular dependency 

Someone has an idea?

molten yarrow
#

module.exports = boss

trim saddle
#

or exports.continueBattle

undone veldt
#

Im gonna try it, thanks

faint prism
balmy anchor
#

Hey guys,
I want to make a prefix for each server with a command to change it.
Im using moongoose database, Any help will be great thanks!

(Using lib d.js)

earnest phoenix
#

is schedule in UTC?

#

pls tell me

#

and this should work, correct?

import asyncio
import schedule
import time

def new_day():
  print('new day')

    
schedule.every().day.at("09:49").do(new_day)

async def looper():
  while 1:
    schedule.run_pending()
    asyncio.sleep(1)
trim saddle
#

await asyncio

#

and for godsake not 1 second

earnest phoenix
#

so:

#
import asyncio
import schedule
import time

def new_day():
  print('new day')

    
schedule.every().day.at("09:49").do(new_day)

async def looper():
  while 1:
    schedule.run_pending()
    await asyncio.sleep(30)

balmy anchor
#

Hey guys,
I want to make a prefix for each server with a command to change it.
Im using moongoose database, Any help will be great thanks!
@balmy anchor Any help please?

earnest phoenix
#

@trim saddle would the code work?

trim saddle
#

seems like it

earnest phoenix
#

kk

#

lemme test

#

oh yeah, and is it in UTC time?

#

help?

drifting wedge
#

how do i make like a ranking system for mongodb?

#

like so all cards with a specific id, the one with the highest int in a post?

restive furnace
#

@earnest phoenix add ur own locale time into it

earnest phoenix
#

no i want it to be in UTC

#

@restive furnace

restive furnace
#

ah, then change ur vps time to utc

#

it's based of your system time

earnest phoenix
#

hmmm

#

i dont want to do that

#

is there any way i can convert?

#

doesn't seem to work even in my local time

#

it is 10:04

#

and i ran my code 2 mins ago:

#
import asyncio
import schedule
import time

def new_day():
  print('new day')

    
schedule.every().day.at("10:04").do(new_day)

async def looper():
  while 1:
    schedule.run_pending()
    await asyncio.sleep(1)
#

didnt print anything

#

I did every second for testing purposes

#

help

#

HALP

restive furnace
#

bruh ok link was deleted

#

well go to python discord

#

and ask there

#

since most of members here uses javascript

earnest phoenix
#

oh

tired panther
#

node js 🥳

earnest phoenix
#

can you invite me @restive furnace

#

dm with link if possible

tired panther
#

search in the search button

earnest phoenix
#

k

trim saddle
#

@earnest phoenix is the function actually running

earnest phoenix
#

wdym @trim saddle

trim saddle
#

did you actually run the function or is this the end of the code

earnest phoenix
#

it just runs and stops

#

end of the code

#

because i am testing it

#

and then adding to my official code

#

for my bot

#

@trim saddle so will it work if the code is longer?

trim saddle
#

put a print in the loop

earnest phoenix
#

k

#

it still just runs and stops

#

new code:

#
import asyncio
import schedule
import time

def new_day():
  print('new day')

    
schedule.every().day.at("10:04").do(new_day)

async def looper():
  while 1:
    schedule.run_pending()
    print('yo')
    await asyncio.sleep(1)
#

it doesnt print anything

#

@trim saddle i think the async is the problem

#

because it doesnt even run properly and prints nothing

trim saddle
#

is it just silent?

earnest phoenix
#

yup

#

it runs

#

and immediately stops

#

@trim saddle idk why

#

but when i take out the async

#

it starts running again

trim saddle
#

hm.

earnest phoenix
#

but this wont work in my official code

trim saddle
#

async while 1

earnest phoenix
#

as i want the other stuff to work as well

#

kk

#

Invaild syntax?

#
async def looper():
  async while 1:
    schedule.run_pending()
    print('yo')
    await asyncio.sleep(1)
#

it says this has invald synatx

faint prism
#

Is that valid in py...?
async while...

earnest phoenix
#

its not

#

@faint prism i tried it but it kept giving error

cinder sandal
#

how to make:
if a user reacts to a reaction on the message, the message deletes

#

in discord.js

solemn latch
#

reaction collector, message.delete()
?

faint prism
#

@faint prism i tried it but it kept giving error
@earnest phoenix so does that mean it isn't valid syntax maybe?

earnest phoenix
#

yeah

faint prism
#

I'd imagine if so, you'd see an unexpected token error on that line

earnest phoenix
#

yup

faint prism
#

then fix the syntax

earnest phoenix
#

i did

#

and then it doesnt work at all

#

i did

cinder sandal
#

how to make an calculator command

faint prism
#

are you calling looper()?

cinder sandal
#

in discord.js

faint prism
#

Whatever you do, don't just eval it

#

lol

earnest phoenix
#

why can't I get the profile picture thumbnail?

{
"kind":"t2",
"data":{
"icon_img":"https://styles.redditmedia.com/t5_16r5ps/styles/profileIcon_7cqjq4t22iq41.png?width=256&height=256&crop=256:256,smart&s=4b49cb4c05148c6656567dc42103f992716f5810"
  }
}
        embed.setThumbnail(`${redditp.data.icon_img}`)
faint prism
#

@earnest phoenix try truncating it at the ? character so it will run like this

embed.setThumbnail('https://styles.redditmedia.com/t5_16r5ps/styles/profileIcon_7cqjq4t22iq41.png')
earnest phoenix
#

how can I do it

#

It works when I copy and paste the address there.

faint prism
#

you cut the string at the ? character

earnest phoenix
#

setThumbnail(https://styles.redditmedia.com/t5_16r5ps/styles/profileIcon_7cqjq4t22iq41.png?width=256&height=256&crop=256:256,smart&s=4b49cb4c05148c6656567dc42103f992716f5810)

#

It works when I do this.

faint prism
#

doesn't work when I click it

#

but it works if I cut off the query ?width=256&height=256&crop=256:256,smart&s=4b49cb4c05148c6656567dc42103f992716f5810

faint prism
#

did you google your question?