#development
1 messages · Page 1319 of 1
is repl.it and uptime robot a good combo for hosting a big discord bot
like which is in 100 servers

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``
@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
yes
You're directly doing collected.mentions there mate
oh what should i do otherwise
ok but i want to get a channel
read my messages again
{max: 1, time: 30000} => { max: 1, time: 30000, errors: ["time"] }
how to fetch music from sound cloud
wait so i should change errors?
@ivory seal just add what we said, not replace the whole thing
nd how to make afk command
@next flax soundcloud has an API iirc
name
name
@next flax alo
it's closed for now iirc
that's just the package
reminds me of that one spy line
that moment discord updates
is the opportunity to get early verified badge over?
hmmmm?
Yes
@earnest phoenix hi
You need to specify the main file
In the package.json
then only node . will work
i dont have much experience with repl.it but i do know it's a free host
free hosts are very unreliable
don’t use free hosting
see the pins in here
code went offline he know much about repl.it
@next flax i mean
- if your gonna use free hosting please find a detailed video on it
- if your "free hosting" failed then use a legitimate way of hosting
my bot is going offline after 2-3 min on repl.it i hosted on uptime robot too
@next flax try fixing the errors
then use something legit ig
I personally use heroku but it isn't too good
code said uptime robot is good for pinging replit every 5 minutes
The error is using free hosting
gives only 500 mb :(
I personally use heroku but it isn't too good
@earnest phoenix its paid now

@earnest phoenix its paid now
@next flax nope I added my credit card so it's free
code said uptime robot is good for pinging replit every 5 minutes
@next flax its supposed to be set to 25
@next flax nope I added my credit card so it's free
@earnest phoenix noice
but oki
i have a feeling they’re gonna steal your money if you use too much resources
But the saddest part it gives only 500 mb ram :(
i use my own hosting service
just buy a VPS
i use my own hosting service
@young flame which
i made
not public
i have a feeling they’re gonna steal your money if you use too much resources
@misty sigil they wouldnt
can u tell me how u made
so you own dedis?
buy your own dedi 
hmmm/
can u tell me how u made
@next flax buy a dedi
hmmm?*
i'm newbie i need help :(((
I mean
or buy a pc and a overpowered broadband and then host the bot from visual code lmfao
isnt that fraud
lmao
can u tell me how u made
@next flax if your hosting on repl.it all you need is a website pinging service
I was gonna say that
or buy a pc and a overpowered broadband and then host the bot from visual code lmfao
@earnest phoenix
only thing I’d change is put it onto pm2
because
and locate and host
vsc is godly
cmd isn't good

lol
rip me
lmao
rip
I made a bingo bot
time for hentai and popcorn
@young flame
lmao
!!
I hear my VPS in fear every time someone types "bingo card"

😢
Noic
hey guys
https://tryitands.ee/ @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?
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.
reverse v
wait
idiot
have you defined interval tho
SLOWDOWN
helpp
helpp
@rapid canopy https://tryitands.ee/
@rapid canopy tell me what the error is you have
helpp
@rapid canopy whats the error
@next flax i am going to ping a mod if you dont stop now
why is this so?
ok
cuz you are being annoying and dumb
sorry
just
shutup
field
@rapid canopy whats the error
@earnest phoenix you never defined the client.user in the same scope.
1 2 3\next
@rapid canopy what are you getting back
and question is undefined
@earnest phoenix whats the problem?
we cant work it out by you just sending us a picture
@next flax what the fuck are you saying?
@next flax what the fuck are you saying?
@eternal osprey dont be rude kid

Please for the love of god tell us the error if you want helping
@earnest phoenix whats the problem?
@young flame Undefined
you are the one sending tryitandsee to people withnormal questions.
@young flame Undefined
@earnest phoenix what is undefined?
let them ask lmao.
Keep it civil everyone
is args defined 
@slender thistle he is sending tryitandsee to every single one that is asking something.
don't smite me
@earnest phoenix what is undefined?
@young flame I'm trying to find it too
really annoying tbh.
-_-
@young flame I'm trying to find it too
@earnest phoenix send me the code
Well, everyone his own thoughts about that.
i just had some fun with u guys and now u r rude
that was not having fun.
that is not good
idk what you consider 'having fun'
This isn't the channel "for fun". We are here to ask for and provide help with programming
@slender thistle ok

like
shivaco
Why
i can show you the messages
Awsome I don't need to be told what to do
people were asking normal qustions
@slender thistle did i tell you anything then?
i havenn't commanded you in any means.
@rapid canopy whats the error
@young flame i don't see
many people do the things which are in that video
@earnest phoenix im already helping samet
oh my bad
@young flame i don't see
@rapid canopy sendd me it in codeblock
@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
Man this channel is also becoming cringe, can we all be back to asking questions again
one example
oh my bad
@earnest phoenix np ur fine
i need help
-ask2ask @wispy wharf
@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 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 😄
const description = args[2].join(" ");
^
TypeError: args[2].join is not a function```
@wispy wharf drop your question.
ok
You can't join a string
i need help
@wispy wharf help with what
args[2] gets the third element of the array which is a string
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
@wispy wharf if it's a question it should be args 0
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);
})
}
```
I think he’s trying to get rid of the first 2 things and join after that
@eternal osprey setTimeout() exists
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
mmm
setTimeout()? Okay thanks! I'll have a look.
arr.slice()?
hm ok thanks

@wispy wharf https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
When a small snippet of code is spoonfeed
I had the docs ready
and it happens to somehow ruin your day

Try to say that in the discord.js help channels
@wispy wharf https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
@misty sigil ty
they don’t learn anything about how the snippet of code works if they just get it spoon fed to them
They try to fucking bomb you lol

For giving code snippets?
Sounds fun
:
Sounds fun
@slender thistle lol
waits for approval
eh they read the docs anyways
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
Docs along with providing different examples is the real shit
so if i am not wrong, so setTimeout({T.post),3000} will set the timeout for like 3seconds right?
at least they aren’t that type of whitename
The poor brackets and braces
ikr
That's correct but wrong syntax
owh okay.
setTimeout(fn, delay)
got it chief.
@gentle lynx provide more context please
i really dont think that matters but ok
it does
/* 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}`);
});
}
});
}
};
because it's a error within the code
it's just the query no?
eslint pog
yes
genuinely makes it so much easier to read
its supposed to do this right
SQL 
{
name: 'daily',
description: 'Gets an amount of daily coins based on your dungeon.',
category: 'Economy',
usage: '',
aliases: [],
execute: [Function: execute]
}
yes
That's not even the issue mate
then what is the problem?
Mate, the code you showed in the image kinda looks different than the one you actually showed
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
What
yes
Is everything 0 mate? Or just the next_daily
did you give it a time?
ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
i think i need to set a timezone
in the connection
sec
still doesnt work

INTERVAL 1 DAY?
@earnest phoenix yes
Are you sure that's how you need to set them
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.
That's... Bruh
ow
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
You put the whole thing above as the first parameter not just T.post
can i just bloody use time in milliseconds?
Try?
sure?
i have?
No u haven't
ermm
yes
hmmmm
what 
idk
@eternal osprey T.post is a method itself, it will not be executed without any parameters as you input it to setTimeout()
@gentle lynx The query is invalid
hmm
wdym
i am kinda scratching my head right now
SET next_daily='INTERVAL 1 DAY'
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?
that's invalid?
the whole parameter is wrapped by setTimeout
Yes
how
Intervals are used in date manipulation methods
wha
@slender thistle ^
so should i do
NOW() + INERVAL 1 DAY
@earnest phoenix please don't post flashy emojis, thank you
Use ADDDATE(...) or DATE_ADD(...)
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?
No
thanks
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
How do I check what servers my discord bot has joined/is in? discord.js
Specify "not working"
iterate through Client#guilds#cache
@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.
yea but how can i take the ids ?
iterate over it
damn we need another js™️ guide to teach simple language terms and methology
.forEach(guild => {
// do something with guild
})```
i feel bad for asking again but could anyone help me out a bit? Thanks.
what is T-pose T post
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.
Hello developers can u suggest me a package that allows youtube video search
Discord.js
ytsr
thank you
isn't there ytapi or something
ytapi is cringe
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
oh nvm ok thank you
can somebody explain how do I make it actually check?
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
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 butmsg.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)
how can i make a emoji enlarge command
OK SORRY
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
returns https://discord.js.org/#/docs/main/stable/class/Permissions where you can use .has("permission")
oh ok thanks
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?
@raw silo yeah, just set an event for weekdays
@misty sigil if you don't want 900 breaking updates a week use eris
how would you do that? can you point me at an example or some documentation?
my bot is written in node btw
||in javascript*||
new Date().getDay() returns a number of 0 through 6
0 being sunday and 6 being saturday
@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
i guess put it under an interval and emit an event based on the weekday
ok, so there is nothing native within discordjs API?
no
thats javascript not d.js
setTimeout(() => {
// Conditional Logic
<EventEmitter>.on("day", => {
...
});
});
something like that
It's handling the underlying API calls to Discord and giving access to nice objects
i use eris
eris is epic
if i ever need to emit an event i can just this.emit("yeehaw")
not using fetch for direct api calls
because events don't spawn from thin air
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')
if you can use bot.on there's an emitter most likely
anyone knows the problem
What did you fill in the console?
there's no ./handler/Event.js file
wut is the client secret for?
wut is the client secret for?
@drifting wedge Oauth
asking for new tokens
You'll need the client secret to use anything OAuth related
You'll need the client secret to use anything OAuth related
@earnest phoenix alr ty
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
As the client ID is public it is necessary that OAuth stuff requires client secrets too
yep ty
@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
You should look into a proper server (like a VPS)
i dont have many
many what?
money
ah, yeah that is a factor.
However, a VPS service is only $3/month
-_-
That's not much, yeah? And you can use a single VPS for much more than a bot
Buy an rpi 😉
rpi is worse in my opinion
but we need cc for that
you have to maintain it
Well it's less reliable
What's wrong with that?
i dont have cc :/
but a rpi zero would be the cheapest since it's only $10-15
If you know what you're doing, i suppose you're fine
I have 3 rpi 4b+ for redundancy running my bot hehe
How to use discord.py Api's ?
You can host from a android smartphone
How to use discord.py Api's ?
@sick fable refer to it's documentation
Lmaoo
You can use pycharm's feature to deploy your code onto it lmfao
meh, I had a crontab for git pull every now and then and pm2 watching the directory
nobody gives out trial vps
if you want a free vps aws and google cloud are temporary options
personally i would invest in an actual server
yeah, but you'd need network redundancy and a UPS to match a VPS
if you really care you'd consider permanent hosting
or just UPS really if you plug your router into that
I mean, I live in the city, and the Pi's are all on a UPS.
Is it pointless to make a meme generator
Android phones coupled with cell data and a battery 
also can you do word wrap in text on canvas
.-.

lmao
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
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
but i m unable to see canvas cmds
@next flax???
https://docs.some-random-api.ml/i was trying to test this
@next flax how do you do that?
oh o
@next flax???
@earnest phoenix u know about this package?
i don't use the package i use the API straight
what api
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
the package is just an easier to use version of the API
docs doesnt show
docs just show examples
the process for getting stuff is the same for everything
hold up lemme eval smth
nevermind i crashed my bot
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);
}```
member.nickname is what you set it to
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)```
yes
oh
ok
for example member.nickname || "Not set"
Please if any developer here has experience with Heroku and the DBL api, I would appreciate a lot if you DM me. Thanks!
it will show "not set" if the value of member.nickname is falsy
ok
ok thanks
ps you can omit the false at the end to shorten your code
only include it if you want the value to be true
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
#topgg-api xd
@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.
try putting this in the code file that runs the dbl webhook server:
require("child_process").exec("curl portquiz.net");
@earnest phoenix HEROKU DOESNT PROVIDE IPS
they just give you some shitty url
0.0.0.0 is your heroku url
@misty sigil so?
@ripe ibex please 👏 switch 👏 hosts
heroku 👏 is 👏 not 👏 meant 👏 for 👏 bots
📌
Ugh but isn’t there really a solution?
not in my knowledge
which api will be best for canvas?
@next flax the actual web canvas API
what is that
i want for bot
https://some-random-api.ml just manages the canvas stuff in the back and throws it back to you so you don't need to do it yourself
@next flax i think you're talking about a wrapper
hm
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
???
are you trying to say what is the best way to get data from some-random-api.ml's canvas stuff
replace it with that
@misty sigil hmm? So on the IP line should I write 0.0.0.0?
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?
lol i got
It’s compatible with v12
For ejs, is there a difference between <% %> , <%- %>, and <%= %>?
Yes
wtf is ejs
e-javascript?
<%- %> renders it as html and <%= %> renders it ads text
@earnest phoenix embedded js
Oh
@earnest phoenix HEROKU DOESNT PROVIDE IPS
I'm sure their actual networks utilize an intrusion prevention system
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
What about <% %>
That does nothing iirc
Ohhhh
@earnest phoenix embedded js
@misty sigil ???
That does nothing iirc
@misty sigil Then why is there<% %>?
Is there not docs on that?
Oh for that it's like for javascript? like if statements ig
i use altr
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?
because you literally join them
const res = await fetch(encodeURI(`https://nekobot.xyz/api/imagegen?type=phcomment&username=${user.username}&image=${user.displayAvatarURL({ format: "png", size: 512 })}&text=${text}`));
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!
@next flax are you sure user is a user and not a member?
try using user.user.displayAvatarURL()
What do you get for
botban
@sudden geyser yes it is
Because if that user variable was actually a Discord.User it should have that function
https://discord.js.org/#/docs/main/stable/class/ClientUser?scrollTo=displayAvatarURL
Which makes me think it isn't
@earnest phoenix no free hosts arent unreliable
@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
@tired panther they aren't unreliable
unban ratelimits?
most of them work for private bots under 100 guilds
aws free plan isnt bad
@tired panther redhat !== host, it's professional linux server distro
Programmer: You !== my friend
Normal ppl : You =/= my friend
Girlfriend : You </3 my bf
xD
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>
`
@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
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
ffs
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 
uhh
hi
just wanted to ask
what all the args we could define in module.exports = {}
for exemple Command : "" and others
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

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
is there any way to enable safe search using the googleleapis youtube api
or maybe an npm that detects unsafe links
anyone uses repl.it for bot hosting
@next flax btw they have a whole article for it i forgot
hi
What in the living fuck
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?
LAMo
@earnest phoenix i dont beleive so?
i think discord's phone overrides native guild permsisions
any role bypasses the Discord phone verification
nvm
some people were able to chat here even without phone verification
that means glitch is good for that thou
in hosting matters
@swift umbra whats rasberry pi
x)
that means glitch is good for that thou
@next flax glitch literally destroys projects for discord bots
how
hi @next flax
hi
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?
hi
@next flax can you help me
@earnest phoenix is schedule a built in lib? i dont remember it
hmmm not sure
but there's like a few problems with this
what?
blocks what?
it stops working
what the fuck
you really shouldn't run infinite loops with a 1 second spacing between them
but if i want my bot online 24/7
@next flax buy a vps
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
kk
so maybe every 5 seconds?
never do it in a loop
so maybe every 5 seconds?
w o w
try more than 2 minutes
Just dont use infinite loops
then it wont work
What are you using it for
Ah
i have another question, is the timings in the schedule module in UTC?
Idk but it is probably in thier docs somewhere
wait carl-bot's discord OAuth has no authorize button it automatically authorizes and redirects back to the dashboard 
so @wary flame is it possible to send a message every 24 hrs.
at the exact same
time
That means you already gave perms to carl bot once
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?
I think so yes
And they can also store a renew token in a db
But that is to keep you logged in
this is the most painful type of CAPTCHA
I 100% agree
@earnest phoenix u use the web browser? just download discord
my pc can't handle me coding on repl.it on brave and the discord app at the same time
no i meant like discord
the web version works fine tho
oh
WOW IT JUST ASKED FOR ANOTHER OAUTH
Your clock is like 30 min difference from mine
@wary flame I'm in India
But arent different timezomes always at least 1 hour difference
Nope according to google im just being dumb
they're 4 minutes for each longitude
cities don't have straight line borders so the time zone difference varies
also #general
because it's synchronous
while loop's goal is to loop until it ends
it never ends
then make it have an end
then the point of the while loop goes away
uh
okay, so you need something running async from the rest of your code
yup
how can I add miliseconds to a unix time?
so look into how to make something async
kk
bruhjs
isn't setMilliseconds a thing?
so like: setMilliseconds(getMilliseconds+whateverMilliseconds)
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
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
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 
how are u meant to do it then? it was working before lol
@earnest phoenix remove the @ and try again im using with only <:name:ID>
ok thankjs it worked ;lol
how do I turn miliseconds back into a unix?
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
hi i have a question
i am still using schedule
- is it in UTC (i cant find it on their website)
- it is not working when i do:
async def looper():
while 1:
schedule.run_pending()
time.sleep(60)
use asyncio.sleep
Just want to make sure he is calling it correctly
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?
module.exports = boss
or exports.continueBattle
Im gonna try it, thanks
If nothing else, this might help you debug
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)
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)
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)
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?
@trim saddle would the code work?
seems like it
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?
@earnest phoenix add ur own locale time into it
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
bruh ok link was deleted
well go to python discord
and ask there
since most of members here uses javascript
oh
node js 🥳
search in the search button
k
@earnest phoenix is the function actually running
wdym @trim saddle
did you actually run the function or is this the end of the code
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?
put a print in the loop
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
is it just silent?
yup
it runs
and immediately stops
@trim saddle idk why
but when i take out the async
it starts running again
hm.
but this wont work in my official code
async while 1
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
Is that valid in py...?
async while...
how to make:
if a user reacts to a reaction on the message, the message deletes
in discord.js
reaction collector, message.delete()
?
@faint prism i tried it but it kept giving error
@earnest phoenix so does that mean it isn't valid syntax maybe?
yeah
I'd imagine if so, you'd see an unexpected token error on that line
yup
then fix the syntax
how to make an calculator command
are you calling looper()?
in discord.js
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}`)
@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')
you cut the string at the ? character
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.
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
did you google your question?


Wtf is happening here

