#development
1 messages · Page 950 of 1
when i put it in src/commands it works but not in src/commands/first
i have no idea why
using console.log it works
Returns?
?
What does it return?
Alright.
Probably because of the null
Change null to 'no module found'
Or some other error message.
.setAuthor
smh
you need to use it like this: ```js
[embed].setAuthor('text'[,image])
image is optional
@fluid basin I used to test. Same issue. What should I do ?
async function testing(connection, message) { const serverdispatcher2 = connection.playStream(ytdl("https://www.youtube.com/watch?v=G9ffM4EJPVs", { filter: 'audioonly', quality: 'highestaudio', highWaterMark: 1 << 25 })) .on("end", () => { connection.disconnect(10000); }) .on("error", error => { console.log(error) }) } message.member.voiceChannel.join().then(function (connection) { testing(connection, message); })
@fluid basin So i used this code and got no error at all. The bot joins and leaves. Even if i install an older version of ytdl-core
optimization:
message.member.voiceChannel.join().then(function (connection) {
testing(connection, message);
})```
can be ```js
message.member.voiceChannel.join().then(connection => {testing(connection,message)})```
you can use the .tag property of a user
like
@tight plinth.tag = Lumap#0001
@tulip ledge Array or [['name', 'data']] or?
['name', 'name2']
{
"greater backpack": "Big oof",
"diamond": "Also big oof",
"emerald": "Another big oof"
}
I want to turn that into an array like this: "greater backpack", "diamond", "emerald"
In js
So that I don't need this anymore const itemstosearch = ["diamond", "greater backpack", "emerald"];
You don't need that.
Yes I do
delete it and change keys to
const keys = Object.keys(file);```
I thought that array was for whitelisted stuff.
No
@clever tree I just downloaded the code from the repo, and its working fine
Well ty verry much
make sure you fast forward the changes from the repo to your code
By changing this I can up the threshhold right?
Yes.
Higher or lower?
Higher means it will be more restricted
Ok
or diamon = diamond
@fluid basin lul. Then its my pc i gues.
install a fresh copy from the repo
and try running it
if its working
that means its something with your current code

@fluid basin Whisch packages did u use ?
the default ones
go download the zip https://github.com/iCrawl/discord-music-bot/archive/master.zip and run npm install
also if you aren't using d.js v12
you should be using that
@fluid basin if i use v12 my whole code break. So idk xd
Almsot all function are wrong then
yes its a major version change
though you can still use v11, but I think about october it will not work anymore
when discord officially introduces intents
@fluid basin I will look then. But at this moment i want my bot to wokr again xd
also the 11.6 version is also working: https://github.com/iCrawl/discord-music-bot/tree/50e5e63659cb9a4a655d9fbe0997157294364022
@fluid basin Yea. I did this :
async function testing(connection, message) {
const serverdispatcher2 = connection.playStream(ytdl("https://www.youtube.com/watch?v=G9ffM4EJPVs", { filter: 'audioonly', quality: 'highestaudio', highWaterMark: 1 << 25 }))
.on("end", () => {
connection.disconnect(10000);
});
serverdispatcher2.on("error", error => {
console.log(error)
})
}
message.member.voiceChannel.join().then(function (connection) {
testing(connection, message);
})
package
"@discordjs/opus": "^0.3.2",
"colors": "^1.4.0",
"discord.js": "^11.6.4",
"file-system": "^2.2.2",
"ms": "^2.1.2",
"simple-youtube-api": "^5.2.1",
"yt-search": "^1.1.2",
"ytdl-core": "^2.1.5"
Instant leave.
try removing quality: 'highestaudio', highWaterMark: 1 << 25
what would be commando equivalent of dpy's "consume rest" behavior
like how do i make a string command arg act like this
command: {p} {cmd} text with spaces
arg: 'text with spaces'
@fluid basin still instant leave.
{
key: 'text',
prompt: 'promt',
type: 'string',
infinite: true
}```
makes it returns an object of args like this: `one two` would be `['one', two']`
did you try a clean install?
of the code from the github repo
and re-setup with your token
if that works that means there's something wrong with your bot
me?
not u
My friend is like: Coding is just knowing the syntax it's so easy
My friend is like: Opening cmd is hackerman
(My friend doesn't know shit about coding) he just sais its easy
y'all have friends?
what is this friend thing ur talking about
My friens is like: Trying to skip python basics such as OOP and goto machine learning
My friends are like:
.
.
.
.
.
.
.
.
.
(They don't exist)
lmao
[{"name":"Name1"},{"name":"Name2","changedToAt":1571238414000},{"name":"Name3","changedToAt":1573834068000}]
How do I get the last collection?
Cuz i wanna get Name3
But
The amount of objects inside of it can vary
So i can't just do [2]
is it a d.js collection?
discord.js collections have a .last() function
so its just a normal array
array[array.length-1]
should be
use the length of the collection i guess
array[array.length-1]
then use this
{ [Error: ENOENT: no such file or directory, scandir 'D:\OneDrive\Bureaublad\Caeli\cmds\ ']
errno: -4058,
code: 'ENOENT',
syscall: 'scandir',
path: 'D:\\OneDrive\\Bureaublad\\Caeli\\cmds\\ ' }
Euh
@fluid basin Im too dumb to install the bot u sent. xd
But idk what my issue is. I installed everything new. Made a new folder everything. but ...
also not sure about this but it isn't really a good idea to have your node modules in onedrive XD
You must pass an array of objects.
let embed = new Discord.MessageEmbed()
.setTitle(`Caeli | Skyblock Craft Request`)
.addField(`IGN`, ign)
What does ign equal?
Setting to
nullmeans that the default prefix from CommandoClient#options will be used instead.
but i am looking at CommandoClient's options
????
Oh dude. I will just delete my bot i gues. Nobody knows how to help me... that does not make fun if u coded for half a year on this bot everything worked fine but from one day to another the bot didnt play music haha xd
its 2 different things
@fluid basin what is what then
well if you don't mind you should upload your code somewhere so maybe I could take a look @clever tree
Anyone knows whats happening with mine?
@next remnant
the one in the link is referring to:
commandoClient.commandPrefix = '!'
but the one in options is:
const commandoClient = new Commando.CommandoClient({commandPrefix: '-'})
@fluid basin The problem is. You saw my code. The play command with a specific yt link was the command. And the Package was the package
no I meant all the files not just that
also, how do i make it not ping the author in every response
@fluid basin I will look. have to do sth else now
don't use message.reply? @next remnant
there are other places it does that too
like with unknown commands responses (how do i disable those?)
prompts
etc
I think that is a built in feature
well honestly commando isn't the best to use if you're planning to have an entire command system
Fixed it by updating nodejs
what else do i use?
you could just make your own
it isn't very difficult
good starting point
Anyone here know the color code to make it seem like an embed doesnt have a color on the side?
don't think that is possible?
if you're using light theme the background colour is different from the dark theme background colour
But I dont have the color code anymore
Yeah I know
But I just want the one for the dark colore
I thought if you just left the colour field empty it does the job for you
hmm does it really sound that complex? @next remnant
as someone who has dug through discord.py's comamnds ext code, yes
plus its more code on me to maintain
well, what kind of system will you need though
i'm just trying it out, not gonna write any prod bot in it but i'm looking fot something like d.py's
a configuarable command system
with good docs
you should go looking around github for a d.js framework then
d.py is rather nicely developed
with a bunch of helper stuff
Any idea why this isn't working?
function toProperCase(string) {
let str = string.toLowerCase();
console.log(str)
if(string.includes(" ")) str = string.split(" ")
str.forEach(x => {
let splitted = x.split("")
console.log(splitted)
splitted[0].toUpperCase();
splitted.join("")
})
if(string.includes(" ")) string = str.join(" ")
return string;
}
It doesn't uppercase the first letter
https://github.com/1Computer1/discord.js-frameworks-comparison
might be a little outdated
@tulip ledge strings are immutable
?
@fluid basin wdym? I dont know what that means lol
oh it just means that you cannot modify a string character individually
Well
if you want to modify the string, you have to change the entire string
well then theres something wrong the code
yeah well I don't understand what you're trying to do
When i have this:
big oof
It needs to become
Big Oof
also <string>.toUpperCase() returns the uppercased string, and does not modify the string
welp turns out
short of making my own command framework, there's no good way to handle commands with djs
are you trying to do something similar to commando
it can
because if so, args must be a pain in the ass
are you trying to do something similar to commando
im trying to use commando and failing miserably at it
well the main issue is the language difference, javascript doesn't support annotations
typescript
Hey can anyone help me with that
When I Play A Music And Disconnect The Bot By Clicking Right On The Bot And Disconnect And Play Another Song Then The Bot Add That Song To In His Queue
TypeScript Decorators overview
and decorators in ts is messy imo
no?
well unless you can find a library that supports that
as someone who has only consumed them
if not you still need to implement them yourself
ive only used them with angular and they work well
Can somebody explain how's the t is the second index while it's literally the 3rd index in the array?
'/', '/', 't', 'e', 's', 't', '\n', 'a',
'r', 'g', 's', '.', 'j', 'o', 'i', 'n',
'(', '"', '', '', '"', ')', '.', 's',
'p', 'l', 'i', 't', '(', '"', '"', ')',
'.', 'j', 'o', 'i', 'n', '(', '"', '',
'', '"', ')', '.', 's', 'p', 'l', 'i',
't', '(', '"', '', '', '"', ')'
]```
0, 1, 2
indexing starts from 0
arrays start from 0
Oh wait damn... I forgot
is there any good big open source js bot whose code i can look at
so thats why you still get the same data back
preferably written in ts
thats some requirements
i mean big as in big code base
~~https://github.com/Malexion/Rhythm-Bot~~ jk don't acutally
oh
~~https://github.com/AssystDev/Assyst~~
@pale vessel your bot?
don't you know how indexing works in most langs?
there isn't much ts d.js bots with a complex command framework well
dank voltrex
@tulip ledge also there should be a simpler way to do it
@copper cradle maybe he's confused with length
I don't think so
well then
¯\_(ツ)_/¯
My wifi is dying
well your main issue is that splitted is not used
I fixed that
export default {
name: 'badtranslator',
aliases: ['bt', 'badtranslate'],
responseOptional: true,
metadata: {
description: 'Run text through a bad translator',
usage: '<text>',
examples: ['hello there']
},
ratelimit: {
type: 'guild',
limit: 1,
duration: 10000
},
args: [
{
name: 'hops',
default: '6'
}
],
run: async (assyst: Assyst, ctx: Context, args: any) => {
await ctx.triggerTyping();
if (!args || !args.badtranslator) {
return ctx.editOrReply('You need to supply text to translate');
}
``` ngl this looks horrible
oof
function toProperCase(string) {
let str;
if(string.includes(" ")) {
console.log(1)
str = string.split(" ")
str.forEach(x => {
let splitted = x.split("")
splitted[0] = splitted[0].toUpperCase();
str = splitted.join("")
console.log(str)
})
console.log(str)
str = str.join(" ")
}
else {
str = string.split('');
str[0] = str[0].toUpperCase();
str = str.join('')
}
return str;
}
(coming from dpy)
yeah why are you replacing the entire str variable
if you want to find the guild using a invite link would you have to fetchInvites for each guild in order to find which guild the link goes to?
assuming that the bot is also in that guild
hmm you need to change the word
you can fetch invite
you are splitting the string into an array
got it I see it in the docs
so you need to replace the part of the array with the new uppercased string
yea
or of course if you're more advanced you can do this with a .map but well lets not go into that
.map(x => x[0].toUpperCase)?
discord
.map(x => x[0].toUpperCase + x.substr(1))
alr
str.split(" ").map(x => x[0].toUpperCase + x.substr(1))).join(" ")
very nice 1 liner
My bot is just not sending the embed
Ok
function toUpperCase() { [native code] }reater function toUpperCase() { [native code] }ackpack
add a ()
let str;
if(string.includes(" ")) {
str = str.split(" ").map(x => x[0].toUpperCase + x.substr(1)).join(" ")
}
else {
str = string.split('');
str[0] = str[0].toUpperCase();
str = str.join('')
}
return str;
}```
Oi
it's a method
where do I add it?
lol not str.split(" ") but string.split(" ")
str = string.split(" ").map(x => x[0].toUpperCase + x.substr(1)).join(" ")
you forgot () in toUpperCase()
I have this
Oh ok
yeah and that
lol
So its not my wifi dieing its discord?
Cuz status.discord.com sais its 41ms ping
But my ping is liek 2 secs
.setColor("#ffffff")
Why is it making my embed blue?
no.
oh
so no one knows how to get server boost lvl?
how to add own bot to our site
And no one knows how to change the color of a friking embed? in v12
what u meen ddl
you used #ffffff, which is a hexadecimal for the color WHITE
And it makes my embed blue
Is this blue or am I color blind?
let embed = new Discord.MessageEmbed()
.setColor("#ffffff")
.setTitle(`Caeli | Skyblock Craft Request`)
.addField(`IGN`, ign, true)
.addField(`Item to Craft`, tocraft, true)
.addField(`Collection`, collection, true)
message.channel.send(embed)
Thats the code
how do i log all the servers the bot is in?
@pure lion all their instances or their names or something?
i love discord

Make sure if you do this, That it's not a command that everyone can use.
Emojis get really big if you don't put at least one letter or a character
On mobile
invisible spaces should do the trick yeah
we gave you a fix
like just ' ' or?
no
\u200B
Let's say I have an object with a value called lock than can either be true or false;
Now I have a variable which contains for example a string "lock", so myVariable = "lock";
How can I say if(myObject.myVariable) //do stuff ?
Yea but myObject would be your object name and myVariable would be one of the objects inside the main object
Didn't really get it
For example
myObject: { name: "Thing" }
if(myObject.name){
yeah but I need to referr to the name with a variable
like myVariable = "name"
is there a way to use the content of that variable to indicate the object property?
is there a method to determine if an invite link is valid or invalid
fetch it
Idk what you exactly trying to do but you can get that whole object by a content of a variable inside that object
<Array of objects>.find(o => o.name === "content of the variable").....
check error
myObject.myVariable = "something";
= js { myVariable: "something" }
myObject[myVariable] = "value"
" "
myObject.myVariable = "something";
=js { myVariable: "something" }
yeah that's what I don't want
what do you want then?
to use the variable value to call an object value
object[variable]
^
nice thank you
wait no
?
thanks @pale vessel
I'm confused lol
the field was a great idea
ah
honestly i wanna facepalm with a chair.. why didnt i think of that xd
is message.guild.owner a thing? (I'm not sure where to look on the docs)
show code
ok thanks
yeah
But message.guild.owner returns a resolvable member or a null.
it is but the owner can be uncached
i like how this looks exactly like mine
console.log(message.guild.region) for starters
well?
there's no europe in the object
you have an outdated region list
did you read the migrating article?
you'll see
region is not the part of that
it's channels and roles
for regions, you can fetch them using discord's REST API
then?
what
damn ok
so problem solved?
V11 or V12?
@pale vessel What do you use for music my man?
Same I cant get lavaplayer to work correctly 😠
[ERROR] [LocalAudioTrackExecutor]: Error in playback of u1YRjCTxR80
com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track.```
Does anyone else have this issues with lavalink/player/cord?
how do I make the bot match only the user, not the bot?
@radiant parcel if(msg.author.bot) return
haha, dont worry I feel you
thy

thx
please stop using css highlighting when sending bot code 
Yes
@magic jackal
client.on("message", msg => {
if (msg.content === "qu!ping") {
if(msg.author.bot) return
msg.reply("Pong!");
}
});
?
move it outside
"if(msg.author.bot) return
uhhhhhhhhhh
client.on("message", msg => {
if (msg.content === "qu!ping" && !msg.author.bot) {
msg.reply("Pong!");
}
});```
uhhhhhhhhhhhhhh
Bit long winded as you'd have to check for that each time.
mhm thats per command
so so thx
client.on('message', m => {
if (m.author.bot)
return
//commands here
});```
As you'd have to use if (message.content == "qu!command" && !message.author.bot) {} every time.
show code
in v12 verificationLevel is a string, not a number
yes
no, you remove the entire thing
you're still trying to use it as an array index
Hey there, how could I make the bot to send attachments? I've tried many methods but no one of them seem to work. I'm using discord.js, thanks 👍
in an embed or in a normal message?
Normal message 😛
without defining a file name .send({files:[URL OR BUFFER OR STREAM]})
with a file name .send({files:[{attachment: URL OR BUFFER OR STREAM, name: "filename.jpg"}]})
why jpg
just an example
Oh, alright, let me try! Thanks! 😄
Well, the bot sent this, and that wasn't the objective x)
Could it send the picture? Not a download link, but the picture itself ^^'
For example, could the bot send an image in this way? Without the URL, only the picture
Yes. Turn the photo into an attachment.
Send the attachment.
Or use an embed and setImage
How to turn the photo into an attachment? 🤔 😅
@coarse topaz that is the picture itself
its 600kb big
which looks correct
its not showing because it has an incorrect file name
File extension.
could it be that it doesnt have an extension?
if its a png image, you have to use the version that defines the file name as i showed you and name the file with a .png extension
how do I make commands for my bot
learn a programming language
how-
do you know what programming is?
quite
programming is the act of creating programs, programs that execute functions in a machine or computer
there are many different programming platforms, languages, methods, environments etc
discord bots have to be programmed, ie you have to build a program and connects to discord in order to make it execute functions and commands
there are many different programming languages with various purposes, and discord bots can be built with many of them
for example, javascript is widely used for making advanced websites
python is another language widely used to make a variety of programs
both can be used to make discord bots
you need to chose a language and start learning it, there are plenty of online courses and guides for free
you need to have a basic understanding of a programming language before attempting to create a bot, else you will have a very hard time
try looking into some online course and see if you like it
for example, try codecademy
or udemy
I can try
bot.fetchInvite("invite link").guild.id
gives an error even though the invite link is valid. When I looked at the docs, it said there was a .guild property so Im not sure why this doesnt work
A question: Could I create an edit message command by having the message's ID?
Something like: !edit <MessageID> <new text>
@tired nimbus all methods with the word "fetch" in it are async, which means they return a promise, which means it has to be awaited or used with a .then()
ur bot can't edit users messages if thats what ur trying to do, or if ur not trying to do that, you can await sending the message, and then edit that
@coarse topaz only if the message was sent by your bot
oh ok its strange because bot.fetchInvite("link").toString() works but the guild id doesnt
Yes! The message was sent by my bot, of course! x)
fetch the message
then you can await sending the message, or r u trying to edit a random message ur bot sent?
The second one, yeah
my full code:
let invite = await bot.fetchInvite("link").toString()
let guild = await bot.fetchInvite("link").guild.id```
1st one works but second one doesnt
what library are you using?
no uhh hector
@tired nimbus you're not awaiting correctly
if you do await bla().bla2.bla3 you're actually doing await bla3
you have to explicitly define which one you want to await, for example (await bla()).bla2 or define a variable first something = await bla(); something.bla2
oh okay thanks
no uhh hector
@digital ibexyeah, v12 😅
Is there a problem with the library? :c
I have fixed it thank you
idk how you'd do it in d.js, but i assume it would be something likeTextChannel.messages.cache.get('mesasge id').edit('ee');
you can try client.getMessage but d.js doesn't branch out like eris' client 😛
in djs v12 it would be channel.messages.fetch(id)
then after fetching, you can do message.edit()
Oh, alright.. So will I need to edit messages from the bot's code or can I create an edit message command?
anyone else has issues with ytdl and audio?
The following codes result:
buffer: BufferList { length: 0 },
function testing(voicecc, message) {
const streamstream = ytdl("https://www.youtube.com/watch?v=iU9bc6LmX8k", { filter: 'audioonly'})
var dispatcher = voicecc.playStream(streamstream);
if(dispatcher) {
console.log("dispatcher exist")
}
dispatcher.on("finish", () => {
voicecc.disconnect();
console.log("disconected")
});
dispatcher.on("speaking", () => {
console.log("i try to speak")
});
dispatcher.on('error', error => {console.log(error)});
console.log(streamstream)
}
const voicecc = await message.member.voiceChannel.join()
if(voicecc) {
console.log("joined a voicechannel")
}
testing(voicecc, message)
"dependencies": {
"@discordjs/opus": "^0.3.2",
"colors": "^1.4.0",
"discord.js": "^11.6.4",
"file-system": "^2.2.2",
"ms": "^2.1.2",
"simple-youtube-api": "^5.2.1",
"yt-search": "^1.1.2",
"ytdl-core": "^2.1.5"
@coarse topaz you can do it through a command, but thats what your command code will have to do
Ah, got it... Sorry if I bother you, but could you please give me an example of the command already done? I'm kinda new in programming, so I'm still learning all these things ^^'
@quartz kindle
on message received...
let args = message.content.split(" "); // assuming your command is something like "mycommand IDHERE CONTENTHERE"
let id = args[1];
let content = args[2];
let m = await message.channel.messages.fetch(id);
await m.edit(content)
note that the target message needs to be in the same channel as the command
if you want to edit messages from other channels, you will need to supply a channel id too
for example mycommand MESSAGEID CONTENT OPTIONALCHANNELID
then you will need to get the channel as well in the code
Oh sure, thanks for it! I'm gonna test it right now 
Oof, it didn't edit the message, @quartz kindle
Being this the code:
if (message.content === `mm!edit`) { let args1 = message.content.split(" "); let id = args1[1]; let content = args1[2]; let m = await message.channel.messages.fetch(id); await m.edit(content) }
add some logging
for example console.log(id,content)
to make sure they are correct
if (message.content === `mm!edit`) { let args1 = message.content.split(" "); let id = args1[1]; let content = args1[2]; let m = await message.channel.messages.fetch(id); await m.edit(content) console.log(id,content) } like this?
(Anyway it doesn't log anything even after running the command)
if it still doesnt log anything, then the command is not even running
where did you put that code?
On Glitch, all other commands are working correctly
Well, this appeared after running the commands some times, @quartz kindle
that has nothing to do with the bot
exactly lol
are you running other things? like a webserver, uptimerobot, etc
anyway i meant where in your code did you put the command
Hmmm, well, the bot is being hosted on another page too, but it doesn't has nothing to do with my code, both hosters can work at the same time :p
anyway i meant where in your code did you put the command
under thebot.on("message", async (message) => {listener
try moving the console.log to before the await message line
Still not working, also checked logs and there's nothing again
if there is nothing, then the command is not running
you said you had another copy of the bot running somewhere else?
Yeah, but everything has been working normally
are you sure you didnt add the command to the wrong bot?
No, lol, I have the right token, and as I told you, I have another commands, and they're working fine
For example, mm!say <text>
And the send attachments one
that doesnt mean you're working on the right file/bot
if you change your other commands are the changes actually applied?
for whatever reason your bot is either not restarting/updating or not picking up the code you wrote
you need to figure that out
Ok, let me edit a command and tell I'm going to tell you if it updated the code 👍
There you go, @quartz kindle
then show your full code
ok
@coarse topaz ah i know why
change content === "bla" to content.startsWith("bla")
is there a package that will automatically change strings like "5d65m" to ms
I just want it to know what is a minute, day, hour
and can take it from the string
I just want to know if something like this already exists before I get into it
I mean, ms does things like that, but it does not seem to support the format you want
I mean I guess all I really have to do is just separate the strings and then add them up
@quartz kindle
let args1 = message.content.split(" ");
let id = args1[1];
let content = args1[2];
let m = await message.channel.messages.fetch(id);
console.log(id,content)
await m.edit(content)```
It doesn't work anyway 
i need help with my cogs pls
i think i scripted it wrong
bc i try to do my command
and in terminal feedback thing it says "ignored command ping, cant find the command"
i can post pics
i got it fixed
Python gang
is client.guilds.map deprecated
well on v12 you use client.guilds.cache
can node.js be exploited in any way to do something malicious? Over like some form of exploit?
Most languages can
Anything can be exploited if the attackers are given a chance
Like exploiting it to that point where it evals stuff where it shouldnt do
no
if you mean something like an sql/eval injection on some random bot built with discord.js then no
cool, then it shouldnt be possible to yoink my bots token without me being dumb
nice
yeah, unless you do something like an open eval command, or something stupid, nobody can do anything
not through discord
most tokens are stolen from github or glitch
because people forget to put them in a separate file and gitignore it
or just dont know that thats a thing
or a math command except the dev decided eval would do the trick
iirc discord resets your bot token if it finds it on github
I’d eval the equasion in a container so it doesnt have access to global vars
regardless, you should keep them in a .env file or some other file that you plan to ignore on git
containers are still not safe enough
people can still require("fs") and wreck havoc
What about the VM module
or require child process and delete everything
or require("http") and dos something
I mean
vm module is kind of cool but takes a bit.
lul
there's a lot of things that would need to be taken care of
so its generally discouraged to even try
is it normal to have 2 bots for the same bot?
but if you absolutely wanna go that route, i believe Brain did something like that
using a custom c++ javascript engine or something
OR
that's dedication
srsly is it normal?
oh wait i should probably provide context
i have a canary build (just in my test server) and a stable build (hosted 24/7 for everyone)
@quartz kindle are you busy?
your Brit too tim?
2am implied Brit but 👌cool
is there a quick method to check if your bot is in a server given server id?
thank you
const {body: background} = await bot.fetch.get("https://cdn.discordapp.com/attachments/533877198885486603/533877255810842635/800px-Thank-you-2017-background-320.svg.png");
at Client.bot.on (/app/src/index.js:99:46)```
?
what's bot.fetch
yea brains system is complex af
its a custom javascript interpreter embedded in his bot
so only the things he defined are available for users scripts
bot.fetch.get??
Does the ban members permission include fetching guild bans
If not, which permission allows fetching guild bans
I would assume it's view audit log, but not sure
does anyone know of a situation where they await messages but then it returns the catch that was supposed to be for timeout?
I remember having this issue before but I seriously forgot how to fix it and I just wanted to know if there was a cause of this error so I can find the fix more quickly
me got questionn
i made a welcome cog
and idk what to change bot and member to
(async isnt an error)
How can I keep my bot on 24/7?
I use Node.js
Ok i'll watch some
mhm!
is there a fast way to get all guild ids that have the bot?
What language
Iterate over the .guilds collection on the client with the map method.
is there a way to loop through each row in better-sqlite3 and get the first key value
also is it faster to loop through guilds using guilds registered in a database or should I iterate over bot.guilds
code: https://hastebin.com/qiviqagiru.cs
error: src/client/BotClient.ts:6:10 - error TS2614: Module '"../../../../../../Users/nerd/Desktop/ts bot/src/structures/Database"' has no exported member 'Database'. Did you mean to use 'import Database from "../../../../../../Users/nerd/Desktop/ts bot/src/structures/Database"' instead?
6 import { Database } from "../structures/Database"
I shut down my computer at 10PM every night and then I turn my PC back on 10PM. The problem about this is that my Bot shuts down 5 minutes after my PC
Question: How can I keep my bot online after my PC shutsdown
I have a hosting platform. I use Node.Js. But that doesn’t keep it on 24/7.
I have a hosting platform. I use Node.Js. But that doesn’t keep it on 24/7.
Uhh, lol that's a runtime/framework
Hosting is like. Glitch, Heroku, Google Cloud ect
that's not a hosting platform
Oh-
Would be kinda nice if it hosted itself 😂
@hardy vector You're exporting as default export default ... and importing as a named export import { Database } ...
Sorry for wasting your time @hoary elm I’m new to bot developing.
Your good. I'm pretty sure there's a list of hosts somewhere in the pinned messages
kok dapet role bot dev sih?? gimana??
@frank wraith #memes-and-media for other languages
submit your bots If you bots accepted you will get the role
where a submit? @wild mist
Yeah
owh oke
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Fun' object has no attribute 'channels'
what does this mean?
@frank wraith Did you use other library?
Then u use discord.js?
yeah use it
Btw u had bad english
yeah because i from indonesian
@wild mist discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Fun' object has no attribute 'channels'
can u help me with this?
Is that py?
yep
I dont use py
oh ok!
K
i am wait to approved my bot
Im indonesian but not isnt that bad
@spare iron cogs
i loaded the cog but when i type the commands in that cog it gives this error
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Fun' object has no attribute 'channels'
@spare iron ^
This is not Full Error
wait
Can U show me that code where u are using Fun.channels
wew
I asked a question not a suggestion
anyone here randomly know how to setup netdata notifications to send to a discord channel via webhook?
gua harus nunggu dlu sampe 5-7 hari ya bro @wild mist
from discord.ext import commands
class Fun(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
@commands.bot_has_permissions(add_reactions=True)
async def payrespect(self, ctx, *, user: discord.User = None):
"""Pay respects by pressing F"""
if str(ctx.channel.id) in self.channels:
return await ctx.send(
"Oops! I'm still paying respects in this channel, you'll have to wait until I'm done."
)
self.channels[str(ctx.channel.id)] = {}
if user:
answer = user.display_name
else:
await ctx.send("What do you want to pay respects to?")
def check(m):
return m.author == ctx.author and m.channel == ctx.channel
try:
pressf = await ctx.bot.wait_for("message", timeout=120.0, check=check)
except asyncio.TimeoutError:
del self.channels[str(ctx.channel.id)]
return await ctx.send("You took too long to reply.")
answer = pressf.content[:1900]
message = await ctx.send(
f"Everyone, let's pay respects to **{filter_mass_mentions(answer)}**! Press the f reaction on the this message to pay respects."
)
await message.add_reaction("\U0001f1eb")
self.channels[str(ctx.channel.id)] = {'msg_id': message.id, 'reacted': []}
await asyncio.sleep(120)
try:
await message.delete()
except (discord.errors.NotFound, discord.errors.Forbidden):
pass
amount = len(self.channels[str(ctx.channel.id)]['reacted'])
word = "person has" if amount == 1 else "people have"
await ctx.send(f"**{amount}** {word} paid respects to **{filter_mass_mentions(answer)}**.")
del self.channels[str(ctx.channel.id)]
def setup(client):
client.add_cog(Fun(client))```
#memes-and-media @frank wraith
@earnest phoenix I don't code in py
oh f wrong tag
okey
@neat ingot I never used netdata but I am pretty sure ifttt is similar to it.
Is it not loading @earnest phoenix
@spare iron it is loading
Then,
unlikely, i need to know specifically for netdata which conf file i need to be editing for a dockerized netdata instance
but commands not working
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 797, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 92, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Fun' object has no attribute 'channels'```
@spare iron shows me this ^
Its A Indentation Prob
oh!
So is anyone going to help?
It is in self.channels line
Is there a script to create commando commands?
It will fill in all those ```js
const Command = require('../../structures/Command');
module.exports = class HangUpCommand extends Command {
constructor(client) {
super(client, {
name: 'name',
group: 'groupname',
memberName: 'membername',
description: 'deschere',
guildOnly: true
});
}
async run(msg) {
}
};
This is how i thought it would be
Command name: # enter command name
Command group: # enter command group
...```
Like an interactive shell
@earnest phoenix It is in self.channels line
Yes they are wrong, cause self is fun cog, and it has no attribute channel
so how should i overcome it?
so.. uh no help i guess
Can U Tell me What will self.channel do?
Then I can help according to that
Looking like channel is dictionary yes?
post a specific message i want in a channel.
Which Channel, Is it stored in a list or dict or some db?
in the channel the command was used
see did u have channels dict?
umm no ig
ok let me check
hmm i asked but no response
Can, you tell me are u copying this code from somewhere?
@earnest phoenix channels is list
make it empty list at top not dict
channels = []
my friend gave me when i asked
self.channels = channels
oh
😅 I think he removed some lines😅
wait
U did it?
Is there a script to create commando commands?
It will fill in all those ```js
const Command = require('../../structures/Command');
module.exports = class HangUpCommand extends Command {
constructor(client) {
super(client, {
name: 'name',
group: 'groupname',
memberName: 'membername',
description: 'deschere',
guildOnly: true
});
}
async run(msg) {
}
};
This is how i thought it would be
Command name: # enter command name
Command group: # enter command group
...```
Like an interactive shell
SOMEONE
HELP
😅 I think he removed some lines😅
@spare iron not removed his codes are really huge so i just ask him for the code for that specific command. A Verified Bot Developer
@glossy elk no idea me beginner
@earnest phoenix Is it working now?
wait give me a min
def __init__(self, client, channels):
self.client = client
self.channels = channels
ㅤ
@broken crater stop posting nothing in every channel.
Is there a script to create commando commands while filling in name,desc,etc?
It will fill in all those ```js
const Command = require('../../structures/Command');
module.exports = class HangUpCommand extends Command {
constructor(client) {
super(client, {
name: 'name',
group: 'groupname',
memberName: 'membername',
description: 'deschere',
guildOnly: true
});
}
async run(msg) {
}
};
This is how i thought it would be
Command name: # enter command name
Command group: # enter command group
...```
Like an interactive shell
@glossy elk no, but you can make it
private void updateWater(){
int[] pushData = new int[resolution*resolution];
pushData = data;
for(int x = 0;x<resolution;x++){
for(int y = 0;y<resolution;y++){
if(data[resolution*x+y] == 1){
if(x<resolution-1){
pushData[resolution*(x+1)+(y)] = 1;
}
if(x>0){
pushData[resolution*(x-1)+(y)] = 1;
}
if(y<resolution-1){
pushData[resolution*(x)+(y+1)] = 1;
}
if(y>0){
pushData[resolution*(x)+(y-1)] = 1;
}
}else{pushData[resolution*x+y] = 0;}}}
data = pushData;
}
This function is called once a second but it just fills the data array with ones can someone help with this
Really I Need Help With DiscordGO
check the bot's perms in that particular channel
message.channel.permissionsFor(message.guild.me).has(<Permissions>)?
yes
Thanks
In discord.js, how can I check whether or not the Everyone role has specific permission in a channel?
that's not it
yeah
Ok thanks
i'm not sure if that's the correct way of getting permission overwrites but yeah, use the guild id
await reaction.remove(1);
bu doğru bir terim midir
sadece 1 reaction silmesi için
@summer torrent
english only in this channel. (also no)
dur çeviri yapıp geliom .d

@summer torrent Ok if i want to check if the permission in true or false?
await reaction.remove(1);
is this a correct term
for 1 reaction delete only
Hello
hi
Sorry, i´m new on this. How can I have a color?
are you mention the bot developer role ?
I think not
this channel help to code
@balmy knoll has() is Boolean
true/false
@lavish summit you need an approved bot on website
for Bot Developer role
@obtuse thorn WOW
What should i do to make ping go down?
is the reactions bot down?
@misty hemlock go to their support server
idk where it is
F
click "Join Support Server"
https://cdn.discordapp.com/attachments/272764566411149314/716579731453247528/wtf.PNG
like i added reaction roles and a sticky message
where ;-;
can you dm me the link? or no?
want me to invite ?
yes please

Neon's Info
Total servers:
16
Total users:
827
Ping:
9544ms
whats that
Send help
@misty hemlock ^
0k thanks
await reaction.remove(1);
is this a correct term
for 1 reaction delete only
@summer torrent
no
how
where ;-;
@misty hemlock
Ay, esta chingadera ya valió. xdxdx
eh?
What should i do to make ping go down?
@obtuse thorn get faster internet speed
vds
#memes-and-media pls
Why?
this channel is for chatting about development
Okay
await reaction.remove(1);
is this a correct term
for 1 reaction delete only
pls response
remove which user's reaction
message.author
@obtuse thorn get faster internet speed
@summer torrent bot dosent run on my internett and i have 300mbs... But my bot is on a vps....
I mean on a vps
how do i do that
just use them normally
try{
If(something)Error here
else
}
catch(e){
console.log(e)
}
yeah
Yes
this doesnt seem to be working
Well not literally that
its still saying unhandled promise rejection
just catch would become inefficient
try {
if (a condition) {
mg.edit(Something else)
} else {
mg.edit(Something)
}
} catch (e) {
Wanna handle here
}```
Is mg defined?
what is mg
and its bot's
Then the message is more than 2000 characters
Yeah i want it to send in a new message
is this discord.js
yeah
do two messages
use {split:true}
isn't that only for sending
That's a thing??
it is just returning after that error
@golden condor yes
it is not reaching to catch
Holy shit I wish I realised this sooner
i have made a catch which used to work without try catch
I just manually checked lengths
holy shit really
but it wont work on my case as it would split in middle of a sentence i suppose
is it the content that you want to edit that has over 2000 length?

