#development

1 messages · Page 501 of 1

sick cloud
#

well im trying to add {x} ms (ie. my thing turns 15d to 15 days in ms) for durations

quartz kindle
#

try mutedAt = new Date(); unmuteAt = new Date(mutedAt.getTime() + durationTimeInMilisecondsiThink)

sick cloud
#

alright

west raptor
#

whats the full error

waxen quest
#

How can I add redirect to my invite link for my bot? I tried to do it but it didn't work

stable tide
#

@whole condorcheck ur internet

#

Thats The error we get when Websocket disconnects iirc

west raptor
#

o

quartz kindle
#

websockets are usually ECONNRESET

#

thats a timeout error

stable tide
#

Um maybe

#

But Its an internet err

quartz kindle
#

yes, but it might be anything from him trying to access a broken api to using the wrong address

#

i tried going to 104.16.59.5 and it requires special headers to allow access

#

@sick cloud try to store them as timestamps then, instead of date objects

whole condor
#

@stable tide this is a vps...

sick cloud
#

timestamps? @quartz kindle

inner jewel
#

104.16.0.0/12 ips are cloudflare

#

which is why you need the headers to access

#

otherwise they wouldn't know where to connect

quartz kindle
#

@sick cloud dateobject.getTime()

#

unix timestamp

lost scarab
#

this isnt working

#

🤔

#

and there is this error

earnest phoenix
#

you need to put the return on the same line as the if

#

and are you using glitch?

lost scarab
#

yeah

earnest phoenix
#

ew gross

lost scarab
earnest phoenix
#

anyways

lost scarab
#

whats the problem of glitch

earnest phoenix
#

just put in the same line wih the if

lost scarab
#

i wonder

earnest phoenix
#

nothing really

#

if you want a really small bot

lost scarab
#

yeah i want a small bot xd

earnest phoenix
#

oh ok

lost scarab
#

and

#

its already in the if line

earnest phoenix
#

no

#

the second one

lost scarab
#

well now u confusing me

#

xd

earnest phoenix
#

literally the only one with the return outside the if statement

lost scarab
#

well didnt work xd

#

if u want u can come here and change it

earnest phoenix
#

fine

lost scarab
#

commands/fight.js btw

earnest phoenix
#

sad

#

broken link

lost scarab
#

lol

smoky spire
#

Nice token

earnest phoenix
#

lmao

#

you have an env file

#

but not even going to put your token in it

#

@lost scarab reset your token and put your resetted token in your .env file

lost scarab
#

done

earnest phoenix
#

also there is no commands folder

lost scarab
#

commands are all gone

#

wtf

#

oh

earnest phoenix
#

nvm env broke

lost scarab
#

its trying to load them

#

but cant

earnest phoenix
#

you have no commands folder

#

also i thought the .env was going to hide it like glitch says

#

but it didn't

sick cloud
#

lmao

lost scarab
#

wait

wheat marten
#

I had a bot called pornhub

#

He kissed a bot and liked it

earnest phoenix
#

oh cool

#

@lost scarab some of this looks stolen

lost scarab
#

what?

earnest phoenix
#

most looks unorganized

#

also what is mstory and hstory

lost scarab
#

is a command i did

earnest phoenix
#

but what exactly is it

lost scarab
#

storries

#

like horror storries and mystery storries

#

random ones

earnest phoenix
#

too bad they can't be used

lost scarab
#

i regenerated it

#

dw

earnest phoenix
#

you put it back ing the public botconfig.json tho

lost scarab
#

i did

earnest phoenix
#

also your stories are unable to be used

lost scarab
#

ehm

#

they were working

#

it works lol

earnest phoenix
#

thats way past discords character limit

lost scarab
earnest phoenix
#

not certain this code isn't stolen

#

but

#

i fixed the proble

west raptor
#

Users/bots can't ban people that have the same role position as another member, correct?

earnest phoenix
#

yeah

west raptor
#

ok

earnest phoenix
#

wait no

#

they can

west raptor
#

what

#

no i mean

#

like

#

x trys to ban y but x has the same role position as y

earnest phoenix
#

same role or role position

#

abecause

#

two roles can't have the same role position

west raptor
#

yea i know

#

so

#

basically same role

earnest phoenix
#

yeah

#

they can

west raptor
#

if they have a nother ole above yes

#

but

#

what about when both members highest roles are the same

earnest phoenix
#

i said yes twice dream

west raptor
#

a

#

ok

earnest phoenix
#

thats the only thing we're talking about

west raptor
#

wait

#

no

earnest phoenix
#

oh yeah

#

i was wrong

#

but you can remove roles of someone with the same highest role as you

earnest phoenix
#

hey

#

VSC is giving me a issue

topaz fjord
#

what's the issue

earnest phoenix
#

i need that 2 be yellow

#

am i inputting something wrong

#

dbl api and development:
50% property of undefined,
25% unhandled promise rejection
25% "there are no errors but it still doesnt work"
100% people with no clue

#

?

topaz fjord
#

that looks fine

#

its just the vscode theme

earnest phoenix
#

ok

#

highlighting opening and closing tickYes

#

what is this error awaitwhat

#

i am learnijng how 2 code

#

and in the video

#

it shows this

#

tthe dbl api .hasvoted is 24 hour check right?

#

yellow

#

or 12 hour

topaz fjord
#

its just the theme

earnest phoenix
#

ok

#

there is no error

#

ty

topaz fjord
#

vscode will shout at you if there is an error

earnest phoenix
#

ok

#

now

#

it does not show this

#

is should sow this

#

@topaz fjord

#

haha

#

how about node filename.js

#

so node index,js

topaz fjord
#

yes

#

index.js

#

not index,js

west raptor
#

Or just node index

earnest phoenix
west raptor
#

What

topaz fjord
#

did you save the file 👀

earnest phoenix
west raptor
#

Save the file

earnest phoenix
#

@earnest phoenix do you know how to code?

#

or node

#

laerning

#

learning*

#

console.log Pog

#

finally

west raptor
#

Go to the file and hit cnrtl + s

earnest phoenix
#

it worked

west raptor
#

Ok

earnest phoenix
west raptor
#

Why node .

topaz fjord
#

that targets the index file afaik

west raptor
#

o

earnest phoenix
#

lol

#

need 2 make sure it works of course\

gusty inlet
earnest phoenix
#

ok

#

do you have a problem ma'am

#

i cant turn on my bot

#

i cant b/c i have discord.js and discord.js-commando

topaz fjord
#

why do you have both

sharp bluff
#

anyone want to give me command suggestions, hmu in dms

earnest phoenix
#

so i i can do p[ing and pong

#

for the command ping

topaz fjord
#

wut

earnest phoenix
#

thats not how commands work

topaz fjord
#

thats not how it works

earnest phoenix
#

what ever

#

so i cant have a message and command in index?

topaz fjord
#

I suggest whatever tutorial you're using, ditch it, and find an updated one

earnest phoenix
#

the docs are there

#

ok

#

ty

#

np

west raptor
earnest phoenix
#

yeah

#

your tutorial is outdated

sharp bluff
#

anyone have command/bot ideas. dm me

topaz fjord
#

you dont need to say it again

sharp bluff
#

but i have nothing else to do

earnest phoenix
#

a bot that mutes for:
-code not in code block
-posting questions with "property of undefined" in the text
-posting questions with "unhandled promise rejection" in the text

sharp bluff
#

that is not dm

topaz fjord
#

lmfao

#

@earnest phoenix amazing

earnest phoenix
#

dbl needs

topaz fjord
#

wait

earnest phoenix
#

and it should give special role with special channel

#

teaching how to fix the problem

topaz fjord
#

a bot that mutes for undefined

earnest phoenix
#

yes

topaz fjord
#

@ Oliy please add

earnest phoenix
topaz fjord
#

discord update

#

brb

quartz kindle
#

a bot that mutes people who ask to ask

topaz fjord
#

yes

earnest phoenix
#

or ask to dm

#

or ask how ti invite a bot

#

or how to code a bot

topaz fjord
#

why tf does the discord overlay not show ur cert Tim

earnest phoenix
#

a bot that mutes people that ask how to make a bot

quartz kindle
#

no idea?

topaz fjord
#

discord broke

earnest phoenix
#

i can see ur cert

#

i have these intervals setup, and im wondering if i can make it so the interval only runs a certain amount of time

#

if i have this

#

how do i add a

#

Playing ________

#

...

zenith moss
#

client.user.setActivity(“what you want it to be playing”)

earnest phoenix
#

yeah

#

there are also other options

#

like

#

type

topaz fjord
#

you dont need 2 message events

#

and sendMessage doesnt work anymore

earnest phoenix
#

and they are the same thing?

topaz fjord
#

its send

#

you can put all your commands in one message event

earnest phoenix
#

or have handlers

#

ok Thank you\

earnest phoenix
#

how do I get a list of roles with eval

#

Map the guild roles collection, by a property such as name

ruby dust
#

depending on the library, a guild object should have .roles property

earnest phoenix
#

yeah guild.roles discord.js

#

guild.roles.map()

ruby dust
#

in discord.py that returns the guild roles in random order

#

but luckily there's a guild.role_hierarchy

high tinsel
earnest phoenix
#

yeah I did that

#

also Glitch is bad because it says the bash has errors

#

but I didn't make a bash + debugger dosen't load

#

ovh is better

#

you don't have to worry about nerds stealing your bot either

high tinsel
#

The debugger is early in development and still probably full of bugs itself :)

earnest phoenix
#

do you know how to map all roles by their name

high tinsel
#

I never mapped roles, so no...

earnest phoenix
#

ok found it

#

.eval guild.roles.map(r => r.name).join("\n")

#

use VSC

#

it is much better

west raptor
#

What

#

VSCode is a code editor

earnest phoenix
#

you should know it

west raptor
#

Or IDE

#

Eval is a function used to execute code well in code

earnest phoenix
#

i have been having troubles with my bot being slow

#

what lang

#

discordjs?

#

ye

west raptor
#

Ur internet

earnest phoenix
#

log client.ping()

#

or is it not a function

#

i forget

west raptor
#

Uh

earnest phoenix
#

lol

west raptor
#

I dont remember

#

I think just a property

earnest phoenix
#

yeah

#

not a function

#

just checked

quartz kindle
#

bot slow? get a vps. still slow? code better

#

:^)

earnest phoenix
#

whats a vps

#

🤦

west raptor
#

Virtual private server

quartz kindle
#

seriously though, when i got a vps, my bot instantly got 500x faster

earnest phoenix
#

oh

bright spear
#

what did u run it on before

quartz kindle
#

although it doesnt help that i live in a 3rd world country, and self-hosting on this kind of internet is impossible

earnest phoenix
#

oof

#

i have 50/50

quartz kindle
#

my bot's ping was anywhere from 500 to 15000

earnest phoenix
#

lmao

quartz kindle
#

it was very unstable lmao

earnest phoenix
#

i get like 30ish ping on my mac and on my vps

quartz kindle
#

funny enough, i get 50 ping in league of legends

earnest phoenix
#

link me pls

quartz kindle
#

link what?

earnest phoenix
#

link me a VPS

quartz kindle
#

there are many

west raptor
#

Takes 10 seconds to look up

earnest phoenix
#

give me urs tim

#

urs sounds good

quartz kindle
#

google compute engine
ovh
digital ocean
vultur
galaxygate

#

to name a few

earnest phoenix
#

use skysilk

#

gcloud is too expensive

#

vultr is ok

quartz kindle
#

i use google compute engine

earnest phoenix
#

same

#

its too expensive

quartz kindle
#

im on the free tier

#

lul

earnest phoenix
#

still using free credit mmLol

#

same

#

is it just me or is the discord server going insane

quartz kindle
#

its fine here

earnest phoenix
#

just you?

#

testing category is being deleted then added 4 me

#

hek

#

any good free VPS

#

gcloud free tier

#

ok

quartz kindle
#

yes, but you still need a credit card to create an account

earnest phoenix
#

¯_(ツ)_/¯

quartz kindle
#

its not 100% free though, they still charge you for outbound traffic

earnest phoenix
#

its like 2 cents a month tho

quartz kindle
#

a discord bot uses surprising amounts of data

earnest phoenix
#

i pay like 2 cents a month

#

¯_(ツ)_/¯

quartz kindle
#

my bot was averaging 7gb / month of data

#

let me check now

earnest phoenix
#

where do you check

quartz kindle
#

i got charged 1.13 USD last month

#

from my free credit

earnest phoenix
#

oof

bitter sundial
#

@quartz kindle they shouldnt charge you unless you upgrade

earnest phoenix
#

that might not be the right one

quartz kindle
#

8gb egress traffic

#

last month

#

they charge for egress traffic on all tiers

bitter sundial
#

do you have music on your bot

quartz kindle
#

no

earnest phoenix
#

i did 1.563 gb and it cost $0.07

quartz kindle
#

but it does send a lot of images

earnest phoenix
quartz kindle
#

90% of my commands output images

earnest phoenix
quartz kindle
#

8gb per month is still a lot though

earnest phoenix
#

i have 2 bots on that

#

what

bitter sundial
#

your bot is also big in scale so

quartz kindle
#

i only have 350 servers

#

idk if its used that much

earnest phoenix
#

i only have 12 on avocado

#

smh

#

and 2 on zaam

bitter sundial
#

how are you getting 8gb egress then

earnest phoenix
#

xD

quartz kindle
#

no idea

bitter sundial
#

your images must be large

quartz kindle
#

default is 800x800 png

earnest phoenix
quartz kindle
#

average 100kb per image

earnest phoenix
#

u have to advance thru it

quartz kindle
#

unless

bitter sundial
#

I dont think I ever reached 1gb of data with 100 servers if you exclude music

earnest phoenix
#

thats retarded

#

oof

#

wix btw

quartz kindle
#

im sending images as buffers, maybe their size is bigger as a buffer

earnest phoenix
#

is broken

#

just make your own site

bitter sundial
#

nah

earnest phoenix
#

nah

#

or ask your dev that your paying $100 a week to do it

#

then i have 2 pay 4 a domain

bitter sundial
#

unless you dump some useless shit into it before sending

earnest phoenix
#

you are already paying $100 a week for a dev

#

no i lowerd his price 2 50$ a week

#

(50#)

#

(50$)

quartz kindle
#

if my images are about 150kb, then 8gb/month would average about 2000 images per day

earnest phoenix
#

a .xyz domain is $1 a year

#

too much

#

LMFAO

quartz kindle
#

is there a linux tool to measure traffic?

earnest phoenix
#

uh

quartz kindle
#

like how much data was send/received per process for a given amount of time

#

i found a lot of tools that show network speed, but not traffic log

earnest phoenix
#

netdata?

#

xD

#

what lmao

quartz kindle
#

does it show totals tho? i only see current

earnest phoenix
#

hm

quartz kindle
#

i found a hidden option in nethogs

#

sudo nethogs -v 3

#

hmm i dont know if this is normal

#

but in about 2 minutes, i got 5mb received and 500kb sent

#

on idle

earnest phoenix
quartz kindle
#

?

earnest phoenix
#

?

quartz kindle
#

my bot uploads ~1mb per 5 minutes while being idle, which totals ~8gb per month

#

what the fuck

earnest phoenix
#

How do I show that on how many servers my bot is? Google Translate

#

Gibt's hier Deutsche?

#

what lang and library

quartz kindle
earnest phoenix
#

I need ideas for commands

terse geode
#

algum br?

quartz kindle
#

@terse geode sim, mas vc so pode falar ingles aqui. outros idiomas só em #memes-and-media

earnest phoenix
#

My Developer ( @storm tartan ) has already done this & true unsuccessful. :(

#

why the fric are there so many people hiring developers for discord bots now

#

@storm tartan Wenn du Englisch kannst, schau ob dir hier geholfen werden kann.

storm tartan
#

Yeah

earnest phoenix
#

👌

#

😝

quartz kindle
#

well, i asked in the d.js server

#

they said 1mb per 5 minutes "seems normal"

#

which is 12mb per hour, 288 per day, 8.640gb per 30 days

#

¯_(ツ)_/¯

topaz fjord
#

👀

#

I say switch to GG

quartz kindle
#

gg?

topaz fjord
#

galaxygate

#

you have unlim bandwith on it

quartz kindle
#

well yeah

heady anvil
#

or ovh

quartz kindle
#

but

#

im on google's free tier and still have 290 USD of free credit left

topaz fjord
#

its in NY and I get about 23 ping

#

use the Google thing for smth else

#

besides bot

quartz kindle
#

i might in the future

topaz fjord
#

like discord clone

#

so you can kill it even more

quartz kindle
#

but for now i cant afford to pay for a vps

#

lmao

lofty hamlet
#
            fonction.channellogs(message)
            if (!Dresseurs[sender.id]) return message.channel.send(`Vous devez être un dresseur pour commencer (Commande : \`${prefix}Start\` )`)
            var Dresseur = [];
            var NbPokemons = NbPokemons
            var Team = Team
            var Noms
            var nb = 0;
            var rank = 0;
            for (var i = 0; i < message.guild.members.map(user => user.username).length; i++) {

                if (Dresseurs[message.guild.members.map(user => user.id)[i]]) {
                    nb++;
                    var Dresseur1 = Dresseurs[message.guild.members.map(user => user.id)[i]];
                    Dresseur[nb] = {
                        Points: Dresseur1.Points,
                        NbPokemons: Dresseur1.NbPokemons,
                        Team: Dresseur1.Team,
                        Nom: Dresseur1.NomDresseur
                    }
                }
            }

            Dresseur.sort(function (a, b) {
                return b.Points - a.Points;
            });
            for (var i = 0; i < nb; i++) {
                if (Dresseur[i].id == i) {
                    rank = i;
                }
            }
            var TopMsg = "";
            var topcount = 1
            for (var i = 0; i < Dresseur.length - 1; i++) {
                TopMsg += (`\n[**${topcount}**] - ` + `**${Dresseur[i].Nom}**` + " : " + `**${Dresseur[i].Points}**` + " Points | " + `**${Dresseur[i].NbPokemons}**` + (' Pokémons | Team : ' + `**${Dresseur[i].Team}**`))
                topcount++
            }
            const TopPoints = new Discord.RichEmbed()
                .setColor(0xFF88FF)
                .addField("Top Dresseurs du Discord :", TopMsg, false)
            message.channel.send(TopPoints)
        }```
#

My top is infinite, how to make it stop at 5?

quartz kindle
#

jesus

earnest phoenix
#

can someone send me a good design for an eval command

#

I don't like how it looks

#

Can program yourself. My PC is broken and I can not continue learning until I have a new one

@earnest phoenix

lofty hamlet
#

Who can help me privately?

quartz kindle
#

privately? nobody

#

unless you pay

topaz fjord
#

lmao

lofty hamlet
#

😂

topaz fjord
#

oh wait ur cert is showing up now in the overlay for me

quartz kindle
#

lmao

#

your discord thinks im worthy again

topaz fjord
#

it only happened after an update'

quartz kindle
#

@lofty hamlet if(topcount > 5) break

lofty hamlet
#

Where ?

#

@quartz kindle

quartz kindle
#

wherever you want it to stop after 5

#

actually you dont even need that

#

if you want a for to stop at 5, just do i < 5 instead of i < array.length

lofty hamlet
#

Where you can change my code ?

#
            fonction.channellogs(message)
            if (!Dresseurs[sender.id]) return message.channel.send(`Vous devez être un dresseur pour commencer (Commande : \`${prefix}Start\` )`)
            var Dresseur = [];
            var NbPokemons = NbPokemons
            var Team = Team
            var Noms
            var nb = 0;
            var rank = 0;
            for (var i = 0; i < message.guild.members.map(user => user.username).length; i++) {

                if (Dresseurs[message.guild.members.map(user => user.id)[i]]) {
                    nb++;
                    var Dresseur1 = Dresseurs[message.guild.members.map(user => user.id)[i]];
                    Dresseur[nb] = {
                        Points: Dresseur1.Points,
                        NbPokemons: Dresseur1.NbPokemons,
                        Team: Dresseur1.Team,
                        Nom: Dresseur1.NomDresseur
                    }
                }
            }

            Dresseur.sort(function (a, b) {
                return b.Points - a.Points;
            });
            for (var i = 0; i < nb; i++) {
                if (Dresseur[i].id == i) {
                    rank = i;
                }
            }
            var TopMsg = "";
            var topcount = 1
            for (var i = 0; i < Dresseur.length - 1; i++) {
                TopMsg += (`\n[**${topcount}**] - ` + `**${Dresseur[i].Nom}**` + " : " + `**${Dresseur[i].Points}**` + " Points | " + `**${Dresseur[i].NbPokemons}**` + (' Pokémons | Team : ' + `**${Dresseur[i].Team}**`))
                topcount++
            }
            const TopPoints = new Discord.RichEmbed()
                .setColor(0xFF88FF)
                .addField("Top Dresseurs du Discord :", TopMsg, false)
            message.channel.send(TopPoints)
        }```
#

You can edit my code ?

#

I don't know

quartz kindle
#

i already told you what you have to do. its up to you now. i have to go out anyway

lofty hamlet
#

But i'm french i don't understan anyway

#

You can edit plz 😣

#

Or just say where i place this line

#

@quartz kindle

earnest phoenix
#

@lofty hamlet

quartz kindle
#

google translate:

#

je ne sais pas quelle partie vous devez arrêter à 5. de toute façon si vous voulez arrêter une boucle FOR à 5, faites simplement i < 5 au lieu de i < blablabla.length

lofty hamlet
#

?

earnest phoenix
#

change Dresseur.length to 5

#

like remove Dresseur.length

#

and replace it with 5

lofty hamlet
#

I test

topaz fjord
#

@quartz kindle nice french

quartz kindle
#

thank google

#

the only thing i actually know in french is je ne parles pas francais merci bocoup

heady zinc
#

that's valid french

#

somewhat

earnest phoenix
#

how do I round ping

#

what lang @earnest phoenix

#

discord js

west raptor
#

not a lang

#

but

mild quarry
#
f = open('userlist.txt')

line = f.readline()

while line:
    st = line
    st = st[:-1]
    userlistwithformatting = ('<@!' + st + '>')
    line = f.readline()
f.close()```
I have some user IDs of Discord users in this file (users can add their ID via a command). I want to make a command that grabs all of the IDs in the file and outputs them. The problem with this though is that it's only setting the last line of the file to "userlistwithformatting". If I want to format all the lines in the certain way that Discord interprets the user IDs ( <@![userID]> ), and then store it to a variable, how do I do that?
earnest phoenix
#

@earnest phoenix thats not a lang thats a lib

#

also since your using d.js

#

Math.round()

kind nexus
#

Yo homies

mild quarry
#

does anyone know the answer to my problem above ^^

quartz kindle
#

i believe i already told you lol

kind nexus
#

I'm coding in C#,
I'm trying to have it set as, if the elapsed time = the amount of time the person set, then it sends the message
I have this but it has an error with "Time"

TimeSpan ts = stopwatch.Elapsed;
                        if (ts = time)
                        {
                            embed.WithTitle("**Time!!**");
                            embed.WithDescription("Your time is up!");
                            embed.WithColor(new Color(129, 127, 255));
                            embed.WithThumbnailUrl(Context.Guild.IconUrl);

                            await Context.Channel.SendMessageAsync("", false, embed.Build());
                        }```
#

umm

mild quarry
#

me?

quartz kindle
#

yeah, your loop is replacing the variable everytime

#

you have to concatenate or use arrays

mild quarry
#

Oh ok

west raptor
#

https://owo.oooooooooooooo.ooo/i/kjua.png any reason this is getting a messageUpdated event when nothing has changed? code: js let logchl: any = db.fetch(`${oldMessage.guild.id}_logchl`, {target:'.channel'}) if (!logchl) return; let channel: any = oldMessage.guild.channels.find((c: any) => c.id === logchl) if (oldMessage.content === '' || newMessage.content === '') return; channel.send({embed: { title: 'Message updated', fields: [ { name: 'Old Message', value: oldMessage.content }, { name: 'New Message', value: newMessage.content } ], timestamp: new Date() }})

#

i use quick.db cause im lazy pls no make fun

#

i know a simple fix i just want to know why

#

its doing it

topaz fjord
#

are you checking if the old message is the same as the new message @west raptor

gilded blaze
#

Are you accounting for embed updates?

west raptor
#

@topaz fjord i just did

topaz fjord
#

is this typescript

#

also where

west raptor
#

yes

#

uh

#

i just added it

ruby dust
#

what is that domain

west raptor
#

idk

topaz fjord
#

also are u using the messageUpdate event

west raptor
#

yea

quartz kindle
#

how do you install d.js master with npm again?

topaz fjord
#

npm i discordjs/discord.js

#

directly from source

quartz kindle
#

thanks

west raptor
#

what is the max amount of time for .setRateLimitPerUser()? like .setRateLimitPerUser(5)

inland latch
#

anyone know how to get the bot's server names, in a comma seperated string? discord.py async version, cmds ext

earnest phoenix
#

async?

#

Why not just switch to rewrite

west raptor
#

async is outdated

#

use rewrite

ruby dust
#

That doesn't even sound like a library specific question, it's as simple as using .join(list)

west raptor
#

i dont like python's way of doing that

#

i think myarray.join(' ') is a lot simpler imo

#

and looks a bit cleaner

quartz kindle
#

in the d.js docs it says bufferutil is faster when not using uws

#

does anyone know if this is also true for Eris?

#

it doesnt say anything about it in the Eris docs, just that both can make the bot faster

earnest phoenix
#
@bot.event
async def on_member_join(member):
    embed = discord.Embed(title="Member Joined")
    embed.add_field(name="User",value=member.name)
    embed.add_field(name="Time",value=datetime.now())
    try:
        channel = discord.utils.get(member.guild.channels, name='general')
        await channel.send(embed=embed)
    except:
        channel = discord.utils.get(member.guild.channels, name='bot-testing')
        await channel.send(embed=embed)
    else:
        channel = discord.utils.get(member.guild.channels, name='bot-hell')
        await channel.send(embed=embed)

What it does:
Sends the person who joined to my server
What I want:
sends to the server of the person who joined

#

Thanks in advanced

#

😐

quartz kindle
#

what? i dont understand

earnest phoenix
#

tim stop being a dum dum

#

also

#

@earnest phoenix you code doesn't say to send it to a specific server

#

it says to just send it to any channel with the name general

inland latch
#
@bot.command(pass_context=True)
async def servinv(ctx):
    if ctx.message.author.id.startswith('261236127581601793'):
        serversearch = discord.utils.get(bot.servers, name=ctx.message.content[10:])
        if serversearch == None:
            await bot.say(":no: | **This server cannot be found.**")
            return
        else:
            try:
                n = await bot.create_invite(destination=serversearch)
                await bot.say(":yes: | " + n.url)
                return
            except Exception as e:
                await bot.say(e)
    else:
        await bot.say(":no: | **You don't have permission to use this command.**")    
        return

Anyone know how to fix my invite code?

uneven depot
#

id is not a string, can just do id == 261236127581601793

west raptor
#

id is only a string in js iirc

topaz fjord
#

yes

#

js cant handle bigint

earnest phoenix
#

@earnest phoenix So what do i do?

#

i know why the problem is happening

#

i don't know how to fix it

#

soz

#

i don't use python

bleak sapphire
#

Am I allowed to have swear words in my bot's responses?

lament meteor
#

i think u can

#

just no nsfw

bleak sapphire
#

oh alright tnx

stone scroll
#

how do get a role set of a memer with .toLowerCase()?

#

I want to make a purge command and you need to have mod / admin role and I don't want the roles to be those exact names.

#

like it's case insensitive

earnest phoenix
#

Can somebody tell me how can I make my Discord bot status set to streaming?

bright spear
#

@earnest phoenix lib?

earnest phoenix
#

JS

bright spear
#

...

#

thats the language

#

what lib

earnest phoenix
#

Discord.js

#

Clear now?

bright spear
earnest phoenix
#

K thx

earnest phoenix
#

Hello, I have this error in my code

#

TypeError: Cannot read property 'name' of undefined

#

code

#
if(message.content.startsWith(prefix + "userinfo")) {
    const user = message.mentions.users.first() || message.author;
    const embed = new Discord.RichEmbed()
    .setTitle(`Informations about`)
    .setDescription(`${user.username}` + "#" + `${user.discriminator}`)
    .setThumbnail(user.displayAvatarURL)
    .setColor('RANDOM')
    .addField('ID', user.id, true)
    .addField('Username', user.username, true)
    .addField('Discrim', user.discriminator, true)
    .addField('Status', user.presence.status, true)
    .addField('Bot', user.bot, true)
    .addField('Game', user.presence.activity.name)
    message.channel.send(embed)
}```
#

i think the problem is

#
.addField('Game', user.presence.activity.name)```
#

You'd be right

#

user.presence.activity is null

#

You have to make sure it's not null first

#

Can someone tell me is there an error that causes my bot to not set its status to stream?

client.user.setActivity(‘http://codiac.onuniverse.com’, `https://twitch.tv/codiacbot`, {type: “STREAMING”});
vernal rivet
#

@earnest phoenix check to make sure that stats names is STREAMING AND NOT SOMETHING ELSE

earnest phoenix
#

How should I do that?

bleak sapphire
#

if you want to compare use a if statement but if u just want to print out the status then check the documentation for the activity

storm tartan
#

Hey can somone help me with the Server count on the website i had do all same but its not works libary discord.py

lament meteor
#

watcha mean @storm tartan ?

#

also u gotta post it using the api

storm tartan
#

i use the example

lament meteor
#

which example?

storm tartan
#

from the API page

lament meteor
storm tartan
#

yes

lament meteor
#

did u put the correct api key?

storm tartan
#

yes

lament meteor
#

and whats the error?

storm tartan
#

Notinhg

lament meteor
#

u mean it doesnt show on the website the correct servercount?

storm tartan
#

its show nothing

#

can i send you the code private ?

lament meteor
#

sure

#

just dont show the token(even i wont troll u with it)

storm tartan
#

yes

whole condor
#

How to detect the person who puts a reaction on a message with :

const collectorM = msg.createReactionCollector(MinutesCollector, { time: 900000 });
 

collectorM.on('collect', async (r) => {
})
lament meteor
#

@whole condor pls explain more

earnest phoenix
#

help me out


from discord.ext.commands import has_permissions

import discord

with open('reports.json', encoding='utf-8') as f:
  try:
    report = json.load(f)
  except ValueError:
    report = {}
    report['users'] = []

prefix = '#'
bot = discord.ext.commands.Bot(command_prefix=prefix, description=description)

@bot.command(pass_context = True)
@has_permissions(manage_roles=True, ban_members=True)
async def warn(ctx,user:discord.User,*reason:str):
  if not reason:
    await bot.say("Please provide a reason")
    return
  reason = ' '.join(reason)
  for current_user in report['users']:
    if current_user['name'] == user.name:
      current_user['reasons'].append(reason)
      break
  else:
    report['users'].append({
      'name':user.name,
      'reasons': [reason,]
    })
  with open('reports.json','w+') as f:
    json.dump(report,f)

@bot.command(pass_context = True)
async def warnings(ctx,user:discord.User):
  for current_user in report['users']:
    if user.name == current_user['name']:
      await bot.say(f"{user.name} has been reported {len(current_user['reasons'])} times : {','.join(current_user['reasons'])}")
      break
  else:
    await client.say(f"{user.name} has never been reported")  

@warn.error
async def kick_error(error, ctx):
  if isinstance(error, MissingPermissions):
      text = "Sorry {}, you do not have permissions to do that!".format(ctx.message.author)
      await bot.send_message(ctx.message.channel, text)```
whn i use it says
```eError: name 'MissingPermissions' is not defined```
whole condor
#

@lament meteor How to know the user who puts a reaction

lament meteor
#

@earnest phoenix can u do ```py on ur code

#

stable right @whole condor

whole condor
#

Yes but I do not have access to the ID of the person who reacts ..

lament meteor
#

wait no

#

it is

#
collector.on('collect', async (r, user) => {
console.log(user.id)
})
whole condor
#

It does not work

#

I had already tried

#

@lament meteor

placid sierra
#

sorry, please help me 🙏
Anyone knows can we send message or chat to somebody from external service using Discord chat API?

quartz kindle
#

if an external service is programmable or has an API, you can link both and broadcast messages to each other's apis

#

for example, a telegram bot and a discord bot broadcasting to each other

placid sierra
#

We are programming a service what users can login by Discord account, and we want to let them can chat each other on our platform using discord chat server.
We dont build private chat server.

astral quail
#

That's not possible.

placid sierra
#

@quartz kindle
Thank you so much.

for example, a telegram bot and a discord bot broadcasting to each other
Do you think it is one way good for my application?

#

@astral quail

That's not possible.
😩
do you have any idea for replaceable solution?

quartz kindle
#

yes it is possible

#

you want to create a private chat system powered by discord

#

discord has special integrations for that, for example their game integration api to create discord chats inside games

#

you just need a discord server and a discord bot that sends and receives messages to and from your service

placid sierra
#

you want to create a private chat system powered by discord
How can we do it? Do you have any documentation about this? 🙏

quartz kindle
#

what is your service built on?

placid sierra
#

we built on node.js

#

did you mean it?

quartz kindle
#

then integrate a discord bot in it

#

any discord library

#

set up a server and monitor messages. when a new message is posted in the server, send to your service. when a new message is posted in your service, send to your server

placid sierra
#

set up a server
did you mean it is a private chat system powered by discord?

quartz kindle
#

a normal discord server

#

you have two options, either people can chat in both, your discord server and your service

#

or people can only chat in your service

#

for the second option, you create a discord server and have nobody in it, only your discord bot

astral quail
#

@quartz kindle yeah but he wants to make one without his own server stuff

quartz kindle
#

you cant without a discord server

placid sierra
#

Yes, we only provide discord chat functionality in our service. We dont own any games, any discord chat servers.

#

Discord bot can send message directly to anyone, doesn't it?
If they accessed to our service via oauth2 authentication, can we send message to them directly using discord bot?

#

Maybe it is impossible too...
Discord bot works for our discord server, doesn't it?

stuck ravine
jagged plume
#

get ffmpeg

stuck ravine
#

Yes, but how to do it ?

jagged plume
#

one sec

stuck ravine
#

no problem 😉

jagged plume
#

you'll just need to google it, shouldn't be that hard. make sure to include what os you're using

stuck ravine
#

Okay thanks you

#

I have a problem with my bot discord, he does not play music

quartz kindle
#

you're passing an object instead of a string

#

it says right there

stuck ravine
#

And how can I fix the problem?

quartz kindle
#

by passing a string instead of an object

stuck ravine
#

But I do not know the object ^^

quartz kindle
#

if you dont know what an object or a string is, then you should study more

stuck ravine
#

After joining the channel he does not put the music

#

If I know, but I do not know which channel

idle mountain
#

oof

quartz kindle
#

sinner

idle mountain
#

editing your bot a whole bunch of times is ok, people do it all the time

#

im kinda minimodding aren't i angeryBOYE

bronze wagon
#

i got a bit of problem

#

im trying to like execute function on command

#

like if command is given

#

function will pause

#

and if command is given again function will continue

#

thats a bit messy.

{
*function1* 
}

//if message "asd" given, stop function 1
//if message "asd" given again, start function1
night imp
#

@bronze wagon uh you could do it two ways

#

have a condition if paused and check it then with a while loop check if it is true (every x seconds)

#

if true than stop the loop and continue

#

or you could break it up to several smaller functions and use a setinterval to see if the value is x and start the function

bronze wagon
#

Ill try to figure it out, tnx

earnest phoenix
#

hey

#

my VSC is saying this has a issue in it

#

const discord = require('discord.js');
const bot = new discord.Client();

bot.on('ready' , () => {
bot.user.setGame('Rainbow Six Siege')
//Normal SetGame Status is: Prefix Is ZTB Creator is EmanSza
bot.user.setStatus('Online')

});

bot.on('message' , (message) =>{

if(message.content == '>ping') {
    //message.reply('pong 10.75MS');
    message.channel.sendMessage('pong');

}

});

bot.on('message' , (message) =>{

if(message.content == '>Help') {
    //message.reply('pong 10.75MS');
    message.channel.sendMessage('Help Ping');

}

});

topaz fjord
#

send message is deprecated

earnest phoenix
#

the help one right

topaz fjord
#

And you don't need 2 message events

earnest phoenix
#

i dont ?

topaz fjord
#

no

earnest phoenix
#

so do i do this then

topaz fjord
#

sendMessage is deprecated in both

earnest phoenix
#

const discord = require('discord.js');
const bot = new discord.Client();

bot.on('ready' , () => {
bot.user.setGame('Rainbow Six Siege')
//Normal SetGame Status is: Prefix Is ZTB Creator is EmanSza
bot.user.setStatus('Online')

bot.on('message' , (message) =>{

if(message.content == '>ping') {
    //message.reply('pong 10.75MS');
    message.channel.sendMessage('pong');


if(message.content == '>Help') {
    //message.reply('pong 10.75MS');
    message.channel.sendMessage('Help Ping');

}

});

#

would that work

topaz fjord
#

nope

#

your not closing the brackets

earnest phoenix
#

const discord = require('discord.js');
const bot = new discord.Client();

bot.on('ready' , () => {
bot.user.setGame('Rainbow Six Siege')
//Normal SetGame Status is: Prefix Is ZTB Creator is EmanSza
bot.user.setStatus('Online')

});

bot.on('message' , (message) =>{

if(message.content == '>ping') {
    //message.reply('pong 10.75MS');
    message.channel.sendMessage('pong');

}

});

if(message.content == '>Help') {
    //message.reply('pong 10.75MS');
    message.channel.sendMessage('Help Ping');

}

});

topaz fjord
#

You're closing the message event too early

west raptor
#

code block pls

earnest phoenix
#

js code

#

?

west raptor
#

```js
code```

earnest phoenix
#

what does that do?

west raptor
#

puts it in a code block

quartz kindle
#

this

west raptor
#

in

#

discord

topaz fjord
#

make it easier to read

west raptor
#

^

earnest phoenix
#

``const discord = require('discord.js');
const bot = new discord.Client();

bot.on('ready' , () => {
bot.user.setGame('Rainbow Six Siege')
//Normal SetGame Status is: Prefix Is ZTB Creator is EmanSza
bot.user.setStatus('Online')

});

bot.on('message' , (message) =>{

if(message.content == '>ping') {
    //message.reply('pong 10.75MS');
    message.channel.sendMessage('pong');

}

});

bot.on('message' , (message) =>{

if(message.content == '>Help') {
    //message.reply('pong 10.75MS');
    message.channel.sendMessage('Help Ping');

}

});``

quartz kindle
#

no

earnest phoenix
#

could someone edit that pls

#

and fix it

#

i tired yt videos

quartz kindle
#

3x `

#

not 1x `

#

on each side

earnest phoenix
#
const bot = new discord.Client();

bot.on('ready' , () => {
    bot.user.setGame('Rainbow Six Siege')
//Normal SetGame Status is: Prefix Is ZTB Creator is EmanSza
    bot.user.setStatus('Online')


});

bot.on('message' , (message) =>{

    if(message.content == '>ping') {
        //message.reply('pong 10.75MS');
        message.channel.sendMessage('pong');

    }
});

bot.on('message' , (message) =>{

    if(message.content == '>Help') {
        //message.reply('pong 10.75MS');
        message.channel.sendMessage('Help Ping');

    }
});```
west raptor
#

yes

quartz kindle
#

thank you

earnest phoenix
#

np

west raptor
#

setGame is deprecated

quartz kindle
#

now dont do bot.on("message") 2x. only 1x

west raptor
#

use setActivity

earnest phoenix
#

ok

quartz kindle
#

and you have a lot of outdated functions

#

you're following an old and outdated tutorial

earnest phoenix
#

would any of you would like to help me with this

quartz kindle
#

sendMessage is old and outdated. you should use send instead of sendMessage

topaz fjord
#

he's using yorks

earnest phoenix
#

discord frooze

#

so i do this

#
const bot = new discord.Client();

bot.on('ready' , () => {
    bot.user.setGame('Rainbow Six Siege')
//Normal SetGame Status is: Prefix Is ZTB Creator is EmanSza
    bot.user.setStatus('Online')


});

bot.on('message' , (message) =>{

    if(message.content == '>ping') {
        //message.reply('pong 10.75MS');
        message.channel.send('pong');

    }
});

bot.on('message' , (message) =>{

    if(message.content == '>Help') {
        //message.reply('pong 10.75MS');
        message.channel.send('Help Ping');

    }
});```
#

something like dat

west raptor
#

you don't need to set the status btw

#

discord.js does that for you

earnest phoenix
#

ok

quartz kindle
earnest phoenix
#

manage roles then?

topaz fjord
#

you dont need to check if they equal true

quartz kindle
#

its MANAGE_GUILD not MANAGE_SERVER

topaz fjord
#

they return a boolean anyways

earnest phoenix
#

I check for true because I use emojis instead of true and false

topaz fjord
#

yes but you can do if(message.guild.me.hasPermission(....)) { ... } else { ... }

earnest phoenix
#

ty @quartz kindle

west raptor
#

hasPermission returns a boolean doing js if (thing) { ... } checks if it is true

#

no reason to do js if (thing === true) { ... }

topaz fjord
#

yes sir

earnest phoenix
#

yes papa

earnest phoenix
#

help me ?

#

can anybody help me?

#

<@&304313580025544704>

#

You just pinged all the mods

#

Why

#

?

#

whats?

#

Why did you ping all the moderators?

#

I need help to put the number of servers where my bot is currently as I do it?

#

What lib

#

sorry I did not want to bother

#

py

#

ye

#
len(bot.guilds)
#

?

#

I want to put it on the website

#

Oh

#

I don't know then

#

:/

hushed berry
#

Please don't tag all mods in the future

earnest phoenix
#

sorry

#

Do I need to change something on the site to show the server count?

#

What is the dbl token?

#

@hushed berry ?

west raptor
earnest phoenix
#

thanks

#

I did this plus my servers counter is not showing up

quartz kindle
#

show what you did

earnest phoenix
#

okay

#

@quartz kindle

#

That's a long AF token

#

??

#

whats

#

@earnest phoenix

#

the token

quartz kindle
#

and it doesnt work? does it show any error?

earnest phoenix
#

the bot usually connects but does not appear on the site the number of servers

quartz kindle
#

what is loop=bot.loop ?

#

the official example doesnt have it

topaz fjord
#

dbots tokens are long @earnest phoenix

earnest phoenix
#

ik

#

why so long

topaz fjord
#

I think its a jwt

earnest phoenix
#

jwt?

#

@quartz kindle não entendi

#

I did not understand

quartz kindle
#

your code looks different than this

earnest phoenix
#

no

#

@quartz kindle

#

it's alright

quartz kindle
#

what is your client variable?

#

this? client = discord.Client()

earnest phoenix
#

yes

#

@quartz kindle

quartz kindle
#

try this py def setup(client): global logger logger = logging.getLogger('client') client.add_cog(DiscordBotsOrgAPI(client))

#

else i dont know, i dont use python

earnest phoenix
#

I have to change these too?

#

@quartz kindle

#

Wanna see what I'm doing?

quartz kindle
#

i think you dont need to change those

#

client there gets converted to bot up there

#

i think

#

i might be wrong, i dont know python

earnest phoenix
#

😦

#

@earnest phoenix yes

#
# Update server count on Discord Bot List (DBL)

# Variables

token = config.dbltoken;
dblpy = dbl.Client(bot, token, loop = bot.loop);

# Function

async def update_dblservercount():
    await bot.wait_until_ready();
    while not bot.is_closed():
        try:
            await dblpy.post_server_count();
            print("Posted server count on DBL");
        except Exception as e:
            print("Failed to post the server count on DBL");
            print("Error: " + str(e));
        await asyncio.sleep(1800);
bot.loop.create_task(update_dblservercount());
#

dosen't tell me the error

#

but my bot is offline

#

my help plss

#

@topaz fjord look, another one of my suggestions zoomeyes

#

the "no error but doesn't work"

topaz fjord
earnest phoenix
#

🔇

topaz fjord
#

im legit about to make a bot that does this

earnest phoenix
#

dms them with "hey, you just sent a message with "property of undefined" in the text, why not take a look at these links? <insert codeacademy link here>"

topaz fjord
#

yes

earnest phoenix
empty rampart
#

hey i have a question

ruby dust
#

hey I have an anwer

west raptor
#

ok

#

ask

empty rampart
#

how can i have my bot say somthing when i upload a youtube video

west raptor
#

uh

#

wdym

frank dust
#

try IFTTT

#
#

that might have something for you

empty rampart
#

like i want it to say some thing wen i upload a youtube video like how and should use a api

earnest phoenix
#

or use the youtube api

#

I'm pre sure they have webhook for that

empty rampart
#

ok but how do i use a api

west raptor
#

pls

earnest phoenix
#

idk how do i use google

#

kill me pls

ruby dust
#

I don't think you have to use a bot for that, IFTTT provides you the free way of webhooking these events

empty rampart
#

dont you think ive already tried googling it

ruby dust
#

how about instead of googling "how to use youtube api", try googling "youtube discord webhook"

earnest phoenix
#

yep u must have ur eyes closed tho

#

How do I know if the apple is working?

cold niche
#

Does somebody ever used the Patreon API to get Discord IDs of subscribers?

earnest phoenix
#

I'm wondering too @cold niche since their webhook docs suck

#

alot

topaz fjord
#

@earnest phoenix s9 or 8

earnest phoenix
#

8

topaz fjord
#

nice

#

switch your buttons smh

cold niche
#

I think I did everything well, but:

{
    "errors": [
        {
            "code": null,
            "code_name": "InternalError",
            "detail": "An unrecoverable internal server error has occurred.",
            "id": "asd",
            "status": "500",
            "title": "Internal Error."
        }
    ]
}
#

xD

topaz fjord
#

the back button is supposed to be on the left

earnest phoenix
#

no I switch

cold niche
#

everytime I include the social_connections param

earnest phoenix
#

I prefer this way

cold niche
#

otherwise all the others are working

earnest phoenix
#

I'm used to since hardware buttons on Samsung's for many years

#

I'm not using the all just looking at the webhook responses @cold niche so cant help sry

#

but the webhook format is ass :p

cold niche
#

this is bad too

earnest phoenix
#

rip

cold niche
#

It took me 3 hours to figure out how it works

empty rampart
#

dame why u so rufe im just asking question @earnest phoenix

topaz fjord
#

He's not rude

earnest phoenix
#

another mute reason @topaz fjord

#

complaining when getting helped

cold niche
#

but the webhook isn't always accurate and I want to get data not just on changes

topaz fjord
#

he's just showing you how easy it was

earnest phoenix
#

not accurate? MonkaS

cold niche
#

I think I'll end up parsing the website xD

earnest phoenix
#

ill end up just not using it tbh

cold niche
#

yeah they say sometimes they don't send out the events

earnest phoenix
#

oh rip

cold niche
#

it happened with me 4 times

earnest phoenix
#

damn

cold niche
#

better to request all the subs/ids once a day

#

and keep it up to date in a db

#

plus I won't drop the hooks either

#

but this seems to be broken

earnest phoenix
#

well if you work out how to get social connections working dm me i would appreciate

cold niche
#

alright

earnest phoenix
#

How do I know if the dbl api is working?

cold niche
earnest phoenix
#

ok

cold niche
#

no response

earnest phoenix
#

so uh code block

#

check the response code of your request @earnest phoenix

cold niche
#

I think they just don't care

heady zinc
#

they don't

#

patreon's api is a pain to work with

topaz fjord
#

ur a pain to work with

cold niche
#

I know

#

Their docs is so shitty

heady zinc
#

the only "reliable" way we've found to get discord IDs is to iterate over all the pledges

cold niche
#

I guess it's time to switch to braintree xD

#

What if the user doesn't belong to any pledge but donates some money

heady zinc
#

the user cannot not belong to any pledge

cold niche
#

Oh there is a 0 one

#

I see

earnest phoenix
#

so uh

#

help me to get a server counter without dbl

#

what

cold niche
#

Just use your bot thinkSmart

earnest phoenix
#
 message.guild.members.forEach(g => {
    if(g.nickname.startsWith("!")) {
      
    }
  })
#

would this work? (sorry for sending it again)

#

if nickname is not undefined

#

and is valid property of guildmember

#

then yes

#

haha yes

west raptor
#

wouldnt displayName be better

earnest phoenix
#

also if you are trying to dehoist

#

don't do that

#

use localecompare

topaz fjord
#

check if their displayName has a hoisting character and nickname them

earnest phoenix
#

oh ok

topaz fjord
#

and also use what tom said

earnest phoenix
#

localecompare or die

topaz fjord
#

localeCompare *

#

camel case pls

earnest phoenix
#

mobile pls

cold niche
#

camelCase*

topaz fjord
#

I need to figure out how to pretty print logging in golang

earnest phoenix
#

functions without camel case when™

cold niche
#

I need to figure out how to put my commands into reloadable modules with go

#

So I don't need to restart the bot on changes

topaz fjord
#

you cant do function with camel case in golang

#

if you do camel case it counts as a private function

earnest phoenix
#

ok so

#

im looking at localeCompare

#

and

#

i got u dawg dw

#

gimme sec to type on mobile

#

if(nickname.charAt().localeCompare("a") < 0) {}

west raptor
#

do displayName instead, @earnest phoenix

topaz fjord
#

spoonfeed