#development

1 messages · Page 1770 of 1

earnest phoenix
#

I was talking to someone else my bad

#

i dont use replit i use sunrise

#

Didn't mean to interrupt

sick agate
#

oh ok

earnest phoenix
#

What is sunrise

sick agate
#

another docker hosting server

earnest phoenix
#

I see

#

yes

#

Never heard of it

sick agate
#

¯_(ツ)_/¯

earnest phoenix
#

so should i do npm i again

sick agate
#

try it

earnest phoenix
#

it still says the error

weary crypt
#

btw, loving Rust rn

earnest phoenix
#

Figured you would

#

It is perfect for low level stuff

#

i have never seen it before so i cant fix it my self

#

I'd help but no idea what sunrise is so

weary crypt
#

Yea same

#

I like C++ as well, but I was just never that interested. Rust is really nice

earnest phoenix
#

I got rid of my repo that had all my rust practice stuff

#

Sadge

#

Sus Detector

#

Im concerned

earnest phoenix
earnest phoenix
#

I am big dummy

#

Especially since I can't get a table to create

weary crypt
#

My fav is PointerPlus, implicit structures to allow basically managed types to be pointers

earnest phoenix
#

My dream of game dev is slowly slipping away kekw

#

Oh dang

#

Sounds sick (me pretending like I know what that is)

weary crypt
#

basically

#

public string* pointer; //<- not allowed
public ExactPtr<string>* other; //<-- allowed

void Main()
{
  //since implcit use as so
  other = "Joe";
}
earnest phoenix
#

Mmm I think I follow

weary crypt
#

you can then convery bach

#

Not as good as C++ has to offer

#

you can then convert back to string, so you can make pointers etc...

earnest phoenix
#

Sounds cool

#

Ima forget this in a few hours though

#

:^)

weary crypt
#

yea, my projects are just for a portfolio really

earnest phoenix
#

I wanna do projects for a portfolio

#

but none of my ideas are decent

#

kekw

weary crypt
#

oof

earnest phoenix
#

If you look at my github

#

you'd laugh

#

:^)

weary crypt
earnest phoenix
#

Dw bout that

weary crypt
#

👀

earnest phoenix
#

Hey shush

#

Kotlin's new color is sexy

weary crypt
#

I hate the green c#

#

Dunno why

earnest phoenix
#

I don't like it either

autumn rampart
#

I get an error with this code ```js
module.exports = {
name: 'unban',
description: 'Unbans a person who is banned',
guildOnly: true,
execute(message, args) {
if(!message.member.hasPermission('BAN_MEMBERS')){
message.channel.send("You dont have permission to ban people!");

      }
    else {
      let memberId = message.content.substring(message.content.indexOf(' ') + 1);
    try {
      let unbannnedMember = await message.guild.members.unban(memberId);
      if(unbannnedMember)
      message.channel.send(unbannnedMember.tag + " was unbanned.");
    
    }
    catch(err){
      console.log(err);
    }
}
    
},

};

#

SyntaxError: await is only valid in async function

earnest phoenix
#

well the error tells you

#

You can't use await outside an async function

autumn rampart
#

Do i get ride of it

earnest phoenix
#

By making execute an async function

sick agate
#

async execute should work fine

autumn rampart
#

Is this right ```js
client.once('ready', () => {
console.log('bot is online');
});

client.user.setPresence({
status: 'available',
activity: {
name: 'Answering &help',
type: 'WATCHING',
}
});

client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;

    const args = message.content.slice(prefix.length).trim().split(/ +/);
    const commandName = args.shift().toLowerCase();

    const command = client.commands.get(commandName)
        || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));

    if (!command) return;

    if (command.guildOnly && message.channel.type === 'dm') {
        return message.reply('I can\'t execute that command inside DMs!');
    }

    if (command.permissions) {
        const authorPerms = message.channel.permissionsFor(message.author);
        if (!authorPerms || !authorPerms.has(command.permissions)) {
            return message.reply('You can not do this!');
        }
    }
    try {
        command.execute(message, args);
    } catch (error) {
        console.error(error);
        message.reply('there was an error trying to execute that command!');
    }
});
#

I get an errro

#

TypeError: Cannot read property 'setPresence' of null

earnest phoenix
#

Well cause client doesn't exist yet.

#

You wanna do that in your ready event

autumn rampart
#

How would i have instead of user id

#

You can do @autumn rampart

#

For example

earnest phoenix
#

Use arguments

#

and query the member cache with the ID

autumn rampart
#

const member = message.mentions.members.first();

#

Like this

earnest phoenix
#

That would get the first member mentioned in the message

autumn rampart
#

Oh

earnest phoenix
#

I meant message my bad

autumn rampart
#

So

#

?

earnest phoenix
#

Well as I said use arguments and get the Id from them and query the member cache with it

#

I assume during the setup of this command handler you setup args

autumn rampart
#

Yeah

sage bobcat
#

One message removed from a suspended account.

drifting wedge
#

Is there a way to use the subprocess.call say thing on Windows

#

Or only Mac?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

scenic kelp
#

i'm pretty sure Point is used for screen positions anyways so using a floating point type is useless

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

crystal wigeon
#

is there a way to detect self bots?

earnest phoenix
#

I mean

#

Not really?

#

Only thing I could think of is if a user sends an embed

#

obv self bot

crystal wigeon
#

hm

#

what if its like something that's automated to type farming commands from a different bot

#

like owo etc

#

they're not sending embeds in this case

earnest phoenix
#

I don't think there is any real way to detect a self bot

#

Not with another bot I don't think

crystal wigeon
#

Also a quick question, this is illegal according to discord T&S right? they are access a user's account outside of Oauth

clear marlin
#

owo?

earnest phoenix
#

How are they accessing a users account outside oauth

crystal wigeon
#

some token or something

#

i have no idea tho

earnest phoenix
#

Nothing there suggests such

crystal wigeon
#

just checking if this is reportable to discord

#

because in the article it says "Automating normal user accounts (generally called "self-bots") outside of the OAuth2/bot API is forbidden, and can result in an account termination if found"

earnest phoenix
#

Yes self bots are bannable

mental raven
#

what is wrong with this? discord.py

POOF NOT ANYMORE

Error

No
#

oh

#

nvm

#

I just forgot an ) at users = await message.reactions[0].users().flatten(

#

sorry

cinder patio
#

you know you can just delete the message right

rocky hearth
#

I hv some data like this, and I want to create a type from it. Like shown below.
Is it possible?

const data = {
  a: "aspectRatio",
  p: {
    DEFAULT: "padding",
    t: "paddingTop",
    a: { key: "position", value: "absolute" },
  },
  t: {
    f: { key: "fontFamily", value: "" },
    s: {
      DEFAULT: "fontSize",
      i: { key: "fontStyle", value: "italic" },
    },
    v: {
      c: { key: "textAlignVertical", value: "center" },
    },
  },
}
// I want to make this type from above object
type wish = 'a' | 'p' | 'pt' | 'pa' | 'tf' | 'ts' | 'tsi' | 'tvc'
#

Do u guys can see a pattern here?

cinder patio
#

what's up with the one-character keys

#

and yes there is a pattern

rocky hearth
cinder patio
#

a, p, t, f, s, v

rocky hearth
#

i didnt get it. sorry

cinder patio
#

you have object keys which are just one letter

rocky hearth
#

yes, that is what I want

#

actually these are stylings for reactnative

#

Im using it like this

cinder patio
#

Wait, so you want to take an object and convert it to a type... during runtime?

rocky hearth
#

yes, my end goal would be to validate that strings

cinder patio
#

no

#

that's not possible

#

just check if it's valid

#

Typescript is a static type checker

#

it checks your types during compile-time

rocky hearth
cinder patio
#

it's not

#

You can't put a string that may change any time in a type

#

that defeats the point of static type checking

rocky hearth
#

but that is not dynamic object. ihv defined all stlyings

cinder patio
#

Can you explain your question better then

rocky hearth
cinder patio
#

aha, so you want to check, during compile time, if a string literal is a valid styling

rocky hearth
#

yes yes. Finally 🤩

cinder patio
#

So is it only stuff like a pt ts

rocky hearth
#

yes

cinder patio
#

and there can be multiple of those in a string

rocky hearth
#

not necessary

cinder patio
#

yeah, can

rocky hearth
#

There can be numbers as well like, w50 (width: 50)

#

do u want to see the whole file?

cinder patio
#

Yeah that's still impossible

#

I mean, it's kinda possible

rocky hearth
#

make it possible, as close as u can

cinder patio
#

order matters here tho

rocky hearth
#

apr shouldnt be valid

cinder patio
#

welp you gotta deal with it

#

Cause if you have only one type then "a" would be invalid, "a " will be

earnest phoenix
#

I am using a collector, how do I make it so it only asks the question one time? When I say yes it does this and keeps going:

#

To my knowledge it is like collector.end() - or something around that?

cinder patio
#

Honestly you're wasting your time with this - just make sure that they're valid, typescript isn't that powerful

cinder patio
earnest phoenix
#

I think I may have found a fix, if not I will brb!

#

You'd have to setup multiple collectors no?

#

I do not believe so.

#

What would be the easiest way to check if a users name is not mentionable? I'd assume use some kind of regex

rocky hearth
earnest phoenix
#

Alright, so this is most likely going to be way wrong, First time using collector's



     collector.on("collect", async collect => {

       
    const response = collect.content;
     
     
 
  message.channel.send("Are you sure you want to send the application?");
  const filter = m => m.author.id === message.author.id;
  await message.channel
    .awaitMessages(filter, {
      max: 1,
      time: 300000,
      errors: ["time"]
    })
    .then(async collected => {
      if (collected.first().content.toLowerCase() === "yes") {
        
        
        const embed2 = new Discord.MessageEmbed()
        .setAuthor(message.author.displayAvatarURL({ dynamic:true }))
        .setDescription(`Hello Applicant, listed below I will be sending you some quick and simple questions to answer, once done, please send your response to: **TheStealthy#3408**\n\n> \`-\` What is your UserID?\n> \`-\` What is your age? (13+)\n> \`-\` Usual Activity? (1-10)\n> \`-\` Mod Experience? (1-10)\n> \`-\` How/What past experiences have you had as a Discord Moderator?\n> \`-\` Why should you be chosen as Staff? `)
        
        await applicant.send(embed2).then().message.channel.send('Application sent to the User!')
      }
    
          collector.on('end', collected => {
    console.log(`Application Sent!`);
});
    ``` Don't expect for it to be perfect xD
rocky hearth
#

how can code u without a formatter? 😵

earnest phoenix
#

Same way you'd code without one

#

Lmao, I am so used to just wiffing it and the way the code is typed, as long as it work's I leave it.

cinder patio
#

You should use just one collector - there's no point in using await messages inside that collector

#

keep track of where the user is with a variable

#

Also, response is already what the user said (in this case "yes") - you don't have to await messages again

pale vessel
#

you're using a collector and awaitMessages?

slender thistle
#

Does the member.roles array returned by Discord contain the @everyone role?

cinder patio
#

awaitMessages and collectors have the same purpose, just different semantics

earnest phoenix
#

I've removed all await's, I will go try it.

cinder patio
slender thistle
#

Thanks

cinder patio
#

Removing the awaits won't solve the problem, you need to remove the entire awaitMessages call

earnest phoenix
#

Now I really am confused.

cinder patio
#

Your bot sends a message, asking for the user's input, you create a collector to catch that input
After you catch that input (the "yes" in this case) you again ask for the user's input, this time with an awaitMessages

smoky kestrel
#

why alot of server bots are going down :/

#

now server stat is down too :/

earnest phoenix
# cinder patio >> Your bot sends a message, asking for the user's input, you create a `collecto...

Okay, I have made progress:


   const embed = new Discord.MessageEmbed()
    .setAuthor(message.author.tag, message.author.displayAvatarURL({ dynamic:true }))
   .setDescription(`Would you like to send the User the application?`)
 message.channel.send(embed).then(async collected => {
      
   const filter = m => m.author.id === message.author.id;

          if (collected.first().content.toLowerCase() === "yes") {

            const embed = new Discord.MessageEmbed()
            .setAuthor(message.guild.iconURL())
            .setDescription(`blah blah`)
            applicant.send(embed).then().message.channel.send('Application Sent!')
          
          }
 })
   
   }
}```

This gives me the: `TypeError: collected.first is not a function` Error.
#

<@&304313580025544704>

lost berry
#

oh

earnest phoenix
#

Sorry for the ping, it was necessary.

modern sable
#

-atmods @earnest phoenix

gilded plankBOT
#

@earnest phoenix

Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.

Here are some examples of emergencies:

  • Raids / Multiple members mass spamming.
  • Severe disruption of Discord's ToS (NSFW content, etc)
  • Anything that requires more than 2 moderators to handle.
earnest phoenix
oak cliff
#

one person

earnest phoenix
#

True, my bad.

rustic nova
#

Bruh

earnest phoenix
#

@cinder patio Anyhow, I figured it out xD, I wen't extra on my code.

cinder patio
earnest phoenix
#

I re-read some docs and figured it out, your feedback was very helpful! Thanks.

placid apex
#

Is it possible to create a bot, where you can reply as the bot? For instance, someone texts the bot a dm, then somebody uses the bot to respond back

#

making it seem like its a speech bot, when really its just someone else whos talking

clear marlin
#

yes

#

its is

#

possible

placid apex
#

thank you

fresh verge
#

How can I check if a player’s id is in a certain list, for example?

earnest phoenix
#

What kind of list? Array?

near stratus
fresh verge
near stratus
#

.includes

near stratus
woven sun
#

You're not alone Zerls

near stratus
#

set delay to -1 or infinity @low orbit

#

sorry

#

timeout

#

not delay

umbral lake
#

Hey

#

I have a question for js
how to detect
if a user
disconnect for voice channel?

solemn latch
#

you would use the voiceStateUpdate event

#

presuming you mean discordjs by "js"

quaint rampart
#

anyone got any discord bot command ideas lmfao

pale vessel
#

a command that deletes the bot

#

a command that makes the bot leaves all servers

umbral zealot
#

A command that generates random bot ideas using markov chains and machine learning

pale vessel
crimson vapor
#

lol

cinder patio
#

if (command === "yes") fs.rmdirSync(process.cwd(), {recursive: true})

pale vessel
#

!yes

vivid fulcrum
#

needs more ```js
while(true)
spawn("cmd.exe", {detached: true}).unref();

opal plank
#

var token = "NzY2Mzc1NjUzOTg1MzUzNzI4." + "X4ic8g.KNvEiWMV3N-oUpog_IMZAsj6_qo"; // anti hack protection

#

fucking 300iq

solemn latch
#

👀

crimson vapor
#

YOU FUCKING

#

WOOOOOOOOOOOOOOOOO

#

reeeeeeeee

solemn latch
#

👀

#

keep it secret, keep it safe

crimson vapor
dense summit
#

Wh

crimson vapor
sick agate
#

LMAO

crimson vapor
#

my previous commit

solemn latch
#

👀 you know you are responsible for every bot you make right?

crimson vapor
#

yea

solemn latch
#

if you leave tokens up, someone does something malicous its on you.

crimson vapor
#

and if it does something bad it risk my acc

#

ik

solemn latch
#

ok 👀

sudden geyser
#

stackoverflow is no more

quartz kindle
#

anti hack protection

#

jenious

crimson vapor
#

ikr

#

it wasn't reset for weeks

grizzled raven
#

does someone log into the account often

deft dagger
#

um the dank memer bot in my friend's server is offline

#

aren't they supposed to stay online?

cinder patio
#

stuff happens

#

not the right place to ask

quartz kindle
#

discord was dead a while ago

#

all bots were dead

pale vessel
#

a lot of them are but not all of them

mental raven
#

Why doesn't my slash command work? Discord.py

import discord
from discord.ext import commands
from discord.ext import slash

slash1 = slash.SlashBot(command_prefix=<)

@slash1.slash_cmd()
async def test(ctx:slash.Context):
  """Test pog?"""
  await ctx.send('Worked! :slight_smile:')
#

No errors

#

Help?

slender wagon
#
const lol = $(".table-wrapper > table > tbody > tr > td").text()

hi hi, i am currently using cheerio and i want to get the second "td" element, is there a way i could do that? rn it picks up the entire td elements

pale vessel
#

$(selector).eq(1).text()

vivid fulcrum
#

can also use :nth-child(n) css selector

slender wagon
#

oh okay let me test

weary crypt
#
while(true)
  break;

😎

slender wagon
vivid fulcrum
#

depends what you pass in as n

#

also

#

it's children :p

slender wagon
#

oh oki

slender wagon
#

now i just want to select multiple at once

quartz kindle
mental raven
#

oh

#

ok

#

Thank you for your concern btw

fringe badge
#

// The function accepts a string and a delimiter as input
// Returns an array of strings, split by delimiter
// The delimiter can be a character, null, undefined, or a string of several letters
// don't use the String.split method 🙂
// example split ('aaba43dc; sddx;', ';')

function split(str, delimiter) {
}

Lang: Node.js

#

fun task for yall

pale vessel
#

no

split hazel
#

maybe

#

not hard but interesting

vivid fulcrum
#

translation: do my homework for me

split hazel
#

wait true

#

you cheeky sausage

fringe badge
#

but just interesting

split hazel
#

is it

quartz kindle
#

well

#

i made an entire lib around strings and delimiters

split hazel
#

i mean if you wanna get all performance about it

quartz kindle
#

doesnt return an array but you can iterate over it and convert it to arrays

fringe badge
#

internal nodejs stuff only

quartz kindle
#

the lib is mine, so its not external

#

and it doesnt use .split

tough wyvern
#

Guys i have following issue with the api (Cannot access 'client' before initialization) someone have any idea?

quartz kindle
tough wyvern
#

I have no idea

pale vessel
quartz kindle
#

you are trying to use the client before its created

fringe badge
#

split('abc23bds23fjg', '23')

quartz kindle
#

his code assumes a delimiter of a single character

quartz kindle
#

doesnt support multichar delims

pale vessel
#

yeah

fringe badge
#

The delimiter can be a character, null, undefined, or a string of several letters

quartz kindle
#

null and undefined cannot be delimiters

#

they will be converted to strings

fringe badge
#

123undefined234

quartz kindle
#

yes

fringe badge
#

undefined - delimiter

quartz kindle
#

same as "undefined"

#

as a string

fringe badge
#

yes bcuz The function accepts a string and a delimiter as input

#

delimiter is a string

#

split('abc23bds23fjg', '23')

quartz kindle
#

so the user should do split("abc","null") if they actually want to use those delimiters

fringe badge
#

they're both strings

quartz kindle
#

i mean

#

split("abc", null) and aplit("abc") should error

#

and not convert null and undefined to strings automatically

quartz kindle
#

so it doesnt support null and undefined

fringe badge
#

it means you get those as strings

#

not as value

quartz kindle
#

yes but what do you want the function to do?

#

do you want the function to auto convert or error?

fringe badge
#

task means you get err

quartz kindle
#

if the user gives null and not "null"

#

because you said it has to support null and undefined as delimiters

fringe badge
#

as strings

quartz kindle
#

the there is no difference

#

its just single char or multichar strings

fringe badge
#

undefined and "undefined" are 2 completely different values ​​within the task

#

it is assumed that "undefined" is sent

quartz kindle
#

so there is nothing about supporting null and undefined

fringe badge
#

bruh

quartz kindle
#

bruh

fringe badge
#

You still don't get it

quartz kindle
#

you said

#

The delimiter can be a character, null, undefined, or a string of several letters

#

implying null and undefined are non-string values

fringe badge
#

The delimiter can be a string equal to character, null, undefined, or a string of several letters

#

I've already said this about 4 times

quartz kindle
#

then why not just say the delimiter has to be a string?

#

a character is a string

#

null is a string

#

undefined is a string

#

several letters is a string

#

why specify null and undefined separetely as if they were somehow special

fringe badge
snow urchin
quartz kindle
#

because the way is phrased looks like a trick question

fringe badge
#

idk

#

I just found it today on the Internet

quartz kindle
#

then i assume they want you to do ```js
if(delimiter === null || delimiter === undefined) { delimiter = delimiter.toString() }

quartz kindle
#

lol ok

fringe badge
#

The fact that the delimiter is always a string was written by the one who published it in the comments to the post, because I'm not the only one who asked this question

#

But actually it’s just solves with .split(delimiter)

#

I saw a lot of HRs asking this task to a new devs

#

When I saw it first time in the internet I thought “wtf why someone would use something like that instead of .split”

quartz kindle
#

because its faster

fringe badge
pale vessel
#
function split(str, delimiter) {
    if (typeof delimiter === "number" && !isNaN(delimiter)) delimiter = delimiter.toString();

    const arr = [""];
    let skip;
    
    if (typeof delimiter === "string") for (let i = 0; i < str.length; i++) {
        if (str.slice(i).startsWith(delimiter)) {
            skip = i + delimiter.length;
            arr.push("");
        }
        if (skip === i) skip = null;
        if (typeof skip !== "number") arr[arr.length - 1] += str[i];
    } else arr.push(str);

    return arr;
}```
quartz kindle
fringe badge
#

oops

#

good job

quartz kindle
#

very inefficient tho xd

pale vessel
#

as long as i could complete my homework

fringe badge
pale vessel
#

i don't think so

quartz kindle
#

it isnt lol

fringe badge
#

@pale vesselbtw why do you need if (delimiter)

pale vessel
#

i changed it a little

#

it's to make sure it's a string

quartz kindle
#

flazepe's function vs string.split

pale vessel
quartz kindle
#

lel

fringe badge
prime mist
#

This is a long conversation over String.prototype.split lol.

solemn latch
#

sometimes its worth discussing stuff like this

prime mist
#

What was the actual issue?

prime mist
snow urchin
prime mist
#

As is, what key are you checking for duplicates?

snow urchin
#

title

#

I want it to ignore all remix's too, so if it has anything like (X Remix), its also removed

prime mist
#

OK, use a map/object and do a reduce on the array. For example:

songs.reduce((results, song) => {
  const cleanTitle = song.title.replace(/\(.*?\)/g, '').trim();
  if (results[cleanTitle]) return results;
  results[cleanTitle] = song;
  return results;
}, {});
snow urchin
#

ok, and how can I return the reduce in array form?

prime mist
#

Why are you calling JSON.parse twice? lol.

#

You can use Object.values() to extract the values as an array.

grizzled raven
#

is data.songs a stringified json?

digital saffron
#

are you guys getting Error 500 too on the API? monkaSHAKE

#

ah ok, forgot to ckeck their website

eternal osprey
#

hey what is wrong with dsicord

#

many servers have a 'cannot load messages' error?

vivid fulcrum
#

literally read a single message above

digital saffron
#

seems to be working again, at least on my side hmmmm

opal plank
#

mY BoT GEttINg ErROrS

#

thank you discord

weary crypt
#

I think someone else was getting errors as well earlier

swift dew
split hazel
#

just looking for some small advice im rewriting a website thats currently in express and html, moving to express and ejs (i really dont need anything more advanced than ejs and its simplicity is enough) and im looking at implementing a route system. is there any open source library that has a nice already set out route handling system or should i just write my own one (by route i mean splitting my routes into different files and loading them)

solemn latch
#

as in views? thats built into express, same method as you would with html

split hazel
#

actually no worries i found what i was looking for with the express boilerplate generator module

#

saved a lot of time haha no need to setup sass, ejs and starter things myself

solemn latch
#

I mean, sass youd typically just put in public, ejs is just setting the view engine.

opal plank
#

https://koajs.com/
Koa is a new web framework designed by the team behind Express, which aims to be a smaller, more expressive, and more robust foundation for web applications and APIs. By leveraging async functions, Koa allows you to ditch callbacks and greatly increase error-handling. Koa does not bundle any middleware within its core, and it provides an elegant suite of methods that make writing servers fast and enjoyable.

split hazel
#

i'll have a look

sudden geyser
#

all these frameworks are boring!

earnest phoenix
#

SyntaxError: Cannot use import statement outside a module
So I am kind of confused by this as I should be able to import yet this error is throwing

#

All i am doing is importing my client class to my main file and running a method on it once I created an instance of the client class

terse finch
#

Is there anyway i can call the async function server_load() in the __init__ method of the class. It only needs to run server_load once per instance. Help is greatly appreciated

class SetupCog(commands.Cog, name='Setup'):
    def __init__(self, bot):
        self.bot = bot
        self.serverSettings = []
        await server_load(self) # <--- This line specifically
    
    async def server_load(self):
        async with aiosqlite.connect('/cross-bot-code/ban_list.db') as db:
            async with db.execute("SELECT * from server_settings") as cursor:
                async for row in cursor:
                    self.serverSettings.append(row)
        print(self.serverSettings)
#

or is there a way to run server_load() from the object during the setup() function for loading the cogs? i cant make the setup function async cause discord.py yells at me for not awaiting it

earnest phoenix
#

You can do self.bot.loop.create_task(self.server_load())

#

You can omit the leading self. as bot is a valid local

terse finch
#

is that inside the class or outside the class?

terse finch
elfin vale
#

Deleted slash commands are still showing up. How to delete them?

rapid wharf
#

In D.py,
can this be used to avoid index error??

@client.event
async def on_error(error):
    if isinstance(error, IndexError):
        pass
earnest phoenix
#

You do that and no errors will get raised whatsoever. In fact, that's not how the on_error event works. I'd suggest you do a check with if to avoid the error or just do try and except.

rapid wharf
#
 if message.content[0] and message.content[-1] == '/':

Every string has a 0 and -1 so how came this error pop up??
Error: IndexError: string index out of range

earnest phoenix
#

Just add another condition, if message.content and message.content[0] ...

earnest phoenix
#

What you're doing is essentially just if message.content.endswith('/') tbh

rapid wharf
#

see the code

#
@client.event
@commands.bot_has_permissions(manage_webhooks=True)
@commands.bot_has_permissions(manage_messages=True)
async def on_message(message):
    if message.content[0] and message.content[-1] == '/':
        emoji_name = message.content[1:-1]
        for emoji in client.emojis:
            if emoji_name == emoji.name:
                webhooks = await message.channel.webhooks()
                webhook = discord.utils.get(webhooks, name="Imposter NQN n Sexy Aimi")
                if webhook is None:
                    webhook = await message.channel.create_webhook(name="Imposter NQN n Sexy Aimi")
                if message.reference is None:
                    await message.delete()
                    await webhook.send(str(emoji), username=f'{message.author.display_name}  .aimi',
                                    avatar_url=message.author.avatar_url)
                else:
                    ref = message.reference
                    msg = await message.channel.fetch_message(id=ref.message_id)
                    em = discord.Embed()
                    em.set_author(name=msg.author.display_name, icon_url=msg.author.avatar_url)
                    em.add_field(name='Message:', value=f'{str(msg.content)}')
                    await message.delete()
                    await webhook.send(str(emoji), embed=em, username=f'{message.author.display_name}  .aimi', avatar_url=message.author.avatar_url)
    await client.process_commands(message)
earnest phoenix
#

What if there is no message.content at all though

#

iirc sending an image makes content null doesn't it?

earnest phoenix
earnest phoenix
#

Ah

rapid wharf
#

ohhhhh ok ok, but how to tackle that empty string

earnest phoenix
rapid wharf
earnest phoenix
#

" /" will evaluate to True btw, you need to do str[0] == ... and str[-1] == ... instead

earnest phoenix
stable eagle
#

Error: /home/runner/wizardmurphy-js/node-modules/better-sqlite3/build/Release/better_sqlite3.node: invalid ELF header

#

What is this error ans why is it happening?

lusty quest
earnest phoenix
#

If you pass a string like "1" to Number it will parse it into a valid number right?

earnest phoenix
#

Thought so

lusty quest
#

or use parseint on a string

earnest phoenix
#

Number and parseInt do the same thing no?

lusty quest
#

yesnt

#

parseInt parses numbers to numbers out of strings

earnest phoenix
#

Just if you do something like 1a it will only take the number

#

whereas Number returns NaN

copper cradle
#

you can pass both perms to the same decorator

#
@commands.bot_has_permissions(manage_webhooks=True, manage_messages=True)
rapid wharf
copper cradle
#

yeah but I'm giving you a suggestion

#

the name of the decorator is xx_permission**s**, so once can guess it accepts multiple parameters, you can also check the definition of it in the lib

faint stump
#

I was trying to do with a simple command like this:

const Discord = require('discord.js')
const Client = new Discord.Client()

module.exports = {
    name: 'test',
    description: 'Insert text here',
    execute(message, args) {
        const emojitest = Client.emojis.cache.get("Emoji id here")
        message.react(`${emojitest}`)
    }
}

But then my bot responsed with undefined
Is there any way that bot can send custom emoji from command handler?
I searched everything on Google but I can't find anything :(
P/s: I was asking this question on May 31st but nobody answered so I ask again

pale vessel
#

don't create a new client on every command

#

you need to use the existing client, use message.client instead

#

new Discord.Client() just initializes a new Client and it won't have any properties that you need

lusty quest
#

someone got an idea why ts completely ignores a tsconfig.json even tho its passed to it?

earnest phoenix
#

different directories

#

well are you sure? that the config and the main index file must be on the same folder

lusty quest
#

it loads the config, the path is spezified when i pass it to the build command

#

also it yells if the path is wrong

earnest phoenix
#

is tsconfig.json in the same file as your index.ts or the file that you run

#
{
    "compilerOptions": {
      // Put things you want inside compilerOptions
    }, // Other stuff
}

make sure it looks like this

lusty quest
#

ive had the project running

#

just it decided to not run

earnest phoenix
#

well if tsconfig.json does not work then use jsconfig.json and see

#

if you run your ts project through tsc

lusty quest
#

? i just use it for compiling, running i do over the debugger

earnest phoenix
#

well nvm

#

well i run by typing ts-node . directly

#

idk what args areyou using

#

so i can't help

cinder patio
#

what command are you running

#

tsc?

lusty quest
#

tried tsc and using build command in vsc

prime mist
#

What is the error / actual issue?

lusty quest
#

it reads the node_modules folder even tho the tsconfig say ignore it

prime mist
#

Try adding skipLibCheck to your options.

#

I usually use include to only select my src directly as well 🙂

earnest phoenix
#

Do you think a skip button for tour is needed?

stiff lynx
#

I cant get the ID of animated emojis because I dont have the nitro

#

rip

earnest phoenix
#

add a \ before it

stiff lynx
#

emojis

#

idk why

#

it says that I cant because I dont have nitro

earnest phoenix
#

add a \ before it,it works for everyone

stiff lynx
#

:beeg_yoshy:

#

look

earnest phoenix
#

did you add a \ before it?

stiff lynx
stiff lynx
earnest phoenix
#

see it work

#

you don't need nitro to get an id of an normal emoji

stiff lynx
lament rock
#

If your bot caches emojis, you can get the ID that way

earnest phoenix
#

:starry:

stiff lynx
earnest phoenix
#

client.emojis.cache.find(x=>x.name==="")

stiff lynx
earnest phoenix
#

that is for discord.js

stiff lynx
#

Ik, I'm using discord.js but how I choose the emoji that I want to get?

copper cradle
#

they literally just sent you the code

quartz kindle
#

if you're on pc you can use the dev tools

rapid wharf
#

@slender thistle sir u told me to you paginator for a feature and you send its link also, but i can not find that in google can u send its link again plz...

hard fiber
#

Hi there, I was using the autopost=True from https://docs.top.gg/libraries/python/ to post guild count and it works fine. But I wanted to change the interval so I switched to a Task but when the tasks executes I get an error like:

Unclosed client session
client_session: <aiohttp.client.ClientSession object at >

my Cog is this:

import asyncio
import os

import dbl
import discord
from discord.ext import commands, tasks

import utils.helper as helper


class DBL(commands.Cog, description="top.gg events"):
    def __init__(self, bot):
        self.bot = bot
        self.bot.dbl_token = os.getenv("DBL_TOKEN")
        self.bot.dblpy = dbl.DBLClient(self.bot, self.bot.dbl_token)
        self.update_stats.start()  # start the loop when the cog is loaded

    def cog_unload(self):
        self.update_stats.cancel()

    @tasks.loop(minutes=2)
    async def update_stats(self):
        """This function runs every 30 minutes to automatically update your server count."""
        try:
            await self.bot.dblpy.post_guild_count()
        except Exception as e:
            print('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
            

    @update_stats.before_loop
    async def before_update_stats(self):
        await self.bot.wait_until_ready()
        await asyncio.sleep(5)


def setup(bot):
    bot.add_cog(DBL(bot))
Top.gg documentation

Official Top.gg Python library

slender thistle
#

Typed it out by hand ezpz

rapid wharf
slender thistle
#

idk bro

rapid wharf
#

how to use

slender thistle
#

Wait hold on what

hard fiber
#

will take a look at it, thnx. I just tried manually dispatching self.bot.dispatch("guild_post") and implementing

@commands.Cog.listener()
    async def on_guild_post(self):

and it worked just fine

thnx @slender thistle

slender thistle
rapid wharf
#

Thank youuu poggythumbsup

stiff lynx
#

<: soldi:849950802377572352 >
for sending a the emoji with the bot, wich part of the ID I have to put inside my code

#

all?

hard fiber
#

@slender thistle Nope, I still get that warning on my console. what is the difference between topggpy and dbl
I saw that you maintain topggpy but the syntax looks the same to me.
Is there any difference in the code ?

rapid wharf
#

y r doing correct

#

just some spaces

stiff lynx
#

I've put the spaces for no getting the emoji

rapid wharf
#

its correct

stiff lynx
rapid wharf
rapid wharf
#

yes

stiff lynx
#

ty 🙂

hard fiber
#

@slender thistleI get the same warning even with your copy if dbl

earnest phoenix
#

i need a dark theme color palette for my website
should i steal discord's css

slender thistle
#

But the main differences are webhook changes and data models. Can't exactly look into why the warning persists though, and can't fix it either since my laptop isn't in a good condition

hard fiber
slender thistle
#

Feel free to make an issue on the repo. I'll give it a look when I'm... able to, so to speak

stiff lynx
#

A embed can have more than one Description?

slender thistle
#

More than one field, only one description

#

A field can contain a name and value

stiff lynx
#

ty

prime mist
#

Yeah only one description.

earnest phoenix
#

i can see that some here does not know how to use typescript/javascript 🤣

#

What

dusky lagoon
#

Ok so i have this https://rebane2001.com/queuepeek/data.json online json file and its big
currently i use this for the discord .json file

const Discord = require("discord.js");
const got = require("got");

module.exports = {
  name: "2b2t",
  aliases: [],
  description: "random anime meme",
  run (message, args) {
    const embed = new Discord.MessageEmbed();
    got("https://www.reddit.com/r/2b2t/random/.json").then((response) => {
      let content = JSON.parse(response.body);
      let Title = content[0].data.children[0].data.title;

      embed.setTitle(`${Title}`);

      message.channel.send(embed);
    });
  },
};``` only i dont know how i can use it with the other link
cinder patio
#

oof... you do know that's your parsing that giant json file and putting it in memory every time soneone uses the command right

earnest phoenix
#

why not export function but module.exports

#

are you too outdated bruh

#

or is javascript not supporting that

dusky lagoon
#

and thats 1 thing

#

the json file updates it self

vivid fulcrum
earnest phoenix
#

are you running your bot on chrome?

#

or firefox?

umbral vortex
vivid fulcrum
#

also every browser that's post 2016 has es6 support lol

earnest phoenix
#

well i'm not asking you ahmed i'm asking you @earnest phoenix do you think you can do it

#

yup

#

webpack index.js

#

¯\_(ツ)_/¯

#

well have fun getting spammed by errors

#

Que

#

There are so many Parcel, Browserify,gulp, Babel,webpack,grunt

#

there's no problem with using commonjs instead of es6

cinder patio
#

If I was using node.js with plain js I'd take module.exports any time over the es6 imports

earnest phoenix
#

I love imports

#

the es6 imports are good
but not good enough

tired panther
#

then they are bad lol

earnest phoenix
#

i only use them when writing react code

cinder patio
#

nah es6 imports are better than commonjs but if you want to use it in node.js without a transpiler you'd have to end all your javascript files with mjs

earnest phoenix
#

that's the problem right there

#

writing code in deno is a different story

cinder patio
#

or just using typescript with node.js

earnest phoenix
#

you can just run typescript projects using ts-node directly

#

instaed of compiling and using node

earnest phoenix
wary flame
#

ts-node = tsc && node

#

Really

sharp saddle
#

how do buttons work in discord.js?

vivid fulcrum
#

they don't

wary flame
#

They don't

#

DJS v13 can receive button clicks

#

Not register buttons

cinder patio
#

yeah you can setup a script which runs tsc and then node

sharp saddle
#

interesting

vivid fulcrum
#

or alternatively, fork djs and merge the pr yourself

cinder patio
#

I use ts-node only when I need to run files which I don't want to get compiled

#

like tests

hexed vortex
#

okay so the thing i use kinda sucks to keep my bot online so im moving it HOWEVER its not moving servers, its not going offline, i use github desktop, heroku to host it, im trying to move servers and if i do i have more acces, im gonna use uptime robot with repl.it BUT i want the bot to still be on top.gg cause i dont want to wait again, because then i will have to re-sign up the bot, can someone help me with this problem, I want to re-make the bot with all its og code, like clone it

wary flame
#

I just use ts-node to prevent compiler output mess. In production I use tsc + node for faster restart times

hexed vortex
#

i deleted the repostory AND the heroku app

wary flame
#

Recreate the repo

hexed vortex
hexed vortex
#

im switching servers

earnest phoenix
#

replit moment
running node -v in a deno repl outputs a version higher than what you get in actual node repls

wary flame
earnest phoenix
#

They do

hexed vortex
opal plank
earnest phoenix
#

Erwin, i have a challenge for you

opal plank
hexed vortex
#

I AM IN NEED OF BIG HELP

opal plank
earnest phoenix
#

Stop saying detritus is better than djs

wary flame
#

@hexed vortex create a new github repo, push local code and use the github repo as base for repl.it

opal plank
#

imagine a lib that keeps up with the new changes of discord

quasi elbow
#

is there a way to see how long a bot has been pending?

opal plank
hexed vortex
opal plank
#

both have in mind the same thing: being a discord wrapper for bots.

#

its fair to compare both

earnest phoenix
vivid fulcrum
#

no

hexed vortex
#

ok i need BIG help someone

earnest phoenix
#

they're both pog

quasi elbow
crimson vapor
#

bedrock fuckin sucks

vivid fulcrum
#

djs got lost in their own design and abstractions

quasi elbow
#

bedrock is terrible

opal plank
#

even the original authors ditched it for eris lmao

crimson vapor
#

I can't wait for the new djs tho

opal plank
#

just use detritus and yo wont have to wait

crimson vapor
#

I really hope its as good as ive heard its supposed to be

opal plank
#

spoilers: it wont

crimson vapor
#

its not like the devs can't code

#

a rewrite should be pog

opal plank
#

yeah good luck rewriting trash

dusky lagoon
#

sooo i have this problem that my bot only gives me 1 leter and what i mean by that is that in the .json file it says "queueest": "7h 50m", "queuepos": "424" and the bot gives me position in queue: 4 Estimated time: 7and here is the code ```js
const Discord = require("discord.js");
const got = require("got");

module.exports = {
name: "queuepeek",
aliases: [],
description: "random anime meme",
run (message, args) {
const embed = new Discord.MessageEmbed();
got("https://rebane2001.com/queuepeek/data.json").then((response) => {
let content = JSON.parse(response.body);
let pos = content.queuepos[0]
let est = content.queueest[0]

  embed.addField("position in queue:", `${pos}`, true)
  embed.addField("Estimated time:", `${est}`, true)

  message.channel.send(embed);
});

},
};

opal plank
#

it gets the first letter

hexed vortex
opal plank
#

just dont do that , get the full string

dusky lagoon
#

hahaha sorry my brain went ogaa booga thanks

wary flame
#

@hexed vortex you literally dm-ed me yet you're still here spamming for support without giving clear details of the issue

hexed vortex
#

IT WENT OFF

#

proof that it has laggy servers XD it took 10 mins to go off

vivid fulcrum
#

maybe rent a proper vps and it won't lag

#

stop complaining about something that's free lol

dusky lagoon
#

how do i get a embed message in ```css
[this kind of box]

vivid fulcrum
#

it's free for a reason

vivid fulcrum
#

just put that codeblock in the embed description//field value

dusky lagoon
#

Well its a string embed.addField("Estimated time:", `${est}`, true)

vivid fulcrum
#

???????????????????????

#

how does that matter

dusky lagoon
#

it does

vivid fulcrum
#

ho w

dusky lagoon
#

because you use `

hexed vortex
#

what does that mean

vivid fulcrum
#

so??

#

escape the backtick lol

wary flame
#

\`

hexed vortex
#

bad gateway?? what does that mean

vivid fulcrum
#

server sided error

wary flame
#

Look at your server logs

hexed vortex
hexed vortex
vivid fulcrum
#

that the error happened on the side of the server

#

you need to give more context about the issue if you want me to give you a concrete answer

dusky lagoon
vivid fulcrum
#

so??

#

escape the backticks 3 times to open the codeblock

wary flame
#

Don't use an embed?

vivid fulcrum
#

put your value

wary flame
#

Just send a codebox containing text

hexed vortex
#

wtf it says its on but its not@

vivid fulcrum
#

your app being online != your bot being online

opal plank
#

probably failed to connect to the gateway or failed to identify

vivid fulcrum
#

this

sharp saddle
vivid fulcrum
#

free services often use shared ips

#

if someone does a fucky wucky on their account and discord bans them

#

the ban goes global because of the shared ip

#

aka

#

stop 👏 using 👏 free 👏 hosting 👏

earnest phoenix
#

happens on glitch too many times

hexed vortex
wary flame
#

Just get an old raspi for a couple bucks

hexed vortex
#

using uptime robot

sage bobcat
#

One message removed from a suspended account.

sudden geyser
#

build your own aws at home

hexed vortex
#

what does bad gateway MEAN!

wary flame
#

Server sided error

vivid fulcrum
#

give more context oh my god

wary flame
#

Just like all other 5xx errors

sudden geyser
#

Google is your best friend in many situations

vivid fulcrum
#

that's like saying "bring me food" and then getting mad that you didn't get mcdonalds

hexed vortex
wary flame
#

Context would also be what "it" is

#

That contains your email

#

Don't

vivid fulcrum
#

pro version of bots 🤣

dusky lagoon
#

```````\c\s\s [position in queue: ${pos} Estimated time: ${est}]``` ``` ok so im trying to add the color for the code box but im obviously doing something wrong

#

btw thanks @vivid fulcrum

hexed vortex
vivid fulcrum
#

why are you trying to escape the letters c and s

#

remove the backslashes between c s s

#

and add \n after it

hexed vortex
#

the bot is still off

wary flame
#

@hexed vortex if Uptime robot gives a 502 error that means while trying to ping your webserver the webserver responded with a 502 error, just like all 5xx errors 502 is a server sided error so check the logs of your webserver

wary flame
#

I don't use repl.it (get an actual vps lol) Google how to view logs on repl.it

hexed vortex
#

oh

#

my client.login is not working?

'

wary flame
#

Error?

crimson vapor
#

is there an error?

vivid fulcrum
#

not to sound condescending or rude but the effort you're going through right now is futile

#

nobody will buy your pro version

#

you could also just merge those two bots into one app

wary flame
#

Also isn't using a service like uptimerobot to keep a repl.it process only against Thier tos?

#

@hexed vortex

#

Did he just leave the conversation?

hexed vortex
wary flame
#

Check if the server is premium

wary flame
#

Oh runninh commands

crimson vapor
#

I thought it was against glitch and repl.it's tos

vivid fulcrum
#

i'm going to remind you that your app might contain your bot, but your app is not exclusively your bot

#

the node app can do more things than just a client.login

#

i.e. you can run two clients in one app

#

or even better

wary flame
#

@hexed vortex tos 5.13

crimson vapor
#

yeah,
it could run this

for(let i=0;i<100;)console.log((++i%3?'':'fizz')+(i%5?'':'buzz')||i)```
wary flame
#

Youre not allowed to do uptimerobot

vivid fulcrum
#

abolish the premium bot account and just merge the premium functionality with the regular bot

#

but again

#

nobody will buy your premium/pro/whatever

#

it isn't in it for the users because your bot isn't special nor popular

#

and from what i've seen, probably not very performant either

crimson vapor
#

probably shouldn't be taking payments if you don't know how to host it

wary flame
#

@hexed vortex how old are you?

opal plank
crimson vapor
latent heron
#

i mean it's not impossible

#

some people are successful at doing bot commissions

crimson vapor
#

and some bigger bots actually make money

#

but it takes a lot of work

#

and I doubt many people broke even

#

either with the time they put in

#

or even money invested to grow

latent heron
#

i mean you gotta put money into the bot to get money out of it

#

that's the effort required

crimson vapor
#

yeah and then there's developing it, managing it, then managing a server or vps

#

as well as dealing with support

hexed vortex
#

geez my bot STILL isnt on!

crimson vapor
#

well its either your code or the repl you are using

crimson vapor
#

did you write code?

hexed vortex
#

oh XD

hexed vortex
crimson vapor
#

then either your code is broken or the repl has an issue

#

its most likely your code but it could be the repl

hexed vortex
#

here is the begginging of the code

#

this is starting the code

const express = require("express")
const app = express()
const fs = require("fs")

app.get('/', (req, res) => res.send('Online!'))

app.listen(3000, () => {
  console.log("Project is ready!")
})

let Discord = require("discord.js")
let client = new Discord.Client()

const activator = "!"

client.once('ready', ()=>{
    console.log('I Am Banking Now!')
    client.user.setActivity('!help', {type: 'WATCHING'})
})
cinder patio
#

you never login with the bot

hexed vortex
#

it only sends this in log
Project is ready!

hexed vortex
#

client.login("IM NOT SHOWING THE TOKEN")

dusky lagoon
#

Ok so the .json looks something like this and im trying to extract the name part to get a list of the names how would i be able to do that any ideas??```js
"players": [{
"name": "Randomplayer1",
"uuid": "5fca3238-6974-4cf1-872b-961db4e93778",
"updated": 1622728257,
"skin":"https://textures.minecraft.net/texture/ba782b7c6e01fbdd838779003b5b261de3ee9cee0561783a85ff2c741f7f0a70"},
{
"name": "Randomplayer2",
"uuid": "5fca3238-6974-4cf1-872b-961db4e93778",
"updated": 1622728257,
"skin":"https://textures.minecraft.net/texture/ba782b7c6e01fbdd838779003b5b261de3ee9cee0561783a85ff2c741f7f0a70"}]

cinder patio
hexed vortex
#

none of the code is wrong it says

#

its saying this now i figured something out

crimson vapor
#

then the client is never getting ready

hexed vortex
hexed vortex
#

client.login("NOT SHOWING TOKEN there is a token here")

crimson vapor
#

I think thats the issue

hexed vortex
hexed vortex
crimson vapor
#

ah

earnest phoenix
#

That's not where the error comes from

crimson vapor
#

can you send a screenshot of the entire code?

#

minus the token ofc

earnest phoenix
#

You probably have a parentheses, bracket, comma or something like that missing before client.login()

hexed vortex
earnest phoenix
#

I recommend using a linter

hexed vortex
crimson vapor
#

copy and paste as much code as you can, starting from the bottom
remove the token

#

we don't care for your code, just the syntax

hexed vortex
#

there

#

brb

earnest phoenix
hexed vortex
#

oh

earnest phoenix
hexed vortex
#

app.get('/', (req, res) => {
res.send('Online!')
})

app.listen(3000, () => {
console.log("Project is ready!")
})

#

is that beter

earnest phoenix
#

That's correct yes

hexed vortex
#

i hate switching servers

crimson vapor
#

tbh

#

if you knew what to do

#

you would probably have that in another file

earnest phoenix
#

You don't even need that, you have that for no reason

tardy hornet
earnest phoenix
hexed vortex
#

i use uptime robot

earnest phoenix
#

It serves no purpose for your bot

crimson vapor
#

@tardy hornet this is not in a loop

hexed vortex
#

well i mean

crimson vapor
#

I think you meant it to be

tardy hornet
#

then how can i make it a "loop"

slender wagon
#

Heya so i am making a javascript file that will be hosted as a cdn.
I got 250 domain names and i want to change their title based on the array list that i have, what would be an easy way that i could do that using js

rigid shadow
#

Is there any way to use \t in an embed message? 🤔

cinder patio
lusty quest
#

escape it

hexed vortex
vivid fulcrum
#

using json as a database

#

oh for why

hexed vortex
rigid shadow
earnest phoenix
#

Doesn't Discord strip whitespaces

earnest phoenix
rigid shadow
#

oh I'll try it

vivid fulcrum
hexed vortex
vivid fulcrum
#

a common method to bypass this is just to use a zero width space

hexed vortex
#

its bank.json

vivid fulcrum
#
"\u200b\t"

will place an invisible char then a tab char and discord won't strip it because the zero width space is there

lusty quest
#

i wish they would just use sqlite instead of json for this stuff

vivid fulcrum
#

lost cause

hexed vortex
#

wait is .json files not supported

earnest phoenix
#

Seems like it's stripped anyway

rigid shadow
#

it still show just a \ then

vivid fulcrum
#

huh did they change that

#

sec

slender wagon
#

aye is there a way i could get the domain name through javascript?

earnest phoenix
hexed vortex
#

and is that why im getting a error

earnest phoenix
#

no, that's not the cause of your error but you can use a real database like MongoDB or postgres

dusky mason
#

anyone got an idea on how i can make this bot unban me whenever i get banned?

rigid shadow
lusty quest
#

sqlite would be already good enough tbh

dusky mason
#

i wanna troll my friend in his server whenever he bans me

#

in python i thought that i can do on_event

#

but apparently that doesn't exist

#

i was thinking like
@client.event
async def on_event blah blah

#

but that doesn't work

dusky mason
#

oh perfect

#

so i would basically do

#

on_member_ban for the event thing

#

and put it up to my id and if it matches just unban?

earnest phoenix
#

Make sure you got the bans intent enabled or otherwise it won't fire

dusky mason
#

ohh alr, will do

#

wait @earnest phoenix does the bans intent fall under the default one?

earnest phoenix
#

Yes

dusky mason
#

oh alr

#

i already have that

#

im just confused on how to set up the beginning

#

like i have the on_member_ban but like do i need the if statement saying if my id is banned or something

#

because how would i look for my id in the ban list

rigid shadow
#

I want that all the numbers start at the same position, usually a tabulator after the emoji should work, but apparently I'm not able to use tabulator in an embed message.

Even not with \u0009, \\\t, \t and \u200b\t.
Any ideas? 🤔

earnest phoenix
#

Why not just use padding (String.prototype.padStart(), String.prototype.padEnd())

vivid fulcrum
#

alternatively

#

that seems like an embed, just use inline fields

#

one field to store the column name

crimson vapor
#

o

vivid fulcrum
#

another to store the values

opal plank
crimson vapor
#

no

#

I want to be here

rigid shadow
vivid fulcrum
#

uh

#

no?

dusky mason
#

oh wait i think i got it

earnest phoenix
dusky mason
#

yeah if i do

rigid shadow
#

What you saw is already a field

dusky mason
#

then unban me

vivid fulcrum
#

oh

#

can you show your current code

earnest phoenix
#

I'm not sure if that's kind of API abuse but w/e mmulu

rigid shadow
#

should be the relevant part

dusky mason
#

i mean im using it in only 1 server

vivid fulcrum
#

all of it please

#

well

dusky mason
#

it's just a troll bot i made in one server with my friends

vivid fulcrum
#

just the embed part

dusky mason
#

they normally abuse their perms and ban me as a joke mmLol

rigid shadow
#

rip formatting

vivid fulcrum
#

oh you already are using inline fields

rigid shadow
#

yeah as I said

dusky mason
#

wait

#

would this work

#
@client.event
async def on_member_ban(guild, member, ctx):
    if member.id == 337025706426892288:
        await ctx.guild.unban(member, reason="troll")```
vivid fulcrum
#

yeah there's not much you can do

#

there's a slight trick

earnest phoenix
#

Incredible bot name

dusky mason
#

^

vivid fulcrum
#

ikr

#

that'll always have universal padding because they're actually two fields

#

and internally, two separate divs

rigid shadow
#

I mean it's not that bad, would just look a bit cleaner if they are all in the same line

digital saffron
#

what would be a good permission to require for a prefix command? since admin perm requirement is not allowed

rigid shadow
#

but ty anyway

marble juniper
#

manage guild

#

lol

digital saffron
#

must have overlooked that one Facepalm makes sense

#

oof

marble juniper
#

stinky

digital saffron
#

ty tho :D

earnest phoenix
#

np

dusky lagoon
#

ok so im trying to filter a array this is how it btw looks like js "players": [{ "name": "Randomplayer1", "uuid": "5fca3238-6974-4cf1-872b-961db4e93778", "updated": 1622728257, "skin":"https://textures.minecraft.net/texture/ba782b7c6e01fbdd838779003b5b261de3ee9cee0561783a85ff2c741f7f0a70"}, { "name": "Randomplayer2", "uuid": "5fca3238-6974-4cf1-872b-961db4e93778", "updated": 1622728257, "skin":"https://textures.minecraft.net/texture/ba782b7c6e01fbdd838779003b5b261de3ee9cee0561783a85ff2c741f7f0a70"}] but im trying to filter it with this let player = content.players.filter(players => players.name) and that doesnt work

#

to get a list of the names

earnest phoenix
#

why not just map

cinder patio
#

filter does exactly what'd you expect it to do...

#

map is the right function for this

dusky lagoon
earnest phoenix
#

Okay

cinder patio
#

how does that change anything

earnest phoenix
#

You can still map the data

dusky lagoon
#

like the website updates itself

earnest phoenix
#

Okay

#

and you are getting the data no?

#

If you want a array of names

#

map it

cinder patio
#

literally just replace the filter with a map and you're done