#development
1 messages · Page 774 of 1
For example, you dont have the on message listener
two you havent got any sort of event handler iirc
^
- you are returning anything with that message content which will just be nothing
@Lady Neko the Third I have the message listener
- you will try add a reaction to every message
I dont see it
- i dont even think thats how you add reactions in d.js
It’s going to react to everything other than “#test”
yeah it is only a part of code
- you arent using a correct if statement
Although yeah I only know JDA
My code for my own bot in js, for sending a message
if (receivedMessage.content.startsWith(prefix+"neko")){ receivedMessage.channel.send(nekoEmbed)}
that's how you would structure a if statement
or if (cmd = "smh") return reaction("9") ex
^
Wait if you use startsWith doesn’t that lead to any command starting with “neko” to be caught
Like you couldn’t have two commands with aliases that start with “neko”
I would parse args if needed
that's what I do for my main bit
bot
I define the base (neko) command and split it into sub commands, (startswith), and then I split the args off of it
Gotcha just checking
So for example, #=neko upload req:url/attachment would have the command layout be:
Main command: neko
Sub-command: upload
Arguments: <req:url/attachment>
I should start uploading all of my commands to the github tbh
But your main command could be “nekoa” and it would still work?
Yes, technically.
^
that's how arguments should work
So you couldn’t have any other command with an alias that starts with “neko”
why would I need a alias for it
I mean the name of any other command you write couldn’t start with “neko”
client.on("ready" () => {
console.log(${client.user.username} rocket arrived on Mars!);
client.user.setActivity(${cliet.guilds.size} Servers);
}
please anyone can help me in this code ?? whats wrong
cliet
If you’re asking why you would want another command that starts with “neko” idk
no ""
?
You need a comma after “ready”
"ready,"
also, what I would do for aliases would be make the command #=n and make the main command use the same sub command system
Also you need ‘around the strings
"ready",
oh ok
@tranquil drum what
Ohhhh
guys i got this error message
/home/runner/discordjs/index.js:12
}
^
SyntaxError: missing ) after argument list
Add the missing )
stop spoon feeding at this point
put ) where
@mint storm learn the language before you make a bot
learn basic js
^
The same way you would call any function, you have to close the argument list with a )
LMAO
is there way to fix this file please
i am not kidding
i see the error and i dont even do js
Too many of you young devs think developing Discord bots is easy without learning the programming language first
@mint storm this is your 2 or 3 or what ever time here asking for help. so
learn the basics
- Rico
even to make a simple program you need at least basic understanding of some part of computer terminology
nice token leak
^ and security
@mint storm learn the basics
Oh yes please cry send that video
jesus
ok
^
No one said "delete your shit and don't code"
If you want to and you are willing to put time and effort into learning programming, you should take a step back and get back to basic programming and get hang of it
I knew nothing about JS but I kept trying (and getting hurt by shiv) but it eventually worked
I learn best by failing and recovering
Hey that's my way of teaching
oh my godness............................
hehe
the problem is not doing research
^
and somtimes the hashing algorthm not actually hashing anything
know what
xD
At least you learned so ig it was effective :^)
one of my fav basic learning site tbh
that's what I used
to get http requests down, get await stuff down, etc.
I run the script, if it works, yay.
If it doesnt, I keep trying.
That's what I'm doing right now
I know n o t h I n g
about java
DONE I FIXED IT WITHOUT UR STUPID BASICS
Oh well
shiv was I ever like that
lol
Don't complain next time you don't get help
or don't understand what is said to you
^
^
should we see if he actually reset his token
Better now than later ig
Alright
And ya see
I kept at this for about 2 hours
(And now it actually runs q.q)
so in python 3, my outputs and everything are running properly however I am wanting to add a "line break" in between sections of the output see the picture for reference.
any ideas on what I can get that to print as such
It hasn't changed much from what I originally messaged you but I will repost it if you want
Have a nice one
def calc():
while True:
print("Options:")
print("Enter 'add' to add two numbers")
print("Enter 'subtract' to subtract two numbers")
print("Enter 'multiply' to multiply two numbers")
print("Enter 'divide' to divide two numbers")
print("Enter 'quit' to end the program: ")
user_input = input(": ")
print('You have selected to ' + user_input)
if user_input == "quit":
break
elif user_input == "add":
num1 = float(input("Enter a number: "))
num2 = float(input("Enter another number: "))
result = str(num1 + num2)
print("The answer is " + result)
elif user_input == "subtract":
num1 = float(input("Enter a number: "))
num2 = float(input("Enter another number: "))
result = str(num1 - num2)
print("The answer is " + result)
elif user_input == "multiply":
num1 = float(input("Enter a number: "))
num2 = float(input("Enter another number: "))
result = str(num1 * num2)
print("The answer is " + result)
elif user_input == "divide":
num1 = float(input("Enter a number: "))
num2 = float(input("Enter another number: "))
while num2 == 0:
print("Number to be divided by 0. This is invalid.")
num2 = float(input("Enter a different number: "))
result = str(num1 / num2)
print("The answer is " + result)
else:
print("Unknown input")
print('Thanks for using the python calculator. See you next time.')
if you want to add like a space between each thing
just do print()
it will print a blank line
or \n yh
so if I did the \n where would that go in the code?
u may need todo \n\n
so example
print("The answer is " + result \n)
or
print("The answer is " + result + "\n")
does it matter which one?
The \n must be inside a string
erm
Can i get opinions on the server banner and icon?
You'd better just send the banner and icon themselves in #memes-and-media at least
I will be back later
google images
But yeah, as CF8 said, this is barely a server to ask feedback for anything...
thank you for the assistance
I'm trying to learn a bit about MySQL but i'm blank. How do the client and server connect? What protocol does the client use to send a query to the server & then receive a response
@split hazel very open ended question
You don't directly connect to mysql you use an SQL client library, the protocol is documented but I couldn't tell you it's details
It connects via Unix socket, TCP on port 3306
Or windows shard memory
Or a windows pipe
Usually the client library you use interfaces libmysqlclient.so
You simply give it queries as strings, and it returns rows and columns as results
In short
And usually mysql is configured on localhost only for TCP
But not always
ah, thanks for the explanation!
So
I am tryna use random puppy to make a reddit command
But I don't know how to make the first argument after the command the subreddit
const subReddits = needs to be the first arg
Can anyone help?
what lang
discord.js
Ok chill
@solemn fern that is a library not a file
Excuse me, I stand corrected I still stand by it that it isn’t a language
Yeah, well he was asking what i coded my bot on
The "not language" part is correct but discord.js is a library
even so the .js part is pretty obvious
Oh
Right
About my earlier question
I am tryna use random puppy to make a reddit command
But I don't know how to make the first argument after the command the subreddit
const subReddits = needs to be the first arg
Can anyone help?
well you just need the very first argument, and args should be an array, unless you've done something different, what you need to do is get the first element in the array
@earnest phoenix This is what I have done
const { RichEmbed } = require("discord.js");
const randomPuppy = require("random-puppy");
module.exports = {
name: "meme",
category: "fun",
description: "Sends an epic meme",
run: async (client, message, args) => {
const subReddits =
const random = subReddits[Math.floor(Math.random() * subReddits.length)];
const img = await randomPuppy(random);
const embed = new RichEmbed()
.setColor("RANDOM")
.setImage(img)
.setTitle(`This image came from r/${random}`)
.setURL(`https://reddit.com/r/${random}`);
message.channel.send(embed)
}
}```
i checked a guild that my bot is in and i mapped all the channels's messages, and all of them were ```js
Collection [Map] {}
meaning no messages in that channel were getting cached even after messages were sent
that was the case for all channels except a few
is this because too many messages are cached on the bot?
@golden condor if the only arguments you need are links you could just do const subReddits = args; (though you wouldn't need the const subReddits, and could use args directly)
otherwise what I would personally do
if you want something like +mycommand [arg] [subreddits], you could just slice after the first argument (0)
This gave an error
tbf you dont need to set const subReddits = args, and can just replace all occurences of it with args
what error are you getting though?
@marble juniper i dont want to do that lol
no problem
Why am I getting this error? I started getting it after I changed the prefix code but I reverted the changes and still get the error.
(node:10973) UnhandledPromiseRejectionWarning: DiscordAPIError: 401: Unauthorized
at item.request.gen.end (/rbd/pnpm-volume/5ddd8829-e3a3-4cf4-987f-20ee0c322ca8/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15)
at then (/rbd/pnpm-volume/5ddd8829-e3a3-4cf4-987f-20ee0c322ca8/node_modules/.registry.npmjs.org/snekfetch/3.6.4/node_modules/snekfetch/src/index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:10973) 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)
(node:10973) [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.
Please ping with response.
wrong token
Really? Normally I get an email for that.
Anyone ever used Strapi and Purest?
@earnest phoenix I regenerated the token and changed it but still get the error.
are you sure you're using the token and not the client secret
Yes.
are you loading the token externally or is it hardcoded
Are you using a bot or a user account? What endpoint are you trying to access?
I have it in a .env file and load it using client.login(process.env.TOKEN;
One moment.
then print the token to console and see what it returns
Can someone explain my mistake ?
message.reply('{client.user.ping}')```
You may have to do Bot <token> depending on the library you're using.
no
No one can help you, that code snippet has zero context.
the token type is always set in the library
@lunar crystal What is message.content type?
@lunar crystal What is message.content type?
I don't know sorry
I'm a simple beginner
@lunar crystal Try client.ping instead.
that's not the issue
The issue is pretty obvious.
^
Also, ${}.
@lunar crystal Try
client.pinginstead.
ah ok nice thx u
they don't know how to compare strings, hence being told to learn basics of the language
@shadow palm 
¯_(ツ)_/¯
Yeah i can't write those character into code text
@lunar crystal
if (message.content === "+ping") {
message.reply(`Pong! ${client.ping}ms`)
}
Anyway anyone here by any chance used Strapi with Purest?

spoon feed detected
I suggest you use Math.round for client.ping but its not needed ofc
just looks more clean
that is also the websocket latency, not the rest ping
The console prints the token.
NjY5NzU5He9MzY1MjQ1NDUw.Xin_8w.zjjFlTdAl_Fbgp3nuTx5ayhEE1A ||Obviously joking.||
I'm not sure what's wrong, this is the first time I've had this error.
d.js says if your token is invalid iirc
They're the same. Also, yes, April.
if nothing else, try hardcoding the token - if that doesn't work you got temporarily api banned for hitting the ratelimits too much
iirc like 2 months ago i was getting a 401 with d.js because of an api update i think
yeah the lib version could be the issue too
The only thing I have is a ping command that responds with Pong! and normally when I log on too much it changes the token and emails me.
they seem to be updated
I have Discord.js v11.5.1.
well as far as I know this version is completely fine and should work
so probably not the version
Yeah, because it was just fine and I never messed with the version.
what if you try a different bot token
I did, I regenerated the token. Or do you mean a completely different bot?
completely different bot
guess you just have to wait
But why? What would I have done to get banned?
hitting the rate limit multiple times in a row
Eh, I wouldn't think so. What rate limit?
that's for you to figure out
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
I never changed anything from what I normally do and if the bot logs on too much, it regenerates the token and emails me.
well.. that might be your issue in the end
😕 I'm so confused.
pretty sure discord isnt gonna like you logging in 1000 times a day
(that you seem to make it very common placed)
Only wait a few weeks or days or sth, i didnt had that yet
Only wait a few weeks or days or sth, i didnt had that yet
@sterile minnow Is that how long the API ban lasts?
don't comment on how long it will take if you've never experienced
weeks seems overkill but you never know
api bans last an hour by default
We dont know how much the Bot spammed or sth
It only sent eight messages.
And it didn't log on that much, I'm pretty sure it was under 30.
this is what jake announced in dapi
8 messages in total? or 8 messages per server, or 8 messages per user it sees?
8 total.
It could be that you commit your token to github and that is the reason why your token gets deleted?
have you tried hardcoding the token yet though
@blissful scaffold no such thing as token deletion exists
the whole of discord depends on JWTs they can't delete them
they just nullinvoid it
I think Discord deletes your token if you break the rate limit too often, and you say discord keeps deleting your token?
No, Discord only changes it if I have the bot login too many times, which isn't the case.
It could be that you commit your token to github and that is the reason why your token gets deleted?
I don't have my code on GitHub, only protected in a.envfile on Glitch (Don't judge.).
No, I haven't, but process.env.TOKEN prints it to the console. I'll try though.
Same thing.
so i'm looking to integrate mysql storage with my bot, but i cant for the life of me get my code (node.js) to connect to it? Anyone got some insight? I keep getting a er_not_supported_auth_mode
which mysql library are you using?
npm install mysql
have you checked this?
thats what I've got
do you have a mysql server running somewhere?
yes, local machine based.
does it have a username and password?
show the full error
im making music commands for my bot using ffmpeg and youtube-dl and im getting an error saying Module import youtube_dl doesnt exist
is it in your env site-packages folder
im using youtube-dl and ffmpeg
youtube**_**dl doesn't exist

did you install the python wrapper for it>?
why did my friend tell me to do pip install -U youtube-dl
i mean you need to get the python package some how
import youtube-dl? 
tried that
did you even do what ur friend said
It's most likely import ytdl if I am guessing without reading the docs
ill try that
Yes I am a liar
python is weird
Did you friend tell you to install this https://pypi.org/project/youtube_dl/
why is the import name different from the package name
to simplify stuff
That how it be Dream
alot of packages do it
Take the case with dblpy where you pip install dblpy but import dbl instead
Logic doesn't apply to Python
i hate python
not that it rlly matters because you can just do xyz as zyx
makes zero sense
python good
Traceback (most recent call last):
File "bot.py", line 7, in <module>
import ytdl
ModuleNotFoundError: No module named 'ytdl'
i feel like when python was being made logic and common sense was thrown out the door
Isn't that the case with almost every language
i guess
well music commands are out the window 😦
tf is lavalink?
basically better ytdl
import youtube_dl per YTDL example
its basically just the go to music system
LL is cool
im just going to leave music commands out and make fun commands instead
im just going to leave music commands out and make fun commands instead
yea you are trying to do music commands but cant even install and import a lib
I think this comes down to a lack of documentation reading
Which will cause you problems no matter what you do with your bot.
The pypi page for youtube_dl doesn't have any documentation
Don't rely on pypi 

Can someone like tell me what do I do to detect if a player has voted today using webhooks? I’ve set up the webhook and it works perfectly but idk what to do next.
.
@earnest phoenix Make a database map their id to the time they voted
if it's within 24 hours then horrah it's today
like record the id and the time the person voted?
Yep
ok thanks
Would anybody recommend lowdb for a database?
https://www.npmjs.com/package/lowdb
Ping with response, please.
can someone help me make a server info command? i use discord.py btw
you don't need to copy and paste the same question
ok
Dang it.
json databases shouldn't be recommended...
i would suggest using an actual database
like sqlite as an example
for a development help chat noone is being helpful and answering my question
can someone help me make a server info command? i use discord.py btw
REPEATS FOR THE 3RD TIME
@fallow mango Read the server description.
Channel for chatting about (bot) development. If you have questions, ask the questions and wait for someone who can answer to help you. Do not ask to ask. Provide all possible information so people know what's up. Just saying "I get an error" doesn't give us enough information on your problem. Do not @mention people randomly.
but i didnt mention anyone 😦
what kind of help do you need
i'm trying to make a server status command but i'm having trouble on how i should make it and my friends explanation was very confusing
just explain your trouble
i tried using my user info and changing a few things and i get flooded with tons of errors (probably because i cant do it that way)
Has anybody tried using Google Sheets for a database?
If you want insanely high response times go for it
@floral bloom sqlite is manly used. never heard of google sheets for a database
I've been trying SQLite, but I'm not getting anywhere.
hm
also it has usage limits unless you pay for more uses so it isnt good with bigger things
go for it i guess
also it has usage limits unless you pay for more uses so it isnt good with bigger things
Welp, never mind.
i use 5 JSON files running parallel for my database
I use mongo it's quite easy
pretty fast response
i use 5 JSON files running parallel for my database
@fallow mango The issue is that it's prone to corruption.
Well JSON is only limited by the read/write speed of your drive but it can corrupt easily
Batch file database what.
thats what i said
i use 5 json files
but The issue with that is that it's prone to corruption.
trying to find an easy alt
Why not using any standard database?
just dont to i guess
Anything but storing data in json files.
how are they prone to corruption
@fallow mango Because every server will write in the file at the same time.
It can corrupt the file.
You'd have to use a lock everytime a server is writing to it.
Again storing data in a json file is not good.
5 files running in parallel is good?
Again storing data in a json file is not good.
Even If it is multiple or not.
if the json file is to store a bot prefix ok..
But if you are holding user data that's really bad.
ok... here me out.. im trying to add moderator commands to my discord server, and its working, but regular users (not mods) are able to use them. how do I make it so that they can't do that?
Check for user permissions.
the user didn't even have a role, and was able to kick someone with admin perms
isnt there a code that makes it so u must have KICK_MEMBERS in the user permissions?
Thank you part 2
Heya
@floral bloom json isnt prone to corruption if its written atomically but i doubt he is writing it atomically
@tiny tinsel u 2
also if you do use json dont store everything in one file
use a diff file for each id
so you have guild settings you have a json file for every guild
atomically written json could probably handle 50K+ guilds, you would probs have to have a NVM ssd vps tho or it would get slow. but it doesn't use as many write/read calls as sqlite because sqlite rewrites the entire file everytime you change 1 thing
if i have an app running on that port, is there a reason this would just give me the nginx welcome screen?
@stable horizon try 127.0.0.1 instead of localhost
did u restart nginx?
yea
where are you putting the conf file?
/etc/nginx/sites-available/
with a link to /etc/nginx/sites-enabled
@stable horizon does /etc/nginx/conf.d/default.conf exist?
nuked it
yes i want you to see if conf.d has a default conf file
wrong folder
if so move ur conf file to conf.d
top one
oh ok it does exist
can u copy ur sites conf and put it in there
then restart nginx with sudo service nginx restart
ur not
@polar shadow So atomically writing JSON will not corrupt the data being written to the file(s)? Also, if I use this NPM package, will it work?
https://www.npmjs.com/package/write-json-file
fs-extra?
I would use https://fs-nextra.js.org/globals.html#writejsonatomic tho
as you can pass a JS object directly
So what exactly does writing a JSON file atomically do opposed to the writing it unatomically?
Please ping with response.
Atomicity. In computer programming, an operation done by a computer is considered atomic if it is guaranteed to be isolated from other operations that may be happening at the same time.
@floral bloom
Ah, thanks!
👍
what do i do here
Read the channel topic
so close to release, I could have it tonight potentially...
Take your time
i checked a guild that my bot is in and i mapped all the channels's messages, and all of them were ```js
Collection [Map] {}
meaning no messages in that channel were getting cached even after messages were sent
that was the case for all channels except a few
is this because too many messages are cached on the bot?
also that has been happening for multiple guilds
I know for discordpy the default cache limit is 5000, I can't speak for other languages though.
I'm pretty sure the cache is overwritten though, so that may not be the issue...
Yes, that's why I said default cache limit.
D.py caches everything by defualt unlike the other libs
Most other libs require you to fetch the message again compared to d.py
Doing some nice website stuff and added customizeable backgrounds and preview if you change it 
@prime cliff what is this website ??
It's a wip website i'm making for a nice project btw that is not the full view
Can i have the url🤔
Sure i can show u in DMs
What do you think of getting websites for bots?
do it if your bot is big or unique
I wouldn't get a whole new domain for it personally
Just use my website and make a page for it
advertising
But nah, I can get a custom domain, website etc for free
Just a bit of work
Not massively needed unless for a web dashboard
Tfw I don't even have a website besides for a meme domain 
I have a domain that I use for PDF exporting from the server
And some redirectuon
But the main site is bigger than the bot so xD
Something as simple as github wiki is enough for any small bots tbh
Yh
I use "Glitch Host" "Free" as you know. However, 512 MB of RAM is allowed. My "bot" a very highing using of ram so I use 5 projects. These are connected through "Token".
Changing "Token" takes 5 minutes, but "Token" replacement times vary. For this reason, I noticed that it was bot offline for 10 minutes or even 2 hours. I how to fix this problem?
I have no money. Is there another solution?
I live in Turkey, where VDS very expensive one-month money needed.
depending on what your bot does, you can optimize its ram usage
most discord libs allow for a pretty ridiculous optimization, if you know what you're doing
😦
i wanna fit all my projects in a 3$ vps
Fairs xD
VPS r cheap
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
vps are very cheap these days
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@sage bobcat thats a terrible price
google compute engine is free for 1 year, but you need a credit card to register
amazon aws also free for 1 year
11.25$ for that bad of stats?
One message removed from a suspended account.
One message removed from a suspended account.
I think I need to escape this country 😄
Lets just not have a argument of who can get the cheapest vps
One message removed from a suspended account.
google compute engine is free for 1 year, but you need a credit card to register
amazon aws also free for 1 year
^ and if you have an edu enabled email you can make use of github's education pack which offers 2 or 3 hosting providers willing to give you free credits while you're a student
One message removed from a suspended account.
need a credit card***
One message removed from a suspended account.
hes already using glitch
One message removed from a suspended account.
One message removed from a suspended account.
all free "hosting" providers are bad if you plan to do anything productive
I think I still have to keep glitch 😄
i just didnt get why exactly do you need 5 projects and token swaps?
but one project max 512 mb ram using
and how much is your bot using? how many servers does it have?
yes but it will not crash from that
is there anything else shown besides socket hang up
discord.js can handle more than 500 servers before reaching 300+mb ram without any optimization
that is normal
4 project: 150 command
commands take very little disk space, its only js files
160 commands will be like 10mb at most
quick.db
what are you saving in the db?
oh you have music commands...
music uses a lot of ram
glitch is not good for music commands
One message removed from a suspended account.
160 commands= 100.000 using for 1 day its a so impossible
One message removed from a suspended account.
One message removed from a suspended account.
@quartz kindle yes...
so yeah, you need a vps
that error is not because of ram
anyway a discord bot with 0 commands will use ~100mb ram
its normal for a bot to start with that much
hmm
time to hack a club penguin account aww yeeaaa
thats just his project id, where's the token?
10.000 max using
@quartz kindle a picture he posted was deleted, showed like 4 tokens
ah
what is that? what are you saving?
counter for what?
wait
sorry its a turkish 😄
the counter counts the incoming and outgoing and informs the server leaders.
There are many commands like this and I guess the bot can't stand anymore 😄
are these logs
Turk servers, commands like this are famous. I had to add it to the bot
i hate this country....
oh ok
Where can I get discord mail address
discord's email?
discord doesn't care about your hosting problem
no its a not hosting discord.com/developers
constantly exchanging tokens.
I will ask how to stop the token exchange
what are you exchanging them for?
One message removed from a suspended account.
you mean the discord bot token?
yes
discord changes it for you when you exceed 1000/24h IDENTIFY payloads to the gateway - aka logging in and out more than a thousand times in a day
I found the first token error in the world. omg...
One message removed from a suspended account.
One message removed from a suspended account.
the issue boils down to you not using a reliable host so the host keeps turning off and on - starting and stopping your bot constantly
One message removed from a suspended account.
One message removed from a suspended account.
hmm
One message removed from a suspended account.
my bot gg is now omg 😄
5 project 5 token
lol
😄
i found this npm
One message removed from a suspended account.
One message removed from a suspended account.
that npm package is against the tos
One message removed from a suspended account.
it requires you inputting your user token, you're not allowed to use user tokens outside of official clients
One message removed from a suspended account.
ok and I have no money! 😄
ok! 😄
One message removed from a suspended account.
I think I have to do it from "shit heroku"
One message removed from a suspended account.
be warned that logging in with a user token outside of the official client will most likely end up in your account getting terminated
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
what the
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
i feel like this is an optimization problem, not a resource problem
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
instead of throwing more hardware at it, work on optimizing your code
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
thats a different case tbh
One message removed from a suspended account.
but i gonna remove that feature tbh
i'll just save the parameters used in the generation instead
and re-generate the images each time
its gonna cost more cpu, but w/e
a say?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
try it and see, most likely not
One message removed from a suspended account.
My bot is like 700KB so how df Ur bot is 200mB is insane
Considering 500KB is a preload for cache
Is there a cheap VPS like glitch that allows you to both host a website and a Discord bot
if you count node.js itself and node modules, it easily gets several tens of mb
Glitch can do websites aswell @earnest phoenix
ik
And if you count just the bot code
but im afraid of glitch not being able to handle my bot
which?
Just what ever specs you need idk
galaxy gate is prolly the cheapest for what you get, idk if its reliable though
I just know it's one of the cheaper options
im on galaxygate and so far its been great
contabo is cheaper but afaik they use atom cores
I mean bigger bots won't be able to run on glitch
but people's been praising contabo a lot here lately
Usually
is your bot like checkin rhings every 0.1 seconds?
@earnest phoenix my bot is growing very quick and i think glitch wont be able to handle it together with my website too
they buy vps
a website doesnt use much resources
A website uses hardly anything as long as it's small
k got you
i can vouch for galaxygate
There was a list of cheap VPS in the pins here
this
^no
SkySilk has fairly cheap stuff imo
No
not a hosting provider
I just released combined the website and bot use nearly 48GB ram and 24 cores xD
That is insane
😳
Logical cores that is
What in the honest to all Gods fuck
You thought I wouldn't see it but ik you're mining bitcoins there
Nu
cache every single user's avatar byte data into memory
The website went from running on a 4 core with 8gb ram to a 12 core 32GB ram server xD
Loading time went down a bit xD
is aws good for bot hostin?
computerfreaker8 hi
Yh
eg
for example what is good
windows or ubuntu?
Ubuntu
Windows sucks as a development... Anything
Linux is the way to go for developing stuff imo
win server is k on dedi, but on like 1gb ram and 1vcpu, linux.
how does one even do timely punishments. ik the db is involved, and i'm guessing i'm not doing timeouts on every single one. do i load like all the one within a certain time period into timeouts or what?
Idk just run a background thing every minute that runs a db query to find expired punishments?
Seems like a better alternative to timeouts and punishments are saved even when the bot dies
hm alright
Be sure to use lots of for loops 
@slim heart You mean ban user 1 where 1 is 1 day or hour?
dw that's not what i'm on about :p
He's talking about how to unban/mute users when their time is up if i understand
how can i abuse aws trial?
I would add a datetime to the database (punishment ends date)
And use something like Hangfire to run a query to check every expired punishments.
No clue what's your language equivalent of Hangfire.
@ me if you know how 🙂
And a bool (muted, banned)
hell you could even have a cron task that runs every minute that just connects to the db and runs through the users, dk about actually telling the bot that their time is up
@scenic kelp That's why I add a datetime example he gets banned on 2020-01-24 10:09 AM and I ban the person for 1 day
It would ends on 2020-01-25 10:09 AM
So the cronjob just check If the date is in the past. If yes set (muted, banned) bool to false.
@earnest phoenix No one here will (or at least shouldn't) tell you how to abuse anything
😐
How can I do this.db in the Main Code and this.module.db in the Test Code?
Sorry what
You gotta give use more than that
What language r u using
And what do you want todo
what should i fo about this
@earnest phoenix is the response actually taking that long to appear?
@uneven wyvern what language r u usig
i mean, its no wonder considering the request has to go to neptune and back
JavaScript
yeah
where is your bot hosted?
yeah try that
@uneven wyvern there are many ways to do that, how are your files organized? is this a module you want to publish?
do you want to require the main module in the test file? or do you want to require the test file into the main module?
yes, but i want to use the db object for me for a test
oh my English is crap today
and if my trial ends im going to switch to digital ocean maybe
lmao
still not enough information, which file is requiring which file?
well, for the file for exporting the db object is Data/database.js and for importing is it index.js
for example, lets say you have this structure:
node_modules/mymodule/index.js
test.js
in your test file, you will have ```js
const mymodule = require("mymodule");
class SomeClass {
constructor() {
this.module = new mymodule();
}
someMethod() {
// this.module.db
}
}
let myclass = new SomeClass();
let db = myclass.module.dband in your module's index.js you will havejs
const db = require("somedatabasemodule");
module.exports = class {
constructor() {
this.db = db;
}
}```
i dont know how your code looks like, but im assuming you're using classes since you mentioned the this keyword
its just a matter of requiring the correct file, and assigning either the class or an instance of the class to another class, or however works better for your use case
Ok ty as always
ubuntu or linux
thats not how that works
discord.js is telling me to install a node engine, even though i have one installed.
im on discord.js v12. tried @discordjs/opus, node-opus, and only opusscript seems to work
but who wants to use opusscript
lol now even opusscript doesnt work
Opus gave me PTSD 😦
i know whats the problem. just because of one folder i dont have access to, it refuses to use npm at all
Which languages have shards as clones of the bot process, rather than OS threads? From what I can tell most node.js bots do
node can run both, processes and threads (well, "worker threads")
class Drive:
def __init__(self):
self.gauth = None
self.drive = GoogleDrive(auth=self.authorise())
def authorise(self):
""" Automatically loads our creds and saves if needs be. """
self.gauth = GoogleAuth()
if os.path.exists('token.pickle'):
with open('token.pickle', 'rb') as token:
self.gauth = pickle.load(token)
else:
if self.gauth.credentials is None:
self.gauth.LocalWebserverAuth()
elif self.gauth.access_token_expired:
self.gauth.Refresh()
with open('token.pickle', 'wb') as token:
pickle.dump(self.gauth, token)
self.gauth.Authorize()
return self.gauth```
finally got it auto loading creds
appart from i spelt Authorize wrong
xD
Nah you just went British there
Hello, excuse me for disturbing you but I'm just starting to learn how to code, I would like to know where I could find a good hoster, free and secure if possible, to put my bot in.
If I missed something, just give me the link to the message and I'll read it all, thank you ^^
"free" = "not safe" essentially
I'd suggest cheap VPS (refer to https://discordapp.com/channels/264445053596991498/272764566411149314/576818380498010112)
I can't put money on, i'm ... like poor ... the nitro you see someone give it to me ...
if you have or can borrow a credit card, you can get 1 year for free at google and amazon
otherwise, glitch and heroku are the only "free" services, but have several limitations and restrictions
Okey, thank you
Google: How to install java on linux for ubuntu/debian/arch it's not that hard 
@prime cliff read pins
We no lang/lib wars
Yea i see
can someone gimme an example on how to develop an market system for my economy bot?
That'd be a lot for an example, you can probably find one on github.
umm....not any in python tbh
Well, I know of a few, none of them are any good.
exactly
there are likely a lot (and if they're not good, just make it better!), but all you really need to do is fetch all the items in the market, check how much it costs compared to your balance and list them
You'll probably need a database, a way to add points (whether that be per message, or using an activity monitor (hint: discord.ext.commands.cooldowns), a command to view said points, a shop or something, and commands for people to interact with the currency (think robbing, slots etc)
just gimme a link
yeah thought of that but cogs arent working
so i make them into a single file
User error
You'll have to learn to make one. We can't really give an example of something that specific
Cogs work fine
then it says syntax error



