#development
1 messages · Page 1461 of 1
i found another dumb bot maker
i mean some frameworks actually are
Not as effective in what terms
.-.
obviously not lol
Which is what js is meant for
just because it was meant for something doesnt mean it cant be used in another way effectively
True
node.js has many benefits
for example only needing one language
for frontend and backend
Ts, now
Erwin
I just wish python had as many good frameworks as JS has 😪
thats me
Dead laptop
ik
trueee
wont stop me from bitching to you about learning ts though
I'm not doing TS on phone ty 
Nu
there are great frameworks out there but trash, popular frameworks overshadow them
Nope 
Sanic
yeah
wait you're saying sanic is good right?
I'm just saying that it exists
ok
I use Flask tbh
I used it and had no problems using it
flask not async tho 😦
Both sync and async clients
That was the thing
I mean

No
lol
shitpost in #memes-and-media
it was supposed to be youve been gnomed
this chat for development, not shitpost
how is that shitpost
how is that not
🤔
how is #development message
and #development message
NOT shitpost?
you know how you've been gnomed relates to development
When the code works but dosent
But like why
dude stop
when discord freezes
and ur trying to show ur bot'
ok\
And the topic
@inner stump stop posting off-topic content in a channel mostly meant for coding help
back to what I was saying
i will send some pictures
guys??? 
and gals
you realize this is only frenzy right?
ok guys im going to bring us back on-topic real quick:
def hi()
print("hi")
why doesnt this work
show error
you're missing a :
so i was trying to open my bot but suddenly mee6 appears
and hi.run at the bottom
You didn't import antigravity and this
your welcome!
we already talked about it
does botghost host your bot for you?
yes, and its shit
yeah i guess
import nasa
nasa = nasa.get_nasa_src()
print(nasa)``` 
of course i am
@opal plank i was about to send this, ur lucky i didnt post the message
in markdown to add
like this
`hi` - this right?
``` for the bot webpage?
why dont you just try it? there's literally a preview
(but yes)
at the bottom
oh
i think this deserves to get on starboard
maybe not when you're creating a new bot
try submitting it
you can just edit it after
okay!
at Function.resolve (/root/Muser/node_modules/discord.js/src/util/BitField.js:150:19)
at Permissions.has (/root/Muser/node_modules/discord.js/src/util/BitField.js:45:28)
at Permissions.has (/root/Muser/node_modules/discord.js/src/util/Permissions.js:45:85)
at GuildMember.hasPermission (/root/Muser/node_modules/discord.js/src/structures/GuildMember.js:271:24)
at Client.<anonymous> (/root/Muser/bot.js:726:32)
at processTicksAndRejections (internal/process/task_queues.js:97:5) | Make sure you ran command properly```
this does bring up an interesting question though, you should be able to preview your bot's page before you create it
it would make sense
Apparently you get a 504 or 403 when you try editing

Peep #support
yeah
2|index | (node:960755) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
2|index | at RequestHandler.execute (/root/Muser/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
2|index | at processTicksAndRejections (internal/process/task_queues.js:97:5)
2|index | at async RequestHandler.push (/root/Muser/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
2|index | at async ReactionCollector.<anonymous> (/root/Muser/node_modules/discord.js-collector/src/collectors/reactionCollector.js:417:33)
2|index | (node:960755) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
2|index | (node:960755) [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.
In editing Message?
It's simply editing message
but my bot doesn't have perm
wat
huh
@delicate shore maybe you're targeting the message from the message listener
türk varmı ?
No I'm not
It works if my bot has manage messages permission
But it doesn't delete anything
It just edits
Maybe that's the issue then
how to make the bot delete its own messages
Can someone help me out with a small bot I did?
bot.on('message', async m => {
if(m.author.bot === true || m.channel.type === 'dm') return;
if(m.content.startsWith('realm')){
let num = parseInt(m.content.split(' ')[1]) || 1
if(num > 3 || num < 1) return
else{
console.log(num)
m.channel.setTopic(`Realm: ${num}`)
m.channel.send(`Set realm to ${num}`)
console.log(m.channel.topic)
}
}else{
return
}
})
It's supposed to update the channel topic, but even with admin privs it doesnt
Did you queue it?
message.channel.send('message').then(msg => {msg.delete()})
rn ive made a small bot to ping me as soon as someone says certain words during convos
Dunno if the api you're using requires you to queue actions or not.
Ah I use JDA. Everything normally needs to be like "message.delete().queue()
Ah
Nvm then
import discord
import os
client = discord.Client()
my_pings= ("fury","FURY","NIGHTFURY","nightfury","Nightfury","adrian","Adrian","Strawhats","strawhats")
myid= '@mighty quiver'
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith(my_pings):
await message.channel.send(myid)
client.run(os.getenv('TOKEN'))
this is my code
and it works
Ohhh you use python
yea
but couldnt figure out deleting part
yea i thought so lmao
i just want my bot to ping me and delete message as soon as it sends it
just so that i can keep an eye on what people are saying bout me
on my server
if message.author == client.user:
await client.delete_message(message)
And you can add some more if statements to filter that specific message
ohhh
so this will delete anything the bot says
right?
Yes
ctx.delete works too
I don't have Python installed on my computer so that's what I use repl.it for... I have node.js installed
ohh
and if you pass the sent message to variable you can use <variable>.delete()
ohhh this works too
i didnt think of this
I have em all on my pc but i still develop vsc remote connect plugin with my vps
I am not as experienced in py as js lmao
I've only ever made one bot in python
I've made tons in javascript
im bad at py, normal on js, proficient o c/++
Eh, I've never done a bot in c++, mostly arduino stuff
well i have, but i don't focus on bot making tho
How to see how invited user in guildMemeberAdd event
Language?
bot.on('guildMemberAdd', async member => {
code
})
FOr that you would have to store all invite codes
this didnt work
im sure i messed up somewhere
but idk where
Okk
Do you know how to go about storing the invites?
@delicate shore?
Nah
Do you need some help?
if (options.Filter) {
Seek = Db.ExtraTime ? Db.Bot.dispatcher.streamTime + Db.ExtraTime : Db.Bot.dispatcher.streamTime;
}```
error :- ` UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'streamTime' of null
`
Indeed , I'm trying to figure it out
If I can't I'll ask here
DM me if you can't get it
K thanks
how do i crack passwords ?
for my email that got hacked
they changed the password for my email and i need to crack the password can someone teach me please
bruh, do you really think anyone can crack email passwords? If yours really did get cracked it was probably really weak. Next time, think of a stronger password
lol
Does anyone here know python code for welcome message?
Like "welcome, tomson, you enter in this server" message?
M
Function - on_member_join
Channel - bot.get_channel(id)
Ping user - member.mention
And:
await channel.send(f'{member.mention} hello!')
like so
Tysm
How do you do this?
do what
Just i use this code:
@bot.event
async def on_member_join(member):
print(config.system_msg + f'Пользователь {member.name} зашёл на сервер.')
news_channel = bot.get_channel(id=745223801419202590)
#await news_channel.send(f'Пополнение на сервере, {member.mention} теперь с нами!')
colour = discord.Colour.from_rgb(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
embed = discord.Embed(title = f'Пополнение на сервере, {member} теперь с нами!', colour=colour)
embed.set_author(name=member, icon_url=member.avatar_url)
embed.set_footer(text=f"Цвет обложки - {colour}")
await news_channel.send(embed = embed)
And how to do the vote requirement command
So this will send a message to a specific channel?
@sage crescent tysm
One question before I go
Do I change the bot.event to client.wvent
Yes, bot - name of my variable
wrong ping)
:)
wait
?
oh
Its just message
ok thx
const fetch = await channel.messages.fetch({ limit: 100 })
const msg = fetch.find(m => m.embeds[0].footer.text.startsWith('⭐') && m.embeds[0].footer.text.endsWith(message.id))```
(node:9948) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'footer' of undefined
at C:\Users\Dom\Desktop\projekty\Xibbly2\Xibbly_modules\DiscordBot\utils\starboardAdd.js:22:45
at Map.find (C:\Users\Dom\Desktop\projekty\Xibbly2\node_modules\@discordjs\collection\dist\index.js:161:17)
at module.exports (C:\Users\Dom\Desktop\projekty\Xibbly2\Xibbly_modules\DiscordBot\utils\starboardAdd.js:22:23)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:9948) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:9948) [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.```
the embed is undefined 🤷♂️
easiest way to fix it is to use optional chaining
The ?. operator functions similarly to the . chaining operator, except that instead of causing an error if a reference is nullish (null or undefined), the expression short-circuits with a return value of undefined.
ok, thx
hey guys!
I have a json file with different coordinates. I basically get the distance (in KM, which is a number.) I have made a chart: js 1: 1, 2: 1, 4: 2, 10: 8, 12: 9, 15: 11, 20: 13, 25: 15, 30: 18, 40: 22, 45: 23, 60: 25, 80: 27, 100: 30, 125: 33, 140: 34, 150: 36, 180: 39, 200: 42, 250: 46, 300: 50, 350: 53, 400: 56, 500: 64,
So the left are the kms and right are the cooldowns in minutes. How do i make a code that wil take the cooldown in minutes that is the most near the kms.
like for example: 74km will get: 80: 27,
so 27 minutes.
how would i make a code like that?
none of what you just said made sense
i have made a distance calculator
which gives the distance in kilometers, right.
i want to have the right cooldown that belongs to the distance i
so for example a distance of 74km > is the most near 80km, so it will give 27minutes cooldown.
understand it?
so a nearest number lol
why did you complicate your question so much
i guess you can use KNN alg?
KNN?
does anyone know how to make sending the same message on different servers to specific channels? For example: !message (channel) and this send harvested message in this channel to.
i am using js
oh
this SO thread is going to be useful to you https://stackoverflow.com/questions/8584902/get-the-closest-number-out-of-an-array
don't just copypaste it in though
try to understand what it does
How can I see how much memory a map/array uses?
get a debugging tool
which one?
you can use chrome dev tools with the --inspect flag
node js xD
yeah... you can use the chrome dev tools
memory profiling
"how many people will fit in this car"
there's too many factors for you to have a concrete answer
xD
If you know the length of all of the strings you are storing you could get a very rough estimate
yes I know , 2000 objects with each 3 strings in a map
lmfao
do you know the lengths of the three strings?
Find length of strings
ah xD, guildid , prefix, true/false
10, 1, 4
Why is the "ban" property stored as a string? Storing it as a number / boolean would use less memory
@tired panther Well, to determine a string's size, you have to double the amount of characters , so (10 * 2) = 20, 20 bytes are used to store an ID string.
Hello I am new
Hi
ask the magic man
Who
the magic man
Use google search)
Internet have so much tutorials
as 0/1?
what should I save in the ban
I read somewhere that bools are stored as 4 bytes
yeah because of alignment in some languages
but in js numbers are floats and therefore use 8 bytes, so boolean is still better
🙄
if (options.Filter) {
Seek = Db.ExtraTime ? Db.Bot.dispatcher.streamTime + Db.ExtraTime : Db.Bot.dispatcher.streamTime;
}```
error :- ` UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'streamTime' of null
`
Db.Bot.dispatcher is null
Hey, So uh, I got a quick question, I am working on a custom welcome message for a server which should be configurable,
Yes
const welcomeEmbed = new Discord.MessageEmbed()
if(valueTitle).setTitle()
.setColor(0xf04747)
.setDescription();
Now ofc this wont work, But if i need to make a brute force method for every type or combination of title + description etc etc
it will cause hella cluttered code,
would there be a way to do this more efficiently for every different value?
But it is possible to have a embed to be title-less
so this would cause that the title does exist,
Yeah, \u200b
But it needs to be a str
Okay
Ok, i try again
does anyone know how to make sending the same message on different servers to specific channels? For example: !message (channel) and this send harvested message in this channel to.
Hmm
how to set it
and how many bytes are "true" as a string
4 * 2 = 8
wow just 4 bytes more
You'll need a database for that,
client.channels.cache.find(c => c.name === 'channel name').send(message)
Since every server has different channel names...
I know it
yeah
This command work if admin write !message (channel)
say for example have a mongo db string like;
272764566411149314,412006692125933568,751966421101182996
and have it split at (,)
and then make it a list
and message.channel.send(message)
where message is args.join( )
or wait
no channel.send(message)
and then have channel = the list
that makes for 2,5 k guilds 0,01 mb, not worth to change
How make array?)
Ffs
Wait
If you want to make a new array
You could do
let arr = []
Then
To add strings into it
You need
arr.push(str)
Ok, how save this array in db?)
@carmine summit so I tried the blank string in the title, it sends it as undefined, so the search will continue...
me?
Yeah
if (welcome.title == 'test') var title = '\u200b';
if (!welcome.title == 'test') var title = welcome.title;
const welcomeEmbed = new Discord.MessageEmbed()
.setTitle(title)
.setColor(0xf04747)
.setDescription('this is a undefined string...');
message.reply(welcomeEmbed);
help me
db.set('channels', arr)
pls
?
npm WARN deprecated dblapi.js@2.4.0: Module is no longer maintained
i get this error
@carmine summit the description is to keep it from crashing if it has no string there in the title
Remove it.
var title = welcome.title || '\u200b'
@tired panther one object stores 20 bytes for the id, 2 bytes for the prefix, 8 bytes for the boolean value that's a string. That's 30 bytes total per object. In reality it's probably more because of property names and offsets. 2500 * 30 = 75k bytes or 75 kb.
ight
Module dont maintained
It means that it is deprecated
You have to do it manually
but the issue is, is that the default string is test, so if it is test it wont have a title
what should I do
If the first one is undefined, it will then go to the second one, if you use ||
Cry
:(
Make it null instead?
:)
Because null is false
Somebody help you, just wait
@distant hound You need to read the api docs, to do it manually using axios
Smh
Wait
what data type should i use?
Array?
In db
@carmine summit set it as null, now the title is null
Lemme guess, null is a string?
there is no other way to retrieve it from the database
My db need data type, like - text, or bigint
Null must not be a string
Wut?im confused, what's going on
I think I got it, Imma test it brb
Nope, Doesn't work like that, But I just remembered, I think I remember seeing something about stuff like this somewhere...
Let me see your code
In some documentation, So Imma test that brb
On how you define it
var title = welcome.title || '\u200b';
const welcomeEmbed = new Discord.MessageEmbed()
.setTitle(title)
.setColor(0xf04747)
.setDescription('this is a undefined string...');
message.reply(welcomeEmbed);
Send me the code that defines welcome.title
look here;
Send me the code that defines welcome.title
By I mean null, I mean null. Not ""
hi, how do i get my bot to update details on the top.gg website? it says its in 0 servers but i know its in more
You need to do api magic
It's not gonna update automatically
var closest = counts.reduce(function(prev, curr) {
return (Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev);
});
if (closest == "1"){
return closest = "1"
}
if (closest == "2"){
return closest = "1"
}
if (closest == "4"){
return closest = "2"
}
console.log(closest);
if (isRaidBoosted(raid)) {}
let z = "BOOSTED"
let text = `**${name}** | **${varz}** | **${z}**` + "\n" + ${closest}``` will this return undefined? Because the if statemenets close before the closest is being called in the embed
i cant try
it can only be tried in certain events.
that is the problem.
appreciate your site tho.
I can't see return; anywhere so, I guess not?
The only way it will return is at the if statement
the send is under the let text
Also, you should use a formatter
this was just a snippet
Hm, Doesn't seem to work for me...
Hm
hmm so it wouldn't work?
Nope,
I need to find a way to get this single piece working and then I can go on my merry way
how can i ever define it inside it's scope?
Uh
How do a command, which set server-prefix? Save server prefix in db, yes, but how set this prefix for need server?
exactly what i've done
But if you do it like
if (true) {
let str = "test"
}
console.log(str) //undefined
TypeError: message.guild.me.voice.leave is not a function
ok
if (closest == "1") {
str= "1"
}```so @carmine summit this would work?
Someone, please get an error. I'm bored af
can you download and import custom fonts on samsung
yes
WING
oh they renamed to wings or im just dumb
downloads fira code
Choose one
Imma go with Samsung Sans
if (!Db.Always) {
await Db.VoiceChannel.leave();
};```
``` Cannot read property 'Always' of undefined```
bruh
what happen 🙄
Imagine capitalizing the first letter of a string
*variable
Its the same
Ok so guys
2|index | https://www.youtube.com/watch?v=KXdRl6Ml37I
2|index | https://www.youtube.com/watch?v=MVc3Z-bG6Eo
2|index | https://www.youtube.com/watch?v=6Z3N79ktprw
2|index | https://www.youtube.com/watch?v=_bZH1ygc5IA
2|index | https://www.youtube.com/watch?v=mdQvsppbxQY
2|index | https://www.youtube.com/watch?v=SEYdPQ5VKbY
2|index | https://www.youtube.com/watch?v=0opZqh_TprM
2|index | https://www.youtube.com/watch?v=WyX-PRqzV78
let songs = await getTracks(args22[1])
songs.forEach(async (ar) => {
let result = await distube.search(ar.name)
bruh.push(result[0].url)
console.log(result[0].url)
});```
Why is array empty
even tho it gets all the song
can't you conclude why just based on your logs output
forEach just fires a bunch of promises
it doesn't wait for them to finish
don't use forEach and instead do the classic for loop
you shouldn't use forEach anywhere really
it's super slow compared to classic for
Oh
when a user doesnt have a nickname and you try to rename it this happens:
https://gyazo.com/547349744e67bc2dddb7a9c89fd300e0
heres my code:
event.getMessage().getMentionedMembers().get(0).modifyNickname(event.getMessage().getContentRaw().substring(11).replace(event.getMessage().getMentionedMembers().get(0).getAsMention(), "")).queue();
event.getChannel().sendMessage("Successfully renamed " + event.getMessage().getMentionedMembers().get(0).getEffectiveName() + " to" + event.getMessage().getContentRaw().substring(11).replace(event.getMessage().getMentionedMembers().get(0).getAsMention(), "")).queue();
//Java
OK so I have never done a classic for loop
let songs = await getTracks(args22[1])
for (i = 0; i < songs.length; i++) {
let result = await distube.search(songs.name)
let final = await result[0].url
bruh.push(final)
console.log(final)
}```
But I guess it will be something like this
null
and you need to index songs
correct
But i want all of them
but instead of 0, you're going to use i
gonna need more than that chief
sec
const Discord = require('discord.js')
const client = new Discord.Client()
client.on("message",async(message)=>{
const role_switch = await message.guild.roles.fetch('781710153354575892')
console.log(role_switch)
})
client.login('mytoken')
and thats the error i get
that's exactly the code you have in your editor?
and it is saved?
sorry what
I'm making a bot with a friend which is meant to check the status of everyone in the server and then send a certain message based on that, but at the moment it's the member list it's getting only incudes itself and no one else in the server
async def vibeCheck(self, ctx):
bot=self.bot
memberList = ctx.guild.members
print(memberList)
for member in memberList:
print (member)
does anyone know what's going wrong here?
enable intents
Thanks for that, should fix everything ^-^
Is there a way to make your bot send a message like when it joins it says (thank you for adding me!)
sure
what language and library?
There is a guildCreate event
Bdfd or discord.js
guildCreate for discord.js idk about bdfd
Ok discord.js
Can some give me py script of server up vote
ok, so i got this problem
Yes?
?
when i do userinfo on WarGack, it logs this error
how can i get the message from the reaction cuz i can only get its id
reaction.message
Cannot resolve method 'getMessage' in 'GuildMessageReactionAddEvent'
@tribal siren
could anybody tell me why my text is not being sent? I know it is because of the if statements, but why and how to fix it?
that's the only method i know of
yes but why are you doing it in the first place
how can i set specific redirect urls with flask and discord auth flask?
it is for pokemon go
i didn't ask that
i have a specific distance between raids
i'm asking why you're transforming it like that
and i want the corresponding cooldown
and it goes by a specific list: js 1:1 2:1 4:2 10:8 12 :9 15:11 20:13 25:15 30:18 40:22 45:23 60:25 80:27 100:30 125:33 140:34 150:36 180:39 200:42 250:46 300:50 350:53 400:56 500:64 600:72 750:82 800:86 900:93 950:97 1000:100 1150:111 1200:115 1250:118 1266:120
left km (distance), right the cooldown
so why not just use a map
The Map object holds key-value pairs and remembers the original insertion order of the keys.
fill the map when your app boots up
and then just get(key)
module.js:550
throw err;
^
Error: Cannot find module '../build/better_sqlite3.node'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/rbd/pnpm-volume/cc2b88ab-6c71-4cd1-93ec-efef8f9711ff/node_modules/.registry.npmjs.org/quick.db/7.0.0-b22/node_modules/quick.db/node_modules/better-sqlite3/lib/database.js:5:21)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
pls help
me
me bot is inactive
you didn't follow the instructions on the quick.db installation page
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/app/bot.js:22:12)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
````MongoError: Authentication failed.``` what does this error usually mean?
would you believe me if i told you that the authentication failed
but its the correct username and pass kek
google around and narrow your problem down 🤷♂️
ok
I wanna make a voting system and idk how to check if there are more reactions with 1 emoji or another in js
reaction.users
hello tim
That will contain all users that used a specific reaction, so you can count them
Hello lol
jason.db has more installs than ourcord
that's just sad
yep it is
installs on npm don't mean much
ik but its just funny
loggers
(node:1516) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'addRole' of undefined
HELP
whats your code
throw new TypeError("Cannot read property 'addRole' of undefined")```
lmfao 
okay, so i have put everything in a map, but the question is.
how to call it?
how to get it to action.
map.get('<corresponding key>')
that is the problem.
my distance isn't the same as the mapped ones.
i miht have distances of like 74km.
that should become 80.
you understand?
yes
it has to take the most near.
round up or down?
{
const DBL = require('dblapi.js');
const express = require('express');
const http = require('http');
const moment = require("moment")
moment.locale("tr")
const app = express();
const server = http.createServer(app);
const listener = app.listen(3000, function() {
console.log('Your app is listening on port ' + listener.address().port);
});
const dbl = new DBL("", { webhookAuth: '123', webhookServer: listener, webhookPort: 3000});
dbl.webhook.on('ready', hook => {
//console.log(`Webhook running with path ${hook.path}`);
});
dbl.webhook.on('vote', vote => {
dbl.getUser(vote.user).then(user => {
let tarih = moment().add(3, 'hours').format('__(**DD/MM/YYYY**)__ [Saat:] __(**HH:mm:ss**)__')
const embed = new Discord.RichEmbed()
.setTitle(":canelmasss1: Yeni Oy!")
.setDescription(`> :candansss: **( ${user.username} )** Adlı Arkadaş Sky'a Oy Verdi Teşekkürler!`)
.setColor("RANDOM")
.addField("Oy Veren Bilgileri:",`:cansagagit: <@${user.id}>\n:cansagagit: __${user.username}#${user.discriminator}__\n:cansagagit: __${user.username}__\n:cansagagit: __${user.id}__\n<@&777611852791152670> Vote Supporter Rolünü Başarıyla Verdim 12 Saat Sonra Geri Alacağım`).addField("Tarih:",`> ${tarih} \n\n\n :cans::cank::cancany:`)
.addField("Sende Oy ver Rolüünü Kap", "[Oy Ver](https://top.gg/bot/765291624586018856/vote)")
client.channels.get("784415260085714964").send(`<@${user.id}>`, embed)
let server = client.guilds.get("687692294337331221")
server.members.get(user.id).addRole("788426229699051551")```
what is command error
that depends on the distance
if it's 50:
``js
distanceMap['45'] = '23'
distanceMap['60'] = '25'```it has 2 options
who
is html encoding neccesary
no idea
okay so it works
i get the nearest number from the logarithm i made.
distanceMap.set(60 , "25")
how do i get the "25" tho?
I thinkn you can get https://discord.com/api/users/@me/guilds
With the Bearer <token> authorization of course
Nope
it just returns an array
so response.length
like
the json response is an array of guilds and their basic info
you have to make another request to the /api/users/@me/guilds endpoint
it'll send an array of guilds
so you can get its length
nope
const serverCount = response.length
yeah
guilds have a permissions number
How does one go about creating a bot?
create a bot
Well, yes, but what steps
@gaunt crypt do u know how to code?
How can I make a image smaller in css
height width
width: smolWidth
Ok @crimson vapor I am here
I don't know java 
Not much but I can do a few things
what lang?
😐
let varz = "";
let z = "";
let var5 = Boolean(raid.ex_raid_eligible);
if (var5 == true) {
varz = reactionEmoji9;
function isRaidBoosted(raid) {
var pokemon = [];
var key = "" + weathers[raid.cell_id];
var weatherAffinitie = weatherAffinities[key];
} let text =
`**${name}** | **${varz}** | **${z}**` +``` why is this always showin boosted and ex logo?
because it is not always true or false
let var5 = Boolean(raid.ex_raid_eligible);
i think there are broken brackets
yeah
there are a couple of libraries for permissions i think
What is the ex_raid_eligible property
and it does return false/true.
or you can use some bitwise operators
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
just can't get the emoji to work. Because now it only shows the emoji all the time, even though the boolean shows false.
anyone that knows the answer?
how would i force dark mode on my bot page? i was directed here to ask. thanks for any help 🙂
[
{
"id": "some-guild-id",
"name": "The kids club",
"permissions": 435632,
// There was more stuff
}
]
on the edit page
yea
Just map it
array.prototype.map
the option is there however when i click it and submit my changes it does not work. I get the error:
Forced themes are only enabled for creators who use custom CSS in their detailed description.
However i am unsure of how to rectify the issue.
console.log(<Guilds>.map(...fn).join(seperator))
well you gotta include css in your bot's page
apparently
🤔 ok i have no clue on that. I think ill leave it as is
okay so i fixed the EX problem.
but i have the same problem with the BOOSTED
let z = " ";
function isBoosted(raid) {
var pokemon = raid.pokemon_id;
var key = "" + weathers[raid.cell_id];
var weatherAffinitie = weatherAffinities[key];
}
if (isBoosted(raid)) {
z = "BOOSTED";
}
let text =
`**${name}** | **${varz}** | **${z}**` +````
this code is not showin the boosted at all
i tried logging z
but it does nothin
could anyone help me please?
isBoosted function doesn't return anything
It doesn't have the return keyword in it
i am trying to get this
wait what
Several ways
for() loop, Array.prototype.map(), Array.prototype.forEach(), Array.prototype.reduce(), etc etc
map and reduce technically ain't loops
what do you mean by it doesn't have return?
for example
They aren't, but they at least apply a function in the current element so
function isAwesome(value) {
return value === 'awesome';
}
function bruh() {
"Bruh";
}
bruh(); // undefined
function bruh() {
return "Bruh";
}
bruh(); // "Bruh"```
nope
well array.map basically creates a copy of the original array
you can pass a function that returns a different version of the current element
for example
const nums = [4, 6, 2, 3];
// I want to double all the numbers
const doubled = nums.map(num => num * 2); // [8, 12, 4, 6]
function isBoosted(raid) {
var pokemon = raid.pokemon_id;
var key = "" + weathers[raid.cell_id];
var weatherAffinitie = weatherAffinities[key];
if (isBoosted(raid)) {
return z = "BOOSTED";
}
}```this should just work fine but it doesn't
still BOOSTED doesn't show, while it actually should.
you always have to return a value
then something is broken
You can iterate through every guild and access whatever property of it you want, and join it and log all at once instead of spamming the console
Wait
@eternal osprey Your app is going in a loop
above is let z = " "
isBoosted still doesn't return anything
You are calling isBoosted in the function
You're closing the function early
And calling the function inside the function itself which doesn't even return anything
Hello how to add server count in our bot dashboard
Use the top.gg API to post your servercount
How
I don't know
Google basics of making a POST request
my dad is smart
pff whatttt
Lemme explain your function lmao
// Function definition start
function isBoosted(raid) {
// Defining variables
var pokemon = raid.pokemon_id;
var key = "" + weathers[raid.cell_id];
var weatherAffinitie = weatherAffinities[key];
// This is where the function is supposed to end and return a value but you don't close and call it in a if statement which as usual, it doesn't have a return value because it never passes this block
if (isBoosted(raid)) {
// Abandoned area
return z = "BOOSTED";
}
}
// Function definition end```
// Function definition start
function isBoosted(raid) {
// Defining variables
var pokemon = raid.pokemon_id;
var key = "" + weathers[raid.cell_id];
var weatherAffinitie = weatherAffinities[key];
// This is where the function is supposed to end and return a value but you don't close and call it in a if statement which as usual, it doesn't have a return value because it never passes this block
if (isBoosted(raid)) {
// Abandoned area
return z = "BOOSTED";
}
}
// Function definition end``` lemme format your function
so i should close it and return it's value
Can any one send of server count
and after that scope i should use the if?
?
Return the value that's supposed to be the boolean
how to add server count in our bot dashboard @earnest phoenix
I already told you
use the top.gg API
smh
@earnest phoenix how
never worked with the API but you need to make a google post request as Voltrex Master says
I don't now please help
How to post
Is it so hard to do a Google search?

@earnest phoenix what search
🗿 I literally said, "Google basics of making a POST request"
function isBoosted(raid) {
var pokemon = raid.pokemon_id;
var key = "" + weathers[raid.cell_id];
var weatherAffinitie = weatherAffinities[key];
return m = Boolean(z);
} ```so like this right?
http requests dum dum
what is z?
What is m
what is f
why do you format like this?
omg i fucked up
?
what?
you said you fucked up lmao
This guy confused himself in his own confusion
let text =
`**${name}** | **${varz}** | **${z}**` +```
How to post request
yeah
this is the variable that i want to if
so if( m == true){
Jeez what is wrong with your editor
Just return the boolean instead of assigning it to a variable
but how would i later on call it then?
it doesn't need to return a variable
function isBoosted(raid) {
var pokemon = raid.pokemon_id;
var key = "" + weathers[raid.cell_id];
var weatherAffinitie = weatherAffinities[key];
return Boolean(z);
}```like this
but wouldn't it be undefined if i would try to reach it?
Wait a minute
Uhh
If you only need to convert the variable z to a boolean and return it, why to define the other variables that are unused
yeah but that doesn't fix the problem
Your function definitions are confusing, you're defining variables or doing operations that doesn't affect the return value whatsoever
yeah nvm boys. Thanks for the help!
i will just cut it off and delete that function.
You take a parameter called raid and define variable based on it, but on return you only convert z to a boolean
K
or wait it worked
Lol
request('https://verify.eryn.io/api/user/' + message.author.id, { json: true }, (err, res, body) => {```
says it cannot read property 'id' of undefined
Why does this line throw a NullPointerException?
.setImage(event.getChannel().getHistory().getMessageById(event.getMessageIdLong()).getAttachments().get(0).getUrl())
one of those method calls returned null
probably because the message attachment is null
does a embed image count as a attachment?
I don't believe so.
wat really
It would be under the embeds object returned from the API.
then how do i get the image?
o
o
well why isnt the request working when i send it
it just keeps giving me it cant read id
Is the image in an embed, or is it just an attachment
this
in the embed
Rr lb
See https://ci.dv8tion.net/job/JDA/javadoc/net/dv8tion/jda/api/entities/MessageEmbed.html. For example, if it was in the image field, you could use .getImage().getUrl()
ok thx
of course, to get the embeds, you need to use .getEmbeds() on a Message instance (https://ci.dv8tion.net/job/JDA/javadoc/net/dv8tion/jda/api/entities/Message.html#getEmbeds()).
Log what message is
Also why are you using request? It's deprecated.
console.log(message)
more of your code
exports.run = async (Discord, client, message, args) => {
console.log(message)
let groupid = 1;
request('https://verify.eryn.io/api/user/' + message.author.id, { json: true }, (err, res, body) => {```
Are you sure it didn't log anything, because going by that, message is not a Message instance like you're using it.
it still throws a nullpointer for some reason..
.setImage(event.getChannel().getHistory().getMessageById(event.getMessageId()).getEmbeds().get(0).getImage().getUrl())
show the code in your message event where u run the command
You have to check beforehand if any of the methods are null.
You could log one-by-one to find the offender.
billion dollar mistake™️
wdym
ill send the whole code one sec
https://gyazo.com/c8339bcfaccd80d6bf946863038f0d69 im trying to do stuff with this message
u cant upload messages without attachments there
so how come its a nullpointer
i mean the message event, where u check if the input is a command or not
if you have it in your index than yes
xD
How can i put attachment in .setImage() on MessageEmbed.?
attachments://name.png
why this throw null pointer
.setImage(event.getChannel().getHistory().getMessageById(event.getMessageId()).getEmbeds().get(0).getImage().getUrl())
(yes, the embed im getting 100% has a image)
i dont think this is to show off but to ask-
people ask questions here
oh cool
what here is not in v12 bc some of it isnt but i forgot:
} else {
rbx.getUsernameFromId(body.robloxId).then(username => {
let nametoset = username;
message.member.setNickname(nametoset).catch(function(err){
message.channel.send(`Error: I was not able to update your discord nickname.`)
const newname = body.robloxUsername;
});
message.member.addRole(message.guild.roles.cache.find("name", "Verified")).catch(function(err){
message.channel.send(`Error: I was not able to give you the verified role.`)
});
rbx.getRankNameInGroup(groupid,body.robloxId).then(data => {
rbx.getRankInGroup(groupid,body.robloxId).then(data => {
let RankForGroup = message.guild.roles.cache.find("name",data);
message.member.addRole(RankForGroup).catch(function(err){
message.channel.send(`Error: I was not able to update your discord role.`)
});
});```
yeah
Sorry
?
Wrong server my bad
lol
Bro that's a long chain of functions haha
I accidentally said eat my 🍆
yeah i saw that..
Yeah
Nice typo lol
use your trusty debugger
it says that fn.bind is not a function
probs has to do with a .find thing since its in v11
is it not message.member.addRole
?
roles.add() now
.setNickname() returns a promise
hmpj
i get fn.bind() is not a function
message.member.setNickname(nametoset, "Verification").catch(function(err){
message.channel.send(`Error: I was not able to update your discord nickname.`)
const newname = body.robloxUsername;
});
message.member.roles.add(message.guild.roles.cache.find("name", "Verified")).catch(function(err){
message.channel.send(`Error: I was not able to give you the verified role.`)
});
rbx.getRankNameInGroup(groupid,body.robloxId).then(data => {
rbx.getRankInGroup(groupid,body.robloxId).then(data => {
let RankForGroup = message.guild.roles.cache.find("name",data);
message.member.roles.add(RankForGroup).catch(function(err){
message.channel.send(`Error: I was not able to update your discord role.`)
});
});```
from this
.bind?
yes
