#development
1 messages · Page 992 of 1
@elfin finch you're trying to use forEach on something that either doesnt exist or was not found
@quartz kindle ? How do I fix it, do you need to see my index.js?
yes
yes
does it have discord.js in dependencies?
ok wait
yes
@quartz kindle https://sourceb.in/c3b609726c here then
v11 is outdated
though its highly unlikely that it'd have updated the package without installing it
even outdated though
his error points towards it not even being installed
can i change the depemdencies and put discord.js v12?
no, uninstall the old version then install the new one
if replit automatically installs dependencies on save, then yes
npm uninstall discord.js
in cmd?
@elfin finch one of your commands does not have aliases
Which one?
idk
the one without any aliases
https://hasteb.in/vajaleyi.js when i do _cc hello hi and try running _hello the custom command i created i recieve an error saying cannot send an empty message but on the GUI in mongo compass i can see it
im a mongo noob
sry
pls help
if you want to know which one, console.log(f)
@quartz kindle wait what, do i do that in terminal
@hardy vector the problem is most likely in the code that runs the command
not the code that saves it
oh
@elfin finch
this.on('message', async (message) => {
const mentionRegex = RegExp(`^<@!${this.user.id}>$`);
const mentionRegexPrefix = RegExp(`^<@!${this.user.id}> `);
if (!message.guild || message.author.bot) return;
if (message.content.match(mentionRegex)) message.channel.send(`My prefix for ${message.guild.name} is \`${this.prefix}\`.`);
const prefix = message.content.match(mentionRegexPrefix) ?
message.content.match(mentionRegexPrefix)[0] : this.prefix;
if(!message.content.startsWith(prefix)) return;
// eslint-disable-next-line no-unused-vars
const [cmd, ...args] = message.content.slice(prefix.length).trim().split(/ +/g);
const command = this.commands.get(cmd.toLowerCase()) || this.commands.get(this.aliases.get(cmd.toLowerCase()));
if (command) {
command.run(message, args);
} else {
custom.findOne({ Guild: message.guild.id, Command: cmd }, async(err, data) => {
if(err) throw err;
if(data) return message.channel.send(data.content)
else return;
})
}
});``` i added the else statement on to execute the custom cmd
@hardy vector ur in all my servers😂
ok
._.
ty tho
nodejs v6?
Nice
gg
@elfin finch
@quartz kindle so after jsfile.foreach i ad console.log(f) and it's gonna tell me which one is wrong?
node.js v6 wtf
yes lmao
its ancient
^
holy shit
v14
it was a long time without using it
@elfin finch it will show all commands loading in your terminal, the last one that shows up before the error is the culprit
ok thanks
lmfao
can anyone help?
@elfin finch it will show all commands loading in your terminal, the last one that shows up before the error is the culprit
@quartz kindle it stopped at the first command lmao
i wanna make a command that if the user writes .pokemon it shows their pokemon for their user tag
from the mons.json file
@elfin finch so open the first command and check if it has aliases
if it doesnt, give it some
@long yew i already told you how to do it
what are you stuck on?
starting it
if it doesnt, give it some
@quartz kindle How do i give it some (sorry for the spam im new to this)
your code is doing pull.config.aliases.forEach
which means, pull is the command file. and inside the file it looks for a config property
you want me to put pull.config.aliases.forEach on all of the commands?
and inside the config property, its looking for an aliases array
Someone knows any free Glitch alternatives? repl.it
@quartz kindle is it correct so far?
so your code is expecting all your command files to have something like module.exports.config = { aliases: [a,b,c] }
or something similar @elfin finch
show what your command has
@long yew i assume the switch case is for commands, right? so "pokemon" is the command used
yeah
a switch case works like this:
show what your command has
@quartz kindle https://sourceb.in/7322780007
switch(command) {
case "a":
run
the
command
code
here
break;
case "b":
let bla = something;
message.channel.send(bla);
break;
case "c":
... etc
break;
...
}
@long yew
o
so under the pokemon case, you get the contents of the json file, get the data from the user id, and send the data, then break;
each case is the full code for that specific command
@elfin finch see
switch(command) {
case 'pokemon'
break;
case "b":
let bla = something;
message.channel.send(bla);
break;
case "c":
... etc
break;
...
}
idk what else to change
switch(command) {
case 'pokemon'
break;
case "b":
let bla = something;
message.channel.send(bla);
break;
case "c":
... etc
break;
...
}
@long yew
how do you send messages?
@elfin finch see
@quartz kindle yes i do see it
didnt you swap to a command handler anyway?
@elfin finch your config object has name, description, usage and accessableby
but has no aliases
oooh
and your code is looking for aliases
so i put that at the end of configs? thanks
my question is related to sql. i have duplicate values in table the id of them being same. i want to use update command to increase the values of subsequent duplicate values by 1. by that i mean ``id name
1 ,uchiha
1,uchiha
but i want 1 uchiha , 2 uchiha
i am bad at explanation
set a field to ID and set it to AUTOINCREMENT (SQLITE) and as Primary_KEY
the problem is the data already exists with duplicates
the auto increment will generate a new ID for every item and Primary_KEY will make it unique
aliases:[]
@quartz kindle ok so i just put that at the end of module.exports.config = {
(also makes sense to set the id as primary key)
would it work with data which already exists
only with new data if you edit the field in the Database
is it sqlite or mysql?
what about existing one
(there is probably a way for existing data but idk)
or other
its postgre
ah
i asked because sqlite has a hidden _rowid column you could use
but not postgre afaik
switch(command) {
case 'pokemon':
let pokemon = mons[`${message.author.id}`] = []
message.channel.send(pokemon);
break;
}
})
``` @quartz kindle what is wrong?
row_id?
export the data then update the database and import it back in and hope it works
@long yew very good you almost did it
the = [] part is wrong
mons[message.author.id] will return ["pokemon","names","here"] which is an array of pokemons
what i did is
FROM
(
SELECT row_number() over (partition by userid order by userid) AS rn,userid,character
FROM userdata
) AS idek
where userdata.character = idek.character and userdata.userid = idek.userid```
now to send it as a message you need to join them
ok
so just add .join(", ")
http://tryitands.ee
@quartz kindle yes very helpful advice thanks
but that thing is assigning same id to duplicate values
switch(command) {
case 'pokemon':
let pokemon = mons[`${message.author.id}`] = ["pokemon","names","here"]
message.channel.send(pokemon);
break;
}
})``` @quartz kindle so is this correct?
no
like 1 = batman,1= batman, 3= superman. although its not assigning the 2nd value
@long yew
mons[message.author.id] will return ["pokemon","names","here"] which is an array of pokemons
which means, i am explaining what the value contains, not telling you what to do
http://tryitands.ee
@quartz kindle Well now forEach is undefined
@elfin finch show what you did
name: "ban",
description: "Bans a Users",
usage: "-ban",
accessableby: "Admins",
}```
i did that and aliases is no longer undefined
but forEach is
....
no
you add
an aliases field
to the object
{
bla:bla,
bla2:bla2,
aliases:[]
}
hmmmmmmmmmmm
@long yew do you know what is an array?
im not able to understand whats wrong with this code
this is an array: [a,b,c]
this is a string: "abc"
you cannot message.channel.send([a,b,c]) but you can message.channel.send("a,b,c")
oml
in order to convert an array into a string, you use the .join() function
lmao
ok
why use an or operator there?
for example if you do [a,b,c].join(", ") it is converted to "a, b, c"
your mons[userid] is an array
@earnest phoenix no, why another if statement that does the same thing as the first one
@earnest phoenix no, why another if statement that does the same thing as the first one
@pale vessel and that
switch(command) {
case 'pokemon':
let pokemon = mons[`${message.author.id}`] = [].join(", ")
message.channel.send(pokemon);
break;
}
})``` correct?
so in order to send mons[userid] you need to use mons[userid].join(", ")
hmm
switch(command) {
case 'pokemon':
let pokemon = mons[`${message.author.id}`].join(", ")
message.channel.send(pokemon);
break;
}
})
```correct?
yes
why dont react?
@client.command()
async def reaccionar(ctx, *, arg):
if arg == 'bien':
new_msg = await ctx.send("Bien")
await new_msg.add_reaction("721174526930714634")
if arg == 'mal':
msg_new = await ctx.send('Mal')
await msg_new.add_reaction("721174460073377804")
@hazy sparrow you have an extra } at the end
Read the error
i did
@earnest phoenix You're not passing an actual emote
command is not defined
Let's help some people's 
how did you define command?
i didn't
then thats the problem?

@quartz kindle how you got certified developer
what do i define it to?
filled up some forms
you have to extract the command from the message content
@slender thistle what?
the same way you did it for your other commands
um
@quartz kindle if we get bot developer tag then we get certified developer
this anything to do with it?
https://top.gg/certification @earnest phoenix
@earnest phoenix ^
Ok
Thanks
**Certification is currently closed. We are actively working to make an improved system to benefit developers
**
Lol
@long yew is command not _command
ik i was just wondering
or change de switch(command) yo switch(_command)
@hazy sparrow you have an extra } at the end
@quartz kindle at line 24?
ok
@earnest phoenix what should command =?
@hazy sparrow 22, 23 or 24, one of those is extra, you can remove whichever you want
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
Ngl thanks
How's it possible to like make functions that extends from Guild.members?
For example like
message.guild.members.Newest()
ynot
guild.members.newest() = code
No?
@earnest phoenix you can use prototypes, but the official discord.js way is to use Structures.extends
I know you can edit client objects not sure if you can edit that
^
i'll show you an example
K
https://kyoya.why-am-i-he.re/eZZqka How can i fix this? (V11)
sxcu.net free ShareX uploader
this seems useful
I don't know why it's happening
@earnest phoenix show your 1369th line
Tim u know why?
@earnest phoenix actually nvm, managers are not extensible structures
ill show an example for both then
Oh k
can anyone help?
@long yew problem?
when i write .pokemon
it displays them in command handler
switch(command) {
case 'pokemon':
let pokemon = mons[`${message.author.id}`].join(", ")
message.channel.send(pokemon);
break;
}
})```
That's console not command handler btw
@earnest phoenix Glitch adlı siteden botu kodlıyıp VDS lerden aktif tutuyorum.
@gleaming glen Bu kanalda Türkçe konuşmak yasak değil miydi?
@scarlet dragon vds kaç para
is there a way to have a general catch in a python file where if an error happens it runs that to send the error to a channel
@earnest phoenix Değişiyor
@gleaming glen abi
try-except
@earnest phoenix ```js
// extend an "extensible" structure (these include Message, Member, User, Guild, Channel, Role, etc...)
Discord.Structures.extend("Message", whatever => {
return class Message extends whatever {
xyz() {
return this.content + "zyx";
}
}
});
// extend a manager (extending a manager must be done BEFORE creating a discord client)
Discord.GuildMemberManager.prototype.newest = function() {
return this.cache.sort((a,b) => b.joinedTimestamp - a.joinedTimestamp).first();
}
@earnest phoenix 60
yeah but i cant put a try except inside a try
why not
mine is ₺120
cuz thing says no
Also what
i can try it
@quartz kindle oh thanks tim, i completely understand it now
>>> try:
... 5
... try:
... 3
... except:
... 6
... except:
... 4
...
5
3
Nesting them works just fine
yeah, thats actually super useful tim
Thanks to tim as always lol
im totally doing that for adding/removing/checking balance of users
How do you get the amount of server boosts a server has using discord.js
...
read the docs
im using the prototype method to basically rewrite half of discord.js
Lol
Mmmh Tim your code I just added it to my code and it sais that it can't send an empty message 🤔
wut
const Discord = require("discord.js");
Discord.GuildMemberManager.prototype.newest = function() {
return this.cache.sort((a,b) => {b.joinedTimestamp - a.joinedTimestamp}).first();
}
const client = new Discord.Client();
message.channel.send(message.guild.members.newest())
?
@tulip ledge well, newest should return a Member object
you cant send an entire object
also, if you put {} around b and a you have to return it
?
my bad lul
Tims big brain shrunk for a second
(node:45496) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
show code
should be either (a,b) => b - a or (a,b) => { return b - a }
newest().tag still gives empty message
Members dont have tags?
^
@quartz kindle wait tim... So if i wanted to do something like
<Message>.content.<function> how would that be?
Like what am i supposed to extend? Or like i need to use a prototype on the Message.content?
newest().user.tag is what u need @tulip ledge
Message.content is a string, so you'd need to extend the String prototype itself
Oh
Ih yeah its a member
a member doesnt have a tag
but a member has a user property
K tim thanks
which has a tag
(node:15716) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message 🤔
newest().tag is no
newest().user.tag is yes
Index.js
const Discord = require("discord.js");
Discord.GuildMemberManager.prototype.newest = function() {
return this.cache.sort((a,b) => b.joinedTimestamp - a.joinedTimestamp).first();
}
const client = new Discord.Client();
message.js
message.channel.send(message.guild.members.newest().user.tag)

if(message.author.bot) return;
console.log(message.guild.members.newest())
message.channel.send(message.guild.members.newest().user.tag)
// Ignore all bots
if(message.author.bot) return;
Lul

let rolesNum = member.roles.cache.size.filter(r => r.id === "264445053596991498"); aint working :/
derku
You find
what the fuck did you think when writing that code
*use
Tim is big brain boy
what the fuck did you think when writing that code
@earnest phoenix i think unicorns tbh
@earnest phoenix size is a number, not an array. remove the size thingy and u good
.size 
k
also you can only get one element when searching for an id so you might aswell use member.roles.resolve(id) or member.roles.cache.get(id)
didnt work removing .size
whats your current code
did you add size
let rolesNum = member.roles.cache.filter(r => r.id === "264445053596991498")
I think he want the number of roles
add size
@earnest phoenix so that will return an array with one element containing the role you want
is that what you wanted?
If yes, good
oh yeah lol
wait
why did they call it rolesNum
oh my
bruh
that's like, completely the oposite of what you're doing
bruh x3
let rolesNum = member.roles.cache.size-1
no
Yes
@everyone role has a different ID for each server
let rolesNum = member.roles.cache.size-1
So you're doing -1
^
most libs have a guild.publicRole
Dude
everyone is just the guild id
Constantin has better solution
but you can -1 if you're not going to view the values
Just do -1
^^^^
yes, I'm just pointing that getting everyone by ID ain't gonna work
I didn't say it was the best option
@earnest phoenix let rolesNum = member.roles.cache.size-1 do this and u will be fine
yes it will
unless your cache somehow fucked itself
only if it's the guild's id
no, hardcoded ID won't work for all guilds
@earnest phoenix
let rolesNum = member.roles.cache.size-1do this and u will be fine
@earnest phoenix mk
oh u ment hardcoded
well, I'm basing on the current context
return class Message extends MessageS{
Exceeds(Length){
return this.content.length > Length ? true : false;
}
}
})
message.Exceeds(1);```
`message.Exceeds is not a function`

MessageS?
"Message", MessageS <=
Currently following tim's thing
Like Tim said you need to define it before creating a client
That he showed
oh my, indent that thing plz
So
@tulip ledge that applies to a manager... Message isn't a manager
const Discord = require('discord.js')
Discord.Structures.extend("Message", MessageS => {
return class Message extends MessageS{
Exceeds(Length){
return this.content.length > Length ? true : false;
}
}
})
const client = new Discord.Client();
Oh
I didn't know that
extending a structure needs need to be done before the structure is used, so in case of messages, before you receive a message event
or it will only be applied to future message events
Oh so as Many messages get received as currently... So this extend of the structure must be done before the construction of the client?
Oh wait nvm i get what you mean... Well this can't be done on a simple eval


Why does this always return false?
if(!Length){
return "No length was included";
}
if(typeof(Length) !== "number"){
return "Included length isn't a number";
}
return this.length > parseInt(Length) ? true : false;
}
"What".Exceeds(100);```
anyone know how I can pin a message that the bot just sent in a text channel when you run a command
with discord.js v12
whatever.pin()
});``` @unborn fulcrum
ooo ty <3
don't think .then is a callback
@digital ibex actually no, both response times are same... Just both looks and works differently
it's equivalent to await
this is a callback```js
hello("yes", (error, res) => {
});```
yeah, but u can still use await there, and callbacks are not slow wym?
await and .then aren't callbacks
ik
They're promise resolvers

Oh i thought you was confused about the thing i said lol
https://hasteb.in/adisutem.js
it does the role menu but then it crashes and gives me this error at Function.Module._load (internal/modules/cjs/loader.js:879:14)
(node:1704) UnhandledPromiseRejectionWarning: OverwriteModelError: Cannot overwrite ReactionRole model once compiled.
at Mongoose.model (C:\Users\kenra\Desktop\Frosty Rewrite\node_modules\mongoose\lib\index.js:524:13)
Does anybody know what could be causing the abortErrors? After a simple error?
It's an internal server error on discord's end
how can i use heroku with github?
huh
how can i use heroku with github?
@earnest phoenix I can explain in DMs
ok
@earnest phoenix I have a similar question but its a little different, mind if I ask?
Yes
so the question is, how can I add channel permission overwrites for a role that I just created
What lib
discord.js v12
{
bla:bla,
bla2:bla2,
aliases:[]
}
@quartz kindle so i add that inside that part?
Get the channel and use GuildChannel#createOverwrite
@smoky spire I did that, but my issue is getting the role ID from the role name now
when i write .pokemon
it displays them in console
switch(command) {
case 'pokemon':
let pokemon = mons[`${message.author.id}`].join(", ")
message.channel.send(pokemon);
break;
}
})```
Just resolve the promise of the create and you have the role object @unborn fulcrum
@smoky spire how would I do that exactly?
ty
Anyone help me making an api thing cuz iam new to python and i watched some videos and they are all about js or outdated
so if someone would help that would be awesome
lol
like send me the code and explain or something @solemn latch thats what i needed
lol
i dont use python
@final summit if your new to programming you either have to learn from stage 1 or reverse engineer simple logic
but not knowing why things work is bad
Making API? Use Flask or Django
how did you read that much, its like a 20 minute read
What didnt work?
the whole thing
Hmm
first push to heroku since updating node/djs
and I'm getting a mess of start up errors
updating to djs 12?
a lot of structure changes
are there process env requirements?
i wouldnt think any would have changed
does ../errors exist?
I'm thinking maybe the version didn't update in heroku some how
idk how heroku works tbh
is your repo private
yes
😮
Heroku is (usually) fine for hosting a random website that won't be constantly getting requests, as it automatically puts the server to "sleep" when it doesn't receive any requests. If you try to do this with a bot, it won't receive any requests, it'll be put to sleep, and the websocket connection will be closed.
It was the easiest thing to set up when I needed a web server
I've never had that issue
like, actually dont use that
in 6 months its never been unresponsive
how would I delete a message if it was ever edited in a certain channel? Discord.js v12
also another quote
like
Bots are not what the platform is designed for. Heroku is designed to provide web servers (like Django, Flask, etc). This is why they give you a domain name and open a port on their local emulator.
Heroku's environment is heavily containerized, making it significantly underpowered for a standard use case.
Heroku's environment is volatile. In order to handle the insane amount of users trying to use it for their own applications, Heroku will dispose your environment every time your application dies unless you pay.
Heroku has minimal system dependency control. If any of your Python requirements need C bindings (such as PyNaCl binding to libsodium, or lxml binding to libxml), they are unlikely to function properly, if at all, in a native environment. As such, you often need to resort to adding third-party buildpacks to facilitate otherwise normal CPython extension functionality. (This is the reason why voice doesn't work natively on heroku.)
Heroku only offers a limited amount of time on their free programme for your applications. If you exceed this limit, which you probably will, they'll shut down your application until your free credit resets.
^
hah
just because you didnt have issues at one point, doesnt mean it wont cause issues later
try to avoid glitch and heroku as much as possible
glitch is already doing what they can to get rid of discord bots, Heroku likely will do the same at some point, since your using them in ways that are unintented
oh wow
Usually your options are :
spending 5$ or less on a very cheap vps
asking a friend to host it for you on their pc
using a rapsberry pi or another low voltage hardware capable of running a bot
running on your pc and letting it on 24/7
for example, i installed linux on my old Wii that i had, running my bot there
runs rather smooth for being such an old piece of hardware
I suppose I'll have to run it local til I figure this out
you can run bots on old cellphones, laptops, old consoles, mostly all new tech is capable of doing that simple task
yeah its a relatively small project with not a lot of demand
should be fine then localhosting
you might wanna use an old hardware if you plan on shutting down your pc every now and then though
raspberry pi is a decent option
That's also the thing. There's no errors @lyric mountain
discord.js I guess?
maybe 🤷♂️ but wouldn't anyone else be having the same issue then?
"maybe"??
you're either using discord.js or not
anyway, how do you know it is not working?
yes im using discord js. Because I have it in my main server and it works. but my test server it's not
and it has all perms
wait what
I wanted to make a random no. Cmd but the no. That already shown one time that should not come again. In discord.js v12
ok, so you have a car that runs on gasoline during day and beef-power at night?
that makes no sense

i am so confused what the test server has to do with the lang you using
let's go step by step
How you became bot dev @earnest phoenix
what programming language are you using?
javascript
good
ok, nice
Lol
now, what library?
discord js
Discord.js? And which version @earnest phoenix
kuuhaku setup wizard v1.0
Nc
what is the expected result vs the current result?
as in, what did you expect to happen that is not happening?
#development message
@surreal notch Math.random() * somenumber
I was expecting it to function in ALL servers. It's not. I have it in tow different servers. It works in one. Doesn't work in another
this might make things a bit more easier
But that no. Should not come again
bigbeef, do you use Visual Code Studio?
yeah
Math.random is....well....random
do you know what step debugging is?

he'll at least see if the code is firing when the triggers an event
for vsc
Ya it's random but I think it will repeat
yes, for VSC
yep
run the code on a debugger and set a breakpoint on the trigger line
I was expecting it to function in ALL servers. It's not. I have it in tow different servers. It works in one. Doesn't work in another
@earnest phoenix what doesn't work?
the bot itself?

usually on the beggining of your code that you are trying to run
Yes the bot itself. But i also have all my code to console log but nothing shows up
to make sure the code is running. From what i've heard you arent getting an error
yep
if youa rent getting an error, lets exclude the other possibilities
is the code even running?
yes

no random emotes ultron
either do step debugging or console.log('test') to make sure it is
i can use it 100% in one server
i'm able to run commands as well
lets say you have a command called ?ban, you should be running the console.log('test) into the ban.js file, or whetever you are running that command on
have you given your code yet?
specifically, the command handler 
if thats out of the way and you know the command is properly being triggered, use the step debugging every major step of your code with breakpoints, that'll tell you where the code is going rogue
if you still cant get it after that, post the code of the specific command you are trying to run on pastebin or some other bin website, then send link here
pastebin hastebin
a woo does rock
have you assigned a subdomain just for that?
lol
ok. be back soon
aight
the one better than that is for the discord api status
Welcome to Discord's home for real-time and historical data on system performance.
lol
thank sharon for that one, its hilarious
I prefer https://tryitands.ee
Hmm
this is some top notch stuff too http://welcomer.is.a.really.shit.bot.trinit.is/
welcomer sucks
Lol
welcomer 101 client.on('GuildMemberAdd', () ) message.reply('welcome!');
done, welcomer, gimme 5$
can u check not.erwin ?
not sure

what is it?
awh
nvm
one site said $3
wouldnt let me buy
all the other sites say $600+
woo.win

This error even tho there is a parent
it works when im manually using lock perms from eval command
and im using await to create the channel and then set it category to a channel and then lock it.
its creating and setting parent alright
but errors on the third part
it shouldnt do that since its await....... right?
(this command was made in v11
I changed it to v12
Just the cache and manager thingies
Could something in update have broken it?)
Figured it out. Thanks whoever helped me. I'm still learning
me?
https://hasteb.in/adisutem.js
it does the role menu but then it crashes and gives me this error at Function.Module._load (internal/modules/cjs/loader.js:879:14)
(node:1704) UnhandledPromiseRejectionWarning: OverwriteModelError: Cannot overwrite ReactionRole model
pls help me
ok, how would one make a Confirmation message on a command ? are you sure you want to do this? etc etc
@hardy vector what are you trying to do?
make a reaction role cmd
@earnest phoenix in what lib
py
but when i do that cmd it makes the menu and reacts to it but then it crashes and gives me that error
@earnest phoenix not entirely sure, await the message author to send a message, check if it's the conformation and then execute shit
define a check function that will check the author id
but when i do that cmd it makes the menu and reacts to it but then it crashes and gives me that error
@hardy vector lib/code?
They have some nice examples
JS/i linked code
it's a Guild.owner only command, i'll check it out rq, tyy
Can someone help me? My clear command works but my kick,ban and meme command don't
JAJAJAJAJAJAJAJAJ MY JSON FILES CORRUPTED
@elfin finch lib/code
@hardy vector in a sec
how'd you pull it off
@elfin finch lib/code
@pure lion https://sourceb.in/3cd0eca413
https://srcb.in/8e6fc25fbb
https://srcb.in/488a4a963f
here
i really hate reaction work 😂
?
trying to get the bot to send a Confirmation message before running the command..
ah, reaction buttons
@elfin finch what is img?
@elfin finch what is img?
@pure lion ?
why cant this just be easy for my small brain
d.js?
@pure lion ?
@elfin finch reddit
Could someone help me pls?
I have a problem .content returns : undefined
and response returns:
content: 'no', at one point.
var response = await message.channel.awaitMessages(message2 => message2.content === "yes" || message2.content === "no", {
maxMatches: 1,
time: 300000,
errors: ['time']
});
console.log(response)
console.log(response.content)
@elfin finch reddit
@pure lion yes?
img - image
@pure lion Now its the right code xd
But from what?@elfin finch
isnt using awaitmessages blocking 
But from what?@elfin finch
@pure lion idk
IMG needs to be defined
isnt it tho
@solemn latch What do u mean
nothing nvm, its not
xd
blocking just means nothing else can happen until its done
@elfin finch nope
oh, how do i define it then (im a nooby coder, sorry for the simple questions)
@clever tree isn't response a collection of messages?
Assuming that's what it is
did you try response.first()?
Get the subreddit image?
@pure lion Huh?
@pale vessel Oh. I will try it out wait.
how
Pass the name of the Reddit const through functions at the top
Or include it at the top
@pale vessel thx ;)
*sit in the corner cradling legs*
@elfin finch in the Reddit command file, make a const and require the Reddit npm
Oh yeah forgot about you
:((
*dying*
@pure lion that makes sense but why arent the ban and kick commands working
@hardy vector uh, the bot can react with custom emojis
Just sayin
Just ask for an emoji ID
ik but thats not my problem
Okay wait
huh?
if you want u can take a look at my pagination lib, it's written in java but might help u figure out how to make yours work
Big sure, @hardy vector, is it in the docs?
@elfin finch in the Reddit command file, make a const and require the Reddit npm
@pure lion i downloaded the reddit npm, why it still no work tho

I'm literally
am i that dumb
but i did get the reddit npm
bro tip: use yarn
@elfin finch IDK, DID YOU?
Then npm i random
:h:
@elfin finch IDK, DID YOU?
@pure lion yeah i typed "npm i reddit" into terminal
why don't you just use their json response
Did it install?¿
not sure what you want to do with the API though
yes it did install
Epiccccc
and?
can you make me a 20 point presentation on it @pure lion
@bot.command()
async def purge(ctx):
if ctx.author == ctx.guild.owner:
embed = discord.Embed(title=":warning: Warning! :warning:", description=("""Are you sure you want to purge this discords prefix?
Once this servers prefix is purged there is no way of getting it back!"""), colour = discord.Colour(int('ffcc66', 16)))
await ctx.send(embed=embed)```
Halp 
Also did you type exactly "npm i reddit"
@pure lion thanks:D
@earnest phoenix whats wrong
await a message and then react to ir
Ir
It
Idk py tho, so that's all the help I can give rn
Also did you type exactly "npm i reddit"
@pure lion was i not supposed to tho
Fuqk
Go to the npm website and search for Reddit
do i have to set up a const
Go to the npm website and search for Reddit
@pure lion i did and it still no work
Okay yk what
ok then what
yes thats the one i used
and i typed npm install reddit
into terminal
and it downloaded
ok thanks
lol
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Context' object has no attribute 'add_reaction'
i'm lovin' it

Can I get help with quick.db
hello every time I launch my bot the channelCreate event does this launch normally?
module.exports = async (bot, channel) => {
if(channel.type === 'dm') return
let guild = bot.channels.get("534738699628576780").guild
let chan = `https://discordapp.com/channels/${guild.id}/${channel.id}`
const entry = await guild.fetchAuditLogs({type: 'CHANNEL_CREATE'}).then(audit => audit.entries.first())
user = entry.executor
let embed = new RichEmbed()
.setDescription(`
> Nom du salon crée : ${channel.name}
> Créé par : ${user}
> ID : ${channel.id}
> Description : ${channel.topic}
> [Aller vers le nouveau channel](${chan})
`)
.setColor('#14EB39')
.setTimestamp()
.setFooter(`Logs serveur ${guild.name} `)
WebBlock.send('', {
username:"Juzoo logs (Channel Create)",
avatarURL: bot.user.avatarURL,
embeds:[embed]
})
}```
(v11)
i dont understand the question 🤔
all i got was "every time i launch my bot the channel create function - - - - - "
Can I get help with quick.db
Pleeeease? :3
how to say, when i launch my bot it is supposed to execute that event ready?
you want it to run on startup?
Does anyone know quick.db :sad:
no no actually, when I launch the bot everything works fine except that it executes the channelCreate event on some channels when no channel is created
I think my brain is going to fall out
mood
no it does not create any channel just it logs channelCreate while nothing is created
No lynx, it gets the log of when a channel was created
you want it to run on client.on(create_channel ?
I can't make myself understood let it fall
Woo can you quickdb? I need help
i use mysql 
:sad:
whats the error?
I already use quick.db what do you need?
Can someone teach me how to make a python bot music please. No good tutorials out there are working for me. most of them are unclear or fuzzy videos. and mostly outdated. just dm me if you can help me or ping me here pleeease
you cannot use youtube tutorials
they're simply outdated and not up to standards
the yt vids
I never use quick.db for this use I doubt I can help you I even doubt that this is possible 
ya thats y i asked for someone to teach me
something as complex music/audio requires a lot of programming knowledge including byte manipulation and buffering
no one will teach you for free
it looks like you just set it using add @pure lion
you can teach yourself though

what about making a basic bot?
@solemn latch but I got errorz
what about making a basic bot?
@cerulean lake start with a ping command.
follow discord.py docs
can someone teach me how to make a basic bot
No
:l
You're a big boy
IDK how
my bot isnt starting up
again, nobody will teach you for free
you can teach yourself by following the docs
db.prepare(`CREATE TABLE IF NOT EXISTS ${options.table} (ID TEXT, json TEXT)`).run();
this is the error im getting
WHAT DOCS
otherwise pay for someone's time invested in teaching you
do you have a database setup already?
WHAT DOCS
@cerulean lake https://discord.py.com
cry y would i pay to do that
people pay thousands of dollars to go to college for programming
:p
why would people teaching you be free
do you have a database setup already?
how would i do that?
o
yeah |:
sharding depends on your library
I have already read that
I have sucess to create shard
But
To get channels, someone Say me it's with broadcasteval but to get users & guilds also?
if you're using the sharding manager, and you have more than 1 shard (which happens at around 1500 guilds)
then your bot will be split into more than 1 process, meaning that each process has its own separate memory and contains only a part of the total data
including users, guilds, channels, everything
in order to join this information, the sharding manager offers two functions, broadcastEval and fetchClientValues
what these functions do is they send messages to all shards, and ask them to send their data over
the type of data that can be sent is limited tho, they can only send you back simple values such as strings, numbers, arrays, etc. you cannot request a full Channel object for example
Oh okay
bot.shard.broadcastEval(`
let channel = this.channels.cache.get('543511427651207169');
if (channel) {
channel.send("test")
}
`);```
Like that to get a Channel?
With shard?
If I want to send embeds and messages through a webhook do I still need to apply for a bot? Or how do I get about that
that will send a message to all processes and tell them "hey check this channel id. if you have it, send a message to it"
which is the correct way to send a message to a channel
yes, but depends what you want to do with them
in the example above you're just telling them to send data to the channel, the situation changes a bit if you want them to return data to you instead
Get users and guilds informations
const WebBlock = new Discord.WebhookClient("id web", "key web")
WebBlock.send(...)```@tawny obsidian

you don't need to use a whole ass library just for a webhook
lol
just manually send a request through some shit like wget, curl or postman
bot.shard.broadcastEval(`
let guild = this.guilds.cache.get("${guild id here}")
if(guild) { return guild.name; }
`).then(results => {
console.log(results)
})
in this case, results will be an array of responses from all shards
something like [undefined,undefined, guild name here ,undefined] if you had 4 shards and the guild was found in one of them
Yea @wicked pivot im brand spakin new at this so where should I go to start from the very beggining
Is there any limit of https://discord.js.org/#/docs/main/12.2.0/class/ReactionUserManager?scrollTo=fetch ?
👍
Weird ping



