#development

1 messages · Page 622 of 1

celest spindle
#

2019-05-25T21:27:03.475238+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'prefixes' of undefined

still getting this @earnest phoenix

let prefixess = JSON.parse(fs.readFileSync(`${__dirname}/../prefix.json`))
let prefix = prefixess[message.guild.id].prefixes;
#

no clue why

earnest phoenix
#

make a

#

well

#

check if guild got prefix by if

#

and if not then make

#

Ah yes!

#

^

celest spindle
#

its already made tho

#

in the main bot code

earnest phoenix
#

Hmm

celest spindle
#

this works

#

and when i print prefix it works

earnest phoenix
#

oh yeah like that but you might wanna save to the json?

celest spindle
#

wait

#

oh

#

ok

earnest phoenix
#

well yeah thatw orks

#

@celest spindle you need fs.writeRile

#

File

#

yeet

#
  fs.writeFile("./prefixes.json", JSON.stringify(prefixes), (err) => {
    if(err) console.log(err)
  });```
#

idk how your file are named

#

u forgot .json

#

hehe

#

Ah yeah

celest spindle
#

thanks

#

ill run it rn

earnest phoenix
#

my laptop just chose to do windows update cuz it failed earlier XD

earnest phoenix
#

why do I have this error in my console? "DeprecationWarning: Collection # find: pass a function instead"

jolly sentinel
#

is it discord.js?

earnest phoenix
#

Yes

jolly sentinel
#

#Collection.find() takes a function

#

Googling the warning takes like five seconds

earnest phoenix
#

Okay thanks

jolly sentinel
#

np

graceful warren
#

hello guys, I need some help

#

trying a github clone in cmd not working

#

is there a plugin or something I need?

#

dm me please, it s urgent

earnest phoenix
#

Git

#

I thought github explained that lol

#

@graceful warren git clone

graceful warren
#

thanks

#

can someone dm me and explain me how do I do that? I can't understand..

earnest phoenix
#

Ever heard of docs

#

Like, google "how to use git"

#

Search on google before asking here, and if you dont found ask here

graceful warren
#

alright, thanks

cerulean jacinth
#

@zealous veldt can i have my bot un muted, i fixed everything

#

@modern sable ^

modern sable
#

sure

cerulean jacinth
#

k thnx

#

btw nice pfp

zealous veldt
#

]]helpcom

covert turtleBOT
#

You will not be the first, and you will not be the last to do the following:

  1. Decide to run a common prefixed help command.
  2. Immediately regret your decision.
  3. Post about it in #general , warning people about it.

Times this message has been reposted: 25
Break the cycle. If you fuck up, then keep it to yourself.

cerulean jacinth
#

XD

#

tru

earnest phoenix
#

Bad choice

cerulean jacinth
#

2

#

ik

#

different prefix

#

what should it be

earnest phoenix
#

For your bot?

cerulean jacinth
#

yee

earnest phoenix
#

Something easy to click

cerulean jacinth
#

mine is ">"

zealous veldt
#

Something unique

cerulean jacinth
#

ok

#

^

zealous veldt
#

many people put the first letter of their bot's name before or after a character like !, ?, etc.

cerulean jacinth
#

kk

earnest phoenix
#

Like b!help

cerulean jacinth
#

ik

zealous veldt
#

e.g. if my bot's name was Bill I might make my prefix something like b!ping

#

yeah

cerulean jacinth
#

ok

earnest phoenix
#

My prefix is +

modest remnant
#

I made a bot in android tell me way how to host it

fiery stream
#

Lol glitch

shy rose
#

heroku better than glitch

#

mainly cause its designed to host apps
rather than running as a hobby service like glitch

west spoke
#

:v

shy rose
#

saw that lol

west spoke
#

M h m

fiery stream
#

-exec

#

eval 2 * 2

shy rose
earnest phoenix
#

@cerulean jacinth wth

#

Your screenshot length

cerulean jacinth
#

ikr

jolly sentinel
#

uhh does discord.py-rewrite have a way of checking if the channel the command is used in is a dm channel or not

#

i know i talked about googling a problem in five seconds earlier but i don't think i found anything when i did and i'm too lazy to do it once again

west spoke
#

async has that. Idk about rewrite. Rewrite wont work for me qwq

jolly sentinel
#

you are not w o r t h y

#

I know .bot() exists so I thought there might be something similar for dm channels

west spoke
#

Kek

jolly sentinel
#

I run my levels through .json despite like everyone telling me to use something else and I've no clue how to prevent people from just spamming a message to gain exp

#

I feel like there's a function that should help me here

#

maybe something with god damn datetime and comparing the current datetime to the datetime i can log but I've no clue how to compare datetimes and it sounds like more work than it's worth tbh

west spoke
#

Python timers exist. Make it set a date and store it in a file ig

jolly sentinel
#

all I can think of doing is adding a 'time' key and putting the time

#

then a function that compares the current datetime to that

west spoke
#

That would work

jolly sentinel
#

I'm going to work out the logic of that tomorrow because it's nearly 11pm and I'm tired

west spoke
#

Agreeable

earnest phoenix
#

#inv

slender thistle
#

@jolly sentinel if a command is used in DM, message.guild is None

jolly sentinel
#

ah

#

that makes things easier

slender thistle
#

Also, command cooldowns exist if you are using commands extension

jolly sentinel
#

I was talking about the on_message

#

You get x exp for every message sent, yada yada, basic basic

slender thistle
#

Ah, well

#

You will need a dictionary where the key is message author id and the value is datetime.datetime.now().timestamp()

jolly sentinel
#

I just want to know how to compare the datetimes

slender thistle
#

dt > some other dt object

jolly sentinel
#

so something like uhh

slender thistle
#

I doubt timedelta works when comparing

jolly sentinel
#

say I want to make it not allow it if they've sent a message in the past minute

#

I've only ever used datetime for logging purposes so I've no clue how to check these things

slender thistle
#

You will need datetime.datetime.now() as a value of dict
Then, when a message is sent, substract another dt.dt.now() from the previous one

#

And see if .total_seconds() will be > 60

jolly sentinel
#

so

#

dict = dt.dt.now()
x = dt.dt.now() - dict
if x.total_seconds() > 60:

#

because

#

I've no c l ue

slender thistle
#

Well certainly that won't work for each member so you need a dictionary :p

jolly sentinel
#

yeah

#

I'm just putting the idea through

slender thistle
#

But you are close

jolly sentinel
#

Would that work if the dict was instead the dictionary

#

so instead it would be

#
a = lvl[str(guild.id)][str(user.id)]['timestamp']
x = datetime.datetime.now() - a
if x.total_seconds() > 60:
    # stuff
else:
    pass```
slender thistle
#

That looks correct

jolly sentinel
#

if this doesn't work

#

I will cry

slender thistle
jolly sentinel
#

if this also completely wipes my json script

#

i will cry

#

this is why I have a backup

#

lets go boiiisssss

#

I almost fucking panicked thinking that my on_ready statement was taking user ids instead of guild ids when checking

slender thistle
jolly sentinel
#

someone deleted a message in corgobot's dms

#

they just made me realize it gave an error

#

phuck

#

good news; it didn't throw an error

bad news; it still gives exp

#

bad bad news; json doesn't like dumping datetime.datetime.now()

#

good news; fixed it still giving exp

slender thistle
#

Store .timestamp()

jolly sentinel
#

alrighty

#

should that still work?

#

with the subtraction

slender thistle
#

Well unless json doesn't like floats, it will work:p

#

Substraction? Well use two timestamps for that then

#

Since .timestamp() is float

jolly sentinel
#

bad news

#

... json doesn't like floats

#

you know what

slender thistle
#

What

jolly sentinel
#

I don't know

#

Dumping to the file while trying to store it--

slender thistle
jolly sentinel
#

nvm

#

found the problem

#

I'm just dumb

#

hallelujah

#

it fucking worked

slender thistle
jolly sentinel
#

I'm gonna set it to like 60 for now

#

and just add a way to customize it another time

slender thistle
jolly sentinel
#

though

#

bad news

#

Luckily I have to do this now and not later

#

I have to reset everyones levels in my dict

#

because otherwise

slender thistle
#

Welp

jolly sentinel
#

key errors

#

anyhow

#

thanks for the help

#

also, messages in the dms return as NoneType

slender thistle
#

You can use .get('key') on a dict instead of ['key'] so thaf it will return None instead of KeyError

#

Messages in DMs? Well that's weird

jolly sentinel
#

that only happens if someone tries to use something like -!level in dms tho so no one would try taht

#

r i gh t t t

slender thistle
#

One important rule of a developer

#

"Never trust user input"

jolly sentinel
#

well

#

unless there's some unseen danger of letting keyerrors run rampant

#

is there a reason for me to make it neater in my console

slender thistle
#

So that you could look at it without having your eyes bleed? Thinkmas

jolly sentinel
#

I have accepted that I shall suffer

slender thistle
#

Good luck

jolly sentinel
#

eh

#

my console doesn't log anything anyways

#

it just logs this

#
Bot is ready!
corgobot
2019/05/26
12:14:00 AM
<--->```
slender thistle
#

What is it supposed to output?

jolly sentinel
#

my console?

#

exactly what i just wrote

slender thistle
#

Ah, I thought you were getting some other issues with outputting something

jolly sentinel
#

No

#

My console doesn't really do anything

slender thistle
#

Good

jolly sentinel
#

I don't know what to add to my bot

#

Now that I added that, I'm stumped on ideas

slender thistle
#

Search some random bots on the website for ideas /shrug

jolly sentinel
#

I'm proud of what I've done

slender thistle
#

Or dedicate your bot to just levels

jolly sentinel
#

It's not just levels

#

It's levels, logging (message, admin actions (using the bots commands), warns), and other stuff

#

I don't care to list it off rn

slender thistle
#

Well then ig search for some ideas 10outta10

jolly sentinel
#

I shall

#

My bot was originally just a three day project to see how much I could do for a friends server that evolved into this

slender thistle
#

Nice

earnest phoenix
spice pivot
#

Hello , how i get bot developer or certified developer ?
and how i can know if my bot declined or not ?

zealous veldt
#

]]faq 1

covert turtleBOT
#
Frequently Asked Questions 📜

Click the link to get more information on the question:

  1. How do I add a bot?
zealous veldt
#

]]faq 2

covert turtleBOT
#
Frequently Asked Questions 📜

Click the link to get more information on the question:
2) How long is approval?

zealous veldt
#

both apply

slender thistle
#

Bot Developer role is given to you when your bot is accepted on the website
Certified Developer role is for developers of certified bots

#

Ah well

zealous veldt
#

yes that too

earnest phoenix
#

]]faq1

proud wadi
#

why i cant invite @covert turtle

bright spear
#

@proud wadi its a private bot

#

its only for this server

proud wadi
#

ooh

earnest phoenix
#

how do i get the data of a list

#
{
    "test" : {
        "test1" : {
            "id" : "tt",
            "return" : "success 1"
        },
        "test2" : {
            "id" : "tz",
            "return" : "success 2"
        }
    }
}
#

how to return test 1 and test 2 at the same time

bright spear
#

just get test?

earnest phoenix
#

does it return all?

bright spear
#

it should

proud wadi
#

how i can set bot status

#

ah

#

there is function i guess

#

yes?

hoary current
#

py or js?

proud wadi
#

py

hoary current
#

like playing?

proud wadi
#

no

#

Like Do not Disturb

hoary current
#

oh

#

ok

proud wadi
#

or idle

#

btw i found functions list

hoary current
#

Do you want your bot playing and idle status?

#

if yes, maybe I can help you

proud wadi
#

some bots have status "streaming"

hoary current
#

Oh

#

I cant do streaming

vapid rune
#

please, just go to docs

hoary current
#

but playing yes

proud wadi
#

i know its configurable

vapid rune
#

hmm

#

@proud wadi looked at the documentation, here's an example

await client.change_presence(activity=discord.Game(name='my game'))

# or, for watching:
activity = discord.Activity(name='my activity', type=discord.ActivityType.watching)
await client.change_presence(activity=activity)
proud wadi
#

streaming?

vapid rune
#

you could probably do discord.ActivityType.streaming

mossy vine
#

for streaming to work you also need to provide a url

slender thistle
#

discord.Streaming

mossy vine
#

just please

#

read the damn docs

vapid rune
#

oof :/

mossy vine
#

not you

proud wadi
#

okay

vapid rune
#

ik, but i wouldn't be able to help anyway because i'm on the old version, not rewrite lol

proud wadi
#

okayokayokay

vapid rune
#

@cunning oar

mossy vine
#

because you didnt set a url for streaming

vapid rune
#

ah

#

thanks

#

what if i linked to xQc...?

mossy vine
#

whats that

vapid rune
#

a streamer my friend likes

mossy vine
#

you could do that

#

iirc most just link to monstercat

vapid rune
#

oh yes what a good choice

#

?

#

oh

#

music bot.

#

24/7?

#

um

#

have a dedicated server?

mossy vine
#

all these noobs hosting their bot 24/7, why not just do 24/24

vapid rune
#

LOL

#

24/24

vapid rune
#

gotta get those 24 days a week you know

proud wadi
#

excuse me

#

Archives Manager Bot?

vapid rune
#

?

proud wadi
#

what im making

mossy vine
#

what

vapid rune
#

oooh

#

sounds interesting, would like to see it once it's accepted

#

ooo

proud wadi
#

im making just very simple bot for managing archived channels

#

though

vapid rune
#
bot.on('message', msg=>{
    if(msg.content == "HELLO"){
        msg.reply('HELLO CHIPS!');
}
mossy vine
#

if statement isnt closed

proud wadi
#

give me say something

mossy vine
#

neither is the event listener

vapid rune
#

i did js syntax colouring but i have no idea what language that is

mossy vine
#

its javascript

vapid rune
#

ah

#

i was right lol

proud wadi
#

pls

mossy vine
#
bot.on('message' => {
    if(msg.content === 'HELLO') {
        msg.reply('HELLO CHIPS')
    }
})```
vapid rune
#

oh yeh

proud wadi
#

my very simple system for bot

vapid rune
#

mhm

proud wadi
#

VERY SIMPLE

#

first, user types what channel he want archive

mossy vine
#

..and?

#

i just set up a category with permissions, and it became a drag and drop instead of a bot command

proud wadi
#

canceling

#

ok

ruby dust
#

people nowadays rely on bots too much

vapid rune
#

xd

mossy vine
#

i have no problem with bots doing simple things a dumb user could do

#

i just dont use them

#

plus the best thing about being a bot develpoer is that you can just build your own systems for whatever you want instead of having 900 bots in the server

ruby dust
#

I have no problem with shit bots existing, but what's the point of them when manual actions are far more efficient?

mossy vine
#

again, dumb users

#

youd be surprised how many people have no idea how permissions work

vapid rune
#

._.

mossy vine
#

im not calling out anyone, just talking from my own experience

ruby dust
#

I've been in more than enough servers where in channels like announcements and rules you can't read message histories

mossy vine
#

there was a youtuber who is now inactive, and i was given the muted role in his server for uh reasons and i was able to send messages in the rules channel

#

i have no idea how you fuck up that badly, but eh

vapid rune
#

._.

ruby dust
#

what's more triggering to me is when they want to hide the channel, they disable LITERALLY EVERY permission for that channel

mossy vine
#

yeah

#

what

#

no

#

there are plenty of great guides

hoary current
#

@earnest phoenix

#

I can teach you

earnest phoenix
#
Nvm
anyways, please teach me some custom commands```

that's not how it works
#

a giant prerequisite to making a bot is knowing the programming language you're going to make it in (ignoring the fact that 80% of people here do the exact opposite)

#

once that has been done, you progress onto learning what discord's api offers you and what you're capable of doing

vapid rune
#

mhm

#

idk why people don't look into things first

ruby dust
#

is there a way in python to, instead of running through individual items in a list with a for loop, it just does every item at once?

earnest phoenix
#

I have a Google search command, when I run home, its works, but on my vps, its not working. And there is no API to create for the command. Do you know what this is about?

earnest phoenix
#

google will ip ban you sometimes

#

use duckduckgo instead

#

ok thx

solid pike
#

Do you speak french?

earnest phoenix
#

@solid pike oui

#
const Discord = require ("discord.js");

module.exports.run = async (bot, message, args) => {
	
	if(!message.member.hasPermission("MANAGE_ROLES")) return ("**❌ Vous n'avez pas la permission d'effectuer cette commande. Permission requise : `Gérer les rôles`**");
	
		let role = args.join(" ");
	    if (!role) return message.channel.send("**❌ Veuillez spécifier un rôle.**");
	    let gRole = message.guild.roles.find((r) => r.name === role);
	    if(!gRole) return message.channel.send("**❌ Je ne trouve pas ce rôle.**");
	    message.channel.send(`<@&gRole.id>`)
}

module.exports.help = {
	name:"mentionrole"
}

I wonder why he doesn't answer when he finds the role..

#

You miss something

opaque eagle
#

Is there a way to deploy to netlify without using github?

#

I really don't wanna make a github repo for a trivial project I'm working on

earnest phoenix
#
let mention = message.server.roles.get('name', role);

roles at role.get is undefined.
How can i do ?

opaque eagle
#

Read the docs

#

server isn’t a property of the Message class

#

And Map.get() only takes one param

earnest phoenix
#

ok

#

thx

vital nest
#

is someone able to show me how to embed messages from a discord bot?

west spoke
#

:v

#

Do you even know how to code

#

Cause doing that is very basic

grizzled spruce
#

@vital nest can ur bot send any messages yet?

buoyant wagon
#

what language is it

vital nest
#

its in javascript, and yes I can send messages with it

buoyant wagon
#

i mean library

#

new Discord.RichEmbed()?

earnest phoenix
#

Can i get helpjs if (message.isMentioned('366026189166346242')) { message.reply("Are you really pinging him when they told you not to... Great When he gets back you're Banned. Have fun!"); if (!message.channel.includes('408885161724215296', '366026189166346242')) return; } if (message.isMentioned('408885161724215296')) { message.reply("Are you really pinging him when they told you not to... Great When he gets back you're Banned. Have fun!"); if (!message.channel.includes('408885161724215296', '366026189166346242')) return; } i am trying to make it with me being the owner and the other owner can ping each other without the message going off when other people ping let the message go off the message goes off when anyone pings him even him self.

vital nest
#

i figured it out!

earnest phoenix
#
const Discord = require ("discord.js");

module.exports.run = async (bot, message, args) => {
	
	if(!message.member.hasPermission("MANAGE_ROLES")) return ("**❌ Vous n'avez pas la permission d'effectuer cette commande. Permission requise : `Gérer les rôles`**");
	
		let role = args.join(" ");
	    if (!role) return message.channel.send("**❌ Veuillez spécifier un rôle.**");
	    let mention = message.server.roles.get('name', role);
	    role.setMentionnable(true)
	    message.channel.send(`${mention}`);
	    await role.setMentionnable(false)
}

module.exports.help = {
	name:"mentionrole"
}

why is not fonctionnaly ?

opaque eagle
#

What error do u get? @earnest phoenix

earnest phoenix
#

When I do the command with a role name that exists, it finds it but it does not mention

opaque eagle
#

So I'm guessing the console says Can't find "roles" of undefined?

earnest phoenix
#

no

#

It says nothing

opaque eagle
#

What does it say then

#

Hmm

#

Do you suppress your errors somehow?

#

Like do u do a client.on("error") or process.on() somewhere?

earnest phoenix
#

i have a handler

#

but

opaque eagle
#

wdym by "handler"

earnest phoenix
#
const Discord = require ("discord.js");

module.exports.run = async (bot, message, args) => {
	
	if(!message.member.hasPermission("MANAGE_ROLES")) return ("**❌ Vous n'avez pas la permission d'effectuer cette commande. Permission requise : `Gérer les rôles`**");
	
		let role = args.join(" ");
	    if (!role) return message.channel.send("**❌ Veuillez spécifier un rôle.**");
	    let mention = message.guild.roles.find(`name`, role);
	    role.setMentionnable(true)
	    message.channel.send(`${mention}`);
	    await role.setMentionnable(false)
}

module.exports.help = {
	name:"mentionrole"
}
opaque eagle
#

What does ur main file look like

earnest phoenix
#

But, it's not from the..

#

The concern is that when he finds the required role, he does not answer of the latter

opaque eagle
#

Can you pls send the main file or not

#

Ik what's wrong with ur code, but what's concerning that you're saying you don't get any errors in the console... that's more important to fix

earnest phoenix
#

ok

opaque eagle
#

You have to get errors in the console...

#

But you're saying you don't.

#

That's more important to fix first

earnest phoenix
#

No, just for this command it does not send error, for others, its the e

#

for others, its send them

opaque eagle
#

It should send you an error for this command

#

But you're saying it doesn't

earnest phoenix
#

huum

opaque eagle
#

Yeah... you have to fix that first

#

That's very very important

earnest phoenix
#

just says me :

#
(node:21006) DeprecationWarning: Collection#find: pass a function instead
opaque eagle
#

Well you said you didn't get any error

#

How did that magically show up

#

Were you lying to me earlier

earnest phoenix
#

I didn't think it was a mistake me..

opaque eagle
#

Anyways you have to pass in a function

#

it works just like Array.find()

earnest phoenix
#
const Discord = require ("discord.js");

module.exports.run = async (bot, message, args) => {
	
	if(!message.member.hasPermission("MANAGE_ROLES")) return ("**❌ Vous n'avez pas la permission d'effectuer cette commande. Permission requise : `Gérer les rôles`**");
	
		let role = args.join(" ");
	    if (!role) return message.channel.send("**❌ Veuillez spécifier un rôle.**");
	    let mention = message.guild.roles.find(`name`, role);
	    role.setMentionnable(true)
	    message.channel.send(`${mention}`);
	    await role.setMentionnable(false)
}

module.exports.help = {
	name:"mentionrole"
}

Please, fix it directly if it doesn't bother you, I'm a little lost

opaque eagle
#

Dude... pass in a function

earnest phoenix
#

I put find

opaque eagle
#

Just replacing .get() with .find() won't do anything

#

You have to pass in a function

earnest phoenix
#

I don't know sorry.

opaque eagle
#
Collection.find(role => role.name === "I'm gonna copy-paste this code cuz i want to make a bot without knowing js")```
earnest phoenix
#

but I want the command to be available in all the servers where is the BOT!

buoyant wagon
#

.setMentionnable

#

.setMentionable

spring ember
#

@earnest phoenix what was the question

buoyant wagon
#

mention.setMentionable

earnest phoenix
#
const Discord = require ("discord.js");

module.exports.run = async (bot, message, args) => {
	
	if(!message.member.hasPermission("MANAGE_ROLES")) return ("**❌ Vous n'avez pas la permission d'effectuer cette commande. Permission requise : `Gérer les rôles`**");
	
		let role = args.join(" ");
	    if (!role) return message.channel.send("**❌ Veuillez spécifier un rôle.**");
	    let mention = message.guild.roles.find(`name`, role);
	    role.setMentionnable(true)
	    message.channel.send(`${mention}`);
	    await role.setMentionnable(false)
}

module.exports.help = {
	name:"mentionrole"
}

The command does not work and I do not know why!
@spring ember

#

@buoyant wagon what ?

buoyant wagon
#

mention.setMentionable because role is a string

earnest phoenix
#

k thx

#

@buoyant wagon The command still does not work

buoyant wagon
#

what does work

earnest phoenix
#

mention.setmentionable is not a function

opaque eagle
#

M caps

#

Lmao again I'm surprised by how terrible some people are at copy-pasting spoonfeed code...

earnest phoenix
#

i have this :

#
let role = args.join(" ");
	    if (!role) return message.channel.send("**❌ Veuillez spécifier un rôle.**");
	    let mention = message.guild.roles.find(`name`, role);
	    mention.setMentionnable(true)
	    message.channel.send(`${mention}`);
	    await mention.setMentionnable(false)
#

@opaque eagle I made it..

opaque eagle
#

Role.setMentionable() with one n

earnest phoenix
#

hum

buoyant wagon
#
await message.channel.send(`${mention}`);```
opaque eagle
#

Lmao yeah that too

earnest phoenix
#

What is this level there that is not going?

#

what ?

late hill
#

Do you use an ide

earnest phoenix
#

🤔

#

no

opaque eagle
#

Yeah that's a good question

#

Why what do u use to code

late hill
#

Maybe you should try one

#

It would have most likely pointed out your error

earnest phoenix
#

But I want to know why it doesn't work

opaque eagle
#

Read the console

earnest phoenix
#

STOP SAY ME !

opaque eagle
#

The error should tell everything you know

late hill
#

It doesn't work because you typed it wrong

earnest phoenix
#

stop say this *

#

sry im french

opaque eagle
#

Dude I don't like to repeat stuff that you should know already

#

But I have to...

late hill
#

I understand that you're not English but that doesn't mean you aren't capable of getting an ide

#

Which would point out these issues

#

And actually be very helpful for someone like you

opaque eagle
#

^

#

VS Code is a great one for beginners

late hill
#

(and free)

earnest phoenix
late hill
#

Oh you're coding on mobile

#

👀

earnest phoenix
#

yeah

#

and ?

opaque eagle
#

ROFL

earnest phoenix
#

what ?

late hill
#

That's a rip

#

Anyway

#

It's not working because you aren't waiting for the role to be mentionable

#

It doesn't immediately happen

#

You should await setting the role mentionable and then await sending the message

#

After that you can set it back

earnest phoenix
#

ok

#

i test this

fiery stream
#

ayy how can i get user by id

opaque eagle
#

What language

#

What library

mossy vine
#

in discord.js its client.users.get(id)

opaque eagle
#

lol

mossy vine
#

he asked about discord.js before iirc

opaque eagle
#

oh

fiery stream
#

ohh so that

#

@mossy vine A!eval client.users.get("542877354125557760").message.send("Hi")

#

cant i send msg wit that function

mossy vine
#

because a User doesnt have a message property

#

just do .send directly

#

also read the docs

fiery stream
#

ohh thx

mossy vine
#

i swear 90% of the problems in this channel could be solved by reading the docs

fiery stream
#

cant send msg

#

to this user

opaque eagle
#

DMs are probably closed in that user's settings

fiery stream
#

ohh

copper cradle
#

hmm

hollow fulcrum
#
            profilepicraw = await self.bot.session.get(f"https://www.reddit.com/user/{memepak['author']}/about.json")
            profilepicpak = await profilepicraw.json()
            profilepic = profilepicpak["data"]["icon_img"].split("?")[0]``` look at my coding gore
loud salmon
earnest phoenix
#

Does anyone have the code for virtual currencies ?? Pollux type rubies. GWqlabsPrings

night imp
#

This is not a place to be spoon-fed. There are plenty of examples online and you should first try to create what you can and ask questions relating to that rather than steal someone else's entirely @earnest phoenix

earnest phoenix
#

@night imp spoonfeed

nova atlas
#

ive been away from discord.py for a while and i cant seem to find the rewrite docs. is there even rewrite anymore? lol

naive laurel
hollow fulcrum
#

@nova atlas Rewrite is now latest

#

happy birthday

nova atlas
#

ohhhhhh

slender thistle
nova atlas
#

ive been gone longer then expected then lol

#

thanks @slender thistle

#

and ultra

buoyant wagon
#

@naive laurel why would it be private if you were to add it

naive laurel
#

"wait for an oficcial release"

#

I mean private view in the list

fiery stream
#

ayy i cant change .attr in a tag

#

why is that help me out

honest pebble
#

How i can get my bot votes? in dblapi

west spoke
fiery stream
#

A!eval client.guilds.get("506041422626029578").channels.find("name", "general").send(Pong)?

#

why doesnt that work

opaque eagle
#

What does the error saay

amber fractal
#

well that find is deprecated and ^

fiery stream
#

TypeError: Cannot read property 'send' of null

#

thats what she said

#

@opaque eagle umm?

opaque eagle
#

A channel by that name probably doesn't exist then

#

What version of d.js do u use?

fiery stream
#

latest

opaque eagle
#

master or stable

fiery stream
#

stable

#

there was no channel

#

lol

#

sorry for ping

#

for my dumb mistake

opaque eagle
#

Np lol

earnest phoenix
fiery stream
#

ayy anyone ever used mongoose cdn before if u did pls help me out

pallid zinc
#

I don't know why it's not work

#
 message.author.addFriend()
 break;```
#

No err

copper cradle
#

lmao

#

That doesn't exist

#

you can't friend a bot

earnest phoenix
#

How to get errors: run bot from phone on data

topaz sphinx
#

missing library smciota

earnest phoenix
#

reinstall android

topaz sphinx
#

microwave iphone

copper cradle
#

I just installed Windows Me on my iPad +

topaz sphinx
#

u retard smciota

#

its even less functional than fukin XP 2019

pallid zinc
#

And I install ios on Windows

earnest phoenix
#

@earnest phoenix ytb dude

#

best way to learn

#

Wait

#

(:

#

I'm not at home

#

Sry

earnest phoenix
#

wew

royal tide
#

I'm struggling to be able to get my bot to go online, I've started using a software called node but when I continued on visual studio code it keeps saying node is not recognised. Does anyone know how to help

mossy vine
#

Is node.js installed properly?

#

If it doesnt recognize node you likely didnt add it to PATH while installing

royal tide
#

How do I add it to the path

#

I'm sorry but I'm just confused

#

Do I need to uninstall and reinstall??

mossy vine
#

Likely

#

You could always just google how to add something to path

royal tide
#

Okay

#

Thanks for your help

unique nimbus
#

I prefer reading docs as I understand what to do and not by copying what someone has doe

#

Done

#

I still prefer reading docs

#

Again i prefer reading docs

rustic obsidian
#

YoU cAn LeArN fRoM dOcS LoL

#

No but i prefer docs yes

#

But i started coding with a simple tutorial.

#

And from then, i tried to learn it myself

#

wOw oK

#

cAnt i give my own opinion

#

Nah joking

crude tide
#

guys any help on slowmode wwith python?

#

@slender thistle

#

its the last ver

#

look at the error

slender thistle
#

.edit

#

Not just ctx.channel

crude tide
#

what you mean?

slender thistle
#

You are using channel property of ctx

crude tide
#

yeah

#

i make it like ctx.edit.channel?

slender thistle
#

channel is instance of TextChannel, which has function edit

crude tide
#

ohh

#

yeah i understand

slender thistle
#

Also, time: int in command function arguments

crude tide
#

done thanks

#

yeahi

#

i already did that

#

btw

#

can i send my code and see if i can like wrap it a little bit?

#

cause its too long lol

slender thistle
#

Sure

crude tide
#

dm

pallid zinc
#

 if(message.mentions.members.size == 1) { 
let member = message.mentions.members.first()
 
message.channel.send(`${message.author} gave ${member} a hug!`, { file: "https://media.giphy.com/media/CZpro4AZHs436/giphy.gif" }); } 

break;```
#

No err

opaque eagle
#

Pretty sure it has to be js { files: ["url"] }

pallid zinc
#

Ohh thanks

#

Nope it's not working even the text

opaque eagle
#

=== instead of ==?

golden surge
#

When i realised i fucked up

#

You can easily crash my bot 😦

#

Via DM's xD

mossy vine
#

how do you even manage to do that

#

im actually curious

#

what fucking tutorial do you follow to manage that happen

modern sable
#

magic

pallid zinc
#

Ok

golden surge
#

Im not following a Tut ma dude 😛

#

a simple ```JS

if (message.guild == null) {
    await message.channel.send("No no, not here")
    return;
#

fixed it

#

Just forgot to add it in xD

mossy vine
#

please give me that tutorial lmao

golden surge
#

What tutorial ?

mossy vine
#

oh wait

#

nvm

#

i cant read ok

golden surge
#

😛

pallid zinc
#

Not working even with ===

amber fractal
#

Could just use the channel type

#

And if you wanted that !message.guild would probably be better

pallid zinc
#

Where?

#

I am noob

warped ruin
#

How to shard a bot using discord bot maker

amber fractal
#

Go into the code

golden surge
#

Anyway to remove [ws] [connection] Heartbeat acknowledged, etc from showing in the console ?

#

it is annoying as fuck

mossy vine
#

thats commando isnt it?

#

i think theres a client option to disable it

golden surge
#

Im using discord.js 🤷

#

no idea where to find it

mossy vine
#

no i mean

#

discord.js-commando

#

youre using that arent you?

golden surge
#

Where would i be able to find that out

#

I dont recall using .js-commando

mossy vine
#

how are you creating your client?

golden surge
#

Internal via VS ( for testing ) Linux for the main bot. it shows on both clients

mossy vine
#

i mean

#

new Discord.Client()

#

?

pallid zinc
#

client or bot

#

Or Client

golden surge
#

client.on

#

🤷

pallid zinc
#

Like I created my bot as sh*t

mossy vine
#

no not that

#

const client = ???

pallid zinc
#

he sad client

golden surge
#

ohhhh

#
const client = new Discord.Client();
mossy vine
#

huh

#

so thats not commando

golden surge
#

👍

mossy vine
#

i dont know why its sending those then

golden surge
#

😦

mossy vine
#

only had that when i was testing a commando-based bot i was contributing tho

golden surge
#

Kms

#

Found the issue

opaque eagle
#

KMS = Kiss My Self ?

buoyant wagon
#

Kill My Self?

mossy vine
#

kms = kill myself

#

which you should never ever even consider doing

ruby dust
#

no shit sherlock, how about just typing it, since that violates community guidelines

earnest phoenix
#

fun fact if you kill yourself you die

#

wrong channel

#

when you try installing new modules but pips like "nah i dont exist anymore"

golden surge
#

Anyone know this issue

#

we cant find it anywhere

#

Yes you now know my name

west spoke
#

Are you trying to edit a message?

crude tide
#

Guys what do you need visual studio for?

mossy vine
#

visual studio is an ide

crude tide
#

Oh

mossy vine
#

it helps you write code more effectively

crude tide
#

Like pycharm?

mossy vine
#

and also has some nice integrated tools

#

exactly

crude tide
#

Lol i use pycharm

opaque eagle
#

Who needs visual studio when u got notepad

crude tide
#

Yeah lol

mossy vine
#

im in the vim gang

crude tide
#

Notepad for life

#

Xyber

#

Whats better

#

Pycharm or visual studio

mossy vine
#

fuck if i know, never used pycharm and only used visual studio for an hour

opaque eagle
#

They're for different langs

mossy vine
#

i use vim and vscode

opaque eagle
#

I use vim and webstorm

mossy vine
#

visual studio has python support

opaque eagle
#

and goland

#

and intellij

crude tide
#

Oh nice i use pycharm lol

#

Btw

opaque eagle
#

pretty much all the jetbrains editors

crude tide
#

What you need database for

#

The bot

#

How can he use it

#

Like leveling stuff?

opaque eagle
#

Storing things like channels, economy currency values, etc

#

yeah leveling too

crude tide
#

Wym storing channels

mossy vine
#

a database is for storing literally anything

crude tide
#

I know i know

#

But ehu

#

Why

mossy vine
#

to

#

to store literally anything

crude tide
#

Yeah why lol you dont need to store channels

#

They already exist

#

In the server

mossy vine
#

fetching from a database can be faster afaik

opaque eagle
#

Like if a user wants to set which channel they want mod logs in, etc

mossy vine
#

yeah but even then storing the id is enough

opaque eagle
#

Yeah

crude tide
#

If a user want to set logs chqnnel

#

He can just type a commad

#

To create that channel

#

Amd assign logs to it

#

I mean its already created in thr server

#

Why making database and it wont help

earnest phoenix
mossy vine
golden surge
#

Here is the code

west spoke
#

I dont know shiz about java

golden surge
#

oof

#

Good old JS 😛

west spoke
#

Py

mossy vine
#

isnt that js

grim aspen
#

that's js

golden surge
#

yes @mossy vine i just said that xD

mossy vine
#

yes ok

west spoke
#

Whatever from the preview it looks like java..

mossy vine
#

im proud of you

west spoke
#

Leave me alone cri

grim aspen
#

what is the error if you're recieving one?

golden surge
#

When it edits the message one of them comes up with a Node error

#

let me see if i can re create the error and send it

#

1 sec

mossy vine
golden surge
#

{ DiscordAPIError: Unknown Message
at item.request.gen.end (C:\Users\Jake\Desktop\GIT HUB\Discord-Test-Bot\discordbot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:79:15)
at then (C:\Users\Jake\Desktop\GIT HUB\Discord-Test-Bot\discordbot\node_modules\snekfetch\src\index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
name: 'DiscordAPIError',
message: 'Unknown Message',
path:
'/api/v7/channels/574658802268241962/messages/582575541434056717',
code: 10008,
method: 'DELETE' }

#

Yes u now know my name now

mossy vine
#

what line are you getting that on

golden surge
#

🤷

mossy vine
#

oh nvm

#

im literally blind

slender thistle
#

We don't care about your name, no need to say that again and again

golden surge
#

@slender thistle I am kindly going to say Shh

slender thistle
#

ily2

golden surge
#

mossy vine
#

wait what

#

you are getting it on index.js

#

wait this is index.js

#

a part of it

#

so we have no idea what line youre actually getting it on

golden surge
#

Correct

mossy vine
#

so we cant help you

golden surge
#

oof 😦

mossy vine
#

because we dont know where the error is coming from

#

can you open up your index.js file and tell us which line youre getting the error on on the paste

golden surge
#

i will do that 😃

#

line 215

#

(err) => cb ? cb(err, err.status ? err : null) : Promise.reject(err)

mossy vine
#

uh

#

theres nothing like that in the code snippet

#

also pls dont ghost ping

#

oh wait

golden surge
#

U started typing as i hit enter

#

so i del it

#

😃

mossy vine
#

thats the discord.js code

#

not the code you wrote

#

and is also not in the index.js file

golden surge
#

That is the Index.js

mossy vine
#

what

#

index.js:215

golden surge
#

correct

mossy vine
#

theres nothing like that in the code you sent

mossy vine
#

nothing like that in your code

#

at least

#

the one you sent on pastebin

golden surge
#

il dm you all me code

#

if thats ok ?

mossy vine
#

sure

#

ig

west spoke
#

Remember to take out the token

mossy vine
#

he did

topaz sphinx
#

who

#

uses

#

javascript

#

in visual

#

studio

west spoke
#

me

mossy vine
#

who

#

cares

topaz sphinx
#

visual studio is mostly used for HUGE libraries

#

like Unreal library

#

or Unity

#

or BDL

light matrix
#

lol

#

i should make a game

topaz sphinx
#

but NOT for discordbots made within like 4 hrs of coding

#

or even a little larger

#

those things should stay within the visual studio code environment

#

due to a) simplicity, no need to worry about file mismatch or adress location failure

#

b) speed, alot faster to start up the program and get into the IDE

earnest phoenix
#

there’s not rules on what ide to use

#

i personally think npp is futile and shouldn’t be used for anything but people still use it

golden surge
#

My token is not in the main script

#

its in config.json

grim aspen
#

bad idea

golden surge
#

I only sent him _main.js

grim aspen
#

if you were to send the full code i could find it in the config.json since it's automatically not hidden

golden surge
#

i did not send him config.json or settings,json so he cant get my token

#

and i sent it in a pastbin so he has the code only

mossy vine
#

he only posted the main.js file in a pastebin so i have no idea about the json files

pale mango
#

Hey guys.

#

Does anyone have an open source discord bot?

earnest phoenix
#

there are a lot on github

west spoke
#

@pale mango you wont be able to add it here

pale mango
#

I know.

earnest phoenix
#

you can't add an open source bot to here?

#

did not know that

west spoke
#

Nope

#

You have to alter the code a lot to add it

earnest phoenix
#

im ok with that i was gonna keep mine closed source lol

west spoke
#

You just can't use someone else's code without modifying it

earnest phoenix
#

i don't use other people's code anyway lol

west spoke
#

K goof

#

You can upload yours

#

That's fine

inner jewel
#

there's no problem adding an open source bot here if it's yours

west spoke
#

^

earnest phoenix
#

ah alright

west spoke
#

Just not someone else's

inner jewel
#

what you can't do is download the code and add an unmodified copy

west spoke
#

^^^

earnest phoenix
#

i use the klasa framework but that's not really copying someone elses code

#

since its made to be used by other people

cunning oxide
#

adds guidebot to server @inner jewel

west spoke
#

ree

earnest phoenix
#

hey can someone help me, pips decided its not gonna work any more, tried a complete reinstall

west spoke
#

What happened?

#

@earnest phoenix are you trying to install async discord.py?

earnest phoenix
#

no i got that, just wanna get Flake8

#

got all the required things to run the bot and connect it

#

ah no ok nvm im stupid

#

what would i do if i want some like

const admins = ["ID HERE", "ID HERE ETC"]```

And it work with all commands with it being in index. and by updating it with eval like :
`;eval admins.push('ID HERE');`
mossy vine
#

it will work... until your bot restarts

earnest phoenix
#

it donest?

#

don't*

mossy vine
#

no

#

all variables are reset to default value

#

use a database

opaque eagle
#

or to decide if they're an admin or not, check if they have an admin role in ur bot's support server or smth

#

so u can easily add and remove admins

digital sparrow
#

Can you help me make help command? Discord.js

warm marsh
#

Depends.

digital sparrow
#

:D

warm marsh
#

Em.

#

Sorry I'm not very good at JavaScript. I mainly use perl.

west spoke
#

You can do it yourself

digital sparrow
#

Help ?!?

warm marsh
#

Uno reverse?

#

A help command is just like any other command.

west spoke
#

^

digital sparrow
#

Hm

near ether
#

All I did was make my bot send a formatted embed with commands when you ask for help

#

It shouldn’t be any different from other commands as paradox said

cunning oxide
#

^ what they said. Not worth doing otherwise unless you want like a Dynamic one.

warm marsh
#

if you use external files

#

just make an addition like help = {}

#

if you use Js module.exports.run = async() => {}

#

Wow

#

Ok.

mossy vine
#

or make it read dynamically

warm marsh
#

That would be dynamically.

mossy vine
#

js on Line with `

#

whant

#

WHAT

earnest phoenix
#
const Discord = require ("discord.js");

module.exports.run = async (bot, message, args) => {
	
	if(!message.member.hasPermission("MANAGE_ROLES")) return message.channel.send("**❌ Tu n'a pas la permission de gérer les rôles pour effectuer cette commande.**");
	if(!message.guild.me.hasPermission("MANAGE_ROLES")) return message.channel.send("**❌ Je n'ai pas la permission de gérer les rôles pour effectuer cette commande.**");
	
	let demande = args.join(" ");
	if(!demande) return ("**❌ Veuillez m'indiquer un rôle à donner à tout le serveur.**");
	
	let role = message.guild.roles.find(`name`, demande);
	
	await message.channel.send("**✅ L'envoi du rôle à tout le serveur en cours. Cela peut prendre quelques minutes..**");
	message.guild.members.forEach(e => {
		(e.addRole(role)) 
		});
}

module.exports.help = {
	name:"roleall"
}

Error :

(node:4845) UnhandledPromiseRejectionWarning: TypeError: Supplied parameter was neither a Role nor a Snowflake.

How can i do dude please ?

warm marsh
#
console.log(true);
#

So works there....

#

@earnest phoenix

#
let role = message.guild.roles.find(role => role.name == demande);```
mossy vine
#

@earnest phoenix first of all, give .find a function

#

^ like that

earnest phoenix
#

thx

late hill
#
return ("**❌ Veuillez m'indiquer un rôle à donner à tout le serveur.**");```
#

was that

earnest phoenix
#

I did the update and that's the worry

const Discord = require ("discord.js");

module.exports.run = async (bot, message, args) => {
	
	if(!message.member.hasPermission("MANAGE_ROLES")) return message.channel.send("**❌ Tu n'a pas la permission de gérer les rôles pour effectuer cette commande.**");
	if(!message.guild.me.hasPermission("MANAGE_ROLES")) return message.channel.send("**❌ Je n'ai pas la permission de gérer les rôles pour effectuer cette commande.**");
	
	let demande = args.join(" ");
	if(!demande) return message.channel.send("**❌ Veuillez m'indiquer un rôle à donner à tout le serveur.**");
	
	let role = message.guild.roles.find(`name`, demande);
	
	await message.channel.send("**✅ L'envoi du rôle à tout le serveur en cours. Cela peut prendre quelques minutes..**");
	                message.guild.members.map(member => {
                        member.addRole(role)
                    })
}

module.exports.help = {
	name:"roleall"
}

Error :

(node:5558) UnhandledPromiseRejectionWarning: TypeError: Supplied parameter was neither a Role nor a Snowflake.```
late hill
#

epic

#

now change the find()

#

so it uses a function

earnest phoenix
#

where ?

mossy vine
#

o h b o y

earnest phoenix
#

owh ok i find

#

but

#

I replace it with what?

late hill
#

basically do what strangeparadox said but use === instead

#

because that's epic

warm marsh
#

...

#

You don't require to use 3 =

mossy vine
#

^

late hill
#

They will both be strings

mossy vine
#

=== is just == but type checking as well

late hill
#

So you should

mossy vine
#

if we know we are dealing with the same data type why the ===?

late hill
#

A developer who knows the difference should use them accordingly.

#

Because

#

When another person reads your code and sees only 2 of them

#

They will assume there was a reason why you used 2 instead of 3

mossy vine
#

okay see now thats a valid answer

late hill
#

👌

#

bless mathias best teacher

quartz kindle
#

=== should also be faster than ==

vernal rivet
#

does anyone know how to do sqlite stuff in c#?

earnest phoenix
#

I took your advice, the command works, but in the console there are time errors (its going too fast). How do I settle this?

mossy vine
#

you dont abuse the api by giving everyone a role

#

how about you actually respect discords rate limits and wait a bit between each call

earnest phoenix
#

So?

mossy vine
#

oml my head

earnest phoenix
#
does anyone know how to do sqlite stuff in c#?```

just like you'd do regular sql, or if you don't want a headache use ef core
#

I set an interval?

vernal rivet
#

thats not what i mean. i already did that, but my database won't enter a new entry.

earnest phoenix
#

In an interval function, for two seconds I put what? 2000 ?

#

🤷 i don't do sql because hand writing it is a nightmare

#

i use ef core instead

#

create models and ef core binds them and writes sql commands

#

In an interval function, for two seconds I put what? 2000 ?

quartz kindle
#

all timings are based on milliseconds, so yes, 2000 ms = 2s

earnest phoenix
#

thx

#

@quartz kindle
So the interval is good?

const Discord = require ("discord.js");

module.exports.run = async (bot, message, args) => {
    
    if(!message.member.hasPermission("MANAGE_ROLES")) return message.channel.send("**❌ Tu n'a pas la permission de gérer les rôles pour effectuer cette commande.**");
    if(!message.guild.me.hasPermission("MANAGE_ROLES")) return message.channel.send("**❌ Je n'ai pas la permission de gérer les rôles pour effectuer cette commande.**");
    let role = message.mentions.roles.first();
    if(!role) return message.channel.send("**❌ Veuillez m'indiquer un rôle à donner à tout le serveur.**")
    message.channel.send("**✅ L'envoi du rôle à tout le serveur en cours. Cela peut prendre quelques minutes..**");
         message.guild.members.map(member => {
         	setInterval(member, 3000);
         function member() {
                        member.addRole(role)
         setTimeout(function() {
            	})
           })
}

module.exports.help = {
    name:"roleall"
}
hushed quarry
#

did you test it

earnest phoenix
#

The name of the Member interval is false? If so, I don't know what to put

quartz kindle
#

i can see disaster happening with that code lmao

earnest phoenix
#

Seriously, it's not with her that I'm going to move on..

quartz kindle
#

if you have 500 members, you will create 500 setIntervals

earnest phoenix
#

NO

quartz kindle
#

thats what the code is doing

earnest phoenix
#

Oh okay, I fix that how?

mossy vine
#

learning how setInterval works maybe by reading documentation would be a good start

earnest phoenix
#

ok

quartz kindle
#

here's a hacky way to do it

#
for(i = 0; i < 5; i++) {
    result = await new Promise(r => { setTimeout(t => { r(i) },3000) })
    console.log(result)
}```
earnest phoenix
#

And I put her in the loop?

#

dont put a woman in a loop thats not healthy

quartz kindle
#

basically, executing a loop with an interval between each iteration is not so simple. one way is to await promises, the other way is a recursive function

#

so good luck figuring it out

copper cradle
#

@earnest phoenix do u speak spanish?

earnest phoenix
#

no, french

copper cradle
#

hmm

#

still

#

nice

fiery stream
#
  <a id="sign-in-or-dashboard-button" class="text-white btn button" role="button" style="margin-left: 25px">
    
  </a>```
#

if i have img like outside a tag the id works if i do it inside a it crashes help

#
    <img id="pfp"  width="50" height="50" style="border-radius: 25px; margin-left: 911px">
  </a>```
#

like that not really crash but img does not show up

#

and its jquery

#
    if (user) {
      $("#user-name").html(user.w3.ig);
      $("#sign-in-or-dashboard-button").html(user.w3.ig).attr("href", "/Dashboard.html");
      $("#pfp").attr("src", user.w3.Paa.replace("s96-c", "s512-c"));
      console.log(user);
    } ```
#

thats js

west spoke
#

That's odd

#

I use <a><img> all the time