#development

1 messages · Page 502 of 1

earnest phoenix
#

yeah displayname is nickname, else username iirc

#

so def use

#

yes

waxen quest
#

How do I get an invite link for my bot that redirects the user to a website without giving me the Unknown error?

midnight widget
#

You need to include a code grant which isn't supposed to be used when inviting bots

earnest phoenix
#

make sure you add the correct credentials, and add a redirect URI

kind nexus
#

Anyone here familiar sith github that can help me out?

#

With*

earnest phoenix
#

can anyone help me here?

topaz fjord
#

ask your question

#

someone will come to help

loud salmon
#

yea just ask, also what language? @earnest phoenix

earnest phoenix
#

its javascripy

#

javascript

loud salmon
#

we have a lot of javascript devs here

#

just ask your question

#

dont ask to ask

earnest phoenix
#

i need help with making a random number gen because something is going wrong and idk what

#

should i use hastebin

#

or paste the section of code here

loud salmon
#

if the code is small, like less than 20 lines, use code blocks

#

have you tried using the rand function?

#

im sure there is one in js

#

iirc its Math.random()

earnest phoenix
#

ill just paste it here

#

its small

loud salmon
#

kk

topaz fjord
#

code block it please

earnest phoenix
#
var randomnumber = Math.floor(Math.random() * 101);
        if (randomnumber < 101)
        {
            message.reply(randomnumber)
        } ```
loud salmon
#

mhm

topaz fjord
#

what does it reply

loud salmon
#

that will always be true

topaz fjord
#

besides the number

earnest phoenix
#

randomnumber is not defined

loud salmon
#

did you misspell the variable name somewhere?

earnest phoenix
#

i only mention randomnumber in that section of code

loud salmon
#

hmm

#

i havent had much experience in js

#

i would assume it works

earnest phoenix
#

aw

loud salmon
#

im more of a java kind of guy

#

¯_(ツ)_/¯

earnest phoenix
#

same

#

but i just do javascript for this idk why

#

i just like javascript for these types of things

#

rip nobody can help

#

Ok found the error so i dont need help

earnest phoenix
#

🎂

#

anyone know how to change my bot prefix its currently "!"

#

the language is javascript

west raptor
#

r u fr

#

@earnest phoenix show code

earnest phoenix
#

why do i need to

#

i just need the line of code to change it

west raptor
#

how am i supposed to know what line its on??

earnest phoenix
#

no its not a issue i just want to know how to change my bot's prefix

gilded blaze
#

Actually learn to code first.

west raptor
#

literally

earnest phoenix
#

its the default "!" and i want to change it

west raptor
#

just

#

show

#

the

#

code

earnest phoenix
#

nvm i found out how

west raptor
#

:|

#

ok

earnest phoenix
#

i mean

#

if you don't know how to change you bots prefix

#

maybe stop stealing code

#

or learn how to use strings

mild quarry
#

Probably a dumb question, but a week or smthn back, my bot got declined because it had a public token? How do I make it private (discord.py)?

bright spear
#

@mild quarry do you use github?

mild quarry
#

No

bright spear
#

where was the token then

mild quarry
#

Actually nvm I switched hosters a while back

#

It should work now

#

I don't think anybody has access to the code at the moment

bright spear
#

well you should be careful with the token because its basically the password to the bot

mild quarry
#

Yeah :p I'll be careful

hushed berry
#

@mild quarry your token is still public btw

earnest phoenix
#

lmao

lusty dew
#

Hmmm

bright spear
#

@hushed berry ad ^

timber olive
#

What do you use for storing data? For a user level system for example.

#

I heard json files are prone to corruption

ruby dust
#

@timber olive databases will always be the best for storing data

bronze wagon
#
client.channels.get('name', "kancer").send('some kancer message');
#

and it doesnt or

#

work

#

any ideas?

coral trellis
#

Did you put the correct var in 'some kancer message')

quartz kindle
#

thats not how get works

#

get directly accesses the desired collection by ID: channels.get("CHANNELID")

bronze wagon
#

wont that just give me problem

#

if i want to send message to logs channel

#

not every server uses same CHANNELID

coral trellis
#

client.channels.get('481054861497204739').send(embed);

quartz kindle
#

either save each server's logs channel id in a database, or use find if you want to find a channel by name (but then your users need to create a channel with that exact name)

bronze wagon
#

it already does that

#

so for 'find' it will be client.channels.find

quartz kindle
#

channels.find(channel => channel.name === "channelname") if i recall correctly

bronze wagon
#

ReferenceError: channels is not defined

earnest phoenix
#

Lol

quartz kindle
#

with client of course

#

i just didnt write it because its obivous

coral trellis
#

client.channels.find(channel => channel.name === "channelname")

bronze wagon
#

gives no error but just doesnt send message

quartz kindle
#

it probably found the channel in another server lmao

#

<guild>.channels.find()

#

where <guild> is the current guild you're working on

fading thistle
#

oh

lament meteor
#

client.guilds.find(g => g.id === "id").channels.find(channel => channel.name === "name") maybe like that

quartz kindle
#

or message.guild.channels.find() if you're working on a received message

bronze wagon
#

Got error, missing permissions

#

fixed, just messed up code badly

coral trellis
#

The bot has missing perms so it can't send a message ;-;

#

.<

bronze wagon
#
client.channels.find(channel => channel.name === "kancer").send("lkdfldfg")
quartz kindle
#

that will send a message to the first channel called "kancer" it finds in ALL servers

coral trellis
#

It's an event right?

bronze wagon
#

yes

earnest phoenix
#

@gleaming glen ur ne demek ?

gleaming glen
amber junco
#

!g6 dirrectsupport I need help w my bot in Lang JS. All we need is a proper moderation system and !help

earnest phoenix
sturdy chasm
#

I'm having some trouble with making a search array from an array element in a 2D array.

wintry jungle
#

Do you have your current code?

#

(Like that we can see)

sturdy chasm
#

Hang on a moment, it's failing to send

#

here's the search array (with some context):

    var trbiome = message;

    // makes a new filtered array of the original array
    let Array1 = List1.run("fill");
    const search = Array1.filter(function(e) {
        if(e[2].includes(trbiome)){
            return e[2] == trbiome;
        }
    });
    var rand = search[Math.floor(Math.random() * search.length)];```
here's two lines from the array it's referencing (look at the 3rd element to get an idea when I'm trying to do):
```    ["Grimtooth's Traps", "Mirror, Mirror, and the Fall", ["Wonders"], "Corridor", "Obstruction", 4, "./traps/mirror_mirror.png"],
    ["Grimtooth's Traps", "Delvermatic Dicer & Malingerer Trap", ["Wonders", "Mountain", "Jungle", "Grasslands"], "Door", "n/a", 4, "./traps/delvermatic_dicer.png"],```
#

I have used this on the other fields and it worked fine (with the if statement removed), I just don't know how to search within that inner array

ruby dust
#

this is my first time actually using github seriously, what is appveyor and how can I use it? or is it on github by default?

quartz kindle
#

@sturdy chasm you can use a for loop inside the filter function or a filter inside the filter

#

Or a map

#

For example if you want to match Wonders, you filter and inside the filter check if current item is an array jnstead of a string, and if so, filter it again

#

There might be better ways to do it though, but that would work

#

If you need to search an array with unknown number of levels, you need a recursive function

cold harness
#

literally can't figure out why this doesn't work

  async def on_message(self, message):
    if not message.server == None and not message.author.bot and not str(message.author) == "Jade#6135" and message.content.startswith('JD ') or message.content.startswith('jd '):
      ModMessage = message.content[3:]
      #print(ModMessage)
      await client.send_typing(message.channel)
      intent = detect_intent_texts("jade-204720", "j-i", ModMessage, "en")
      await client.send_message(message.channel, "Intent: " + intent)
    
      if intent ==  "Chatbot":
        initBot()
        msg = await client.send_message(message.channel, "...")
        async with message.channel.typing():
          print('\n' + str(message.server) + '\n' + str(message.author) + ": " + ModMessage)
          await client.send_typing(message.channel)
          answer = callBot(ModMessage)
          await client.edit_message(msg, answer)
        print("Jade: " + answer)
#

returns

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/discord/client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "<ipython-input-19-814980f8bc58>", line 23, in on_message
    async with message.channel.typing():
AttributeError: 'Channel' object has no attribute 'typing'
topaz fjord
#

It literally says channel isn't defined

cold harness
#

oof wrong error

#

now it's the right error

#

but uh help pls

#

i'm using the rewrite branch...

sturdy chasm
#

I think I may have solved my problem. I was on the right track with the e[2].includes, just wrong formation. I needed to lose the if statement, and just return e[2].includes(trbiome);. I only realized this after Tim's response.

abstract crystal
#

@cold harness are you certain that you're using rewrite, because your code looks like async

wintry jungle
#

I think he referring to typing just isn’t a thing

abstract crystal
#

typing in the channel object is a method in rewrite version

#

check the version with: ```python
import discord
print(discord.version)

earnest phoenix
#

i need to reinvite my bot because i need to change permissions

fierce thorn
#

Is it allowed to have bot with suffix and not prefix 😂

earnest phoenix
#

Just check for suffix in the end of the command message ¯_(ツ)_/¯

#

But why do you need it, I wonder? 🤔

orchid raft
#

@earnest phoenix they meant, because the rules of this server say bot commands have to be prefixed, can their bot commands be suffixed instead

earnest phoenix
#

Oh, I see...

#

But, anyways, why? XD

loud salmon
#

probably not @fierce thorn

earnest phoenix
#

Just rofl?

fierce thorn
#

Ik 😂

earnest phoenix
waxen quest
#

a.tag::after maybe

earnest phoenix
#

kk

lost scarab
earnest phoenix
#

wat

lost scarab
#

wat wat

#

lol

#

help?

earnest phoenix
#

@waxen quest that didnt work

waxen quest
#

Ok I'll try something and let you know if it worked

earnest phoenix
#

kk

waxen quest
#

a.atag::after {border-left: 10px solid #793a3a}
@earnest phoenix this worked for me

earnest phoenix
#

kk

#

thanks

waxen quest
#

np 🤠

earnest phoenix
#

🤠

mild quarry
#

dumb question but

@client.command(pass_context = True)
async def adduser2(*args):
    
    

    botargs = ''
    for word in args:
        botargs += str(word)
        botargs += ' '

        print(args)

    print(args.message.author.id)``` I'm getting an error in the last line (there's a lot more to the script that I didn't include) that says "discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'tuple' object has no attribute 'message'". How do I properly print out the ID of the user while also taking arguments?
#

nvm

earnest phoenix
knotty steeple
#

yes there is wait a sec

#
#details .bot-img {
      box-shadow: none !important;
}```
#

@earnest phoenix

earnest phoenix
#

thanks

#

so much better

#

@waxen quest how would i fix it on hover?

#

.atag::after:hover {border-left: 10px solid #f45342}
.atag:hover {border-left: 10px solid #f45342}
arent working

waxen quest
#

let me check

earnest phoenix
#

kk

waxen quest
#

Sorry but I'm not sure about that

earnest phoenix
#

hec

topaz fjord
#

wdym "on hover"

earnest phoenix
#

like

#

how do i install botconfig.json on VCS

#

thats when i hover over

#

how do i install botconfig.json on VCS

topaz fjord
#

@earnest phoenix it's happening mmLol

earnest phoenix
#

lmfao

topaz fjord
#

You dont install json

earnest phoenix
#

dude learn to code

topaz fjord
#

you make a json file

earnest phoenix
#

then why does it give me dis

#

oh god not again

#

instead of paying $50 a week

#

because u cant read

#

and u copypastad ur code probs

#

Tom can u halp fix

#

on hover

#

it might be 2 divs

#

or the ::after

#

it gives meh dat

#

yeah im using that

#

.atag::after:hover {border-left: 10px solid #f45342} doesn't work

#

check my bot page maybe FeelsWeirdShrug otherwise idk sorry

#

busy rn gotta go

#

whats ur bot page

topaz fjord
#

you have to move the botconfig.json to the right folder

earnest phoenix
#

tombot

topaz fjord
#

and/or create it

earnest phoenix
#

it is in index

#

you dont have any tags

#

oohhh I might have his them lmaooo

#

sorry

#

i need botconfig in index 4 dis

#

idk if after support hover

#

let prefix = botconfig.prefix;
let messageArray = message.content.split(" ");
let cmd = messageArray[0];
let args = messageArray.slice(1);
let commandfile = bot.commands.get(cmd.slice(prefix.length));
if(commandfile) commandfile.run(bot,message,args);

#

maybe google

#

nono

#

i want to make it so nothing happens on hover

#

basically

#

bil

#

vill

#

could u help me

topaz fjord
#

I was pinged?

earnest phoenix
#

let prefix = botconfig.prefix;
let messageArray = message.content.split(" ");
let cmd = messageArray[0];
let args = messageArray.slice(1);
let commandfile = bot.commands.get(cmd.slice(prefix.length));
if(commandfile) commandfile.run(bot,message,args);

#

what

#

can you read

#

ye

#

it says you dont have a botconfig

#

but i do

#

but you dont

#

yes

#

not in that folder

#

type pwd

#

nothing

#

lmfao

#

in your termina

#

i did

#

oh

#

your on windows

#

ic

#

ye

#

mk

#

what folder are you in

#

index

#

.js

#

folder

#

not file

#

holy fuck 2iq

#

yeah wheres your botconfig.json

#

how da fuck do i make one den?

topaz fjord
#

do I see you putting js in node_modules

earnest phoenix
#

lmfao

topaz fjord
#

what the fuck

#

dude honestly

earnest phoenix
#

please learn to code

#

holy fuck

topaz fjord
#

learn a coding language

earnest phoenix
#

i am trying

topaz fjord
#

don't make a discord bot to learn a coding language

earnest phoenix
#

wait did you make this or did your $50 a week guy

#

i did

#

the current state of the bot

#

that?

#

i am learning

topaz fjord
earnest phoenix
#

yes go watch a youtube video

#

or

#

that

topaz fjord
#

making a discord bot isn't how you learn coding

earnest phoenix
#

^

topaz fjord
#

that's the mistake I did

#

and I regret it

knotty steeple
#

same

earnest phoenix
#

im very confused

#

why the fuck

#

on hover

#

does it go partly blue

#

i am not coding is that

mild quarry
#
@client.command()
async def adduser2(member: discord.Member, *, args):
    print(member.author.id)``` idk why I keep getting this error with this code: `discord.ext.commands.errors.MissingRequiredArgument: member is a required argument that is missing.`
earnest phoenix
#
            if (!VC)
                return;
    VC.join()
            .then(connection => {
                const dispatcher = connection.playFile(`Luis Fonsi - Despacito ft. Daddy Yankee.mp3`);
                dispatcher.on("end", end => {VC.leave()});
            })
            .catch(console.error);
        });

The bot joins the channel but never plays, why is this?

#

dispatcher.on(

#

there some for error

#

listen to that maybe will give a clue

#

wut

#

english plox

#

ok it joins but never plays

#

hmmm

#

there is a listener for the 'error event on the dispatcher

#

there is no error...

#

not if you dont listen for it

#

in the event

#

oh sht

#

ok

#

ur killing me

#

ill look at the docs

#

afk

mild quarry
#

does anybody know the answer to my question above? ^^

earnest phoenix
#

missing required argument

mild quarry
#

well obviously :p It says that in the error

earnest phoenix
#

not familiar with .py lib but most likely you are not passing discord.Member as the first arg

mild quarry
#

Ok

earnest phoenix
#

oof

#

im missing ffmpeg

#

i think

#

well at least now u gotg the error

#

there is ffmpeg-binaries node module

#

or install it on ur system another way

#

for more updated versions

#

uh huh

#

thx

topaz fjord
#

use lavaloink

earnest phoenix
#

lavalink FeelsAmazingMan

#

@topaz fjord don't you remember those good old days back in Root's server? bloblul

#

You used to ask about every little thing

#

I'm glad that you've taken time to learn

topaz fjord
#

Ye I do

#

I'm ashamed of that

earnest phoenix
#

thats while hovering

slender aspen
#

Hey

earnest phoenix
#

Why does my bot leave my VC and join another VC when the command is run again?
``` if (msg.startsWith(${prefix}play despacito)) {
var VC = message.member.voiceChannel;
if (!VC)
return message.reply("you aren't in a voice channe, silly!")
VC.join()
.then(connection => {
const dispatcher = connection.playFile('./despacito.mp3');
dispatcher.on("end", end => {VC.leave()});
})
.catch(console.error);

}
night imp
#

Use :onhover and set the color to red

slender aspen
#

Anyone available to help?

night imp
#

@earnest phoenix your not checking if the bot is in a voicechannel

#

Check if it is

earnest phoenix
#

but like i want it to be able to be in multiple

#

lmfao

#

it can't

#

how do the big bots do it then?

#

shards?

night imp
#

the bot can only be in one voice channel per server

earnest phoenix
#

thats not how discord work

slender aspen
#

How would I get a terminal to open and it run the command "nodemon index.js" as I am lazy (Mac Os)

earnest phoenix
#

ohhh

slender aspen
#

Dobble click a File I am looking for

earnest phoenix
#

makes sense

night imp
#

Does macos have bat files?

#

I think it has applescript

slender aspen
#

Ok

cold harness
#

@abstract crystal any idea if message.attachments[0].save(fp="images/custom_img_1.jpg") would work in the rewrite version of d.py?

earnest phoenix
cold harness
#

like what does it mean when the api says

coroutine save(fp, *, seek_begin=True)
                   ^ tf does this mean
#

tom i've been reading the docs that's why i'm confused

slender aspen
#

Wow You guys made me learn another languege

west raptor
#

what

earnest phoenix
#

so i need opinions and help

#

so im making a mass-nick command (haha yes)

#

and

#

should it be

#
message.guild.members.forEach(h => {
        h.setNickname(args.join(" "))
    });
#

or

#
message.guild.members.setNickname(args.join(" "))
knotty steeple
#

members is a map (pretty sure) so the second wouldnt work

earnest phoenix
#

cool

#

@earnest phoenix neither works, you'd need to either turn it into an array/iterable, then loop it, or use some sort of ugly method through .filter or something

knotty steeple
#

why do you need to filter it

wheat marten
#

what can I use firebase for

knotty steeple
#

wat

wheat marten
#

When it comes to making a bot?

earnest phoenix
#

it's already a map which has foreach

#

don't map it to an array for the love of god

#

it works

#

i didn't need to turn it into an array

#

thx tom

#

but wait

#

i fixed my problem

#

its .atag:hover::after

#

cool

#

yes

#

cool

wheat marten
earnest phoenix
#

ok

wheat marten
#

wait I am using a server count example

#
const DiscordBots = new DiscordBotsList('token');

const shardID = '';
const shardCount = ''; 
const serverCount = '';
const id = '';
 
DiscordBots.postStatsWithShards(shardID, shardCount, serverCount, id);

// Without Sharding
const servercount = ''; // Replace '' with your guild count.
 
DiscordBots.postStats(servercount); ```
#

do I put my bot's token in 'token'?

topaz fjord
#

no

#

you put you dbl api token

sick cloud
#

why not use the official api

earnest phoenix
#

wait

#

don't you need your bot accepted to get a api token

sick cloud
#

yes

earnest phoenix
#

so it wouldn't work anyways

wheat marten
#

to get my bot accepted does it need to be hosted

#

?

sick cloud
#

it has to be online during testing at least

topaz fjord
#

Its needs to be on while they test it

wheat marten
#

ok

earnest phoenix
#

the mods need to review it and stuff

wheat marten
#

ok

sick cloud
#

and deny it a load

wheat marten
#

I haven't hosted my bot that was why I was asking

earnest phoenix
#

ok

wheat marten
#

The only thing I hate is the description

#

wait do I need a website and a github URL?

earnest phoenix
#

no

#

and why do you hate the description tho?

#

🤔

wheat marten
#

the detailed one sucks

unborn crow
#

😅

earnest phoenix
#

guys i need a 300 word essay by tomorrow im screwed apepeS

unborn crow
#

have fun xD

earnest phoenix
#

@earnest phoenix lol, what's this have to do with development

#

somebody said the 300 word long description was hard

#

havent u heard the "i have a <small number> word essay due tomorrow oh no!" meme?

#

does anyone know any good ways to host a bot

#

vps

unborn crow
#

Or buy a RaspberryPI KappaLUL

earnest phoenix
#

theres that too

#

ok thanks

unborn crow
#

I'm actually hosting one of my bots on a RaspberryPI ... xD

earnest phoenix
#

meme

quartz kindle
#

anyone has experience with nano-sql?

#

im looking for a minimalistic database for a node api

earnest phoenix
#

btw which RasberryPI would you recommend

topaz fjord
#

the newest

earnest phoenix
#

Can't recommend an rpi for a growing discord bot

#

if it's a few servers, then maybe..

unborn crow
#

My Bot isn't growing THAT fast... So, i use it as long as i can.

earnest phoenix
#

CPUs, though in those RPI. very weak

unborn crow
#

yep

topaz fjord
earnest phoenix
#

How can i make the bot deafen itself when they joining voice channel?

#

i use discord.js and js

#

yeah course js

earnest phoenix
#

Missing Permission, i think they no need that perms to deafen itself

#

what was the code you put down

#

First i eval it to join voice channel
then eval use msg.guild.member(client.user).setDeaf(true)

#

@earnest phoenix

#

no

#
message.guild.me.setDeaf(true)

@earnest phoenix

#

still same Missing Permission @earnest phoenix

#

check to see if it can even deafen itself

earnest phoenix
#

so

#

...

#

thats idle

#

o

#

look

#

I dont no ANYTHING

#

about coding

#

trying to learn how to code a discord bot

#

learn how to code in python

#

that gives arole

#

Go to file

#

Then click on New File

#

@earnest phoenix

#

done

#

i mean

#

You can use that as your IDE now

#

i could make you one tbh

#

YES

#

THANK YOU

#

ffs

#

wait so @earnest phoenix what do I type in her eLOL

#

In her?

#

python code

#

I didn't know that IDEs have sexes

#

same

#

in here *

#

smh

#

also what are you making a bot about?

#

First he/she needs to use pip to install discord.py

#

Open up the command prompt and type in

pip install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]
#

You also need to install git to install discord.py rewrite

earnest phoenix
#

@earnest phoenix how do I down load git

zenith moss
#

Just search git download

earnest phoenix
#

h

#

i saw that

#

it says launch git bash

#

now what

#

@earnest phoenix

#

Send a pic

zenith moss
#

Launch git bash

earnest phoenix
#

done

#

Now close the window

#

now wut

#

Then open up the command prompt

#

yea

#

Windows Key + R
cmd

#

ye

#

Then copy and paste pip install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]

#

ah

#

Type in py instead

#

now wut

#

What does it show?

#

Good

#

Type in exit()

#

oh

#

it reset

#

lit

#

Now copy and paste py -m pip install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]

#

WOAH

#

WT

#

F

#

IS IT DOING

#

TO MY COMUPTE

#

WTF

#

ummmm..........

quartz kindle
#

lol

earnest phoenix
#

WHADHU HECK IS THAT

#

Yes

#

That's good

#

bet

#

That means it installed everything needed to use discord.py correctly

#

OH LIT

#

When it says collecting and downloading, it's installing

#

now wut

#

Now open up IDLE

#

python?

#

yes

#

k

#

done

#

ok

quartz kindle
#

are you seriously going to walk him through everything?

#

lmao

earnest phoenix
#

@quartz kindle heck off

#

I like him

#

hes acctually doing it better than the video

quartz kindle
#

but are you actually learning anything from it?

#

will you remember and understand all of this?

earnest phoenix
#

no but I can set it upthough

#

i just needed help to set up

#

and download

#
import discord
from discord.ext import commands
from discord.ext.commands import Bot
#

Add that to import the module

#

wait

#

do I copy paste all of it

#

Sure

#

and then just paste it in?

#

Yep

#

Send a pic

#

oh

wheat marten
#

How could I make my bot's status have all of the guilds it is in?

earnest phoenix
#

You have to click on FIle > New File

#

@wheat marten What lib are you using?

wheat marten
#

discord.js

earnest phoenix
#
if (message.channel.id !== '501572986558480386') return;
if(message.content.startsWith(args.join(" ") !== "--verify")) {
    message.delete();
    await message.author.send("Please Use ``--Verify`` to verify yourself in The Server! Channel: [#501572986558480386](/guild/264445053596991498/channel/501572986558480386/) ")
}

would this work for me?

#

whaddhu frick

#

what is that

wheat marten
#

discord.js?

earnest phoenix
#

OH

#

I see

#

ye, u see

#

xd

#

so, would it

#

oh

#

@earnest phoenix I dont know what the heck code is

#

I don't know discord.js

#

but is that a simple verify commands

#

where it asks the person to --verify

#

no, the verify command is different

#

to verify them?

quartz kindle
#

that looks weird @earnest phoenix

earnest phoenix
#

^

#

this is just to make sure, they dont spam any other message

#

and they can only send that message to the channel

quartz kindle
#

if(message.content.startsWith(args.join(" ") !== "--verify"))

#

args.join(" ") !== "--verify" will return true or false

#

therefore you're checking if a message starts with true or false

earnest phoenix
#

so if (message.content == (args.join(" ") !== "--verify"))

amber junco
#

How can you make your bot stay online for ever?

earnest phoenix
#

ners

#

nerds

#

kappa jjkjkj

#

you have to have

#

a server

#

like a seperate one

quartz kindle
#

you need a computer or a device always on, or a vps @amber junco

amber junco
#

?

earnest phoenix
#

that doesnt run on ur ocmputer

amber junco
#

Ohhhh

earnest phoenix
#

that is what most people use

#

anyways @earnest phoenix can u help me out

#

so if (message.content == (args.join(" ") !== "--verify")) would that work instead

amber junco
#

Why is my name hoisted?

earnest phoenix
#

what is the problem

#

again

#

I gotta go to bed

amber junco
#

I mean hoister?

quartz kindle
#

@earnest phoenix you're still comparing a message to true or false

earnest phoenix
#

It's getting late

#

last one

#

do I click enter

#

or just leave it there

#

Go to File > New File

#

why wont this work annyways

if (client.guild.id !== '497153287779516417') return;
client.on("guildMemberAdd", function(member) {
    let role = member.guild.roles.find("name", "ToBeVerified");
    member.addRole(role).catch(console.error);
});
#

Then paste

wheat marten
#

how do I make a config javascript file?

earnest phoenix
#

Then you imported discord.py and you're ready to start programming!

wheat marten
#

I am confused on it

earnest phoenix
#

uuuuuuuuuuuO lit

amber junco
#

I mean hoister?

quartz kindle
#

@earnest phoenix that if outside the client.on is not doing anything

earnest phoenix
#

@quartz kindle how did you learn to code discord bots

amber junco
#

Lmao

earnest phoenix
#

so above the role being defined

#

butinside client

quartz kindle
#

i've been working with web development for many years

#

so i already knew javascript when i started doing bots

earnest phoenix
#
client.on("guildMemberAdd", function(member) {
    if (client.guild.id !== '497153287779516417') return;

    let role = member.guild.roles.find("name", "ToBeVerified");
    member.addRole(role).catch(console.error);
});

this

#

do u know any good ways to code bots

#

yes

#

type some words, and make them work

#

xd

#

BET

quartz kindle
#

@earnest phoenix what exactly are you trying to do? that IF makes no sense

earnest phoenix
#

autorole, but only on one server

quartz kindle
earnest phoenix
#

thats my best

quartz kindle
#

you're checking the guild of the member that joined

earnest phoenix
#

is that how u code D:

#

idk how

#

im just looking off what your doing

#

.

#

and tryina do my own thing

#

😦

#

You know a great place to learn?

#

where

quartz kindle
#

Neuro you should really look into learning a programming language, if you're really interested in learning how to code

earnest phoenix
quartz kindle
#

if you learn a programming language, you can do anything with it, including discord bots

earnest phoenix
#

python

#

how long will it take to learn that

quartz kindle
#

depends on how smart you are and how hard you work

#

it can take weeks, months or years

earnest phoenix
#
if(message) (message.channel.id !== '501572986558480386') return;
                                                          ^^^^^^

SyntaxError: Unexpected token return
quartz kindle
#

that IF is wrong

#

if you cant do if() ()

#

its if() {}

#

besides your condition is also wrong

earnest phoenix
#

@earnest phoenix took me 2 days

#

but

#

I knew JS

quartz kindle
#

if(message) === check if message exists

earnest phoenix
#

yup, my other problem is the stoopid thing was not in a message event

#

oh

#

yeawell ofc

#

its easy for you

#

if I had learned js back in minecraft days

#

then it woulda been easy as heck

quartz kindle
#

minecraft doesnt use js

#

it uses java

#

which is a different thing

earnest phoenix
#

same thing

#

right

#

what is js

#

java script?

quartz kindle
#

js = javascript

#

its a different language

#

techincally, javascript's real name is ECMAScript

#

but it was popularized as javascript

#

it has nothing to do with Java

earnest phoenix
#

JavaScript's naming was just for publicity

quartz kindle
#

Java is a compiled language, similar to the C languages, its much more complex and low level

earnest phoenix
#

o

#

alola

quartz kindle
#

javascript is a high level interpreted language, its much easier to use, but it needs to run inside an interpreter program

#

web browsers have built in javascript interpreters, which makes javascript extremely popular for websites and web apps

#

so if you're interested in web development and learning how to work with websites, javascript is a must

earnest phoenix
#

too much tech talk

#

im just lookin to code using python

#
client.on("message", async(client, message, args) => {
    if (message.channel.type === "dm") {
        if (message.author.bot) return;

        message.react("❌")

        message.author.send("You Cannot Use Commands In DM!")

        return;
    }
(node:14060) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channel' of undefined

i may not be good, but i know that message is defined herethonkku

#

Codecademy is one of the best sites out there

#

someone can agree that that should work ^^^^^

#

bruh

#

how long is this gonna take

#

how long 4 what

sinful lotus
#

@earnest phoenix it is not defined

#

you defined it wrong maybe

#

client.on message only returns one parameter which is message

#

but you have 3 parameters there

quartz kindle
#

try a space after async

sinful lotus
#

means the message is defined as client

quartz kindle
#

else it thinks its a function

earnest phoenix
#

it has worked before

quartz kindle
#

async()

earnest phoenix
#

now it wont

sinful lotus
#

space will not really work on that I think

#

show the wole code and is that module.exports

#

Im pretty sure that message is defined as client there

#

👀

#

unless you did other things on your code

#

but I doubt you use event handler

quartz kindle
#

do you really need async there anyways?

earnest phoenix
#

@quartz kindle

#

do i need to use pthon 3

#

well, i do need to define mesage dont i

#

or 2

#

and args

#

for coding discord bots

#

and shit

quartz kindle
#

depends

sinful lotus
#

try this first

#

just put message on the top

earnest phoenix
#

wym depends

sinful lotus
#

remove that client, message and args

earnest phoenix
#

owah

quartz kindle
#

a discord bot is coded using a "discord library", which is a package containing a shit ton of code to make python work with discord

sinful lotus
#

show the whole code

#

the stuff on top of that

quartz kindle
#

so depending on which discord library you use, it may require python 2 or python 3

earnest phoenix
#

UGH

#

thw whole code is 300 + lines

#

this is so confusing

sinful lotus
#

just hastebin it

quartz kindle
#

hence why better learn coding first

#

there are a lot of things involved in programming besides coding

earnest phoenix
#

i just need to make a simple discord bot 😭

quartz kindle
#

environment, dependencies, and even linux in general are extremely useful things to know

sinful lotus
#

first of all, why do you want a bot

earnest phoenix
sinful lotus
#

if there are already a lot of bot

earnest phoenix
#

because no one can code one for me

#

and I need one spesified for my server

#

and ive been here for the past 3 hrs

quartz kindle
#

you wont code a bot in 3 hours anyways

sinful lotus
#

my gowsh

#

callback hell

quartz kindle
#

my bot took months to reach a state where is usable, useful and stable

earnest phoenix
#

tf

#

I need a bot

#

that

#

like this

sinful lotus
#

ok first of all

earnest phoenix
#

and if you click on the letters

#

you get the role

quartz kindle
#

fyi thats not simple to code

sinful lotus
#

@earnest phoenix first of all

#

rewrite the music

earnest phoenix
#

ITS A MESSAGE

#

WT

#

no

sinful lotus
#

it shoudnt be like that

earnest phoenix
#

it works

#

its litterally 1 message

sinful lotus
#

it doesnt work like you expected it to work

#

you have 2 message listeners

#

which is why?

earnest phoenix
#

rly`?

#

show me

sinful lotus
#

@untold pulsar uses a single listener for all her functions

#

you dont do 2 client.on message

earnest phoenix
#

SHOW ME BOoth

sinful lotus
#

I cant show you a code that has 200 files on it

#

lmao

earnest phoenix
#

show me a snip of it

sinful lotus
#

thats why Im pointing out your music should be rewroted

earnest phoenix
#

well, ignore the music

#

thats not the preoblem

sinful lotus
#

it is causing errors because

earnest phoenix
#

no

#

ive had it for 2 months now, and no errors

sinful lotus
#

you ask your help then you point your own view

#

you dont code a bot and refuse to improve it

earnest phoenix
#

@quartz kindle

quartz kindle
#

@earnest phoenix here's whats involved into reaction roles:

  1. bot receives command
  2. bot sends list of roles
  3. bot reacts to own message
  4. bot starts listening to reactions on its message
  5. bot receives reaction update
  6. bot checks which reaction was used
  7. bot checks who used reaction
  8. bot assigns role

all of that with extra checks in the middle for checking if both bot and user have all the requires permissions, plus extra checks for error handling

earnest phoenix
#

oh

#

Im saying The music is irrelevant

#

wut

#

all i want to fix is the other error for now

sinful lotus
#

it is relevant because the that code contains the music

earnest phoenix
#

then when the bot grows, ill clean up all the code

sinful lotus
#
 client.on(eventName, (...args) => eventFunc.run(client, ...args));

you got this

#

then

#
client.on("message", async(client, message, args) => {
earnest phoenix
#

@earnest phoenix here's whats involved into reaction roles:

  1. bot receives command
  2. bot sends list of roles
  3. bot reacts to own message
  4. bot starts listening to reactions on its message
  5. bot receives reaction update
  6. bot checks which reaction was used
  7. bot checks who used reaction
  8. bot assigns role

all of that with extra checks in the middle for checking if b

sinful lotus
#

you have this

earnest phoenix
#

it shouldnt be that hard right

sinful lotus
#

@earnest phoenix and no

#

I worked for reaction stuff commands for a day

#

leearning await reactions

earnest phoenix
#

ffs

sinful lotus
#

if you want a bot that does that you need to pay a dev

quartz kindle
#

its not hard if you know what you're doing. if you dont, then it is hard

earnest phoenix
#

@sinful lotus i was ready to pay

#

and then a mod said dont advertie your shit in here

#

thats a handler

#

and i deleted it

sinful lotus
#

@earnest phoenix thats the point

earnest phoenix
#

its a handler

sinful lotus
#

why not put the music code Inside the handler?

#

why create a separate client.on message

earnest phoenix
#

that still wont fix my problem

sinful lotus
#

it will

earnest phoenix
#

@quartz kindle soooo, how do I find out a bots cod

#

code

#

how do I look at it

#

like as a refereance

#

Watch me do it, BET U IT WONT FIX

sinful lotus
#

I coded for 8 months and I know what and donts

quartz kindle
#

there are many open source bots in github for example

sinful lotus
#

I experienced a lot of bugs more than you do

earnest phoenix
#

send m

#

me

sinful lotus
#

I experienced a lot of crashes

#

so I know that causes issues

quartz kindle
#

but i wouldnt advise looking at them, since their code can be quite complex and just leave you more confused

earnest phoenix
#

fuk

#

god damnit

#

im so stuck

quartz kindle
#

you can try some tutorials

sinful lotus
#

Look for Reaction Role bot

#

I think that does what you want

quartz kindle
#

for example i just googled "discord bot example python"

#

and i got this

#
import discord

TOKEN = 'XXXXXXXXXX'

client = discord.Client()

@client.event
async def on_message(message):
    # we do not want the bot to reply to itself
    if message.author == client.user:
        return

    if message.content.startswith('!hello'):
        msg = 'Hello {0.author.mention}'.format(message)
        await client.send_message(message.channel, msg)

@client.event
async def on_ready():
    print('Logged in as')
    print(client.user.name)
    print(client.user.id)
    print('------')

client.run(TOKEN)```
earnest phoenix
#

once again. i need it to havemy own name and profile picture

#

thats why i wanna code my ownw

sinful lotus
#

:v

earnest phoenix
#

but i guess I have to go through 10 thousand years of learning code

sinful lotus
#

good luck with that

quartz kindle
#

thats an example of a python bot that responds to "!hello"

earnest phoenix
#

and then study at harvad

#

and then get my ass wooped by a teacher

#

there

#

comeback here askin what is a command for a bot

#

OH

#

@quartz kindle

#

thanks

#

for sending that

#

PROVEN WRONG

#

still have error

sinful lotus
#

just use another bot tbh @earnest phoenix saves you time

earnest phoenix
#

so does it reply with something

sinful lotus
#

@earnest phoenix did you eveen code it right?

earnest phoenix
#

@sinful lotus no

#

im not a quitter

#

YES

#

might complain

sinful lotus
#

how?

earnest phoenix
#

IT WAS WORKING

#

but not aquitter

#

IM NOT TRYNA FIX MUSIC

quartz kindle
#

this is the command logic: if message.content.startswith('!hello'): msg = 'Hello {0.author.mention}'.format(message) await client.send_message(message.channel, msg)

#

if message content starts with !hello

#

message equals "hello author"

#

send message

earnest phoenix
#

wait so if I have to do a commands

sinful lotus
#

https://github.com/Deivu/Kongou @earnest phoenix you know what, thiss is coded on the same logic of your music bot

earnest phoenix
#

I always have to do

#

if message.content.startswith('!hello'):

sinful lotus
#

but it never errored

earnest phoenix
#
client.on("message", async(client, message, args) => {
    if (message.channel.type === "dm") {
        if (message.author.bot) return;

        message.react("❌")

        message.author.send("You Cannot Use Commands In DM!")

        return;
    }

this is all i asked for help with, so dont be saying my music feature is f***** up becaus eits not

#

btw how do you get that black box

sinful lotus
#

so it IS your problem

earnest phoenix
#

and the colored words whadhu

quartz kindle
#

like this ``` code here ```

sinful lotus
#

if you are pursuing that code

earnest phoenix
#

THe music thing is in a completely different file!

sinful lotus
#

I already told you wtf to do

#

client.on("message", async(client, message, args) => { just remove this all and put async (message)

earnest phoenix
#
from discord.ext import commands
from discord.ext.commands import Bot

# Work with Python 3.6
import discord

TOKEN = 'XXXXXXXXXX'

client = discord.Client()

@client.event
async def on_message(message):
    # we do not want the bot to reply to itself
    if message.author == client.user:
        return

    if message.content.startswith('!hello'):
        msg = 'Hello {0.author.mention}'.format(message)
        await client.send_message(message.channel, msg)

@client.event
async def on_ready():
    print('Logged in as')
    print(client.user.name)
    print(client.user.id)
    print('------')

client.run(TOKEN)
```]
#

OSOOAS

sinful lotus
#

you are just d oing it wrong

earnest phoenix
#

purfect

#
        msg = 'Hello {0.author.mention}'.format(message)
        await client.send_message(message.channel, msg)```
#

do I have to indent?

quartz kindle
#

you have to understand what is happening in the code and what is the process that the bot is following, aka, the code flow. else you wont understand shit and just get confused

sinful lotus
#

this is why you dont code with little js knowledge

quartz kindle
#

so for example

earnest phoenix
#

indent is important for python yes

quartz kindle
#

the discord library will listen to ALL messages received by ALL servers the bot is in

#

ALL of them

#

and your code will filter ALL the messages

earnest phoenix
#

ReferenceError: async is not defined

#

oh

#

ReferenceError: async is not definedReferenceError: async is not defined

quartz kindle
#

until it finds a match

earnest phoenix
#

your fix doesnt help me

quartz kindle
#

that matches with whatever you want it to

#

for example a prefix, or an exact match

earnest phoenix
#

i would rather not have @sinful lotus help e

#

me

sinful lotus
#

are you meme or wth?

earnest phoenix
#

@topaz fjord another use for the bot zoomeyes

sinful lotus
#
async (message) {
#

will not work

earnest phoenix
#

so whats the difference with ' ' and " "

quartz kindle
#

everything in coding is manually specified and defined, you have to tell your bot EVERYTHING you want it to do, every single step literally

sinful lotus
#
client.on("message", async(client, message, args) => {
TO
client.on("message", async(message) => {

what Im telling you to do is

#

learn js for petes sake

earnest phoenix
#

thats the exact same thing

sinful lotus
#

Just do it

earnest phoenix
#

what fucking difference would that make

#

double quotes angeryBOI

#

I HAD TRIED THAT ALREADY

#

and i need args

sinful lotus
#

Args is alreadyd efined

#

inside that code

#

unless

#

you did something to break it

earnest phoenix
#

nop

sinful lotus
#

var args = message.content.substring(prefix.length).split(" ");

#

^ its inside your code

#

so why the hell put args there

earnest phoenix
#

do

#

sooo

#

if I want it to

sinful lotus
#

do you even know that code is

#

facepalm

earnest phoenix
#

something not defined tickYes didnt readthedocs tickYes wrong parameters in events tickYes dbl dev tickYes

#

guess what

#

i did what u said

#

(node:8828) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channel' of undefined

#

no change in error whatso ever

sinful lotus
#

are you sure its in that code

earnest phoenix
#

YES

#

its right under it

#

say hi for example, I have to be like. Think the word high, form the letters in your head, make sure your mouth knows the letters, then form letters into words, make sure you know how to say the words, then say the words

#

literally 1 line under

sinful lotus
#

to tell more about that error

quartz kindle
#

client.cannons.fire

#

lmao

sinful lotus
#

nvm that

earnest phoenix
#

client.sortie

#

lol

#

i dont nee that

sinful lotus
#

removee the client

earnest phoenix
#

thats my problem

sinful lotus
#

jsut leave message there

earnest phoenix
#

the client being removed, will do no diference to error

sinful lotus
#

try it first and make sure you save it

#

first of all client isnt even used therwe

#

its not even highlighted

earnest phoenix
#

whats this, removed client

(node:17168) UnhandledPromiseRejectionWarning: ReferenceError: async is not defined
sinful lotus
#

put space

earnest phoenix
#

I still dont understand

#

i thought i understood

#

now im like

#

idk

sinful lotus
#

exports.run = async (client, msg) => {
not
exports.run = async(client, msg) => {

quartz kindle
#

^ said that ages ago lul

sinful lotus
#

yeah didnt see that ^

#

lmao

earnest phoenix
#

IGHT BET

#

so how do I find a dev to code me a bot

quartz kindle
#

you can ask the mods to post there

earnest phoenix
#
(node:8924) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'join' of undefined

    if (message.content == (args.join(" ") !== "--verify") ) { 
        
        if (message.channel.id !== '501572986558480386') return;
    
        message.delete();
        message.author.send("Please Use ``--Verify`` to verify yourself in The Server! Channel: [#501572986558480386](/guild/264445053596991498/channel/501572986558480386/) ")
    }
#

already asked

#

no reply

quartz kindle
#

then wait for reply

earnest phoenix
#

wtf

#

i msged like 8 hrs ago

sinful lotus
#

put the ```js
client.on("message", async(client, message, args) => {
var args = message.content.substring(prefix.length).split(" ") // TO HERE
if (message.channel.type === "dm") {
if (message.author.bot) return;

    message.react("❌")

    message.author.send("You Cannot Use Commands In DM!")

    return;
}
if (message.content == async(args)(args.join(" ") !== "--verify") ) { 
    
    if (message.channel.id !== '501572986558480386') return;

    message.delete();
    message.author.send("Please Use ``--Verify`` to verify yourself in The Server! Channel: [#501572986558480386](/guild/264445053596991498/channel/501572986558480386/) ")
}


var args = message.content.substring(prefix.length).split(" "); // THIS LINE
#

pls define variables properly

#

faceplam overlord

earnest phoenix
#

@sinful lotus do u know a bot that gives roles based on the emoji they react to>

sinful lotus
#

I was not this dumb when I started js

earnest phoenix
#

i like froot lopes

quartz kindle
#

trying to join args when they dont exist, trying to compare a message to a boolean, comparing an array joined by spaces to a single string

earnest phoenix
#

OOH

sinful lotus
#

I'd rather stop helping this guy