#development
1 messages Β· Page 1377 of 1
is it possible to have a bot add a bot?
Imagine bots inviting bots.
@solemn latch pretty normal
there would be more bots than people in discord
^
at some point
@blissful coral no stop
Killing the dream
a bot cant create an application, but somehow tupper box can create his children of bots
and you can go over the 32 bot limit for him
so idk
does anyone has experience with basic react native, and is willing to help me a litte?
@stark abyss https://dontasktoask.com
state = {
teamScore: 0
}
<TouchableHighlight
onPress={() => {
alert('Alert Message!')
}}
>
<Text style={{color: 'green'}}>
{this.state.team1}: Goal
</Text>
</TouchableHighlight>```
I want to change the teamScore value in a touchable highlight component not sure how
;-;
wait Tupper Box uses webhooks
is there any way for a bot application to add a bot application
no
How is the key to leave a space of an empty embed field without returning undefined?
Its something specific. Lemme google it.
Oh hey, finally figured out why it was so specific.
https://www.fileformat.info/info/unicode/char/200b/index.htm
Get the complete details on Unicode character U+200B on FileFormat.Info
sounds like your webhook code is repeating itself in a loop or an event
and also this
this is my code
dbl.webhook.on('ready', hook => {
console.log(Webhook running at http://${hook.hostname}:${hook.port}${hook.path});
});
dbl.webhook.on('vote', vote => {
console.log(User with ID ${vote.user} just voted!);
con.query(UPDATE USERDATA SET LASTVOTE=${Date.now()} WHERE DISCORDID=${vote.user};);
});
You can only have 10 webhooks made per channel or guild can't remember
I think you are trying to do something that you aren't allowed to
if(!voiceChannel) return message.channel.send("You need to be in a voice channel to place music.");
const permissions = voiceChannel.permissionsFor(message.bot.user);```
it's saying 'user' is undefined, did I do something wrong?
Its saying what your using user on is undefined I believe.
Message.bot doesn't exist
I think you were looking for message.client
Can anyone help me to make my bot?
I can help with errors or specific problems
Not sure i can dedicate enough time to help you with an entire bot
@golden olive What language do you know?
@stark abyss english and hindi
@stark abyss english

Step 1) learn a programming language
Step 2) choose a library in that language
Step 3) actually start writing the bot
Step 4) ask for specific help if you need it
@golden olive if you don't even know what a programming language is, we can't help you.
Learn basic js or python before starting. If you learn js https://discordjs.guide/
Hi
Hello
no that's djs if you do learn js that can be helpful
@golden olive Useful links for learning JavaScript and Node:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
If he reads the first page you linked to it will tell him to learn js first
What time is duration of verification?
what verification
5+ weeks
4 - 8 weeks.
Ok
Officially 5+
Thanks
o ok
@golden olive Useful links for learning JavaScript and Node:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
@umbral zealot i have to learn all this things ??
A good chunk of them
state = {
teamScore: 0
}
<TouchableHighlight
onPress={() => {
alert('Alert Message!')
}}
>
</TouchableHighlight>```
I want to change the teamScore value in a touchable highlight component not sure how
@stark abyss
You have to learn a language yes
Programming isn't something you learn overnight
and that takes more than 5 minutes.
I'm years in and I still learn daily
It will take a few weeks or months before you get used to it.
@stark abyss honestly I don't think anyone here can help you with react or react native. I'd suggest you join the /reactiflux community instead, they have a lot of people that can help.
Aight okay thx
@umbral zealot I can't find "reactiflux" server, can you dm a invite?
found it
npm install -g ffmpeg-binaries
Even though I installed the above, its says the following
FFmpeg/avconv not found!
did you install ffmpeg?
Yes.
Wait no
you need to install it
that only install the required lib for node
npm install ffmpeg
Please help me to make my botπππ
Please help me to make my botπππ
@golden olive Please watch a YouTube video.
@feral aspen link please?
We linked you literally 15 sites to learn
Search How to create a Discord Bot V12
the fuck
When you forgot to use ` and use " instead
Every platform i use " except discord
Come on, don't eww me
Kinda weird.
Can someone help me
Depends on the question

You want to make a bot?
Yes
What lang do you know
What is a lang
Step 1) learn a programming language
Step 2) choose a library in that language
Step 3) actually start writing the bot
Step 4) ask for specific help if you need it
JavaScript... Python, Java.. you know
Which not can play music
They can all do it
Error: input stream: Could not find player config.. π€― AHHH
Do I need to make a new discord acount
No.
What do I need to do
And idk programming language
Then learn one
step 1: learn a language
You'll have to learn
javascript or python is fine
Can anyone let me know why it doesn't seem to play. This is the error I am getting. Error: input stream: Could not find player config
without learning you will just be relying on people to spoonfeed you
Owo money
if(!voiceChannel) return message.channel.send("You need to be in a voice channel to place music.");
const permissions = voiceChannel.permissionsFor(message.client.user);
if(!permissions.has("CONNECT")) return message.channel.send("I do not have permission to connect to the voice channel.")
if(!permissions.has("SPEAK")) return message.channel.send("I do not have permission to speak in the voice channel.")
try {
var connection = await voiceChannel.join()
} catch (error) {
console.log(`There was an error connecting to the voice channel. ${error}`)
return message.channel.send("There was an error connecting to the voice channel.")
}
const dispatcher = connection.play(ytdl(args[0]))
.on('finish', () => {
voiceChannel.leave()
})
.on("error", error => {
console.log(error)
})
dispatcher.setVolumeLogarithmic(5 / 5)```
Owo money
Hello?
@feral aspen hey
Hi.
i forget if that affects async stuff
Owo cf all
Like this?
Umm owo game off?
why are you spamming random shit in #development
if(!voiceChannel) return message.channel.send("You need to be in a voice channel to place music.");
const permissions = voiceChannel.permissionsFor(message.client.user);
if(!permissions.has("CONNECT")) return message.channel.send("I do not have permission to connect to the voice channel.")
if(!permissions.has("SPEAK")) return message.channel.send("I do not have permission to speak in the voice channel.")
try {
var connection = await voiceChannel.join()
} catch (error) {
console.log(`There was an error connecting to the voice channel. ${error}`)
return message.channel.send("There was an error connecting to the voice channel.")
}
try {
const dispatcher = connection.play(ytdl(args[0]))
.on('finish', () => {
voiceChannel.leave()
})
.on("error", error => {
console.log(error)
})
dispatcher.setVolumeLogarithmic(5 / 5)
} catch (error) {
console.log(error)
}```
Like that?
To a voice channel.
How do you track if something is a number or just letters in javascript?
In this case msgArguments
const voiceChannel = message.member.voice.channel;
if(!voiceChannel) return message.channel.send("You need to be in a voice channel to place music.");
const permissions = voiceChannel.permissionsFor(message.client.user);
if(!permissions.has("CONNECT")) return message.channel.send("I do not have permission to connect to the voice channel.")
if(!permissions.has("SPEAK")) return message.channel.send("I do not have permission to speak in the voice channel.")
try {
const connection = await voiceChannel.join()
const dispatcher = connection.play(ytdl(args[0]))
.on('finish', () => {
voiceChannel.leave()
})
.on("error", error => {
console.log(error)
})
dispatcher.setVolumeLogarithmic(5 / 5)
} catch (error) {
console.log(`There was an error connecting to the voice channel. ${error}`)
return message.channel.send("There was an error connecting to the voice channel.")
}
Alright, Ill be trying
ive never seen that error before
Error: input stream: Could not find player config
oh wait yeah that looks like a ytdl issue
it does say YTDL
yes its an issue with ytdl
what package are you using
and how are you getting the link
ytdl only accepts youtube links
This is what I usually do
!play <youtubeurl>
as well as
these are the packages
"ytdl-core": "^3.2.0"
const ytdl = require("ytdl-core")
ok im really stupid, how do i get it so my bot responds to commands if i @ it?
I made it 4.0.0 and yet giving the error
I will try again
Error: input stream: Error parsing info: Unable to retrieve video metadata
Now this came up
Error: input stream: Error parsing info: Unable to retrieve video metadata
Flaze, could you help please?
you can ask @earnest phoenix
Hmm
Hello
It has to be the latest as 4.0.3
Which version currently?
4.0.3
Did you also restart the bot?
Ahh alright
getBasicInfo: [Function],
getInfo: [Function],
chooseFormat: [Function],
filterFormats: [Function],
validateID: [Function],
validateURL: [Function],
getURLVideoID: [Function],
getVideoID: [Function],
cache: {
sig: Cache [Map] { timeout: 1000 },
info: Cache [Map] { timeout: 1000 },
watch: Cache [Map] { timeout: 1000 },
cookie: Cache [Map] { timeout: 86400000 }
},
downloadFromInfo: [Function]
}
There was an error connecting to the voice channel. TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received undefined```
Ignore the last line.
or not
Seems alright but can you do this?
console.log(require("child_process").execSync("npm ls ytdl-core").toString());```
Done.
What did it log?
The song played for some reason
+-- ytdl-core@4.0.3
`-- ytdl-core-discord@1.2.4
`-- ytdl-core@3.4.2
I see 3.4.2
Do npm install ytdl-core in terminal to update to latest just to confirm
also i won't be here to help have school homework
the app crashed

the console was sending 1 million messages a second
Bruh, it used my lavalink thing for some reason
I want a raspberry pi to host my bot, it runs on 1 server and isnβt very large
Js
What model should I get
I installed again @earnest phoenix
@feral aspen This whole thing doesn't seem to be the case, can you show how are you using the ytdl-core
@storm cliff it runs on 1 server so I want a reliable but cheap one
do I send you the !play code?
well go for the third model (rpi 3)
@earnest phoenix Could you slide to DMS/
hey anyone that could help me out a bit π
}).then(() => {
fetch("https://nycpokemap.com/raids.php?time=" + new Date().valueOf())
.then(res => res.json())
.then(
data => {
const getName = id => nameList.filter(el => el.i === id)[0].n;
data.raids.filter(raid => getName(raid.pokemon_id).toLowerCase() === options.name.toLowerCase() && raid.level === (options.level ? options.level : 5)).forEach(raid => {
const name = getName(raid.pokemon_id);
console.log(name, + "\n" + raid.gym_name, + "\n" + raid.lat, + "\n" + raid.lng);
message.channel.send("**" + raid.gym_name + "**" + "\n" + raid.lat + "," + raid.lng + "\n" + "**Raid level: **" + raid.level + " | " + name + " | " + "**Pokemon Cp: **" + raid.cp + "\n" + "**Egg Spawn Time: **" + getFormattedTime(raid.raid_spawn) + "\n" + "**Raid Start Time: **" + getFormattedTime(raid.raid_start) + "\n" + "**Raid End Time: **" + getFormattedTime(raid.raid_end))
.then(function (message) {
const reactionEmoji1 = message.guild.emojis.cache.find(emoji => emoji.name === 'valor');
message.react(reactionEmoji1);
const reactionEmoji2 = message.guild.emojis.cache.find(emoji => emoji.name === 'mystic');
message.react(reactionEmoji2);
const reactionEmoji3 = message.guild.emojis.cache.find(emoji => emoji.name === 'instinct');
message.react(reactionEmoji3);
})
```` cannot readd property toLowerCase of undefined
can anyone help me set up my rules bot. its not working
ah, unreadable code, my favorite.
either this getName(raid.pokemon_id) or this options.name is undefined @eternal osprey
Cannot read property 'id' of undefined
at GuildMemberRoleManager.get _roles [as _roles] (/root/bot/node_modules/discord.js/src/managers/GuildMemberRoleManager.js:32:101)
at GuildMemberRoleManager.get cache [as cache] (/root/bot/node_modules/discord.js/src/managers/GuildMemberRoleManager.js:41:17)
at Client.<anonymous> (/root/Arch_Bot/server.js:2735:37)
at Client.emit (events.js:322:22)
at MessageCreateAction.handle (/root/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/root/bot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/root/bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/root/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/root/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)```
Line 2735: let role = message.member.roles.cache.has("597689309918658570");
Is that an error from my side or d.js?
@solemn latch how is my code "unreadable
super long string concatenation
how does i use an emoji in an embed? (coding in java with jda)
any idea about mine?
looking around the source code on djs yours will take a bit.
What is the minimal allowed status update interval?
aight
in javascript, how can I join a string into an array? for example lets say we have var x = '1,4,3' how can i turn that into an array like [1, 4, 3]
20 sec right?
im having strange issues
is it .join?
so i made a translate command for my bot
global variables?
I use 21 secs
i clear them after its executed
or just dont use global
But I can change it to 30
@commands.command()
async def trans(self,ctx,arg,lang):
translator = Translator()
translated = translator.translate(f'{arg}', dest=f"{lang}")
await ctx.send(f'{translated.text}')
translated = None
lang = None
arg = None
this is the code
wat am i doing wrong?
what stupid thing have i done this time
I don't see any errors or whatever that's wrong with it
i will show u the logs
And why are you resetting everything to None
Traceback (most recent call last):
File "/home/meisme/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/home/meisme/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/meisme/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'group'
Is that all
Fun
fun indeed
Unless that's an error caused by the translator instance, I'm bound to assume that the error doesn't happen in that snippet
its the only code in the file tho
honestly, zero clue @small prairie
looked around couldnt find anything :/
honestly, zero clue @small prairie
looked around couldnt find anything :/
@solemn latch Same it just started happening in one server
my guess is discord broke something
I just made a new server and it has some new weird stuff
It's double underscores on each side
?
For the init method
?? it works fine for me
all my cogs have one underscore and they work fine
Β―_(γ)_/Β―
I would say its an intent or something, but even if you had zero roles cached i dont see why it would error.
honestly, might be a "tim" level issue lol @small prairie
Traceback (most recent call last):
File "/home/meisme/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/home/meisme/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/meisme/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'group'
I would say its an intent or something, but even if you had zero roles cached i dont see why it would error.
honestly, might be a "tim" level issue lol @small prairie
@solemn latch Haha
You're just not using anything attached to the instance of your class/cog
after putting two underscores it stopped working completly
But the thing is
its only happening in one server
You're just not using anything attached to the instance of your class/cog
@slender thistle wdym
it stopped working completly
Detailed exception logs could help way more
You're just not using anything like self.x
Hey guys so im making a role command and im getting this error:
command needs to be defined
Read the error
@slender thistle same logs but happens at first time
i did
Do you use regex anywhere
Hmm
anyone have an idea on how to make it whenever my bot joins a new server, it will dm me the server details (members, name, etc.) in python?
Use the on_guild_join event
spitballing here, this command is guild only right? its erroring actually in a guild correct @small prairie ?
heres the code:
Wtf googletrans
i mean i know that
but like how would i make it dm me
and fetch the details
rn i have this
user = get_user(yourid)
user.send
and it doesn't work
@client.event
async def on_server_join(server):
owner = await client.fetch_user(337025706426892288)
await owner.send(f"Joining {server.name}: {len(server.members)} Members")```
spitballing here, this command is guild only right? its erroring actually in a guild correct @small prairie ?
@solemn latch Yes i return it if(!message.member)return
its just happening in ONE PARTICULAR server
so wild
on_guild_join
discord must have tried something out which messed up
guild not server
it was before rewrite
such an annyoing issue.
that server is really weird
there are some server settings which i have never seen before
okay yeah, maybe its diffrent
async def on_guild_join(guild):
owner = await client.fetch_user(337025706426892288)
await owner.send(f"Joined {guild.name}: {len(guild.members)} Members")```
like that?
thats actually wild
the roles dont get deleted before i actually reload my discord
only way is to test
the worse thing
i need that server for an event in like 2 days ;-;
i hate discord ffs
but i will still login tommo
you need to define command to use the variable command. so yes. make sure command is defined @halcyon kite
lmk when you figure it out legendary.
please* and also ill prob add that it sends me a server inv
you got it
i am really curious
please* and also ill prob add that it sends me a server inv
@dusky mason bad
Yes and against discord's tos
people still do that.....
(server name) : (members) looks horrible
i'll just delete the server if i rage lmfao
ohh that would save me a lot of tim
you get the same guild properties
time*
just none of the member ones if you have any of those in server info command
i love how huge my server info is
people have gotten banned from here for doing that iirc.
@solemn latch Yup and I might've happened to be the one handling a case like that


the one where the mods made a server and the user joined just after being told itll get him banned

well thank you for telling me lol cuz i didn't know
quick question; How do I remove a singular user's reaction without removing all users' reactions? - in djs
hahahhaha i remember that
I see I am blind
Silly
sad part is, i dont think it was malicious.
people sometimes are just completely dumb.
I was literally looking at the docs for like 30 minutes
:sad:
lmao i get it
i legit couldnt find a thing right in front of me for like 2 hours before i gave up
Well I mean they were told multiple times by mods to not do it
yeah.
i guess they were dumber then that lmfao
alr i copied the serverinfo code
time to try
wait im so dumb
i never even put in send embed lol
Case on point, they still did it and frankly, I'm bound to believe they have an alt here still to this day.
i wanna kill myself and take discord with me :hate:
syntax
, between elements
missing something here, darling.
also gotta close brackets every { needs a }
i guess , after args:true
nice fast thingy
i cant even make those arrows straight from shareX
#topgg-api ig
Yup
im so big brain
no point of using this feature
since i have a problem with my intents
i mean server add isnt a privileged intent
should it really be hard
not that
since im sending myself user data (like amount of users for example) it can't
since i don't have that intent
i do have it enabled
but i have some problem
Lesgo
i should add under
guild number : (guild)
since it dms me the number
alr @slender thistle time for the hard thing
the intents
gl
so i have this
and everything
and it's enabled in the portal
but look at this
it's not counting member datat
and im in that role
and i fixed this last time by enabling in the portal
but now it's enabled
it broke since i updated to the latest discord.py
Try to reenable it 
how do you send a dm to a user regardless of the shard they're in? (discord.js v12)
on_guild_remove
anyone?
broadcast eval it.
Vote tracker against of tos?
a
you might run into an issue where if a user is in 2 guilds with your bot on separate shards it will send 2 dms. so youll need a way around it.
alright thanks
it says
none
and then if i do p!eval await ctx.send('hi')
this happens
kinda weird
It's not

You're just basically outputting he last returned value
print() doesn't return anything but instead writes to stdout
you can use redirect_stdout by some fucking library I don't remember
so I asked this yesterday, but i want to ask again so i can get a second opinion, I'm looking into heroku databases and i want to store data like a currency system that i can easily acess and change. Should I use Redis or Postgres?
i mean i honestly don't care less,i don't even need eval
i thought like bots have it
and its cool
to multiply 1823947829035482390581902584*90128359083190568493
so
i just made one
Well yeah, the idea is that you redirect stdout values from some point, print them, and then retrieve them to then post in a message from the bot
how hard it will be for you I can't say, but it was relatively simple for me with the amount of copypasting I did
wisdom so wise
Okay guys so I'm building a weapon command in my bot, when you attack with that weapon I want it to be deleted from user inventory, idk how to do it cause I cannot use DB.delete or var delete
I'm going crazy trying to find a solution lmao heeelp
what language
whats the error
so I asked this yesterday, but i want to ask again so i can get a second opinion, I'm looking into heroku databases and i want to store data like a currency system that i can easily acess and change. Should I use Redis or Postgres?
isnt redis an in memory database?
@solemn latch Lmao the error fixed itself
Defo discord trying out something
had a small server outage too before that happened
what language
@upper elm JS
yes

why did you delete everything else
this file
you had other stuff here
this isn't valid JS
so I asked this yesterday, but i want to ask again so i can get a second opinion, I'm looking into heroku databases and i want to store data like a currency system that i can easily acess and change. Should I use Redis or Postgres? @upper elm
That's why i switched to AWS Lmao
no
green means add, red means remove
this is a "difference" indicator, as in, they're telling you, "add this line that has the +"
This is what happens when someone with no JS knowledge just blindly shovels code.
That's why i switched to AWS Lmao
@north birch what's that i'm pretty new lol
So why are you making a bot in JS, darling?
@north birch what's that i'm pretty new lol
@upper elm It's amazon vpc, it has free tier for 12month
redis is in memory storage. meaning if the redis restarts you lose that info afaik.
alr
alr
@upper elm Try it out
i will, thanks
You're welcome
Ok well then learn javascript first
otherwise you're not making a bot, you're just mimicking someone else's code
which holds absolutely no value in this world.
Ok so?
there are plenty of decent 13 year old devs
Then don't make a bot!
If you don't have time to learn, you don't have time to make a bot. it's that simple.
im god damn 13
me too
@covert gale Coding too complicated? Don't have time to learn? There are many thousands of bots available already and one of them is bound to have exactly the features you want. No programming necessary, no setup, no hosting required, all 100% free and ready for you to use! Just head on over to https://top.gg/ and checkout the various bots (there are thousands of them) and you'll most definitely find something for your needs.
lemme see if i can find it.
i'm getting this error:
UnhandledPromiseRejectionWarning: SyntaxError: Unexpected identifier
on this code:
client.shard.broadcastEval(`(${user.send(vEmbed)})`);
but the message still sends and works fine, it just sends an error
(discord.js v12)
Guys ill building a weapon command, i want the weapon to delete after used but i dont know how to do it cause i cant do quickdb delete or using a var to clear cause the data are in a text
What do you guys suggest me?
oop, i lied. it was 2d
https://www.youtube.com/watch?v=9HCboZHTyrw
woo do you know what the issue is
ngl, ive yet to shard.
lol
@dense patio the brackets are causing that
The () are part of the actual eval string and the other portion is a template expression
The expression gets run but the eval thing can't understand why the hell there is a random ()
If you want to make your own bot you have to start by learning the language
afaik
remove the brackets ig
it's like "I don't want to go to the restaurant, I want to make my own food" and then you don't understand what "preheating the oven" means. You can't have it both ways, either learn javascript first, or don't make a bot.
ah
or any language you want that has a discord variation really
@dense patio also why are you evalling that anyways
to make sure they get the dm regardless of the shard they're in
it sends a dm when they vote
user.send returns a Promise and you're trying to eval that Promise object on every single shard
he doesnt know what shard the user is on
to make sure they get the dm regardless of the shard they're in
then why is there a template expression
Oi please help lmao
smh
now this:
Where is the non-defined variable?
the non defined variable?
Check the code for 'user'
the non defined variable?
@solemn latch LMAO Sorry bout that im not english LMAO
yeah
bot off?
and the thing i had before with broadcastEval worked
it was sending to the user?
yep
was the user on the same shard the broadcast eval ran on?
then i dont think it worked, since it had the variable.
there's only 1 shard atm, i'm just future proofing it
if the user wasnt on the same shard, i dont think it would have worked.
oh okay. well then yeah what you had before would work.
but you also dont need to broadcast eval it
you can just run it.
i know
since its practically the same thing.
but i want to get this done asap
with my other bot i was stuck for so long trying to figure this all out
caused a lot of mess
i haven't done anything with broadcast eval though so that's why i'm confused
Im looking for some help to make this command delete the weapon after it moves to equipped weapon, but idk how, if anybody have suggestions ping me:
const db = require('quick.db')
module.exports = {
name: "equip",
description: "Equip a weapon",
async run (client, message, args, config) {
let weapons = db.fetch(`${message.author.id}_weapons`)
let equippedweapon = db.fetch(`${message.author.id}_equipweapon`)
if(armi === null) {armi === 'Youre pooooor!'};
if(!args[0]){return message.channel.send(`available weapon: ${weapons}`)}
if(args[0] === 'TestWeapon') {
message.channel.send('You equipped TestWeapon!')
db.set(`${message.author.id}_equipweapon`, 'TestWeapon')
};
}}
lmao.quick.db.gif
?
quick.db is crap.
hey
I prefer using MySQL as a database.
Nobody asked π
π¦
lol
It's not that bad but now transfering database it's...well...you know
It's not that bad but now transfering database it's...well...you know
@north birch True.
client.on('message', message => {
if(message.content === `!kill`){
const exampleEmbed = new Discord.MessageEmbed()
.setColor('#9400D3')
.setTitle('**A crime has been commited!!**')
.setAuthor('Tendo Reactions')
.setDescription(`${message.author} brutally killed ${message.mentions.members.first()}`)
.setFooter("Command created for Tendo!")
message.channel.send(exampleEmbed)
}```
why does my bot not work when i use !kill @fair rover\
the !kill works
but !kill @fair rover does not
You did not set an args[0]
Yeah sure it's a hassle but, as a wise man once said, just because you've invested a lot of time in a mistake, doesn't mean you should hang on to it.
your also checking if content === !kill
not startswith
Yeah sure it's a hassle but, as a wise man once said, just because you've invested a lot of time in a mistake, doesn't mean you should hang on to it.
@umbral zealot Yeah ik but my friend just started playing it i dont want to transfer all data lmao
time to learn I guess, or learn ot read their docs better. but quick.db has very little actual functionality over something like keyv, and is much slower than pretty much literally anything you can find out there Β―_(γ)_/Β―
But now forget about the quality of the database, is there a method that i can remove the "weapon" from the data without deleting all?
is quick.db one of those fs wrappers for json
get all the weapons, remove the one you want removed, set all the weapons.
But now forget about the quality of the database, there is a method that i can remove the "weapon" from the data without deleting all?
@north birch If you are starting small, use .Json
no
N
dont use a json database
@north birch If you are starting small, use .Json
@feral aspen My database is .json
Yes true.
do it right once and dont worry about it
Well fck
oh isnt it sqlite
I used json and Ill be spending my entire life migrating to MySQL
It's a wrapper around sqlite that stores stringified data.
Anyways @north birch quick.db doesn't have a way to remove "only part of the data", so you'd need to get the data, modify it, then set it back
if you want a wrapper that doesn't suck, look up Enmap instead (disclaimer, I made enmap)
get the weapons. remove the element you dont want, then set it.
Guys i got the concept but how i can actually do it LMAO
what part
This is normal javascript manipulation
the getting part? the removing an element, or the setting part.
removing something from an array or object is just.. code.
This is normal javascript manipulation
@umbral zealot I tried but my database, idk why, take all in a text file
It's not an object
no no just fetch or get the data
I fetched it
right so take that
Wait i try something
Well yes i did something wrong at the beginning It should work now
Just quick question, suppose I write a code in the ``` but I dont want it to all be the same color but all like different colors\
I put JS?
Thank you! π
If I want to make it all one color
What is it that I should do?
Like all red, all blue, all green, etc.
should I write the hex color?
Thanks.
wtf they're trying to sell me discord formatting guide
"Want to take this guide with you on the go?"
hUH?
So delete weapons['TestWeapon'] dont wanna actually delete the shit*y weapon out @solemn latch @feral aspen
Np
oh are you talking once youve gotten it?
This is the database console.log before and after
[
'TestWeapon',
'TestWeapon2',
'TestWeapon3'
]
I would filter out the item you dont want from the array.
I never did that before but i will try
how do I get a member by ID?
guild > members > cache > get
should help with getting member by id
I'll try that
how come that this code is not working? ```js
if(message.content.startsWith === !poke){
const pokeUser = message.mentions.members.first()
if(!pokeUser) return;
const exampleEmbed4 = new Discord.MessageEmbed()
.setColor('#9400D3')
.setTitle('**Pokes have been transferred!!**')
.setAuthor('Tendo Reactions')
.setDescription(`${message.author} poked ${kissUser} till he left holes in his body!!`)
.setFooter("Command created for Tendo!")
message.channel.send(exampleEmbed4)
}
yeah i only should use the prefix probably
It's a function
I think it would be if message.content.startsWith('poke')
there are plenty of decent 13 year old devs
@solemn latch agreed
i am one of them
so don't feel discouraged or anything
age is just a number?
shoot, i had a bad build
xD
lmao tim
but if you train your EVs right, you can become stronger than higher level characters
stackoverflow is the cheat sheet wiki
shoot, i had a bad build
I see i sucks at filtering objects
I did not expect this for removing an object in that db LMAO
I see
while i was testing my bots i found out even if i invite the bot using all the permissions except Admin (in this case im focusing on Embed Messages) , my bot is not able to send embed in channels where everyone is not allowed to embed links. and it causes my bot to crash. Any fix? it works fine if i invite the bot with Admin perms
i mean, it cant send embedded messages. Most of the error checks returns an embed message in my bot. I have to go through each of them to remove the embeds if i want to fix this which i dont wanna do
yeah, I am unaware of the permission that would do that.
intresting. embed links removed indeed doesn't let bots send embed.
the fix would be to require the "embed links" permission with your bot.
you could also add a check if the bot has that permission, and give a generic error when it happens.
Guys i have a problem with my bot. I tried my command in windows but my command is not working in linux
i'm using shelljs in linux
Bremchu, use the isNaN function
eing?
@dreamy thistle if(isNaN(Number(deleteNumber))) // do something
i'm checking the function is executed or not, it says function is executed
it return stderr also
is there anyone has any idea?
i want to send dm to specific user
here is dm message
but it's not working on linux
i'm checking the function is executed or not, it says function is executed
@feral furnace I will just add a console.log when you want to check
@feral furnace I will just add a console.log when you want to check
@north birch i added console.log to check whether the function is executed or not. As you can see, function is executed
im confused, why not just process.exit() when you want to restart the bot when using a process manager.
@feral furnace How are you going to send a message after you restart the bot
You cant lmao
i can
Wtf?
Wtf
process.exit()
message.channel.send(βsuccessfully restarted botβ)
@dreamy thistle just do if(!deleteNumber)
@solemn latch What filter can i apply for excluding the specific weapon i used
@dreamy thistle just do if(!deleteNumber)
@earnest phoenix but thats for other case
filter(weapon => weapon != equippedWeapon)
i want a one who replys to ?clear asadsasd
hum
@dreamy thistle just do if(!deleteNumber)
@earnest phoenix if(!deleteNumber instanceof Number)
Why would you do that..?
filter(weapon => weapon != equippedWeapon)
@solemn latch For weapons you mean the name of the weapon or all weapons fetched?
cant you use β in javascript?
Yea you can
filter is a function that goes through every element of the array its reading from
weaponArray.filter(weapon => weapon != equippedWeapon);
the weapon => weapon != equippedWeapon gets run for each weapon in the weaponArray
It's..not working? i dont know why
im doing const newweapons = weapfilter.filter(weapfilter => weapons!= equippedweapon);
weapfilter = weapons
thats not the way it works.
your essentially creating a function within a function(callback)
so you need to use its own variables in that callback
weaponArray.filter(weapon => weapon != equippedWeapon);
weaponArray is seperate from weapon
so
const newweapons = weapfilter.filter(weapon => weapon != equippedweapon)
weapon => weapon != equippedweapon < is checked for each weapon in weapfilter
Okay
I think the description on this page is really good.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
Sorry bout that i never did filter
np
its actually super common to have callbacks like this in code
its really useful to learn.
Perfect
lmk if it works
how to delete a message posted by the bot?
@dreamy thistle <message>.delete();
.then(messageReaction => {
message.delete({ timeout: 2000 });
i have this but deletes the command posted by you
not by the bot
for my bot i need to verify over how many guilds?
for my bot i need to verify over how many guilds?
@faint arch to get verified you need 76 guilds
or more
but you can't get the badge anymore
@earnest phoenix Did you see .NET core 5 dropped today?
before I lose it - how do I get the role object from a role ID? Discord.py
@fierce arch you could use Guild.roles to get a list of roles and use one of discord.py's utility methods: ```py
message.guild.roles -> List[Role]
discord.utils.get(message.guild.roles, id=the_id)```
I think it goes like this, but you can review the docs for more.
oo okay I'll try it
.utils 
theres the create instant invite perm
anyone know how i can customize my invite and vote buttons on top.gg
i have been digging through html
but havent got very far at all
@late light css
why would you put your bot to dnd
idk why not
One message removed from a suspended account.
client.user.setStatus('dnd')
@swift umbra
do i put the with the bots activity?
whats the name for the phone icon when your on mobile?
@swift umbra
pretty sure thats undocumented.
its still probably not a smart idea to use undocumented things.
!help
no bot commands here
My bot no longer plays music. In the past I had the same problem and decided to put 1 << 25 in YTDL highWaterMark, but it seems that even this is not working anymore. Does anyone have any solution?
is it just not playing or are you getting a specific error?
@cinder sandal nice pfp
is it just not playing or are you getting a specific error?
@solemn latch Do not touch anything, without errors
Is your ytdl-core the latest version?
hey
Hey there
on how can I make the message send only on nsfw channels
Make a if statement check
if (<message>.channel.nsfw) // send message here```
Is your ytdl-core the latest version?
@earnest phoenix I updated and went back to work. Thanks!
pretty sure thats undocumented.
@solemn latch it's documented lol
you have to modify your lib to get the mobile indicator
the client in the IDENTIFY payload to the websocket needs to be set to mobile
@earnest phoenix Did you see .NET core 5 dropped today?
@faint prism yeah i'm going to explore and fiddle with it over the weekend, it finally released
would 2 open connections to a sqlite file be bad?
who am i
yes @grizzled raven
however sqlite tries its best to be threadsafe
so when one connection does a query, the tables are locked and released once the query's finished iirc
which will result in, obviously, slower queries over multiple connections
sqlite3 handles concurrency very well though
so there shouldn't be anything noticable per se
i found this if you want to read more into it https://www.sqlite.org/lockingv3.html
msg.author.send(`\n> Byte Memory Usage: ${process.memoryUsage().heapUsed}\n> Bot Uptime:\n> Seconds: [${Math.floor(bot.uptime/1000)}]\n> Minutes: [${Math.floor(bot.uptime/1000/60)}]\n> Hours: [${Math.floor(bot.uptime/1000/60/60)}]\n> Days: [${Math.floor(bot.uptime/1000/60/60/24)}]`);
im not that good at math
how can i make it so
the number resets past 60/60/24/365
commands do not work if i update
well, obviously
it's a major version update
there'll be breaking changes
could someone help me with the math
in discord.py 1.5.1, guild.members only returns one member
which is the bot itself
but there are definitely other users
are those members cached?
@solemn latch do u know how my problem can be fixed
SERVER = bot.get_server(770731640682053663)
for i in SERVER.members:
print(i.name)
π€·ββοΈ i might be able to in a minute
@tardy dove do you have intents enabled
Intents.defualt() enables everything except presence and member data.
Look into the Intents class and see which one you need: https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents
Bots will be kicked if they DM a user:
1. Join messages
2. Any type of automated message without consent
3. Any advertisements
whats wrong with join messages
Then, when initializing the discord.Client class, pass a kwarg where intents is the key and the value is an instance of discord.Intents
valurim they're unwanted here.
i turned on its ability to download the member list
but my side doesn't seem to see it
ive seen plenty of official bots have join messages
Those rules are for this server
@earnest phoenix it means you cant have join messages here
Try restarting your bot. Also can you show your code where you initialize your client
bot = commands.Bot(command_prefix="!!", intents= discord.Intents.default())
@sudden geyser
Like I said, that enables everything except presence and member data I believe.
is it possible to insert my own functions into vsc
i have member data turned on through the dev portal
without making it in said code
but its still not working
and w/out module
as in an export?
@sudden geyser does it generally take a few minutes for new intents to propagate or something
just make it appear
like, a function with the code in another file?
yeahh
yeah an export
but not requiring that file



