#development

1 messages Β· Page 448 of 1

hardy fiber
#

wait, is 404 it exists but it cant be found, and 400 it just does not exist? Or does this have its own error codes

flint river
#

1 sec

#

"The 400 Bad Request error is an HTTP status code that means that the request you sent to the website server, often something simple like a request to load a web page, was somehow incorrect or corrupted and the server couldn't understand it"

sick cloud
#

400 = bad request = something is probably broken or such

#

yeah

flint river
#

am i allowed to paste code in chat?

#

cause i think i might need a fresh set of eyes on this code

earnest phoenix
#

Yeah.

sick cloud
#

If it's small enough, in a codeblock yes. But use https://hastebin.com if it's bigger than like 8-10 lines.

knotty steeple
#

or over 2k characters GWcmeisterPeepoShrug

flint river
#

it is in python btw

#

i just pasted the repeating section in there that deals with the crap

#

and i think i did so many patchwork bugfixes that the system is starting to fall apart

solid cliff
#

value is empty (value="")

#

you will get a py discord.errors.HTTPException: BAD REQUEST (status code: 400): Invalid Form Body In embed.fields.0.value: This field is required

flint river
#

i

#

want

#

to die

#

i forgot about that bit

knotty steeple
#

does bot.users.size only return cached users? discord.js btw

#

bot or whatever the client is defined as

sick cloud
#

i believe it does, yeah

#

to get all users, you need to like, loop over all guilds memberCount or something

flint river
#

also, for whatever reason, it seems that my search program always skips the second to last page and only post the last third of the page

#

im thinking it might be an issue regarding one of the index counts vs iteration counts

#

nvm, it was due to the first embed post if statement was overwriting the previous embed messages before they were posted

earnest phoenix
#

bot.users.size = length of the internal values as bot.users is a discord collection which extends javascript Map. @knotty steeple

lyric sigil
#

Who might I talk to about getting a bot unmuted? @idle lotus got muted, however we have now fixed the issue. πŸ˜ƒ

static lynx
#
@commands.command(pass_context=True, aliases=["reddit"])
    async def meme(self, ctx):
        accounts = ['dankmemes', 'wholesomememes', 'meirl', 'beeirl', '195'] # embed.set_image(url="{}".format(resp["source"]))
        async with aiohttp.ClientSession(headers={'Accept': 'application/json'}) as session:
            acc = "https://api.reddit.com/r/" + rnd(accounts)
            async with session.get(acc) as get:
                resp = await get.json()
                embed = discord.Embed(colour=0x4286f4)
                embed.set_image(url="{}".format(resp["url"]))
                embed.set_footer(text="{} | :speech_balloon: {}".format(resp["subreddit_name_prefixed"], resp["num_comments"]))
                await self.bot.say(embed=embed)``` @trim saddle
trim saddle
#
  1. ew async
  2. uhhh
static lynx
#

kjhgfd

sick cloud
#

@lyric sigil, talk to an online moderator hint hint, or the moderator that muted the bot.

latent heron
#

so

latent heron
#
await client.change_presence(game = discord.Game(name = "in " + str(len(servers)) + " servers | /help", url = "https://twitch.tv/nope", type= 1))```
#

as we all know in discord.py, are you able to use the change_presence function to specify the change in the bots status. Either for it being Online, Invisible, Do not Disturb, Idle, or Offline are the main ones.

#

However, are you also able to have the bot show streaming as well. If you add this code in, (as well as you must give the link of an existing twitch channel) you will have the bot streaming it along with the name

#

the type numbers go as follows:

  1. streaming
  2. 'listening'
  3. 'watching'
#

all numbers that come after that are able to be used for the status color change for invisible, idle, do not disturb and etc.

#

However (afaik testing wise) only streaming is the only other color able to be changed

slender thistle
#

Uhm

#

Is it supposed to be discord.Game...

latent heron
#

yes

slender thistle
#

Rewrite:

await bot.change_presence(activity=discord.Streaming(name="Just a little test", url = "https://twitch.tv/something"))```
latent heron
#

why

#

discord.Game allows you to change it however

slender thistle
#

Does async do that GWfroggyBlobThonk

latent heron
#

yesssss....? 😟

slender thistle
#

Wait, what exactly are you even trying to do rn?

latent heron
#

it just allows you to change status into streamer mode

#

also i do not have discord.Streaming

slender thistle
#

rewrite

latent heron
#

oh

#

im an idiot my apologies

slender thistle
#

kek

#

So, what about my previous question? :^)

ocean furnace
#

why

latent heron
#

It is just 1 line code that changes the bot status

#

into a streamer mode

#

im not a professional at all, im just sharing my knowledge or if any available πŸ˜„

slender thistle
#

Does it not work?

latent heron
#

not yours mine does

#

i posted it for others to learn off of

slender thistle
#

I quite forgot async since haven' used it for a while

#

Oh

#

Ok

#

I thought you had problems with it GWchadThink

latent heron
#

ah no

#

i was told to shoot it here πŸ˜„

slender thistle
#

Sorry for that GWjiangoNegaLUL

latent heron
#

np

#

i actually do need some help

#

i would love to move away from parsing commands in message() using async and making my own functions for it

#

but i seriously dont know how

slender thistle
#

You use on_message() event for commands?

latent heron
#

yes 😒

#

its embarassing

#

very

slender thistle
#

Commands extension /shrug

latent heron
#

its just a simple split by whitespace thing

#

and checks it

ocean furnace
#

hi

latent heron
#

hi

ocean furnace
#

hi

slender thistle
#

Hi, if you want to chat, move to #general GWchadThink

ocean furnace
slender thistle
#

Yeah well, using commands extension is the way besides using on_message() :p

earnest phoenix
#

little bit stuck, my bot has a warning point system and theres is a command that lets you see the users warning level if they have one but if a user has never been warned and you try to use the command it just sipts an UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'warns' of undefined error, is there a way to make it so this error return to a message saying that the user has no warnings sorry i'm new to this be kind >~<

sinful lotus
#

then why not get the key or check if the user exists in the database of some sort?

#

before doing anything "check if the user do have an warning first then return"

earnest phoenix
#

arr ok i'll gave that a shot thanks

latent heron
#

so

#

im deciding to try and convert over from on_message() command parsing to using my own async defs

#
@client.command(pass_context = True)
async def ping(ctx):
    await client.say("Pong!")```
#

this is as simple as it gets when i want to try a ping

#

but it won't work

#

what have i done wrong?

#

it is still able to parse through on_message() just fine too

slender thistle
#

You forgot to add client.process_commands(message) in your on_message()

latent heron
#

oh

#

thank you

brittle zephyr
#

How do i make reload command for bot?Only for me (@brittle zephyr)

static lynx
#

What lib?

brittle zephyr
#

Discord(python)

slender thistle
#

Which branch?

#

actually... in what sense?

#

Reload cog/extension/module or the bot?

earnest phoenix
#

hey guys were can i get soundcloud Api?

spring ember
#

do you have a code?

#

if yes run it

#

else learn how to code and code and then run it

#

no

#

it will teach you Discord.js which is the framework of Discord in Javascript

karmic parcel
#

a library to connect to Discord using JavaScript

brittle zephyr
#

How do i make reload command for bot?Only for me (@brittle zephyr)
Discord(python)
I need reload bot

restive silo
#

@brittle zephyr dont ghost mention people in here or you will get muted.

brittle zephyr
#

Okay

slender thistle
#

Oh, it was him

brittle zephyr
#

sry (

slender thistle
#

What did you mean by reload

#

Reload cog/extension/module or the bot?

brittle zephyr
#

the bot

slender thistle
brittle zephyr
slender thistle
#

Now I have another question

#

async or rewrite

brittle zephyr
#

async

latent heron
#

rewrite

#

πŸ˜’

latent heron
#

ah

#

you want to make an embed? @brittle zephyr

brittle zephyr
#

yea

latent heron
#

you need an embed

#

is this what you mean?

#

That is what i am using

brittle zephyr
#

yea

latent heron
#

ah alright

#

give me a second to dummy up some code for ya then

#

i recommend reading the docs

slender thistle
#

I sent the link a few messages ago

latent heron
#

^^^

#

check the docs out

#

are you trying to replicate the exact same thing? or just get it to show? @brittle zephyr

brittle zephyr
#

replite.

latent heron
#

oh boy

#

hold on then

slender thistle
#

cough
7. a. Don’t spoon-feed or attack beginners.

latent heron
#

hmm

slender thistle
#

But well, an example is enough, I guess?

latent heron
#

yeah

slender thistle
#

Fucking hell, I am back to mini-modding

latent heron
#

haha

brittle zephyr
#

haha

latent heron
#

question

#

is discord.Colour still carried?

slender thistle
latent heron
#

kewl

#
embed = discord.Embed(
                            title = "Title goes here",
                            description = "Description goes here",
                            colour = discord.Colour([r = 255, g = 0, b = 0])
                    )
                    embed.add_field(
                            name = "Second title goes here",
                            value = "Second description goes here"
                    )
                    await client.say(embed = embed)```
#

@brittle zephyr

#

thats a rough example

brittle zephyr
#

okay thx

#

I'll go testing

latent heron
#

@slender thistle is it done as discord.Colour([0,255,0])?

#

the docs says it can output the colors but 🀷🏼

#

value could be anything

#

could be a hex, could be rgb, yku

slender thistle
#

discord.Colour(r=0, g=255, b=0)? GWcfcThonk

latent heron
#

oh

#

oop

slender thistle
#

Oh wait

latent heron
#

go on

#

well then

slender thistle
#

Eh, rewrite has to_rgb() while async has to_tuple() to return the colors but you have to provide a raw integer value as value in discord.Color(value=X)

#

Sooo

brittle zephyr
slender thistle
#

That doesn't work

latent heron
#

HM

#

try

#

discord.Colour([255,0,0])

#

im sure it will recognize tables just fine

slender thistle
#

I'll just remind you that value parameter is a raw integer value

#

Not a list or tuple

brittle zephyr
#

haha(

slender thistle
#

What the fuck is that indentation

latent heron
#

oh boy

#

how the hell are you supposed to

#

turn it into an integer

#

???

slender thistle
#

Put embed.add_field on the same column as embed = discord.Embed

brittle zephyr
#

OH

#

No

#

So many space(

slender thistle
#

Get raw integer value

latent heron
#

how tho

slender thistle
#

Google

latent heron
#

im i too rarted to know this

#

ok fine

brittle zephyr
#

oh

#

lol

latent heron
#

oh

#

im using ext.commands

brittle zephyr
#

I'm so stupid i think(

slender thistle
#

Do you have rewrite installed

earnest phoenix
#

Should I download .deb or .rpm?

quartz kindle
#

depends on which linux you have

earnest phoenix
#

Uh.

#

I have a chromebook.

quartz kindle
#

i dont think you can install linux packages in chromebook running chromeos

#

you'd have to install linux on it

#

but then again, i've never used a chromebook, i could be wrong

knotty steeple
#

what are you installing

earnest phoenix
#

Visual Studio Code.

knotty steeple
#

there is a community build of it for chromebooks

earnest phoenix
#

Send me link pls/

knotty steeple
earnest phoenix
sullen path
#

o

knotty steeple
#

just follow the steps below

#

the page

earnest phoenix
#

What page

#

Does message.rUser.send correct any1

knotty steeple
#

does anyone know what is your code?

earnest phoenix
night imp
#

well your sending the embed wrong

#

.send({ embed })

earnest phoenix
#

I'm so mad that I'm now using both JavaScript and Phyton...

quartz kindle
#

why are you using both? lmao

earnest phoenix
#

I can't decide which I should use.

sullen path
#

fair

earnest phoenix
#

uuuuuugggggggghhhhhhhhhhhhhh

sullen path
#

flip a coin, assign a language to each side, go with that one

quartz kindle
#

make 2 bots

#

one in each lang

earnest phoenix
#

I'm kinda thinkin' Phyton due to it being in High Demand so a job would be easier to find....

#

But Java is simple

knotty steeple
#

javascript*

#

:(

earnest phoenix
#

im not using gramma'

#

i said java for short

knotty steeple
#

you cant say java short for javascript zoomeyes

ruby dust
#

Java and JavaScript are actual different languages

knotty steeple
#

what he said

earnest phoenix
#

wtf

#

wow.

knotty steeple
#

javascript -> js

#

java -> java

#

πŸ‘€

ruby dust
#

JavaScript is more for website scripting, and Java is a language for... making games with it?

#

Lol

knotty steeple
#

you can also make an operating system with it iirc zoomeyes

quartz kindle
#

java? for games? pffffff

#

look at minecraft

heady zinc
#

java is meant to build applications with

#

javascript isn't

quartz kindle
#

its a giant messy clusterfuck that eats your ram like its nothing, and cant even run shaders without top gpus

earnest phoenix
#

What do you guys use for Discord bots?

quartz kindle
#

javascript

heady zinc
#

that's because the minecraft devs are incompetent

#

java is way more performant than javascript

ruby dust
#

All languages are acceptable for building a discord bot

quartz kindle
#

but java is not designed for games

heady zinc
#

nothing is really designed to make games

quartz kindle
#

java has terrible graphic apis and relies on some weird opengl implementation

heady zinc
#

well except things like gml i guess

ruby dust
#

I was only explaining this because the guy didn't even know what Java is facepalm

quartz kindle
#

java is the most used lang for banking systems

knotty steeple
#

lets bring c# in here mmLol

earnest phoenix
#

JavaScript*

#

C+++?

knotty steeple
#

wat

earnest phoenix
#

i give up

#

ok

knotty steeple
#

there is no C+++ lol

earnest phoenix
#

uh

quartz kindle
#

lmao

earnest phoenix
#

the C language

knotty steeple
#

there is C++

earnest phoenix
#

yea

#

i messsed uppp

knotty steeple
#

C !== C# zoomeyes

earnest phoenix
#

😑

quartz kindle
#

java is similar to the C family, it does many similar things, but it relies too much on the java runtime

earnest phoenix
#

uh

#

I like the HTML format

quartz kindle
#

html is not a language

ruby dust
#

Hrml isnlt a language

earnest phoenix
#

i like it still

ruby dust
#

Nice autocorrect failed on that message

quartz kindle
#

but if you like html, then go for javascript, because they designed to be used together

earnest phoenix
#

ya

#

what do you use html for

quartz kindle
#

websites

knotty steeple
#

make a discord bot with html

earnest phoenix
#

uh

#

ok

uncut slate
#

you easily can

knotty steeple
#

wait discord.js has that webpack thing right?

uncut slate
#

yes

earnest phoenix
#

if i DM a moderator will they get mad

knotty steeple
#

what about a bot in json

uncut slate
#

@earnest phoenix if you have a valid reason to be, no

quartz kindle
#

well, you can write a bot in any thing, but you need something to run it

coral lichen
#

Samurai, I saw a bot coded 75% on json files but other then that it was like d.js or eris

knotty steeple
#

cool

quartz kindle
#

json wont run itself, but you can make something that will read and execute json files

coral lichen
#

If I still remember it was d.js kyarablobsweat

quartz kindle
#

convert code to bson and convert bson to machine code

#

lmao

earnest phoenix
#

how many years did it take y'all to master coding

knotty steeple
#

1/4 years mmLol

#

you dont need much experience to make basic stuff

#

which is what i do

earnest phoenix
#

Me: 1 day

#

no

#

i just started yesterday lmao

quartz kindle
#

you never "master" coding

knotty steeple
#

i started few years ago GWseremePeepoGGERS

#

when i was 9

quartz kindle
#

there is an infinite amount of things to learn

knotty steeple
#

scratch GWqlabsMingLUL

quartz kindle
#

there is over 1000 programming languages

knotty steeple
#

no way

earnest phoenix
#

no

knotty steeple
#

wait

quartz kindle
#

and there is things about one single programming languages that even people with 50 years of experience with it still dont know

earnest phoenix
#

i thought only 6

quartz kindle
#

you cant ever "master" it

#

its a lifetime adventure

knotty steeple
#

no there is way more

earnest phoenix
#

C++, Phyton, JavaScript, Java, & Ruby

knotty steeple
#

sass, assembly

earnest phoenix
#

im so dumb

knotty steeple
#

rust

#

i can name more if i wanted to

quartz kindle
#

just take a look at esolangs :^)

knotty steeple
#

F# GWqlabsMingLUL

quartz kindle
#

brainfuck, chef, lolcode, whitespace

knotty steeple
#

yea lolcode

ruby dust
#

C, C#, C++, Java, JavaScript, Python, Ruby.
All the languages I have in my head

quartz kindle
#

holyC

#

xD

knotty steeple
#

πŸ˜‚

#

dont forget scratch guys

ruby dust
#

scratch is not a programing language to me

earnest phoenix
#

OMG PHYTON OR javascrippt

ruby dust
#

python

knotty steeple
#

javascript mmLol

quartz kindle
#

and even if you stick with only one language for years, you will always be surprised by what it can do

earnest phoenix
#

ok

ruby dust
#

just go python, it's the easiest

knotty steeple
#

sure

earnest phoenix
#

i dont even know anymore

quartz kindle
#

for example, that guy who wrote an animated globe in javascript with like 200 characters

knotty steeple
#

get yourself in a million indentation errors

#

because i dont indent any of my code

ruby dust
#

every good developer start with python to at least learn what programming is even like

knotty steeple
#

its a mess

#

i use a js beautifier most of the time bloblul

ruby dust
#

python enforces indentation because it doesn't have {} or ;

#

pretty much the only reason

quartz kindle
#

take a look

#

at

#

this

ruby dust
#

woah

knotty steeple
#

woahh

ruby dust
#

I can't select anything, it cancels out xd

quartz kindle
#

there are things we dont even imagine the languages we use can do

knotty steeple
#

thats cool

quartz kindle
#

take a look at the source

ruby dust
#

inb4 the main purpose of that site is to secretly grab your ip

quartz kindle
#

lmao

#

that was made in one of those code marathons

earnest phoenix
#

someone hacked my account, that's the first reason i started coding in the first place.

quartz kindle
#

the guy who made it made several presentations on secret tricks with javacript that nobody knows

spring ember
#

DNS GWfroggyPepoSmug

knotty steeple
#

the creator has a decent amount of projects

earnest phoenix
#

i'm getting a bit fluent in html

ruby dust
#

good luck with building most basic sites, I guess

#

cause that's all what html can do

earnest phoenix
#

someone was DMing me to give them answers on SoloLearn...

spring ember
#

Lmao

#

Sololearn is easy and it teaches the super basics of every language

#

That's why I am usually using tutorial point

#

But sololearn has a very good machine learning course

earnest phoenix
#

"I need help with HTML"

#

lmao

knotty steeple
#

@spring ember i used tutorial point to learn how to use express lmao

spring ember
#

Same

#

It is a very good course

knotty steeple
#

i also used it to learn a bit about assembly

knotty steeple
#

tables?

earnest phoenix
#

i'm at tables, i'll check it out

spring ember
#

CSS has become a little redundant

#

Oh wait that's html

earnest phoenix
#

whats css

spring ember
#

@earnest phoenix ?

#

@earnest phoenix if you are not joking it has a course there as well

#

What do you mean

#

What is it used for?

earnest phoenix
#

im doing the html test and i have 2 lives left

#

1 life left

knotty steeple
spring ember
#

@earnest phoenix node.js is a framework for JavaScript that is meant for server side developing

jolly mist
spring ember
#

wait what

#

fake

jolly mist
#

???

#

my is name?? what!

#

how did it happen, tell me please!

hardy fiber
#

I mean, considering there are no {}s in that

#

It Would throw an error, is it in a try statement that you set to say lul

gilded blaze
#

No it wouldn't.

#

It's only one line.

jolly mist
#

???

hardy fiber
#

Ih rught

#

Right*

#

Forgot you can do that, I always include the {}s even in 1 line if statments

gilded blaze
#

I remember seeing an article about how that can be true. It's possible.

uncut slate
#

tldr just eqeqeq

gilded blaze
#

Yes thank you.

plucky fox
#

wh

latent heron
#
@client.command(pass_context = True)
@commands.has_permissions(administrator = True)
async def kick(ctx, user: discord.User): # Kicks the user from the server
        if ctx.message.author.id in id_whitelist:
                print("[GLOBAL] Requesting command '{command}', OK.".format(command = command + ctx.command.name))
                await client.say(str(user) + " has been successfully kicked!")
                await client.kick(user)
        else: # If ID was not in whitelist
                print("[GLOBAL] Requesting command '{command}', BAD.".format(command = ctx.command.name))
                await client.say("The person you tried to kick has a higher role than you, is immune, or does not exist.")```
#

is there a way i can make this any more simplified or shorter

#

i don't like how i format it many times but 🀷🏼

#

also i guess i should get rid of the id checker if i am doing an admin perm check right?

shy verge
#

iirc, f"" enables string interpolation

knotty steeple
#

Whats the difference between using console.log(err) and console.error(err)?

sullen path
#

it's like stdout and stderr

hardy fiber
#

I think console.error formats it different

#

Differently*

knotty steeple
#

stdout and stderr?

slender thistle
#

command + ctx.command.name?

#

What is command in that case

spring ember
#

@knotty steeple that's c++ stuff

#

or c

slender thistle
#

And yes, you should use the Admin permission check but idk why you need whitelist

sullen path
#

it's not C stuff, it's bash/sh

#

linux stuff

latent heron
#

command is a variable i made

#

it is just "/"

#

i would do command_prefix but then it overwrite so

knotty steeple
#

i was trying to run the example code on the canvas npm page but it says Canvas is not a constructor? wat

slender thistle
#

Either f-strings or/and #MoreVariables

#

I also recommend you converting user to discord.Member instead of discord.User GWcfcThonk

jolly mist
#

Why does not send to the channel πŸ”¨bot, I'll say right away, but I'm Russian and fuck, help me!

if (cmd === `${prefix}help`) {

        let helpEmbed = new Discord.RichEmbed()
        
        .setTitle("НуТна ΠΏΠΎΠΌΠΎΡ‰ΡŒ, смотри Π½ΠΈΠΆΠ΅!")
        .setColor("#ffa500")
        .setDescription("m!color - Π£Π·Π½Π°Ρ‚ΡŒ Ρ†Π²Π΅Ρ‚Π° HEX/RGB\nm!ping - ΡƒΠ·Π½Π°Ρ‚ΡŒ Ping Π½Π° сСрвСрС!\nm!idea - Команда для прСдлоТСния ΠΈΠ΄Π΅ΠΈ сСрвСру!")
        let helpchannel = message.guild.channels.find(`name`, "453655872527269888");
        if(!helpchannel) return message.channel.send("ΠžΡ‚ΠΏΡ€Π°Π²Π»Π΅Π½Π½ΠΎ Π² ΠΊΠ°Π½Π°Π» `πŸ”¨bot`");
        message.delete().catch(O_o=>{});
        helpchannel.send(helpEmbed);
    }
knotty steeple
#

your finding the channel by name but using an id

#

you can just use bot.channels.get("channelid")

#

or whatever you have new Discord.Client() as can replace bot

tight aspen
#

Just wondering but do you guys keep statistics of your bot how often certain commands are used etc?

sullen path
#

Add a counter to the command handler

tight aspen
#

Yeah i know how

#

But was wondering if you guys did

heady zinc
#

i was ZoomEyes

#

it's quite useful when you need to know what feature you can discard and what feature is popular

tight aspen
#

Yeahh thats why im thinking about it

minor valve
#

Looking for a bot or someone that could make a simple bot that levels up based on the ranks not the individuals.
That way we could make Red Team, Blue Team, etc get exp.
Ping / DM me! πŸ˜„

earnest phoenix
#

ok

pale glen
#

so

sick cloud
#

@minor valve, wrong channel for that.

pale glen
#

id have to restart the bot

#

which i dont wanna do

#

but

#

message.channel.guild.members

earnest phoenix
#

@pale glen Whats the error?

pale glen
#

works just fine on the other server

#

read above

#

i mean i guess i could and just run it

#

off console

#

@earnest phoenix think im up to it

#

rejection ReferenceError: discordUserId is not defined is what it is

latent heron
#

UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 54-54: Non-BMP character not supported in Tk

#

any ideas?

#

i want the bot to be able to recognize any emoji sent in chat

earnest phoenix
#

What does 'await' outside function mean on python?

latent heron
#

?

quasi marsh
#

You can only use await inside async functions

earnest phoenix
#

Ok

ivory sapphire
#

@latent heron I believe Tk and that can only support unicode characters, and Discord uses some non-unicode characters. There might be a library to help with that, or maybe you can mess with a setting in Tk, I'm not sure

#

In the meantime I'd say just use the

try:
    do_stuff()
except: pass

thing

latent heron
#

alright thanks

#

i'll check out for a library or extension in discord hopefully

ivory sapphire
#

There should be something, maybe something in the discord.Emoji object will help

latent heron
#

alright thanks

ivory sapphire
#

Anytime

latent heron
#

does this mean i could do

#

hmm

#

well i still want to try and get the emoji from the message

#

a way i can parse check discord.Emoji without needing to use context in the message?

ivory sapphire
#

A Message.emoji would be really helpful tbh

latent heron
#

πŸ€”

#

if discord.py server had recommendations channel i would post but

ivory sapphire
#

I'm gonna check if that's coming in 1.0.0 actually, one sec

#

Unfortunately I can't see anything

blazing gorge
#

Can't see what?

deep inlet
#

Anything, duh

blazing gorge
#

Lol

ivory sapphire
#

A way of extracting emojis from Message.content

blazing gorge
#

...

#

What?

ivory sapphire
#

Maybe running it through Message.clean_content would allow you to get the double colon version of the emoji @latent heron? It's discord.py

blazing gorge
#

Oh

latent heron
#

hm

#

well yeah it was either try that

#

or try splitting by : and then find the 2 halves

#

and then sending it again

#

or

#

it was that or i could have my message content split by whitespace and then check for it being in an array

#

does nt work @ivory sapphire

ivory sapphire
#

Maybe

#

Maaayyybe

#

You could split by whitespace, find a way to detect non-unicode charaters, run them into discord.Emoji (I think there's a way of just doing that), then if so, try to get something out of the objects attributes

latent heron
#

yeah

#

discord.Emoji allows to run with str, id, has_colons

#

oh

#

shit

#

my god

#

so

#
args = message.content.split(" ") # Splits by whitespace
        args_char = list(args[0]) # Lists chars in command arg

        if discord.Emoji(has_colons = args_char) == True:
                pass```
#

maybe?

#

sometihng like this?

#

ignore the discord.Emoji aspect but

#

has_colons in the docs specifies as a bool

#

now obviously it would be better to run discord.Emoji with the ext.commands as context but i want it to respond via on_message()

ivory sapphire
#

It's worth a shot

#

I think there's maybe some use out of discord.Emoji.id. So you know when you \ πŸ˜„ it returns it's unicode counterpart? That's the id command for users, so with any luck discord.Emoji.id would return the same thing

#

At the very least you can iterate through emojis on the server, and check their IDs or names against whatever discord returns in the Message.content

latent heron
#

yeah

#

i was thinking doing either doing a list of message content and check that way

#

or by just seeing (if args == ":thonk:")

#

and etc.

ivory sapphire
#

I don't think Discord returns messages with the colon syntax unfortunately

latent heron
#

mhm noo

#

has_colons is boolean

#

and no

#

it doesn't

#

sadly

#

why we really need a message.emoji

#

if args.has_emojis(),

#
await client.send_message(message.channel, i)```
ivory sapphire
#

Exactly! That'd be so useful

#

I guess in the meantime we're limited to unicode emojis :/

latent heron
#

😦

#

tried making a pull request but i had some compare issue

#

im using async

#

hmm

#

very interesting

#

so message.content.emoji could exist

flint river
#

the most important question possible to be asked on this server

#

πŸ‘ˆπŸ‘‰ or πŸ‘‡πŸ‘† or πŸ‘ŽπŸ‘ or πŸ–“πŸ–’ each of them being used for an embed msg interraction go back a page or forward a page

frail harbor
#

β¬… and ➑

flint river
#

i do not explore the emoji library often enough apparently, thanks

sick cloud
#

So eh, I have a basic /commands/ reader, that can have commands in that folder. Is there a way to read commands from additional folders, such as /moderation/ and /help/?

#

Current command loader:

client.commands = new Collection();

const filteredCommands = fs.readdirSync('./commands').filter(_cmd => _cmd.endsWith('.js'));

for (const moduleFile of filteredCommands) {
    try {
        const c = require(`./commands/${moduleFile}`);
        client.commands.set(c.name, c);
        console.log(`+ loaded ${c.name}.js`);
    }
    catch (err) {
        console.log(`- command failed\n${err.stack}`);
    }
}
ivory sapphire
#

The line under try (easiest to reference that way); could that be wrapped in a for loop, iterating through an array of strings?

#

I'm assuming string concatenation like that is possible in that language (JavaScript? -- I don't program in that language if you couldn't tell)

sick cloud
#

uhm

#

i dunno

fossil oriole
#

For nekos.life

lament meteor
#

@fossil oriole you mean u want a random neko command for your bot?

fossil oriole
#

I know how to do that

lament meteor
#

idont think so

fossil oriole
#

So how do I do the random neko command for the foxgirl listing?

#

Actually, it gets better

lament meteor
#

yea

sick cloud
#

looks confusing

lament meteor
#

tbh i dont understand what he/she wants

fossil oriole
#

basically the neko command for the /fox_girl/foxgirl and the /fox_girl/kitsune listings

earnest phoenix
#

What does 'await' outside function on python mean I'm new to this coding stuff

fossil oriole
#

It's also safe to assume it's not a good idea to download all the neko images, either, even if you put a good old "i did not make these"

#

right?

#

neko/foxgirl/kitsune

austere meadow
#

@fossil oriole you could do https://cdn.nekos.life/fox_girl/kitsune_{random number}

#

by constructing a string then making a call to the API with that string

fossil oriole
#

Guess that'd work.

Probably have to put it in a try{} loop as i don't know the uppber bound of the images, and i'd just do a random between 0 and 1000 over and over again....

fluid basin
#

Use the official nekolife library

#

on NPM

#

@fossil oriole

#

telk srry wrong ping

earnest phoenix
#

Who else uses discord.js instead of that uhhhhh discord.py

fluid basin
slender thistle
#

What

wild tide
#

is there any way for a bot to check if a user has a role ID on another guild?

vale harness
#

As long as the bot is on the guild you want to check

wild tide
#

discord.js btw

#

yes, I know that. The bot is on the same server

vale harness
#

I don’t know discord.js but I can provide general information about discord API

#

Can’t u just do it the same way as if it’s the same guild?

wild tide
#

no

vale harness
#

Just get the guild object from the ID and go from there

wild tide
#

hmm

bitter sundial
#

client.guilds.get().members.get()...

lament meteor
#

or like message.guild.roles.get() then check if the user got the role

bitter sundial
#

"on another guild" - the person asking, 2018

earnest phoenix
#

oof

wild tide
#

oof

#

could members be substituted with roles @bitter sundial?

#

on the line you said ^^

austere meadow
#

yes

wild tide
#

okey

#

thanks ❀

bitter sundial
#

you'd get the roles in the server yea

earnest phoenix
#

where do i post meme

sand roost
#

How should I loop through a guildmembers list with d.js?

earnest phoenix
#

Guys

sand roost
#

yea

#

@earnest phoenix

earnest phoenix
#

K thx

lament meteor
#

@sand roost about ur question im also trying to figure out the most efficient way cause for loops will get slow if the bot gets rlly big

sand roost
#

yeah

#

idc about the speed

#

since its only about <50 users

#

@lament meteor

summer narwhal
#

Π΅

karmic parcel
#

UwU, someone suggested my lib zoomEyes

earnest phoenix
#

What does 'await' outside function on python mean I'm new to this coding stuff

night imp
#

Await must be in a function

#

iirc

earnest phoenix
#

Ok

slender thistle
#

outside of function?

earnest phoenix
#

Ya

copper cradle
#

aye boys, hows it going anyway free to help when making a bot on https://discordapp.com/developers I am getting an error which states You are being rate limited. cheers and thanks in advance

earnest phoenix
#

Try refreshing your page

copper cradle
#

same error

#

already did that anyway

#

also with clearing cache

spring ember
#

you probably refreshed too much

frail harbor
#

That means you're requesting too much information in a short amount of time

copper cradle
#

i made like 9 bots

frail harbor
#

Wait 10 minutes and try again

spring ember
#

maybe it is a bug

copper cradle
#

5

#

thats probs why hah

#

xD

frail harbor
spring ember
#

it has nothing to do with the bots you made

frail harbor
#

Read up this

copper cradle
#

ty

#

but like in a short time span..

#

also another offtopicish thing do we have any Discord Bot Developers (freelancers) that are interested in continuing a project if so dm me. (also if this is not allowed im happy to del this message etc)

waxen quest
#

How do I trigger the vote event without voting?

blazing gorge
#

Idk

sick cloud
#

You can't.

spring ember
#

you can test the webhook

#

via the bot edit page

shrewd hedge
#

Guys

#

Wait

#

Wrong channel

#

Sorry

flint river
#

restarts bot after fixing a bug

#

many many errors

#

looks at server title

#

it was being tested

#

loooks at discord after seeing it was tested - and right after sending this first line, it said the bot got approved

#

AnD iT oNlY tOoK 5-6 TrIeS

#

ty eggsy

earnest phoenix
#

i need help

#

how to send my bot guilds size on the shard

#

i get error

blazing gorge
#

Google lol

night imp
#

Please post your error

earnest phoenix
#

@night imp

#

already using port

#

i use 4 shard

gilded blaze
#

Then change the port.

#

You are using.

#

Or find out what is hogging port 5000

earnest phoenix
#

shard 1 is using port

#

and shard 2 is cant use

gilded blaze
#

oh

#

Wouldn't let each shard use a port.

#

Make the main process do the posting.

earnest phoenix
#

hmm

marble arrow
#

about sharding with discord.js, are there any good guides about it? The ones I found only talk about spawning them but dont say much about other methods like broadcastEval, etc.

sick cloud
#

I haven't found any yet, so not that i know of

gilded blaze
#

The docs explain the methods.

marble arrow
#

I see

earnest phoenix
#

i fix it

long forge
#

There an issue with the API right now?

desert bough
#

can bots be playing rich presence games πŸ€”

grizzled isle
#

Yes but they have to be approved by discord.

desert bough
#

ok

grizzled isle
#

If I read all of it correctly.

buoyant oak
#

cuz it doesn't live 24 hours +

sullen path
#

Crontabs.

earnest phoenix
#

henlo whis familiar with discord webhook under d.js HyperThonk

brave lion
#

@frosty sleet Yeam Im pretty sure i got it correct coz i can access the variables properties

#

And its correct

frosty sleet
#

You can access the variables without authorization

brave lion
#
            Global.MeBot = await this.dblApi.GetMeAsync();
            Console.WriteLine(Global.MeBot.PrefixUsed);
            await Global.MeBot.UpdateStatsAsync(21);
#

I can do this without auth?

#

coz

    this.dblApi = new AuthDiscordBotListApi(botDiscordID, botToken);
        ```
frosty sleet
#

Do you use API token or bot discord token?

brave lion
#

bot

#

Ohh shit

frosty sleet
#

You can do some requests without authorization

brave lion
#

I got it wrong here didnt I

frosty sleet
#

Not post request

brave lion
#

1 sec brb

blazing gorge
#

1 second later

brave lion
#

I needed to use the bot token didnt I?

blazing gorge
#

Oh ur back

#

Lol

frosty sleet
#

No. DBL API token

#

You can get it on API page

brave lion
#

Okay thanks @frosty sleet i was using my bot token lol RIP me

frosty sleet
blazing gorge
#

Bot token?

frosty sleet
#

(I am contributing .net api, so soon you will have "has voted" and "isWeekend" methods

#

Even though you can make them yourself

blazing gorge
#

?

#

Vote where tho

frosty sleet
#

?

earnest phoenix
#

damn no one knows ok

blazing gorge
#

Tell meh

#

πŸ˜‚

#

Lol

frosty sleet
#

Has voted already on GitHub, but not sure if it's on NuGet

blazing gorge
#

Ok..

earnest phoenix
#

Vote for DBL i presume

blazing gorge
#

.

frosty sleet
#

If(dbl.HasVoted(User_ID))

earnest phoenix
earnest phoenix
floral leaf
#

hey is bots having an issue connecting to voice channels right now?

blazing gorge
#

Probably

#

Lol

inner jewel
#

yes

split lantern
#

I have first reports of it working again

bright spear
#

yeah its fixed

zenith vector
#

Cool

zenith vector
#

Hi

quartz kindle
#

hi

zenith vector
#

How are you?

quartz kindle
#

im good, btw for normal chat go to #general , unless you have a programming question

zenith vector
#

That's good

#

ElectroCrysZtaL told me to come here for some reason

#

I'm in now what electro

earnest phoenix
#

Go to application

#

Click on create an application

zenith vector
#

Ok now what

earnest phoenix
#

Yeah click on that create an application

zenith vector
#

I did

earnest phoenix
#

Gimme a ss

zenith vector
#

K

#

What does this do again?

earnest phoenix
#

Creates a bot for you

#

to code

zenith vector
#

?

#

Ok

#

What I do now?

pale marsh
#

You basically create an application and convert it to a bot account (there's a button in the application's page that does that)

zenith vector
#

Ok but

earnest phoenix
#

Ye

zenith vector
#

Hold on

#

Brb

#

In a sec

earnest phoenix
#

First, make a name for it

blazing gorge
#

He had to go to bed

#

But

#

I'm here to continue for him

#

We both know each other I'll btw

pale marsh
#

Lol wut?

blazing gorge
#

Andrrw

pale marsh
#

Lol okay

blazing gorge
#

Had to go to bed

pale marsh
#

Yeah got it

blazing gorge
#

He told me to continue

pale marsh
#

Weird though lmao

earnest phoenix
#

What is even happening

pale marsh
#

Idfk

blazing gorge
#

Lol

#

Just continue

earnest phoenix
#

Ok, make a name for the bit

#

bot*

blazing gorge
#

Ok

pale marsh
#

@earnest phoenix good luck mate. I'm out of this πŸ˜‚

earnest phoenix
#

And make a pfp for it

blazing gorge
#

Lemme think of the name

earnest phoenix
#

This will take probably an hour

blazing gorge
pale marsh
#

At least

earnest phoenix
#

And now idk how long will it take 4 u to figure out a name now

blazing gorge
#

IDK what to come up with

#

I'm just gonna do fun bot

#

πŸ˜‚

#

Lol

#

Now what?

earnest phoenix
#

Make a pfp for the bot

#

Just put whatever photo

blazing gorge
#

Ok

#

I'm gonna leave it blank for now

earnest phoenix
#

Ok

blazing gorge
#

Ok

#

Next

earnest phoenix
#

scroll down send me a sa

#

ss*

blazing gorge
#

?

sick cloud
#

go to the bot tab and click create a bot user

blazing gorge
earnest phoenix
#

Ye

blazing gorge
#

Ok

#

So save changes?

sick cloud
#

yes

earnest phoenix
#

Save changes

blazing gorge
#

Ok

sick cloud
#

then go to the bot page

earnest phoenix
#

And click on create a bot user

#

When u scroll down

blazing gorge
#

?

sick cloud
#

add bot

#

the one button on that page

blazing gorge
#

Ok

earnest phoenix
#

Ok

blazing gorge
#

Now what

split lantern
#

Press Copy

blazing gorge
#

I did

split lantern
#

Thats the key to login to your bot

blazing gorge
#

Why I need to copy?

#

Oh ok

#

Gotcha

earnest phoenix
#

Ye

sick cloud
#

the token is like

#

your email password to log the bot in

blazing gorge
#

I sent Andrew the log in

#

Lol

sick cloud
#

don't show anyone

earnest phoenix
#

Dont show anyone the token

split lantern
#

Press regen to get a new one

blazing gorge
#

This is our bot-me and Andrew apparently

#

I did

#

Why tho

pale marsh
#

Just a quick question

#

Do you know any programming languages to begin with?

blazing gorge
#

Ye

split lantern
#

Basically with the token i can do anything with your bot

pale marsh
#

And is the typing thingy broken?!

blazing gorge
#

Nope I am new to all this tbh

#

Wait wat

earnest phoenix
#

I think js is the easiest

blazing gorge
#

My bot πŸ˜‚

split lantern
#

@blazing gorge what are you gonna learn

blazing gorge
#

How to make a bot

pale marsh
#

I think you need to learn a language first then come back in here. Learning by making a bot is not the best idea imho

blazing gorge
#

This is my first time tbh

earnest phoenix
#

Hm

blazing gorge
#

Plasma next time
Say demonic instead

split lantern
#

@blazing gorge language i mean

blazing gorge
#

Boi

#

Idk

#

Lol

pale marsh
#

🀦

split lantern
#

Before making a bot you need to learn the language

earnest phoenix
#

Yeah

split lantern
#

Then u make bot and learn how to use api warper

blazing gorge
#

?

earnest phoenix
#

but now he made a bot .-.

blazing gorge
#

Lol

pale marsh
#

Learn how to use python or nodejs or something

earnest phoenix
blazing gorge
#

Ok

#

I'm on

earnest phoenix
#

@pale marsh this dude is on mobile

pale marsh
#

I noticed...

blazing gorge
#

Shut up

#

If my computer would work I would be on it

#

But no it decided to fucking crashed πŸ˜‚πŸ˜‚

#

I'm on the website

earnest phoenix
#

Ok, were helping you so lets just go straight ahead

blazing gorge
#

Ok

split lantern
#

Well glitch will get your bot banned if setup wrong

earnest phoenix
#

U saw a file called server.js?

blazing gorge
#

I can make other accounts

#

Lol

#

?

split lantern
#

And its not a good dev env

blazing gorge
#

What?

earnest phoenix
#

Send me the sw

#

ss

blazing gorge
#

Ss

earnest phoenix
#

Of the web

#

screenshot

blazing gorge
#

Og

#

Oh

earnest phoenix
#

Go to package.json

blazing gorge
#

Ok

earnest phoenix
#

U saw that?

blazing gorge
#

Hmhm

earnest phoenix
#

Ok

#

click on add package

blazing gorge
#

Ok

earnest phoenix
#

Search up discord.js

blazing gorge
#

Ok

earnest phoenix
#

Search up discord.js

#

and click on the body

blazing gorge
earnest phoenix
#

Click on the first one, but dont click on docs

blazing gorge
#

Which one

#

Ok

earnest phoenix
#

The first one

#

click on the body

blazing gorge
#

I did

earnest phoenix
#

Ok send me the screenshot

blazing gorge
earnest phoenix
#

K good

#

now go to server.js

blazing gorge
#

What happens at the end after I do all steps πŸ˜‚

#

?

earnest phoenix
#

U will see

blazing gorge
#

K

earnest phoenix
#

the bot online

#

you say β€œping” it responds β€œpong”

#

Ok

blazing gorge
#

Hold on

#

Bad image

earnest phoenix
#

delete everything

blazing gorge
#

Delete all?

earnest phoenix
#

Yeah

blazing gorge
#

Including var

split lantern
#

Is spoonfeeding that good

earnest phoenix
#

Those dosent have to do anything

blazing gorge
#

Ok

earnest phoenix
#

Ok

#

on the first line

#

do

blazing gorge
#

:/

earnest phoenix
#

const Discord = require(β€˜discord.js’)

#

first line

split lantern
blazing gorge
#

Ok

earnest phoenix
#

Error

blazing gorge
split lantern
#

This has gone beyond spoonfeeding

blazing gorge
#

?

split lantern
#

Isnt it 'discord.js'

blazing gorge
#

Error? Wtf

split lantern
#

Your ' ' look brokedn

sick cloud
earnest phoenix
#

Ok

blazing gorge
#

....

#

Wat

#

I am now legit confused ATMπŸ˜‚

earnest phoenix
#

Thank you

#

now im finally free

blazing gorge
#

I just went from ok to now confused

split lantern
#

ThatTonybo its not even spoonfeeding anymore
Its worse than that

blazing gorge
#

What I do when I get in there @sick cloud

split lantern
#

Read it

earnest phoenix
#

Yeah

#

I reccomend anidiots guide

blazing gorge
#

Why

split lantern
#

Well my idiots pr did not get accepted yet :)

blazing gorge
#

?

earnest phoenix
#

Ugh i just want to spoonfeed him the gdm code and be free

blazing gorge
#

Boi

split lantern
#

Starboard code is borked af in idiots guide