#development

1 messages Β· Page 1287 of 1

cobalt spruce
#

so

#

...

rustic nova
cobalt spruce
#

sorry

#

i didnt mean

#

HAHF

#

am out

slender thistle
#

I can still moderate as I'm only on break but I admit I was wrong

#

Didn't see that search query

cobalt spruce
#

ok

rustic nova
#

Mods on break can still backseat mod SureBruh

limpid geode
#

OK, that updates all my public bots. Wonder how long that was broken.

cobalt spruce
#

pogey @rustic nova

forest drift
#

how to i get a users discriminator/hashtag using member.

sonic lodge
#

member.user.discriminator

forest drift
#

thanks

slim forum
#

guys how do i make my bot join a voice room

arctic sable
#

GuildMember.user.discriminator

#

@slim forum 🀷

earnest phoenix
#

hi need help

#

const Discord = require("discord.js");
const client = new Discord.Client();
const prefix = ".";
//required starts

if(cmd === ${prefix} ping )

// It sends the user "Pinging"
message.channel.send("Pinging...").then(m =>{
// The math thingy to calculate the user's ping
var ping = m.createdTimestamp - message.createdTimestamp;

      // Basic embed
        var embed = new Discord.MessageEmbed()
        .setAuthor(Your ping is ${ping})
        .setColor("Your Color")

        // Then It Edits the message with the ping variable embed that you created
        m.edit(embed)
    });
compact oriole
#

this explains nothing :P

earnest phoenix
#

is there any error in the code?

compact oriole
#

what do you need help with

earnest phoenix
#

since it is saying erroe

#

error

compact oriole
#

is there any error in the code?
hard to asume from whitetext

earnest phoenix
#

in line 6

compact oriole
#

also why not sending the error?

earnest phoenix
#

line 6 erroe

#

indentation

#

error

compact oriole
#

...

earnest phoenix
#

pls help

#

i tried many times

compact oriole
#
  1. embed has no real color
  2. cmd === ${prefix} ping not correct
  3. where are the ; ?
  4. use const/let
  5. where is the onMessage
earnest phoenix
#

ok

#

yes now working

#

thanks

thin turret
#

; arent required in javascript

#

thanks to ASI

earnest phoenix
#

k

vale garden
#

hi i need some help

#

i just started hosting my bot on heroku

#

and i know nothing about it

#

so how do i update it when i make any changes in my code

#

it gets updated on my git rep also but the bot isnt still sending the updated version

thin turret
#

Heroku should be connected to the repo

#

Make sure you have the git program on your pc, there's where you commit changes to the master branch

vale garden
#

yea it is connected

#

and i have it as well

#

the bot was working when i connected it initially

#

but when i made a change and updated it it didnt work

opaque seal
#

What do you guys use for premium versions of your bot?
Do you have like a code system where a user gets a code to activate the bot in a server or... idk, what do you use?

silver lintel
#

I believe it's a different bot

#

Just with extra features

opaque seal
#

Yeah Obv

earnest phoenix
#

Y

#

Ya

opaque seal
#

But how do you limit the servers where he can join

earnest phoenix
#

A link

#

Or have to activate the bot in bots dashboard

vale garden
#

someone help plz

compact oriole
#

with what facepalm

silver lintel
#

Is there a way to see how many times a user used a command in a day in djs? Like a collection or something?

upbeat rock
#

hello please top gg new bot html

thin turret
#

?

upbeat rock
#

please

compact oriole
upbeat rock
#

html

compact oriole
#

write LUL

thin turret
#

Oh

upbeat rock
#

tΓΌrkΓ§e bilen yokmu

compact oriole
thin turret
#

html is like the easiest language out there

compact oriole
#

or just use markdown

silver lintel
#

It's just markup

compact oriole
#

yea

thin turret
#

Yos but in general

#

Css as well

compact oriole
#

css is hell

#

well it is easy, but getting css right is hard

earnest phoenix
#

:u

thin turret
#

khe pedo v:

earnest phoenix
#

Hello I would like to know if the bot can register the user's highest permission? It would help a lot to know if it is possible to do this.

faint prism
#

CSS is meh. It has a lot of property names I can't remember half the time

#

But it can do a surprising amount of visual stuff

compact oriole
#

it can

violet mesa
compact oriole
#

css has a lot of depth

kind thicket
#

I feel like everytime someone posts their custom page here I really need to do a better job lmao

compact oriole
#

it also has 3d stuff and other interesting things

faint prism
#

mhm

#

gradients, transitions, etc

compact oriole
#

but making it just what you want is hell

violet mesa
#

discord.py
how do i save a list with json?
help pls

thin turret
#

I was good at css

compact oriole
#

@violet mesa google is invented

thin turret
#

Until i forgot positioning

#

🐸

violet mesa
#

@compact oriole i tried i didnt find an answer

faint prism
#

but making it just what you want is hell
@compact oriole most people just do their stuff with JS nowadays for fancy visuals

compact oriole
#

yea

#

I use Nextjs (React) and I use a lot of js to make my effects

#

or use third party libs

faint prism
earnest phoenix
#

hi

#

I would like to know if the bot can register the user's highest permission?

faint prism
#

@violet mesa but Pickle is a popular module for that as well

earnest phoenix
#

I would like to know if the bot can register the user's highest permission?
in discord.js

faint prism
#

register the user's highest permission
Can you elaborate?

#

What's the behavior you're trying to code?

earnest phoenix
#

I'm doing a userinfo and would like it to look like this: Higher permission: $ {permissions}

#

I read the documentation but didn't quite understand

faint prism
#

Thank you for reading the docs first πŸ™‚ A lot of people don't do that

earnest phoenix
#

Thank you for reading the docs first πŸ™‚ A lot of people don't do that
oh

faint prism
#

I meant that as a compliment

earnest phoenix
#

It is not a role, but permission

#

I meant that as a compliment
ah, ok

earnest phoenix
#

Example:
Highest permission: Administrator

#

oh

#

thank you

silver lintel
#

message.member.roles.higherst

faint prism
#

message.member.roles.higherst
@silver lintel he want's the permission flags

delicate shore
#

Ok so

#

Markdown on website is weird

faint prism
#

When Will i Get my verified badge?
@earnest phoenix Never

#

Sorry

compact oriole
#

omg that name

#

now I wanna unplug my life support

earnest phoenix
#

I got it checked, but I deleted my bot and I'm starting again

compact oriole
#

why do people get cringy names with custom font and long :P

faint prism
#

No fr When do i get verified bot?!
@earnest phoenix On DBL bot verification is +6 weeks

compact oriole
#

server you are on

faint prism
#

l0l

#

||I love their bot that replies when people mention the badge||

compact oriole
#

that server doodoo

earnest phoenix
#

today is halloween?

still merlin
#

Is there a way to detect unicode, emojis or special fonts in a username (in d.js)?

faint prism
#

Probably need a library for that

quartz kindle
#

you can check the character's length

slender thistle
#

Regex?

faint prism
#

Idk about regex

#

That might work for emojis

#

But the other two would be checking for characters outside the standard char codes

#

oh

#

hey, do that

quartz kindle
faint prism
#

check if there are char codes present outside the typical range

still merlin
#

Alright ty

quartz kindle
#

badges are not given anymore afaik

faint prism
#

Bug hunter badges are for people who find bugs

quartz kindle
#

idk about that one

faint prism
#

Is that not obvious...?

earnest phoenix
#

How do i inv Yagpdb.xyz on my dc server?

#

It doesn't show up on discord bot list

quartz kindle
#

go to its website and click invite

#

if your server doesnt show up, you're logged in in the wrong account

#

go to the discord website, logout, and login again

earnest phoenix
#

Okie okie ty

autumn aspen
#

Guys I got A on the P.E when u have a map and find controls also I got C on the latest math test today is that good?

quartz kindle
#

wrong channel?

pale vessel
#

life development

autumn aspen
#

lmao

violet mesa
#
@bot.command()
async def buy(ctx, *, args):
    await open_account(ctx.author)
    
    users = await get_bank_data()

    user = ctx.author
    buyable = ["computer", "sniper", "candy", "fishing poll", "lottery ticket"]
    isbuyable = args not in buyable
    if (isbuyable == False):
        if (args == "sniper"):
            if (users[str(user.id)]["wallet"] >= 1500):
                users[str(user.id)]["backpack"].append('sniper')
                await ctx.send(f"succefully bought {args}") 
        elif (args == "computer"):
            if (users[str(user.id)]["wallet"] >= 10000):
                users[str(user.id)]["backpack"].append('computer')
                await ctx.send(f"succefully bought {args}") 
        elif (args == "fishing poll"):
            if (users[str(user.id)]["wallet"] >= 20000):
                users[str(user.id)]["backpack"].append('fishing poll')
                await ctx.send(f"succefully bought {args}") 
        elif (args == "fortune cookie"):
            if (users[str(user.id)]["wallet"] >= 1000):
                users[str(user.id)]["backpack"].append('fortune cookie')
                await ctx.send(f"succefully bought {args}") 
        elif (args == "candy"):
            if (users[str(user.id)]["wallet"] >= 10):
                users[str(user.id)]["backpack"].append('candy')
                await ctx.send(f"succefully bought {args}")
        elif (args == "lottery ticket"):
            if (users[str(user.id)]["wallet"] >= 200):
                users[str(user.id)]["backpack"].append('lottery ticket')
                await ctx.send(f"succefully bought {args}")

            else:
                await ctx.send("you dont have enough money to purches this item")
    else:
        await ctx.send("this item is not buyable do d!shop to see list of items")


in open_account function
vvvvvvvvvvvvvvvvvvvvv

#

users[str(user.id)]["backpack"] = [None]

#
async def open_account(user):

    users = await get_bank_data()


    

    with open("mainbank.json", "r") as f:
        users = json.load(f)

    if str(user.id) in users:
        return False

    else:
        
        users[str(user.id)] = {}
        users[str(user.id)]["wallet"] = 0
        users[str(user.id)]["bank"] = 0
        users[str(user.id)]["backpack"] = [None]

    with open("mainbank.json", "w") as f:
        json.dump(users,f)
    return True


async def get_bank_data():
    with open("mainbank.json", "r") as f:
        users = json.load(f)

    return users
#

why does this no work

#

and how can i fix

pale vessel
#

were there any error

sudden geyser
#

What doesn't work?

cobalt mural
#

What is this

earnest phoenix
#

What is this
@cobalt mural A refernce to the current object

autumn aspen
#
message.channel.send(embed).then(m => {
                m.react("❌")
              })
            
}     

Yo why does this not work?

#

m is not defined?

#

how

lucid wharf
#
if (message.content === '!react') {
    message.react('πŸ˜„');
}
opaque eagle
#

That code looks fine @autumn aspen

violet mesa
#

i fixed it

earnest phoenix
#

m is not defined?
@autumn aspen because the message was never sent successfully

#

discord.js doesn't care if the message was successfully sent or not

#

so it still returns a promise

#

and executes the callback

#

with no message object passed

#

hence m is not defined

#

lemme test if i was correct

sudden geyser
#

.then will be called if the promise resolved.

#

.catch will be called if the promise is rejected.

#

The .then callback does not look like the root of the error.

#

It would be easy to debug with the stacktrace so it would point to the exact line causing the error.

#

@earnest phoenix for the record, promises are a JS thing. Discord.js wouldn't pass nothing to the resolving promise, and if it did, m would just be set as undefined.

earnest phoenix
#

i just ran his code

#

it doesn't work

#

but there is no error saying m is not defined

sudden geyser
#

Then what was the error you got

#

It looks correct.

earnest phoenix
#

nothing

#

the bot sent a message uwu but the stuff inside .then wasn't executed for some reason

pale vessel
#

are you sure you saved the file and restarted your bot

#

and that the error came from that line of code

sudden geyser
#

Then you probably did something incorrect along those lines code913

#

It's written correctly.

earnest phoenix
#

have they changed read_json ?

Ignoring exception in on_ready
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
    await coro(*args, **kwargs)
  File "OwO.py", line 132, in on_ready
    data = json.load("blacklist")
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/__init__.py", line 293, in load
    return loads(fp.read(),
AttributeError: 'str' object has no attribute 'read'```
sudden geyser
#

fp is a string

#

There's no method called .read() on it to my knowledge.

earnest phoenix
#

I don't get it

#

It's randomly working and not working

#

this is starting to bug the ** out of me...

pale vessel
#

what's blacklist supposed to be?

sudden geyser
#

Then what did you define fp as and what did you expect it to be

earnest phoenix
#

(please ignore the fucked up embed on mobile)

sudden geyser
#

oh wait I think I see

earnest phoenix
#

i foind the error too

#

a random } at the end in the code that he gave

sudden geyser
#

fp comes from python so you're calling it without the correct type

#

causing the error

earnest phoenix
#
message.channel.send(embed).then(m => {
                m.react("❌")
              })
            
}     
#

@pale vessel it's a Json made to Block people in the Blacklist from using the bot..

pale vessel
#

that doesn't look like json

earnest phoenix
#

@pale vessel it's a Json made to Block people in the Blacklist from using the bot..
@earnest phoenix JSON DATABASE AAAAAAAAAAAAAA

sudden geyser
#

isn't the first argument supposed to be a file

autumn aspen
#

lemme test if i was correct
@earnest phoenix dude how do I make it reacts

earnest phoenix
#

yh, SQL dashboard doesn't work on mac, @earnest phoenix.

pale vessel
earnest phoenix
#

@earnest phoenix dude how do I make it reacts
@autumn aspen there is a random closing brace at the end of the code that you gave

#

lemme run it and show you

#

so it's json.load() not read_json() @pale vessel ?

pale vessel
earnest phoenix
#

hm,

pale vessel
#

again, what's blacklist supposed to be?

#

a file?

earnest phoenix
#

json file yes

autumn aspen
#

@earnest phoenix ```js
message.channel.send(embed).then(m => {
m.react("βœ…")
m.react("❌")
})

}

pale vessel
#

what is the filename?

autumn aspen
#

bruh what wrong

earnest phoenix
#

blacklist.json

#

@autumn aspen there is a random } at the end

#

please learn to read what we said

pale vessel
#

you need to open the file first fp = open("blacklist.json") and then you can use json.load(fp)

autumn aspen
#

@autumn aspen there is a random } at the end
@earnest phoenix then I get an error

#

problem in terminal

pale vessel
#

can you send the error?

autumn aspen
#

@pale vessel ```js
module.exports.run = async (client, message, args) => {

the bracket at the end
pale vessel
#

hmm?

#

can you hastebin the file, perhaps?

autumn aspen
#

can you hastebin the file, perhaps?
@pale vessel emm whats that again

pale vessel
autumn aspen
#

@pale vessel check it now

earnest phoenix
#

bruh send the link

autumn aspen
#

bruh send the link
@earnest phoenix how its the same

pale vessel
#

click save, the url should be in the address bar

#

ctrl + s should work

sullen plover
#

hi

#

i need help

autumn aspen
pale vessel
#

hm, nope

boreal iron
#

Weird... sending a client presence update and receiving a Session closed: reason: "Unknown opcode."
3 Presence Update Send Update the client's presence.
Isn't it possible to set the BOTs status anymore?

autumn aspen
#

bruh how

pale vessel
autumn aspen
#

here?

pale vessel
#

the code looks right

autumn aspen
#

yes but it doesnt react

pale vessel
#

are there any errors?

autumn aspen
#

to the embed

#

no

pale vessel
#

did it at least send the embed?

earnest phoenix
#

now when i run the command the bot wont respond but theres 0 errors i wanna smash it to bits

autumn aspen
#

did it at least send the embed?
@pale vessel yes

earnest phoenix
#

ignore the server count part thats because it's not the actual Bot,

autumn aspen
#

cry

earnest phoenix
#

😭

shy turret
#

how do i detect a new server join and who it was invited from

autumn aspen
#

how do i detect a new server join and who it was invited from
@shy turret google it

sudden geyser
#

@boreal iron does it happen any time you send one

shy turret
#

@autumn aspen i did

#

and im too lazy to read docs

boreal iron
#

Yeah

autumn aspen
#

and im too lazy to read docs
@shy turret wll that ur pb

shy turret
earnest phoenix
#

Study the docs like the bible @shy turret

sudden geyser
#

are you using a library

boreal iron
#

Weird, gonna try the API call right now, but it's not documentated

earnest phoenix
#

you won't get no where if you don't πŸ₯²

boreal iron
#

nope I'm not

earnest phoenix
#

@shy turret google it
@autumn aspen says the guy who can't google stuff himself

#

πŸ’€

restive furnace
earnest phoenix
#

don't attack him 😦 @earnest phoenix

#

bruh

#

take deep breaths

#

that's not attacking

boreal iron
#

gonna send an API request to /api/v6/users/@me/settings no docs found

sudden geyser
#

I wouldn't call it attacking. I'd say it's still rude.

boreal iron
#

using the "custom_status"

misty sigil
#

You can’t

earnest phoenix
#

I wouldn't call it attacking. I'd say it's still rude.
@sudden geyser ^^^

sudden geyser
#

bots can't use custom statuses

earnest phoenix
#

they can only have four kinds of statuses

#

playing, streaming, listening and watching

sudden geyser
#

and offline

autumn aspen
#

:X:

#

\❌

earnest phoenix
#

the online/dnd/idle/invisible stuff aren't considered part of actual custom statuses

boreal iron
#

Yeah sending an presence update with OPCode 3 doesn't work for some reason 3 Presence Update Send Update the client's presence.

#

Session closed: reason: "Unknown opcode.

#

weird

earnest phoenix
#

because bots can't set fully customizable custom statuses they can only have playing, listening, streaming and watching

#

lemme show you with my bot

boreal iron
#

yeah I got that, but it doesn't explain the Unknown opcode. response

earnest phoenix
#

ran

c.eval Client.user.setPresence({
    activity: {
         type: "CUSTOM_STATUS",
         name: "uwu"
}
});

the bot status just disappeared until i set it to STREAMING as type

boreal iron
#

Bots are only able to send name, type, and optionally url.

#

aye

#

misread that

earnest phoenix
#

but there is no way you can remove the Playing/Streaming/Listening to/Watching part

#

because discord is gay

hazy sparrow
#

This server has more messages with "fuck" in it that my server with normal messages including "fuck"

pale vessel
#

it's not fully supported yet on bots @earnest phoenix

earnest phoenix
#

This server has more messages with "fuck" in it that my server with normal messages including "fuck"
@hazy sparrow welcome to a 13+ chatting app

hazy sparrow
#

ty

drifting wedge
#

Fuck

pale vessel
#

you

drifting wedge
#

Sorry papa

pale vessel
#

πŸ˜” development

hazy sparrow
#

But how the fuck do you fucking put "fuck" like so many fucking times in 1 fucking message

earnest phoenix
#

But how the fuck do you fucking put "fuck" like so many fucking times in 1 fucking message
@hazy sparrow we type

tepid kestrel
#

G!YardΔ±m

boreal iron
#

{ "op": 3, "d": { "activities": { "name": "some music", "type": 2 } } }

#

"Unknown opcode."

#

well... idk

pale vessel
#

shouldn't the payload be a json (as string)?

boreal iron
#

it is...

pale vessel
#

oh

#

what api version are you using

boreal iron
#

socket.send(JSON.stringify({ "op": 3, "d": { "activities": { "name": "Test", "type": 2 } } }));

#

v6

pale vessel
#

try v8, the latest

boreal iron
#

wut

pale vessel
#

6 is deprecated

boreal iron
#

September 24, 2020 oh missed that

#

lol they switched from 6 to 8 @ sep 24 and I missed that

opal plank
#

stuff should still work in v6

pale vessel
#

yeah, still the default

opal plank
#

deprecated is different from discontinued as you can see

boreal iron
#

yeah but for example opcode 3 is unknown, which means I can't edit the presence

#

need to upgrade I guess

opal plank
#

probably, yeah

earnest phoenix
#

😭

boreal iron
#

"Invalid intent(s)." alright... need to study the docs right now

pale vessel
#

that should just be under the identify payload just invalid, already provided

boreal iron
#

aye, read it will come "in the future"... looks like the future is now

#

πŸ˜…

pale vessel
#

it's close

slender thistle
#

Yeah, October 7th is close

pale vessel
#

5 days more here

sudden geyser
#

@earnest phoenix I think you're supposed to call that on an instance of the class (I think AutoShardedBot is a class).

earnest phoenix
#

@boreal iron wait are you freaking trying to use the API without a wrapper ExcusemeWtf

pale vessel
#

it's not that hard

#

connect to ws and start sending heartbeats

sudden geyser
#

Else it expects the first argument to be the instance, than the rest being the arguments to the method

boreal iron
#

don't need to use a lib... works for "like always"

earnest phoenix
#

ahhhhh makes sense @sudden geyser

boreal iron
#

just pure JS (incl. jQuery) and some PHP for the API requests

sudden geyser
#

also may I ask what theme you're using

boreal iron
#

quite enough for what I need to do

earnest phoenix
#

light theme

pale vessel
#

not you xd

earnest phoenix
#

i actually like light theme

sudden geyser
boreal iron
#

anyway thx for the hint with v8... gonna study the docs right now b

pale vessel
#

glad to see someone actually uses php here

#

i mean it's not that bad

#

i use it too

slender thistle
#

I guess people shit on it because it used to be

earnest phoenix
#
Ignoring exception in command blacklist:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 83, in wrapped
    ret = await coro(*args, **kwargs)
  File "OwO.py", line 213, in blacklist
    data = read_json("blacklist")
  File "OwO.py", line 188, in read_json
    data = json.load(file)
NameError: name 'file' is not defined

The above exception was the direct cause of the following exception:``` i Actually want to just throw my Pc out the window..
pale vessel
#

rasmus doesn't even code the current php we know but still, we meme about it

slender thistle
#

happy little girl noises
What is file supposed to be?

earnest phoenix
#

blacklist.json

slender thistle
#

Show your code

pale vessel
#

did you use open()?

boreal iron
#

uh why not? using ajax calls for events, using POST method to my PHP handlers

earnest phoenix
#

this a long one

#

@pale vessel yh

slender thistle
#
    with open(f"blacklist.json", 'r') as f:
        data = json.load(file)
#

take a closer look

#

See what doesn't make sense?

pale vessel
#

f xd

earnest phoenix
#

i hate life.

#

-_- ty shiv ❀️

slender thistle
#

It's common to call an open file f or file tbf

pale vessel
#

he used file instead of f, isn't that the problem?

slender thistle
#

Mhm

pale vessel
#

ah

#

cool

slender thistle
#

😁

earnest phoenix
#

and now it wont process

#

my bot hates me...

slender thistle
#

Take it slow

pale vessel
#

take it despacito mate

slender thistle
#

Distract yourself for a bit, watch a few videos, calm down

earnest phoenix
#

😭

#

OH SHIT IT WORKED1!!!!!

#

Well... kinda

#

it didn't send the embed

slender thistle
#

Still progress :p

earnest phoenix
#

yuhhh

#

How can I fix this error?

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []```
west agate
earnest phoenix
#

@slender thistle i found reason for not sending embed

#

πŸ˜‚

slender thistle
#

πŸ‘€

earnest phoenix
#

i forgot the await ctx.send(embed=embed)

#

πŸ˜‚

pale vessel
#

pogu he did it

west agate
#

plss help me

compact oriole
#

did γƒͺンクス do it?

eternal osprey
#

hey guys!

compact oriole
#

I have lurked this saga

#

I am so happy, grats @earnest phoenix

slender thistle
#

lmfao, at least you figured it out

pale vessel
#

@west agate can you show other part of the code?

eternal osprey
#

how do i create a stop interval command?```js
if (message.content.startsWith(prefix + 'feed')) {
let channel = message.mentions.channels.first();

 {
  const args =
    ' ' +
    message.content
      .slice(prefix.length)
      .replace(/^feed/, '')
      .replace(/<#\d+>/, '')
      .trim();

  queueMessageText = '**The twitter feed has been searched and sent by this/these keyword(s): **';
  queueMessageText +=
    ' ' +
    message.content
      .slice(prefix.length)
      .replace(/^feed/, '')
      .replace(/<#\d+>/, '')
      .trim();

  
  const messageToEdit = await channel.send(queueMessageText)
  function generateEmbedFromFeed(query, callback) {
    T.get('search/tweets', { q: query, count: 1 }, function(err, data, response) {
      const status = data.statuses[0];
  console.log(status)
      const embed = new Discord.MessageEmbed();
  
      embed.setTitle('Twitter Feed Poster');
      embed.setDescription(`${status.text}`);
      embed.setImage(`${status.user.profile_image_url}`);
      embed.setFooter('Command created for Pokehub!');
      embed.setColor('#FF0000');
      embed.setAuthor('@' + `${status.user.screen_name}\n` + `${status.user.name}`);
      embed.setURL(`https://twitter.com/${status.user_screen_name}/status/${status.id_str}`);
      
      return callback(embed);
    });
  }

  generateEmbedFromFeed(args, (embed) => {
    // once the twitter search is resolved, we can edit the original message with the embed
    messageToEdit.edit(embed)
  })

  // again every 5 seconds
  let testing; 
   setInterval(() => {
    generateEmbedFromFeed(args, (embed) => {
      messageToEdit.edit(embed)
    })
  }, 5000);
}

}``` this is my code.

west agate
eternal osprey
#

like i already tried clearinterval(testing)

boreal iron
#

uhh... intents are quite useful, specially for me only watching sent messages. wondering why this wasn't in earlier already.

pale vessel
#

wouldn't that just send the same embed over and over?

#

you're not fetching the data again

#

you're using the previous data aka embed

west agate
#

oh..

#

how would i get the new data?

compact oriole
#

wtf is that

west agate
#

and why doe sit send like 5

pale vessel
#

try checking your updateTime

#

how would i get the new data?
@west agate make a function for it

earnest phoenix
#

How can I fix this error?

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []```
compact oriole
#
  1. use const not let
  2. discord.Embed? (use {} to open just embed)
#

let is used if you plan to change the data

#

const if it is not gonna change

pale vessel
#

const and let gang

compact oriole
#

aka not gonna get overwritten

pale vessel
#

fuck vars 😎

compact oriole
#

fuck vars PES_CoolNerd

earnest phoenix
#

How can I fix this error?

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []```

@earnest phoenix ???

compact oriole
#

"FallGuys ModMail"

pale vessel
#

doesn't sound like a module

earnest phoenix
#

wdym?

west agate
#
  1. use const not let
  2. discord.Embed? (use {} to open just embed)
    @compact oriole u want me to make another embed and send it?
compact oriole
#

also not showing code doesn't help @earnest phoenix

#

@compact oriole u want me to make another embed and send it?
not talking about embeds

west agate
#

@west agate make a function for it
@pale vessel how?

earnest phoenix
pale vessel
#

wrap the fetch and sending part inside a function and set an interval that runs the function again

earnest phoenix
#

discord.js

obtuse jolt
#

@earnest phoenix what

pale vessel
#

permissions.hoist does not exist, only role.hoist

earnest phoenix
#

wanted to put the biggest permission to appear

pale vessel
#

use member.roles.highest

earnest phoenix
#

Use GuildMember#permissions then

#

wait what

pale vessel
#

you can also sort their roles by position

earnest phoenix
#

I wanted permission

#

;-;

#

GuildMember#permissions will return all member permissions

pale vessel
#

highest permission?

earnest phoenix
#

How can I fix this error?

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []```

@earnest phoenix pls help me again

pale vessel
#

thonk

earnest phoenix
#

@earnest phoenix how can i apply this?

obtuse jolt
#

How do I do the ? Thing : thing for true and false things

earnest phoenix
compact oriole
#

@earnest phoenix you still didn't answer

earnest phoenix
#

rtd @earnest phoenix

#

wait...

compact oriole
#

also not showing code doesn't help @earnest phoenix
@compact oriole

pale vessel
#

condition ? <if truthy> : <else>

compact oriole
#

aka show code or not gonna help

earnest phoenix
#

Required settings

-----------------

token =
mainGuildId = 751182786756476968
mailGuildId = 751182786756476968
logChannelId = 761586206102126593
categoryAutomation.newThread = 761585942716481577

Add new options below this line:

----------------------------------

responseMessage = Thanks for messaging our FallGuys Modmail! We will next to you as soon as possible!
closeMessage = Your ticket was closed! Dont answer to this message only if you need more help
mentionRole = 761586690200436746

#

i am making a modmail

#

from the source code

#

rtd @earnest phoenix
@earnest phoenix what is?

#

rtd

pale vessel
#

read the docs

earnest phoenix
#

^

#

me?

#

I've already read

#

oh

silent cloud
#

Guys, Before that, my bot had an error 429, it passed in Β± 5 days, but now it appears again, although nothing was touched

clever dust
#

how do i post to a url? so for example, i want to post guild count to a url, how do i do that?

compact oriole
#

use a lib

#

like axios

obtuse jolt
#

@pale vessel ty

earnest phoenix
#

how do i post to a url? so for example, i want to post guild count to a url, how do i do that?
@clever dust you mean an HTTP POST request or just yeeting data to a website in general?

#

@compact oriole you talking to me?

compact oriole
#

no

clever dust
#

@clever dust you mean an HTTP POST request or just yeeting data to a website in general?
@earnest phoenix http post

compact oriole
#

aka use a library like axios

earnest phoenix
#

ok but what can I make for my problem?

compact oriole
#

like I said before

silent cloud
earnest phoenix
#

you told me to send you the code

pale vessel
#

i used to use node-fetch but now i made my own request wrapper

compact oriole
#

you told me to send you the code
you didn't

pale vessel
#

fetch is annoying with their res.json() and text()

compact oriole
#

i used to use node-fetch but now i made my own request wrapper
I usually use node-fetch or axios :P

#

but for some reason axios broke for a bit

pale vessel
#

discord.js uses node-fetch

#

i never used axios, just felt like node-fetch was good enough for me

sudden geyser
#

fetch is annoying with their res.json() and text()
@pale vessel because you can't check the body beforehand right

pale vessel
#

right

#

is there a property for that?

#

i'm guessing there is

#

but i don't use it anymore

earnest phoenix
#
Ignoring exception in command unblacklist:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 83, in wrapped
    ret = await coro(*args, **kwargs)
  File "OwO.py", line 235, in unblacklist
    await ctx.send(embed=embed)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/abc.py", line 870, in send
    data = await state.http.send_message(channel.id, content, tts=tts, embed=embed, nonce=nonce)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/http.py", line 225, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.fields.0.name: This field is required

The above exception was the direct cause of the following exception:```
#

does this mean the embed has to have a name ?

pale vessel
#

yeah

#

can't be empty, you would need to put a zws for that

silent cloud
#

Guys

#

Before that, my bot had an error 429, it passed in Β± 5 days, but now it appears again, although nothing was touched

pale vessel
#

you were rate limited

#

now you're not

#

as simple as that i guess

earnest phoenix
#

@earnest phoenix http post
@clever dust you need an HTTP client like phin to send HTTP POST requests to a URL
The request body will be whatever data is sent in the POST request
example of phin:

const phin = require("phin");
phin({
     url: "https://www.example.com",
     method: "POST",
     data: {
             smth: "smth"
}
});

read more about phin at https://npm.im/phin

silent cloud
#

So, what i need to do, if I want this not to happen again

pale vessel
#

use proxies

silent cloud
#

How? Rly idk

pale vessel
#

can't you use proxy directly with ytdl-core?

#

not sure

#

you should look that up

silent cloud
#

Google yep?

pale vessel
#

yep

silent cloud
#

Lets gooooo

#

Xd

#

Ty

earnest phoenix
#

@silent cloud send the request stuff to the proxy, the proxy forwards on the request to the API and since the proxy's IP is different from your main bot if the proxy gets rate limited you can switch to another while one of them is rate limited

quartz kindle
#

ytdl has an example for using a proxy in their github

silent cloud
earnest phoenix
#

and also not allowed in some APIs

silent cloud
#

ytdl has an example for using a proxy in their github
@quartz kindle rly!?!?

quartz kindle
#

yes

#

but you still need to get the proxies yourself

silent cloud
#

Hmmm how

quartz kindle
#

google for proxies

#

although most free proxies are shit

silent cloud
#

Ohhh

#

K ty

compact oriole
#

most free proxies either are super slow, not secure or they collect and sell your info

#

that's why they are free :P

quartz kindle
#

or they get shut down fast

pale vessel
#

not to mention their uptime

earnest phoenix
#

Is there any difference between a proxy and a normal web server other than only being used for rerouting requests

pale vessel
#

damn, it was mentioned, gg

compact oriole
#

also free proxies are blocked from most apis/sites

earnest phoenix
#

Why do you guys always suggest stuff to people then instantly ruin their excitement five seconds later
I don't think free proxies are that much shit for smol devs like us

silent cloud
#

BRUH

#

So how i need to do music bot ._.

#

Use*

earnest phoenix
#

@silent cloud try out a free proxy for testing then when you're confident rent a real proxy for the real bot

silent cloud
#

Ohhh thats money

pale vessel
#

i've tried free proxies and none of them worked :p

silent cloud
#

Lol

pale vessel
#

probably my luck

low shard
#

i can get help pls

#

i try to install quick.db

#

in another pc

#

but its not download it

pale vessel
#

can you elaborate on that

eternal osprey
#

hey

#

could someone help me with this problem:

#
if(message.author.id !== '345138133429649408') return message.channel.send("You don't have permissions to do that!");
  let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
  if(!rMember) return message.channel.send(xdemb);

  let role = args.join(" ").slice(22);
  if(!role) return message.channel.send("Specify a role!");
  let gRole = message.guild.roles.find(r => r.name === "name");
  

  if(rMember.roles.has(gRole.id)) return message.channel.send("This user already has that role.");
  await(rMember.addRole(gRole.id));

    await message.channel.send(`***I just gave ${rMember.user.username} the ${gRole.name} role!***`)

    message.delete();
  
}```
low shard
#

What you need

#

?

#

Invalid user

eternal osprey
#

my !addrole isn't working?

#

it just says nothing

#

nothing errors out.

#

is it an invalid user?

pale vessel
#

sup

eternal osprey
#

hey

pale vessel
#

is the role actually called "name"?

eternal osprey
#

could you possibly help me with the snippet sent above

#

no it isn't

pale vessel
#

are you using v11?

eternal osprey
#

v12 i think

#

hold on

pale vessel
#

and the name should be the role that you're trying to find

eternal osprey
#

v12.18.3

#

hmm

earnest phoenix
#

my bot is not replying to any commands i have tried many command handler my bot was working well till toady bot today my bot goes offline and i again hosted my bot on heroku but he is still not respomding

eternal osprey
#

can't i put a args in there?

#
let role = args.join(" ").slice(22);``` can't i put args role in the name?
pale vessel
#

ye

eternal osprey
#

as i want to add a role by name

pale vessel
#

treat r as a role

#

role has the property name

#

and you're trying to find a role that matches the input

#

so r.name === something

eternal osprey
#
let role = args.join(" ").slice(22);
  if(!role) return message.channel.send("Specify a role!");
  let gRole = message.guild.roles.find(Role => Role.name === role);```  owh yeah exactly
west agate
#

why does my bot keep sending more than 1 message?

eternal osprey
#

still doesn't add the role

#

again, with no errors.

#

@west agate whats the code?

pale vessel
#

did you check your version?

eternal osprey
#

yeah

#

v12.18.3

west agate
eternal osprey
#

bin it

pale vessel
#

in v12 it would be guild.roles.cache for the role cache

#

notice the .cache

eternal osprey
#

owh yeah omg

#

fuck

west agate
#

don't mind the mess as notpad messes it up

eternal osprey
#

@west agate bin it.

west agate
#

wut?

low shard
#

Invalid user you can help me or not

pale vessel
#

provide something

eternal osprey
#

ask your question lmao.

pale vessel
#

like the error

low shard
#

I say I try to install

west agate
low shard
#

Quick.db in another of

#

Of

pale vessel
#

you can't say "it doesn't work" without a proper reason

low shard
#

Pc

pale vessel
#

what didn't work, like something

low shard
#

I say

#

Wait I reset my pc

eternal osprey
#

hey, i literally changed everything again.

#

it;s still not wroking?

main chasm
#

.send("sent by "+ message.author.tag + message.content)
how i can space between sent by and message content ?

misty sigil
#

Use a ` string

main chasm
#

i know

#

but not working

#

you mean

misty sigil
#

use template literals

opal plank
#

@west agate oh god please dont do that

main chasm
#

.send(sent by + message.author.tag + message.content)
how i can space between sent by and message content ?

#

right ?

misty sigil
#

Use template literals.

main chasm
#

ok

misty sigil
#

I have literally said.

eternal osprey
#

anyone that could help me out?

misty sigil
main chasm
#

thank u

opal plank
#

@west agate first, dont do multiple let , second, dont do multiple setField(), theres setFields() method so you dont repeat that.

eternal osprey
#
let xdemb = new Discord.RichEmbed()
  .setColor("#00ff00")
  .setTitle(`Addrole command`)
  .addField("Description:", "Add role to member", true)
  .addField("Usage", "!addrole [user] [role]", true)
  .addField("Example", "!addrole @Odar Member")

  if(message.author.id !== '345138133429649408') return message.channel.send("You don't have permissions to do that!");
  let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]);
  if(!rMember) return message.channel.send(xdemb);

  let role = args.join(" ").slice(22);
  if(!role) return message.channel.send("Specify a role!");
  let gRole = message.guild.roles.cache.find(r => r.name === role);
  

  if(rMember.roles.has(gRole.id)) return message.channel.send("This user already has that role.");
  await(rMember.addRole(gRole.id));

    await message.channel.send(`***I just gave ${rMember.user.username} the ${gRole.name} role!***`)

    message.delete();
  
}```

why is my !adddrole command not working?
opal plank
#

third, all of that is in data already

#

no need to reference those values into other variables

earnest phoenix
#

@eternal osprey are you fucking telling me you have the exclamation mark as the prefix 200iq

misty sigil
#

Await

eternal osprey
#

i just use it like that in my test server

misty sigil
#

Isn’t

cobalt spruce
#

HELP ALERT

misty sigil
#

A

pale vessel
#

await() is allowed

misty sigil
#

Ok

eternal osprey
#

wait what?

pale vessel
#

ignore

#

him

eternal osprey
#

ignore me?

misty sigil
#

ignore me

#

no it’s me

earnest phoenix
#

ignore me
ReferenceError: me is not defined

eternal osprey
#

oowh.

misty sigil
#

Why not args[1] instead of some weird split join rubbish

cobalt spruce
#

i

earnest phoenix
#

i
@cobalt spruce you?

cobalt spruce
#

YES

opal plank
#

@misty sigil ty for reminding me

#

i needed to fix args but i had forgotten

cobalt spruce
#

my zqsd wasnt working

pale vessel
#

@eternal osprey can you add console.log(role) and console.log(gRole) after defining gRole?

cobalt spruce
#

i tried i and it woked

#

lol

#

anyways

eternal osprey
#

okay sure.

cobalt spruce
#

but am suc

#

so i need to ask

#

it use data push that i dont know how to use in Embed

#

Grizz Got ignored

low shard
#

@pale vessel

pale vessel
#

@earnest phoenix guess what

#

integer

misty sigil
#

integer

pale vessel
#

@low shard did you install build tools?

earnest phoenix
#

hes missing python

pale vessel
#

you can specify python path via command right?

earnest phoenix
#

yes

#

wait no you cant really

pale vessel
#

or he should probably install it if he haven't already

earnest phoenix
#

node guy gets run by node itself so you have no control over the args

#

gyp*

#

node gyp*

pale vessel
#

npm config set python won't do?

earnest phoenix
#

idk about config

misty sigil
#

node guy

boreal iron
#

back... with a full stomach

autumn aspen
#
let reason = 'Unspecified';
    if (args[2]) reason = args.splice(3).join(" ");

    try {

        const embed2 = new Discord.MessageEmbed()
        .setTitle("TEMPBANNED")
        .addField("Read!", `${user} you have been **Tempbanned** for ${time} day(s) in the server "**${message.guild.name}**" by ${message.author} with the reason of \`${reason}\``)
        .setFooter("Time tempbanned", message.guild.iconURL())
        .setTimestamp()
        .setColor(0xf7ff31)

        
        user.send(embed2)
    } catch (err){
        console.log(err)
        }
    

Why dows Unspecified not show up?

eternal osprey
#

hey i have logged my role and grole

#

gang

#

all i get

#

so my gRole is notworking for some reason/

earnest phoenix
#
async def timer(ctx, seconds):
    try:
        secondint = int(seconds)
        if secondint > 300:
            await ctx.send("I don't think I can go over 5 mins.")
            raise BaseException
        if secondint <= 0:
            await ctx.send("I don't think I can do negatives")
            raise BaseException

        message = await ctx.send(f"Timer: {seconds}")

        while True:
            secondint -= 1
            if secondint == 0:
                await message.edit(content="Ended!")
                break

            await message.edit(content=f"Timer: {secondint}")
            await asyncio.sleep(1)
        await ctx.send(f"{ctx.author.mention}, Your countdown has been ended!")
    except ValueError:
        await ctx.send('You must enter a number!')```


I wanna embed this command please help
pale vessel
#

check your args

autumn aspen
#

check your args
@pale vessel help ne

#

me

#

pls

pale vessel
#

you should use args[1] instead of slicing 22 characters of the joined args

eternal osprey
#

bro chill the fuck out.

#

ooowh okay.

pale vessel
#

wat

earnest phoenix
#

@pale vessel help me please

autumn aspen
#

bro chill the fuck out.
@eternal osprey u are the last person to say that

eternal osprey
#

i was talking to Endph.

pale vessel
#

@autumn aspen with what again

eternal osprey
#

what are you kidding me?

#

i am asking in a polite way

#

you are begging like fuck,

pale vessel
#

anyway

#

anyway

#

anyway

autumn aspen
#

@pale vessel

let reason = 'Unspecified';
    if (args[2]) reason = args.splice(3).join(" ");

    try {

        const embed2 = new Discord.MessageEmbed()
        .setTitle("TEMPBANNED")
        .addField("Read!", `${user} you have been **Tempbanned** for ${time} day(s) in the server "**${message.guild.name}**" by ${message.author} with the reason of \`${reason}\``)
        .setFooter("Time tempbanned", message.guild.iconURL())
        .setTimestamp()
        .setColor(0xf7ff31)

        
        user.send(embed2)
    } catch (err){
        console.log(err)
        }
    
#

this

#

Unspecified dont shows up

boreal iron
#

;

autumn aspen
#

when I tempban

pale vessel
#

@earnest phoenix you can use discord.Embed() for embeds

wanton mural
#

'

earnest phoenix
#

@pale vessel for embeding that commands

autumn aspen
#

@pale vessel yo u helping

#

lmao

low shard
#

@pale vessel what you say

pale vessel
#

@autumn aspen what did the message show?

#

the embed, i mean

lucid prawn
#

who need help with coding

eternal osprey
#

me kinda.

autumn aspen
#

@autumn aspen what did the message show?
@pale vessel it only showed up "``" not the Uncpesified

pale vessel
#

have you tried debugging?

#

console.log(reason)

lucid prawn
#

just dm and i will help u with coding

earnest phoenix
#

bruh dm help

autumn aspen
#

have you tried debugging?
@pale vessel I will show u in hb

eternal osprey
#

why not here?

pale vessel
#

@autumn aspen debug

earnest phoenix
#

he said debug

pale vessel
#

debug and splice()?

#

what are you trying to do

low shard
#

@pale vessel you can help me or not

pale vessel
#

you should log reason and see that it is

autumn aspen
#

you should log reason and see that it is
@pale vessel aight

compact oriole
earnest phoenix
#

not a testing channel

pale vessel
#

@low shard constantin can probably help you, i don't have that much experience with these native module errors

earnest phoenix
#

@earnest phoenix

eternal osprey
#

btw invalid user

#

the slice.(22)

#

is for removing the member id

#

as you are pinging.

pale vessel
#

can't you use args[1]

eternal osprey
#

no

pale vessel
#

why not

eternal osprey
#

that will leave this:

#

@!745253908275920986> gang

earnest phoenix
#

gang gang

eternal osprey
#

so @member (role name)

pale vessel
#

args is an array, is it not?

#

that only happens if you use args.join(" ").slice(1)

eternal osprey
#

well it came back to me like this: @!745253908275920986> gang

#
let role = args.join(" ").slice(22);```
#

and i am

earnest phoenix
#

22?d

pale vessel
#

try console.log(args)

eternal osprey
#

anyways this works

pale vessel
#

but pings can be different

eternal osprey
#

the variable role works

pale vessel
#

some can have !

#

ah

eternal osprey
#

it is the gRole

boreal iron
#

@autumn aspen next error will be a missing ;

...
.setColor(0xf7ff31); <--
user.send(embed2); <--```
pale vessel
#

well, let's get to that then

eternal osprey
#

as it's not logging.

#
let gRole = message.guild.roles.cache.find(r => r.name === role);```
pale vessel
#

so the role matches the role name that you want to look for?

eternal osprey
#

exactly.

pale vessel
#

does it have any whitespace?

eternal osprey
#

my roles?

#

nope.

pale vessel
#

the input

eternal osprey
#

wait a minute,

pale vessel
#

you can use string.trim() just in case

eternal osprey
#

i use !giverole @member role

#

would that be the problem/

pale vessel
#

there would be a space

#

since you're only slicing the mention length, excluding the space

#

add .trim() to role

#

let role = args.join(" ").slice(22).trim();

earnest phoenix
#

What does trim() do?

eternal osprey
#

trim an amount of characters right?

wanton mural
#

@eternal osprey

pale vessel
#

removes extra spaces on the left and right of the string

#

kind of

eternal osprey
#

what's up

earnest phoenix
#

Oh, good.

pale vessel
#

like " test " becomes "test"

cobalt spruce
#

can any one help

wanton mural
#

notagirl dm u @eternal osprey

pale vessel
#

but " hello test " would be "hello test"

#

only the edges

eternal osprey
#

yeah she did

#

why

#

she said shes testing out the code i provided,

#

but imo she's just doing something?

misty sigil
#

@cobalt spruce copying is NOT making

eternal osprey
#

she said it's an illegal return statement..

pale vessel
eternal osprey
#

uhhm wtf.

misty sigil
#

The fact that you can’t apply it to an embed means you don’t understand the code.

wanton mural
#

@eternal osprey

eternal osprey
#

WHAT

cobalt spruce
#

@misty sigil ik

pale vessel
#

almost 12am here so i gotta go to bed, gtg

boreal iron
#

b

eternal osprey
#

have a great night!

pale vessel
#

matthew can help you troll

#

gn

autumn aspen
#

@autumn aspen next error will be a missing ;

...
.setColor(0xf7ff31); <--
user.send(embed2); <--```

@boreal iron lmao everything works as it should that thing with uncpesified was only the problem but I fixed it

eternal osprey
#

i hope os!

autumn aspen
#

@pale vessel I fixed the specified thing

#

noice

boreal iron
#

aye

#

just to have a "correct" syntax

autumn aspen
#

what u got ; this from

#

lol

#

_just to have a "correct" syntax
@boreal iron oh yeah

#

but I will fix it or that is the last thing

#

bc I need to hurry if my bot is gonna get approved by top.gg

#

@boreal iron

#

--bots

#

-bots

gilded plankBOT
boreal iron
#

what does it do?

autumn aspen
#

what does it do?
@boreal iron its a professional project that can lock channels servers better than sounddrouts bot (private)

#

I need it to be as good as probot

#

and much better

#

than it

boreal iron
#

roger

autumn aspen
#

lol

eternal osprey
#
if(message.author.id !== '345138133429649408') return message.channel.send("You don't have premmsions to do that!");
  let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]);
  if(!rMember) return message.channel.send(xdemb);

  let role = args.join(" ").slice(22).trim();
  console.log(role)
  if(!role) return message.channel.send("Specify a role!");
  let gRole = message.guild.roles.cache.find(r => r.name === role);
  console.log(gRole)
  if(!gRole) return message.channel.send("Couldn't find that role.");

  if(rMember.roles.has(gRole.id)) return message.channel.send("This user already have that role.");
  await(rMember.addRole(gRole.id));

    await message.channel.send(`***I just gave ${rMember.user.username} the ${gRole.name} role!***`)

    message.delete();``` why is this still not working?
#

it is only logging the role

#

and not the gRole

lucid prawn
#

-bot

#

--bot

autumn aspen
#
if(message.author.id !== '345138133429649408') return message.channel.send("You don't have premmsions to do that!");
  let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]);
  if(!rMember) return message.channel.send(xdemb);

  let role = args.join(" ").slice(22).trim();
  console.log(role)
  if(!role) return message.channel.send("Specify a role!");
  let gRole = message.guild.roles.cache.find(r => r.name === role);
  console.log(gRole)
  if(!gRole) return message.channel.send("Couldn't find that role.");

  if(rMember.roles.has(gRole.id)) return message.channel.send("This user already have that role.");
  await(rMember.addRole(gRole.id));

    await message.channel.send(`***I just gave ${rMember.user.username} the ${gRole.name} role!***`)

    message.delete();``` why is this still not working?

@eternal osprey wtf is xdemb

lucid prawn
#

-bots

gilded plankBOT
autumn aspen
#

gg lmao

#

deleted?

#

or not approved

eternal osprey
#

it's something i defined.

boreal iron
#

whats the issue again?

eternal osprey
#

Notagirl says its because it's an illegal return statement.

#

i mean, how.

#

this isn't an illegal return statement, is it?

autumn aspen
#

it's something i defined.
@eternal osprey I think copy persons is not that good

#

this isn't an illegal return statement, is it?
@eternal osprey google it

eternal osprey
#

@autumn aspen what are you saying amte?

#

i didn't copy anything

#

i made it myself.

autumn aspen
#

dude I have been here for 6weeks and Im better than u

eternal osprey
#

do you even know what defining is?

autumn aspen
#

lol

#

do you even know what defining is?
@eternal osprey well no fucking shit

cobalt spruce
#

@autumn aspen how did u add colors to ur messages

boreal iron
cobalt spruce
#

the script ones

autumn aspen
#

Hi mother fuckers
@earnest phoenix @modern sable

wanton mural
#

awsome

eternal osprey
#

yeah

wanton mural
#

check ur dm

autumn aspen
#

@autumn aspen how did u add colors to ur messages
@cobalt spruce just type '''js but the other once

#

like other dots

#
hey
#

like that

#

but js

#

and code

cobalt spruce
#

js```js
const { prefix } = require('../config.json');
const Discord = require('discord.js');

module.exports = {
name: 'help',
description: 'List all of my commands or info about a specific command.',
aliases: ['commands'],
usage: '[command name]',
cooldown: 5,
execute(message, args) {
const data = [];
const { commands } = message.client;

    if (!args.length) {
        data.push('Here\'s a list of all my commands:');
        data.push(commands.map(command => command.name).join(', '));
        data.push(`\nYou can send \`${prefix}help [command name]\` to get info on a specific command!`);

        return message.author.send(data, { split: true })
            .then(() => {
                if (message.channel.type === 'dm') return;
                message.reply('I\'ve sent you a DM with all my commands!');
            })
            .catch(error => {
                console.error(`Could not send help DM to ${message.author.tag}.\n`, error);
                message.reply('it seems like I can\'t DM you!');
            });
    }

    const name = args[0].toLowerCase();
    const command = commands.get(name) || commands.find(c => c.aliases && c.aliases.includes(name));

    if (!command) {
        return message.reply('that\'s not a valid command!');
    }

    data.push(`**Name:** ${command.name}`);

    if (command.aliases) data.push(`**Aliases:** ${command.aliases.join(', ')}`);
    if (command.description) data.push(`**Description:** ${command.description}`);
    if (command.usage) data.push(`**Usage:** ${prefix}${command.name} ${command.usage}`);

    data.push(`**Cooldown:** ${command.cooldown || 3} second(s)`);



    message.channel.send(data, { split: true });
    


},

};```js

autumn aspen
#

dude I just told u

cobalt spruce
#

wttf

#

can any one help me make this as a embed

autumn aspen
#

can any one help me make this as a embed
@cobalt spruce look

boreal iron
#
var thatsHowitWorks;
cobalt spruce
#

@autumn aspen were

boreal iron
#

js has to be in the first line

cobalt spruce
#

lol

#

ok

boreal iron
#

to specify javascript

cobalt spruce
#

@boreal iron man

#

can u help

autumn aspen
#
client.login('')
//'''js
code
#

like that but other dots

boreal iron
#

meant the code tag in Discord (here)

clever dust
#

@clever dust you need an HTTP client like phin to send HTTP POST requests to a URL
The request body will be whatever data is sent in the POST request
example of phin:

const phin = require("phin");
phin({
     url: "https://www.example.com",
     method: "POST",
     data: {
             smth: "smth"
}
});

read more about phin at https://npm.im/phin
@earnest phoenix thanks, it works

cobalt spruce
#
const { prefix } = require('../config.json');
const Discord = require('discord.js');


module.exports = {
    name: 'help',
    description: 'List all of my commands or info about a specific command.',
    aliases: ['commands'],
    usage: '[command name]',
    cooldown: 5,
    execute(message, args) {
        const data = [];
        const { commands } = message.client;

        if (!args.length) {
            data.push('Here\'s a list of all my commands:');
            data.push(commands.map(command => command.name).join(', '));
            data.push(`\nYou can send \`${prefix}help [command name]\` to get info on a specific command!`);

            return message.author.send(data, { split: true })
                .then(() => {
                    if (message.channel.type === 'dm') return;
                    message.reply('I\'ve sent you a DM with all my commands!');
                })
                .catch(error => {
                    console.error(`Could not send help DM to ${message.author.tag}.\n`, error);
                    message.reply('it seems like I can\'t DM you!');
                });
        }

        const name = args[0].toLowerCase();
        const command = commands.get(name) || commands.find(c => c.aliases && c.aliases.includes(name));

        if (!command) {
            return message.reply('that\'s not a valid command!');
        }

        data.push(`**Name:** ${command.name}`);

        if (command.aliases) data.push(`**Aliases:** ${command.aliases.join(', ')}`);
        if (command.description) data.push(`**Description:** ${command.description}`);
        if (command.usage) data.push(`**Usage:** ${prefix}${command.name} ${command.usage}`);

        data.push(`**Cooldown:** ${command.cooldown || 3} second(s)`);



        message.channel.send(data, { split: true });
        


    },
};```
i want to make this as a embed
#

any one can help?

autumn aspen
#

exactly!

cobalt spruce
#

idk how to use data push

#

lol

boreal iron
#

data is the array

cobalt spruce
#

@boreal iron i copied the code

boreal iron
#

.push() will add a new field to the array

cobalt spruce
#

from the guid

eternal osprey
#

hey fake

#

could you help me out with my code?

#

if you please.

boreal iron
#

you gonna use the callback to send EmbedMessages and use for/foreach for each data field, for example as embed field

#
for(var i = 0; i < data.length; i++ )
#

for example

wanton mural
#

@eternal osprey check dms

cobalt spruce
#

@boreal iron i toltaly understand what u sayingπŸ˜‰

boreal iron
#

embed -> fields need at least a name and value

cobalt spruce
#

i wana die

boreal iron
#

each element of data will get an embed field, for example

#

1 field = 1 line to list all contents of array data

#

however you like to do it

wanton mural
#

@eternal osprey

boreal iron
#

can't help you will all the callbacks and functions in DiscordJS, not using it

#

I'm sure there should be an example how to create embed messages using DiscordJS

eternal osprey
#

@wanton mural i am in your server

#

WHAHAHHAHAHA

#

WHATTTT

clever dust
#

@split hazel

#

someone was advertising

eternal osprey
#

lets dislike his vids

misty sigil
#

that editing cringe ngl

eternal osprey
#

it really hurt my ears at the beginning

#

like an explosion

weak parrot
eternal osprey
#

Adib i saw that quick edit πŸ‘€

boreal iron
#

     const embed = new MessageEmbed()
      // Set the title of the field
      .setTitle('A slick little embed')
      // Set the color of the embed
      .setColor(0xff0000)
      // Set the main content of the embed
      .setDescription('Hello, this is a slick embed!');
    // Send the embed to the same channel as the message
    message.channel.send(embed);

       .addFields(
        { name: 'Regular field title', value: 'Some value here' },
        { name: '\u200B', value: '\u200B' },
        { name: 'Inline field title', value: 'Some value here', inline: true },
        { name: 'Inline field title', value: 'Some value here', inline: true },
    )

@cobalt spruce .addFields to add your fields from the array data into

thick gull
cobalt spruce
#

@boreal iron man am dum

violet mesa
#

how do i see what item the person uses and then with id's do what its suppose to do through id
discord.py, if you dont understand anything tell me what u dont understand ill try to explain : >

cobalt spruce
#

@boreal iron cant u just send source code in my dms

boreal iron
#

lol

cobalt spruce
#

for real

#

i dont understand

#

lol

violet mesa
#

not for real hes name is fake

#

badom tas

boreal iron
#

dont get me wrong, learning to code doesn't work if somebody presents you the solution

cobalt spruce
#

..

#

;-;

violet mesa
#

how do i see what item the person uses and then with id's do what its suppose to do through id
discord.py, if you dont understand anything tell me what u dont understand ill try to explain : >

cobalt spruce
#

@boreal iron man help me more

eternal osprey
#

could anyone please help me with my not working role addcommand?

#
if(message.author.id !== '345138133429649408') return message.channel.send("You don't have premmsions to do that!");
  let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]);
  if(!rMember) return message.channel.send(xdemb);

  let role = args.join(" ").slice(22).trim();
  console.log(role.length)
  if(!role) return message.channel.send("Specify a role!");
  let gRole = message.guild.roles.cache.find(r => r.name === role);
  console.log(gRole)
  if(!gRole) return message.channel.send("Couldn't find that role.");

  if(rMember.roles.has(gRole.id)) return message.channel.send("This user already have that role.");
  await(rMember.addRole(gRole.id));

    await message.channel.send(`***I just gave ${rMember.user.username} the ${gRole.name} role!***`)

    message.delete();
  
}```
#

it isn't adding shit.

abstract coyote
#

hey quick question, how could I check if a role was mentioned in a message?

#

or a member with that role

#

is what I meant sorry

violet mesa
#

@eternal osprey u use python?

boreal iron
#

what's the issue with ur code?

cobalt spruce
#

@boreal iron me?

#

nothing

boreal iron
#

nope, Awsome in this case

cobalt spruce
#

ok