#development

1 messages ยท Page 427 of 1

restive silo
#

๐Ÿ‘€

upper ember
#

indeed

austere meadow
#

what line is it happening on

#

is it happening inside of the for loop or on the for loop

upper ember
#

inside the loop Blake

restive silo
#

thats the performance of postgres

ruby dust
#

aha

wise bridge
#

@austere meadow simplehttpserver isn't asynchronous :/

austere meadow
#

im sure there is one that is async
that was just the first one i found on google

restive silo
#

since simplehttpserver got merged into that

wise bridge
#

Really installing more libraries isn't what I intended to do

restive silo
#

๐Ÿ‘€

#

its pre installed with python

#

lmao

#

http server is pre installed with python 3.x

wise bridge
#

I think I will use a server side PHP script which forwards a discord webhook message

restive silo
#

do like you want blobcatthumbsup

#

we only wanted to give example ideas how to implement it

wise bridge
#

Yeah problem is it isn't always as easy as in node with python cos it needs to be async

austere meadow
#

does anyone know how to load an .eslintrc.json file into vscode-eslint

restive silo
#

should load automatically

austere meadow
#

its only loading the default (global) one for some reason

#

its overriding it

slender thistle
sinful lotus
#

is postgres better than MongoDB?

#

I used MongoDB in upgrading the database of my bot to tend to the sharding needs since sqlite is crap anyways

grizzled isle
#

RethinkDB is best with sharding

sharp escarp
#

i can't find any javascript econemy videos i tried doing discord-eco it brought up errors about installing it so and discord.js eco tutorials you know please tell me

restive silo
#

@sinful lotus Postgres is the Strongest SQL DB from performance and outperforms a lot of NoSQL DBs like Rethink, Mongo aswell. It also has good Utility like NOSQL types (Array/JSON) as SQL DB.

sinful lotus
#

what about the size ?

#

of stuff

restive silo
#

It uses less Ram and storage than mongo, dunno about other tho

sinful lotus
#

I dont know about much stuff on dbs. I honestly used mongoDB because its the one that worked. but frankly saying its much more better than an sqlite storage

shy verge
#

databases that don't require a server instance > *

uncut slate
#

oh boi

shy verge
#

you're not making some triple-A game

#

You're making a discord bot

uncut slate
#

you're not making an android app

#

an embedded database works for a bot, sure, but it's not very scalable

#

once you need to get into multiprocessing you're fucked with an embedded db

native narwhal
uncut slate
#

๐Ÿคข

native narwhal
#

xD

shy verge
#

what world do you live in where $ isn't reserved for the language

native narwhal
#

J a v a

shy verge
#

Dammt, lemme get my belt

native narwhal
#

The fun thing is that they use it for inner classes ๐Ÿค”

shy verge
#

GET THE FUCK OVER HERE SUN

native narwhal
#

So why not reserve it

#

xD

delicate rover
#

just no

uncut slate
#

$ isn't reserved in js either

native narwhal
#

Any inner classes compiled will get the name ClassName$InnerClassName and any anonymous classes will get the name ClassName$1 (1 changing depending on how many anonymous classes you have) so I don't understand why they haven't reserved it ๐Ÿ˜‚

shy verge
#

Sometimes I think Oracle needs a firm spanking

#

jeez

native narwhal
#

xD

buoyant oak
#

guys

#

how can I run the bot

#

using multiple files

#

I took the command

#

and put it into another python file

#

and then imported it

#

but it keeps saying invalid syntax at the bot on the line
await bot.say("")

old glade
#

Heyo guys. Is there a Gitlab-ci expert in there ?

#

if yes pls DM me

#

I have questions

slender thistle
#

@buoyant oak You are probably using rewrite version of Discord.py, where bot.say is ctx.send. thanking

buoyant oak
#

how do I prove that

#

oh

#

but the program functions

#

when it's apart of the main code

#

it's just too long

#

so I'm trying to split it

slender thistle
#

Could you send me the command?

#

Or the file itself.

buoyant oak
#

the whole thing

#
bot.command(pass_context=True)
async def deploy(ctx, target:str=None , Type:str=None, Quantity:int=None):
    global userid
    ID = ctx.message.author.id
    userid = ID
    ID23 = ctx.message.author.id    
    if Type != None:
        Type = Type.lower()
    if Type == "cruisemissile":
        AUTHOR_NAME = ctx.message.author.name
        AUTHOR_ID = ctx.message.author.id
        Mention_Target = ctx.message.mentions[0]
        ID_Target = ctx.message.raw_mentions[0]
        Target_Username = Mention_Target.name
        rand1 = random.randrange(0,2,1)
        rand3 = random.randrange(0,3,1)
        rand2 = random.randrange(1,10,1)
        CM_LAUNCH0 = "https://i.imgur.com/tXPv3F3.gif?1"
        CM_LAUNCH1 = "https://i.makeagif.com/media/8-07-2015/drp9p5.gif"
        CM_STRIKE0 = "https://media.giphy.com/media/1xpAvRhIQa1GJqRUt7/giphy.gif"
        CM_STRIKE1 = "https://adriaticmedianethr.files.wordpress.com/2016/02/bombardiranje.gif?w=500&h=281&crop=1"
        CM_STRIKE2 = "http://bestanimations.com/Military/Explosions/military-explosion-animated-gif-2.gif"
        CM_FAIL0 = "https://i.kinja-img.com/gawker-media/image/upload/s--Dd84PFEN--/c_fill,f_auto,fl_progressive,g_center,h_675,q_80,w_1200/nwadqejad1rskasrtven.gif"
        if rand1 == 0:
            CM_LAUNCH = CM_LAUNCH0
        elif rand1 == 1:
            CM_LAUNCH = CM_LAUNCH1

        if rand3 == 0:
            CM_STRIKE = CM_STRIKE0
        elif rand3 == 1:
            CM_STRIKE = CM_STRIKE1
        elif rand3 == 2:
            CM_STRIKE = CM_STRIKE2
        LAUNCH = " <@{}> , {} has Launched a cruise missile".format(ID_Target, ctx.message.author.name)
        embed = discord.Embed(title = "**ALERT**:", colour = discord.Colour.orange())
        embed.add_field(name = "CRUISE MISSILE LAUNCHED", value = LAUNCH)
        embed.set_image(url = CM_LAUNCH)
        await bot.say(embed=embed)
#

on the

low rivet
#

py -c print(__import__('discord').__version__) or pip show discord.py

buoyant oak
#

await bot.say(embed=embed)

#

at the bottom

low rivet
#

codeblock please

buoyant oak
#

that took a while

#

sec

#

Ill get u pip

#

Version: 0.16.12

#

@low rivet

#

@slender thistle

floral stone
#

async

slender thistle
#

Aight, that's not rewrite. mmLol

buoyant oak
#

aye hi antonio

#

xd

#

I imported asyncio

#

didn't work

slender thistle
#

But why does that give you Invalid Syntax error, tho

buoyant oak
#

still highlighted

slender thistle
#

Try copying this: await bot.say(embed=embed)

buoyant oak
#

what

#

thats the same thing

#

xd

slender thistle
#

That's the magic of Python.

buoyant oak
#

OH wait

#

i forgot to say this

floral stone
#

Invalid syntax

buoyant oak
#

when I just copied it

floral stone
#

^^^

buoyant oak
#

it used to not read the command

#

so I changed it to just def no async, to test it.... and completely forgot about that

#

but ye

#

I reverted it to this

#
@bot.command(pass_context = True)
async def deploy(ctx, target, Type):
    global userid
    ID = ctx.message.author.id
    userid = ID
    ID23 = ctx.message.author.id    
    if Type != None:
        Type = Type.lower()
    if Type == "cruisemissile":
        AUTHOR_NAME = ctx.message.author.name
        AUTHOR_ID = ctx.message.author.id
        Mention_Target = ctx.message.mentions[0]
        ID_Target = ctx.message.raw_mentions[0]
        Target_Username = Mention_Target.name
        rand1 = random.randrange(0,2,1)
        rand3 = random.randrange(0,3,1)
        rand2 = random.randrange(1,10,1)
        CM_LAUNCH0 = "https://i.imgur.com/tXPv3F3.gif?1"
        CM_LAUNCH1 = "https://i.makeagif.com/media/8-07-2015/drp9p5.gif"
        CM_STRIKE0 = "https://media.giphy.com/media/1xpAvRhIQa1GJqRUt7/giphy.gif"
        CM_STRIKE1 = "https://adriaticmedianethr.files.wordpress.com/2016/02/bombardiranje.gif?w=500&h=281&crop=1"
        CM_STRIKE2 = "http://bestanimations.com/Military/Explosions/military-explosion-animated-gif-2.gif"
        CM_FAIL0 = "https://i.kinja-img.com/gawker-media/image/upload/s--Dd84PFEN--/c_fill,f_auto,fl_progressive,g_center,h_675,q_80,w_1200/nwadqejad1rskasrtven.gif"
        if rand1 == 0:
            CM_LAUNCH = CM_LAUNCH0
        elif rand1 == 1:
            CM_LAUNCH = CM_LAUNCH1

        if rand3 == 0:
            CM_STRIKE = CM_STRIKE0
        elif rand3 == 1:
            CM_STRIKE = CM_STRIKE1
        elif rand3 == 2:
            CM_STRIKE = CM_STRIKE2
        LAUNCH = " <@{}> , {} has Launched a cruise missile".format(ID_Target, ctx.message.author.name)
        embed = discord.Embed(title = "**ALERT**:", colour = discord.Colour.orange())
        embed.add_field(name = "CRUISE MISSILE LAUNCHED", value = LAUNCH)
        embed.set_image(url = CM_LAUNCH)
        await bot.say(embed=embed)
#

but I get this

#
discord.ext.commands.errors.CommandNotFound: Command "deploy" is not found
slender thistle
#

Do you have something like:

def setup(bot):
    bot.add_cog(x) # x is your class name
``` in the end?
buoyant oak
#

what

#

is that

#

O_O

#

its not even in a class

slender thistle
#

Does that explain it?

buoyant oak
#

uhhh

#

so i make it into a class?

#

brb

sharp escarp
#

i can't find any javascript econemy videos i tried doing discord-eco it brought up errors about installing it so and discord.js eco tutorials you know please tell me pelase help

delicate rover
#

how far have you already gotten with your bot? if it is your first time building a bot it may be better to start off with something smaller and work your way up.
And sorry, I dont know of any economy tutorials about javascript bots.

sharp escarp
#

ok

delicate rover
#

so do you have a reliable database connected to your bot?

buoyant oak
#

@slender thistle okay so I did what you told me

slender thistle
#

Aaaand?

#

Did it work? thanking

buoyant oak
#

nope

#

def setup(bot):
bot.add_cog(War(bot))

#

like that right?

#

nice new profile picture btw :p

slender thistle
#
  1. Yeah, if your class name is War.
  2. Thanks. Think
  3. And what error did you get? Command "deploy" not found?
buoyant oak
#

yep it is war

#

class War():

#
class War():
    @commands.command(pass_context = True)
    async def deploy(ctx, target, Type):
        global userid
        ID23 = ctx.message.author.id    
        if Type != None:
            Type = Type.lower()
        if Type == "cruisemissile":
            AUTHOR_NAME = ctx.message.author.name
            AUTHOR_ID = ctx.message.author.id
            Mention_Target = ctx.message.mentions[0]
            ID_Target = ctx.message.raw_mentions[0]
            Target_Username = Mention_Target.name
            rand1 = random.randrange(0,2,1)
            rand3 = random.randrange(0,3,1)
            rand2 = random.randrange(1,10,1)
            CM_LAUNCH0 = "https://i.imgur.com/tXPv3F3.gif?1"
            CM_LAUNCH1 = "https://i.makeagif.com/media/8-07-2015/drp9p5.gif"
            CM_STRIKE0 = "https://media.giphy.com/media/1xpAvRhIQa1GJqRUt7/giphy.gif"
            CM_STRIKE1 = "https://adriaticmedianethr.files.wordpress.com/2016/02/bombardiranje.gif?w=500&h=281&crop=1"
            CM_STRIKE2 = "http://bestanimations.com/Military/Explosions/military-explosion-animated-gif-2.gif"
            CM_FAIL0 = "https://i.kinja-img.com/gawker-media/image/upload/s--Dd84PFEN--/c_fill,f_auto,fl_progressive,g_center,h_675,q_80,w_1200/nwadqejad1rskasrtven.gif"
            if rand1 == 0:
                CM_LAUNCH = CM_LAUNCH0
            elif rand1 == 1:
                CM_LAUNCH = CM_LAUNCH1

            if rand3 == 0:
                CM_STRIKE = CM_STRIKE0
            elif rand3 == 1:
                CM_STRIKE = CM_STRIKE1
            elif rand3 == 2:
                CM_STRIKE = CM_STRIKE2
            LAUNCH = " <@{}> , {} has Launched a cruise missile".format(ID_Target, ctx.message.author.name)
            embed = discord.Embed(title = "**ALERT**:", colour = discord.Colour.orange())
            embed.add_field(name = "CRUISE MISSILE LAUNCHED", value = LAUNCH)
            embed.set_image(url = CM_LAUNCH)
            await bot.say(embed=embed)
#

it still saying

#

-deploy is not a command

#

Ignoring exception in command None discord.ext.commands.errors.CommandNotFound: Command "deploy" is not found

slender thistle
#

I have no ideas left, tbh.

buoyant oak
#

do you have an example

#

I could see

#

๐Ÿ˜ฎ

slender thistle
#

I think that won't do. thanking

buoyant oak
#

okay

slender thistle
#

Ignore the checks.

buoyant oak
#

aye thank you

buoyant oak
#

@slender thistle

#

uhh

#

shouldn't the definitions

#

oh nvm

#

does it have to be def init(self,bot)}:

#

``__init __(self,bot):

#

__init__(self,bot):

slender thistle
#

Ignore that since you don't use self.bot.

buoyant oak
#

but should the definition be inside of the class

#

cuz you have some functions outside the class

#

?

slender thistle
buoyant oak
#

me nr^^

#

rn*

#

!baron counters kayn jungle

delicate rover
#

@sharp escarp if so, i would first suggest taking a look into working with databases

#

<@&304313580025544704>

south finch
#

u know

#

u can tag

native narwhal
#

You did not have to ping all of them ๐Ÿ‘€

south finch
#

an online

#

mod

delicate rover
#

oh sry

south finch
#

an online mod

#

but ty

delicate rover
#

thought this would be easier

south finch
#

nope

delicate rover
#

well, will do that the next

#

time

tall falcon
#

Is it possible to have separate channels for each user? Like for example:
User: @Thebot#0000 Can you make an announcement?
Bot: Sure, what would you like the announcement to be?
User: @TheBot#0000 blah blah blah

And it can't overlap so when more than one user says this they would have separate results

shrewd hedge
#

Hi, I'm having an issue with an announcement command I'm making

spring ember
#

@tall falcon check the author id if it matches with the user

#

@shrewd hedge what?

shrewd hedge
#

Well

#

Basically, the bot can't recognize if the first arg is a channel

tall falcon
#

@spring ember that's it?

maiden geyser
#

can someone help me please

quiet bobcat
#

"Do not ask to ask."

#

it's in the channel topic

maiden geyser
#

what...

quiet bobcat
#

just tell me what you need help with

maiden geyser
#

i tried to create my bot but it says unable to fetch application

quiet bobcat
#

what language are you coding in?

maiden geyser
#

coding...

quiet bobcat
#

yes, coding

supple lodge
#

Java ^^

quiet bobcat
#

are you sure?

delicate rover
#

javascript

floral stone
#

html

quiet bobcat
#

I'm coding in json

native narwhal
#

Are you by any chance in the process of cloning another bot? ๐Ÿ‘€

quiet bobcat
#

discord.json

maiden geyser
#

no

quiet bobcat
#

then what language are you coding in?

maiden geyser
#

python

delicate rover
#

is there a library for basic

maiden geyser
#

no...

delicate rover
#

would be brilliant to have bot run on basic

maiden geyser
#

okay thank you

supple lodge
#

there is a library on Visual basic....

delicate rover
#

is there something for scratch?

maiden geyser
#

no i will do basic thank you for answering my questions

solid cliff
#

im so lost

quiet bobcat
#

same

native narwhal
#

I think you are mistaken, no one answered your question(s)

earnest phoenix
#

can anyone tell me how to make how many servers my bot is in show up?
now it just says N/A

delicate rover
#

you must use the dbl api

native narwhal
earnest phoenix
#

so i have to include some stuff in my code?

buoyant oak
#

@shrewd hedge I dont know if it helps or not, but get the id of the message by saying message.channel.id

#

discord.Object(id='453597268986298380')

#

and then where you see the numbers

#

put the channel id there

#

so it looks like

slender thistle
buoyant oak
#

bot.send_message(discord.Object(id="45723894723894"), "announcement")

#

AHAHAHA

#

me

#

oh wait

#

what

slender thistle
#

Are you sure [TG] Tina the Cyclops#5861 uses Discord,py?

buoyant oak
#

uh

#

I don't know, but I'm guessing its similar

#

you have to put it as an object

#

discord object

#

just saying thats what you need to look for

#

you can't say (ID, "announcement")

slender thistle
#

The argument is a channel name, so unless they use Discord.py, let someone else answer.

buoyant oak
#

well

#

I tried that

#

okay

slender thistle
#

Let's not assume things unless we are sure what language they code in.

buoyant oak
#

though

#

yea, sure

buoyant oak
#

@slender thistle

#

so I found out

#

that you have to unload the extensions

#

right

#

but ehhhhhhh

#

await bot

#

NameError

#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'bot' is not defined

slender thistle
#

Where do you use it? In which part of code, I mean.

buoyant oak
#

the await bot.say

#

in the imported module

#

the one that gets imported

#

it's raising that error

slender thistle
#

Are you importing from discord import bot?

buoyant oak
#

uhhhhhhhhhhh

#

into the imported module?

#

i put that in?

slender thistle
#

Can you send me your code?

buoyant oak
#

as

#

a .py

#

or do you want me to send it as text

#

via here

slender thistle
#

Either.

#

.py is preferred.

buoyant oak
#

its pretty long

#

just warning you

#

its just one command

#

@slender thistle

earnest phoenix
#

what would the reason be for my bot to post the wrong # of guilds as its watching status on its profile but it posts the right # of guilds when you run >stats

buoyant oak
#

as in channel?

#

@earnest phoenix

earnest phoenix
#

number as in number of guilds

buoyant oak
#

oh ok

earnest phoenix
#

it posts 760 guilds but it should be 1510 (atm)

buoyant oak
#

aye nice

slender thistle
#

Using two different methods of getting the guilds number?

buoyant oak
#

ye

#

check if there any differences

#

between >stats

slender thistle
#

iirc, js has guilds.size or something like that. Thonk

buoyant oak
#

I love this

#

so much

#

btw

#

any clue on what the problem is ?

slender thistle
#

Bot not being defined, hold on. Thonk

buoyant oak
#

okay

slender thistle
#

Try this.

buoyant oak
#

ooo

#

okay

#

what did u change

slender thistle
#

Removed parentheses from class War, you had written await bot.say (embed=embed) somewhere and removed your client variable since you don't use it.

buoyant oak
#

bot.add_cog(War(bot))
TypeError: object() takes no parameters

earnest phoenix
#

same method to get guild count

slender thistle
#

Oh, and, of course, edited the latest line, which was bot.add_cog(War) before and which is bot.add_cog(War(bot)) now. :^)

buoyant oak
#

yea

#

its raising an error for that]

earnest phoenix
#

my code

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(`>info | ${results.reduce((prev, val) => prev + val, 0)} guilds`, { type: 'WATCHING' })
  })
  setInterval(() => {
    dbl.postStats(client.guilds.size);
  }, 800000);
});

stats command

if (message.content.startsWith(prefix + "stats")){
  client.shard.broadcastEval('this.guilds.size').then(results => {
  const clientStats = new Discord.RichEmbed()
  .setColor(0xdf4b4b)
  .addField("Supporting Guilds", `${results.reduce((prev, val) => prev + val, 0)}`, true)
  return message.channel.send({embed: clientStats}).then(message => message.delete(120000))
})
  .catch(console.error);
}
slender thistle
#

@buoyant oak What error? Still getting one?

buoyant oak
#

yea

#

bot.add_cog(War(bot))
TypeError: object() takes no parameters

#

and if I remove (bot)

#
    await bot.say(embed=embed)
NameError: name 'bot' is not defined

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 374, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'bot' is not defined
#

@slender thistle

shrewd hedge
#

@buoyant oak I use JavaScript

slender thistle
#

Guh...

buoyant oak
#

oh

slender thistle
#

@buoyant oak Try defining bot under import's.

buoyant oak
#

what do you want me to say

#

bot = commands.Bot(command_prefix='-')

#

??#

#

YO

#

ALEX JONES

#

IS JAMMING

#

anyways

#

bot = commands.Bot(command_prefix='-')

#

@slender thistle

#

??

slender thistle
#

Yeah, put that under the import things instead.

buoyant oak
#
Ignoring exception in command deploy
Traceback (most recent call last):
  File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "C:\Users\YOUSEF\Desktop\CTE LEAGUE OF NATIONS\War.py", line 47, in deploy
    await bot.say(embed=embed)
  File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\bot.py", line 309, in _augmented_msg
    msg = yield from coro
  File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\client.py", line 1152, in send_message
    data = yield from self.http.send_message(channel_id, content, guild_id=guild_id, tts=tts, embed=embed)
  File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\http.py", line 200, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: UNAUTHORIZED (status code: 401): 401: Unauthorized

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 374, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\YOUSEF\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: UNAUTHORIZED (status code: 401): 401: Unauthorized
#

O_O

#

but im the one who created you

#

unauthorized

#

rip

#

ooo

#

maybe

slender thistle
#

Wrong token.

buoyant oak
#

what

shrewd hedge
#

Well

slender thistle
#

The bot signs up under wrong token.

buoyant oak
#

theres only one token tho

#

and the other functions work

shrewd hedge
#

Anyways

#

I can't use my laptop rn

#

@buoyant oak thanks for trying to help tho

buoyant oak
#

I don't know javascript that well

#

sorry .-.

slender thistle
#

No idea how you managed to get 401 error code.

buoyant oak
#

๐Ÿ˜ฆ

#

huh

#

so in on_message

#

I did global bot

abstract mango
#

you don't have the permission to do something

#

what are you doing that triggers unauthorized

buoyant oak
#

nah, I put my bot to have admin

#

it just sends a gif

#

in an embed

#

with tetxt

abstract mango
#

oh embed

buoyant oak
#

text

abstract mango
#

hm

#

weird

#

does your bot not have send message perms

slender thistle
#

@abstract mango Missing Permissions is 403.

#

Not 401.

buoyant oak
#

it does

#

damn

#

the fact that you know it off by heart

#

damn

#

respect

slender thistle
#

What

buoyant oak
#

the different errors

#

xD

slender thistle
#

Try removing the bot = commands.Bot line and retry.

#

It literally takes up to 1-2 minutes to memorize them. bloblul

buoyant oak
#

raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'bot' is not defined

#

raise CommandInvokeError(e) from e discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'bot' is not defined

#

await bot.say(embed=embed) NameError: name 'bot' is not defined

#

discord gods, may you bless my soul for this very journey

slender thistle
#

Okay, I have no idea. If you define it in the same file, you have different instances. If you don't define, you can't use your bot. ThinkLMAO

#

Heck's sake, I am useless at this.

buoyant oak
#

T_T

abstract mango
#

quick tip

#

you don't need to init a new bot for everything

#

you can use something like

class Example:
    def __init__(self, bot):
        self.bot = bot
        # Now we can reference `bot` as `self.bot`
buoyant oak
#

ye

#

you have to use innit

#

init*

#

server

#

yea

woven blaze
#

Um my pokecord bot went offline in my server and idk how to bring it back :/

knotty steeple
#

do you own the bot or is it someone else's

#

i dont think so maybe shard is offline Thonk

woven blaze
#

Well I don't own it it's just in ma server

knotty steeple
#

ok then you could ask in the support server

woven blaze
#

O ok thx

worn sparrow
#

Anyone know anything about discord api redirects e.e

small solar
#

@worn sparrow when you authorize it goes to the first redirect url iirc

#

i remember a little from when i made my web dashboard

worn sparrow
#

I got the redirect

#

and the code, etc.

small solar
#

oh ok

gilded blaze
#

With the code you request an access token

#

Which can be used to request user data.

small solar
#

and other stuff depending on the scopes you chose

earnest phoenix
#

async def on_message(message):
if message.channel.id == elite_general:
c = bot.get_channel(elite_trading_floor)
await c.send(message.clean_content)

#

are those the channel ID's?

#

just the title of the channel right?

#

elite_trading_flood

#

and elite_general

quasi marsh
#

You'll need ID's

#

Go to Settings > Appearance and enable developer mode

earnest phoenix
quasi marsh
#

Then right click on a channel and press Copy ID

earnest phoenix
#

doing it

quasi marsh
#

Don't do it like that

knotty steeple
#

whats with d.js cache stuff

quasi marsh
#
import discord

client = discord.Client()

@client.event
async def on_message(msg):
    if msg.channel.id == ID:
        c = client.get_channel(id2)
        await c.send(message.clean_content)
earnest phoenix
#

Wow thank you IDK what i'd do without you @quasi marsh

native narwhal
#

Inconsistent use of capital letters please help me

quasi marsh
#

Make sure that in that the first ID is the news channel

#

And the second is your main

#

Otherwise it'll copy everyone's message into your news channel

earnest phoenix
#

you.are.awesome!

quasi marsh
#

And you don't want that

earnest phoenix
#

@quasi marsh hmm I have it but its not posting

#

do the channel id's need to have quotes around them?

#

that's what I have now

hushed oyster
#

message is not defined

#

replace message with msg

quasi marsh
#

^

earnest phoenix
#

I can just close the command prompt and restart it correct?

hushed oyster
#

yes

earnest phoenix
#

after I save the bot?

hushed oyster
#

yes

#

or you could just press control+c

quasi marsh
#

And yeah you'll need to have your PC running 24/7 if you want it to stay on

hushed oyster
#

I would get a VPS if you want it to stay on 24/7

quasi marsh
#

Recommend that ofc, but those are paid

earnest phoenix
#

hmm still not posting in the other room

#

bot is online

quasi marsh
#

You have logged in right?

#

With a token?

earnest phoenix
#

yep

#

logged it off and back in

quasi marsh
#

Is the bot in your server?

earnest phoenix
#

gave the bot permissions just to be sure

#

yes

quasi marsh
#

Are you sure you have discord-rewrite?

#

py -m pip install discord-rewrite

earnest phoenix
#

haha no i'm not sure of that

#

this goes in cmd right?

#

installing

#

๐Ÿคฆ

quasi marsh
#

Works now?

earnest phoenix
#

oh no

#

dang it haha

#

I had it with a test bot working

#

hard face palm

quasi marsh
#

Hmm, try doing py -m pip install -U aiohttp

#

And try py -m pip uninstall discord.py

#

Maybe it's in conflict with the old one

earnest phoenix
#

discord 0.0.2 requires discord.py, which is not installed.
discord-rewrite 1.0.0 has requirement aiohttp<2.3.0,>=2.0.0, but you'll have aiohttp 3.3.1 which is incompatible.

quasi marsh
#

Okay here

earnest phoenix
#

i'm so sorry

#

i'm trying

quasi marsh
#

do py -m pip uninstall discord

earnest phoenix
#

thank you so much for your help

quasi marsh
#

and py -m pip uninstall discord-rewrite

earnest phoenix
#

done

floral stone
#

0.0.2

delicate zephyr
#

@quasi marsh its yarn

#

Literally

#

py -m pip install "yarn<2.0.0"

earnest phoenix
#

lol

delicate zephyr
#

and then reinstall discord

#

and it works

#

I had the same issue with discord py

quasi marsh
#

py -m pip install -U git+https://github.com/Rapptz/discord.py@rewrite

#

This'll make sure you have rewrite

#

If that error happens again, follow Luke's advice, I personally have never seen it

earnest phoenix
#

OMG

#

it works

#

BOT WORKS

#

every7thing works

#

@delicate zephyr @quasi marsh

#

THANK YOU

quasi marsh
#

np

#

Have fun

earnest phoenix
#

X1000000

delicate zephyr
#

Which bit fixed it

#

lmao

earnest phoenix
#

the last yarl thing got it

delicate zephyr
#

๐Ÿ‘Œ

earnest phoenix
#

amazing guys I can't thank you enough

#

now you said that I can run this bot on a server instead

delicate zephyr
#

google the error next time ๐Ÿ˜„

earnest phoenix
#

of my pc

#

for sure

#

hhaha

#

๐Ÿคฃ

rain orbit
#

ayy

#

i haz question

floral stone
#

ask it

#

I'm ready for ya boi

rain orbit
#

when using ytdl and d.js, is it possible to get the total queue time?

floral stone
#

come at me

#

nvm

#

I don't use js

rain orbit
#

well dam

#

thx anyways

floral stone
#

sry :p

wild tide
#

How is a bot able to tell if a user is under the age of 13? I know Luca does this, and I was wondering where it grabs the information from.

hidden ginkgo
#

๐Ÿ˜‚

south finch
#

luca doesnt

#

we do

#

like the mods

shy verge
dull mica
#

Luca is all knowing

wild tide
#

oh I thought luka knew all

#

:3

#

Even then, how do mods find out? lmao

frail kestrel
#

not development related kthx

drowsy sentinel
#

Via voice, and/or maturity speculation.

wild tide
#

accurate?

restive silo
wild tide
#

I wasn't shitposting, I was still on with the question

restive silo
#

Yea but thats still not develope related

#

as someone mentioned already but you succesfully ignored

wild tide
#

I didn't get a mention

#

I've been on discord ever since

#

never been offline

restive silo
wild tide
#

gothca

#

๐Ÿ˜‰

halcyon torrent
#

does a executed webhook trigger the message reception event ?

#

I mean, is a message sent using a webhook considered as a normal message and will my bot receive it as a created message?

earnest phoenix
knotty steeple
#

what is the client secret for?

austere meadow
#

its for oauth2 stuff

#

i believe its there to prove that this application is yours and its not just an imposter

knotty steeple
#

oh ok

#

then i dont need it

bitter sundial
#

client secret is part of the oauth2 protocol yea
you need it to get the access and refresh tokens of an authorization code

slender thistle
#
import discord
import aiohttp
import asyncio
import json

class dbots:
    def __init__(self, bot):
        self.token = 'DESPACITO'
        bot.loop.create_task(self.update_servers())

    async def update_servers(self):
        while True:
            header = {
                'Authorization': self.token,
                'Content-Type': 'application/json'
            }
            async with aiohttp.ClientSession() as session:
                async with session.post("https://discordbots.org/api/bots/{}/stats".format(bot.user.id), data='{{"server_count": {}}}'.format(len(bot.guilds)), headers=header) as r:
                    await asyncio.sleep(1800)
#

Well, that's just a part of code in my cog.

delicate zephyr
#

I'll try and get it to work

#

nice url

#

lmao

slender thistle
#

Yeah, it's from my .pw code.

#

๐Ÿ˜‚

delicate zephyr
#

@slender thistle fucking legend

deep inlet
#

DESPACITO

delicate zephyr
#

๐Ÿ‘Œ

slender thistle
#

It worked?

delicate zephyr
#

yea

slender thistle
delicate zephyr
#

Tbf I did have to set it to 500 in postman to make sure it worked

#

never hurts to double check

native narwhal
#

๐Ÿ‘

slender thistle
#

๐Ÿ‘ŒLUL

gilded thunder
#

@delicate zephyr That's what I did too but I pushed 1337.

#

But good it worked.

quasi hearth
#

Does anyone know why this happens:

events.js:188                                                           [8/1951]
      throw err;                                                                
      ^                                                                         
                                                                                
Error: Unhandled "error" event. ([object Object])                               
    at Client.emit (events.js:186:19)                                           
    at WebSocketConnection.onError (/home/theusaf/bot/node_modules/discord.js/s$
c/client/websocket/WebSocketConnection.js:374:17)                               
    at WebSocket.onError (/home/theusaf/bot/node_modules/discord.js/node_module$/ws/lib/event-target.js:128:16)
    at emitOne (events.js:116:13)
    at WebSocket.emit (events.js:211:7)
    at _receiver.cleanup (/home/theusaf/bot/node_modules/discord.js/node_module$/ws/lib/websocket.js:211:14)
    at Receiver.cleanup (/home/theusaf/bot/node_modules/discord.js/node_modules$ws/lib/receiver.js:557:13)
    at WebSocket.finalize (/home/theusaf/bot/node_modules/discord.js/node_modul$s/ws/lib/websocket.js:206:20)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)```

and if there is any way to reconnect the bot when this error occurs?
deep inlet
#

Why not ask DAPI or DJS?

verbal zodiac
#

<@&304313580025544704> ((sorry for the ping )) if anyone is reviewing my bot it wont be online til tonight, the host is down

restive silo
#

.

#

Okay so first of dont ping all mods, instead ping only 1 online

#

second we decline your bot only if its offline for 1 day (we invite it and if its offline we check back in a day) so you dont get a special treatment here in any way. @verbal zodiac

verbal zodiac
#

oh ok i was just letting u know

sorry for the ping

restive silo
#

Yea but please dont ping all mods, that is quite pointless

austere meadow
#

i want to better my knowledge on classes in javascript, so say i have something that looks like this

module.exports = Class {
    constructor(client) {
        this.client = client;    
    }

    async run(oldMember, newMember) {
        this.client.setTimeout(this.destroy, 60000, oldMember.guild)
    }

    async destroy(guild) {
        const player = await this.client.lavalink.get(guild.id);
    }
}

this is basically what my VoiceStateUpdate event looks like (massively simplified), but on const player = await this.client.lavalink.get(guild.id);, this becomes undefined (Cannot read property 'client' of undefined). why is this, and how can i access this.client? do i just need to pass it through as an argument in the destroy function?

uncut slate
#

@austere meadow when you run this.client.setTimeout, this.client will call this.destroy

#

so, this will turn into this.client because this.client is calling it

#

three things you can do to fix that

#
  1. replace this with this.client
async destroy(guild) {
  const player = await this.lavalink.get(guild.id);
}
  1. use an arrow function to prevent this from changing
async run(oldMember, newMember) {
  this.client.setTimeout(() => this.destroy(), 60000, oldMember.guild);
}
  1. use .bind to prevent this from changing
async run(oldMember, newMember) {
  this.client.setTimeout(this.destroy.bind(this), 60000, oldMember.guild);
}
austere meadow
#

ahh okay

#

thanks for the help aeth ๐Ÿ˜„

uncut slate
#

np

#

also

#

you might like 60e3 or 6e4 over 60000

austere meadow
#

oh true

uncut slate
#

60000 isn't too bad but at some point the zeroes get hard to keep track of

austere meadow
#

yeah i always forget you can use scientific notation

karmic parcel
earnest phoenix
#

you can also use scientific notation

karmic parcel
#

?

maiden geyser
ruby dust
#

wdym?

maiden geyser
#

for bot commands

ruby dust
#

import a commands extention and start defining commands

maiden geyser
#

what?

#

ooooh okay

#

i get you

#

sorry

#

thank you for your help

ruby dust
#

np

serene echo
#

could i post a conf file for a discord dialer bot and get input on what may be wrong?

supple geode
#

Can I add commands for my bot?

quiet bobcat
#

Yes you can

serene echo
#

thanks

#

i got this for github website

#

+-------------------------+
| |
| Discord API: https://discordapp.com/api/guilds/451573510700138508/widget.json
| |
+-+---------------------+-+
| |
| Discord messages: Welcome to DarkenedSpirits
| |
+-v---------------------v-+
| |
| node index.js (server): https://discordapp.com/widget?id=451573510700138508&theme=dark
| |
+-+---------------------+-+
| |
| WebSockets |
| | +------------------------+
+-v---------------------v-+ | |
| +---------> WebRTC-compatible |
| Browser (index.html) | | SIP server: bluedemon@sip.firertc.com
| https://discordapp.com/widget?id=451573510700138508&theme=dark |
+-+---------------------^-+ | |
| | +------------------------+
| Audio routing |
| |
+-v---------------------+-+
| |
| Discord client: 454058503716208641
| |
+-------------------------+

supple geode
#

My bot's Commands are called ^^help^^reviews {user} and ^^news {user} for Popuko News-Bot

serene echo
#

bad confuration?

supple geode
#

I got my github too

serene echo
trim plinth
#

thats a lot of whitespace man

quiet bobcat
#

i agree

knotty steeple
#

whats the ratelimit for changing profile picture

#

on a bot

umbral pelican
#

twice every hour iirc

knotty steeple
#

is that it zoomeyes

#

ok

serene echo
#

I don't know how to code but would like to have a discord dialer bot that's a bot

buoyant oak
#

@slender thistle

#

DOOD

#

THANK YOU SOOOOO MUCH

earnest phoenix
#

where can i find how to make my prefix configurable for server owners?

#

a database

fluid basin
#

store the prefixes in like a db or smth

earnest phoenix
#

every bot needs a database even simple ones GWfroggyWeSmart

fluid basin
earnest phoenix
#

well not a very very simple one

#

@earnest phoenix if i do that would I have to put all possible prefixes in the database? im using discord.js by the way

#

I still kinda new to the whole discord.js thing

trim plinth
#

no

#

you'd make it an option for guilds to change their prefix

earnest phoenix
#

so make a table with guild.id and prefix right?

#

yes

trim plinth
#

no

earnest phoenix
#

and that prefix is changeable by admins+ or what you want

#

wait

#

would it be a table

trim plinth
#

@earnest phoenix you'd make a document, not a table

#

so for each guild your bot has, you'd insert a document into a table

earnest phoenix
#

oh.. I havent done that yet I will have to read up on that.. any docs I can go over?

trim plinth
#

depends what db you're using

earnest phoenix
#

sqlite3

trim plinth
#

INSERT INTO [table name] (columns) VALUES ([stuff]);

earnest phoenix
#

so they would all be TEXT NOT NULL correct?

trim plinth
#

no

#

maybe

earnest phoenix
#

lol

trim plinth
#

๐Ÿค”

#

not good with SQL

#

just refing off of mini docs I made for myself

#

for postgres

earnest phoenix
#

maybe if anything learn SQL before you use

trim plinth
topaz fjord
#

^

trim plinth
#

example: INSERT INTO guilds (id, prefix) VALUES ('guild id', 'default prefix');

#

@earnest phoenix but I think it'd be VARCHAR

earnest phoenix
#

%komutlar

#

%destek

trim plinth
#

@earnest phoenix if you're trying to do commands, go to a testing channel

earnest phoenix
#

okey thanks

fleet epoch
#

is there a guild.delete function?

atomic wasp
#

Is there any method to get the total number of users (joining all guilds) in html?

frail kestrel
#

@fleet epoch prob

#

discord.js?

fleet epoch
#

I saw

#

Any limits on it?

inner jewel
#

you have to be the owner

fleet epoch
#

Dang

#

So it's useless

frail kestrel
#

pretty much

fleet epoch
#

Dangit

topaz fjord
#

how is it useless

#

i dont think you would want someone who is not owner to delete ur server

#

its like that for a reason

uncut slate
#

selfbots used to be popular some time ago, yano

#

they had to get that juicy ass 100% api coverage badge

inner jewel
#

bots can still own guilds

uncut slate
#

yes that too but I would call that useless tbh

delicate zephyr
#

thats not useless

#

Its nice if you dont want to be in the guild cause you're taking a break testing stuff

mental trellis
#

in discord.py, is there a way to have the bot send the commands.errors as a message?

#

like if I get the command not found error, can I have the bot say the command doesn't exist

low rivet
#

yes.. but why do that when you should silently fail, it gets annoying when im not trying to trigger a bot response and it says command not found

mental trellis
#

I'm just making a bot as a project to learn python. I'm not planning on joining any servers other than my own with it

mental trellis
#

alright, thanks

lament meteor
#

Tbh making a bot isnโ€™t a smart idea for learning a coding lang

mental trellis
#

it's not my first

earnest phoenix
#

LOL

#

@earnest phoenix @DBW#9176 look at your servers!

cedar oar
#

If anyone could help

#

(BTW this is a failed build)

earnest phoenix
#

@shadow ice dm?

#

Or i can share ss?

shadow ice
#

K?

earnest phoenix
#

In here

shadow ice
#

lets talk in a vc

earnest phoenix
#

Wait what?!

#

I cant speak english :/

shadow ice
#

?

earnest phoenix
#

I cant speak english :(

shadow ice
#

How old are ya?

earnest phoenix
#

Not i am not from english

slender thistle
#

Could you ask your question, if it is related to programming/coding?

earnest phoenix
#

Hmm Thonk

slender thistle
earnest phoenix
#

Yes

#

@slender thistle๐Ÿ‘† ๐Ÿ‘†

#

Help it says 1000000000000 servers for my bot

delicate rover
#

pretty sure that is not correct

earnest phoenix
#

Why does it say that?

#

My bot tels me 17 and this website says loads

delicate rover
#

i wouldn't know, i dont have the code that sends the amount of bots, you should send the amount of bots via the dbl api

upper ember
#

quick html question

#
<body bgcolor="#7289DA">
<img src="https://mrsheldon.me/images/785375.gif" alt="" width="800" height="600" style="float: right;" />
</body>
upper zodiac
#

Ermm, i wanna tell that my bot (Spidey, now it's in Queue) info on Discordbot list is future update. For now you can check old commands by using /help . I'll update it to -/help after all new commands done. The bot will have big update

solid cliff
#

@earnest phoenix did your dbl token get leaked THINKCEPTION

earnest phoenix
#

Should i make that an environment variable?

worn sparrow
#
require("imlib2")
local corner_a, corner_b, side = ...
assert(corner_a and corner_b and side, "Please provide 3 integer parameters")

local side_length = 500

im = imlib2.image.new(side_length, side_length)
local colors = {imlib2.color.YELLOW, imlib2.color.BLACK, imlib2.color.RED}

for x=0, side_length-1 do
  for y=0, side_length-1 do
    local a = corner_a + x*(side/side_length)
    local b = corner_b + y*(side/side_length)
    local c = math.floor(a^2 + b^2)
    local color_index = 1 + c % #colors
    im:draw_pixel(x, y, colors[color_index])
  end
end

im:save("wallpaper.png")```
upper ember
ruby dust
#

css?

earnest phoenix
#

Does css cascade?

bitter sundial
#

css=cascading style sheets

earnest phoenix
#

i know what it stands for, that's why I'm asking does it cascade?

spring ember
fluid basin
#

learn html+css owo

karmic parcel
#

sure, it cascades down the page thinkman

earnest phoenix
#

hello .. i want to ask something problem.

i used : bot.user.setPresence({ game: { name: ${bot.users.size}, type: 0 } });

i want make the Presence changing every second.. I've tried with the function interval and timeout, but it does not work. Can anyone help me?

example :
Playing PUBG, after 2 second change to Playing Fortnite..

#

?

restive silo
#

short answer, you cant

earnest phoenix
#

Uh

#

Yea

restive silo
#

you will hit a rate-limit

earnest phoenix
#

Maybe every minute

#

Imagine changing the bot name every second, hahaha

restive silo
#

you can only change your presence every 15 seconds iirc, and if you do that the whole time then this could be seen as API Abuse since you spam the api with request

earnest phoenix
#

the command name is "rate limit"?

#

What?

restive silo
#

what

#

no

earnest phoenix
#

Umm do you know what is rate limit?

restive silo
#

your bot will get "rate limited"

#

thats not a command

earnest phoenix
#

DoS attacks

restive silo
#

yes

earnest phoenix
#

Hmm

restive silo
#

spamming a server with tons of request to get it down is also called DoS

earnest phoenix
#

ohhh.. i dont know what is.. hehe

you may often see bots changing activity playing in status, I need to know his js command.

restive silo
#

you can change your status but not every second

earnest phoenix
#

ok every minutes no prob

#

To put in simpler terms, when you create a bot, you make requests to discord api

#

Discord api doesn't want people to spam their servers

#

So they implemented a thing called "rate limit" where you can only make requests in moderation

#

For example, 5 requests every second

#

So like Yukine said for the presences endpoint, 1 request every 15 seconds

#

ohhhh ok i see, I understand... thank you for your all answer ๐Ÿ‘

#

Sure thing

fluid basin
#

If I'm not wrong presence updates are once per 15sec

earnest phoenix
#

Yea thats what yukine said

earnest phoenix
#

Is it possible to shard some commands in discord.py?
I have a command who eats my ping like mad, preventing commands from being run quick.

fluid basin
#

wut

#

Either you shard the entire bot but if the command is resource intensive, you'll need to try and make it more efficient or abandon it

cobalt ivy
#

(Node.js)

tall falcon
#

@earnest phoenix there's work arounds

cobalt ivy
#

Pls help.

frail kestrel
#

??

tall falcon
#

Do npm update and see if it has the same error @cobalt ivy

frail kestrel
#

unhandled error

#

lol

tall falcon
#

Does DBL have a thread on stack overflow?

cobalt ivy
#

@tall falcon It's already been 2 minutes without problems.

tall falcon
#

@cobalt ivy Good

prime geyser
#

Problem with the API

#

node-v6.11.3-win-x64\node_modules\dblapi.js\src\index.js:79
async postStats(serverCount, shardId, shardCount) {
^^^^^^^^^

SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)

tall falcon
#

It's weird looking at that without code blocks

prime geyser
#

Code :

#

bot.on('ready', () => {
setInterval(() => {
dbl.postStats(bot.guilds.size, bot.shards.Id, bot.shards.total);
}, 1800000);
});

fluid basin
#

weird

prime geyser
#

Code redirected :
async postStats(serverCount, shardId, shardCount) {

halcyon torrent
#

hm, weird

prime geyser
tall falcon
#

How do you add reactions to message sent by the bot? I want to add a reaction so when pressed the user can delete the message

prime geyser
#

Const's like this :
const Discord = require('discord.js')
const bot = new Discord.Client()
const DBL = require("dblapi.js");
const dbl = new DBL('You have really think I give you my token ๐Ÿ˜‚', bot);

tall falcon
#

I store all my tokens in a file

#

I wonder why most people don't do that

fluid basin
#

Lol why

#

They store it in a db xD

halcyon torrent
#

I store my tokens on github gunsthonker

mental solstice
#

hmm how to specify a guild in JS?

halcyon torrent
#

so now if I forget them, I can ask microsoft to remind me

tall falcon
#

@halcyon torrent ask me

floral stone
#

I store everyone's token on github

tall falcon
#

Store my token

cobalt ivy
#

@tall falcon Thank you! (+rep)tickYes

tall falcon
#

@cobalt ivy No problem

#

npm updateusually solves all my issues

#

Whoops

mental solstice
#

got it though, thank you.. client.guilds.get("guildid");

icy hearth
#

unless you want to find it by the name

#
client.guilds.find(`name`, guildName)```
quasi marsh
#

@oak smelt when you have it in a db you can access it in a programmatic way

#

Simply put you could have get all scores and filter by top

oak smelt
#

I think I might be asking my question too broadly. Here are two questions: 1) How does a bot grab that data and post it into discord? 2) is it possible for the data to look like the picture I posted with conditional formatting and all that jazz?

fluid basin
#

Hmm

oak smelt
#

or will a bot simply spew out the numbers as text and that is it?

icy hearth
#

@oak smelt are you trying to send an image?

#

or, are you trying to use canvas, for userinfo, ranks, etc

oak smelt
#

Right now I upkeep a google doc (sheet) which works well. My original hope was that I would like to embed the sheet into a channel that acts like a real time view of that page. Otherwise, it could also be a live link to an image that I overwrite.

sick cloud
#

Are there any guides to how canvas works more.. say, in depth? I've got some basics down (made a fancy welcome message one), but I'd like to see if theres things I could do like, saaaay... positioning, I dunno blobsmilehappy

icy hearth
#

that made 0 sense to me

#

just google javascript canvas

#

positioning just takes two more args though does it not? or am i thinking of using canvas with html? @sick cloud

sick cloud
#

I dunno really, the furthest I got was following a discordjs.guide article ablobmelt

fluid basin
languid dragon
#

shh

fluid basin
#

I sense ken

languid dragon
#

u saw nothing

fluid basin
#

sniff* *sniff

#

Well if its image manipulation then you'll need to learn canvas and other image libraries

oak smelt
#

I am looking at that webpage right now....sorry....had a support phonecall come in

quasi marsh
#

@oak smelt Basicly, you get data with script

#

With my DB it's like r.get('guild:ID:key').decode()

#

you could do like

x = []
try:
    x.append(r.get('guild:264445053596991498:score').decode())
except AttributeError:
    pass
icy hearth
#

if youโ€™re tryna to make an image like other popular bots, then youโ€™d need canvas, a database, and some knowledge

#

Say for example, your database is in json format, then you could define it, and do dataBase.id.whatever your trying to get

upper zodiac
#

<@&304313580025544704> Sorry for the ping, but, Ermm, i wanna tell that my bot (Spidey, now it's in Queue) info on Discordbot list is future update. For now you can check old commands by using /help . I'll update it to -/help after all new commands done. The bot will have big update

south finch
steel heath
#

"Sorry for the ping,"

south finch
#

okay

upper zodiac
#

Sorry for the ping again

languid dragon
#

no

south finch
#

๐Ÿ‘๐Ÿฝ

uncut slate
#

@upper zodiac

  1. you don't have to ping the whole staff for anything unless it's urgent
  2. you don't have to ping anyone at all because we don't need to know if your bot is online or not
#

that's like going "@Mods I'm taking a shit! Sorry for the ping~"

upper zodiac
#

Ouh sorry

#

New here

#

my bot online 24/7 now

languid dragon
fluid basin
#

๐Ÿ‘€

sick cloud
upper zodiac
#

Nitro UwU

sick cloud
#

blobnitro yep

restive silo
#

@upper zodiac you dont need to ping us when your bot wents down btw

upper zodiac
#

Nope my bot not went down

restive silo
#

oh wait

#

i misread

upper zodiac
#

You guys want to verify bot before apprive it to list right

restive silo
#

you can edit the bots page

#

yea just edit the bot page

fluid basin
#

O.o

upper zodiac
#

Yaa but i'll do the update in ASAP

#

Too lazy to change it many times lel

restive silo
#

???

#

and instead pinging all mods

fluid basin
#

You can preview it btw

restive silo
#

wow

upper zodiac
#

Mayb you guys can check it after i updated the bot

restive silo
#

what a nice person

#

no

fluid basin
upper zodiac
#

I'll start developing the bot start from next week Tuesday

#

The bot now only have old commands

restive silo
#

ThinkShrug what has that to do with us now Thonk we test your bot and approve it when it works we dont mind it having new features at all, rather tha just update your bots page and done

fluid basin
#

tbh is true

sick cloud
#

I remember my old experience approving bots on another list. bot devs get angery at times ._.

#

but trueeee

upper zodiac
#

Ouhhhh

#

Okay okay

#

I understand your point

restive silo
upper zodiac
#

I updated the bot page info that's why i say to you guys that the commands on bot page info is still not available at this time

#

The bot page info is future update

restive silo
#

oh thats fine aslong as your help commands shows the current commands

upper zodiac
#

Okay :)

#

Good night /day

fluid basin
delicate rover
#

so just a quick question, with what character do i separate guild ids in the bot edit form, i cant figure it out

#

nevermind apperantly i needed a space after the comma

icy hearth
#

๐Ÿ˜‚

quasi hearth
#

In discord.js, how do you run code when the bot is pinged?

restive silo
#

check on the message event if the Message#mentions collection contains the Client User

sick cloud
#
if (<message>.content.contains(`<@${<client>.user.id}>`) { /* ... */ }

.. or that

#

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

#

thats what I use

quasi hearth
#

oh :p

sand roost
#

anybody have code for an paged help command

#

like one with โ—€ and โ–ถ

quasi hearth
#

so js if(msg.isMentioned(bot.user)){} would work?

restive silo
#

yes that should work

#

๐Ÿ‘€

pearl schooner
#

i asked before and ill probably get the same answer but how do you make a c!disable <command> command?

#

im using discord bot maker from steam.

quasi hearth
#

what is this "disable" command supposed to do

pearl schooner
#

so just say i went c!idiot @pearl schooner (a command)

#

and it worked

#

so you would do

#

c!disable idiot

#

then when you run the c!idiot command.. it says this command is disabled in this server

quasi hearth
#

use some kind of database

pearl schooner
#

if you r wondering this is my bot @CowBot

#

its not in here?

quasi hearth
#

not yet

#

it has not been approved

pearl schooner
#

doesnt it auto-add

quasi hearth
#

no

#

it has to be approved first

sick cloud
#

You got to wait for a moderator to review and approve/deny it.

pearl schooner
#

hm.

#

cant find it so it must not be here

#

ill try..

#

doubt it'll work.

#

yep, didnt work.

quasi hearth
#

what didn't work?

#

when your bot gets added, you will get the role bot developer

pearl schooner
#

no the command..

#

new topic : im building a bot from the ground up..

#

what code is good for just a shell bot thing

#

nvm

quasi hearth
#

shell bot?

pearl schooner
#

like.. what should i use rn

#

RIGHT IT DOESNT MATTER

quasi hearth
#

is confused

mental solstice
#

Oh.. youre paying for discord bot maker.. rip

#

Free and easy to make your own bot do the same thing

pearl schooner
#

@mental solstice im trying to use discord.js but i dont rlly know how

sick cloud
#

Try one of them ๐Ÿ‘€

pearl schooner
#

ok

restive silo
#

these both guides will help you thumbsUp but you should still have basic knowledge of Javascript

mental solstice
#

Yeah, i just started aswell. Got quite a bit done the last day or so.. there is an example of a connection.. also check out youtube tutorials.. nodejs discord bot or something

pearl schooner
#

discord bot maker costs 7 pounds..

#

people complain that its too much.

#

but i mean its good for learners

#

for the tool, its worth it i think

sick cloud
#

"Learners" should start with actual code.

#

otherwise they never learn .-.

trim plinth
#

dbm does everything for you

#

it isn't teaching you anything GWqlabsKek

midnight widget
#

Can anyone help we with discord oauth2 apps? Whenever I put in this url it gives me an unkown_error:

https://discordapp.com/oauth2/authorize?client_id=454689258016604160&scope=identify%20guilds&response_type=code&redirect_uri=https://gruppe6bot.com
mental solstice
#

Isnt scope supposed to be numerical?

pearl schooner
#

no

#

it can be scope=bot

#

lemme try da link

trim plinth
#

they're not doing a bot

mental solstice
#

Oh. Was thinking permissions

pearl schooner
#

i think the redirect uri...

delicate zephyr
#

Im helping him

west raptor
#

how would you make ms in to dd/mm/ss format in d.js

sick cloud
#

moment maybe?

trim plinth
#

you could use moment or a lot of js maths

west raptor
#

ok

icy hearth
#

moment-duration-format iirc

uncut slate
#

or literally 6 lines of code

icy hearth
#

that too

quasi hearth
#

I keep getting errors for a new bot im making. The token is correct, but it doesn't seem to work:

UnhandledPromiseRejectionWarning: Error: Incorrect login details 
were provided.```
night imp
#

So @earnest phoenix what do you need?

earnest phoenix
#

nvm, rule is no dm

#

thanks anyways ๐Ÿ˜ƒ

night imp
#

๐Ÿค” could we not solve it here?

earnest phoenix
#

i don't think so.

#

it's not a problem

#

i just need something that i can't do

gritty ice
#

I am looking a bot, which

  • has levelling system
  • uses Python
  • is Open Sourced
#

any one know of any such bot that ifits the criteria?

abstract mango
#

you could look at the old mee6 source
(which is old and not updated, but it may give a example)

gritty ice
#

I went to their account, I didn't see any bot repo ๐Ÿค” I should check again

abstract mango
gritty ice
#

๐Ÿ™๐Ÿฝ thanks a lot tilda

abstract mango
trim plinth
#

m e e 6

sand roost
#

anybody have code for an paged help command
like one with โ—€ and โ–ถ

grizzled isle
#

@sand roost You have to use the event listener, and lets say the help message was an embed. You'd get the message through the reaction, get the embed title, and if it starts with "Commands" (for example) then you can use message.edit({RIchEmbed}) for the next set of commands

sand roost
#

@grizzled isle Yeah ik but was looking if somebody could have given me the code so that I wouldnt have to recode that.

short hemlock
#

Anyone have a way in dart to generate an int excluding a number? like I am using new Random().nextInt(21) is there no other way than doing new Random().nextInt(20) + 1?

halcyon abyss
#

is it a specific number ?