#development

1 messages · Page 836 of 1

finite bough
#

probably some kind of trial

wide wharf
#

My channel name is #chat

wheat jolt
#

I am trying to get a message from a channel only when a command is executed

wide wharf
#

Which one is better:

const Discord = require('discord.js');
const client = new Discord.Client();

client.login("token").then(() => {
    console.log("I am ready");
    var guild = client.guilds.get('guildid');
    if(guild && guild.channels.get('channelid')){
        guild.channels.get('channelid').send("Good Morning").then(() => client.destroy());
    } else {
        console.log("nope");
        //if the bot doesn't have guild with the id guildid
        // or if the guild doesn't have the channel with id channelid
    }
    client.destroy();
});

OR

const Discord = require('discord.js');
const client = new Discord.Client();

client.on('message', message => {
    //...
});

client.on('ready', () => {
    setTimeout(function(){ // in leftToEight() milliseconds run this:
        sendMessage(); // send the message once
        var dayMillseconds = 1000 * 60 * 60 * 24;
        setInterval(function(){ // repeat this every 24 hours
            sendMessage();
        }, dayMillseconds)
    }, leftToEight())
})

function leftToEight(){
    var d = new Date();
    return (-d + d.setHours(8,0,0,0));
}

function sendMessage(){
    var guild = client.guilds.get('guildid');
    if(guild && guild.channels.get('channelid')){
        guild.channels.get('channelid').send("Good Morning");
    }

}

client.login("token");

@wide wharf


@wide wharf the first one
@earnest phoenix


no
@quartz kindle


the 2nd one
@sudden geyser

sudden geyser
#

why are you pinging me

wide wharf
#

^^ quote

finite bough
#

the 2nd one does not work

#

1st*

#

the 1st one does not work

wide wharf
#

⛔ | يرجى كتابة أي شيء بعد ألأمر
@earnest phoenix other langs in #memes-and-media

solar lark
#

wait what

#

1st*

#

lmao

#

@modern sable

wide wharf
#

the 1st one does not work
@finite bough But everyone, @sudden geyser and @quartz kindle both says the 2nd one

finite bough
#

yea

solar lark
#

selfbot

finite bough
#

yes coz

sudden geyser
#

1st*

modern sable
#

1st*

finite bough
#

1st one is wrong

#

2nd one works only

modern sable
#

LMAO

sudden geyser
#

big brain

solar lark
#

haha

wide wharf
#

⛔ | يرجى كتابة أي شيء بعد ألأمر
@earnest phoenix other langs in #memes-and-media

sudden geyser
finite bough
#

Xddd

slender thistle
#

I don't think talking to a selfbot will do anything

wide wharf
#

But

#

How do you do that the Greeting message
will be send in ALL the servers in the first
channel where the bot can type in at 8am?

finite bough
#

1st one hello

heavy knot
#

Hi

finite bough
wide wharf
#

But there it will just send in only one channel (one channel id) so??

#

in the first one

#

How do you do that the Greeting message
will be send in ALL the servers in the first
channel where the bot can type in at 8am?
@wide wharf

finite bough
#

1st one does not work

wide wharf
#

second one than?

finite bough
#

yes

sudden geyser
#

iterate over each guild and check if it's 8 am. If it's 8 am, find a channel by its permission if you can send messages in it <TextChannel>.permissionsFor(someone).has(thePermission)

heavy knot
#

Can I get rank

earnest phoenix
#

no

tight plinth
#

Lol

quartz kindle
#

@wide wharf you have a bigger issue to solve: 8am in which timezone?

wide wharf
#

Uh

grizzled raven
#

earth timezone duh

slender thistle
#

Just use UTC if unsure

wide wharf
#

Just GMT+1

#

@quartz kindle

raven token
#

has anyone ever had that message.author.id references another discord user than the one making the request?

quartz kindle
#

@wide wharf so your bot will only ever be used in central europe?

#

or is it a server-specific bot?

#

@raven token no

raven token
#

rip lol

quartz kindle
#

that should never happen lol

#

are you sure you're not doing something weird?

raven token
#

ikr? idk what caused it

quartz kindle
#

such as global variables

raven token
quartz kindle
#

show code?

raven token
#

client.createMessage(msg.channel.id, msg.author.id); this is it haha, and i get the same as someone else

#

like its the most basic command ever

#

i cant find the cause either, i used a certain command on someone and it now mistakes me for him

wide wharf
#

@wide wharf so your bot will only ever be used in central europe?
@quartz kindle Uh no but most of the servers (12) where my bot is in, are in central europe... so

raven token
#

is there a certain place where this linking can go wrong?

wide wharf
#

Google Greenwich:
8 am GMT is 8 am UTC

#

@quartz kindle So how can I do that the bot will send a message in the first channel where he has perms to send messages?

#

Because I don't want to do that with channel id, because then the bot will only work in one server 😦

quartz kindle
#

@raven token are you using Eris?

wide wharf
#

I am using discord.js

quartz kindle
#

so what happens if your bot gets added to a server that is in a different timezone? lmao

raven token
#

you think that might be the problem? i might be confusing libraries? 🤔

quartz kindle
#

or to people who are in the server, but live in a different timezone than the server's

blissful scaffold
#

My bot also has a few commands that use time, by default it uses GMT but there is a command to change the time for your server

quartz kindle
#

@raven token no, just so i know what you're doing. anyway that snipped is not enough information to know whats going on

blissful scaffold
#

And if you need to show the time in everyone's own timezone then I think the only option is to use an embed and use the time value in there.
That time is always shown at your computer/phone's timezone

raven token
#

@quartz kindle would you be against DMing? 🤔 i cant rly put all the bot code in here...

earnest phoenix
lyric mountain
#

two hastebin

earnest phoenix
#

the second one is a fork

#

cause the first one is usually down

lyric mountain
earnest phoenix
#

no

#

eradicate yourself

lyric mountain
raven token
#

lmao

earnest phoenix
#

white theme by default, ads, trackers and annoying popups

quartz kindle
#

there's like 100 bins out there

pale vessel
#

i have one at home

slender thistle
#

When pastebin doesn't even load for you

finite bough
#

tim uses recycle bin

zenith terrace
#

Yes

small prairie
#
});
 ^
SyntaxError: Unexpected token )
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
#

i checked ALL brackets and they are perfect

pale vessel
#

show code

small prairie
#

too big

pale vessel
#

like from start to end of the bracket?

small prairie
#

1.7k lines

#

what

earnest phoenix
#

if only you'd use a text pasting service

pale vessel
#

use pastebin

#

/s

small prairie
#

I probably wont make my code public

earnest phoenix
#

you need jesus and christ

pale vessel
#

no thanks

earnest phoenix
#

same

pale vessel
#

so we can't help you then

#

good luck

small prairie
#

i checked each and every bracket

pale vessel
#

well, ok

neat ingot
#

how much ram does your bot use?

small prairie
#

Idk

#

100-200mbs

#

@pale vessel if i keep on adding the space(type nothing there)
The error keeps coming to the last line

#

can that help?

pale vessel
#

do you use an ide?

finite bough
#

sometimes }); are before }

small prairie
#

First used using Nano

lyric mountain
#

I probably wont make my code public
@small prairie dude, unless you have top secret pentagon codes there noone will steal them

pale vessel
#

nano lol

small prairie
#

now trying in glitvh

#

glitch

lyric mountain
#

just show us the section where it's erroring

pale vessel
#

does the bracket match the starting one?

neat ingot
#

im using discord js, according to my app, its using around 180mb. but my host is claiming near 1gb 😄

small prairie
#

@pale vessel wdym?

#

@lyric mountain The error transfers to the last line

#

if i keep adding a new line

#

the error is in the last one

lyric mountain
#

sure, because you added more chars to the code

#

thing is

#

we need to see the code

#

if you don't want to show the entire code, just show us the function where that is happening

pale vessel
#

code 👏 review

lyric mountain
#

even a single line would help

small prairie
#

Nevermind

#

Found the error

#

i added a w in front of an if

pale vessel
#

wif

neat ingot
#

lulz

earnest phoenix
#

what if

small prairie
#

i found it our by removing each bracket code

earnest phoenix
#

a new kind of if

small prairie
#

one by one

#

Haha

earnest phoenix
#

do you not have an IDE with syntax highlighting lol?

lyric mountain
#

wif stands for what-if

pale vessel
#

this is why you don't use nano

neat ingot
#

use visual studio code man

#

free, open source, tons of plugins.

#

written in node js

lyric mountain
#

even notepad++ would highlight it

neat ingot
#

lol

pale vessel
#

ayyy

#

i use notepad++

neat ingot
#

try visual studio code

#

or even sublime text 3

lyric mountain
#

intellij

neat ingot
#

need that intellisense yo!

pale vessel
#

nah. notepad works for me

small prairie
#

thanks tho

lyric mountain
#

intellisense?

small prairie
#

which is best for linux?

#

minimal usage

neat ingot
#

intellisense guesses what your typing and suggests an autofill

lyric mountain
#

nano

pale vessel
#

vim

small prairie
#

i mean cpu and ram usage

lyric mountain
#

lol

pale vessel
#

:wq

lyric mountain
#

just use np++ dude

neat ingot
#

i can type 'fo' and it fills a for loop ~~ for example

lyric mountain
#

unless you're working on a headless os

#

np++ is the lower you'll be able to get for js coding

small prairie
#

on

#

ono

#

removing w doesnt fix

lyric mountain
#

with highlighting

pale vessel
#

you just defined an ide dekita

#

i just needed something light to code

neat ingot
#

vs code isnt an ide though. but i guess it can be used as such for certain environments

#

its very versatile

#

honestly, try it, you wont be sad

pale vessel
#

i'm fine for now

neat ingot
#

i tried it one day when sublime text had an update and became super laggy. havent went back

sudden geyser
#

"something light" that ain't intellij

pale vessel
#

who were you referring to

small prairie
#

Finally

#

Visual Studio

#

found the bug

#

or error

pale vessel
#

human error

earnest phoenix
#

Hey guys

#

Can I ask a question about mongodb in this channel?

slender thistle
#

Sure

earnest phoenix
#

I am receiving "Topology is closed, please connect" error

#

I've been researching for a few days, but none worked

#

And the number of connection is usually +80

heavy marsh
#

in discord.js - v12.0.2 is there a way to get the total memory for a bot?

restive furnace
#

no

#

cause discord.js doesnt look at your memory, you need to use process#method, it can show it, and im not spoonfeeder, wo figure it out by googling for example.

heavy marsh
#

I mean RAM

restive furnace
#

yes

#

i know

#

d.js doesnt look at your memory/ram

heavy marsh
#

So it can only check the memory usage?

restive furnace
#

no.

heavy marsh
#
${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}
``` = Memory Usage
restive furnace
#

you cant even that with d.js, you need to use process (node process) and check there, or use third party libraries

heavy marsh
#

ooh ok

restive furnace
#

process != discord.js

heavy marsh
#

Can we not use some other way to get the total memory?

restive furnace
#

process or third party libraries/packages.

heavy marsh
#

OOh ok

restive furnace
#

for examole

#

but you dont need, cause process has heapTotal method too, but ye, bye! 👋 hope it works.

heavy marsh
#

heapTotal doesnt give me the total

#

as i want to get the free ram in the bot

earnest phoenix
stable nimbus
#

@dusky marsh @prime cliff I finally got it to host with no issues! My code was the issue as I forgot a parameter when creating the embeds on discord.js@11.5.1, so yeah its working now!

#

Thank you guys for your help last night

quartz kindle
#

@heavy marsh heapUsed is not accurate for memory usage btw

#

and as Dany pointed out, to get total system memory, use os

heavy marsh
#

ooh ok

quartz kindle
#

and btw, os doesnt need to be installed, its integrated into node

heavy marsh
#

os.freemem()

#

like this

dire abyss
#

right,

#

what does reduce do?, will it just give me the all the users?

summer torrent
#

yes

#

in djs right?

dire abyss
#

yes

#

how would i use it for user size

#

client.cached.users.size.reduce()

summer torrent
#
client.guilds.reduce((a, b) => a + b.memberCount, 0)```
heavy marsh
#

Who should we change the eval when its sharded

dire abyss
#

@summer torrent so this will show all members

#

brb

heavy marsh
#
function clean(text) {
  if (typeof(text) === "string")
    return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
  else
      return text;
}

    let code = args.join(" ");
    if (!code) return message.channel.send(`![cross](https://cdn.discordapp.com/emojis/678626371110567973.webp?size=128 "cross") **Please enter a command to eval!** - **Usage:** \`${config.prefix}eval <code>\``);

    try {
      let evaled = eval(code);
 
      if (typeof evaled !== "string")
        evaled = require("util").inspect(evaled);
 
      message.channel.send(clean(evaled), {code:"xl"});
    } catch (err) {
      message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
    }
summer torrent
heavy marsh
#

For me?

dire abyss
#

he was talking to me

summer torrent
#

no

slate oyster
#

Where can I find a text channel permission calculator?
or do I use the same one as I use for the bot?

neon storm
slate oyster
#

No

neon storm
#

Ok

pale vessel
#

read guides holy frick

neon storm
#

I do

pale vessel
#

not that hard

neon storm
#

Can't find a good guide

pale vessel
#

the official docs should have an example

neon storm
#

Where

modest maple
#

look it up

#

its litterally

#

the 1st - 4th results

sudden geyser
#

Have you tried using your browser.

dire abyss
#

@summer torrent if i wanted to do the same with guilds do i just replace membercount with guildcount?

earnest phoenix
#

literally everything you need is on google, if you can't find it - congrats, you don't know how to use google

summer torrent
#

@dire abyss You don't need to do it for guild count

#

client.guilds.size is enough

dire abyss
#

same for channels?

summer torrent
#

no

dire abyss
#

so i need it for channels?

earnest phoenix
#

have you tried

#

reading the docs

dire abyss
#

i kinda hate it

earnest phoenix
#

i don't care

dire abyss
#

wows

quartz kindle
#

an unmodified discord.js automatically caches all guilds and channels

#

so all you need to do is check the size of the guild store and channel store

#

although dms will count as well (when used), so you will need to account for that if you want only guild channels

dire abyss
#

so client.channels.cache.size is sufficient

quartz kindle
#

yes

dire abyss
#

i see

#

thank you

heavy marsh
#

Can you not make a eval that will work on shards?

#

Like for example get information from a guild which is on another shard?

west spoke
#

you will need to go through each shard

#

and find it

heavy marsh
#

eval bot.guilds.cache.get("611881570202025986").shardID

#

For example

#

Will not give you the shard id?

west spoke
#

you need to go through each shard

#

and find it

#

*2

heavy marsh
#

Could you give me a small example

west spoke
#

psuedo code:

for shard_data in (bot.shards):
  shard_data.guilds.cache.get("??")
#

basically, that is what you would do

heavy marsh
#

But you will have to do it in the eval right. Like I mean you dont have to change anything on the eval command right?

#

Eval command before sharding and after shard is the same right?

quartz kindle
#

when sharding, each shard will have a number of guilds assigned to it

#

that means that shard 1 has X guilds, and shard 2 has Y guilds

#

trying to get a guild that is in shard 1 from shard 2 will not work

#

as the guild does not exist in shard 2

#

the problem is not the eval command, is how you're using it

#

if you're using the sharding manager, the only way to access data from other shards is via broadcastEval or fetchClientValues

heavy marsh
#
    let evaled;
    if (args.broadcast && bot.shard) {
      evaled = await bot.shard.broadcastEval(args.code);
    }
    else {
      evaled = eval(args);
    }

    if (typeof evaled !== 'string') {
      evaled = require('util').inspect(evaled);
    }

    let output = await message.channel.send({
      embed: {
        fields: [
          {
            name: ':inbox_tray:  INPUT',
            value: `\`\`\`js\n${args}\n\`\`\``
          },
          {
            name: ':outbox_tray:  OUTPUT',
            value: `\`\`\`js\n${clean(bot, evaled)}\n\`\`\``
          }
        ]
      }
    });

    if (args.delete) {
      output.delete(10000).catch(() => {});
      message.delete(1000).catch(() => {});
    }
  }
  catch(e) {
    let error = await message.channel.send({
      embed: {
        fields: [
          {
            name: ':no_entry:  ERROR',
            value: `\`\`\`js\n${clean(bot, e)}\n\`\`\``
          }
        ]
      }
    });

    if (args.delete) {
      error.delete(10000).catch(() => {});
      message.delete(1000).catch(() => {});
    }
grim aspen
#

what does args.delete do

earnest phoenix
#

How do I check if client.users.cache.get() returns something because if(!user) doesn’t work.

marble juniper
#

if (!client.users.cache.get("id"))

#

easy

plush quail
#

What version(s) of dot net are supported?

quartz kindle
#

if(!user) does work lol

earnest phoenix
#

I am confused lol

let player = await client.users.cache.get(user);
let stats = await db.collection("users").findOne({_id: user});
console.log(player, stats, "yay");
if(!player || !stats) return;
console.log("test yeah");
#

the console.log() says that player and stats are valid but the if thing does not

quartz kindle
#

you dont need to await player

#

its not an async function

#

idk about your db

#

what does the first console.log show?

earnest phoenix
#

it shows a JSON file and an User object

#

and yes its an async function

quartz kindle
#

how about this console.log(typeof player, typeof stats, Boolean(player), Boolean(stats))

earnest phoenix
#

wait lemme edit the file using vi

#
(node:15) UnhandledPromiseRejectionWarning: TypeError: message.author.createMessageCollector is not a function
at Object.execute (/home/container/commands/DoNotIndex/backdoor.js:14:38)
at Client.<anonymous> (/home/container/index.js:139:13)
at Client.emit (events.js:311:20)
at MessageCreateHandler.handle (/home/container/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/container/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
at WebSocketConnection.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:311:20)
at Receiver.receiverOnMessage (/home/container/node_modules/ws/lib/websocket.js:789:20)
(node:15) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15) [DEP0018] DeprecationWarning: Unhandled promise
#

How would I make a messagecollector in a DM

#

channel

#

(in discord.js v11)

quartz kindle
earnest phoenix
#

Oh.

#

Thanks

#

Is there a way to clear a file in command prompt?

#

because im too lazy to scroll down the file when in vi editor

#

i guess i should just boot up my pc and view it there

#

i have another issue

#
(node:15) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'createMessageCollector' of null
at Object.execute (/home/container/commands/DoNotIndex/backdoor.js:14:48)
at Client.<anonymous> (/home/container/index.js:139:13)
at Client.emit (events.js:311:20)
at MessageCreateHandler.handle (/home/container/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/container/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
at WebSocketConnection.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:311:20)
at Receiver.receiverOnMessage (/home/container/node_modules/ws/lib/websocket.js:789:20)
(node:15) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
#

i

#

try to make a messagecollector

#

in message.author.dmChannel

#

do i make a new dmchannel?

quartz kindle
#

the dm channel is not cached

#

yes

earnest phoenix
#

const dm = new dmC

#

hoh

quartz kindle
earnest phoenix
#

oh

#

@quartz kindle it returns object object true true

#

nani

quartz kindle
#

then the if should work

earnest phoenix
#

but it doesn’t?

quartz kindle
#

try adding brackets to it

#

if() { return }

earnest phoenix
#

does it do anything tho

#

arent them the same?

quartz kindle
#

brackets make it more explicit

#

plus they are mandatory for multi-lines

#

not using brackets is just a silly shortcut for lazy people

earnest phoenix
#

I think i will try if(Boolean(player) && Boolean(stats))

quartz kindle
#

well, Boolean shouldnt be needed, because the if basically does that already

earnest phoenix
#

it turns out that it suddenly worked when i restarted it

#

thanks anyways

amber fractal
#

I don't use brackets on single lines

#

mainly returns and breaks

mystic violet
#
(node:20520) UnhandledPromiseRejectionWarning: TypeError: Class extends value #<ShoukakuPlayer> is not a constructor or null

Im doing 

class player extends serverCache.player {

if thats not a way to extend the class, then How would I keep the events of ShoukakuPlayer in my new class

sudden geyser
#

I like always using brackets.

Whatever you're extending is not a class/constructor?

#

Unless I'm not getting something.

copper cradle
#

player is not a class

mystic violet
#

but when I log it its a class zoomeyes

#

I mean

#

idk if this is a class

#

but I think it is? 🤔

#
<ref *1> ShoukakuPlayer {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  voiceConnection: ShoukakuLink {
    node: ShoukakuSocket {
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: undefined,
      shoukaku: [Shoukaku],
      players: [Map],
      rest: [ShoukakuRest],
      state: 'CONNECTED',
      stats: [Object],
      reconnectAttempts: 0,
      name: 'Node Test #1',
      ws: [WebSocket],
      [Symbol(kCapture)]: false
    },
    player: [Circular *1],
    guildID: '689157206028976153',
    shardID: 0,
    userID: '691451179212865619',
    sessionID: 'fd7292cbbd9de06f2b36ac540bc9b484',
    voiceChannelID: '689166772267516003',
    selfMute: false,
    selfDeaf: true,
    state: 'CONNECTED'
  },
  track: null,
  paused: false,
  volume: 100,
  bands: [],
  position: 0,
  type: 'track',
  [Symbol(kCapture)]: false
}```
sudden geyser
#

It looks like an instance of the class.

#

It needs to be the actual constructor/class that's being extended.

mystic violet
#

How could I extend the instance?

#

is it possible?

#

Wheres the constructor here (I know its there but what is Shoukaku Player)

zenith terrace
#

I was about to do my bot command in here

#

oops

crimson vapor
#

@mystic violet if its just new ShoukakuPlayer, you should be able to do class x extends ShoukakuPlayer

earnest phoenix
#

Hey there

#

I need help with my santa wumpus bot 😦

crimson vapor
#

I think you have the wrong server

mystic violet
#

@crimson vapor I did that

#
(node:20520) UnhandledPromiseRejectionWarning: TypeError: Class extends value #<ShoukakuPlayer> is not a constructor or null

Im doing 

class player extends serverCache.player {```
crimson vapor
#

did it work?

#

yeah

#

when you create a player, what do you use?

mystic violet
#

the join to a voice chnanel

#

(for a shoukaku player)

crimson vapor
#

I dont understand

#

do you do let x = new ShoukakuPlayer?

quartz kindle
#

you cant extend class instances, only the class itself

#

.player is an instance of the class, that is created when it joins a voice channel

astral yoke
#

How would I be able to make a embed that lists all the servers my bot is in?

grizzled raven
#

@mystic violet do serverCache.player.constructor

mystic violet
#

ok

grizzled raven
#

@astral yoke loop through every entry in bot.guilds

mystic violet
#

I know this is a bot server, but im trying to setup an ftp server. any idea where I would put the credentials "username and password" to login to the ftp?

earnest phoenix
#

Lmao I fucking knew it

#

Suspension Reason: Overdue on payment

obtuse jolt
#

good job

#

how did you manage that?

#

@earnest phoenix

earnest phoenix
#

Give me a minute

#

Remember my VPS name

obtuse jolt
#

I mean, what did you use it for?

earnest phoenix
#

I planned on using one mainly for my own Purposes and one for maybe a public api

#

The funny thing is

#

It says Overdue on payment right

obtuse jolt
#

yeah

outer niche
#
    'Authorization' : token, 
    'Content-Type' : 'application/json' 
}

stats = {
    'server_count' : str(len(self.client.guilds)), # Remove self if not necessary 
    'member_count' : sum(len(s.members) for s in self.client.guilds), # Remove self if not necessary 
    'shard_count' : self.client.shard_count # Remove self if not necessary 
} 

data = json.dumps(stats, sort_keys=True, indent=4, separators=(',', ': ')) 

async with aiohttp.ClientSession() as s:
    async with s.post(f"https://arcane-botcenter.xyz/api/{bot_id}/stats", headers=headers, data=data) as r:
        text = await r.text()
        await ctx.send(f'{r.status} : {text}')``` ```Traceback (most recent call last):
  File "C:\Users\culan\Desktop\echo\echo.py", line 37, in <module>
    bot.load_extension("arcaneapi")
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 621, in load_extension
    lib = importlib.import_module(name)
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 724, in exec_module
  File "<frozen importlib._bootstrap_external>", line 860, in get_code
  File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\culan\Desktop\echo\arcaneapi.py", line 20
    async with aiohttp.ClientSession() as s:
                                           ^
SyntaxError: 'async with' outside async function```
obtuse jolt
#

I could probably get you an early access one through us but idk if you'd trust us since you just met me yesterday @earnest phoenix

earnest phoenix
obtuse jolt
#

you should probably get a refund

earnest phoenix
#

And suspending my VPS because of "overdue on payment"

#

bruh

#

Paysafe isn't refundable, I could message them asking to unsuspend it

obtuse jolt
#

ouch

#

how much do you pay?

earnest phoenix
#

But like the VPS before, they will probably screw it up again

obtuse jolt
#

and what do you get for it?

earnest phoenix
#

5 euros, not that much, so it's not that painful

#

what was your provider

#

Like that would've been the VPS for the bot, 2gb ram, 100gb space or so and done

obtuse jolt
#

so you use it for less ram intensive purposes?

earnest phoenix
#

Italian one, not saying to name though, don't wanna advertise

#

Exactly

obtuse jolt
#

is it more storage or CPU?

#

or is it just a small vps

earnest phoenix
#

Well I kinda went for more CPU than storage on it

#

Though for the API one I'm definitely going for Space and Bandwidth

obtuse jolt
#

we have 1 VPS for sale

£6/m - 2GB RAM 15GB storage and unlimited bandwidth

#

that's like 6.55 euro

#

$7

mystic violet
#

hey, my ftp server

192.168.0.8
``` Is working, I portforwarded it and my ftp: (my ip address) isnt working
obtuse jolt
#

omg

#

please dont

mystic violet
#

any idea why

earnest phoenix
#

I'm staying on my hu Host for now

obtuse jolt
#

is it a local ftp server?

mystic violet
#

Yeah it is

obtuse jolt
#

like just for you

mystic violet
#

No its for my friend

obtuse jolt
#

...

earnest phoenix
#

I was literally about to throw my phone against the wall

obtuse jolt
#

you have to be on the same wifi to use a 192.168

#

its a local address

mystic violet
#

I know,

#

thats why I portforwarded it

obtuse jolt
#

does it have a static ip?

mystic violet
#

Yeah

#

192.168.0.8 constantly

obtuse jolt
#

what errors are you getting?

#

connection refused?

#

@earnest phoenix ight, good luck with getting your server problem fixed

mystic violet
#

I mean, my local one gives me the ftp username and password to type, the ip one here. ill send it in dms

#

I cant connect to it

earnest phoenix
#

Its fixed already, I didn't upload anything on that VPS because I knew it would happen

mystic violet
#

says site cant be reached

trim saddle
#

@outer niche you can't use asynchronus functions inside synchronus functions

#

if you need to request in a synchronus function use requests

outer niche
#

I did I think

digital ibex
#

hi

#

how would i make something like this?

#

"1 year, 223 days and 8 hours ago"

#

and for joined he server

pale vessel
#

moment

#

use that

digital ibex
#

okie

#

ty

pale vessel
#

their docs have everything, so look it up

deft leaf
#

Looking for a simple bot to pull images from an imgur album after the command /smoke is ran

#

if anyone is for some reason interested

wicked salmon
#

I wish I could make a bot

earnest phoenix
#

why cant you . ?

wicked salmon
#

I tryed

#

Too complicated

earnest phoenix
#

don't give up 🙂 keep learning, you'll get it over time you wont just know everything over night.

wicked salmon
#

I already gave up

earnest phoenix
#

well thats not good,

deft leaf
#

yea why not i have pycharm ill give it a shot

slender thistle
#

if you need to request in a synchronus function use requests
@trim saddle suggesting a blocking lib for an async lib

trim saddle
#

silence shiv

#

i forgot the name of the other one

slender thistle
#

Just use asyncio with aiohttp

trim saddle
#

@slender thistle did you not hear the issue

slender thistle
#

Using async in sync functions

trim saddle
#

i refuse to deasyncify something just for the sake of using it in a sync fucntion

#

besides i use requests for posts

#

posts don't block

sick cloud
#

will an inline statement like this work with setting variables?

let logWebhook = isBeta ? config.beta.logChannel : config.stable.logChannel;
dusky marsh
#

ye

sick cloud
#

is that a yes

copper cradle
#

@wicked salmon it's easy af lmao

#

@sick cloud yes

wicked salmon
#

Not for me

copper cradle
#

just try again

#

coding is easy

sick cloud
#

cool

copper cradle
#

first learn a lang

#

then start on a project

#

that's what I did

marble juniper
#

just
don't look at yt tutorials

restive furnace
#

use official or "Official" but yeah, they better than yt tutorials

#

like if you would like to learn js and make bot in node.js this would be your guide https://discordjs.guide or https://discord.js.org

neat gazelle
#

how do you add a role to a user in the new v12?

restive furnace
#

try guildMember.cache.roles.add

neat gazelle
#

this is going to be in the instance of a message so message.guildMember.cache.roles.add?

#

(node:9076) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined

#
message.member.guild.roles.create({ // <== left here
            data: {
                name: "Rolename",
                color: "0xE400FF",
                permissions: ['SEND_MESSAGES', 'VIEW_CHANNEL', 'CHANGE_NICKNAME', 'SPEAK', 'CONNECT', 'USE_EXTERNAL_EMOJIS', 'READ_MESSAGE_HISTORY', 'ATTACH_FILES', 'ADD_REACTIONS', 'EMBED_LINKS', 'USE_VAD'],
                mentionable: true
            }
        }).then(function(role){
            message.member.guild.roles.add(role);
            .catch(console.error);
        });
sick cloud
#

message.member.roles.add

neat gazelle
#

im trying to make it create a role then add that role to the person that ran the command. it creates the role successfully but i cant get it too add

sick cloud
#

messages don't have guildMembers, just members, and they aren't a collection

neat gazelle
#

that worked. thanks man!!!

marble juniper
#

don't ask for approval
you have to wait 2 weeks or more for them to review it its not on demand

earnest phoenix
#

Anyone know a discord.js music bot on GitHub?

sick cloud
#

look for yourself

restive furnace
#

How i would make a command that can delete more than 100 msgs, i tried using for(let i = 0; i < parseInt(args[0]); i++) {} but cant figure out what to do next? (i know its possible because many bots have it.)

sick cloud
#

discord's got a limit for a reason, you'd need to time it out

#

use the general bulk deletion in groups of 50 or something, split apart, just keep the user notified of progress

restive furnace
#

so smh like 100 ms per deletion is ok or need even more?

modest maple
#

Well that would be ten a second

earnest phoenix
pale vessel
#

MY EYES

#

what is THAT?!

earnest phoenix
#

IDK

pale vessel
#

the size depends on the user's profile picture

finite bough
#

u can always resize it

pale vessel
#

he did

earnest phoenix
#

Hmm... But that happens on everybody when i mention them

#

Is there something wrong?
I'm CONFUSION

pale vessel
#

try viewing it on desktop

earnest phoenix
#

Hmm lemme try

#

I am looking for someone who can help code some bots plz dm me if interested

pale vessel
#

💰

earnest phoenix
pale vessel
#

then there you go

#

mobile discord is different in some ways from the desktop/web version

#

markdown too

earnest phoenix
#

Hmm... So is that an issue with discord app?(on mobile)

pale vessel
#

yes

earnest phoenix
#

Hmm... Discord staff is on crack or smoking weed or something...

zenith orchid
#

Now mobile version better than old mobile version.

restive furnace
#

true, but still its worse than desktop/web version.

earnest phoenix
#

i find it interesting that people manage to code on the phone.

tight plinth
#

how can I know how many ppl are connected into a vc using d.js v12

earnest phoenix
#

@earnest phoenix it is interesting as I'm coding on mobile but it's way too hard than expected...

#

i mean i did code plugins on a tablet back then for the pre-Minecraft Bedrock Edition

#

So i do feel that

#

everyone gotta start somewhere eh

#

Yea... Epic gamer moment...

soft flare
#

i hosted my bot to heruko via github and that mean will be 24/7 active?

finite bough
#

@soft flare if you have connected your credit card with heroku

#

yes

#

else it will have a limited amount of uptime per month

soft flare
#

i have 0.00 per mouth

#

@finite bough that mean its free

finite bough
#

it is free for a limited amount of time per month

#

if u connect your credit card

#

it will still be free

soft flare
#

nvm i will host it back when its was before

honest perch
earnest phoenix
#

When the Internet starts going back to the future

#

@honest perch show the code please...

honest perch
earnest phoenix
#

Just turn it around GWomoDrakeYea

#

@honest perch you can use
${msg.createdTimestamp - message.createdTimestamp}
Instead

honest perch
#

works now thanks 😆

restive furnace
#

Whats that editor

earnest phoenix
#

@honest perch np

#

I want my own bot

finite bough
#

can i somehow remove the undefined without saving the name in a db and without using 12v

earnest phoenix
#

How can i start

#

@restive furnace it's Mix file manager's own in-app code editor but i mostly use Termux's nano module

#

First of all, you gotta decide on what language you can use, so a bit of pre-knowledge about coding would be helpful

#

so i'd suggest reading that first

earnest phoenix
#

@earnest phoenix you should watch some updated bot making tutorials on YouTube or something...

finite bough
#

@earnest phoenix pls provide them an official guide link

earnest phoenix
#

oop sorry

earnest phoenix
#

oldState and newState

#

U can use these for ur bot

finite bough
#

yea i did that

#

thanks

#

i was blind and didnt see what i was doing

earnest phoenix
#

oldState.channel?

finite bough
#

mhm

earnest phoenix
#

Try it

#

Not member lol this is v11

#

Use

finite bough
#

i am using 11v

earnest phoenix
#

oldState and newState

#

Oh

finite bough
#

life makes sense now xD

earnest phoenix
#

Yeah srry i'm dumb

#

Yeah x)

finite bough
#

its ok

earnest phoenix
#

This is weird

finite bough
#

not rlly

#

@earnest phoenix another question

#

in 11v

earnest phoenix
#

Yes?

finite bough
#

is it better to see if the channel is deleted using channelDelete event or channelUpdate event

#

coz i am adding both the events in my bot

earnest phoenix
#

channelDelete

#

channelUpdate can't see this lol

finite bough
#

so will it be efficient if i do something like if (newchannel.id === 'undefined)

earnest phoenix
#

This is only for view changes

#

channelDelete

#

This is for see deleted channels

finite bough
#

if the new channel id is undefined

#

the that means channel is deleted

#

that way channelUpdate can see it

earnest phoenix
#

Hmmmm

#

The channelUpdate can see if a user
voice a => voice b
BUT he is undefined if he disconnect

finite bough
#

wut

earnest phoenix
#

U can use the channelUpdate for resolve this

finite bough
#

channelUpdate has nothing to do with voice channels

earnest phoenix
#

No yeah sorry x)

finite bough
#

ima try it and see if it works

earnest phoenix
#

I'm confusing the events

broken jay
#

How to use Kubernetes scaling for discord bot sharding?

golden condor
#

How do I check if something is a number
is it
x = NaN
or
isNaN(x)

#

Or neither

earnest phoenix
#

(No this isn't a good answer sorry)

pale vessel
#

!isNaN

golden condor
#
if(!isNaN(x)) {}```
#

Like that

pale vessel
#

yes

#

it mean if it's a valid number

#

float don't count afaik

golden condor
#

Should I do

pale vessel
#

ok?

golden condor
#

It doesn't work

pale vessel
#

you make it 404 right

#

try adding .jpg

golden condor
#

if(isNaN(x) === NaN) {}

#

.setImage(https://http.cat/404.jpg)

pale vessel
#

why

golden condor
#

It already si

#
if(!isNaN(reason)) {
 const embed = new Discord.RichEmbed()
    
    .setColor("#00aaff")
    .setImage(`https://http.cat/404.jpg`) 
    message.channel.send({embed})}```
pale vessel
#

that's a valid number

finite bough
#

^

pale vessel
#

why is it 404

golden condor
#

?

#

I want it so if it is text

pale vessel
#

.setImage

golden condor
#

Then it returns 404

#

But it doesn't

pale vessel
#

but it's a valid number

golden condor
#

What

#

look

#

If i type say

pale vessel
#

you want an invalid number to return 404

golden condor
#

c-error dbshjashgdsbhjcbds

#

I want it to return 404

pale vessel
#

!NaN means valid

#

NaN means not a number

golden condor
#

I use !isNaN

finite bough
#

Nan is not an number

pale vessel
#

that means a valid nunber

finite bough
#

!NaN means is an number

golden condor
#
if(NaN(reason)) {
 const embed = new Discord.RichEmbed()
    
    .setColor("#00aaff")
    .setImage(`https://http.cat/404.jpg`) 
    message.channel.send({embed})}```
pale vessel
#

it's not not a number

golden condor
#

Like that

pale vessel
#

yes

golden condor
#

Ok thanks

#

(node:31694) UnhandledPromiseRejectionWarning: TypeError: NaN is not a function

pale vessel
#

isNaN

golden condor
#

ok

#

It worked thanks

honest perch
#

how would one make a bot edit messages multiple times

#

discord.js I know how to edit once but not twice or more

restive furnace
#

for(let i = 0; i < /*how much times you wanna edit your message */; i++) is your answer

#

noy spoonfeeding

#

like make inside that msg#edit and setTimeout.

#

easy peasy'

earnest phoenix
#

how does one wait for a webhook in python? i want to use twitch webhooks for stream notifications, (@ me)

modest maple
#

you dont wait / shouldnt for webhooks

#

they're and event

restive furnace
#

@earnest phoenix ^

earnest phoenix
#

how do i check the amount of roles with v2

#

v12

sudden geyser
#

the amount of roles in what

earnest phoenix
#

in a guild

sudden geyser
#

do it the same way except add .cache after .roles

zenith terrace
#

^

earnest phoenix
#

@earnest phoenix if you don't know it's like this:
message.guild.roles.cache.size

#

so. like. how do they work on the python end then? the interwebs is confusing me

#

webhooks are in a sense reverse APIs

#

instead of you making a request to the API

#

the API makes a request to xouz

#

you*

split hazel
#

While downloading buffer with node-fetch, does the library expose any 'buffer downloaded so far' property in it? I want to create a some kind of transfer bar, getting the percentage from total buffer amount & buffer transferred so far

#

Or do I have to go deeper than that and use native libraries

earnest phoenix
#

but like, how do i listen? or do i just like set up a script at /webhook on my server to process it? or can it be done within d.py or py

#

host a webserver

#

i know that much.

#

i moved my bot onto a vps for this specific purpose

#

then what else do you need to know..?

slender thistle
#

You need a webserver framework

earnest phoenix
#

in python, im assuming

slender thistle
#

Anything that's async

#

so either aiohttp.web (what dblpy uses) or separate Django/Flask script

restive furnace
#

@split hazel i think it doesnt.

earnest phoenix
#

oki. ty

foggy trail
#

hello

#

i have a problem with bot

zenith terrace
#

what problem with bot

quartz kindle
#

what bot

zenith terrace
#

what what

foggy trail
#

the tic tac

mystic violet
#

Hey im hosting an ftp server, ftp:192.168.0.8 works on my PC, but my actual ip doesn't work on another PC, Im portforwarding and stuff. any help?

foggy trail
#

g*tictactoe

earnest phoenix
#

firewall?

mystic violet
#

Ive enabled "ftp server" to pass through windows firewall

#

do you think its my routers firewall?

earnest phoenix
#

ok @slender thistle new problem.

class WebhookHandler:
    async def hello(self, request):
        return web.Response(text="Hello world")

    def __init__(self, bot):
        self.app = web.Application()
        self.bot = bot
        self.app.add_routes([web.get("/", self.hello)])

    def start(self):
        web.run_app(self.app)

this code doesnt work, cuz dbl already has a server open. so..do i attach to that somehow or..?

honest perch
#

if we knew the problem, maybe

mystic violet
#

I figured out the problem, it was with windows firewall, Im wondering how to enable my FTP server to work through windows firewall, (right now I just have it turned off)

earnest phoenix
#

open a port?

mystic violet
#

How 😂

earnest phoenix
#

iirc ports 21 and 22

#

hold on

mystic violet
#

On my router?

earnest phoenix
#

both that and windows i think

mystic violet
#

all done

earnest phoenix
#

the port?

mystic violet
#

Yep

#

its all working now

#

thank you

#

:))

earnest phoenix
#

np

plucky root
#

Iae

slender thistle
#

@earnest phoenix either edit dblpy's internal code to add more endpoints or make the webhook run separately

earnest phoenix
#

but-
how do I make it separate? The server I tried to start already had no relation to dbl

earnest phoenix
#

I’m willing to hire I need a bot Dev dm me if interested

#

Payment will be up to 200 SGD

west spoke
#

whatBlink really? okay then

earnest phoenix
#

lol

#

Racoin: has Dev role
Racoin: "i want to hire a developer"
waitWhat

quartz kindle
#

dev role doesnt mean anything

#

it just means you have a bot on the website

late hill
#

Using money as only motivation without any other information

#

🧠

cursive dagger
#

@earnest phoenix glitch better on that one cheif

#

(in my opinion)

pale vessel
#

yes chief*

zenith terrace
#

Never used repl

#

Now im curious

pale vessel
#

it's public afaik

zenith terrace
#

Im guessing its online like glitch

pale vessel
#

yes

#

what else would it be for

zenith terrace
#

youtube

#

Every like 2 mins I stare at my glitch project. Cause if I leave it for like quite a few minutes, project gotta refresh..so I making sure it dont so it stays online 😂

#

Uh idk then

pale vessel
#

no

earnest phoenix
#

Time for an osu integration, why not

pale vessel
#

yes

#

get the API key

#

although it'll be deprecated soon (after v2 comes out)

#

setinterval

#

that's javascript though

#

setTimeout could actually work too if you cycle through them

earnest phoenix
agile orchid
slender thistle
#

are you using v2 API?

agile orchid
#

what is that even

earnest phoenix
#

ye

pale vessel
#

v2 isn't out yet

slender thistle
#

Is it even properly documented yet kek

earnest phoenix
#

oh oof

pale vessel
#

that's just the oauth

#

for integration

agile orchid
#

what is that i've never seen that

pale vessel
#

wrong page

slender thistle
earnest phoenix
#

lemme retry GWjiangoOmegaLUL

agile orchid
#

oh osu v2 api

#

bruh

pale vessel
#

peppy pls

#

i need it

#

by you can get news using v2 api

#

but you know, useless....

agile orchid
#

i'm using node-osu

#

pretty simple

#

and easy to use

pale vessel
#

nodesu

agile orchid
#

no

#

node-osu

pale vessel
#

y not

slender thistle
#

Can guess it uses v1 k3llyShrug

agile orchid
#

nodesu is garbage

pale vessel
#

wdym

#

shiv

slender thistle
#

node-osu

agile orchid
#

yes it uses v1

pale vessel
#

yeah of course

#

we can't get bearer token for v2 yet

#

y e t

slender thistle
#

inb4 its dev secretly added support for all endpoints smug

#

You can though?

pale vessel
#

not for me

slender thistle
#

I remember actually doing some stupid stuff with v2

agile orchid
tight plinth
#

quick question : I forgot how to use the map function to map server roles. How to use this function?

pale vessel
#

.map(r => r)

cunning glen
pale vessel
#

how did you get the token tho shivaco

#

I've seen a repo that has a tutorial but it didn't really work for me

slender thistle
pale vessel
#

yep

slender thistle
#

Look around here

pale vessel
#

that's it

slender thistle
#

I followed something there, it worked fine for me

agile orchid
pale vessel
#

it said error or something

earnest phoenix
#

anyone here

pale vessel
#

it should give a callback

earnest phoenix
#

good with

#

js

pale vessel
#

but it didn't

#

i might try again

slender thistle
#

Last time I played around with OAuth was like last year October or something

earnest phoenix
#

    channel.guild.fetchAuditLogs({type:12}).then(audit => audit.entries.find(entry => entry.executor.id == entry.executor.id).then(entry => {  
        author = entry.executor;
        author.ban("User deleted a channel, possible nuke attempt.")
        console.log(`Channel ${channel.name} delete by ${author.tag}`);
    }).catch((err) => {
        console.log(err)
    }))
});```
pale vessel
#

thing's must've been dated

#

idk

slender thistle
#

Though I certainly remember making it working following that guide

pale vessel
#

all right I'll give it a shot agane

earnest phoenix
#

why wont it take perm from the user who deleted role

#

this so confusing

#

might just go to sleep

quartz kindle
marble juniper
#

makes no sense to me

agile orchid
#

same

earnest phoenix
#

to be honest

#

idk

zenith terrace
#

TIm sounds frustrated when he says "wtf".

earnest phoenix
#

fuck it ill put the osu thing aside

agile orchid
#

why 🤔

#

it's pretty easy

slender thistle
#

It's not that hard at least

agile orchid
#

yea

earnest phoenix
#

code string The code you received.

#

what code tho?

agile orchid
#

wdym

earnest phoenix
agile orchid
#

code string The code you received.
how do you wanna get osu data?

earnest phoenix
#

wait i think i figured it out

#

after 10 minutes, finally got the bearer token

pale vessel
slender thistle
pale vessel
#

it was the redirect link

slender thistle
#

I knew you could do it

pale vessel
#

now i don't need a json file for country codes

earnest phoenix
#

Why does the code expire tho?

#

token*

agile orchid
#

What token? 🤔

pale vessel
#

bearer token

slender thistle
#

Can't you make it "non-expiring"?

pale vessel
#

well you check the mentioned user and compare it with the author

#

id would be good

#

yeah

agile orchid
#

do you just want a mention message or mention in a command

restive furnace
#

<@!id>

earnest phoenix
#

oh dang, it does work

restive furnace
pale vessel
#

yummy

agile orchid
#

ye forgot the rule nvm

#

i never sent any code here 👀

earnest phoenix
#

Resolved
https://gyazo.com/3729c0bf48153ae4a8e59991cdb44325

if(oldVoice && newVoice){
       let slog = newMember.guild.channels.find(channel => channel.name == row.clogs);
       if (!slog) return;
       if (row.logsenabled === "disabled") return;
       let sVoice = new Discord.RichEmbed()
            .setColor("#36393f")
            .setThumbnail(newMember.user.avatarURL)
            .setTitle("Vocaux")
            .addField("Utilisateur", `${newMember.user.tag} - (<@${newMember.user.id}>)`)
            .addField("A switché de channel", "Ancien channel: `"+oldVoice.name+"`\nNouveau channel: `"+newVoice.name+"`")
            return newMember.guild.channels.find("id", slog.id).send(sVoice); 
       }```
#

I don't see why i can't make this

copper cradle
#

what are you trying to do

earnest phoenix
#

Hey guys

#

Transfer voicechannel logs

halcyon iris
#

@restive furnace what to do here ?

restive furnace
#

send your bot error here

#

or the logs

#

does it print anything into console?

#

like logged in?

halcyon iris
#

Oh ohk just a minute

earnest phoenix
#

:/

halcyon iris
zenith terrace
#

what about it

earnest phoenix
halcyon iris
#

What to fill up

zenith terrace
#

anything that has the *

pale vessel
#

that's v1

#

no wonder it's ez

#

or is it

#

can't see

zenith terrace
#

That help

pale vessel
#

no

earnest phoenix
pale vessel
#

is that v1?

#

i'm assuming it is

#

it doesn't have v2 stuff

earnest phoenix
#

yes, i wanna test the concept though if its practical for the bot

#

anyone know how to use FS to move a file from /tempt/ to a folder on the server?

#

        author = entry.executor;
        author.ban("User deleted a channel, possible nuke attempt.")
        console.log(`Channel ${channel.name} delete by ${author.tag}`);
    }).catch((err) => {
        console.log(err)
      })
})```
#
bot.on('channelDelete', async channel => {

        author = entry.executor;
        author.ban("User deleted a channel, possible nuke attempt.")
        console.log(`Channel ${channel.name} delete by ${author.tag}`);
    }).catch((err) => {
        console.log(err)
    })```
summer torrent
#

remove })

earnest phoenix
#

the whole coding broke

#

lol

#

var author

#

🤔

#

?

#

not author = nanana

#

const author = entry.executor

#

Put this

#

Anyone can help me? :/

#

entry is not defined

#

Yeah u have to define entry

late hill
#

yes

earnest phoenix
#
let entry = await member.guild.fetchAuditLogs({type: <number>}).then(audit => audit.entries.first())```
late hill
#

@earnest phoenix You've set slog to a string, it won't have an id property.

earnest phoenix
#
let entry = await member.guild.fetchAuditLogs({type: 12}).then(audit => audit.entries.first())```
#

@late hill and why for the join and leave he work? 🤔

#

I take in the sqlite database

#

member not defined

late hill
#

Because you didn't make that mistake there?

earnest phoenix
#

hmm

#

Mmmh

#

Okay ty

#

I see

#

this broke even more

#

wtf

#

1sec

#

He work now lol ty

#

he?

#

oh thats dope

#

?

#

Why?

#

cuz in future i might make one

#

where someone leaves vc

#

it says who left

#

why this break

#

This is easy to make and short code PepeShrug

#

@earnest phoenix define member

#

its hard for me cuz i aint speak english that much

#

Oh you speak what normaly?

#

🤔

#

somalian

#

Too hard srry

#

lmao

#

this finna be like

#

wick bot type

digital ibex
#

hi uhm

pale vessel
#

hi

digital ibex
#

i am trying to make a command handler for Eris, i am kinda stuck on what to do

#

any ideas why it doesn't load and stuff?

#

hi

#

not sure how wrong it is but i am sure it is very wrong

#

shrug

pale vessel
#

no error whatsoever?

digital ibex
#

nope

quartz kindle
#

what exactly isnt working? have you tried debugging?

digital ibex
#

i have

#

and in a seperate file i do ```js
module.exports = {
name: 'i',

execute(message) {
console.log('aaa')
client.createMessage(message.channel.id, 'd')
}

#

nothing logs & nothing gets sent

quartz kindle
#

if you're exporting an object, execute should be a property of the object

#

execute: message => {}

digital ibex
#

ok

#

oh yeah and

#

wait, nvm

#

ok uh