#development
1 messages · Page 1070 of 1
so in html im trying to do something like that: https://lumap.is-inside.me/SUWGwUuP.gif
a clickable "button" which contains a link to something, but my brain is too smol to do that
do a ```html
<a href="limn">kek</a>
and style in css
hmm
i added a bot but the commads dont work
eg
a:hover {
background-color: pink;
}
commands*
const randomPuppy = require("random-puppy");
module.exports = {
name: 'holomeme',
description: "Sends a hololive meme.",
usage: "r!holomeme",
run: async (message, args) => {
try {
throw new Error('Error');
} catch(e){}
const subReddits = ["hololivememes", "Hololive", "VirtualYoutubers", "hololive", "Nijisanji"];
const random = subReddits[Math.floor(Math.random() * subReddits.length)];
const img = await randomPuppy(random);
const HoloMeme = new Discord.MessageEmbed()
.setColor("RANDOM")
.setImage(img)
.setURL(`https://reddit.com/r/${random}`);
message.channel.send(HoloMeme);
}
}``` Need help, getting a "UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded" error.
these bitches still use random puppy
what
well imma noob, so that's the first thing I found
node fetch 💯
The error usually means you have some infinite loop or recursion running.
Do you have a stacktrace to go with the error
to be eaxct im searching to do some text that doesnt look like a link but which is in reality a link
Also why are you throwing an error then catching it. js try { throw new Error('Error'); } catch(e) {}
but once again my brain is too slom to do that
Also why are you throwing an error then catching it.
js try { throw new Error('Error'); } catch(e) {}
@sudden geyser Well, that was my "trying" to fix the error.
That's not responsible for the error.
Do you know what is?
It would be easier to spot if you had a stacktrace.
oh
sorry
at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:4:22)
at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
(node:14152) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated
either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14152) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
index.js line 4 column 22
You have some infinite recursion running in a dependency of yours.
What you mean by an infinite recursion? Can you give an example?
a function that calls itself
var name = function() {
return name();
};```
something like that is happening
^ In this case, it's an issue with a dependency. The actual flow is your project -> random-puppy -> unique-random-array -> unique-random
hey so my bot just got approved and i am getting this error in heroku
ik heroku isn't good but i can't offer paying money rn
so since the bot got approved and the bot goes online and offline continuously
idk why this is happening
it's a 1st
so this is the error i get ig
Stopping all processes with SIGTERM```
module.exports = function (min, max) {
var prev;
return function rand() {
var num = Math.floor(Math.random() * (max - min + 1) + min);
return prev = num === prev && min !== max ? rand() : num;
};
};```
Index.js in unique-random
hey so my bot just got approved and i am getting this error in heroku
ik heroku isn't good but i can't offer paying money rn
so since the bot got approved and the bot goes online and offline continuously
idk why this is happening
it's a 1st
so this is the error i get igStopping all processes with SIGTERM```
@regal jacinth signterm = ctrl + c in my knowledge
look for close codes so u get it
anyone know any good text uploaders for longer than 2000 eval outputs
There was a good one I remember using but I can't remember the name sadly. To be honest I'd just send the text as a file instead of up to a service
i wanna do it in an embed tho
you shouldn't, are you sure what you're uploading is completely fine to be public?
by the way, embed description can store up to 2048 characters, just in case you want to increase it a little
2048, then i'll implement pages
(node:7047) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 19)
(node:7047) UnhandledPromiseRejectionWarning: Error: Client network socket disconnected before secure TLS connection was established
at TLSSocket.onConnectEnd (_tls_wrap.js:1088:19)
at Object.onceWrapper (events.js:277:13)
at TLSSocket.emit (events.js:194:15)
at endReadableNT (_stream_readable.js:1125:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
help
code pls
consol erorr
where did the error come from
just saying help and providing an error isn't enough
ok

cool
Can someone fix my code? I use discord.py and @bot.command() is not working...
from discord.ext import commands
bot = commands.Bot(command_prefix="!")
@bot.command()
async def ping(ctx):
await ctx.send("Pong!")
Is that your entire code?
At the bottom of the code
if __name__ == '__main__':
bot.run(token)
Full code please
is there a way to host Discord python bot on a cpanel ??)
cpanel? What
a panel like plesk
isn't cpanel for web?
hello, i'm trying to fix my editsnipe command, i wanna show edit snipes only for server that i'm using the command, but it shows me message edited from all servers that bot is in, that's my code
async def editsnipe(ctx):
embed = discord.Embed(colour=bot.org_message.author.color, description=f"**Original message:** {bot.org_message.content}\n**Edited message:** {bot.ed_message.content}", timestamp=ctx.message.created_at)
embed.set_author(name="Last edited message from: {}".format(bot.org_message.author), icon_url=bot.org_message.author.avatar_url)
embed.set_footer(text=f"Sniped by: {ctx.message.author}")
await ctx.send(embed=embed)```
it's possible to deploy a python application
but i don't think it's suitable for discord bots
collected.first() is the first detected reaction right?
What is bot.org_message
bot original message
@slender thistle it should be like this, I just want to fix the @bot.command()
or is it just the one that it collected
it shows the message before edit
Kee, what's your discord.py version?
@rapid tapir Are you sure you are restricting the event to your server?
async def on_message_edit(before, after):
bot.org_message = before
bot.ed_message = after```
actually not
Boom
@slender thistle version 1.3.1 by Rapptz
how do I get the most recent reaction on a message using awaitReactions? (📖 : discord.js |
)
Any errors you get, Kee?
@slender thistle Nope, it doesn't show any errors
@solid falcon How are you using the command
Are you sure you are running the bot also :^)
!ping
and yes i'm running it
Are you running it under the right bot account
Hello everyone.
I've been testing different permissions sets for my bot and I'm getting 'Missing Access' error even when I enable every single permission except admin.
Bot makes permissions overrides for users when they join/leave certain voice channel.
I've been discussing the issue with one of the moderators, and he said that everything should be working without admin permission.
Am I doing something wrong?
Only @bot.event is working @slender thistle
I don't know why @bot.command() not working
Which event is that?
on_message
Do you currently have one?
Like this?
What is bots
Anyhow, you need await bot.process_command(message) at the very end of your on_message
it allows for @bot.command to be used
...just a side question
could you please send me the actual up-to-date code you run the bot with
i want to do a eval command for my bot, but i have no ideia how to start, can someone pls give a hint of how can i start?
could you please send me the actual up-to-date code you run the bot with
@slender thistle https://ghostbin.co/paste/tsurx
Anyhow, you need
await bot.process_command(message)at the very end of your on_message
chunk them
won't you be ratelimited?
depends on how many messages
yes
loop or regex
would this work with dbl.webhook? Since, when I use express, the url I get is just the ip and port without the path.
if(message.author.bot) return;
can i do the same thing like this for only guild owner ?
@viral iris yes
compare the id to guild#ownerID
i just-
He just did. Comparing values literally are like 1 == 2; // returns false
dont get it?
1 !== 2 // returns true

what 1 & 2
that's a bitwise operation
if(message.guild.owner === message.member)
almost
what's wrong ?
extremely close, 1 letter incorrect
owner sometimes needs to be fetched, it's safer to use ownerID and compare it with message.author.id
if(message.guild.owner) return ;
So made a function that shows the actual uptime of the client... All works but i want it to slice off the s off of the hours and minutes or whatever if the number is 1, this doesn't work...
_eval Discord.Client.prototype.Uptime = function Uptime(){
let time = ms(this.uptime);
return Object.entries(time).filter(u => u[1] > 0 && u[0] !== "milliseconds").map(up => `${up[1]} ${up[0].toProperCase()}`).join(", ").replace(/(\d?1\s\w*)/gi, gTS => gTS.slice(0, -1));
}```
Output:
```2 Hours, 7 Minutes, 1 Seconds```
For example i want that `1 Seconds` to be `1 Second`
check if it's 1, if it is, slice -1
What am i exactly doing there
still don't get it ?
w h a t
Bruh wtf

you use an if statement to check if it's 1, if it is 1, you will remove the last letter using string = string.slice(0,-1);
that is how I would do it
if (!message.guild.owner) return false ;
I never use regex, so my methods are just using JS
how do i split strings after X characters?
you check if it's that amount of characters
if it is
you make it the string but split it at that place
alr got that
I would make more variables by slicing
i want it in an array
for each of the times it reaches x
is it right ?```js
if(!message.guild.owner) return;
Just
ok thx lol
@earnest phoenix after filter, .map(up => (up[1] + (up[1] < 2 ? up[0].slice(0, -1) : up[0])).toProperCase())
has anyone used dashflo for hosting
I actually... Tried that but imstead of up[1] < 2 i did up[1] === 1
Wait
Yours doesn't even
:waitWhat:

better version js .map(up => `${up[1]} ${up[1] < 2 ? up[0].slice(0, -1) : up[0]}`.toProperCase())
previous one didn't have a space after the time
Yours didn't just slice the s off, yours sliced off the entire <Number> Seconds 
wouldn't up[0] be something like "seconds"?
i never used that module so i have no idea lol
yeah
I am the old fashioned js noob
cool
using js functions to get date
it does
but some date are complicated so new Date() can't parse it, so that's why people prefer moment
ye
some people*
sometimes it fucks up as well
like wdym cant parse it
sometimes people just work with timestamps
like
it's perfectly fine to use new Date()
sometimes the actual month is 3 but it shows 2
oh
happened to me some times
not all dates are like 2020-07-20
u mean formats?
it supports other formats too like 12 Jun 2020 but still
yea
https/discord.bots
no
@pale vessel no
is there a way to host completely different files on the same server
ex. having two folders with their seperate node_modules
how to do when a person do -setup #channel then in that channel whole code execute just like welcome
it should detect that automatically [@celest schooner]
I join server link
Re: When I do let prefix = db.get('prefix_${msg.guild.id}') it doesn't read my command file, but when I do let prefix = botconfig.prefix, it does.. what's the problem?
bot.on("message", async(msg) => {
if(msg.author.bot) return;
let prefix = db.get(`prefix_${msg.guild.id}`)
if(prefix === null) prefix = botconfig.prefix;
let args = msg.content.split(" ");
let cmd = args[0];
if(cmd === `${botconfig.prefix}help`){
var file = require(`./commands/help.js`);
file.run(bot, msg, args, prefix);
msg.reply(prefix)
}
});```
No errors though
it should detect that automatically [@celest schooner]
@pale vessel wdym
the server?
it should pick the module from the node_modules folder in the same directory/index root
it wouldn't pick outside
@pale vessel omg... My own fucking way worked without needing anything... The function was just assigned and not changing anymore until i restarted the client 
Anyone here know how to make a web panel or use dashcord for python?
up[0] = keys
up[1] = values
if so then my code is shorter and more efficient
Mine is the same
it should pick the module from the node_modules folder in the same directory/index root
@pale vessel oh okay thanks!
im new to making discord bots what free things do u guys use to code them.
eris
I use Djs
i moved from eris
Just because I like JS and the library is simple
@pale vessel what to
d.js non light
for now
discordeno is better
detritus better 
RigidCord is better 
d.js-light is is D.js V12 but with no caching. in the base configuration uses less ram than Eris
anyone know how i can split string into array in 1500 character chunks?
yes
@misty sigil regex or loops
@earnest phoenix i would update soon
regex seems more compact
regex is a bad way
could be slower
yea
again?
how would i do that?
in october V11 is getting killed
jk
i was changed to v12 like 2 weeks ago
make an array
start with an empty string in array
loop through characters (text.split(""))
if last element in array is >= size, add new empty string element
add character to the last element
@misty sigil
djs-light is the shit
i'm probably gonna go with regex
although it's splitting linebreaks too
/.{1,2000}/g
``` is what i have so far
how do i cut the line into 2 lines
i want the css a
but it needs to be in 2 lines
add \n
Hi Guys
Question
So I want to make a website for my bot.. what's the best website makers I should use?
I heard about nicepage and Mobirise4
If you don't wanna code it yourself, I think the best way of doing it is just grabbing a template. I don't recommend website makers. But that's just my opinion.
Is Mobirise good?
its a nice website maker
@honest perch mhmm
smh
😮
@pale vessel html is the best website maker, no doubt
agreed
made this with it https://misly.dev/
don't use website makers
WYSIWYG ftw
oof

Very cool
mine almost 1k in 2 weeks
Nicee
How?
lmao3d
Would there be a way I can create an object in javascript in a separate file like I could in C# or Java?
Then do like new Object();?
sounds like a class
No just go like so:
const object = {
property1: "nonsense"
}
big brain.
but yes, you can create a new class with class MyClass {...}, export it, then just import it and use new MyClass(...)
Gotcha
For something like this do I need a constructor?
module.exports = (id, name, status) => {
class todo {
}
}
the constructor goes inside the class
module.exports = class todo {
constructor(id,name,status) {
}
}
Ahh gotcha
because who cares
:/
lmao
I do ;)
Your strict linter will scream at you
isn't Vinniehat old mod?
yes
does anyone know a simple way of debugging a memory leak? i found its coming from arrays but that doesn't tell me much tbf, it seems to be a lot of tiny arrays combined to form that but yeah im not doing to look through that many elements
Heyo,
I'm trying to split a message using a delimiter that is more than one char long without removing the char.
I know how to do this with a delimiter that is 1char long (/([c])/, 'c' gets split)
An example of what I'm trying to achieve:
>>> let foo = "b-=a-=r";
>>> console.log(foo.split(/smth here that does that splits by '-=')/));
..< ["b", "-=", "a", "-=", "r"]
``` Here's another (simpler) example: ```
IN: HE|LL|O
OUT: ['HE', '|', 'LL', '|', 'O']
``` So basically this (<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split#Splitting_with_a_RegExp_to_include_parts_of_the_separator_in_the_result>) but with multiple characters.
Really
I am not online only for 1 day
And you loking my bot when I cant look internet
are you self hosting it on your computer or something
Must am I wait 2 month more
are you self hosting it on your computer or something
@sudden geyser a hosting application
I've been waiting for 2 months. I wish we could be prepared whenever you let me know when my turn would come. 2 months of labor wasted
@ruby talon I tried experimenting a bit, and came up with the answer: <String>.split(/(YOURDELIMITERHERE)/). For example, "this is a string".split(/( )/) returns [ 'this', ' ', 'is', ' ', 'a', ' ', 'string' ]. However, I don't really see the point in this unless you really need the separator in the middle. I'd just use .split(mydelimiter) and .join it later if you want it as a string.
Also Mehmet I'd talk to the moderator who denied your bot, but I doubt it would do good since your bot is expected to be online and I don't run this.
"2 month more"?
You mean a few weeks
@ruby talon I tried experimenting a bit, and came up with the answer:
<String>.split(/(YOURDELIMITERHERE)/). For example,"this is a string".split(/( )/)returns[ 'this', ' ', 'is', ' ', 'a', ' ', 'string' ]. However, I don't really see the point in this unless you really need the separator in the middle. I'd just use.split(mydelimiter)and.joinit later if you want it as a string.
@sudden geyser That returns an invalid Regex expression for me, I wouldn't be asking this if I didn't need it ehj x)
I think I found a solution tho, lemme test it ^^
it was close to a month but not 2 months
For me the regex works 
hello fellow humans
im showing servers using ejs and it works for servers using normal icons but if a server doesnt have one
would i replace it with the discord asset server side or in the ejs file?
64553578736037507368736034680468349th time to add the discord bot Yurian#6082 :(
is that your bot?
yes
did you add it through the website?
yes
then wait for approval
but it's declined
then fix the issue, and add it again
it's declined because of a f...ing command shows a server list :(
@honest perch check if document.icon exists, if not, replace it with the default icon's url
i changed the usage permissions of this command
in the ejs file or server side smart person
either, probably easier to do in the ejs
@earnest phoenix you need to add it through the website again
and wait for verification again
Tim is it okay to host an ejs server on my own laptop?
besides slow internet and downtimes, yes its ok
Lol
@sudden geyser found a little solution:
message.split("splitter").join(",splitter,").split(",")
😄
hmm
hey after how much time should i change my bot's presence?
iirc discord's fine with 10x per minute? i'm doing it 4x per minute tho. thats fine?
@quartz kindle im stuck, i dont know how to both have a for each and an if
cant you simply do document.icon || "defaulticonurlhere"
wait, that works?
would src="https://cdn.discordapp.com/icons/<%= document.id %>/<%= document.icon %>.png?size=256 || https://discordapp.com/assets/dd4dbc0016779df1378e7812eabaa04d.png"
work
or am i being stupid
im being stupid
a what what
document.icon ? `http://ppiwjpfiwe/${document.icon}/ouwehofuwhe` : "http://defaulturl"
ah yes, ppiwjpfiwe
iirc discord's fine with 10x per minute? i'm doing it 4x per minute tho. thats fine?
@untold folio I think it was at minimum, 5 per minute, but I can't find it in the documentation anymore. I'd recommend you come up with something reasonable, as you probably don't need to update it every X times per minute.
what am i supposed to replace ppiwjpfiwe with lmao
v
how do i split a string into array every 1500 chars
My code currently is js let array = evaled.split(0,1950)
i thought you used regex
It splits into a few lines but nothing close to the specified amount of chars
I decided to try other methods flaz
use a loop
nah
@misty sigil wdym nothing close to the specified amount of chars
idk i think that should split it every 1950 chars afaik
split works with delimiters, not length
for length you need slice/substring/substr
ah right im just using the wrong things
@quartz kindle where do i put that
uh...
src="https://<%= document.id && document.icon ? `cdn.discordapp.com/icons/${document.id}/${document.icon}.png` : `discord.com/assets/woeugwouehowueg.png` %>"
thank you kind sir
now time to filter permissions 
how do permissions work as a user
is 2147483647 admin?
is this bitfield?
just res.json(req.user);
2147483647 & (1 << 3) returns 8 so I guess that includes admin
unless that's not how bitfields actually work and my copy-pasted-from-2018 snippet is wrong
time to see if my spaghetti works
of course not

@quartz kindle should one filter guild shown by permission server side or ejs
either

ok, let me think about if im able to do it and then ill most likely come back for help
must do one hard think about splitting strings into 1900 char array sections
u just
do
<Guilds>.filter((e) => e.permission & bitrate).whatever
imo u probably should do the loop client side instead of server side
requires extra effort
not that much
Anyone want me to buy them a vps?
hi, i just added the aliases to my bot. but i have a little problem when i place a nonexistent order i have those problem
var args = message.content.slice(prefix.length).trim().split(' ');
var cmd = args.shift().toLowerCase();
var command;
if(bot.commandes.get(cmd)){
command = bot.commandes.get(cmd);
}else if(bot.commandes.get(bot.aliases.get(cmd))){
command = bot.commandes.get(bot.aliases.get(cmd));
}else{
return;
}
command.run(bot, message, args, prefix)```
```TypeError: command.run is not a function
0|main | at Client.bot.on (/root/juzoo/main.js:713:15)
0|main | at Client.emit (events.js:203:15)
0|main | at MessageCreateHandler.handle (/root/juzoo/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
0|main | at WebSocketPacketManager.handle (/root/juzoo/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:108:65)
0|main | at WebSocketConnection.onPacket (/root/juzoo/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:336:35)
0|main | at WebSocketConnection.onMessage (/root/juzoo/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:299:17)
0|main | at WebSocket.onMessage (/root/juzoo/node_modules/ws/lib/event-target.js:120:16)
0|main | at WebSocket.emit (events.js:198:13)
0|main | at Receiver.receiverOnMessage (/root/juzoo/node_modules/ws/lib/websocket.js:789:20)
0|main | at Receiver.emit (events.js:198:13)```
command is undefined
you could replace half of that code with a one liner lol
how am I supposed to define command if the command does not exist?
command = <Collection>.get(args[0])
let command = bot.commandes.get(cmd) || bot.commandes.get(bot.aliases.get(cmd))
if(command) command.run(...)
I cannot run a file which return example this command does not exist?
the problem is not that command doesnt exist
the problem is that a command has no run function
@digital ibex it returns all user info that i collected with discord oauth
for each
like js app.get('fatty', (req) => { // whats here });
ok
oh ok
u can just like do
const fullserverList = req.user.guilds.filter((e) => e.permission & bitrate number);
does this make sense cause my terminal tells me this is the error
let args = message.content.substring(PREFIX.length).split(" ");
guys?
its the permission bitrate number
@unborn haven show error
just a sec
@digital ibex yeah, no
what
no what?
u know what this means?
The error is self-explanatory: message is not a defined variable.
@summer torrent u know what this means
yes but it says that let args = message.content.substring(PREFIX.length).split(" "); this is wrong
apparantly
Yes, so where did you define message
this is all the code in the catagory
theres a max of 10 message limiters @earnest phoenix
thats what the error says
says you have 11
let args = message.content.substring(PREFIX.length).split(" "); is the problem
@digital ibex what would i define bitrate as? The number?
sooooo whats the problem?
what can i do about that 🤔
@honest perch ^^
guys i am just trying to do a kick command but i have this problem
can someone pls help me : (
you just gave your code, thats not a problem 🤔
the problem is: let args = message.content.substring(PREFIX.length).split(" ");
here let me send screenshot
@digital ibex im aware how permissions work
have you read it?
mhm
you're obviously not fully aware,
i dont understand what im supposed to do lmao
can someone help me
where are you confused?
const fullserverList = req.user.guilds.filter((e) => e.permission & 0x80); this here
i sent screenshot of this command not working: let args = message.content.substring(PREFIX.length).split(" ");
yeah and it wont work
????????????????????
ok bye . : (
whats not working?
as you can see from the shade its not using it
are you have retard
@unborn haven its kinda hard to read your formatting ngl
are you have retard
@digital ibex yes
oh lmao
fullserverList
the bitwise number is incorrect then
ah wait
permission instead of permissions
right
it returns less servers but iirc im not an admin here
nvm
fixed
ok
thanks
who here uses eris' command framework?
Hello people I need some help making my bot! I need a confident developer that knows d.js v12 very very well, I am asking for help because I’m noticing it’s incredibly time consuming adding new features recently, I will only accept help from people with a bot dev role here and a bot here coded in discord.js please DM me if you would be interested, this is not a me thing it would be an us thing, thankssss
pretty sure the mods will tell you to not ask in this server @obtuse jolt
and to ask on fiverr if you need devs
I’m not asking in Fiverr
I could see that but people know exactly what I want here
And to find that anywhere else it’s the easiest
lul fiverr
🤷♂️
I've made like $80 off of a month in fiverr 
I made $0
no, someone literally paid me $30 to add a bot to their server when I told him I'd do it for free
lol
intense coding I see
I didnt even make a bot for it, I added it. I told him I would just do that for free but he said "Your knowledge and time is enough"
literally just free money at that point
did u take it lol
I didnt have a choice, people can tip you on fiverr regardless of whether you do anything
and idk if there's any way to refund it
lol
life is funny
still, trying to split my string correctly
how do you need it to split then
1950 characters per array entry
from a single string?
well from a eval
does JS not support string indexing?
thats what im trying to do lol
does anyone have any vps/server advice
no like which one
i use galaxygate
I use scaleway
i got one from oxide
contabo are pretty good
contabo i heard oversells pretty bad
don't think it rly matters which one
im looking for a cheap one tho
their cheap ones are a little underpowered but theyre still great on support
but scalable
is it virtual servers or website hosting
i wanna learn deno, anyone know any good resources?
you can host website on vps
use namecheap
whats a dedicated server
dedicated can mean a few things
If my bot adds everyone a role on the server will be it api abuse?
what if you do it slowly tho
then no
2 seconds will be enough?
@misty sigil this is the sort of logic you need for splitting every 1950 characters:
text = "a" * 200000
split_on = 1950
length, extra = divmod(len(text), split_on)
if extra != 0:
length += 1
array = []
for index in range(length):
section = text[index + index * split_on: index + (index * split_on) + split_on]
array.append(section)```
this is python just cuz
thats google right
pithon
I've been trying to implement webhooks in dotnet but no success, any good resources to learn?
you can still take the logic and implement it in js 🙃
even i can probably work how todo it in Js and i do very very little js
anyone tried to use dashflo
wait what
which is this?
but isnt that enough for small bots
MB
what
not GB
just for comparison @celest schooner
do you get a processor too or just ram? $500 per ghz?
^
its extremely cheap, but also dumb expensive at the same time
your paying for practically no resources
i guess
what are you looking for, ramen?
well im looking for a server that can host my current bot, and in the future, ill maybe want to add a website or more bots on to
without having to buy a new one
wait
also one that can hold sqlite wrappers
without having to buy a new what?
a new instance
instance of?
https://jeremy-clarkson.is-inside.me/rnsNPM3j.png is this good?
like server
new vps
how much memory, jeremy?
2GB
oh
it says 
but i dont even know what to look for
🤷♂️
yea ill compare some more
i'd use a managed instance of the database even if you have a vps
i'd use a managed instance of the database even if you have a vps
@proven lantern wdym
do is a bit more expensive due to being a well known name.
couldnt u just use mongodb since its free
what sqlite wrapper do u use bro @celest schooner
instead of like s3 or rds
wait wrong person
i recommend using https://beta.libraryofcode.org, unsure if they support sqlite wrappers though. they're free and they r pretty good for free imo
i meant officiallylost
?
what sqlite wrapper do you use?
i dont use sqlite
ruby on drugs
i use enmap
yeah use mongodb if you can
or some other hosted db
im trying mongodb
i would probably have to make another bot to implement mongodb
mongodb is amazing
i recommend using https://beta.libraryofcode.org, unsure if they support sqlite wrappers though. they're free and they r pretty good for free imo
@digital ibex where do u start for hosting
its pretty easy to use
click it
click where
join the discord server
its not just for hosting, they do classes for beginners too
u might be able to join a mongodb class which teaches u how to use it
everything is all free
okay thanks
np
looks like you have to dm someone for access
wdym?
in the discord server
a modmail bot
is that free tho
most likely outdated
yeah
is it reliable tho
yeah
i host my website there
never had an issue with them
only a few downtimes and i've been using them since like dec 2019
donations
and ads
im pretty sure nearly everything is open sourced and for that, they're getting some kind of sponsorship thing
dont quote me on that tho, im not a mod or anything
Is this too much text?
not really
Ok
I need different colors for: Statistics, Economic and Gambling any idea for these colors? I just did yellow for them all but it looks odd to have 3 different categories with same color
Oh cool
They're so useful
https://getwaves.io/ like this one
making wave svgs is stupid
y
Oh thats dope
Rather spend an our finding my own
Is there a way to write this more compoact
map1 = new Map();
map2 = new Map();
map3 = new Map();
map4 = new Map();
use a loop?
christ i want to break up my bots backend into microservices and im already at 5 seperate processes
also cant you just do let map1, map2, map3, map4 = new Map()?
yea
oh so just
The way they're currently doing it is fine imo
let map1 = new Map(), map2 = new Map(), map3 = new Map(), map4 = new Map()
that?
is 0.303ms slow or fast to search through 149 users?
Pretty quick
actually nvm read that wrong
const user = require('model');
user.findOne({ id: message.author.id });
and it took 303ms to do that
so i made a doc gen thing but run into this issue in my html file where the html comes out as a string and won't render
but my bots ping self hosted on a shitty pc 200ms, and im doing more than just that 
how r u doing it, tony?
storing the html in an object then using it ${object.html}
route.content is this
content: '<h1 id="hello">Hello</h1><br /><p>test content</p><br />'
its valid html
whats the diffrence between vCore and vCPU
okay thanks
its using reef which is similar but its diff
A lightweight library for creating reactive, state-based components and UI. Reef is a simpler alternative to React, Vue, and other large frameworks.
i have allowHTML set to true
well any general solutions?
i'll try anything rly
its just a templating system nothing complex
oh scaleway changes their prices to 5 bucks in a month
the stupid one i wanted to try was just document.getElementById lol
inspect element doesn't even think its html
what does the network tab show?
oh :/
im not sure if this would change anything, but try doing js template: (props, route) => { return '<p>hi</p>'; });
as in with that content or
can be anything, but not dynamic
how much ram does like dank memer use
ask them
got it
cant help much, sorry
okay
@digital ibex i fixed it by instead passing the markdown to the browser then rendering it inline
works now
oh cool. nice
nobody in here i think
hey whats the command to give a user a role in discord.js?
<member>.roles.add()
unless u using v11
thanks
@celest schooner anywhere from 100mb to 5gb
depending on libraries, purpose, caching, optimization, language, etc...
mine is 119 MB with 80 guilds
mine is 116 MB with 3800 guilds
uhm
5 gigabytes damnnn
mine is 16.7mb with 6 guilds
idk make one yerself
OfficiallyLost :)

no thonk me
anyone know the v12 version of bot.ping. It use to work back in v11 but idk what the v12 version is
@celest schooner thanks
np
hey can anyone explain me how does node-cache work? like if i do this
const myCache = new NodeCache( { stdTTL: 100 } ); would every element last 100 seconds in the cache even though i don't specify the ttl when doing .set?
and that's for each element right? it would delete a certain element x seconds after it was stored
Yes.
stdTTL would set the default timer for how long an object lasts in the cache before being deleted. It's not deleted as soon as the timer reaches zero, as it instead checks during a period of time (better than setting a bunch of setTimeouts)
ohhh
and whats the best relationship between that period of time and ttl?
proportion* lol
wdym
should i just do it like this? new NodeCache( {stdTTL: 1200} ); cause there's another option thats called checkperiod
Yes. I'm just going off the documentation as I've never used the package (though it's very useful). If you wanted to add another option, you'd just add it to the object.
oh alright! thanks
Object.getOwnPropertyNames(p);
})``` how's it possible to run an eval that runs a promise then show the actual result instead of
Promise { <pending> }```
Get the result from the eval(...) function call, and check if it's an instance of Promise. If it is, await it.
await => you can only use await in async function which turning it into an async function and executing it will cause to not call back the function and still say promise { <pending> }
Tried many ways

@commands.Cog.listener()
async def on_dbl_vote(data):
channel = self.client.get_channel(734610683718664203)
embed = discord.Embed(
colour=discord.Colour.purple(),
description=f"{data}"
)
await ctx.send(embed=embed)
doesn't show an error
i want my bit
bot
to search if the channel is in server
and get it's id
and then send the second arg in that channel
by name?
yes
like i do
s!say #commands Bruh
so it send the msg there
module.exports = {
name: "say",
execute(message, args, bot){
if (!message.author.id === '<719052008690024469>') {
message.delete();
message.reply('You do not have the permissions to use this command.');
return;
}
if(!args[1]) return message.channel.send("Please specify the channel you wish to speak to! i.e `!say #communications`");
if(!args[2]) return message.channel.send("Please specify what you want to say! i.e `!say [CHANNEL] [SAY]`");
let say = args.splice(2).join(" ")
let channel = args.shift().slice(2, -1);
message.delete();
bot.channels.cache.get(channel).send(say);
}
}```
this is the code
but it says cannot read say
of undefined
how would you find the user who reacted in awaitReactions
@delicate shore that error is not thrown there
e
its somewhere else
@tired nimbus I'm sure the collected after awaiting the reactions is done also returns an array of users
yea It returns a map that seems to have the usre
Yea but if you want to see who was the user who reacted at the time a reaction was added, you gotta go with <Message>.createReactionCollector()
Instead of <Message>.awaitReactions()
await => you can only use await in async function which turning it into an async function and executing it will cause to not call back the function and still say promise { <pending> }
@earnest phoenix I have no idea what you said, but code can speak clearer than words sometimes: ```js
let res = eval(myCode);
if (res instanceof Promise) {
res = await res;
}
This is what I meant by. You simply eval it and check if it's an instance of a promise. If it is, await it so you have the result. If you can't use async since your function is not `async`, simply make it async or use `.then` (may lead to uglier code)
i don't think you have to check if it's an instance of Promise, this just works:
var result = await eval(myCode);
@sudden geyser i knew of that lol, i was trying to say do that while inside an eval...
Not in the code of the eval command, i already have that... Was just asking if this was possible to resolve it from inside the eval not the code of the eval command itself

module.exports = {
name: "say",
execute(message, args, bot){
if (!message.author.id === '<719052008690024469>') {
message.delete();
message.reply('You do not have the permissions to use this command.');
return;
}
if(!args[1]) return message.channel.send("Please specify the channel you wish to speak to! i.e `!say #communications`");
if(!args[2]) return message.channel.send("Please specify what you want to say! i.e `!say [CHANNEL] [SAY]`");
let say = args.splice(2).join(" ")
let channel = message.guild.channels.cache.get(c => c.name === `${args[1]}`)
message.delete();
bot.channels.cache.get(channel).send(say);
}
}```
this is not working
i don't think you have to check if it's an instance of Promise, this just works:
@sonic lodge that works, but if it doesn't return a promise, it's sort of unnecessary (andawaitworks in weird ways even if it's notasync).
i see
anyone help me too
PGamer what doesn't work about it? your if condition has two issues:
- Your not
!operator is on the wrong side. You should remove it and use!==instead of===. Else, you're comparing a boolean with a string. .idreturns a string of numbers. It doesn't return a mention or<>before or after it.
but @sudden geyser error is it says cannto read property send of undefined
then channel is undefined. .channels.cache.get does not accept a function in the first place
use find lol
ok
const msg = client.snipes.get(message.channel.id)
Cannot read property 'get' of undefined
Can Anyone Help Me?
did you define snipes on the client variable.
no
@earnest phoenix are you use a snipe module?
ya
i made a bot but i am still working on the commands
async execute(message, args, client, users, cashe) {
message.channel.send("<@&734634711208689674> || <@&724525049607880764>")
const embed = new Discord.MessageEmbed()
.setTitle("Reports Command")
.addField("Report Started", `${message.author.tag} I have alerted staff, Please be patient.`)
message.channel.send(embed)
client.users.cashe.get("694367588464984095", "470825695237636107").send(`${message.author.tag} , Has used the ``g+report`` Command. `);
return;
}
}```
**It says "Cannot read property 'users' of undefined**
means "users" is undefined 
check if client actually has a users property
uh
very cashe money
you misspelled cache
oh it's a function parameter lol
probably client is invalid
How do I validate it?
(node:11186) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
time to learn to read errors
Nice System :O
gg

