#development

1 messages ยท Page 1663 of 1

sour flame
#
async def buy_this(user,item_name,amount):
 item_name = item_name.lower()
 name_ = None
 for item in mainshop:
   name = item["name"].lower()
   if name == item_name:
    name_ = name
    price = item["price"]

   break

 if name_ == None:
     return [False,1]

 cost = price*amount

 users = await get_bank_data()

 bal = await update_bank(user)

 if bal[0]<cost:
  return [False,2]

 try:
  index = 0
  t = None
  for thing in users[str(user.id)]["bag"]:
    n = thing["item"]
    if n == item_name:
     old_amt = thing["amount"]
     new_amt =  old_amt + amount 
     users[str(user.id)]["bag"][index]["amount"] = new_amt
     t = 1
     break
    index+=1
  if t == None:
    obj = {"item": item_name, "amount" : amount}
    users[str(user.id)]["bag"].append(obj)
 
 except:
   obj = {"item": item_name , "amount": amount}
   users[str(user.id)] = [obj]
  
 with open("bank.json", "w") as f:
      json.dump(users, f)

 await update_bank(user,cost *-1,"wallet")

 return [True, "Worked"]
``` buy_this function
#

My problem

fierce ether
#

'../build/Release/sharp.node' cant find it? what do i do?

earnest phoenix
fierce ether
#

thx

#

nope same thing

earnest phoenix
#

delete the lock file

#

and then npm install

fierce ether
#

what lock file?

earnest phoenix
#

package-lock file or something like that

fierce ether
#

i done that same thing

earnest phoenix
#

unsure then

#

have you deleted the node_modules folder

fierce ether
#

yep

earnest phoenix
#

what node version

#

node -v

fierce ether
#

v14.15.4

lament rock
#

what's the error stack. You may have to remove dependencies

leaden flare
#

ne

#

what

lament rock
#

That is not the stack

#

I was referring to the npm stack where the error you originally showed came from

fierce ether
#

i fixed it now

#

could you help with message: 'req.flash() requires sessions',

solemn quartz
#
    .setColor(colore)
    .setTitle("Missing Permissions")
    .setDescription("yes");


if (message.content.toLowerCase().startsWith(config.prefix + "mute")) {
  NHIP.setDescription("You must have the `Kick Members` permission to use this command!")
  if (message.member.hasPermission('KICK_MEMBERS')) {
const mutedR = guild.roles.cache.find((role) => role.name.toLowerCase() == "muted");
let noMutedR = new Discord.MessageEmbed()
.setTitle('Missing muted role')
.setDescription('Please make a role named "muted"!');
  if(mutedR) return message.channel.send(noMutedR) 
    message.channel.send('lol')
    } else {
    message.channel.send(NHIP)
  }
}```
fossil grove
#

..

solemn quartz
#

what

#

im sending a message where i explain what's wrong

#

ye

#

So it sends the missing muted role embed if there is, and if there is not it send "Lol" (i need to replace message.channel.send('lol') with the rest of the code, it is just to test)

#

btw in the let nhip "colore" is a let that says a hex color

#

So can someone help me?

boreal iron
#

what do you still need help with?

solemn quartz
#

it sends the missing muted role embed if there is, and if there is not it send "Lol"

proven lantern
#

what is it doing now and what do you want it to do

boreal iron
solemn quartz
boreal iron
#
if(mutedR) return message.channel.send(noMutedR) 
    message.channel.send('lol')
    } else {
    message.channel.send(NHIP)
  }

that doesn't make sense

solemn quartz
#

what

#

why

boreal iron
#

you return BEFORE sending lol

solemn quartz
#

what

#

i dont understand

boreal iron
#

that's coding basics

solemn quartz
#

i mean that im not english

#

so i dont understand what you're trying to say

#

If you dont want to explain it can you just tell me how can i fix this?

boreal iron
#

ow nvm the else belongs to the permission check

solemn quartz
#

yeah

boreal iron
#

sry happens but the coding style is horrible

solemn quartz
#

why?

boreal iron
#

let's don't start a discussion

#

what's the issue again?

#

lmao

solemn quartz
#

thats it

quartz kindle
#

your code is incorrect

#

if(bla) return send1
send2

#

thats what you're doing

solemn quartz
#

what?

quartz kindle
#

if bla, send1 will send, if not bla, then send2 will send

solemn quartz
#

so the return should give the next step?

quartz kindle
#

the return makes it not continue

#

it stops there

solemn quartz
#

yea

#

So how to fix it

quartz kindle
#

dont do it like that

solemn quartz
#

how then?

boreal iron
cinder patio
#

Wouldn't the code throw a syntax error

solemn quartz
#

what do you mean

quartz kindle
#

what do you want to send?

solemn quartz
#

that says that there is no muted role

quartz kindle
#

because you return

#

you want to send both?

solemn quartz
#

No

boreal iron
#
let NHIP = new Discord.MessageEmbed()
    .setColor(colore)
    .setTitle("Missing Permissions")
    .setDescription("yes");

if (message.content.toLowerCase().startsWith(config.prefix + "mute"))
{
    NHIP.setDescription("You must have the `Kick Members` permission to use this command!");
    
    if(!message.member.hasPermission('KICK_MEMBERS')) message.channel.send(NHIP);
    
    const mutedR = guild.roles.cache.find((role) => role.name.toLowerCase() == "muted");
    
    let noMutedR = new Discord.MessageEmbed()
        .setTitle('Missing muted role')
        .setDescription('Please make a role named "muted"!');
    
    if(!mutedR) return message.channel.send(noMutedR);
    
    message.channel.send('lol');
}
quartz kindle
#

then what do you want?

boreal iron
#

you forgot to add a !

#

if(!mutedR) return message.channel.send(noMutedR);

#

NOT

#

if(mutedR) return message.channel.send(noMutedR);

solemn quartz
#

ohhhh

#

thanks

#

c:

boreal iron
#

BEFORE this discussion will continue FOREVER

solemn quartz
#

Lol

quartz kindle
#

the } else { still makes no sense

solemn quartz
#

Iits just because i dont really know how to use the ! in coding

boreal iron
#

yeah

#

that's why I removed it in my example

solemn quartz
quartz kindle
#

ah

solemn quartz
#

yeah

boreal iron
#

copy what I wrote, use it, think about it, continue with this style

solemn quartz
#

hm

#

ill see

#

i mean your message

#

wait what?

#

you didnt remove them

#

i didnt saw that msg

boreal iron
#

I don't see any else in my example, you do?

solemn quartz
#

this little boi

lament rock
#

! negates a boolean

solemn quartz
#

what

boreal iron
#

you DID if(mutedR) return message.channel.send(noMutedR);

lament rock
#

!true => false
!false => true

solemn quartz
#

ooooooh

boreal iron
#

the role mutedR was found

#

but you returned return message.channel.send(noMutedR)

#

noMutedR not found

#

if(!mutedR) return message.channel.send(noMutedR);
!mutedR
means if not / if FALSE

solemn quartz
#

ooh

#

k

#

the only problem now is that when i started making the cmd i didnt think about if the message had no mentions in it

#

so i need to add it when i finish it

boreal iron
#

god damn... trying to install the damn webserver and mailserver for 3 h now... should close Discord pogey

boreal iron
#

you really need to learn the basics yourself

solemn quartz
#

soo, this should be the final code, but i need to replace message.channel.send('lol') with a function where the bot gives the mention a role

if (message.content.toLowerCase().startsWith(config.prefix + "mute")) {
  let muted = message.content.mentions.members.first()
  if(!muted) return;
  if(!args[1]) return;
  NHIP.setDescription("You must have the `Kick Members` permission to use this command!")
  if (message.member.hasPermission('KICK_MEMBERS')) {
const mutedR = guild.roles.cache.find((role) => role.name.toLowerCase() == "muted");
let noMutedR = new Discord.MessageEmbed()
.setTitle('Missing muted role')
.setDescription('Please make a role named "muted"!');
  if(!mutedR) return message.channel.send(noMutedR)
  message.channel.send('lol')
    } else {
    message.channel.send(NHIP)
  }
}```
#

and i need to add some embeds for the bot to send for the first 2 returns

boreal iron
#

instead of using else for the permission check, take a look how I did

solemn quartz
#

well it looks really clean

#

but idk if i will learn to do it like that

boreal iron
#
  let muted = message.content.mentions.members.first()
  if(!muted) return;
  if(!args[1]) return;```
#

you did it here as well

#

or just copy & pasted the code

#

idk

solemn quartz
#

i actually already fixed that

#

i needed to switch up a lil the things, and remove the ! before args

#

so this is the FINAL code

if (message.content.toLowerCase().startsWith(config.prefix + "mute")) {
  if(args[1]) return message.channel.send('Correct usage: ?Mute <userMention>')
  let muted = message.mentions.members.first()
  if(!muted) return message.channel.send('You must specify who you want to mute!')
  NHIP.setDescription("You must have the `Kick Members` permission to use this command!")
  if (message.member.hasPermission('KICK_MEMBERS')) {
const mutedR = guild.roles.cache.find((role) => role.name.toLowerCase() == "muted");
let noMutedR = new Discord.MessageEmbed()
.setTitle('Missing muted role')
.setDescription('Please make a role named "muted"!');
  if(!mutedR) return message.channel.send(noMutedR)
  muted.roles.add(mutedR)
  message.channel.send('User succesfully muted!')
    } else {
    message.channel.send(NHIP)
  }
}```
#

but the muted role's perms are still just a mistery.

#

and i will leave them like so.

lusty quest
#

also you have 2 checks for the same thing, you check if args[1] is a thing (not sure if you want args[0] and then again check if a user got mentioned who is also in this case the same as the arg you check one line before

#

for the mute role, i would suggest to either use a command to create a role with read only permissions or let the user supply a role that will be used to mute user

solemn quartz
#

wait

boreal iron
#

if(args[1]) return message.channel.send('Correct usage: ?Mute <userMention>')

solemn quartz
#

This are all the cases

solemn quartz
boreal iron
#

I know I copyed it and pasted here

solemn quartz
#

yea but why?

boreal iron
#

well what's args

#

You may wanna read what Superbrain wrote

solemn quartz
#

i want it to fire when there is a mention

fierce ether
#

if req.session is undefined what does it mean?

vivid fulcrum
#

that it's undefined

solemn quartz
# solemn quartz so this is the FINAL code ``` if (message.content.toLowerCase().startsWith(confi...

Nvm this is

 if (message.content.toLowerCase().startsWith(config.prefix + "mute")) {
  if(args[1]) return message.channel.send('Correct usage: ?Mute <userMention>')
  let muted = message.mentions.members.first()
  if(!muted) return message.channel.send('You must specify who you want to mute!')
  NHIP.setDescription("You must have the `Kick Members` permission to use this command!")
  if (message.member.hasPermission('KICK_MEMBERS')) {
const mutedR = guild.roles.cache.find((role) => role.name.toLowerCase() == "muted");
let noMutedR = new Discord.MessageEmbed()
.setTitle('Missing muted role')
.setDescription('Please make a role named "muted"!');
  if(!mutedR) return message.channel.send(noMutedR)
  muted.roles.add(mutedR)
  message.channel.send('User succesfully muted!')
  mutedR.setPermissions(['VIEW_CHANNEL', 'READ_MESSAGE_HISTORY', 'CONNECT']);
    } else {
    message.channel.send(NHIP)
  }
}
vivid fulcrum
#

horrid

solemn quartz
#

why

#

:c

vivid fulcrum
#

like i said before, you need to set up proper command handling

#

the sky is the limit

boreal iron
vivid fulcrum
#

you can create so many beautiful design patterns

solemn quartz
#

well i think im an ugly person

boreal iron
vivid fulcrum
#

okay there's no limit

boreal iron
#

phew... u saved the day

blissful cliff
#

just make some machine learning bot, feed it the commands you wanna have and link that to discord, no limit, right?

vivid fulcrum
#

teach it to run :(){ :|:& };:

boreal iron
#

don't abuse js just because it's bad

blissful cliff
#

which programming languages do you all use?

#

or is it mostly js?

cinder patio
#

mostly TS

vivid fulcrum
#

depends what project

cinder patio
#

I don't use TS when I can't

vivid fulcrum
#

if i'm making a bot i use c#, if i'm making a desktop app i'll most likely mix typescript and c#

boreal iron
#

not gonna start the war about the all mighty PHP

vivid fulcrum
#

๐Ÿšฎ

boreal iron
#

shh move on

blissful cliff
#

well, from what ive heard, php 7 is ok in performance, but problem is still the naming conventions are inconsistent and its too easy to use so theres loads of terrible code floating around

vivid fulcrum
#

php shouldn't be used today anymore

cinder patio
#

๐Ÿคฎ

solemn quartz
#
  if(args[1]) return message.channel.send('Correct usage: ?Mute <userMention>')
  let muted = message.mentions.members.first()
  if(!muted) return message.channel.send('You must specify who you want to mute!')
  NHIP.setDescription("You must have the `Kick Members` permission to use this command!")
  if (message.member.hasPermission('KICK_MEMBERS')) {
const mutedR = guild.roles.cache.find((role) => role.name.toLowerCase() == "muted");
let noMutedR = new Discord.MessageEmbed()
.setColor(colore)
.setTitle('Missing muted role')
.setDescription('Please make a role named "muted"!');
  if(!mutedR) return message.channel.send(noMutedR)
  muted.roles.add(mutedR)
  mutedR.setPermissions(['VIEW_CHANNEL', 'READ_MESSAGE_HISTORY', 'CONNECT']);
  let muteDM = new Discord.MessageEmbed()
  .setColor(colore)
  .setTitle('You got permanently muted! :D')
  .setDescription(`Muted from: ${guild.name} \n Muted by: <@${message.author.id}>`)
  muted.send(muteDM)

  let muteE = new Discord.MessageEmbed()
  .setColor(colore)
  .setTitle('User Muted!')
  .setDescription(`I succesfully muted ${muted.user.name}!`)
  message.channel.send(muteE)
    } else {
    message.channel.send(NHIP)
  }
}```
vivid fulcrum
#

ok in performance isn't good enough anymore

blissful cliff
vivid fulcrum
#

and there are more modern and flexible languages capable of what php does and more

boreal iron
vivid fulcrum
boreal iron
#

still more then 60% of all the backend in the 'net is running on PHP

earnest phoenix
#

I've pulled out some old python code and having trouble lol

vivid fulcrum
#

and 50% of that 60% is running on a php version as old as mother teresa

boreal iron
#

at least regarding form evaluation

#

aye

blissful cliff
#

i feel like atleast 50% of those php websites are all wordpress, smileyface

boreal iron
#

Unfortunately using depreciated functions

earnest phoenix
vivid fulcrum
#

wp ๐Ÿ˜”

#

i hate wp with a passion

boreal iron
#

like anybody does

#

maybe not anymore in 20 years who knows

#

time is changing

#

still prefer a server sided engine for security purposes

blissful cliff
#

idk about amazon or ebay but i feel like google wouldnt use php

pale vessel
vivid fulcrum
#

๐Ÿคทโ€โ™‚๏ธ

#

i would need to do some research on speed and benchmarks

severe cedar
#

@craggy pine ?

craggy pine
#

sec

#

I'm grabbing a gif for you.

boreal iron
#

Ignore this cry MS fanboy... I'm gonna send him an exorcist

vivid fulcrum
#

welllllll

#

asp.net core is one of the fastest web frameworks out there mmLol

#

c++, rust and c# have the fastest web frameworks right now

#

php doesn't even come close to those speeds

blissful cliff
#

ehh, not really a fan of C# but mostly because of the syntax, dont really have anything really against C# itself, just dislike how its namespace > class > method and stuff

craggy pine
#

@severe cedar This is how CSS works.

earnest phoenix
#

Someone help please

#

@craggy pine Know anything about this?

opaque seal
#

lol dude you'll need to be more specific than that

blissful cliff
boreal iron
severe cedar
#

it will still work

earnest phoenix
#

When I try run I get...

boreal iron
#

but until all big players have changed their whole infrastructure and it gets more common I bet there will be another 10 years or more until that

earnest phoenix
#

Not used python in a long time

#

How would I run using VS terminal

opaque seal
opaque seal
severe cedar
#

or whatever your bot file is called

boreal iron
opaque seal
#

yeah :P

earnest phoenix
opaque seal
#

what's hard to understand xD

#

I literally tells you python is not installed

earnest phoenix
#

I've installed it tho

blissful cliff
#

isnt it python3 main.py or does just python already direct to python3?

craggy pine
# severe cedar don't worry about the red line

Anyways. You need to grab the classes or IDs of the text you used. I use a chrome extension to help me grab that info called live css but the color: is what changes text color.

with that random bot I chose, h1 seems to be a class that's used by default so

<style> h1 {
color: whatever;
}
</style>

earnest phoenix
#

Lmao

severe cedar
#

ah i see

earnest phoenix
#

@opaque seal

opaque seal
#

then it's python3

earnest phoenix
#

I gotta install python3?

opaque seal
#

it's already installed

#

and it's command is python3

earnest phoenix
#

I tried

#

Same message

opaque seal
#

then it's not on path

#

Search how to put python in the path

blissful cliff
#

was about to say, same path in vscode?

#

dont know the windows commands to check path honestly

fierce ether
#

what am i doing wrong?

blissful cliff
#

apparently echo %path%

sudden mortar
opaque seal
#

when you install python it should ask you if you want to add it to the path

blissful cliff
#

yeah but he seems to be able to run python in a seperate shell outside of vscode

blissful cliff
earnest phoenix
#

huh?

blissful cliff
#

your path variable might be different in the vscode terminal than in your normal shell, i think

blissful cliff
earnest phoenix
#

nothing happends

blissful cliff
#

using a different shell than default windows one then? it should echo your path variable

feral aspen
#

If you want to add more album records, you can do this by adding records to the top level array., when they say this, do they mean that we can add it after the object?

#
var ourMusic = [
  {
    "artist": "Daft Punk",
    "title": "Homework",
    "release_year": 1997,
    "formats": [ 
      "CD", 
      "Cassette", 
      "LP"
    ],
    "gold": true
  }
];
unreal estuary
#

yeah i think

#

like

#

wait lol

lament rock
#

Unless you're doing front end dev work, you shouldn't use var

unreal estuary
#
var ourMusic = [
  {
    "artist": "Daft Punk",
    "title": "Homework",
    "release_year": 1997,
    "formats": [ 
      "CD", 
      "Cassette", 
      "LP"
    ],
    "gold": true
  },
{
    "artist": "Daft Punk",
    "title": "Homework",
    "release_year": 1997,
    "formats": [ 
      "CD", 
      "Cassette", 
      "LP"
    ],
    "gold": true
  }
]
sudden geyser
#

var has its uses, but most often unnecessary.

lament rock
#

let is only for if you want to re-declare the value of something later on in run time. const is preferred as there are interpreter optimizations that come from not being able to change the value of something considering JS is not type strict

blissful cliff
#

honestly, ive never really researched as to why, only thing i heard once was that let is better as var has some weird scoping at some times or something? probably should check sometime

lament rock
#

var is not scope locked, which can lead to logical errors if you tend to use similarly named variables. This can cause race conditions in async code execution

thin turret
#
const beHappy = require('happiness');

beHappy();
// Module not found
#

๐Ÿ˜ฆ

blissful cliff
#

reminds me of that meme of "the H in programming stands for Happiness"

thin turret
feral aspen
earnest phoenix
#

What is this?

cinder iron
#

Can someone help because this doesn't run correctly

async def on_message(message):
    if (message.author.id = 712027036511633429:
        message.delete()```
earnest phoenix
#

Someone said its requirements?

cinder iron
#

What should i add on?

sudden geyser
#

Though I don't know how you managed to get that in your requirements.py file

blissful cliff
#

seems more like some install logs with unicode

lament rock
feral aspen
sudden geyser
#

as in you shouldn't see that in a .py file

feral aspen
#
var ourMusic = [
  {
    "artist": "Daft Punk",
    "title": "Homework",
    "release_year": 1997,
    "formats": [ 
      "CD", 
      "Cassette", 
      "LP"
    ],
    "gold": true
  },
{
    "artist": "Daft Punk",
    "title": "Homework",
    "release_year": 1997,
    "formats": [ 
      "CD", 
      "Cassette", 
      "LP"
    ],
    "gold": true
  }
]

As you can see, the new record is at the bottom

lament rock
#

create a new entry in it. It shouldn't matter where it is in the Array

feral aspen
#

but top level array means at the root, right?

blissful cliff
feral aspen
#

Bottom.

#

?

lament rock
#

not the root scope. the ourMusic Array in this context is the root

feral aspen
#

Oh.

#

Thanks.

blissful cliff
#

kinda curious, how do people here have their bots hosted?

#

am just curious if the majority is using a vps, cloud stuff like functions if thats even possible? or cloud applications or using docker or something similar like that?

fiery copper
blissful cliff
#

i got my stuff currently on a gke cluster, kinda hope someone else here aswell so i might be able to ask about rollouts, but still curious how others have it set up

fiery copper
#

A good option if you're on a budget is a raspberry pi

#

Is it weird that discord.js docs are kinda confusing to me

#

Like I get the premise but it's just confusing

#

discordjs.guide?

cinder iron
pale vessel
#

= is for assignment

cinder iron
#

so what should I put instead?

pale vessel
#

you'd want to use == for comparison

cinder iron
#

it says this? im confused

#

where did I go wrong?

feral aspen
#

OH

#

Python

pale vessel
#

remove the parenthesis

feral aspen
#

Add )

feral aspen
#

He is missing the ).

lament rock
#

python

pale vessel
#

it doesn't matter

#

you can add it

#

removing is also fine

earnest phoenix
cinder iron
#

o so in message.delete I should delete the extra one right?

pale vessel
#

yeah and add await since it's a coroutine

earnest phoenix
#
@client.event
async def on_message(message):
    if message.author.id = 712027036511633429:
        await message.delete()```
cinder iron
#

Ok ty

pale vessel
#

==

earnest phoenix
#

oh yeah

#

lol didnt notice

pale vessel
#

IDs are strings in js

earnest phoenix
#

user ids are integers

cinder iron
#

how do I define @client.event?

pale vessel
#

they're int in python

earnest phoenix
#

python does not require ( )

cinder iron
#

it says undefined name as @client or something

blissful cliff
#

Ahh didnt know that types are different

earnest phoenix
#

you just import your client

pale vessel
#

you need the client, did you name it bot?

blissful cliff
#

discord golang library does string ids aswell

cinder iron
#

i tried naming it to my bot but it also gave me an error

pale vessel
#

where did you define your client

earnest phoenix
#

at this point im assuming you have the basic bot

#

might as well show the entire code without the token

cinder iron
#
async def on_message(message):
    if message.author.id == 712027036511633429:
        await message.delete()```
this is all of  the code currently
#

o i didn't define the client

earnest phoenix
#

i suggest you look at the example bots

cinder iron
#

like where?

deft jackal
#

Guys bcs ur smart

#

And i am not

#

Help md

#

Me*

#

What role is missing

lament rock
#

Some languages do user IDs as strings because of number rounding precision errors when they reach close to or exceed the max safe 32 bit integer. Discord sends them as strings. discord.py devs probably just thought it was smarter to coerce them to ints

boreal iron
deft jackal
#

Any idea?

boreal iron
#

I do always say, snakes are weird

scarlet stratus
#

Lmao

scarlet stratus
deft jackal
#

No

#

Bcs

#

Idk how

#

Yesterday it was able

#

To warn

#

But now idk what happens

earnest phoenix
#

dont copy code

#

and then expect it to work

scarlet stratus
#

Then there is no way for us or anyone to help. You can ask on the website or report a bug

deft jackal
#

Ok

unreal estuary
#

if ur gonna use someone else's code try reading the code and see why it isnt working?

deft jackal
#

?

#

Dude

#

Is created with ghostbot

earnest phoenix
#

yikes

#

even worse

unreal estuary
#

oof

deft jackal
#

This is the only thing that my bot can't do

unreal estuary
#

if u want a good custom bot then ghostbot isnt for u

deft jackal
#

So

#

This means that my bot will be rejected

lyric mountain
#

no

deft jackal
#

From Luca

lyric mountain
#

it only means you are seriously capped from using a maker

unreal estuary
lyric mountain
#

but that doesn't prevent u from being accepted

nimble kiln
unreal estuary
#

because its a copy of another bot

#

oh ok

#

nvm

lyric mountain
#

ah, yes

nimble kiln
#

As long as he changes stuff it's fine

lyric mountain
#

if it's using the default stuff you'll be rejected

nimble kiln
#

^this

lyric mountain
#

you need at least 51% custom commands

deft jackal
#

But

#

My bot can set the afk

#

Can mute/unmute

#

Can purge messages

lyric mountain
#

looks like default stuff

deft jackal
#

Can use command like !say

#

It has help commad

#

Command*

nimble kiln
#

@deft jackal Create another botghost bot, dont change anything, and compare it with your bot

#

If most of the stuff is the same, your bot most likely wont get accepted

deft jackal
#

Like !help; !help mod; !help level

deft jackal
#

Only bcs my bot can't warn

#

Did it will be rejected?

#

It can do other things

#

Lile

#

Like*

#

Levels

unreal estuary
#

if some commands dont work then it will be rejected i think

lyric mountain
nimble kiln
#

Edy you dont understand me apparently

deft jackal
#

Ok but only the warn/clearwarn command isn't working

nimble kiln
#

That's not a problem

#

Your bot has to be unique

#

That's the key here

deft jackal
#

Oh ok

unreal estuary
#

my advice: if you want to make your own bot then you should try coding one yourself

deft jackal
#

NICE

#

unique

unreal estuary
#

its way better

nimble kiln
#

Chaning the response of the level-up messages isn't unique tho, just saying

deft jackal
#

The lvl up message is same

#

As mee6's

#

Look

nimble kiln
#

Do you have a bunch of custom commands which other bots dont have?

deft jackal
#

@EDY_1111, You just leveled up to level 5!

#

I think no

#

Wait

#

Wait nvm

#

It has !say

#

Isn't like danl memer

#

Dank*

#

Dank memer says who say and what say

#

Like

#

I am pro

#

EDY_1111#6089

nimble kiln
#

Take this as an example

deft jackal
#

๐Ÿ’ฉ

nimble kiln
#

It's a bit older, maybe the requirements are higher now

deft jackal
#

Ok but let ke say something

#

I have a friend

unreal estuary
#

nice

deft jackal
#

He has coded a bot

#

And his bot can't do anything

#

And now is afk

#

Offline *

nimble kiln
#

Yeah and?

deft jackal
#

Just say

#

He lose time coding

unreal estuary
#

if the bot cant do anything then is it really coded lol

deft jackal
#

Wanna see?

#

Is coded

#

Wair

#

Wait

unreal estuary
#

what does this have to do with ur problem

deft jackal
#

They have banned me

opal marsh
#

can somebody help me with a music system for python 3.9.2??

tired panther
#

Does anyone know the method for moving channels on discord.js?

unreal estuary
#

is that what u mean

opal marsh
#

can somebody help me with a music system for python 3.9.2??

cinder iron
opal marsh
#

oops

#

sorry for ping

opal marsh
#
@client.event```
#
@client.event
async def on_message(message):
    if message.author.id == 712027036511633429:
        await message.delete()```
#

that should work if not go to the python server

#

for help

#

ig

eager lance
#

i need help i first created a bot and i need help with blocking links and playing music but idk how u code it

eager lance
#

english

opal marsh
#

๐Ÿ˜‚

eager lance
#

idk im new to this

opal marsh
#

ohk dms

dusky lagoon
#

Who wants to see something brain hurting

tired panther
dusky lagoon
#

It took me 3 hours to add 120 anime's + information because i had to type and copy it with hand for a random anime suggest command

sudden geyser
#

yikes

#

Why not just get the total number of entries on AniList's site, generate a random number in between 1 and the current total, and use that number as the anime ID

dusky lagoon
#

Wahh

#

Ohw well because i wanted total control about what could be send or not you know what i mean

tired panther
dusky lagoon
#

just having my own kind of database

#

hahaha

#

But ngl i think it was worth it because it looks sick AS FUCK

sudden geyser
#
  1. Get the total number of entries.
query T {
  Page {
    pageInfo {
      total
    }
    media {
      id
    }
  }
}```
2. Use the `data.page.pageInfo.total` number to generate a number in between.
3. Send a request for the data.
```graphql
query T($id: Int) {
  Page {
    media(id: $id) {
      # More fields can follow
      id
    }
  }
}

If you want to filter out certain entries, you can always keep repeating step 2 and 3 until you get a valid result (like filtering out adult content)

#

Your approach (while it is cool) is not sustainable in the future I think

hidden ginkgo
#

cache 1.

rare sierra
#

hi

#

can I get help with CSS

earnest phoenix
#

yeah

rare sierra
# earnest phoenix yeah

when I use a <style> tag in a HTML doc, how do I know that it also is using sass so i can nest rules?
or can i even do that?

#

because it seems like it isn't working

vivid fulcrum
#

you can't use sass

#

it needs to be transpiled down to css

tired panther
#

try a mp3 file, see if its work

#

const soundPath = ./temp/${timestamp}.wav; ???

#

the timestamp renews the every ms

vivid fulcrum
#

is it a valid file in the first place

#

i.e. have you tried playing it

#

on your pc

#

is there any error logged

#

try ffprobing/just running the file through ffmpeg

#

just to see the output

#

ffprobe file or ffmpeg -i file lol

#

ffmpeg != ffprobe

#

oh my fucking god

#

it isn't a npm package

modest maple
pale vessel
solemn quartz
#

guys is there a method to do a math power command?

unreal estuary
#

im an hour and 1 minute late but

vivid fulcrum
#

okay so, the inside is pcm

#

now

#

the play method on the VoiceConnection allows you to set the type

#

so try setting the type to converted

#

play(whatever, { type: "converted" })

#

okay, correction

odd stratus
#

Is it possible to use fs to change a bunch of file names in a specific folder at once?

vivid fulcrum
vivid fulcrum
#

yeah

silent raptor
#

is there anywhere where I can ask people to test my bot for some constructive criticism?

vivid fulcrum
#

oup it's the timing then

#

djs uses 48khz timing

#

the audio file is 22khz

earnest phoenix
#

can anyone help me make a bass boost command?

vivid fulcrum
#

so the issue is with re-encoding for whatever reason

#

what's basically happening normally is

#

wav file that has PCM data -> djs forwards it to ffmpeg -> ffmpeg converts from PCM to PCM again

#

except at 48khz stereo

#

your file is 22khz mono

earnest phoenix
#

can anyone help me make a bass boost command?

vivid fulcrum
#

can you send over some wav file so i can try something out?

#

so, try using the exact same code except with this file

#

what

#

leave your code as is (with streams)

#

and try using that file i just sent instead

#

so it's djs fucking something up with ffmpeg or it's format re-encoding that's the problem

#

which djs version are you on?

#

your package.json

#

hm

#

okay

#

well

fossil grove
#

Sa

vivid fulcrum
#

you're going to have to spawn ffmpeg to convert the file to 48khz stereo

#

and then use that stream method instead

#

autism

rustic nova
#

yeet

earnest phoenix
#

can anyone help me make a bass boost command?

vivid fulcrum
#

you need to spawn ffmpeg with these arguments -ar 48000 -ac 2

so your end code would look something like this

const { spawn } = require('child_process');

say.export(text, null, 1, soundPath, (err) => {
    const outputFileName = "generate it here or something idk";
    const ffmpeg = spawn("ffmpeg", ["-i", soundPath, "-ar", "48000", "-ac", "2", outputFilePath]);

    ffmpeg.on("close", (_) => {
        //converting here finished, proceed with your regular code, except use outputFilePath when creating the stream
    });
});
#

for this to work ffmpeg needs to be added to your PATH

#

otherwise just provide a path to the .exe/binary in spawn()

#

try it and see

#

oh also

#

you should probably add .wav to outputFileName

#

also

#

don't copypaste my code

#

there are some mistakes in there

boreal iron
#

You wrote them intentionally to see if somebody just c&p

#

We now it.

#

Tell us the truth!

vivid fulcrum
#

totally not because i wrote the entire thing in the discord chat

vivid fulcrum
#

sure

#

you're still playing soundPath

earnest phoenix
#

what program this run in? I only know java

vivid fulcrum
#

language*

#

that is js

earnest phoenix
#

haha

#

i only learned using the bluej, maybe thats why i couldnt tell, never really got good with writing if and then statments

blissful cliff
#

Just quickly wanted to say, ew, child processes

quartz kindle
#

its not?

vivid fulcrum
#

according to that log it isn't

#

show your code

#

a VoiceConnection is not a VoiceChannel object

#

you could've said so in the first place ๐Ÿ™„

quartz kindle
#

voice_Connection.channel.id

opaque acorn
#

hello, how do i give presence to my bot?

quartz kindle
#

you mean like a status?

opaque acorn
#

yep

quartz kindle
#

which library?

opaque acorn
#

discord.js

quartz kindle
opaque acorn
#

okay ty

unreal estuary
#

does anyone know why my meta tags arent showing in discord

fossil grove
#

I try too many to make a command that turns on and off by another Command

vivid fulcrum
#

which meta tags

unreal estuary
#

<meta name="title" content="Discord Webhook Sender">
<meta name="theme-color" content="#dbdbdb">

#

this is in the head tag

vivid fulcrum
#

you need opengraph meta tags

unreal estuary
#

ohhh

#

ok thanks

#

ill try

vivid fulcrum
#

these are the ones you need i think

unreal estuary
#

ok

#

it worked thanks

tulip ledge
#

Wich is best sqlite or mongodb

opal plank
#

realistically, you're comparing a fork to spoon

#

both are eating utensil

#

but each have their perks

#

theres no best db

#

even though i keep saying postgres is the ultimate db

unreal estuary
#

i havent tried mongodb but i found sqlite easy to work with

unreal estuary
opal plank
#

each have their own perks

#

postgres bae

tulip ledge
#

Im currently using sqlite but not sure if its the best decision

#

What about fauna?

opal plank
#

my im biased on postgres, try not to eat too much what i feed you on postgres

unreal estuary
#

havent heard of fauna

opal plank
#

havent used fauna so i cant comment

#

it highly depends on what you're doing tbh

tulip ledge
#

Fauna is like all db schemes together

opal plank
#

you need document based db? relational? scalable? light?

tulip ledge
#

Document ig

#

Key value where the value is a json object

opal plank
#

scalable or light?

#

hmmmm

#

keydb or sqlite might be best for you, i assume you're going for something light

tulip ledge
#

Mmmmh whats the difference between scalable and light

opal plank
#

scalable is high performance db

#

light is a db thats quick but its meant for low traffic

#

its not meant for slow traffic, dont get me wrong, but its usable in lower traffic ends

tulip ledge
#

Its an RPG discord bot that stores quite a bit of data per user

opal plank
#

where you wont eb doing thousands of queries a minute

#

storing data isnt the issue

#

i mean more like, how many queries a second do you do

tulip ledge
#

Not that much its mainly 1 query when a command gets executed and then another one if I need to save more data

#

But lets say u have multiple users

opal plank
#

hmmm you might wanna stick with sqlite then

tulip ledge
#

Right and say iโ€™d need a scalable one wich one would be your recommendation

opal plank
#

cassandra or postgres

quartz kindle
#

sqlite can easily handle hundreds of queries per second

opal plank
#

tim bout to swoop in and call me out for biased

quartz kindle
#

if you're writing a lot, enable WAL mode and turn synchronous off

opal plank
#

most of the time i see sqlite being used as a choice db is when there are few queries

#

specially with high volume data

tulip ledge
#

Alright but sqlite is a good pick here right?

opal plank
#

but i doubt they'd be using that much data

tulip ledge
#

Also whats the best compression algorithm I should use

#

I looked into lzjs what about that one?

quartz kindle
#

depends, you want it to be fast or to have high compression?

opal plank
#

it would be better for you to do your own research instead of asking every db you know of here

#

see what each db offers

tulip ledge
#

I did but Iโ€™m really not sure what I should pick thats the thing

opal plank
#

one or two is fine, but it feels like you're googling random db's and just asking it in here instead of reading about them

tulip ledge
#

Iโ€™d want it to be fast but also compress quite a bit

quartz kindle
#

are you gonna use built-in compression in the database level? or are you gonna compress stuff yourself before writing to the database?

tulip ledge
#

I just watched a 30 min video of database shit and I still dont know wich to pick

#

Iโ€™ll compress before writing

quartz kindle
#

in that case, benchmark it yourself

#

but you cant really go wrong with the built in zlib

tulip ledge
#

Is zlib built in sqlite?

quartz kindle
#

deflate is one of the fastest algorithms out there

#

zlib is built into node.js

tulip ledge
#

Oh ok

#

Ty!

unreal estuary
#

inside a string?

tulip ledge
#

Wait but zlib uses deflate right? So whats the difference between deflate and zlib or is zlib deflate Iโ€™m fucking confused

quartz kindle
#

zlib is a library

#

it functions as an abstraction layer for the deflate algorithm

rose lance
#

ayo, I was just working on my bot page and now removed entity-header__short-description
I wasn't sure if that's allowed since it was only mentioned that it's not allowed to hide vital objects
I have no short description tho and I wasn't sure what to put there then
(https://top.gg/bot/701905927363756112) this is how it's looking like now

boreal iron
#

Nope that shouldnโ€™t be an issue, you arenโ€™t removing site content, ads etc.

carmine summit
#

How do I remove duplicate value in an object in an array while having to count how many is the duplicates?

[
  {
    "name": "Steve",
    "voter": "b9k4tx56g"
  },
  {
    "name": "Bill",
    "voter": "es49fs3jf"
  },
  {
    "name": "Adam",
    "voter": "v8k79de56"
  },
  {
    "name": "Bill",
    "voter": "d34svrj"
  },
  {
    "name": "Bill",
    "voter": "lm8h76f"
  },
  {
    "name": "Robert",
    "voter": "l8s5v6q7b"
  },
  {
    "name": "Adam",
    "voter": "f7er43k"
  }
]

I wanted something that looks like:

[
  {
    "name": "Steve",
    "votes": "1"
  },
  {
    "name": "Bill",
    "votes": "3"
  },
  {
    "name": "Adam",
    "votes": "2"
  },
  {
    "name": "Robert",
    "votes": "1"
  }
]
#

should I just make a loop, and make a new array, then start with the first one, then put it into the new array, then check the next one. check the new array for duplicates, then if it is a duplicate, delete it, then add 1 to the new array?

agile lance
#

What language?

carmine summit
boreal iron
#

Youโ€™re still on that thing lol

carmine summit
#

I just need a data on how many is the duplicates

long crow
#

There is native way too

pale vessel
#

This is what I'd dojs array.sort((prev, next) => Number(prev.votes) - Number(next.votes)).reduce((acc, cur) => (!acc.find(entry => entry.name === cur.name) && acc.push(cur), acc), []);

#

Sort the array by little amount of votes to most amount of votes, and remove duplicates using reduce()

long crow
#

^the native way, reducer

sudden geyser
#

couldn't you accumulate first then sort second so you have a smaller array to sort

pale vessel
#

Yeah, I guess, if you know which one is the smallest amount

#

They want an array of unique items, all are lowest price from the original array

#

If I recall correctly?

carmine summit
#

yeah

#

I'm so confused

pale vessel
vast garnet
#

hey

#

i need the mute command

#

discord.js v12

toxic lava
#

code it

vast garnet
#

I don't know much

opal plank
#

we dont spoonfeed here

#

if you got a specific question, we are happy to help you

#

otherwise if you truly want pre-made codes, use discord bot maker or some other sort of bot maker

pale vessel
# carmine summit I'm so confused

I just looked at the result you wanted, seems like you also need to calculate how many votes that user had, reduce() can also do that

#

I'm assuming that one is different from yesterday?

vast garnet
#

hey

#

I have a problem but I couldn't solve it. Is there anybody to solve it?

carmine summit
opal plank
#

again, ask your question

#

@vast garnet

vast garnet
#

ok

pale vessel
#

That's much simpler though, using reduce, you check if the user is already inside the array. If they are, just increment their voter count or if not, create a new entry with 1 voter

#

You don't need to sort it too

vast garnet
#

I didn't vote here but it still sends how do I fix it

opal plank
#

no code = no help

vast garnet
#

i m turkish

#

ok

opal plank
#

@pale vessel also if its a db you can just sql GROUP BY id

pale vessel
#

SQL moment

opal plank
#

rather than doing all that in memory

#

let the db handle the grouping

vast garnet
#

ss or should I write

opal plank
#

up to you

pale vessel
#

bin it

vast garnet
pale vessel
#

You're not doing anything if the user voted

#

Do you want it to send the embed if the user voted?

vast garnet
#

i know

pale vessel
#

If so, move all the embed code to that if block

vast garnet
#

How so else and do I delete the one below?

pale vessel
#

Do you want to send the user this embed if they have voted?

vast garnet
#

No, if he didn't vote, send it

pale vessel
#

Ah

#

Then in that else

#

By the way, you should reset your DBL token

vast garnet
#

ok

pale vessel
#
  • use @quasi shale-gg/sdkinstead since dblapi.js is deprecated
vast garnet
#

npm i @quasi shale-gg ?

pale vessel
#

npm i @top-gg/sdk

#

and npm uninstall dblapi.js

vast garnet
#

ok thnks

pale vessel
#

Your problem can be fixed by putting the embed code inside the else block, since that will only be triggered if the user has not voted

pale vessel
carmine summit
#
      {
        name: "Steve",
        voter: "b9k4tx56g",
      },
      {
        name: "Bill",
        voter: "es49fs3jf",
      },
      {
        name: "Adam",
        voter: "v8k79de56",
      },
      {
        name: "Bill",
        voter: "d34svrj",
      },
      {
        name: "Bill",
        voter: "lm8h76f",
      },
      {
        name: "Robert",
        voter: "l8s5v6q7b",
      },
      {
        name: "Adam",
        voter: "f7er43k",
      },
    ];

    let newArray = [];

    for (i = 0; i < array.length; i++) {
      let name = array[i].name;
      let newObject = newArray.find((arr) => arr.name == name);
      console.log(name);
      console.log(newObject);
      if (!newObject) {
        console.log("Creating");
        newArray.push({ name: name, votes: 1 });
      } else {
        console.log("Modifying");
        let votes = newObject.votes + 1;
        newObject.votes = votes;
      }
    }```
pale vessel
#

Hey man, if it works it works

#

I'd be proud if I got that working all by myself

vast garnet
#

Can you help me mostly when I don't know much?

pale vessel
#

It's crazy that one method and shorten your code to one line

pale vessel
carmine summit
#

what is the other method?

vast garnet
#

Now what am I going to write instead of the old one?

pale vessel
#

reduce((acc, cur) => (acc has current's name ? <find acc by name and increment the voter count> : <else, acc.push(an object with name and voter count 1>, <return back acc>), [] (start with an empty array))

carmine summit
pale vessel
carmine summit
pale vessel
#

What part are you having trouble at? @vast garnet

vast garnet
#

ok sorry i m turkish i need the translate ๐Ÿ˜„

vast garnet
pale vessel
#

Try replacing require("dblapi.js") to require("@top-gg/sdk")

vast garnet
#

ok

earnest phoenix
#

can someone check something in dms

vast garnet
#
      const dbl = new DBL('dbl token', client)

      dbl.hasVoted(message.author.id).then(voted => {
        if(voted) {
        } else {
        message.channel.send("Bu komutu kullanabilmek iรงin botumuza oy vermelisin! https://discordbots.org/bot/813015311199633418/vote/n%60%60Onaylanmasฤฑ birkaรง dakika sรผrebilir")
      }
    })
it is a correct?```
pale vessel
#

Yeah

vast garnet
#

but error

pale vessel
#

put new DBL.Api

#

Add .Api

vast garnet
pale vessel
#

Can you show your code?

vast garnet
#

I deliberately typed "token"

carmine summit
#

@pale vessel This is what I got if single brain cell didnt fail me:

array.reduce((acc, cur) => ( acc.includes(array.name) ?array.find(arr => arr.name == acc).votes =  array.find(arr => arr.name == acc).votes + 1: acc.push({name:acc.name, votes: 1}), return acc), [])
pale vessel
#

Remove that duplicate new

craggy pine
vast garnet
#

ok

pale vessel
#

For votes, use .votes++ to increment it, you don't need to reassign the whole object that way

vast garnet
#

I get it already my calm friend ๐Ÿ˜„

#

@pale vessel thnks man

pale vessel
#

Yeah but you still hasn't fixed your original issue

#

You want to send the embed if the user hasn't voted right?

carmine summit
#

is it acc.find, or cur.find?

pale vessel
#

cur, yeah

#

acc is an array

carmine summit
#

acc is like the object itself

pale vessel
#

Yeah

carmine summit
#

and cur is what it returns

#

?

pale vessel
#

Cur is the current element

#

Think of it like a loop

earnest phoenix
craggy pine
#

You can share it here if it's related to development

earnest phoenix
#

this doesn't work

carmine summit
#

is acc or cur the element inside the array?

craggy pine
#

Delete that jesus KEKW

vast garnet
earnest phoenix
#

thats why i said dms

craggy pine
#

You can actually format the code to look normal

#

or put it in a pastebin

earnest phoenix
#

with `?

#

`I'm a dummyยง

pale vessel
earnest phoenix
#

frick

craggy pine
#

Don't

Code

Like

This

earnest phoenix
#

I don't

pale vessel
#

Hence why there is , acc at the end

earnest phoenix
#

it's like that when I pasted

craggy pine
#

use that

carmine summit
#

if I remember correctly, cur is like the {name, voter}. While acc is the final result, {name, votes}

earnest phoenix
#

can I share a file

#

.txt?

vast garnet
#

So how do I write "voted === true" instead of "vote"?

pale vessel
#

Naw that's just what voted is

#

All you have to do is move your code to the correct scope

carmine summit
earnest phoenix
pale vessel
#

Cur is the element from the original array

vast garnet
#

where am I going to move?

pale vessel
#

you won't need return, , acc is enough since it's inline (no {})

carmine summit
#

@pale vessel alright thanks, I think I am getting the hang of it now.

pale vessel
#

Move embed to else {}, and the channel.send to if

earnest phoenix
#

r u making a bal command in js

vast garnet
#

hey dude i m turkish not u understand

carmine summit
#

This is what I got so far.

earnest phoenix
#

nvm

pale vessel
#

Try array.find().votes++

#

for the first expression in that ternary

pale vessel
drifting wedge
#

cannot import name 'web' from partially initialized module 'aiohttp'

vast garnet
#

I don't want to send embed

drifting wedge
#

any ideas?

pale vessel
#

but that if-else should be self explanatory

earnest phoenix
#

flaze be helping everyone

#

flaze do you know python?

pale vessel
pale vessel
drifting wedge
#

from aiohttp import web

earnest phoenix
#

tough

drifting wedge
#

as doc example

native hound
#

Are there Arabs here to communicate?

earnest phoenix
#

nope

vast garnet
#

I am Turkish and I do not understand anything, please can you put the code ready (provide translate)

earnest phoenix
#

@vast garnet step 1 learn english

drifting wedge
earnest phoenix
#

is that python

drifting wedge
#

yes

earnest phoenix
#

ok

#

is aiohttp installed

drifting wedge
#

yes

#

its default

earnest phoenix
#

k

#

where is web

drifting wedge
#

its an aiohttp class

#

ImportError: cannot import name 'web' from partially initialized module 'aiohttp' (most likely due to a circular import)

#

full error

earnest phoenix
#

meant to say where is aiohttp

drifting wedge
#

how is it partially initialized

#

its a python module

carmine summit
#

im using prettier in vscode, and it always makes a newline everytime a code is getting too long. I want to disable it. What settings is it related to?

earnest phoenix
#

you say from aiohttp

drifting wedge
#

oh i got it

#

lol

#

kek

native hound
#

Are there Arabs?

earnest phoenix
drifting wedge
#

kek

#

got it

#

im good

earnest phoenix
#

what happened

earnest wigeon
#

@drifting wedge ur importing 2 modiles frkm each other

earnest phoenix
#

spelling๐Ÿ“‰

drifting wedge
#

non no

native hound
#

ููŠู‡ ุนุฑุจ ู‡ู†ุง ุŸ

earnest wigeon
#

Yes

drifting wedge
#

file was called aiohttp

#

kek

earnest wigeon
#

Duh

earnest phoenix
#

bru

earnest wigeon
#

U fixed!?

earnest phoenix
#

from keep_alive import keep_alive
from discord.ext import commands
||pov you clicked||

earnest wigeon
#

@drifting wedge google: python circular import

vast garnet
earnest phoenix
#

it took you that. long to say that

earnest wigeon
#

Coreh Schaefer has really good explanation

vast garnet
earnest wigeon
#

@earnest phoenix i am slow af

vast garnet
#

What is the "vote" "BOTUU" here for?

pale vessel
#

"Toggle word wrap"

drifting wedge
#

Hey flapze

#

You know any python?

#

Basically is there a way to setup a webserver that doesn't stop other processes?

#

Like for example, if you run your bot it goes forever technically

#

Webservers too

vast garnet
#

hey look at me ss

drifting wedge
#

Is there a way to make it still process requests but not stop everything else?

pale vessel
#

Do you have a file called web by any chance

carmine summit
pale vessel
#

.

drifting wedge
#

Talking to me?

#

I fixed it already

#

It was cuz the file was called aiohttp kek

vast garnet
pale vessel
#

oh xd

#

It did say something about circular dependencies

pale vessel
#

Did you change your code though?

vast garnet
pale vessel
#

what's the embed for though?

#

If you don't want it, you can remove it

carmine summit
vast garnet
pale vessel
#

Yeah, everything after var down there

vast garnet
#

ok

#

Where do I write them later?

pale vessel
#

What is the embed for?

#

what is this

vast garnet
#

this is a fun code she needs to vote for it to use it and if she doesn't send a message send a fun code in the code below

steady yarrow
#

anyone good with heroku?

pale vessel
vast garnet
#

ok ok

pale vessel
#

return stops unvoted users from executing that command

vast garnet
#

stop, I accidentally said ok ok I did not understand. Can you directly throw the code or can you tell?

pale vessel
#

I can only tell

#

You also still have to put your code inside that .then(voted => {}) or use await

#

I'll give you an example

#
const voted = await dbl.hasVoted(author.id);
if (!voted) return channel.send("Oy verilmedi"); // not voted, return with a message asking them to vote

// Embed code

channel.send(embed1);```
#

It will only run the embed code IF the user has voted

#

So you have to change your code since this makes it way simpler

vast garnet
#

OK, but am I going to type that fun command below into "// embed command"?

pale vessel
#

Yes

#

It will only continue if the user voted otherwise, it will send "Oy verilmedi" and stop

vast garnet
#

ok i m try

earnest phoenix
#

-_

#

can someone tell me why this doesn't work

vast garnet
#

do i need to edit?

earnest phoenix
#

wym it brings to code

dusky sundial
#

In what way does it not work? Does it give you any error messages?

pale vessel
#

Not just author

vast garnet
#

ok

pale vessel
#

You should also remove this, it doesn't do anything

dusky sundial
pale vessel
#

Oh

#

@vast garnet Remove this for now

vast garnet
pale vessel
#

it workie?

earnest phoenix
#

I need help