#development
1 messages · Page 1139 of 1
Assembly Programming Tutorial - Assembly language is a low-level programming language for a computer or other programmable device specific to a particular computer architecture in contrast to
Why thank you cry
And when I use server variables ( server name / id / owner ), will it return id of the new joined or left guild? @misty sigil
yea
Thanks!
we're not personal dogs to teach everyone basics
Well, why do you feel obliged to help everyone in that case
It returns full guild object @fallow steppe
Oki
You can do anything you can do with message.guild
the docs tell you whats returned
most of the time i just assist people into making a conclusion themselves
I want to create a server log ( a channel that logs server joins and leaves ) so thats why I asked
Except the people that dont ever come to a conclusion
Just walk in circles with them then say you have to leave
unfortunately
assembly is fun
I want to learn anyway
wait till you get into cpu-specific instructions and machine code
Well yeah, it's a low level lang they all look like hell
why not give up and carry on if you don't feel like not being hostile towards them in that case
wait till you get into cpu-specific instructions and machine code
Actually sounds like fun
machine code is absolute hell
I meant they walk themselves in circles to the point trying to help them is just infuriating
until you realise about Thread and memory safety
wait till you get into cpu-specific instructions and machine code
@earnest phoenix Yeah lol. Different Assembly languages for specific cpus and architectures
You try to help and they just dont listen
Then stop trying and do your business
assembly is weird
So when I try to trigger the event, I do client.on.guildCreate { ... } @misty sigil?
machine code is absolute hell
010001001000101010101010101010100
That's what I do...
Boom I made an os
That's why I said tell them you have to go and leave

thats not machine code......
Well assembly is just very low-level, not machine code. Just more so than languages we are used to
No offense but why the fuck do you write machine code
@fallow steppe wouldn't it be
client.on("guildCreate", (guild) => {
})```?
machine code is binary
no
your missing a ,
yes
yes
@misty sigil i'd use this instead then?
@misty sigil you are a verified dev-
we had a specific set of instructions in CS that we had to translate from binary without a calculator, i wanted to cry
No offense but why the fuck do you write machine code
@pure lion you'll never get people writing machine code anymore, it's just what your compiler outputs
yeah looks right now
lmao i am
i just forgot a ,
and read the machine code for exploits
But what in the world is this channel rn
we had a specific set of instructions in CS that we had to translate from binary without a calculator, i wanted to cry
Okay now this sounds like hell
@pure lion you'll never get people writing machine code anymore, it's just what your compiler outputs
@queen violet Unless you use JIT 🙂
RIP
But what in the world is this channel rn
@fallow steppe Great question.
machine code is binary
@earnest phoenix people writing it don't just write binary tho you can write text that compiled directly to machine code
yeah im aware
@queen violet Unless you use JIT 🙂
@faint prism unless you use any non native language
Error 503 Backend fetch failed
Backend fetch failed
Guru Meditation:
XID: 163578730
xd
yes
Btw someone told me they wrote their bot in "010" then proceeded to show me binary

oh
this is a big reason why intermediate languages exist in the first place
dbl backend is taking a shit
its not a new issue
its just slowly happening more and more as the backend burns into a smoldering ash
they where hiring some new devs, hopefully itll get better
Time to buy a host and not host on your 39 year old laptop
yea 
Wouldn't it be epic if I got hired x)
this is a big reason why intermediate languages exist in the first place
@earnest phoenix they exist cuz people were lazy with writing compilers
Idk why they even want backend JS devs
lol
i wouldnt even want to get hired
i believe dbl's backend is straight up a dumpster fire
Id just rip the entire backend out and start over
Any reasonable backend dev doesnt want to touch that shit show
I'd just do crtl a and rewrite the entire thing
their frontend was a disaster a year back, don't know if it still is
you'd need to lmao
Can you imagine working for DBL
you gotta understand they get a shitton of people visiting the site
Yeh
can't be that bad
@pure lion
The backend is a dumpster file which suprises me considering that the site really isnt very complicated in design
Can you imagine working for DBL
let me translate that for you, can you imagine being underpaid
The backend is a dumpster file which suprises me considering that the site really isnt very complicated in design
Mood tbh
'love' questionable
but it works so lmao
The backend is a dumpster file which suprises me considering that the site really isnt very complicated in design
@modest maple ye like holy shit it's a fucking bot list
Just gotta get veld to remake it
no
How hard is it to make queries to a db
but it works so lmao
@misty sigil but it doesn't 10% of the time
Smh
veld's code is so bad
not hard
Like people shit on discord for being unstable then you look at DBL's backend and realise that you know, DBL is more likely to be fucked
20% of the time
gotta get actual devs to remake it then? 
FUCK IT IM MAKING DBL 2.0 (backend only ofc)
development moment
^
if you want to do something as big as DBL's scale you need a performant language
yes really
dbl is quite big
Hi this is #development
hi development, im dad
oh right
yes and we're talking about dev stuff shiv <3

we're having a development related conversation
#development is about developing bots
not just bots
very indirectly tbf
Sure you might need some framework to not be a shitshow like dbl already is
node as backend for this scale is shit mainly because it's singlethreaded, you need to be able to push your machine specs to the limit if you want to squeeze out performance
But even Flask and Python would be enough
@faint prism bots is in brackets, it can be any type of development
Hell Uvicorn and python can handle more requests in a minute than DBL handles in a month
knowing how to thread and manage threads in programming is extremely useful and can be a huge performance booster to apps
It just you know, needs to not be a burning reck
@faint prism bots is in brackets, it can be any type of development
@misty sigil It's parenthesis tyvm
And I think that implies it should be related to bots
not exactly
It's general development...
Hey, on a similar topic, do y'all think using node.js for a game server is a good idea
no?
it's just a pointer to "hey you can ask questions about your bot code here"
Probably not
Hey, on a similar topic, do y'all think using node.js for a game server is a good idea
@cinder patio no.
Any development-related discussion is fine, it's just that Discord bots are mainly the topic because this is mainly a support server for a bot list website
Gotcha
C++ for that stuff is pretty nice I believe
almost all triple a multi games use cpp yeah
even as a backend streaming data needs to be quick
It's also a super insecure language
Well it's not thread safe is it?
not if you can actually code it properly lol
wym i love BSODing my windows by messing around with raw memory
That's why they usually have devs that know what they're doing
Unless it's activision 
Its native, if you're scared about not knowing what youre doing with memory safety or thread safety use rust and have it enforce it on you lol
misUsing C++ is the leading cause for memory leaks though iirc
yup
that goes for any lang tho
Not Rust
java 
memory leaks?
all langs can get mem leaks
its just much harder because the compiler enforces you to standards
I believe Rust was made to prevent that
It's gonna be a multiplayer browser game so I am not sure what to use exactly. I just started coding the server in javascript but I dunno
Rust was made for that
having 130 message events is one of the major causes of memory leaks in new bot developer's code.
But you can still do with thinks like unsafe rust
Then they deserve memory leaks lol
@misty sigil about that, where can I read about guild properties?
By what to use I meant which programming language
Like name, id, owner etc
Can't force a driver to wear a seatbelt ig
There are some things you just cant do safely
https://discord.js.org/#/docs/main/stable/class/Guild @fallow steppe
Ok
just downloaded discord.js
Another reason Rust has an unsafe alter ego is that the underlying computer hardware is inherently unsafe. If Rust didn’t let you do unsafe operations, you couldn’t do certain tasks. Rust needs to allow you to do low-level systems programming, such as directly interacting with the operating system or even writing your own operating system. Working with low-level systems programming is one of the goals of the language. Let’s explore what we can do with unsafe Rust and how to do it.```
Like use http post calls for logins 
forgot ti downlosd it earlier
Can I host a mongodb cluster through nginx?
i thought you gave up @left nacelle
"Trust me, I know what I’m doing.”
C++ devs
Big fucking mood right there
im trying again
Yes?
@pale vessel
good luck this time
how to send two embed in same command in cmd handler discord.js v12
so you shouldnt even need it and idk if it even can do it with DBs
yes
i got the latest versions
that's a starter i guess
how to send two embed in same command in cmd handler discord.js v12
send it twice
iirc, bots can only do one embed per message
hOw
like, send it normally
so you have to send them in two seperate messages
I saw someone doing that
Just msg.Reply() twice
bot still offline
only webhooks can have multiple embeds in one message
^
try running it lad
you misspelled "require"
That's two. The break in the red line
also require accepts a string
But, make your bot reply twice with 2 seperate embeds
module.exports = {
name: "help",
usage: "help",
category: "extras",
run: async (client, message, args) => {
const embed = new discord.MessageEmbed()
.setTitle("Command List")
.setDescription("Here is all my commands!")
.setFooter("Powered By Ragnar")
.setTimestamp()
.setColor("#FF0000")
.setThumbnail("https://images-ext-2.discordapp.net/external/uKya972PBlPLPFbA7nQ8Wxcg511fSrkN-kptVoq_fnM/%3Fsize%3D2048/https/cdn.discordapp.com/avatars/730114390036316251/c301fd4e6f626eb256b9ac381b6bf733.png?width=702&height=702")
.addField("r!help","Shows this Message")
.addField("r!emoji","Shows the number and types of emoji's in server!")
.addField("r!help","Shows this message")
.addField("r!help","Shows this message")
return message.channel.send(embed)
const help= new discord.MessageEmbed()
.setTitle("Join our Support server and Invite the Bot")
.setFooter("Powered By Ragnar")
.setTimestamp()
.setColor("#FF4500")
.setThumbnail("https://images-ext-2.discordapp.net/external/uKya972PBlPLPFbA7nQ8Wxcg511fSrkN-kptVoq_fnM/%3Fsize%3D2048/https/cdn.discordapp.com/avatars/730114390036316251/c301fd4e6f626eb256b9ac381b6bf733.png?width=702&height=702")
.addField("Join Support Server:", "[Click Here](https://discord.gg/KUcHXhC)")
.addField("Invite Bot:", "[Click Here](https://discord.com/oauth2/authorize?client_id=738811950066040882&permissions=8&scope=bot)")
message.channel.send(help);
}}```
<channel>.send(embed1)
<channel>.send(embed2)
lol
your returning on the first send
I tried something this but dont working
return message.channel.send(embed)
oh
return means dont do anything after this
clicks invite
ughhhhh module not found
npm i discordjs
all i need is a module to fix it
did you actually install it?
npm i discord.js
i did
in the correct folder?
@solemn latch it worked ty
np
@left nacelle Do you have a package.json
@left nacelle do it in package.json
node . looks for the start in package.json afaik
in the picture, yes
who are we talking to again
lol
try just node file.js
windows key + shift + s
file being your bot file name
then control + v to paste into discord
simply press prt sc
alt + prtscn for just the selected window
before delete
print screen is so far away tho
hotkeys, use em
🤔
windows key + shift + s is snipping tool
sniping tool? that's illegal
you dont need discord.js in there
oh
you're trying to start it
I open manually by search
try node index.js or node whateveryourfilescalled.js
someone told me to do that
@sonic lodge no
i was kiddingggggg
what is your bot file called @left nacelle
it's index.js
Discord Bot
in the picture
try node index.js
somethinf supposed to happrn?
yes
it runs the index.js file
nothing haplens
did we confirm djs is installed
oh jeez
are you immediately cancelling it using Ctrl + C
have you tried acc running it the normal vsc way?
use sharex to screenshot your screen, actual pictures of your screen are hard to read
like, uh, with the debug button
yea
gets js from Discord< I've done it!
you need to change that to a string
const Discord = require('discord.js');
i did that
requiee
i did change my spelling
👀
like i said
did you make it a string though
did you make it a string tho
give us up to date code please
from this error, it looks like its looking in the wrong location
because its not a string
its a string
one moment
then control v in discord client
we dont need the whole thing, just the updates
move it to a config file and you won't have to cover it each time you screenshot
idk how but ok
control + s
ok done
run it again
with token in place, and save again
you have to save every time before running
IT WORKS
gg
you'll eventually get into the habit of saving every few characters of code you type
now i gotta make it speak
My last problem was because I was trying to be abstract and use interfaces where I had to use concrete :/
i did
capital t

your code has it case sensitive
ay
🎊
i feel dumb
i didnt know i had to save it
Trial and Error
programming takes time to get used to
@left nacelle Trial and error is best way to learn....do some reading and then just fumble your way through a project.....eventually you'll be amazing
Well, that and constantly soaking up new info
ur the smartest in the galaxy
hello fellow weeb
Lol Rick and Morty is considered an anime now, is it?
it is an animation
Well that is what anime is short for
@left nacelle Trial and error is best way to learn....do some reading and then just fumble your way through a project.....eventually you'll be amazing
@distant sequoia Just wait until you get into design patterns/principles 🙂
can anyone here help me? How do i randomize embeds? (discord.py)
Hi i need help
randomize?
Define "randomize"
yes
User a random number generator to pick an index in an embed array. Just stay within index's bounds @languid pollen
i have a couple of embeds and i want the bot to send a random chosen embed
i wanna do if bot is disconnected (by clicking right click)(not by leave command or music end) how can we end the queue
Store them in a list and then use random.choice
Or that
works
JS has some EZ extensions doesn't it? lol

js.ez
i wanna do if bot is disconnected (by clicking right click)(not by leave command or music end) how can we end the queue
@low marlin 👀
where
On message event, parse the string
else if(message.content === "thing"){
do thing
} @left nacelle
the guide you where linked to covers it
ok
umm
what i did was copy and paste this
bot.on('message', msg=>{
if(msg.content === "test"){
msg.reply('Test Complete Bot is Active');
the lyrics command in my bot
just increases my bot ping
to 1k+
i need to add 30 seconds cooldown
> bot.on('message', msg=>{
> if(msg.content === "test"){
> msg.reply('Test Complete Bot is Active');
else if (msg.content === "anotherone")
msg.reply('That's another one');
is it having trouble processing that?
might want to put the code that handles lyrics on a separate process
is it having trouble processing that?
might want to put the code that handles lyrics on a separate process
@solemn latch
i am not pretty much getting that
just increases my bot ping
@delicate shore It sounds like you aren't doing it async
i am
nodejs is single threaded, if you have code that blocking, nodejs will not do anything until its done doing something
@delicate shore It sounds like you aren't doing it async
@faint prism my msg event is in async

so, if you have something that blocks code for extended periods of time(1 second is extended), ideally you hand that off to some other process
That doesn't mean that code inside it can't block the event loop
const Discord = require("discord.js");
const bot = new Discord.Client();
module.exports = {
name: "avatar",
aliases: ["av"],
category: "Extras",
usage: "avatar <user>",
description: "Change the guild prefix",
run: async (client, message, args) => {
let user = message.mentions.users.first() || message.author
const embed = new Discord.MessageEmbed()
.setColor(0x333333)
.setAuthor(user.username)
.setImage(user.displayAvatarURL());
message.channel.send({embed})
}}```
I m using this but i want high quality avatar cmd
^
lol
Okie
i has one more issue
i have*
bot requires code grant
guys*
lol
what in the world are you doing that needs a code grant
i on did purpose it
ok it worked


can u send me the link to the guide?
yes there is
you should follow it in order
check the command handling section afaik
you should follow it in order
@solemn latch ^ cant stress that enough
you can just hit the next one when you reach the end
i found it
i also suggest skimming over most of the guide before doing anything more at all.
get a basic general understanding and whatnot
djs is known for being one of the easier libs, with the best guide and docs
yea
lol
thats called coding
the function is not closed
you seemed to delete a section of your code
?
every { needs a }
function myFunction() {
// missing "}"
// the program doesn't know when the function ends```
every ( needs a )
same goes for every [ needing a ]
every dbl needs a tim
still says theres a problem
he just straight copied code
https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel.purge
https://img.rovi.me/I18vpH2yUn.png
ight so how do i get it to have the limit be the number of messages to delete rather than the number it searches through as the documentation is being poop
just a heads up your searching for problems that contain b
so you cant see the problem
@left nacelle https://www.w3schools.com/js/
learn javascript before making a bot
or go buy Discord Bot maker or something
ew
don't give them ideas
no ones gonna help them if they buy a bot
they support team will
it says } expected
learn js
at least 30 pages in. Then come back if you did it
read mdn too
ok.
i don't like how you've just copied the code
you pass through msg but you're using message?
mhm says no problems but doesnt send the msg
you wonder why

go learn basic js
you can't access variables that arent made
js is amazing like that
JeremEEEEEE

cLARKSOOOOOOOOOOOn
Js compiler goes brrrr
lmao
theres docs on that
I need to boost this server asap so I can be cool
how do i fetch a channel?
client.channels.fetch(id)
via the guild i mean
?
guild.channels.fetch(id) iirc
@opal plank aka it won't complain until it reaches that scope?
Bot offline
@sudden geyser precisely
nope not a method @solemn latch
@lusty quest uh, hey
Ts would've absolutely caught that
so, uh you use 11+ message listeners?
How can I get non-cached channels?
so, uh you use 11+ message listeners?
@misty sigil wdym
Because welcome still not work. xD
show code.
fetch
channels should always be cached
Python's in the same boat as well but all JS looks out for before actually running it just looks for syntax
@misty sigil wdym show code
@opal plank it did
And which code
client.on('guildMemberAdd', async member => {
let wchannel = await db.fetch(`wchannel_${member.guild.id}`);
const channel = db.get(`wchannel_${member.guild.id}`)
let text = `Welcome ${member} to ${member.guild.name}`
client.channels.cache.get(wchannel).send(text)
});
unless you're using a library that removes caching features
the bot code
Because this is not working...
@earnest phoenix it did not, his code compiled
have you confirmed that it's returning the correct id
so, uh you use 11+ message listeners?
@misty sigil the Turkish bot tutorials show them to make message listeners for each command idk why
i thought u were talking about my code
have you confirmed that it's returning the correct id
@earnest phoenix no, the channel ID is undefined
but das fuckin stupid
@sudden geyser indeed only linter catches that. Tis why im loving TypeScript thus far
oh my fucking god
@earnest phoenix nah, other person code
ts is hot x)
ts hot :p
i had so many bugs before i used it now it shows during compile its very easy for me now x)
it's undefined
And, it's not sending anything in it.
lol
Yea, idk why.
Yea, idk why.
@fringe axle
it's undefined
@earnest phoenix
async run(message, args, { text }) {
let wchannel = await db.fetch(`wchannel_${message.guild.id}`);
db.set(`wchannel_${message.guild.id}`, `${text}`)
const embed = new MessageEmbed()
.setDescription(`The welcome channel was set to <#${text}>`)
.setColor('#ea6ef1')
.setAuthor('| Welcome Channel', 'https://cdn.discordapp.com/avatars/714745136122429491/e16289a6de8bd22fb433b1e029fe98e1.png?size=2048')
.setTimestamp()
.setFooter(`Requested by ${message.author.username}#${message.author.discriminator}`);
message.channel.send(embed)
}
}
How I set the welcome channel with ID
${text}
${text} ?
why you passing text ?
as an object?
this hurts
isnt the channel id supposed to be in the args array
u have to parse as object
I hurt myself
@fringe axle we do not condone these actions
uh
and read it
I'm confused...
try console.log(text)
we do not condone these actions
@earnest phoenix unless you do this https://ptb.discordapp.com/channels/264445053596991498/272764566411149314/742415902821056633
I wrote it by myself.
try console.log(text)
@restive pebble did it.
"send is not defined"
@opal plank frick that hurt
it means no text x)
client.on('guildMemberAdd', async member => {
let wchannel = await db.fetch(`wchannel_${member.guild.id}`);
const channel = db.get(`wchannel_${member.guild.id}`)
let text = `Welcome ${member} to ${member.guild.name}`
client.channels.cache.get(wchannel).send(text)
});
oh my god
If someone joins ^^^^^^^^
because it doesn't know wtf wchannel is
that piece of code is not the issue, the issue is that you're setting an incorrect channel id
how are you passing the text?
quick.db x)
lmao
@fringe axle look up fetch
they're not erwin, it's why it is undefined
makes sense
the channel id is in the args array
means what @lusty quest?
if you cant get a channel from the cache you can fetch them
how do i restart my bot
he has unused vars as well
passing a string as object is also big brein
lmao
superbrain that's not the issue
if you cant get a channel from the cache you can fetch them
@lusty quest okay
how do i restart my bot
@left nacelle use a process manager
the channels are always going to be in cache, their issue is setting the wrong id in the database
since your just using node
control + c
i need to restart my bot cuz i made chanfes
Just replace cache with fetch?
hi
the channels are always going to be in cache, their issue is setting the wrong id in the database
@earnest phoenix
exit process
@wheat terrace fuck off
hm.
ok then its not this issue
i need to restart my bot cuz i made chanfes
exit the process (ctrl + c) then start the node process
I don't copy
take a guess 
I'm just new and try my best.
ok
not an excuse
Yea
No
That's why I asked here
@earnest phoenix it is an excuse because everyone starts somewhere.
x)
Everyone was a beginner once
Thanks
x)
yeah but you can't just come here and say shit like that
D:
this is like the fourth time im telling that the id is in the args array and you should be getting it from there, i don't know what the fuck you're doing with the text variable but it's undefined because you're not passing anything to it
typically you should learn js before making bots
if you're a beginner learn the language
x) this is a fight channel
I don't say shit. I'm new, coded a code that worked in my eyes.
fight me 1v1 halo @restive pebble
no
i wanna do if bot is disconnected (by clicking right click)(not by leave command or music end) how can we end the queue

me dont play halo rip
now bot isnt doing anything
you stopped your bot
lmao
code.
it wont do anything
i started it again
start again rip
then your changes broke it
this is like the fourth time im telling that the id is in the args array and you should be getting it from there, i don't know what the fuck you're doing with the text variable but it's undefined because you're not passing anything to it
@earnest phoenix It's justw!setwelcome <id>and it worked but q.db say's it's undefined...
prob bout to crash cuz he put some more copy pasted code
lol
i wanna do if bot is disconnected (by clicking right click)(not by leave command or music end) how can we end the queue
@low marlin can someone tell me
@left nacelle i know how to fix your bot
voiceStateUpdate
to Test to _test
we all do Not Erwin
npm test
@left nacelle wanna know how to fix bot?
show us your code
Okay, I'm out.
rhetoric
I'll fix it
i told you how to fix it
x)
wait i swear we told him to learn js multiple times
four times
you chose to ignore what i said every single time
x)
love it
@slender thistle token leaked https://discordapp.com/channels/264445053596991498/272764566411149314/742422833862410290
TOKEN LEAK
@earnest phoenix he's doing the same here
bruh image ain't even loading
lol
@left nacelle Please change your token ASAP
You need to cover your token
is your function even closed
Your token is important
Oml
ty shiv 🙂 or whoever ghost mod
imagine who is even copying it lul
forgot to
uhh no you're bots dead
im getting too heated with this one
i just made a new one
imagine hardcoding a token tho
x)
Can we calm down and carry on
show me your message event code @left nacelle
without the token
I said message event auric
learners
send all code acc
ffs
what
can you send it in code block

Well
token leaked again

well
He said he changed it since that
yeah i did
Don't post tokens lol
i did
not a screenshot
const Discord = require('discord.js');
const bot = new Discord.Client();
const token = 'NzMyNzMyOTIzODMyMTcyNjA1.Xw44tg.11m0w2DVNS2hs5BJhcc7xcUu0Nw';
bot.on('ready', () =>{
console.log('This bot is online');
})
bot.on('message', msg=>{
if(msg.content === "_test"){
msg.reply('Test Complete Bot is Active');}
})
i did
@left nacelle
- It wasn’t all the code.
- It had the token
- It was a screenshot

Error: couldn't connect to server 127.0.0.1:28015, connection attempt failed: SocketException: Error connecting to 127.0.0.1:28015 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:362:17
@(connect):2:6
exception: connect failed
exiting with code 1
```oh boned i am oh say can you see how boned i am
oh my bots offline
@left nacelle where is the if statement closed
he doesn't even login
the bot doesn't login
@left nacelle have you tried reseting your token
const Discord = require('discord.js');
const bot = new Discord.Client();
const token = 'BIG_BRAIN';
bot.on('ready', () =>{
console.log('This bot is online');
})
bot.on('message', msg=>{
if(msg.content === "_test"){
msg.reply('Test Complete Bot is Active');}
})```
there
how hard was that?
god
🥄
guys he didn't even do bot.login(token)
it's offline because you reset the token and it kicked the bot off the gateway, you need to update it in your code
nah i didnt change anything, i just removed token and put in code block
he regened the token
can you tell him to make the bot login
you’re forgetting bot.login @left nacelle
bruh said that 2 times but guess he ignored me
@earnest phoenix he's ignoring all of us
im not even sure why we helping at this point
im not ignoring
ok is your bot online?
you are
im just tyoing in code and dont see it
it will greatly help

not on yet
what is your full code
wel'll foward you docs, thats it
im forgetting bot.login
lol
frick this im getting my ice cream
@earnest phoenix same here
they said that 10 minutes ago
ik
@earnest phoenix I’m off to do the same
thats why i said it
it’s 5pm almost 6pm here
how does ufw work
what yes
whatcha mean how does it work
ok finally did it hopefully
This article contains some ufw commands https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-18-04
i do too ;p
same
frontend often requires a creativity i dont have
saaaaaaaame
did you got ufw running now?
you don’t need to br creative for backend
just think of idea, and no more creativity
i had it running on the same day i bought my server
just code
did you got ufw running now?
e
ok
@misty sigil you need express that is it
and a bit of creativity
I need a bit of help with something. I'm using discord.js v12.2. What I am trying to do is when a command has an error, I send an error response in the chat, and I want to add the error type into the embed, and TypeError I know just isn't enough.
const embed = new MessageEmbed()
.setAuthor(message.member.displayName, message.author.displayAvatarURL())
.setTitle(`:warning: Command Error :warning:`)
.setColor(0xFF0000)
.setDescription(`Hello <@${message.author.id}>! There was an error while running your command, if the problem persists, please stop running the command and contact my support team so we can get a fix! Thank you!`)
.addField(`Support Server: `, `To report directly, come and visit the support server using [this](https://discord.gg/PagSDjA) link!`)
.addField(`Report Command: `, `You can also use my handy dandy report command! (If you're unsure what it is, use \`/bugreport\`, or \`/helpfeedback\` for all feedback commands!)`)
.addField(`If you submit through the bug report command, this was your recent command: `, commandName)
.addField(`Type of Error: `, error)
.setFooter(copyright.copyright);
await message.delete();
return await message.channel.send(`Hey <@${message.author.id}>!`, embed);
}```
This is my code
error.stack?
iirc
<Channel>.send(error) often sends the first line of the error
Gib stacktrace
Okay, well I want to put it into an embed so I'm wondering mainly now if I did it right @solemn latch
how 2 nginx + mong shell?
Error: couldn't connect to server 127.0.0.1:28015, connection attempt failed: SocketException: Error connecting to 127.0.0.1:28015 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:362:17
@(connect):2:6
exception: connect failed
exiting with code 1
```oh boned i am oh say can you see how boned i am
Okay yes how I have it is correct, I was just unsure.
@solemn latch You're correct, error does display the first line of the error.
That's a user, not a bot...
@gentle wyvern bot commands in testing channels please
Sorry
Hey
hello.
If you make a bot. Steal someone’s command handler if you are lazy
the guide also goes into dynamic command loading/execution which is really useful for bots with more than a couple commands
Otherwise make your own
Unsure what I've done wrong, but a command is just not running even though I have everything set up correctly?
At least I think?
I get no error but I get no response from the bot.
"webs" isn't a table
const embed = new MessageEmbed()
.setAuthor(message.member.displayName, message.author.displayAvatarURL())
.setTitle(`:mosquito: The Bug Report! :mosquito:`)
.setColor(0xFF0000)
.setDescription(`Thank you for your report <@${message.author.id}>! Sorry that this is happening! My dev team will look into this report and get it fixed as soon as they can!`)
.addField(`Note: `, `Please allow me about 5 seconds to send your report, I'll let you know when its in!`)
.setFooter(copyright.copyright);
message.delete();
message.channel.send(`Hey <@${message.author.id}>!`, embed);
setTimeout(function(){
const embed01 = new MessageEmbed
.setTitle(`:mosquito: The Bug Report! :mosquito:`)
.setColor(0xFFD700)
.setDescription(`Hello! There is a bug report from ${message.author.tag}! Here is the information!`)
.addField(`The command is: `, command)
.addField(`The error is: `, TheError)
.addField(`This was made at: `, Date.now())
.setFooter(copyright.copyright);
const embed02 = new MessageEmbed()
.setTitle(`:thumbsup: Success! :thumbsup:`)
.setColor(0xA1EE33)
.setDescription(`Thank you for your report <@${message.author.id}>! Every report helps me to be a better bot!`)
.setFooter(copyright.copyright);
client.channels.cache.get('742157639122681947').send(embed01);
message.channel.send(`Hey <@${message.author.id}>!`, embed02);
}, 5000)```
My current code
But i created it on let SQlCreate @faint prism
https://pythontic.com/database/sqlite/create table (Queries are the same)
https://www.sqlitetutorial.net/sqlite-create-table/
CREATE TABLE [IF NOT EXISTS]
it's for sqlite 3?
idk
linux specific*
linux is the kernal
and ubuntu uses linux kernel
I doubt the kernel is responsible for fonts
well, manjaro (a different os using linux kernel aka different linux distro) does that error sometimes too
How to make a bot
@earnest phoenix I know why
you are using repl.it
and you are trying to do canvas
Fine, "linux-based OS specific error"
you have first to install the font
repl doesnt have common fonts
I also see that you are using repl, because you have send a screenshot of your terminal
If you know what the problem is
then solve it?
How to make a bot
@earnest phoenix
#502193464054644737 @earnest phoenix
I wont explain all, but this should help you. You can simply google this, how to install fonts on repl for canvas.
const { registerFont } = require('canvas')
registerFont('fonts/OpenSans-Regular.ttf', { family: 'FontName' });
oop
How can I change the background of my bot
im still trying to figure this out, im trying to make my bot switch between 3 statuses very 10 minutes and do that continuously, im putting each status in a setTimeout and then wrapping the whole thing in a setInterval where the interval is 30 minutes (10 + 10 + 10) and i cant get it to work
so?
well, if they do not have a function like registerFont
it wont work on repl
Hello I have a question.
@earnest phoenix use canvas on repl. The rest is bs.
@heavy nova this is an embed..
@midnight blaze I'm new to this, how could I do it?
create canvas
not embeds
does it? then it has a function
registerFont function
ok, good
so you dont get the error anymore?
register font must be called before the creation of the canvas
@pure lion not really, it works for me like that
wha-
How hack discord
wha-
const Canvas = require('canvas')
Canvas.registerFont('path.ttf', {'FAMILY-SHIT': 'Big Dicc 44px'})
Canvas.createCanvas(69, 69)
const { registerFont } = require('canvas') /// you take registerFont from the canvas
registerFont('fonts/OpenSans-Regular.ttf', { family: 'FontName' }); ///then you use it
How hack discord
@earnest phoenix You open chrome, press F12 -> Console, and type:while(true) alert('hacking dIsCoRd...')
So this is something I actually need help on, and still haven't figured out.
I want my bots server count to update every 15 seconds, so when the status changes, it reloads the server count for the next time it gets displayed. But I've been trying to get this done with no success
client.on('ready', () => {
console.log('Ready to RP!');
guilds = client.guilds.cache.size;
console.log(`Starting up in ${guilds} servers!`)
const activities = [
{
'text': ' /help',
'type': 'PLAYING',
},
{
'text': ' my admins!',
'type': 'LISTENING',
},
{
'text': ' the /news command! (last updated on 07/01/2020)',
'type': 'LISTENING',
},
{
'text': ` over ${guilds} servers!`,
'type': 'WATCHING',
},
];
setInterval(function() {
const activity = activities[Math.floor(Math.random() * activities.length)];
client.user.setActivity(activity.text, { type: activity.type });
}, 15000);
});
client.on('guildCreate', (guild) => {
guilds +=1
console.log(`I am now in ${guilds} servers!`);
});
client.on('guildDelete', (guild) => {
guilds -=1
console.log(`I am now in ${guilds} servers!`);
});```
This is everything I've done so far, but I can't figure it out.
@stable nimbus why not use client.guilds.cache.size instead of the guild variable declared at ready
as that'll be what it was when it was ready
plus while thats technically not api abuse having it at 15 sec
I'd still reccomend making it longer
get_prefix
with open('prefixes.json', 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'prefixes.json'```
it was working
its a json db
ill move it to a proper db soon
go learn quick db it isn't that hard lmao
im using sqlite
@drifting wedge absolute path maybe?
naw thats json?
i mean ill just move to sqlite
instead of relative
There's no file
the file is in the same foler tho
is it the main file
i thinks o
@drifting wedge then use ./


