#development
1 messages · Page 594 of 1
0x40
i can return any other, e.g. ("KICK_MEMBERS")
instead of SEND_MESSAGES?
Ye
0x00000800
May actually be that
Through a bit more research..
And the SEND_MESSAGES should have worked tho
it doesn't for some reason
Weird
it logs Missing permissions to console
as error
but i cant return error as message
What lang
js
idk, theres catch
Like when that error comes up
which works
Make it say the error messagd
I don't know js
its called .catch
Whatever will make it work tho
show us the error message
Wait
wait
you're trying to have the website server count?
look, im trying to make bot reply to user if cant send message to channel
and i made it
but code is so long
with .catch
if i could check for permissions
in message event. instead of .catching every error
just screenshot the code
sec
this is the code im trying
its werid cuz i have this code
and it works perfectly fine
whats the error
Maybe the user has blocked DM’s
pls
i still want to handle all errors
put a catch after the author.send
you put the catch on the author.send?
I mean, did you put that catch you screenshotted on the author.send?
so what do you want
its not what im looking for because its long
i want
to check if bot can send messages
before it continues
so i dont have to .catch 345345 times
are you sure that's the permission it's missing
muted?
im looking for a way to handle that error
or removed the permission from it's role
removed permission
role
i mute bot so i can cause an error
i want to check for that error
just not with .catch
idk why checking for "send_messages" wont work
its only thing i need right now
change this to SEND_MESSAGES https://media.discordapp.net/attachments/272764566411149314/560942287379759134/unknown.png
this works
but actually give it SEND_MESSAGES before testing it
buuuuut
i would like to check for permissions
when message event is called
not specific command
on what
member.top_role
dbl ask2ask
okay i think im actually retarded
@deep pond what you need with help?
if you have an error just send code and your error
and we will may help you :^)
so what was wrong "uwu"?
welp i dont even know python languages so yeah
oh
i didnt declare check for permission in message event xd
dk how tf i missed that
i need help making a roblox verification bot
How can I put a timestamp in a message
client.channels.find(x => x.name === 'bot-information').send(`Bot succesfully logged in at ${Date.now()}`);
${Date.now()}
ain't working, it sends it in ms (I think) but I want it like Today at 23:12
Any1 knows how to put it so it would do that?
Idk how to make timestamps on a regular message that change like the ones in embeds do
same ::P
just format it
I tried
I dont think that changes with the time like embed times stamps do though
but Im new to coding
you cant put a discord timestamp on a normal message, it will show next to your username, but not in the message itself, you cant connect the two
message deleted: not helpful and sounded rude
Send an embed with just a timestamp with the message 
well, embeds yeah, hes trying on a normal message
xd
Im trying to get the times my bot restarted in a channel
any idea how to do that with embed?
if you're posting to discord, you dont need to control that yourself
just use discord's own timestamps that appear after the username
but that takes more time for my eyes to find and im lazy
@deep pond Wut you trying to do?
discord.js itself is the leak
bug fixed put bot back in for verification
if i'm not mistakened, it's a webhook and html
client.on('guildMemberAdd',member=>{
let color = ['Red','Pink','Green','Blue','Yellow','Snow','Black','HotPink','DeepPink','Chocolate','Cyan','Purple','DodgerBlue']
var role = member.guild.roles.find('name'+color[Math.floor(Math.random()*color.length)])
member.guild.channels.get('281113673282486273').send(`${member} хай кст`)
member.addRole(role)
})
what am I doing wrong? a fall due to the line:
+color[Math.floor(Math.random()*color.length)]
.find() either takes 2 params or a function, and you passed 1 string param
you probably want .find('name', color[Math.floor(Math.random() * color.length)])
@idle basalt thank you very much, I did not notice this)
i read the russian anyway, youre welcome
Well using the 2 params is deprecated. It will only work with functions in the future
ye but theres not even a tentative date for v12 release
it wont be a problem for a long time
But why use deprecated methods in the first place
no reason. i use functions /shrug
with support i prefer to just fix the problem theyre having instead of telling them to refactor code that works (and will work for some time)
(r => r.name == "role") isn't that difficult lol
i dont know what youre arguing
I'm arguing that you gave him a deprecated solution either way
reread this message: with support i prefer to just fix the problem theyre having instead of telling them to refactor code that works (and will work for some time)
passing a function is better, i agree. its just not necessary to refactor his code
He would need to add 6 extra characters not including spaces
you told him .find('name', color[Math.floor(Math.random() * color.length)])
Which is lliterally
.find(r => r.name == color[Math.floor(Math.random() * color.length)])
argues over using deprecated code that will work for months
uses double equals
Sorry I dont want to use strict equals for something that it wouldnt make a difference for
I'm not checking strictly that a number is a number or a string is a string it would make no difference in this case
But if you want 1 extra character? Then fucking go for it
ironic
if we're golfing, why are you suggesting he pass a function which takes 6 extra characters
Because it isnt deprecated
That's like knowing a company is going to collapse and investing in it anyways.
If you want to make your code work in the future, go for it
like i said twice now, i agree that passing a function is more correct. i use master so i have to pass a function anyway, but its silly to refactor someones code when he just wanted to know what he did wrong
his code will work in the future
you act like this is the only change that will exist in v12 😂 if he chooses to update when master comes out (in an unknown but large amount of time), he will have to refactor a lot more code than his .find()
https://github.com/teamreflex/DiscordPHP Is this the most up to date Discord library in PHP?
It's literally not a refactor he would've hit backspace 6 times and type 11 characters
youre making a silly semantic argument. whats the point?
The reason why I ask is because I'd like to make a Discord bot that interacts with my website written in PHP
literally the first paragraph in the readme
i wouldnt know, but its likely theyre all substandard
pretty sure you can have your discord bot interact with your backend even if theyre in different languages
Hm, I'll try to look it up. Thank you
you can use http requests and web sockets to transfer data from one language to the other
theres no need to torture yourself with a discord php lib if you know another language that can get the job done (py, js, java, cpp, go, etc.)
I'm more fluent in PHP than I am in JS, Python or CPP
Although, I'll try to take a look into doing the above
Thank you
anyone use postgres with node.js?
@amber fractal @idle basalt to settle this dumb argument:
DO NOT instruct newbies to use deprecated functions, it'll be a setback on them later and they'll be super confused. It doesn't help them learn. Instead, if you see someone asking for help with code that has a deprecated function, as a side note recommend them to switch away from the deprecated function.
I am trying to manipulate json data from my postgres database using knexjs, if anyone understand what I just said and thinks they could help @ or dm me
help
how do i see invites
when people invite
??
how do i trach invites
@bitter sundial

- provide more information. you are asking how do you make a bot to track invites but you do not give any useful information as what library or coding language you use
giving yourself pseudo admin on any server your bot is on sounds like a pretty bad idea
yes it so anoying to server owner
This may be a stupid question, but could my bot use any language I want?
sure, as long as you're able to make api requests you can use whatever you want
if there's no library for the language you wanna use you might have to write your own though :>
bot auto role is code if (member.user) return false; ?
can someone please explain in a tl;dr or link me an article about what docker is and why and when i would use it?
Does anyone know if it is possible for a discord bot to create a channel? I found on the developer portal page information for modifying and deleting a channel but never found anything for creating one...
https://discordapp.com/developers/docs/resources/channel#deleteclose-channel
Integrate your service with Discord — whether it's a bot or a game or your whatever you wildest imagination can come up with.
wild guess but if he's searching for the specific discord api reference he might not be using any conventional lib
one of the Java ones, I haven't gotten that deep yet but I wanted to know if my idea was possible
Look at their docs
Should be something like guild the message was sent in .createChannel
I don't use java so cant tell ya
Integrate your service with Discord — whether it's a bot or a game or your whatever you wildest imagination can come up with.
there's your reference
found it via detour aswell, looked through a lib's code to find what endpoint they use for channel creation 
ahh very nice
Apparently my computer is running node version 7.0.0
Will that be a problem? It seems like a problem so far, but is here a work around?
its not too hard to just install a newer version lol
This isn't my computer, so I don't have permission to do that
I keep getting unmet peer dependency problems when I try to install discord.js
bufferutil, for instance, and when I try to install bufferutil, I get 'node_api.h' file not found
you could simply ask for permission to update node 
Mmmmm... I could. I think I'd rather just do this on my laptop instead.
whats a good site to start learning nodejs for free?
let channel = message.guild.channels.get('540406836311097374')
This should work right?
Yep
The message is in DMs
If a message was sent in a DM, guild attribute will be null
(return on dm messages)
an if checking for falsey value

so wait
could I do something like
if(message.guild){
//do something
}else if (message.dmchannel){
//do something else
}
Would that work?
just switch through message.channel.type
if it's 'text' do your thing if it's 'dm' or 'group' return
ah okie
so like
if(message.channel.type === "text"){
//do something
}else {
return
}
?
if you're only interested in text messages then yes you could do it like that
Wait
but what if I want it to also get the channel id and send something to that channel if they use a command in dms
This is for an error system I have
if you want to have messages sent to a channel via dm command the channel id you want the message to be sent into needs to be one of the command arguments
Wdym?
what exactly do you wanna do
I was trying to use the help cmd
in my bots dms
and it sent me an error
But I couldn't view the error until I did console.log
so my error system isn't working in dms
and I also don't know why my help cmd won't send in dms
bc the error system broke so I couldn't view the error it gave me to fix the reason it won't send in dms
As for the error system, I want it so if they send a cmd in dms and it errors I want that error to be sent to a channel in my discord server
what does your error system do for errors that happen in regular text channels
also send a message to your specific channel?
https://i.ryeqb.me/e0dd4163eb.png is your bot specific to your server or why are you trying to get your channel's id dynamically
It is specific to my server yes
could just hardcode the id and call it a day, get the channel through <client>.channels and you're fine
client.guild.channels.get()
sorry its: client.channels.get
happens
don't fail silently
if the bot is specific to your server anyway keep logs of whats happening, will help you troubleshoot simple issues
Wdym keep logs?
track errors and stuff
return console.logs or whatnot unless you're 100% sure your code will run without failing in any given scenario
Ah okie
Wait what are you trying to do?
I already got part of it solved
now I need to get it to check the users permission from the server they are in
(node:14217) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'tag' of undefined
${nesne.user.tag}
Turkish word.
nesne.user is not defined
I know that
blacklist command
You know who I am tho
Im steven 😢
let nesne = args[0]
Ok
is nesne mention
Yea
That wouldnt give it a user property
okay, buddy
right?
No
:\
He just knows who I am :(
It ruins our friendship
but when i remove .user undefined :/
you want it to be a mention right?
guys how can i cut it? use an array?
hello
Rikkaevet- undefined karalisteye alındı.
özgür bey
He cnm
mantıklı
@earnest phoenix https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch
How could I restrict certain commands from being used in dms?
simply return if the respective command is used in dms rather than processing it
Or return an error
If you're gonna allow some commands in DM
It be better to let the user know when using one that isn't allowed
with what
prob have a zero width space or something
can you show your entire json
did you copy paste that code from the internet?
copypaste it here
why 🤔
because i was gonna ask if you can help me
{
"token": "put your token here"
}```try copy pasting this
im not available to call, and whatever problem you have can surely be fixed by text
ok
thanks
so i have some code set up to say a message at a interval but i dont think its working
show the code
k
var Discord = require('discord.io');
var logger = require('winston');
var auth = require('./auth.json');
// Configure logger settings
logger.remove(logger.transports.Console);
logger.add(new logger.transports.Console, {
colorize: true
});
logger.level = 'debug';
// Initialize Discord Bot
var bot = new Discord.Client({
token: auth.token,
autorun: true
});
bot.on('ready', function (evt) {
logger.info('Connected');
logger.info('Logged in as: ');
logger.info(bot.username + ' - (' + bot.id + ')');
});
bot.on('message', function (user, userID, channelID, message, evt) {
// Our bot needs to know if it will execute a command
// It will listen for messages that will start with !
if (message.substring(0, 1) == '!') {
var args = message.substring(1).split(' ');
var cmd = args[0];
args = args.splice(1);
switch(cmd) {
// !ping
case 'ping':
bot.sendMessage({
to: channelID,
message: 'Pong!'
});
break;
// Just add any case commands if you want to..
}
}
});
there really is no error but it wont send the message i want it to its just a test Right now
do you even understand that code
i dont really code but i am working on it
next time put it in a code block
what?
var logger = require('winston');
var auth = require('./auth.json');
// Configure logger settings
logger.remove(logger.transports.Console);
logger.add(new logger.transports.Console, {
colorize: true
});
logger.level = 'debug';
// Initialize Discord Bot
var bot = new Discord.Client({
token: auth.token,
autorun: true
});
bot.on('ready', function (evt) {
logger.info('Connected');
logger.info('Logged in as: ');
logger.info(bot.username + ' - (' + bot.id + ')');
});
bot.on('message', function (user, userID, channelID, message, evt) {
// Our bot needs to know if it will execute a command
// It will listen for messages that will start with !
if (message.substring(0, 1) == '!') {
var args = message.substring(1).split(' ');
var cmd = args[0];
args = args.splice(1);
switch(cmd) {
// !ping
case 'ping':
bot.sendMessage({
to: channelID,
message: 'Pong!'
});
break;
// Just add any case commands if you want to..
}
}
});```
how
```js
code
```
im just trying to make a simple bot that sends a message at a interval
i dont really code
are you looking to learn or just do this
just make the interval bot and im done i might get back into it
im willing to do a commision thing for the code
commission 🤔 im in
how much is your commision
this is probably not the right place to hire freelancers
free lmao i wouldnt charge for something as simple as a message interval bot
sure
would you be able to make it send mulitiple at intervals of my choosing?
slightly more work, but sure

so I've been trying to start a PHP project which requires me to get data from a MySQL database
I've worked with code like this in school and it successfully worked there, however it doesn't work at home and I have no idea why
<?php
$db = new PDO("mysql:host=localhost;dbname=competitive;charset:utf8", 'competitive', '123456');
$id = $_GET["id"];
$sql = 'SELECT * FROM matches WHERE tournamentid = "$id"';
$result = $db -> query($sql);
$row = $result -> fetch(PDO::FETCH_ASSOC);
while($row)
{
echo("test");
$row = $result -> fetch (PDO::FETCH_ASSOC);
}
?>```
This code should work but it refuses to do anything
@scarlet bane
test doesn't echo?
nope
only thing i can think of is that you have no rows
that's the only case your code would fail on
make sure you spelt your column names / table name right
actually
i think i figured out the main issue
but that still doesn't explain anything
💵
i added a echo to print $sql
aaaaand it turned into SELECT * FROM matches WHERE tournamentid = "$id"
inb4 $id isnt valid

uh
try with double quotes
also, you should be escaping your params
$sql = "SELECT * FROM matches WHERE tournamentid = '$id'";
code works now?
Epic
nice
I am proud of both of you
you should really escape your params tho, you're begging for an sqlinjection like that
yeah
I wanted to get basic functionality working just to test and then secure it
i dont really use pdo often (i prefer mysqli cus i use that more)
but uh
$id = $db->quote($_GET["id"]);
$sql = "SELECT * FROM matches WHERE tournamentid = $id";
that should do it
notice that on the $sql, i removed the 's, since quote does that for you
any time ❤
php and mysql the two frenemies of leaking data
Use PDO prepared statements wherever possible
effort
Not really
This works quite well: https://github.com/paragonie/easydb
Single file project? You know that's what *not my bot is 😛

not what*
no i mean for marco
Ah okay, still worth using PDO tho
I feel sad
Why peter
wait I move to #memes-and-media
syntax?
look very carefully
😑
srsly?
hint: .
I suggest you learn javascript properly before trying to make a bot with it
yikes
that doesnt look like it "works" to me
How did this even happen
Learn the lang first before making a bot
considering it's doing a .react("?"), i really think you just copied a bot and are trying to run it
We don't help with that here
i got help out by a guy named @earnest phoenix he just went some where and i need a little help
...
he is in my testing server so he help out
Then wait for them to come back...?
i really need this bot up and running
Why don't you just learn the JS basics until u start working with a library or something like this?
^
@scarlet bane what do you mean its doing .React("?")
Dude
should i just get rid that line
? is not an emote, you dont know what your code is doing
xd
i do
You clearly copied this
i didnt
Please stop
there is the og code
all i did was modify it alittle bit
delete it
IM TRYING TO HELP
dude
Frigid token bad
@modern sable token leak up there
I could use your bot
oh, someone already got it
and yeet
its already deleted
my bad marco
xd
where 
its gone
changed the token
regen your token
didnt realise god dammit
Instead of the '?'
bruh i gave u working code
:grey_question:
u just don't have emoji encoding
Or
so it becomes ?
im am exceptionally retarded
:question:
xdd
@earnest phoenix tip 1: don't give code to people
Try it with unicode symbols
help yourself
YeS
@idle scaffold
That link
And the only reason I use async is because I'm too lazy to translate my code xddddd
the async in the website is referring to async code
Ik
not the lib
Ooooh ok
we can stop brigading now 👏
discord is delaying my messages wee
alright im sorry for not knowing the code
Same cry
i just wanted to make a bot its my first time trying
Learn the lang first tho
i didnt know that i needed to know Js
Make a text based game first or sth
sorry
Nah it's k
i changed the Token
You just need to leaRn
thats equivalent of saying "i didnt know i had to learn spanish in order to work in spain"
also use hastebin for sharing code
^
endless loop by
for(;;)
or paste.mod.gg if it doesnt work
i use hasteb.in.. doesnt matter
if you dont know what youre doing, then just dont bother
either pay someone to make the bot for you, learn the language yourself (this doesnt mean you have to do it alone. you can ask for support, just dont ask to be given free code when you dont have the faintest idea of how it works), or use one of the thousands of public bots
i wanted to make it for a friend im sorry
nah u gave him code and let him copy
u can't code without knowing syntax
you're hurting him more than helping him
heRES A GREAT GUIDE ABOUT HOW TO CODE ON MO
to you
not to someone who has no idea how to program
i doubt he even knows what a for loop is
why would you use an infinite loop and a promise timeout when you can just use setInterval() lmao
shush
was testing different ways
also why declare ms, min, and sec when you never use any of them
!!
use a vps, not glitch, like cry said
you guys assume they know how to use a vps
I recommend a vps from ionos if you want something simple to use
Yeah right, Ionos. Stay very far away from them, they're pretty shady
Google or amazon are free for 12 months
in mongoose/mongodb is there a way to check two fields in one query?
for ex
.find(name) will check the {name:} field of a document and {nickname:}
{field1: condition..., field2: condition...}?
.find({field1: condition..., field2: condition...})
so if field1 doesnt match any itll go to field2?
oh is there anyway to check field2 if field1 is false?
like
how i want it to work is
find it, if it doesnt exist find the other field
$or: {..., ...}
tysm
it's called documentation man
I dont even use mongodb that much 
for (let { conf } of Object.values(client.commands)) {
console.log(conf.guildOnly)
if (conf.guildOnly && message.channel.type !== "text") {
return message.reply("That command is a Guild Only command!")
}
}
Alright
ignore the console log with the conf.guildOnly
But conf is for some reason undefined.
I don't see how or why it would be.
Can someone please help me?
perhaps client.commands values do not have a conf attribute
or perhaps your for loop format is wrong, i can't tell, im not that good with JS
then your loop is weird
Don't see how
try with let cmd and cmd.conf
and see if that fixes it
maybe its not unwrapping properly
What?
oh?
Makes no sense to me, how could that fix it?
@lusty dew do you have an example command?
I have a command
mind posting it?
man what is this newfangled formatting
you have function declarations inside of objects without defining keys, you're unpacking inside of a for initializer, what the fuck
Hm?
for (let cmd of Object.values(client.commands)) {
let conf=cmd.conf;
console.log(conf.guildOnly)
if (conf.guildOnly && message.channel.type !== "text") {
return message.reply("That command is a Guild Only command!")
}
}
raid
just
no
You said you weren't any good at Js
no other part seems wrong
you're missing }); on the last line
What?
no?
shit i missed
xd
i need to go die
client.commands = new Discord.Collection();
No
🤦
you guys are wacky lmfao
@potent frost No
@lusty dew try what i did
OH wait lmao
@scarlet bane No
Ok then stop asking for help
I don't trust it
¯_(ツ)_/¯
You said you was not good at js
I can.
So use it
It seems safe, right?
It's not modifying anything, it's not printing your token
What's the worst that could happen, it doesnt solve your problem
But at least you tried
What are you trying to do 
He's trying to unpack a custom object inline inside of a for loop constructor
because apparently let cmd of is too low iq
You are the one choosing to have the attitude I am not forcing you too.
of is a collection iterator right?
ig
Object.values is tripping me out too
pretty sure you can do of on the dict
but that shouldnt affect anything
Then if you wanna loop over commands in a Discord.Collection you can just use of like he said
client.loadCommands = (callback) => {
client.commands = {}
fs.readdir('./commands/', (err, files) => {
if (err) {
client.log(`Error loading commands : ${err}`)
return
}
files.forEach(file => {
require(`../commands/${file}`).load(client)
})
callback()
})
}
for (let cmd of client.commands) {
let conf=cmd.conf;
console.log(conf.guildOnly)
if (conf.guildOnly && message.channel.type !== "text") {
return message.reply("That command is a Guild Only command!")
}
}
but you flipped out
How did I flip out
I was joking...
Lmfao
You guys have no humor
Don't cuss at me
Sorry that I don't like being cussed at.
No i just dont like your attitude, it's very entitled and frankly it's too "jokey" for me
Nothing either of us can do about it. Good luck with your bot
@lusty dew try this
and tell me what it returns
console.log(Object.values(client.commands))
ok ok ok. you're trying to load commands right?
No
also, real question
why are you iterating through every command
when you are responding about "this command"
It isn't the only command like that
...
You guys asked for a example command
So I sent one
How do you know your code isn't working?
@lusty dew this is my command layout,
and doesn't send the message it is supposed too.
Mhm
module.exports = commandManager.addCommand({
commandsAlias: ["ping", "clientPing", "pong"],
configuration: { guild: false, loud: false, nsfw: false},
description: `gets the bot's ping`,
commandArguments: ``,
example: ``,
runFunction: (args, params, msgObj, speaker, channel, guild, isStaff) => {
Util.sendEmbed(channel, 'Ping', `PONG! \n ${client.ping}`, Util.makeEmbedFooter(speaker), null, Colors.Orange, null);
},
});```
if(!conf) return
What does m9's snippet say
I had
console.log(Object.values(client.commands))
put that in front of your loop, what's it respond with
with conf and everything?
conf and everything inside of conf
undefined
for (let cmd of client.commands) {
let conf=cmd.conf;
console.log(cmd)
console.log(conf.guildOnly)
if (conf.guildOnly && message.channel.type !== "text") {
return message.reply("That command is a Guild Only command!")
}
}
like that
Cmd is undefined?
Oh no
(node:7248) UnhandledPromiseRejectionWarning: TypeError: client.commands is not iterable
This was the erorr
uHH
But i thought client.commands was a regular dict??
you can
you can
afaik
but not of?
but not for ... of ...
Yea
What I though.
thought*
but wouldn't in just return the number of values?
and not hte value itself?
or am I wrong?
fair
steven pls
?
for (let cmd of Object.values(client.commands)) {
let conf=cmd.conf;
console.log(cmd)
console.log(conf.guildOnly)
if (conf.guildOnly && message.channel.type !== "text") {
return message.reply("That command is a Guild Only command!")
}
}
try that then, my bad
could've sworn of lets you iterate dicts
I'm confused at why you said steven pls tho
I thoguth so at first as well.
thats not even using an of at all xd @amber fractal
Yes
because of doesnt do that
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in
The for...of statement creates a loop iterating over iterable objects, including: built-in String, Array, Array-like objects (e.g., arguments or NodeList), TypedArray, Map, Set, and user-defined iterables. It invokes a custom iteration hook with statements to be executed f...
@lusty dew any luck with that one
yikes
Actually
how come your confs dont have guildOnly in here
this doesnt even

Let me actually go do that
but why do that 
Ok
It works in dms
but in server
it errors
It tells them they must use cmd in server and I tried to use cmd in server and I got errors
what errors
so I'm assuming that you only want some commands to work in a dm channel then?
Oh wait
I'm a little behind
Yea

I do
and I think I know the problem
oof
I forgot to add if(!conf) {continue}
so it is checking all cmd files
and there is one file that has admin instead of conf
so it doesnt have guildOnly in it
Hopefully it works now :p
Ayyy it worked.
Thaks @amber fractal and @scarlet bane
thanks*
god my grammar
👏 np
Question though.
I have this idea for a command but idk how to go about doing it.
You know the bot Yggisdral or however you say it
It has the userphone cmd
I wanted to do that
but people could mention the person they wanted to talk too.
and their names would be anon and it would happen in dms.
The bot would dm each other their messages to the other person.
Any tips on how to do that?
What I would use and such?
a dict mapping userids together and a message event handler that pushes one dm to another person and vice-versa if they're in the dict
wow I spent like 10 mins trying to make it work in dms just for him to say it worked lmfao
I didnt realize he fixed it
oh well
time to revert
did you make an entire new application just to test his theory
no
Guild Lock
That's why it took so long, I had to modify my original one to work outside guilds
It's something I'm working on
oh ok
COnvient name Lmao
I was bored so I started working on a mod bot lmao
I need to stop saying lmao and leave the developer channel
👋
so any hints on how to start learning java
^
anyone know why my start script isnt working?
{
"name": "RB",
"author": "Miko E.",
"main": "bot.js",
"version": "1.3.0-beta.5",
"scripts": {
"start": "node bot.js"
},
"dependencies": {
"discord.js": "^11.3.0",
"fstorm": "^0.1.3",
"jimp": "^0.2.28",
"valid-url": "^1.0.9"
}
}
it works at start
but fails when it tries to reboot
what im saying is any know the best way to reboot WITHOUT crashing?
how to fix it?
let uptime_embed=new Discord.RichEmbed()
.setColor('RANDOM')
.addField('Uptime: `'+days+dayText+hrs+':'+min+':'+sec+'`')
.setTimestamp(new Date())
return uptime_embed
undefined
@earnest phoenix you gave a field title but not the content
so the content is undefined
Adds a field to the embed (max 25).
𝗣𝗮𝗿𝗮𝗺𝘀: name StringResolvable
The name of the field
value **[StringResolvable](https://discord.js.org/#/docs/main/stable/typedef/StringResolvab...
can someone help me tho
{
"name": "RB",
"author": "Miko E.",
"main": "bot.js",
"version": "1.3.0-beta.5",
"scripts": {
"start": "node bot.js"
},
"dependencies": {
"discord.js": "^11.3.0",
"fstorm": "^0.1.3",
"jimp": "^0.2.28",
"valid-url": "^1.0.9"
}
}
my reboot doesn't work
yes you already sent that
depends how youre rebooting
if youre killing the process, you need to be running the bot with something like pm2 that will auto-restart
no it just dies
nobody responded because nobody really knew how to help
pm2 + process.exit()
I am trying to manipulate json data from my postgres database using knexjs, if anyone understand what I just said and thinks they could help @ or dm me
I just am having trouble trying to store an array in postgres
I've figured out I probably use json/jsonb and that arrays are native to json so they sorta just work together, but anytime I try manipulate the array and post it back to postgres through knex it doesnt do what I'd expect
are you storing an actual json string to the db?
for example, im trying to store an array of a bunch of user ids, so to begin with its just []
I then try .push the id to a variable I made = the json value from db, but checking my db it just return [1]
I've tried JSON.stringify and all that, idk im probably just a little confused on how to properly format it


