#development

1 messages · Page 459 of 1

warm prairie
#

his promise is hanging after update, even when its reflected in the db.

fluid basin
#

Well

#

Tbh you shouldn't be returning a promise in a promise

#

Thats bad

warm prairie
#

not necessarily

fluid basin
#

you should await the coll.update and then return that

hushed berry
#

iirc, the cloud function docs reccomend that you return a promise from the function or smth

warm prairie
#

you can do a promise inside a promise catch - or you can use async and use await - essentially doing the same thing

hushed berry
#

if i await it, it does the same thing btw willi

fluid basin
#

well idk tbh bloblul

#

nvr tried

#

Wait nik is that your code @hushed berry

hushed berry
#

@fluid basin yeah, in the hastebin link

fluid basin
#

Well

#

Just really curious why you would need to use that as a seperate module xD

hushed berry
#

because I dont wanna have to setup and deploy a server specificly to handle the incoming webhooks lmao

fluid basin
#

hmm

#

Can you do me 1 thing

#

Log client after you awaited the mongo conn

#

@hushed berry

visual surge
#

leveldb js, does this look right? I don't want to break my db just yet :p

const level = require('level')
const db = level('./db', { valueEncoding: 'json' })

db.put('key', 'value');

function dbHas(key){
  db.get(key, function (err, value) {
    if (err) {
      if (err.notFound) {
        return false
      }
      return false
    }
    return true
  })
}


console.log(dbHas('key'))
lapis robin
#

how do i create bots

visual surge
#

oof

cinder stratus
#

@lapis robin learn coding

lapis robin
#

ok

#

hmmmmmmmmmmmmmmmmm

zealous veldt
#

lol

cinder stratus
#

i will suggest you js @lapis robin

lapis robin
#

but where do i code

#

do i code in cmd

visual surge
#

Watch that

lapis robin
#

ok

visual surge
#

^ That too :p but the Discord bot part is in the video, as long as you can understand the programming it's helpful

#

Nothing too complicated either way

lapis robin
#

what i was thinking tocode was this

cinder stratus
lapis robin
#

ok thx

visual surge
#

UwU

lapis robin
#

Wait there is one more thing u forgot

#

GITHUB yas

#

Oh i get it now this is the same with scripting in roblox

visual surge
#

xD alrighty

earnest phoenix
#

I need help

#

But not now 😂

visual surge
#

xd

earnest phoenix
#
npm ERR! canvas@1.6.11 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.6.11 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Any idea on how to fix this. I've searched around and I can't seem to get it fixed.

austere meadow
#

do you have the build tools installed?

earnest phoenix
#

nope

austere meadow
#

what OS are you on

earnest phoenix
#

Windows 10

austere meadow
earnest phoenix
#

👍

austere meadow
#

you need microsoft-build-tools and libjpeg-turbo

#

no worries

earnest phoenix
livid whale
#

It say my bot is waiting for approval ?

gilded plankBOT
#
rb08081#5441
Bots

@tall halo

fluid basin
#

yup

livid whale
fluid basin
#

It should take around few hours to a few days

#

Really depends

paper mortar
#

Is a 20c bribe acceptable?

livid whale
#

😅 😅

fluid basin
#

Anyways in the meanwhile you could try to ensure your bot is functioning correctly and online, also that it doesn't break any rules of Discord or the server

livid whale
#

It is working well

#

And not breaking any rule

fluid basin
#

Which will have a higher chance of being approved

#

Oh thats good to hear

livid whale
fluid basin
#

I guess you'll just need to wait then

livid whale
visual surge
#
var connection = null;
client.r.connect( {host: 'localhost', port: 20815}, function(err, conn) {
    if (err) throw err;
    connection = conn;
})```
Ok so I have no idea whatsoever as to what i can do here.
I'm currently running on glitch and I want to get this rethink db working. Problem is, of course since this isn't hosted on my computer, localhost doesn't work.
fluid basin
#

I don't think glitch supports running rethinkDB server

visual surge
#

Hmm

#

Well that kinda sucks

fluid basin
#

Not 100% sure on that but it is highly the case but still if its possible it'll be really hard to setup

visual surge
#

Well hopefully I can get rid of this hosting situation soon...right now it's great because if the bot goes offline (which is pretty uncommon now) people can start it up by going to a short link to the project

fluid basin
#

You do know that you can keep it always online by just letting the bot visit that link

visual surge
#

What, with glitch?

fluid basin
#

yup

#

https://anidiotsguide_old.gitbooks.io/discord-js-bot-guide/content/other-guides/hosting-on-glitchcom.html

#

Under "Keeping the project 'alive'"

visual surge
#

Yeah I have pings setup, just earlier got it setup from the external source. The bot would go offline every few days or so beforehand (maybe it won't now)

#

That's the main reason I like glitch

earnest phoenix
#

need help

#

makin a loop

#

command

visual surge
#

Specifics?

#

what does it do?

#

@earnest phoenix

earnest phoenix
#

loop

#

for a music

#

bot

#

making it play the same song for that amount of times

visual surge
#
let num = 37
for(let i=0;i<num;i++){
  //your code
}```This will loop `//your code` 37 times
earnest phoenix
#

wow

paper mortar
#

If it has a queue, just add it to the queue multiple times.

earnest phoenix
#

python

#

@visual surge

visual surge
#

Idk haha

livid whale
#

A issue

visual surge
#

My brain is fixed on JS and I forget this server supports everythang

livid whale
#

I made a request for my bot

earnest phoenix
#

@livid whale dont ask

#

they

#

add

#

1 month

#

on the waiting time

#

@visual surge not an issue

#

@livid whale just 3 to 4 days and you will be all set

visual surge
#

^at most, usually quicker

earnest phoenix
#

^

visual surge
#
var num = 7
for x in range(num):
  yourCode
#

I'm extremely unfamiliar with python but I mean, that should work as a loop I guess xD

earnest phoenix
#

so

#

where do i put this

#

we are trying to loop the song that is playing

paper mortar
#

when a user executes loop <number>, basically just loop the request command over and over, it'll add it to the queue. That is, if your bot does have a queue.

#

that's a messy way, but it should work (I don't recommend keeping it this way if you end up doing it like this.)

earnest phoenix
#

i dont want to do it like this

#

i want the song to be looped for as many times as the user inputs

#

and then it plays the song for that many times and if someone puts something to the queue it breaks the loops

#

or untill the loop is finsihed

paper mortar
#

idk python enough to explain it, really. Plus I don't know how your bot works lol

earnest phoenix
#

well i can send you the bot

#

file

serene plover
#

Why not just check if the song is finished then do your stuff after?

wide ruin
#

hey

#

just a python question

#

please dm me if you know about tkinter

#

the code is quite long

#

i will delete this message when somebody dms me

earnest phoenix
#

@serene plover wouldnt change match

sour perch
#

is there a way to check if the input is an id in d.js?

ruby dust
#

wdym?

sour perch
#

like if argument 1 is an id continue, else return

ruby dust
#

what I do in discord.py is attempt to get the object with the given id, if discord didn't return anything then it's not an id of that object type

sour perch
#

hm, that might work

ruby dust
#

but that might not always work on specific occasions

#

for example, an id of that server might exist, but your bot will not return it if the bot is not in that server

sour perch
#

what im doing is im making a settings command, where i want them to specify which role that is the mute role, but then i have to make sure that that argument is a role on the server, might be other ways to do that then to check for id...

ruby dust
#

idk if discord.js has that, but there's a way to get an object from a given iterator, and the same logic applies here wether it returns an object or nothing at all

sour perch
#

yeah, i think thats an function

#

ill do some reserch on roles

earnest phoenix
#

i need helpin

#

makin

#

somethin

#

called

#

loopin

#

for a musicin bot causein people askin me to make it

sour perch
#

you need help making a loop?

earnest phoenix
#

yeah

sour perch
#

what language?

earnest phoenix
#

if this helps

#

python

sour perch
#

sorri i dont know that

#

phyton

earnest phoenix
#

np brother

earnest phoenix
#

?

earnest phoenix
#

const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
what i need to change the 'password'

cinder patio
#

Um guys

#

when you do

#

\:seven: discord doesn't turn it into it's unicode emoji

#

\7⃣

#

\6⃣

#

\5⃣

#

\🔟

#

it works with 10 though

mortal ruin
#

\:customemoji: shows how you would format it in code

#

for example, \:tickYes:

#

i don't know if you already knew that, but...

slender thistle
#

\7⃣

#

Oh

cinder patio
#

I was not talking about that

#

at all

topaz fjord
#

/7⃣

zealous veldt
#

se

#

ven

upper ember
#
  app.post("/me", checkAuth, (req, res) => {
    usersDB.get(`SELECT * FROM users WHERE id = ?`, [req.user.id], (err, row) => {
      if (err) {
        return console.error(err.message);
      }
      if (!row) {
        usersDB.run(`INSERT INTO users(id, title, bio) VALUES(?, ?, ?)`, [req.user.id, req.body.title, req.body.bio], function(err) {
          if (err) {
            return console.log(err.message);
          }
        });
      } else {
        usersDB.run(`UPDATE users SET title = ?, bio = ? WHERE id =? `, [req.body.title, req.body.bio, req.user.id], function(err) {
          if (err) {
            return console.error(err.message);
          }    
        });
      }
    });
    res.redirect("/me");
  });
#
<%- include('blocks/header', {bot, user, path}) %>
  <div class="container">
      <div class="container">
        <div class="row justify-content-md-center">
          <div class="col col-10"><h3>Your profile</h3>
          </div>
        </div>
    </div>
    
<form method="post">
    <label for="title">Title</label><br /> 
    <textarea name="title" cols="30" rows="2"><%= userTitle %></textarea><br /> 
    <label for="bio">Bio</label><br /> 
  <textarea name="bio" cols="30" rows="2"><%= userBio %></textarea><br /> 
  <button type="submit" class="btn btn-primary">Save Changes <i class="fa fa-fw fa-save" aria-hidden="true"></i></button>
</form>
<br>
<h6><strong>Your exp:</strong> <%= userExp %></h6>
<h6><strong>Your level:</strong> <%= userLevel %></h6>
<h6><strong>Your rank:</strong> <%= userRank %></h6>
    <% include ./blocks/footer %>
#

help here FingerWave

gilded blaze
#

checkAuth might be returning false

upper ember
#

it doesn't

livid whale
#

hi

topaz fjord
#

Putting /me in the URL means it's a get

livid whale
cold niche
#

What is the legacy bool in the DBL /bots endpoint responses?

uncut slate
#

Bot pages were given a massive rework some time ago, I believe the legacy parameter is for bots that were still on the old schema (which there are none of anymore)

cold niche
#

oh, I see

#

Thanks

upper ember
#
  client.on('messageUpdate', Message => {
  let serverid = Message.guild.id;
  client.serverlogMessageEdited(serverid, Message.before.content, Message.after.content, Message.after.author, Message.after.channel, Message.after.id);
  })
#

a little help in here

earnest phoenix
#

There’s 2 params, oldmessage and newmesaage

upper ember
#
  client.on('messageUpdate', before, after  => {
  let serverid = Message.guild.id;
  client.serverlogMessageEdited(serverid, before.content, after.content, after.author, after.channel, after.id);
  })
#

is that ok?

earnest phoenix
#

Yeah I think

#

Try it

#

inb4 Message is not defined

#

Nono

#

Its an event

#

With a callback

upper ember
earnest phoenix
#

wrong syntax

upper ember
#

gaaa

earnest phoenix
#

you need (before, after) probably

#

Yea

upper ember
#

can you just show me an example? think

#
 client.on('messageUpdate', before, after  => {
  let serverid = after.guild.id;
  client.serverlogMessageEdited(serverid, before.content, after.content, after.author, after.channel, after.id);
  })
#

I did that

earnest phoenix
#

No () is for only 1 param

#

It’s (before, after) =>

#
(param1, param2, …, paramN) => expression```
upper ember
#

client.on('messageUpdate', (before, after) => {
let serverid = after.guild.id;
client.serverlogMessageEdited(serverid, before.content, after.content, after.author, after.channel, after.id);
})

earnest phoenix
upper ember
#

so like this?

earnest phoenix
#

Yes

lilac dome
#

Whats the code for the kick command?

upper ember
#

let member = message.mentions.members.first()
let reason = args.slice(1).join(' ');
if(!reason) reason = "No reason provided";
member.kick(reason)

lilac dome
#

Oof 'let' is underlined in red

knotty steeple
#

@upper ember spoonfeed

#

read the docs™

lilac dome
#

@upper ember Can u help me pls

spring ember
#

Ask the question

lilac dome
#

I asked roy Whats the code for the kick command?

upper ember
#

wait

#

what lib?

spring ember
#

No spoon feeding ree

lilac dome
#

lib?

upper ember
#

discord.js?

#

JDA?

lilac dome
#

no

upper ember
lilac dome
upper ember
#

oh, Imma not a c# developer.. at least not a c# bots developer

lilac dome
#

@spring ember Can u help?

upper ember
sour perch
#

yo, i tried to make custom prefix in js, and use this line in the message event: ```const prefix = ${guildConf[message.guild.id].prefix}

quasi hearth
#

maybe it is because you are using a constant? idk

sour perch
#

what should i do then?

heady zinc
#

that guild.id is undefined? thonk

knotty steeple
#

means its not stored

#

wait

sour perch
#

no, it says cannot read property id off null

heady zinc
#

uh, are you using eris thonk

sour perch
#

no, discord.js

knotty steeple
#

also you dont need that template literal

#

wew

heady zinc
#

then there's something wrong with your message/the error doesn't come from here specifically

#

actually i guess in dm it would cause this error

#

but only if you didn't prevented it

sour perch
#

yup i see that one ^^

#

thanks for the hint

knotty steeple
#

while you all are here whats the hex code for blurple

#

nvm

upper ember
knotty steeple
#

i already found it

#

thats why i said nvm

sturdy chasm
#

I have a question that pertains to discord. js and javascript. I want to get my bot to post an array variable from another file. In total, I have a record. js, an array. js, and the main file included in an "index. html" file. I have the array using the so called "record", what I'm trying to have main do is post a record field in array[1]. It sees where the array's coming from, yet when I try to get it to post a variable, it gives an error of "ReferenceError: TrapList1 is not defined". Could I get pointed in the right direction to look?

quasi hearth
#

uhh. So.... you are trying to access a variable from one process in another one?

sturdy chasm
#

Yes. I used VS Code to see if it can see everything, and it all came back positive in the coding. It's the actual calling where I get an error

quasi hearth
#

I am 90% sure that two different javascript files cannot directly access variables from each other. You will probably want to use a database

gilded blaze
#

Use module.exports

topaz fjord
#

well if you make a function in the other file that returns that value and call that function in your file you can

upper ember
#
{ Error: Cannot find module '../build/Release/canvas.node'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/root/oliver/node_modules/canvas/lib/bindings.js:3:18)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3) code: 'MODULE_NOT_FOUND' }
``` ![FingerWave](https://cdn.discordapp.com/emojis/474337696689422336.webp?size=128 "FingerWave")
quasi hearth
#

did you put this "canvas.node" thing in the correct place? :p

upper ember
#

?

sturdy chasm
#

@topaz fjord which file would I have to put one into?

quasi hearth
#

is this for a website or a discord bot?

topaz fjord
#
// file1.js
const func = require('./file2.js');

console.log(func.test());
// will log ['1', '2']
// file2.js

const arr = ['1', '2'];

module.exports.test = function () {
    return arr;
}
#

@sturdy chasm

gilded blaze
#

@topaz fjord Does it even need to be a function?

sturdy chasm
#

@quasi hearth this is for a discord bot, but what I'm trying for is neat coding so that, when I want to mess around with it I don't have to cipher through long walls. Basically, the array is to keep a list of traps for D&D use, the record is just for storing it with info

topaz fjord
#

if you want to make a global you can @gilded blaze

#

but its not really recomended

gilded blaze
#

Well it could just be module.exports.test = arr if i remember correctly

topaz fjord
#

^

#

i usually do func

sturdy chasm
#

thanks, I'll have to try these out later tonight. family just told me their waiting for me to join them to dinner.

unique star
#

For easier purpose you can do module.exports = arr if you dont want to put a .test after the variable you defined the require as

sturdy chasm
#

alright, I just made of note of it, thanks

sturdy chasm
#

@topaz fjord so I quickly tested what you sent me before I left my house, as well as what everyone else said about module.exports. what you sent works, however it sends it to console instead of to a discord chatroom it received the command from.

topaz fjord
#

Yes

#

You will have to replace the console.log the thing you use to send

sturdy chasm
#

Ah, ok. Thanks.

viscid falcon
#

any good api for fornight?

shy rose
#

google is good this time of year

viscid falcon
#

for getting fortnight stats?

#

i couldnt find any good ones

shy rose
#

i mean there are lots

viscid falcon
#

i speeled it fortnight opps

shy rose
wide ruin
#

On normal python, is there a way to get a random number between 000000 and FFFFFF

sullen path
#

random.randint(0, 16777215)

wide ruin
#

And then to convert to hex?

#

@sullen path

sullen path
wide ruin
#

I mean in python

#

Basically I want a random hex code

viscid falcon
#

how would i check if a role exists with discord.js

knotty steeple
#

just find the role by name

sick cloud
#

check if the roles collection for the guild or guildmember has a role

knotty steeple
#

if it cant find it not exist

sick cloud
#
<guild>.roles.has('id')``` would work
viscid falcon
#

thanks

knotty steeple
#

wouldnt getting it by name be better Thonk

viscid falcon
#

oh yeah id is exclusive to guild isnt?

knotty steeple
#

yes

viscid falcon
#

how would i check by name

knotty steeple
#

i dont know

viscid falcon
#

@sick cloud how would i check by name

sick cloud
#

you don't, names are unreliable

#

just use IDs

viscid falcon
#

but ids are exclusive to guilds

#

i am rlly confused

quartz kindle
#

what do you want to do?

viscid falcon
#

check if a role exists on the server

#

but doesnt id vary from server to server for each role

quartz kindle
#

but for what purpose?

viscid falcon
#

i need to see if a person has an announce role , if they do they can use a _announce command to announce something to the server

sick cloud
#

role names can change

#

role IDs can't

quartz kindle
#

you're better of letting each server setting the role

#

instead of hardcoding it by name

viscid falcon
#

how would i do that?

sick cloud
#

a database

quartz kindle
#

so instead of checking if X exists

#

make a database and a command that the person can use

#

like setaccouncerrole rolename

#

and you save the role id

viscid falcon
#

i was kinda trying to avoid data bases at first

zealous veldt
#

yeah good luck with that lol

#

databases are kidn of essential

viscid falcon
#

ik

#

but im still learning

quartz kindle
#

if you want to avoid it and use a hardcoded name

viscid falcon
#

which i do

quartz kindle
#

then do something like .roles.find(role => role.name === "yourhardcodedname")

viscid falcon
#

thank you

quartz kindle
#

i havent done that myself so idk if it works

#

also, are role names case sensitive?

#

if they are, you should use .toUpperCase()

viscid falcon
#

i was planning on having it create a set of roles at join

knotty steeple
#

or .toLowerCase()

sick cloud
#

role names are case sensitive

quartz kindle
#

uppercase is better

viscid falcon
#

why

quartz kindle
#

there was several articles about it, i dont really remember, but apparently lowercase can have weird interactions

#

which apparently they are also outdated, and the best method now is .toLocaleCompare() used in combination with either or them

#

lmao

knotty steeple
#

toLocaleCompare()?

#

tf does that do

quartz kindle
#

its an internationalization problem

#

some non-english characters in some languages do not have upper/lower case variants and might be converted into something else

earnest phoenix
zealous veldt
#

I'm going to guess that's a code issue

earnest phoenix
uncut slate
#

that looks fine, unless you're caching command input/output it's just js randomness being fucky

earnest phoenix
#

Lol

#

Js is quite fucky

#

Yes I just got tails in a testing channel

zealous veldt
#

lol

earnest phoenix
#

Is there a way to get all the emoji a bot has access to in a collection?

gilded blaze
#

Just loop through guilds

#

And get emojis from each one

earnest phoenix
#

Great

#

he says sarcastically

uncut slate
#

client.emojis is a thing on discord.js

#

so it depends on your library

earnest phoenix
#

Ok nice

#

Client.emojis it is

earnest phoenix
#

hey

#

how do i get the amount of vote my bot as

#

?

quartz kindle
#

use the api

obtuse wind
#

How would I make my bot leave a server via bot console

zealous veldt
#

bot console?

obtuse wind
#

Yes I can run commands and code in my bot's console

zealous veldt
#

what language?

#

what lib

obtuse wind
#

it's node.js ( discord.js )

#

I tried this, but it didn't work

earnest phoenix
#

1+1

#

Two

zealous veldt
#

did you properly declare the guild?

obtuse wind
#

yes I did

#

I'm not in the guild but I have the guild's ID

zealous veldt
#
let guild = client.guilds.get(<guild id>);
guild.leave()
    .then(g => console.log(`Left guild ${g}`))
    .catch(console.error);
obtuse wind
#

k let me try that

#

Do I need a "bot.on()"

zealous veldt
#

no

#

not for this

obtuse wind
#

k

zealous veldt
#

that should work

knotty steeple
#

id has to be a string

obtuse wind
#

it's not

#

unexpected token "l"

zealous veldt
#

oh yeah

obtuse wind
#

even if I put capital "L"

zealous veldt
#

make the id a string

knotty steeple
#

"<id>"

#

instead of

#

<id>

obtuse wind
#

still unexpected token "l" Xd

knotty steeple
#

where

zealous veldt
#

send the full stacktrace

obtuse wind
#

Here's the bot's code

#

Even if I removed "<>" it still doesn't work

heady zinc
#

so, you do need to remove the <>, and are you sure the id is right thonk

obtuse wind
#

yes I'm sure

heady zinc
#

that codes looks ok to me tho cuteThink

obtuse wind
#

Yes the guild ID is corrent

#

correct*

#

I just ran a command in my console

#

or do I need to put the ID in the "leave()"

slim heart
#

okay i feel like im dumb

#

how do i get the username of a member

#

its not member.username

#

(discord.js)

#

member.user.username?

heady zinc
#

yes

slim heart
#

ok

obtuse wind
#

hmm

#

anything i try it won't work

#

it says cannot find property "leave"

earnest phoenix
#

are you on master?

obtuse wind
#

master?

earnest phoenix
#

actually its the same api thonkku

#

can you show error / respective code

obtuse wind
earnest phoenix
#

undefined, which means .get returns undefined

obtuse wind
#

even with capital But that's a valid server

earnest phoenix
#

is the bot in the guild you're passing? :p

obtuse wind
#

yes it is

#

If I go to my console and type inbot.guilds it will show all the guilds, roles, total members, etc. etc.

#

the server is listed there

earnest phoenix
#

are you certain this is the correct snowflake

obtuse wind
#

snowflake?

earnest phoenix
#

the id

obtuse wind
#

yes

#

it matches the ID listed in console

quartz kindle
#

type the get() part in your console too

earnest phoenix
#

really it should work, try let guild = bot.guilds.find(g => g.id === '461273721764577312')

quartz kindle
#

if it works in the console but not in the code, then the problem is the code

obtuse wind
#

Ok so will this work, because I don't want to press enter and then guild will be declared already

sick cloud
#

put a ; on the end of the find pls

obtuse wind
#

So this?

sick cloud
#

yeah

obtuse wind
#

"g" apparently is not defined

#

but if I did "guild.leave()" it worked

#

mkay so the bot isn't on the server anymore, kthx.

tight coral
#

guys any opinions regarding choice of database for bots? I don't really know if I should go with mongodb or postgress

sick cloud
#

rethinkdb

restive silo
#

rethinks develoment is kinda dead

#

for SQL i recommend Postgres, for NoSQL i recommend MongoDB

tight coral
#

I'm very tempted to save all guilds configuration in a mongo document

#

but idk if that will scale

#

probably not

#

i mean each guild in a document

restive silo
#

if you really want to scae then SQL is the way

#

if you want easy acess and integration NoSQL it is

tight coral
#

bc having multiple collections on a mongodb is a pain

quartz kindle
#

anyone tried using Redis?

#

it looks pretty good on paper for small bots

heady zinc
#

redis can actually be used at large scale

#

i use it and for example dank memer use it

#

depends on what do you want to do with it tho

quartz kindle
#

tbh i dont really need it, all i need is eventual copy to disk as i do everything in memory

#

im using json files currently

heady zinc
#

could be nice in your case then, redis will write to disk as you insert/delete/edit data

#

though while it can do that it is quite limited compared to actual databases

quartz kindle
#

yeah but wouldnt that theorically double memory usage? my entire database is loaded into an object on bot startup, using redis would keep 2 copies of the database in memory

#

or would redis shut down after a write operation?

heady zinc
#

it won't unless you tell it to, though that would be a quite unorthodox way of using redis

quartz kindle
#

yeah i figured

heady zinc
#

standard way would be to only use redis as cache

quartz kindle
#

so in my case something like sqlite or leveldb would be better

heady zinc
#

yeah, as databases they have more options, redis shines as message broker or cache server but not really database

quartz kindle
#

yeah, i could use it to offsource the database to it, but having it as an object inside node is good enough

heady zinc
#

might be something to consider at a scale where you'll have to separate your bot into multiple processes though

quartz kindle
#

yeah good thought

#

my bot is not really sharding-ready, but i kinda doubt it will reach that point xD

heady zinc
#

well that or a database that accepts multiple connections, two options that you can consider before needing to chose one

quartz kindle
#

yeah i like the redis idea for sharding more than handling multiple connections

#

i'll sleep on it, thx for the inputs

obtuse wind
#

Hey there!

#

I'm trying to tweak up my ban command for my bot

#

Will this work

#

if(!message.member.hasPermission("BAN_MEMBERS"), message.author.id != my ID) return message.channel.send("No can do pal!");

restive silo
#

you can't use , in an if statement

obtuse wind
#

yes I can

#

I've done it before on an autoresponder command

#

it works fine in that

restive silo
#

oh i actuall never saw people using that over ||

#

but yea beside that that should work

obtuse wind
#

|| will crash my bot

restive silo
#

what

obtuse wind
#

watch this

grizzled isle
#

Pleb Question: How do I get the package.json file started using command promopt again?

sick cloud
#

npm init -y -f @grizzled isle

#

that's the quick way

grizzled isle
#

Thanks tony. I knew it had something to do with init

sick cloud
#

np

proven surge
#

Anyone know how to make heroku work???

gilded blaze
#

What do you mean by work?

obtuse wind
#

How do I make my bot clear bans

#

( as in unban everyone at once )

warped ruin
#

@obtuse wind

  1. get ban list
  2. loop over it and unban every user
#

idk which lib you use so can't provide docs or code mmLol

obtuse wind
#

node.js discord.js

#

and IDK how to get full banlist

#

and loop unban users

sick cloud
#

look at the docs

#

specifically guilds

#

and if you don't understand loops, learn js

earnest phoenix
#

@proven surge heroku sucks ass, you're better off actually paying for a vps like digitalocean

#

yes

#

heroku is ass

#

gcloud gud

zealous veldt
#

yes

#

not DigitalOcean

#

too expensive

earnest phoenix
#

vultur better

zealous veldt
#

no

#

OVH is cheap af

earnest phoenix
#

yes

zealous veldt
#

also bakery

earnest phoenix
#

i said better

#

bitch

zealous veldt
#

even cheaper

earnest phoenix
#

nono

#

not bakery

#

its run by some sketch ass dude

#

i know him from a few servers

#

i wouldnt trust him with data like that

zealous veldt
#

I know him

#

I use Bakery

#

bakery is awesome

#

he's not sketchy

#

The guy you need to watch out for is bob the builder

#

pretty sure he kind of disappeared though

earnest phoenix
#

wait TetraByte is owner of bakery right

zealous veldt
#

no

#

Donut is

earnest phoenix
#

yeah donut and him colab on it

zealous veldt
#

byte works for bakery I think

#

but Donut is the owner

#

bakery is amazing

earnest phoenix
#

byte greifed like 2 disc servers now

zealous veldt
#

um what?

earnest phoenix
#

ye

#

he deleted all roles from one

#

the other he mass banned

zealous veldt
#

What servers?

earnest phoenix
#

Trivia Comm

#

it had like 10k+ members

zealous veldt
#

Who owns that?

earnest phoenix
#

uh i think its deleted now

zealous veldt
#

Rip

earnest phoenix
#

what the shit is this

zealous veldt
#

oof

#

I know namecheap has some filters

#

trying to prevent scam stuff

earnest phoenix
zealous veldt
#

like things with chrome are blocked usually

earnest phoenix
#

how fix

zealous veldt
#

verify?

#

I don't know

earnest phoenix
#

hows

zealous veldt
#

contact support

earnest phoenix
#

one sec

#

googling

#

it icann suspention

#

wot

zealous veldt
#

lmao what

earnest phoenix
#

the whois of my nomain

zealous veldt
#

Yeah I would probably contact support

earnest phoenix
#

yeah

#

i have all real info and shit too

#

wait it might be fix Thonk

#

idk

#

n v m

lone orchid
#

hey

#

im making my bot send a list of maps like
1: map1
2: map2
3: map3
4: map4
and only two people are allowed in the chat
im making the bot choose one of the users at random

now what i want the bot to do is alternate voting, like say the two users are user1 and user2. and the one chosen at random is user1 and now only user 1 should be allowed to vote and if he votes now its user2's chance to vote. so if its user1's chance and user2 does a vote he should be told that its user1's chance

neon swift
#

Sound like you want to have two async tasks run at the same time, one that checks for the vote, and other that tells who's turn is it

#

What language/library are you using?

lone orchid
#

discord.js

neon swift
#

Ok, there are alot of people here who use d.js so somebody should point you to right direction

lone orchid
#

ok im waiting 😃

neon swift
#

🤔 or... you could probably have the same task just do two different things and just loop again if the wrong user voted

lone orchid
#

how tho

neon swift
#

I don't know d.js... In d.py there's a wait_for('event') which you can use, there's probably something similar in d.js

lone orchid
#

await

sick cloud
#

maybe awaitMessages?

lone orchid
#

like await message.channel.send

#

i dont know how to get it work tho

sick cloud
#

are you trying to wait for a reply, then wait for another users reply?

lone orchid
#

yup

sick cloud
#

yeah, awaitMessages is exactly what you need

lone orchid
#

cool thx

sick cloud
#
const filter = m => m.author.id === 'an user id so only that user can send the msg';

channel.awaitMessages(filter, { max: 1, time: 60000, errors: ['time'] }) // 1 minute wait time
  .then(collected => /* message here */)
  .catch(collected => /* error, time running out */);
#

a bit of an example based on the docs

lone orchid
#

ooh tysm

sick cloud
sour perch
#

hey, im having a problem with the structure of my json file, i wanna save it like GuildID/permlvls/lvl1/rolebut i need some dditional info after role then

neon swift
#

So, why can't you have to role key just have another key:value struct as its value?

#

{role_id:{additional info here}}

lone orchid
#

ok well the thing is it only does that for one user whose id i mention

#

but i want it to keep alternating between both users

#

like if user1 does !vote 1

#

then now its user2's chance to vote

#

but if user1 again votes he'll be warned like its user2's chance

earnest phoenix
#

Guys I'm making a bot to look through an entire server's message history and grab the links from it
Any advice on how to do this?
Does a bot already exist that does this?

junior bobcat
#

how can I show how many server the member are in ?

earnest phoenix
#

First of all, what library are you using?

#

Because for discord.js it would be<client>.guilds.size

#

@earnest phoenix would you know how to get a list of all the previous messages on a server?

#

No, not really

#

And,

livid whale
#

Hi

junior bobcat
#

@earnest phoenix yes discord.js, but I dont want the guilds of the bot, but the guilds of the taged user

lone orchid
#
  if(message.content.startsWith('--vote')) {

    let messageArray = message.content.split(" ");
    let cmd = messageArray[0];
    let args = messageArray.slice(1);

    let maps = [`bank`,`border`,`clubhouse`,`coastline`,`consulate`,`oregon`,`villa`];

    let vote = args[0]
    maps.splice(vote,1)

    console.log(vote);
    console.log(maps[0] + maps[1] + maps[2] + maps[3])

  }
#

im trying to remove arguments from an array

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


    const questions = JSON.parse(fs.readFileSync('./commands/ask/questions.json', 'utf8'));
    const answers = JSON.parse(fs.readFileSync('./commands/ask/answers.json', 'utf8'));


module.exports.run = async (client, message, args) => {
    const id = message.author.id;

    let question = Math.floor((Math.random() * questions.length));

    message.channel.send(questions[question])


const msgs = await message.channel.awaitMessages(msg => {
    if (msg.content.includes(answers[question]) && msg.author.id === id) return message.channel.send("right answer :white_check_mark:")
}, {time: 10000});


message.channel.send("time finished, the answer was [`" + answers[question] + "`]");


}

module.exports.help = {
    name: "ask"
}```
in this code when some one repeat the answer the bot repeat "right answer" message 
and at the end it say time finished 

can you help me to make the time stop when the bot get the right answer
lone orchid
#

and its doing it but when i use the command again the previous command gets overwrited

hot sleet
#

@lone orchid use sql or fs.write

lone orchid
#

can i dm u zyad?

bright spear
#

@junior bobcat you would only be able to get the servers that the user and the bot share

junior bobcat
#

oh ok

#

thanks

smoky panther
#

How long does it take for bots to be a/d ?

wide ruin
#

@smoky panther a/d?

smoky panther
#

accepted / declined

wide ruin
#

one second...

#

Aetheryx 22/07/2018 after a few days

#

thats what they said

restive silo
dull nimbus
#

hey, im trying to start a discord.js bot and the code wont work, can some1 help me review it ?

wide ruin
#

what are you hosting it with

dull nimbus
#

glitch

wide ruin
#

oh i use glitch

#

dm me

dull nimbus
#

k

#

btw im trusting u with the bot token

ruby dust
#

but you shouldn't

floral zinc
#

Ye just hide it

bright spear
#

lol

lone orchid
#
  if(message.content == 'reset'){

    const ListEmbed = new Discord.RichEmbed()
    .setTitle('Users with the go4 role:')
    .setDescription(message.guild.roles.get('475934116865376267').members.map(m=>m.user.tag).join('\n'));
    message.channel.send(ListEmbed);

    //membersWithRole.removeRole(myRole);
    //membersWithRole.removeRole(myRole);
  }
#

im using this code to get the list of people who have a specific role

#

but i cant figure how to remove the role from all of them?

hot sleet
#

@lone orchid use forEach function

restive silo
#

forEach is slow tho

#

using map or a simple for loop would be better

lone orchid
#

nvm zyad i figured it

#
    let aRole = message.guild.roles.get('475934116865376267');
    aRole.members.map(mem => mem.removeRole(aRole));
#

this worked for me

restive silo
#

yea map

hot sleet
#

@lone orchid good work

lone orchid
#

😃

tiny lodge
#

@earnest phoenix What lang and lib, and what do you mean by "make a poll"

#

Then just send a message with the poll message, react with the options, and count the reactions when time is up?

earnest phoenix
#

hmmmm

#

Anyone have some good videos to start learning NodeJS/DiscordJS?

marble elm
#

How would i change the background just of the long description?

earnest phoenix
#

Guys how to ping a role via role's ID?

ruby dust
#

<@&ID>

earnest phoenix
#

Ty

grave mist
#

<#id> for channel

ruby dust
#

no

grave mist
#

If you need in future

#

I mean <#>

ruby dust
#

<#ID> for a channel

grave mist
#

Yea

#

I didn't reaslize that I added @ there lol

knotty steeple
#

css

#

use style tag in bot long description and go crazy with css

marble elm
#

How would i change the background just of the long description?(edited)

slender thistle
#
    .longdescription .content {
        your stuff here
    }
marble elm
#

ok thanks

slender thistle
#

👍

marble elm
#

google is cool

slender thistle
knotty steeple
#

ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client how do i fix this

#

mysql

earnest phoenix
#

just dont use mysql lul

knotty steeple
#

smh

grave mist
#

Is it menu container?

slender thistle
#

@grave mist #menu, iirc

#

Yep

earnest phoenix
#

is there a way to get the pfp of a user once they change it?

gilded blaze
#

Use the Guild Member Update event

earnest phoenix
#

hmmm

#

is it the object?

tidal parrot
#

What's the best library for POST requests in node?

#

no complicated requests

#

just looking for something simple and fast

earnest phoenix
#

im using request...

karmic parcel
#

honestly, just doing something based off of just the http module would be fine

#

or https

tidal parrot
#

yeah

#

ill just stick with that then

karmic parcel
#

you can just grab post from https if you want too

tidal parrot
#

huh?

#

wdym

karmic parcel
#
const {get} = require('https');
#

I forget what the process is called

#

destructuring or something?

tidal parrot
#

ohh right

#

yeah

#

https doesn't have a post function tho afaik

#

only http

uncut slate
#

https' post is just https.request with a method: post in the config

tidal parrot
#

aeth

karmic parcel
#

I didn't look, I thought it'd be weird if they had get and not post though

tidal parrot
#

best lightweight/fast lib for post requests?

karmic parcel
#

He's probably gonna say soemthign similar

tidal parrot
#

probably

uncut slate
#

https is as light as it gets but if you want to use a more syntax-friendly solution node-fetch is pretty nice

#

zero deps as well

karmic parcel
#

now that snek is dep

uncut slate
#

ye

tidal parrot
#

ill go with node fetch then

#

mainly cuz im a lazy bitch

karmic parcel
#

lol fair

#

Yukine should just put the wrapper on npm

#

then profit

tidal parrot
#

what wrapper

karmic parcel
#

it was a wrapper around built in node libs to have basically the same syntax as snekfetch

tidal parrot
#

oh nice

neon swift
#

Do all the mods here use d.js??

karmic parcel
#

no

slender thistle
earnest phoenix
#

All the mods use discord dart

#

What

#

Discord dart

neat falcon
#

all the REAL mods use discord brainfuck cosmicbrain

zealous veldt
#

No the real mods use discord.node

earnest phoenix
#

Okay so, im using the commas as a split thingy, but if there is a song in the queue with commas in, it creates a new line for it. Anyone know a fix please would be very much appreciated :)
let queueOrdered = queueUnordered.split(",").join(\nsmall_blue_diamond );
Returns this:

knotty steeple
#

escape the letter

sullen path
#

send more than 1 message

#

XD

earnest phoenix
#

What? @knotty steeple

knotty steeple
#

\,

earnest phoenix
#

No pleb. You on about the small_blue_diamond thing?

#

lmao

knotty steeple
#

uh

#

no

earnest phoenix
#

nvm anyway lol. I got it working in the end

tiny lodge
#

@earnest phoenix you're storing the queue as a string? Thonk

sick cloud
#

@rotund mesa if your using discord.js, just add { split: true } to the end of your message.

#

Like <message>.channel.send('whatever', { split: true });

knotty steeple
#

what does that do

topaz fjord
#

splits a 2000+ char message into multiple

#

im guessing at leasy

quartz kindle
#

you can further customize it, you can specify exact split length (default is 1950), specify a character to split on, and you can add prefix/sufix to the splits

simple bramble
#

So i have a report command for my bot, so someone can report a bug about the bot/user abusing the bot. I want it to create an embed message to send to a specific channel in my support server so i can be notified about this. I have the channel id, how do i make the embed send to that channel?

#

and im in c#/discord.net

earnest phoenix
sullen path
#

get your guild ID, lookup your guild, get the channel using your channel ID, send the message

simple bramble
#

where do i put the guild/channel id

sullen path
#

idk read your lib docs

simple bramble
#

mk

knotty steeple
#

the split thing isnt for python btw

gilded blaze
#

Use the Reaction Add event

knotty steeple
#

codeblocks please

slender thistle
#

Don't you need a Context object on invoke()

steel heath
#

oh man its 4:45am please

#

why didnt you just ping one mod instead of pinging ALL of us

#

only one mod can handle that, not all 14 needed to ban a bot

shell blade
#

lmao

steel heath
wanton walrus
#

NotLikeCat you pinged them all

earnest phoenix
#

Whats wrong with user.displayAvatarURL

#

It didnt work

bright spear
#

@earnest phoenix was there an error?

earnest phoenix
#

Nvm i fixed it

obtuse wind
#

How can I make my ban command work even when I don't have ban permission?

#

This is what I mean:
I wanna be able to use the ban command without the ban memberspermission, how would I add a whitelist thing to the highlighted line there?

#

Do @TøxiCⱥrlⱥ カーラ〜先輩ᵛᵉʳᶦᶠᶦᵉᵈ#0172 when replying please,kthx.

sour perch
#

hey, how do i get this (the one inside the []) value uot as a string from json to js? ```json
"guildID": {
"permlvl": {
["roleID"]: "lvl"
}
}

sick cloud
#

why is it in an array in the first place?

sour perch
#

cuz i couldnt find out how to do it without makinng it an array :/

sick cloud
#

just make it a string??

#
"guildID": {
    "permlvl": {
        "roleID": "lvl"
    }
}
sour perch
#

yeah, so that i can put it inside if(message.member.roles.has(string))

sick cloud
#

if your using your way, it'd be <file>[guildID].permlvl["roleID"] i guess

sour perch
#

wouldnt that return the lvl? or did i missunderstand?

sick cloud
#

that'd return the "lvl" after "roleID":

#

so if its "roleID": "123", <file>[guildID].permlvl["roleID"] should return "123"

sour perch
#

yeah that what i thought, but i want roleID as a string

#

probably have to rewrite the structure of the document then?

slender thistle
#

@rotund mesa I doubt it's possible thonkku

sick cloud
#

i just said exactly what it'll give you??

#

@sour perch what i just said will give you roleID as a string exactly, i don't get why you think it isn't

sour perch
#

well, i want permlvl then, without roleID and i want to check if its one of all the permlvls

earnest phoenix
#

help

sour perch
#

think i found an solution

earnest phoenix
#

that is js

#

which me no

#

know

#

what does this code do?

sick cloud
#

who knows

#

maybe learn js

earnest phoenix
#

com'n tony

sick cloud
#

it looks like someone was bored and made a story in a code editor though

#

lmao

earnest phoenix
#

learn java script just to know what that does

#

a story? in a code?

sick cloud
#

idk

sour perch
#

i did not find a solution...

earnest phoenix
#

@sour perch help

sick cloud
#

maybe don't use json for server settings or something then

earnest phoenix
#

me

#

what does this do

sour perch
#

fair point

sick cloud
#

seriously @earnest phoenix take it to #memes-and-media, this isn't coding-related

earnest phoenix
#

hab help me

#

@sick cloud i got a question tho

sick cloud
#

it's for shitpost, you don't generally need help with development

earnest phoenix
#

alright

sick cloud
#

does .forEach return a promise? (so you can .then on it)

heady zinc
#

the built-in forEach? no

sick cloud
#

crap, alright

uncut slate
#

it could return an array of promises if you want it to, which you could Promise.all, which is a .thenable

sick cloud
#

@cinder patio not the place

cinder patio
#

thonkku I don't get anything from that but suuure

#

It's literally an npm module

vestal zephyr
#

what website do i go to so i can make a bot

neon swift
#

discord bots, atleast real ones, aren't made on a site

#

they are made using IDEs

earnest phoenix
#

what website do i go to

#

lmfao

#

probably amazon or yahoo

earnest phoenix
#
@bot.command(pass_context=True)
async def join(ctx):
    with io.FileIO(f"{ctx.message.author.id}.py", "w") as f:
        with open("code1.py") as f:
            await asyncio.sleep(5)
            with open(f"{ctx.message.author.id}.py", "w") as f1:
                for line in f:
                    f1.write(line)```help
#

I'm really concerned why it doesn't work

#

It says that the process cannot access the file cause it's already used by another process

neon swift
#

my god

earnest phoenix
#

oh nevermind

neon swift
#

Yes, it's already opened where you open the file first

earnest phoenix
#

I think i found the issue

neon swift
#

Also, wtf is this supposed to be???

#

Don't use .py as a database

earnest phoenix
#

not a database

neon swift
#

Oki, then next question

#

why not jsut shutil.copy ?

earnest phoenix
#

didn't know about it's existence

devout flicker
#

Der Wert "ArticleData" vom Typ "ArticleData" kann nicht in den Typ "ArticleData" konvertiert werden.
roflmao

#

Value 'ArticleData' from type 'ArticleData' cant be converted into type 'ArticleData'

floral zinc
#

Yey deutsch

wide ruin
#

i need help

#

a bot hosted with glitch just wont go online

#

but it says show: live

bright spear
#

@wide ruin any errors in the activity log?

wide ruin
#

nope

bright spear
#

hmm

#

does it log anything at all?

wide ruin
bright spear
#

hm

wide ruin
#

thats just the uptime updates

bright spear
#

are you just setting it up for the first time?

wide ruin
#

its been online before, but not hested by glitch

#

*hosted

#

Any ideas

bright spear
#

hm

#

can u dm me an invite?

wide ruin
#

To glitch

bright spear
#

yeh

wide ruin
#

Anybody else have any ideas?

earnest phoenix
#

code error

sullen path
#

very specific

floral zinc
#

That is pretty specific

steep bane
#

what should everything in the launch.json?

meager flower
#

Hey anyone know cheerio?

earnest phoenix
#

is this the correct way to get all the guilds shared by a user and a bot?

const userGuilds = client.guilds.filterArray(guild => guild.users.exists('id', newUser.id))
wide ruin
#

is it possible to run a .js bot without having a computer on 24/7

restive silo
#

no

#

@earnest phoenix use .has() instead exists for IDs

#

and why you wanna have an Array over an Collection?

#

also guilds only have members

#

not users

wide ruin
#

can a bot that is online 24/7 run a bot @restive silo?

restive silo
#

w-what

#

how should a bot run a bot?

wide ruin
#

it runs the code

restive silo
#

no thats not how Programming works

#

and also thats a really bad idea since performance will be killed since it runs the code in a VM pretty much

wide ruin
#

also

#

can different people host the same bot, if they both have different code

restive silo
#

define "host the same bot", yes they can host 2 different instances on 2 different bot accounts, they can also host 2 instances on 1 bot account but that would double respond to input whats bad

wide ruin
#

i mean if person 1 has a ping command and person 2 has a help command, would it work if they both did that on the same bot

restive silo
#

its possible but why would you do that? Thonk

#

also it would have caching disadvantages

#

since you cache 2 times the same stuff

wide ruin
#

what even is cache

restive silo
#

okay i won't explain that to you since thats kinda complicated, you should probaly google that up

wide ruin
#

ok

#

whats the best way to learn how to get a .js bot up

restive silo
#

you learn javascript

#

@earnest phoenix that is in no way usefull for the conversation, go away

wide ruin
#

it was a school emoji

#

wait, what about hosting a python bot

#

ik python

restive silo
#

the language doesn't matter you always need to run the files compiled or not compiled doesn't matter aswell

wide ruin
#

what site can run python code 24/7

restive silo
#

some glitch ips are banned from discord for abuse

#

wouldn't recommend using it

#

get a real host for some small money

wide ruin
#

my other bot uses it

#

but a fresh app wasnt working

#

it wasnt any sort of abuse

meager flower
#

It shouldn't be tho

uncut slate
#

Cheerio doesn't let you load URLs like that afaik

#

You have to get the contents of the page in HTML and load that

meager flower
#

So do I need to fetch the url first?

#

let ESTTResponse = await fetch(ESTTURL);

uncut slate
#

Yeah

meager flower
#

Well I tried doing that and it didn't work :/

#
const ESTTURL = 'https://data.soderslattsfk.se/estt-weather/ww4.php';
        let ESTTResponse = await fetch(ESTTURL);
        const $ = cheerio.load(ESTTResponse);
        console.log($('img')[0]);
    let ESTTImage = $('img')[0].src;
uncut slate
#

What's fetch defined as

meager flower
#

const fetch = require('node-fetch');

#

Works fine for the other commands that are using it

uncut slate
#

ESTTResponse is the response object from fetch()

#

Not the raw HTML

#

ESTTResponse.text() would return Promise<RAW_HTML>

#

That's what you want to feed into cheerio.load

meager flower
#

oh

uncut slate
#

ESTTResponse.text() returns Promise<RAW_HTML>

#

You have to resolve that promise

meager flower
#

and how would I do that then

uncut slate
#

Await it

meager flower
#

GWfroggyFacepalm 😂

uncut slate
#

Smh

meager flower
#

Okay got it

#

Thank you so much 😄

uncut slate
#

Np

blazing gorge
#

Nice job phill

earnest phoenix
#

How to grab the first channel that a bot has permissions to post in?

sick cloud
#

filter the guild channels

#

and check the permissions for has send messages

earnest phoenix
#

Ah. Ok

wintry bobcat
#
@client.command(name='kick')
async def kick(context, username: discord.Member):
    if context.message.author.server_permissions.kick_members:
        await client.kick(username)
    else:
        permission_error = str('It turns out you dont have permission to do that, ' + context.message.author)
        await client.say(context.message.channel, permission_error)```
``discord.ext.commands.errors.MissingRequiredArgument: username is a required argument that is missing.``
Does anyone know how to fix this

Also dont judge my outdated methods
young wind
#

How can you create a webhook for a channel using discord.py non-rewrite?

earnest phoenix
#

please help me

#

dm message sending command is not working

topaz fjord
#

what lib

earnest phoenix
#

dm message sending command is not working

knotty steeple
#

what library

topaz fjord
#

what library are u using

earnest phoenix
#

libary ??

topaz fjord
#

yes

#

like discord.js, JDA, etc.

earnest phoenix
#

what libary ım new

knotty steeple
#

what are you using to make a discord bot

earnest phoenix
#

wait ı give screenshot

#

bot.js

#

node_modules

topaz fjord
#

where is the screenshot?

earnest phoenix
#

const Discord = require('discord.js');
const ayarlar = require('../ayarlar.json');

exports.run = (client, message, args) => {
if (message.author.id != 451109370273726464) { return; }
let mesaj = args.slice(0).join(' ');
if (mesaj.length < 1) return message.channel.send('Birşey Yazmalısınız');
message.delete();
const mesajat = new Discord.RichEmbed()
.setColor('RANDOM')
.setDescription('' + mesaj + '')

  client.users.forEach(u => {

u.sendEmbed(mesajat)
})
};

exports.conf = {
enabled: true,
guildOnly: true,
aliases: ['duyur'],
permLevel: 4
};

exports.help = {
name: 'dmduyuru',
description: 'İstediğiniz şeyi bota duyurtur.',
usage: 'dmduyuru [duyurmak istediğiniz şey]'
};

#

ıts now working

sick cloud
#

codeblock when

earnest phoenix
#

?

#

what is codeblock