#development
1 messages · Page 1333 of 1
We can swear in here? Wow.
@still cliff yea
not in my christian server
lol

bruh this is so fun to watch
I am still very very very hyped that i got my own daomin
seeing each shard get populated with streams

Puppeteer takes up A LOT of resources, you are basically opening multiple chrome processes, but you don't see them
I remember that excitement too, @earnest phoenix. It gets lesser when you get more. 😂
I have like 19 domains lying around now. 😂
I have like 19 domains lying around now. 😂
@still cliff lemme guess namecheap
now the question is:
Do i move everything from the main branch onto the test branch with shards?
Or do i move the test branch shards to the main branch?
Thats what i get for not doing modular stuff 
Not entirely.
Freenom
Puppeteer takes up A LOT of resources, you are basically opening multiple chrome processes, but you don't see them
@cinder patio why are you explaining us the science of how RAMs burn from Chrome we already know that mate
I have like 19 domains lying around now. 😂
@still cliff Lol
for .tech domains
This is a html related question but you know how some sites have a embed that displays with the link do any of you know how to get something like this setup?
Freenom is the scummiest of all, @misty sigil. Would never get a domain from them.
Get.Tech, I guess.
@main trench google opengraph tags and twitter tags
Thanks
Search for twitter summary cards, @main trench.
twitter tags?
don't they just use vanilla OpenGraph?
5h uptime and not a single error 

discord uses twitter cards for their "large" embed preview, but they fallback to opengraph to display the small version, with an image thumbnail
sharding is working really nicely now
What. Is. That?
a fun fact about twitter embeds, you can force the behaviour of having multiple images in an embed without twitter
O k a y.
erwin is a racist, he has lots of slaves
What. Is. That?
Not Erwin's bot which is also a nice way to ddos twitch
im racist
only possible with webhooks though since twitter images are just separate embeds
i love races. I also like to play Forza a lot
He races using race cars, he's racist
Let's all be racists.
looks code, its not my fault twitch doesnt have sharding and allow people like me to connect 100k IRC connection JOINS within 40 seconds while in voicechat streaming this 100% Twitch API abuse

can you make d3.js run a loop on a transition
@earnest phoenix What's d3.js
dumbos, they could have used js.org domains and they would only need an extra dot in the URL but save basically all of the money on the domain
d3js
h8ter
xD
djs-light wins
Imagine using discord.js v1
didnt it start at 8 or something?
Discord.js started from 1.0.0 but it was hidden and not officially published so it had seen a lot of changes and improvements when it was released at v8
imagine waiting until v8 to release something
meanwhile steam is like "buy this pre-alpha early access game which is in v0.0.0-beta5 for 50 bucks"
I'm on v3 of an auto typer that people have been bugging me constantly for.
Still won't release it because its not good enough
if it works and does the job, release it
Maybe v3.7
Its got some issues with profile switching that I'm too lazy to fix or remove
What’s the issue to not use djs?
What?
Imagine coding a bot without discord.js
Just banter
@boreal iron i don't see a problem coding a bot without using discord.js. Discord.py is also a good language to code with
It is preference
Or just Js
Imma using pure js and php
Sure a framework is nice to have but doing it yourself is still better, in my opinion
It just consumes a little more time

But doesn’t require you to update the code all the time if you have to update the library in case it changes things
axios.post()
cpr::Post()
axios
So webhook is like api but no rate limit?
Alright so I'm working on this feature in my RPG bot that you can have multiple "profiles" you can basically start over on a diff profile and swap back to ur original, now the profiles have an ID property and name property, I've already managed to make it so the ID's are always unique now the issue is getting a unique name as it's taken from a list for example: ["Apple", "Pear", "Banana"]. The way the profiles of a user are stored is like this: ["ID1", "ID2"]. What I tried to do is have a do while loop and inside of that a for loop that loops over the profile, gets the data from the db then compares the name if they are the same I'd generate a new name and start the loop all over again, although this results in an infinite loop. Any other ideas or ways I could do this?
just fewer
I just bought a domain, how do I host my site on it? I am new to this
(NameCheap)
U also need to buy a web hosting service
@commands.Cog.listener()
async def on_ready(self):
payload = {
"server_count": len(self.bot.guilds),
"user_count": len(self.bot.users)
}
async with aiohttp.ClientSession() as aioclient:
await aioclient.post('myapi.net', data=payload)```
thats what i have
I don't know python sorry
ooof
U also need to buy a web hosting service
@tulip ledge can't you just selfhost it?
.
u could
using XAMPP
probably running apache alone would be fine
xampp is good when you need multiple things
php, databases, etc
I've always used xampp
using xampp ONLY for apache is a bit overkill
whts you issue
Alright so I'm working on this feature in my RPG bot that you can have multiple "profiles" you can basically start over on a diff profile and swap back to ur original, now the profiles have an ID property and name property, I've already managed to make it so the ID's are always unique now the issue is getting a unique name as it's taken from a list for example: ["Apple", "Pear", "Banana"]. The way the profiles of a user are stored is like this: ["ID1", "ID2"]. What I tried to do is have a do while loop and inside of that a for loop that loops over the profile, gets the data from the db then compares the name if they are the same I'd generate a new name and start the loop all over again, although this results in an infinite loop. Any other ideas or ways I could do this?
wait WHAT?
i didnt even understand the question
i got that you want profiles
so your MASTER is your userID presumably
so no issues there
how would I make the name of the profile unique
for each profile you want to generate unique ids, correct?
a user can't have 2 profiles wit hthe name: Apple for example
I already have the unique ids working
UUID is one route, there are other smaller ones , though database indexes also handles that for you
okay, so you got both of them done
now what?
i did not understand a single thing about the while or for loops that you did
what exactly do you WANT to do?
ok I'll send u the code
let profileNames = ["Apple", "Pear", "Carrot", "Watermelon", "Tomato", "Mango", "Banana"]
let profileName;
let foundName = true;
do {
profileName = profileNames[Math.floor(Math.random() * profileNames.length)];
for(let i; i < message.author.settings.profiles.length; i++) {
let name = await this.client.db.get(`profile-${message.author.settings.profiles[i]}`).name;
if(name === profileName) foundName = true;
else foundName = false;
}
}
while (foundName)
This is what I tried
but it resulted in an infinite loop
why you even doing that though?
generate a dummy name once the profile is created BLANK or PLACEHOLDER or something
make a command so the user can change if they want
the profiles, as you said, are already uniquely identified
so whats the point of worrying about name duplicates?
yes, the ID is unique but the user can swap between their profiles doing -profile apple for example
If they have 2 profiles with the name "apple"
U see the issue?
then once you create the profile, generate a name, if it exists, append (1) on it, if it exist, 1++, etc...
t h i s
Is message.channel.me.hasPermission('SEND_MESSAGES') a correct way to check if I can send messages in a channel?
just like files that we have on windows
whenever there are duplicates, append a number onto it
file
file(1)
file(2)
But I don't rlly want that...
while will keep running constantly
its a pain in the ass
be performant
just run a name check on creatiuon
@blissful coral js <GuildChannel>.permissionsFor(<client>.user).has("SEND_MESSAGES") // it also can be <Array of permissions>
what if I take the names of all the profiles the user has, then remove these names from the array?
function generateProfile() {
let names = [random,names,array]; //random default names
let _name = names[Math.random()]; //pick a random index name from array
let profiles = await db.get(allProfiles where ID = user.id); //get all profile names from a specified user
if(profiles.has(_name)) { //check if the profile exists
let tempName = _name;
let modifier = 1;
if (profiles.has(tempName + `${modifier}`)) genNameAGain() => { //if name + modifier exists, loop a funciton until it doesnt
modifier++
if(profiles.has(tempName + `${modifier}`)) getNameAgain();
}
}
//there we go, you got a name that isnt duplicate to insert on your database
}```
@tulip ledge
I'm sure that database returns an array instead of a map
Array.prototype.has() isn't a thing tho

if im in a function, but i put a try catch block and do a return in the catch thing, will it stop the function? just wanna be sure b4 being stupid
@pure lion what
I'm pretty sure it will
ok, thanks
Fck can I get problems, Nutella has copyright on their name and my website is: "Nutella-dev.xyz"
is that a problem
.
@pure lion 
Name it nutello then 
@tulip ledge you got the gist of what i said?
Ran into another issue (also html related) doing the opengraph for the site anyone know how to get the embed to have color?
doubt anyone here is a lawyer either to give you advice on that
I'm a lawyer
Copyright laws are very stinky
and btw, if a message is deleted, is the MessageReactionsRemoveAll event triggered too if it contains reactions?
heyall making a application bot was wondering on how to make the questions NOT hard coded. basically can someone give me a idea on how to fetch them from a database and have a waitfor check for each question. im using discord.py library
I don't think so @tight plinth
then tell them about copyright and cyber laws about it if you know
everyone knows them
But try <client>.emit("event", callback) and see
ah yes, 2020, the year where everyone reads something for 5 minutes and call themselves lawyers to give legal advice

sounds like a great time
ok
@earnest phoenix it's not that one emitter triggers another
thank
Wot
It's that if a bot deletes a message with reactions, does discord emit removedallreactions
I mean, he can try to see if it emits with that
- Delete message
- Emit
O r g a n i c
If it returns anything that means it emits
Yes but a client emission stinky poo
Dont wanna ask again but anyone know how to get a opengraph embed to have color? (Html related)
Lel
Wait you do know it?
<meta name="theme-color" content="HEX CODE WITH #">
Ah thanks
What platform you springboarded eejit
Someone has a template for discord bot dashboard with mongodb so i can learn with it and make my own
What a polite way of asking for code lol
😂
Lmao
xD
But isn't asking for code the same as reading a doc they have the same information 
What platform you springboarded eejit
@misty sigil discord you tomato flavoured piece of cheese
no
example
oh my lord
When you type in https://peepeepoo.com/ there is an embed you sideways upside down green red and orange fuck
with meta tags ye edjit
Example?
look in pee pee poo poo’s code
Ok brb
Like with mine you can out meta tags into the head element to make a link embed
I'da've access to it
would i have to use php or something to access all the images in a folder on the server
i would like to display all images in a folder withotu making seperate image tags
but i am a complete noob when it comes to web shit
:)
Creating img tags is quite easy with js
i mean
i have a folder
on the server
n i dont think js can access that based on what i googled
n looked for
i can do it,
just idk how to do it on a webpage
Are you using node.js and express as a backend?
Then you can make the folder public, or put it inside a public folder
Please I'm making an config command that includes configs for prefix but when I change it bot doesn't response to it
const prefix = db.get(message.guild.id + "-prefix")||configs.prefix;
if(!message.content.toLowerCase().startsWith(prefix)) return;
configs.prefix
is string "f!"
And db is quick.db
No its guildid with string "-prefix"
2313213-prefix
Ye
like it
how are you saving it
if(subcommand === "prefix"){
const contenterror = new discord.MessageEmbed()
.setTitle("**Error**")
.setColor("#0000")
.setDescription(`Invalid prefix use ${prefix}config prefix <new prefix>`);
if(!content) return client.guilds.cache.get(message.guild.id).channels.cache.get(message.channel.id).send(contenterror);
const lengtherror = new discord.MessageEmbed()
.setTitle("**Error**")
.setColor("#0000")
.setDescription("New prefix cant be bigger than 6 characters.");
if(content.length > 6) return client.guilds.cache.get(message.guild.id).channels.cache.get(message.channel.id).send(lengtherror);
if(content === confighandler.global().prefix) db.delete(message.guild.id + "-prefix");
const sucessemb = new discord.MessageEmbed()
.setTitle("**Sucess**")
.setColor("#0000")
.setDescription(`Prefix sucess changed to "${content}".`);
if(content === confighandler.global().prefix) return client.guilds.cache.get(message.guild.id).channels.cache.get(message.channel.id).send(sucessemb);
db.set(message.guild.id + "-prefix", content);
client.guilds.cache.get(message.guild.id).channels.cache.get(message.channel.id).send(sucessemb);
}
the content is third argument in message
like: f!config prefix <prefix>
what is content
is that message.content
because then your saving it
as
prefixconfig prefix prefix
No its 3rd argument of message
const content = message.content.toLowerCase().split(" ")[2];
why is this code so hard to read
xd
^
Cuse I make it Woo xd
using vsc?
beautified it
if (subcommand === "prefix") {
const contenterror = new discord.MessageEmbed()
.setTitle("**Error**")
.setColor("#0000")
.setDescription(`Invalid prefix use ${prefix}config prefix <new prefix>`);
if (!content) return client.guilds.cache.get(message.guild.id).channels.cache.get(message.channel.id).send(contenterror);
const lengtherror = new discord.MessageEmbed()
.setTitle("**Error**")
.setColor("#0000")
.setDescription("New prefix cant be bigger than 6 characters.");
if (content.length > 6) return client.guilds.cache.get(message.guild.id).channels.cache.get(message.channel.id).send(lengtherror);
if (content === confighandler.global().prefix) db.delete(message.guild.id + "-prefix");
const sucessemb = new discord.MessageEmbed()
.setTitle("**Sucess**")
.setColor("#0000")
.setDescription(`Prefix sucess changed to "${content}".`);
if (content === confighandler.global().prefix) return client.guilds.cache.get(message.guild.id).channels.cache.get(message.channel.id).send(sucessemb);
db.set(message.guild.id + "-prefix", content);
client.guilds.cache.get(message.guild.id).channels.cache.get(message.channel.id).send(sucessemb);
}
not much differen
tin code block
pain

my eyes
xd
still a ton better though
I swear erwin is about to walk in
shift + alt + f
auto formats in vsc
yep
so just use <message>.channel.send?
how do i with flask make a redirect to the current domain but with another /
so like for example
how can i make the newredirect
cuse its 5 bots in one and client is client from connection-handler and client just making action and I cant use message.channel.send cuse it sends message from another bot that I want
xd
its 5 bots on 1 aplication
on 1 prefix
what does db.get(message.guild.id + "-prefix")
return
like how do i get the current domain
yes but what is it
if not returns nothung
basically?

yes but what is it
@thick gull i'm using quick.db npm module
const db = require("quick.db");
yes
i am aware
what is the prefix being set as in the database
like
when you run the command
is it being set properly
@drifting wedge https://stackoverflow.com/a/35107993
i am aware voltrex
f!config prefix <prefix>
it sets 3rd argument of message so it sets string of prefix waht u set
im not sure if he did it right
thanks @solemn latch
<quick.db>.set(<key>, <value>)```
Yep
@earnest phoenix https://kooleyy.is-inside.me/LsPhAxM1.png
😄
there is the problem that when i run command with custom prefix it doesn't work
soo
const prefix = db.get(message.guild.id + "-prefix")||configs.prefix;
if(!message.content.toLowerCase().startsWith(prefix)) return;
this is bad
cuse when prefix is not edited and i use normal f! prefix it works
but when I use custom prefix and message starts with it it returns
Try
const prefix = (await db.fetch(`${message.guild.id}-prefix`)) || config.prefix;```
I need a service that is like the AltDentifier API (https://docs.altdentifier.dev/api/oauth2-api) (AltDentifier's API is for letting users 'verify'/'authenticate' theirself)
@solemn latch so like basically i want to get the current url the person is one
on*
and add a /(new thing)
take the parameter you got from the <var> and put it in the return redirect(url) @drifting wedge
@earnest phoenix it doesn't work
take the parameter you got from the <var> and put it in the return redirect(url) @drifting wedge
@solemn latch wait wut
@sick apex Have you tried what it logs when you try to use a command
@earnest phoenix and tho it corupted the normal prefix
yesterday you asked how to redirect, which uses return redirect()
console.log(prefix)```
which i linked yesterday
Try this and see what it logs
@earnest phoenix I tryed it just 1 min. ago it returns prefix what set in db and if not set returns f! what is normal prefix configs.prefix
I mean, did you log what it returned
yes
Idk why it doesn't work im confused im trying to fix it something like 1 day and dont understand why it doesn't work
Wait oh my god, why are you using
<client>.guilds.cache.get(message.guild.id).channels.cache.get(message.channel.id).send(successembed)``` instead of just ```js
message.channel.send(successembed)```
Wtf
Cuse its 5 bots on 1 prefix
Hi
It doesn't even matter
and client is bot what executing the action and message.channel.send when I use it other bot send it
like the bot what must execute the action is bot1 and when I use message.channel the bot5 execute the action
I mean, what i said will work on all bots
it's problem becouse its 5 MUSIC bots on 1 prefix
You don't have to do that
I have
Jsut
Just
I have only problem with that prefix
it returns it when I dont wait to
What is content defined as in your code
No i mean what's it defined as
string
Defined as in
<const|let|var> content = ???```
const
const content = message.content.toLowerCase().split(" ")[2];
You realize that won't work on all prefixes right, f!prefix something is undefined, bruh prefix something is something
whats your code look like thats not working @drifting wedge ?
whats your code look like thats not working @drifting wedge ?
@solemn latch 1 sec
f!config prefix <prefix.
and what parts not working, the dynamic path, or the variable
you should check your path is working with a specific response, or logging it
<li class="nav-item">
<a class="nav-link" href="/../guild/?edit=/{{ variable }}/vanity">
<i class="ni ni-circle-08 text-pink"></i>
<span class="nav-link-text">Vanity URL</span>
</a>
</li>``` this is in the .html file
@app.route('/../guild/?edit={{ variable }}/vanity', methods=['GET'])
def vanity(variable):
variable = request.args.get('?edit=')
return redirect(url_for("control-panel.vanity.html"))```
and this is the flask
i dont get it tho
how do i pass it
your code looks extremely different than what i linked to
and,
@app.route('/../guild/?edit={{ variable }}/vanity', methods=['GET'])
should look more like a flask style variable rather than whatever {{ variable }} is.
<variable> or such
hmm ok 1 sec
html doesn't have variables
@earnest phoenix unless you're using a js fe framework
it still won't have variables
you can use js to render html with a variable
but html never will have variables
yeah that's what I meant
(unless you're using SSR)
@app.route('/../<var>/vanity')
def vanity(var):
return redirect(url_for("control-panel.vanity.html"))``` this is what its at rn
id need to make var the ?edit=(guildid)
but i would need to get the url the person is on?
it looks like to me, your trying to put a query parameter in the middle of your path
i dont think query parameters go in the middle
they go at the end
and query parameters are not paths
they are just parameters
so id need to be /../<var>?
diffrent concepts
well no
see you originally asked your question like you wanted a dynamic path
but you want just a normal query parameter
which in flask is
request.args.get('edit')
in your case
with the query in the right location
?edit= ? or edit?
if its a path of edit its edit?
Anyone knows why tf this is coming?
if its a parameter its ?edit=
@fringe axle are you on centos or
well how can i just get the entire path then?
@fringe axle are you on centos or
@earnest phoenix whot?
the entire path wont have that data either, since your putting a query param in a path

it wont see it
what distrib are you using, vale
npm
??????????
i can get enttire urlm and add /vanity at its end?
Idk what you mean
i'm asking about your linux distro
why not just make the url
/guild/vanity?queryparams
like they are supposed to be
or /guild/edit/vanity or however you want with query params in the correct location
or
/guild/edit/:id/vanity
and use a dynamic path
you cant put that there
the whole way you're doing this seems super insecure and exploitable
my suggestion for this would be to use an SPA for your frontend (react/angular/whatever) and just expose API endpoints on flask
you'd obviously serve the SPA files from flask too
my suggestion for this would be to use an SPA for your frontend (react/angular/whatever) and just expose API endpoints on flask
@earnest phoenix we're doing it so it checks if u have access to it
thats not an issue
anyway, heres how urls are structured
https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL
your putting parameters in the path section and trying to make it work. @drifting wedge
which flask wont know how to handle.
craft is WOODEN_SWORD, but if I do items[craft].type.toUpperCase() it changes to SWORD
user.set() takes 3 variables, table, column, input
and user.get() takes 2, table and column
Does anyone know how to make ssh work on ubuntu
what
This must be sql
also
items[craft].category.toLowerCase() is tools
ok so the error is coming from here
user.set(`inventory_tools`, items[craft].type.toUpperCase(), craft);
its this line
so this is the set function
items[craft].type.toUpperCase() is SWORD
but it says it's WOODEN_SWORD
what
what are you having trouble with
nvm fixed
@stable snow you're using the wrong HTTP method for your endpoint
it isnt
[Rust] I have this function:
async fn perform_query<T: GraphQLQuery>(variables: T::Variables) -> Result<impl Deserialize, reqwest::Error> {
// ...
}```
The Rust compiler does not allow this to compile with the error message, `implicit elided lifetime not allowed here`. It suggests I indicate the anonymous lifetime around `Deserialize` in the return type, but I don't know how I'd do that. In the function body, it makes an HTTP request, parses it into a struct, and returns it. How could I solve this issue?
Also @gentle lynx just wondering, but is there any protection against SQL injection in the source code you shared
hi so I have a command on discord py that runs a while true loop I want to know if I can hive it so that the while true loop ends after ruining a !endloop command
why
Also @gentle lynx just wondering, but is there any protection against SQL injection in the source code you shared
@sudden geyser i honestly have no idea what this is so no
its a private bot log that alerts on changes to a text document that works like this
while True: with open('server.log') as f: for line in f: pass last_line = line m= open("lastline.txt","r") oldline =m.read() m.close() m= open("lastline.txt","w+") m.write(last_line) m.close() if last_line == oldline: pass else: await ctx.send(last_line)
@gentle lynx SQL injection relates to security. Take this for example: sql SELECT * FROM users WHERE id = ${input}
A malicious user could set input equal to 5; DELETE FROM users;--, which would look like: sql SELECT * FROM users WHERE id = 5; DELETE FROM users;--
There are measures to protect against SQL injection as it can introduce security vulnerabilities into your code, such as deleting the entire table/database or dumping all user data.
@stable snow you're using the wrong HTTP method for your endpoint
@earnest phoenix wdym
Get/post/patch/delete/etc.
i was the happiest with scaleway and galaxygate
scaleway changed up their plans recently though so it's not as "you get your moneys worth" as it was before
$3 when their other stuff will be in stock(sometime in the next week probably)
its reasonable
it's worth trying out
i can always just stop my AWS instance and boot it back up if i want it back
GCP has super powerful machines and servers all around the world but... GCP is meant more for companies than personal use
which means expensive
but you do get $300 in credit when you sign up
@earnest phoenix it‘s Debian 10
install it via apt
Phone coding?
apt?
sudo apt install gcc
gyp rebuild, my favorite error
idk
bruh
What's going on?
i dont know what you ran to get the error
then yeah rerun it after installing g++
if anything else complains
just install the whole build essentials suite
sudo apt install build-essential
metapackage yeah
we use DJGPP at school for intel chips
but that's kind of an iffy subject because well, instruction sets
Say I'm starting to write asm
look into AVR assembler
it's what we use for atmel chips but i'm not sure if it works with modern day chips
@gentle lynx SQL injection relates to security. Take this for example:
sql SELECT * FROM users WHERE id = ${input}
A malicious user could setinputequal to5; DELETE FROM users;--, which would look like:sql SELECT * FROM users WHERE id = 5; DELETE FROM users;--
There are measures to protect against SQL injection as it can introduce security vulnerabilities into your code, such as deleting the entire table/database or dumping all user data.
@sudden geyser hmm
How do I fix this
Use regex
Or prevent it
@earnest phoenix error:
make: g++: Command not found
make: *** [better_sqlite3.target.mk:123: Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 127
rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediatemake: Leaving directory '/Vale/Boatz/node_modules/better-sqlite3/build'

@pure lion most of my values in the database are numbers, and if they arent theyre probably strings that I have set in my code so I think no one can inject my database
I cant really explain it but there is no way that anyone can inject my db considering the way I use it and how people can interact with the db through commands
Hello. Recently, I put my bot on three different servers and something happened that I already knew would happen, but I still don't know how to solve it. Example: When a person places a song on the X server, that song is also added on the Y and Z server. How to solve this problem?
Okay cry
A queue for each individual guild @haughty bough
Okay, but how do I do that?
I would make a map of all the guilds, and put an array for each ones queue
a more OOP way:
create a player class, the player is going to contain your queue, guild, dispatcher, anything you want
have a map of guild ids as keys and players as values
i think you'll need js for that
i think there's an old school trick to make your inputs radio buttons and then style them with css, however i'd recommend going the js way
anyone know how to fetch from an api in nodejs
use node-fetch
module?
yes
k
Can someone help me make it so when my bot crashes it send the crash log into a discord channel?
why not use something like sentry instead
i had an error
C:\Users\Mythify\Desktop\education\coding\javascript>node .
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'C:\Users\Mythify\Desktop\education\coding\javascript'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}```
what other info do i need for items for my currency system?
https://cdn.discordapp.com/attachments/758641373074423811/767476850607521822/unknown.png
const fetch = require('node-fetch');
fetch('https://api.github.com/users/github')
.then(res => res.json())
.then(json => console.log(json));``` is my code
wdym
im sorta new to js lol
javascript is the folder
@stable snow what is the file called with the code
apitest.js
lol
main.js > index.js
node .only looks for index.js file
No it looks for the main file in the package.json
discord.py is hell
not rlly
can confirm
then define it lmao
Doesn't look very defined
Just because you use the word doesn't make it defined
Where do you define jQuery
@queen crescent load the page in your browser, right click it, click "view source" copy and paste the source to pastebin or some other bin, and post it here
then define it somewhere
ok
In retrospect I didn't think xfortnite would have been available but there you go
@queen crescent you're loading your main.js before jquery
move <script src="../public/assets/js/main.js"></script> to after the line that loads jquery
works fine for me
when i open the second one, the first one closes
did you refresh the page properly? disable/clear caches, etc
are you on chrome, firefox, or other?
try clearing cache
disabling cache is really useful when making sites(f12, network, disable cache)
im gonna use svelte on my next project
@quartz kindle http://svelte-personal.vercel.app/
Currently working on this
Do need to push latest to gh though
nice
That macos terminal was a pain ngl
Also routing is a pain
Apart from that svelte is great
how do i change content of text in html using javascript
if you have a <p> tag with an id bla you can do document.getElementById("bla").innerText = "new text"
ok thanks
henlo how do i code an embed pages in js
Are you using Discord.js?
ye
honestly, i thought he was talking about embeding webpages
Use the MessageEmbed class from the library, but making the pages is a bit of a tricky process. You'll need to create a reaction collector and listen for reactions while keeping the state of the page you're on (e.g. a variable/property number of the current page, and the last page).
I recommend you create a class for your embed page handler.
im a beginner at coding and im so confused
Then making an embed page handler is probably not going to be an easy task (or a good one to start with).
Hi
hi
ty
I was wondering if anyone could help teach me how to code a discord bot?
Learn a programming language, then learn to use the library you want to use.
this isnt a teaching channel, might be a little much for someone to teach you here
If you're a beginner to programming, I recommend JavaScript or Python.
I have a deep understanding of Python but not sure how to incorporate it into discord
Then check out discord.py's documentation: https://discordpy.readthedocs.io/en/latest/
It provides a lot of details & examples on how to use the library.
Im not even argue
???
why are people so disrespectful 😦
cuz ppl r 
🆒
im stuck lol
document.getElementById("stats").innerHTML = `${json.server_count}` ``` isnt working
is your elements id stats?
ksfhoadlkfns
jyes
yes
finally
my iq increases to 10
I figured out how to do these webhooks and stuff
and now i need to use cogs for the rest of my code ðŸ˜
I need to convert all 5k lines
ðŸ˜
where you a repl user @remote wharf i forget
yeah
what did we use for your port?
Can anyone help me make a unban command in python?
ok
uban command
thanks
Punch punch
I get an error
what error
so my bot post its stats and analytics to my api, im debating taking that into its own process
thots?
imo, a good idea
yea probs better practice to go the whole microservice route
Good idea
Is there a way to fetch a message without cache (d.js)
messages.fetch(id,false)
^^^
i'm trying to get the guild's id when my bot joins it, but i don't know how, any help? (discord.py)
Listen to the on_guild_join event. The first argument is a Guild instance, so you can just get its ID via .id
i have tried @client.event async def on_guild_join(guild): ServerID = discord.Guild.id print(ServerID)
but it just prints <member 'name' of 'Guild' objects>
It prints that because discord.Guild.id is not an instance of the class.
The guild parameter you received is an instance of discord.Guild
Why is that undefined, shouldnt return the emoji with that ID?
are emojis cached by default?
hello 🙂
heya
i pretty much gave up on the Database 😂
awh
it wouldn't execute peoples ID's into the db, and then it messed up and wouldn't work, so i gave up with it Db's aren't my thing 😂
so that works... but I want to do it with the ID lol 
try:
voted = await DBL_CLIENT.get_user_vote(ctx.message.author.id)
print(voted)
except Exception as e:
print(e)
seems to hang on get_user_vote, any ideas
@ionic dawn cant you just... guild.emojis.cache.get(id) ?
what if you console.log(guild.emojis.cache)
@restive willow ask @slender thistle
but when I try filter or find by id it returns undefined, but "name" seems to work
this is #dev lmao
rtfd
hoW dId you dO iT
@ionic dawn what is the structure like?
nvm it is get_user_vote
like what are the keys
@restive willow What is DBL_CLIENT
ooh next question @blissful coral should i handle votes on the analytics process OR should it be on the engines api
when you console.log the entire collection it should show something like this ```
Map {
[2834702834] => {
name:bla,
etc:bla
},
[23425334634] =>
}
correct?
and using.get() doesnt work?
nope
are you sure the id is correct?
try copying one of the ids that were logged there, and use that id
ooh next question @blissful coral should i handle votes on the analytics process OR should it be on the engines api
@earnest phoenix hmmmm
Engine
undefined
yo anyone know how to detect if a specified user is a bot in d.js?
^ check if user.bot is true
banned by your own vps
okay, i can get it by ID if I do filter

so like if (user.bot === true)return?
@ionic dawn that makes 0 sense
if(user.bot) return
aight
thats already a boolean
thanks
if(true) =>
if(false) =>
ok
what about emoji = server.emojis.cache.find(emoji => emoji.id === "id")
ok so for context im fixing warn to dm the user and i keep having trouble with a specified user being a bot i did this code and it still wont work correctly any ideas on how to fix it?
if(true) return;
} else {
user.send(embed2)
}```
if (!user.bot) user.send(embed2)```
if(message.author.bot) return
I'd give you what I have for my bot but I'm on phone now
thanks but i just need to figure out how to specify bot
if (!message.user.bot) return user.send(embed2)
im trying to fix my mod commands to dm a user but not dm them if they are a bot
In your message event, do if(message.author.bot) return
wouldnt author look for the person who executed the command then?
That command checks if the user that sends the message is a bot, and if it's a bot it will return
all this just to get/set the channels people want to use the bot in with caching
😩
im trying to get it to check if a specified user is a bot for example if *ban @bot_here reason if that user is a bot dont dm them but if they arent then do dm them
let user = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.member;
i tried what you sent and i still got the "cant dm this" user error
that is the problem
message.mentions.members.first() is a member, not a user
same with message.guild.members.... and message.member
ok so just change member?
if you define user like that, then this user you created is actually a member, and therefore you will need to do member.user, or in your case it would be user.user.bot and user.user.send() lol
@ionic dawn do share
using .get() without quotes?
well... I was taking the ID right clicking and "Copy ID"
and... that was giving a bad ID
it wasnt copying the actual ID
it works now thanks

i cant even right click an emoji, it just gives me the regular browser right click lmao
(using browser discord)
on the desk app show the "Copy ID" section
I did \ near the emoji instead
sry Tim for bothering you with that thing

thats what I did
@ionic dawn that emote kinda breaks the rules here, ngl
wich one
quick question
would it be
or (name)[url]
so then why dosent it work on embeds
k
what about a field?
what did you put?
.setDescription(args[0], '[name](https://www.youtube.com/watch?v=eE7CSQOZn9E)')
its just a random youtube url
I want to define t in payload as event because I'm making a deno discord lib but when I define it as this, const { t: event, op } = payload; on line 21, and I try to console.log the event, it's not defined. Is there anyway that I can define it as event without taking more lines? Typescript btw
Code: https://srcb.in/7f27c8aeeb
Is this intentional? I don't use TypeScript for the record.
@quartz kindle I figured it out. Have to put it after the switch
yes
@ Tim hilp
#502193464054644737 @cloud girder
Why is it anyone can use the command when i did
let cmdRan = `${prefix}seteco`
if(!message.author.id == "ID ONE" || "ID TWO") return message.reply(`You can not trigger the ${cmdRan} command.`)
you cant compare multiple ids like that
Ah. I'm not familiar with using the for loop with arrays
you dont need a for loop with arrays
I've been making my life harder than needed ;-;
I'm using message.author then using .id to find the UID
whats happening is this:
!authorid == "ID ONE" || "ID TWO"
becomes
false == "ID ONE" || "ID TWO"
becomes
false || "ID TWO"
becomes
false || true
becomes
true
So maybe something like this:
let cmdRan = `${prefix}seteco`
if(!message.author.id == "ID ONE") return message.reply(`You can not trigger the ${cmdRan} command.`)
if(!message.author.id == "ID TWO") return message.reply(`You can not trigger the ${cmdRan} command.`)
```?
you're still doing !message.author.id == "ID ONE"
which becomes false == "ID ONE"
what you want is message.author.id !== "ID ONE"
aka: NOT EQUALS
Ohh, Thanks
and you can use both together in one line
but you have to repeat the entire comparison
if(a !== b || a !== c)
It's better than doing more complicated stuff
yup
So this will work:
let cmdRan = `${prefix}seteco`
let UID = message.author.id
if(UID !== "ID ONE" || UID !== "ID TWO") return message.reply(`You can not trigger the ${cmdRan} command.`)
yes, just one thing, you probably want to use an && here, not an ||, assuming you want only those 2 IDs to be able to use the command
Yeah, Only those 2 because it's a Global Economy bot
if ID is NOT EQUAL ID1 AND ID is NOT EQUAL ID2
I would say identical instead of equal since it has to be the same type def as well
If message.author.id is an integer and you compare this to a string it will return false of course.
(int) message.author.id !== (string) "id"
Just a little question:
Is there a way to make a command that can make commands for the bot?
Sure why not if you save your input into a database for example the bot could listen to it
As soon as you add a new command it will be added to the database for example and also to your cache, to make the bot listen to it without the need to read the database to get the latest commands the bot has to listen to
umm
And if you restart your bot it will request the lastest commands saved n database n once to be up to date again
Hmmm... Thanx
Instead cache let’s say commands array
Array is being created on bot init and you can add or remove new commands of course at any time
hey
im new to vs
and i am making a bot in js
so how would i be able to turn it off
if i start it with node .
anyone know what’s the mee6 level api?
Mmm anyone know a good way to have a trigger have an extremely rare chance? Example, you send a message and theres a 1/10000 chance you get a response back. Or if theres a bot that could do something like this already?
kinda
@dawn harbor link?
how do I write ` inside another one
idk
`` a ``

@ionic dawn Try \`
Mmm anyone know a good way to have a trigger have an extremely rare chance? Example, you send a message and theres a 1/10000 chance you get a response back. Or if theres a bot that could do something like this already?
@toxic acorn bruh don't you have a custom bot already lol
Mmm anyone know a good way to have a trigger have an extremely rare chance? Example, you send a message and theres a 1/10000 chance you get a response back. Or if theres a bot that could do something like this already?
@toxic acorn generate a random number from 1 to 10000 and, If it is equals f.e. 7729 bot will react. If it is not - stop sequence
if(Math.floor(Math.random() * 10000) == 1) //do stuff
In theory it is going to work






