#development

1 messages · Page 1291 of 1

opaque seal
#

But I want credits for it

quartz kindle
#

then you have MIT which is basically do whatever the fuck you want with it

#

check this out

opaque seal
#

But I want credits for it
what would be the right one for this?

quartz kindle
#

A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.

#

yes, with MIT they must preserve the copyright and license notices

#

unless they heavily modify it

opaque seal
#

Idk what those terms mean one sec

wooden wigeon
#

How would I get a hex value as input from a user (#ff0000) and then convert it to type hex (0xff0000) and then store it into json? I'm using Discord.py

opaque seal
#

Well I guess I'll go with MIT then, if that's what you suggest

sudden geyser
#

I think the int type has a second parameter to set the radix (int(hex_string, 16)).

#

the regular GPL is the same but only applies to distributed code (downloadable), not for hosted code
@quartz kindle so with GPL, the user can edit it in private but if they want to publish it, they need to make the source code public?

quartz kindle
#

yes

wooden wigeon
quartz kindle
#

they can use it privately as a server or even offer a service based on it, but they cannot offer a downloadable closed source program with it

#

they can still sell it tho

wooden wigeon
#

ok I think I got it

honest perch
#

how could i get a specific guild in djs

wooden wigeon
#

Yes, I got it, thank you very much!

#

I just had to remove the hash

sudden geyser
#

yep

glad heart
#

is it text or (text)[link]?

marble juniper
#

just

#

do it

quartz kindle
glad heart
#

alright thanks

marble juniper
#

imagine someone said ()[] as a joke

sudden geyser
#

[][]

honest perch
#

so im making a leaderboard and im getting the money from the database, but im not sure how i could display the users name

#

ejs and djs

quartz kindle
#

do you have their id in the database?

honest perch
#

yes

quartz kindle
#

use the id to fetch them

honest perch
#

yes but how could i fetch for each member

#

and then display the name

quartz kindle
#

if they are all in the same guild, you can fetch multiple members at once using guild.members.fetch({user:[id,id,id]})

pale vessel
#

forEach + fetch 😳

honest perch
pale vessel
#

maximum of 100 members right?

honest perch
#

forEach + fetch 😳
@pale vessel yes but how would i then place the right username with the money

#

my brain isnt developed enough

quartz kindle
#

result is an object of users from the database right?

#

does it contain an id?

honest perch
#

yes it does

quartz kindle
#

so ```js
for(let index in result) {
result[index].name = guild.members.cache.get(result.id).displayName
}

#

assuming you have all members fetched before that

honest perch
#

mhm

#

it returns of undefined

cobalt spruce
#

hmm

honest perch
#
  app.get('/leaderboard', function(req, res) {
    Money.find({serverID: 'REDACTED'}).sort([['money', 'descending']]).exec((err, result) => {
      const guild = bot.guilds.cache.get('REDACTED');
      guild.members.fetch();
      for (const index of result) {
        result[index].name = guild.members.cache.get(result.userID).displayName;
      }
      res.render(__dirname + '/views/leaderboard', {user: req.user, users: result});
    });
  });
quartz kindle
#

you need to await the fetch

cobalt spruce
#

.

honest perch
#

im fetching all the members from that guild

quartz kindle
#

also, change the of to in

honest perch
#

i made it an async function

violet haven
#

can u help me? i want do delete an embed after a reaction. i tried with message.delete but it doesn't work.

honest perch
#

but its telling me

#

its not an async function

quartz kindle
#

you need to make it async in the exec

#

async (err, result)

honest perch
#

ah right

violet haven
#
                    const getMusicPlayer = client.musicPlayer.get(message.guild.id);
                    let track = 0;
                    switch (reaction.emoji.name) {
                        case "1️⃣": track = tracks[0];
                            getMusicPlayer.queue.add(track);
                            message.channel.send(`${track.title} a été ajoutée à la playlist :musical_note: !`)
                            if (!getMusicPlayer.playing) getMusicPlayer.play();
                            break;}}```
#

i want to put something here to delete my embed pls

#
        .setAuthor(message.author.username, message.author.displayAvatarURL())
        .setDescription(`Voici les 5 premières recherches pour \`${q}\` :musical_note: `)
        .setColor("#0000FF")
        .setFooter(`Commande Play - 10 seconds to choose `, message.author.displayAvatarURL());```
honest perch
#

@violet haven messagevariable.delete()

tight plinth
#

@violet haven store the embed and delete it

#

ez

quartz kindle
#

wat

violet haven
#

messagevariable.delete(embed);?

honest perch
#

no

tight plinth
#

nah

honest perch
#

delete the actual message

tight plinth
#

you see the line where you send the embed

#

make that a variable

#

like

violet haven
#

ah with var instead of const?

tight plinth
#

let smth = await msg.channel.send...

honest perch
#

const xyz = message.channel.send(embed)
xyz.delete();

tight plinth
#

then you can just do smth.delete()

#

store it in the queue or smth

violet haven
#
            await playmsg.react("1️⃣");
            await playmsg.react("2️⃣");
            await playmsg.react("3️⃣");
            await playmsg.react("4️⃣");
            await playmsg.react("5️⃣");
            await playmsg.react("❌");```
honest perch
#

playmsg.delete();

violet haven
#

ok thx

honest perch
#

that would be it

#

tim help

#

im quite a stupid

tight plinth
#

@honest perch what's ur problem

honest perch
#

scroll above

#

idk anymore

#

async

#

fuck async

tight plinth
#

show error

honest perch
grave smelt
#

how can I write to a log file without having to recreate it every time?

honest perch
earnest phoenix
#

how can I write to a log file without having to recreate it every time?
@grave smelt read the file => add a few more lines describing your current log => overwrite the whole file

pale vessel
#

what

earnest phoenix
#

wdym

pale vessel
#

misly show more code

quartz kindle
#

dafuq u doing lmao

pale vessel
#

wait

#

what

#

shouldn't it be inside?

quartz kindle
#

exec(async () => {})

pale vessel
#

my brain

honest perch
#

dafuq u doing lmao
@quartz kindle yes

earnest phoenix
#

@honest perch restart your IDE that'll fix 99.99% of weirdass errors

pale vessel
#

that's not even

#

i need to relax

quartz kindle
#

lmao

honest perch
#

yes

#

tim

#

i have more

#

TypeError: Cannot read property 'displayName' of undefined

quartz kindle
#

that means the user was not found

honest perch
#

why was the user not found

quartz kindle
#

did you await the fetch?

honest perch
pale vessel
#

oh

#

old code fullbruh

quartz kindle
#

is the guild id the same as the serverID in the find function?

honest perch
#

yes

quartz kindle
#

ah i see why

#

result[index].userID

honest perch
#

result[index].userID = guild.members.cache.get(result.userID).displayName;

#

=

quartz kindle
#

no

pale vessel
quartz kindle
#

the other way around

honest perch
#

TypeError: Cannot read property 'displayName' of undefined

#

wait what

quartz kindle
#

result is the array

#

index is the index

#

you want to add a name to the user

honest perch
#

yes

quartz kindle
#

result[index].name = get name of result[index].userID

honest perch
#

what

earnest phoenix
#
def allowed_to_use(ctx):
    return ctx.author.id in bot.blacklisted_users


@commands.check(allowed_to_use)```

Raises this error : 

```fix
Ignoring exception in command ping:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
    await ctx.command.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 790, in invoke
    await self.prepare(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 744, in prepare
    raise CheckFailure('The check functions for command {0.qualified_name} failed.'.format(self))
discord.ext.commands.errors.CheckFailure: The check functions for command ping failed.```
honest perch
#

man im confused

pale vessel
honest perch
#

idk

pale vessel
#

this is a bruh moment

honest perch
#

yes

pale vessel
#

whose userID are you grabbing

honest perch
#

every userid in the db

pale vessel
#

it's in a loop

#

index is one of every members

#

result.userID would be invalid since there's no property called userID inside result

#

it's inside result[index]

honest perch
#

mhm

pale vessel
#

the id can be fetched the same way, with a different property

honest perch
#

yes

#

but

#

how

pale vessel
#

you didn't specify the index

#

you only need to add one thing

honest perch
#

but

#

what

#

is

honest perch
#

the index

pale vessel
#

result.userID is wrong

#

it would be result[index].userID

#

i'm trying to explain it to you in a way that you would get it on your own but i failed

#

you're looping through the indexes

honest perch
#

mhm

#

so for that part would it be ```js
result[index].name = guild.members.cache.get(result[index].userID).displayName;

pale vessel
#

yes

honest perch
#

that still returns TypeError: Cannot read property 'displayName' of undefined

pale vessel
#

another bruh moment

#

show the new code

#

also show what result looks like

ancient nova
pale vessel
#

that can get very big

ancient nova
#

it kinda is

#

had to zoom out

#

to take a screenshot

honest perch
ancient nova
#

oh you're not talking to m3

pale vessel
#

i was

honest perch
#
app.get('/leaderboard', async function(req, res) {
    Money.find({serverID: 'redacted'}).sort([['money', 'descending']]).exec(async (err, result) => {
      const guild = bot.guilds.cache.get('redacted');
      await guild.members.fetch();
      for (const index in result) {
        result[index].name = guild.members.cache.get(result[index].userID).displayName;
      }
      res.render(__dirname + '/views/leaderboard', {user: req.user, users: result});
    });
  });
ancient nova
#

ah I see

pale vessel
#

what about the leaderboard page

honest perch
#

<% users.forEach(function(user){ %>
<%= user.name %>
<% }); %>

#

but that doesnt error

#

its only the server side code

#

that errors

dense patio
#

@compact oriole i saw you mentioned some hosts in #topgg-api and i'm curious about galaxygate since that is the cheapest one that fits my needs the best

pale vessel
#

can you console.log(guild.members.cache)

#

after fetching them

honest perch
#

that returns every user

#

etc

quartz kindle
#

@honest perch then do this ```js
for (const index in result) {
let member = guild.members.cache.get(result[index].userID);
if(!member) { console.log("user not found:", result[index]); continue; }
result[index].name = member.displayName;
}

pale vessel
#

maybe one of them left the server?

molten charm
#

What does shards mean?

honest perch
#

yeah that loads

#

and it logged quite a few left

compact oriole
#

Well GalaxyGate is reliable

#

and at least the first dedicated plan gives a /48 ipv6 block

honest perch
#

@quartz kindle @pale vessel thanks for the help blurryeyes

dense patio
#

i don't have a domain or anything, what should i put in this hostname section? it says it's mandatory

pale vessel
#

anything

#

literally

honest perch
#

its just the name of the machine

compact oriole
#

where is that @dense patio ?

dense patio
#

on the purchase page

quartz kindle
#

@molten charm a shard is a connection to discord. they only allow each connection to have 2500 guilds, so if your bot has more guilds than that, it needs to start "sharding", which means splitting itself into multiple connections, each handling a specific number of guilds

dense patio
#

"Configure"

compact oriole
#

oh

honest perch
#

its just this

dense patio
#

ah

#

thanks

compact oriole
pale vessel
#

how many servers are there is the question

compact oriole
#

btw termius gang LUL

honest perch
#

yes

#

i wish you could customise themes

dense patio
#

is termius cheaper

compact oriole
#

termius is a ssh client

dense patio
#

wait

honest perch
#

termius is a ssh client

dense patio
#

yeah i just saw

compact oriole
#

it has a free tier but I use pro

#

as I get pro for free

honest perch
#

same lmao

dense patio
#

i use mobaxterm ¯_(ツ)_/¯

honest perch
#

sftp is great on it

quartz kindle
#

terminus > termius

compact oriole
#

they aren't even similar LUL

honest perch
quartz kindle
#

lmao

compact oriole
#

isn't terminus the android thing?

dense patio
#

what's the easiest way to transfer everything from my old server to this new one

honest perch
quartz kindle
compact oriole
#

oh

dense patio
#

what's the easiest way to transfer everything from my old server to this new one
@dense patio

honest perch
#

sftp

compact oriole
#

@quartz kindle ima check out terminus

honest perch
#

hacker command prompt gang

#

wait you can make this shit white

#

jesus

dense patio
#

is gcp better than galaxygate

pale vessel
#

probably but it's more expensive iirc

#

free trial though

dense patio
#

yeah i've been using it for about 10 months or so but the prices are crazy

#

i would be spending like 5 times less if i switched to galaxygate

#

at the same time, however, i trust gcp, and all of my bots are on it

earnest phoenix
#

what is code of total guild members i want to set in playing activity

dense patio
#

bold won't make your question get answered quicker

earnest phoenix
#

hehe

dense patio
#

what library are you using?

earnest phoenix
#

w8

#

a min

pale vessel
#

you can either grab cached user count or accumulate all guild member counts

#

combining all guild member counts will have duplicates

earnest phoenix
#

i using node 12.0.0

dense patio
#

that's not a library

pale vessel
#

i'm guessing he uses discord.js?

dense patio
#

yeah

earnest phoenix
#

yikes a help vampire

pale vessel
earnest phoenix
#

that's not a library
@dense patio then iam noob

pale vessel
#

How To Use C# ? @earnest phoenix

#

I am Noob

earnest phoenix
#

me biggest noob iam biggner

pale vessel
#

jeez

cinder sandal
#

how use js?

earnest phoenix
#

pray to god that he teaches you

it's an ancient skill

cinder sandal
#

pls tell

pale vessel
#

i see

earnest phoenix
#

how to check library

dense patio
#

you should... know

pale vessel
#

check your code

quartz kindle
#

@dense patio which tier are you using on gcp?

dense patio
#

tier?

earnest phoenix
#

ok i use

#

node index.js

quartz kindle
#

like which plan, how much ram etc

earnest phoenix
#

what is code of total guild members i want to set in playing activity

dense patio
quartz kindle
#

ah, ye those are expensive af

dense patio
#

yeah

#

forecasted cost this month is $90

quartz kindle
#

jesus christ

dense patio
#

i get a discount for having it online all month but still

quartz kindle
#

i pay $3 for all my bots

dense patio
#

that only brings it down a bit

#

holy

#

where?

quartz kindle
#

galaxygate lol

#

but i could run it on gcp's free tier as well

dense patio
#

hm the galaxygate option that was closest to mine costed $16 a month

quartz kindle
#

the problem with gcp is that lower end units have horrendous disk speeds

dense patio
#

how much ram does gcp's free tier have

quartz kindle
#

600mb

dense patio
#

ok nevermind lol

quartz kindle
#

xD

dense patio
#

so would it be worth it to switch to galaxygate?

pale vessel
#

doesn't sound so bad if you have a lightweight bot

earnest phoenix
#

google has super high quality servers, they don't oversell and don't cram in a vps on a shared machine
...but that shows in the price

shy iris
#

@earnest phoenix Hlw

quartz kindle
#

yes it would, however you may also want to check some alternatives, galaxygate sometime suffers from weird downtimes

dense patio
#

i have several bots on 1 vps and one of them is really big and is very resource intensive

pale vessel
#

groovy is hosted on gg right?

#

i think rythm too

#

not sure

shy iris
#

@earnest phoenix I cannot able to search anything on top.gg site (discord bots)

earnest phoenix
#

stop pinging me i don't care

quartz kindle
#

if you're ok with being located in europe, check out hetzner and contabo, they are one of the cheapest on the market

shy iris
#

@earnest phoenix mt maan maa chuda

honest perch
#

not contabo

quartz kindle
#

their machines are not high quality, but they give you more bang for the buck to compensate

dense patio
#

hm

earnest phoenix
#

i don't speak caveman

pale vessel
#

ooga booga

dense patio
#

hm

#

i'm still very hesitant about switching even if they have lower prices

honest perch
#

not high quality
yes because shitty quality

dense patio
#

look at the docs

pale vessel
#

you'd have to store their roles

#

preferably inside a database

quartz kindle
#

i only use google for their free tier, everything else they offer is way too expensive, no matter how good

earnest phoenix
#
                        let knpermissions = knallPermissions.filter(p => { return knMembro.hasPermission(p) }).map(p => `\`${permissoesJSON[p]}\``).join(', ');```
pale vessel
#

not in a json file of course

earnest phoenix
#

if your bot isn't super big i'd recommend going with providers like galaxygate

for bots like rythm it makes sense because to use google because of their reliability and some out of the box ddos protection

#

error in haspermission

honest perch
#

i can literally go upstairs

#

and grab an 2600

earnest phoenix
#

help pls

pale vessel
#

@earnest phoenix show permissoesJSON

dense patio
#

so i'm looking at hetzner and there's a lot of specific products that are confusing me

#

cloud, dedicated server, and managed server

earnest phoenix
dense patio
#

what's the difference

earnest phoenix
#

it's all correct

#

scaleway is also a good provider, the pricing is super nice

quartz kindle
#

cloud is a vps
dedicated is a physical machine
managed = they do everything for you, and you just pay

honest perch
#

dont bother with managed

dense patio
#

would cloud work? it's the cheapest by a long shot

quartz kindle
#

yes, what you have in google is the same as cloud

dense patio
#

oh nice

honest perch
#

cloud is great

dense patio
#

well these prices are pretty much the same as galaxygate

shy turret
#

or just use my own vps

honest perch
#

no

#

they buy your bot and collect data

shy turret
#

i heard they were owned by bluestacks and yah that

honest perch
#

its owned by bluestacks

quartz kindle
#

i heard they were going around offering to buy people's bots

earnest phoenix
#

you are the product in this case

dense patio
#

sounds scummy

earnest phoenix
#

you're better off freelancing as an independent dev

honest perch
#

i heard they were going around offering to buy people's bots
@quartz kindle ues

#

they bought bots

#

and are using them to collect data

#

as in their policies

valid grotto
#

Hmm interesting

honest perch
#

at least in their old policies it allowed it

dense patio
#

lol just reading their tos makes them seem scummy

valid grotto
#

By just applying to their services I won't lose my copyright for my bot right

#

Ah true

#

I feel like it's just an opportunity for bot developers to grow their bots, maybe I'm just not seeing what you're seeing

#

Ah gotcha, yeah I feel like it's just very similar like a musician signing a contract with a recording label

honest perch
#

@quartz kindle lets say if the user left instead of showing a blank name how could i replace it with another value

earnest phoenix
#

throw the user out of your database

#

||

#

use ||

honest perch
#

||
@earnest phoenix doesnt work

earnest phoenix
#

you can also still fetch the user regardless whether you have a shared guild or not

#

smh

#

you mean inside a string when referncing the user name if it's blank you want to show smth else?

#

this will work:

`Username: ${username || "smth else to show when blank"}`
honest perch
#

right now i have result[index].name = member.displayName, doing result[index].name = member.displayName || 'something' wouldnt work

earnest phoenix
#

()

#

wut da fork

#

wait

#

what are you doing

#

what's your problem in the first place

#

lol

#

@honest perch LMFAO you're just decaring a variable with value as a function object instead of running the function KEK

honest perch
#

if a member is found

#

vs not found

earnest phoenix
#

wtf

#

that's a falsy value

quartz kindle
#

@honest perch if you're still using the code i gave you, then it wont work because the code is skipping the loop when a user is not found

earnest phoenix
#

json stringify the string then console log it

#

but if they left i'd just suggest throwing them out of your database

quartz kindle
#

so you need to change it accordingly

earnest phoenix
#

because it might be \u200b

#

which js does not detect as falsy

#

discord does not allow zwsp as username or nickname anymore i think

#

they patched it ages go

#

discord does not allow zwsp as username or nickname anymore i think
@earnest phoenix wtf

#

i set my name as that

#

and it works fine

#

i

quartz kindle
#

LOL

earnest phoenix
#

lemme quickly revert bac

quartz kindle
#

he means zero-width-space

#

lmfao

sudden geyser
#

5head

honest perch
#

im guessing it would be easier to delete the document on user leave

earnest phoenix
#

please don't

honest perch
#

huh

earnest phoenix
#

because i sometimes test leave and rejoim servers and if for whatever fucking reason i add your bot i don't want my stuff to be reset everytime
add a 7 day timer before deletion and if the user joins back within that time don't delete the document

honest perch
#

its a private bot for an org

earnest phoenix
#

emphasis on whatever fucking reason i add your bot KEKW

#

gtg brb from the store in five minutes

leaden flame
#

?

#

||whattttttttttttttttttt||

earnest phoenix
#

Alot of the thumbnail gifs i use always break.. how do i make these work properly?

sudden geyser
#

make sure the image url you're supplying is correct

earnest phoenix
#

you're at the mercy of discord and your internet

#

the poo means it's a valid image, the request to it just failed lol

leaden flame
#

visual code no work

honest perch
earnest phoenix
#

make sure the image url you're supplying is correct
@sudden geyser I use ingur to host the image and use their direct link.. some work some dont

leaden flame
#

bot offline

#

no work

honest perch
#

because its not logging in

earnest phoenix
#

yikes

honest perch
#

you a) barely blured the token

leaden flame
#

how i codeing

#

i see this on yt

honest perch
#

b) you defined the token but havent used the variable

sudden geyser
#

do you know javascript

honest perch
#

please learn javascript

#

learn atleast the basics

#

make an easier project

#

then try and come back

autumn summit
#

mbnn

leaden flame
#

can any selling nitro?

slender thistle
#

Please please please I don't like to say this often but PLEASE learn JavaScript ITSELF FIRST

dense patio
#

wtf lol

slender thistle
#

We don't sell Nitro

honest perch
#

and learn at least those

pale vessel
#

deja vu

honest perch
#

im stupid but i know how to define things poopiepat

misty sigil
#

oh my god

#

i just looked at that syntax

dense patio
#

reading that code is a trip

honest perch
#

wtf

pale vessel
#

"ready," 😳

misty sigil
#

bot.on{)

#

aaaaaaaaa

slender thistle
#

I genuinely hate to say this but you are going to struggle A LOT continuing to make a Discord bot with no knowledge of the language itself

misty sigil
#

dont hate to say the truth

slender thistle
#

I prefer not to be an annoying ass about it but this is just bugging me on all levels of irritation

earnest phoenix
#
@commands.command(name="Kick")
    @commands.has_permissions(kick_members=True)
    async def kick(self, ctx, user: discord.Member, *, arg=None):
        author = ctx.message.author
        x = await check_logging_channel(ctx.guild.id)
        xx = self.bot.get_channel(x)
        embed = discord.Embed(name="MEMBER_KICKED", description="", color=discord.Color.blurple())
        embed.set_author(name="MEMBER_KICKED:\nMember Kicked Successfully")
        embed.add_field(name="Kicked by: ", value=f"{author.mention}", inline=False)
        embed.add_field(name="Kicked: ", value=f"<{user.mention}>", inline=False)
        embed.add_field(name="Reason: ", value=f"{arg}\n", inline=False)
        embed.set_thumbnail(url="https://i.imgur.com/ZPFYGfc.gifv")
        await ctx.send(embed=embed)

Image doesnt want to load.. imported from imgur..

Anyone recomend a different host for pics?

misty sigil
#

.gifv?

slender thistle
#

uh try to use .gif instead of .gifv

pale vessel
#

gg

earnest phoenix
sudden geyser
#

gif video

slender thistle
#

@split hazel ad spam, see logs

leaden flame
#

const Discord = require('discordjs')
const bot = new Discord.Client();
const token ='YOUR_TOKEN_GOSE_HERE';
const PREFIX = '!';

bot.on('ready,'() => {
console.log('THE BOT IS on! i am ready to be used')

bot.user.setActivity('!help created by sid62',{type:'PLAYING'}).catch(console.error); 

})
bot.on{'message', message => {
let args = message.content.Substring(PREFIX.length).split(" ");

switch(args[0]) {
case 'invite':
    message.channel.send('https//discord.gg')
break;


}

})
bot.login(token);

pale vessel
#

i now see a january first 1970 message

leaden flame
#

what

honest perch
#

have you even read what we said

pale vessel
#

please don't repost that

honest perch
#

why not

#

wait

sudden geyser
honest perch
#

which one

pale vessel
#

gahh nevermind

honest perch
carmine summit
#

LOL

pale vessel
#

i'd say w3schools since it's beginner friendly

#

like erwin said

earnest phoenix
#

If someone is annoying and/or being a dick, block and move on
~~ shivaco the ignored, 2020

slender thistle
#

@carmine summit are you here to laugh at people or be helpful?

#

🙃

#

Thank you very much

carmine summit
#

😇

#

bot.on is an event i think

leaden flame
#

?

earnest phoenix
#

@slender thistle please suggest a rule that bans where people like the person above with the {) syntax who dont know anything about the language theyre using

carmine summit
#
})```
#

There

earnest phoenix
#

No

quartz kindle
#

lmao

slender thistle
#

So let's ban people for being new to programming then

earnest phoenix
#

@slender thistle please suggest a rule that bans where people like the person above with the {) syntax who dont know anything about the language theyre using
@earnest phoenix NO

dense patio
#

lol

sudden geyser
#

We all started somewhere. I think it's better you guide those people rather than shit on them for their lack of knowledge

slender thistle
#

🙃

pale vessel
#

you're missing a comma bro

slender thistle
#

We all started somewhere. I think it's better you guide those people rather than shit on them for their lack of knowledge
this

earnest phoenix
#

@slender thistle im suggesting to ban people who dont wanna learn

#

bro

slender thistle
#

Those are punished accordingly

earnest phoenix
#

Alright then

#

are you telling shivaco to ban people who were me from january

#

Never seen that happen but oktrump

slender thistle
earnest phoenix
#

because i wasn't a programmer before January

slender thistle
#

We're here to help as best as we can, EVEN IF users are stubborn on not learning

earnest phoenix
#

Last time was 2019 😂

pale vessel
#

i swear there's always this topic here at least once everyday

slender thistle
#

Well you have to be an exceptional idiot to be muted for help vampirism

earnest phoenix
#

Hm

#

i have zero bans currently in my server because i don't allow dicks in
unlike DBL

#

Ok

dense patio
#

you have zero bans on your server because it is small

earnest phoenix
#

I bet thats what she said

slender thistle
#

At least it's not as bad as it used to be back in the days. Most hostilities are either shut down and moved elsewhere or are reasonable enough and are borderline civil. /shrug

earnest phoenix
#

ok

slender thistle
#

(Joining on the off-topic train)

earnest phoenix
#
// how the hell can i do:
require("phin").unpromisified();
// if
require("phin")();
// is a valid function
// you can't get properties of function objects right?

(this extra line is here so discord doesn't display code blocks terribly on mobile for no fucking reason)

#

@.Tim#2373 halp

slender thistle
#

@quartz kindle if you're not busy? ^

peak osprey
#
else if (command === 'reminder') {
    let messagez = args.join(' ');
  if (messagez.length < 1) return message.channel.send('Incorrect format. !reminder <minutes> <message>');
  return new Promise((resolve) => {
    if (!isNaN(messagez[0])) {
      const time = parseInt(messagez[0]);
      if (time > 2880 || isNaN(time)) return message.channel.send('Maximum time is 2 days (2880 minutes)');
      if (time < 1) return message.channel.send('Time must be at least 1 minute.');
      setTimeout(() => {
        message.reply(`Remember: ${messagez.split(' ').slice(1).join(' ')}!`);
      }, time * 60000);
      const minutemessage = time === 1 ? 'minute' : 'minutes';
      return message.channel.send(`Reminding you in ${time} ${minutemessage}.`);
    }

    const results = chrono.parse(messagez);
    if (results.length === 0) return message.channel.send('Error parsing date. Try using format: !remind <minutes> <message>');

    let endTime = moment(results[0].start.date());
    const currentTime = new moment();
    let duration = moment.duration(endTime.diff(currentTime));
    let minutes = Math.round(duration.asMinutes());

    if (minutes < 1) {
      if (results[0].end) {
        endTime = results[0].end.date();
        duration = moment.duration(endTime.diff(currentTime));
        minutes = duration.asMinutes();
      }
      if (minutes < 1) {
        return message.channel.send('Time must be at least 1 minute.')
      }
    }
    if (minutes > 2880) return message.channel.send('Maximum time is 2 days (2880 minutes)');

    setTimeout(() => {
     message.reply(`Remember: "${messagez}".`);
    }, minutes * 60000);
    const minutemessage = minutes === 1 ? 'minute' : 'minutes';
    return message.channel.send(`Reminding you in ${minutes} ${minutemessage} for ${messagez}.`);
  });
  }```

i want it so when i do .reminder it says "you have to say .reminder <time> <message>"
#

how would i do that

quartz kindle
#

@earnest phoenix you can assign properties to almost anything, including functions

peak osprey
#

with ".reminder" and ".reminder 1m"

sudden geyser
#

Check how many arguments were supplied

#

if args.length < 2 then send error message I'd think in your case.

#

Also using setTimeout for reminders is not a good idea.

#

If your bot/process shuts down, it won't remind the user.

autumn aspen
#

guys how do I make a number of how many commands each field has?

#

or is it impossible?

#

not even excist?

pale vessel
#

depends on how you make your embed

autumn aspen
#

depends on how you make your embed
@pale vessel how what u mean

#

so how do I do?

carmine summit
#

Uh

pale vessel
#

sorry, i'm on phone. can't help

autumn aspen
#

@compact oriole how do I react to a embed then it deletes

carmine summit
#

My bot gon get verified in a week or so, and im paranoid that its gonna go offline

stiff flare
#

there is a way to join the bot in a specific voice channel ?

quartz kindle
#

yes

stiff flare
#

How?

quartz kindle
#

channel.join()

#

and the channel you can get from the cache

#

with a name or an id, or whatever

#

client.channels.cache.get(id)

stiff flare
#

thx

earnest phoenix
#

@earnest phoenix you can assign properties to almost anything, including functions
@quartz kindle just realised all objects inherit all prototype properties from Object and functions are instances of Function which is an instance of Object so you can still do object stuff to functions

carmine summit
earnest phoenix
#

why "results" is always []:

const googleIt = require('google-it');
let results = (await googleIt({query: 'youtube'}))
return results

?

#

@earnest phoenix because you're putting the stuff inside parenthesis

#

remove the unnecessary parentheais

quartz kindle
#

thats not the problem

compact oriole
#

@earnest phoenix because you're putting the stuff inside parenthesis
no

#

it doesn't affect it

earnest phoenix
#

smh

compact oriole
earnest phoenix
carmine summit
#

Maybe it returns a promise?

compact oriole
#

no he awaits it

earnest phoenix
#

I try with .then(() ...) too

#

and always is []

quartz kindle
earnest phoenix
#

thanks

#

google can easily ban you from scraping it

#

so you're better off scraping ddg/using some package that does it for you

final token
#

why u skidding code of github

#

because if u wrote that code you would see the error straight away

earnest phoenix
#

client = discord.client()

#

where is the github code dude

final token
#

in the error it legit says what you havent done

earnest phoenix
#

@earnest phoenix türk müsün kanka

opaque seal
earnest phoenix
#

@earnest phoenix türk müsün kanka
@earnest phoenix evet

#

@earnest phoenix hata nerede tam olarak

final token
#

Whoops
Didn't know Discord would notify you tho, that's cool
@opaque seal that is cool. never knew they did that

earnest phoenix
#

client yok

#

şunu dene client = discord.client()

#

const client = new Discord.Client()

#

BÖYLE

#

yapsam

#

düzelir mi

#

oda olur ( python kullanıyorum ben)

#

hm

#

deneyeyim mi

#

dene

#

aynı hatayı verdi

#

@earnest phoenix

#

const u kaldır bilmiyorum javascript i çok anlamıyorum

#

python ile nasıl yazabiliyorsun ki

#

discord sadece java desteklemiyor mu

royal portal
#

@earnest phoenix did you write the code

earnest phoenix
#

python ile nasıl yazabiliyorsun ki
@earnest phoenix discord.py var

#

@royal portal which code

royal portal
#

the one u have now

#

bot code

earnest phoenix
#

discord sadece java desteklemiyor mu
@earnest phoenix ve hayır kullandığın kütüphane javascript java değil

#

javascript işte

royal portal
#

there's an easy fix

#

you gotta define client

#

you forgot to define it so thats the issue

earnest phoenix
#

client' of undefined

#

this error

#

@royal portal

#

@royal portal dude i will go dinner i will soon back 15m

royal portal
#

someone told me you got that code from github

#

why dont you check the description on how to start it up

earnest phoenix
#

this check... i swear is going to kill me..

sonic lodge
#

what check

faint prism
#

else balance = balance
Lol

earnest phoenix
#

@sonic lodge ```py
def not_allowed(ctx):
return ctx.author.id in bot.blacklisted_users

@commands.check(not_allowed)```

sonic lodge
#

why, is it not working

earnest phoenix
#

nope,

#

trying to get it to not run commands if they're in the Blacklist, but it either runs it or raises "check failed"

#

@earnest phoenix gelince beni pingle yardımcı olmaya çalışırım

real helm
#

Hiya

#

Good API for anime gif?

livid lichen
#
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/discordjs/Commando.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent Thi``` I can't download discord.js-commando. Anyone know why?
earnest phoenix
#

Does anyone have a guide that can help me use Giphy API in discord.py?
i used their example code and it doesnt even seem that the library works.

#

@real helm nekos.life?

#

download git @livid lichen

livid lichen
#

Alright

real helm
#

@real helm nekos.life?
@earnest phoenix Oh, thanks bby

earnest phoenix
#

np...?

#

lol

#

@earnest phoenix geldim

#

@earnest phoenix events klasörü varmı?

#

var

#

Komutları çalıştırabilmek için yani...

#

var

#

sadece bu komut hata veriyor diğer komutlar

#

normal çalışıyor

#

bu komut sadece kullanıldığında hata veriyor

#

yani açıkçası bot açılıyor

#

komut yüzünden kapanmazlık yapmıyor

#

english only in this channel

#

new Date() yap orayı (footer)

#

@earnest phoenix is that rule ?

#

i dont think so dude

#

yes

#

english only in this channel
@earnest phoenix I can't see any EngLiH oNlY IN This chAnnEl tExT

#

.setFooter(new Date()

#

this is development.._.

#

so?

#

:D?

#

@earnest phoenix come dm

#

do you understand what excluding means lol

#

No i don't "lol"

#

interpret it as except

#

meaning english only in all channels but the mentioned ones

slim hare
#

Hi

earnest phoenix
#

need help with programming?

#
const { ShardingManager } = require('discord.js');
const { toUnicode } = require('punycode');
const shard = new ShardingManager('./bot.js', {autoSpawn: true});
console.log('Ready!')
shard.spawn(2);
});```
#

Is this enough for the bot to work with shard?

#

Why not?

#

I just want to know if this would work

tacit cradle
#

Does making a bot in multiple files change anything in bot performance or is it just purely aesthetic ?

earnest phoenix
#

purely aesthetic

tacit cradle
#

Ah

earnest phoenix
#

based on your code the performance will vary

#

your computer sees it differently than you

#

make it perfect and you'll have unnoticable performance drops

#

but i wouldn't recommend storing anything other than commands in different files

#

because why the fuck would you want to store half your bot in one file and half in another
however storing all commands in one big file is SUPER TERRIBLE

tacit cradle
#

I just watched a few tutorials and one guy was making everything in the index.js file and the other one was making a seperate file for every command so I was just wondering

earnest phoenix
#

@tacit cradle follow the second one

#

@earnest phoenix that does not seem correct

tacit cradle
#

Okey

#

Thanks for the help

quartz kindle
#

a single file will load faster than multiple files

#

but once all files are loaded, the performance is the same

earnest phoenix
#

^

#

so basically like a one time performance payment everytime you restart your bot

#

@earnest phoenix that does not seem correct
what is wrong?

#

you're watching youtube tutorials

#

youtube tutorials are 10000% outdated

#

me?

quartz kindle
#

@earnest phoenix yeah thats not how you use the sharding manager

#

you need to create a separate file for the sharding manager code

#

not put it in a ready event

earnest phoenix
#

oh

#

I think I understand

#

thank you

#

I think I understand
@earnest phoenix you don't know that you understand? get help i suppose

#

I believe I already know how to do it. I will read the documentation and see how it works for sure

obtuse jolt
#

does anybody have manage server in like a lot of guilds?

earnest phoenix
#

does anybody have manage server in like a lot of guilds?
@obtuse jolt suspicious

#

^^^^

obtuse jolt
#

you are sus

earnest phoenix
#

idkkkkkkkkkkkkk

#

does anybody have manage server in like a lot of guilds?
@obtuse jolt why the sus question

obtuse jolt
#

this isn't among us are you or not

earnest phoenix
#

you are sus
@obtuse jolt yes i am tell me something new

#

also we're getting oof topic

silent cloud
#

Yo

earnest phoenix
#

Yo

#

indeed i am

silent cloud
#

I have an error, but why

earnest phoenix
#

what error

silent cloud
#

const client = require('nekos.life');


const neko = new client();

module.exports = {

  name: "hentai",

  category: "commands",

  description: "Отправляет рандомный хентай",

  usage: "[hentai]",

  execute: async (client, message, args) => {


  var errMessage = "Это не NSFW канал";

  if (!message.channel.nsfw) {

      message.react('💢');

      return message.reply(errMessage)

      .then(msg => {

      msg.delete({ timeout: 3000 })

      })

      

  }

        async function work() {

        let owo = (await neko.nsfw.hentai());

        const hentai = new Discord.MessageEmbed()

        .setTitle("Дрочибельный хентай")

        .setImage(owo.url)

        .setColor(`#FF0000`)

        .setURL(owo.url);

        message.channel.send(hentai);

}

      work();

}

                };```
earnest phoenix
#

@silent cloud don't even mention nsfw inside the server

obtuse jolt
earnest phoenix
#

go somewhere like plexidev if you still need help with NSFW

#

they allow NSFW in some channels

silent cloud
#

So

#

I need go to plexidev?

earnest phoenix
#

*just found out they don't allow NSFW

silent cloud
#

Oh

earnest phoenix
#

search tag:developer tag:NSFW on top.gg

silent cloud
#

search tag:developer tag:NSFW on top.gg
@earnest phoenix why?

earnest phoenix
#

because

#

i can't find any programming servers that allow NSFW

#

we don't

#

so if you're gonna still use nekos.life and ask for help with it find a server that allows NSFW

silent cloud
#

K

#

Ty, gl

obtuse jolt
#

@earnest phoenix so they we're all there?

earnest phoenix
#

yh

obtuse jolt
#

awesome

earnest phoenix
#

well-done!

#

this Check is honestly the most infuriating thing i've ever done...

magic bough
#

Hey guys, I have a quick question about the bot reviewal process.

Your bot is tested using permissions=0, you should ensure that your bot functions without permissions.
Does this just mean that in order to pass, the bot needs to have some output if it's missing proper permissions?

earnest phoenix
#

@magic bough of course

#

but it shouldn't ask for unnecessary permissions

sudden geyser
#

It's good practice to have output when something goes wrong.

plucky harness
#

Are the first 8 digits of a (message id) always supposed to be unique? or not

earnest phoenix
#

you can ask for embed links permission on help command
but you can't ask for admin for ban command because you only need ban members for it

magic bough
#

Gotcha, just making sure I understood what that meant. For a second I read that as "the bot should function properly with permissions=0, and that didn't quite make sense lol.
Right, that all sounds familiar and makes sense, thanks!

obtuse jolt
#

@plucky harness well all user ids are supposed to be completely unique and dont just go up 1 number for each user so there is no like neighbour ids as such a bit like youtube where the IDs are completely randomised

#

because if they went up in order youd just be able to see unlisted videos just by changing like the last letter

weary adder
#

wtf bro?

sudden geyser
#

yeah going up by ones is no good

loud tiger
#

what

#

xd

plucky harness
#

@plucky harness well all user ids are supposed to be completely unique and dont just go up 1 number for each user so there is no like neighbour ids as such a bit like youtube where the IDs are completely randomised
@obtuse jolt not user ids i mean (message ids)

obtuse jolt
#

yeah i know

plucky harness
#

Are the first 8 digits of a (message id) always supposed to be unique? or not
this

loud tiger
#

caralhes q quem n bate palmas e tripeiro

obtuse jolt
#

yes they are mostly unique although with anything unique theres always a chance for one to be the same

loud tiger
#

mano siga siga]

earnest phoenix
#
api_response = api_instance.gifs_random_get(api_key, tag=tag, rating=rating, fmt=fmt)
{'data': {'fixed_height_downsampled_height': '200',
          'fixed_height_downsampled_url': 'https://media0.giphy.com/media/LFmxDLUTQH7dS/200_d.gif',
          'fixed_height_downsampled_width': '318',
          'fixed_height_small_height': '100',
          'fixed_height_small_still_url': 'https://media0.giphy.com/media/LFmxDLUTQH7dS/100_s.gif',
          'fixed_height_small_url': 'https://media0.giphy.com/media/LFmxDLUTQH7dS/100.gif',
          'fixed_height_small_width': '159',
          'fixed_width_downsampled_height': '126',
          'fixed_width_downsampled_url': 'https://media0.giphy.com/media/LFmxDLUTQH7dS/200w_d.gif',
          'fixed_width_downsampled_width': '200',
          'fixed_width_small_height': '63',
          'fixed_width_small_still_url': 'https://media0.giphy.com/media/LFmxDLUTQH7dS/100w_s.gif',
          'fixed_width_small_url': 'https://media0.giphy.com/media/LFmxDLUTQH7dS/100w.gif',
          'fixed_width_small_width': '100',
          'id': 'LFmxDLUTQH7dS',
          'image_frames': '14',
          'image_height': '314',
          'image_mp4_url': 'https://media0.giphy.com/media/LFmxDLUTQH7dS/giphy.mp4',
          'image_original_url': 'https://media0.giphy.com/media/LFmxDLUTQH7dS/giphy.gif',
          'image_url': 'https://media0.giphy.com/media/LFmxDLUTQH7dS/giphy.gif',
          'image_width': '500',
          'type': 'gif',
          'url': 'https://giphy.com/gifs/cat-random-nerd-LFmxDLUTQH7dS'},
 'meta': {'msg': 'OK',
          'response_id': '777181cac0e9912dc8ed16be9cfec6c5bf22df5f',
          'status': 200}}

This is what it prints.. so why doesnt print(api_response['data']['url']) do anything.... im so ^&%^&%^& confused

knotty quartz
#

Hi can i get some help with my development?

dense patio
#

details?

knotty quartz
#

Its a bot log that keeps a eye on who uses what command or if they use a troll command using my bot prefix"!d". So I can monitor it better but every time I try It shuts the bot off so I wiped the script and planning to restart with help.

dense patio
#

can you use punctuation please

knotty quartz
#

can you use punctuation please
Is that better now?

dense patio
#

so what are you trying to do?

#

@fleet hornet what do you need help with?

knotty quartz
#

Make a bot logs to see who uses what command using the bots prefix "!d" for example if they uses a command that not there with the bot preifx, I can see that. It to help me monitor if someone trolling the bot so I can blacklist them.

For example:

!d shutit (Troll)

dense patio
#

@fleet hornet can you space that out better, don't be afraid of whitespace

#

@knotty quartz just add a console.log under your command caller

#

ok

knotty quartz
#

@knotty quartz just add a console.log under your command caller
I only have a database.

dense patio
#

that's completely unrelated

#

what library are you using?

knotty quartz
#

Host or bot script? I have two sites I use.

dense patio
#

do you know how to code

knotty quartz
#

Yes I have a whole bot list wait a min

dense patio
#

then you should know what library you're using

earnest phoenix
#

what have i come back too--

knotty quartz
#

But I use two sites .-.

earnest phoenix
#

@knotty quartz What library do you use..... What language is your bot in?

knotty quartz
#

@knotty quartz What library do you use..... What language is your bot in?
discord.js

dense patio
#

alright that's just invalid syntax

#

on line 18 of your pastebin

#

should be this:

#
 new MessageEmbed({ author: `Tritan Bot`, `https://cdn.discordapp.com/attachments/732766998345285712/744305778399117476/8bd897f7fce9469a670f494768f21dec.jpg`, 
#

it's the same embed as normal discord.js

#

good luck 👍

knotty quartz
#

Do you use glitch?

#

gitlab oh you mean github

#

I hate glitch to ir rubbish

#

Okay ehh

#

Oh github I use so I cant help there

earnest phoenix
#
def not_allowed(ctx):
    return ctx.author.id in bot.blacklisted_users

@commands.check(not_allowed)

THIS CHECK IS PISSING ME OFF.

knotty quartz
#

Your trying to make a blacklist?

earnest phoenix
#

mhm

knotty quartz
#

I just recently made one

#

Do you use discord.js?

earnest phoenix
#

lucky 😂, this Check is annoying the fuck out of me

#

no python

knotty quartz
#

Oh sorry I cant help there I use discord.js I find it easier than phthon

earnest phoenix
#

meh personally i find python more comfortable for my needs

sudden geyser
#

Lynx just so you know, you can apply a check to every command in Discord.py without using the decorators on every one

earnest phoenix
#

i know, but the check itself doesn't work,

#

it still runs the command, thats not what i want, i don't want the command to executable by those in the blacklist

sudden geyser
#

I think it's not working because you haven't inverted it yet.

#

If the check returns True, it passes. If it returns False, it throws a command error (check).

#

So, try using not in.

spice furnace
#

hello

sudden geyser
#

hi

spice furnace
#

helloo

muterole1 = await message.guild.roles.create({
          data: {
            name: "Muted",
            color: "#000000",
            permissions: []
          }
        });
        message.guild.channels.cache.forEach(async (channel, id) => {
          await channel.overwritePermissions(muterole1, {
            data: {
              id: muterole1.id,
              deny: ['SEND_MESSAGES'],
            }
          })
          message.channel.send(channel)
        })
        await message.channel.send('Muted rang sikeresen létrehozva.')
      } catch (err) {
        console.log(err.stack);
        message.channel.send('Hiba merült fel. Kérlek szólj fejlesztőnek.')
      }
      return;
    }

Error code:
(node:9288) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied overwrites is not an Array or Collection of Permission Overwrites.
Who can help me?
please..

#

i dont know what is the problemxd

earnest phoenix
#

@sudden geyser when i use not in it throws this error :

Ignoring exception in command ping:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
    await ctx.command.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 790, in invoke
    await self.prepare(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 744, in prepare
    raise CheckFailure('The check functions for command {0.qualified_name} failed.'.format(self))
discord.ext.commands.errors.CheckFailure: The check functions for command ping failed.```
sudden geyser
#

Was the user blacklisted

earnest phoenix
#

yep

sudden geyser
#

Then it worked

earnest phoenix
#

i love you so much..

#

the amount of times i've put not in then thought to myself That cant be right...

sudden geyser
#

@spice furnace the first argument of .overWritePermissions is an array or collection of permission overwrites. However, your code works for .updateOverwrite

#

Yeah np lynx

#

Just make sure you handle the error with the on_command_error decorator.

#

So instead of throwing that error in your console, you can instead respond with nothing or say the user is blacklisted.

long widget
#

where do you apply for bot dev role?

sudden geyser
earnest phoenix
#

how do i make the bot make a new text channel

#

in

#

which

#

library

#

discord.js

#

l i b r a r y

#

discord.js

spice furnace
#

thanks

#

sry my bad english

boreal iron
#

@boreal iron It's intentional right now because users cannot set a watching status, so you shouldn't receive one from anyone.
@quartz kindle Aye, edited the BOT real quick and surprise surprise, type 3 is "watching" (as it isn't a surprise for you lel)

trim onyx
#

A good coding app?

Code Lang: discord.js

long widget
#

anyone fancy helping me with my bot. (I have little to no experience lmao) i will be very surprised if anyone says yes

obtuse jolt
#

how can I store the amount of messages sent in a guild each month

#

like what would be a good way of storing that data

quartz kindle
#

have a database and have a message counter for each guild in the database

#

on every message, increase the counter by 1

obtuse jolt
#

i know that

#

but

#

like

#

idk i think i have an idea

#

ill try it

quartz kindle
#

if you're worried about performance, update it in chunks with a interval

earnest phoenix
#

hitting up your database on every message isn't such a smart idea though, this ^

long widget
#

anyone fancy helping me with my bot. (I have little to no experience lmao) i will be very surprised if anyone says yes
@long widget ping me if you will please

peak osprey
#

prefixRegex is not defined

 else if (command === 'prefix') {
    const sql = require("sqlite");
    if (!message.member.hasPermission("MANAGE_GUILD")) return message.channel.send("You are missing MANAGE_GUILD permission");
    const newprefix = args[0]
    const newprefixfix = newprefix.replace(/[^\x00-\x7F]/g, "");
    if (newprefix.length < 1) return message.channel.send("Didn't provide a new prefix to set")
    if (newprefixfix.length < 1) return message.channel.send("Prefix can't have ascii characters")
    if (newprefix.length > 7) return message.channel.send("prefix can't be longer then 7 characters")
    sql.get(`SELECT * FROM scores WHERE guildId ="${message.guild.id}"`).then(row => {
    sql.run(`UPDATE scores SET prefix = "${newprefixfix}", casenumber = ${row.casenumber + 1} WHERE guildId = ${message.guild.id}`);
    message.channel.send("I have set the new guild prefix to " + newprefix)
    let modlog = message.guild.channels.find(channel => channel.name == row.logschannel);
     const embed = new Discord.RichEmbed()
       .setColor(0x00A2E8)
       .setTitle("Case #" + row.casenumber + " | Action: Prefix Change")
       .addField("Moderator", message.author.tag + " (ID: " + message.author.id + ")")
       .addField("New prefix", newprefixfix, true)
       .setFooter("Time used: " + message.createdAt.toDateString())
     if (!modlog) return;
     if (row.logsenabled === "disabled") return;
   return client.channels.get(modlog.id).send({embed});
   })
}```
obtuse jolt
#

hitting up your database on every message isn't such a smart idea though, this ^
@earnest phoenix well its a bit too late to not do this tbh

earnest phoenix
#

yikes

#

don't you have any caching behaviour?

obtuse jolt
#

well it pings the database everytime someone talks to check for a prefix

earnest phoenix
#

yeah that's what i thought so

obtuse jolt
#

so caching that wouldnt be a very good idea

peak osprey
#

hm

earnest phoenix
#

it shouldn't be that hard to switch to a caching system

peak osprey
#

so how do i fix this

earnest phoenix
#

define prefixRegex

peak osprey
#

how?

#

what do i do to define prefixRegex

earnest phoenix
#

in whichever way you want

quartz kindle
#

@obtuse jolt caching prefixes is like a must lol

peak osprey
#

see idk a way to define prefixRegex

opal plank
#

just to get this out of that way

#

i really hope you arent regexing the message to catch your prefix

quartz kindle
#

@peak osprey did you copy that code from somewhere?

peak osprey
#

me and my buddy worked on it

#

but he doenst know how to fix it

#

and nether do i

opal plank
#

regex has to be the worst option you can pick for checking prefixes

peak osprey
#

so no

quartz kindle
#

i mean

#

if you worked on it, that means you made it, and if you made it, you also made it require a variable named prefixRegex

opal plank
#

fyi i did proper testing on speed

#

regex is 3x slower at BEST

quartz kindle
#

also, you're using an outdated version of discord.js and likely following an outdated tutorial

opal plank
#

message.guild.channels.find(c

#

good catch didnt even see it was outdated

fierce arch
#

Using discord.py and pm2, how can I restart my bot from a command?

quartz kindle
opal plank
#

pm2 should automatically reveive the process i think, no?

#

you should just need to exit it ^^

placid iron
#

Does pm2 have a thing where it only revives on errors

fierce arch
#

so just run a sys.exit() function and then pm2 will revive it?

opal plank
#

why bother on errors?

#

if it crashes or you exit it, it should restart

quartz kindle
#

pm2 always revives

placid iron
#

Ah oki

quartz kindle
#

the only way to make pm2 not revive is using pm2 stop

opal plank
#

actually i need to turn that into a tag

placid iron
#

Cuz on docker you can set it so that it will restart if the program exited from an error

opal plank
#

1 sec

placid iron
#

But if you want the program to actually stop then it will

#

Quite useful

quartz kindle
#

idk if pm2 has an option for that

opal plank
#

cant you use a terminal or shell to tell pm2 to stop?

placid iron
#

Sure but that won't be as graceful

opal plank
#

i can see it being useful in some VERY rare occasions

#

like a kill switch

obtuse jolt
opal plank
#

though a kill switch usually should be good for a restart

#

unless you fucked the code up it should be almost non existant the occasion where you NEED to kill the bot

#

like setting up a spam or something that works on startup

silent cloud
#

Thats me again yo

limber flume
#

...

silent cloud
#

const bot = new Discord.Client();

const snekfetch = require('snekfetch');

module.exports = {

    name: "hentai",

    description: "Че дрочишь?",
    
    nsfw: true,

execute: async (client, message, args) => {

        const { body } = await snekfetch

            .get('https://nekos.life/api/lewd/neko')

       

/*        if (!message.channel.nsfw) return message.channel.send("Не могу отправить NSFW контент в SFW канал.")
*/
        const embed = new Discord.MessageEmbed()

        .setImage(body.neko)

        message.channel.send(embed).catch(console.error);

  }
    };```
opal plank
#

isnt nekos against the rules here?

#

cuz underaged stuff?

placid iron
#

Yeah

obtuse jolt
#

u wot

placid iron
#

nekos.life is banned here

silent cloud
#

Why ._.

placid iron
#

He literally said

opal plank
#

im not finding it in #rules-and-info though im fairly certain i read it somewhere

placid iron
#

Modlog

opal plank
#

maybe it was on the website

silent cloud
opal plank
silent cloud
#

Oh

#

If my bot have in top.gg i cant do nsfw commands?

opal plank
#

ask a mod

placid iron
#

You can do NSFW

opal plank
#

im not too well familiarized with the website rules

placid iron
#

But not from nekos.life

silent cloud
#

Ohhhh

placid iron
#

And you can't mention it on the bot page in top.gg

silent cloud
#

Idk more pages

opal plank
#

i pushed the lib to its limits now

thick gull
#

iirc nekos.club is by someone here as a replacement for it

opal plank
placid iron
#

It's down now

thick gull
#

oh

opal plank
#

the bot legit having a stroke with this many channels

placid iron
#

And they deleted their discord account

opal plank
placid iron
#

Very wired

thick gull
#

i think they charge backed

#

i had a nitro token from them

#

and it was gone

#

¯_(ツ)_/¯

opal plank
#

time to set up a better cluster

cobalt spruce
#

||idk||

opal plank
#

clearly one process isnt keeping up with that

placid iron
#

Try discord searching nekos.club

#

All the mentions of it from them - the account is deleted

thick gull
#

yeah i know

opal plank
#

yall ever get stuck between 5 or 6 projects switching back and fourth or is it just me and my weird ass?

placid iron
#

Just you

#

Then again

#

I don't think I even have 6 projects

opal plank
#

while i work on one i get an idea i can use on another, and i keep jumping around

quartz kindle
#

i usually work on one project at a time

cobalt spruce
#

true

opal plank
#

i guess its just my weird ass

obtuse jolt
opal plank
#

fuck...

#

hmm

placid iron
obtuse jolt
#

lmfao

opal plank
#

now how can i dynamically spawn a node process with a file target and assign it a name and connect to my ipc master?

boreal iron
#

that's the "new" responsive design 2020

obtuse jolt
#

@placid iron refresh

opal plank
#

actually

#

i has idea

#

bye

placid iron
opal plank
#

'forgot password' huh?

#

arent you logging in with auth?

boreal iron
#

Please enter your last known Discord email address and password... lmao

opal plank
#

whats the point of the account/password reset if its all done via oauth @obtuse jolt ?

earnest phoenix
#

but-

faint prism
#

wat
{"easter_egg": "https://www.youtube.com/watch?v=fC7oUOUEEi4"}

earnest phoenix
#

hi

opal plank
#

you can do that when you click it...

peak osprey