#development
1 messages · Page 1410 of 1
functional language ™️
One message removed from a suspended account.
I mean it does
it would add a tiny overhead to call the function, but it's super tiny, a few ns or so
Why the fuck are there separate packages for is-odd and is-even
meme packages ig
One message removed from a suspended account.
please i'm going insane i need a break
What's hard about num % 2 === 0
i spent most of my awake hours today making electron inject over a fullscreen opengl app
One message removed from a suspended account.
spoiler alert
Ew electron
it's minecraft
One message removed from a suspended account.
One message removed from a suspended account.
Pgo
disaster
One message removed from a suspended account.
One message removed from a suspended account.
I can imagine
One message removed from a suspended account.
im working on an array-like storage class based on strings lmao
Why not use arrays 
ph
One message removed from a suspended account.
Oh yeah you said
One message removed from a suspended account.
does js has vectors?
One message removed from a suspended account.
One message removed from a suspended account.
not afaik
you'd surely need a native module
vectors go lowlevel
at least the ones in .net that is
Thanks
So apparently the delete keyword is the fastest thing associated with arrays
do vectors support strings?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Hi
One message removed from a suspended account.
efcore + sqlite/postgres is my togo
If My Bot In 76 server well prove?
One message removed from a suspended account.
One message removed from a suspended account.
hey guys
If My Bot In 76 server well prove?
@steel dirge it should
wait for the automated DM
I need help fixing this it says
client.user.setActivity("playing" H!help"});
When it gets to that part of the code it says client is an unknown identifier
lol
Damnnnn
is it concurrent though 👀
time taken to match all occurences of a string in 500k items
Let's see some code
@gritty sinew it needs to be in a string
Also tip, windows + shift + s to take screenshots
I only use discord on phone
Ah
if there's a red line under your code then it's clearly indicating something is wrong about it
So put () around it
im gonna make this into another npm package lul
@earnest phoenix is there a way to see solutions on the css website you shared
Cause that's the part of the code that's acting up idk if it's because a learned from a really old guide or what
i think you can see what other people have done
that disableEveryone.token makes no sense
oh ok ill have to try and find that
also, you're mixing {} and ()
you cant mix them
this one is also completely wrong
I'm using videos cause all the freaking courses cost money or are way to out of date that the dont work with VSC anymore
And ty tim
well, the people who wrote/produced the resoures have to eat too
if only there was some kind of fund for people who work open source
its been years since i last logged in to SO lmao
I just realised they're using ' and a template literal
Or at least the syntax for a template literal
ye lul
And all the types of quotes
<img style=box-shadow:0+0+0+2in#b5e0ba,0+0+0+5in#5d3a3a> i love how this is the top solution for the first exercise
wat
Also I was able to make it work without arguments but I need arguments to use commands
dafuq is that box-shadow syntax
@gritty sinew learn js first, at least learn basic syntax and formatting and linting
who knows
if only there was some kind of fund for people who work open source
fun fact about this, FSF will glady protect any properly licensed open source code
if someone breaks the license for your open source project and you take them to court, FSF will most likely assist you (financially)
How do i make some sort or mail bot or whatever they're called
Aka track my bot dms
(Py)
I haven't i want the general idea
Of how to do it
Like the module i should be using
So i can start doing it
just listen to messages from dms
he said hes using dpy
Method or whatever its called
Like u know for checking msgs on a guild its on_message or wait_for
well he only said py, im assuming dpy
For dms what is it?
on_message should work for dms as well
yeah
good thinking
second, do you happen to know if a bot that stops recieving events past its verification limit?
say, bot is at 74 servers, its already connected, hits 76, i assume it wont lose its updates until it reconnects?
No reason other than scepticism
it should work until it disconnects
okay good
I could be completely wrong
fuck this bot is giving me more headache that it should
lmao
rust too wack
hey guy
Ok Erwin firstly hiwdareyouassAULTMYHUSBAND
Secondly,,,,,
Uwj
can I ask a question about writing code?
yes
You can indeed
thank you, I want to ask you about the webhook
how do I write a webhook that can delete the user message and set the webhook name as the user name. I also see someone did the webhook that work on every channels too. For example: /hook @jaunty surge Hi and it will print Hi in custom channel with my name as a bot
Like
which language you using?
discord.js?
yes
discord.js has a section in their docs about using webhooks
I'd use quick.hook
@pure lion yes like that
lemme grab it
@quartz kindle but it's not really detailed
you'd need to create a webhook, then send the message through it, then delete the webhook afterwards
@jaunty surge https://discordjs.guide/popular-topics/webhooks.html
Will
async def on_message(message):
if message.channel == client.message.DMChannel:
# blah
else:
pass
work?
webhooks are legit the same as channel. Same payload and format. The only different is that you're using a webhook rather than a channel
no
What does pass mean
I also see someone use 1 webhook that work in every channel
@quartz kindle why?
oh
im fairly certain webhooks are channel bound
@wise quartz you wanna check the channel.type
@opal plank bot webhooks are a one time thing
you'd need to change the webhook to a different channel or create one for every channel
nah, webhooks you can use
Or use quick.hook
they stay for as long as you like
D.js makes it stinky
it creates an integration iirc
because I seen people write their message with the bot sign next to their name and it's really interesting so I want to try
message.channel.type == "private"
was about to ask
because py
and why not ===
Oh
reeee
Because py
Ok thank you for it
@quartz kindle thank too
== is kinda the same as === right?
Extremely
Plagiarist you copied my joke
does python have ===?
What about this?
async def on_message(message):
if isinstance(message.channel,discord.DMChannel):
#balh
that could work yes
Alr
Also whats the difference between
!== and ==!
What should === do btw?
==! doesnt exist
^^
What is !== ?
Somebody used it inside the code and it seemed to work for them
Jeez so much new things
But eh, I’ll stick to !==
!== different than
@agile lance !== is not exact and ==! is what a drink person does
but checks type too
They were probably doing if (true ==! false)
1 != '1' => false
1 !== '1' => true
the difference between === and ==, which is also the same as the difference between !== and !=, is that the shorter version converts types, the longer version doesnt.
for example 1 == "1" is true, but 1 === "1" is not true
fek your ts
Or rust
no fork u
Nooo! Don't Frick Tim!!!!
nah faka u
spoon you
Lmfaofiaofj
So will this work
if (message.author.id !== "MY ID HERE") {
message.reply(`You can not access the **eval** command!`)
} else {
// code here
}```
spoonfeedin! @ mods!
That made me exhale
yes
Thanks :-)
When writing an eval, is it wise to write a try catch blocc for the eval or is there a better way?
Okay cool
just eval().catch(() => {}); 
I didn't know if you meant yes or yes
So is if(message.author.id !== 'myid') return message.reply("You're not the boss of me"); 400 IQ then?
error catch is not a function
Tim,,,,
yes
shhhhh, just add another .catch() in the end 
lmao
Is it okay for me to get angry at people who use async (callback func) or await function().then(...)?
i mean, await function().then() is a valid use case
Like why would you evermixsyncandasyncitslikeincest
there we go, that was so stupid its worthy of starboard
you cant chain .then() on await iirc
you can
u sure?
I hate mixing sync and async
yes
It makes me cry
hmmm
I use async where possible
@pure lion how do you change webhook name to user name for the webhook message
that makes no sense though
South Texan farming university
await is technically then, it waits for the promise to fullfill
arent you technically splitting into different threads?
js is event-based
hmmm, time for more booze, one sec
promises are a glorified timeout
Yes but the good thing is that you don't need to write .then() 
.and_then
await awaits for all promises to fulfill
if your function returns a promise, it awaits it, if the promise returns another promise, it awaits it as well
until there are no more promises left
.await? very sexy mmm
It's like a stack of burgers
Or just a stack of you're low on time
hmmm thats a bit odd
No it's not
it is
It's not rocket science it's computer science
I don't think it's like that, because it would look like Promise<Promise<Promise<T>>>
const a = await promise.then(console.log(a));
what would happen on this case?
does await finish before then?
reeee
const a = await promise.then(() => console.log(a));```
Because I'm a mere mortal
there
Oh I hate that
a will be undefined
So much
then finishes before await, then?
Ok well gn
gn
it resolves the promise, then resolves the .then()
.then() doesnt return anything
so a is undefined
a is the return from the .then()
that makes absolutely no sense
await returns the value of the final promise in the chain
but you arent returning anything
you'd need brackets there
without a return
lemme write dummy code
arrow function without brackets = implicit return
yep
Here, have a read, @opal plank https://js.evie.dev/functions#es6-functions
^_^

async function test() {
let a = 0;
await setTimeout(() => a = 1, 2000);
return a;
}
const b = await test().then(() => {console.log(b)})
logic would dictate b should be 1, and then should log either 1 or undefined
Jesus you spent a lot of time writing that page
that setTimeout wont work lul
Not a lot, I was very inspired 😂
b will be undefined
yeah it would be
and if i were to add a console.log(b) below?
it makes no sense
The best example I have of chaining promises is fetch(). ```
fetch(url).then(res => res.json()).then(json => console.log(json))
Or, ```js
const jsonData = await fetch(url).then(res => res.json());
.then() should simply run a function on the output, not change the value of the variable its in
Promise chaining requires every part of the chain to return something
think about a promise chain as a reduce function, the returned value is the accumulator, after all items have been processed, except with promises there is no accumulator unless you return it on every then()
.then(() => {console.log(b)}) returns undefined so awaiting it would give you undefined on b
hmmm i understood it, but i still dont think its logic
it is logical because otherwise how else would you properly wait for something, then wait for something else that needs the first thing?
So I used the code I know and the error is showing up
const wait = require("util").promisify();
async function test() {
let a = 0;
await wait(2000);
a = 100;
return a;
}
const b = await test().then(result => {
console.log(result);
return result;
});
console.log(b); // 100
Which makes no sense since I have what there saying is missing
first log is undefined
@gritty sinew might wanna learn some javascript before writing a bot. It seems blatantly obvious you don't understand basic syntax right now
yes, both are 100
like i said, i understood it, but its still confusing
let's clarify it. ```js
const wait = require("util").promisify();
async function test() {
let a = 0;
await wait(2000);
a = 100;
return a;
}
const b = await test().then(result => {
console.log(result); // 100
});
console.log(b); // undefined
What's the difference? The promise function didn't *return* anything.
if it didnt work like it does, you wouldnt be able to do something like this ```js
finalResult = await promise().then(result1 => promise2(result1)).then(result2 => promise3(result2));
console.log(finalResult)
honestly it's the same as chaining normal functions. If you don't return a value from the function you can't assign that "nothing" to a variable. it'll be undefined.
well yeah
const add = (a, b) => { a + b };
This won't work, add(2+2) gives you undefined
Same happens with promise chaining.
in fact, ```js
const add = async (a, b) => { a + b }; // resolves to undefined
const add = async (a, b) => { return a + b }; // resolves to a + b
is how .then() manipulates the value of the promise it originating from
I'm not talking about scopes
I'm talking about returning something from a function so that it can be used later.
yeah that part i know
The callback in the .then() is no different than any other function
It "manipulates" it only as any other function would
it's just a callback function, nothing more.
it doesnt "manipulate" the value, it receives the value
the promise returns a value
.then() receives the returned value
as an argument
const jsonData = await fetch(url).then(res => res.json());
Also, ```js
const wait = require("util").promisify();
async function test() {
let a = 0;
await wait(2000);
a = 100;
return a;
}
const handleResponse = (result) => {
console.log(result); //100
return result;
}
const b = await test().then(handleResponse );
console.log(b); // 100
since it's "just a function"
when you return res.json(), that itself becomes the value
and after that, if you attach ANOTHER .then(), it'll get the value from that already parsed .json() from the privous then
thats whats confusing
await getOne(1).then(one => one++).then(two => return two);
expected, 1
actual return, 2
getOne returns 1
thats the bit i was talking about, it IS manipulating the output of getOne
two in the second .then() is already 2
.then(one => {one++; console.log(one)}); //2
.then(one => one++).then(two => console.log(two)) //2
Look, ignore the promise for a second. ```js
const getOne = () => 1;
const one = getOne();
const two = one++;
console.log(two)
What's your value?
yeah i understand that
Ok but it's the same thing
ik, i told u, i understood it lmao, its still doesnt make sense to me
the principle is the same as this:
const async getOne = () => 1;
const one = await getOne();
const two = await one++;
console.log(two)
This is the exact equivalent of await getOne(1).then(one => one++).then(two => return two);
I mean, as far as order of operations go
This is why I prefer async/await by an order of magnitude. Because there's no confusion callback chains.
either js whack as fuck or im not drunk enough
It's real hard for a senior to be able to even comprehend the confusion you're feeling now, so I'm sorry if I can't relate anymore
its the carrying value of .then() and assignment based on the .then()'s and not the promise itself
.then() is a type of callback
i get that
Yes, it's chaining them.
Just like the pipe operator in bash.
the output of one goes to the next in the chain
what i dont get is why the value changes while chaining them
its intended
im aware
but its ilogical imo
because the callback function returned a modified value and that's what's being sent down the chain, not the original promise.
It's not passing the original promise resolution, it's passing the new promise resolution.
serial, not parallel.
hmmm that makes sense
I gotta say it took me a long time to really grok promises.
a few months at least.
i've used promises for a while now, hands down its completely fine specially cuz i despise .then() unless browser doesnt support async
a = await promise() // resolves to 10
.then(result => { // result is 10
return 20;
}) // resolves to 20
.then(whatever => { // whatever is 20
return 999;
}) // resolves to 999
a // 999
.then()'s just causes callback hells
I think what really made me understand is when I had used promises for a few months and I ended up making one. that's when it sort of clicked for m.e
^ same
that actually explains
funny how a simple image can say so much

get rid of it
throw it out the window
like im doing to js arrays
friendship ended with array, string my new best friend
lmao
come to ts and you'll say that, but for typescript
come to graphql and you'll say that, but for graphql
def owner(ctx):
return ctx.author.id == ctx.guild.owner_id
@commands.group(invoke_without_command=True, aliases=['manager', 'm'])
@commands.check(owner)
async def managers(self, ctx):
setup = db.child("guilds").child(ctx.guild.id).child("setup").child("managers").get()
setupval = setup.val()
if setupval == None:
await ctx.send("You have no managers yet")
return
q = 0
msg = ""
while True:
if q < len(setupval):
msg = msg + f"<@{setupval[q]}>/n"
q += 1
return True
else:
return False
await ctx.send(msg)
``` Why does this not work? (py)
it returns before the message is even sent
perhaps you mean to break instead of return False and just remove return True
@wise quartz
also you should just be iterating over the list instead of using a while loop with the length
how?
use a for loop
if you dont know what that is, you should learn python before making a bot
i know what a for loop is
and i tried it before using a while loop
but it didnt work
idk why
can you show what you tried
i dont have a copy of it but imma try to write it
GraphQL is nice unless you're working from a very strongly-typed code base
I hate Apollo so much but it's the only decent option.
i = 0
msg = ""
for i in len(setupval):
msg = msg + f"<@{setupval[i]}>\n"
i += 1
await ctx.send(msg)
``` @hollow sedge something like that
that wont work tho
why not?
setupval is a list inside my db
setupval is ["idididididiiddiid","ididididididid"]
so i use i as an index
to get all of them
how does that change anything
idk
i am not that advanced in python so not sure
this works tho imma keep it
the while loop
lol
it's bad but ok
ok how do i change it to a for loop then?
You could even: py msg = "\n".join(f"<@{id}>" for id in range(len(setupval)))
this
which i am, Ts
enjoy your suffering
unless you plan on hard-coding the query as a string
then really good luck
any 
thats some advanced 💩 lol
1 line code
fancy ass
any help?
it wont even work properly
those are literally there for simplicity
im pretty sure Lite was joking with that
msg = "\n".join(f"<@{id}>" for id in setupval)
it'd be like that though
no thats complex
its simple for ur level
not me
tho its kinda understandable
anyways so how i do ur for loop excatly cuz i dont get it
for manager in setupval:
setupval[manager]
?
list1 = ["a", "b", "c"]
for letter in list1:
print(letter)
this will print "a"
then "b"
then "c"
yes
yes
how do i make a api
In this video, I will show you how to create a Youtube API Key.
Go to: https://console.cloud.google.com
Sign up for service and follow the step by step video.
If you liked it consider liked and share it - https://youtu.be/sVEytWDWYwM
Follow on the Telegram - https://t.me/wordpressforbeginners
#YoutubeAPI #createYoutubeAPI #getYoutubeAPI
abort
the worst part isnt the API key
its the Auth screen that needs to be verified by google
you thought verifying on discord was lenghty and annoying?
hahaha, cute
do i have to make a youtube api because im make a api for it to shown different anime image
hey\
anyone able to walk me thru hosting the main file, separate from my other files because i am using cogs
py
Hi, i want ask about search song command. When I use the search command, why do I always get an error ```
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'voice' of undefined
at Object.execute (/app/src/commands/play.js:22:40)
at Object.execute (/app/src/commands/search.js:47:45)
but when I use play command, I don't get any error and it works
no in your case you have to choose a different one
because whatever you're trying to use dot notation to access on .voice is undefined.
And it's coming from src/commands/play.js line 22
@neon heart *
in command play.js line 22 const { channel } = message.member.voice;
so message.member is undefined.
there are cases where message.member can be undefined. I recommend checking if it's equal to undefined and considering the user not in a voice channel.
hmmm
it won't ever be undefined because discord sends you the member - you need to have server member intent enabled
i have enable from discord developer portal
are you using the intent in your code though
djs uses gateway v7, you need to specify your intents
Can someone help me with getting data from DSL? So I got a simple webhook server but I’m confused how exactly I need to go about getting this to work. I’m using Python by the way
#topgg-api would be more appropriate
Well it’s not an API though..
#topgg-api is for top.gg's API
Yea.. DSL uses webhooks it doesn’t have an API.. DBL has an API
what intents should i use?
take a guess
it's enforced on v8, no?
yes
So on v7 intents are still optional
i asked you to take a guess because it's a really logical solution, take a guess and i'll tell you whether you're right or not
What the fuck happened to v7 anyway
a product of switching 60 different developers within a month
they just abandoned it altogether and went to v8
yikes
guild_member?
the only difference between v7 and v6 is... fancier error codes in v7
close enough, GUILD_MEMBERS
then what should i do?
specify the intent in your client and it should work
like this?
const client = new Discord.Client({
disableMentions: 'everyone',
ws: {
intents: 'GUILD_MEMBERS'
}
})
yup
I don't think it accepts intents like that tho, maybe a bitfield or an array of intents
after using the intent, the command doesn't work
because message intent isn't enabled?
GUILD_MESSAGES ?
nope
May i see how you exactly used the intents
const client = new Discord.Client({
disableMentions: 'everyone',
ws: {
intents: ['GUILD_MEMBERS', 'GUILD_MESSAGES']
}
})
These are all the intents and their bitfields, try to construct a bitfield and use it
It's like addition, start from 0 and add the bitfield of the intents you gonna use to it
i am read how to use intent from this question https://stackoverflow.com/questions/64559390/none-of-my-discord-js-guildmember-events-are-emitting-my-user-caches-are-basica
is it wrong?
Just use this
const client = new Discord.Client({
disableMentions: "everyone",
ws: {
intents: (new Discord.Intents().add(<array of intents>))
}
});```
or just [intent 1, intent 2, ...]
like this? ```js
const client = new Discord.Client({
disableMentions: 'everyone',
ws: {
intents: (new Discord.Intents().add(['GUILDS', 'GUILD_MEMBERS', 'GUILD_BANS', 'GUILD_EMOJIS', 'GUILD_INVITES', 'GUILD_MESSAGES', 'GUILD_MESSAGE_REACTIONS', 'DIRECT_MESSAGES']))
}
})
I guess but you shouldn't use intents that you don't have access to
GUILD_MEMBERS and GUILD_PRESENCES are privileged intents and needs whitelisting
uh
this is simple question but why go to hard question? my search song command cannot run because message.member.voice is undefined at play.js
What's the error you exactly got? + Stacktraces
at Object.execute (/app/src/commands/play.js:22:40)
at Object.execute (/app/src/commands/search.js:47:45)
at processTicksAndRejections (internal/process/task_queues.js:88:5)
(node:1488) 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:1488) [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.```
Oh wait, i think i know why this is happening
It's because of wrong parameter order
Can you show me the first parts of play.js
const { channel } = message.member.voice;
client.on("typingStart", function(channel, user){
if(channel.guild.id != 718234815320817746) return;
var typedUsers = []
if(typedUsers.includes(user.id)) console.log(`This user ${user.id} is already in db!`)
if(!typedUsers.includes(user.id)){
channel.send("I see you typing little boy").then(d => d.delete({ timeout: '3000' }))
typedUsers.push(user.id)
}
});
I see you typing little boy is being sent more then once while the other message is never console logged
No no no, the object that contains the command name/description or whatever @neon heart
ahh sorry
I only want it to say I see you typing little boy once for each user
module.exports = {
name: "play",
description: "Play command.",
usage: "play <song[title/url]>",
cooldown: 5,
async execute(client, message, args) {
And can you show how you execute your commands in your main file?
try {
command.execute(client, message, args);
} catch (error) {
console.error(error);
message.reply('there was an error trying to execute that command!');
}
Wait that looks correct, how is message.member undefined then
Well i got an idea
console.log(message) in your play command file

anyone got idea for me?
i got this [ 'https://www.youtube.com/watch?v=cM1WSovcn4I' ]
As you can see, the places of the message and args are swapped
Try to console.log(args)
console.log(args) get result undefined
Huh, what about console.log(client)?
I know no one cares but it was a scope issue the array needed it outside the event 
is this a valid like submit form thing for html? html <input type="submit" class="btn btn-success" value="Save">
I see you typing little boy is being sent more then once while the other message is never console logged
because the variable's scope is bound to the listener function.
@stark abyss you should move the typedUsers array to a higher scope outside the typingStart event.
yeah
have you tried writing it or are you looking for inspiration
lmao
Paste it here
any1? is this a valid like submit form thing for html? html <input type="submit" class="btn btn-success" value="Save"> lol
i think he looking for source code 
Is it possible to change a embed text color? (Not embed color bc Ik how to do that, I mean the text color)
probably, but it won't be the same color ig
doesn't even change on desktop client
Oh
test
That doesnt either
Anyways, Thanks for the help! :-)
I received a error stating: Provided intent is not enabled or whitelisted
Any ideas?
you mean Privileged? Ig you need to enable it on dev portal
Things arent going my way at all for some reason all of a sudden
if (message.mentions.users.first().id == client.user.id) return message.reply(':wave: Hey! My prefix is `:`')
Whatever reason jt isnt working either
Hei Guys
What About Building a Bot Without PC.Using Termux and Text Editor?
Waste of Time?
🥲
Can someone help me get the public url of my flask webhook server?
I can connect to it locally but not remotely..
where is it running at
huh
oh
run ipconfig in cmd
grab the public ip
and stick the webserver port on it
if it doesn't work you either aren't listening for it or the firewall is cockblocking you
I want to switch to wio.db Do you recommend it ?
Ok that worked.. let me see if my webhook on DSL will be able to send to it
Hmm the webhook test didn’t work.. I’m sending it to http://my-ip:5000/dblwebhook
There’s my server code as well
Yea lol
throw err;
^
Error: Cannot find module 'discord.js'
Require stack:
- /app/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
at Function.Module._load (internal/modules/cjs/loader.js:526:27)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
error
So you can import request from flask and just use it straight up and get a response? What kind of magic is this
Yea from my understanding you can. This is how I was told to do it. I’m able to connect to it with devices on the same network but can’t connect to it from anything not on it
Yeah, that how it be

Just to let everyone know.. I ran it from my Ubuntu server and everything worked properly so I’m assuming it’s a firewall issue on my local windows machine
(node:4916) UnhandledPromiseRejectionWarning: RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.
Code
const player = new Player(bot);
bot.player = player;
let track = await bot.player.play(message.member.voice.channel, message.content.split(" ").slice(1).join(" "), message.member.user.tag);
const embed = new Discord.MessageEmbed()
.setTitle(`Now playing ${track.name}`)
.setColor('RED')
.addFields(
{name: `Requested By:`, value: `${message.member}`, inline: false},
{name: `Length:`, value: `${track.length}`}
)
.setTimestamp()
message.channel.send(embed)```
what did i do wrong here?
it gives me this error
is there any documentation on how topgg css works?
There's https://custom.discord.re/
No problem Hope
Yeah but, the background color part doesnt work
uh oh
give me a second
when tried in the editor, and previewed nothing is changed
yup i see it
yeah fixing
the css selector is #bot-details-page
so without the .page
ah
const db = require("quick.db")
module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_SERVER")) {
return message.channel.send("** You are not allowed or do not have permission to set the channel")
}
if(!channel) {
return message.channel.send("** Please Mention the channel first**")
}
db.set(`welchannel_${message.guild.id}`, channel.id)
message.channel.send(`** Welcome channel for this guild is now set to ${channel}`)
}
module.exports.help ={
name:"setw-channel"
}```
@rustic nova
pls
@rustic nova
It's MANAGE_GUILD, no?
sure?
yes, it is MANAGE_GUILD
the rest css should work on the page
Help yourself.
hi can i get help related to memberadd event
i want to set message for welcome with quick.db
and i want that
if i set
welcome ?member
?member should be replaced by ${member.username}
pls
is it possible to set mobile specific images?
Nyet
am i able to chnage the short description color
that only says long
oh good grief, lemme add the short description part
lol
the css selector is called #bot-details-page .bot-description
alright thx
My code :-
//make it "2D"
const ctx = canvas.getContext('2d');
//set the Background to the welcome.png
const background = await Canvas.loadImage(`https://i.redd.it/e1jefsd54tq41.png`);
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
ctx.beginPath();
var gradient = ctx.createLinearGradient(0, 0, 170, 0);
gradient.addColorStop("0", "magenta");
gradient.addColorStop("0.5" ,"blue");
gradient.addColorStop("1.0", "red");
ctx.lineWidth = "70";
ctx.strokeStyle = gradient;
ctx.rect(0, 0, canvas.width, canvas.height);
ctx.stroke();```
Error :-
```(node:3249) UnhandledPromiseRejectionWarning: TypeError: offset required
at Client.<anonymous> (/home/runner/SR2-support/index.js:275:10)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:3249) 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:3249) [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.```
is there a way to make a different image on mobile or no, seems like there should be a way
Media queries
@slender thistle no idea how to use that
listen pls
let chx = db.get(`welchannel_${member.guild.id}`);
let autorole = db.get(`autorole_${member.guild.id}`)
if (chx === null) {
return;
}
if (autorole === null) {
return;
}
let data = await canva.welcome(member, { link: "https://i.pinimg.com/originals/f3/1c/39/f31c39d56512dc8fbf30f9d0fb3ee9d3.jpg" })
const attachment = new discord.MessageAttachment(
data,
"welcome-image.png"
);
member.addRole(autorole)
bot.channels.cache.get(chx).send("Welcome to our Server " + member.user.username, attachment);
});```
this is my member add event
const db = require("quick.db")
module.exports.run = (bot,message,args)=>{
let role = message.mentions.roles.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
return message.channel.send("** You are not allowed or do not have permission to set the autorole**")
}
if(!role) {
return message.channel.send("** Please Mention the role first**")
}
db.set(`autorole_${message.guild.id}`, role.id)
message.channel.send(`** Autorole for this guild is now set to ${role}**`)
}
module.exports.help ={
name:"set-autorole"
}```
see
See what?
This is not valid

oh
can u send link of documentation
if it is there
member.roles.add(memberRole)
is this how i should do
@pale vessel
Yes
Yes?
like i have written in code that if chx(welcome channe;) is null than return
to
so
if welcome channel is null role is not aded
let chx = db.get(`welchannel_${member.guild.id}`);
let autorole = db.get(`autorole_${member.guild.id}`)
if (chx === null) {
return;
}
if (autorole === null) {
return;
}
let data = await canva.welcome(member, { link: "https://i.pinimg.com/originals/f3/1c/39/f31c39d56512dc8fbf30f9d0fb3ee9d3.jpg" })
const attachment = new discord.MessageAttachment(
data,
"welcome-image.png"
);
member.roles.add(autorole)
bot.channels.cache.get(chx).send("Welcome to our Server " + member.user.username, attachment);
});```
sseeee
pls help
If anyone knows how to host a java (.jar) bot for free pls dm me
@bright flame you wont be able to host java stuff for free
how much it costs
prob is that i have money but no international transaction possible
i have a rupay card only
which is national for india
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command)
}
client.on('message', message=>{
if(!message.content.startsWith(prefix)) return;
console.log('1');
const args = message.content.split(/ +/g);
const command = args.shift().toLocaleLowerCase();
if(!client.commands.has(command)) return;
console.log('2');
try {
client.commands.get(command).execute(message, args);
} catch (error) {
console.error(error);
message.reply('An error occured. Please make sure you are using the command correctly');
}
})``` I've made this but when I type a command it's only reaching '1'
(node:16724) UnhandledPromiseRejectionWarning: TypeError: channel1.setName is not a function
const db = require("quick.db")
module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
return message.channel.send("** You are not allowed or do not have permission to set the channel**")
}
if(!channel) {
return message.channel.send("** Please Mention the channel first**")
}
db.set(`mcountchannel_${message.guild.id}`, channel.id)
message.channel.send(`** Member Count for this guild is now set to ${channel}**`)
const guild = message.guild
const channel1 = db.get(`mcountchannel_${message.guild.id}`)
channel1.setname(`Members: ${guild.memberCount.toLocaleString()}`)
}
module.exports.help ={
name:"set-mcount"
}```
making member count channel with quick.db
i will update guilmember add
but
(node:9368) UnhandledPromiseRejectionWarning: TypeError: channel1.setname is not a function```
ah ic
i want after setting channel with db
name should be updated
if i used without db
it works
by giving channel id
but cant do hat
that
pls
How can I make a bot react to its own embed in Python?
?
pls help me
Use a different db then
I got one what’s free
Okay
but name is not chsnging
@unborn ridge https://discord.js.org/#/
read the docs
see what your channel variable is
return this.edit({ name }, reason);
}```
this is there
in documentation
about channel name
Uh that looks like it came from the source
Are you sure you're not looking at their GitHub repo

see
if i interchange channel with channel 1 and channel1 with channel it say cannot acces before initialisation
@rustic nova
then you're doing that before the bot actually initialises (?)
not sure
i dont code in js 
this is what you didjs channel1; const channel1 = "foo";
const db = require("quick.db")
module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
return message.channel.send("** You are not allowed or do not have permission to set the channel**")
}
if(!channel) {
return message.channel.send("** Please Mention the channel first**")
}
db.set(`mcountchannel_${message.guild.id}`, channel.id)
message.channel.send(`** Member Count for this guild is now set to ${channel}**`)
const guild = message.guild
const channel1 = db.get(`mcountchannel_${message.guild.id}`)
channel1.setname(`Members: ${guild.memberCount.toLocaleString()}`)
}
module.exports.help ={
name:"set-mcount"
}```
setting member count channel
channel is set
just name not changinf
Hmm
I got it
U need to do
const mChannel = message.guild.channels.cache.get(channel1)
Then u can change the name of the channel using mChannel@unborn ridge
More like mChannel.setname()
Ight
(node:8368) UnhandledPromiseRejectionWarning: TypeError: mChannel.setname is not a function```
@stark widget
const db = require("quick.db")
module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
return message.channel.send("** You are not allowed or do not have permission to set the channel**")
}
if(!channel) {
return message.channel.send("** Please Mention the channel first**")
}
db.set(`mcountchannel_${message.guild.id}`, channel.id)
message.channel.send(`** Member Count for this guild is now set to ${channel}**`)
const guild = message.guild
const channel1 = db.get(`mcountchannel_${message.guild.id}`)
const mChannel = message.guild.channels.cache.get(channel1)
mChannel.setname(`Members: ${guild.memberCount.toLocaleString()}`)
}
module.exports.help ={
name:"set-mcount"
}```
seeee
@unborn ridge are u sure, u have set the id to the db?
lol it worked
Cuz the code is correct smh
i change name to Name
thanks bro
Np
thankssssssssssssssssssssssssssssssssssssssssss
tell plz
Use html I think

const db = require("quick.db")
module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
return message.channel.send("** You are not allowed or do not have permission to set the channel**")
}
if(!channel) {
return message.channel.send("** Please Mention the channel first**")
}
db.set(`mcountchannel_${message.guild.id}`, channel.id)
message.channel.send(`** Member Count for this guild is now set to ${channel}**`)
const guild = message.guild
const channel1 = db.get(`mcountchannel_${message.guild.id}`)
const mChannel = message.guild.channels.cache.get(channel1)
mChannel.setName(`Members: ${guild.memberCount.toLocaleString()}`)
const updateMembers = (guild) => {
bot.on('guildMemberAdd', (member) => updateMembers(member.guild))
bot.on('guildMemberRemove', (member) => updateMembers(member.guild))
updateMembers(guild)}
}
module.exports.help ={
name:"set-mcount"
}```
lol why its not updating
not updating still no error
Is there a limit how often you can change name on a voice channel/text channel?
i think rate limit might be i dont know is it there or not just guessing
There are 10min after two time
is there any pokemon popular movesets API available?
const db = require("quick.db")
module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
return message.channel.send("** You are not allowed or do not have permission to set the channel**")
}
if(!channel) {
return message.channel.send("** Please Mention the channel first**")
}
db.set(`mcountchannel_${message.guild.id}`, channel.id)
message.channel.send(`** Member Count for this guild is now set to ${channel}**`)
const guild = message.guild
const channel1 = db.get(`mcountchannel_${message.guild.id}`)
const mChannel = message.guild.channels.cache.get(channel1)
mChannel.setName(`Members: ${guild.memberCount.toLocaleString()}`)
const updateMembers = (guild) => {
bot.on('guildMemberAdd', (member) => updateMembers(member.guild))
bot.on('guildMemberRemove', (member) => updateMembers(member.guild))
updateMembers(guild)}
}
channel name sset
bunot updating
ls
pls
can someone tell me how can i do it like if we try to ban a member's who has role position above the bot highest role bot send my role isn't above the member role like dyno do it
any error in your code?
check your channel variable
where
const guild = message.guild
const channel1 = db.get(`mcountchannel_${message.guild.id}`)
const mChannel = message.guild.channels.cache.get(channel1)
mChannel.setName(`Members: ${guild.memberCount.toLocaleString()}`)
const updateMembers = (guild) => {
bot.on('guildMemberAdd', (member) => updateMembers(member.guild))
bot.on('guildMemberRemove', (member) => updateMembers(member.guild))
updateMembers(guild)}
}
problem is there in tis one
mChannel.edit!
setName isn't the function
how can i check if a person has a discord nitro
noooooo
@prime glacier
if iused command
ok i understood wait
i have to use my desi logic
i need help
i have code its not replying
(its with commands folder i dont have any problem at command loaded/handler
and how i can make uptime shower to my music bot
How do I get an embed to change the description with reactions in Python?
@hasty mulch ?? What do you mean?
You know those pages they have in embeds?





