#development

1 messages Β· Page 411 of 1

topaz fjord
#

I can barely see

#

Also reset your token

#

Your not supposed to show it to others

brisk ginkgo
#

crap i forgot that was there

#

how can i make my code bigger for u to see

#

and if u go to the see origanel u can zoom in

#

and i also cant start it

low rivet
brisk ginkgo
#

?

#

what is that

tepid laurel
#

If u go to it u can just copy and paste ur code there click the save button and then send the link

brisk ginkgo
#

ya i got my code fixed now trying to get it to start

tepid laurel
#

You got it fixed but it wont start

#

Seems like a technical issue to meπŸ€”

brisk ginkgo
#

ReferenceError: bot is not defined
at Object.<anonymous> (C:\Users\Durran\Documents\BOTS\index.js:43:1)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:719:10)
at startup (internal/bootstrap/node.js:228:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:576:3)

tepid laurel
#

So u had it first as β€œbot”

brisk ginkgo
#

?

tepid laurel
#

And you need to login

quasi hearth
#

is bot = require('discord.js')

brisk ginkgo
#

can u show me your code

quasi hearth
#

try changing 'bot' to 'client'

tepid laurel
#

Uh no plenty of free sources on google

quasi hearth
#

just a hunch

tepid laurel
#

Plus, you're not logging in even.

brisk ginkgo
#

wjhat u mena

tepid laurel
#

paste below

#

client.login('sometoken')

brisk ginkgo
#

dose bot.login not work?

quasi hearth
#

demon_hell, on your first few lines, do you have a code like
var client = require('discord.js') ?

if so, then bot.login('token') wont work
You need to use:
client.login('token');

tepid laurel
#

It depends how you defined your instance of it

#

And you defined it as client

#

Meaning bot is undefined yes

#

@quasi hearth could you not

quasi hearth
#

😦

brisk ginkgo
#

worked

tepid laurel
#

Okay great but you sure are long way from getting a hang of it all. What I suggest is reading guides or so, source codes, puzzling it all, as is google your best friend

#

@brisk ginkgo some useful links

#
brisk ginkgo
#

ok thx man

tepid laurel
#

No problem

brisk ginkgo
#

how do i shut off my bot?

quasi hearth
#

end the process via terminal (ctrl + c) or close it

brisk ginkgo
#

yay my bot works\

#

@quasi hearth join and try him out

tiny turtle
#

How do I add my own text before the var but in it so if the value is false it disappears with the var?
${tempVars("test")[0].bonus_item_1 || ""}

#

I want it to add (Item 1)

quasi hearth
#

client.on('message', function(msg){
if(!msg.author.bot){
switch(msg.content){
case '+youtubelink':
msg.reply("bar");
break;
case '+instagram':
msg.reply("foo");
break;
}
}
});

ISSUE: '+instagram' spams for some reason
EDIT: strangely, changing the link to text fixes the issue

brisk ginkgo
#

anyone got an idea on how to fix

lament meteor
#

yes :learnjs:

quasi hearth
#

we found that replacing the link with text fixed the issue. it was quite weird

lament meteor
#

?

#

also @quasi hearth u should...

quasi hearth
#

i should....?

lament meteor
#

use returns

#

so if(msg.author.bot) return

quasi hearth
#

true, didn't think of that :p

lament meteor
#

πŸ˜›

earnest phoenix
#

@bitter sundial when will my bot be online?

bitter sundial
#

when you make it online

lament meteor
#

lol

soft shadow
#

Hi, is this the proper channel to address a slight issue with?

ruby dust
#

this is bot development discussion, if that's what you mean

soft shadow
#

Well, no, see, I'm trying to resolve an issue I've been having as of late concerning the Login function.

quasi hearth
#

What's the issue?

soft shadow
#

I use Discord on both my mobile device and my Kindle Fire tablet (although my phone is always the more beneficial use), but I've noticed that each time I try to invite a Discord bot on my phone, via the Authorization panel, it doesn't have my main account signed in. Yet, on my tablet, it does, and I wanna be able to have my main Discord account signed in on my phone as well.

#

And it seems to keep the same issue around. My phone seems to only recognize my secondary account

#

And my tablet the primary one

quasi hearth
#

Try logging out from the app

ruby dust
#

discordbots.org uses your actual discord account, so you have to sign out from that instead

soft shadow
#

I'm currently using my primary account. I can try signing out of this one and see what it does, but if nothing changes, I'l come back in.

heady zinc
solid cliff
#

you are trying to signout through mobile right

soft shadow
#

Alright, let me try that because signing out of both devices didn't work

ruby dust
#

well you are technically inviting bots via a oauth page on the browser, so you need to log into the correct account on that corresponding browser then

soft shadow
#

Alright it seems that aspect was logged in with my other account. I signed in and relogged in with my primary.

#

I'm gonna test to see if it'll work now.

quasi hearth
#

Good luck

soft shadow
#

Successful login. Thank you very much, guys, the issue has been resolved.

quasi hearth
#

πŸ˜ƒ

ruby dust
#

so official, but np

soft shadow
#

Haha, I have my formal moments.

#

But once again, I appreciate the assistance.

hidden crystal
#

Hey

#

I want some help

#

developing a python bot

halcyon torrent
#

I dont know pyton, but ask your question, they'll answer you ^^

hidden crystal
#

I was sent here to ask for help with my problem, and I'm being redirected to somewhere else

#

Lol

quiet bobcat
#

bruh node.js

#

haha

halcyon torrent
#

it was a joke ^^ because I dont like python xD

#

you're at the right place ^^

earnest phoenix
#

Uhm

#

MAke your bot in js or C# XD

#

Ok srsly whats your problem?

#

with Python

halcyon torrent
#

I already made this joke x)

earnest phoenix
#

Lol XD

hidden crystal
#

You know python @earnest phoenix

#

?

earnest phoenix
#

Ish

#

I know C, JS, Java, C#

#

Python is based on them

hidden crystal
#
@bot.command(pass_context = True)
async def infoembed(ctx, user: discord.Member):
    embed = discord.Embed()

    embed.set_author(name = "API Security Bot | Statistics")
    embed.add_field(name = "The user's name is: ", value = format(user.name))
    embed.add_field(name = "The user's ID is: ", value = format(user.id))
    embed.add_field(name = "The user's status is: ", value = format(user.status))
    embed.add_field(name = "The user's highest role is: ", value = format(user.top_role))
    embed.add_field(name = "the user joined at: ", value = format(user.joined_at))

    await bot.say(embed = embed)
#

This is the code

#

And it returns with this error when executed:

earnest phoenix
hidden crystal
#

Yeah obviously

#

Which is that arguement though

earnest phoenix
#

hold up gotta see what the PY APi says

hidden crystal
#

It says below that line "user is a required arguement that is missing."

frigid juniper
#

do ctx, *user

hidden crystal
#
async def infoembed(ctx, *user):
#

?

frigid juniper
#

Yes

#

And after user

#

ctx, *user: discord.Member

hidden crystal
#

Okay

#

lemme see if it works

frigid juniper
#

And after do

    user = ...```
hidden crystal
#
async def stats(ctx, *user: discord.Member):
    if not user
        user = discord.Member
#

like that?

#

I forgot a colon

frigid juniper
#
async def infoembed(ctx, *user: discord.Member):
    if not user:
        user = ctx.message.author
    embed = discord.Embed()```
hidden crystal
#

Okay

#

Works!

frigid juniper
#

Yep I know

#

^^

hidden crystal
#

Now I need something else..

frigid juniper
#

for what

hidden crystal
#

I want to have the avatar or the bot at top next to the author

#

of the bot*

frigid juniper
hidden crystal
#

Wait, the "Request by RANDOMUSER

#

is a footer?

#

or am I dumb?

frigid juniper
#

Yes footer

hidden crystal
#
embed.add_footer(text = "Requested by ".format(user.name))
#

or

#
embed.add_footer(text = "Requested by " + format(user.name))
earnest phoenix
#
client.on("message", async message => {
if(message.author.bot) return;
if(message.content.indexOf(config.prefix) !== 0) return;

const args = message.content.slice(config.prefix.length).trim().split(/ld!/g);
const command = args.shift().toLowerCase();```
#

That was teh only way I manage to make it to ignore everything except real people?

#

It works, but is that the most effecient way?

quiet bobcat
#

You could use /\s+/g instead of /ld!/g

#

also you could use message.content.startsWith

#

instead of message.content.indexOf

earnest phoenix
#
if(message.author.bot) return;
if(message.content.startsWith(config.prefix) !== 0) return;

const args = message.content.slice(config.prefix.length).trim().split(/ld!/g);
const command = args.shift().toLowerCase();```
#

?

quiet bobcat
#

You don't need !== 0

#

just if it doesn't start with config.prefix return

earnest phoenix
#

oh, so I can remove the whole !==0 ?

quiet bobcat
#

yeah

#

add a ! before message

#

or it will ignore everything that starts with your prefix

earnest phoenix
#

How do I connect a API to my bot?

#

Like SpaceX api?

#

Caus I have made "require" thing

#

but it cant find the api?

quiet bobcat
#

is the node package installed?

earnest phoenix
#

Yes

#

Its with that I run the bot

quiet bobcat
#

you run your bot via a spacex api?

wanton walrus
earnest phoenix
#

XD

#

I want to

#

;/

quiet bobcat
#

then it wouldn't work with discord

earnest phoenix
#

Shit ;/, then I have to make a external server that sends the API data to my bot?

quiet bobcat
#

what

#

idk

#

I don't think so

earnest phoenix
quiet bobcat
#

that's not requiring a node package

earnest phoenix
#

I need koa ;/

#

running koa through node ;))))

earnest phoenix
#

omg I just downloaded 50 MB koa librbaries XD

#

lol

topaz fjord
#

Why not run as two separate processes

inland pulsar
#

(embeds are disabled in this chat)

#

I don't know why :/ it isn't showing up with https

#

Discord also doesn't show .png ect in chat when using https

acoustic juniper
#

quick question I have a bot that keeps repeating the same statement when you try to say something to it any one know why?

grizzled isle
#

Try using else-if statememnts

#

or case-switch

inland pulsar
#

please use a switch

uncut slate
#

use an object

topaz fjord
#

If you try to add that bot to this server it will probs get muted for repsonded to non prefixed commands

trim plinth
#

switch and case please zoomeyes

uncut slate
#

ew

#

no

#

use an object, that makes so much more sense

earnest phoenix
#

^

uncut slate
#
const responses = {
  'hi': 'hello',
  'bye im leaving': 'ok bye'
};

client.on('message', msg => {
  const response = responses[msg.content.toLowerCase()];
  if (response) {
    msg.channel.send(response);
  }
});
earnest phoenix
#

Ey timmy

#

I'm trying to connect my bot to SPaceX api

#

but I cant get the fetch to work?

#

Like I want to take the JSON and then print int out raw in chat as a start but I cant get it to download it ;/

inland pulsar
#

please help meh :(

hidden crystal
#

I need some help with coding a python bot (embed)

earnest phoenix
#

embed?

#

python?

#

Whats the problem with that?

hidden crystal
#

If I do apistats without mentioning someone

#

it shows my stats

#

if I mention someone

#

it doesn't do anything at all

quasi hearth
#

that looks like it might be a problem with your code that fetches the stats

hidden crystal
#

Yeah

#

What do I gotta add?

#
bot.command(pass_context = True)
async def stats(ctx, *user: discord.Member):
    if not user:
        user = ctx.message.author
    embed = discord.Embed()

    embed.set_author(name = "API Security Bot | Statistics")
    embed.add_field(name = "The user's name is: ", value = format(user.name))
    embed.add_field(name = "The user's ID is: ", value = format(user.id))
    embed.add_field(name = "The user's status is: ", value = format(user.status))
    embed.add_field(name = "The user's highest role is: ", value = format(user.top_role))
    embed.add_field(name = "The user joined at: ", value = format(user.joined_at))
    embed.set_footer(text = "Requested by API Security")

    await bot.say(embed = embed)
quasi hearth
#

mentions look like this to the bot: <@id>
so to get a user from a mention, you need to do something like:
ctx.message.guild.members.get(id)
(You will need to write the code to get id by yourself, as I'm not fully sure on how your messages are formatted and stuff)
(might not work exactly, as I use discord.js)

hidden crystal
#

Isn't it <@%s>

#

?

#

wait

#

nvm

#

@quasi hearth want me to send you the whole bot?

#

bot code

#

I mean

quasi hearth
#

if you want to (dm me tho cuz i might be going afk soon) just make sure that any personal info is hidden.

violet wyvern
#

Keeps doing error

elder rapids
#

well for one you don't because you need ffmpeg for what you're doing

#

I guess depending what you're using

violet wyvern
#

Ok

#

But I don't know how to add ffmpeg to my github repo

low owl
#

You talk a bunch of gibberish right now. First try explaining your actual problem, please. Otherwise we won't be able to help you the slightest.

violet wyvern
#

I'm hosting my music bot in heroku and the log keeps giving an error about ffmpeg

elder rapids
#

wew

#

Heroku

violet wyvern
#

Yes

elder rapids
#

Bad, not really a good platform on that

earnest phoenix
#

How do i get my bot on the site>

elder rapids
#

I remember I had issues with Heroku and ffmpeg and such before

#

(but that was before I bought got a VPS)

violet wyvern
#

But I don't want to pay

#

That's the problem

elder rapids
#

Sorry to break it to you, you need to

earnest phoenix
#

Lol

#

get a cheap vps

elder rapids
#

The free services are quite bad

violet wyvern
#

Ok

earnest phoenix
#

It doesnt need to be good at all the vps

elder rapids
#

Anyways you should probably post an error

earnest phoenix
#

if

#

your only running a bot on it

elder rapids
#

But I know Heroku has some issues with ffmpeg and other stuff

earnest phoenix
#

and also how do i get my bot on the site>

violet wyvern
#

But I just want to know one thing: does heroku run python?

earnest phoenix
#

yes

violet wyvern
#

How?

elder rapids
#

Heroku is a PaaS

#

it can run close to anything (in languages)

#

close to anything overall is a bad statement

earnest phoenix
elder rapids
#

magic

earnest phoenix
#

nah fr

violet wyvern
#

Click on create bot

earnest phoenix
#

Where kek

elder rapids
#

on the site....

#

Where else

violet wyvern
#

Top of the site

earnest phoenix
#

🀦

#

I may need to login πŸ˜‚ Im tarded

violet wyvern
#

Yup you need to

#

How does heroku run python ?

earnest phoenix
#

Idk it just does

#

heroku is shit

violet wyvern
#

It would get my problem solved

earnest phoenix
#

just saying

#

it barely works

elder rapids
#

any free host*

earnest phoenix
#

yes

#

any free host

violet wyvern
#

But how do I run python?

elder rapids
#

Trust me I learned the hard way about free hosts OwO

earnest phoenix
#

By getting a vps

topaz fjord
#

Yes

earnest phoenix
#

and running the .bat file

#

ez

violet wyvern
#

Ok

elder rapids
#

bat file

#

what is is this windows

earnest phoenix
#

yes

elder rapids
#

no

topaz fjord
#

Or just running the .py file with a process manager

earnest phoenix
#

this is windows

#

LOL

#

Nah if u get a windows vps i mean

topaz fjord
#

Ew

elder rapids
#

ew

topaz fjord
#

Getting windows vps is shit

elder rapids
#

Windows VPS is terrible and expensive

earnest phoenix
#

for running a bot

topaz fjord
#

No

solid cliff
#

Linux pls

earnest phoenix
#

i got one for like Β£2

elder rapids
#

Linux pls

earnest phoenix
#

:/

topaz fjord
#

Linux is the best for running botd

#

Bots

elder rapids
#

Any service*

#

Not just a bot

topaz fjord
#

Same difference

#

But yeah what he said

earnest phoenix
#

Someone who doesnt know how to use heroku isnt going to be able to use a linux vps

#

🀷

solid cliff
elder rapids
#

Um

#

Using Heroku == Linux VPS

topaz fjord
#

Linux is easy to understand

elder rapids
#

Heroku is still a command line VPS that's linux

earnest phoenix
#

Someone who doesnt know how to use putty and datttt

#

or whatever u use

topaz fjord
#

There's always Google you knoe

elder rapids
#

It's not that hard to learn PuTTY

topaz fjord
#

Know

earnest phoenix
#

but

#

a windows vps is the same

#

you remote connnect

topaz fjord
#

No

earnest phoenix
#

and run a bat file

#

and ur done

#

all im saying 🀷

#

i love thje 🀷

elder rapids
#

And linux is SSH => type a command to execute it

#

wow

earnest phoenix
#

hard

#

use your server to hit people off too!

topaz fjord
#

Don't forget transferring files

earnest phoenix
#

πŸ˜‚

elder rapids
#

FileZilla is easy

topaz fjord
#

It's easy to do that on Linux

earnest phoenix
#

Ik

topaz fjord
#

With filezilla

elder rapids
#

Especially easy with SFTP

solid cliff
#
cd bot/dir/
pip install -r requirements.txt
python3.6 bot.py```
elder rapids
#

python3.6 ??

#

You mean python3

solid cliff
#

I got 3

#

Nobulli

topaz fjord
#

Oh rekt is unmute

#

But yeah Linux vps is easy

solid cliff
#

python == 2.7
python 3 == 3.5 or something
python3.6 == 3.6

elder rapids
#

Ever notice the original people that asked questions and talked about opposing linux VPS left

topaz fjord
#

Yeah

elder rapids
#

means we won

earnest phoenix
#

im back

topaz fjord
#

Lmfao

earnest phoenix
#

i went for a piss

#

i never said windows vps is better

#

i said its ez

#

'er

#

ez'er

topaz fjord
#

Linux is easier

earnest phoenix
#

lol

topaz fjord
#

Tbh

earnest phoenix
#

But its not tho

topaz fjord
#

It is

elder rapids
#

Linux is easier

earnest phoenix
#

Linux is easy

#

not easier

#

for someone that has never used linux

elder rapids
#

It also has a bit more control in terms of security and other stuff

#

Linux is very good with that

topaz fjord
#

It only took me 10 mind of googling to figure out how to set my bot up in Linux

earnest phoenix
#

What os do you have

topaz fjord
#

I have windows

elder rapids
#

Personal ... or server?

#

Windows if personal tbh

earnest phoenix
#

personal

topaz fjord
#

On my personal

earnest phoenix
#

Why would you use windows if linux is better?

solid cliff
#

Try Linux for a week

elder rapids
#

Because linux is shit for a personal computer

uncut slate
#

arguably

elder rapids
#

Oh not

#

it's aeth

#

Not going to argue the reason ;P

topaz fjord
#

I would try arch linux

uncut slate
#

nah

topaz fjord
#

But im too lazy

elder rapids
#

Aeth uses linux all around

uncut slate
#

Linux is definitely not for everybody (regarding personal machines), but for some it can be far more powerful than windows

topaz fjord
#

I use windows for my games

solid cliff
#

Yus

topaz fjord
#

That's mainly why

elder rapids
#

At least Aeth doesn't argue crazily about it

topaz fjord
#

And also I don't like how the Ubuntu top nav is

earnest phoenix
#

I have linux on my laptop

#

its kinda annoying

#

like

#

its good and sll

topaz fjord
#

Then dual boot

earnest phoenix
#

all

#

but i prefer windows

#

and i never use the laptop its shit

#

slow af

topaz fjord
#

Im gonna dual boot on my laptop

#

@uncut slate gib me best type of linux

solid cliff
#

While we are in the topic of Linux dual booting, can I dualboot from an external hard drive ( Ν‘Β° ΝœΚ– Ν‘Β°) think

topaz fjord
#

Arch, Ubuntu wat

uncut slate
#

a heavily personal choice @topaz fjord

topaz fjord
#

Wut do u use

elder rapids
#

If the external hard drive can be set as the boot device

#

yes

uncut slate
#

I use Arch on my PC and laptop(s), Debian on my VPS'

solid cliff
#

How much space would you recommend for it

topaz fjord
#

30gb

solid cliff
#

Okai

sturdy edge
#

@languid dragon Can you help me find the proper setup?

#

Or teach me?

languid dragon
#

learn javascript

sturdy edge
#

Ik javascript

languid dragon
#

no you don't

sturdy edge
#

I dont quite understand it tho

neat falcon
languid dragon
neat falcon
#

needs more "

#

and less .user

languid dragon
#

.setAvatar() accepts a string, not just the link alone

low wasp
neat falcon
#

^

low wasp
#

its a magical thing called the DOCS

sturdy edge
#

thanks

languid dragon
#

@low wasp you helped enough

#

dont need to keep being a smartass

sturdy edge
#

@languid dragon He is actually helping.

#

I am reading the DOCS

languid dragon
#

its a magical thing called the DOCS

sturdy edge
#

ik ik

low wasp
#

yeah the docs are magical

sturdy edge
#

I dont really card

#

care*

neat falcon
sturdy edge
#

and they actually are

low wasp
#

theres the set avatar

sturdy edge
#

thanks.

#

does the avatar need to be a file in the bot's files?

low wasp
#

you can use a url

#

but it needs to be in '

sturdy edge
#

with 's?

#

ok

#

thanks

#

You really helped! πŸ˜ƒ

clever ingot
#

!say test

#

!reload

#

wat

#

!reload

knotty steeple
trim saddle
#

at some point i need someone to help me manage data although my bot runs on heroku..

spring ember
#

then move from heroku, it's shouldn't be used for bots anyway

lament reef
#

Can anyone help me? I got a (probably) dumb question.

spring ember
#

shoot

lament reef
#

How to get if the channel is NSFW? I used message.channel.nsfw but it only returns true if the channel was created AFTER the bot was added.

#

node.js btw

earnest phoenix
#
if(message.channel.name === "nsfw")
``` I think
knotty steeple
#

no

lament reef
#

no

earnest phoenix
#

Idk

lament reef
#

πŸ˜•

earnest phoenix
#

I tried

lament reef
#

but what if the channel is called "porn" or "hentai"?

knotty steeple
#

it should have the nsfw channel check

#

if it doesnt then bad server

lament reef
#

i used message.channel.nsfw but it says its not nsfw unless the channel was created after the bot was added

#

πŸ˜•

knotty steeple
#

that

#

is weird

lament reef
knotty steeple
#

no u

lament reef
#

just look

#

u see what happens

knotty steeple
#

how old do you think i am

lament reef
#

hold on

#

ill screenshot

knotty steeple
#

no

lament reef
#

..

toxic oracle
#

please do not

#

its in the nsfw channel for a reason

#

not to be put in others

#

smh

lament reef
toxic oracle
#

then they cant do checks

lament reef
#

argh so twiggered

prime cliff
#

Either the code for that is very bad or your lib/version is shit but i put my money on bad code

lament reef
#

well im using an older version

#

so ill update it

earnest phoenix
#

Imma fix it when I get home

earnest phoenix
#

got API to work :))) heheh

amber ice
#

Can anyone tell me some non-meta commands

knotty steeple
#

wat do u mean

amber ice
#

Like some commands for my bot. It got denied because of no non-meta commands

earnest phoenix
#

Those who are experienced at application creating and mobile developing I wanted to share my idea I got while taking a shower it might be unoriginal but I never heard somebody think about this.

Desktop and Mac / Mobile application/software to control your bot stuff if somebody likes that idea. πŸ˜ƒ

topaz fjord
#

Ok

low wasp
#

nice blank name

topaz fjord
#

Very

earnest phoenix
#

Yes it is

amber ice
#

I thought my phone was going crazy with that name XD

earnest phoenix
#

Its just invisible letter

#

I had invisible avatar at one point too lol

amber ice
#

Lol

#

Anyone know a 'node.js' script for changing 'prefix'

earnest phoenix
#

I think u need small kind of database to store all other server prefixes

low wasp
#

^

amber ice
#

Oh ok. I'll get it looked at now

low wasp
#

data base that stores all the server ids and the prefix

earnest phoenix
#

Yeah

low wasp
#

i do it

earnest phoenix
#

If I knew how to do it...

amber ice
#

I want help actually

earnest phoenix
#

Im not professional but I can try

#

to help

low wasp
#

visit the support server for the lib u are using then

earnest phoenix
#

I dunno why but I tried making a good help command (I failed miserably)

amber ice
#

I just started JavaScript and my teacher wants to look at my script

earnest phoenix
#

Dont let

#

Be gangsta

#

Say hell naw lemme do mah stuff myself

amber ice
#

Ok. I think I did enough here

earnest phoenix
#

I think our conversation is changing kinda off-topic lol

amber ice
#

So I'll get it looked at and see where it takes me

#

Yeh. Nvm. I wanted to know how to do it, it kinda makes sense though

earnest phoenix
#

I found a tutorial for custom prefixes its for discord.js

#

It uses quickdb

#

Ill send you it in dm

topaz fjord
#

Ew quick.db

inner jewel
#

slow.db

quasi hearth
#

Lol

earnest phoenix
#

I think the tutorial video I sent him also works with different dbs

amber ice
#

I watched it. Will do steps

earnest phoenix
#

Hopefully it helps you!

#

how would I make an rbg to hex converter?

shy verge
#

math

earnest phoenix
#

rip

quasi forge
#

true tho

earnest phoenix
#

ye

velvet latch
#

i need help making my bot

shy verge
#

ok

#

what are your struggling with

#

you need to be specific

velvet latch
#

with Detailed description too short. Minimum 300 characters. Add your commands. Spaces or empty spaces are not counted.
No ID given
No library selected
No prefix given
No brief description given

earnest phoenix
#

?

#

It literally says what you gotta do

velvet latch
#

sorry wrong thing lol

earnest phoenix
#

ok

floral stone
#

Lol

shy verge
#

are you really having issues filling out a form

floral stone
#

no, but ty for your concern.

#

I think I can figure it out

velvet latch
#

Detailed description

earnest phoenix
#

xD

quiet bobcat
inner jewel
#

what do you have on your server?

#

for nginx you could use try_files $uri $uri.html =404 or something like that

quiet bobcat
#

ok

#

thanks

sick kraken
#

Hey I need help guys.

#

If you know .js scripts.

quasi forge
#

Ok...

sick kraken
#

Do you know .js? @quasi forge

#

Hey, so.. My bot is kinda old. ^_^ And it relies on roles.. 9:

quasi forge
#

Ok

violet wyvern
#

How do I make a welcome and leave message?

knotty steeple
#

library

solid cliff
#

@violet wyvern store the channel id and server id the owner chooses to set, when a member joins, if the join is the server, get the channel id and send a message, same for leave

violet wyvern
#

That doesn't work

#

Error

solemn obsidian
#

then provide the code and error?

sick kraken
#

Sure.

#

Well, this is my code.

#

client.elevation = message => {
let permlvl = 0;
let mod_role = message.guild.roles.find('name', settings.modrolename); @solemn obsidian

knotty steeple
#

pls

sick kraken
#

?

#

The error is the r in roles.

quasi hearth
#

in d.js, can you edit an embed with msg.edit?

quasi forge
#

No idea

#

Never tried that

grizzled isle
#

If the embed layout is the same. You should.

#

Actually, you can.

violet wyvern
#

This is my welcome code: module.exports = member => { let guild = member.guild; guild.defaultChannel.send(Please welcome ${member.user.username} to the server!);};
Leave code:
module.exports = member => { let guild = member.guild; guild.defaultChannel.send(Please say goodbye to ${member.user.username} we will miss you!);};

grizzled isle
#

Default channel is deprecated.

quasi hearth
#

how? like this?: msg.edit({embed:embed});

sick kraken
#

Colby_Scripts - Today at 4:24 PM
Sure.
Well, this is my code.
client.elevation = message => {
let permlvl = 0;
let mod_role = message.guild.roles.find('name', settings.modrolename); @weeb(edited)

#

Cough anyone can answer this.

velvet latch
#

hello humans i am fellow human

#

haha haha haha haha

#

i need help humans

quasi hearth
#

what help do you need?

sick kraken
#

Colby_Scripts - Today at 4:24 PM
Sure.
Well, this is my code.
client.elevation = message => {
let permlvl = 0;
let mod_role = message.guild.roles.find('name', settings.modrolename); Can anyone help?

topaz fjord
#

provide the full error

#

not just say what it is

knotty steeple
#

also stop posting that

shy verge
#

also please use codeblocks

#

```
```

sick kraken
#

No one is helping me.

topaz fjord
#

@shy verge i will code block u

shy verge
#
blocked
topaz fjord
#

provide the full error

sick kraken
#

The error is r in roles

topaz fjord
#

like that stack trace

shy verge
#

PASTE THE ERROR

sick kraken
#

I can't..

shy verge
#

STACKTRACE PLS

#

YOU FUCKING WHAT?

topaz fjord
#

@shy verge its ok bb

sick kraken
#

It on my other computer..

#

😦

blazing stag
#

What are you trying to do @sick kraken

#

?

shy verge
#

then remote into that fucker and copypaste the error

sick kraken
#

Hello .

topaz fjord
#

then we cant help you without it

sick kraken
#

I did!

#

client.elevation = message => {
let permlvl = 0;
let mod_role = message.guild.roles.find('name', settings.modrolename); @weeb(edited)

topaz fjord
#

saying that the error is in r

shy verge
#

oierabvueyrbvaoe

sick kraken
#

That is the error the code.

topaz fjord
#

isnt a full error

blazing stag
#

thats not the error

shy verge
#

WHAT THE FUCK IS THE FUCKING ERROR

sick kraken
#

R in roles

knotty steeple
#

that is code not error

sick kraken
#

It is when I use it in DM..

shy verge
#

THE FUCK DOES THAT MEAN

sick kraken
#

Ikr

shy verge
#

🀦

#

roles don't work in DMs

sick kraken
#

Yea, so how do I block the DM..

knotty steeple
#

🀦

blazing stag
#

what do you want it to do @sick kraken That would be a better place to start

knotty steeple
#

what he said

sick kraken
#

I tryed return;

#

Did not work.

hidden crystal
#

Hey

shy verge
#
if(message.channel.type === "dm") return;

is that right?

hidden crystal
#

I wanted some help w/ java and php

sick kraken
#

@blazing stag Yes, I would like the bot to only work in servers.

knotty steeple
#

@shy verge that should be right

shy verge
#

ok cool

sick kraken
#

Now it says.

#

"message"

#

Not defined

topaz fjord
#

also for future reference. This is what a error looks like

shy verge
#

stick that in your message handler

topaz fjord
#
unhandledRejection:
ReferenceError: fes is not defined
    at Eval.run (C:\Users\weeb\Desktop\TurtleBot-Class\cmds\system\eval.js:25:17)
    at Message.run (C:\Users\weeb\Desktop\TurtleBot-Class\events\message.js:48:15)
#

dont need help

gilded blaze
#

Learn the Lang first

topaz fjord
#

dont try to help me

shy verge
#

replace message with whatever your message object is called

sick kraken
#

;\

#

i did.

topaz fjord
#

also what Sei4or said

sick kraken
#

Nevermind this server is dead to me.

shy verge
#

paste code into a hastebin

#

this server is dead to me

#

fuck off

topaz fjord
#

Well it kinda isnt out fault

sick kraken
#

If it is just everyone screaming at me..

topaz fjord
#

your not providing us with what we need

sick kraken
#

I don't care about it.

topaz fjord
#

I asked you once

#

you pasted the same exact thing

shy verge
#

paste us your message handler

blazing stag
#

well we were trying to help you actually

shy verge
#

in a hastebin

sick kraken
#

Anyways the code worked.

shy verge
#

oh

#

huh

sick kraken
#

It just kinda glitched.

topaz fjord
#

lmfao

hidden crystal
#

Does anyone know java and php?

earnest phoenix
#

i know php

sick kraken
#

lol

topaz fjord
#

and?

#

doesnt seem development related

sick kraken
#

Colby check your DMs

gilded blaze
#

Send to author

shy verge
#

cause you're in a dm

gilded blaze
#

Oh that’s dm

shy verge
#

paste us your message handler

#

your dm filter isn't working

sick kraken
#

Huhh it works fine.

#

Β―_(ツ)_/Β―

shy verge
#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

sick kraken
#

lol

blazing stag
#

┬─┬ γƒŽ( γ‚œ-γ‚œγƒŽ)

sick kraken
#

I fixed it.

#

So in DM it would say. Nothing xD

blazing stag
#

well done

sick kraken
#

Yep

#

Are you a dev too? (;

blazing stag
#

i work a software engineer for my day job

#

so yeah

sick kraken
#

Cool.

#

What job.?

#

I'm a Flight Attendant.

#

For JetBlue. (:

blazing stag
#

its in the cyber security field.

shy verge
#

has roblox pfp

blazing stag
#

i mostly work with .Net

#

and sql server

shy verge
#

oh boy i love you already

sick kraken
#

(:

shy verge
#

.net is literally the best thing ever

blazing stag
#

heheh yeah agreed

spring ember
#

Yes

sick kraken
#

Yep

#

When I look up in the sky.

spring ember
#

Ok it's development GWnekomakiAngeryBOYE

sick kraken
#

Of my job. (:

earnest phoenix
#

..?

#

you are 13

sick kraken
#

No..

spring ember
sick kraken
#

I write when I apply in Discord I'm 13 so people don't think i'm weird xD

shy verge
earnest phoenix
#

message.channel.send("ok");

#

πŸ˜…

#

@sick kraken lol lie

#

rip colby muted :-;

quasi hearth
#

im trying mesg.embeds[0].fields[0].value = mesg.embeds[0].fields[0].value + msg.author.username; but that doesn't update the embed

knotty steeple
#

that is a weird way to do embed field values

quasi hearth
#

do you know how to update embed fields?

knotty steeple
#

what u mean edit message

#

?

quasi hearth
#

yeh

#

but the docs say it takes a string

#

not an object, but can u use embeds in msg.edit?

knotty steeple
#

yes

quasi hearth
#

oh. ok :p

knotty steeple
#

if not my ping cmd would not work properly

quasi hearth
#

got it

earnest phoenix
#

@languid dragon Has anyone looked at my bot?

languid dragon
#

no

earnest phoenix
#

rip

#

.-.

shy verge
#

tfw pinging admins to look at your bot

earnest phoenix
#

what im just a kid

#

what do you expect

shy verge
#

how old are you?

knotty steeple
#

^ yeah

earnest phoenix
#

i'm 2 and a half

shy verge
#

welp

#

πŸ…±anne

knotty steeple
#

@earnest phoenix we need your legit age

shy verge
#

ok but serious question, tell us your real age, you could get access to a secret channel

earnest phoenix
#

no thancc

knotty steeple
#

u also get free bot hosts

shy verge
#

"what i'm just a kid"

knotty steeple
#

like i do

earnest phoenix
#

yeah

#

i'm 13

shy verge
#

oh ok

earnest phoenix
#

which i consider a kid

shy verge
#

you're good

knotty steeple
#

ok well u get no free bot host

earnest phoenix
#

pl

#

ok

turbid trench
#

@shy verge 22 Kappa

shy verge
#

ok

#

why did you ping me?

topaz fjord
#

@shy verge cus ur Mr. Cocker

#

ecksdee

earnest phoenix
#

Jzaj

#

;help

#

Oh

inland pulsar
#

i don't know

acoustic juniper
#

so im doing this:

#
const bot = new Discord.Client();

bot.on('message', (message) => {
  switch (message.content) {
    case "Hi":
      message.channel.send("Hi");
      break;
  }
});```
#

and it says Hi a bunch of times anyone know why

earnest phoenix
#

every time someone ever said hi it says hi

#

i think

acoustic juniper
#

no

topaz fjord
#

are you saying hi to the bot

acoustic juniper
#

if you say Hi it says hi about 4 times waits 5 seconds and repeats

#

oh i know why

knotty steeple
#

@acoustic juniper you dont have a check

#

for if its a bot

topaz fjord
#

^

acoustic juniper
#

it's responding to it'sself

inland pulsar
#

167.99.196.89 - - [12/May/2018:01:14:47 +0200] "POST /webhook/index.php HTTP/1.1" 200 332 "-" "DBL"
:|

topaz fjord
#

ip i see

elder rapids
#

It's DBL's IP

inland pulsar
#

^

#

xd

acoustic juniper
#

how do you set it not to check its own messages

knotty steeple
#

@acoustic juniper also instead of making it say Hi, which triggers it make it say something else

topaz fjord
#

if(message.author.bot) return;

knotty steeple
#

^

topaz fjord
#

@knotty steeple get rekt

knotty steeple
#

who uses the yandex api

acoustic juniper
#

@topaz fjord where would you put the if(message.author.bot) return;

knotty steeple
#

anywhere

#

in the msg event

#

just not in if statements

acoustic juniper
#

so after the bot.on or before?

knotty steeple
#

after

acoustic juniper
#

so like this

#
const bot = new Discord.Client();

bot.on("message", (message) => {
  if(message.author.bot) return;
  switch (message.content) {
    case "Hi":
      message.channel.send("hi");
      break;
  }
});```
knotty steeple
#

yes

#

good

acoustic juniper
#

ok

#

thank you

knotty steeple
#

your smarter than others

#

also no problem

acoustic juniper
#

thank you

ashen quail
#

does anyone know how to use the moment package?

elder rapids
#

yus

narrow flare
#

Anyone using .py lib that could help me making a !ping command XD???

shy verge
#

like a ping command that gives you latency?

acoustic juniper
#

How do you check if someone with a specific role sent a command?

night imp
#

get the user, find him in the guild, check his roles

#

Also language please

shy verge
#

is your bot confined to one server or do you plan to expand/scale?

acoustic juniper
#

one server

shy verge
#

ok

#

what lib are you using

acoustic juniper
#

just checking for ownership though i'm using Discord.js

shy verge
#

ownership?

#

hmmm

#

again, what lib are you using?

acoustic juniper
#

Discord.js

topaz fjord
#

you can do message.member to get the GuildMember

#

and GuildMember has the property roles

shy verge
#

if(message.guild.ownerID == message.member.id) doStuff();

topaz fjord
#

then you can use .filter on the roles since it returns a collection to find if the user has a role with a specific name

#

wait

#

are u trying to find if the guild owner id is the same as the message author?

acoustic juniper
#

yup just to find the owner

shy verge
#

the above codeblock will work

topaz fjord
#

so do what @shy verge did

acoustic juniper
#

ok it works

earnest phoenix
#
  • every time a user connects send large key to everyone connected (key = just text)
  • every time a user connects all connected users check if they have the key, if not, ask the user that just joined for it
#

in terms of efficiency, what would be best

#

take into account that the 2nd option might bombard the new user with requests, if you have a better idea pls share

topaz fjord
#

so if they have no key they depend on that one person for the key

floral stone
#

Just gonna post this here```py
def get_default_channel(self, guild):
channels = guild.text_channels
text_cha = [x.name.lower() for x in channels]
lines = ["general", "lounge", "chat", "hangout"]
words_in_line = []
for y in lines:
words_in_line += [x for x in text_cha if y in x]
k = []

    if len(words_in_line) > 0:
        for x in words_in_line:
            channel = discord.utils.get(channels, name=x)
            perm = guild.me.permissions_in(channel)
            if channel is not None and all([perm.send_messages, perm.read_messages, perm.embed_links]):
                k.append(channel)
                channels.remove(channel)

    if len(k) == 0:
        for x in guild.text_channels:
            perm = guild.me.permissions_in(x)
            if all([perm.send_messages, perm.read_messages, perm.embed_links]):
                k.append(x)

    if len(k) == 0:
        return None
    else:
        return k[0]```
#

I feel proud of this, anyone can use.

quasi hearth
#

what does this do?

grizzled isle
#
for y in lines:
            words_in_line += [x for x in text_cha if y in x]

This will never run

#

nevermind

#

me being stupid

floral stone
#

It works

#

for me

#

It finds the default channel in a server. First, it sees if there any servers in the lines are in any channel names. Then it will remove the channels if it doesn't have read msg, send msg, and embed link permissions. Now, if it doesn't find any channels with the name or if all those channels don't have permissions, it will do the same thing over again for all the channels in the guild not the filtered out ones. Once done, if there are no channels then it will return None otherwise it will return the first channel in the list.

#

@quasi hearth

quasi hearth
#

interesting... seems dangerous

floral stone
#

Not really. It just finds the main channel.

quasi hearth
#

oh, i thought you meant that it deletes the channels lol

floral stone
#

No.

#

It just gets the default channel

ashen quail
quasi hearth
#

maybe its because you keep adding 1 minute?

ashen quail
#

then what do i do to fix it?

fluid basin
#

lol wot

quasi hearth
#

add some kind of conditional to make it not add 1 if there already has been 1 min added, until it says test, where you toggle the conditional

ashen quail
#

okay lemme try that

#

@quasi hearth weird, I wait 1 minute and it still says fail.

fluid basin
#

...

#
var a = moment.utc().add(1, 'minute');
setTimeout(() => {
  var b = moment.utc();
  if (b > a){
    console.log("Test");
  } else {
    console.log("fail");
  }
}),61000);
#

you can add 1 more sec

#

just in case

quasi hearth
#

unless he wants it to keep pinging with "fail"

fluid basin
#

He doesn't understand his code rn

#

When you have var a = moment.utc().add(1, 'minute'); and var b = moment.utc();

#

You basically tell node to set 'a' as 1 min later and 'b' as the current time

#

So ofc a > b and b will never > a

ashen quail
#

I removed the ) after 61000 because it caused an error

fluid basin
#

oh wait some edits

quasi hearth
#

nuuu

fluid basin
#
var a = moment.utc().add(1, 'minute');
setTimeout(() => {
  var b = moment.utc();
  if (b > a){
    console.log("Test");
  } else {
    console.log("fail");
  }
},61000);
#

Now shld be ok

low owl
#

@floral stone Seems a bit voodoo magic like

slow elk
#

Alright, I have kind of a wide question/topic to talk about in discord.js.
I want to access the Audit Logs in Discord and log edited messages and more, but I don't know how to do that. I already got it logging the messages that get deleted.

#

The things I want to log are the following:

  1. CHANNEL_CREATE
  2. CHANNEL_DELETE
  3. MEMBER_BAN_ADD
  4. MEMBER_BAN_REMOVE
  5. ROLE_CREATE
  6. ROLE_UPDATE
  7. ROLE_DELETE
    I already got the MESSAGE_DELETE thing going on
gilded blaze
#

then u listen for the events

fluid basin
#

uhh

#

you could just simply use events tbh

slow elk
#

I know

#

But that returns Promise rejections

gilded blaze
#

what

fluid basin
#

whaart

slow elk
#

So I want to use the Audit Logs, because those give more info and didn't return any errors :3

gilded blaze
#

well you would have to check audit logs every so often

#

and compare the arrays

slow elk
#

Hmmm

#

I honestly have no clue on how to do this, because this is completely new to me on d.js

fluid basin
#

tbh just use events

#

events don't give promise errors

#

that means its your code

#

Β―_(ツ)_/Β―

slow elk
#

Oh well Β―_(ツ)_/Β―

lusty pulsar
#

Hey guys! Im starting a site and i need coders! DM me if interested!

trim plinth
#

hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

earnest phoenix
#

thoughts on custom network packets format

#
[Pigeon][--][--][--------][+]
 ^       ^   ^   ^         ^
 |       |   |   |         |
 |       |   |   |         Packet data (binary)
 |       |   |   |
 |       |   |   Packet size (long)
 |       |   |
 |       |   Packet type (number)
 |       |
 |       Format version (number)
 |
 Application name
low owl
#

What about sender, receiver? πŸ‘€

earnest phoenix
#

yea adding that rn

#

receiver isn't necesarry

#

receiver is whoever has the packege

#

xd

low owl
#

Well

#

Which layer are you targeting?

earnest phoenix
#

huh?

#

it's all going to be encrypted

low owl
#

I mean Network Layer

earnest phoenix
#

application

low owl
#

Wait, so you are using Ipv4 or something I assume?

earnest phoenix
#

tcp

#

yea

#

here it is with the sender:

#
[Pigeon][--][-------------][--][-----------][+]
 ^       ^   ^              ^   ^            ^
 |       |   |              |   |            |
 |       |   |              |   |            Packet data (binary)
 |       |   |              |   |
 |       |   |              |   Packet size (long)
 |       |   |              |
 |       |   |              Packet type (1-2 digit number)
 |       |   |
 |       |   Sender (id)
 |       |
 |       Format version (1-2 digit number)
 |
 Application name
#

what's the max of a long again?

#

let me look it up

low owl
#

But hold on, if you are using something like IPv4/6 packets anyways, they already contain sender, receiver, TTL, etc.

earnest phoenix
#

yea

#

it's just a custom implementation to comminicate with my application

low owl
#

I would not reinvent the wheel to be honest

earnest phoenix
#

it's like saying, sending json data

#

then how would I communicate with my application?

low owl
#

Client <-> Server? REST for example. Well, depends on what you want to do. But there are plenty of things to communicate.

earnest phoenix
#

I'm talking about

low owl
#

Websockets, Webhooks

earnest phoenix
#

lan tcp

low owl
#

Still works over the TCP stack. The IPv4 packet for example contains the information that it is a packet with content that contains more specific details.

earnest phoenix
#

I'm using that instead of json

#

there's a reason to use that format instead of json in my situation

#

since the packet data may be huge, I'd have to parse the json object, then access it

#

parsing is another step

#

get it?

#

you're understanding it wrong

#

it's not actually a network packet

#

it's the content of it

#

it's just formatted

low owl
#

Ah

earnest phoenix
#

ye

#

πŸ˜‰

#

I just call them packets

#

hehe

#

like actions

#

if I used json

#

then I would have to parse it

#

and since the data property in the json would be juge

#

it would take even mor etime

elder rapids
#

inb4packet payload is json in binary (bytes)

earnest phoenix
#

so I just go right into the start of the data

#

yea I mean when the receiver recives the packet

#

then he needs to parse it

#

if its in json

#

why not just keep it as binary

elder rapids
#

Why not just use ETF rather than making your own weird system πŸ€”

#

If you need other headers you can extend what ETF does then

earnest phoenix
elder rapids
#

ETF is a known system for what you're kind of trying to do

earnest phoenix
#

never heard of it

elder rapids
#

In fact Discord supports ETF websockets

earnest phoenix
#

interesting

elder rapids
#

ETF is Erlang External Term Format

#

It's a binary (bytes) communication system like what you want

earnest phoenix
#

shiny

#

why would I use it

elder rapids
#

Because it's kind of like what you're doing

#

Might as well use something that already sort of exists or use a protocol that exists for doing said stuff

earnest phoenix
#

not really

elder rapids
#

Standards > Custom

earnest phoenix
#

It's only for my application

elder rapids
#

Personally I would use something like ETF rather than custom even if it's for personal use

earnest phoenix
#

extending that would only add unnecesarry headers

low owl
#

What do you mean not really

#

in 99% of the cases you don't need to write your own implementations

earnest phoenix
#

I already have the perfect model for my application

#

yea remember it's only for my application

#

I won't be doing any external communication

elder rapids
#

You'll add more of a headache trying to setup your own protocol implementation