#development

1 messages · Page 740 of 1

earnest phoenix
#

huh?

#

i'm just asking you to run the process with the arguments in the command line

trail kernel
#

oh

earnest phoenix
#

and see if it outputs something close to mine

trail kernel
#

sec

#

did i do it right

earnest phoenix
#

do you understand how cmd works

trail kernel
#

no

earnest phoenix
#

oh amazing

trail kernel
#

haha

earnest phoenix
#

i won't teach you the basics, you have google for that

you have to run youtube-dl.exe in the location where youtube-dl.exe is located in

#

also remove {} in the args

trail kernel
#

oh

#

yes sorry mb

#

my cmd crashed tho

earnest phoenix
#

it works correctly

#

i don't know why it doesn't pipe to discord

trail kernel
earnest phoenix
#

can you post your entire Program.cs on paste.mod.gg, removing your token if it's in your code

trail kernel
#

ye sec

earnest phoenix
#

i do not know why you're getting a nullref

#

hm

#

it might have something to do with this line client.CreateDirectPCMStream(AudioApplication.Mixed, 96000);

#

and it is

#

you're trying to feed it direct PCM stream which is a nono

#

use CreatePCMStream and AudioApplication.Music

#

there's your problem

trail kernel
#

wait so i dont need the link u sent?

earnest phoenix
#

nope

trail kernel
#

like that?

earnest phoenix
#

remove the 96000 argument

trail kernel
#

oh k

#

it shows the same

earnest phoenix
#

i know

trail kernel
earnest phoenix
#

the error is not from there

#

i can't point my finger at where the error is because your system font is not renderable in cmd

trail kernel
#

so what should i do

earnest phoenix
#

i guess yeah the last thing to try is to try catch in your MessageReceived handler

trail kernel
#

where is it

earnest phoenix
#

lol

#

it's a handler for your MessageReceived event

#

guess

trail kernel
earnest phoenix
#

yes

trail kernel
earnest phoenix
#

what's line 54

trail kernel
#

it was 52 before

#

same line that gives problems

earnest phoenix
#

i don't get how that can nullref

trail kernel
#

😔

#

does anyone else maybe has an idea what could be the issue?

unique nimbus
#

Not a lot of people here used C#

trail kernel
#

so basiaclly my bot will never work?

unique nimbus
#

it will

vital lark
#

can you atleast google ur answer and see if someone already got that problem please

unique nimbus
#

However I personally don't know C# to help

vital lark
#

were not gonna spoonfeed you the basics of the language

trail kernel
#

but thats not the basics

earnest phoenix
#

try to remove the or part which checks for the mention prefix

trail kernel
vital lark
#

you forgot to add a pipe

#

or ||

earnest phoenix
#

by that i also meant to remove the actual method itself

trail kernel
#

hehe

earnest phoenix
#

so you're only left with HasCharPrefix

trail kernel
#

do i run it now

earnest phoenix
#

try to

#

i don't know where else a nullref could come from

#

you literally check is message is null and return if it is so the message can't be

trail kernel
#

ok what the fuck

#

its still not working

earnest phoenix
#

i helped you resolve that part

#

it had no connection to voice

#

i don't get why voice won't stream

#

can you post your updated AudioService**

trail kernel
earnest phoenix
#

remove that starting point

#

you're already starting with youtube-dl.exe

#

you don't need the path to the file in the arguments again

trail kernel
#

still cant hear anything

#

😦

earnest phoenix
#

what's your code now?

trail kernel
#

oh wait

#

ill put

#

a url

#

Arguments = $@"--no-check-certificate -f bestaudio {url} -o - | C:\ffmpeg\bin\ffmpeg.exe -i pipe:0 -f s16le -ar 48000 -ac 2 pipe:1",

#

no sound is being heard

earnest phoenix
#

try adding -hide_banner -loglevel panic after ffmpeg.exe

#

the problem might be that ffmpeg is outputting its configuration which is invalid audio

trail kernel
#

still not working

#

maybe i should change it to just ffmpeg.exe instead of all that c:\....

earnest phoenix
#

it genuinely doesn't matter if you have ffmpeg in the c:/ffmpeg/bin directory

trail kernel
#

i dont know then

earnest phoenix
#

i guess check if ffmpeg is there

trail kernel
earnest phoenix
#

no, in c:/ffmpeg/bin

trail kernel
#

it does

earnest phoenix
#

i don't know then, compare your code to a sample that works

#

i posted one above

#

the sample is obviously for local files

trail kernel
#

alright ill keep working on that tomorrow imma head off to bed now thank you very much for all the help

#

i really dont know how to thank you enough

sick cloud
#

if i have a string which is math (ie. 10/5) how do i take that string and run it to get the result (ie. 2) in python?

earnest phoenix
#

eval if you trust the source

sudden geyser
#

There's the evil eval keyword

earnest phoenix
#

if you don't trust the source i've seen people use pyparsing

slender mountain
#

How am I supposed to interact with functions and variables from one file in another?

I am currently trying something like this:

// main.js
var settings = module.exports = {
    "124153124": { // Guild ID
        "125135134": { // User ID
            //Settings
        }
    }
 }
module.exports = function setUpGame() {
    // content
}

//game.js (command file)
const settings = require("../LDS-Bot.js").settings;
const setUpGame = require("../LDS-Bot.js").setUpGame;
if (message.guild.id in settings) {
    if(message.author.id in settings[message.guild.id]) {
        setUpGame(); //start game
    } else {
        //add to guild
        setUpGame(); //start game
    }
} else {
    //add guild to dictionary and user to guild
    setUpGame(); //start game
}

FYI: setUpGame(); needs to be able to run a function that is in the main.js file.
any help would be appreciated

sick cloud
#

@earnest phoenix python has eval?

knotty steeple
#
eval()
#

wew

#

idk try it

earnest phoenix
knotty steeple
#

py probably has some eval

#

yes

amber fractal
#

@slender mountain do what you just did... export the function and require it in another file

slender mountain
#

what about the dictionary, does that work as well?

modest maple
#

Python does have eval yes

#

You can also turn a string using int()

#

If you want to say divide the number split on the "/" and then int the list

slender mountain
#

@amber fractal currently it throws an error that says: TypeError: Cannot use 'in' operator to search for 'GUILD_ID_HERE' in undefined

amber fractal
#

settings must be undefined then

lament hatch
#

guys i shit and cummed what do fuck fuck time to shoot up some herion

vital lark
sudden geyser
#

that's worse

lament hatch
#

shart teh fuark up poo head

opaque eagle
#

@west raptor

west raptor
#

they already left @opaque eagle

#

nothing i can really do

opaque eagle
#

oh ok

opal halo
lean mortar
#

you could try embeding

earnest phoenix
#

const talkedRecently = new Set();
if (talkedRecently.has(message.author.id)) {
  message.channel.send("You have to wait 1 hour before doing this command again!");
  message.delete();
  return;
}
talkedRecently.add(message.author.id);
setTimeout(() => {
  talkedRecently.delete(message.author.id);
}, 3600000);

  let score = client.getScore.get(message.author.id, 
 message.guild.id);
   if (!score) {
   score = { id: `${message.guild.id}-${message.author.id}`, user: message.author.id, guild: message.guild.id, points: 0 } }
   score.points += randomNumber;
   client.setScore.run(score);
   message.channel.send({embed});
}

I tried making a cooldown for my ~work command but it look like the cooldown dont do anything at all

warm marsh
#

Do you use external commands or all in one file?

earnest phoenix
#

external

warm marsh
#

Okay

#

The variable gets created each time the command is called.

#

You need to pass it through or add it to message or client.

earnest phoenix
#

ohh i c thank u

warm marsh
#

No worries.

earnest phoenix
#

Thank you it work now @warm marsh, I added it into client.Cooldowns = new Set(); so its accessible through other files in my index.js

#

👍

sudden geyser
#

@opal halo consider making a single string or something that resolves into a string and sending it to the user. If you want to be simple, you can use the split option for the 2nd argument. For example:

let cmds = ["BAN: Bans a user", ...];

message.channel.send(cmds.join("\n"));```
#

sending over 18 messages is a horrible alternative

opal halo
#

ikr

#

but is that discord.js?

sudden geyser
#

it can be

#

you just need to edit it to your needs

steel cloak
#

in d.js what would be the best way to keep track of time for like a mute command. like how long the person needs to be muted for and then automatically unmute them?

opal halo
#

download ms

#

it would help

rare tangle
#

Create embed instead

steel cloak
#

wdym?

uncut raven
#

Is anyone here a gfx maker

sudden geyser
#

@steel cloak you should get the milliseconds and store it in case your bot unexpectedly goes offline. Periodically, check if the time has expired (or use a setTimeout) and execute your unmute stuff if it's passed time.

If you're getting time from user input, the ms module is recommended

steel cloak
#

ahh okay thanks so much!! have a good day (or night) 🙂

long lintel
#

._.

valid frigate
#

honestly command cooldowns are probably handled best in a db of some sort

#

but not creating a new document for each command used

#

especially if you want commands that can only periodically be used such as 1 week intervals, then bot restarts won't matter since it's in a db

#

if you have maybe 3-5 second cooldowns on all commands this wouldn't be necessary but would alleviate memory usage if it were in a db

dapper musk
mossy vine
#

isnt that a simple maximum search

#

define an int called max with 0, loop through the elements of the array, if the element is larger than max set it to max, return max afterwards

earnest phoenix
#
let args = message.content.split(' ').slice(1);
if(!args){
let msgchannelid = message.channel.id;
        } else {
        let msgchannelid = args[0].replace(/\D/g,"");
        }
let chn = msgchannelid;
var snc = snipes[chn];

Why is he telling me that msgchannelid is not defined?

#

because it isn't

#

learn how variable scoping works

#

But even in const or var he tells me undefined

#

again

#

learn how variable scoping works

grim aspen
#

because snipes isn't defined, and cry is right

earnest phoenix
#

No

let chn = msgchannelid;

This isn't defined

snipes je defined x)

#

But okay i go To learn

green kestrel
#

does anyone have an example of the post data sent from the voting webhook?

#

im assuming its just a json object within the post body, no form encoding at all

#

yes?

fluid basin
#

isnt it on the docs

green kestrel
#

that bit isnt clear

#

it says "JSON params" but it isnt clear if that json body is within form-encoded params or not, and i cant just do a vote to see

#

as i already voted today.

fluid basin
#

what

#

JSON is json

#

form encoded is form encoded

#

they're 2 separate things

green kestrel
#

not always

#

ive seen apis that do this:

#

JSON={url-encoded-json-object-here}```
#

and, the docs dont indicate a mimetype of the body, so im having to ask

#

for now i'll assume its just a json object in the post body, and that the content type is application/json, e.g. the sensible choice

fluid basin
#

yeah ofc its json

#

I can say that for sure

#

not that weird form encoded format

green kestrel
#

thanks, thats what i wanted to know

fluid basin
#

you could test the webhook

green kestrel
#

what ive learned over the years is never assume an api is sane

fluid basin
#

by going to your bot page and using the testing button

green kestrel
#

does it post a vote?

fluid basin
#

not really sure

green kestrel
#

well, lets find out 🙂

fluid basin
#

its meant for testing

green kestrel
#

yup it does

#

nice

#

now i just need to find a way to give someone this role without having to hack that into my bot

#

brb, time for some light reading... thanks willi123yao

fluid basin
#

np

earnest phoenix
#

:/

trail kernel
#

hello guys

#

i have a problem with my discord bot that i made with c#, everytime i try to put a song, he joins the channel but doesnt play anything... i am using ffmpeg and youtube-dl, does anyone have an idea on what could be the problem?

earnest phoenix
#

@earnest phoenix

sudden geyser
#

@earnest phoenix consider reading about scopes:
https://developer.mozilla.org/en-US/docs/Glossary/Scope

earnest phoenix
#

@sudden geyser thank you weirdsip

glacial mango
#

How do I pick a random file from folder?

earnest phoenix
#

in

#

w h i c h

#

l a n g u a g e

glacial mango
#

js

earnest phoenix
#

use fs.readdir

#

it's going to give you all files inside of the directory

#

from there on it's just randomly picking from an array

glacial mango
#

I searched on google, but I don't know how to use fs.readdir

earnest phoenix
#

first result

glacial mango
#

Yes, but then?

modest maple
#

Learn the programming language before you program a bot

earnest phoenix
#

what but then

#

the docs literally say how to use it lol

trail reef
#

So I’m having trouble with discord.ext tasks (Python). It appears that tasks with code inside that uses await do not start, but tasks that don’t use await inside of them work fine.

    @tasks.loop(hours=3)
    async def activity(self):
        with open("playing.txt", "r") as file:
            playing = file.readlines()
        await self.bot.change_presence(activity=discord.Game(name=choice(playing)))
        print("========== ACTIVITY UPDATED ==========")

This is the task I am trying to make, I have verified that the cog that contains it is loaded and without await self.bot.change...... the task works. But with that included, the task never appears to be started.

green kestrel
#

yay, its done 😄 my bot now auto grants a role on the official server to anyone who votes for it on top.gg 😄

trail reef
#

Cool!

modest maple
#

Right

#

So

#

Why df do you need to create a new event just to change presence

#

Just create a background task from on_ready

trail reef
#

I like to group my code, loops should go in the loops cog, etc...

#

Ig if I can’t find a way to fix it I’ll just do what you said

modest maple
#

You can still put loops in loops cog etc...

trail reef
#

Oh I see what you’re saying

modest maple
#

All you do when creating a background task is run another function on a independent thread

trail reef
#

Could this be done using just discord.ext and discord or would I have to use the threading module?

modest maple
#

You don't use threading with async if you want to live

#

U legit just use what async gives tou

#

Async has a create background task wrapper

#

Which handles running background tasks for you

trail reef
#

So I could just have it triggered on an event like on_ready

modest maple
#

Yh

#

So once on_ready() fires

trail reef
#

K

modest maple
#

Loop.create.background_task(func, arg)

#

Somthing like that

trail reef
#

Thanks!

green kestrel
#

now we'll just have to see if anyone actually votes for the bot to get the role. the bot takes the role away after 24 hours unless you vote again, so...

trail reef
#

After around 45 minutes of unwillingness to read any documentation, I think I got it to work properly!

#

Thx chillfish!

atomic quarry
#

Does anyone know where I put

module.exports = require('./lib/lint/');

this at?

patent prism
#

In a file

restive furnace
#

@atomic quarry whats idea of that?

#

const anything_you_want_to_call_it = require('./lib/lint/<somefile>js'); OR
import anything_you_want_to_call_it from './lib/lint/<somefile>.js'

those are right, and if you want to do for whole directory use, fs.readDir.

earnest phoenix
#

how i do ^say 1 2 3 4 5 6

#

in python ^^

trail reef
#

Say?

#

Do you mean send to a channel?

earnest phoenix
#

ok

steel cloak
#

in d.js on a bots ready event can it get a user in a guild or does it need to cache (or fetch) them or something?

opaque eagle
#

Use Client#fetchUser()

#

It'll use the cache if it's already cached

amber fractal
#

and on master client.users.fetch()

steel cloak
#

ahh okay thanks!

ebon moat
#

@earnest phoenix my father died yesterday :\

earnest phoenix
#

and i need to know that because...?

ebon moat
#

thought it might interest you

#

to know that fact

#

so

#

was it interesting?

earnest phoenix
#

how did you get to that conclusion

#

yes very

#

but i dont care

ebon moat
#

i dont know , my mind works in a mysterious ways

#

oh..

#

u dont care..

#

i see..

#

😭

ocean current
#

you don't need to cry about your father if he never liked you pepega

earnest phoenix
#

Disappears

#

*POUF*

ebon island
#

yeah

earnest phoenix
#

Hello folks 👋 Discord py question:
Any idea why I cant pull a guild-object for any of my guilds, even the ones my bots in 🤔
I'm using client.get_guild(id) @ async on ready (thats a long story), anyways its worked before the update to 1.2.5 which is the strangest part 😦

#

oh and I am connecting using client.run() after initializing the client if that helps

#

I'm able to get user object with client.get_user(id) in the same instance just fine

restive furnace
#

Did you put fetching guilds off from your client settings?

#

And what you are using: (AutoSharded)Client or (AutoSharded)Bot?

earnest phoenix
#

oof that may be that case! I didn't create the client with fetching guilds in mind, i think thats it!

#

and the bot is an autosharded bot*

#

So unfortunately that wasnt the case :/
Here's the relevant script, ill edit it here to make it a bit easier to work with


client=discord.Client()
@client.event
async def on_ready():
    global idd, typ
    this = {}

    this['id'] = idd #$idd is correct
    try:
        server = client.get_guild(idd)
    except Exception as EEE:
        print(f'{"response":"Error! Guild not found!", "error":"{str(EEE)}"}')
        cont = False
        exit(0)

    if server.name == None:  #Failing Here < 
    #Using guild.name to check if not None <
        print(f'{"response":"Guild not found!"}')
        cont = False
        exit(0)
        
    if cont == True:
        try:
            this['name'] = str(server.name) 
            this['owner_id'] = str(server.owner_id)
try:
    client.run(TOKEN)   
except Exception as grrr:
    print('{'+'"fatal_error":'+f'"{grrr}"'+'}')
    sleep(.1)
    exit(0)     
#
-daemon.py", line 63, in on_ready
-    if server.name == None:
-AttributeError: 'NoneType' object has no attribute 'name'
slender mountain
#

Looks to me like server is undefined

#

have you tried logging what server brings back?

earnest phoenix
#

good call, trying now 🙂

#

Ok so server is None, referring to the docs that means "couldn't find guild"

modest maple
#

Just a note for you you can't get a guild object by doing client.get guild on a guild object

#

Client.get_guild is what you use to get the guild object

#

Also you using exist(0) which if I remember right closes python

#

That is baddddd

#

Because if a shard dies the program won't restart and create a new connection

earnest phoenix
#

exit(0) kill the script, the pid is no longer there, it does the job

modest maple
#

I wouldn't advise it

earnest phoenix
#

ok thank you

modest maple
#

Wait nvm

earnest phoenix
#

i'm quite sure my client is the issue, my main bot pulls it just fine, this is a very strange issue 🤔

modest maple
#

There are alot of things I don't like about that code tbh, mostly the use of exit() which you don't need in a async subroutine, secondly your putting client.run(token) in a try and except which is a lil weird seeing that you want it to crash and display the full error on a invlaid token

earnest phoenix
#

ok I will work on that lol

modest maple
#

Overall the error is that it can't find the guild with that Id now I have no idea what you're using for the id but if the bot isn't in the server I don't think it can actually get the guild object

earnest phoenix
#

its for an api btw so it really doesn't need to be coro, ill probs use php for this mess 😩

#

Thats true but i cant even fetch my admin-level servers with this instance

#

this is working @ on_message() just fine: guild = client.get_guild(message.guild.id)

modest maple
#

How r u getting idd ?

earnest phoenix
#

idd = 632649478288965703

modest maple
#

Where is that being assigned?

slender thistle
#

Are you waiting until your bot's internal cache is fully ready

earnest phoenix
#

lets try logging that actually, good call!

#

@slender thistle thats what i'm thinking is the issue

modest maple
#

If it's going off on_ready it should go when internal cache is ready anyway

slender thistle
#

And I mean Client.wait_until_ready

#

Why not try

modest maple
#

Altho message event will start firing instantly on ready should go on cache ready anyway

earnest phoenix
#

ok lets do it 🙂 brb

slender thistle
#

I very highly doubt on_ready is fired when client is FULLY ready

modest maple
#

I just wonder where he's assigning idd

#

If he's making it global in on_ready

#

Where df is the assignment

slender thistle
#

God knows but does that matter in this case

modest maple
#

Yh would explain why he gets a none type error

earnest phoenix
#

idd = the id, just ran that test

modest maple
#

No

#

Where in the code

#

Is it

earnest phoenix
#

thats not nearly all the code 😮

#

lol

modest maple
#

If you Id is being assigned in a subroutine making it a local variable before you are telling it that it's a global var you're gonna get a none type error

slender thistle
#

NoneType error is because you are trying to get a guild your bot is either not in or your cache is drunk at the time of getting the guild

modest maple
#

Or it can't find the guild you given it ¯_(ツ)_/¯

earnest phoenix
#

yea this is madness :/ Most likely its my client, waiting for async def wait_until_ready():
was unseccessful (never fired)

slender thistle
#

What

earnest phoenix
#

so my bot is never ready lol

#

same tbh 😉

slender thistle
#

Did you read the docs on wait_until_ready

modest maple
#

Can you just paste your whole code

#

In hastebin

slender thistle
#

Cool beans

modest maple
#

Lol

#

Idk what your were doing there xD

#

/ demonstrating

#

Mostly concerning about i-love-children

#

XD

slender thistle
#

shh

#

If they did what I basically tried, there would be a NameError, not AttributeError because of None.x

modest maple
#

I'm just thinking he's assigning idd somewhere when it is a local var

#

Seeing that there is no where in the on_ready() event where he assigns it

#

And he only makes it global in there

slender thistle
#

I'll just aggressively shrug it off because python never lies

modest maple
#

If he's got it in on_message or a different subroutine he's got it as a local variable to on_ready

#

Which defualts the var to none

#

And on_ready only fire when discord client and cache are loaded

slender thistle
#

I wouldn't say that's the case

modest maple
#

¯_(ツ)_/¯

modest maple
#

You've made idd global by having it outside any subrutines

slender thistle
#

Ah yes pastebin I can't read because it doesn't work for me

twilit rapids
#

It's 133 lines mmLol

modest maple
#

He's assigned idd at the top of the code outside a subroutine

twilit rapids
modest maple
#

Making it global

earnest phoenix
#

oh snap cont is not defined 😮

slender thistle
#

Uhhh

earnest phoenix
#

is not global*

modest maple
#

He then tells the subrutine on_ready to make the idd global

slender thistle
#

Essentially what I did

modest maple
#

Any var outside a subroutine in python is global by defualt

#

And what ever he's doing is unassigning idd

slender thistle
#

I may look dumb but I'm not that dumb mmulu

modest maple
#

Because global idd should not work if it's already been assigned

slender thistle
modest maple
earnest phoenix
#

just tried ```python
try:
server = client.get_guild(632649478288965703)
except Exception as EEE:

still the same error, i can assure that $idd is not the issue
slender thistle
#

Would you mind doing await client.wait_until_ready() on the first line of the function on_ready

earnest phoenix
#

no prob, trying now 🙂

#

it passed but unfortunately its not the issue 😢 thank you though!

slender thistle
#

Is your idd variable for user ID or server ID

earnest phoenix
#

its my servers id, which the bot is in

#

this is crazy

modest maple
#

What are you even trying Todo with the guild object

earnest phoenix
#

its a lazy attempt to create an api that fetches user/guild info, simply by supplying user/guild id's. For private use only as that would be against tos to create a public api hook

modest maple
#

Why does that need to be on_ready then

earnest phoenix
#

tbh it doesn't, my next move is to take a lower level approach. Not too big of a deal as we currently use php for discord 0auth2 and its worked decent

slender thistle
#

Have you tried logging idd and its type right before get_guild

modest maple
#

When in doubt slap a print statement

earnest phoenix
#

yes 🙂 printed directly before/after and both came back as expected

modest maple
#

Which is?

earnest phoenix
#

idd = 632649478288965703 # for testing

#

always returned as such

#

i even tried client.get_guild(632649478288965703)

modest maple
#

Which gives you and error?

earnest phoenix
#

yea there seems to be a low-level issue somewhere else

modest maple
#

Personally I don't get why it needs to be in on_ready

#

Saying that it should still work

earnest phoenix
#

no you're absolutely right, client.run isnt good for 1 shot scripts, it shouldn't even involve a loop tbh

modest maple
#

I did it

#

You're using get_user not guild?

earnest phoenix
#

no thats fine that works as it should

modest maple
#

Where df is the guild system then

#

Wait found it

earnest phoenix
#

line 59 is the bad boi

#

its cursed I swear

restive furnace
#

im trying to make array inside array is it possible, because im working w queue system and if (songs_q.find(msg.guild.id)) boolStat = true; it says TypeError: 264445053596991498 is not a function
and i tried with has but then it said has is not function.
defining line: let songs_q = [];

#

(in js)

warm marsh
#

Find takes a query function.

#

<Array>.find(element => element === "query")

earnest phoenix
#
if (message.content.includes(message.mentions.users.first())) {
    let mentioned = client.afk.get(message.mentions.users.first().id);
    if (mentioned) message.channel.send(new Discord.RichEmbed()
                                       .setTitle(`${mentioned.usertag} is currently afk.`)
                                       .setDescription(mentioned.reason)
                                       .setColor("BLURPLE"));
  }```
#

Is there anything wrong with this?

slender thistle
#

what is client.afk

warm marsh
#

A map, collection and or some kind of sqlite db by its looks.

pliant adder
#

no client.afk is a map in this situation

slim heart
#

As far as regex is involved it doesn’t matter if I just take and exec user entered regex correct?
Like is there anything I have to worry about that’ll screw up my server or nothing like that?

#

(And yes after ensuring that the regex is actually valid)

green kestrel
#

it does matter.

#

a malicious regex can kill your bot

#

or maybe even your whole virtual machine if you havent set memory/cpu limits

#

its one of the many attacks i have had to put checks in for within duktape in my own bot

warm marsh
#

It's called ReDoS or something.

green kestrel
#

you can do things like malicious backreferences

#

yeah

#

The regular expression denial of service (ReDoS)
is an algorithmic complexity attack that produces a denial-of-service by providing a regular expression that takes a very long time to evaluate. The attack exploits the fact that most regular expression implementations have exp...

#

read those and understand them and your bot will be a ton more secure @slim heart

slim heart
#

Is there a package or something I can just use to ensure it’s nothing bad lol

warm marsh
#

You could just not implement it.

#

What's the purpose of the regex anyway?

slim heart
#

I’m going to be adding a premium feature to my censor bot that accepted regex in server filter

#

It’ll be a big helpful addition

amber fractal
#

If they know regex, chances are they can make their own bot for a filter

warm marsh
#

Make your own "regex".

slim heart
#

Yes

green kestrel
#

@slim heart if youre in full control of the interpreter of the regex you can put a timeout on its loop

#

thats what i was able to do, usually in js itself you cant do that

#

if you'd like to brainstorm ideas, i think you and i are writing similar things

slim heart
#

@amber fractal close to 300 people have asked for it. It’s not like they’re all gonna be regex masters coming into it however the amount of customization that comes with it would be amazing, because regex is really simple to just look up what u need with it. Like it’ll take 2 seconds for a normal user to figure out how to add a .
And then they can use it

green kestrel
#

the risk is from people who dont know what theyre doing

compact oriole
#

you can learn regex but making a bot is much more complex lol

green kestrel
#

not actively malicious, although theyre a threat too

#

its too easy to accidentally write an evil regex

#

like (a+)*{50}

#

that'd kill your bot stuck at 100% cpu the first time someone says "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah!"

#

that gets worse if you try and separate it into a thread

#

because that thread gets stuck, and then they start another... and another...

#

i had to submit a pr to the people who made the js interpreter i use to prevent the problem

slim heart
#

Not too sure really

late hill
#

@earnest phoenix why are you checking if the message content includes the mention?

#

I'm pretty sure that would call toString() on the user object

#

Which in discord.js would be the mention in the form of <@userid>

#

Which in discord.js would be the mention in the form of <@userid>

#

Which in discord.js would be the mention in the form of <@userid>

#

Which means your code probably won't work if the user has a nickname because those mentions show up as !@userid or <@!userid> , don't know anymore.

#

Anyway, that check is pointless?

#

Just check if there's a mention or not.

#

Just check if there's a mention or not.

earnest phoenix
#

What do you mean by “Which means your code probably won't work if the user has a nickname because those mentions show up as !@userid or <@!userid> , don't know anymore.”

amber fractal
#

@compact oriole A bot isnt really complex. In fact, I can make a bot turn on in like 5 minutes I still don't know everything I can do with regex

compact oriole
#

With configurable regex checks and moderation

#

Lol

#

No-one can

#

And a web dashboard

amber fractal
#

I said make it turn on

#

Then checking message content against a filter is also simple.

compact oriole
#

Yea, but turning it on doesnt accomplish the regex stuff

#

Can you change the filter automatically

#

For any server

amber fractal
#

That has nothing to do. With anything

compact oriole
#

If you want to change the regex, can your 5 minute bot do it?

#

Maybe they never have coded

#

They would have to learn coding

amber fractal
#

If people pay for a regex addition, then making their own bot specifically for their server then it takes a lot less time

compact oriole
#

Then discord.js

#

Then regex

#

When hes bot handles other stuff

amber fractal
#

I said nothing about what his bot can and cant do

#

Im saying making a bot is easier than regex

compact oriole
#

But you said "WhY cOuLdNt yOu JuSt CoDe YoUr OwN bOt"

#

and no it isnt

#

learning coding, js, discordjs and regex combined > regex

restive furnace
#

btw what regex stands for? (lol, i dont rly know)

amber fractal
#

Regular expression

restive furnace
#

kk

amber fractal
#

Tell me how js is complicated

#

Advanced stuff is

compact oriole
#

Its complicated when you have never coded

amber fractal
#

You don't need anything advanced to check against a filter

compact oriole
#

Why would people with 0 coding skills make a bot

#

When they could use his regex thing

amber fractal
#

And regex is mpre complicated of you've never used it.

#

Because it's literally saving money.

compact oriole
#

Lol ur delusional

restive furnace
#

js is complicated, if you want professional bot.

compact oriole
#

Learning a new skill like coding isnt that efficent

restive furnace
#

js is easy, if copy paste.

compact oriole
#

Just pay the premium and thats it

amber fractal
#

What do you mean it isnt efficient

#

Prigrammers make super high pats and are in high demand

#

It's one of the most efficient career paths

compact oriole
#

Its easier to pay a small fine than learn tens of hours to code

#

Everybody doesnt know how to code

amber fractal
#

And it's almost entirely self teachable.

compact oriole
#

It doesnt happen in hours lol

amber fractal
#

So learn, save money, and make money

#

You open so many options when you.learn skills.

#

And it will be way worth it in the long run

restive furnace
#

I never had js lessons xD (it took 1y and 2m to fully understood js)

compact oriole
#

But why would someone want to learn a skill for one simple thing

west raptor
#

if it's one simple thing why not

compact oriole
#

When you can have it better

amber fractal
#

one simple thing

#

simple

restive furnace
#

Actually, it isnt simple, when you start making advenced things for your bot.

#

but until that, it is simple.

compact oriole
#

It isnt simple to learn to code

west raptor
#

it's really not that hard honestly

compact oriole
#

Scratch is easy, theres a reason it cant do that much

west raptor
#

once you grasp the basic concepts it gets so much easier

#

and people that want to code should be willing to do that

restive furnace
#

Its actually pretty easy to understand coding language, if you had ever coded w another lang than js. (not visual lang)

west raptor
#

it's easy to understand what's going on with any basic programming knowledge

#

will understand everything it's doing? probably not

#

but you can follow along

amber fractal
#

I was just trying to argue that paying for a regex addition to a filter isn't worth the simplicity of learning to make your own bot (only with the capability of checking against a filter nothing else) with the regex filtering capability.

restive furnace
#

(you can use google too)

west raptor
#

I agree @amber fractal

green kestrel
#

there we go, ive altered my description to tell people about the special perk they get on the support guild by voting

#

if only the system i made for that was more generic, i'd be happy to share it

slim heart
#

@amber fractal the way my bot work is really efficient and really effective as well. I’d argue it’s likely better but also like there’s other features that’d be complicated if not dumb to try and implement into another separate bot. Hosting is another issue. I don’t think it’s really fair to say that just because a feature is niche or complicated that it just shouldn’t be added lmao

green kestrel
#

@slim heart are you going down the customisable behaviour route too?

sick cloud
#

it's made in python

slim heart
#

@green kestrel I honestly don’t know what to do. I’m not even able to reproduce a catastrophic backtrack as claimed

green kestrel
#

its a thing, best thing to do is avoid letting users do regexes

#

unless you can be sure you can set a time limit and ram limit on them

slim heart
#

Again i can’t even reproduce a ReDoS

green kestrel
#

what language are you using?

slim heart
#

Js

#

Like I tried the (a+)+ on a bunch of a’s with a ! At the end and it just returns as expected

green kestrel
#

try and eval this

#
'aaaa'.split(/a+b?c*/g);```
slim heart
#

I just get [“”, “”]

green kestrel
#

ok, sec

slim heart
#

I’m trying a bunch of other ones on the wiki and long ones take a few milliseconds longer but it just returns null

green kestrel
#
if (/^([a-zA-Z0-9]+\s?)+$/.test("no u aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!") && /^([a-zA-Z0-9]+\s?)+$/.test("no u aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!") && /^([a-zA-Z0-9]+\s?)+$/.test("no u aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!") && /^([a-zA-Z0-9]+\s?)+$/.test("no u aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!")){
    console.log("looped");
   }```
#

i think that may work.

#

without proper limits in place, that can kill my bot

#

each one takes several seconds to execute

#

someone put it into a js handler on message create to see what would happen, only difference was they had the constants as message.content, and console.log as a create_message

slim heart
#

I mean that wouldn’t be a realistic scenario would it

green kestrel
#

in my case yes it can be

#

i dont just allow regexes, i allow custom code

#

so, someone literally put that in there

slim heart
#

I loop through every thing in an array make it a regex and match it against a single word

#

Plan would be to allow them to enter in their own regex and it’d just add it to the array

amber fractal
#

I didn't say it was bad or ineffective, it isn't; it's more features. However, I said I don't understand why anyone would pay

sudden geyser
#

4 separate regex checks in a single if akariThink

west raptor
#

it's the same regex

#

and the same check

surreal sage
#

heyo what to do at "client" in js const dbl = new DBL('Your top.gg token', client);

west raptor
#

passing in your discord client

surreal sage
#

ok

slender thistle
#

or ignore that if you don't want dblapi.js to post your server count automatically

surreal sage
#

well, they should update the example on the docs then with 'client id'

west raptor
#

it's not tho

slender thistle
#

It's the client object

#

not its ID

surreal sage
west raptor
#

np

#

no

#

your client object the main discord client

#

the client you are logging in with

surreal sage
#

client token? cuz im new to this thing

west raptor
#

sigh

#

no

surreal sage
#

where can i find it

mossy vine
#

you have a line somewhere with const botorsomething = new Discord.Client()

slender thistle
#

What are you using to sign into Discord through your bot

mossy vine
#

whatever you have instead of botorsomething, pass that variable

surreal sage
#

ohh

#

i see

#

nup

#

error

mossy vine
#

oh god

#

did you actually write botorsomething

surreal sage
#

no

slender thistle
#

We're off to a great start, gentlemen

mossy vine
#

thenw hat

slender thistle
#

Show your code

surreal sage
amber fractal
#

Then it's client

west raptor
#

show the error

amber fractal
#

And you have to make sure it's in scope.

surreal sage
#

ok wait

mossy vine
#

and what is the error you are getting

surreal sage
#

im sending

west raptor
#

it's not that hard

surreal sage
#

it is with bad internet

west raptor
#

then how are you sending messages now

surreal sage
#

there it is

west raptor
#

could've just copy and pasted the error

surreal sage
#

its on a alternative laptop/pc

amber fractal
#

Cant use client before it's defined

surreal sage
#

yep

#

opp

#

i tried again

#

to upload

amber fractal
#

Define dbl after client

surreal sage
#

later on but bad internet

mossy vine
#

move the const dbl line below the const client line

amber fractal
#

You cant use client before it exists

surreal sage
#

works

restive furnace
#

@surreal sage btw why u censor ffmpeg and fs?

surreal sage
#

idk

west raptor
#

they censored their token

surreal sage
#

*** i like to ****

west raptor
#

oh wait

#

the second image

#

lol

surreal sage
#

no late thing

#

bad internet

#

fuck it

restive furnace
#

You only need to censor your token, and some important things/passwords, not modules.

#
  • If you're complaining about bad internet, why not get better one? :D
west raptor
#

because not everyone can afford it?

restive furnace
#

Hmm... true

surreal sage
#

we did it

#

we buyed

#

we had to wait some months

#

dutch so its dutch

#

it shal be last month but "no"

restive furnace
#

buyed = bought, shal = shall

surreal sage
#

ok i hate these words

storm thistle
#

How to create a IGN webhook so that it posts in a discord channel?

sterile minnow
restive furnace
#

css

compact oriole
#

^

raven axle
#

When I wan't my bot to send an animated emoji is it the same way to do it with a non animated one?

restive furnace
#

no

#

<a:name:id>

slender thistle
#

:ablobbongocatpat:

#

What a disappointment

raven axle
#

oh okay, thx

restive furnace
#

:200iq:

trail reef
#

Oh god my page looks like hot garbage in dark mode

earnest phoenix
#

Same

trail reef
#

Is there a selector or something for it?

earnest phoenix
#

I want to make a music bot. How to do that? (tutorials sucks)

trail reef
#

What language?

earnest phoenix
#

js

restive furnace
#

Google -> Lavalink

#

All advenced tutorials = 💩

trail reef
#

Idrk js, sorry

grizzled raven
#

is there any ratelimit to adding reactions to messages?

mossy vine
#

1/.25s i think

#

should be pinned

grizzled raven
#

ok

sterile minnow
#

Can someone explain me in voice how 2 use css in bot page?

sudden geyser
#

TheNoob don't trust the pinned message for ratelimit times

#

Discord can change the time whenever they want; they recommend your library handles ratelimits

#

if you want to pause, maybe give it 2 seconds

slender thistle
#

one request per second has worked with me for everything so far

#

So 1-1.5 delay might be good

floral stone
#

How to do a 2x2 field field when doing embed. Here's my code: ```python
def embed_start(self, user, msgid):
data = self.bj[msgid]
embed = discord.Embed(
title="BlackJack", color=14629377)
embed.set_thumbnail(url=self.bot.user.avatar_url)
embed.add_field(name="How to Play", value="In order in to win, you have to get 21 or less.......................................... ", inline=False)

    mycards_string = self.get_cards_string(data[2])
    botcards_string = self.get_cards_string(data[3])
    embed.add_field(name="{}'s Cards".format(user.display_name), value=mycards_string, inline=True)
    embed.add_field(name="{}'s Score".format(user.display_name), value="**{}**".format(data[4][1]), inline=True)
    
    #embed.add_field(name="How to Play", value="In order in to win, you have to get 21 or less. ", inline=False)
    #embed.remove_field(3)

    embed.add_field(name="Opponent Cards", value=botcards_string, inline=False)
    embed.add_field(name="Opponent Score", value="**{}**".format(data[4][1]), inline=True)


    return embed
#

I'm trying to get the opponent score on one row, and the players score on another.

grizzled raven
#

you cant really

#

well you can, but it wont be consistent

#

as not all people will see the embed have inlins

#

wait

#

stupid me

#

sorry

#

add a blank field after p1's score that isnt inline

#

then make opponent's cards inline

#

along with score

amber fractal
#

No point in making a game if the opponent can see your cards

#

And vice versa

late hill
#

Yes

#

But it's blackjack

#

Meaning the opponent would be the dealer

#

Also, if you use the blank field method up above.. The blank field will still be there as in it'll take up space, there'll be a huge gap between your 2 lines of fields
It still won't look great

restive furnace
#

Just, dont use inline.

sudden geyser
#

Not using inline fields 🤢

#

Sometimes they can look good (e.g. displaying small info) but too compact.

restive furnace
#

/n gang

#

or just use fields but not inline

trail reef
#

/n lol

#

\n

#

\uFEFF gang

earnest phoenix
#

What's wrong

#

I'm new

mossy vine
#

any errors?

earnest phoenix
#

Bot is not responding

#

Bot is online

restive furnace
#

firstly firmat your cide

#
  • make message.content to message.startsWith
#
  • wrongly used embed
#

.addField needs to be used in like this .addField(name, value, inline?)

earnest phoenix
#

message.startsWith would be incorrect

#

you call it on .content, not the message itself

sudden geyser
#

Adding a value is optional i believe. It's set to undefined to my knowledge

#

The problem is you don't actually pass a function for the 2nd arg of the listener

#

Notice how it's closed after the "message" string for the .on method.

earnest phoenix
#

value is not optional

sudden geyser
#

It's optional for me, but I don't know if that's a difference in versions as I'm on master. All I remember them changing is the name.

earnest phoenix
#

still not optional on master MegaThonk

sudden geyser
sudden geyser
#

They re-assign it with Util.resolveString. If no value is passed, it returns "undefined". Only an empty string will throw as the string's contents is "undefined".

#

Anyway that's not the point of this

cobalt mesa
#

is it normal that the code of this embed works on my servers but not on discord bot list? please mention me if you have a solution

        .setAuthor(message.guild.owner.user.tag, message.guild.owner.user.avatarURL)
        .setTitle("Information à propos du serveur")
        .setThumbnail(bot.user.avatarURL)
        .setColor('#' + Math.floor(Math.random() * 16777215).toString(16))
        .addField("Nom du serveur", message.guild.name)
        .addField("Nombre de membres sur le serveur", message.guild.memberCount)
        .addField("Nombres de bots", message.guild.members.filter(member => member.user.bot).size)
        .addField("Nombres de personnes connecté (hors bots)", message.guild.members.filter(member => !member.user.bot && member.presence.status === 'online' || member.presence.status === 'dnd' || member.presence.status === 'idle').size)
        .addBlankField()
        .addField("Propriétaire du serveur", message.guild.owner.user.tag)
        .addField("Date de création du serveur", createdDate)
sudden geyser
#

Larger servers may different conditions like uncached users (e.g. server owner is null/undefined).

cobalt mesa
#

the lines that pose problems are the 1st and the last

sudden geyser
#

Are you getting an error?

cobalt mesa
#

yes the error is Cannot read property 'user' of undefined

#

what does it mean cached users? @sudden geyser

sudden geyser
#

Users you have saved in your collections

#

for example: If you evaluated the member count with message.guild.members.size and message.guild.memberCount, they'd likely be different if you don't fetch all users.

cobalt mesa
#

and how fetch all users ?? like the owner of the server for example

quartz kindle
#

you can enable fetchAllMembers in your client options

#

but keep in mind that this will increase memory usage and startup time

prime cliff
#

Most libs have a function to download all members for a certain guild too

cobalt mesa
#

it's not a problem

late hill
#

Or just fetch the owner if that's all you need

sudden geyser
#

or you could use the fetch method to get a single member which is faster (depends on if your'e on master or stable)

#

me too slow saddo

cobalt mesa
#

@quartz kindle have you got an example to enable fetchAllMembers in the client options ??

prime cliff
#

Read the docs

quartz kindle
#

you know how you initialize the client?

#

let client = new Discord.Client()

#

you can add options to it

#

Client({option:value})

cobalt mesa
#

ah ok i didn't know

quartz kindle
#

this is the list of options you can add on djs v11

cobalt mesa
#

ok thanks

#

but otherwise there is no other way just by changing what's in the embed?

quartz kindle
#

the client option is to enable caching all members

#

which means, all servers and all users and all members will always be cached

#

else the bot will only cache users who are online

#

but you can manually cache users when you need them

#

using fetchMember or fetchUser (in v11)

cobalt mesa
#

ah ok

#

thanks

#

fetchUser can fetch only the owner ??

quartz kindle
#

yes

cobalt mesa
#

oh ok thanks

#

if i put the fetchAllMembers option in the client, will i need to change the embed or not?

quartz kindle
#

no

cobalt mesa
#

i change the embeds only if i use the fetchUser ?

quartz kindle
#

yes

cobalt mesa
#

ok thank you very much

earnest phoenix
#

*help

modest maple
#

ok

surreal sage
#

howtodoascriptsoachatgetssyncedtoaotherserverwithwebhook

modest maple
#

learn to use a space bar then ask

trail reef
#

^

earnest phoenix
#

donotdothatyou'llgetratelimited

surreal sage
#

sry

#

how to do a script to let a chat be synced to a other server with a webhook

trail reef
#

with a webhook

#

no.

surreal sage
#

.....

trail reef
#

If you are really set on doing this

earnest phoenix
#

webhooks are incapable of receiving messages

trail reef
#

^

surreal sage
#

a bot can

trail reef
#

sigh

modest maple
#

thats not a webhook

earnest phoenix
#

but you said a webhook

surreal sage
#

what if a bot reads it and sends it

#

i do

earnest phoenix
#

learn how to ask questions

surreal sage
#

bots can send webhooks roght

#

right

earnest phoenix
#

well

#

no

#

learn how to speak english

trail reef
#

^

surreal sage
#

im Dutch stfu

earnest phoenix
#

roght isn't a english word

#

i'm croatian but here i am speaking fluent english

modest maple
#

id advise learning what webhooks and api's r first

earnest phoenix
#

a webhook is not a bot and a bot is not a webhook, however a bot can create a webhook

surreal sage
#

r

modest maple
#

cuz seems to me you want to make a bot webhook with a bot?

surreal sage
#

no

#

the bots send a message thru a webhook

earnest phoenix
#

that's not how it works

surreal sage
#

OKAY

#

oops

#

sry

earnest phoenix
#

webhooks are isolated, a thing of their own

surreal sage
#

ok...... 👃

earnest phoenix
#

what

surreal sage
#

thats a nose

earnest phoenix
#

i'm aware

#

what's the point of it being there

#

i think that's what you need

trail reef
#

lol

earnest phoenix
#

i believe you use discord.js

modest maple
#

@earnest phoenix stop randomly staring every little thing

earnest phoenix
#

i jk

#

that method returns a promise so resolve that and use Webhook#send

#

what you're probably thinking of doing is getting a message through a bot's event and then piping it through a webhook, however a bot can't make a webhook say something, you have a webhook client of it's own that'll help you do that

since webhooks are linked to only one channel, you can directly make a request to the api with its id and token and it will send a message to that channel

#

but bot != webhook

#

be warned that having two different text channels linked and piping messages through only one bot/webhook will often lead to a ratelimit

peak bloom
#

that's kinda misleading, afaik many discord libs let you execute webhooks via bot context, theres not that much difference as its just another API request though not authenticated with your bot's token

earnest phoenix
#

uh

peak bloom
#

far from needing a separate "webhook client"

earnest phoenix
#

well

#

no

#

every lib is indeed different

#

but the native and only possible way is to make a request to the endpoint with your webhook's id and token

#

which, if some libs let you execute webhooks from a bot, they do exactly that in the background

peak bloom
#

via discord.js you simply get a webhook object and call send on it as if it were a channel or user

#

just saying that specifying "a bot can't make a webhook say something" is a bit misleading as from the devs perspective they do exactly that in a one-liner

earnest phoenix
#

the lib is at fault

#

not every lib is the same

lone lintel
#

!invite

trail reef
#

first

peak bloom
#

at fault? that seems excessive

earnest phoenix
#

and discord.js does a lot of things for the end user because most of the userbase are 9 year olds who can't comprehend with multiplying

peak bloom
#

right, well i use eris which has just a client.executeWebhook

#

it's pretty much the same from my perspective

earnest phoenix
#

again, every lib is indeed different

#

but a bot doesn't execute the webhook

#

saying that it can is incorrect

peak bloom
#

a bot user doesn't, but a bot user doesn't do anything

#

the "bot" is the program controlling the bot user

#

so really a bot totally does execute the webhook if we're being pedantic

earnest phoenix
#

the only thing you do with your bot is get the webhooks, when you get your webhooks you have the access to its id and token, which means you can make requests with the webhook

lone lintel
#

!link

trail reef
#

lmao still

earnest phoenix
peak bloom
#

yeh, that's all true, just again think it's not a useful distinction to make nor is it helpful to the user seeking to do that with discord.js

#

at best you can specify "you may think to receive a message and send it to the webhook and you can do exactly that it just won't be authenticated with the bot token" which doesn't really throw any wrenches into the original plan lol

atomic quarry
modest maple
#

this is what happens when you copy and paste code

atomic quarry
#

I didn't copy and paste

grim aspen
#

are you getting any errors?

atomic quarry
#

Well the log shows a bunch of stuff when I try the command want to see it?

modest maple
#

i do not believe that you went through and commented on every part of the code with instructions on whats going on

earnest phoenix
#

yeah I looked through it, that's copy pasted from a tutorial iirc

modest maple
#

yh

#

ive seen the same code from someone else or a couple people actually

unique nimbus
#

it is commented a lot

atomic quarry
#

@modest maple I can share my screen if you want to see what it says

unique nimbus
#

found it

earnest phoenix
#

lmao

unique nimbus
#

specifically

earnest phoenix
#

he's writing a new client.on message for each command

modest maple
#

this is why we dont C+P code

#

when you have no idea how it works

unique nimbus
#

yes

#

Zach what is the error

atomic quarry
#

So before I run the command it says this

Promise { <pending> }
Bot has started, with 120 users, in 86 channels of 2 guilds.

unique nimbus
#

yes

atomic quarry
#

and after I run the code

unique nimbus
#

when you run it

#

what do you get

#

run the code

atomic quarry
grim aspen
#

command is not defined

unique nimbus
#

yes

earnest phoenix
#

learn basic js before trying to make a bot in js please

modest maple
#

👏 watch 👏 a 👏 tutorial 👏 Learn 👏 JS 👏 Read 👏 the 👏 docs 👏

#

thats how u fix ur error

unique nimbus
#

Reading the docs helped me

atomic quarry
#

Look I just need help with separating the damn commands

unique nimbus
#

Zach

#

Do you know JS

modest maple
#

LEARN JS FIRST

unique nimbus
#

Yes or no

earnest phoenix
#

help yourself by learning js

modest maple
#

then come back to us

earnest phoenix
#

they dont

unique nimbus
#

I know they copied pasted

modest maple
#

and maybe if you didnt copy and paste

#

you wouldnt have this issue

#

cuz you would understand your own code

earnest phoenix
#

If you are going to copy and paste which I dont recommend actually read through the code and see how it works

modest maple
#

not trying to understand someone else's way of coding

atomic quarry
#

@earnest phoenix Well maybe if my school had a damn coding class I wouldn't even be in this damn server

modest maple
#

maybe if you actually learnt JS first

#

instead of jumping into a big lib

earnest phoenix
#

well why are you attempting to make a bot with a language that you don't even know ?

modest maple
#

you wouldnt have this issue

earnest phoenix
#

start with something more basic than a bot

modest maple
#

like printing hello world

#

xD

earnest phoenix
#

^

#

i don't think it's a school's fault, how would they know people want to make a discord bot?

atomic quarry
#

I hate to tell you but my school is the smallest school in the damn state

earnest phoenix
#

plus your online right now, just watch some tutorials or read through some docs

#

You can always look at examples but don't copy paste

peak bloom
#

you don't need your school to have a class on it, there are an amazing number of tutorials and resources online

atomic quarry
#

then my dumbass cousin who codes doesn't even help me

peak bloom
#

I'd venture to guess most of us are self taught

#

just seek out some good js tutorials and learn at least the basics

unique nimbus
#

Most of us are self taught

earnest phoenix
#

Yeah i self taught everything ever

unique nimbus
#

I don't actually think js is taught in school

#

I think its Python

#

and others

earnest phoenix
#

python or c++

#

it depends on the school's programme

peak bloom
#

it's usually Java and c++

earnest phoenix
#

well HTML and CSS is taught in my school

peak bloom
#

in my experience

unique nimbus
#

I mean this is from Britain

empty owl
#

im self taught

earnest phoenix
#

we have electives in our school, python, c++, c# or php

atomic quarry
#

I learned how to code in 6th grade using python but that didn't do shit

modest maple
#

python does everything

peak bloom
#

Python is pretty similar to js

earnest phoenix
#

uh

#

no

unique nimbus
#

it really isn't Runi

earnest phoenix
#

it's not

modest maple
#

things ive done in python:

peak bloom
#

sorry lmao not in syntax

empty owl
#

i learned to code in 5thgrade and created my own bot that failed horribly without any command handlers

#

js

peak bloom
#

they are the top two interpreted languages though imo

#

very similar in features and such

earnest phoenix
#

@empty owl I think everyones first project kind of fails lmao

modest maple
#

Website
Mobile App
Discord Bot
High Speed file handler
Webscraper
Q Learning AI
MENACE Machine learning

empty owl
#

lmao

modest maple
#

countless games in python aswell

#

like

#

python does alot

#

theres pretty much always a module for somthing

atomic quarry
#

Ya know what since I'm not getting any help I'll just use my other 2 bots that have a say command

#

see ya

peak bloom
#

anyway Zach if you truly know Python then you should know you can't use variables that haven't been defined

modest maple
#

cya

peak bloom
#

if that's not enough then go learn more

earnest phoenix
#

interpreted languages are often avoided in game deving

modest maple
#

yh

earnest phoenix
#

people are helping you, you can choose to accept our help and take initiative to actually learn the language or continue copy and pasting

grim aspen
#

waitWhat how does he have a say command

modest maple
#

CUZ HE JUST COPY AND PASTED IT

#

and tbf

#

you can use pygame with Kivy to make an EXE

empty owl
#

say command isnt really eh

#

just send message content

earnest phoenix
#

i mean you have DDLC as an example for a game in py but that's just a visual novel

modest maple
#

yh

#

most games are c# or somthing else

#

cuz unity and stufffs

earnest phoenix
#

cpp

peak bloom
#

scripting language for a game is fine if you're scripting an engine