#development
1 messages ยท Page 765 of 1
@earnest phoenix @earnest phoenix (that's using both <@> <@!>)
isn't there a thing where you can do ```java
event.getAuthor().getAsMention()
but thats for jda, im not sure if thats in discord.js
ok right can anyone explain why <@ and <@! is inconsistent
Pretty sure it's something like this for DJS @outer niche
_client.on('message', message => {
if (message.isMemberMentioned(_client.user)) {}
});```
I am the python
I have a question for somebody.
My bot has a meme command which finds and sends the memes via a Reddit/subreddit link
Every now and then my bot will throw this error
UnhandledPromiseRejectionWarning: HTTPError: Response code 429 (Too Many Requests) I am trying to get the bot the throw that error in a message instead of in the console so that when it happens and the meme doesn't send people know why and not think the bot is broken when in all reality the website is really just receiving to many requests.
D.JS right?
Mhm
okay on the catch (I assume you're doing a try catch with an error logging)
replace console.log(error) with message.channel.send('give us some time to get our memes sorted out');
you can just handle the error through whatever way you're supposed to (e.g. callback or promise) and use the .message property on the error
There is a default cooldown of 10s
check reddit's api ratelimits
How can I convert this to work with @
as in the prefix just being @?
Like @bot
if your meme command is being used simultaneously by a lot of users, it will give that error often
Yeah I figured @valid frigate thanks for your help anyways ๐
Python
e cant help u there. im terrible at python lol sorry
Lol
Lol python ๐คฎ
@hoary elm which sub-reddit are you using if you don't mind me asking
i like js
@lilac wharf umm Reddit .com/r/memes
Oh the full setup is like this got('https://www.reddit.com/r/memes/random/.json').then(response => { let content = JSON.parse(response.body); let permalink = content[0].data.children[0].data.permalink; let memeUrl = `https://reddit.com${permalink}`;
@lilac wharf
Oh you're not limiting the query that's why I believe...
This is something that I have for the memes reddit.
You can always consider caching alot of memes and make the cache expire every once a while and get the memes from api again and update cache
Hmm okay thanks for your suggestions lady's and gents ๐
wait just asking, can i do the same thing with java?
I'd suggest something like this:
const sf = require('snekfetch');
const { body } = await snekfetch.get('https://www.reddit.com/r/memes.json?sort=top&t=week').query({ limit: 800 });
const allowed = message.channel.nsfw ? body.data.children : body.data.children.filter(post => !post.data.over_18);
if (!allowed.length) return message.channel.send(`sorry but it seems like we're out of memes`);
const randomInteger = Math.floor(Math.random() * allowed.length);
let memeEmbed = new discord.RichEmbed()
.setAuthor(`Memes Example`)
.setImage(allowed[randomInteger].data.url)
.setTimestamp()
.setColor('#3e3a11');
message.channel.send(memeEmbed);```
@hoary elm
Despacito unfortunately I'm not able to answer that question with 100% certainty but to the best that I know I don't believe so since java doesn't have the same availabilities as javascript does with packages such as snekfetch etc...
Thanks anyways!
Yeah no I don't believe it would be the same
Im sure it's possible but not the same setup
And thanks @lilac wharf
you can always base the code when writing a java version
Would this work
Bot(command_prefix=commands.when_mentioned_or('!')
try it out and see (but fix the missing ')' first)
Missing ")"
Yea
How do I make my bot send a message in a channel that it just created?
message.guild.createChannel('๐party๐', { type: 'text' })
Guild#createChannel() returns a promise of a Channel (CategoryChannel, TextChannel, VoiceChannel)
So you could await it for use the .then() method @shadow copper
Okay. Thank you!
@ะฟะฐัะธะผัะบ#2150 this channel is English only
Hey so im trying to get my Bot auth on a pop up but when i click it it says "UNKNOWN_ERROR"
10/10 lots of information
ooh nm i had a space after the ? in the url ๐คฆโโ๏ธ
but now, how do i close it after it being added?
We have no idea what you're on about, how about explaining what you're trying to have it do, give a small example and then an error message if there is any.
oh ye pardon me, so if you press a button on my website you get a pop up to add the bot, once you added it it will close the pop up by itself.
i've done the first pop up that you can add it but it wouldn't close on its own
Are you using redirect uris?
yes, but i asked that yesterday here but it didn't work
is there a way to force a field in an embed to align left or right?
i removed two fields and now this looks a mess.
i highlighted how the uptime field seems to have alignment centre, colspan 2
i could put an empty field after the uptime field, which might 'force' it... but it seems like a hacky solution
i dont think there's anything you can do about that
You could add an empty field in between those two all though the spacing might still be broken.
just use \n so you can decide where you can put the info
That's fine until the data changes into something longer then everything breaks again.
lol... this should be funny. im letting sporks consume an encyclopaedia of world history and greys anatomy.
what are you using for the graph?
php pchart, @lusty quest
thx
on an unrelated note
i just found a crashbug in my bot, oops
it had been bombing out about twice a day for about 3 or 4 days, but nobody had noticed as it instantly comes back again
/**
* Escape all parameters properly
*/
for (unsigned int i = 0; i < parameters.size(); ++i) {
char out[parameters[i].length() + 1];
mysql_real_escape_string(&connection, out, parameters[i].c_str(), parameters[i].length());
parameters[i] = out;
}
that char out[] is too small to hold an escaped version of the parameter if any characters are escaped
it needs to be [parameters[i].length() * 2 + 1]
to accommodate for the worst case scenario of every character being escaped with a leading "\", plus the null terminator
i hate C.
Automatically restarting bots are the best ^^
As long as they don't get stuck in a crash loop
lol yeah you have to take precautions
i have a 30 second delay on it
which in theory makes it impossible to send enough IDENTIFY in a day to get the key revoked
My bot tries to restart 3 times before giving up and then trying again after an hour
if it was stuck in a real loop though, reconnecting over and over i'd notice it within a couple of hours
thats a good plan
My bot also sends me a dm when it restarts
i have mine set up to do more than that, but it had broken
heres my restart script
# run gdb in batch mode to generate mail the stack trace of the latest crash to the error_recipeint from config.json
/usr/bin/gdb -batch -ex "set pagination off" -ex "set height 0" -ex "set width 0" -ex "bt full" ./bot `ls -Art *core* | tail -n 1` | grep -v ^"No stack."$ | mutt -s "Sporks Bot rebooted, stack trace and log attached" -a log/aegis.log -- `/usr/bin/jq -r '.error_recipient' ../config.json`
basically, every time it restarts, get a stack trace from the last core dump, email it off to me using mutt with the last 5mb of log file attached
but the mutt command was broken, so i wasnt being emailed
My restart script also checks every 10 minutes if I pushed a new jar file to the server and restarts the bot when there is a new version of the bot
ah
thats a good idea too
i decided to go with a modular approach so i just issue a command to unload the module i want to upgrade, recompile it, and issue another command to reload it
I thought about doing it that way too, but restarting is quick enough and I am lazy xD
currently teaching my bot fiction
its just eaten two encyclopaedias and greys anatomy
๐ณ
i found a language parser so im using public domain works from project gutenberg as seed material for the chat bot
๐
give it as many romance novels as you possibly can
haha, theres jane austin on there
right now its eating huckleberry fin and frankenstein
You're using machine learning in a bot?
not exactly, i wouldnt be so bold as call it that
its a simple pattern analysis that identifies sentences that declare a statement
so any "a is b", "b are c", "n was m" etc
there's a word/phrase for that kind of thing but I don't remember what it is
it generally learns from discord chats, but i decided to feed it fiction
๐
if you do remember let me know, because i dont know it lol
@warm marsh its basically designed to learn transparently, so you can tell how it learned things. cleverbot doesnt learn, but can say lots of things. other bots (not seen any yet but im sure they exist) may learn but not transparently
cleverbot learns doesn't it
Fair. My heads in the clouds so don't understand.
I'll look back after will probably understand or at least be able to look it up.
@earnest phoenix not directly no
i think they seed it from logs
so that they can vet and curate what it has in it
you cant go "cleverbot remember i am a banana" and have it remember that, it can establish sessions though im told
no one read my msg ;-;
https://discordapp.com/channels/264445053596991498/272764566411149314/664763757179961365
5xx means it isnt your fault
let updatelogMessages = bot.channels.get('652683584733184000').fetchMessages()
console.log(typeof updateLogMessages)
let map = updatelogMessages.map(message => message.content)
console.log(updatelogMessages)
let updatelogArray = map.join("\n")
let uLembed = new Discord.RichEmbed()
.addField("Update Log", updatelogArray)
message.channel.send({embed: uLembed})
``` map isnโt a function, discord.js both console logs return undefined
.fetchMessages() is an asynchrous method so you should use await or .then
no
.fetchMessages() return a promise
Oh
Make thus
This
bot.channels.get('652683584733184000').fetchMessages().then(updatelogMessages => {
let map = updatelogMessages.map(message => message.content)
let updatelogArray = map.join("\n")
let uLembed = new Discord.RichEmbed()
.addField("Update Log", updatelogArray)
message.channel.send({ embed: uLembed })
})```
Ok
I have some problems with this code : ```js
try {
var response = await msg.channel.awaitMessages(msg2 => msg2.content > 0 && msg2.content < 11, {
maxMatches: 1,
time: 10000,
errors: ['time']
});
} catch (err) {
console.error(err);
return msg.channel.send('No or invalid value entered, cancelling video selection.');
}
https://pastebin.com/PUUuBYp1 here is my entire code if neded
if I put a video link he sais me handleVideo is not definied(line 62)
well you're comparing a string to an integer as a start apparently js finds that okay
and for handleVideo is not definied?
I see a lot of people uses it likle me and works, but why it happens to me?
https://prnt.sc/qlwrk5 yea thx now litteraly nothing happens
jesus
you would have changed the string to an int
if needed
not change both of them to a string
I think you're looking for max instead of maxMatches on master

what do you mean with it logging message properties
and this
if I put a video link he sais me handleVideo is not definied(line 62)
handleVideo indeed isn't defined in any of the code you provided
Anyone know brian?
which brian
Does anyone know joe


What is the primary language that you program your bots in?
english
lol
whatever language you know best
see if it has a library
most commonly seen are js and python
maybe java is 3rd idk
I was trying to decide if I wanted to learn a new programming language specific for this task. I have done some programming in C++, but wasn't sure that would cut it.
Thats an interesting dilemma
Hence why I asked
It's your choice, are you good at C++, can you find a library that seems simple to you to use.
Do you want it to be easy? Do you want to improve your C++ skills? Do you want to learn a new language?
Always down to learn a new language. Always want to improve the skills I have. Easy isn't always better, but does make the frustration levels less. I am not sure about the library section of it.
Anyone know library for C++ that have something like JS's Eris register_command? or something, just I need lib that have good in-build commands and args handling.
if you are using C++ you might as well just write your own 
I did think about that
I'm pretty new in C++...
@broken jay I am not an expert by any means, but I will probably be building one if you want to co-op on it.
Maybe, but I try first 100% complete Codecademy C++ course...
Documentation
you use it with a discord bot the same way you would otherwise
mess around with the mongo shell before implementing it in your code
just like a bot, it wont
the machine that is hosting your database/bot needs to be on all the time
It is recommended to get a VPS
however you can use mongodb atlas
Host MongoDB in the cloud with MongoDB Atlas, the official database-as-a-service, on AWS, Azure and GCP. Try free!
yeet
"free"
Its tryable for free.
can someone help me
With?
What code do you work with
i got MEE6 but how do i make a leveling system
Are you making a bot or need help with their website
l 0 l
I O I
when you dont know what the person is saying Are you making a bot or need help with their website
l 0 l
Are you creating a bot with code
Like mee6
yes
Ok so you want help with leveling
when people are too smart n u dont know what they are saying

yes
Quick question
What code do you use
Python, javascript?
java
K I'm 0% of a help then
I use python
kek
i'll get python
TELL ME
no
wait
Wait are you asking for MEE6 support?
This server is for top.gg, you should contact MEE6 support on the server sent above
you want to code a command to make a potato emoji
well no
you gotta subscribe
like
jump out a f-13
wait
YT is generally not a good idea for Discord API stuff
yes
im sorry, what the fuck do yall not understand about i got MEE6 but how do i make a leveling system
@earnest phoenix we aren't allowed to spoonfeed, but you should probably rely on a certain type of database to store users with variables
well you know
wait
You should probably learn java or a type of code before you jump to making a discord bot levelling system
are you asking for help with how to enable level up messages with mee6 or are you trying to code a similar system yourself?
@earnest phoenix you would be perfect as tech support cuz youre just as clueless as one
thanks
i take that so close to my heart
I'll remember that for 2 fortnights
youtube is the best
i got it
ez
did you read what I said about YT
๐ค
hey any prefix ideas that aren't stupid
w/e
<botname><some_character>
i said 'that aren't stupid'
Play around, get some prefixes as options and ask people
I meant ones that you don't have to break a hand to type
maybe
stupid is somewhat subjective
but will mess up command names
ahelp
akick
ainfo
ainvite
anyone using ] as prefix?
if you want something simple you could always set up aliases @tiny viper
wrong guy to ping
hmm
Aliases help make commands shorter so a alias for the help command would be "h"
but you could just say ah in conversation
obvs could change the key...
but still problems like
o info
would become oi
o kick would be ok
and you could kick someone lol
tbh mention prefix and something like %
Lol see it would make it interesting but I see what you mean about could be problematic
I honestly usually use mention prefix or something simple like / to avoid people typing in chat triggering the bot.
So you want something unique?
something to avoid getting 'common prefix' on this server anyway
maybe
- is common
preferrably something that doesn't need shift
Really? Never seen it ๐ค
so maybe [ or ]
Now that's unique
maybe welsh LL
Is there any amount limits when uploading img to Discord (attachment)? Like X times per X minute.
i should discriminate on anyone not using en_GB keyboard layout
im totally not nationalist
๐ฌ๐ง
@broken jay you send messages, so by defdault 5/5s but again, ratelimits are not static
someone join my amazing radio
Ok thx
If all bots use a prefix then the best thing would be to not use a prefix at all 
just use mention as the only prefix
Or mention as second prefix & a customizable prefix ยฏ_(ใ)_/ยฏ
yea don't join his amazing radio
hey
?eval message.channel.send(bot.channels.get("652683584733184000").lastMessage.content)
why does taht work once
then never agin
this is my code btw
let content = bot.channels.get('652683584733184000').lastMessage.content
let embed = new Discord.RichEmbed()
.addField("Change Log", content)
message.channel.send(embed)
it used to do promise pending but idk now
or does it need to cached messages or somethign
lastMessage will only have a message if its in the cache
oh
else it returns null
cached means basically after restart
cached means the bot received a message from that channel and saved it in the cache
ok
hey all, im doing stuff with regex
let regex = /@someone/gi;
let finalMessage = message.content.replace(regex, `<@${person}>`);
if (message.content.includes(`${pPrefix}someone`)) {
var replace = `${pPrefix}someone`;
var re = new RegExp(replace, "g");
finalMessage = message.content.replace(re, `<@${person}>`);
}```
SyntaxError: Invalid regular expression: /?someone/: Nothing to repeat
the normal prefix is ?
i did a \ before but it still doesnt seem to work
you need to escape the question mark as it makes the point optional.
how would u do that
with a backslash. You said you did, but I doubt it was correct: /\?someone/yourflags
oh
but im doing it like this
var replace = ${pPrefix}someone;
so do i just put a \ infront of ${pPrefix}
@sudden geyser
Try escaping it twice (using two \\), that may pose a problem for different prefixes.
like the length or whatever the prefix may be
oh okay thanks
im trying 2 make a bug report command something like -bug bot this is the bug. So something like bot is the location and this is the bug is the reason. Im making an embed so it has a field were it only states the bug and then another field for the reason. I am not able 2 have it show only 1 word is pretty much my problem. Code >>https://hastebin.com/sacolideji.js
can you rephrase your problem
oh ya
sorry it was kind of confusing
pretty much im trying 2 have the bot say the first word in the command in 1 field in the embed, then the rest of the words in another field
if that makes any more scence
oh yeah
so the first field should be the location
and the second, description of the bug?
mhm
ah
ya
correct
well
i notice in line 20 you're using words.slice(0).join(' ') which seems unncessary
since words is already an array, you can just get the first word by using words[0]
ok.
so in your if comparison, you could replace if (!location) to if (!words[0])
or if (words.length == 0)
ok. thanks!
is thar not a module named Bot
I may be braindead but 
Same
what kind of project would you think this classifies as?
1ModuleNotFoundError: No module named 'Bot'
Show the line where your code is erroring out
did you mean to install a bot library @outer niche?
Let's not confuse them
im just confused on whats happening, so ill leave it alone
They most likely want the Bot class provided by discord.py commands extension
I doubt there's a Bot library that they would need
How do you think you use Bot if it's a class under the commands module you're importing
so this
eeeee not rilly
Nice
Why don't you take a step back and get used to basic Python stuff first
just an idea
so this
Are you trying to instantiate Bot anywhere in that file
bot.on('messageReactionAdd', (reaction, user) => {
let server = message.guild
if(reaction.emoji.name === "โ
" && user.id !== bot.user.id){
console.log('marche')
reaction.remove() \\ <<<< here
}else if(reaction.emoji.name === "โ" && user.id !== bot.user.id){
let channelserver = server.channels.find(c => c.name == message.author.id && c.type == "text")
channelserver.send("Channel fermer").then(c => {
channelserver.overwritePermissions(message.author, {
SEND_MESSAGES: false,
READ_MESSAGES: false
})
})
}
})```is there any way to remove all the reactions?
I had an internal existential crisis just by looking at that, dw
Error
@wicked pivot are you on stable or master, and are you trying to remove every reaction off the message, all reactions for an emoji, or a single reaction
check out the docs for <MessageReaction>.message, there's something about clearing all reactions depending on your version: https://discord.js.org/#/docs/main/master/class/MessageReaction?scrollTo=message
Why am i getting: dbl.errors.Unauthorized: Unauthorized (status code: 401)
I have my token where it says to be
๐
I don't know the cause for that but it seems to be API-side
Weird.
If it's needed
This is the full Traceback
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x04FCC8B0>
Task exception was never retrieved
future: <Task finished name='Task-1' coro=<DBLClient._auto_post() done, defined at C:\Users\azerb\AppData\Local\Programs\Python\Python38-32\lib\site-packages\dbl\client.py:84> exception=Unauthorized('Unauthorized (status code: 401)')>
Traceback (most recent call last):
File "C:\Users\azerb\AppData\Local\Programs\Python\Python38-32\lib\site-packages\dbl\client.py", line 87, in _auto_post
await self.post_guild_count()
File "C:\Users\azerb\AppData\Local\Programs\Python\Python38-32\lib\site-packages\dbl\client.py", line 130, in post_guild_count
await self.http.post_guild_count(self.bot_id, self.guild_count(), shard_count, shard_no)
File "C:\Users\azerb\AppData\Local\Programs\Python\Python38-32\lib\site-packages\dbl\http.py", line 169, in post_guild_count
await self.request('POST', '/bots/{}/stats'.format(bot_id), json=payload)
File "C:\Users\azerb\AppData\Local\Programs\Python\Python38-32\lib\site-packages\dbl\http.py", line 141, in request
raise errors.Unauthorized(resp, data)
dbl.errors.Unauthorized: Unauthorized (status code: 401)
I highly doubt the issue is in the code if regenerating the token does the trick ๐คทโโ๏ธ but thanks nonetheless
Could you send me the full code in DMs if possible?
Sure
In what language Cxllm?
discord.js
Okay before I actually get into this I have another question...
Do you actually know how to code in javascript & discord.js or are you expecting to be fed the code?
I actually know how to code
I coded 3 bots so i think i know
I just don't know which dependencies to use
I've heard lavalink is quite good, but i can't get it to work
I've tried ffmpeg
And lots of others
you know lavalink requires JDK 11 to be installed
JDK 11?
Java Development Kit
Probably the issue then
I got no idea how to use lavalink
i know how to use discord.js obviously, just never used lavalink
well
it requires the server to be running
The what
the lavalink server
My brain
https://github.com/Frederikam/Lavalink/blob/master/README.md#server-configuration this is for installing & running the server in the background process
How do I get a lavalink password?
I am very confused
Everything
tell me exactly
you'll need to install JDK on your machine
just Google jdk install and it should redirect you to Oracle's page to install
It installed without it
That's the NPM edition of it
You'll need the JDA version to run the server then the JS package version to work with javascript.
you don't need the JDA version
Hello,
please can someone point me the way, how do i distribute my bot?
The bot is running in a container already, and i think i should learn kubernetes for distributing it, but how do i tell the sharding manager what node to start what shards on? Also, should i make 1 shard per container or 1 container with a sharding manager?
Help is much appreciated if anyone has knowledge on this!
you just need this running in the background process: https://discordapp.com/channels/264445053596991498/272764566411149314/665492393105293312
@viral spade I use heroku to host my bots
it's literally an http server running locally emitting events with a websocket
My mind is aaaaaaaaaaaaaaa
which the lavalink package does automatically
Holy crap this is so confusing
when the server is running
@golden condor but they run on one flexible virtual machine i guess?
nah man is not public
You can make it private on github]
usually sftp should work too
It's the best hosting option for free
nothing is free. Free hosters like to make a copy of the files on the server and maybe use them on theyre own
It is literally just an online terminal that auto runs node index.js for you
Nope
It automatically runs it
And when you make a change to your file, it notices and restarts
running the bot on a Raspberry would be better than any free host in my opinion
that's running it
my bot needs 10 gigs of memory for 10k servers so i wont use heroku xD
https://top.gg/bot/534589798267224065 < This is his bot
seems like 1gb per shard
i have 8 shards
on one pc, i would like to separate it on 2 pcs
discord requires you to shard at 2.5k guilds
Linck, I don't have any Docker/K8s experience so I can't help you
i know a little bit docker but dont found out how to run shards on different Containers without having a new Instance running
but still on heroku, if you lets your bots run on different virtual machines, you would have to have some kind of orchestration, no?
ah thats too bad, i guess you would have to be able to tell the sharding manager what exact shard its to start
Heroku is a great starting out option
but its terrible for teh rest
its cheap at the beginning and very expensive as you go on
so its nioce to try things out but not if you already need 10gigs of memory
for me it took almost 2 weeks to get approved
I've been waiting about 1 week
i am approved and used it
The basic plan would more than likely be free but if you need more and more stuff like ram the cost will be more is what Linck01 was saying.
Does ffmpeg actually work?
@golden condor did you see a dyno with 1gb costs 50$
I found this guide
https://dev.to/galnir/how-to-write-a-music-command-using-the-discord-js-library-462f
but opus won't work
@viral spade my bot uses hardly any ram so
What the hell, Those pricings on Heroku are a scam.
yes, 1gb ram for 50$. while for a vps with 50$ you get like 30gigs
I haven't really got another solution as I don't have much money
currently i use Digital ocean, its good performancewise later i may can make a deal in the company i start this year
yep
I'd suggest GalaxyGate primarily or others such as DigitalOcean & OVH if you are looking for hosting to pay for.
Well, you get 600 hours of free dyno hosting so
and if the promo is still active you get 2 months for free
600 hours is only 25 days...
Well, what other options do I have?
there is still the alternative with Google that allows you to host a VPS for free (only in the US and its a really really bad vps)
I am in the UK
A: Hosting from your own PC
B: Online hosting from Digital Ocean, OVH, GalaxyGate, VPSServer, AWS.
Are any of those free tho?
you barely notice it if the server is in the US. or get something like a Old Pc or Raspberry 4
Yeah, A is the free one.
your own pc is free
get a Nas
Well, The power going into it isn't free but yeah...
if you live int he cold it goes into heating ๐
hosting on a raspberry can work too if you dont get to many servers on it
What about glitch?
No
Zeitnow?
I got no better options really
We've given you options you just haven't chosen them.
what raspberry did you got?
honestly get digitalocean 5$ per month. you can scale it up enough to hold very long for a reasonable price.
I have no money
Kind of misleading since before you said "much money"
https://discordapp.com/channels/264445053596991498/272764566411149314/665496277101969427
you either need money or an existing machine in your house that you can run 24/7 everything else will be really annoying after you need some more power
in the end, paying the 5$ per month, however you make it, will save you time
Uptime Robot isn't a hosting...
you can use free hosting services but with the risk that they will : steal your files, shut it down for no reason, it will have terrible performance or it will have a terrible uptime
That's what we've been trying to say
I can't
Why not?
I can't keep my pc on 24/7
Why
i have here a raspberry now running for almost 2 years. it draws less power than a TV in standby
I do it all the time and I'm not even running a bot on this pc.
I am 13 almost 14
My PC has been on for 3000 hours+

My parents won't let me keep my main pc on
then turn off the screen
main pc?
they will never know
so keep the secondary one on.
so you cant talk to them and explain them that youre working on an it project blabla so they might accept it?
itโs literally the size of a credit card so you can put it virtually anywhere
and once itโs setup you can just unplug your monitor / keyboard and ssh into it from your main computer
what does ssh main
or have parents with the knowledge about PCs like a donkey. You can tell them you need it to keep the internet running
wtf...
@golden condor i donโt think youโre ready to make a bot
Agreed.
Bruh
basic knowledge about servers is needed
I already have made a bot
you still have to know how to get it online
I already do
You don't even understand simple terminology that is required to run an application on a server (such as a raspberry pi)
It's in D.JS
and or library
i didnโt ask to see it
ssh'ed is that where you can remotly control it?
I wouldnโt say remotely control it
well @lilac wharf when i first started server side applications i didnโt really know what ssh was i just did it
ยฏ_(ใ)_/ยฏ
It's where you can access the server remotely without needing to be on-site to access locally.
Yeah
@golden condor do you have your raspberry pi nearby ?
Yes
Is it powered on / connected to monitor and keyboard
No
plug it into everything
I don't think I have the software installed anymore
then open chrome on your main computer or whatever browser you use
then download that
once thatโs done downloading go to youtube
and type "How to setup ssh on raspberry pi"

I used that sd card for my phone (before now, that's why I got it)
I just never use it
So
I am gonna use that
Idk iโve never owned one personally
they use Micro SD
Thought so...
but dont use cheap ones they wont survive a year
Canโt you just use a USB to boot on raspberry PI?
I'd hope not, have you seen the size of sd cards...
Yeah
Idk
if you change the boot interface maybe
either way
Once you get that OS installed and setup ssh on your pi and youโre still having trouble. feel free to come back
I am just gonna format the sd card
make sure to use a ARM compatible OS
doesnโt rasPI have an OS
yes...
here you go @golden condor https://ubuntu.com/download/raspberry-pi simple and easy tutorial
Ubuntu is an open source software operating system that runs from the desktop, to the cloud, to all your internet connected things.
Okay...?
Not really our concern...
we donโt care if your house is leaking
there are mutiple OS that supports ARM not only Rasberian
Ik that
Don't take this like we're jerks but we just don't really care...
this is a development channel, not a social channel
^
Yeah well I can't do stuff if I need to go help out]
okay see you later then.
I am back now
I did and it was fine
Don't believe cursing is against the rules.
yeah just looked and iโm safe 
Anyways, once you get that OS installed search on youtube "setup ssh on ubuntu server" (if you go with ubuntu)
ok so I have a code which converts the url you submit to the api to an image and then write's it into the database
it makes an id and pushes the id for the image into a json file
fs.writeFile("./sonic_ids.json", JSON.stringify(idObject, null, 4), (err) => {
if (err) { console.error(err); return; };
console.log("The Sonic Images ID File has been updated");
everything worked
but it doesn't update the json file
the json file stays the same
nothing gets added
before I do fs.writeFile it pushes an id
then I write the file
idk where the problem is
and I noticed it also doesn't log that the file has been updated
I really donโt suggest storing data like that in a json file in the first place
its not about how I store it its about why it doesn't work
After a while of a lot of writing the json file will collapse on itself and cause eternal hell in your server
i never could get writeFile to work
stack overflow it
You could even use a simple database to do all of the storing
sqlite works
you can't do that on glitch sorry
This says I mention 1 member but I mention twice?
const abc = '@Evo#4850 @Evo#4850'
msg.mentions.users.size```
@glacial mango that is how that is supposed to work
Then how do I get the amount of mentions?
thats because its the same user
@glacial mango i assume you have an arguments variable
Can I get 3 if I do @glacial mango @glacial mango @glacial mango
why would you get 3
it has to be a different user
Because there are 3 mentions
Can I get the amount of mentions and not of users?
I don't understand how to use that
nice
good 
And ping is basically nothing
are you in the right headspace to receive information that could possibly hurt you?
is There a way to find channel in a particular category or i just have to filter it through the full server?
d.js
@earnest phoenix yes ok
Lol Glitch
free hosting isn't and will never be good, no one will let you use their resources 24/7 for free, don't be a cheapskater because renting a vps costs a few bucks a month
I am 13, got no virtual money so
and
im 13 too and use the vps from someone else cuz he gave me a place in his vps
for free
Your lucky then
maybe you can ask him
@sterile minnow this guy
Hmm?
Tayron can you give Cxllm maybe a space in your vps or something
anything is better than glitch seriously
k
well anyways I was here cuz I have problems with my storing
and wanted to get suggestions what I should use for a database
mongo db is cancer for me
small scale or big scale?
since it's local you can move it around
sure
@golden condor sure Im also hosting my bot on his vps you can trust him
Does he update the bot every time you do?
once you save your code the bot restarts automatically
it you make a file
or change a file and so on
Not happy with the status
status what
@marble juniper I don't host by glitch btw, my code is on there but uptimerobot keeps it up
k
So it isn't bad
it is lol
which are bad
also i was saying glitch is bad
the uptimerobot is a nice utility, that breaks glitch's TOS lol
Help
Ok didn't know that
How I add me bot
You don't need them to dm you... just link them to https://top.gg/bot/new and that has the information on it.
plus they already asked it #general
K
wrong channel
and
can u be patient
it takes like 1-2 weeks for ur bot to get approved
Is it possible to check if a string has ||spoilers|| ? I'm using js
String.includes() is not reliable
@glacial mango you're gonna want to make or find a regex for it
How do I make it?
https://regexr.com this might help
How do I change the bot page.
https://prnt.sc/qmacbt
example: https://prnt.sc/qmacpn
Is it css?
edit the site classes
yeah
alright
Can someone guide me on how to do this?
I'm trying to do the command
"if(message.author.id !== config.ownerID) return;"
but I don't know where to put it
I have no idea what you're trying to do but if you're checking if the user is a bot owner then?
but I don't know where to put it
I don't want to expose the code
put it at the beginning of your command
then require it
Like at the top?
ah you are following that guide
if (message.content.startsWith(prefix + 'ping') {
if(message.author.id !== config.ownerID) return; // if anyone except you (or the configurated bot owner) tries to run the command, nothing will happen
message.channel.send("pong!")
}```
Do I have to put it after every command?
if you want the command to only be usable by you, yes
if it isnt there, anyone will be able to use it
Okay
How do I make it so that if I use a command the bot will say the word "Yes." and if anyone else says it the bot says "No."?
if(blah blah blah){
return message.channel.send("yes");
}
else{
return message.channel.send("no");
}
if (/*some magic to check if the command has been executed*/) {
if (message.author.id === config.ownerID) {
//this code block will execute if you ran the command
message.channel.send("Yes.")
} else {
//this code block will execute if someone else ran the command
message.channel.send("No.")
}
}```
Okay
@honest karma indents 
It's early in the morning
ew
your token in client.login() is wrong
Incorrect login details were provided.
Go to your dev portal
put the right token in
Select your app
It is the right token
On the left, you have "Bot"
Click on it and reveal your bot token
and then, put it in your code
You are probably using the client secret
ive been making bots for like 2 years and i still sometimes use the client secret instead of bot token
I didn't
i sometimes make a copy of the main file for some reason, then i make changes to the wrong file and wonder why my changes dont work
its normal for it to change
Not really
a part of it is based on the current timestamp
The token shouldn't change once you generated it
Unless I regenerate a new one
Anyone knows how I can the Percent of the Online Users in a Guild?
it resets if you for example post it on github
^
@uneven wyvern get total users and online users and do a percentage calculation
how?
@uneven wyvern with basic maths
with what method I mean

Math.<method>()
the token does change, even if you dont regenerate it
because its encoded using the current timestamp the moment you open the page
๐ค
its not the token itself that changes, only the token wrapper/encoder
yes
Like basic percentage calculations from high school
but if you go to your page and click copy token, then refresh the page and copy it again, it will be different
the part after the dot will

oh, ok ty @topaz fjord
@modest maple no code = no spoonfeed
Is it possible to get the amount of emojis in a message? in JavaScript
ok now next question, how to round a number? I only know Math.floor(Math.round()) @topaz fjord
Math.round(x)
you legit typed it in that message
where x is the number
also why are you flooring a rounded number
oh that's simple
@earnest phoenix I read through the whole TOS of glitch, there is nothing saying I can't do what I am doing
Btw, that profile pic is very epic
?help
Frick sorry wrong channel
AAAAAAAAAAAAAAAAAAAAA
What does it mean if an emoji is managed by an external service?
@golden condor making discord bot in glitch, is allowed, but not worth of it. (if you talking about this)
@ cry I read through the whole TOS of glitch, there is nothing saying I can't do what I am doing
yes
better to get vps or smh
I mentioned before, I don't have the money too
heroku? its better place than glitch and free
I used to use heroku
supp?
Only 550 hours a month
yea thats 22.91 days
Exactly
You can verify it w ur cc
Glitch with uptimerobot is free



