#development
1 messages · Page 1390 of 1
Yeah
Like i said i just split out the id from the base emoji name and get the id from the cache
somebody can help?
first() doesnt return a random
it returns the first one
if you do that twice the outcome will be the same
i want to make &startBingo [time] command and i want to wait [time] and start bingo but what if user wants to stop bingo so i need to make &stopBingo and i dont know how to do that can someone help
I split the emoji:123456890
@rare plume not all emojis use that pattern
native emojis use unicode notation
but if you pass a normal emoji wont it error?
If you check it first it won't
But like i said i am also looking for a new way to detect emojis in messages
Mine is also shit
For now it works but a improvment would be also good
try this reg
<(a:|)\w+:\d+>
actually, <(a:|)(\w|\d)+:\d+> would be better
since you can have numbers in emote's name
Thanks
@lyric mountain the a should be an optional, because the : prefix exists on all emojis. Like, /<a?:\w+:\d+>/
oh I forgot ? exists
nvm, just noticed <a?:(\w|\d)+:\d+> then\w also matches numbers
maybe /<a?:\w+:(\d{17}|\d{18})>/
@green kestrel since you're online, here's some spam above by @fair crypt
Mehh
eject red
Im not the impostor
No just a lame spammer.
Brain has high ping
Im not spamming im real im not a.i.
why i get this error when the bot create a channel?
"Red was an impostor"
@earnest phoenix your flag (probably permission flag) is either corrupted (do not do arithmethic stuff with flags) or invalid
wtf
Can you show the stacktrace
what is "stracktrace"?
the error
https://hastebin.com/diwudifoqo.rb @sudden geyser
Your eval command probably won't show it
@sudden geyser
okay the stacktrace has nothing helpful in it
😔
all of it points to the library but none of your code
what are you trying to do with the eval command?
this: #development message
maybe its something with your eval cmd
🤔
i dont think is my eval cmd
because in the event ready i put "channel.setName('Guilds: '+client.guilds.cache.size)" with an interval of 5m and i get the same error
Traceback (most recent call last): File "main.py", line 16, in <module> bot.run(os.environ.get("TOKEN"))
Who knows how to hack?
Lol
what can i do instead then
create your own function. slice <@ > from the argument and then use the id
There should be more to the stacktrace
@sudden geyser
i want to do a bot that sends a message for each hour, how can i do that? I mean, when its 2:00 pm i want it to say "Its 2 pm"
for example
I need to check it every second
can someone solve my error ⤴️
Can someone please help me with this problem?
I'm trying to install dblapi.js with npm
but this happens
Could not install from "dblapi.js" as it does not contain a package.json file.
Hey all 🙂
So i've been working on a bot and have some code here but i'm not sure on how to make it as a embed
what lang
``const Command = require("../../structures/Command.js");
const { MessageAttachment } = require("discord.js");
const { MessageEmbed } = require("discord.js")
class Achievement extends Command {
constructor(...args) {
super(...args, {
description: "Achievement Get!",
cooldown: 3,
cost: 5,
usage: "achievement [@user] <text>"
});
}
async run(msg, [user, ...args]) {
user = await this.verifyUser(msg, user, true)
.catch(() => {
args.unshift(user);
return msg.author;
});
if(!args.length) return msg.send("Hey Friend, You need to provide some text.");
const text = args.join(" ");
if(text.length > 21) return msg.send("Sorry Friend, Text cannot be longer than 21 characters.");
const img = await this.client.img.achievement(user.displayAvatarURL({ size: 64, format: "png" }), text);
return msg.send(new MessageAttachment(img, "achievement.png"));
}
}
module.exports = Achievement;``
@bronze fable Discord.js
Keep in mind timezones differ.
@sudden geyser its only for 1 city and i am using node.js
misunderstood
yeah 😄
@jovial nexus I mean the user may live in another timezone and see something different
node.js
@bronze fable Do u actually know how to do it 🙂
send embed?
i have the hour with const Hour = date.toLocaleString().split(" ")[1] but i want it to check every second if Hour = 12:00:00 for example
what exactly is the problem
lol
what exactly is the problem
@bronze fable I want to make it send as a embed
not just a regular messgae
``const Command = require("../../structures/Command.js");
const { MessageAttachment } = require("discord.js");
const { MessageEmbed } = require("discord.js")class Achievement extends Command {
constructor(...args) {
super(...args, {
description: "Achievement Get!",
cooldown: 3,
cost: 5,
usage: "achievement [@user] <text>"
});
}async run(msg, [user, ...args]) {
user = await this.verifyUser(msg, user, true)
.catch(() => {
args.unshift(user);
return msg.author;
});if(!args.length) return msg.send("Hey Friend, You need to provide some text."); const text = args.join(" "); if(text.length > 21) return msg.send("Sorry Friend, Text cannot be longer than 21 characters."); const img = await this.client.img.achievement(user.displayAvatarURL({ size: 64, format: "png" }), text); return msg.send(new MessageAttachment(img, "achievement.png"));}
}module.exports = Achievement;``
@primal garden
@primal garden read this https://discordjs.guide/popular-topics/embeds.html#attaching-images
What I think you could do is Date.now() % (1000 * 60 * 60), which should get the time for the hour in milliseconds. You'll use this so you can calculate how far into the hour you are.
So, then you'll use the ms in a setTimeout(() => {...}, ms), so if it was 8:30 and hit 9, it would run that timeout function. After that, you'll set an interval inside the setTimeout so it can be in order to run every hour.
For example: ```js
setTimeout(() => {
console.log("X")
setInterval(() => {
console.log("Runs every hour.")
}, 1000 * 60 * 60)
}, Date.now() % (1000 * 60 * 60))```
There is probably a more idiomatic way of handling this, but this is the one that came to my mind. Searching on Mozilla's developer site for Date would probably show you a function to get the current time (in hour) so you can say "It's X:00 AM/PM".
@jovial nexus
ok this might be a stupod question but how do i make a command that manipulates a image or uploads an image
manipulates?
like adding a overlay
use canvas
canvas?
i think its native
u didnt
^^^
oh
use pillow then
i mean from a API
there are alot of apis out there
@sudden geyser thx for that, what i did is ```js
function notify() {
const TiempoAhora = new Date()
const Dia = TiempoAhora.toDateString().split(" ") [2]
const Hora = TiempoAhora.toLocaleString().split(" ")[1]
if(Hora == "15:18:30") console.log("a")
}
setInterval(notify, 1000);```
i found this https://some-random-api.ml/canvas/wasted and what do i do to add a image thing
that runs every second
yup
There are probably more efficient ways of handling that.
mabye node schedule
@earnest phoenix add a param to it
or what I was suggesting, where you calculate how many milliseconds until the next hour then start your interval for every hour
why do you say that is not eficient? it uses a lot of ram?
so according to the API docs (for that api) i need a avatar param and how would i add that to my code
ok i will see it thanks a lot :D
@earnest phoenix like this
https://some-random-api.ml/canvas/wasted?avatar=imgurl
replace imgurl with the image url
but i want it so when a person uploads a Image file it'll use that to add the overlay
await the message?
then learn more about it
How can I use an async method in Python Flask?
Class ...:
def get(self, name):
data = await self._fetch_data(name)
return {
"result": data
}```
I need fetchAllMembers for stuff like guild.members.cache.find to work properly at all times?
You don't need it, but it can make it more accurate.
I did some tests and sometimes it wouldn't find the member by it's username for example.
but fetchAllMembers can make your bot super slow in startup
unless you enable the intent
Intent verification is separate from the "regular" bot verification?
i literally waited 10 minutes in decent-szied server for my bot to fetch every member without the intent, but with it the fetch took only like 2 secs.
Intent verification is separate from the "regular" bot verification?
not sure, but what I heard it's the same, just it asks bit more questions.
Intent verification is separate from the "regular" bot verification?
@stoic girder you could do it both at the same time
theres an option there
Well my bot is in like 200 servers already.
on what intents you want the bot to get whitelisted
If I turn on the intent it won't function properly until it gets approved?
contact discord support and verify the bot if you haven't already
on what intents you want the bot to get whitelisted
@worthy pine Server members intent I assume
yes
contact discord support and verify the bot if you haven't already
do this then
@chrome garden add async before def
@restive furnace I go to the regular support contact page?
Or there is some developer one?
I don't see any dev related category.
Regular, but select the category as closest as possible to (bot) development
hmhm
how can i get 1 data of all the users in a mongodb database?
Like i have 100 users with this data: ```
id: "'49820429420939"
group: 1
message: true
@hollow sedge Doesnt work
how can i get 1 data of all the users in a mongodb database?
@jovial nexus I am not sure but try <Schema>.find({ group: 1 });
Or just one use findOne
@earnest phoenix
message.channel.send(editEmbed).then(msg => {
editEmbed.setTitle("edited TITLE");
msg.edit(editTimer)}```
That's how I did it with an embed
i already solved my problem xd
awesome 
but how can i make my bot wait about 2 or 3 seconds before editing the message?
setTimeout
//Do stuffs
}, 3000)```
how, i'm new at development xD
the settimeout example
put the msg.edit inside setTimeout
oh
in the block () => {...}, you'll edit the message in there
setTimeout(function(){
msg.edit()
}, 3000)```
Then make it a async function
how xd
You need to add async to the function signature.
async function() {...} or async () => {...}
Yes
Did you save it
yep
It's actually not possible for that error to happen with that code 😕
Odd.
Yeh lol
msg.edit()
}, 3000))```
how do i made a field inline in .addField()? i only know how to do it in .addFields() :/
.addField('Test', 'this is a test')
oh yeah sorry and thanks
so umm
.addField("Title", "other stuff", { inline = true }
Correct?
nope
nope
inline: true?
that inline may not stay there
when you see a value being inside [] in documentatino
.addField("Title", "other stuff")
that means that value is optional
so that means you can do either .addField(name,value,inline) or .addField(name,value)
for the title you may use .setTitle('Test')
lemme try again
then in the parameter list, you see what type the values are
name is a string
value is a string
inline is a boolean
inline is a boolean
module.exports = {
name: "kick",
usage: "kick <@user> [reason]",
description: "Kick a user from the guild.",
execute: async (client, message, args) => {
let user = message.mentions.users.first();
let reasonkick = message.content.split(' ').slice(2).join(' ');
let guild = message.guild;
let memberkick = message.guild.member;
if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You Require `KICK MEMBERS` Permission to Execute this Command")
if (message.mentions.users.size < 1) {
return message.channel.send('You need to mention someone to kick!');
}
if (!reasonkick) {
reasonkick = "No Reason Given"
}
if (!message.guild.member(user).kickable) {
return message.channel.send("That Member couldn't be kicked due to role hierarchy");
}
message.guild.member(user).kick();
let embed = new Discord.MessageEmbed()
.setTitle("User Was Successfully Kicked")
.setDescription(`${user.username}#${user.discriminator} was kicked by ${message.author.username}`)
.addField(`Reason :-`, `${reasonkick}`)
.setColor("RANDOM")
message.channel.send(embed)
let DmEmbed = new Discord.MessageEmbed()
.setDescription(`You were Kicked from ${guild} for: ${reasonkick}`)
.setColor("RANDOM")
user.send(DmEmbed)
}
}```
the command wont respond, no error in logs
you know what a boolean is?
yeah i have vague memories of it
wait that's JS?
wait that's JS?
@earnest phoenix yeah
im using a diffrent command handler
same
Don't tell me you have more than one message listener
me?
lol
how can i made my bot send a channel message when it's added to a new server??
@earnest phoenix
guildCreate event @earnest phoenix
¿?
cual es el problema?
wut?
yo te ayudo en español
DM
English please.
Yeah, sorry
if i have a dict like user[0] how can i make a variable for all the users inside the dict?
Use a loop
how?
Hi so I made a mute command but it auto revokes the mute, I have been testing timers with this and I still cant seem to figure it out, can somebody help me with this? heres the code:
wdym revokes the mute
user.roles.remove(role)
message.channel.send(`${user} is now unmuted bois`)
}```
like
here I will show screen shot
Where's the second argument (how long to wait in ms)
@halcyon kite your time out is probably a wrong number
so it unmutes them immediately? did you add the time to wait in the setTimeout?
lol you're telling them it was invalid 3 times
Error: input stream: This video is unavailable
at downloadFromInfoCallback (C:\Users\poronga\node_modules\ytdl-core\lib\index.js:76:26)
at C:\Users\poronga\node_modules\ytdl-core\lib\index.js:18:5
at processTicksAndRejections (internal/process/task_queues.js:97:5)
🤝
ok im making a discord bot with c# in vs and i want to to something where some one will say thx @blissful fiber and it will add i helpfulness to my profile but idk how to do that save data for the user like it would add +1 helpfulness to the profile
if you guys can help
ef core + sqlite if you're small scale
efcore + postgres if you're large scale
whast this
you tell me
develment
or so
learning the server
Hello, a question, the guild member remove event records the suppress of users?
Like what
?
i have a question i went to create my bot and after completing everything i clicked send what do i do now?
client.on("guildMemberRemove", member =>{
const canal = member.guild.channels.cache.find(c => c.name === "left-userx");
if(!canal) return;
const embed = new Discord.MessageEmbed()
.setAuthor(member.user.username, member.user.displayAvatarURL({format: "png", dynamic: true}))
.setDescription(***<@${member.id}> bye dumbass***)
.setThumbnail(member.user.displayAvatarURL({format: "png", dynamic: true}))
.setColor(0x72473d)
.setFooter(siempre en nuestros corazones <@${member.id}>)
canal.send(embed);
});
this is an example
i have it in my bot
👍
@earnest phoenix
my question not that my question is how i creat my bot i cliked to send and idk what i do
@earnest phoenix No me refería al código, y sí hablo español, pero me refería a que si detecta al purgar/suprimir miembros del servidor. Igualmente, gracias.
lol
ok so
this is my code and i'm trying to make a custom welcome message like thing but
get this error
kinda poggers
@young flame do u have privileged gateway intents?
that isnt relevant here
yes
@young flame do u have privileged gateway intents?
@arctic hare i do
i changed some of it around i'ma try it out
kinda poggers
@young flame If it cant find guild and is undefined, Try to log this: console.log(message.guild.id)
kk
Probably quick.db
eh might use my own db
I prefer using MySQL! 🙂
I also use mysql
Try doing this then: db.set("wel"+message.guild.id, channel.id)
Might switch to using postgresql
why are you giving pointless solutions
the error clearly says that the message is undefined for whatever reason
Guys im confused, when i usually push data in my db it store object like:
'Data1',
'Data2',
'Data3'
]```
But now my database, idk the reason, store data like this:
```['Data1', 'Data2', 'Data3']```
And now i cant check if the db contain a specific data and broke like 30% of my bot commands
Strings, the name of the weap
Probably quick.db
@feral aspen no i had message.guild.id working but since i didnt have it like ```js
db.set(channel_${message.guild.id}, cArgs)
Strings, the name of the weap
@north birch wut
@north birch wut
@young flame The data is actually the name of the in game weapons
let author = db.fetch(`money_${message.guild.id}_${message.author.id}`)
if (author < 5000) return message.channel.send('You dont have enough cash')
db.push(`${message.author.id}_weapon`,'Weapon1');
db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000)
message.channel.send(message.author.toString() + 'You buyed Weapon1')```
nope nm
nvm*
guild is still "undefined"
let author = db.fetch(`money_${message.guild.id}_${message.author.id}`)
if (author < 5000) return message.channel.send('You dont have enough cash')
db.push(`${message.author.id}_weapon`,'Weapon1');
db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000)
message.channel.send(message.author.toString() + 'You buyed Weapon1')```
@north birch uh what is weapon1
The name of the weapon
@young flame
Moon is your code in message event?
let Weapon1 = db.fetch(`ect_${message.author.id}_ect` 1)
Moon is your code in message event?
@molten yarrow yeah
it is
Yes
what do u have in your index line 84
let Weapon1 = db.fetch(`ect_${message.author.id}_ect` 1)
@young flame Weapon1 is a string text not a var
Yay error party
no the command is in the message event
change the line to:
client.on('guildMemberAdd', (bot/client, member) => {
To have quick.db you need which application
To have quick.db you need which application
@restive otter The windows built app idk how that is called lmao
bruh you only need json.sqlite lol
it can't make it on it's one so you get a build error
@young flame
bruh you only need json.sqlite lol
@young flame To use npm install quick.db you get error if you dont have the windows build app
make a file called json.sqlite file
then try again
@young flame To use npm install quick.db you get error if you dont have the windows build app
@north birch it worked for me though?
it gave me the same error all i did was make a json.sqlite error and it worked
@restive otter try npm install --global windows-build-tools
wait, does (client, member) actually work for the guildMemberAdd event?
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-guildMemberAdd
Ive always gotten client from the member.
i know, its weird
i was using it like this before intens @solemn latch
ah, i didnt know client was passed like that.
i know, its weird
@solemn latch Level up: Crook > Boss
@restive otter
but i think it depends on your event handler
i have a json.sqlite file
@restive otter try npm rebuild
@restive otter Try closing all app that is reading from the bot folder and try again the command that i give you
probally
and run terminal with admin rights maybe helps xD
Damn
Bruh
its asking for visual studio
Oh yeah you're right again
npm install --global --production windows-build-tools --vs2015
like i said you dont have message there
Oh my gawd
hhhhhh
I'm noob or no?
i have the db setting it for the message.guil.id so other guilds can change it
Oh @restive otter i just notice that you're trying to install it in the system32
lmao
unless guild is in the member event
cd to your bot folder or in any folder that the system can write temp file @restive otter
Yes
yes moon its member.guild.id
What ? @north birch
run the terminal in your Bot root folder
@molten yarrow do i change this to member to
yeah
oh and sorry for the pings and stuff i'm a little slow
What ? @north birch
@restive otter Your pc was trying to install the windows build tool setup in the sys32, that why you get that error
yeah i see it too now xD
lol
go to your bot folder
cd desktop
shift + right click and open power shell
if desktop isn't found then
cd onedrive
cd desktop
Listen to @molten yarrow that method it's faster
@restive otter try npm install --global windows-build-tools
@north birch This
is this your Bot folder?
hhh
is this your Bot folder?
@molten yarrow I guess not lmao
@restive otter cd in your bot folder
@restive otter Your powershell is not administrator
Moon try remove client and keep only member, maybe your handler dont have it idk xD
UseCMDi am not a Professional (just a Suggestion)
We
Use CMD i am not a Professional (just a Suggestion)
@tranquil basin They're similiar for installing using npm
yeah than try with only member
kk
How do I open it in admin
@restive otter
go to your Bot folder first
@restive otter Run your powershell as administrator
cd 33769
cd Desktop
cd ALG
power shell => power shell admin
@molten yarrow Yeah @restive otter
Use one of this two method
@molten yarrow hHhHhHHhHhhHhhhhh
thats weird xD
try console.log(member) on first line somewhere
press Fichier on top left side in your Bot folder than power shell
@restive otter
@restive otter try cd into user first
im giving up soon xD
lmao
what is URL?
@restive otter if you dont know how to reach desktop with cd use tree to figure the way out
Well..
@warm crater a link
of what
Why the fuck your powershell cant write on your bot folder
Of anything @warm crater
ok
@restive otter You need to figure out why your system console cant write in that folder, try closing app that are reading from that folder, turning off antivirus
@restive otter Dont give up lmao
@restive otter if you're having that many problems you could just use https://repl.it/
Repl.it is a simple yet powerful online IDE, Editor, Compiler, Interpreter, and REPL. Code, compile, run, and host in 50+ programming languages: Clojure, Haskell, Kotlin, QBasic, Forth, LOLCODE, BrainF, Emoticon, Bloop, Unlambda, JavaScript, CoffeeScript, Scheme, APL, Lua, Pyt...
@warm crater #502193464054644737 if you want to get started
bruh @molten yarrow lol
client.on('guildMemberAdd', async (member) => {
console.log(member)
let channel = db.get(channel_${member.guild.id}, channel);
if(!channel) return;
let msg = db.get(message_${member.guild.id}, msg)
let image = db.get(image_${member.guild.id}, image)
let embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDecription(msg)
.setImage(image)
.setFooter(member.guild.name, member.guild.iconURL());
channel.send(embed);
});
how doe
what does member logs?
anyway channel is probably not going to be a GuildChannel. Most likely a channel ID, so why are you trying to call channel.send(...) when channel is likely a string
anyway
channelis probably not going to be aGuildChannel. Most likely a channel ID, so why are you trying to callchannel.send(...)whenchannelis likely a string
@sudden geyser i'm gonna make a thing so it makes the channel.id a name ig
idk
You shouldn't need to add message_ and image_ before the thing
its his key to find the values
db saves like key, value pattern
otherwise he cant save multiple values to same guild.id
IK
i would change the db to better one tho
i would change the db to better one tho
@molten yarrow that's why I asked what the db was
so i put channel_ so it gets the channel from the guild id
well i accidentally deleted my db MoonSQL so i gotta use quick.db
@young flame My bad, before i didn't wrote the entire code:
if(args[0] == 'weapon1') {
if(armi == 'Weapon1') {
var armi2 = new db.table('weaps2')
let author = db.fetch(`money_${message.guild.id}_${message.author.id}`)
if (author < 5000) return message.channel.send('You dont have enoguh cash')
armi2.push(`${message.author.id}_weapon`,'Radiciona di Radicia');
db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000)
message.channel.send(message.author.toString() + ' You buyed Weapon1 (You have now 2')
delete armi2
} else {
let author = db.fetch(`money_${message.guild.id}_${message.author.id}`)
if (author < 5000) return message.channel.send('You dont have enough cash')
db.push(`${message.author.id}_weapon`,'Radiciona di Radicia');
db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000)
message.channel.send(message.author.toString() + ' You buyed Weapon1')
}```
YOUR DB??
yeah i made one?
quick.db
You made your own DB?
yes
How did you accidently delete that lol
i was cleaning files and i uhhh
yk how it says like
downloads from 1 month ago?
i just clicked on that and deleted like 140 files
kinda poggers but now i wish i didn't lmao
member.guild.channels.cache.get(channel).send(embed)
gotta add that since it's a id
yeah should work
don't question it
i save everything to downloads
it's naturaL
or i copy it to downloads
WTF WAS THAT
Yes please use folders
does anyone know how to set a webhook to a user's avatar? (discord.js v12)
the following does not work:
message.author.avatarURL({ format: `png`, dynamic: true })
it's the right url but it isn't setting it
How are you setting it in the webhook
One message removed from a suspended account.
One message removed from a suspended account.
hHhhHhhHhH
One message removed from a suspended account.
One message removed from a suspended account.
i dont use command handlers
One message removed from a suspended account.
One message removed from a suspended account.
regular formatting
One message removed from a suspended account.
well somewhere message is not defined
for reactions when i copy and paste \🍔 into visual studio code i get an error saying unknown emoji
hmm
dis
do i need like
One message removed from a suspended account.
there is no message on guildMemberAdd
One message removed from a suspended account.
aH
\🍔
so message embed wouldn't work?
for reactions when i copy and paste \🍔 into visual studio code i get an error saying unknown emoji
@shadow crag language?
JavaScript
@earnest phoenix
One message removed from a suspended account.
JavaScript
@shadow crag can i see the error?
yes
One message removed from a suspended account.
lol

its not the same lol
One message removed from a suspended account.
well yes, the language itself is the same
but you will have issues installing some modules like the error above
One message removed from a suspended account.
One message removed from a suspended account.
at RequestHandler.execute (/home/pi/Desktop/Cheems/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:32510) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:32510) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
@sage orbit
because a phone runs in a sandbox environment, you are technically not an admin in your phone, where on the pc you are the admin
One message removed from a suspended account.
@shadow crag im not that familiar with js so take a look at the api server discord.gg/discord-api
ok thank
One message removed from a suspended account.
One message removed from a suspended account.
When i try to store data in db it store like
[ 'Data1', 'Data2', 'Data3' ] and broke all my command to check if db contain a data, in fact normally it store data like
[
'Data1',
'Data2',
'Data3'
]
So a lot of my bot command broke
if(args[0] == 'weapon1') {
if(armi == 'Weapon1') {
var armi2 = new db.table('weaps2')
let author = db.fetch(`money_${message.guild.id}_${message.author.id}`)
if (author < 5000) return message.channel.send('You dont have enoguh cash')
armi2.push(`${message.author.id}_weapon`,'Radiciona di Radicia');
db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000)
message.channel.send(message.author.toString() + ' You buyed Weapon1 (You have now 2')
delete armi2
} else {
let author = db.fetch(`money_${message.guild.id}_${message.author.id}`)
if (author < 5000) return message.channel.send('You dont have enough cash')
db.push(`${message.author.id}_weapon`,'Radiciona di Radicia');
db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000)
message.channel.send(message.author.toString() + ' You buyed Weapon1')
}```
there is no difference between those
when i create a channel i get this error:
https://cdn.discordapp.com/attachments/495064486001246228/777995435637604352/unknown.png
thats discord's fault
discord's api is kinda going brr right now
One message removed from a suspended account.
thats discord's fault
@quartz kindle Actually when happen like [Data1 Data2 etc] it broke all my command to check if that db contain that weapon
Soo
then you did something wrong
there is absolutely no difference in the data itself if you're using it properly
One message removed from a suspended account.
One message removed from a suspended account.
@north birch
tim wasnt replying to you, he was replying to #development message
@sage bobcat Oh LMAO Sorry guys
When i try to store data in db it store like
[ 'Data1', 'Data2', 'Data3' ] and broke all my command to check if db contain a data, in fact normally it store data like
[
'Data1',
'Data2',
'Data3'
]So a lot of my bot command broke
if(args[0] == 'weapon1') { if(armi == 'Weapon1') { var armi2 = new db.table('weaps2') let author = db.fetch(`money_${message.guild.id}_${message.author.id}`) if (author < 5000) return message.channel.send('You dont have enoguh cash') armi2.push(`${message.author.id}_weapon`,'Radiciona di Radicia'); db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000) message.channel.send(message.author.toString() + ' You buyed Weapon1 (You have now 2') delete armi2 } else { let author = db.fetch(`money_${message.guild.id}_${message.author.id}`) if (author < 5000) return message.channel.send('You dont have enough cash') db.push(`${message.author.id}_weapon`,'Radiciona di Radicia'); db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000) message.channel.send(message.author.toString() + ' You buyed Weapon1') }```
@north birch Not to be mean or anything, I'm just saying but there are quite a bit of spelling mistakes in there
One message removed from a suspended account.
One message removed from a suspended account.
arent u creating a new table with same name each time you run this command?
I'm just saying there are quite a bit of spelling mistakes
new db.table(weaps2")
they're probably not a native speaker
@sage bobcat You're right : )
Sorry about thatt
they're italian
One message removed from a suspended account.
Yeah
One message removed from a suspended account.
Heyy
no problem I'm just saying that imo I don't like bots that don't have proper spelling
i understand italian because #allromanlanguagesarethesame
One message removed from a suspended account.
One message removed from a suspended account.
:^)
One message removed from a suspended account.
One message removed from a suspended account.
im memeing lol
One message removed from a suspended account.
lol
lol
poggers
client.on('guildMemberAdd', async (member) => {
console.log(member)
let channel = db.get(`wchan_${member.guild.id}`, wchan);
if(!channel) return;
let msg = db.get(`message_${member.guild.id}`, msg)
let image = db.get(`image_${member.guild.id}`, image)
let embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setDecription(msg)
.setImage(image)
.setFooter(member.guild.name, member.guild.iconURL());
member.guild.channels.cache.get(channel).send(embed);
});
what is wchan lol
uhh
dis
if(command === "set-wchan") {
let permission = message.member.hasPermission("ADMINISTRATOR");
if(!permission) return message.channel.send("You are missing the permission `ADMINISTRATOR`")
let wchan = args[0]
if(isNaN(wchan)) return message.channel.send({ embed: { color: ('RANDOM'), description: ("You must provide a valid channel id first!") } });
db.set(`wchan_${message.guild.id}`, wchan)
message.channel.send({ embed: { color: ('RANDOM'), description: ("You have successfully set the welcome channel to <#" + wchan + ">") } });
}
No
that would have been helpful an hour ago
lmao thanks doe
probally woulda removed the commmand entirely
if you're getting/requesting data from the database you have to call using the key wich is wchan_${message.guild.id} in your case, the second parameter in .set is the value of the key wich will eventually be returned when using .get("key")
When i try to store data in db it store like
[ 'Data1', 'Data2', 'Data3' ] and broke all my command to check if db contain a data, in fact normally it store data like
[
'Data1',
'Data2',
'Data3'
]So a lot of my bot command broke
if(args[0] == 'weapon1') { if(armi == 'Weapon1') { var armi2 = new db.table('weaps2') let author = db.fetch(`money_${message.guild.id}_${message.author.id}`) if (author < 5000) return message.channel.send('You dont have enoguh cash') armi2.push(`${message.author.id}_weapon`,'Radiciona di Radicia'); db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000) message.channel.send(message.author.toString() + ' You buyed Weapon1 (You have now 2') delete armi2 } else { let author = db.fetch(`money_${message.guild.id}_${message.author.id}`) if (author < 5000) return message.channel.send('You dont have enough cash') db.push(`${message.author.id}_weapon`,'Radiciona di Radicia'); db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000) message.channel.send(message.author.toString() + ' You buyed Weapon1') }```
So any solution for this?
like Tim typed above
[ 'Data1', 'Data2', 'Data3' ]
//and
[
'Data1',
'Data2',
'Data3'
]
is the same
like Tim typed above
[ 'Data1', 'Data2', 'Data3' ] //and [ 'Data1', 'Data2', 'Data3' ]is the same
@molten yarrow They're giving me problem btw, the first one has broke my equip command that check if database contain that specific weapon
where do u check it?
Just using console.log, and when happen the first one case here, my equip command dont work
why are u creating a new table
var armi2 = new db.table('weaps2')
and trying to delete it
delete armi2
why are u creating a new table
var armi2 = new db.table('weaps2')and trying to delete it
delete armi2
@molten yarrow i was trying to delete var cause idk if it can cause problem with other one, cause there are like 3 of the command that i send
> if(args[0] == 'weapon1') {
> if(armi == 'Weapon1') {
> var armi2 = new db.table('weaps2')
> let author = db.fetch(`money_${message.guild.id}_${message.author.id}`)
> if (author < 5000) return message.channel.send('You dont have enoguh cash')
> armi2.push(`${message.author.id}_weapon`,'Weapon1');
> db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000)
> message.channel.send(message.author.toString() + ' You buyed Weapon1 (You have now 2')
> delete armi2
> } else {
> let author = db.fetch(`money_${message.guild.id}_${message.author.id}`)
> if (author < 5000) return message.channel.send('You dont have enough cash')
> db.push(`${message.author.id}_weapon`,'Weapon1');
> db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000)
> message.channel.send(message.author.toString() + ' You buyed Weapon1')
> };```
```javascript
> if(args[0] == 'weapon2') {
> if(armi == 'Weapon2') {
> var armi2 = new db.table('weaps2')
> let author = db.fetch(`money_${message.guild.id}_${message.author.id}`)
> if (author < 5000) return message.channel.send('You dont have enoguh cash')
> armi2.push(`${message.author.id}_weapon`,'Weapon2');
> db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000)
> message.channel.send(message.author.toString() + ' You buyed Weapon2 (You have now 2')
> delete armi2
> } else {
> let author = db.fetch(`money_${message.guild.id}_${message.author.id}`)
> if (author < 5000) return message.channel.send('You dont have enough cash')
> db.push(`${message.author.id}_weapon`,'Weapon2');
> db.subtract(`money_${message.guild.id}_${message.author.id}`, 5000)
> message.channel.send(message.author.toString() + ' You buyed Weapon2')
> };```
For example
use const or let
@molten yarrow I can try but it wont fix the db problem
LETS GOOO
i dont know quick.db tho
but im sure u dont need create a new table everytime you run a command
aaay gg :3
i dont know quick.db tho
but im sure u dont need create a new table everytime you run a command tho
@molten yarrow If i dont use new before db.table it just take ALL the data from ALL commands from the new table, meaning that !money and !health will just ''reset''
i'm gonna cry starboard gonna take 4 hours with how slow i am
that should not happen tho xD
that should not happen tho xD
@molten yarrow I know O.0
i'm gonna cry starboard gonna take 4 hours with how slow i am
@young flame Yesterday one guy just tested a nsfw command in a EventOnMessage, and his bot spammed 100+ Porn in over 80 Guilds LMAO
that should not happen tho xD
@molten yarrow I dont know what to do this commands are driving me crazy lmao
let args = message.content.slice(prefix.length).split('/ +/g');
what does the error say?
and where do u see that the error is in the lines above?
the errorlog doesnt say anything
is there more above or below it?
do node index.js instead of npm start
probably cant run on your phone
show your index.js
I think you have error
can u run "node ." to start it
In package
it failed to load your start script
can u show your package.json
only the scripts part is enough
yeah thats why
remove the ./ before index.js
"node index.js"
try now
should start atleast
what does the error says?
cant help without :3
100% the same? D
you can check the log stored in "/data/data/com.astrosohu/files/home/.npm/_logs/2020-11-16T21_39_13_798Z-debug.log"
maybe theres more
@young flame Yesterday one guy just tested a nsfw command in a EventOnMessage, and his bot spammed 100+ Porn in over 80 Guilds LMAO
@north birch LMFAO
poggers!
@north birch LMFAO
@young flame in the end his bot got removed from 10 guilds
damn
Lol
only this 10 were real, the others are Bot collecting server :3
now it's vibe time
only this 10 were real, the others are Bot collecting server :3
@molten yarrow oh and should i start using shards now?
naah
o oki
was above 1k or 2k guilds
someone said "yOOu ShoUlD StArT ShArDiNg NoW"
how to make a bot for free
how to make a bot for free
@earnest phoenix Making bot is free
how
Hosting a bot 24/7 isn't free
what website or so
you need to code it yourself
how
#502193464054644737 should give you a help
Yeah
i have to buy
you need to pay if you want it 24/7 online yes
how to do it none
you can host it on your PC
Go on Discord developer and start a new project and a new bot
Then set up a bot folder when you're gotta code (on your pc)
Start coding and create your EpIk bot
Btw I'll go offline in a couple of minutes I'm tired
?
Question :
how can i solve this error?
Ignoring exception in on_command_error
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
await coro(*args, **kwargs)
TypeError: on_command_error() missing 1 required positional argument: 'ctx'```
```py
async def on_command_error(error,exc,ctx):
Can you show more of your source code.
anyone know why this is triggering when the member does have manage messages?
if one of them is false, the condition is true https://cdn.hopefuls.de/y7fF
|| means or, just saying
ik, so
If the first one is false, run the second one, if that ones false too, run the 3rd
but its still running even when the first one is true
becasue i do have the manage messages

hosting it is where the problem starts
"How do i code it for free, what can i use, im on mobile"
what do you mean if i close program bot no work???
GUYS MY BOT WAS RUNNING AND WHEN I TURN MY PC OFF IT STOPS?!?!?!??!?!?
oh no
that was a joke....
because i developed a bot?
GUYS MY BOT WAS RUNNING AND WHEN I TURN MY PC OFF IT STOPS?!?!?!??!?!?
then why u ask this ^^^
lol
-bots
no bot?
-botinfo 774198333899800607
774198333899800607
Akamenotabot
1451
We are this updating the bot so it may be down something and this bot can help u get more member on ur server with the new update coming
discord.js
ak
1
0
No server count
@lucid prawn
Please include a bot mention or ID
-botinfo 764159325702193192
u should check my bot out
i will if you check my bot out o.O
ok
How to get the answer / response from prompt in JavaScript
How to get the answer / response from prompt in JavaScript
@stark abyss tf you mean
its not verifed yet?
yes
u use this link https://top.gg/bot/774198333899800607 ?
so i need to log out?
no just take my word for it.... its not on the site
it takes about 7 weeks to get verified
i have two bot btw
4* now
oh
What did it do
wym
the bot
yes
off online
lol
idk
did u look at my bot?
its not done yet
why did you submit it then
because it say here #development message
We are still updating the bot so it may be down something and this bot can help u get more member on ur server with the new update coming
Makes sense to submit it with how long the queue is
Although you should fix the description
You should say what the bot's current features are, not just that there is more coming
It won't get approved otherwise
ok
it say in the description this
We love this bot and we will update it alot and we hope you enjoy our bot here our commands akahelp - Shows this message. akarandom - Shows a random number from to <args 2> - akaban - Do tupban @username why - akakick - Do tupkick @username why and u can kick someone - akalove-Do tuplove - akakiss-Do tupkiss - akapurge-Do tuppurge - akagiverole-Do tupgiverole - akaremoverole-Do tupremoverole akahug hug someone akapat pat someone akaSupport - take u to the support website#
@hollow sedge
How do i send a jpg file?
@modest smeltctx.send(file=discord.File(fp="path/to/file", filename="image.jpg")
@lucid prawn ig that sounds better but you should fix formatting
@modest smelt
ctx.send(file=discord.File(fp="path/to/file", filename="image.jpg")
@hollow sedge i fixed it.await ctx.send(file = discord.File(f'{problemname}.jpg'))
Ok so I was right?
@hollow sedge #development message
I saw, but there was nothing to say
-botinfo 774198333899800607
774198333899800607
Akamenotabot
1451
We are this updating the bot so it may be down something and this bot can help u get more member on ur server with the new update coming
discord.js
ak
1
0
No server count
@lucid prawn
im using discord.py
python3 -m pip install -r requirements.txt && python3 auto-voice-channels.py
how come that doesnt work
client.user.setPresence({ activity: { name: '<activity>' }, status: 'idle' });
what are examples of <activity> that i can put here? i want my bot status to say "*help"
see above
thanks
message.guild.owner returns the owner as "null" in any server. How would i get it to respond with the actual owner, i use discord.js
await message.guild.members.fetch(message.guild.ownerID)
Thank you
{name: 'assume this is a link'},
)```
when i do this, the output in discord still shows a value as "undefined"
is there any way to make it so that there just is no value?
no...that's just how fields work...
'\u200'
sure
is there a node module to watch if a certain youtuber has posted a video or if a twitch streamer is live?
Youtube and twitch api respectively
Guys check out this cool password generator I made (don't fucking use it or I'll use faith in every single one of you it's a joke but some people with take it seriously).
Math.floor(Math.random()*1000000).to string().split("").map(v => "abcdefghij".split("")[v]).join("")
Yk, if you have a pass generator you can reverse-engineer generated passwords using the same algorithm
Except if you use hash generators
Hashes are tough boyes
Hash? You mean like this?
var hash= "hash str".split("").map(v => v.charCodeAt(0)).reduce((a, b) => a+b);
```?
Probably not
But your right, I should be hashing my passwords before I put them into my database.
That's still easily reverse-engineer-able
Now I wonder if you mean hashing vs. salting
Hash is a blackmagicfuckery string generated from another string's bytes
sql.query("INSERT INTO `Accounts` (`username`, `password`) VALUES ('"+username+"', '"+Math.floor(Math.random()*1000000).to string().split("").map(v => "abcdefghij".split("")[v]).join("").split("").map(v => v.charCodeAt(0)).reduce((a, b) => a+b)+"')'");```
no
It's a one-way thing, so it can't be reversed
Alas why 99% trusty sites and services use for password storage
They really really don't know your actual password, only its hash
Pint for the record, your code looks vulnerable to SQL injection.
"looks" is a weak word in his case
About the hash stuff pint, search for SHA-1, SHA-256 and MD5
It'll explain a bit about what it is
Hmm. So what about
app.get("/db/:sql", (req, res) => {
sql.query(req.params.sql, function(e, r, f){
res.send(r);
});
});```
Then I can do
```html
<p id="name"></p>
<script>
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("name").innerHTML = JSON.parse(xhttp.responseText)["username"];
}
};
xhttp.open("GET", "/sql/SELECT * FROM Accounts WHERE username='"+new URLSearchParams(window.location.search).get("name")+"';", true);
xhttp.send();
</script>```
Those three are the most commonly used, but there are a myriad of them
Guys I'm sorry for hurting you with this code I'll fix it for you
app.get("/getname/:id", (req, res) => {
sql.query("SELECT `name` FROM `Accounts` WHERE `id`=?;", [req.params.id], function(e, r, f){
if(err || r.length < 1) return res.send("");
res.send(r[0]["name");
});
});```
```html
<p id="name"></p>
<script>
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("name").innerHTML = xhttp.responseText.replace(/&/g, '&').replace(/</g, '<').replace(/"/g, '"');
}
};
xhttp.open("GET", "/getname/"+new URLSearchParams(window.location.search).get("id"), true);
xhttp.send();
</script>```
crypto.randomBytes(9, function(e, b) {
if(e) return reject(e);
resolve(b.toString("hex"));
});```
and
```js
require("crypto").createHash("sha256").update(pass).digest("hex");
just dont give color
It shows black
Set it to discord background/embed color. I don't know the colors on the off the top of my head but you can use inspector to figure it out.

@unborn ridge change your discord to light theme and you'll know how it works
Yeah that'll do it 
https://discord.com/branding as a small hint 
#ffffff00 
?

It's #2f3136
Ok
Imagine if discord's embed color accepted 4 byte colors
read the branding what i sent
i was kidding lol that's 8 bit hex







