#development

1 messages Β· Page 877 of 1

amber fractal
#

why

#

you could just use the event and count

#

then you don't waste memory

#

and it works on reset

earnest phoenix
#

^

coarse topaz
#

big brains talking omg

unreal cliff
#

use whatever suits you

coarse topaz
#

Thank you for the help, guys ^^... I dunno exactly how am I going to figure it out, but I'll try...

#

I'll send a message here if I still have doubts πŸ‘

#
  const emoji = messageReaction.emoji //the reaction emoji
  const message = messageReaction.message //the message reacted to
  if(!emoji.id === "698687776421445654") return;
    const array = db.fetch("message")//unicode emoji (normal emoji) or a custom emoji (id)
    if(!db.has("messages", message.id)) return;//checks if it is the message you want
if (message.reactions.cache.filter(r => r.emoji.id ==="698687776421445654").size === 2) return message.channel.send("whatever").catch(e => console.log(e))
});```

So, from where should I delete those tests code lines? :p
earnest phoenix
#

from what i'm seeing everything is great except this line
if (message.reactions.cache.filter(r => r.emoji.id ==="698687776421445654").size === 2) return
you already have the reaction object, messageReaction, replace that long ass if statement with messageReaction.count === 2

#

your current code will send a message as long as the amount of reactions is not 2 im blind

coarse topaz
#

a

fleet chasm
#

why a

coarse topaz
#

it's like the shortest form to say 'ah,' or 'oh,'
or at least i think it haha

fleet chasm
#

oh ok

coarse topaz
#
  const emoji = messageReaction.emoji //the reaction emoji
  const message = messageReaction.message //the message reacted to
  if(!emoji.id === "698687776421445654") return;
    const array = db.fetch("message")//unicode emoji (normal emoji) or a custom emoji (id)
    if(messageReaction.count === 2) {
      message.channel.send(`Hello!`)
    }
});```
Something like this could work? @earnest phoenix
earnest phoenix
#

yeah, you just have to check if it's the message you want to track

coarse topaz
#

Oook

clear wraith
#

Guys, How can I make the server invite code a link. In the bottom right of this screenshot:

coarse topaz
#

Are you using discord.js, @clear wraith ?

#
  const emoji = messageReaction.emoji //the reaction emoji
  const message = messageReaction.message //the message reacted to
  if(!emoji.id === "698687776421445654") return;
    const array = db.fetch("message")//unicode emoji (normal emoji) or a custom emoji (id)
    if(!db.has("messages", message.id)) return;
    if(messageReaction.count === 2) {
      message.channel.send(`Hello!`)
    }```
Btw, @earnest phoenix, something like this should work fine?
clear wraith
#

Yes @coarse topaz

coarse topaz
#

I think I have an example in one of my codes, give me a min πŸ˜‰

sudden geyser
#

It can't be a clickable link if it's in the footer.

coarse topaz
#

I also thought that ^

#

But wanted to confirm anyway

#

[Your clickable text](URL)
@clear wraith This is the example you need to follow πŸ™‚

nocturne dagger
#

o you did that

coarse topaz
#

Just that, try using it in a field

clear wraith
#

Ok, Thanks

coarse topaz
#

bruh

#

XD

#

No problem! ^^

#

@earnest phoenix Nvm! It worked perfectly! Thank you so much!! ^^
Just wanted to ask something else... that number 2 in this line: if(messageReaction.count === 2) could be an object?

For example, the amount of members that have a role

earnest phoenix
#

uh no

#

you need to compare to a number

coarse topaz
#

Ohh... Are you sure there isn't any way?...

earnest phoenix
#

whats your end goal here

coarse topaz
#

Ok...
when i run the command, the bot will send a message and react to it.
then when it has reached a specified number, it will send a message.
that specified number, needs to be the half + 1 of the amount of the members of a role.

#

(I already have that object)

#

I'm using this:

#

${(hotw_committee_members.size/2) +1}

earnest phoenix
#

can other members which don't have the role react

coarse topaz
#

But I need to use the same object in this line: if(messageReaction.count === 2)

#

They can, but the bot will not count their reaction

earnest phoenix
#

it will

coarse topaz
#

ah

#

then there isn't any problem

earnest phoenix
#

the count property doesn't filter out members, as it's just a number

coarse topaz
#

it doesn't matter

clear wraith
#

I have another question.

coarse topaz
#

Ask away!

#

πŸ˜›

clear wraith
#

so the channel can stand out

coarse topaz
#

Ah

#

You need to type the ID of that channel

clear wraith
#

in this case... #bot-updates

coarse topaz
#

for example: [#development](/guild/264445053596991498/channel/272764566411149314/) It's the ID of the #development channel.

#

you just need to put \ before the channel tag to know its ID

#

for example: \#development

clear wraith
#

so i would replace the Id of the channel for #bot-updates

earnest phoenix
#

if it doesn't matter then you can simply get the role from the guild (https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=roles) (https://discord.js.org/#/docs/main/stable/class/RoleManager?scrollTo=cache) (https://discord.js.org/#/docs/collection/master/class/Collection?scrollTo=get)

once you have the role object, you can get the collection of members that are inside of the role (https://discord.js.org/#/docs/main/stable/class/Role?scrollTo=members), .size property of that will give you the amount of members inside of the role

coarse topaz
#

Yep, And the bot will mention it ^^'

#

[#development](/guild/264445053596991498/channel/272764566411149314/)

clear wraith
#

Thank you again!

coarse topaz
#

No problem!

clear wraith
coarse topaz
#

if it doesn't matter then you can simply get the role from the guild (https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=roles) (https://discord.js.org/#/docs/main/stable/class/RoleManager?scrollTo=cache) (https://discord.js.org/#/docs/collection/master/class/Collection?scrollTo=get)

once you have the role object, you can get the collection of members that are inside of the role (https://discord.js.org/#/docs/main/stable/class/Role?scrollTo=members), .size property of that will give you the amount of members inside of the role
@earnest phoenix I already have the amount of members... I just want to make the number the bot needs to reach, the amount of members of that role ^^'

#
  let hotw_committee_members = message.guild.roles.cache.get(hotw_committee_role).members;```
#

${hotw_committee_members.size}

#

Ping me if you will answer to this message :p

earnest phoenix
#

@coarse topaz size returns a number

#

it isn't an object

coarse topaz
#

a

#

it's a collection then, right?

earnest phoenix
#

members is a collection

#

yes

coarse topaz
#

Ah...
Then...

#

Is there a way to do what i was thinking in with that collection? πŸ˜…

#

Also, good night, @earnest phoenix! Thanks for helping me today! ^^

#

πŸ’€ 😴

valid frigate
#

ok guys so typescript i have a class that contains

public metricsManager: BaseMetricsManager | null;

and this is BaseMetricsManager

export class BaseMetricsManager {
    protected readonly prefix: string = "bot";
    constructor(prefix: string) {
        this.prefix = prefix.toLowerCase();
    }
}

so for example if i have another class that extends BaseMetricsManager and assign it to metricsManager, metricsManager will contain all the methods from the extended class

#

i think it's called a mixin but idk how to use it so if anyone could explain that would be epic

clear wraith
#

I have a quick question...

fleet chasm
#

ask it

ember atlas
#

Dont ask to ask, just ask your question πŸ˜„

clear wraith
#

Or is that even possible ^

amber fractal
#

you can <@id> but that will only work if your bot isn't nicked

#

<@353782817777385472> = @amber fractal

raw idol
#

<@\353782817777385472>

#

Lol

amber fractal
#

That slash wasn't supposed to be there

raw idol
#

Yeah figured

clear wraith
#

I got iy

#

*it

amber fractal
#

or (in d.js) you could <Client>.user.toString() I believe

clear wraith
#

Yes

#

Oh, Is there a way to remove "your" bot from a server that "you" do not manage?

fleet chasm
#

guild.leave() if you use d.js

#

let me check

#

yes

clear wraith
#

k

#

would i execute that in the Terminal?

fleet chasm
#

any where you can run it like eval

clear wraith
#

i do not use eval

amber fractal
#

you can't do it via terminal

#

Well

#

you can make the request yourself

#

but it's a little complicated

clear wraith
#

i ran guild.leave(server id) but nothing happened.

fleet chasm
#

you have to get the guild first, then do .leave() on it

#

leave doesnt have arguments

raw idol
#

Lol

clear wraith
#

ohhh

#

ok

grizzled raven
#

if its a function for the guild, its probably going to be called from the guild

#

aka guild.leave(), guild.setName() etc

clear wraith
#

??

raw idol
#

Lol no

earnest phoenix
#

oop

raw idol
#

You get the guild from your collection of guilds using id

#

And you get your collection of guilds from your client object I think

clear wraith
#

dang

#

lol, i suck at this.

raw idol
#

What lib do you use?

earnest phoenix
#

pretty sure he’s using .js, idk tho

clear wraith
#

discord.js

fleet chasm
#

check the docs

raw idol
#

Ok do you know how to access your client object?

clear wraith
#

yes

raw idol
#

Is there like a .Guilds under it?

fleet chasm
#

this thing

clear wraith
#

yes there is

drowsy sentinel
#

You could just do client.user or message.guild.me and it'll mention the user object for the client in a string. No need toString it.

clear wraith
#

Ahh, Ok

drowsy sentinel
#

You can always do <@id> and that'll work too.

#

But, normally casting the object to a string will mention it.

fleet chasm
#

oh everytime i do guild.me i always get a blank message

#

.me probably gets the entire member object instead of the mention so not sure

amber fractal
#

lmao you can make a DELETE request to https://discordapp.com/api/users/@me/guilds/the_id with your bots token as the Authorization header as Authorization: Bot your_bots_token mmLol

drowsy sentinel
#

Huh, maybe the guildmember object doesn't mention but the user object does.

#

I never checked, I just figured since it returns the client as a guildmember object it would mention.

fleet chasm
#

ok time to check

drowsy sentinel
#

It works for me.

fleet chasm
#

user also returns the entire user object for me

#

not sure why

drowsy sentinel
#

Are you casting it as a string or trying to send the object?

#

Sent it above the embed.

fleet chasm
#

casting as string, but whatever im using is not working, and its not an issue that id like to bring up in here

#

waht

clear wraith
#

how tf do you make an eval command

#

lol

fleet chasm
#

eval(code)

raw idol
#

xddd

clear wraith
#

Does the bot come with a vote command?

fleet chasm
#

what

clear wraith
#

like: c!vote

fleet chasm
#

uhh

raw idol
#

No you have to code it xddd

clear wraith
#

Omg, I hate life

#

lol

fleet chasm
#

wrong server?

earnest phoenix
#

you have to add commands yourself xd

clear wraith
#

this is going to be a long night

earnest phoenix
#

gl man

raw idol
#

Just have it send a link to your vote page lolll

#

I dont see what is hard

earnest phoenix
#

or a hyperlink

clear wraith
#

lol

#

ik

#

im just tired

raw idol
#

Loll

#

Gl man

clear wraith
#

Jeez, thx. Lol

raw idol
#

Np

hushed cosmos
#

How to fix this error

fleet chasm
#

wrong server uhhh

hushed cosmos
#

My bad

ember atlas
#

-wrongserver @hushed cosmos

gilded plankBOT
#

@hushed cosmos

Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of our website. If there isn't a button that says Join Support Server, then we can't help you. Sorry :(

wanton nova
#

oh so THATS what his pfp is suppoused to be....
Ever since the pfp change i thought it was just a bunch of white blobs

sudden geyser
#

Same except I thought it was some cursed blob

fleet chasm
wanton nova
#

sorry just wanted to bring it up here since it was relevant

fleet chasm
#

Β―_(ツ)_/Β―

small prairie
#

channel limit hit tho only 90 channels in server
(message.guild.channels.cache.size)

earnest phoenix
#

Intel(R) Xeon(R) E-2136 CPU @ 3.30GHz VPS STARTER HL+ 3 Go de RAM + DDR4 ECC 30 Go SSD 300 Mbps 1 Γ  3.3 Ghz
or
Intel(R) Xeon(R) E-2136 CPU @ 3.30GHz VPS Medium HL+ 6 Go de RAM + DDR4 ECC 50 Go SSD 300 Mbps 2 Γ  3.3 Ghz

#

for discord bot

fading wigeon
#

@earnest phoenix how many servers does ur bot have

#

Also try measuring the memory usage

earnest phoenix
#

750

fading wigeon
#

The internet speed shouldnt be an issue

#

In that case id go for the top one

#

You can still upgrade to the bottom one if your bot gets larger and exhausts all the resources

earnest phoenix
#

And vps with 2go ram is good @fading wigeon ?

fading wigeon
#

Well i would suggest you check how much your bot uses currently

#

And it also depends on ur code and language

earnest phoenix
#

11MB RAM

fading wigeon
#

Haha yeah ur good

earnest phoenix
#

code its optimised

#

so

#

2go ram is perfect?

fading wigeon
#

Yeah 2gb is fine

earnest phoenix
#

Okk

fading wigeon
#

Id go evdn lower to save cash

earnest phoenix
#

What is your host?

#

1 CPU E5-2690 3.8GHz
2 Go RAM DDR3
1 IPv4 & 1 IPv6
20 Go NVMe
3.99$ /month

#

this offer is good?

fading wigeon
#

Yeah seems like a good deal

#

I buy my own hardware

earnest phoenix
#

uh ok

#

ty u

tight plinth
#

yea

golden condor
#

Hi I am tryna use git push and git pull to push to a private remote repo but I'm not sure how to

nocturne grove
#

Does anyone know why the Discord website says If they (a member) have a nickname there will also be a be a ! after the @. if it's not true? My bot has no nickname (in all guilds) and the mention is still like <@!id>.

lilac urchin
#

yeet

golden condor
#

How do I use git push

#

I have fetched a repo

#

But I can't push

#

To ir

#

And I have put in the credentials

nocturne grove
#

@golden condor you should first do git add . (. = everything) and then git commit -m "reason for committing" before you push

golden condor
#

@nocturne grove I did that

#

Now it says this

#
cxllm@Cxllm-VirtualBox:~/Bots/Corynth$ git push
fatal: The current branch github.com/cxllm/corynth.git has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin github.com/cxllm/corynth.git```
#

@nocturne grove then it says this

cxllm@cxllm-VirtualBox:~/Bots/Corynth$ git push --set-upstream origin https:// github.com/cxllm/corynth.git
fatal: remote part of refspec is not a valid name in https://```
nocturne grove
#

hmm sorry but I don't know what to do. Guess it's an easy thing but I am not a github expert

spare goblet
#

just use github desktop

#

ez

stray wasp
#

git push -u origin master

junior bison
#

Guys, I have a problem. My music bot doesn't work between 2-3 at night. He gives an error online but there is no such song on youtube

spare goblet
#

what you're doing is saying to push to the remove repo called origin with the branch called https:// github.com/cxllm/corynth.git

stray wasp
#

@golden condor

spare goblet
#

which is why you're stuck

#

all you have to do is clone the repo then push it to the master branch (aka what Rotinxss said)

stray wasp
#

and then you can do git push because then the upstream is then defined

golden condor
#

It kinda worked

#

@spare goblet The branch is named this

spare goblet
#

your branch is literally called

golden condor
#

Yes

spare goblet
#

who names a branch that?

golden condor
#

Git autonamed it

#

Idk how to name it

spare goblet
golden condor
#

How do I name it

high bough
#
Guild.findOne({
                guildid: message.guild.id
              }, async (err, guild) => {
                if(err) console.log(err);
                async function checkcommand() {
                  if (guild.banned === "true") return
                  if (message.content.toLowerCase().startsWith(guild.prefix)) {
                    const commandName = message.content
                      .slice(guild.prefix.length)
                      .toLowerCase()
                      .split(" ")[0]
                      .toLowerCase();
                    const args = message.content
                      .slice(guild.prefix.length)
                      .split(" ")
                      .slice(1);
                    const command = client.commands.get(commandName);
                  try {
                    await command.execute(client, message, args, Discord, config, avatarURL, footer, clientname, NL3Embed, DevEmbed)
                  } catch (err) {
                    var owner = await client.users.cache.get(`${config.primaryownerid}`)
                    console.log(err);
                    }
                  } 
                }
                if(!guild){
                  const newDoc = new Guild({
                    guildid: message.guild.id,
                    welcomechannelid: message.channel.id,
                    loggingchannelid: message.channel.id
                  })
                  newDoc.save().catch(err => console.log(err));
                  checkcommand()
                } else {
                checkcommand()
              }
            }
          )
```Guys, what did I miss?
#

Sorry bout the indents

earnest phoenix
#

How can i reset a quick.db database for a server?

ocean violet
#

@earnest phoenix I believe you can’t delete stuff from quick.db

earnest phoenix
#

can i maybe set to each user?

ocean violet
#

What do you mean

earnest phoenix
#

for each user
set his coins to 0

#

or somthin

#

g

ocean violet
#

db.set

#

And use a forEach

#

To loop

quartz kindle
#

if you want to delete the entire database, just delete the json.sqlite file

earnest phoenix
#

for a specific server tho

sacred mountain
#

Yo

earnest phoenix
#

not everything

sacred mountain
#

Can someone help me

earnest phoenix
#

explain the problem

sacred mountain
#

I made a ping command but when I run it, it just says NaN

earnest phoenix
#

send the command

sacred mountain
#

One sec

#
        case 'ping':
            //message.channel.send('pong!');
            //console.log(message.member + ' USED \'ping\' PROMPT')
            //break;
            ping_msg = message.channel.send(`πŸ“ Pinging...`)

            message.channel.send(`πŸ“ Pong!\nLatency is ${Math.floor(ping_msg.createdAt - message.createdAt)}ms\nAPI Latency is ${Math.round(bot.ping)}ms`);
            break;```
quartz kindle
#

@earnest phoenix are you using tables? if not, you should

earnest phoenix
#

i am

sacred mountain
#

Someone plz help me

quartz kindle
#

@earnest phoenix then you can delete the entire table. not sure if quickdb has a method for that, if it doesnt, you can load the sqlite file in a database viewer, and delete the table from there

earnest phoenix
#

idk how, im trying to reset the entire specific server coins

#

for all users in this server

sacred mountain
#

Can someone help me

spare goblet
#

@high bough that looks like callback hell uwot_confused

high bough
#

Yes

#

It seems so.

spare goblet
#

you should promisify some of those callbacks

#

it's almost impossible to read that code ngl

high bough
sacred mountain
#

Can someone help me

high bough
#

it's almost impossible to read that code ngl
@spare goblet Sorta

spare goblet
#

Can you stop asking for help @sacred mountain

#

someone will help you when they can.

#

please be PATIENT.

high bough
#

you should promisify some of those callbacks
@spare goblet I don't know how to do that well.

spare goblet
#

const { promisify } = require('utils');
const newFunction = promisify(oldFunction);

#

i think

#

idk

#

Or you can just promisify it the normal way

high bough
#

how?

#

I never tried, really.

quartz kindle
#

@sacred mountain use createdTimestamp, not createdAt

#

timestamp is a number, createdAt is a string, you cant do math on strings

earnest phoenix
#

Tim, is there a way to delete the coins from a specific server?

spare goblet
#

const newFunction = new Promise(resolve, reject){
something(something, (body, error){
if(!error){
resolve(body)
}
}
}

#

or something like that idk

high bough
#

Umm, okay, lemme see.

spare goblet
#

then you can just do
const thing = await newFunction(thingy)

sacred mountain
#

@quartz kindle nope

#

Still not working

quartz kindle
#

@earnest phoenix either edit the file in an sqlite viewer or do what others said, load all entries from the table, edit them all, and save them again one by one

#

@sacred mountain then you did something wrong

sacred mountain
#
            //message.channel.send('pong!');
            //console.log(message.member + ' USED \'ping\' PROMPT')
            //break;
            ping_msg = message.channel.send(`πŸ“ Pinging...`)

            message.channel.send(`πŸ“ Pong!\nLatency is ${Math.floor(ping_msg.createdTimestamp - message.createdTimestamp)}ms\nAPI Latency is ${Math.round(bot.ping)}ms`);
            break;```
earnest phoenix
#

i have no idea how to view and delete it

#

is there an editor ?

spare goblet
#

you can view it with an sqlite editor

#

google it

earnest phoenix
#

kk

quartz kindle
#

@sacred mountain ping_msg = await message.channel.send()

spare goblet
#

if you're more capable with sql syntax you can also run that

sacred mountain
#

@quartz kindle I thought u can only do that in a certain function

quartz kindle
#

yes you need an async function

sacred mountain
#

How

quartz kindle
#

add the async keyword to your event function

sacred mountain
#

How would I do that

#

Umm

spare goblet
sacred mountain
#

I’m not very good at this

quartz kindle
#

client.on("message", async message => {

high bough
#

Yeah

#

It's common to use async message instead of just message

#

Even if you don't need it, it helps

spare goblet
#

async is nice to make your code cleaner

high bough
#

<Spoonfeeding is not allowed. 😦>

sacred mountain
#

Yesss

#

It’s working

#

πŸ‘πŸ‘

#

Thanks @quartz kindle and @high bough

high bough
#

No probs

earnest phoenix
#
if(command === "reset") {
  let allusers = await message.guild.fetchMembers()
  allusers.forEach(user => coins.set(`${message.guild.id}.${user.id}`, 0))
}```
idek what im doing
sacred mountain
#

Oh no

earnest phoenix
#

how does foreach work

sacred mountain
#

It’s not working

#

@quartz kindle the first bit works now

#

But not the second

spare goblet
#

you can literally google that

earnest phoenix
#

i tried i cant find anything lmao

spare goblet
#

it executes things for each element of an array

#

are you serious

#

first thing is that

earnest phoenix
#

wh-

high bough
#

@quartz kindle
@sacred mountain Hold on a sec

spare goblet
#

you're either blind or you didn't google it

earnest phoenix
#

LMAO

spare goblet
earnest phoenix
#

i looked for forEach js

#

or discord.js

sacred mountain
slender thistle
sacred mountain
#

So I fixed the first one

#

But not second

spare goblet
#

foreach is not just a discordjs thing

#

:')

#

its a native js thing

quartz kindle
#

@sacred mountain if you're using discord.js v12, then its bot.ws.ping

sacred mountain
#

How do I know which version I’m on

high bough
#

<Spoonfeeding is not allowed. 😦>

quartz kindle
#

do npm ls discord.js in your terminal/command line

sacred mountain
#

K

high bough
#

Prob v12

#

It's the only reason

sacred mountain
#

It’s working now

#

Also one other thing

#

Is there a way to edit the initial message instead of writing a new one

high bough
#

Yes

#

A sec

quartz kindle
#

ping_msg.edit()

sacred mountain
#

I tired it

quartz kindle
#

you tried before you awaited it

#

now that its awaited, it should work

sacred mountain
#

Oh

high bough
#

<Spoonfeeding is not allowed. 😦>

sacred mountain
#

Yessssss

#

Thanks again

high bough
#

No probs

earnest phoenix
#

in sql is it possible to push an element into an existing array, something like this? APPEND arrayTable SET array= "new_element" WHERE id="id"

sacred mountain
#

@high bough I hav another problem

high bough
#

What?

sacred mountain
#

I hav another function which doesn’t work

high bough
#

Which function?

sacred mountain
#

A user info function

#

Should I send code?

high bough
#

Sure

#

DM

sacred mountain
#

K

feral fiber
#

This is considered a privacy breach right? ( Top 10 Guilds )

1. 100 Members - Guild Name
2. 99 Members - Guild Name
3. 98 Members - Guild Name
4. 97 Members - Guild Name
5. 96 Members - Guild Name
6. 95 Members - Guild Name
7. 94 Members - Guild Name
8. 93 Members - Guild Name
9. 92 Members - Guild Name
10. 91 Members - Guild Name
earnest phoenix
#

i've heard both

#

ppl saying it is and isn't

elder vine
#

yes

finite bough
#

yes

summer acorn
#

@feral fiber Must be opt-in and opt-out, or else it's a privacy breach

finite bough
#

@feral fiber add a toggle leaderboard cmd so guilds can turn their ranking on and off

#

as many servers like it, but on the other hand some do not

summer acorn
#

as long as they can get out of it whenever, it should be fine.

feral fiber
#

So if its just that with no settings, privacy breach?

summer acorn
#

and of course, no hard process to get out of it

finite bough
#

violets discord bot terms and services

summer acorn
#

if it's impossible for them to opt out, it's a privacy breach.

feral fiber
#

πŸ‘

earnest phoenix
#

i always seems to hear a different answer every time i or someone else ask about πŸ€”

finite bough
#

if you have a private server

#

suppose a private school educational server

#

its name shouldnt be leaked

feral fiber
#

Exactly

earnest phoenix
#

logically yes, but idunno if discord has a tos paragraph that states all servers are seen as public to everyone

#

like i don't feel like i breached the user "Light"'s privacy by posting that conversation since it happened in a public text channel

slender thistle
#

Server names should fall under End User Data

vital cove
#

Hq quiz

quartz kindle
#

i dont think discord will ban your bot for showing a top 10 list, but morally speaking, the right thing to do is not to have features that expose potentially private information

#

so if anything, think about the moral/ethic aspect of it and not strictly the TOS aspect

#

you want your bot users to trust you

#

how you handle their data is a big part of that trust

earnest phoenix
#

would you say it's unmoral for moderation bots to log deleted messages?

#

if "unmoral" is the correct word

quartz kindle
#

no because that falls within the server's ownership of content posted there, however, the correct thing to do is to state that conversations may be logged for moderation purposes in the server's rules/information, and users should read it and comply to it

#

the correct word is immoral

#

if you wanna go further, then the server should also explicitly inform users that any message they post will be considered owned by the server

earnest phoenix
#

funny you said that, was about to ask

quartz kindle
#

although all of this is kinda implied by discord's structure, in how the moderation can delete people's content at will, which implies the server owns the content or the rights to display it

earnest phoenix
#

"does that mean servers own the messages posted by the users"

quartz kindle
#

so essentially, user owns the content, user wants to post the content in server, user must agree to server rules to have their content posted there, among those rules is that the server may monitor their content for moderation purposes

earnest phoenix
#

does that mean users delete the guild's content when they delete " their own" messages

quartz kindle
#

discord gives users the ability to do that, so they do retain some ownership of it

#

i guess it would be similar to the relationship between a creator and publisher

high bough
#

I mean, i log every single user and server, but limit it to owner only, violation?

earnest phoenix
#

do your users know that?

high bough
#

Yes

#

But i hide it

#

Only i can use it

#

I suppose the barely know about it

sacred mountain
#

Hello

#

I have a big problem

earnest phoenix
#

lmao

#

explain

sacred mountain
#

Most of my functions are broken

#

i think i worked out something

#

when i run info it then just does the function below it then the one below that

#

Ok I fixed it

#

But I have another problem

#

Apparently I don’t have the permission MANAGE_MESSAGES in my own server

high bough
#

Misspell?

sacred mountain
#
            if(!message.member.hasPermission('MANAGE_MESSAGES')){```
earnest phoenix
#

anyone have experience with using mysql as a db?

sacred mountain
#

Oh wait @high bough nvm

#

I just realised I did !

#

Now I know why anyone without the permission could do it but not me...

high bough
#

-_- I see.

#

The ! Was annoying, wasn't it.

sacred mountain
#

Yh

#

Also I hav another problem with the function

#

Apparently I’m not specifying args[1]

#
                else{```
#

let args = message.content.substring(prefix.length).split(" ")

high bough
#

Hmm...

#

Also, everyone, can anyone help me what I missed in my sharding? Or is it correct?

#

Ah, I forgot the spoilers again.

sacred mountain
#

I would help u but I hav no idea

#

I’m pretty useless with js

#

But do u know how I can fix my code?

quartz kindle
#

show full code

sacred mountain
#

me or her?

quartz kindle
#

you

sacred mountain
#

oh

balmy knoll
#

Hey. How can I wait for the code to continue only after the forEach has finished? [discord.js]

            if (item.type == 'voice') { var channel = item; }
            if (item.type == 'text') { var ctext = item; }
          });```
sacred mountain
#

what full code for that function?

quartz kindle
#

yes

sacred mountain
#
            if(message.member.hasPermission('MANAGE_MESSAGES')){
                if(!args[1]) return message.reply('Please specify how many messages')
                else{
                    message.reply('Are you sure you want to delete ' + args[1] + ' messages? (Y/N)')
                    bot.on('message', message=>{
                        if(message.content === 'Y'){
                            message.channel.bulkDelete(args[1])
                            console.log(message.member + ' CLEANED ' + args[1] + ' MESSAGES')
                            message.reply('Successfully deleted ' + args[1] + ' messages!')}

                        if(message.content == 'N'){
                            message.reply('The action has been cancelled!')
                            console.log(message.member + ' CANCELLED AN ACTION OF CLEANING ' + args[1] + ' MESSAGES')}
                    
                    }
                        )
                
                


                            }
            
                    }
            else{
                message.reply('You must have the Manage Messages permission in order to use the clean prompt')
                console.log(message.member + 'FAILED TO USE CLEAN PROMPT DUE TO PERMISSIONS')}    
                break;        ```
quartz kindle
#

@balmy knoll forEach is sync code, sync code is always done in the same order as you write it, so anything you write below the forEach block will only run after the entire forEach finishes

#

@sacred mountain are you getting "please specify how many messages"?

sacred mountain
#

i was

#

but i fixed that bit

#

now its broken differentlu

quartz kindle
#

then what is the problem?

balmy knoll
#

@quartz kindle Ok, but i got this error: ctext is not defined

sacred mountain
quartz kindle
#

ctext will only be defined inside the forEach block

#

whatever you're trying to do, you're probably doing it wrong and forEach may not be the best solution

sacred mountain
#

This is the updated code for my thing which doesnt work:

#
            if(message.member.hasPermission('MANAGE_MESSAGES')){
                if(!command[1]) return message.reply('Please specify how many messages')
                else{
                    message.reply('Are you sure you want to delete ' + command[1] + ' messages? (Y/N)')
                    bot.on('message', message=>{
                        if(message.content === 'Y'){
                            message.channel.bulkDelete(command[1])
                            console.log(message.member + ' CLEANED ' + command[1] + ' MESSAGES')
                            message.reply('Successfully deleted ' + command[1] + ' messages!')}

                        if(message.content == 'N'){
                            message.reply('The action has been cancelled!')
                            console.log(message.member + ' CANCELLED AN ACTION OF CLEANING ' + command[1] + ' MESSAGES')}
                    
                    }
                        )
                
                


                            }
            
                    }
            else{
                message.reply('You must have the Manage Messages permission in order to use the clean prompt')
                console.log(message.member + 'FAILED TO USE CLEAN PROMPT DUE TO PERMISSIONS')}    
                break;   ```
quartz kindle
#

thats not how you wait for messages, that will destroy your bot

balmy knoll
#

@quartz kindle In practice, having the id of a category (it includes a textual and a vocal channel), I take all its children channels and save them. I will also need these children channels after the forEach.

quartz kindle
#

@balmy knoll forEach executes a function for each element in the list. if you have a list [1,2,3,4,5] and you do .forEach(item => { var b = item }) then b will become 5 because on every loop it will overwrite the previous value

#

what do you need them for? what do you want to do to them?

sacred mountain
#

@quartz kindle i deleted the bit saying on 'message' but now i hav 14 errors

quartz kindle
#

show code

sacred mountain
#
            if(message.member.hasPermission('MANAGE_MESSAGES')){
                if(!command[1]) return message.reply('Please specify how many messages')
                else{
                    message.reply('Are you sure you want to delete ' + command[1] + ' messages? (Y/N)')
                        if(message.content === 'Y'){
                            message.channel.bulkDelete(command[1])
                            console.log(message.member + ' CLEANED ' + command[1] + ' MESSAGES')
                            message.reply('Successfully deleted ' + command[1] + ' messages!')}

                        if(message.content == 'N'){
                            message.reply('The action has been cancelled!')
                            console.log(message.member + ' CANCELLED AN ACTION OF CLEANING ' + command[1] + ' MESSAGES')}
                    
                        
                        )
                
                        


                        }
            
                    
            else{
                message.reply('You must have the Manage Messages permission in order to use the clean prompt')
                console.log(message.member + 'FAILED TO USE CLEAN PROMPT DUE TO PERMISSIONS')}    
                break; ```
balmy knoll
#

Ok, but .. the forEach will find only two items (one voice and one textual), which through the if, I insert in the correct variable

quartz kindle
#

@balmy knoll userCategory.children only contains 1 voice channel and 1 text channel?

balmy knoll
#

@quartz kindle yes, alway in my case

quartz kindle
#

alright then do it like this:

#
let channel;
let textchannel;
....forEach(item => {
  if(item.type === "text") { textchannel = item }
  else if(item.type === "voice") { channel = item }
})```
sacred mountain
#

i did

#

now i hav 16 errors

quartz kindle
#

then show code

#

idk what else you changed

balmy knoll
#

@quartz kindle Thanks, now works

valid holly
#

Shouldn't you await the "Y" ?

quartz kindle
#

we'll get there later

balmy knoll
#

But i have another problem πŸ˜„

valid holly
#

Like this it would try to bulkDelete every Y

quartz kindle
#

it will never even get there

sacred mountain
#

i messed around with the } and ) and now i hav no errors

valid holly
#

Oh soz then mb

sacred mountain
#

i will send code

#
            if(message.member.hasPermission('MANAGE_MESSAGES')){
                if(!command[1]) return message.reply('Please specify how many messages')
                else{
                    message.reply('Are you sure you want to delete ' + command[1] + ' messages? (Y/N)')

                        if(message.content === 'Y'){
                            message.channel.bulkDelete(command[1])
                            console.log(message.member + ' CLEANED ' + command[1] + ' MESSAGES')
                            message.reply('Successfully deleted ' + command[1] + ' messages!')}

                        if(message.content == 'N'){
                            message.reply('The action has been cancelled!')
                            console.log(message.member + ' CANCELLED AN ACTION OF CLEANING ' + command[1] + ' MESSAGES')}
                    
                    }
                        
                
                


                            
            
                    
            }else{
                message.reply('You must have the Manage Messages permission in order to use the clean prompt')
                console.log(message.member + 'FAILED TO USE CLEAN PROMPT DUE TO PERMISSIONS')}    
                break;  ```
#

if i cant fix that i would want to make it so that it adds a tick and cross reaction on the message

#

then u click the one u want

#

but idk how to do that

balmy knoll
#

In my bot, I'm using a mySQL database. I want to make sure that the bot is always connected to it to avoid having it connected whenever I need it, but I get this error: Connection lost: The server closed the connection. Why?

quartz kindle
#

@sacred mountain afterwards please read this

spare goblet
#

@balmy knoll it could be because you didn't make any queries and the server ended the connection cuz of it being extensively idle?

sacred mountain
#

@quartz kindle is there any way i could change it to the thing i said above bc it would look nicer

valid holly
#

Could be because of the port you used for the connection

spare goblet
#

Are you using a pool?

sacred mountain
#

"if i cant fix that i would want to make it so that it adds a tick and cross reaction on the message
then u click the one u want
but idk how to do that" @quartz kindle

quartz kindle
spare goblet
#

you could be getting an error, then it's getting closed; you should use a pool if that's the case

sacred mountain
#

@quartz kindle i really dont understand that at all

balmy knoll
#

@spare goblet Yes most likely it is due to inactivity. But this depends on the database server, right?

spare goblet
#

If it's inactive then the connect will close itself

quartz kindle
#

@balmy knoll you can use a connection manager/pooling library

spare goblet
#

you should use a pool

quartz kindle
#

there are many libraries that do that for mysql

balmy knoll
#

I am inexperienced with these things. It is my first time that I use mySQL. What should I do?

sacred mountain
#

@quartz kindle can we go dm bc this is very confusing

spare goblet
#

What are you using rn to access your mysql db?

quartz kindle
#

search npm for a library that does what you need

balmy knoll
#

I could also let you give me this error, since the bot reconnects to the database immediately after the error. But I would like to avoid that in those few seconds of reconnection, some commands may not be executed

valid holly
#

@sacred mountain react with the emoji's then create a collector for the emojis and await for user input, that's basically the idea.
awaitReactions passes a function and options as Tim mentioned.
Use it to wait for reactions over a period then use the callback from the function

quartz kindle
balmy knoll
#

@spare goblet Do you mean which library I use to access the bot to the database?

spare goblet
#

yeah

balmy knoll
#

mysql and util

spare goblet
#

one sec

#

I personally use mysql2 actually

#

it just seemed more updated and stuff

#

but that should work

sacred mountain
#

ok i dont understand that thing Tim sent me at all so i will just give up on that feature

balmy knoll
#

@spare goblet Ok thanks. So should I create a new connection and change all connection.query?

spare goblet
#

I'm not sure, you should probably check the docs I sent you

#

You get the connection from the pool, then query it using that

balmy knoll
#

I try it now

golden condor
#

On mongoose, is there anyway to tell the database latency?

high bough
#

Idk

trim nexus
#

try console.time or performance.now

#

there's probably something built-in tho

mossy vine
#

performance.now is way more accurate

vagrant tide
#

Is there a way I can get my bot to run continuously, even if I close the terminal

#

?

trim nexus
#

library?

vagrant tide
#

I'm using discord.js

#

I tried using forever, but it would stop instantly

earnest phoenix
#

where do you run your bot?

#

pc ?
website ?

vagrant tide
#

PC

earnest phoenix
#

oh
no idea then

trim nexus
#

pm2

vagrant tide
#

Thanks

trim nexus
#

and keep your pc always open

#

or use docker

mossy vine
trim nexus
#

which also includes having to keep your pc open

neat mulch
#

how to make that when someone will ping bot it will reply with prefix

earnest phoenix
#

@neat mulch if you're using discord.js v11 then this should work

#

idk about v12

#
if (message.isMentioned(client.user)) {
message.channel.send("your prefix")
}```
neat mulch
#

this didnt work for me if (message.isMemberMentioned(_client.user)) { message.reply(`Hi my prefix for this server is **${prefix}**. Try to use **${prefix}help** command`) }

earnest phoenix
#

v11 or v12?

neat mulch
#

"discord.js": "^11.6.2",
and "node": "10.x"

earnest phoenix
#
message.reply(`Hi my prefix for this server is **${prefix}**. Try to use **${prefix}help** command`)
}```
#

try this

#

worked for me before

neat mulch
#

help menu like this

#

with reactions

#
   message.reply(`Hi my prefix for this server is **${prefix}**. Try to use **${prefix}help** command`)
   }``` didint work for me too
#

@earnest phoenix

nocturne dagger
#

Random question. if I was making a embed how to I have 2 fields next to each other instead of ontop o feach other

#

discord.js

#

They have

User Mod

Reason

#

I have User
Mod
Reason

sudden geyser
#

@nocturne dagger use the inline field for the first two.

neat mulch
#

yes

#

.addField("", "", true)

sudden geyser
#

Though you can't do something like this because of the update they did with it: field field field field <-- You could do this before

#

I just like sending the raw embed object instead of using the messageembed class

nocturne dagger
#

ok

#

thanks

topaz sphinx
#

can i yoink in here

#

ill take it as a 'ted was typing something' and now is quiet due to it feels weird to respond to what i was typing

#

anyhow ASTomatoSmug

nocturne dagger
#

or general.

topaz sphinx
#

nono i actually have a question

#
reset_timeout := format('SELECT %I_refresh 
    FROM users.ratelimits 
    WHERE user_id = $2'
        , $1);

this is the wrong format to do in PostgreSQL 11, however i wonder what would be the correct format to write this kind of statement

#

just adding EXECUTE in front of the format gives error

earnest phoenix
#

i can’t download quick.db on linux

#
npm ERR! errno 1
npm ERR! integer@3.0.1 install: `prebuild-install || npm run build-release`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the integer@3.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-04-18T14_17_17_755Z-debug.log```
#

(debian 9)

static sable
#

what's the log in /root/.npm/_logs/2020-04-18T14_17_17_755Z-debug.log ?

earnest phoenix
#
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', '$2 info using npm@6.14.4
3 info using node@v13.13.0
4 verbose run-script [ 'prebuild-release', 'build-$5 info lifecycle integer@3.0.1~prebuild-release: i$6 info lifecycle integer@3.0.1~build-release: inte$7 verbose lifecycle integer@3.0.1~build-release: u$8 verbose lifecycle integer@3.0.1~build-release: P$9 verbose lifecycle integer@3.0.1~build-release: C$10 silly lifecycle integer@3.0.1~build-release: Ar$11 silly lifecycle integer@3.0.1~build-release: Re$12 info lifecycle integer@3.0.1~build-release: Fai$13 verbose stack Error: integer@3.0.1 build-releas$13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> ($13 verbose stack     at EventEmitter.emit (events.$13 verbose stack     at ChildProcess.<anonymous> ($13 verbose stack     at ChildProcess.emit (events.$13 verbose stack     at maybeClose (internal/child$13 verbose stack     at Process.ChildProcess._hand$14 verbose pkgid integer@3.0.1``` @static sable
#

who can help me?

coarse topaz
#

You will have to wait until a reply from a person with the required knowledge...

#

Β―_(ツ)_/Β―

sudden geyser
#

Vinx may I ask if you're using a host like glitch.com

prime cliff
#

^ also try npm install <package> --unsafe-perm

sudden geyser
#

@earnest phoenix (since you're offline)

earnest phoenix
#

already test @sudden geyser

#

and same error

sudden geyser
#

what

earnest phoenix
#

uh sorry, im not use glitch lol

#

and @prime cliff already test

#

and same error

white glade
#

Hello guys i have one question at begining
i want to build simple responding bot
im not much into programming but i know how to edit code

is there any solution like database or somethign helpfull to inserts new commands and responds or i must do it in one .js file in notepad

mossy vine
#

yeah you can use a database but bots like mee6 can also be set up to have autoresponses

coarse topaz
#

What API are you using? @white glade

white glade
#

becouse for few comand its simple to edit my index.js file but i want build 100 respond IF/else in future

mossy vine
#

???????,,

white glade
#

api api hmm im using node_modules and discrod.js im think

#

mee6 have limited responder if i remember

coarse topaz
#

Ok...
Then you don't want to make 1000 code lines but want to add 100 responds commands?

white glade
#

yes i understand this need much more code lines

tulip wave
#

custom responses wouldn't take too many lines of code only if they are text based responses

white glade
#

but i think something about similar to html input forms

tulip wave
#

that being said its only a few lines of code if you make it dynamic and not hardcoded responses

white glade
#

meybe its about my IDE πŸ€”
basic windows notepad isnt convenient for editing

#

in html

#

and do something magic to put form input to my bot js code

earnest phoenix
#

it's more complicated than you think it is

rare tangle
#

Hi, how can I detect which command using most memory?

prime cliff
#

Blob_Sweat that's not how memory works

rare tangle
#

I mean I have a simple bot but it keep exceeding 256 MB, something must be causing that

prime cliff
#

What lib are you using?

rare tangle
#

js

earnest phoenix
#

thats a language

rare tangle
#

what do you mean by lib?

prime cliff
#

The lib you use to connect to Discord e.g. discord.js

rare tangle
#

I use discord.js

prime cliff
#

discord.js tends to hog ram a lot which is the case and if your bot gets into like 1,000 servers you will need more ram

#

You can disable events and use v12 with gateway intents to solve that though

rare tangle
#

How effective it'd be?

prime cliff
#

I don't really use d.js but gateway intents means you have to specify what events your bot gets on startup so that it uses less data/cpu/ram and less objects cached

rare tangle
#

Okay I'll search for that thank you a lot!

cinder patio
#

Afaik objects still get cached, just not updated πŸ™ƒ

prime cliff
#

Depends what events you use and if you have all members option enabled

heavy marsh
#

In discord.js v11.4.8 - I am trying to give roles or remove roles for staff members from the staff server from getting the roles from the main server.

This is my code https://hasteb.in/isalirex.js
But no errors and no roles are give on the staff server

quartz kindle
#

you need to add them to the target guild member, not the current guild member

prime cliff
#

Your bot can only give roles that are below the bots current role too

  • Admin Role ❌ bot can not give
  • Your Bot Role ❌ bot can not give
  • Mod Role Tick bot can give
quartz kindle
#

ie: guildA = main server
guildA.member() = member in guild A
member.addRole = add role to member in guild A

#

so you need guildB.member() to get the guild B member object

#

or member = message.guild.member()

heavy marsh
#

ooh

#

How about the roles then?

quartz kindle
#

wait, what is target?

heavy marsh
#
let target = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[1]));
quartz kindle
#

ah then its correct

heavy marsh
#

this is the full code

#

But roles are not given on the staff server

quartz kindle
#

console.log(rolesToAdd,rolesToRemove)

heavy marsh
#
[
'700443253404729355',
'700444761118736464',
'700444846074101800',
'700446107393851393',
'700447750805913610',
'700448718414938173'
] [
'700443648503840888',
'700443878796427274',
'700444922209239090',
'700445213520560209',
'700445306147307554',
'700445368084725841',
'700445558170583162',
'700445875377274931',
'700446032378593422',
'700448079647604859',
'700448242315296889',
'700448297374056549'
neat mulch
#

how to make that when someone will ping bot it will reply with prefix

quartz kindle
#

and you didnt get any error?

heavy marsh
#

nope

quartz kindle
#

try target.addRoles().catch(console.log)

#

same for removeRoles

#

@neat mulch check if message starts with the bot mention

#

mentions look like this <@!BOTID>

neat mulch
#

I tryed

quartz kindle
#

show code

quartz kindle
#

not enough code

heavy marsh
#

@quartz kindle Ahhh it gave me the roles now

quartz kindle
#

what language/library is that?

neat mulch
#

Discord.js

heavy marsh
#

But it send the same message 2 times

quartz kindle
#

@neat mulch you named your client as _client?

heavy marsh
#

Ok nvm not it works

neat mulch
#

Yes

heavy marsh
#

But why didnt it work before?

#

with out the catch?

valid holly
#

Quick question, how does the AFK system work in a server ?

#

Who moves the users to the afk channel and if for example I have an afk channel with CONNECT permission denied, can they still be moved there ?

#

Reason to this is, I don't want normal users to join the AFK channel, just the actual AFK people to be automatically moved.

nova jay
#

um if a person joins the afk vc they are muted so I don't see a reason for that

earnest phoenix
#

anyone know how to make a error 404 page?

quartz kindle
#

@neat mulch then you're gonna need to show more code

#

also state your discord.js version

nova jay
#

@valid holly

quartz kindle
#

@earnest phoenix what webserver?

earnest phoenix
quartz kindle
#

express.js?

earnest phoenix
#

um.. index.html

quartz kindle
#

@heavy marsh honestly no idea lol

heavy marsh
#

Shmm

#

ooh ok

earnest phoenix
#

@quartz kindle I use HTML, CSS and JS - host my website on glitch.com

quartz kindle
#

@earnest phoenix it seems like glitch does not support custom error pages by itself, you need a webserver to make them

earnest phoenix
#

oof

quartz kindle
#

express.js is a javascript webserver commonly used in glitch projects

earnest phoenix
#

wait so

#

i cant use terminal to let my website host, cuz im on chromebook

#

so.. should i use github instead?

quartz kindle
#

wdym?

earnest phoenix
#

instead of glitch, can i just put my website on github

#

and..

#

you know how you use terminal for node bot.js

#

can i do that with my website

#

well i cant cuz im on chromebook

#

oh @quartz kindle

valid holly
#

Thing is I asked if it's either possible or not.

#

So is it or not ?

#

@nova jay

nova jay
#

um idk

quartz kindle
#

@valid holly try it and see

#

discord manages that part, not bots

wise quartz
#

How do i make the bot send a custom emoji?

#

The bot is in the server with the emoji and i have the emoji id and everything

earnest phoenix
#

Get the emoji by its id i think

wise quartz
#

I tried <:emoji_name:emoji id>

#

Didn't work

earnest phoenix
#

Message.guild.emojis.get("id")
Maybe

wise quartz
#

I tried <:emoji_name:emoji id>

earnest phoenix
#

Just use what i told you

wise quartz
#

Emoji = await ctx.guild.emoji.get("id")?

earnest phoenix
#

Probably

wise quartz
#

Aha lets try...

valid holly
#

emojis is a collection, get() a function for a collection.

#

guild.emojis.cache.get("ID") if v12

earnest phoenix
#

^

valid holly
#

.cache returns a collection, simply calling emojis will return null

earnest phoenix
#

If he is on v11, he can use what i told him

valid holly
#

Well yeah.

wise quartz
#

so emoji = await ctx.guild.emojis.cache.get("id") awaut ctx.send(f"{emoji}")

#

?

#

Imma try dat

valid holly
#

ctx.send(f"{emoji}" wtf is this

earnest phoenix
#

Same
Wth

#

Why f
And what is ctx

valid holly
#

Prolly a variable

earnest phoenix
#

Prob

wise quartz
#

Owh wait...

#

I didn't specify i need python

#

Ur probably talking about

#

Js

#

Right?

earnest phoenix
#

LMAO

#

Idk py

valid holly
#

You can call the object or use template literals.

#

Yeah sorry not so good with py

wise quartz
#

ctx = context its the first argument of commands on oython

#

Python*

#

Xd

#

Its alr imma wait someone that understand py to help me

#

Ty for trying
.

#

[Q] How do i make the bot send a custom emoji ? (Python) (i have the emoji id) (i tried <:emoji name:emoji id>) but didn't work.

restive furnace
#

if its animated context is <a:emoji name:emoji id:>

wise quartz
#

Its not

#

Animated

restive furnace
#

Okay, but do :emojiname:

#

wait

#

\:emojiname:

wise quartz
#

Ok

#

Imma trt

#

Try*

sudden geyser
#

What exactly are you sending (the entire custom emoji string)?

wise quartz
#

I have a server-info commands and i need that emoji to show the memebrs status

#

On the server members field

#

These ^^^

#

Status emojis

#

The message is embeded btw

#

So they'll be inside that embed

stable nimbus
#

I'm creating something with my bot that would require it to keep track of something, but its literally one thing, with my bot being developed for GTAV and RDR2 RP, I'm working on the GTAV side with a BAC commands so I can use a breathalyzer command, where the bot looks to see what said users BAC is that they set and the bot returns after a few seconds with a specific number. I'm not 100% sure how to do this and I would like some help.

digital ibex
#

use an api

#

or create 1

wise quartz
#

Like this ^

digital ibex
#

just

sudden geyser
#

Yeah so are you sending it exactly how they're displayed (e.g., angeryBOYE -> !angeryBOYE)

digital ibex
#

\:emojiname:

#

and copy and paste that

wise quartz
#

Dude i did it...

#

Didn't work

digital ibex
wise quartz
#

Lemme try

digital ibex
#

u didn't do it right

wise quartz
#

Dude i can't beleive myself....

#

I placed the other way slash

#

...

#

Lol

sudden geyser
#

yeah

#

so it works now

#

correct

wise quartz
#

No?

#

Is there something wrong with me wtf?

#

I thought i'd work

digital ibex
wise quartz
#

Unfortunally didn't...

digital ibex
#

how r u doing it?

sudden geyser
#

can you show how you're passing it in your code

wise quartz
#

Sure sec

#

embed.add_field(name= f"Server members: [{member_count}]", value= f"<\:TM_discord_online:697508180170768454> - {online} \n<\:TM_discord_invisible:697508210889719829> - {offline}")

sudden geyser
#

remove the \

digital ibex
#

um

#

yeah

wise quartz
#

I tried didn't qork

digital ibex
#

<\:TM_discord_online:697508180170768454> wrong

wise quartz
#

???.

digital ibex
#

<:emotename:emoteid>

#

wait

wise quartz
#

Ok i did that aswell

#

But

digital ibex
#

no u didn't

wise quartz
#

Didn't work

#

YES I DID I SWEAR

#

Tf

digital ibex
#

ok

#

u saved?

wise quartz
#

That was the original thing i tried

#

Then i asked here

#

Lemme do it again for u

#

...

#

See

#

This is the results

#

Without the slash

#

With the slash the emoji shows how its in the code

digital ibex
#
embed.add_field(name= f"Server members: [{member_count}]", value= f":TM_discord_online: - {online} \n:TM_discord_invisible: - {offline}")
#

use that

wise quartz
#

And yeah my bot is in the server with the emojis

digital ibex
#

is ur bot in the se-

#

ok

#

uh

wise quartz
#

Lol

digital ibex
#

the id is wrong then

wise quartz
#

No?

digital ibex
#

the

#

id

#

of

#

the

#

emote

#

is wrong

wise quartz
#

Lemme show u the emote with its id

digital ibex
wise quartz
#

Its the same

#

Lemme try like u said without the id just name

#

Didn't work

#

:/

earnest phoenix
#

seriously?

wise quartz
#

I am god damn serious

#

Imma get the ids again

#

Bruh

digital ibex
#

its literally so simple

#

i also gave u the code

#

to copy and paste

sudden geyser
#

It's formatted as <:emoji_name:emoji_id> for custom emojis iirc. You're doing something wrong there.

wise quartz
#

Bruh i am doing it correctly i just showed my coee

#

Code*

#

i also gave u the code
@digital ibex i litterally did that... and didn't work

#

I recopied the emojis with their id

#

And did it all over again

digital ibex
#

custom emote

wise quartz
#

I am litterally doing just like that...

digital ibex
#

um

#

well

#

try storing ur emotes in a json called something like emotes.json

#

and then

#
{ 
   "online": ":discord_online:"
}
wise quartz
#

All thats work for a simple emote...? -_-

digital ibex
#

and then import it to ur whatever file

#

and use that

#

then u can change the emote file

earnest phoenix
#

Or just use client.emojis.get('ID')

wise quartz
#

I ain't doing all that just for a simple emote...

#

This us getting way to complex...?

digital ibex
#

lol

#

what

#

oh, u were being serious

#

nvm

earnest phoenix
#

Or just use client.emojis.get('ID')
@earnest phoenix i told him that lik20 mins ago

digital ibex
#

try that way then

frail ocean
#
var emoji = client.emojis.get(ID)

message.channel.send(emoji)```
wise quartz
#

PYTHONNNN

digital ibex
#

he's using py not js

pale vessel
#

v a r

frail ocean
#

ah

#

Just convert it into python

wise quartz
#

Omg i am getting confuzed af

earnest phoenix
#

Oh...

frail ocean
#

Simplest method

wise quartz
#

Why thr hell this ain't workinggg

#

The**

earnest phoenix
#

Whats the difference
Between let var const
Like why does it matter

quartz kindle
#

do you have an eval command?

wise quartz
#

no

quartz kindle
#

have you tried sending the emoji in a non-embed message?

heavy marsh
wise quartz
#

have you tried sending the emoji in a non-embed message?
@quartz kindle imma try that

heavy marsh
#

I got the same problem TIM

digital ibex
#

emotes work are fine for me

#

both with embeds and without it

wise quartz
#

This is on a regular message

quartz kindle
#

@wise quartz does your bot have "use external emojis" permission?

wise quartz
#

It role has the administrator perms only

#

Idk in the channel... lemme see

#

Because its my friend server

#

That might be it tbh

#

Waiting my friend to respond rn...

heavy marsh
#

Your bot must be on that server your using the custome emojis from

quartz kindle
#

@wise quartz you can try checking the permission from within the bot

quartz kindle
#

idk whats the syntax for discord.py, but something like channel.permissionsFor(bot).has("USE_EXTERNAL_EMOJIS")

wise quartz
#

Wait i think i found the prob

valid holly
#

Also does your client have access to the emojis ?

wise quartz
#

Oh my ...

#

I am an actual moran

#

I was using my testing bot while my main bot is the one on the server with the emojis

#

Dude i can't beleive myself rn...

earnest phoenix
#

Oof

#

Thats ok we all have mistakes

wise quartz
#

πŸ˜– i am sorry

hybrid ruin
#

At least you now know

wise quartz
#

πŸ˜”

golden condor
#

Is there any way to access a localhost db from another computer

#

mongo db

rare tangle
#

Hey

#

Dumb question but, do I need express to run my bot?

golden condor
#

No

static sable
#

you just need a discord library

#

in case of javascript I recommend discord.js

pallid marsh
#

how can i check if a voicestate change is a disconnect or connect?

#

discord.js

amber fractal
#

Check the channels

#

if the channel is null on oldState, it's a connect

#

if the channel is null on newState, it's a disconnect

rough musk
#

One message removed from a suspended account.

coarse topaz
#

-ask2ask @rough musk

gilded plankBOT
#

@rough musk

Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

vital cove
#

I need help trivia quiz game

coarse topaz
#

-wrongserver @vital cove

gilded plankBOT
#

@vital cove

Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of our website. If there isn't a button that says Join Support Server, then we can't help you. Sorry :(

topaz sphinx
#

I'm on the search for SQL wizards

#

I come with a great question

earnest phoenix
#

ok

dusky marsh
#

Just ask

topaz sphinx
#
reset_timeout := EXECUTE format('(
        SELECT %I_refresh 
    FROM users.ratelimits 
    WHERE user_id = $2
        )', $1);```

this uncompleted query is giving errors
#

and I wonder

#

what is the correct way to write this kind of query

abstract crow
#

If I'm hosting multiple websites on my Linux Ubuntu server, is it better to manually run the server and then reverse proxy the websites using Apache or is it better to use something like Plesk

fallow quiver
#

I have an issue that has recently come up. It was working fine and has recently stopped. It is supposed to catch the n-word and ect from an array of bad words:

    for(i = 0; i < badWords.length; i++) {
        if(msg.includes(badWords[i])) {
            bad = true;
            word = badWords[i];
            break;
        }else {
            bad = false;
            word = "nullptr";
        }
    }
    if(bad) {
        message.delete(100);
        if(message.author.id == "535499942970785793") {
            console.log("caught " + word);
        }else {
            console.log(`caught ${word} from ${message.author.username}, ${message.author.id}`)
            message.channel.send(`${message.author} BRO! LANGUAGE!`);
        }
        
    }
#

However, now it returns an error that appears to say that something isn't an object? I'm confused because I haven't changed anything.

TypeError [INVALID_TYPE]: Supplied options is not an object.
    at Message.delete (C:\Users\ezj21\OneDrive\Desktop\Utilities\Coding\PeterBot\node_modules\discord.js\src\structures\Message.js:500:44)
    at Client.<anonymous> (C:\Users\ezj21\OneDrive\Desktop\Utilities\Coding\PeterBot\main.js:338:23)
    at Client.emit (events.js:209:13)
    at MessageCreateAction.handle (C:\Users\ezj21\OneDrive\Desktop\Utilities\Coding\PeterBot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\ezj21\OneDrive\Desktop\Utilities\Coding\PeterBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\ezj21\OneDrive\Desktop\Utilities\Coding\PeterBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (C:\Users\ezj21\OneDrive\Desktop\Utilities\Coding\PeterBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:435:22)
    at WebSocketShard.onMessage (C:\Users\ezj21\OneDrive\Desktop\Utilities\Coding\PeterBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
    at WebSocket.onMessage (C:\Users\ezj21\OneDrive\Desktop\Utilities\Coding\PeterBot\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:209:13) {
  [Symbol(code)]: 'INVALID_TYPE'
}

If someone has any idea what is causing this I could really use the help

#

It is within the client.on ("message", (message) and msg = message.content.toLowercase()

earnest phoenix
#

How do I set a default prefix using node.js?

fallow quiver
#

I'm not sure what you mean by that

earnest phoenix
#

Like a prefix for the bot

#

Supposedly "it doesn't have one yet"

fallow quiver
#

Are you using like a JSON to allow different prefixes for different servers

earnest phoenix
#

It's a one a server bot

#

That's not public

#

I'm trying to help my friend

fallow quiver
#

I just did const prefix = 'character here'

earnest phoenix
#

For node.js?

fallow quiver
#

Yeah