#development

1 messages ยท Page 447 of 1

quartz kindle
#

also make a find/search command

earnest phoenix
#

yeeeeee

flint river
#

well, the entire bot is essentually a find/search command XD

quartz kindle
#

xD

flint river
#

that's its entire use actually

#

i just have mine so it goes to the next page after the user post "!next" in chat

quartz kindle
#

sure

#

emojis are sexy tho, you can look at them later

flint river
#

oio

#

will do

knotty steeple
#

yes its way better

quartz kindle
#

btw, does is emoji pagination slower in dms for anyone else?

#

my bot's pagination is much slower in dms than in servers

knotty steeple
#

might be you

quartz kindle
#

might be

sick cloud
#

why tho

#

๐Ÿ‘€

midnight widget
#

shh

knotty steeple
#

template? zoomeyes

midnight widget
#

at least i'm not a scumbag and removed the copyright

quartz kindle
#

removes copyrights

knotty steeple
#

true

quartz kindle
#

.<

sick cloud
#

wow

flint river
#

so, how do i do clickable emojis? is it just get_reaction then compare the value to ๐Ÿ‘ˆ(back) or ๐Ÿ‘‰(next)

frosty sleet
#

I guess I will ask again, is there a way to see if a user have voted for my bot?

#

.net library

earnest phoenix
#

yes. setup webhooks and add it to db/cache it somehow

quartz kindle
#

its a bit more complicated than that @flint river

#

you need to set up a reaction collector to watch for reactions to that specific message

#

well, i guess you could just use the reaction event and check if the message id matches, but i've never tried that way

frosty sleet
#

I am getting null by using GetVotersAsync

frosty sleet
#

is that possible that my token is not authorized yet?

#

@earnest phoenix I dont know how to set up a webhook, but its not required as I have only 30~ votes a month

frosty sleet
#

I am confused... to get APLI I should follow this:
AuthDiscordBotListApi DblApi = new AuthDiscordBotListApi(BOT_DISCORD_ID, YOUR_TOKEN);
I place there ID and Token from https://discordbots.org/api/docs#mybots (API key) but I am stil lgetting null from GetVotersAsync

sick cloud
#

Anyone here good with HTML/CSS and able to help me make a dropdown for my navbar I made?

#

I've had no success lol

earnest phoenix
#
client.on('ready', () => {
  console.log('Turned on the Discord client.');
  console.log('Running on guilds now...')
  client.shard.broadcastEval('this.guilds.size').then(results => {
  client.user.setActivity(`${results.reduce((prev, val) => prev + val, 0)} guilds | >info`, { type: 'WATCHING' })
  });
 })```
#

Displaying an incorrect number of guilds for my bot's status, what am I doing wrong?

#

not 100% sure since i havent used d.js in a while, but im pretty sure you just do guilds.size in broadcasteval

#

That worked, thanks.

earnest phoenix
#

๐Ÿ‘Œ np

#

@earnest phoenix also you could use fetchClientValues instead of broadacsteval if you are just getting guilds across all shards
almost identical to what you are doing but probably faster:

manager.fetchClientValues('guilds.size')
  .then(results => console.log(`${results.reduce((prev, val) => prev + val, 0)} total guilds`))
  .catch(console.error);
frosty sleet
#

it start to work. I guess it took time to authorize.
but for some reason it giving me all votes, no matter how many days I enter, 0-100 it will be always all votes. Does it suppose to be like that?

autumn slate
#

Anyone know how to make it so that only people with certain roles can interact with my bot?

slim heart
#

Im currently getting spammed with this

#

no clue why or how

#

But all my modules keep restarting

stiff juniper
#

cuz you don't have an error handler

#

so it's crashing

#

and reloading

slim heart
#

No like ALL my modules

#

And ive never had this problem before

stiff juniper
#

yeahhh one breaks all

slim heart
#

No it doesnt

#

I have seperate js files

stiff juniper
#

well if you dont have proper handling yeah

#

but i'd hope you do at least

slim heart
#

Theyre all different processed

stiff juniper
#

what library do you use

slim heart
#

But either way im gettin the error ive never had before and i havent touched it

#

discord.js

stiff juniper
#

version?

slim heart
#

juan second

stiff juniper
#

12?

fluid basin
#

thats mean an unexpected disconnection event happened between your bot and discord

stiff juniper
#

from the "event" thing

#

yeah

fluid basin
#

Most likely your internet disconnected or something else

stiff juniper
#

just restart the bot

#

cuz sometimes it goes apeshit

#

after it happens

#

at least in my experiences

slim heart
#

11.3.2

fluid basin
#

yeah after the 11.3.1 update I think they sorta removed the handler for ws disconnection errors

stiff juniper
#

WOW

#

WHYYYY

#

what was the point

fluid basin
#

idk what happened but it seems to be the case

stiff juniper
#

I use v12 soooo it doesn't affect me too much

#

but yeah

#

yes I do understand v12 is a beta version

#

but it works fine for me

fluid basin
#

It'll work alright if your internet does not disconnect and reconnect randomly

#

which causes the underlying socket to be broken

#

and then throwing an error

stiff juniper
#

yeah if you're gonna do like a serious bot, it needs something like an OVH VPS or AWS or Azure

#

that kinda thing

slim heart
#

its still restarting over and over

stiff juniper
#

that has a 99.99% uptime

fluid basin
#

@slim heart can you double check your internet connection? and especially to discord

stiff juniper
#

or smth

slim heart
#

I mean its connecting in general but then disconnecting

#

but yeah

#

should i ping the api or discordapp?

stiff juniper
#

its entry point is https://discordapp.com/api

#

so

slim heart
stiff juniper
#

๐Ÿ‘Œ๐Ÿป

#

uhhh

#

hmm

#

idk why it would be disconnecting

#

if your internet is receiving replies from Discord

slim heart
stiff juniper
#

then idk why it isnt working

slim heart
#

or something like that

stiff juniper
#

443 is https

#

and it auto redirs

#

to https

slim heart
#

no the api

stiff juniper
#

its https when you click on i--

#

yeah it does

#

443 is the HTTPS port

#

not just an API port

slim heart
#

which port is the api?

stiff juniper
#

its not on any port

slim heart
#

no its another one ik it is

stiff juniper
#

its right here

#

it says 404 not found in it because you didnt give it a function

#

but it gives it in the API form

slim heart
#

could it be on part of the fact that i have 10 different js files running all logging in?

stiff juniper
#

wait

#

they all do client.login()

#

each?

slim heart
#

yees

stiff juniper
#

uhhhh

#

yeah that's a problem

slim heart
#

ik spam

#

shh

stiff juniper
#

it spams the API

#

so you might be being ratelimited

slim heart
#

Ight

#

Ill work on putting them all together kek

stiff juniper
#

so what i'd advise you to do is make a main js that connects to discord once

#

and the other js files

#

can use that connection

slim heart
#

Can i get like a quick guide on how to do that

#

I need spoonfeed cuz i needa solve fast ๐Ÿ˜‚

stiff juniper
#

I can't spoonfeed you

#

with stuff like this you really need to learn it

slim heart
#

i cri

#

guide?

#

I know i do i hate being spoonfed but i needa do this quick oof

fluid basin
#
process.on('uncaughtException', function(err) {
  console.log(require('util').inspect(err, { depth: null }));
});
#

btw

#

thats an library issue so most of the time its complicated to fix

#

Try adding that to the end of your bot code and try running your bot again to show the error

slim heart
#

@stiff juniper do u have a guide by chance

fluid basin
#

At least it will be more specific about the error

stiff juniper
#

@slim heart uhhh I use something called Klasa

#

which is a framework

#

on top of Discord.js

#

it was a pretty shit ride

#

trying to set it up

slim heart
#

nvrm

stiff juniper
#

mkay then

#

yeahh

#

unless you wanna make your own thing

#

use something like Klasa

#

do NOT use djs commando

#

it's just a big meme in the discord.js community

#

seriously just dont

fluid basin
#

you don't need a js minifier lul

stiff juniper
#

wh

fluid basin
#

yuicompressor is a js minifer

stiff juniper
#

ohh right

slim heart
#

how does klasa work?

stiff juniper
#

it's class based

#

and you can extend the classes

slim heart
fluid basin
#

Klasa is a bot framework

stiff juniper
#

to dooo

#

whatever

#

yeah

#

he asked how it works

#

sooo

fluid basin
#

Like express is a web framework for nodejs

slim heart
#

so do i add to like each file

#

or can i just make my own

stiff juniper
#

wh

slim heart
#

im confused

fluid basin
#

so klasa is a framework for discord.js

stiff juniper
#

yeah

#

it gives you essential shit

#

like command handling

#

event handling

#

that kinda stuff

#

you can add commands

#

and events

#

and other shit

#

TO IT

#

by using js files in folders

#

and extending the right class

slim heart
#

Oh im tryna figure out a way to call all 10 of the js files and use them and then after it log in for each of them

stiff juniper
#

Klasa has a handler for that

#

the command handler

#

here i'll dm you my bot's gitlab repo

#

which has Klasa set up

#

to help you

slim heart
#

I mean i dont use commands

#

but i may be getting commands mixed up idk

stiff juniper
#

commands

#

are like

#

you do prefix!command args

#

and the bot does something

#

for example

#

prefix!ping

#

the bot says

#

"last heartbeat: 89ms"

#

boom

#

like that

slim heart
#

yeah the modules arent commands

#

they all do something different

#

usually not command based

stiff juniper
#

likeeeeeeeeee

slim heart
#

Filters are split into messagefilter editedmessagefilter and nicknamefilter

stiff juniper
#

oh

#

wh

slim heart
fluid basin
#

well imo modules react to events and commands are a subset of the message events

#

ยฏ_(ใƒ„)_/ยฏ

stiff juniper
#

interesting system there

#

but to do shit like the invite filter

#

you'd just make an event

#

to handle the messageCreate

#

event

#

to see if the message contains any invites

#

events/messageCreate.js

// blah blah
doStuff();
slim heart
#

is there any way i could just set up a single js file that runs all the other files with one login

stiff juniper
#

do they need to be all run

#

at the same time

slim heart
#

Yeah

fluid basin
#

yeah why not

#

just do it the normal JS way without any frameworks

stiff juniper
#

yeah

#

you'd do

client.on("ready", () => {
    requireAllTheDamnFiles();
});
fluid basin
#
bot.on('message', function (msg) {
    ...
});
#

ยฏ_(ใƒ„)_/ยฏ

slim heart
#

but how would i do that therandommelon

#

like const blah = require('usecommands.js')

stiff juniper
#

uhhh

#

exactly like that

#

lmaooo

slim heart
#

huuue

stiff juniper
#

thats how you require a file

slim heart
#

and then it runs?

stiff juniper
#

so blah would now be the usecommands.js thing

#

whatever it is

#

whatever's in module.exports

#

will become the value of the var

slim heart
#

module.exports..?

stiff juniper
#

uhhh yeah

#

require() takes it

#

from module.exports;

fluid basin
#

remember to add ./ infront of the file name to make sure it doesn't start looking in your node_modules

stiff juniper
#

^

slim heart
#

Okay so how do i add that?

stiff juniper
#

module.exports = thething;

#

not hard

slim heart
#

do i just add module.exports = {all the code}

#

to each file?

fluid basin
#
module.exports = function (name) {
    return "hi " + name;
}```
stiff juniper
#

^

#

so when you import it

#

if you console log the value of varName("h")

#

it'll say

#

"hi h"

#

it literally imports everything from that file

slim heart
#
    //ALLL my code not some ALL?
}```
stiff juniper
#

like how requiring discord.js is requiring djs (./node_modules/discord.js/src/index.js)

fluid basin
#

and you call it with

const hello  = require('./hello.js'); //assuming you called it hello.js
bot.on('ready', function () {
    console.log(hello('world'));
});
slim heart
#

i just add all my code in there nothing else?

stiff juniper
#

yeah

slim heart
#

Im trying to make sure oof

stiff juniper
#

everything after the } there

#

wont be in the export

#

put a semicolon after the } too

#

in this case afaik you need it

#

maybe maybe not

#

idfk

slim heart
#

do i have to add like function(bot)?

stiff juniper
#

yeah

slim heart
#

anything else

stiff juniper
#

which would mean running varName(bot)

#

would give it

#

the bot property

#

to use

slim heart
#

Yeh

stiff juniper
#

yeahhh what @fluid basin said too

slim heart
#

so

const Discord = require('discord.js');
const bot = new Discord.Client();
const auth = require('./auth.json')
const 1 = require(./usecommands.js)
//etc ^
1(bot);
// etc ^
bot.login(auth.token)```
fluid basin
#

btw its not that good naming your variables as numbers only

slim heart
#

its just an example

#

ill give them actual names

jovial sigil
#

Does anyone know a discordbot that can detect a mention and redirect the user to the correct channel to use it in? something like a mention manager?

stiff juniper
#

i dont know of a preexisting one

#

but it's really easy to do it yourself

#

in a basic way

#
discordbot.on("messagesend", message => {
    // pseudocode btw sooo
    if message.channel.id is this id {
        message.channel.send(`<@${messageauthorid}>, use <#${otherchannelid>`);
    }
});
#

i did psuedocode

#

just to give you an idea

#

on what to do with it

jovial sigil
#

ah thanks, i already have a concept as well, just wanted to know if one existed so that I would use that instead of creating a whole new bot

stiff juniper
#

i see

slim heart
#

Yay it works :D

#

its saying memory leak

#

idk

#

but it works

#

so idc ๐Ÿ˜‚

spring ember
#

You should fix this though

slim heart
#

Idek whats causing it

#

Damn my ping cut in half and no longer randomly crashing

keen drift
#

I'm getting a lot of ECONNRESET that started after the major outage today

earnest phoenix
#

hey guys i need help with:

i using in my help command :
group.commands.map(cmd => cmd.name).join(', ')

but idk how to change the name of command like command_name ๐Ÿ‘ˆ

#

is in the black bar

serene bear
#

@earnest phoenix yo, did you want to be able to make a welcome image?

earnest phoenix
#

Yes

#

Your bot is weird

serene bear
#

Wdym

odd tinsel
#

this here is just triggering me and I have no clue what to do

Line 13
async def on_ready():
^
SyntaxError: invalid syntax

#

I have the right version, the code's perfect, and I have no typos

#

what is going on?

solid cliff
#

What's your python version

odd tinsel
#

3.6.5

stiff juniper
#

usually that'd mean you did a bad syntax

#

on the line above

odd tinsel
#

oh ok

stiff juniper
#

show like line 11 through 14 or smth

#

so we get an idea

odd tinsel
#

k

#

here

bot = commands.Bot(command_prefix='turt!')

@bot.event
async def on_ready():
print ('I am ready to be Insane')

stiff juniper
#

hmmm

#

i'm not really big on the whole python thing

#

looks fine to me?

#

so huh

odd tinsel
#

just wish anyone knew

cursive dagger
#

That should work

odd tinsel
#

yeah

#

this is getting annoying now

earnest phoenix
#

anyone can't help me? ๐Ÿ™„

stiff juniper
#

?

ivory osprey
#

yeah

earnest phoenix
#

hey guys i need help with:

i using in my help command :
group.commands.map(cmd => cmd.name).join(', ')

but idk how to change the name of command like command_name ๐Ÿ‘ˆ
its in black bar

ivory osprey
odd tinsel
#

one question

ivory osprey
#

idk

odd tinsel
#

can you make discord bots on mac?

ivory osprey
#

yeah

#

you can make discord bots on mac

odd tinsel
#

omg

#

what is blocking my bot?

ivory osprey
#

you just need microsoft visual code and node.js (mac version)

odd tinsel
#

yep

#

got those

earnest phoenix
#

i just use Mobile to make bot ;-;

#

hallo ๐Ÿ˜„

odd tinsel
#

I just realised

#

I had visual studio set to work on 2.7

#

XD

ivory osprey
#

:))) xD

earnest phoenix
#

i want to ask mod but i do not want to tag him :/

ivory osprey
#

if you don't know watch this tutorial, i'll will help you

earnest phoenix
#

i has make a bot dude, i just need help with my question

odd tinsel
#

still not working

ivory osprey
#

watch the tutorial i sended you

earnest phoenix
#

ahhh @ivory osprey dude as you know i has see all of this, thats not i mean i want to see

earnest phoenix
#

`import dbl
import discord
from discord.ext import commands

import aiohttp
import asyncio
import logging

class DiscordBotsOrgAPI:
"""Handles interactions with the discordbots.org API"""

def __init__(self, bot):
    self.bot = bot
    self.token = 'dbl_token'  #  set this to your DBL token
    self.dblpy = dbl.Client(self.bot, self.token)
    self.bot.loop.create_task(self.update_stats())

async def update_stats(self):
    """This function runs every 30 minutes to automatically update your server count"""

    while True:
        logger.info('attempting to post server count')
        try:
            await self.dblpy.post_server_count()
            logger.info('posted server count ({})'.format(len(self.bot.guilds)))
        except Exception as e:
            logger.exception('Failed to post server count\n{}: {}'.format(type(e).__name__, e))
        await asyncio.sleep(1800)

def setup(bot):
global logger
logger = logging.getLogger('bot')
bot.add_cog(DiscordBotsOrgAPI(bot))`

#

does this example work

#

why do i get Expected Content-Type header to be one of set(['application/json']).

stiff juniper
#

because Content-Type isn't set to application/json

#

you really shouldnt be doing this yourself if you dont even grasp that

earnest phoenix
#

but

#

i did set it to that

#

woty

stiff juniper
#

i know some of this kinda thing cuz i've made web apis before

#

soo

#

also

#

did you

#

did you really

#

gimme a raw POST thing

#

like

POST discordapp.com
...etc
earnest phoenix
#

headers: {
'Content-Type': 'application/json'
} that rite?

slender thistle
#

@earnest phoenix Yes

earnest phoenix
#

like the header thung

stiff juniper
#

should be

#

whats your whole

#

thing

#

here

earnest phoenix
#

i >ctrl z'ed 20 times then saves went to sleep and im back now

#

lol

#

leme just remake that shet

spiral sluice
#

controlezed?

earnest phoenix
#

@slender thistle so i just put that in my bot

#

and it should be gold?

slender thistle
#

Replace the token

#

And basically yeah, unless you declared client instead of bot in main file

earnest phoenix
#

i will try it later when i got the time to

#

as me dont feel like doing anythign

#
bot.req("POST", "https://discordapp.com/api/v6/users/@me/channels", {
                      headers: {
                        'Content-Type': 'application/json'
                    },
                    'recipient_id': user.id                      
                    }.then(body => {
                        let parsed = JSON.parse(body);
                        console.log(body);```
#

was similar

#

@stiff juniper

stiff juniper
#

what are you using

#

what's bot set to

earnest phoenix
#

bot is set tooooo

slender thistle
#

discord.Client()?

stiff juniper
#

no

#

he's not using a wrapper/lib

slender thistle
#

Oh

stiff juniper
#

he's trying to POST

#

directly

#

to the API

earnest phoenix
#

well this is hard hold up

stiff juniper
#

yeah no shit

#

this is why people use libs

earnest phoenix
#

rofl ikr

#

but it does work when i send messages to a channel

stiff juniper
#

you're overcomplicating this honestly

#

this is all you need in djs to make your bot say "pong" when someone says "ping"

earnest phoenix
#

d.js is easy

#

ik

#

im just trying to try out new stuff

stiff juniper
#

to get the proper results

#

you'll have to connect to the Discord websocket

#

and all that shit

#

and its just

#

reeeee

earnest phoenix
#

to send a message to a user???

stiff juniper
#

nope

#

to like

#

get events

#

and to like

#

be decent

#

right now, you can't just wait until Discord sends the client an event via websockets

#

the way you're doing it

#

it's just not worth it man

slender thistle
#

Your typing skill sure is kinda bad :p

stiff juniper
#

it is

#

cuz i type too fast

#

then i have to correct myself

#

like that

ruby dust
#

this is the second time I see someone using raw discord api

#

the first time was some guy from dbots saying he is programming for over 30 years and he doesn't need a lib mmLol

austere meadow
#

@ruby dust do you know what happened to him

ruby dust
#

nope

austere meadow
#

he's probably just using some shitty lib now like discord.io

gusty topaz
#

libs make stuff so much easier

ruby dust
#

he acts like a fucking smartass, thinking that we're all noobs here

stiff juniper
#

^

#

thats what i hated the most

#

he treated me like an ass

#

when i was just trying to help him

summer narwhal
#

ะฟ

stiff juniper
#

me too thanks

#

(talking about the newest case of POSTing to the API cuz "i dont need no lib" btw)

ruby dust
#

I'm talking about the first guy from dbots, he was saying something about looping (I don't remember much about it) and a bug that doesn't let it preview images on discord, which he then contacted discord and said they fixed it for him

ivory osprey
#

how i can create a web dashboard for my bot?

ruby dust
#

you make it xd

stiff juniper
#

there's a lot of stuff that goes into that

ivory osprey
#

you can give me a tutorial

#

?

#

or something

austere meadow
#

the basic idea behind a web dashboard is that you need to have some kind of communication between your bot (either the bot itself or just the database) and your website/server

#

we can't necessarily guide you on how to implement that but there are plenty of articles online about it

stiff juniper
#

yeah

ivory osprey
#

some tutorials to create a music bot?

quartz kindle
#

which language/lib?

ivory osprey
#

js

#

javascript

quartz kindle
#

discordjs?

ivory osprey
#

yea

quartz kindle
#

https://anidiotsguide_old.gitbooks.io/discord-js-bot-guide/content/coding-guides/coding-a-music-bot.html

lament meteor
#

thats old u know. also thats paid

ivory osprey
#

i see.. other one?

quartz kindle
#

he has 3 other examples to chose from in there

#

if you dont want to pay

#

he also mentions is not as easy as you would think, and that everyone and their grandmother want to make music bots, which is kinda the point i wanted to make here

earnest phoenix
#
any1 to help?
quartz kindle
#

post question

weak parrot
#

^

earnest phoenix
#

How do you add your own bot to a server?

deep inlet
#

Help with your personal bot is not customer service dude

#

You use the OAuth link

#

I mean, if you don't know the basic principles of Discord Bots, don't think of uploading here

earnest phoenix
#

aright

#

alright*

deep inlet
#

Do you know how to get the OAuth link? @earnest phoenix

earnest phoenix
#

mhm..

#

yes, i believe i can

bitter sundial
#

thats kinda rude mets

deep inlet
#

Sorry

#

Also, why's he named hoister? His username is fine...

bitter sundial
#

asks for help
mets tells you to basically fuck off

earnest phoenix
#

ya

deep inlet
#

I didn't tell him to fuck off

bitter sundial
#

it was a hoist before

earnest phoenix
#

ok so i made my OAuth link

bitter sundial
#

then use it

deep inlet
#

You put it into your browser

#

Any servers you have admin in will allow you to send it there

earnest phoenix
bitter sundial
#

your link is wrong

deep inlet
#

Ok, go to your bot's panel

#

Where you set the name, icon and stuff

#

And scroll down to OAuth generator

#

And click the button

gilded blaze
#

Not entirely true. You can have Manage Server which allows inviting bots.

deep inlet
#

Oh

#

Imo they should have a separate permission for inviting bots

gilded blaze
#

Well it kinda makes sense. People who manage the server manages which bots are in it.

deep inlet
#

Eh

earnest phoenix
bitter sundial
#

I dont think adding bots should be its own permission

deep inlet
#

He... he didn't even make it a bot user

bitter sundial
#

but I think some new permissions need to happen
there needs to be a good balance between ease of use and customizability
anyway thats off-topic

#

@earnest phoenix so have you created a bot user or did you only make an application?

earnest phoenix
#

I'm making the bot user rn

#

BOOM

#

FINALLY

#

i finally made my first bot ๐Ÿ˜„

#

ok thx for your help

cloud kelp
#

Why is bot offline 24/7

earnest phoenix
#

Because it may be updating or experiencing a glitch.

gilded blaze
#

Either your bot is crashing. Or you simply made an application and didn't program it.

cloud kelp
#

thanks

earnest phoenix
#

Is it the website URL, etc?

gilded blaze
#

The black bar is a text box.

earnest phoenix
#

omg

#

im so stupid

#

thx

gilded blaze
#

It is like that because the detailed description supports html.

earnest phoenix
#

Why do bots have to be approved?

#

What will the bot have so it will not make the bot be approved?

gilded blaze
#

In order to prevent bots that don't function properly, break the Discord TOS, and some other stuff.

earnest phoenix
#

Alright.

#

How many minutes will it take to be approved?

gilded blaze
#

Tbh idk. probs a few days

earnest phoenix
#

Oh.

#

I thought it would only be a couple of minutes lmao.

lament meteor
#

the mods are only human

uneven depot
#

it seemed to have taken roughly a day to get mine approved (i submitted it few days ago). I can imagine this varies greatly.

lament meteor
#

watcha mean?

uneven depot
#

like it could also take a week or longer. Depending on how many bots are getting submitted, how busy the people approving them, etc

lament meteor
#

yea but the mods are fast + a lot of offline bots

ruby dust
#

people still don't understand, how many times have I told this... there are more web mods now than before, so it now takes no longer than 2 days now

lament meteor
#

that too

bitter sundial
#

anywhere from 1 minute to 1 month

deep inlet
#

We need a visual queue so people stop asking

uncut slate
#

that's information we're currently not interested in making public

deep inlet
#

Oh, ok

#

I kinda wanna know why but ok

slender thistle
#

Even the amount of bots that will be reviewed before one's bot?

deep inlet
#

Maybe because if the line doesn't move, people don't say "The mods are lazy"

earnest phoenix
#

Do the Discord bots have to be in the Bot list for it to work?

neon schooner
#

They have to be in the bot list to be in this server

earnest phoenix
#

Why is my bot always offline?

neon schooner
#

if it hasn't been approved then it won't be in this server yet.

earnest phoenix
#

It doesn't work in my other server too.

sullen path
#

Did you check to make sure itโ€™s running?

earnest phoenix
#

How will I make sure it's running?

neon schooner
#

You have to run it

#

Like

#

If you're the developer you need to know how to start up your bot.

vernal crow
#

@earnest phoenix Have you made any program for your bot using a library like Discord.js, JDA, etc.?

earnest phoenix
#

Nope.

vernal crow
#

From what I can tell, youโ€™ve only made an application on Discordโ€™s site.

#

So, youโ€™ve made the user, but theyโ€™re a hollow shell as far as weโ€™re concerned. That will quickly be denied by the mods.

#

I gtg soon, but do you have any programming experience in any language?

earnest phoenix
#

No, I'm making my first bot.

ruby dust
#

building a bot has the same logic as building a game - by knowing a programming language

pale glen
#

how long does it take to be approved

#

!?

ruby dust
earnest phoenix
#

So where do I go to program the bot?

ruby dust
#

you don't go programming a bot yet, you go learn a programming language of your choice by looking up some online courses

earnest phoenix
#

For free?

knotty steeple
#

for a newbie like you i recommend javascript or python :^)

#

yes

earnest phoenix
#

Ok.

knotty steeple
#

codecadamy is free

ruby dust
knotty steeple
#

or sololearn

earnest phoenix
#

Does it work on mobile too or do I have to get my pc on.

knotty steeple
#

you may need your pc

earnest phoenix
#

kk.

knotty steeple
#

actually you do need your pc

earnest phoenix
#

i'll go on solo learn.

ruby dust
#

google play has a sololearn app

knotty steeple
#

idk anyone who would program on a mobile device zoomeyes

pale glen
#
  • It can take up to a week for your bot to be approved or declined.(edited)
#

christ

#

ok

earnest phoenix
#

but when i learn enough already, can someone show me the link on where you program the bot?

pale glen
#

guy go on youtube

earnest phoenix
#

why

pale glen
#

type in, how to create a discord bot

earnest phoenix
#

theres like 9-year old ppl there

pale glen
#

bingo

earnest phoenix
#

ok

pale glen
#

who cares

ruby dust
#

when you know how to program, you won't need any help like that cause you'll be experienced enough

pale glen
#

they tell you how things are done

#

you modify

#

to your needs

earnest phoenix
#

idk whats going on but kk

#

ill on yt and get solo learn

ruby dust
#

go on sololearn first to learn the basic of basics, and then look at how people make their first projects on youtube

earnest phoenix
#

if u are just learning programming pls dont make a discord bot right off the bat

ruby dust
#

like I did

earnest phoenix
ruby dust
#

mistakes were made

knotty steeple
#

same me too

#

what programming language your plan to learn about? :3

earnest phoenix
#

lmao

#

English

knotty steeple
#

๐Ÿ˜‚

ruby dust
knotty steeple
#

thats not

earnest phoenix
#

my language will be english lmao

#

what

#

language

sullen path
#

๐Ÿคฆ

knotty steeple
#

thats not a programming language

ruby dust
#

offtopic

knotty steeple
#

thats a language you speak

earnest phoenix
#

yea

#

im new ok? i just started coding

ruby dust
#

don't question anymore, choose a language you seem to like the most and learn it on sololearn

earnest phoenix
#

okay

sullen path
#

programming language ๐Ÿ˜‰

knotty steeple
#

you really should not try to make a discord bot right now if you dont know about programming languages and programming in general zoomeyes

earnest phoenix
#

what lesson should i start with?

knotty steeple
#

wdym

earnest phoenix
#

There are several lessons they are offering

vernal crow
#

Learn how to do a Hello World program

#

Then learn about types (this depends on the language you learn). Then learn some logic statements. โ€œIf this then do thisโ€ stuff.

alpine lark
#

Or go on steam and purchase Discord Bot Maker for $10. A few on here use it

granite hedge
#

A try catch should prevent a script to exit right? if something inside that try catch crashes

gilded blaze
#

Depends. If you specify all exceptions then yes. If you specify a certain exception it will only catch that.

granite hedge
#

Well for some reason the discord ban list doesn't follow the rules of that try catch xd

#

I catch all exceptions, and still it exits if their service goes down, (which is quite frequent)

ruby dust
#

discord ban list?

#

dbans?

granite hedge
#
try {
    const {
        Blacklist
    } = require('discordblacklist');
    const token = AuthDetails.blacklisttoken;
    const blacklist = new Blacklist({
        token, update: true
    });
    blacklist.update();
    bot.on("guildMemberAdd", async member => {
        try {
            settings = require("./Storage/settings.json");
        }
        catch (e) {
            //no settings yet
            settings = {};
            console.log(e)
        }
        if (!settings.hasOwnProperty(member.guild.id)) return;
        if (!settings[member.guild.id].hasOwnProperty("autoban")) return;
        if (settings[member.guild.id]["autoban"] != "on") return;
        if (blacklist.lookup(member.id)) {
            member.createDM().then(m => m.send("Your user-id was found on the public banlist, if you think this is a mistake, contact the owner of this bot or contact the owners of this module: https://bans.discordlist.net/")).then(member.ban(7).then(() => console.log(`Banned ${member.displayName}`)).catch(console.error))
        }
        else {
            console.log("user is allowed to join")
        }
        WelcomeMessage(member)
    });
}
catch (e) {
    console.log(e)
}
#

yep

sullen path
#
try{
    //do stuff
}
catch(Exception e){
    server.panic();
    server.crash();
}
gilded blaze
#

If you request a resource from any service check if the response code is 200.

ruby dust
#

I'm not gonna tell you what to do, but there are a lot of articles about discordlist.net as a whole being one of the worst sites the internet has seen with the least security possible

gilded blaze
#

Else handle the code accordingly

sullen path
#

I just let java throw exceptions so I can catch them

granite hedge
#

Any other service that could check if a player has done bad stuff?

sullen path
ruby dust
#

I mean dbans is pretty popular, but you need to choose the one you trust

#

I have a system of my own

sullen path
#

I just use all of them mmLol

granite hedge
#

I used Dbans just for the sake of quickly adding it, and I have an internal system too but I would love to check a new member that has never been in one of the guilds my bot is in

sullen path
#

I made a command that takes IDs and checks them

ruby dust
#

idk, I just personally don't trust sites that log raw personal and possibly sensitive data, including ips, without any sort of encryption, and which is so fkin easy to ddos or hack into @granite hedge

sullen path
#

doesn't matter if the user is in the server

granite hedge
#

@sullen path but you need something to compare it with xd, will try the ksoft.si thing

sullen path
#

I'm currently using both dbans and ksoft

ruby dust
#

I created my own system because every others seems to be either very vulnurable or sometimes they ban users without a reason

#

making them look bad

sullen path
#

๐Ÿค”

ruby dust
#

also, as a good practice, don't make any sort of commands that bans globally banned users

#

or hackbans

granite hedge
#

why is that bad? Keeping scum and bad players out of any server

ruby dust
#

because it's not for you to decide who to have banned from a commuity that you don't own/manage/moderate

sullen path
#

I only ban if banned users join. Any existing users are ignored.

ruby dust
#

on a public bot?

sullen path
#

um, yes?

ruby dust
#

sigh remind me to don't touch your bot ever again

sullen path
#

if you remove its ban perms, it just displays an alert

ruby dust
#

and without toggling it? even better

sullen path
#

๐Ÿค” should I make a toggle?

ruby dust
#

just remove the banning part on that end completely

#

before someone thinks of your bot as "another raid bot"

granite hedge
#

Mine is a toggle too, but I am removing it now

earnest phoenix
#

What programming language should I use for a beginner? [Finally know what a programming language is! :D]

granite hedge
#

Javascript I would assume

ruby dust
#

people say python is a good choice for building simple AI programs

granite hedge
#

or Python

#

Python is probably a bit easier to learn, but I think JavaScript has more docs and guides

ruby dust
#

python is easier in a way that it doesn't have {} and ; type of things

#

so you can fully focus on the program's logic

earnest phoenix
#

Alright.

stiff juniper
#

a good IDE will fill those kinda things in for you though (e.g typing in { will put the other } automatically)

sullen path
#

Don't use NotePad++

stiff juniper
#

^

sullen path
#

First rule

stiff juniper
#

i use VS Code personally

#

and it's really good

blazing gorge
#

Does anyone already made a Java bot?

earnest phoenix
#

I'll try Phyton 3 Tutorial

ruby dust
#

go with python3 if there is one

earnest phoenix
#

Ye.

sullen path
#

@blazing gorge why?

ruby dust
#

2 is outdated

blazing gorge
#

I am having trouble making one @sullen path

sullen path
#

there are thousands of Java bots

earnest phoenix
#

Uh.

sullen path
#

Second rule: don't dev on a mobile device

ruby dust
#

why are you skipping courses? that's what you are doing instead of learning them

blazing gorge
#

And my computer is slow so it doesn't work with java that well so that's why I asked that cause I need someone to help me make my bot

sullen path
#

then don't use java

granite hedge
#

Java is quite resource heavy

blazing gorge
#

Lol true

ruby dust
#

no wonder why mc is laggy

granite hedge
#

well not for the very simple things but if you expand, like sue maven it's heavy

sullen path
#

no wonder why my server crashes after 5 days of uptime

granite hedge
#

xd

#

that's just a memory leak

blazing gorge
#

I just need help setting up the commands and other stuff

#

Lol

granite hedge
#

java is like a big hole

sullen path
#

"setting up the commands"

#

๐Ÿค”

blazing gorge
granite hedge
blazing gorge
#

...

sullen path
#

ew maven

granite hedge
#

xd

blazing gorge
#

?

#

I am new to java btw ๐Ÿ˜‚

granite hedge
#

Ew Java xd

blazing gorge
#

Lol haven't use it in a while

sullen path
#

๐Ÿคฆ

granite hedge
#

yep don't start with java please

blazing gorge
#

Lol ok

sullen path
#

learn java first or use a different programming language

granite hedge
#

you will probably rather jump of a bridge then finish it as a beginner language

blazing gorge
#

Which is ๐Ÿ˜‚

#

Lmao

sullen path
#

Java

granite hedge
#

is a hell

blazing gorge
#

Rip

sullen path
#

I learned Python 2 (it's dead now) as my first language.

#

Java was my second

blazing gorge
#

Cool

granite hedge
#

if you count html as a programming language that was my first otherwise it was javascript

blazing gorge
#

how to download linux onto a Acer Chromebook

sullen path
#

a flash drive

earnest phoenix
#

i literally don't know what the hell i'm doing...

blazing gorge
#

what if u don't have one

#

Lol

sullen path
#

get one

blazing gorge
#

best buy? Lol

sullen path
#

idk

blazing gorge
#

i have now what lol

#

๐Ÿ˜‚

#

I am new to this more advanced technology ๐Ÿ˜‚

ruby dust
#

this is getting off topic

blazing gorge
#

?

earnest phoenix
#

i cant find the off topic channel

blazing gorge
ruby dust
blazing gorge
#

Who is good at using java btw?

#

Cause I'm not

ruby dust
#

the fewer part of the bot devs

earnest phoenix
#

i'm good at nothing...

blazing gorge
#

?

earnest phoenix
#

i don't even know how to get one question right!

ruby dust
#

dude, you are skipping the courses, I told you already

#

you clicked the wrong thing

blazing gorge
#

What website r u on @earnest phoenix๐Ÿ˜‚

ruby dust
#

sololearn,

blazing gorge
#

K

ruby dust
#

and you should be too, not shitposting here

earnest phoenix
#

i'm thinking on going to a website to 1-year olds.

blazing gorge
#

I'll be back in 5 years

#

Ok

earnest phoenix
#

ok

ruby dust
#

@earnest phoenix did you click on take a shortcut button?

blazing gorge
#

Lol

earnest phoenix
#

yes

#

wait is that good

ruby dust
#

yeah, sololearn won't let you pass unless you know everything what you were suppose to learn on first step

#

so if you don't know basics it won't let you take the shortcut

#

you have to click here

#

and actually learn, instead of taking quick shortcuts and not learning anything

earnest phoenix
#

What topic should i choose?

ruby dust
#

topic?

earnest phoenix
#

HTML Fundementals?

#

Yee

ruby dust
#

html isn't even a programming language

#

you wanted to choose python or what?

earnest phoenix
#

RRRREEEEEEEEEEEEEEEEEE

#

ugh

#

i'll just choose something

blazing gorge
#

What's the first step @ruby dust

ruby dust
#

of what

blazing gorge
#

Of what u said

#

Lol

ruby dust
#

to you or what? and what did I say?

blazing gorge
#

U said "yeah, sololearn won't let you pass unless you know everything what you were suppose to learn on first step"

ruby dust
#

that wasn't directed at you

spring ember
#

btw that's not true

#

if you pass the test then you can pass

ruby dust
#

yes

#

but they don't know the basics

devout raven
#

hmm

ruby dust
#

they didn't learn anything and want to pass that

blazing gorge
#

Ok

devout raven
#

why all my server.js error at github to heroku

#

hmm

sour perch
#

how do i makea new json file witf filesystem?

plucky fox
#

as a developer, i'd say start with the uttermost basics

sour perch
#

with

plucky fox
#

what language

sour perch
#

js

plucky fox
#

no idea

ruby dust
#

yes, but you'd only say that as a developer, someone who didn't touch a programming language yet will still want to learn everything fast

devout raven
#

hmm

#

my handler error!

blazing gorge
#

I'm on the website now what @ruby dust

ruby dust
#

great, now the question, why are you even there?

#

that website is for those that want to learn the very basics of the programming language they want to learn

#

so choose a language and learn it

#

I guess

blazing gorge
#

Cause why not lol ๐Ÿ˜‚

plucky fox
#

first, choose a language like deived said

#

then focus on the basics

devout raven
#
    if(message.author.bot) return;
    if(message.content.indexOf(config.prefix) !== 0) return;
    const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
    const command = args.shift().toLowerCase();
try {
    let comamnds = require(`./commands/${command}.js`);
    comamnds.run(client, message, args);
  } catch (e) {
    console.log(e.stack)
  } finally {
    console.log(command)
  }
});```
#

Client is defined

#

can help me?

plucky fox
#

are you sure it doesn't say client isn't defined?

earnest phoenix
#

do you know what "defined" means?

plucky fox
#

@devout raven

devout raven
#

ye

#

ye

blazing gorge
#

Lol

#

Tbh no, I'm just gonna learn myself

quartz kindle
#

gj discord

spring ember
#

google cloud*

#

he is probably on Android

blazing gorge
earnest phoenix
#

Aha! I'm finally learning it!

#

I'm starting with HTML for starters.

sullen path
ruby dust
#

html isn't a progr ok good luck

earnest phoenix
#

I'm trying to learn as much as possible.

#

Then I'll get into programs.

#

is it possible to buy nitro for my bot?

#

just a question xD

#

tag me if you want to reply

sullen path
#

๐Ÿคฆ why

#

@earnest phoenix

quiet bobcat
#

no you cant

earnest phoenix
#

don't know xd

#

just could be fun

sullen path
#

it's a waste of money

#

if you could

ruby dust
#

discord already provides free nitro-emotes for bots for free

stiff juniper
#

^

#

thats like the only thing I used Nitro for

#

soo

sullen path
#

If you want your bot to have an animated avatar, too bad

pale glen
#

ok guys

#

upvote my bot

#

get it

earnest phoenix
#

xD

#

buy me nitro then โค

pale glen
#

shit its not approved yet

earnest phoenix
#

xD

ruby dust
#

not even possible to gift nitro

earnest phoenix
#

to bad to be true

#

who is a good coder?

stiff juniper
#

yeahh i wish you could gift nitro

#

also "good" is very broad

#

and can mean anything on a positive level

earnest phoenix
#

uh

#

u

sullen path
#

there's a suggestion open for that

stiff juniper
#

ik

#

i already voted it up

#

i think

ruby dust
#

what suggestion?

earnest phoenix
#

someone wanna help me update a old code bot to update stuff? I can pay if everything works clean asf again

stiff juniper
#

gifting nitro

ruby dust
#

oh that

sullen path
#

ye

earnest phoenix
#

ye

stiff juniper
#

it has 7,409 votes

earnest phoenix
#

and they don't add it?

ruby dust
#

suggesting doesn't instantly mean adding it

sullen path
#

I think they want to fix the 70% uptime first

ruby dust
#

also, I'd love to continue this conversation but it kinda gets off topic here

sullen path
#

let's go

earnest phoenix
#

What could programming language should I use to make a Discord Bot?

sullen path
#

any

quasi marsh
native narwhal
#

If you know any languages at all, pick one of them (Preferably the one you are best in if you want to make a good bot) otherwise just pick any which has an API wrapper for Discord and learn that language

quasi marsh
#

If you don't know any, people usually tend to start with Python or Javascript as those are the most beginner friendly langs

#

Both languages have very high quality libs available

earnest phoenix
#

Should I choose Phyton or JavaScript?

quasi marsh
#

I prefer Python myself but it's up to you

earnest phoenix
#

What's the difference between Phyton & JavaScript?

native narwhal
#

Use google for good comparisons

quasi marsh
#

They both work in different ways, but Python forces you to use a particularly unusual style of writing

#

While JS uses the more conventional brackets

#

It's best to use sites like codecademy to introduce yourselves to both languages so you can see which one you prefer

sullen path
#

Python relies too much on indentations

quasi marsh
#

Personally I like that

earnest phoenix
#

I like both of 'em.

#

While JS looks simple.

#

And Phyton looks a bit, 'alot'.

sick cloud
#

I like node.js more, Python looked hard for me.

earnest phoenix
#

In my personal words.

#

Hm.

#

Ugh, just choosing one of them is so hard for me.

#

Phyton looks waaaayyyy simpler.

sick cloud
#

So, is this too much data for RethinkDB to handle?

        await r.table('giveaways').insert({
            id: msg.id,
            channel: msg.channel.id,
            startedAt: startedAt,
            startedDate: startedDate,
            setTime: setTime,
            endsAt: endsAt,
            startedBy: msg.author,
            prize: prize,
            winnerCount: winnerCount,
            channel: channel.id,
        });

I keep hitting an error with that, dunno how.

heady zinc
#

what's the error though

#

i usually insert more than that

sick cloud
#

RangeError: Maximum call stack size exceeded @heady zinc

heady zinc
#

oh

#

that would happen if the object you try to insert goes too deep

sick cloud
#

Uh, wha..? I don't see how that could happen..

#

never run into this issue either

#

This is the full code if it helps:

        let startedAt = new Date().getTime();
        let setTime = convert(time).ms();
        let endsAt = new Date().getTime() + convert(time).ms();
        let winnerCount = parseInt(winners);

        await r.table('giveaways').insert({
            id: msg.id,
            channel: msg.channel.id,
            startedAt: startedAt,
            setTime: setTime,
            endsAt: endsAt,
            startedBy: msg.author,
            prize: prize,
            winnerCount: winnerCount,
            channel: channel.id,
        });
#

๐Ÿ‘€

uncut slate
#

msg.author probably

#

has a circular prop

heady zinc
#

^

sick cloud
#

oh thonk

#

I included it since I wanted the users mention

#

should I just add the ID and .get it later?

heady zinc
#

just include the id

uncut slate
#

then toString()

#

but you're better off just including the ID

sick cloud
#

alright

heady zinc
#

doesn't tostring() do the same in d.js?

#

just returns the id

uncut slate
#

no point in storing it as a mention, they're constant bytes

heady zinc
uncut slate
#

toString mentions

heady zinc
#

oh

sick cloud
#

woo ok, storing the ID fixed it

sour perch
#

hey, how do i create a json file in js? i want to make it so that if the file doesent exist, create it

#

then the other stuff

sullen path
#

create it like any other file ๐Ÿคท

sour perch
#

yea, but make the bot create it if it doesent already exist in a chosen folder, using filesystem

sullen path
#

If it doesn't exist, create it.

#

I'm not sure how to do that with JS but you can steal someone's code from stackoverflow

sour perch
#

well thats what im asking

sick cloud
#
const reactions = msg.reactions.filter(r => r.emoji.name === '๐ŸŽ‰').first();
const users = reactions.users.filter(u => u.bot !== true);

What am I doing wrong here?

pale glen
#

Print out reactions and paste it here @sick cloud

sick cloud
#

already fixed

#

thanks though

earnest phoenix
#

Can someone send me the link where I can program my bot?

#

Is it Visual Studio Code?

sour perch
#

yes

earnest phoenix
#

Alright.

#

This?

sour perch
#

yup

earnest phoenix
#

Can you use it for mobile too?

sick cloud
#

No, it's a Windows/Mac/Linux program.

#

You can't really code on a mobile you know lmao

earnest phoenix
#

Chromebook?

sick cloud
#

That should work considering its Linux.

uncut slate
#

Chromebooks can't run most Linux apps

#

and Chromebooks don't run Linux, they run ChromeOS

hardy fiber
#

ChromeOS is based on/a modified version of linux right?

uncut slate
#

sure, but so is Android

#

you can't really compare it to linux directly

sullen path
#

You can try to install linux on a chromebook ๐Ÿคท

hardy fiber
#

I mean, you can install anything on a chromebook if you're willing to

#

linux is probally the best to put on a chromebook though

sullen path
#

It's kind of the only OS you can install on a chromebook

hardy fiber
#

Its very possible to install windows on a chromebook, you probally just need one with a larger ssd then the ones ive used

quartz kindle
#

so it turns into "explorerbook"?

sullen path
#

totally didn't drive everyone off-topic

uncut slate
#

yeah, this is more appropriate for #general (partially my bad mmLol)

knotty steeple
#

vscode is make in javascript, typescript and css

#

just get those and ur good

flint river
#

question: im getting

#

discord.errors.HTTPException: BAD REQUEST (status code: 400)

#

which apparently means im trying to post something/ connect to something with something that doesnt exist

#

but i cant figure out what im doing wrong

hardy fiber
#

error 404, existence not found