#development

1 messages · Page 457 of 1

earnest phoenix
#

@heady zinc it never recieves the ready event

heady zinc
#

what

earnest phoenix
#

hi how do i do a report cammand

#

The bot never received the ready event before restarting

#

i need it so ppl can report other ppl and it will send it to me

#

or an admin

gilded blaze
#

Just think of it logically of how it would work and code it.

earnest phoenix
#

Discord needs a lightbulb emoji for these moments

neat falcon
ripe crown
#

lol

#

turtle.stats

#

.set prefix turtle.

#

wtf

neat falcon
#

What the fuck are you doing

#

you're in development, not testing-1

earnest phoenix
#

Lol

#

:cosmicbrain:

#

Fuck my life

earnest phoenix
#

testing your bot in development is a sin

#

smh

#

Lol

earnest phoenix
#

how do I delete these lines

#

I try everyhing

muted barn
ruby dust
#

I remember tonkku had an aswer to that in #general, it's something related to css

#

or was it tonkku Thonk

#

now I'm thinking it was auxim, or aly, idk anymore ¯_(ツ)_/¯

earnest phoenix
#

how long ago

#

Ok I want to add some NSFW commands to my bot, but I don't know of any good apis to use, any suggestions?

#

Once I get the API, I can do the rest lol

#

@ruby dust

#

how long ago

ruby dust
#

a few days ago

#

I think

earnest phoenix
#

I could not find you

#

@ripe crown I believe you can assist me

ripe crown
#

with?

#

@earnest phoenix srry for the late reaction im playing a game so didnt see the mention

vernal basin
#

anyone got any ideas on how to fix this?

#

that's the folder contents

#
const client = new Discord.Client();
​
client.on("ready", () => {
  console.log("I am ready!");
});
​
client.on("message", (message) => {
  if (message.content.startsWith("ping")) {
    message.channel.send("pong!");
  }
});
​
client.login("supersecretid");```
knotty steeple
vernal basin
#

just a note, I did replace "supersecretid" with the token, with quotes

#

is it supposed to be no quotes?

knotty steeple
#

quotes/strings

vernal basin
#

oof, just a sec

knotty steeple
#

its supposed to be like that

vernal basin
#
​
^

SyntaxError: Invalid or unexpected token
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    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)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
PS C:\Users\gah\Documents\EXP Bot>```
knotty steeple
#

i dont see any problem Thonk

vernal basin
#

the bot is still offline though?

flat kite
#

What do I do when I'm in this discord and says I still need to be in it

knotty steeple
#

where @flat kite

flat kite
#

Nvm

knotty steeple
#

OK

earnest phoenix
#

Ok I want to add some NSFW commands to my bot, but I don't know of any good apis to use, any suggestions?

#

@ripe crown ^^

ripe crown
#

Uhm

#

random-puppy

#

to grab nsfw photos from imgur

flat kite
#

How do you even make one

knotty steeple
#

make one what

flat kite
#

A bot

knotty steeple
#

with code

flat kite
#

Oh so u cant really make it on mobile

knotty steeple
#

no not really

flat kite
#

Oof

#

So do the bot developers take requests?

knotty steeple
#

most of them nah

#

some might do it at a cost

#

its better to just code it yourself cuz you and only you know what you want

#

and its free*

#
  • = hosting on your computer and not a dedicated host because hosting can cost money unless you somehow get a free host like glitch or heroku
flat kite
#

Oh rip

#

I dont have a pc

knotty steeple
#

sad

quartz kindle
#

@vernal basin you have an invisible character code 8203 on line 3

#

Unicode Character 'ZERO WIDTH SPACE' (U+200B)

knotty steeple
#

Thonk how does one get a zero width space in their code

quartz kindle
#

no idea, probably coding on notepad

knotty steeple
#

just notepad

#

not notepad++

#

rip

quartz kindle
#

his "mybot" file has the default icon, not associated with any editor

#

probably notepad

knotty steeple
#

yea ur right

#

get a editor please its better

#

also enable file name extensions i recommend

quartz kindle
#

^

muted barn
flat kite
#

Is there a bot that could let you chat as a different name?

knotty steeple
#

visual studio code, sublime text etc.

quartz kindle
#

what do you mean?

#

chat as a different name

flat kite
#

Be as your name then like chat under another persons name in the server

muted barn
grizzled isle
#

Nope

#

only setting nicks would do

quartz kindle
#

you can make the bot repeat what you said

#

but thats that

#

you can talk through the bot if you're the owner, but that against TOS i believe

knotty steeple
#

webhooks GWqlabsThinkLol

viscid falcon
#

im trying to log the warn and kick command to a certain channel, im using client.channels.get("member-log").send("message") but it gives me ReferenceError: client is not defined

quartz kindle
#

then client is not defined

glad charm
#

^

knotty steeple
#

what do you have defined as new Discord.Client()

viscid falcon
#

i figured that but how do i define it

muted barn
#

^

viscid falcon
#

ok thank yiou

#

oh wait nothing in the command fil;e

#

in my index file i have it defined as client

quartz kindle
#

if you're using module exports, i believe you need to redefine it in every file

viscid falcon
#

oh ok thank you

knotty steeple
#

yes you do @quartz kindle

#

its annoying GWqlabsSweats

viscid falcon
#

do i need to define it as anything diffrent or still new Discord.client()

quartz kindle
#

i dont use module exports so idk

#

it should be exactly the same as you define it in your main file

#

i guess

knotty steeple
#

it should

viscid falcon
#

thank you

knotty steeple
#

thing is i dont use module.exports like that but exports.run where run is a function that basically has the command's code

quartz kindle
#

but you still need to redefine everything?

knotty steeple
#

yes

quartz kindle
#

rip

knotty steeple
#

yes i know

quartz kindle
#

i have one main file which contains all the command functions, then i have a couple other files that contain the heavy logic of the function

#

and i load them using eval

#

xD

knotty steeple
#

so in main file it would be like this to run the command

const cmd = require(`./cmds/${command}.js`)
cmd.run(bot, msg, args, config)
#

then in the command file
exports.run = (bot, msg) => { // blah }

viscid falcon
#

so i added const client = new Discord.client but it said discord is not defined, so i added const Discord = require('discord.js'); but now its giving me Discord.client is not a constructor

knotty steeple
#

so yea

muted barn
#

How would I make an emoji command?

knotty steeple
#

what you mean

muted barn
#

Like

#

emoji Hello

#

And it would send Hello with emojis

quartz kindle
#

ah

#

just replace the string with the emoji codes for the regional indicators

#

or simply copy the unicode character

muted barn
#

O

#

K

#

Thanks!

viscid falcon
#

but what would i do for my error mentioned above?

knotty steeple
#

code is case-sensitive so its Client not client

viscid falcon
#

o thanks

#

idk how i missed that

#

but now on the line client.channels.get("member-log").send("test") its giving me cannot read property 'send' of undefined (sorry if im being a bother)

knotty steeple
#

.get() uses ids

viscid falcon
#

oh is there something that uses channel names?

knotty steeple
#

you have to do .find(c => c.name === "name")

#

iirc

viscid falcon
#

thanks

#

im so sorry that im asking for more help but on the same line which is now client.channels.find(c => c.name === "member-log").send("test") is giving me cannot read property send of null

knotty steeple
#

oh wait

#

you have to do msg.guild.channels.find()

#

my bad

viscid falcon
#

oh thanks

#

thank you so much! ive been having trouble with this for several days and it finally works

knotty steeple
#

np :D

vernal basin
#

@quartz kindle i'm coding using the VS thing

#

Visual Studio Code

knotty steeple
#

nice

#

you can get custom themes

vernal basin
#

where is the extra space coming from?

knotty steeple
#

btw

vernal basin
#

owo

#

how

knotty steeple
#

just search theme in the extensions tab

vernal basin
#

oh cool

quartz kindle
#

@vernal basin your error says its on line 3

vernal basin
#

lets try again, I deleted line 3 completely

#

dang, again

#

line 6 this time

#

ah I get it

#

I can't have random [Enters] in the code

#

YES

#

it worked

#

thanks 😄

#

onto step 2

knotty steeple
#

that happens when you copy and paste code sometimes

#

on websites with like codeblocks

vernal basin
#

ah, that would explain it

quartz kindle
#

yeah some websites encode special characters in weird ways

worldly sigil
#

i need some help coming up with functioning song queue

#

i have almost everything i need i just need a way to continuously check if the current song is finished playing

neon swift
#

There's an after call you can set when you start playing the song

worldly sigil
#

oh really?

#

is it a parameter of .start()?

slender thistle
#

How can I edit the Vote button with CSS? 🤔

quartz kindle
#

use the dev tools, inspect element, see the css structure and how to target it

slender thistle
#

Gotcha

#

Thanks

vernal crow
#

@abstract perch What library do you use?

vernal basin
#
{
    "token": "mytoken";
    "prefix": "exp!";
}

so the config guide tutorial told me to do this, except the compiler keeps saying there's a problem with using a colon and that it expects a semicolon

#

fixed, nvm

abstract perch
#

Discord.js but why are you asking? @vernal crow

vernal crow
#

Cause of what you put in general

#

One sec. Gotta drive. But I’ll help you with the welcome message.

stone sun
#

can someone help me

spare quail
#

ye token was cool

stone sun
#

oof

#

pls dont use it

spare quail
#

you should reset it in case someone stole it lol

quartz kindle
#

👀

stone sun
#

i reset it :v

spare quail
#

tim took the token and now will download illegal stuff with that token

quartz kindle
#

Lol

stone sun
#

:V

#

noooo

spare quail
quartz kindle
#

illegally downloads bot server/user list

#

compares it to mine

spare quail
quartz kindle
#

laughs/cries

spare quail
#

lmao

quartz kindle
#

sends mass dms until banned

#

ok enough shitposting, sorry about that

spare quail
#

lul

abstract perch
#

@vernal crow You have not understand. They are tons of bots that logs when a user join the server. My bot works fine, but I have to setup the command to send it there #265156361791209475

-welcomeset {channel}

quartz kindle
#

if only admins/mods can use that command, then change it so you can also use it

#

or ask a mod to use the command for you lol

abstract perch
#

I need Manage Channel.

#

My bot is muted

#

For no reason

quartz kindle
#

there is always a reason. search for it in #mod-logs

abstract perch
#

Ohhh yes

earnest phoenix
#

whats the function to unban on discordjs, on the docs it says its guild.unban but when i try that the function doesn't exist

quartz kindle
#

stable is guild.unban()

#

master is guild.members.unban()

earnest phoenix
#

ah thanks

worldly sigil
#

bot.player = await bot.voice.create_ytdl_player("https://www.youtube.com/{}".format(url),after=lambda: play_next(ctx,args))
so this doesnt seem to be working for me

#

def play_next(ctx, args): coro = play_music.invoke(ctx,args) fut = discord.compat.run_coroutine_threadsafe(coro, bot.loop)
it doesnt go past the first line

vernal crow
#

@abstract perch Okay, I see what you’re saying.

abstract perch
#

Nah, my bot got muted for a command that I made for fun without a prefix

#

And I thought that my bot it wasn’t here

#

But I have already fixed it like 3 months ago.

vernal basin
#

how does one make a type of database where you store information of a player and such, and how would you access it when a user prints a command such as !mypoints, where their points are stored, etc.

sick cloud
#

you don't really "make" one. there are local databases that are easy to use like lowdb, sqlite and leveldb, then when you need really scalable and bigger access, then you get mysql, mongo, rethink, etc

#

just got to choose what is best for you

vernal basin
#

cool, thanks

hot eagle
#

my favorite database for simple projects is google sheets

vernal basin
#

could you teach me how to read in google sheets o.o

sick cloud
#

hilarious. and np @vernal basin. i myself use rethink for everything since i'm an addict

#

and pls no

#

google sheets isn't a database

vernal basin
#

oh

hot eagle
#

no it really has all the functionality you need if you aren't doing complicated joins and stuff

knotty steeple
#

google sheets

#

use a proper db pls

#

okay thanks

hot eagle
#

there is no reason to knock it unless you are a grognard

#

we aren't making banking software here

knotty steeple
#

uhh

#

yes ill make my new banking software using sqlite!!1!

vernal basin
#

how does one write/read in databases

knotty steeple
#

how do you even store data

#

or read data

vernal basin
#

D: sorry I'm bad

knotty steeple
#

how tf do you even use it

hot eagle
#

thats what im saying its perfect for beginners because you can see it in action

earnest phoenix
#

LOL is this a joke

hot eagle
#

there is an api

knotty steeple
#

ikr @earnest phoenix

earnest phoenix
knotty steeple
#

this is about development

sick cloud
#

so if i make a function like this

const thing = async () => {
    return 'hi';
}

can i use it like this?

thing().then(hi => console.log(hi));
// 'hi'
uncut slate
#

yes

sick cloud
#

okie dokes

restive silo
#

you shouldn't use async function without await tho since there is no reason to make it async

worldly sigil
#

so self.audio_player = self.bot.loop.create_task(self.audio_player_task()) was on this github for music but it doesnt seem to work

#

and i have no idea where audio_player_task() comes from

sick cloud
#

i need to use things like await get (url thing) @restive silo

#

thats why

restive silo
#

kk

sick cloud
#

little issue here:

(node:10221) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'url' of undefined
    at Object.handler (/home/tony/musicbot/commands/play.js:45:65)
    at commands.get.push.then.results (/home/tony/musicbot/commands/play.js:99:18)
// play.js, line 44/45/46:

dispatcher = 
        queue.connection.play(ytdl(music[msg.guild.id].songs[0].url, { quality: 'highestaudio', filter: 'audioonly' }), { passes: 4 });
    
// play.js, line 98/99/100:

                commands.get('play')
                .handler(msg, music[msg.guild.id]);
            });

i think its the fact that its not getting enough time to run this code, which fetches the video details:

    push: async (msg, args, queue) => {
        YouTube.searchVideos(args.join(' '), 2)
        .then(async res => {
            YouTube.getVideoByID(res[0].id)
            .then(async results => {
                const res = {
                    title: results.title,
                    id: results.id,
                    url: `https://www.youtube.com/watch?v=${results.id}`,
                    description: results.description,
                    addedBy: msg.author,
                    length: results.durationSeconds,
                    thumbnail: results.thumbnails.high.url,
                    channel: results.channel.channelTitle,
                    publishedAt: results.publishedAt
                };
    
                queue.songs.push(res);
                return res;
            }).catch(console.error);
        }).catch(console.error);
    },
#

its very annoying :V

earnest phoenix
#

Does anybody here use GPU.js or something similar to speed up their bots?

#

I haven't looked into this much so I'm not sure if JIMP would work on it

sick cloud
#

never even knew that existed

#

whats the bot ratelimit for setting profile pictures?

inner jewel
#

"gpu.js is a single-file JavaScript library for GPGPU in the browser"

#

also running code on gpus != performance boost

#

moving data between main memory and gpu memory is expensive

#

and unless you're doing massive amounts of simple calculations, there's no real benefit

vernal basin
#

how does one detect if a new user joins the server?

uncut slate
#

the guildMemberAdd event

vernal basin
#

thx

viscid falcon
#

is there a way to wait a set amount of time in javascript (sorry if this is a dumb question)

quasi marsh
#

Not really

#

Not like the time.sleep() function from python

#

You can however set use setTimeout() I think

worldly sigil
#

ytdl_options (dict) – A dictionary of options to pass into the YoutubeDL instance. See the documentation for more details. where can i find documentation for this
the link is broken

quasi marsh
#

Which you can use to call a function to execute after the timeout

#

@worldly sigil ytdl docs in python are extremely shitty

#

If it's for a music bot I'd not look into ytdl

worldly sigil
#

but

#

all the work ive done so far

#

cri

quasi marsh
#

I mean personally when I tried to use it I could get it to work but it would load tracks insanely slowly

#

And nobody is going to wait 30 seconds for a music bot

worldly sigil
#

whats the other way to do it

quasi marsh
#

Essentially Lavalink is a seperate program that loads the tracks and plays them for you through Discord

#

It more or less takes over all of the music functions, skips, volume, queue, search etc

worldly sigil
#

it looks a lot easier

quasi marsh
#

you'll need to use Lavalink with Java 10 btw

#

Java 8 & 9 gave me issues

worldly sigil
#

i need to use java too huh

quasi marsh
#

Well yeah

#

but honestly you just put it on your vps

#

and run it

worldly sigil
#

playing music in sequence is overrated anyways

#

real men run the command each time

quasi marsh
worldly sigil
#

if you do something like this while not ytplayer.is_done(): await asyncio.sleep(1) await my_bot.voice.disconnect() you wont be able to run any other commands until its done right

quasi marsh
#

Doesn't seem like a good idea to me

worldly sigil
#

thought as much

#

this was on stack

viscid falcon
#

if i tell my bot to say something in a specific channel and that channel does not exist on that server, would it crash my bot?

slender thistle
#

Most likely an error

viscid falcon
#

is there a way i can check if a server has a certain channel?

#

im using discord.js

gilded blaze
#

guild.channels.has()

viscid falcon
#

and is that channel name or id?

gilded blaze
#

Pretty sure it is id.

viscid falcon
#

thanks

gilded blaze
#

Because ids are unique.

viscid falcon
#

umm is there a way toi check for channel name?

gilded blaze
#

guilds.channels.find()

viscid falcon
#

tahnk you

gilded blaze
#

And just find the one using the name property

viscid falcon
#

??

#

what do you mean

#

the one?

#

the channel?

#

i

#

opps wrong kb

golden sparrow
#

my bot has like 300+ servers but I wanna give up and stop working on it, should I still continue with it?

slender thistle
#

Up to you

#

Users might still wanna use the bot

golden sparrow
#

yea, its being used a lot

#

near 24 7

slender thistle
#

Your call :^)

golden sparrow
#

so i want to continue it but dont want to

slender thistle
#

Probably upload the code on GitHub and let users know about it /shrug

golden sparrow
#

yea oof

sick cloud
#

@golden sparrow what i'd do is keep it running

#

but tell users it won't be updated

#

then maybe discontinue it after a year

earnest phoenix
#

a dude

#

needs help

#

which is me

muted barn
#

?

#

What's wrong?

earnest phoenix
#

alot

muted barn
#

Ok

#

Begi

#

*Begin

#

👀

sick cloud
#

@earnest phoenix ask your question instead of asking to ask

muted barn
#

Lol

earnest phoenix
#

one sec

#

aaaaa

#

python me

#

brb

#

how do i make my bot support

#

itunes

#

my music bot

#

a friend gave me this which it does support a soundcloud

#

which i didnt have

#

whats the thing called where i can share my code at

#

cause its over 2000char

sick cloud
#

you can't support itunes

earnest phoenix
#

why not

#

tho

sick cloud
#

because

#

1, no api
2, like spotify, they don't allow you legally

earnest phoenix
#

cant i make the bot search from youtube

sick cloud
#

yes

earnest phoenix
#

when someone drops an itune

#

link

sick cloud
#

well

#

no

#

since itunes !== youtube

earnest phoenix
#

yeah but my members are asking for support

#

for itunes

sick cloud
#

tell them its legally impossible

#

end of story

#

also tell them that the itunes program exists

earnest phoenix
#

alright thanks

sick cloud
#

np

next zealot
#

does anyone have some spare time to help me?

neat falcon
#

what language + lib?

next zealot
neat falcon
#

oh

#

sorry, i don't know much about discord.py and nothing really about async sadcat

next zealot
#

oof

bright spear
earnest phoenix
#

yo

#

const Discord = require('discord.js'); const client = new Discord.Client(); client.on("ready", async => { setInterval(function(){ client.channels.find('id', '435814918651117579').setName("♡A"); client.channels.find('id', '435814918651117579').setName("♡An"); client.channels.find('id', '435814918651117579').setName("♡Anime"); client.channels.find('id', '435814918651117579').setName("♡Anime G"); client.channels.find('id', '435814918651117579').setName("♡Anime Ga"); client.channels.find('id', '435814918651117579').setName("♡Anime Gam"); client.channels.find('id', '435814918651117579').setName("♡Anime Game"); client.channels.find('id', '435814918651117579').setName("♡Anime Gamer"); client.channels.find('id', '435814918651117579').setName("♡Anime Gamers♡");}, 10500); }); client.login("NDczODA2MDk5MzY4Mzc4Mzg4XAL8gFIEpjg9dbdRSE4DU");

#

i heard this is breaks discord tos?

#

is that true?

bright spear
#

btw u know that will set the name 8 times at once so nobody will be able to see it

#

and that is pretty close to api abuse

earnest phoenix
#

i dont code js

#

so i wouldnt know

#

does this break the tos

#

tho?

next zealot
#

i can't pip install dbl for some reason

#

nvm it's dblpy

short siren
#

@earnest phoenix Id add set interval so that you can actually see the first second and third etc. Also it would make it happen slowly so it wouldn't be as bad api abuse

#

Tbh it's probs fine if there is a interval because rainbow roles does it

uncut slate
#

rainbow roles are against the ToS as well

short siren
#

Oof

#

Seriously?

earnest phoenix
#

@short siren i need help cause i dont know js

short siren
#

Iv seen loads of bots do it

heady zinc
#

there's loads of bots that breaks the ToS indeed

short siren
#

You could setTimeout

earnest phoenix
#

idk how

short siren
#

For say 2000 that's 2 seconds

earnest phoenix
#

i cant code js

short siren
#

Google setTimeout

earnest phoenix
#

where

short siren
#

The first example is it will send alert after 3 seconds

earnest phoenix
#

so like

short siren
#

If you define the message then msg.edit

#

So like

#

Send it then edit it with timeout

earnest phoenix
#

const Discord = require('discord.js'); const client = new Discord.Client(); client.on("ready", async => { setInterval(function(){ setTimeout(function(){ alert("H"); }, 3000); setTimeout(function(){ alert("He"); }, 3000); setTimeout(function(){ alert("Hel"); }, 3000); setTimeout(function(){ alert("Hell"); }, 3000); client.login("NDczODA2MDk5MzY4Mzc4Mzg4XAL8gFIEpjg9dbdRSE4DU");

#

@short siren like this

short siren
#

Alert is html

#

So change that to to console.log

#

Or something

earnest phoenix
#

idk how

#

me no js

#

0 js

short siren
#

Also I wouldn't send your token if I were you

earnest phoenix
#

i took off 7 letters

short siren
#

Oh ok

earnest phoenix
#

so can i get help?

short siren
#

I'm not going to spoonfeed but if I were you I'd focus on firstly getting one message to edit after 3 seconds first

earnest phoenix
#

please

#

look fam i dont know js

#

:(

short siren
#

I can't tell youh everything

#

If you read the link

earnest phoenix
#

this is for private use

short siren
#

So?

earnest phoenix
#

just letting you know

next zealot
earnest phoenix
#

function myFunction() {
myVar = setTimeout(alertFunc, 3000);
}

function alertFunc() {
alert("Hello!");
}

#

now

#

how can i make it edit

short siren
#

You can't use s function before you say it

earnest phoenix
#

so? how?

short siren
#

Just Google it

bright spear
#

@next zealot is that with DBL?

#

make sure your dbl token is correct

next zealot
#

yes

bright spear
earnest phoenix
#

myVar = setTimeout(alertFunc, 3000);

function myFunction() {

function alertFunc() {
alert("Hello!");
}

#

like this

uncut slate
#

you can use functions before you declare them, lol @short siren

earnest phoenix
#

const Discord = require('discord.js'); const client = new Discord.Client(); client.on("ready", async => { setInterval(function(){ client.channels.find('id', '435814918651117579').setName("♡A"); client.channels.find('id', '435814918651117579').setName("♡An"); client.channels.find('id', '435814918651117579').setName("♡Anime"); client.channels.find('id', '435814918651117579').setName("♡Anime G"); client.channels.find('id', '435814918651117579').setName("♡Anime Ga"); client.channels.find('id', '435814918651117579').setName("♡Anime Gam"); client.channels.find('id', '435814918651117579').setName("♡Anime Game"); client.channels.find('id', '435814918651117579').setName("♡Anime Gamer"); client.channels.find('id', '435814918651117579').setName("♡Anime Gamers♡");}, 10500); }); client.login("NDczODA2MDk5MzY4Mzc4Mzg4XAL8gFIEpjg9dbdRSE4DU");

#

whats the number on the buttom?

short siren
#

The 10500

earnest phoenix
#

yea

short siren
#

?

#

The time

#

Like how long

#

In ms

earnest phoenix
#

how long of what?

short siren
#

How long till it changes

earnest phoenix
#

oh so rechange?

bright spear
#

did you even write that code 🤔 obviously you dont understand it

earnest phoenix
#

no

#

i didnt

bright spear
#

who did then

earnest phoenix
#

a friend who got it from a friend who got it from a friend who got it from someone who gave it to me

short siren
#

Umm

bitter sundial
#

did you just leak your token

knotty steeple
#

i think he did

jagged plume
#

he said he took part of it out

knotty steeple
#

idk looks like it

bitter sundial
#

which part tho

#

is that the beginning or the end

#

looks like some from the middle

knotty steeple
#

it is

#

its the beginning and some part of the middle

bitter sundial
#

nah its most of the beginning and then a bit of the end

knotty steeple
#

hm ok

#

i got this when i tried to decode it 473806099368378388\��R�8=u�QHN

bitter sundial
#

that might be a full id

#

and then a bit of the end

#

but theres no dots so

#

that's what leads me to believe its a bit of the end

slender thistle
knotty steeple
#

pretty sure it is

heady zinc
#

psure everything is editable

slender thistle
#

Or is it just body affecting that

knotty steeple
#

nah

slender thistle
#

Oh, aight

#

Yep, it is. I was using color instead of background for whatever reasons and got lost 😄

earnest phoenix
#

hi can someone help me

#
    
      let guild = client.guilds.find('what gose here');
      let channel = guild.channels.find(`id`, 'what gose here');
      
      if (message.author.id == loggedIn.pref.join(' ')) {
      
      let msg = args.join(' ');
        
      channel.send(msg);
      
      } else {
      
      message.reply(`:warning:  You are not logged in!`);```
knotty steeple
#

logged in to what

earnest phoenix
#

oh i have made it so you need to login to use the command

knotty steeple
#

log in

#

to what

earnest phoenix
#

so on my discord server you do prefix-console login < this will log you it to the bot to you can use the owner only commands

#

boy i dont know that to put in to let guild = client.guilds.find('what gose here');

#

and let channel = guild.channels.find(id, 'what gose here');

bitter sundial
#

in the find one, you put in a function that returns true if it's what you want

#

client.guilds.find(guild => guild.name == 'Discord Bot List');
for example

#

or as you have this alternate syntax

#

guild.channels.find('id', '264445053596991498');
is the same as
guild.channels.find(channel => channel.id == '264445053596991498');

earnest phoenix
#

let guild = client.guilds.find('ID');

#

what do this one do

bitter sundial
#

is the say command going to send something to a specific channel

earnest phoenix
#

yes

#

just the main

bitter sundial
#

and you know the ID of that channel?

earnest phoenix
#

467877657988562955

#

yes

bitter sundial
#

you can directly use client.channels

#

and the get function

#

client.channels.get(id)

earnest phoenix
#

?

bitter sundial
#

for example const development = client.channels.get('272764566411149314')
that would set development to this channel

#

then you could development.send('help me')
and the bot would send "help me" to this channel

earnest phoenix
#

Also just look at the discord js docs

#

It shows everything

#

that did not work @bitter sundial

bitter sundial
#

what's the code right now

earnest phoenix
#

back to how i had it

bitter sundial
#

like the original code block?

earnest phoenix
#

?

#

im slow

#

if you know what i mean

bitter sundial
#

I don't

earnest phoenix
#

im as some ppl will call retarted

#
    
      let guild = client.guilds.find('ID');
      let channel = guild.channels.find(`id`, 'ID');
      if (message.author.id == loggedIn.pref.join(' ')) {
      
      let msg = args.join(' ');
        
      channel.send(msg);
      
      } else {
      
      message.reply(`:warning:  You are not logged in!`);
      
      }```
#

this is home made all i need to know what i need to put in let guild = client.guilds.find('ID'); and let channel = guild.channels.find(`id`, 'ID');

bitter sundial
#

you don't need the let guild line

earnest phoenix
#

what do you need

#

also do not find with ID, since the collection is mapped by ID just use .get

bitter sundial
#

and on the let channel line replace guild with client

#

and do what tom said

earnest phoenix
#

ok

#

do i need to put an ID in to the spot where i have put ID or do i leave it blank with a space in it

muted barn
#

How can I make the bot send the number of guilds it's inside?

#

Is it bot.guild.size?

bitter sundial
#

@muted barn yes

#

actually

#

bot.guilds.size

muted barn
#

?

#

Oh

#

Ok thanks!

bitter sundial
#

@earnest phoenix you put an id there

earnest phoenix
#

@earnest phoenix you can see o nthe d.js docs that "Collection extends Map"
Since collection doesnt have its own get method, it must take it from Map, so you look up Map on MDN or something and look for the get method to see what parameters it needs

#

what id my channel id or ?

bitter sundial
#

yes

earnest phoenix
#

also i host my bot off glitch.com how to i make a restart thing

knotty steeple
#

process.exit() should work

#

glitch automatically restarts process doesnt it?

muted barn
earnest phoenix
#

no

#

not from what i know

muted barn
#

Can you help me host my bot? @earnest phoenix

#

On glitch

bitter sundial
#

glitch restarts whenever you type code

muted barn
#

Because I have no idea how xd

earnest phoenix
#

the say is still not working

#

im just going to leave it for now

#

i will bother you agin if needed

earnest phoenix
#

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa < sorry for all the a's but i have tryed every thing i know

#

and i still cant get it to work

#

what's your problem

#

lol

#

this ```if (choice == "say") {

  let guild = client.guilds.find('what ID');
  let channel = guild.channels.find(`id`, 'what ID');
  if (message.author.id == loggedIn.pref.join(' ')) {
  
  let msg = args.join(' ');
    
  channel.send(msg);```
#

it is a say command for my bot

#

and i just cant get it to work

#

dont .find() with an ID, use .get(). collections are mapped by ID. IFfyou read the discord.js docs you will find this clearly stated.

#

you get ids with get

#

not find

#

i tryed that and still nothing

#

is the console outputting an error

#

also, you didnt tell us what if loggedIn.prefis, but jusging from
if (message.author.id == loggedIn.pref.join(' ')) {, this screams logic error to me.

#

He doesnt have an error most likely, just an if statement that will never be true because it makes no sense

#

no not that i now of

#

yeah

#

remove all your loggedin code

#

do a basic if

#

and try again

#

that way you know what's the issue

#

this wole bot that im doing is an unfinished bot that a friend gave me befor he stoped coding

#

so i dont know what im doing

#

learn how to code

knotty steeple
#

well you should learn

earnest phoenix
#

either that or just use a bot from dbl

#

your choice

gilded thunder
#

How can I display emotes in d.py with this sort of script?

emotes = ctx.message.server.emojis
    emotelist = ""
    for emoji in emojis:
            result += emoji. + " "```
#

My main question is how do I get the actual emote in the result emoji.

slender thistle
#

"<:{0.name}:{0.id}>".format(emoji)?

upper ember
#

im trying to make it where someone joins it auto dms them saying thanks for joining my server(edited)

gilded thunder
#

What lib?

upper ember
#

d.js

gilded thunder
#

Ok can't help

#

@slender thistle lemme try that

gilded blaze
upper ember
#
bot.on('guildMemberAdd', member => {
    const channel = member.guild.channels.find('name', 'welcome');
    if (!channel) return;
      member.send("Thank you Joining my server");
  });
``` but that doesn't dm me when i join the server
gilded thunder
vernal basin
#
  const args = message.content.slice(prefix.length()).trim().split(/ +/g);
                                     ^

ReferenceError: prefix is not defined
    at Client.client.on (C:\Users\23stephenx\Documents\EXP Bot\mybot.js:7:38)
    at emitOne (events.js:116:13)
    at Client.emit (events.js:211:7)
    at MessageCreateHandler.handle (C:\Users\23stephenx\Documents\EXP Bot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\23stephenx\Documents\EXP Bot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (C:\Users\23stephenx\Documents\EXP Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (C:\Users\23stephenx\Documents\EXP Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
    at WebSocket.onMessage (C:\Users\23stephenx\Documents\EXP Bot\node_modules\ws\lib\event-target.js:120:16)
    at emitOne (events.js:116:13)
    at WebSocket.emit (events.js:211:7)```
this is the error that I get when I try to run any command:
```client.on("message", (message) => {
  const args = message.content.slice(prefix.length()).trim().split(/ +/g);
  const command = args.shift().toLowerCase();```
here is the line above and below
#

I tried looking around but my config.json file is correct

#

"prefix": "exp!",

#
const client = new Discord.Client();
const config = require("./config.json");
const fs = require("fs");```
#

that's the header

gilded blaze
#

@upper ember Error?

upper ember
#

I don’t get any error

gilded blaze
#

Do member.user.send

upper ember
#

ok

#

ill try

#

still don't work

gilded blaze
#

That means the if statement is false.

slender thistle
#

Oh ok, the format should be correct

#

Eh well

#

@gilded thunder Most likely your bot doesn't have access to the emotes or something

vernal basin
#

does anyone here know how to link up an excel sheet (database) and JS? cause I'm really confused as of now

knotty steeple
#

nope

#

also on your error before you use just prefix and its not defined in the code

vernal basin
#

yeah I fixed that

knotty steeple
#

oki

vernal basin
#
    var tableName = 'oTable';
    var oTable = ctx.workbook.tables.getItem("myTable");
});```
I tried this but it said excel wasn't defined so I'm trying to figure out if I need to require something
knotty steeple
#

why you trying to use excel as a database

#

something like mongodb or sqlite would be better

vernal basin
#

figured it would be the easiest

#

since it's a small project

knotty steeple
#

i use sqlite

#

i have a small project

#

and is excel really meant to be a "database"

vernal basin
#

well as long as it stores a matrix of values I'm fine with it

uncut slate
#

using excel as a database is really dumb

vernal basin
#

except the problem with sqlite is I downloaded it except I don't have anything to open it :/

uncut slate
#

use an sqlite db viewer

knotty steeple
#

actually all you need is the viewer

#

for sqlite

vernal basin
#

oh ok

#

DB Browser?

knotty steeple
#

yes

vernal basin
#

hmm ok

#

so then I require sqlite right

knotty steeple
earnest phoenix
#

How do you get the discord emoji ID?

knotty steeple
#

\:emojiname:

earnest phoenix
#

hey for eris, would you need python to make music commands?

quasi marsh
#

Eris is not a Python lib WaitWhat

heady zinc
#

it is

#

javascript is basically python

quasi marsh
#

@heady zinc don't confuse people more thx

heady zinc
#

though you can use python for your music feature but i don't see why you would do that

quasi marsh
#

I wouldn't really recommend mixing libs

heady zinc
#

i wasn't talking about mixing libs

#

i was talking about letting another language handle back-end music stuff

quasi marsh
#

Ah, yeah

#

I mean personally I use lavalink so I already do that

heady zinc
#

but there's not really any performance gain over JS and lavalink already exists so thonk

quasi marsh
#

I meant more as in not connecting to WS two times

earnest phoenix
#

hmm

vernal basin
#

so for sqlite: db.run('INSERT INTO users(name, age) VALUES("Riko", 29)', ['C'], (err) => {
inserts Riko into Name and 29 into Age of Table users, right?

bitter sundial
#

yea

#

not an expert in SQL but thats how it should be yea

vernal basin
#

if I have a table with 12 headers, I would need to have (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) right

bitter sundial
#

I think you can pick and choose which ones you're going to fill

vernal basin
#

ah

#

also, if I want to create another row

#

its the same right

#

except with all 12

#

wait, I just Create another row

#

and increase 12

#

i'm still unclear how to add a row

#

does anyone know?

#

nvm I figured it out 😄

worldly sigil
#

quick question if I create a task in a class constructor is it run automatically or do i still have to explicitly call it with the event loop?

tight coral
#

I'm a javascript / node developer, does anyone knows a good opensource bot as a starting point for a moderation commands type of bot,
because I need to implement some very specific use cases, but I want to have the basics already figured out. (please ping for reply)

sick cloud
#

d.js docs has a basic moderation example @tight coral

#

but honestly, just throw together the basics quickly

#

it isn't that hard

tight coral
#

I was trying to avoid coding one, but we couldnt figure out how to make a !warn and !mute system with auto punishments based on defined thresholds (like 3 warns in past hour gets muted for an hour), but also like with moderation hierarchy, like mods can't warn other mods, trial mods cant warn mods, etc... closest thing was mee6, but ive been talking with the developers and their system is broken

sick cloud
#

honestly, theres no easy way to do it

tight coral
#

logic wise is not that much complicated, but for generic bots, they dont usually allow that kind of customization

remote badge
#

Hi

#

Is it ok if my bot change certain roles color every 3-5 seconds or could it be a problem with a too much number of roles modifications ?

#

(a problem with discord, not the bot performances)

ruby dust
#

Thats basically rainbow role color, it's against API tos

remote badge
#

Oh 😮

ruby dust
#

Bots legitimately get banned for that

remote badge
#

Ok thnx for you ansew, I will fix that

quartz kindle
#

i know a dude who did something similar but for channel description fields

ruby dust
#

Timezones?

quartz kindle
#

he put the current time in the channel description field, in all channels of his server, updated every second

sick cloud
#
if (!req.query.server_count || isNaN(req.query.server_count))
    return res.status(400).send(`Error: property 'server_count' must be provided and must be a valid number`);

got this code for my express server, tho it errors, even when i give it a server count
(node:11280) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'server_count' of undefined

quartz kindle
#

query is undefined

sick cloud
#

ohh

#

alright

remote badge
#

ok thx for your ansews I did not know it was forbidden

ruby dust
#

Yeah it's forbidden only because it's too much for discord to handle, and so we don't want to break it

sick cloud
#

why isn't this working 👀

remote badge
#

Uh and a 1h, 12 or 24h of delay, does it pass or still not?

sick cloud
#

it is a number

ruby dust
#

You could be fine with a 5 minute delay, I guess

#

I'm not really sure

sick cloud
#

its best off to go ask in the discord api server

ruby dust
#

But it's best to keep it at a big number just to be safe

sick cloud
#

they'll know

remote badge
#

ok thnx for the link

#

I go for ask it, thnx again for your ansews

viscid falcon
#

I'm working on a temp mute command, and I've seen some code that I could use but I don't quite remember the thing it was like message.(Some date thing) - message.(Some date thing) for the count down

#

What would it be

#

Or is there a built in temp mute in discord.js

#

Is .setMute for voice or text?

short siren
#

I'm guessing voice

sick cloud
#

voice

#

muting for text requires a correctly setup role and permissions/overwrites

viscid falcon
#

Thank you, and for my first question?

sick cloud
#

dunno

vernal basin
#
    if (err) {
        console.error(err.message);
    } else {
        console.log("Connected to the file database.");
    }
  });``` This line of code repeatedly tells me SQLITE_CANTOPEN - any ideas? the fie xyz.db is in my folder
#

and the file is read/write

marsh lark
#

in general how long does a reply for certification take? not sure if this is right place to ask

quasi marsh
#

Not really the right place, but since you asked anyway it's not really on a schedule or anything, they're usually checked once a while in bulk

marsh lark
#

apologies and thanks for the response

tight coral
#

does anyone have a oauth authentication example for a web admin interface (nodejs) ?
plz ping

earnest phoenix
#

why so hard to make description in the web he say 300 characters but i see there another bot without 300 characters :/

#

anyone can help me?

#

what

#

the description

#

theres a short and a long description

#

but i see another bot without 300 characters description

hot eagle
#

they probably have html and css

earnest phoenix
#

long description is ur html one and the short description is a smal one

#

^^

#

nope, they don't use html or css

#

uh

#

almost every bot page does

#

wait

hot eagle
#

link?

earnest phoenix
#

see?

#

but i can't

fluid basin
#

You have to have 300 characters for verification and accepting, but you can change it after that

#

I guess, not 100% sure

earnest phoenix
#

ahh okok

hot eagle
#

they could just have 40 classes in the html

earnest phoenix
#

lol

#

whether the bot will remain in aprove if using description outside his category?

quartz kindle
#

@earnest phoenix can you send the link to that bot?

earnest phoenix
#

what bot? @quartz kindle

quartz kindle
#

the one in the picture

earnest phoenix
#

what you want to do 😂

quartz kindle
#

see the code

#

if they really dont have 300 chars

earnest phoenix
#

ahh, ok

#

this

quartz kindle
#

seems like they really dont

#

maybe its an old bot

earnest phoenix
#

nope, this a new bot

quartz kindle
#

are you sure?

earnest phoenix
#

yes

#

because i know who make this bot,

#

haha

#

lol

#

but i don't want to ask they how

#

uh

hot eagle
#

guess they just edited it after

earnest phoenix
sick cloud
#

lol

long glade
earnest phoenix
#

@sick cloud did you get fonts working?

sick cloud
#

yep, sure did

earnest phoenix
#

how did you do it

#

i have the otf

#

@sick cloud

#

reeee

sick cloud
#

i got a different ttf file @earnest phoenix

earnest phoenix
#

ah

#

so once you load the file what do you use it as

#

the file name?

#

@sick cloud

#

or the font name

#

(node:72886) UnhandledPromiseRejectionWarning: Error: Could not load font file

sick cloud
#

shrug

#

depends on how you load it

earnest phoenix
#

how u load it

#

.addTextFont('uni-sans-bold-webfont.tff')

#

thats how im doing it

sick cloud
#

i use Canvas.RegisterFont('./font-name.ttf', 'Font name'); then i use it as .setTextFont('22px "Font name"') for example

earnest phoenix
#

kk

#

registerfont doesnt exists

#

@sick cloud

#

wait nvm

#

sadpepe nvm

#

(node:73170) UnhandledPromiseRejectionWarning: TypeError: Canvas.registerFont is not a function

#

@sick cloud

#

wut dis

sick cloud
#

@earnest phoenix oh lmfao

#

your not using canvas constructor i guess?

earnest phoenix
#

I am @sick cloud it autocompletes on vs code as a method, but when I run it it says it’s not a command

sick cloud
#

dunno then

#
Canvas.registerFont('./fonts/Discord.ttf', 'Uni Sans Heavy');
#

thats how i do it mmLol

digital forge
#

!play 6ix9ine fefe

#

!play 6ix9ine fefe

#

!next

#

!skip

#

!play 6ix9ine fefe

slender thistle
earnest phoenix
#

@sick cloud this shud be working right?

const {Canvas} = require('canvas-constructor');
Canvas.registerFont('./uni-sans-bold-webfont.tff', 'Uni Sans Bold')
solid cliff
#

iduno whatshappening notLikeMiyaButFast

heady zinc
#

both of you are high

earnest phoenix
#

help

#

me

#

please

knotty steeple
#

what is

#

your problem

earnest phoenix
#

python

#

do you python?

knotty steeple
#

no

earnest phoenix
#

oh

#

well, i want someone that can python

slender thistle
#

Ask your question

upper ember
#
  client.modlog = (guildid, type, mod, badguy, reason) => {
    if (!reason) reason = "No reason provided";
    const sqlite3 = require("sqlite3");
    const db = new sqlite3.Database('./db/servers.db');
    const Discord = require("discord.js");
    db.get("SELECT * FROM servers WHERE id = ?", [guildid], (err, row) => {
      if (err) return console.log(err.message);
      if(!row) {
        db.run(`INSERT INTO servers(id) values(?)`, [guildid], (err) => {
            if (err) return console.log(err.message);
            db.get("SELECT * FROM servers WHERE id = ?", [guildid], (err, row) => {
              if (err) return (err.message);
              const embed = new Discord.RichEmbed()
              .setTitle(type + " case")
              .addField("Moderator:", mod, true)
              .addField("User:", badguy, true)
              .addField("Reason:", reason, false)
              console.log(row.modlog)
              guild.channels.find("id", row.modlog).send(embed);
            })
        });
      } else {
        const embed = new Discord.RichEmbed()
        .setTitle(type + " case")
        .addField("Moderator:", mod, true)
        .addField("User:", badguy, true)
        .addField("Reason:", reason, false)
        console.log(row.modlog)
        guild.channels.find("id", row.modlog).send(embed);
      }
    })
  };
#

umm

#

anyone have ideas why this doesn't wrok?

sullen path
#

any errors?

upper ember
#

nope

knotty steeple
#

is it supposed to be a function you can use

upper ember
#
client.modlog(message.guild.id, "test", "eksdee", "lol", "mmlol")
#

yes

knotty steeple
#

maybe do function(guildid, type, mod, badguy, reason) { on top instead of (guildid, type, mod, badguy, reason) => {

#

try it

earnest phoenix
#

Eek function

upper ember
#
  client.log = (type, msg, title) => {
    if (!title) title = "Log";
    console.log(`[${type}] [${title}]${msg}`);
  };

this works @knotty steeple

knotty steeple
#

well idk

quartz kindle
#

which part doesnt work?

#

the log? the database?

upper ember
#

the log

quartz kindle
#

the database works?

upper ember
#

yes..

#
  client.modlog = (id, type, mod, badguy, reason) => {
    const sqlite3 = require("sqlite3");
    const Discord = require("discord.js");
    const { RichEmbed } = require("discord.js");
    const db = new sqlite3.Database('./db/servers.db');
    
    if (!reason) reason = "No reason provided";
    
    db.get("SELECT * FROM servers WHERE id = ?", [id], (err, row) => {
      if (err) return console.log(err.message);
      if (row.modlog = 0) return;
      const embed = new Discord.RichEmbed()
      .setTitle(type + " case")
      .addField("Moderator:", mod, true)
      .addField("User:", badguy, true)
      .addField("Reason:", reason, false)
      guild.channels.find("id", row.modlog).send(embed);
    });
  };
#

does the id need to be int or text?

quartz kindle
#

i dont see guild defined anywhere

upper ember
#

guild == id

#

client.modlog = (id, type, mod, badguy, reason) => {

quartz kindle
#

guild.channels.find

#

if id is just the guild id, then it doesnt have the guild proprieties to check channels and send messages

#

if id is the entire guild collection, then it should be id.channel.find()

upper ember
#

this isn't guild property, id is guild id

quartz kindle
#

then where is guild defined?

upper ember
#

uwu

#

he isn't..

#

smort

#

so for define guild I should use message.guild?

quartz kindle
#

you dont have a message collection in there either

upper ember
quartz kindle
#

you have Discord as your only entry point to discord

#

so you'd need to start from the beginning

#

client = new Discord()

#

client.guild.find(id).channel.find().send

upper ember
#

so client.guild.find(id).channel.find(row.modlog).send

#

?

#

or "id", row.modlog?

quartz kindle
#

you have client already defined outside the function, so if you can use that already, then yeah client.guilds.get(id).channels.find("id",row.modlog).send

#

find("id",row.modlog) this i dont know

#

i havent used the find() function

#

also, do you really need to redefine sqlite, Discord, richember and db? dont you have them globally defined outside the function?

#

or is it a module exports/run

upper ember
#
  client.modlog = (serverid, type, mod, badguy, reason) => {
    const sqlite3 = require("sqlite3");
    const Discord = require("discord.js");
    const { RichEmbed } = require("discord.js");

    const db = new sqlite3.Database('./db/servers.db');
    
    if (!reason) reason = "No reason provided";
    
    db.get("SELECT * FROM servers WHERE id = ?", [serverid], (err, row) => {
      if (err) return console.log(err.message);
      if (row.modlog = 0) return;
      const embed = new Discord.RichEmbed()
      .setTitle(type + " case")
      .addField("Moderator:", mod, true)
      .addField("User:", badguy, true)
      .addField("Reason:", reason, false)
      client.guild.find(id).channel.find("id", row.modlog).send
    });
  };
#

this is module.exports = (client) => {

quartz kindle
#

why did you change id to serverid

#

now you need find(serverid) as well

#

and client.guilds

upper ember
#

also

#

shouldn't it he ("id", serverid)?

quartz kindle
#

you should know that, not me

upper ember
#
  client.modlog = (serverid, type, mod, badguy, reason) => {
    const sqlite3 = require("sqlite3");
    const Discord = require("discord.js");
    const { RichEmbed } = require("discord.js");

    const db = new sqlite3.Database('./db/servers.db');
    
    if (!reason) reason = "No reason provided";
    
    db.get("SELECT * FROM servers WHERE id = ?", [serverid], (err, row) => {
      if (err) return console.log(err.message);
      if (row.modlog = 0) return;
      const embed = new Discord.RichEmbed()
      .setTitle(type + " case")
      .addField("Moderator:", mod, true)
      .addField("User:", badguy, true)
      .addField("Reason:", reason, false)
      client.guilds.find(serverid).channels.find("id", row.modlog).send
    });
  };
#

not working..

quartz kindle
#

do you have a server id or a channel id?

#

because guild id and channel id are different

#

and a channel id does not need a guild

upper ember
#

channel is == row.modlog

quartz kindle
#

you can do client.channels.get(channelid)

#

without going through the guilds

upper ember
#

client.channels.get("id", row.modlog).send?

#

wait get or find?

quartz kindle
#

if you have id, get(id)

#

find is if you dont have the id

#

and need to find with channel name or something else

hot sleet
#

useCSS client.channels.get(ID).send(message here)

quartz kindle
#

^

hot sleet
#

no need to use row.modlog

upper ember
#

what...?

#
  client.modlog = (serverid, type, mod, badguy, reason) => {
    const sqlite3 = require("sqlite3");
    const Discord = require("discord.js");
    const { RichEmbed } = require("discord.js");

    const db = new sqlite3.Database('./db/servers.db');
    
    if (!reason) reason = "No reason provided";
    
    db.get("SELECT * FROM servers WHERE id = ?", [serverid], (err, row) => {
      if (err) return console.log(err.message);
      if (row.modlog = 0) return;
      const embed = new Discord.RichEmbed()
      .setTitle(type + " case")
      .addField("Moderator:", mod, true)
      .addField("User:", badguy, true)
      .addField("Reason:", reason, false)
      client.channels.get(row.modlog).send(embed)
    });
  };
quartz kindle
#

but his id is the server id

upper ember
#

no

#

serverid is the server id

#

id is nothing

quartz kindle
#

his channel id is in the database

upper ember
#

NOT WORKINGGG

#

the problem is with client.channels.get("id", row.modlog).send(embed)

quartz kindle
#

try thistry { client.channels.get(row.modlog).send(embed).catch(e => console.log(e)) } catch(e) {console.log(e)}

upper ember
quartz kindle
#

so channels.get() is undefined

upper ember
#

ok, how do I fix it? lol

quartz kindle
#

try console.log(client.channels)

upper ember
#

doesn't print anything

quartz kindle
#

then the entire clients collection is missing

#

ie: your client is not discord's client, is has nothing to do with discord at all

upper ember
#

what...?

earnest phoenix
#

I don't see a client variable

quartz kindle
#

supposedly is in his function

#

or outside of it

#

since his function is assigning the function to a client

#

anyway i need to go to work, you help him

earnest phoenix
#

also i dont think youre using sqlite3 correctly

upper ember
#

I'd

#

the only problem in this function is the send part

earnest phoenix
#

What are you trying to do

upper ember
#
  client.modlog = (serverid, type, mod, badguy, reason) => {
    const sqlite3 = require("sqlite3");
    const Discord = require("discord.js");
    const { RichEmbed } = require("discord.js");

    const db = new sqlite3.Database('./db/servers.db');
    
    if (!reason) reason = "No reason provided";
    
    db.get("SELECT * FROM servers WHERE id = ?", [serverid], (err, row) => {
      if (err) return console.log(err.message);
      if (row.modlog == 0) return console.log("Modlog is disabled in one of the server")
      const embed = new Discord.RichEmbed()
      .setTitle(type + " case")
      .addField("Moderator:", mod, true)
      .addField("User:", badguy, true)
      .addField("Reason:", reason, false)
      var guild = client.guilds.find("id", serverid);
            guild.channels.find("id", row.modlog).send(embed);            
    });
  };
quartz kindle
#

???

upper ember
#

??

quartz kindle
#

what part of "if you have the id, you use .get()" and "if you have the channel id, you dont need guilds" you didnt understand?

earnest phoenix
#

you should be using db.all()

upper ember
#

THE DB IS FINE

earnest phoenix
#

db.get assumes you will only get one row

upper ember
#

I can console.log the info

#

AND ALL I NEED IS 1 ROW

earnest phoenix
#

stop typing in caps

upper ember
#

OK

#

ok*

#

sorry

earnest phoenix
#

Your guild var is incorrect

upper ember
#

how is it incorrect?

earnest phoenix
#

you don't find ids using find

#

you use get

#

So

upper ember
#
     var guild = client.guilds.get("id", serverid);
            guild.channels.get("id", row.modlog).send(embed);
earnest phoenix
#

Client.guilds.get(id)

upper ember
#

so will this work?

earnest phoenix
#

try it

#

wait no

#

you have an id variable

#

so

#

client.guilds.get(serverid)

#

You can't pass two parameters

upper ember
#

so ```js
var guild = client.guilds.get(serverid);
guild.channels.get(row.modlog).send(embed);

#

?

earnest phoenix
#

yeah

upper ember
#
  client.modlog = (serverid, type, mod, badguy, reason) => {
    const sqlite3 = require("sqlite3");
    const Discord = require("discord.js");
    const { RichEmbed } = require("discord.js");

    const db = new sqlite3.Database('./db/servers.db');
    
    if (!reason) reason = "No reason provided";
    
    db.get("SELECT * FROM servers WHERE id = ?", [serverid], (err, row) => {
      if (err) return console.log(err.message);
      if (row.modlog == 0) return console.log("Modlog is disabled in one of the server")
      const embed = new Discord.RichEmbed()
      .setTitle(type + " case")
      .addField("Moderator:", mod, true)
      .addField("User:", badguy, true)
      .addField("Reason:", reason, false)
      console.log(row.modlog)
      console.log(serverid)
      console.log(type)
      console.log(mod)
      console.log(badguy)
      console.log(reason)
      var guild = client.guilds.get(serverid);
            guild.channels.get(row.modlog).send(embed);            
    });
  };
#

ok

#

lets see what this gives me

#

nothing

#

@earnest phoenix

simple bramble
#

So in my bot, im making 2 new commands (that only i can use): one that can restart the bot's application, and one that can end it. im using discord.net, and im adding these commands incase i can't restart/end it in visual studio (like if i'm not home) im not sure how to do this, so any help would be nice

serene plover
#

Nice

upper ember
#

id need to be int or text...?

uncut slate
#

IDs have to be strings in js

simple bramble
#

in in .net

#

i already got the part where only i can use it, i just need the part where i restart/end it

mental solstice
#

can you tag a role, like you can a user? @radiant compass

bitter sundial
#

<@&000>