#development
1 messages · Page 638 of 1
Do you mind sending your DBL token in my DMs
ok
Token works fine on my side /shrug
Check carefully how you are entering it in your code

maybe you are using the token wrong?
are you sure you are using the DBL token with the DBL api
yes
Hi, i have a command for show the profil of personne ?profile @craggy sirenx#0000
But i do mention user for this how i can make just : ?profile Userx
Ok, so how i can make this ? :d
Lmao
let total = matches.map(u => '`' + u.tag + '`').join(", ")``` taken from google
though generally, if there's two or more people with the same username you should error with the command
its not exactly what do you want, but it can help you
Hum okay
matches.first()
😢401
just delete let total
and it should be work
@earnest phoenix show ur code
without dbl token
the token is what's wrong
401 is forbidden, meaning wrong token
matches.first().id show the user of matched ?
matches.first().id show the id of the user
Ok ok yes
const api = ayarlar.dbltoken;
snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
.set('Authorization', api)
.send({ server_count: client.guilds.size })
.then(() => console.log('discordbots.org Istatikleri güncellendi!'))
.catch(err => message.channel.send(`Bir hata var: ${err.body}`));```
message.guild.members.get(matches.id).send('Test')
```
@lofty hamlet
it should be work
now
i have remplaced users.filter by message.guild.members.filter
@earnest phoenix
djs ?
Member with s no ?
You say member without s
yes i'm dumb
Ok ok
I have edited the code
const api = ayarlar.dbltoken;
snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
.set('Authorization', api)
.send({ server_count: client.guilds.size })
.then(() => console.log('discordbots.org Istatikleri güncellendi!'))
.catch(err => message.channel.send(`Bir hata var: ${err.body}`));
This wrong?
Why ignoring me :/
snekfetch is deprecated
what i use
it's suggested to use node-fetch
code?
wat
no spoonfeed
@earnest phoenix toLowerCase of not defined
what
args is all after the prefix
Ok ok
after a command*
Ok thx
let matches = message.guild.members.filter(u => u.tag.toLowerCase().startsWith(searchTerm.toLowerCase()))```
`toLowerCase of undefined`
@earnest phoenix
with [ ' ' ] ??
Yes
console return an array 
@lofty hamlet do you have a testing server ?
Yes
yes invite
So I have an interesting question. I currently have a machine with Windows Server 2019 Essentials and Jetbrains Rider. It seems to work just fine with .Net Framework projects but whenever I load in my main bot (which is in .Net Core) Rider crashes and the entire machine reboots. Anyone have any idea what might be causing this? (to be clear I so far haven't loaded up any other .Net Core projects and it might very well be related to this one project but it seems very odd to me as it loads just fine in Visual Studio)
It might be Raider itself. Maybe it assumes it's running on Windows and tries to access a function that's only available there and not Windows Server which causes it to crash?
Try creating a .Net Core project in Raider and see what happens
That's what I have been thinking as well but I'd have no idea what that'd be as idk where to find the logs related to this. To be fair I haven't looked too much into the issue myself but as it's my first and probably only machine I'll actually be using Rider on I thought I'd ask here in case there are people whom have had it before or know something about it
And yeah I'll try that
Also seems to be taking quite a while for it to even load Rider up. Everything is a fresh install since I only just got the server.
Regular .Net Core 2.0 project does seem to build
I can't find anything on google regarding both Rider and Windows Server
Same
Anyone have any other ideas about light weight IDEs which support C#, Framework and Core and don't take up much space? I'd use Visual Studio again but the current drive is only 64GB so rather use something smaller
@weak parrot have you taken a look at windows event logs?
The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly. Regular Kernel-Power error
Clear all your logs and try to crash it again and see if anything pops up
I already uninstalled Rider. I could always try it again but I somewhat doubt something will popup. It's a clean system and already stress tested it for hardware related issues and such. Then again it could always be something entirely different.
Eh fuck it I'll try it
How would I do the votes role thing with dbl? So if they vote my bot they get the role: Voted on my bot’s support server?
Ok
@prime cliff still Kernel Power critical error
Ugh fuck it I'll just install Visual Studio
@earnest phoenix Where do I find them?
Thanks
Is there a video explaining what to do?
anyone good at cpp bindings for node 12? im using a native addon which works on node 11 and im trying to get it to work with node 12...
one of the errors is no matching function for call to ‘v8::Value::NumberValue()’
the suggested candidate is candidate: v8::Maybe<double> v8::Value::NumberValue(v8::Local<v8::Context>) const
the code in question is info [0]->NumberValue ()
info is an object and i need to get the value 0 as a number, i dont really understand what its telling me to do
CryptoToday at 12:34 AM
Is there a video explaining what to do?```
https://stopbeingabad.dev/#general-yt-tutorials
help yourself
Hot to add a bot to my server
Wrong place to ask that
https://discordbots.org/bot/new @ocean ore
(He meant inviting it to his server)
]]faq 1 --clean
if you mean where to add your bot
click the link that coffee sent
and then click the link in that message and fill out the application
also further questions go to #general not here
Anyone know how to make a afk command, like when you type >afk, it will change your name to [AFK] [Your Username] then when you type it will remove your afk, and when someone pings you it will tell them you're afk.
^
Does anyone have a suggestion on an afk command. I used a json file to store users who are afk but I cant get it to remove the user from the list. Is there a better way to do this?
Maybe an enmap? Or a collection
Find a way of storing who's afk e.g. database or JSON file. Then try change users nickname to [AFK] Username then when type it again get entry from file check if it exists then if so change their name.
I did do that but how would I remove them from the list
im sure there is a function to remove an object from a list
splice
That would remove it?
If you're using JavaScript
Yes
discord.js?
Yes
nvm
your language docs will also help
not even discordjs docs
I havent see a way to remove an item from a JSON file
Then set the json file after removing the user
Ih I see
So could I just replace the user with a blank value?
So if I do afklist.splice(); it would remove the object
You could have your JSON file be an object then
// SET AFK
let JSON_OBJECT = {} // GET OBJECT FROM FILE;
Object.defineProperty(JSON_OBJECT, message.member.user.username, {
value: true,
writeable: false
});
// REMOVE AFK
delete JSON_OBJECT[message.member.user.username];
// SET USERNAME:
...
// SET JSON FILE:
Then you'll have to use fs or something to write the file again
Yes
I feel like there is a simpler way to do this but that will work
Ima try out an enmap too
yo SQL/postgres wizards, am I doing anything wrong here? https://moosecorp.xyz/i/wakeful-cover-8308.png (ping me)
guy s help me c++
]]moreinfo
Please provide as much information as possible to get the most efficient assistance as soon as possible; state the library, language, the specific part of the code in question, and what you are trying to do and/or what you think may be causing the error.
21:17:37.152 - Stack Begin
21:17:37.154 - Script 'Model.MainModule', Line 1 (x2)
21:17:37.154 - Stack End
21:17:37.155 - Requested module experienced an error while loading
21:17:37.155 - Stack Begin
21:17:37.156 - Script 'Model.MainModule', Line 2 (x2)
21:17:37.157 - Stack End
21:17:37.157 - Requested module experienced an error while loading
21:17:37.158 - Stack Begin
21:17:37.158 - Script 'Model.MainModule', Line 12
21:17:37.159 - Script 'Model.MainModule', Line 12 - field ?
21:17:37.160 - Script 'Plugin_3323713717.LoadCharacter.Functions', Line 1 (x2)
21:17:37.160 - Stack End
21:17:37.161 - OnServerEvent can only be used on the server
21:17:37.161 - Stack Begin
21:17:37.162 - Script 'Model.MainModule', Line 2 (x2)
21:17:37.163 - Stack End``` help me idk lua neither roblox studio
plsss help me
i have an idea of lua but not professional please help me
ty
want people actually use discord.lua still? Holy shit I thought it was just a meme.
Why are you trying to use something you know nothing about and expecting people to help without you trying to figure it out on your own?
can you make the bot give someone a role by answering dm's from the bot? (I haven't tested it yet, just want to ask if its possible)
Please provide as much information as possible to get the most efficient assistance as soon as possible; state the library, language, the specific part of the code in question, and what you are trying to do and/or what you think may be causing the error.
Discord.js/json Help Needed
So, I'm programming a Discord bot, but got an error I don't understand.
I'm trying to send an embed.
The error is:
- (node:13176) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
```And my embed is:
```js
{embed: {
color: green,
title: "Message Deleted",
description: message,
fields: [
{
name: "Channel",
value: "<#" + message.channel.id + ">"
},
{
name: "User",
value: message.author.mention + ", `" + message.author.tag + "` (`" + message.author.id + "`)"
}
],
footer: {
text: "Entry date: " + date
}
}}
❗ Ping with response please
Hi, I'm trying to install ffmpeg-binaries but recieve an error when running the command:
https://pastebin.com/Zd9rSsD7
Pastebin
[JavaScript] ffmpeg-binaries@4.0.0 install /home/container/LavaBot...
I have also tried using npm i ffmpeg but am recieving the same error.
@floral bloom message.author.tag not message.author.mention
install node bindings
Is there a command to do so?
I forgot the command Im afaik
https://github.com/nodejs/node-gyp probably this
@warm marsh Nope, didn't work...
It's giving the same error when trying to install anything
not sure then probably you can ask on the coding then node.js section
@earnest phoenix ask your question here. People here might be able to help you out
Ugh phone 
@earnest phoenix
@floral bloom
{embed: {
color: green,
title: 'Message Deleted',
description: message.content,
fields: [
{
name: 'Channel',
value: `<#${message.channel.id}>`
},
{
name: "User",
value: `<@${message.author.id}>, \`${message.author.tag}\` (${message.author.id})`
},
footer: `Entry Date: ${date}`
]
}}```
That embed looks fine @floral bloom are you sure that's what the error is originating from
Yes it is.
If message is the variable defined inside of the event
then it's the embed.
Maybe show some more code
Closing bracket?
^
I only see one at the end but there should be two
Yeah
JavaScript welcoming message?
I forgot one
👀
His code has two things inside that could be causing the error.
message.author.mention doesn't exist
and if message is variable defined from client.on('message', async(message) => {}) then that's the reason for circular to json
I think someone should offer paid code cleanup services... he will be as rich as Bezos in a month
lmao
Those would just be undefined if they don't exist
@floral bloom you're most likely using some json method on your embed which you don't have to
Show the code you use to send the embed
I'll show you where his error is coming from.
private async run(message:Message, args:string[]) {
return message.channel.send({
embed: {
title: "**PONG!**",
color: this.client.color,
description: `Client Ping: ${ms(this.client.ping, { verbose: true, secondsDecimalDigits: 0})}`,
footer: {
text: message
},
timestamp: new Date().toISOString()
}
});
}
message
If the variable called message in his embed is the one passed from the event.
otherwise he should name his variables something a lot more meaningful.
yeah
or ${message}
@warm marsh Thanks! That worked! 😄
np
I don't have osu acc
Create one
osu api keys should be private afaik
They are not only private, they are specific to an application (e.g. your bot). You need an osu account to apply for one.
the osu api standalone is very poor anyways
Hello! I am trying make numbers of servers choosed bot handling. I am using next code:
var usr = client.users.get(${user_data.client_id}); var guilds = usr.client.guilds;
But i got only guilds for my client
How can i count number of servers for any bot?
you need to use the oauth2 process to get access to a list of guilds the user is in
I need oauth2 of bot client?
what
*oauth2 token of bot client
you can't get a list of guilds of another bot except for the one you're logged in, however you can get a list of guilds a user is in by using the oauth2 process
an oauth2 token doesn't exist, an access token does
One min

Here we can see number of servers of any bot on official site
So can i use dbl's api to count any bot servers?
no
Why?
because dbl is a bot list, it only provides the server count if the bot is on the list and if it posted a server count, even then it's unreliable because once again you can spoof the server count
Thank you. I will look for widgets
Any easy way to get a emoji from a message on master using discord.js?
thought so
use an api
like this https://thecatapi.com
ok thanks
hi
yes me need help
explain what you need help with please
can give website this server?
yes
if that's what you mean
tysm
you're welcome
Hey guys, I have a question about my prefix. Can I use 2 prefixes? Like "V" and "v"
i mean i guess
like, for bot rules on the site? or just convention
some bots have h! as their prefix
I wanna use 2 languages, and one should be with V and the other with v

Well, for example: if you use Vban, the bot will say "The user has been banned" and if you use vban, the bot will say "Utilizatorul a fost banat" (in romanian)
And so on for other commands
that's pretty cool tbh
hm, I guess that could work out
its an interesting way of doing things
thought most people have the same prefix and then have a command to swap the language of the bot
that would work tbh
Thanks for the approval
I chose not to have multiple languages, not because I'm too lazy but because I want to give people the opportunity to learn English 
a translation api could make that alot easier too
if there is such a thing```
google translate contradicts that statement
manual translation is always better
Google Translate sucks
A way to put a link in the end of a embed? In footer it doesn't work, i'm talking about that [Link](https://)
And i dont want to put a field for this, its ugly
like me
Hmm, is a program attempting to change locally contained root CAs normal?
How add Discord.js in github ? because have 100+ files : (
learn git
...
where ?
if(!message.guild.member(user).hasPermission("MANAGE_MESSAGES")) return;```
Cannot read hasPermissions or null
how can i do ?
permission with S
I think
Ah no
@earnest phoenix message.guild.members.get(user.id).hasPermission('')
@earnest phoenix don't add (user)
guild.member 
I mean
no its guild.members
uwu
now, I have
if(message.member.hasPermission("MANAGE_MESSAGES")) return;```
@earnest phoenix
same error
lol
what ?
do you have defined user?
yeah
to
message.author
okay
look
uh ?
message.guild.members.get(message.author.id).hasPermission('')
and ?
i put this ?
uh
or just message.guild.member.hasPermission('')
here, lets make it even bigger
client.guilds.get(message.guild.id).members.get(message.member.user.id).hasPermission('')

dont use what I just posted
i know
if you have message defined and the message in in a guild what he posted should work
i have this man
Since when do js libraries have guild.member
Let's also refrain from spoonfeeding
message.member
yes ik
bot.on('message', message => {
if(message.channel.type === "dm") return;
if(message.author.bot) return;
let server = message.guild.id;
const user = message.author;
if(message.guild.member.hasPermission("MANAGE_MESSAGES")) return;```
member with s
Just use user then
uh ok
yes
message.member returns a guild member
(That's why I didn't like d.js in the first place :^))
dont most libs separate users and guild members?
https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=member https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=hasPermission
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Its that the error
@earnest phoenix bot.on('message', message => { if(message.channel.type === "dm") return; if(message.author.bot) return; let server = message.guild.id; const user = message.author; if(!message.guild.members.hasPermission("MANAGE_MESSAGES")) return;
bot.on('message', message => {
if(message.channel.type === "dm") return;
if(message.author.bot) return;
let server = message.guild.id;
const user = message.author;
if(message.guild.members.hasPermission("MANAGE_MESSAGES")) return;```
@rugged kelp you need to install ms
also I think that's heroku
so idk how
I think you add it to your package.json
but not sure
@amber fractal yes it;s heroku and how to download ms ?
botdiscord/index.js:197 if(message.members.hasPermission("MANAGE_MESSAGES")) return; ^ TypeError: Cannot read property 'hasPermission' of undefined at Client.bot.on.message (/botdiscord/index.js:197:20) at emitOne (events.js:121:20) at Client.emit (events.js:211:7) at MessageCreateHandler.handle (/botdiscord/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34) at WebSocketPacketManager.handle (/botdiscord/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65) at WebSocketConnection.onPacket (/botdiscord/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35) at WebSocketConnection.onMessage (/botdiscord/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17) at WebSocket.onMessage (/botdiscord/node_modules/ws/lib/event-target.js:120:16)
at emitOne (events.js:116:13)
at WebSocket.emit (events.js:211:7)```
@earnest phoenix
Without s
i put s
Yes
Remove
The s
if(! message.member.hasPermission('MANAGE_MESSAGES'));
Just copy paste
why !
I do not want the negation, precisely, if the user has permission, he can make the command
! if its the member doesn't have manage message permission
Oh okay
Nice avatar
? Why because i have ms
npm install ms
npm i ms@latest
then youre doing it in the wrong directory
How to fix this ?
maybe you should use the actual token
How can I generate a bitfield from an array of permisssions?
Specifically I'm trying to generate an invite link given a set of permissions, in code.
It'd be calculated during runtime based on the requirements of each command
@opaque eagle lib?
Nvm, I figured it out... eris tho
oh
idk shit about eris lol
or bitfields all I know is that you can do some stuff in discord.js with an array of permissions
Why does this return null and how can make it send the shard statuses (Discord.js V12.0.0-dev)
shard.status doesn't exist
I think you're looking for WebSocketShard.status, in which case try ws.shards.map(e => e.status)
I've ran ws.shards.map(e => e.status) and it returns this: TypeError: Cannot read property 'status' of undefined
because shards is a collection of the Shard object
How would I do it then
magic
docs exist
this is what you need https://discord.js.org/#/docs/main/stable/class/Shard?scrollTo=fetchClientValue
bot can fetch audit logs ?
in djs
nvm its good
make the RichEmbed field not empty
oh god
message.channel is a huge channel object
might wanna do message.channel.name
what line do you use message.channel by itself on 
i wasnt talking about those lines..
idk
.addfield("Kicked In", message.channel)
.name ?
yes
step over each variable you use in the embed and see which one doesn't have a value
one of the main possibilities is the reason

args.join(" ").slice(22) lets me belive you are doing bad stuff
also your .find property takes a function not 'name', 'nameThatWasGiven'
so
message.guild.channels.find(channel => channel.name == 'nameYouWant');
the way with 'name', ... is the deprecated one
@rugged kelp When you are copying / writing code down from s viedo you might aswell contact the original creator
The best way to learn d.js https://discordjs.guide/
A guide made by the community of discord.js for its users.
Its OpenSource so many people keep it up to date and decide what the best way of doing it is
do u speak Spanish?
No
k
maybe google the error first?
all of these issues are easily solvable by just searching around on the internet for a bit
@rugged kelp there is literally something called "Error"
I'll give u a hint, if you read it maybe idk you could find the solution
canvas has a few dependencies you need to install before
either way, if that didn't work there is a really useful thing called https://google.com
Hmm, did anyone else notice a change in spambots?
NSFW porn links
They now pretend to link to Google main page
yeah the usual
But still link to NSFW
Off topic content
Oh, sorry
^
Assuming they're using js
Yep
how would you divide a message by its letters?
L i k e t h i s
split by an empty string, join by space
Ok
idk if its possible, but can you combine the
.split("")
with
.split(/ +/)
?
Because, otherwise, it counts the spaces too which doesnt work for the command im tryin to make
just... remove the existing spaces beforehand?
With splice..?
why would you want to splice the string
you'd want to replace (hint hint) every space in the string
Ok lol
hmmm
ill look into it more, it only works for the first space for some reason
Got it
Bad idea but loop through all server channels then send
- pretty sure some servers wouldn't want it
- what lazyneko said
Ye
yes
store the IDs of the selected channels from the opt-in
And for each newline send the next id
like
channel-id-1
channel-id-2
Since it's a newline
You can split by the newline
And send by file[1], and so on
I'm working on a sort of thing when you create a text channel name nb-posts it will send the post feed
talk with some of the servers though
since some of them i'm pretty sure wouldn't want that though
It will have a second opt in to put it as true
Also for those of you who were tryna split the string into letters, here's a really simple solution: js Array.from("Hello, world!") // ["H", "e", "l", "l", "o", ",", " ", "w", "o", "r", "l", "d", "!"]
I think Array.from is clearer
for someone that is wellversed with regexp, why this isn't working 
@sinful lotus https://regexr.com/
uwu
@sinful lotus good job uwu
a little dumb q since i can't think correctly
let commandFile = require(`./commands/${command}.js`); seraches /commands folder
Can I made it search folder that are in /commands folder?
like a /*/ ?
Yeah you will just have to tell it that's what you want.
Do you have express installed?
yes, otherwise it would throw a different error
according to the docs that is perfectly correct 
what are the best NoSQL databases for python?
mongodb is fine, as for best or not best idk
hmm, i already have some experience with mongo and have it set up locally and on my server, so i guess thats an option
mongodb is on fair to me not shabby not the very best
redis is kinda in memory db but havent used that so Im not sure how that works
but redis is fast because its in memory
but since its in memory
that could be your limitation
yeah, thats why i dont really want to use redis
me myself uses sql db so nothing much in store in what is the best nosql for me
mongo definitely seems like the best option for now
if(message.content == 'M!serverinfo'){
let embed = {
title: "Server Info",
icon_url: message.guild.iconURL,
color: 0x55ba53,
fields: [
{
name: "Owner",
value: message.guild.owner.user.tag
},
{
name: 'User',
value: message.guild.memberCount
},
{
name: 'servername',
value: message.guild.name
}
]
}
message.channel.send({embed})
}``` why the picture dosent work....
😮
that is literally what he is doing
He missed the js thumbnail: { url: message.guild.iconURL }
Which if he looked at https://anidiots.guide/first-bot/using-embeds-in-messages he would of noticed.
what kind of image?
Nsfw
no idea
And what about memes,kick, slap
just google "memes api" or "nsfw api"
Ok
https://discordapp.com/channels/264445053596991498/272764566411149314/591517402206830606 solution - delete the node modules folder and reinstall dependencies
if I go on the computer terminal and I run $ cd <my source bot> it tells me ** Permission denied**
Where is it stored
on Visual Studio
free
hello, how can I add a background to my server page?
I have 0 knowledge of coding and don't know how to use markdown.
yeah
like it says edit server page and it says I can use markdown but I don't know how to + other server pages look cool
use css
at the top of your description add <style></style> and inside the tags style your body.
so e.g.
<style>
body {
background-color: #910840;
}
</style>
Rest of description...
Would make your background some shade of purple.
body {
background: url("add your image url here.") /* other options */;
}
That link will take you to css tutorial on w3schools.
thank you so much!
What?
yeah
why doesn't it work?
yeah
it's not working for some reason
try a different image
Does it take time
Nah
I try color
not yet supported
hes doing a server description, not a bot description
oh, so what can I use?
Ah yeah my bad
yeah
That's a bot
that's a bot
I know
@tulip solar they are not using description
i think thats the actual guild banner from server boosting
mk lets do this
It's finna be something simple
EventLoader.js (unoriginal everyone uses this lmao)
const reqEvent = (event) => require(`../events/${event}`);
module.exports = bot => {
bot.on('ready', () => reqEvent('ready')(bot));
bot.on('message', () => reqEvent('message')(bot));
bot.on('reconnecting', () => reqEvent('reconnecting')(bot));
bot.on('disconnect', () => reqEvent('disconnect')(bot));
bot.on('guildCreate', reqEvent('guildCreate'));
bot.on('guildDelete', reqEvent('guildDelete'));
bot.on('guildMemberAdd', reqEvent('guildMemberAdd'));
bot.on('guildMemberRemove', reqEvent('guildMemberRemove'));
bot.on('guildBanAdd', reqEvent('guildBanAdd'));
bot.on('guildBanRemove', reqEvent('guildBanRemove'));
};
/event/message.js
const config = require('../config.json');
module.exports = msg => {
console.log(msg);
//if (!msg.author) return;
if (msg.author.bot) return;
if (msg.channel.type !== "text") return;
if (!msg.content.startsWith(config.prefix)) return;
let command = msg.content.split(' ')[0].slice(config.prefix.length);
let args = msg.content.split(" ").slice(1);
try {
let commandFile = require(`./commands/${command}.js`);
commandFile.run(bot, msg, args);
console.log(`${msg.author.tag} has used the ${command} command in ${msg.guild.name}.`)
} catch (err) {
return;
}
};
so the message.js doesn't see msg.author
and if i log the "msg" it outputs the channels 
well not only the channels but
What do the d.js docs say?
what should they say
i don't even know what to look for lmao
this is the first time it happened
it works perfectly in index.js
then you are probably running it wrong
if message logs channel
it means
- wrong event
- you are passing the event variable wrong
but Im certain you are on number 2
bot.on('message', () => reqEvent('message')(bot));
you didnt pass anything
probably you are even passing the bot variable which is wrong
Yup
as far as I can see your code is not classbased
Maybe bot.on('message', (msg) => reqEvent('message')(bot)); would do it
that would be still wrong
am i dumb
since the bot variable will be the message on message.js
bot.on('message', (message) => reqEvent('message')(bot, message))
// message.js
module.exports = (bot, message) => {}
will probably fix it
where in the first variable is your client, then the second is the message
yeah but that wont have the client on the message.js

commandFile.run(bot, msg, args); causing this to throw error
since bot is not defined
the fix I proposed on top
- Defines your bot properly
- Defines the variable message properly
bot.on('message', reqEvent('message'));
this will work because
reqevent('message')
is literally the same function on
client.on('message', () => {})
with the exception it is exported
basically you just replaced the () => {} with the required js file which is the same () => {}
That makes sense
newbies confuse the exports.stuff usually so the keyword on that is literally think of it as the same function but exported only.
not sure if I read past it or what, but what is the difference between bot-hell and the testing channels?
Can I test my bot in one or any of those?
Yup a lot of bots keep spewing weird stuff down there
why does bot hell even exist? lmao
ah okay, and it sounds like my bot was muted as it was responding to other bots... which is odd.. 🤔
I guess I can just add a check to ignore messages from BOTs, yea?
Yup that's all you need
I mean its not weird if you didnt put a check to ignore bot
bot.on('message', (message) => reqEvent('message')(bot, message))
// message.js
module.exports = (bot, message) => {}``` didn't work, it went thru without error, but command wasn't executed
console.log your message.js
ah gotcha, yes it isn't supposed to do anything with a bot, but I guess it could if they mimic stuff
and see where it stops
ill go update my code a second
also another thing I noticed
try {
let commandFile = require(`./commands/${command}.js`);
commandFile.run(bot, msg, args);
console.log(`${msg.author.tag} has used the ${command} command in ${msg.guild.name}.`)
} catch (err) {
return;
}
you will have a hard time debugging this
why
} catch (err) {
return;
}
because you dont do anything in error nor log it
ye already done with it
you should at least do console.error() there
so that you know when an error happens
yeah I believe it throws error when a command doesnt exist?
then I recommend to you to rewrite that and cache it in a map
is there some way to require(../commands/any_folder/${command}.js);
yeah, fs module of node.js
any folder as in it would go thru every folder looking for it
ty
np
Okay, I believe that is fixed now. Will it eventually get un-muted on its own or do I need to go do something?
Mention a mod
client.on('message', async message => {
if (message.author.bot) {
return;
}
....
Tell them you fixed it
Bot Id?
do people make discord bots in c or just js?
coolio, so now I can go try and test it in one of the bot channels? 😃
yes'
😃
Bot ID please
When I add files to github this message is automatically given
Ok
591346441453305856
@hexed wadi you can use literally any lang that can make http requests
ah oops, nvm that wont work
@sinful lotus 591346441453305856 this is Bot ID
Yes I know.
Why ? 😭
is it your bot?
Yes
... you made it look like you received a spam message, so weeb asked you for its id because spam bots are banned
Its a leaked token
ah figures
git ignore it
@rugged kelp Just resubmit and regenerate your token
.gitignore
since I highly believe thats a leaked token
no
Or private the repo
make another file .gitignore ```
botconfig.json
@crisp turtle Accept my friend requiest
?
yeah but you need to delete the botconfig from git first
QDont ping
where are you stuck?

How in discord.py could i use ctx. something to check if the user is a bot
If you are on rewrite+, you can use ctx.author
ctx.author.bot i think
And yeah, that would be correct, Kef
I don't even think bot commands would get past the command parser to begin with
So that won't even be true afaik
@slender thistle can you confirm that?
Past the command parser?
Does the commands extension trigger on other bots' inputs?
I'm checking the docs and I can't find anything about that
please don't randomly mention people
If you add node_modules to .gitignore, but then make a .gitkeep file in it, will it work or no
chill, there was a small raid, it will be ok
Did it finish ?
Yes, Keep this channel on the topic of bot development
Morning devs
@undone carbon Read my message
10 min in slow mode is much tbh
Not really
take it to #memes-and-media
What chnnel is img channel
there isn't an img channel, now get out of #development
await ctx.send('You cannot kick a this user')``` idk anymore
i want it to check if the user has the permission and if the user that was mentioned has the permissions they cannot be kicked
Why are you comparing a Member/User to a boolean
Yep, just not in #development please
member: discord.Member=None
One message removed from a suspended account.
One message removed from a suspended account.
that is the member part
but i wanted it to check if the MEMBER has those permissons
that was mentioned in the kick message
@commands.has_permissions(kick_member=True)
no
That should be the command which will check if they have permission automatically
await ctx.send('You cannot kick a this user ')```
@unique nimbus idk if you know what i mean
🤦 🤦 🤦 🤦 🤦
You are making an error message if they can't kick the member yes
i want it to check if the mentioned user !kick @randommmm is a moderator / have kick perms in that guild
and if that user do the ctx.message.author cannot kick that user by using the bot
@trail dagger You don't need to compare anything
Also, guild_permissions is a property of Member instance.
I'm giving you the answer and you're not accepting it
because i dont think you understand what i asked for
Thanks
😃
You want your kick command to be usable by a moderator or anyone who has kick permission. Is that correct?
No he wants the kick command to check if the person that is about to be kicked is a moderator
YES
Then you need to store the moderators role id
NO
Got it, thank you and I apologize. Either way, https://discordapp.com/channels/264445053596991498/272764566411149314/591632943189852180 is not how you do it.
You would only need to check for member permissions.
Or you can place the bot below the moderator role
If you want to check for kick permissions, would it not make sense to check for the actual permissions than role?
what library do you use
Hi all! Can you help me? How can i get last N messages form channel to array? (N is arbitrary number)
Anyway, discord.utils.get and https://discordpy.readthedocs.io/en/latest/api.html#discord.Member.guild_permissions are what you need
(However, you don't need to use == in your case.)
@proper inlet hey there what programming language
the 2nd stackoverflow question seems good
thank you
How do I get my BOT's image to update on the discord bot website? Does it only update every so often I guess?
It is already changed on the discordapi site and on my bot's actual image in the discord servers.
It may take a bit to update on the site
awesome, thanks!
This is not github support server, look on google if you have issue with github
heres some docs for it roman https://git-scm.com/docs/gitignore
i do not understand :/
the docs show how to use it
Translate the page


