#development
1 messages · Page 1150 of 1
LUNARCORD :')
I like how funny nicknames we have in our testing servers...
its fixe ggs
only The Purple People™️ can change their nicknames
how this send the normal text with the starcount and channel mention as a whole message with the embed
library?
py
@delicate shore I got the solution
let userid = message.mentions.users.map(u => u.id).toString();
let userarray = userid.split(',');
let seconduser = userarray[1];
message.channel.send(seconduser);
This will send the 2nd mention's id to the channel.
library?
@fluid basin if you know how to do it using js tell me that itself
I wasnt able to think anything other than this.
willi123yao#1345 if you know how to do it using js tell me that itself
@quasi arrow You can pass the unembedded content as a string and the embed in the options.
u mean sending the text first then embed?
channel.send(content="Hi", embed=embed)
bruh thank you too
ok @pallid igloo thnx a to and one thing
can we get a user property from a id?
or if its not cached, use UserManager#fetch
Managers require caching iirc.
yes but its better if you just use fetch
https://discord.js.org/#/docs/main/stable/class/UserManager?scrollTo=fetch
Obtains a user from Discord, or the user cache if it's already available.
you gotta set cache as false then.
uff.. I dont wanna think more about it...
uh yes why not but it can returns an error you're limited to 1 request / 5 secs not sure you want to do that
uh yes why not but it can returns an error you're limited to 1 request / 5 secs not sure you want to do that
it does say it will obtain it from the cache if its already inside
unless it's really important, just ignore or retry later idk
languages*
no
sure @fluid basin i know that, but it can throw errors
something that you don't want
well.. depends on the use case
again, if the user is not cached then it will return null if you use cache#get, which might not be the intention of the developer
though cache#get should suffice for most of the times
maybe I'm overthinking things
Oh wait may be .fetch just waits until it can fetch the user again instead of throwing errors? Idk, I only use it when it's really important, like a remind or what
But if it does wait, if you have multiple users to fetch, that's still not the best idea I guess may be it's even worse if it waits
The only time I used user.fetch is for banning people, they may be not in the cache
not really actually, it checks the cache first if there is the user, and only when its not there you will need to wait
async/await makes things rather simple
yes, simple, but uncontrolable? you probably don't want to wait I think i don't know
well again, I said I might be overthinking the use cases, generally a cache#get should suffice
yep
Why is Worker main.js not showing up?

no procfile
if procfile is their u made syntax error
worker: node main.js
exact
ohho
why
use
heroku
why the fuck do bot hosting on heroku tutorials exist
you're literally wasting your time because if heroku finds that you're using them for bot hosting then they'll just suspend youe account
trust me this has happened to me
will happen soon
keep a backup
of the code
and if they kill the app (which they'll do) switch to a real VPS
then use repl.it
get a job
^
Anyone good with canvas and canvas constructor? I've tried to load an external URL but I've had no luck making it work and the error I receive is
(node:18768) UnhandledPromiseRejectionWarning: TypeError: Image or Canvas expected
I've got the gist of using node-fetch and then turning it into a buffer but just doesn't work for me haha. (canvas does work)
@prime comet try axios
I don't think it's node-fetch TBH, I've console.loged the buffer and it is one, I'll try it though.
It seems to be on canvas' end but I'm unsure though.
How do I get my Raspberry Pi to run my DPY project?
I need it to be as online as possible
ik this sounds weird but is there any tool to convert a better-sqlite3 database to a mongoose database
my goals are beyond your understanding
Do you use quick.db
Yup
convert the sqlite in a reader to json and then do it by hand 
frik
that was a joke
ok I'll see it when i get on mah fucking pc
It's my package but it just has a way to move from a quick-db
no
How do you make a public npm package
Ez
but how
Access the docs
^

Hmmm
yo clapz you need help with smth
hey i managed to connect the bot to the website and it works thanks to u
but i want to open an html file i made tho idk how
i googled but i don't understand them
so can u help me pls
@slender thistle (ping me)
https://pastebin.com/upT7N2Tj
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Mention?
?
How i can delete a value from a array ?
you need to know the index of the value
i fixed
i forgot about it :))
@earnest phoenix there are two ways you can
either do array.pop(thing-case-sensitive);
or maybe splice()
or do array.pop(array[index-of-element]);
k
not sure if the second one is correct
array[index] would require to be an embedded array in-order to use .pop afterwards iirc
f
either do
array.pop(thing-case-sensitive);
also that won't work.
Pop doesn't take any args.
smh
Unless the language you're talking about isn't JS.
i tried and it does work in JS
@earnest phoenix hi for my request 😄
@warm marsh wait wut
pop doesn't take args.
You'd require to use .splice in-order to remove at a specific element.
It removes element(s) between index1 and index2
? help me pls 
scroll up
chances are you didn't specify engines.node in your package.json but i don't think that's required
Also pleaaaaaase stop using heroku
since it might just resolve to latest version
Also pleaaaaaase stop using heroku
@earnest phoenix stop using repl
it's a temporary host cuz my pc is dead rn
hosting a discord bot on a toaster is probably better than heroku
yup
When I start the bot and use a particular command for the first time after the start, it gives me an error but when I use any other command and then use that particular command, it works.
The codes used for that particular command is:
var y = message.guild.members.cache.find(m=>m.displayName.toLowerCase() === x)
If(x === 'text' && !y) var z = message.guild.member(bot.user.id)
if(z.user.flags.has('DISCORD_EMPLOYEE')) {...}
The error I'm getting:
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'has' of undefined
message.guild.members.cache.get?
on var z?
Yeah
For this, I suppose, you should change it to var z = message.guild.me
That also works.
That gives the guildmember property of the bot.
same error
could you ask that in djs please? Djs server has much better environment for djs users.
Yeah you access z even if the statement doesn't happen.
Like they can help you access docs with one command, so maybe yeah.
Yeah, that too,
assign some default value to z
Z shouldn't nor doesn't need to be defined at the if statement as it's literally only the bot your defining to a new variable.
assign some default value to z
@pallid igloo still the same
I gotta check what are user.flags
Is it a good idea to use objects for storing user info about individual users in a database instead of create 2 - 3 databases for each user.
my goals are beyond your understanding
works the exact same.
@warm marsh nope
Efficiency issues
You'll only have efficiency issues if the data is large.
I think he means tables.
I gotta check what are user.flags
@pallid igloo https://discord.js.org/#/docs/main/stable/class/UserFlags
When I start the bot and use a particular command for the first time after the start, it gives me an error but when I use any other command and then use that particular command, it works.
@sterile thicket show the full error
objects:
//single database key with all the stuff
db.set(`userInfo.${message.author.id}`,{
balance: 1000,
inventory: {
pizzas: 5,
apples: 5
}
});
Separate database for each user (what i currently use):
db.set(`userBalance.${message.author.id}`,1000):
db.set(`userInventory_${message.author.id}.pizzas`,5);
db.set(`userInventory_${message.author.id}.apples`,5);
It's still stored as an object.
what's better
thats literally the same thing
.pizzas is the property on your object even when concatenated with the string.
thats literally the same thing
@quartz kindle but for some reason the second one takes more storage space than the first
its not a separate database, not even a separate table, thats just how that specific library arranges stuff
also i can just get the data first and store it as a variable in RAM and when smth updates i can reread it
it abstracts the database as a key-value store, so it doesnt really matter
instead of getting the value every single time the user runs a command
which i currently do
i need serious help with not being a dumbass
sure
if i were to use that (quick.db?), id use the first method and do what you just said yes
if i were to use that (quick.db?), id use the first method and do what you just said yes
@quartz kindle updating to mongoose very soon
also the object one is easier for me to use
@sterile thicket show the full error
@quartz kindle
show your info command
I wish people stopped bluring out the consoles.
lol
Like, Mine is litterally named Dell...
show your info command
@quartz kindle Don't laugh at the codes
|| https://hastebin.com/nowdeleted.js ||
people are dumb and make their username their real name
@earnest phoenix excuse me ?
what i should name my username ?
fuckboy69 ?
yes
LoL
xD
because it's a username
not an id
should i switch to a single userInfo named database for each seperate user which has all the data of the user in a single object instead of creating 2 - 3 databases for each user because I'm a bitch
lol
if you're censoring your shit and dont want people to find out your real name you shouldn't have made your username your real name in the first place
your username is used everywhere
should i switch to a single
userInfonamed database for each seperate user which has all the data of the user in a single object instead of creating 2 - 3 databases for each user because I'm a bitch
@earnest phoenix It would be better to make one database if you can understand what you are doing. If you are not able to handle it, You should use multiple ones.
the problem is
code913 is typing
@sterile thicket users are not guaranteed to have flags, you have to fetch them
if(!Mentionname.user.flags) await Mentionname.user.fetchFlags()
Please let him type his problem....
//I make a different "userInventory" database for each user with "apple" key which is an integer
db.set(`userInventory_${message.author.id}.apples`,5);
//smth i can't
db.set(`userInventory.${message.author.id}`,["apple","apple","apple","apple","apple"]);
//here there are 5 apple elements in the ${message.author.id} (of course replaced) key of the "userInventory" database but due to the way my bot economy system works i can't store "userInventory" keys as arrays because "apple" needs to be an integer
That's why I use objects
So what do you want?
@pallid igloo @quartz kindle so is using objects still bad
because
@earnest phoenix how long it takes you to write thoose comment ??
Efficiency issues still might occur, but it's gonna be alright.
code913#3472 how long it takes you to write thoose comment ??
@earnest phoenix Does that affect you in any way?
there is nothing wrong with using objects
Which is better mongodb or quick.db?
i dont know how that library does its thing internally, the only problem with an object store in SQL is that you lose indexing in them
@earnest phoenix Does that affect you in any way?
@pallid igloo just asking : /
but that's only applicable if you actually know what the underlying database engine is doing
i dont know how that library does its thing internally, the only problem with an object store in SQL is that you lose indexing in them
@quartz kindle indexing???
What's that
^ I'm curious too ngl
a relational database, such as most SQL databases, use tables and columns to store data
you have a column with an id, another column with something else, and in your case, a column with a json object for example
Oh, those
something like this
id | name | data
768 abc {a:1,b:2,c:3}
738 afc {a:4,b:3,c:7}
But it's not hard to add indexing manually, is it?
ye but take a lots of time, right ?
now when you want to get data from your database, for example, you want to search for user with id 738
your database has to scan all the entries until if finds the user. this can take a long time if your database is very big
I'll just override mongo's _id field lmao
something like this
id | name | data
768 abc {a:1,b:2,c:3}
738 afc {a:4,b:3,c:7}
@quartz kindle
db.set(`id.name`,"data");
//is the above korrekt
thats where indexing comes in. if you create an index for the column ID, then the database will keep track of the positions of all IDS
so whenever you want to get data from a specifyc id, your database knows exactly where it is, it doesnt need to scan it
you can index any column, like ID, name, etc
but you cannot index the CONTENTS of a json object
you cannot create an index for lets say, all users that have a = 4 inside their data object
so if you want to search for all users that have a = 4 inside the object, your database needs to do a full scan
f
because that specific property inside an object cannot be indexed
and i don't want indexing anyways but i might need it in the future
this is where a document-oriented database such as mongodb works better than a relational database
mongodb can index the contents of json objects
sql cant (unless it has full support for json data types for example)
in sql, if you want to index something, you need to create a column for it
but none of this is relevant to you, if you use a library like quick.db or sequelize, or mongoose
because all of this will be locked behind the library, the library will do all of this for you automatically without your knowledge
postgres 
sometimes the library does a good job, other times it doesnt, because there is no way it can guess the most optimal way to handle your specific kind of data
var status = target.user.presence.status;
if(status = "dnd") statuse = "";
if(status = "online") statuse = "";
if(status = "offline") statuse = "";
if(status = "idle") statuse = "";
target is a guildmember.
and statuse is basically the status emote. But it's always taking the statuse as idle, no matter which mode I'm on.
I tried being dnd but it was giving me idle.
some sort of caching issues maybe?
and i understood nothing from this because i was staring at shitpost 
The problem with quick.db is that it takes all the power away from you
gonna switch to mongoose soon
same thing with mongoose mostly
although mongoose is a completely different beast
first of all because it uses mongodb instead of sqlite
its a completely different database behind the library
hey so i connected my website to my discord.py bot
but i have a html file
i want to open this file using aiohttp
https://pastebin.com/upT7N2Tj
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Sequelize is possibly the best ORM for node.js
orm = object relational mapping
basically hides the database behind a library, the same way quick.db does, but in a different style
;-;
it lets you work on it as if you were working on objects
;-;
@regal jacinth what happened why are you sad
no one is helping me TwT
oh
or do you not need them?
(a template meaning you needing {{ }} or {% %} stuff in the HTML file)
well how then am i going to make the website?
no one is helping me TwT
@regal jacinth no one was ignoring you it's just that some people who were online didn't know the answer to your problem
yeah i have that
I just want an opinion, Can I ask if any command is "looking" good?
Oh, you have those?
Fuck
Sorry for the unnecessary bloat, I suggest using Sanic then
<!--HEAD-->
{% block head %}
<title>TEST posts 1</title>
{% endblock %}
<!--HEAD end-->
<!--STYLE-->
{% block style %} {% endblock %}
<!--STYLE end-->
<!--BODY-->
{% block body %}
<div class="center">
<h1>This is posts</h1>
<div class="side">
<a href="index">Click to go to index</a><br>
<a href="home">click to go to home</a><br>
<a href="new">Click to go to new</a><br>
<a href="/result">click to go to result</a><br>
<a href="/student">click to go to student</a><br>
<a href="verified">click to go to verified</a>
</div>
</div>
{% for s in stuff1%}
<h1>{{s.title}}</h1>
<p>{{s.content}}</p>
{% endfor %}
<form action="/verified" method="POST">
<div class="side">
<h3>Sign up</h3>
Author:<input type="text" name="author">
Email:<input type="email" name="email">
Phone no.:<input type="number" name="phone no">
Submit:<input type="submit" value="submit">
</div>```
okay
Kindy use a bin service like hasteb.in or gist.github.com, Nobody likes overly flooded chat.
I'm actually curious how one would connect both Jinja2 and aiohttp 🤔
mhm
Kindy use a bin service like hasteb.in or gist.github.com, Nobody likes overly flooded chat.
well i could do it but i don't want
How do you make your bot show up as "fuck is typing..." in discord.js?
search for triggerTyping in the docs 🤔
@slender thistle can i use flask instead of sanic?
You risk getting a blocking code
aka your bot being unable to run while Flask is processing stuff
well i could do it but i don't want
if you don't want then we all will frown at super flooded chat
oh so sanic is the right choice?
change it's nickname in the server
they only work 80/100 time
and call .startTyping
I think of Sanic as async Flask with a few edited stuff
How do you make your bot show up as "fuck is typing..." in discord.js?
@earnest phoenix startTyping iirc.
oh
oh it's startTyping in d.js, rip
change it's nickname in the server
@cinder patio why
to make it show that "fuck" is typing, lol
There's not that much difference between them tbh, I could probably try cramming it into one of my bots at some point
How to get the profile badges with user/guildmember property in djs?
Flags
flags is a property of the user class
user.flags?
@pallid igloo probably
don't spam PGamerX the rick roll link is not funi anymore
startTyping is weird af tho
there is no way to stopTyping besides sending a message
triggerTyping would somewhat make sense imo
and it doesnt work for editing messages
for example, if your bot start typing then it edits a message, it will continue typing
it will only stop if it send a new message
(or the typing times out, which is about 10 seconds i think)
yeah
5/7
Last time I checked it was 10
return prefixes[str(message.guild.id)]
KeyError: '740636229527273602'```
its giving me an error for running any commands on new servers
like if the bot is added, it gives me prefix errors
return prefix
with open('prefixes.json', 'r') as f:
prefixes = json.load(f)
return prefixes[str(message.guild.id)]
client = commands.Bot(command_prefix = get_prefix)```
There's no value for guild with ID 740636229527273602
async def posts(request):
return await response.file("/flask/cogs/posts.html") ```
like this
That's possible?
@slender thistle sorry
?
it gives an error tho
No such file or directory: '/flask/cogs/posts.html'
although they are in the same folder
What's your folder structure like?
and where are you trying to access the file from?
which file is that code snippet in?
from app
.. then just posts.html
i did and got the same error
Does PyCharm give any hints for the directory?
i don't know
i don't use them much tbh
Ctrl+Space in the string
are u guys reql mods?
oh
tell
What does reql happen to be? should answer your question
In other words, no, we are not
it says "no suggestions"
well fuck
XD
cogs/posts.html
🤔
O_O
when the bot adds the server
it doesnt make a prefix
and im confused
cuz it used to i think
You really dont need to add custom settings until a guild sets a custom setting anyway
so how would i do that?
by not doing it?
^ if you dont see the guild in your list of custom prefixes, just use the default
is there a way to delete reactions ?
like when the bot react 🖐️ and user react it the bot remove it
Or put the default prefix whenever the bot joins a guild (not full proof as the bot might be offline when added to the guild).
@viral iris djs?
@viral iris djs?
@pallid igloo yes
message.react('◀').then( r => {
message.react('▶')
.removeAll()
like tis ?
this*
@pallid igloo @solemn latch
Iirc message.react is a promise. You can't really do it that way.
then how ?
promise.then()
Or await the promise
Also message.react ends up resolving with MessageReaction
Which doesn't have removeAll.
It does have remove
https://discord.js.org/#/docs/main/stable/class/MessageReaction?scrollTo=remove
message.reactions.removeAll() works
also a promise
Yeah linked him that earlier
reaction.message.reactions.removeAll()
message.react('◀').then( r => {
message.react('▶')
reaction.message.reactions.removeAll()
like this ?
That would sort of defeat the purpose.
how to do that ?
the bot reacts the the emoji
then u need a reaction collector or await reaction to check for the reaction
and
if u want to delete the old msgs too
u have to use partials
voiceStateUpdate
nvm

has been ages since I last saw js with my eyes
let statuses = [
`${client.guilds.cache.size} Servers,`
`${client.users.cache.size} Users`,
`${client.channels.cache.size} Channels`,
`tr!help | ${client.guilds.cache.size} Servers and ${client.users.cache.size} Users`
]
setInterval(function(){
let status = statuses[Math.floor(Math.random() * statuses.length)];
client.user.setActivity(status, {
type: "STREAMING",
url: "https://www.twitch.tv/pokimane"})
.then(presence => console.log(`Your Status has been set to ${presence.game ? presence.game.none : 'none'}`))
.catch(console.error);
}, 3000) //Seconds to Random
})```
bot is setting statuses as ${client.guilds.cache.size} Servers not telling number of guilds
what to do ?
Anyone
Not sure about your fix. But 3 second status changes is api abuse
they have a delay between the changes
3 second status changes is api abuse.
Most bots who have this feature set it to 1 minute or more
i use on my bot about 5 minutes delay
^ mine is 5 minutes for the first 25 hours from startup.
Then once an hour
Mainly because I still display uptime in my bot.
i show some usefull informations in my status (related to the game its designed for) and there it is fine to change it every 5 Mins
how should i show it?
Also
keep in mind its cached. you need to fetch it again to update it
make a global value where you store your guild count and update the stored number with the Guild Add / Guild Remove event
hm
@weak rain client.guilds.size and client.users.size should work
it showing like
as far as i know, .size isn't a part of cache
with open('prefixes.json', 'r') as f:
prefixes = json.load(f)
return prefixes[str(message.guild.id)]
client = commands.Bot(command_prefix = '.')```
i dont think its working
it doesnt log new roles
when join
and the '.'
i changed it but it was get_prefix
@weak rain use backticks
hm
and channels.size isn't a thing as far as i know
i think guild.channels.cache.size is a thing
that mostly happens if you copy the command
but btw i m using backticks only @fringe goblet
you will have to rewrite it and check if itll work after
this points to no
but this is my code
yes just rewrite it
in the same code
then check if itll wokr
it happened for me once also
console.log("I am Ready to Go")
let statuses = [
`${client.guilds.cache.size} Servers,`
`${client.users.cache.size} Users`,
`${client.channels.cache.size} Channels`,
`tr!help | ${client.guilds.cache.size} Servers and ${client.users.cache.size} Users`
]
setInterval(function(){
let status = statuses[Math.floor(Math.random() * statuses.length)];
client.user.setActivity(status, {
type: "STREAMING",
url: "https://www.twitch.tv/pokimane"})
.then(presence => console.log(`Your Status has been set to ${presence.game ? presence.game.none : 'none'}`))
.catch(console.error);
}, 3000)
})```
see
@weak rain example
dont copy and paste it again just write each letter out
hello
@weak rain try .setPresence() instead
instead of activity ok
How can I write NSFW code to my discord bot. Can anyone write sample code?
like, i use this
client.shard.fetchClientValues('guilds.cache.size').then(results => {
client.user.setPresence({ activity: { name: `Fluffing ${results.reduce((prev, guildCount) => prev + guildCount, 0)} servers`}, ststus: "online"});
setInterval(() => {
client.user.setPresence({ activity: { name: `Fluffing ${results.reduce((prev, guildCount) => prev + guildCount, 0)} servers`}, ststus: "online"});
}, 600000);
});
and it works completely fine
hn
@signal sapphire message.channel.send("nsfw")
@solemn latch I want my discord bot to send +18 content. Can you send DM?
check if the channel is a NSFW channel if it does send the stuff
I keep my dms closed
how to get the nsfw stuff is up to you
sample code pls
presence also not working
did you want to set it or get it?
hm wdym
are properties stuff about objects only?
like:
var object = {
yeet: "yeet"
};
object.yeet //returns "yeet"
long
I mean you can create a new property for strings using String.prototype, maps using Map.prototype...
technically X.prototype is an object
so yeah you can only apply properties to objects
am I clear
Arrays are also technically objects as far as their type is concerned
arrays can contain objects but they are not objects in themself
even if typeof array returns object for some reason
smh
everything is an object except primitive values
^
Classes are functions
at least other languages are clear about what is an object and what is notr
🤔
object = {}
others thighs != objects
soooo I'm generating a profile card right now and it looks like this but it gets cut off on mobile - is there a size limit on mobile images? It's currently a 2000x2000px image
soooo I'm generating a profile card right now and it looks like this but it gets cut off on mobile - is there a size limit on mobile images? It's currently a 2000x2000px image
@queen moss nah, it's just a discord bug
love that
a function is a callable object
thanks
put image in a embed
aight
the higher the res is, the better I guess
may as well
for the user it may take longer to load
Many users have terrible internet
There are devs here with a few megs download
you should try 1024x1024
aight
no
TypeError: Cannot read property 'execute' of undefined tried doing a command handler, ??
Send code
full?
yes
Nope
the code around the error
of the command file
The execute and stuff
ok wait
the starting stuff
Use hastebin
it does not need to be the command file
Where you defined execute
there's a chance it's not coming from there
it does not need to be the command file
@sudden geyser it can be
one time it was for me
You need to check the command exists before doing
Command.execute
Every command also needs an execute function
for example, the command was not found and they were trying to .execute(...) it
in command file i was using execute (msg ,args , client)
but i was exxecuting only msg,args
the stacktrace tells where it's coming from
if(message.content.startsWith(botconfig.prefix)) { switch(args[0].toLowerCase()) { case 'prefix': bot.commands.get('test').execute(message, args); break; }
send command file
does the test command exist
;-;
does it exist or not
@sudden geyser it does...
Does it have an execute function
he did
there is the problme
can you show us the test.js file then
i am fucking sure
can you show us the
test.jsfile then
@sudden geyser this is what i am asking
the command file
ok
pg it's one scenario, really the stacktrace is the most useful out of this
name: "prefix",
description: "test command",
execute(message, args) {
message.channel.send('test');
}
}```
bruh
i knew it
Thats prefix not test
fail at markdown
i fucking predicted it
S
change "prefix" to test
? @steel pelican
@stable eagle change prefix to test
Your getting a command named test
But in your command file you named it prefix
Uh my bots doesnt show up in topgg do u know why?
Ah
Mkay
otherwise u must had role<@&265125253443878912>
ping
Nope
Pong
hey
Heya
DiscordAPIError: Missing Access
at RequestHandler.execute (/home/runner/Oosterhout-V22/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
method: 'post',
path: '/channels/738024910441676852/messages',
code: 50001,
httpStatus: 403
}
If i say !play
Code:
internal/modules/cjs/loader.js:1068
throw err;
^
Error: Cannot find module 'C:\Users\FREE\Desktop\DiscordBot\bot'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
at Function.Module._load (internal/modules/cjs/loader.js:911:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Missing acess is like missing permission.
Your bot did something in a channel it didn't have acess to use
Ok
can anyone tlel me
@sinful sorrel tell what also https://dontasktoask.com
He gave the error
the module doesn't exist
DeprecationWarning: Collection#find: pass a function instead
Pretty descriptive error
(b => b == "a")
umm
thats function for example
i was wondering
wdym
if my bot can habe mobile status
i dont understand
if my bot can habe mobile status
it can, just change the platform and browser toDiscord Android.
it can, just change the platform and browser to
Discord Android.
how
have heard of constants?
internal/modules/cjs/loader.js:1068
throw err;
^
Error: Cannot find module 'C:\Users\FREE\Desktop\DiscordBot\bot'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
at Function.Module._load (internal/modules/cjs/loader.js:911:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
yes
i still dont understand
internal/modules/cjs/loader.js:1068
throw err;
^Error: Cannot find module 'C:\Users\FREE\Desktop\DiscordBot\bot'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1065:15)
at Function.Module._load (internal/modules/cjs/loader.js:911:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
@sinful sorrel the module doesn't exist
Did you make a typo
Yep
i was wrong lul
its string, so ' is ok, like ".
The module it looks for is bot
Which doesnt make a lot of sense to me
free u mean ``` Client.user.setActivity(
!help for commands, { type: 3, browser: "DISCORD IOS" });
something like thus?
this*
Modules can be .js
Require auto adds .js if no extention is given iirc
do alt+f4
Lemme check my code, because I never add .js extensions for js
anyone on here that uses discord 11.5.1 know how to make the bot respond if you tag it as i've tried 2 different ways and still ain't able to get it to work
bot.user.setActivity(`525+ servers | s!help`, { type: 3, browser: "DISCORD IOS" });
anyone on here that uses discord 11.5.1 know how to make the bot respond if you tag it as i've tried 2 different ways and still ain't able to get it to work
@earnest phoenix https://dontasktoask.com
is this code good enough
something like thus?
@delicate shore no and its needs to be in case sensetive
nothing probably
ok
smh
@earnest phoenix didnt really help
bro
i told you not to ask "hey any discord yada yada yada" because....just read the link
not in set statys
@restive furnace wha-
haha ts go brrrrrrrrrrrrrrrr
evin a wit?
@restive furnace wha-
@delicate shorejs require(__dirname + "/node_modules/discord.js/smth/smth").browser = "Discord Android";
for example, and no, that wont work
@earnest phoenix didnt really help
@earnest phoenix just make a command withour the prefix that is literally your bot's name and tag
or
better
uh oh
just check if message.mentions.bots.first() is your bot
and i wont help anymore, since its undocumented feature, so you need to search from google or something.
and i wont help anymore, since its undocumented feature, so you need to search from google or something.
@restive furnace it's against TOS?
Undocumented stuff is generally against TOS
oh
well
Or atleast, isnt intended to be used
i deleted it from my clipboard lmao
almost every bot does it tho
bruh
lol idc
var talkedRecently = [];
client.on("message", msg => {
if (!msg.content.startsWith(prefix) || msg.author.bot) return;
if (talkedRecently.includes(msg.author.id)) {
let embed = new Discord.RichEmbed()
.setThumbnail(msg.author.avatarURL)
.setTitle(msg.author.username)
.addField(`Wait 5 seconds before using a command again.`, " || || ")
.setFooter(`© 2020 Hydra+ | Requested By | ${msg.author.username}`)
.setColor("RANDOM");
msg.channel.send(embed);
return;
}
var args = msg.content
.slice(prefix.length)
.trim()
.split(" ")
.filter(item => item !== "");
var command = args.shift().toLowerCase();
if (command === "") return;
talkedRecently.push(msg.author.id);
setTimeout(() => {
talkedRecently = talkedRecently.filter(e => e !== msg.author.id);
}, 500);
if (msg.content.includes(client.user.id)) {
let embed = new Discord.RichEmbed()
.setColor("RANDOM")
.setThumbnail(msg.guild.iconURL)
.setTitle(`Support Server`)
.addField("test","test")
.setFooter(`© 2020 Hydra+ | Requested By | ${msg.author.username}`);
msg.channel.send(embed);
}
notsobot did it too
notsobot got banned btw
https://hasteb.in/evinawit
how do i fix the ts compiler lmao
Oof did it
atleast it dissappeared
bruh dice doing ts
bruh dice doing ts
is sexy asf
tts is more sexy
oh. i see
if (msg.mentions.bots.first()) {
let embed = new Discord.RichEmbed()
.setColor("RANDOM")
.setThumbnail(msg.guild.iconURL)
.setTitle(`test`)
.addField("test","test")
.setFooter(`© 2020 Hydra+ | Requested By | ${msg.author.username}`);
msg.channel.send(embed);
}
would that work for mentioning the bot first to trigger the command
@warm spruce or @wheat ibex (those rand numbers present yours bot id), would work.
^^
mention regex btw: /^\<(@|!@)(\d{17}|\d{18})\>/g
but uh yeah how 2 mak ts compiler work with async
but uh yeah how 2 mak ts compiler work with async
@pure lion one day 🤞
use ESNext
under what config setting
/<@!?\d{17,18}>/g 
the es version thing

Probably should search for bot mention
ah shit i closed vsc
f
Rather than any mention
still aint working
Oh oof v11
:rip:
V11 is depreciated
shit
Probably should look into changing to v12 before adding any new features
nah
It won't work in a few months
then rip u
ill be fine
Ok. Well I cant help you with deprecated libs.
V11 is depreciated
ppl live in their bubble, and can't update their things
aka they can't be bothered
do i need to install anything to use mongo db cloud?
Need to? No.
Want to? Probably
Iirc mongodb has a driver lib you probably want to install
@client.command()
async def ping1(ctx):
mongo_url = "url"
cluster = MongoClient(mongo_url)
db = cluster['Prefixdatabase']
collection = db['new']
ping_cm = {'command':1}
collection.insert_one(ping_cm)
await ctx.channel.send('ping has been registered')
like is this correct?
🤷 id look over the docs for the lib
sooo can anyone help me i am trying to create a web chatbot and i want the bot to play music when i tell him too so how can i do it is there any doc available i am using css javascript and html5
you cannot do it with pure frontend
I'm confused.
Your making a chat room music bot that also is a discord bot?
also there arent any docs
you need to have good knowledge of full stack development to accomplish this
I'm confused.
Your making a chat room music bot that also is a discord bot?
@solemn latch nah just i web bot
So nothing to do with discord?
like siri
So a voice controlled bot?
yup
This is a huge project tbh
i know
That requires a lot of programming knowledge
i have plenty time thas why i am in it
you need to be good with full stack development, this isn't possible with pure frontend languages
Youd have to know how to do it. Your not going to find some explanation somewhere
frontend is just styling, you still need to do ML in your backend and voice models
^
If I were to pay for a good db what’s the easiest to use on heroku?
Or what is the best hosting?
For a small bot?
You shouldnt have to pay for a db
If your paying for a db, just get a vps
And if using SQLite?
Sqlite is pretty limited iirc
keep in mind that you probably won't be able to record voice models yourself and instead will have to pay for existing voice models or pay people from various countries to record vowels and make a voice model from that, you probably cant do that solo. another way is to use existing voice recognition APIs which again cost money.
google, apple and microsoft can easily do this because they have millions to invest
Which is good
Google it. Databases should be researched before choosing one
.addField("[**Invite Link (Required)**](FIRST LINK)" ,"[**Invite Link (ADMIN)**](SECOND LINK)")```
so what this does is create ADMIN hyperlink
but not the other one
and this is not my main bot in case u wondering
you can't put embedded links into the field title
depends why ur tryna do ¯_(ツ)_/¯
Like carl
no clue, not seen it being used at all
ah you can just put a description with linebreaks and embedded links
ok
thnx
and
.setDescription("[**Invite Link (Required)**](link)" ,"[**Invite Link (ADMIN)**](link)")```
why is this not working
this is what happns

setDescription() only accepts one parameter
I enjoy the .on('ready') event handler. Makes startup jobs EZ
you don't need that second hyperlink
why it still offline i gave it permission
did you actually put the URL
@fading jasper go to their support server
why it still offline i gave it permission
@fading jasper did you perform the bot login function?
ye
Is the process running? or did it crash?
crash maybe
it isn't their bot
@slender thistle hey sorry to ping again
i used aiohttp_jinja2 and it worked but i have another error or question
does {% %} and {{ }} not work
python file : https://hastebin.com/pevaleyoju.py
... how many of those are there
Am I the only one who uses Jinja and webserver frameworks separately lol
lol idk
i pinged u cuz u told me about it
sorry anyway
i will wait for another one to respond
I just never worked with that library specifically
google is ur best friend XD
@regal jacinth How exactly does it not work though?
aiohttp_jinja2 ?
whatever that isn't working 
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ConfigurationError: The "dnspython" module must be installed to use mongodb+srv:// URIs
Ignoring exception in command None:
im using mongo
lmao XD
do i donwload something?
only posts works
hmmm yeah?
or pip?
dude all are the same
so only posts works and when i click "submit" errrrrrrrrrrrrrrrrrrrrrror
How make a wait action?
A wait action?
grammar XD
depends on the language
Discord.js
thats a lib, not a language
You could do a setInterval in JS
XD
setInterval, setTimeout. or a promise that resolves after x time
Ok thanks bro
is it easy to setup reaction roles with mongo on py?
yes?
@regal jacinth what's the error you are getting?
It's easier for both of us if you just post the errors straight away tbh
Because, well, I have absolutely zero fucking idea what the error is 
ok lmao
obligatory videos are not a good idea for development.
use the docs
I've generally tried to avoid YT videos for anything related to Discord bots so far, because they either contain outdated code, or just encourage bad practices
For some reason, it's easier for me to either think the logic through on my own or ask someone I know (or even here while I'm at it)
nice
const mongoose =require("mongoose");
const {Guild} =require('../models/guild');
module.exports = async (bot, guild) => {
guild = new Guild({
_id: mongoose.Types.ObjectId(),
guildID: guild.id,
guildName: guild.name,
});
guild.save()
.then(result => console.log(result))
.catch(err => console.error(err));
console.log('I have joined a new server!');
};
when the bot join a server
i didnt the server information in the database
anyone can help?
@regal jacinth I'm not too familiar with blocks in Jinja per se, but it seems that you are trying to do {% for key, value in result.items() %} where result is not defined
i did tho?
@dreamy cedar you dont associate the model with a schema
the html where the form is (posts) :https://hastebin.com/avesibilor.xml
the html where the values goes (verified):https://hastebin.com/opecuvatoq.xml
@slender thistle here
@dreamy cedar you dont associate the model with a schema
@lusty quest here is the schema
const mongoose =require("mongoose");
const guildSchema = mongoose.Schema({
_id: mongoose.Schema.Types.ObjectId,
guildID: String,
guildName: String
});
module.exports = mongoose.model('Guild', guildSchema);
const newGuild = await new Guild(merged);
newGuild.save()
Is that the verified.html file?
and the posts html file
Oh I see
merged is your model you define in your event
mhm
usually you define a object that contains the stuff you want to save in your DB
then you associate this object with your Model
then save it
yes but it’s always reset


