#development
1 messages · Page 1196 of 1
how do i have it so the $set field updater in the docupdate is able to be changed by the (key) variable that is used in the command instead of being set to a rigid thing
TLDR: i want the command to be able to edit fields in a document
how can I use an iframe
for my bot site
<link href="https://modesta.alexflipnote.dev/css/modesta.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" href="https://dagbot-is.the-be.st/style.css" type="text/css">
<iframe id="botiframe" onload="setCampaignIframe('');" src="https://dagbot-site.herokuapp.com">
</iframe>
doesn't work
Thats all I [asted
@solemn leaf ment.activities.find(fn)
let ment = message.mentions.users.first();
let user = message.mentions.members.first()
@restive pebble
its an array
then u will only get first presence
and its not ment.presence.customactivity it should be ment.presence.activities
ment.presence.activities.customactivity
(<CustomActivity name='testing' emoji=None>, <Spotify title='Jack & Diane' artist='John Mellencamp' track_id='43btz2xjMKpcmjkuRsvxyg'>, <Activity type=<ActivityType.playing: 0> name='Visual Studio Code' url=None details='Editing userinfo.js' application_id=383226320970055681 session_id=None emoji=None>)
@restive pebble
thats not js
fine
[{"name":"Custom Status","type":"CUSTOM_STATUS","url":null,"details":null,"state":"testing","applicationID":null,"timestamps":null,"party":null,"assets":null,"flags":0,"emoji":null,"createdTimestamp":1598585890329},{"name":"Spotify","type":"LISTENING","url":null,"details":"Havana (feat. Young Thug)","state":"Camila Cabello; Young Thug","applicationID":null,"timestamps":{"start":"2020-08-28T04:04:02.870Z","end":"2020-08-28T04:07:40.176Z"},"party":{"id":"spotify:485987127809671168"},"assets":{"largeText":"Camila","smallText":null,"largeImage":"spotify:ab67616d0000b2736eb0b9e73adcf04e4ed3eca4","smallImage":null},"syncID":"1rfofaqEpACxVEHIZBJe6W","flags":48,"emoji":null,"createdTimestamp":1598587444786},{"name":"Visual Studio Code","type":"PLAYING","url":null,"details":"Editing userinfo.js","state":"Workspace: discordjs2","applicationID":"383226320970055681","timestamps":{"start":"2020-08-28T03:42:11.453Z","end":null},"party":null,"assets":{"largeText":"Editing a JS file","smallText":"Visual Studio Code","largeImage":"565944799576719366","smallImage":"565945770067623946"},"flags":0,"emoji":null,"createdTimestamp":1598586131594}]
that is the json.stringifyt
what are we even discussung
umm yeah
activities[0].status
wait CustomStatus is not a property of the first object in the array
activities[0].state
[0].details
CustomStatus is not a property of the first object in the array
And so is notstatus
Read the first object in the array
{"name":"Custom Status","type":"CUSTOM_STATUS","url":null,"details":null,"state":"testing","applicationID":null,"timestamps":null,"party":null,"assets":null,"flags":0,"emoji":null,"createdTimestamp":1598585890329}
so
wait
is there any property called status
I meant state
???
"state":"testing"
Oh you mean dnd and online states
Well...
client.on("presenceUpdate", (oldPresence, newPresence) => {
if (!newPresence.activities) return false;
newPresence.activities.forEach(activity => {
if (activity.type == "PLAYING") {
const guild = newPresence.guild;
let announcement = `Ebrywan ${newPresence.user.tag} just started streaming`;
let channelID = client.channels.cache.find(channel => channel.name.toLowerCase() === "streaming");
if (channelID) channelID.send(announcement);
console.log(`${newPresence.user.tag} is streaming at ${activity.url}.`);
let streamingRole = await guild.roles.cache.find(role => role.name === "temp");
console.log(newPresence.user)
newPresence.user.tag.addRole(streamingRole)
console.log(`${streamingRole.name} added to ${newPresence.user.tag}.`).catch(console.error)
};
});
});```
where do i put async???
var someObject = {
someProperty: "someValue"
}
someObject.someProperty; // "someValue"
@carmine summit put async keyword at the start of the callback function
why would you need to return false
that makes the callback function async
it's a boolean
@carmine summit put async keyword at the start of the callback function
where exactly?
var someObject = { someProperty: "someValue" } someObject.someProperty; // "someValue"
@solemn leaf read this and then try to figure out how to grab property X from object Y
in your case you want to grab property status from object smth
let status = {
"states":,
}
@carmine summit put async keyword at the start of the callback function
where exactly?
you can just add .someProperty
sigh
where exactly?
@carmine summit the callback function is the stuff you gave as a second argument in the client.on() function
so
client.on("smth", async () => {});
the callback function is now async
happy trails
sigh
@dusk vault ik i suck at explainations
and people suck at learning actual coding before developing bots
arrow function
arrow fns = bliss
hum?
yeah that
client.on("presenceUpdate", async (oldPresence, newPresence) => {
if (!newPresence.activities) return false;
newPresence.activities.forEach(activity => {
if (activity.type == "PLAYING") {
const guild = newPresence.guild;
let announcement = `Ebrywan ${newPresence.user.tag} just started streaming`;
let channelID = client.channels.cache.find(channel => channel.name.toLowerCase() === "streaming");
if (channelID) channelID.send(announcement);
console.log(`${newPresence.user.tag} is streaming at ${activity.url}.`);
let streamingRole = await guild.roles.cache.find(role => role.name === "temp");
console.log(newPresence.user)
newPresence.user.tag.addRole(streamingRole)
console.log(`${streamingRole.name} added to ${newPresence.user.tag}.`).catch(console.error)
};
});
});
``` The async error still exists
lol
where exactly?
noni
what async error
you dont need all to be async
await is only valid in async
just the function that contains await
thats all
because async functions return promises
Guys im using an api which returns promises and i need to put the data returned from promises into an embed, right now im nesting promises but i think its not the best way to do it? can u link me something which can help me not nesting 4-5 promises
await
whereeee
im confused as to where im going to put "async"
Here
not going to change your mind
;p
fully agree
hot tip: .catch can be replaced with try/await/catch
btw i solved the async problem
gg
docs :p
docs sucks
I learn by experience
unless they can't read docs @dusk vault
as only 10% of what you read, you remember
same
you don't have to remember the docs??
that's a heavily stupid argument
exactly like epixio said, refer to them when you need to
if you don't understand documentation it's a sign of a greater problem, i.e lack of knowledge
What's the code
Wondering if this is allowed. My bot uses channels that are intentionally set up to deny join permissions so the only way people can join that specific channel is by asking the bot to move them. But the only way the bot can move them if they don't have join permission is to be admin, unless I am mistaken. Is this allowed for the purposes of adding it to the bot list?
Yes
it requires the members to have ADMINISTRATOR?
No, the bot
cannot read property "roles" of undefined
cannot read property "add" of undefined
@carmine summit Did you debug it?
cannot read property "roles" of undefined
@carmine summit Did you debug it?
debug?
You know what debugging is right?
bet not

.catch(console.log(err)
nvm
I cant help you unless you show the code 
const role = await client.guild.roles.cache.find(role => role.name === 'temp');
console.log(newPresence.user)
var member = newPresence.user.tag
member.roles.add(role)
client.guild doesnt exist
oh
client.guild doesnt exist
@dusk vault it exist
no
no it doesn't
client.guilds not client.guild
no with a chance of 100%
Oh, he forgot the s
no he didnt
he needs a guild not a guildmanager
Ah
nope

its automatic, if the bot finds a user that has the "streaming" status
it will yeet the code
how is ur message variable called lol
lol
ok
learn to
i read and then i dont understand
listen mate
eh
you arent gonna be baby fed here

yes, yes I am
not by me.
Not by me
Not by me

not by anyone
._.
let ment = message.mentions.users.first() || message.guild.users.cache.get(args[0]) || message.author
let user = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.member
this right?
#rules-and-info 8a.
we got better things to do then answer what's written in detail on https://discord.js.org
the docs could answer any discord.js question
go search in there first
and maybe afterwards stackoverflow
or the other way around
but not like "oh im too lazy to read the docs cuz thier boring"
also the channel topic 
How do I make a bit on mobile
Bot*
lol
Tell me and I wont
You can use a VPS and an SFTP/SSH client
1st step prepare for headache
To write a bot on "mobile"
Ig you could
ik an app that lets you use node.js
as well as install npm packages
i think only android supports that
rip
Issues : https://github.com/tempage/dorynode
(please open the issue in github, not in email. we are ALL developers :)
upgrade node.js : 'download file' menu -> check 'appfiles' -> check 'executable'
v6.12.3 arm : https://dorynode.firebaseapp.com/v6.12.3_arm_release/node...
if u really want to code on mobile
and ur not on ios
Cos you didn't check whether the user is really listening to spotify or not
Discord is gonna speed up as there will be less bots applying
rip me
ik
ummm i havent found the solution in docs
h o w
Does spotipy work well?
orrrrr I don't know how to read 😛
Like can I use it as a music thing?
he is just waiting for that spoon
what were you trying to find @carmine summit
ig nothing then
`${moment.utc(ment.joinedAt).format('dddd, MMMM Do YYYY, HH:mm')}`
why does this return the current time?
Hi guys, I got a small problem on my cog file to have the member count functionnal.
my code : https://hastebin.com/tuyewisaxa.py
my error : https://hastebin.com/uzanoxusip.sql
Can anyone help me on python ?
@earnest phoenix
if (user.user.presence.activities.find(a => a.type === "CUSTOM STATUS"))
ah sorry
well technically attending zoom classes but you could say i am in school
should i learn C#
can anyone help me please?
https://drive.google.com/drive/folders/17WJUVIyk1jwyq5xpcibgvdUoNhCKb65-?usp=sharing
what do you program?
A ranking system
the font file cannot be parsed
check the font file
yeah
show the code here
don't show a picture of me show your actual code of the font file
ok give me a sec
code can you help real quick
code can you help real quick
@solemn leaf with what
`${moment.utc(ment.joinedAt).format('dddd, MMMM Do YYYY, HH:mm')}`
why does this return the current time?
im trying to get when they joined the server
will are be able to give me economy bot infrastructure?
newPresence.roles.add(roleer)
cannot read property "add" of undefined...
const Discord = require("discord.js");
const client = new Discord.Client();
const Canvacord = require("./package_modules/canvacord");
const fs = require("fs");
client.db = require("quick.db");
client.canvas = new Canvacord();
client.commands = new Discord.Collection();
client.cooldown = new Discord.Collection();
client.config = {
TOKEN: "Token",
prefix: ">",
cooldown: 15000
};
fs.readdir("./commands/", (err, files) => {
if (err) return console.error(err);
files.forEach(f => {
if (!f.endsWith(".js")) return;
let command = require(`./commands/${f}`);
client.commands.set(command.help.name, command);
});
});
client.once("ready", () => {
console.log("Ready!");
});
client.on("error", console.error);
client.on("warn", console.warn);
client.on("message", async (message) => {
if (!message.guild || message.author.bot) return;
xp(message);
if (!message.content.startsWith(client.config.prefix)) return;
let args = message.content.slice(client.config.prefix.length).trim().split(" ");
let command = args.shift().toLowerCase();
let commandFile = client.commands.get(command);
if (!commandFile) return;
commandFile.run(client, message, args);
});
function xp(message) {
if (!client.cooldown.has(`${message.author.id}`) || !(Date.now() - client.cooldown.get(`${message.author.id}`) > client.config.cooldown)) {
let xp = client.db.add(`xp_${message.author.id}`, 1);
let level = Math.floor(0.3 * Math.sqrt(xp));
let lvl = client.db.get(`level_${message.author.id}`) || client.db.set(`level_${message.author.id}`,1);;
if (level > lvl) {
let newLevel = client.db.set(`level_${message.author.id}`,level);
message.channel.send(`:tada: ${message.author.toString()}, You just advanced to level ${newLevel}!`);
}
client.cooldown.set(`${message.author.id}`, Date.now());
}
}
codeblocks
sorry
It's back ticks
ARGHHHHHH
// code
newPresence.roles.add(roleer)
cannot read property "add" of undefined...
let roleer = await guild.roles.cache.find(role => role.name === 'temp');
const Discord = require("discord.js");
const client = new Discord.Client();
const Canvacord = require("./package_modules/canvacord");
const fs = require("fs");
client.db = require("quick.db");
client.canvas = new Canvacord();
client.commands = new Discord.Collection();
client.cooldown = new Discord.Collection();
client.config = {
TOKEN: "Token",
prefix: ">",
cooldown: 15000
};
fs.readdir("./commands/", (err, files) => {
if (err) return console.error(err);
files.forEach(f => {
if (!f.endsWith(".js")) return;
let command = require(`./commands/${f}`);
client.commands.set(command.help.name, command);
});
});
client.once("ready", () => {
console.log("Ready!");
});
client.on("error", console.error);
client.on("warn", console.warn);
client.on("message", async (message) => {
if (!message.guild || message.author.bot) return;
xp(message);
if (!message.content.startsWith(client.config.prefix)) return;
let args = message.content.slice(client.config.prefix.length).trim().split(" ");
let command = args.shift().toLowerCase();
let commandFile = client.commands.get(command);
if (!commandFile) return;
commandFile.run(client, message, args);
});
function xp(message) {
if (!client.cooldown.has(`${message.author.id}`) || !(Date.now() - client.cooldown.get(`${message.author.id}`) > client.config.cooldown)) {
let xp = client.db.add(`xp_${message.author.id}`, 1);
let level = Math.floor(0.3 * Math.sqrt(xp));
let lvl = client.db.get(`level_${message.author.id}`) || client.db.set(`level_${message.author.id}`,1);;
if (level > lvl) {
let newLevel = client.db.set(`level_${message.author.id}`,level);
message.channel.send(`:tada: ${message.author.toString()}, You just advanced to level ${newLevel}!`);
}
client.cooldown.set(`${message.author.id}`, Date.now());
}
}
⋯⋯
Hi guys, I got a small problem on my cog file to have the member count functionnal.
my code : https://hastebin.com/tuyewisaxa.py
my error : https://hastebin.com/uzanoxusip.sql
Can anyone help me on python ? please, I have been stuck on this for 24h now
How can I build the economy bot or is there any infrastructure or something?
wait
why are you running this command
in your index
if you have a command handler
this looks like a command handker
fs.readdir("./commands/", (err, files) => {
if (err) return console.error(err);
files.forEach(f => {
if (!f.endsWith(".js")) return;
let command = require(./commands/${f});
client.commands.set(command.help.name, command);
});
});
this looks like a command
function xp(message) {
if (!client.cooldown.has(`${message.author.id}`) || !(Date.now() - client.cooldown.get(`${message.author.id}`) > client.config.cooldown)) {
let xp = client.db.add(`xp_${message.author.id}`, 1);
let level = Math.floor(0.3 * Math.sqrt(xp));
let lvl = client.db.get(`level_${message.author.id}`) || client.db.set(`level_${message.author.id}`,1);;
if (level > lvl) {
let newLevel = client.db.set(`level_${message.author.id}`,level);
message.channel.send(`:tada: ${message.author.toString()}, You just advanced to level ${newLevel}!`);
}
client.cooldown.set(`${message.author.id}`, Date.now());
yes it is
No, that's just for loading all files inside a dir to a map.
🤔
whihc would be okay
What?
unless you doing that to only save
ya
okay
why did u store your node modules into google drive
^^^
dont ask
I mean you can
i wont...
I ask 21 djs friends
its just a waste of storage
I upload it to drive 😂
git
wow
Here
const Discord = require("discord.js");
const client = new Discord.Client();
const Canvacord = require("./package_modules/canvacord");
const fs = require("fs");
client.db = require("quick.db");
client.canvas = new Canvacord();
client.commands = new Discord.Collection();
client.cooldown = new Discord.Collection();
client.config = {
TOKEN: "Token",
prefix: ">",
cooldown: 15000
};
fs.readdir("./commands/", (err, files) => {
if (err) return console.error(err);
files.forEach(f => {
if (!f.endsWith(".js")) return;
let command = require(`./commands/${f}`);
client.commands.set(command.help.name, command);
});
});
client.once("ready", () => {
console.log("Ready!");
});
client.on("error", console.error);
client.on("warn", console.warn);
client.on("message", async (message) => {
if (!message.guild || message.author.bot) return;
xp(message);
if (!message.content.startsWith(client.config.prefix)) return;
let args = message.content.slice(client.config.prefix.length).trim().split(" ");
let command = args.shift().toLowerCase();
let commandFile = client.commands.get(command);
if (!commandFile) return;
commandFile.run(client, message, args);
});
function xp(message) {
if (!client.cooldown.has(`${message.author.id}`) || !(Date.now() - client.cooldown.get(`${message.author.id}`) > client.config.cooldown)) {
let xp = client.db.add(`xp_${message.author.id}`, 1);
let level = Math.floor(0.3 * Math.sqrt(xp));
let lvl = client.db.get(`level_${message.author.id}`) || client.db.set(`level_${message.author.id}`,1);;
if (level > lvl) {
let newLevel = client.db.set(`level_${message.author.id}`,level);
message.channel.send(`:tada: ${message.author.toString()}, You just advanced to level ${newLevel}!`);
}
client.cooldown.set(`${message.author.id}`, Date.now());
}
}
the font file its loadin is fucked
Hi guys, I got a small problem on my cog file to have the member count functionnal.
my code : https://hastebin.com/tuyewisaxa.py
my error : https://hastebin.com/uzanoxusip.sql
Can anyone help me on python ? please, I have been stuck on this for 24h now
there needs to be a catch and / or finally block
thank
why does this always run
if (args.join('').toLowerCase().includes('token')) {
return;
}
idling around here waiting for someone to ask for help
if (args.join('').toLowerCase().includes('token')) {
return;
}
@solemn leaf that's actually a smart idea
what the hell
no it isn’t
you can put code blocks inside quotes in discord pc
?
in my opinion it is
what if other code includes token
wait it is a good idea?
I have a question. Maybe you can help? I am building a server on discord and I want to use bots to control rooms. Where do I learn about bots and how to use them?
just don’t eval your token
@misty sigil dude all my code requires the token from the config file
and only index requires config
https://discord.js.org is a good place to get started
https://discordjs.guide is even better
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Thanks Users
WHICH EVERYONE SHOULD DO
Guys why are you telling him to learn js if he already has some code that's just being a dick
not him
O

callum has lost his mind ig
understandable have a nice day
I always get rate limited by YouTube
When I use YouTubeV3 API
cuz
How to solve it
Because there is a daily quota
if they don't rate limit
don’t use the api
they'll die
And if you go over said quota
I don't know how to use Lavalink
@delicate shore apply for more or buy more
don’t use the api
@misty sigil MEE6 does for music searching and stuff
or ffmpeg
@misty sigil
We can search with it ?
well they can pay for more quota can’t they
no you need link
Use jsguide?
They probably have their quota increased, yeah
Every music bot breaks YouTube tos and if YouTube addressed it then every YouTube bot will die
yes
@delicate shore there’s a search module too
give
Every music bot breaks YouTube tos and if YouTube addressed it then every YouTube bot will die
@golden condor WHAT THE HELL
now
@delicate shore there’s a search module too
@misty sigil
Can u gimme link thanks
@misty sigil NOW
tjhe fuck
what
I used the run button on code sample on Google’s website and it said I hit daily quota
we won't spoonfeed
just look it up
https://npm.im/yt-search
@golden condor
Ah this thing sucks.
no it just scrapes
I used this but it sucks
If you are rate limited there then you're fucked my friend
h
nice
Hi guys, I got a small problem on my cog file to have the member count functionnal.
my code : https://hastebin.com/tuyewisaxa.py
my error : https://hastebin.com/uzanoxusip.sql
Can anyone help me on python ? please, I have been stuck on this for 24h now
I would have to read the output
and do what I did at the top
but immma
go to my testing server
dude
so I dont have to keep regen my token
don't repeat the same questions @leaden lake
What I wanted is to set a role for a user if he/she starts streaming, and send a message in #streaming. But I keep getting this error that TypeError: Cannot read 'add' of undefined
```js
client.on('presenceUpdate', (oldMember, newMember) => {
const guild = newMember.guild;
const streamingRole = guild.roles.cache.find(role => role.id === 'streamer');
if (newMember.user.bot) return;
if (newMember.user.presence.activities.streaming) { // Started playing.
let announcement = Ebrywan ${newMember} just started streaming;
let channelID = client.channels.cache.find(channel => channel.name.toLowerCase() === "streaming");
if (channelID) channelID.send(announcement);
newMember.roles.add(streamingRole)
console.log(${streamingRole.name} added to ${newMember.user.tag})
}
});```
it won't make us respond faster
evalled.replace() replaces it tho iirc
uhm
@carmine summit roles is undefined
uhm
@leaden lake You can literally remove the first few lines where you do the manual request
so I dont have to keep regen my token
@solemn leaf make eval owner only..?
newMember.roles.add
it is
then why are you
the hell
trying to hide token
Then just don’t eval your fucking token
@carmine summit its not member that is user
just don’t eval token
Aki doesn't trust himself
newMember.member


I dont lmao
@slender thistle so how to do the request ?
eval is fun
You already have update_stats that runs every 3 minutes
newMember.member
ill try this
it runs the request I typed higher in the code ?
yeah
Eval is the best way to get hacked
bots can be in many guilds and how can u add role to user just my member
You're sending the same type of request twice. Except your manual request with requests doesn't actually send the proper request
Oh, good lord, that's for getting the stats
bot.guilds.cache.get("X").members.cache.get("Y").roles.add("Z");
@carmine summit
umm yeah
so this happened
let role = bot.guilds.cache.get("W").roles.cache.find(X => {X.name == "streamer"});
strea,er
@slender thistle but my error is in this line await self.dblpy.post_guild_count()
I'm blind
yeah
Just remove the self.guild_count() parameter
post_guild_count will automatically get length of client.guilds and post it
Passing a function that does the same is pointless
the hell
bruh
the robots are coming after us
it needs to be your guild ID
i wont help then
why tho

it needs to be your guild ID
how to i do this

the Run button is not showing Stop and when I press it it says your program is already running please stop it first but how do I stop it if the Stop button is showing Run
even tried typing process.exit(); in the node repl but it didn't do anything
LEARN
ACTUAL
CODE
BEFORE
MAKING A BOT
Tone it down
no
CODE
NINE ONE THREE
We're here to help, not yell at people
the hell
If you're not willing to actually help, stay away from this channel.
w3schools doesn't have Discord tutorials
no
please
he means learn js
it has js tutorials
-id
An ID is a unique number which is used to identify a user, bot, channel, or message. To obtain an ID, right click on it and click "Copy ID"; this can be done from mobile by holding down.
Should you not see the option to acquire an ID, you need to enable "Developer Mode" which can be done from your user settings, under "appearance".
Get your server's ID
logger.info('Posted server count ({})'.format(self.dblpy.guild_count())) so must I delete on this line ? bc on the await self.dblpy.post_guild_count() I don't have any self.guild_count()
and copy paste it in there
replace the "W" "X" and all that jazz with the proper ids
I'm having a breakdown here, give me a second @leaden lake
do you want I send my entire code ?
https://hastebin.com/tuyewisaxa.py in this snippet that you sent, line 29, you had await self.dblpy.post_guild_count(self.guild_count())
I asked you to remove the self.guild_count() there
self.dblpy.guild_count() is fine because it gets the guild_count method from the DBLClient class
attack of the Read Evalute Process Loops
why tho
client.on('presenceUpdate', (oldMember, newMember) => {
console.log(newMember)
const guild = newMember.guild;
let role = client.guilds.cache.get("69987*****25936680").roles.cache.find(X => {X.name == "streamer"});
if (newMember.user.bot) return;
if (true) { // Started playing.
let announcement = `Ebrywan ${newMember} just started streaming`;
let channelID = client.channels.cache.find(channel => channel.name.toLowerCase() === "streaming");
if (channelID) channelID.send(announcement);
newMember.member.roles.add(role)
}
});```
why would you want my guild id
I regen ?
and give it to me 
I try the cog on a bot not listed on topgg, but the key is from a bot listed on topgg
@carmine summit running a quick docs search brb in a second
That's the problem
The module gets .user.id of the bot object that you pass in DBLClient
and since there's no bot listed under that ID, the top.gg API returns a 403 error
okay so let's try this code on my py file of my bot right lmao
if the js lib had that I’d be annoyed lmao
const response = await this._request('post', 'bots/stats', data, true);
you're telling me I could just send a request to bots/stats under a token and it would work?
Fucking Christ
They're just like GET except you can have request body with POST
Nice
it’s a get but with bodies
@slender thistle Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\client.py", line 312, in _run_event await coro(*args, **kwargs) File "c:/Users/Shaal0wFR/Desktop/Bot Discord/Unconnected Bot [FINISH]/unconnectedbot.py", line 155, in on_message await message.delete() File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\message.py", line 762, in delete await self._state.http.delete_message(self.channel.id, self.id) File "C:\Users\Shaal0wFR\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\http.py", line 221, in request raise Forbidden(r, data) discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
lemme go setup some mongodb stuff and restart my bot
Yeah, that's...
an issue with permissions for your bot
🤔 An error when trying to delete a message. Are you trying to delete someone else's message or your bot's?
in this channel ? the #development channel ?
nvm
Can I be more lazy to move from quick.db to mongodb?
class db {
get(stuff){
stuff = stuff.split(".");
let dbName = stuff[0];
let collectionName = stuff[1];
return client.db(dbName).collection(collectionName);
}
}
"that channel" = wherever you're trying to delete the message from
this code returns the record if the field in my document exists. How do i have it return if it doesnt find a document with a field with that input
idk, server owners can change permissions, but I put the administrator perms
findOne should return a falsey value if a document wasn't found @worthy glacier
use findOne and async/await
idk, server owners can change permissions, but I put the administrator perms
@leaden lake that's the case here. The bot doesn't have the permission to delete other users' messages
how to fix the problem ?
@carmine summit running a quick docs search brb in a second
@earnest phoenix 🤔
so how do i have it exit if it fdins that falsey value?
just print an error or something when that happens
it's impossible to fix the problem
Correct
The good workaround is actually checking for the bot's permissions before trying to delete a message
find returns a cursor, not the output
use findOne and async/await
you can check the size with countDocuments as well
instead of fetching the actual document
Would findOne be more performant than countDocuments though? 🤔
so I must to check if the bot get the manage messages perms, and if he don't, what must I do ?
Catch the error and return
simply return or something
actually not really shiv, findOne still returns the document anyways
so if its not indexed/cached, it will still need to obtain the document itself
@slender thistle just asking Can u accept my bot ?
But it returns when a first occurence is found, no?
okay
:((
which is basically the reason for my assumption
-upto @earnest phoenix
@earnest phoenix
The average up-to-date approval times are stated here.
This does not mean it will take the same amount of time someone else's bot took to be reviewed and does not mean your bot is guaranteed to be reviewed within that time frame.
There is no exact time for how long bot approval will take.
There is a queue and you're not first, nor are you last.
Oh, you can limit it
bruh i know
should be the same for the python driver as well
Yeah, that would make more sense then
@earnest phoenix yes ok great, short answer is you don't get to choose nor the mods get to choose
k
so how do i have it work as long as the key exists in the document
with whatever value for the key
Anyone knows how to import a folder in Glitch?
by uploading it?
also if you’re using glitch for bot hosting then just don’t

read this: any """""""""""free""""""""""" hosting is either:
- not intended to be used as hosting for bots
- not actually suitable for hosting for bots
- not actually free
- will get your token stolen
- all of the above
So how can I have my bot online 24/7 for free?
You don’t.
heroku
you need to pay for a VPS
but only for 22days
@earnest phoenix heroku isn’t 24/7
Not 24/7 is it
ok ok

24/24
Or you can host on your pc
this is a viable solution for me:)
woah you mean bot dev™️ hayper the bot dev™️ home hosts bots that hayper the bot dev™️ devs?
@slender thistle https://hastebin.com/siricapodu.coffeescript is that good ?
Your bot type?
yes but it’s stupid inefficient
lol
Ahhhh
unless you have a massive setup you’re not gonna get anywhere mining
@thick gull model 3, model 4 should be enough
hwo much is one pi 4
A - C - E
wut
You dont have a hosting company to host your bot?
heroku
idc about restart in every 25h
Heroku isn’t meant to host bots
tell me why it is bad
they bannwd me for bots
read this: any """""""""""free""""""""""" hosting is either:
- not intended to be used as hosting for bots
- not actually suitable for hosting for bots
- not actually free
- will get your token stolen
- all of the above
- Not recommended, bot token is ALWAYS GETTING STOLEN
dont use herohu
and save as Matthew Said
trygoogling.it < I want this domain now
*same
Get it then you twit
sorry I don’t have money
So what will happend if i get my token from databsd
😔
Your bot gets hacked
then we all say goodbye to the bot
unless you make a new token
So what will happend if i get my token from databsd
@earnest phoenix it’ll still be in plaintext in the ram
and your account probably
Bro
?:(?
imma go back to my vps
im so confused
I host my bot for only $2 dollars with 1GB storage and 600 mb ram
whre
GoFreshStart
Proudly Independent Hosting Services at Affordable prices. That's FreshStart.
Here.
imma get notes drom that
theres free decent hosting services that are legit and free
Like what.
ye google cloud is good
No.
low disk speed
all of us are broke
low ram
but free :))
just pay for a $3 / mo VPS
does aws good ?
put some investment into your bot smh
but matt its good enough for a simple bot
Hello can i get help?
but you’ll have to move
This is freshstart
@elfin tulip https://dontasktoask.com
const client = new Discord.Client()
const Gamedig = require('gamedig');
const {MessageEmbed} = require('discord.js');
let e = new MessageEmbed();
Gamedig.query({
type: 'fivem',
host: '185.80.130.73'
}).then((state) => {
e
.setColor("#00FF00")
.setDescription("HAHA: {maxplayers}");
return message.channel.send(e);
}).catch((error) => {
console.log("Server is offline");
});```
I have problem with this code
;\
What is the error
ReferenceError: Discord is not defined
gamedig ?
Yes
well the thing is not everyone are serious bot makers or willing to maintain their bots for an extended period of time
never heard about it
@elfin tulip check out the example on how to make a bot over at https://discordjs.guide/creating-your-bot/#creating-the-bot-file
Yes, cause some tutorials that he follows can be different
and compare that of yours
can be
@golden condor your calling
@thick gull wut
It is not
const discord, const bot, const client, const [botname], const [yourname]
const {MessageEmbed, Client} = require("disocrd.js")
const client = nee Client()
@thick gull wut
@golden condor code was using quickdb and mongo
@leaden lake No, not really. I suggest you use message.channel.permissions_for(message.guild.me).manage_messages. That will get you the permissions in the specific channel
const Discord = require("Discord.js")
const bot = new Discord.Client()
smae
Like that
Ok?
but gusy understand iy
okay thx
Hi, what is the type of the announcement channel for liste them ?
there is : "text", "voice" and "category"
news
what library are you using?
in discord.js, these are the ones that are available
discord.js
@slender thistle my bot doesn't want to upload the svg file. It only upload the png file. And the png file doesn't want to show me the server count
how to make my bot online always
get a cheap vps and use a process manager
im making my own bot for my server
you can just run the code everytime but you computer must be on
@pale vessel can u explane it how. because im new in it
i will do the live in the general vc
will u explain me?
i'm busy right now, sorry
@everyone can anybody help me??

what is that ⬆️
at RequestHandler.execute (C:\Users\user\Desktop\Setup Bot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
method: 'get',
path: '/users/2732563712136970290',
code: 10013,
httpStatus: 404
}``` error which i am getting any help?
@small prairie 8b
What?
huh pls help
at RequestHandler.execute (C:\Users\user\Desktop\Setup Bot\node_modules\discord.js\src\rest\RequestHandler.js:170:25) at processTicksAndRejections (internal/process/task_queues.js:97:5) { method: 'get', path: '/users/2732563712136970290', code: 10013, httpStatus: 404 }``` error which i am getting any help?
@ivory seal the ID of the user is wrong?
oh wait
bot doesnt have that user accessible?
hey, how do I find in which args[n] a specific word .includes()?
you could use a loop?
any other easiest way?
Yep, that's what I was looking for, thnks
spoonfeed
how does pagination work someone teach brain small
An array of paginated contents/elements
so does it basically cut a string every x letters and then puts it in an array? so like command 2 would be the 2nd part in it?
For example, if you want to paginate an array like [1, 2, 3, 4, 5, 6] through each 3rd element, you would want to get [[1, 2, 3], [4, 5, 6]]
Okay
Idk I’m just thinking about stuff right now lol
I assume JS?
Yeah
array[0][2]
k
let s = "mycoolstring"
let i = 0;
let l = [];
while (i <= s.length) {
l.push(s.substring(i, i+4));
i += 4;
}
console.log(l)
``` try this
4 in this case is by how many characters to paginate the string
I'll be honest, I don't know whether to use while or for loops in such cases 🤔
Oh, wait, you can just add 4 to i in JS' for
What's that IP
Is it urs?
No
Then its fine
Thats game server ip lol
Its weird to see ips nowadays and not domains
Some server dont have domains some have
Yo I'm using mysql in python but just want to ask - Do I need to await my execute functions?
like await db.execute or just db.execute
how can the bot change the name of a guild?
Depends what lang you are using
node.js
Let me ask you what you need this for
umm i am Trying to make a setup bot
so u invite it and it sets up ur server in an easy way
Preferably just leave the message that pinged undeleted so that I don't have to dig through guesses and snipes to guess why I got pinged 
hyperlinks can be used only in embeds?
Yes, embed description and field value
nvm i got it
good luck finding them
i wants coder yes
var m = await msg.channel.send(`**${msg.member}, Am găsit următoarele video-uri:**\n${videos.map(v => `**${videos.indexOf(v) + 1}.** ${bot.util.escapeHtml(v.title).replace('**', '\**')}`).join('\n')}`);
shouldn't this escape v.title?
https://alex.is-bad.com/JBFT9if.png
between that P and i there's a **
use .replace(/\*/g, "\\*")
you need two \
regex allows it to replace multiple occurrences
thank you so much
hello :) is there a faster way of running my discord bot, instead of running it - it is online - i find a bug - i have to fix it - i close my vsc and restart it so the bot goes offline?
i wants coder yes
@topaz saddle lmfao i was joking
we bamboozled each other
yus
whitenames



