#development
1 messages · Page 1473 of 1
how do i make a command that creates a role
guild.roles.create({
data: {
name: 'Super Cool People',
color: 'BLUE',
},
reason: 'we needed a role for Super Cool People',
})
.then(console.log)
.catch(console.error);```
i know this works but ```guild is not defined```
Define guild
how do i do that?
isn't this from the docs example
yes it is haha
Probably lmao
huh i dont understand 😅
How do I raise an error in an argument that isn’t a Member. Ie:
mb!eject @LIPD Productions Inc.#1205
would function fine, while
mb!eject Test
would throw an error
Python again
Can you share your current code for the command
You can just cast it to a member in the argument: member : discord.Member or member : discord.User
One sec
ok
@commands.command(name='eject')
async def _eject(self, ctx, member: discord.Member):
options = [
'was an Imposter',
'was not an Imposter',
'was the Imposter',
'was not the Imposter']
if ctx.author.id in bot.blacklisted_users: return
else:
option = random.choice(options)
print(f'Ejected {member}')
print(f'{member} {option}')
embed = discord.Embed(
title='VOTE THE IMPOSTER OUT!',
type='rich',
description=f'''
{ctx.author.mention} ejected {member.mention}
*{member} {option}*
''')
embed.set_author(name=ctx.author, icon_url=str(ctx.author.avatar_url))
embed.set_footer(text="Developed by LIPD Productions Inc.#1205",icon_url=str(ctx.guild.icon_url))
embed.timestamp=datetime.datetime.utcnow()
await ctx.send(embed=embed)
pass
Tag me when you respond, Cloud
that was never a discord feature
You can only use that in embeds
And only bots can send embeds
No
It worked on mobile for some time
It was a feature
Yes
I'll show you
Probably a bug
Yeah, I already have an error handler, but if I don’t tag a member, nothing happens, and I do have BadArgument assigned in the handler
Yeah it was probably a bug
They wouldn't have just added it back in and taken it out
Oh, wait, I think it’s passing silently, hang on
It's a security risk too, the users don't see what website they're clicking on
Yes
Try just printing the error to begin with
But there was a confirmation
Just like the one on embeds
It asks are you sure you want to proceed
Oh that would've been fine then
I’ll show you
uh
Uh
how do i use dbl.webhook.on('vote'...
its not sending
@hollow sedge This is all I had: ```py
elif isinstance(error, commands.BadArgument):
if ctx.command.qualified_name == 'tag list':
await ctx.send(':x: | I could not find that member. Please try again.')
Can you share all of your code for that @stray root
Wait what?
No you don't have to make a global command handler for one command
Look at the link I sent you
I like it that way
Ok well then print the command name and see if it's matching what you put there
Plus, if I see an error printed, I can easily add it in without taking half the bot offline
Can you just print the error and the command name
I fixed it
I just added an else and a ctx.send with what I wanted and it’s now working right
@hollow sedge
Ok nice
I wonder if they have if ctx.author.id in bot.blacklisted_users: return in all of commands
moment, they can do it in 1 step to apply that to all commands
My snipe command works fine when I run my bot on my own computer. It works with problems in virtual server
VDS?
VPS
virtual server
sad docker noises
Any way to display a bot's guild count and user count on a website
Like is there discord endpoints to fetch that
that's the cached one
yes i made
I mean im trying to display my servers size on a website
ok open command prompt
there's /users/@me/guilds but I'm not sure if that also returns the member count, why don't you post to the website through the bot though?
run this:
py -m pip --install
i think that's the command to install pip
@lusty laurel did it install pip?
nope
any errors?
yes
show me
maybe i could try store the guilds size on a express web and fetch it
Seems like you already have pip installed
pycharm has virtual env afaik
why discord doe
ok i made i think i must wait a litle bit
his code was missing it
for websites is the url supposed to be like domain.com/poggers/ or domain.com/poggers like with or without the last /
usually trailing slashes indicate a directory
Pls quest command of dank memer bot is not working
Pls repair it
Because I have completed 50 days streak quest
For today it is 52nd day
These many days of my hardwork will go waste so please help
this isn't the dank memer supoport servers
Ok thanks everyone
I was wondering, how can I make the bot webpage show in how many server the bot is? I have searched for it, but couldn't find it 
for websites is the url supposed to be like domain.com/poggers/ or domain.com/poggers like with or without the last / anyone got ideas?
but before this came
Ah, thnx
normally they go without the slash at the end
does it make a difference?
i dont think so
i think its better
it doesn't matter
cuz if i dont have the / in the route
yea
i find the latter more aesthetically pleasing
trying to download discord.py using pip install, gave me the error message in the title.
I installed using cmd and the commands py -m pip install -U discord, the cmd was also run in admin.
tried us...
if i do poggers/ it breaks/ 404
unless you set an option in express i think
k
Alguém sabe como bate ponto no Discord?
english only
Com o bot?
cum bot?

with the bot*
Cum
chalice
challenge
consume the
i think its because im using version 3.9
how do I make random to use variables or make the variable a number.
ok so when i run the code as is
it doesn't like the vaiable
in the value = random.randrange(number)
What does .read() return
It's pretty self-explanatory, you need to cast it to int
string
br
of course
but it returns a string
yeah
use int() ig
you have to parse it to a number
Python doesn't know that it's a number
what is the best python version
3.8 rn
3.9 is the latest but it doesn't have much library support
o
yeah i got 3.9 and it was verry buggy
makes sense
i tried that and i gave me this error did i put the int() in the right spot?
no
Thats not how you cast something to an int
oh
it's int(string)
let channel = this.guilds.cache.get("766019210454892641").channels.cache.get("766019210454892644") cannot read cache of undefined, "this" is client
@weary widget int is supposed to be wrapped around what you want to be a number
this or this.client?
You're setting it equal to a file
ok
note that the number variable still not an int though
Don't you need to close the file though?
just use the context manager
Yeah
@pale vessel do you know how to properly extend a map in typescript
You do mean with open, right?
yes
oh shit he's clicking circles
isnt it Map<K, V>?
anyone?
ts can suck my balls
console.log(this) 
google didn't help me with my error
are you making a collection for your lib
guilds: GuildManager {
cacheType: [class Collection extends Collection],
cache: Collection [Map] {
'679398370917351441' => [Guild],
'766019210454892641' => [Guild]
}
},
yes
LOL
It had the guilds property
wait
figures
class TopazClient extends Client {
class Pile<K extends string, V extends any> extends Map<K, V>
because idk who calls a map object by anything but a string
no that's an error
oh
ik
o
still using a string
damn idk how to extend a map in ts
ok so all my commands do not work when i have a on_message event. does anyone know why? i think its cause i have to close it or somthing.
Either process the command in your new on_message or register external listener so it won't override the default one
I have one @cleint.event on_message and one @cleint.command
you have to include await bot.process_commands(<m>) in a custom message event
that's the one i think
only if you override the default one
what is the <m>
Message object
the message
I'm making a command where the user's username will be part of a url to an api request. The problem is that if they have weird characters in their it gives the error Command raised an exception: UnicodeEncodeError: 'ascii' codec can't encode character '\U0001f5a4' in position 36: ordinal not in range(128)
Anyone know a quick fix for this? Discord.py btw
are you opening a file?
if you're using it as query parameter, you can use encodeURIComponent
oh wait
nvm

@trim saddle I'm not opening a file, no
it's an encoding issue
well you got a wonky character, most likely from setting encoding
Yeah, I was wondering if there's a way to strip the wonky chars from the string
I had this problem with a file open thing but try put "encoding = "utf-8"
idk if this will work
hi
You should just set the encoding to utf-8
I'm using
request = urllib.request.Request(url=url, headers=headers)
with(urllib.request.urlopen(request)) as req:
Can I add encoding in there somewhere?
blocking moment
@mellow kelp I added configuration so you can change POGGERS to any string in jason.db
POGGERS
yea i know
@quartz kindle wake up i need you
Requests is the go-to for synchronous requests and aiohttp is best for async requests
Well I'm getting some json data from a website
Yeah use aiohttp then
Poggers
I'll try that then, thanks
can you even get this profile badge anymore
no
I'm sure more opportunities to get it will come later on, but for now it's not possible
because users kept submitting spam bots for a badge
'cause of ppl submitting trash bots to get this badge
yeah
oh yea
and it was getting in the way of actual submissions
many people who have it don't deserve it
and real devs don't have it
its kinda fucked
don't they actually look at the bots
do you consider yourself as a real dev?
but this is discord
no lol
I mean it was 100+ guilds to get it right?
alekeagle doesn't even have it smh
75 i belive
dad bot dev
wait so you can still get bot verified? but not verified dev
yea
Yes
w h a t
@dusky sundial when you get to using aiohttp you can do response.json(encoding='utf-8') (you'll probably understand when you get there)
@quartz kindle squawk squawk i need help squawk
but why would you setup a fake bot just to get a badge...
yea ig
still on extending a map?
yes
@trim saddle what are you trying to do
anyone have the "what coding really is" computer puzzle meme
how do i put ' in message .send like js message.send('don't do it') i tought ```don't
but?
what are you doing
message.send('don\'t do it')```
It's message.channel.send in Discord.js
1 problem at a time
or just use double quotes
will not work
message.send(\'don't do it\')
wtf ^
what the hell is that
don't do that
@earnest phoenix either help me with my problem or exist elsewhere
extending a map in ts is weird and hard
agree
bro just look at discordjs collection source
doesnt work
What is your current code
isnt djs js
wut
collection is in ts
hello Tim
}else if (command == 'help'){
message.channel.send('
ping, pong hehe
pray, pray for the pepe god
prayspam, event more prays for the pepe god
hmm, pepehmm
dog, woof woof
meme, who doesn't like meme'
sick, cough cough
poopoo, ooooo that was a nice poopoo
nuke, world go brrrrrrrrrrr hehe')
}```
what
use double qoutes at that point
Use the backticks ` for multiline
may want to escape that
}else if (command == 'help'){
message.channel.send(`
ping, pong hehe
pray, pray for the pepe god
prayspam, event more prays for the pepe god
hmm, pepehmm
dog, woof woof
meme, who doesn't like meme'
sick, cough cough
poopoo, ooooo that was a nice poopoo
nuke, world go brrrrrrrrrrr hehe`)
}
is multiline ' even valid
thx
Use ` for multi-lines strings
Nope
Right
works thank u
i get hella confused with multiline ``
when i send a multiline message, the second-to-last lines have an indent 
hehe
lol
wait
That's intended
really?
Yes
/home/skullbite/petals/lib/furpile.ts:6
super()
^
TypeError: Constructor Map requires 'new'
i tried extending a map in ts and i keep getting this
then ill just keep my current solution
you probably need a new instantiating your custom class
why is this
i have it
because messages with multiline `` have an indent
I hate when people post code like this:
const fs = require('fs');
const data = JSON.parse(fs.readFileSync('data.json'))
its the worst
oh
code?
thats on purpose
Only if you want them to
remove the indent
i don't put an indent 
yes
if (randomCommand === 'aaa') {
message.channel.send(`no indent
no indent
no indent`)
}``` You only have to remove the indent using this syntax, but yeah your solution works better
class Pile<K extends string, V extends any> extends Map<K, V> {
constructor() {
super()
}
getRandom() { return this.size ? this[Math.floor(Math.random()*this.size)] : undefined }
getAll() { return Array.from(this.values()) }
find(search: (value: V) => boolean): V[] {
const results = Array.from(this.values()).map((item: V) => {
const res = search(item)
if (res) return item
})
return results
}
}
new Pile
export default Pile
oh thats a big no no
im gonna keep my solution
Yeah it looks bad
I know, I don't like that either
y'all are filling the chat with boxes
yea
Who cares
boxes are the best B)
@mellow kelp that's why i prefer \n unless the message is BEEG CHUNGUUS
foxes are the best F)
yes
if you have an empty constructor, just remove it. it falls back to the extended constructor
o
also, not sure if ts allows new Class, you might need new Class()
do i really even need the constructor in this?
nope
wait, there is a difference between those two syntaxes?
🤔
you're only supposed to use new in your actual code btw, not in the exported file
the other gives you an error
why the other one would throw an error?
ik
@trim saddle discord.js collection bois when they see Pile: Finally a worthy opponent!
i have the new in there as a test
because your not fucking calling the constructor

djs collections p hot tho
yea
jason.db better tho
I think so
by indexed i meant its ordered
did you try? 'cause both works
I think
how would new Class work?
:notes: On the first day of Christmas, MILLION and the weeb bois gave to us
pretty cool jason.db :notes:
bruh
is this something new

lol
try new Date
@mellow kelp cough reactions
I mean I could see how that would work
@quartz kindle so i tried adding an argument to my constructor
Because the new
same error
hmmm
it doesn't throw an error
i'm convinced it's impossible
you don't always need parenthesis
can you have a class with no constructor so it only inherits the methods
But will it call the constructor
Yes it will
Epic
Are you sure this is not an imposter?
Javascript is epic
js is good
But javascript isn't
ts is good
But typescript isn't
y
ts is just microsoft js
otherwise known as typed js
and js is javascript
so therefore ts is just j
and j is just java
ts is js, but js is not ts
ts === java
yeah i'm just gonna use map for the time being
prove me wrong
and java is written in c
java in $CURRENT_YEAR omegalul
lol
i dont get it
ts is "compiled" to javascript according to the docs
but it's a transpiled language
and also a scripting language
the fuck is it
and c is bcpl
ts transpiles, java compiles
bruh
yea
ts is like a compiled language but the target is js
Is there anyway to get the filters from lavalink (like speed and pitch) in JavaScript?
do you have the latest dev build
typescript more like javascript loggers edition
Of what?
ll
no
you need it iirc
Do you mean the other Timo?
Ok
Is there a pillow alternative for js which supports gif manipulate?
wand
Like canvas for gifa
you can use gifencoder with canvas
It doesn't work for me
you mean canvas and gifencoder?
well you did something wrong
ok i dont want to start a language war but hear me out
typescript > javascript > python > weebs in dbl
Yes
weebs in dbl
where does assembly go
And how to get gif frames?
index.weeb
index.widbl
Gif frames module doesn't support canvas for node.js
JIF
It supports pings and jpgs
what are you doing
Hi
G if
i used canvas and gifencoder for a gif command
This is not the meme channel
so that does work
I want to get frames of animated pfp and then manipulate
shut the fuck up
and generate the gif
The only package available doesn't work
what package?
gif-frames
I used gif-frames and have buffers working just fine
@crimson vapor noob
Can u help me ?
ok
got have buffers
Rn?
its still gif
@pale vessel i never understood what process.f is
wait lemme send my code
using flask, domain.com/manage/guildID/control/ makes stuff like not clickable, like stuff works, but like when u click stuff, it doesnt do what its supposed to, but when i do domain.com/manage/guildID it works
like without the 3rd argument
process.fuck you
code
hastebin pls
I made shit dumb changes in code so now I have to rewrite like 200 lines POG
it has problem in Canvas loadimage
@drifting wedge that usage of the word like :OMEGALUL:
and code after loadimage doesn't work
wdym
Code, if you have nothing better to say, just get off this channel
I'm not trying to be rude but
¯_(ツ)_/¯
to me?
OExe are you american?
any ideas?
perhaps
flazepe can you help pl;s ?
ima assume yes based on how you used the word like
i'm eating rn
oy stfu lmao
maybe @mellow kelp can help
jk
nothing that was an excuse LOL
lul
image = await Canvas.loadImage(image);anythinig after this doesn't get executed
unless you aren't then im sorry for "assuming your country?"
idk
im suing
damn
well there isnt code lmao
americans amirite

for example: the page's interactive banners arent clickable for example
whats your code for the route?
in the route of what?
just the default code
idk default code
@app.route("/test/test/test")
def code():
return render template
this breaks
but with 2 test it works
var
hmm
there's no constant or variable in python
look lemme try something rq lmao
predefined or defined per route
@requires_authorization
def showprofile():
user = discord.fetch_user()
name = f"{user.name}#{user.discriminator}"
avatar = user.avatar_url
return render_template("showprofile.html", user=name, avatar=avatar)```
this breaks
https://million.is-a.computer/files/P2eJNQpqAbWUTQJX.png where ID is a variable
@requires_authorization
def showprofile():
user = discord.fetch_user()
name = f"{user.name}#{user.discriminator}"
avatar = user.avatar_url
return render_template("showprofile.html", user=name, avatar=avatar)```
this works
What's the error
ayy shivy entered the chat
Nah don't have hope in me
page loads
and css too
just the stuff isnt clickable
like 1 sec
wait wtf
now it doesnt even work
gimme a bit
is css having a stroke?
gimem a bit
var wb = XL.utils.book_new();
var ws_data = [];
ws_data.push([ "Username", "Weight"])
let array = ["Vigintillion", "Thundeee", "Vexxing_Banana"]
for (let i = 0; i < array.length; i++) {
let userArray = new Array(2)
userArray.push(array[i])
userArray.push(Math.floor(Math.random() * 1500) + 200)
ws_data.push(userArray)
}
var ws = XL.utils.aoa_to_sheet(ws_data);
XL.utils.book_append_sheet(wb, ws, "SheetJS");
XL.writeFile(wb, "players.xlsb");
So I'm tryna write some stuff to an excel document, everything worked untill now.... I added the for loop as I need to generate new rows for in the excel document and I got a heap limit error
i am so stupid and sent message in wrong channel.)
anyone knows how i can use this feature for bot commands?
#commands message
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
hey can I get help ?
async function frameTheFrame(Canvas,ctx,image,frame,width,height,ratio){
let parsedImage = await new Canvas.Image();
parsedImage.src = image;
ctx.drawImage(parsedImage, (width * ratio - width) / 2, (height * ratio - height) / 2, width, height);
ctx.drawImage(frame, 0, 0, width * ratio, height * ratio);
return ctx;
}
It shows image hasn't finished loading
but however I am using await
try ctx.toBuffer(); ?
nah I only want the return in ctx
Crazy guess, but try await (parsedImage.src = image)
whats your code?
nvm lmao
um
pretty sure you shouldn't instantiate an image i think
Jaguar, loading images is not synchronous
have you tried creating the canvas first?
@old cliff You have to do
// Now you can draw the image
}```
Canvas.loadImage is basically a wrapper around that ^
Do any of you know of a good way to implement Jest in a Discord.js project?
Like, ways to mock API calls
Without doing everything from scratch
wat
I haven't seen a way to do that with jest, and no one had bothered creating and maintaining a mock of the discord API.
That would be one hell of an annoying job tbh.
yea
Eh, guess I'll make my custom helper for the scope I need
would be great if there was an option tho
Mocking so many calls? And websockets? Christ who has the time...
that would be pain
pain
Mocking a message/guild/channel object wouldn't be hard in itself, but yeah, full support of the Discord API would be painful
ok what now my on ready event doesn't start
my bot unable to login.
hmm ratelimit ?
cause I restarted it like 100 times just within 10 mins
can sb help me with html
i have buttons and if i resize them they get to the top left most corner, how can i change this to the center?
How can do webhook message when sw vote my bot?
<div style="width: 12em; height: 12em; background-color: aqua;">
<button id="testing">testbutton</button>
</div>```
wait
bruh i forgot what the em unit was
width: 4em;
height: 4em;
color: black;
text-align: center;
padding: 5em 5em 5em 5em;
}
#testing:active {
width: 3em;
height: 3em;
}
"epic measurement"
yes
i dont even know either
so why do you use it
i just searched it up
2em means "2 times the element's font size"
hm
i dont think thats what you want for that case
tried it with px same problem
whoa what
recheck your url, you're passing 'https not https
heres the problem
'https
poggers: "yes"
encryption with a sequence of '
im big brain and set secure to true when testing on localhost
What's the code to catch everyone in all servers that the bot is in than using client.users.cache.size?
can someone help me
chrome got mad
chrome
ew
i have enough chromium apps on my pc i dont need chrome to chonk even more ram
:omegalul:
oh i see what you mean
electron is taking over your pc
someone pushed not working code to prod?
i was looking for it and didnt see it, so i assumed it was an internal issue
heres the culprit
should I go through the pain of changing a lot of code, or should I just leave it in a almost working point?
you mean refactoring code?
no
the domain system for my uploader is shit but works
I want to change it
I want to basically just store subdomains and domain as a string in the user document in the db
but rn it is done differently so i have to change a lot of code
pain
electrons™️
PostgreSQL
Is there a way to retrieve a table's whole schema with a query?
i'd like see the columns including their constraints and types set for each column. Is it possible?
I am trying to make a button to download a .txt file, but it doesn't read the .txt file, i use nginx in ubuntu 20.04
Someone knows what is the error?
If so, please tell me :)
UnhandledPromiseRejectionWarning: Error: read ECONNRESET neden böyle bir hata alıyorum
Oi mates, is this JSDoc looking good enough or does it need changes
Is there any easy way to cache mongodb quaries? I'm using js and mongoose
Why tho
look for some packages for second level caching
Hmm, okay.
Say if a bot is in two servers, how can I check if a user on-join has a specific role in the other server or not?
hey, with flask, using <var> and getitng var in def routevar(var): breaks the page! anyone got any ideas?
new Date()
new Date()

does someone know how to auto restart pm2 with the update when you push a changue to github?
who use canvas pls and know how to insert an user profile picture ?
pm2 start index.js --watch
?
launch pm2 with this and then when you will save , pm2 will auto restart
i think...
and how pm2 know the repo?
how you did use pm2 before I said that ?
dont use it, i just want to know how to when i changue the vps
like for example i think heroku had something like that, when you push a changue to the github repo the app auto restarts with the changues
and i want to do it with pm2 for automation
this
How the fuck?
hmm but the repo is private, how is pm2 going to know when i make a changue?
🤔
don't know
Date.prototype.setHours() doesn't return the date itself, it returns milliseconds
welp thanks anyways if someone know please @jovial nexus me
^^
Your bot can't listen to github push events, that's not possible automatically until done manually
set up a github workflow
Auto-restart is kinda pog actually
and do whatever you want from there
then how heroku does it? and i dont mean the bot, i mean the host
Like, your bot is gonna restart for every single push
yes
Which will kill your ratelimit if you update too frequently
the bot is programed to restart at x hour every day
If you use js, it'd be better to implement hot reload
so restarts arent a problem
I'm sorry for your users
why?
you should also divide your push delivery system between production and development
don't run a dev version on prod
and vice versa
pls
hey
get the avatar url and load it
how much i need to wait for the growing error thing trying to verify the bot
Hey does anyone here know something about galaxygate? I wanna get this play but it asks for a domain name?
they dont need a domain
gg have a support server if you want to use it, its listed on their site.
domain is servername basically
it doesnt have to be a domain
mine's just "Titan"
no domain
oh wait
client.on('guildMemberAdd', async (member) => {
if (message.content.startsWith(prefix + "welcome")) {
(channel => channel.name === 'welcome');
const { guild } = member
const channelId = getChannelId(guild.id)
if (!channelId) {
return
}
const channel = guild.channels.cache.get(channelId)
if (!channel) {
return
}
const canvas = Canvas.createCanvas(700, 250)
const ctx = canvas.getContext('2d')
const background = Canvas.loadImage(
path.join(__dirname, 'Untitled-3.png')
)
let x = 0
let y = 0
ctx.drawImage(background, x, y)
const pfp = Canvas.loadImage(
member.user.displayAvatarURL({
format: 'png',
})
)
x = canvas.width / 2 - pfp.width / 2
y = 25
ctx.drawImage(pfp, x, y)
ctx.fillStyle = '#ffffff'
ctx.font = '35px sans-serif'
let text = `Welcome ${member.user.tag}`
x = canvas.width / 2 - ctx.measureText(text).width / 2
ctx.fillText(text, x, 60 + pfp.height)
ctx.font = '30px sans-serif'
text = `Member #${guild.memberCount}`
x = canvas.width / 2 - ctx.measureText(text).width / 2
ctx.fillText(text, x, 100 + pfp.height)
const attachment = new MessageAttachment(canvas.toBuffer())
channel.send('', attachment)
}
})
can u help me
I mixed the shards by a mistake lmao
What's the problem
i will not send the thing
f
message.channel.send(embed).then(msg => {
for(var i = 0; i < questions.length; i++){
let collector = message.channel.createMessageCollector(filter, { time: 5000, errors: ['time'] })
collector.on('collect', async collectedMsg => {
console.log(collectedMsg.content)
embed.setDescription(questions[i])
console.log(i + " i")
msg.edit(embed)
})
}
})
```
I am struggling to have it ask questions more then 1
i am not sure how to do this, but that's what I coded and it's an epic fail
because it doesn't work that way, put your emoji in an array then use forEach with Message#react
like: [emoji1, emoji2].forEach(a => msg.react(a))
There is probably a better way of doing this but what I did is:
let num = 1;
collector.on('collect', async collectedMsg => {
switch (num) {
case 1:
if (error) {
return num--
}
// code block
break;
case 2:
// code block
break;
default:
// code block
}
num++
})
yeah I was thinking to do that as well but i wanna go through it multiple times that seems like it would work for once?
No I have that setup with multiple questions
is that the same file as what it says in the error
yes
Say if a bot is in two servers, how can I make it so if on a member join, if the member doesn't have a specific role in the other Discord server then to auto-kick it from the server they're trying to join?
I've tried one method right now, and it does auto-kick them but there's still one issue. It's still kicking them even though they have the role in the other server. Am I doing the condition check wrong or?
@stark abyss can you help?
no I am not capable to help you not that I don't want to
oof
Does anyone know the answer to my question?
from what It sounds it seems like you have issue getting user's role from other server
which is why it's kicking everyone but I have no idea on how you doing this so idek
Correct
It's like this
Is it trying to find the roles in the server they're trying to join and not the other one?
well the first line only works if they have the role in that server
it's not a global thing
Do you know how I can make it global though?
would anyone know how to code a command that allows you to give default permissions to a user on a vocal? or an existing bot
hey i have made a bot that sends the id and string (of the prodduct) to the cart.txt.
i am trying to get all of the contents that match the user.id that reacted and message.author.id.
how would i implement that?
Use message.createReactionCollector() or message.awaitReactions()
Get the user id from the user object
already done
basically i want to display all the text from result == message.author.id that used the command.
get what i mean?
those variable names make it sound like you sent 23 messages on the same code, which would likely mean your index is absolutely humongus, and if it is, i'd recommend reevaluating life choices
no i just named them random
i had one simple and fast question thno.
let z = " "
if (raid.is_exclusive == "1"){
let z = "BOOSTED"
}
let text =
`**${name}** | **${varz}** | **${z}**` +``` look eventhough the raid exclusive = 1 it wont show the z as boosted as it's defined out of the scope.
how would i fix that
cuz you're obfuscating it. im amazed ur IDE didnt screech at you
if you want the first z to be BOOSTED, then dont declare it inside
z='BOOSTED'
let z = " "
if (raid.is_exclusive == "1"){
let z = "BOOSTED"
}
let text =
`**${name}** | **${varz}** | **${z}**` +
"\n" +
`**${raid.gym_name}**` +
"\n" +
`*${lat1}, ${lng1}*` +
"\n" +
`**${reactionEmoji5}: ** ${raid.level} | **${reactionEmoji4}: ** ${raid.cp}` +
"\n" +
`**Distance From Last Raid: ** ${lastcoordinatez} KM | ${closestz} Min CD` +
"\n" +
`**${reactionEmoji7} **${move1[1]} | ${move1[2]}` +
"\n" +
`**Start: **${getFormattedTime(
raid.raid_start
)} | **Ends: **${getFormattedTime(raid.raid_end)}\n` +
`${reactionEmoji6}${reactionEmoji6}${reactionEmoji6}${reactionEmoji6}ⓅⓄⓀⒺⒽⓊⒷ${reactionEmoji6}${reactionEmoji6}${reactionEmoji6}${reactionEmoji6}` +
"\n";
let rawdata = fs.readFileSync("./data.json");
let channel1 = JSON.parse(rawdata);
let msg = await message.channel.send(text);
await msg.react(reactionEmoji1);
await msg.react(reactionEmoji2);
await msg.react(reactionEmoji3);
//I tried closing the } here, but it did not send the embed.
```
wait what
remove that let and dont use scopes like that
the first let?
second
but i would only have an if statement without any brackets..?
yeah....?
if (raid.is_exclusive == "1")
z = "BOOSTED"
let text =
`**${name}** | **${varz}** | **${z}**` +``` It is not possible.
why bother putting brackets if its a single thing?
your indentation is killing me, but yes
plase use prettier/linter
i am
clearly not
also use === not ==
so if the raid exclusive is not 1, it will just let z be ''
correct

compare user ids
K what one the id on my name or my discord id
the user id, not the tag
K
any of you also do web development or nah? (ping me if yes)
Well i use bot designer app to code my bot
theres a few of us who do various forms of web development @ruby elbow
Interesting
Would you happen to be looking for a new project?
this isnt the place to find devs for projects
I'm aware
then why ask 🤔
does the amount of "args" in a flask route make a difference?
im having an issue where having more than 1 argument breaks the page, and same with having any variables
Because there isn't a specific channel for that on the server, and this is where you tend to find developers in the wild

well, theres all kinds of places to hire devs 🤔
how do i scan through a txt file to find all messages containing a certain word.
mhm intresting... dm me?
load txt file
Sure :)
what?