#development
1 messages · Page 745 of 1
Yeah the things you need to do are in the error
now try to run your install again
just npm install right?
yes
the first one sent nothing
it's supposed to
it should remove the node_modules directory
after running it, ls shouldn't show a node_modules dir
after doing that run the next one
and the next one after that
same errors
What's lodash?
oh
As root add your non root user to the group sudo
how do i do that
I can tell you but I can't type it... Am on mobile
Struggled to type the cp/chown earlier lol
It keeps auto correcting Linux commands
I usually uncomment the wheel group and add my user to it
why
i need to ask you for a favor
why not just ask me here?
actually #memes-and-media
apt-mark showhold returned nothing
Did you apt-get update as first thing you did?
Otherwise it's looking at an old list
it needs sudo
oh yeah
still says the same thing
well, apt-mark showhold says nothing
god why can't it just work
so what exactly is this green thing?
o woop
@green kestrel do you know of any other way i can do this
because this is not working
do you have root access?
wut
lul
@quartz kindle but yes he did
but then he created a new account
cause someone told him to for security reasons
ah
you commie
wtf
@flat pelican hello yes come come
no u * infinity
dream banned him
you got a fancy ban hammer, enjoy
@west raptor no lurk
it's fine
Thanks Dreamuwu
he put the bot link in the redirect uri twice lol
what
@topaz fjord do you know of anything better i could do
to actually get the damn bot online
Yes git gud
whats your actual problem?
nothing works.
i keep doing everything they told me to do
and i haven't gotten anywhere
additional details: hosting bot on digital ocean
using filezilla to view the files
using mobaxterm to connect to command line
you created a new user correct?
yes
you logged in with it?
yes
log out, log in with root, add user to sudoers
already did
logged back in with user and sudo still doesnt work?
i mean, i scrolled a bit up and you were saying you were still getting access denied even with sudo
anyways, if you wanna jump to npm, how did you install node?
sudo apt-get install nodejs
did you just straight up do that
or did you follow the instructions on Node.js' website
also do node -v
thats the latest major version, i dont recommend using it
how do i get the LTS one
i suggest using nvm to install node
you can get nvm from their github
how do i install that
The second
yeah i figured
now you can use nvm install LTS or nvm install 12.13.1
log out and log in again
ok
Sorry for the inconvenience but the longer it will take for my bot to be tested.
And I'm sorry if I have a lack of spelling out there, I don't usually write in English much.
la cague ;-;
what langs do u speak
On average it takes around a week before your bot gets tested
There is a big queue and mods are checking them all one at a time
maybe the waiting time is longer now
lo
So I'm trying to subscribe to a youtube webhook and Idk if I'm just retarded or not. I keep getting the error Invalid value for hub.mode but my stuff seems to me correct...
"hub.callback": "http://xxx.xx.xxx.xxx:xxxx/x",
"hub.topic": "https://www.youtube.com/xml/feeds/videos.xml?channel_id=x",
"hub.verify": "async",
"hub.mode": "subscribe",
"hub.verify_token": token,
"hub.secret": secret,
"hub.lease_seconds": 864000
}``` I don't know what else `hub.mode` could be. (I did try `unsubscribe` same issue and capitalized)
and yes it is structured like that, idk why but it wants hub.x instead of just x
Or it is that way with twitch's webhooks
https://oliy.is-just-a.dev/stk289_2364.png the worst part is the : at the end but it gives no extra information
oooffff
somereason when i do commands in a big server, i doesnt work but when I do it for mine, it does
any errors?
hi
o h
what is your problem?
could anyone help me out? how do i add some statistics from my discord bot into html? i know it's possible w/ javascript but i'm not sure how
need some context pls
uhhH HH h
not sure how i can explain better,,uhh essentially, i'm trying to get text (like an api) from my discord bot into the website
with the api being this
(from a url)
oh, you can't use JavaScript unless your a certified developer
iframe 
l a z y
no, sorry
yes
look at this code :
var newSongs = musicbot.queues.get(msg.guild.id).songs.map((video, index) => (`**${video.position + 1}:** __${video.title.replace(/\\/g, '\\\\').replace(/\`/g, '\\`').replace(/\*/g, '\\*').replace(/_/g, '\\_').replace(/~/g, '\\~').replace(/`/g, '\\`')}__`)).join('\n\n');
i got the error musicbot.queues.get(...).songs.map is not a function
anybody have a solution ?
in discord.js
are you sure songs is an array or has a map method
yes
check again
var songs = typeof obj == "object" ? Array.from(obj.songs) : [];
aka log musicbot.queues.get(msg.guild.id).songs to your console and see if it's truly an array.
Ok
Can someone help me?
I did the node mybot.js command in terminal
but it keeps saying this
"(node:78909) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.
at WebSocketConnection.client.ws.connection.once.event (/Users/student/Desktop/Discord Bot/node_modules/discord.js/src/client/ClientManager.js:48:41)
at Object.onceWrapper (events.js:286:20)
at WebSocketConnection.emit (events.js:198:13)
at WebSocketConnection.onClose (/Users/student/Desktop/Discord Bot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:390:10)
at WebSocket.onClose (/Users/student/Desktop/Discord Bot/node_modules/ws/lib/event-target.js:124:16)
at WebSocket.emit (events.js:198:13)
at WebSocket.emitClose (/Users/student/Desktop/Discord Bot/node_modules/ws/lib/websocket.js:191:10)
at TLSSocket.socketOnClose (/Users/student/Desktop/Discord Bot/node_modules/ws/lib/websocket.js:850:15)
at TLSSocket.emit (events.js:203:15)
at _handle.close (net.js:606:12)
(node:78909) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:78909) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code."
Can someone help me?
Your bot token isn't correct
Regen the token
Oops.
I realized I did something stupid
?
I was using the client ID
Np
yo does anyone have some good starting points (blueprinting, flowcharts, references) for making a starboard in discord.py?
also working with the reactions api
what do you need help with
just saying you need help without displaying anything isn't gonna get you anywhere to fix the problem
if (command === "clear") {
// This command removes all messages from all users in the channel, up to 100.
// get the delete count, as an actual number.
const deleteCount = parseInt(args[0], 10);
// Ooooh nice, combined conditions. <3
if (!deleteCount || deleteCount < 2 || deleteCount > 100)
return message.reply(
"Please provide a number between 2 and 100 for the number of messages to delete"
);
// So we get our messages, and delete them. Simple enough, right?
const fetched = await message.channel.fetchMessages({ limit: deleteCount });
message.channel
.bulkDelete(fetched)
.catch(error =>
message.reply(`Couldn't delete messages because of: ${error}`)
);
}
this is my code but i want to send a little message like > 20 Messages Deleted
Just add js .then( message.channel.send(`Deleted ${deleteCount} messages! `) ) after .bulkDelete(fetched)

@compact raft
let me check
also that code you posted isn't gonna work
you need to make it into an arrow function
yes worked @vital lark
ok
@earnest phoenix using this i'm getting error like Unexpected token :
@compact raft SRY, retry
ok
if (command === "clear") {
// This command removes all messages from all users in the channel, up to 100.
// get the delete count, as an actual number.
const deleteCount = parseInt(args[0], 10);
// Ooooh nice, combined conditions. <3
if (!deleteCount || deleteCount < 2 || deleteCount > 100)
return message.reply(
"Please provide a number between 2 and 100 for the number of messages to delete"
);
// So we get our messages, and delete them. Simple enough, right?
const fetched = await message.channel.fetchMessages({ limit: deleteCount });
message.channel
.bulkDelete(fetched)
.then(message.channel.send(`Deleted ${deleteCount} messages! `)
.catch(error =>
message.reply(`Couldn't delete messages because of: ${error}`)
);
}
error at );
which one
here
when i comment this line then worked
/// .then(message.channel.send(`Deleted ${deleteCount} messages! `)
and whats the error
You forgot a )
2 opening parentheses but only one closing parenthesis, no?
);
^
SyntaxError: missing ) after argument list
can i use this
.then(message.channel.send(`Deleted ${deleteCount} messages! `))
Yes
@earnest phoenix but Deleted ${deleteCount} messages! not sent?
only message deleted like previously.
He first delete messages, then send a message with the number of messages deleted
.then(deleted => message.channel.send(Deleted ${deleted.size});
what determines wether or not a mention starts with <@ or <@! ?
no
my bot wasnt scanning for the one with ! in it, resulted in some interesting breakage, because overnight my client suddenly started sending the second form
@warm marsh Doesn't work
@compact raft you need to make your .then into an arrow function for it to send.
Hold on
What version of djs?
11.5.1
Okay
Try using ```js
message.channel.bulkDelete(fetched).then(console.log).catch(console.log);
See if get anything in console
console empty
Did messages get deleted?
yes
Mhh
Try assigning to a variable, ```js
let deleted = await message.channel.bulkDelete(fetched);
console.log(deleted);
Although that shouldn't change anything.
@warm marsh message deleted but deleted not showing
Could you use pastebin I'm on my phone.
Yeah
Are you missing a closing quote anywhere?
i think no.
Do you have message.channel uncommented above let deleted?
Idk why it doesn't post.
you're using deleteCount but you don't define it anywhere
deleteCount is defined at start of command
ah i see now
// get the delete count, as an actual number.
const deleteCount = parseInt(args[0], 10);
here defined
you're mixing async and synchronous code in the commented part
i can't tell what's your intention
Is the pastebin broke for you cry?
nope
All I see is full blue so cant see what's commented or not
Yeah I thought hastebin shut or something so recommended pastebin
where i put that code?
What code?
whole file
No where just send command code
if (command === "clear") {
// This command removes all messages from all users in the channel, up to 100.
// get the delete count, as an actual number.
const deleteCount = parseInt(args[0], 10);
// Ooooh nice, combined conditions. <3
if (!deleteCount || deleteCount < 2 || deleteCount > 100)
return message.reply(
"Please provide a number between 2 and 100 for the number of messages to delete"
);
// So we get our messages, and delete them. Simple enough, right?
const fetched = await message.channel.fetchMessages({ limit: deleteCount });
message.channel
let deleted = await message.channel.bulkDelete(fetched);
console.log(deleted)
//.bulkDelete(fetched)
.then(message.channel.send(`Deleted ${deleteCount} messages! `))
.catch(error =>
message.reply(`Couldn't delete messages because of: ${error}`)
);
}
Remove everything after the console.log
The .then is uncommented so it should throw an error?
// This command removes all messages from all users in the channel, up to 100. // get the delete count, as an actual number. const deleteCount = parseInt(args[0], 10); // Ooooh nice, combined conditions. <3 if (!deleteCount || deleteCount < 2 || deleteCount > 100) return message.reply( "Please provide a number between 2 and 100 for the number of messages to delete" ); // So we get our messages, and delete them. Simple enough, right? const fetched = await message.channel.fetchMessages({ limit: deleteCount }); message.channel let deleted = await message.channel.bulkDelete(fetched); console.log(deleted);```
🧐
That should be everything inside the braces {}
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
It's always been https://hastebin.com/
One message removed from a suspended account.
One message removed from a suspended account.
Oh
hello I try to make a discord bot but when I try to add it to the bot it say there is a error
there is the code
One message removed from a suspended account.
it say this
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
where
also are you coding on a phone
One message removed from a suspended account.
I code on phone
One message removed from a suspended account.
One message removed from a suspended account.
someone can help
ok
this is why you dont code on mobile
because you dont have any tools for debugging your code
and?
im not saying you cant, im saying that its a worse idea than cutting your leg off
stop posting your token and fix your syntax error
WHERE NODE SAYS THE ERROR IS
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
ok
If only there were tools that could help you with simple syntax errors
One message removed from a suspended account.
One message removed from a suspended account.
hmm does linting help with syntax 
line 21
if only you would use an actual IDE and an actual platform to write the code on
time to compile vsc for mobile
One message removed from a suspended account.
One message removed from a suspended account.

One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
k
I mean
One message removed from a suspended account.
One message removed from a suspended account.
where one single space can cause your code not to run properly
One message removed from a suspended account.
LMAO
yes im talking about the importance of indentation
One message removed from a suspended account.

One message removed from a suspended account.
One message removed from a suspended account.
it is but
One message removed from a suspended account.
One message removed from a suspended account.
and figure it out
yes and properly indent everything
it will be so obvious to know where you missed out on things
For every ( or { you have, there should be a } or ) to close it out
Right now you have missing closures
Places where you opened an { or an ( and didnt close them
Look carefully
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
ty for token
LMAO
One message removed from a suspended account.
OOF
¯\_(ツ)_/¯
One message removed from a suspended account.
Huh
Thats not even fixed
One message removed from a suspended account.
How can i get the Permissions that the bot has, and list the permissions that it dont has?
lol
Missing a ) lmao
One message removed from a suspended account.
From client(
@earnest phoenix depends on your library and permissions of what
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Lmao
@fluid basin client permissions
Discord.js v12-dev
But let him figure out
Dont just givehim the code lol
or some other rando server
or some random channel
yeah permissions are always channel based
unless its role permissions
i mean the Role permissions
yeah what permissions
jez stop spam
yeah then you find the server that has that role
and?
ok
well permissions are annoying sometimes
gotta bitshift it
just google permission calculator discord and it should tell you how it is calculated
i'm not getting helped
One message removed from a suspended account.
whats his issue?
One message removed from a suspended account.
One message removed from a suspended account.
ah yes
then hes the solution:
Learn the basics of your programming language rather than copy and paste
One message removed from a suspended account.
One message removed from a suspended account.
What's the issue they're having?
their Copy and Paste code isnt working and they didnt send the stack trace so its kinda hard to tell
This is their problem
They're trying to call .then on the console.log() method, which returns undefined.
@sudden geyser RIGHT
You need to call .then on a promise (or remove it and do it normally). Your .then function would not work either. You should search up how to correctly use promises.
@lofty lagoon Please reset your bot’s token if not done
It’s dumb to post your token publicly
I have this assignment for PHP and I cannot figure out why it returns 1 at the end of the arrays values. Anybody see something I'm not?
function printArray($item, $key)
{
echo "<br>$key" . ":" . "<i>$item</i>";
}
$playlist = array(
array("genre" => "hiphop", "auteur" => "John Williams", "titel" => "My Girl"),
array("genre" => "Jazz", "auteur" => "John Coltrane", "titel" => "New York"),
array("genre" => "hiphop", "auteur" => "Shakira", "titel" => "Obsession")
);
$playlist2 = array(
array("genre" => "Latin", "auteur" => "Caetano Veloso", "titel" => "Cafe Atlantico")
);
//Stap 1
echo "<h3>Lab 03</h3>",
" ---- Stap 1: Mijn playlist",
array_walk_recursive($playlist, "printArray");
//Stap 2
$playlist = array_merge($playlist, $playlist2);
echo "<br><br>",
" ---- Stap 2: Track toevoegen",
array_walk_recursive($playlist, "printArray");
array_walk_recursive returns 1
iirc
btw, dont know if you know but any modern php lets you use [] instead of array() to declare an array
a lot easier to read and faster to type
It's for an assignment we need to copy pretty much 1 for 1 what's in/being learned by the book most of the time
ah ok
Also array_walk_recursive didn't return an extra 1 in a previous assignment which is why it's confusing me
yeah i see what it is, when array_walk_recursive returns, it can return true or false
so youre echoing the return value of array_walk_recursive as well as calling your key print function repeatedly
true can be coerced into a 1, but false coerces to a null or empty
because php 😛
so it may be that in your last assignment, array_walk_recursive was returning false
not sure what would make it 'fail' though
Yeah but in this example
function printArray($item, $key)
{
echo "<br>$key" . ": " . "<i> $item </i>";
}
$boeken = array(
array("titel"=> "Stoner", "auteur" => "John Williams",
"genre" => "fictie", "prijs" => 19.99),
array("titel"=> "De cirkel", "auteur" => "Dave Eggers",
"genre" => "fictie", "prijs" => 22.50),
array("titel"=> "Rayuela", "auteur" => "Julio Cortazar",
"genre" => "fictie", "prijs" => 22.50),
);
echo "<br>---- Opgave 21: Boeken recursief doorlopen";
array_walk_recursive($boeken, "printArray");
It doesn't return anything extra
youre not echoing array_walk_recursive there
Oh wait you're right
in your previous code its like:
echo "foo",
array_walk_recursive($arr, "somefunc");```
Yeah that fixed it. Sorry I'm extremely tired atm as I haven't slept 😩
and on that note array_walk_recursive is a function i never use that i probably should
np 🙂
i have Zero idea what im doing with Perl xD all ik is that i have a Generation script
you'd probably use the CGI cpan module
and no idera how to implement it
the other choice is mod_perl, but ive not personally used it, it needs specific apache configuration
and its ...well, its ugh.
get the role object
and do role.mention
¯_(ツ)_/¯
is it js?
or py?
idk how it works for js
#For Python
client.get_role(roleID).mention```
<@&roleid>```
In js, it's .toString()
theyre both self explanitory
they tell you what they mean pretty well
The node to be removed is not a child of this node.
(Bad Request)
is aibot.tk your bot?
-owner @flat sedge
so it is
it returning 400 on the edit page is your fault entirely
i dont fucking know without looking at the code
let me just magically guess
guild.js:111 POST https://aibot.tk/edit 400 (Bad Request)
oh
your bot has Not enough parameters, so the problem is Not enough parameters
well it doesnt have enough
as thats the only reason it would return 400
no shit
yeah well and you didnt add anything for it to do if it has enough
so it will get stuck on loading forever or timeout whichever comes first
better to start from basic stuff example making that it returns guild count etc. and then move into these things
it will return a basic 200 ok iirc
there isnt any res functions being called
so it just waits
you've got to send 200 on express for a 200
or just res.send
yeah res.send is 200
split by -
const [name, index] = str.split("-");
for example. index will be undefined if there is no index
yeah that also works
500?
2xx is for ok stuff
3xx idk (redirects?)
4xx is client errors
5xx is server errors
1 1xx Informational response
2 2xx Success
3 3xx Redirection
4 4xx Client errors
5 5xx Server errors
1xx some response
2xx success
3xx i put you here
4xx you fucked up
5xx i fucked up
copystrike
3xx: Go away.
better auth methods? app.get("/s", function(req, response) { if (!req.query.auth) return response.status(401).json({"401":"Not enough parameters."}); if (!req.query.auth === 'SuperHero:Yahuu') return response.status(402).json({"402":"Wrong Creditentals"}); const cred = req.query.auth; response.status(200).json({guilds: "0", users: "0", chans: "0"}) // response.sendFile(__dirname + "/views/index.html");});
One message removed from a suspended account.
wait lemme format it
app.get("/s", function(req, response) { if (!req.query.auth) return response.status(401).json({"401":"Not enough parameters."}); if (!req.query.auth === 'SuperHero:Yahuu') return response.status(402).json({"402":"Wrong Creditentals"}); const cred = req.query.auth; response.status(200).json({guilds: "0", users: "0", chans: "0"}) // response.sendFile(__dirname + "/views/index.html"); });```
github copying bad
One message removed from a suspended account.
app.get("/s", function(req, response) {
if (!req.query.auth) return response.status(401).json({
"401": "Not enough parameters."
});
if (!req.query.auth === 'SuperHero:Yahuu') return response.status(402).json({
"402": "Wrong Creditentals"
});
const cred = req.query.auth;
response.status(200).json({
guilds: "0",
users: "0",
chans: "0"
}) // response.sendFile(__dirname + "/views/index.html");});```
done







its express
ik
you can use authorization header if you want though
seems better to me imo
and it does support user pass style
k, lemme try
params are /get_info/:id
oops wrong channel
queries are ?q=aaa
that's very insecure
ik, so i was thinking how i could do generating uuids and then update it on the site tooå
Yo guys, did discord change the way on desktop on how to call a user? My bot finds users tagged with @ on mobile but on desktop it's not able to find them anymore? is it still discord_username and discord_id?
const amount = args[2];
const username = args[1];
if(username.includes('@')) {
var username_id = username.substring(2, username.length-1);
}
let userAddress = await Users.findOne({ where: { discord_id: username_id }});
if(!userAddress) return msg.channel.send('Wrong username, try another one!');
userAddress = userAddress.address;
let reciever = bot.users.find('id', username_id);
if(!reciever) return msg.reply('Wrong username, try another one');```
Thanks for looking and maybe knowing what changed...
hmm sometimes mentions starts with <@! and sometimes <@
idk whats the difference but you have to check I guess
which isnt handled in your current code
Hey guys do you have a good C++ IDE for game programming ?
This happened to my bot too
You need to search for both <@!id> and <@id> too now
Both are mentions
~~I was talking about https://discordapp.com/channels/264445053596991498/272764566411149314/655105594889601024~~
@green kestrel it always worked like this, its since today it suddenly only worked on mobile
Would it require big changes?
the ! is for when they have a nickname
Always been like that
Or at least for a very long time
I doubt it's a new change to mobile
<@!userid>
Okay thank you
Whatever library you're using probably has stuff you can use for mentions
So you don't even have to check like that anymore
Its old code ;p
@late hill no they changed the desktop client today
I noticed another change that came with it, the input box primitively previews markdown you enter
So if you put *test* it will italicize the word test in your input box
Or at least, I got the affected update today, woke up to 300 entries in my dB with mentions in them
Hey so Im using discord JS
where do I find Boats.postStats('SERVER_COUNT'
do I leave that empty?
@hushed quarry i think can that occour ( returning None for get_user() ) if they have blocked the bot?
i'm too lazy to solve this damn problem with visual studio code
"update the include path"
when i write #include <iostream>
is there a quick fix available?
https://discordapp.com/developers/docs/resources/user#user-object-user-flags
What does it mean to be
1<<0 ?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
bit shift
to the left
So the flag that was 1 becomes 0?
no
:/
its simple until its the first time you see it is in a competition and end up getting 0 points because you couldnt understand it on the spot
i mean what
we had to figure out what 32 bit assembly code does with given inputs
with jumps and shifts and shit
I don't really understand this system but it doesn't matter x)
play around with byte shifting
it's fun and you'll get it pretty quickly
unless you have to do it without a computer to see if you are even right
yo um how do i... like upload a script... of a .py... to a bot??
thats not how it works
thats what i mean how do i
your python scripts connects to discord with the token you give it
you dont have to upload the script anywhere
i had a competition in CS where we had an octal that had to be shifted to the right by 4 bits which means conversion which means no calculator
we didnt have calculators either
but at least the inputs were easy
hardest one was 42
isnt it something like discordpy.token = "sht goes here"
well googl's your friend xD
so is yours
true
i talk faster than average therfore i fumble my words
(i called a penguin pengin, e.g.)
(can we try to stay on the topic of development tho, as we are in #development)
ok ok
import discord
class MyClient(discord.Client):
#stuff here
client = MyClient()
client.run('my token goes here')
Yes
k thx
The token string is where you put your token
yeah
why is ma bot offline?
have you tried running the script
I mean if you previously had your bot set up so that it would work with nicknames that used @! then nothing should rly change to functionality
@hushed quarry it was a yes no question...
the answer is no
@mossy vine I see you chilling in TOP DOT GEEEEEE GEEEEEE
@upper ember can you fuck off
gladly
who dis dude @upper ember
why my nickname is status ad 
guys how do u do sudo in windows i forgot xD
Do you need it
yes
All you need is pip
Literally just pip install discord.py
^^
...
@wispy vine do u actually know the basics of python?
hey guys! is there a way for bots to set their own custom statuses?
or is that restricted to user accounts only?
yes
(discord.js)
and no, i'm not talking about client.user.setPresence
OH
ok nvm
im talking about the custom statuses recently implemented
yeah no
no
user accs only for now, unless you have the patience to fuck around with inspecting and replicating api calls by users
oh damn
@mossy vine yeah pal i think that's a quick and easy way to get your bot termed
clearly its not available for bot users for a reason
at least i'd assume so
depends
i mean, the update has been out for neraly a month now
and there is yet to be support for it in discord.js
yagpdb did it once, but im not saying its a good idea
nothing wrong with Editing / building your own Module / lib
yeah, but i think there's a reason why bots don't have it
otherwise discord.js would have already added support
in a beta/stable build
considering the update has been out nearly a month now as aforementionedf
I guess they never miss huh
so, I know how to make a command that gives an output in text and all such. but if i wanted to make a make a marry command with json file and have that handle logging data for who married who, how would i set it up to send it to there and when some one "divorced" someone to have it removed?
lengthy...
Discord haven't made an official statement afaik so better not get shit headed your way
@earnest phoenix why are you using json
DATABASES EXIST
and not a more maintained method of database
e.g mysql or mongoose
cos i dont like mongodb
mysql
and i am using Heroku
jake did say that bots are planned to get custom status but god knows when
glitch has mysql
just saying
¯_(ツ)_/¯
glitch bad
depends on your usage scenario
i use it for one-server bots
that dont require
data storage
@empty owl 😑
for actual bots that require datastorage, i upload them to my vps
hmm... ok so ill try mysql, but then again question still stands
uhhh
work it out
xD
what i do
and then write the code
from that
thats what literally every competent dev does haha
well, most competent devs
you can still be competent and not do it
¯_(ツ)_/¯
Case to case basis be like
wait till u do big projects xD
ok-
ya know
i've never actually made a bot for the public to use
will sqlite work?
literally all of my bots have either been for private use
or something else
e.g a test
😎
ew
my bot doesn't go online
why?
well firstly
check if the token is valid
secondly check if there are any errors
i feel like discord broke the gateway again
and thirdly idk
run the code
i puted the token?
@earnest phoenix what? are you using an application?
or are you genuinely coding? as I hear that is something an app does
This is some juicy chat right now
they left

go complain to the developer
yeah, I recommend not using that... and as they said
Anyone get a "Socket hang up" error?
the gateway is having issues
its having the roller-coaster of emotions time again
all you can do is sit and wait it out, possibly throw a tantrum
Sounds like a good idea
Doesn't look any different from usual
Normal:
come on, it's Discord
Discord commiting sudoku
lovely

back at latency = sin(x)
does this work? i dont see any typo but i want to be sure before i test it lol js if (command === "eval" || command === "execute") { if(message.author.id !== botConfigs.ownerID) return; let args = message.content.split(' ').splice(1).join(' '); console.log('executed', args); message.delete(); eval(args) .then(m => m.delete(10000)) let evaled = eval(args) if (typeof evaled != 'string') { evaled = require("util").inspect(evaled) const embed = new Discord.RichEmbed() //fields .addField('Input :inbox_tray:', '' + args + '') .addField('Output :outbox_tray:', '' + evaled + '') .setColor('#ff1493') .setAuthor(`Axyx's EVAL Command`, 'https://cdn.discordapp.com/avatars/636812729222692880/a334d8a64b9081a9484ab14848898169.png') const embedmessage2 = message.channel.send(embed) embedmessage2 } }
<Insert Try it and see video here>
try it out and see (also copy and paste)
stop
it
i dont like that
i dont like you like that but i dont so you have to stop
okay 
saying copy and paste doesn't mean that a person is being a dick
you do if you keep naming me like that
@surreal sageso mad that he didn't do vocals for that one
the code works
you would know that it works if you would know how the code works

^

shitpost in #memes-and-media
const embed = new Discord.RichEmbed()
.setTitle('ERROR')
.setColor('#ff0000')
.catch(err => message.channel.send(embed))``` if theres a error. would it post this embed?
im a bit new to .catch(err)
or https://tryitands.ee ?
Yes
you're catching on the embed
^
lol
Lol
think like a computer when you program
it's going to do what you tell it to do in order
so i have to like if a eval goes wrong: err => evaled?
or js .catch(err) { //code }?
oh god
try catch?
you are confusing Promise.catch and try-catch
oh no
please read this
thx

does my full code need to be in try { and catch err not in that?
rtfd
.catch(error => message.reply("Error. Contact an administrator."));```
i think you should read what cry said too
but yes, if whatever before that returns a promise then yeah
but you should learn proper error handling, and i'm very curious how you have been doing it the whole time without actually knowing what you were doing
also some extra docs https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
try {
if (command === "eval" || command === "execute") {
if(message.author.id !== botConfigs.ownerID) return;
let args = message.content.split(' ').splice(1).join(' ');
if(args === null) {
message.reply('Please specify the code...')
}
console.log('executed', args);
message.delete();
eval(args)
.then(m => m.delete(10000))
let evaled = eval(args)
if (typeof evaled != 'string') {
evaled = require("util").inspect(evaled)
const embed = new Discord.RichEmbed()
//fields
.addField('Input :inbox_tray:', '```' + args + '```', true)
.addField('Output :outbox_tray:', '```' + evaled + '```', true)
.setColor('#ff1493')
.setAuthor(`Axyx's EVAL Command`, 'https://cdn.discordapp.com/avatars/636812729222692880/a334d8a64b9081a9484ab14848898169.png')
const embedmessage2 = message.channel.send(embed)
embedmessage2
}
}
}
catch (err) {
const embed = new Discord.RichEmbed()
.setTitle('ERROR')
.setColor('#ff0000')
message.channel.send(embed)
}```
i would put the try before the actual eval and not the command checking/whatever is above
so: js if (command === "eval" || command === "execute") { try { if(message.author.id !== botConfigs.ownerID) return; let args = message.content.split(' ').splice(1).join(' '); if(args === null) { message.reply('Please specify the code...') } console.log('executed', args); message.delete(); eval(args) .then(m => m.delete(10000)) let evaled = eval(args) if (typeof evaled != 'string') { evaled = require("util").inspect(evaled) const embed = new Discord.RichEmbed() //fields .addField('Input :inbox_tray:', '' + args + '', true) .addField('Output :outbox_tray:', '' + evaled + '', true) .setColor('#ff1493') .setAuthor(`Axyx's EVAL Command`, 'https://cdn.discordapp.com/avatars/636812729222692880/a334d8a64b9081a9484ab14848898169.png') const embedmessage2 = message.channel.send(embed) embedmessage2 } } } catch (err) { const embed = new Discord.RichEmbed() .setTitle('ERROR') .setColor('#ff0000') message.channel.send(embed) }
?
sorry i should've been more specific, put the try right before the eval
whats wrong?
then you try to delete an eval thinking it's a message ???
message.delete deletes the msg of the user
eval(args).then(m => m.delete(10000)) this line
dude you have more problems than just 1
where is the prob?
try {
if (command === "eval" || command === "execute") {
if(message.author.id !== botConfigs.ownerID) return;
let args = message.content.split(' ').splice(1).join(' ');
if(args === null) {
message.reply('Please specify the code...')
}
console.log('executed', args);
message.delete();
eval(args)
let evaled = eval(args)
if (typeof evaled != 'string') {
evaled = require("util").inspect(evaled)
const embed = new Discord.RichEmbed()
//fields
.addField('Input :inbox_tray:', '```' + args + '```', true)
.addField('Output :outbox_tray:', '```' + evaled + '```', true)
.setColor('#ff1493')
.setAuthor(`Axyx's EVAL Command`, 'https://cdn.discordapp.com/avatars/636812729222692880/a334d8a64b9081a9484ab14848898169.png')
const embedmessage2 = message.channel.send(embed)
embedmessage2
.then(m => m.delete(10000))
}
}
}
catch (err) {
const embed = new Discord.RichEmbed()
.setTitle('ERROR')
.setColor('#ff0000')
message.channel.send(embed)
}```
is discord down?
no
one of my bots wont go online
update
https://status.discordapp.com/ maybe ?
Welcome to Discord's home for real-time and historical data on system performance.
It could be Discord or a problem with your code
yeah....
looks like it connected finally, just took like 4 attempts at reconnecting
@tacit stag Discord api is being weird again. A lot of bots are down
gotcha.
welcome to the basics of JS
I had a few disconnects but they all resumed
#[command]
fn prefix(ctx: &mut Context, msg: &Message, args: Args) -> CommandResult {
if args.is_empty() {
msg.reply(&ctx, "You did not input a prefix")?;
Ok(())
}
let new_prefix = args.current().unwrap();
crate::db::update_prefix(msg.guild_id.unwrap().0 as i64, new_prefix.to_string());
Ok(())
}``` having issues with the `Ok(())` in the if statement `settings.rs(14, 9): expected (), found enum std::result::Result`
removing the if statement entirely fixes the issue
as well as just removing the Ok(())
but if im not returning anything inside that if statement it will just continue on
and panics at new_prefix if nothing is provided
client.on('message', message => {
// mensagem em dm
if (!message.guild) return;
// comando
// uns bgui aew
const user = message.mentions.users.first();
// membro mencionado true
if (user) {
// pega os bagui de user
const member = message.guild.member(user);
// membro guild true
if (member) {
member.kick('salva no audit log').then(() => {
// funfo
message.reply(`Usuário expulso com sucesso: ${user.tag}`);
}).catch(err => {
// um erro
// bot no perm,
// user no perm in role
message.reply('Eu não tenho permissões suficientes!');
// Log the error
console.error(err);
});
} else {
// nao ta na guild
message.reply('Esse membro não está nesse servidor!');
}
// sem mençao
} else {
message.reply('Mencione um usuário!');
}
});```
what
help me
with..?

