#development
1 messages ¡ Page 703 of 1
np
new Array() 
or just [] who cares
you can also do js users.map(t => `<div class="card">${t}</div>`).join("")
^^
we dont spoonfeed here
@summer torrent just send the emoji's url
only works for custom ones iirc
such as 
!mmLol
you can make it 128x128 (default) and smaller by appending ?size=x
:/ tried so much ways to get indivisual data đ
tiny mmLul 
smol boye
Does anyone know what the difference is between a Scheme and a Theme in Webstorm(IntelliJ) products?
nvm I think the scheme is how the text color part looks and theme is how the program looks
Whats DBD bots

Designer not developer
Well
So I just added an auto assign role
And my bot is like 100x slower now
Any idea why
@tulip ledge discord is dying right now
So its not just me, oof
What lang?
k
@wicked mango dont use codeblocks to make your message look larger
in your code
really?
well, what did you expect?
All depends when you want it to change lmao
it has a error
oh god
i suggest you learn some javascript first
Im trash at coding
everyone is when they begin
You gotta start somewhere
@wicked mango https://www.codecademy.com/learn/introduction-to-javascript should be helpful
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.
wait a bit it might be still loading itself up again
One message removed from a suspended account.
One message removed from a suspended account.
maybe try later and see if it works. Also you don't have to await console.log
just log it since you're already awaiting the sql
alright last part i need help with
its the css part
then my leaderboard is done
need help with it though because i tried many ways to display leaderboards into boxs which would be in rows
but the boxes keep going down straight
<table>
when i map the the box one box is in the right place while the others arent ?
as neko said, just use a table
if you really want boxes, use display: inline-block
How do you guys get really good looking Shields.io things?
tim i did use table but when im mapping it ``` <% for (var i = 8; i < resp.length; i++) { %>
one is in the correct postion while the other one isnt
if you get me
Is there a way a bot can reward you or do any actions after you voted?
How will it recognize?
I don't know this feature but I want to implement it sooner or later.
@earnest phoenix check the discorbots.org api documentation page
depending on which language you are using, yes there is
oh nice!
@modern elm doesnt really depend on the language. if it can make http requests (and it can, you are making a bot with it) it can interact with the api
jesus i meant there is support in the docs depending on the language chill
Does anyone here know how the hell these weird ass generics work when you get a message asynchronously in C#
I'm just trying to get one god damn message and it's like wtf
[RequireOwner]
[Command("react", RunMode = RunMode.Async)]
public async Task React([Remainder]string reaction)
{
//await Context.Message.DeleteAsync();
var targetMsg = Context.Channel.GetMessagesAsync(1).FlattenAsync();
List<Emoji> emotes = new List<Emoji>();
foreach (char character in reaction)
{
Emoji emojiLetter = new Emoji($"regional_indicator_{character.ToString().ToLower()}");
emotes.Add(emojiLetter);
}
//Add emojis to the one message
}
Hey, I'm new here. I just started playing openttd, and I was wondering if there's an easy way to keep road vehichles evenly separated. If you can help me with that and other things, that would be great.
Wrong server mate
you got told how to use it in dapi, also if you want to access the message that invoked the command you can use Context.Message @lost cove
Ik that, basically I'm getting the message immediately before mine
What?
Like the most recent message in chat besides the one I sent to invoke the cmd @earnest phoenix
ah
It's so annoying because it's a collection and idk how to iterate through it
I can't just cast it to a socketusermessage and be done with it
Can anybody help me make a virtual server for the bot running in 24/7 ? Cause currently it runs on my pc
The only thing I can change it to is ToAsyncEnumerable, and then if I do like .GetFirstOrDefault() etc on top of that, I can't cast it to a SocketUserMessage
Hmm ?
@hybrid cradle check pins
Okay
And are there servers for free ?
no
Or I have to buy it anywqy
Google and amazon offer fully functional servers free for 12 months
Glitch and heroku offer free forever solutions with certain limits
Okay, thanks!
is there a way to make a bot check if the person giving the command is the bot owner?
Yes
compare ids
Check if the message author id is the same as the owners id
ok, and i do that by message.author.id?
Yes
uhm question
i wanna do a Timezone Bot
and long story short
is it okay if the bot edits a certain role (rolename) once an hour?
or is that considered too much?
once an hour is ok @livid rivet
okay nice
Do you know some way to learn basics of js asap ?
When I do F5 : Error "discord.js" can't be found
if you take a step back and relearn from the start, yes
hi, does anyone know how to detect when a member types with python discord?
Thanks so much, couldn't find a working typing command anywhere
not related too much to development but when people call something a "cluster"is it the same thing as a "worker"
e.g. when forking 2 processes those are called clusters? 
not as far as i understand it
a cluster would be sibling processes under a load balancer
each process being stateless
for me there is a difference between clusters and master-slave setup, but idk what terminology would be technically correct
i guess
like when i call cluster.fork() for some reason people call that forked process a cluster
if you're using node-cluster it makes sense
because all children are exact copies of each other, except the master
yeah i'm using the native cluster module
so the master becomes the load balancer
a non-cluster master-children setup could have each children be designed for a specific job
where each child does a different thing
instead of all chilren being identical copies
oh i see
so master-slave is where each child does a different thing, cluster is when every child is the same
kinda yeah
although there is also master-slave replication
which is a term used in databases and database clusters
hmm
ive heard of that before when reading db docs
never really bothered to look at it though
replication would be something like
all children repeat each other's actions
if child A receives a connection and does a job, the job is repeated on all children, so they are all in sync
or something like that
interesting
so if children go offline, they can get a log of actions from other children and re sync when it comes back online
thats cool 
wouldnt them being in sync cause a race condition or is that an entirely different term
that would probably be different, as they are not really competing
mm they're only listening
they are just sharing state with each other
so its like stateful clusters instead of stateless
spooky
but im half talking out of my ass here, so dont take my words for an authority on the matter lol
dbs are a special case because data integrity is more important than anything else
if they want to be ACID compliant
does require work from the root directory or the current directory? I forgot 
working directory of the process
or the node-modules folder
i believe it looks into the node-modules folder first, and then the working directory
I remember having to be in the dir of the require if it was a local file
or else it was looking at nothing
and would error
atleast iirc
might be wrong
One message removed from a suspended account.
One message removed from a suspended account.
so wait when storing bearers and returning a backend auth for bot dashboard they have to request my backend to get their guilds right?
and i make a request with their bearer
also whats the best way to make my dashboard like /dash/serverid while still using just some html and js as the actual frontend
whatever backend framework you're using probably supports route parameters which is what serverid would be in that url
serves the same document but populated with different info based on the route parameter
doesn't typically have much to do with what you're doing in the frontend
I got an answer for my first question already
Tho I still need help with the second
for /dash/serverid I mean like thatâs what somebody seeâs and it knows thatâs the id because rn I have /dash/#serverid
im not exactly sure what youre asking
yup, me neither
I have a backend built right, with api/guilds/serverid/settings get and post to that url to change settings
Currently the frontend dashboard that people actually see is /dash/#serverid which lets you edit that server and it uses js to make those requests to the api
I wanna be able to make it so that I can just do /dash/serverid
so you're using a URI fragment to do this right now and want to just use a route parameter instead
again, just look up your backend framework + "route parameter" and figure out how to do that
can't really offer more specific advice without knowing your tech stack lol
The route parameter is not what I need help with
I might be misunderstanding, are you saying I should be pushing html/css/js through express?
I already have the backend set up like /guilds/:guild/... thatâs not the issue
what i got from your question is "how do i make /dash/#123456789 into /dash/123456789", so just removing the #
But actually doing it, logistically. Because obviously with just static html and js you can just do that
yes but.. your website definitely should not be set up just using static documents lol
ideally you've got some kind of webserver like express that is serving your dashboard and stuff
and through express you can set up the routing to make the 123456789 part a route parameter
So I actually push html through the express server?
this wording confuses me
pushing html through an express server is kinda what express is meant to do lol
Uh
No not really afaik express is meant to be endpointing for serveing and receiving data in things like json
it can be that
Mk
but it is very much a webapp framework and serving html is one of its main functions
Sounds good thanks
well, i guess more specifically, serving any kind of content is its main function, it doesn't care whether it's json or html
anyway yeah
good luck!
Iâll need it lol
is there an easier way to do x-form-www-urlencoded data in fetch similar to the way ajax takes data
bot.on("messageDelete", message => {// message logs
const logchannel = message.guild.channels.find(channel => channel.name === "message-logs");
const user = message.author
if(!logchannel) return
let deleteEmbed = new Discord.RichEmbed()
.setTitle("â ď¸ A message was deleted!")
.addField("Sent by User", user.tag)
.addField("Deleted Message", `${message}`) ``<==== This is the line it picking up on the error``
.addField("Deleted In", `${message.guild.channels.get(message.channel.id).toString()}` + ` (${message.channel.id})`)
.setFooter(`Author ID: ${user.id}| Message ID: ${message.id}`, bot.user.avatarURL)
.setColor("#FF0000")
logchannel.send(deleteEmbed)
});
bot.on("messageUpdate", function(oldMessage, newMessage){
if(oldMessage.content == newMessage.content) return
const user = newMessage.author;
let logsChannel = oldMessage.guild.channels.find(channel => channel.name === "message-logs");
if(!logsChannel) return
let messageEditEmbed = new Discord.RichEmbed()
.setTitle("â ď¸ A message was edited!")
.addField("Sent by User", user.tag)
.addField("Before", oldMessage.content)
.addField("After", newMessage.content)
.addField("Edited In", `${oldMessage.guild.channels.get(oldMessage.channel.id).toString()}` + ` (${oldMessage.channel.id})`)
.setFooter(`Author ID: ${user.id}| Message ID: ${oldMessage.id}`, bot.user.avatarURL)
.setColor("#FFFF00")
return logsChannel.send(messageEditEmbed)
});
i keep getting this crash error on line 53 and i have tried multiple ways to try fix it but i dont seem to get anywhere wondering if anyone can spot my error and maybe help me correct it please
@earnest phoenix message is evidently a message object, you even use it as such in several other places, so just doing ${message} is not only redundant but also is trying to insert an entire object into the field instead of its content
@peak bloom so how would I fix it as I tried message with and without ${}
But I got the same error every time I did even try message.content same error
And now it's just began to annoy me more than anything
console.log the values, figure out which one's empty, figure out why
Yeah that's what in stock on tbh I tried console.logging it and it didn't show anything
But it shows a error on the libe 53 which is what you picked out
how can i format strings that were "browserified" with the things like %## because they were put as a query back into the normal strings?
or maybe how i can get the cryptos without those certain characters
D.js help required.
I have a messageReactionAdd even handler and it only logs Reaction added to the console. The thing is, it doesn't fire for messages sent more than a few minutes ago. Like I add any reaction to a message that was sent more than 10 minutes ago, the handler isn't executed. Any clues as to why this might be happening. Or, how to prevent this? Or, is there some workaround for this?
(Using master branch btw)
use partials
it will only fire if you have the message cached
either cache the message you want to get react events from or if its multiple messages that are just whatever yk, use partials
partials topic: https://discord.js.org/#/docs/main/master/topics/partials
discord.js, what's the easiest way to grab the last message in a channel to send to another channel? Google is failing me
myChannel.send(originalChannel.lastMessage);
tyvm
new TextChannel(msg.guild, myChannel.toJSON()).messages.fetch(message_id);
``` Can this piece of code be simplified? (myChannel != msg.channel)
cuz channel from cache is object of Channel class and not TextChannel although TextChannel is derived from Channel, I don't think it supports sending messages.
anyways, can embeds have multiple images?
No
No
And also TextChannel Extends Channel
If itâs not a textchannel you donât need sending methods
I need to send message in a channel whose ID I have.
Then get that channel and send
So you are saying, if I do myChannel.send even if myChannel is a Channel object and not a TextChannel Object, it will send the message?
You make no sense
If you can send a message
To that channel
Then itâs already a TextChannel
Why do you have to create a whole new instance of a channel that already exists and if you can send to it already has send methods
Can i ask a question, too?
It is a text channel in discord but the object is not of TextChannel class, that's what I am saying. Will it still send the message.
@earnest phoenix I think maybe yes
Why is it not of the TextChannel class
cuz the channels fetched from the cache are objects of the Channel class and even if the TextChannel extends Channel doesn't mean Channel will have the methods of the TextChannel class.
@earnest phoenix lang?
discord.js
I have used djs but never in this way
Channels that are cached are that of their types, if itâs a text channel then itâs already of the TextChannel class in the cache
https://discord.js.org/#/docs/main/master/class/Client?scrollTo=channels
this doesn't say so
Itâs kind of implied
They all extend channel
Therefore theyâre all channels
However that doesnât mean their class isnât other channels
How do you think you can send messages to a channel?
yea but they're all Channels, but it doesn't really imply that they're all of their own types
I am searching oauth2 access code for https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=addMember
Because itâs a TextChannel
If they were all just Channelâs you wouldnât be able to message.channel.send 
Youâll never really be presented with just a channel either
They're all https://discord.js.org/#/docs/main/master/class/Channel which doesn't have send method.
Yes good job
Like I said
If they werenât cached as things other then Channel then you wouldnât be able to do any of the shit that you and everyone else already uses
I canât tell if youâre trolling or not because this is genuinely stupid
XD
@earnest phoenix if you want to implement OAuth, may I recommend using https://npmjs.com/package/disco-oauth
I will try, thanks.
Well, @slim heart it isn't neccessarily stupid because it isn't said anywhere that the channel objects inside the cached ChannelStore are objects of their respective types and since all the various Channel types derive from Channel class, that's why it's written in the docs even tho the channels are objects of classes that extend the Channel class and not direct objects of the Channel class.
Itâs extremely implied
Considering there are bazillions of examples of people using channels.get().send
hey i need some help im trying to make it so you can @ my bot and that will work as a prefix
my prefix is in the .env file on glitch
Lang?
(TBH whatever lang, just use a commands framework)
?
I would recommend using a command framework for handling such stuff. Here's a link where various frameworks for d.js are compared - https://github.com/1Computer1/discord.js-frameworks-comparison
Welp, I need a little help with discordjs. I have a text channel's ID and a message ID of a message which belongs to that text channel. And then I need to edit the message. I can't seem to be able to do this...
the part about editing
what have you tried?
bot.channels.get(channelId).messages.fetch(messageId).edit(...)
wait nvm, I AM STEWPIED
fetch returns a promise
Ok, another discord.js issue, when installing the master branch, I am it keeps getting stuck at this for some reason.
I waited for like 10 minutes at first and then I redid with verbose
Do you have git installed?
dumb Question, how to get the shards size?
Master requires git, althougt a missing git should give an error, not get stuck
What do you mean shards size? How many shards is the current process handling?
Yea
In djs should be somewhere in client
Check the docs, client.shard or client.shards
v12 and v11 sharding are totally different, so it would be nice if you said what version of Discord.js you are using 
Also ^ yeah
I remember how I had sharding on v11, it was perfect and then I upgraded to v12 and I was completely lost
@twilit rapids 11.5.1
shardmanager
can I code a bot in python?
yes
Yes
<Client>.shard.manager.totalShards iirc
You can use either disco or discord.py
does python support them
how fast is discord api abuse?
what are you trying to do
I was wondering. Why my bot isn't show as connected on the site ?
nothing much (for now), i saw the "api abuse" declined messages and i am wondering how fast is api abuse.
yea u will be fine
good
Hitting ratelimits, doing many things at once
?
was an answer to my question of the speed which equals api abuse
hum
whta
hotaskickedbot @smoky briar
Your bot was likely kicked because it broke one of the "bot rules" listed in #rules-and-info.
To find out why your bot was kicked and by who, use the search feature in #mod-logs:
@slender thistle so he has beeen kicked because he has dm when added ?
Correct
how do bots make the boxes with the color at the left
@jade thistle you mean create the bot on the website again ?
Fix the issue and ask a moderator to re-invite the bot
@slender thistle can you reinvite the bot ?
Did you fix the issue
@jade thistle how do bots make the boxes with the color at the left
those are called embeds
most discord libraries have functions to help you build them, but you can also build one with an object literal
ok
thanks
Someone, The Discord Server List Bot Is Offline When I Invited It:
Now I Am Unable To Add My Server
that bot ^ is not associated with discordbots.org
@vagrant heart yes it is
its for https://discordbots.org/servers
oh sorry, thought it was something else

nodejs
app.get("/catmaniabot", checkAuth, async function(req, res) {
res.render("/app/website/page/guildList.ejs", {
userGuilds: req.user.guilds
})
})
html
<script>
var slides = <%- JSON.stringify(userGuilds) %>
var str = '<ul>'
slides.forEach(s => {
str += '<li>'+ slides + '</li>';
})
str += '</ul>';
setTimeout(() => {
document.getElementById("slideContainer").innerHTML = str;
},1000)
</script>
<div class="guildList" id="slideContainer">
</div>
Why is this happening? Probably something very obvious
First of all, you're using slides inside the forEach
Probably meant to use s there
[object Object] is the default toString() of an object
So that's what's happening there
#topgg-api would be a better place to ask
oke
on dashboard for /server/:serverid im gonna do .use to authenticate a user on that endpoint, though idk how i should authenticate, should i fetch guild list again with the filtered permissions that i used to give the guild list in the first place or should i eval on the shard and check if they have perms?
and since i have guild list cached for a bit
Why is this not working:
mega!eval let imageembed = new Discord.RichEmbed()
.setTitle('My stats')
.setImage(https://discordbots.org/api/widget/618037965888684032.svg)
message.channel.send(imageembed)
Which requirements you need to be certified developer?
<script src="file.js"></script>
Tell where to put

in your <head>
This isnt html cyber
node
isnt he asking about embedding js?
js
ouch
discord.js embeds

bruh
stable or master?
Now I know how cry feels
im just bad ok
@stone robin send a screenshot
...
you are god if you can edit on phone
Using discord.js, can I fetch the username of a user, who may not share a guild with the bot but whose ID is available?
Is there a code to make music in python?
@quasi forge no
Music bot in 1 file on python?
Rip
@west spoke so gotta make an API request from discord API directly?
Music Bots can be made in one file
In python?
however spoonfeeding is not allowed
@quasi forge the user has to be in a shared
yes
Its how the discord api works
or it has to have been dm'd at one point @quasi forge
@stone robin might wanna lock your project btw
@stone robin It's possible
@quasi forge you can I believe
Does glitch work for you on phone?
If you have the ID, you can use <Client>.users.fetch
ok nvm
đ
TheDrone are you on stable
but you may wanna reset your token
Then you should be able to fetch a user if you have their user id (assuming that's what you're asking) 
https://discord.js.org/#/docs/main/master/class/UserStore?scrollTo=fetch
Yea I thought so too, but it doesn't seem to work that way
what happens when you try?
undefined
code? Remember it returns a promise
i dont believe you can get a user the bot doesnt share a guild with
Unless you fetch that user directly from API
but that requires oauth no?
^
with permission from said user
I believe you can still (no shared guild)
OOF
or am I the one going the wrong path rn
@stone robin dude seriously lock your project
or make a .env
I'm not even signed in and I already see your bot token
NVM, @sudden geyser was right, I was just editing the wrong part
so you actually can fetch any user
yep
interesting
stalker
Yeah
Thx
brute-forces snowflakes to get info from all 250 millions discord users

@west spoke how?
It only gives partial user tho
@stone robin
I think it gives most info provided. You just can't do stuff like send a dm to them with no shared guilds.
how to make my js bot edit a comment?
get the message, then call the edit method
and how do i do that?
One way doing that is by reading docs
not, because i dont know the edit method because google doesnt fucking help
Okay, then visit the documentation and search for the edit function.
okk
@stone robin also may wanna reset your token. You can do that through the discord developer console

@sudden geyser thanks for help, it was much more easy than espected.
np
Instead of glitch how to host 24/7
There's plenty of hosting companies in pinned messages
not free, not for me

@stone robin ur gonna have to spend a little if u want actual good hosting
c!eval
Rip
you can buy a vps off of hetzner for literally 2.99 euros a month
is there a space at the end of "ay"
how can i clear my bots cache like cached members messages etc.
in djs v12 all collections have a sweep() method
as well as a clear() method
sweep lets you pass a function to filter which items should be deleted, while clear deletes everything in the collection
Ok, so I have this:
https://server.maniabots.xyz/dashboardGetGuild?guild_id=497153287779516417
How can I make it show all the arrays, like users, channels, roles etc
thats a pretty vague question lol
Are you sure it's a good idea to do that
Well, I do need it..
exposing information from guilds to third parties is considered a breach of privacy
unless you lock it for yourself only
or for any specific server-side function you may need
I will be adding authorisation to it.
even with authorisation, user A should not be able to freely access information from a guild he is not in

Thats why I need the members, to see if the user is in that guild
how are you getting this guild object?
app.get("/dashboardGetGuild", (req, res) => {
var parts = url.parse(req.url, true);
var query = parts.query;
if(query.authorisation !== "this is hidden") return res.send("{\"Status\"}: \" 400\", \"error\": \"Unauthorised\"");
let g = client.guilds.get(query.guild_id);
res.json(g)
})
@snow urchin if you log g does all content show up?
you're using the wrong http code
Let me check.
I am getting data for DBL with that link
he said he is working on locking its access to guild members only
also auth keys/jwts should be sent in the headers
making users provide it in the query is unsafe
well google apis put their keys on query parameters
Yes, all the content shows up when I log g
then res.json() is stripping the content out
possibly because it doesnt support complex structures like collections
Is there any solution?
you can turn collections into array
collection.array()
you could loop over keys, and turn them into arrays if they are collections
@snow urchin if(query.authorisation !== "this is hidden") return res.send("{\"Status\"}: \" 400\", \"error\": \"Unauthorised\"");
What's the point of faking JSON?
Sending an object should work the same way but much better
you should also set the code itself in the response
can't rely on that the client will read the body of the response
i think that's how i do it atleast
on the second thought, that doesn't matter if the api is going to be hit only by the user on the website
res.status(400).json({ status: 400, error: "Unauthorised" });
is how u can do it with express atleast
that will also set the content-type header for u too
@sudden geyser Then it dont works at all
If you're slicing by its length, it should work. Is prefix exactly "ay " (with the space at the end)
are you sure the first arg you're using (command) is valid
in html is there a way to make a checkbox activated by default without using any js yet?
use the checked attribute
wait
oh
i was doing a dumb cuz i was testing it by changing it in the browser and it wasnt working
thnx
oof
@quartz kindle https://discordapp.com/channels/264445053596991498/272764566411149314/627889750530981899 can u gave me an source or example
client.users.clear() = delete all users
Hello guys, so I made a live countdown on a website and im wondering how can I show it on my discord server?
@vivid spruce the countdown itself? you can't
I gotta make a countdown with a bot then?
a bot cannot update data in real time
Okay
the most a bot can do it post something and update it regularly
thanks and one more thing
like every 5-10 seconds
Thank you guys
when users leave from guild my bot still cached that user
how can i filter them
like guildmemberdelete => client.users.filter(t => t.id != leaveduser.id) ?
in v12, store collections have a .remove() method
client.users.remove(userID)
or you can just use the native map method .delete(id)
in mongo how can i remove an entire row? i tried to set it to just undefined but it just sets it to null
deleteOne()
that'd be an updateOne
set it to what?
with an option that I don't remember, one sec
cuz when i set it to undefined it turns to null
thanks

const Discord = require("discord.js");
const superagent = require("superagent");
module.exports.run = async (bot, message, args) => {
let {body} = await superagent
.get(http://aws.random.cat//meow);
let catembed = new Discord.RichEmbed()
.setColor("#00ff26")
.setTitle("Cat đą")
.setImage(body.file);
message.channel.send(catembed);
}
module.exports.help = {
name: "cat"
}
this file stopped working for some reason
does anybody know where i went wrong?
app.get("/dashboardGetGuildMembers", (req, res) => {
var parts = url.parse(req.url, true);
var query = parts.query;
if(query.authorisation !== "hidden x") return res.json({ status: 401, error: "Unauthorised" });
let g = client.guilds.get(query.guild_id).members;
console.log(g)
res.send(g)
})
why is this just showing an empty json instead of all the members for the guild specified
oh lord
@twin lion Show the error
Help
with what?
@sour sandal what line does the error exactly happen
guild is null. Are you using it in a dm
How can I add it automatically from the script.js file?
or is the guild not fetched for some reason
then that'd be why
@sour sandal if you're not using it in a guild, message.guild will be null. You could make a workaround, but I'd recommend locking the command to guild only or something. The id is good
how would you use auth headers in node-fetch
Hi ! Sorry to disturb you ! When I put F5 that give me this results
Can you explain me why ? Thanks in advance đ
Says incorrect login details
Line 25 of warning.js holds the issue
@lunar crystal
Ok but why đŹ ?
Ok thanks u very much đ
Np đ hope it helps
I can't see warning.js
Sorry đ I'm a beginner sorry haha
Hm
warning.js is an internal error handling file
its not something you have to go look at, and its not the origin of the problem
your problem is incorrect login details, meaning either your token is wrong, or you didnt put it there correctly
Can I get some reviews regarding this website - https://cjeight--thedrone7.repl.co/
Code:
const { exec } = require('child_process');
module.exports = {
name: 'exec',
description: 'Runs a console command.',
usage: '<command>',
category: 'owner',
aliases: ['ex'],
run: async (client, message, args) => {
}
const command = args.join(' ');
const outMessage = await msg.channel.send(`Running \`${command}\`...`);
let stdOut = await doExec(command).catch(data=> outputErr(outMessage, data));
stdOut = stdOut.substring(0, 1750);
outMessage.edit(`\`OUTPUT\`
\`\`\`sh
${stdOut}
\`\`\``);
};
const outputErr = (msg, stdData) => {
const { stdout, stderr } = stdData;
const message = stdout.concat(`\`\`\`${stderr}\`\`\``);
msg.edit(message);
};
const doExec = (cmd, opts = {}) => {
return new Promise((resolve, reject) => {
exec(cmd, opts, (err, stdout, stderr) => {
if (err) return reject({ stdout, stderr });
resolve(stdout);
});
});
};```
Error: ```js
const command = args.join(' ');
^^^^^
SyntaxError: Unexpected token const
You never added an ending } for the exported run function
const Discord = require("discord.js");
const superagent = require("superagent");
module.exports.run = async (bot, message, args) => {
let {body} = await superagent
.get(http://aws.random.cat//meow);
let catEmbed = new Discord.RichEmbed()
.setColor("#00ff26")
.setTitle("Cat đą")
.setImage(body.file);
message.channel.send(catEmbed);
}
module.exports.help = {
name: "cat"
}
does not give an error but just stoped working after some time i can not find wy sadly any sugestions?
whats bad on having commands that can be used in dms
@quasi forge So I am missing one }?
Yes @ember atlas
I mean
run: async (client, message, args) => {
}
const command = args.join(' ');
You literally have your entire command outside your run
Move your entire command inside that
run: async (client, message, args) => {
// code for your command goes here
}
I changed it and im getting unexpected tokens now
Send your updated code
const { exec } = require('child_process');
module.exports = {
name: 'exec',
description: 'Runs a console command.',
usage: '<command>',
category: 'owner',
aliases: ['ex'],
run: async (client, message, args) => {
const command = args.join(' ');
const outMessage = await msg.channel.send(`Running \`${command}\`...`);
let stdOut = await doExec(command).catch(data=> outputErr(outMessage, data));
stdOut = stdOut.substring(0, 1750);
outMessage.edit(`\`OUTPUT\`
\`\`\`sh
${stdOut}
\`\`\``);
};
const outputErr = (msg, stdData) => {
const { stdout, stderr } = stdData;
const message = stdout.concat(`\`\`\`${stderr}\`\`\``);
msg.edit(message);
};
const doExec = (cmd, opts = {}) => {
return new Promise((resolve, reject) => {
exec(cmd, opts, (err, stdout, stderr) => {
if (err) return reject({ stdout, stderr });
resolve(stdout);
});
});
}
}
oh am i not supposed to close it there
If you want to close your exports there you need to add another bracket in the next line and remove the one from the last line
hm
I figured it out
But now I need to define msg and outputMessage and I am unsure how to do that
Well first off
run: async (client, message, args) => {
Did you code this yourself?
Yes...
then you know you defined your message object as message and not msg and you've been using msg in your entire command
Well msg.edit is a function
message.edit isn't
It runs the command fine, just want it to edit
Are you trying to edit await msg.channel.send(`Running \`${command}\`...`);?
Ok theres your problem
msg.edit(message); I think message needs to be changed to outMessage
thats if theres an error
So none of them are doing the edit?
outMessage.edit(`\`OUTPUT\`
\`\`\`sh
${stdOut}
\`\`\``);
}
};
Thereâs a outMessage.edit and msg.edit
Oh
Yes, they are 2 different things
It's saying if there is an error, msg.edit and send the erro
Are they both not doing the edit though?
And is that the outMessage.edit ?
yes
Did you fix your mixed usage of message and msg yet?
Maybe send the updated code if you have
Something I've noticed is that in your doExec() catch, you'll run outputErr() which edits the message, but right underneath that, you'll immediately edit it again because the code beyond the catch would still be executed
const { exec } = require('child_process');
module.exports = {
name: 'exec',
description: 'Runs a console command.',
usage: '<command>',
category: 'owner',
aliases: ['ex'],
run: async (client, message, args) => {
const command = args.join(' ');
const outMessage = await msg.channel.send(`Running \`${command}\`...`).then(async (outMessage) => {
let stdOut = await doExec(command).catch(data=> outputErr(outMessage, data));
stdOut = stdOut.substring(0, 1750);
outMessage.edit(`\`OUTPUT\`
\`\`\`sh
${stdOut}
\`\`\``);
};
};
const outputErr = (msg, stdData) => {
const { stdout, stderr } = stdData;
const message = stdout.concat(`\`\`\`${stderr}\`\`\``).then((msg) => {
msg.edit(message);
};
};
const doExec = (cmd, opts = {}) => {
return new Promise((resolve, reject) => {
exec(cmd, opts, (err, stdout, stderr) => {
if (err) return reject({ stdout, stderr });
resolve(stdout);
});
});
}
}
I nailed it down to this, but I keep getting
};
^
SyntaxError: missing ) after argument list
on line 21 you are missing a ) after the }
wait fuck
it should have given you an error saying what line #, make sure to look at that next time
what am i to do with this information ^
idk lol
We would need to see the code and more of an explanation to help you out
How do you find the ID of the Discord bot by just using...?
const Discord = require('discord.js')
const client = new Discord.Client()
//some function start
console.log(client.id)
//some function end
client.token("idc")
thx
^^
im too lazy
if (message.content === "<@" + client.user.id + ">") {
message.channel.send("The prefix of <@" + client.user.id + "> is `--` and the help command is `--help`.")
}
That would work I think
would this work if i wanted to do it?
try {
client.login("BOT TOKEN")
} catch(err) {
console.log(err)
}

Does anyone know how to define the name command in this code for python please?
@shy turret no
.login() returns a promise
if you want to use try/catch on it, you have to await it
else, you need to use .catch()
@verbal basalt reset ur token
@knotty steeple is that to define the name command?
Okay
@verbal basalt you revealed your token in that image
meaning anyone could use it to login into your bot
aka: "hack" it
i need help
oh
it says client id is wrong and make sure bot has account
i checked both
and its correct though
where does it say that? please provide context
wdym
context as in, what are you trying to do when that message pops up
in which program does that message appear, in a browser, in a command line, in a code editor?
if in a browser, in which website, which page, where in the page? provide a screenshot with the error as well as what you did that caused it
in order to be able to help, we need as much information as possible, else we have no idea what you're even trying to do
explain what you want to do, the steps you tried, the result you were expecting, and the result you got
function checkValidity(obj, guild) {
if(typeof obj.base !== "boolean") return false;
if(typeof obj.censor.msg !== "boolean") return false;
if(typeof obj.censor.emsg !== "boolean") return false;
if(typeof obj.censor.nick !== "boolean") return false;
if(typeof obj.censor.react !== "boolean") return false;
if(typeof obj.antighostping !== "boolean") return false;
if(typeof obj.log !== "string" || !guild.c.some(x=>x.id === obj.log)) return false;
if((typeof obj.role !== "string" && obj.role !== null) || (typeof obj.role == "string" && !guild.r.some(x=>x.id == obj.role))) return false;
if(!(obj.filter instanceof Array)) return false;
if(obj.filter.some(x=>x.match(/[^a-zA-Z0-9 ]/gi))) return false;
if(obj.pop_delete !== null && typeof obj.pop_delete !== "number") return false;
if(typeof obj.pop_delete == "number" && obj.pop_delete > 120 * 1000) return false;
if(typeof obj.punishment.on !== "boolean") return false;
if(typeof obj.punishment.amount !== "number" || obj.punishment.amount < 1) return false;
if((typeof obj.punishment.role !== "string" || obj.punishment.role !== null) || (typeof obj.punishment.role == "string" && !guild.r.some(x=>x.id == obj.punishment.role))) return false;
return true;
}```
ok current im using this function to validate incoming objects and for obj.role and obj.punishment.role it just seems to mess up with the second part of the if statement, the two of them can be null but im checking they're strings then make sure the guild has the roles as well (guild.r is roles)
ok 1
(this is nothing to do with the code)
ur giving me an aneurysm just by looking it
One message removed from a suspended account.
Iâm doing it like that because Iâm returning numbers instead of false to troubleshoot
Then Iâll make it prettier once all the logic is done
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.
What
Wait
if((typeof obj.role !== "string" && obj.role !== null) || (typeof obj.role == "string" && !guild.r.some(x=>x.id == obj.role))) return false; this one
"returning numbers instead of false"
I'm confused by this
just do
if (typeof validate === 'boolean') return doThis();
else doThisWithNumbers();
Iâm asking for help with the role logic
I'm just confused of what u need help with
I want obj.role to be able to be null or the roles ID which is a string
But it returns due to the second part making sure that the role is actually in the roles array
uhh
Even tho it is and Iâm tired and it makes sense that the logic should work but it doesnât
i don't think i can help u with this since idk what do u mean 
no
sup
Are you sure you are in the right channel?
Ahh i hate German keyyboards xD
Oof
this isnt development please talk in #memes-and-media
dbl bot submission is nothing to do with development
Okay
My Mind is absolutely blowing xD
hmm
ye
Kk
DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.
what lang?
JS
@loud salmon help me shard pls 
@keen drift go figure out how to shard between k8s instances yourself u fuckin nerd

oooof
Anyone know of a good module or api to help notify when a new video from a specific channel is uploaded?
Google just keeps showing youtube bot tuts
Pubsubhubbub or whatever that is but you can also scrape YouTube in the US
Aweshum, spanks :)
Pretty sure you can make a webhook for that using a service like IFTTT
imo it's quite easy to setup a simple one
IFTTT makes it even easier
I appreciate the guidance, thank you :)
How would you connect your bot to a google drive account, or more specifically, how would you have it upload photos to the drive?
I have a feeling that reading this would help you @oblique portal There should be no reason for you to connect any bot to google drive http://xyproblem.info/
Asking about your attempted solution rather than your actual problem
basically tldr
User wants to do X.
User doesn't know how to do X, but thinks they can fumble their way to a solution if they can just manage to do Y.
User doesn't know how to do Y either.
User asks for help with Y.
Others try to help user with Y, but are confused because Y seems like a strange problem to want to solve.
After much interaction and wasted time, it finally becomes clear that the user really wants help with X, and that Y wasn't even a suitable solution for X.```
Ok thanks. I am new to the server, sorry
its alright
its just helpful to us if you tell us your end goal for hooking up to google drive for something
if its actually you wanting to do stuff with google drive then thats fine, but if you are looking to use it as a rudimentary image database to save on vps space then its no bueno
Ok
message: (bot, utils, config, discord) => {
bot.on('message', async message => {
const fs = require ("fs")
const botconfig = require ("../settiings/config.json")
if (message.author.bot) return;
if (message.channel.type === "dm") return;
let prefixes = JSON.parse(fs.readFileSync("prefixes.json", "utf8"));
if(!prefixes[message.guild.id]){
prefixes[message.guild.id] = {
prefixes: botconfig.prefix
};
}
let prefix = prefixes[message.guild.id].prefixes
//let prefix = config.prefix;
let args = message.content.slice(prefix.length).trim().split(' ');
let cmd = args.shift().toLowerCase();
let command;
utils.load(discord, bot, config, message, args, message.guild);
if (!message.content.startsWith(config.prefix)) return;
if (bot.commands.has(cmd)) {
command = bot.commands.get(cmd);
} else if (bot.aliases.has(cmd)) {
command = bot.commands.get(bot.aliases.get(cmd));
}
if (config.commandNotFound == true) {
try {
command.run(bot, message, args);
} catch (err) {
if (err) utils.timed_msg(utils.cmd_fail(`Command \`${cmd}\` is not found!`, `${prefix}play <MUSIC/URL>`), 5000);
}
} else {
try {
command.run(bot, message, args);
} catch (err) {
if (err) return undefined;
}
}
});
}
}```
The Defaut Prefix n! works, but if i change it to ! or sth it dont
because you're returning if the content doesn't start with the default prefix, which i assume is config.prefix
Hello
Hello
I have a question? What is wrong? This is the failure message (node:12248) DeprecationWarning: Collection#find: pass a function instead
(node:12248) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
at item.request.gen.end (C:\Users\wesle\Desktop\Funny bot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15)
at then (C:\Users\wesle\Desktop\Funny bot\node_modules\snekfetch\src\index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:12248) 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: 6)
`This are my codes:
//Dit is aan het bewerken!! Dit is dus nog niet af!!
const discord = require("discord.js");
const ms = require("ms");
module.exports.run = async (bot, message, args) => {
if (!message.member.hasPermission("MANAGE_MEMBERS")) return message.channel.send("Sorry jij kan dit niet doen");
var user = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if (!user) return message.channel.send("Geef een gebruiker op. Of deze gebruiker bestaat niet op deze server");
// if (user.hasPermission("MANAGE_MESSAGES")) return message.channel.send("Sorry deze persoon kan jij niet muten");
var muteRole = message.guild.roles.find("name", "MUTED");
if (!muteRole) return message.channel.send("De rol MUTED bestaat niet!");
var muteTime = args[1];
if (!muteTime) return message.channel.send("Geef een tijd mee!!");
await (user.addRole(muteRole.id));
message.channel.send(`${user} is gemuted voor ${muteTime}`);
setTimeout(function () {
user.removeRole(muteRole.id);
message.channel.send(`${user} is geunmuted`);
}, ms(muteTime));
}
module.exports.help = {
name: "tempmute"
}`
Probably best you choose to try pastebin or hastebin for your code rather than a giant essay.
rather than using message.guild.roles.find("name", "MUTED"); use the function method
look at the docs for that
no the problem was that de role stay above my bot. Then can't role my bot de player
but thank you!!!
i need help
everytime i make my bot join vc it sends something
@hushed berry happy bday!
@inner sapphire where are you hosting your bot
which company is the vps hosted with?
did you install the required dependencies for voice functions?
erm
i don't think so
i have it fixed but now it ends the music
when running the command
the bot works fine on my pc but no the vps
đ
make sure all your dependencies are correctly installed
can u send me the dependencies link?
also make sure any hardcoded paths are properly updated
just review your code and make sure you have installed all the packages you require and that all files and folders you open exist in the vps and are in the correct directories
where are you playing the song from?
youtube
which package are you using for that?
check how to debug errors in that package, how to make sure the youtube link properly connects, the data is valid, etc
make it log all errors and status codes
there is probably an error somewhere but you cant see it because you're not logging and catching them
check the package documentation in their npm page or github page and see how to make it log errors
ehostunreach means the link could not be found
there is a possibility your vps is blocking youtube, or youtube is blocking your vps
but the bot works completely fine on my pc
probs
aws is broken too
let me try that again tho
thats what my aws vps does


