#development

1 messages · Page 365 of 1

maiden trout
#

i tell him that its not lua, because thats what others told me

earnest phoenix
#

What the

maiden trout
#

ive heard lots of different things

#

from different people

#

and its confusing me

earnest phoenix
#

if you arent willing to code and learn a language, dont code

pale light
#

Once again this all starts from choosing a language

maiden trout
#

can you make a bot with lua

pale light
#

if you don't have a base language then you're not going to get specific advice

earnest phoenix
#

.....

maiden trout
#

i take that as no

pale light
#

its possible

maiden trout
#

holy

earnest phoenix
#

Use that, ur friend will then be able to help you.

#

or join DAPI and have fun looking at libs there

#

If he keeps asking about lua

#

Or join discord.js discord.

strange escarp
#

How do you get the Discord username of someone using discord.js(Example: cbpudding#9078)

heady zinc
strange escarp
#

Thanks

scenic crest
#
// Get a channel by ID
client.channels.get("the channel id");
// Returns <TextChannel>```
#

@wispy schooner shouldn't this return any form of Channel?

#

dunno how d.js does internal but surely it'd be logical for that to fetch VCs as well

languid dragon
#

probably does

restive silo
#

oh thats correct but i think he means if you put a TextChannel ID in it always returns TextChannel

#

ofc

patent reef
#

PLS

#

someone help me

scenic crest
#

yeah but it'd be logical to document that too imo

languid dragon
#

yeah it represents all kinds of channels

restive silo
#

@scenic crest PR the change

glossy sand
#

wait does voicechannel extend textchannel?

restive silo
#

no

#

kek

scenic crest
#

no pre sure both extend Channel

wispy schooner
scenic crest
#

I saw

#

but what happens if you put in a VC ID

restive silo
#

@scenic crest both extend GuildChannel which extend Channel

scenic crest
#

because you just say "get a channel by ID"

patent reef
scenic crest
#

so therefore by that logic you can put in a VC ID

wispy schooner
languid dragon
#

its box-shadow

#

box-shadow:none !important;

#

and its not the image itself

#

its the image container

patent reef
#
.bot-img { 
  background: transparent !important;
  border: none !important;
  box-shadow: none !important; 
}```
#

thats my css

languid dragon
#

bot id pls

patent reef
#

381690931088195587

#

@tough atlas

earnest phoenix
#

@languid dragon How do we get the admin role?

mighty barn
#

inb4: ken deletes it

heady zinc
languid dragon
#

change it to .column .bot-img

#

that'll fix it

#
.column .bot-img { 
  background: transparent !important;
  border: none !important;
  box-shadow: none !important; 
}
patent reef
#

kk

#

thanks

languid dragon
patent reef
plush frost
#

hi

earnest phoenix
#

#general unless you actually have a reason to talk here...

plush frost
#

Sorry for who want came for development its moved to general

#

mods are talking in general development stuff like 2 hours

earnest phoenix
#

#general bud or I'm gonna have to mute you

#

**thinks to self** She made a gud point Arisu did

#

Now a mod is gonna threaten to mute me

heady zinc
#

get the hell outta here

earnest phoenix
#

😦

wispy schooner
#

merged

scenic crest
#

<33

wispy schooner
#

at least it wasn't a whole new article, I'd have to set @clever yew to review your PR lol

#

He can be very... yeah...

mighty barn
#

very? strict? evil?

clever yew
#

The word is, picky

mighty barn
#

ah

scenic crest
#

Well if he is as picky as you make him out to be, then my PR wouldn't have been neccessary in the the first place 😉

earnest phoenix
#

hey i was wondering if someone could help me, i'm developing a addmod command and needed help checking if they already are mod or not

#

  const db = require(`quick.db`);
  const member = message.mentions.users.first();
  const hiddensettings = require(`../external/hiddensettings.json`);

  if(!message.guild.member(message.author).hasPermission(`ADMINISTRATOR`)) return message.reply("You do not have the required permission(s): **ADMINISTRATOR**");

  db.fetchObject(`guildPrefix_${message.guild.id}`).then(i => {

    if(i.text){
        PREFIX = i.text;
    }else{
        PREFIX = hiddensettings.PREFIX;
    }

    if(!member) return message.channel.send(`Usage: ${PREFIX}addmod <@User>`);

  })

  db.fetchObject(`moderator${message.author.username}_${message.guild.id}`).then(i => {
      
  })

  db.updateText(`moderator${message.author.name}_${message.guild.id}`, args.join().trim()).then(i => {

    const yes = Aizen.emojis.find(`name`, `yes`);
    
    if(i.text){
        message.channel.send(`:x: That user is already a server mod`);
    }else{
        message.channel.send(`${yes} ${member.username}#${member.discriminator} is now a server moderator!`);
    }
  })
}
``` code
languid dragon
#

.hasRole()

earnest phoenix
#

i'm not using roles

languid dragon
#

how are you making them mod?

earnest phoenix
#

database

#

it's a bit like dynos

languid dragon
#

well in that case

#

you would check if they had moderator in the database

#

have the moderator status either true or false

earnest phoenix
#

have you ever used quick.db?

languid dragon
#

noooope

#

i use rethinkdb

earnest phoenix
#

ffs

languid dragon
#

concept is the same

earnest phoenix
#

what so like if there's i.text

#

it's true?

languid dragon
#

i.text?

topaz fjord
#

@patent reef not that hard

earnest phoenix
#

look at code

languid dragon
#

yeah but what is i.text

#

what's "text"

#

am i missing smoething?

earnest phoenix
#

it's what is in the database

topaz fjord
#

quick.db seems hard

#

k

earnest phoenix
#

it's not really, you just need to get used to it

languid dragon
#

u should consider using something like rethinkdb

#

its a lot simpler EYES

earnest phoenix
#

i was looking at that rn

topaz fjord
#

quick.db is made by a guy named TrueXPixels

earnest phoenix
#

yea

topaz fjord
#

made by a guy with a cancerous discord server

earnest phoenix
#

i'm not in his discord

topaz fjord
#

and his yt vids arent that informative since his doesnt speak

earnest phoenix
#

i don't watch his vids

#

i just found it and learned

#

How do I go about getting the number of servers my bot is on to my website (so it automatically updates as it gets added to more servers)?

I assume I could just scrape the link of my bot's webpage off of discordbots.org but is there any other method?

languid dragon
#

every time you refresh your page you could make a request to the bot and return the server count

earnest phoenix
#

Or use Dbls json stats endpoint for your bot

#

So you don't dos yourself

#

rethinkdb is ehhh

languid dragon
#

its good

earnest phoenix
#

confusing but not confusing

#

it's okay

#

MySQL ftw

languid dragon
#

eeeeeeh

mighty barn
#

SQLite ftw

earnest phoenix
#

quick.db is sqlite3

#

Thank you @languid dragon & @earnest phoenix

earnest phoenix
#

Whenever I run this code:

#
client.on("messageDelete", (Message, throwex) => {
  let embed = new Discord.RichEmbed()

  embed.setColor("RED")
  embed.setTitle("Message Delete")
  embed.setDescription("Someone has deleted a message")
  embed.addField('Deleted Message', (Message))
  embed.addField('Author', (Message.author))
  if (Message.guild.id == "336487228228370432") {
     client.channels.get("398265731176988682").send({ embed });
  }
  else{
          Message.guild.channels.find(c => c.name == 'logs').send({ embed });

}
#

It works, but then throws this and crashes right after

#
                           ^

RangeError: RichEmbed field values may not be empty.
    at RichEmbed.addField (/Users/nayab_warach/node_modules/discord.js/src/structures/RichEmbed.js:158:34)
    at Client.client.on (/Users/nayab_warach/Documents/Discord/LionBot/LionBot/LionBot/lionbot_mac.js:157:9)
    at emitTwo (events.js:106:13)
    at Client.emit (events.js:191:7)
    at MessageUpdateAction.handle (/Users/nayab_warach/node_modules/discord.js/src/client/actions/MessageUpdate.js:13:16)
    at MessageUpdateHandler.handle (/Users/nayab_warach/node_modules/discord.js/src/client/websocket/packets/handlers/MessageUpdate.js:7:34)
    at WebSocketPacketManager.handle (/Users/nayab_warach/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (/Users/nayab_warach/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:330:35)
    at WebSocketConnection.onMessage (/Users/nayab_warach/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:293:17)
    at WebSocket.onMessage (/Users/nayab_warach/node_modules/ws/lib/EventTarget.js:99:16)```
#

I cant seem to figure it out

languid dragon
#

message is an object

#

Message.content

earnest phoenix
#

oh... I'm an idiot

#

thanks

languid dragon
#

or Message.cleanContent

earnest phoenix
#

Same thing happened

#
client.on("messageDelete", (Message, throwex) => {
  let embed = new Discord.RichEmbed()

  embed.setColor("RED")
  embed.setTitle("Message Delete")
  embed.setDescription("Someone has deleted a message")
  embed.addField('Deleted Message', (Message.content))
  embed.addField('Author', (Message.author))
  if (Message.guild.id == "336487228228370432") {
     client.channels.get("398265731176988682").send({ embed });
  }
  else{
          Message.guild.channels.find(c => c.name == 'logs').send({ embed });

}
});
strange escarp
#

Does anybody know how to get a bot to automatically accept friend requests or are bot accounts not allowed to have friends?

earnest phoenix
#

not allowed I think

strange escarp
#

Darn it

#

That means I can't test if a Group DM works

#

Thanks anyways

languid dragon
#

y dont u just use raw embed data

#

its a lot easier

earnest phoenix
#

OK I will, but I dont think that will solve this issue, will it?

languid dragon
#

probably will

earnest phoenix
#

oh

#

well then

#

I'll try that

#

So I plan on scraping data from other websites into my bot's website and I see it can be done with cheer.io (https://cheerio.js.org/) but the problem is I don't truly understand the installation process... npm install cheerio.

I understand that I'll have to install cheerio for it to work, but the problem is...
How do I do that if the site is being hosted by a company and there's no option to run a terminal or whatnot?

I could download the files and upload it to the File Transfer Protocol but would that mean when I say something such as
var cheerio = require('cheerio') in my JavaScript code, it'll function properly?

I'm sorry for asking this stupid question, but it's my first time working like this (for a website).

heady zinc
#

as long as you have node.js and a node_modules folder within your project in which the module is

#

require() will work

earnest phoenix
#

I'm confused as to what "Raw Embed Data" is??

Is it just the same tags without embed infront?

strange escarp
#

No

#

Basically you're making the JSON for the embed

heady zinc
earnest phoenix
#

Oh ok.

heady zinc
#

discord.js allows you to send a "raw" embed as an object like js Channel.send({ embed: { title: 'owo im an embed' } )}

earnest phoenix
#

The node_modules folder shouldn't contain anything right?

heady zinc
#

it should contains every module that you require

strange escarp
#

node_modules should contain all your modules

#

If you don't have anything in there, don't expect to require anything.

earnest phoenix
#

Oh! So I download the source code from https://nodejs.org/en/download/ then put that in my FTP. Then for an example, cheerio, I download that source code and put that in my node_module folder?

heady zinc
#

yes

earnest phoenix
#

awesome thanks!!

heady zinc
earnest phoenix
#

Okay, noted. 👍

#

Ok. I was able to fix it, but now it spams. ( NO I WILL NOT SWITCH TO RAW EMBED. I like rich embed c: )

heady zinc
#

oh uh i maybe said yes a bit too soon, you need to install node.js, not just throw out the source somewhere in your server zoomeyes

#

not sure you can do it without a terminal if you're doing it on ftp thonkku

earnest phoenix
#

Fricking* Hell it was a simple if statement to fix it

topaz fjord
strange escarp
#

Quick question: What do URLs in Discord embeds do?

inner jewel
#

@topaz fjord judging from the value i'd say ms

analog cedar
#

Hey, I’m coding a new bot just wondering what you guys use

earnest phoenix
#

Discord.JS

#

How could I add a widget to weebly?

#

Nvm

#

Figured it out,

elder rapids
#

@strange escarp Just a quick tip. Bots can't join Group DM's/do anything with them (if nobody told you)

strange escarp
#

I noticed that once I realized that they couldn't be friends with people

elder rapids
#

Either way that API is locked for bots

#

So even with friends they still can't

strange escarp
#

Weird

trim plinth
#

Why would you even want to be friends with a bot anyways?

elder rapids
#

why wouldn't you?

trim plinth
#

true bloblul

strange escarp
#

That way you can use the bot via DMs and even add it to group DMs

elder rapids
#

You already can use a bot via DMs

earnest phoenix
#

using via dms is easy

strange escarp
#

I know

elder rapids
#

Bots aren't meant to be in group DMs though

earnest phoenix
#

group dms is weird though. IDK if it's possible

strange escarp
#

It isn't

elder rapids
#

what not possible

trim plinth
#

But even if there was a way to friend bots, they can't accept a request

elder rapids
#

Group DM on bot?

strange escarp
#

They need to be friends with you in order to add them to a group DM

elder rapids
#

I just confirmed you can't as the API is locked

earnest phoenix
#
C:\Users\owner\Desktop\Weather Bot\app.js:141
      if (result.length === 0) {
                 ^

TypeError: Cannot read property 'length' of undefined
    at C:\Users\owner\Desktop\Weather Bot\app.js:141:18
    at Request._callback (C:\Users\owner\Desktop\Weather Bot\node_modules\weather-js\index.js:42:41)
    at self.callback (C:\Users\owner\Desktop\Weather Bot\node_modules\request\request.js:186:22)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at ClientRequest.<anonymous> (C:\Users\owner\Desktop\Weather Bot\node_modules\request\request.js:816:16)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)
    at ClientRequest.emit (events.js:208:7)
    at Socket.emitTimeout (_http_client.js:708:34)```
#

Any help?

jagged plume
#

result is undefined

earnest phoenix
#

No.

jagged plume
#

yes ?

elder rapids
#

Yes

earnest phoenix
#

Length is.

jagged plume
#

thats what the error says

#

“Length of undefined”

elder rapids
#

Cannot read property 'length' of undefined

jagged plume
#

same

elder rapids
#

same

earnest phoenix
#

Any help to fix it?

trim plinth
#

uh using discord.js?

earnest phoenix
#

Yes.

trim plinth
#

ok lemme see

jagged plume
#

without code it’s hard to fix

#

lol

elder rapids
#

Make it not undefined

#

👏

#

I'm a good jokester

trim plinth
#

paste the code in here

#

so I can see the problem

elder rapids
#

We don't know what "result" is (supposed to be/where it came from)

#

so that's the first issue

earnest phoenix
#
  if (result.length === 0) {
        message.channel.send('**Please enter a valid location.**')
        return; 
      }```
trim plinth
#

did you declare result as a variable?

earnest phoenix
#

No,

elder rapids
#

wat

trim plinth
#

uh you can't read the value of a undefined variable bloblul

earnest phoenix
#
if (result === undefined || result.length === 0) { "```
#

How about that?

trim plinth
#

uhh

#

no that doesn't help

elder rapids
#

Do you even know why result is undefined

trim plinth
#

thats not how you declare a variable

#

in js you do const, let, or var

earnest phoenix
#

It fixed it.

trim plinth
#

ok

#

thats questionable how it fixed it, but ok..

jagged plume
#

no it’s not

#

it checked if it was undefined instead of causing an error

strange escarp
#

Why not use ```Javascript
if(typeof result === "undefined" || result.length === 0) {

elder rapids
#

ew

#

That is also pointless

#

You make the computer do extra work too

strange escarp
#

👍🏻

topaz fjord
#

tbh i think ypou should learn js @earnest phoenix

#

*you

pale light
topaz fjord
#

fucking nude

frail kestrel
#

yes

earnest phoenix
topaz fjord
#

@earnest phoenix tf is that

earnest phoenix
#

which par

#

t

topaz fjord
#

000webhost

elder rapids
#

is a pile of shit

#

and untrustworthy

#

Also you can't do node.js on a shared hosting service that uses apache

earnest phoenix
#

o darn

#

tell me something i don't already know :/ @elder rapids

#

lmfao

#

would heroku work? @elder rapids

elder rapids
#

ping

#

PING

earnest phoenix
#

pong

analog cedar
#

what do you guys use

elder rapids
#

Heroku can run node.js

earnest phoenix
#

awesome

analog cedar
#

any suggestions?

earnest phoenix
#

i use discord.js

analog cedar
#

compatible with Mac?

earnest phoenix
#

yes

analog cedar
#

alr ty

earnest phoenix
#

np

earnest phoenix
#

hi

#

Any help? I set my bots activity as Prefix: ~ but the bot is showing Prefix: -

#

Bot is @pseudo root

#

@austere meadow Any help?

jagged plume
#

says ~ for me

earnest phoenix
#

The bot status?

#

@jagged plume ?

jagged plume
#

yes

earnest phoenix
#

Screenshot?

jagged plume
#

it changed back Thonk

austere meadow
#

it probably just looks the same as -

jagged plume
#

on my ipad it said ~ but now on my pc it says -

south finch
#

issa squiggle for me

austere meadow
#

its just a visual thing

earnest phoenix
#

Mm.

#

Here is the code tbh.

#
bot.user.setActivity(`Prefix: ~ |Servers: ${bot.guilds.size} | Website: www.WeatherBot.weebly.com`)```
south finch
#

weebly

earnest phoenix
#

xDDDDDDDd

jagged plume
#

www.

#

who even puts www Thonk

earnest phoenix
#

u

jagged plume
#

no u

earnest phoenix
earnest phoenix
#

Well my bot is so cool that is website doesn’t even exist

abstract mango
#

why weebly out of all things uGH

earnest phoenix
#

^

#

Like just use google sites. Weebly is for people who just want to get out of paying web designers. Or better: learn HTML, CSS, and Web JavaScript and make one.

ripe wing
#

happy? :/

pale light
#

betterbe

rigid pulsar
#

Copy it in instead of trying to type it over

#

webclien

ripe wing
#

i cant see to ctrl V in cmd prompt

rigid pulsar
#

Are you using Windows 10?

#

If so, you can just right click

jagged plume
#

right click and press paste

#

or just right click

ripe wing
#

AY

#

OMG

#

IM BEIN HECKED

jagged plume
#

what

ripe wing
#

it exploded my prompt

rigid pulsar
#

that's what we call verbose

#

it actually tells you what it's doing instead of "We're doing things please wait"

ripe wing
#

ik

#

i just didnt know its called a verbose

pale light
#

its not called a verbose, its just being verbose

south finch
#

english with Loris

heady zinc
vital lark
#
    public static HashMap<String, Command> commands = new HashMap<>();

    public static void init() {
        commands.put("help", new HelpCommand());
        commands.put("shards", new ShardsCommand());
        commands.put("donate", new DonateCommand());
        commands.put("statistics", new StatisticsCommand());
    }

    public static HashMap<String, Command> getCommands() {
        return commands;
    }``` help
#

and it won't load

quasi sandal
#

do you ever call the init function?

vital lark
#

        CommandRegistry.init();
        shards = new DefaultShardManagerBuilder()
                .setToken(NatsukiData.getToken())
                .setAudioSendFactory(new NativeAudioSendFactory())
                .addEventListeners(new EventListener())
                .setGame(Game.playing("Hold on to your seatbelts! <3"))
                .build();
#

yea

#

when she starts

quasi sandal
#

show me your listener

vital lark
#
public class EventListener extends ListenerAdapter {
    @Override
    public void onReady(ReadyEvent event) {
        new Ready(event);
    }

    @Override
    public void onGuildLeave(GuildLeaveEvent event) {
        new GuildDelete(event);
    }

    @Override
    public void onGuildJoin(GuildJoinEvent event) {
        new GuildAdd(event);
    }

    @Override
    public void onGuildMessageReceived(GuildMessageReceivedEvent event) {
        new GuildMessage(event);
    }
}```
quasi sandal
#

show me the GuildMessage class (hastebin)

vital lark
#

ok

quasi sandal
#

add a log in some places in that class to see if it get past some points

vital lark
#

Ok

#

like where?

quasi sandal
#

after line 12
on line 28 (log the command obj)

#

i gtg to school now, be back in like 15-20 mins

vital lark
#

ok

#

@quasi sandal btw I fixed the problem.

quasi sandal
#

@vital lark how did you fix it?

quiet bobcat
#

Can somebody help me? I'm working on a help menu using reactions and how do I make so that if I react to it, it notices it directly instead of having to set a timeout? Also how do I see that the person reacting is the person is the author of the help message sent?

earnest phoenix
#

What langggg

quiet bobcat
#

Sorry completeley forgot about that... The lang is JS and the lib is d.js

earnest phoenix
#

Don’t know them well but i imagine they have an on reaction add event?

#

So then get the author of help and author of reaction and see if they match

quiet bobcat
#

I can try

heady zinc
#

there is reactions collectors built-in d.js

earnest phoenix
#

And if the message id of the reaction matches your help message id

quiet bobcat
#

There is?

heady zinc
quiet bobcat
#

oh...

#

Thanks

earnest phoenix
quiet bobcat
#

gtg

#

cya

vital lark
#

@quasi sandal Removing the 2nd prefix

#

aka natsuki [command]

quasi sandal
#

ahh

mental willow
#

can someone help me with a server count code for discrd.js

tawny lava
scenic galleon
#

the superior language

umbral pelican
potent lily
#

Python >

earnest phoenix
#

brainfuck >

potent lily
#

Ada >

#

ok i have the best

quasi sandal
#

assembly >

earnest phoenix
#

mspaint >

earnest phoenix
#

I use MSPaint as IDE.

severe socket
#

batch > kek

potent lily
#

too strong neko

#

you win

earnest phoenix
#

Is there a way to make the bot send a message to all the guilds it is in? (I’m a noob, I know)

heady zinc
#

basically iterate through all guilds and send a message to the first channel your bot has permission to talk in in each

prime cliff
#

^

heady zinc
#

that may result in ratelimits tho

prime cliff
#

Or default channel because thats still a thing

heady zinc
#

well check if defaultChannel is a thing in the guild first maybe yes

austere meadow
#

?

#

defaultChannel is deprecated

#

doesn't work

fathom pebble
#

maybe first channel is better to do that

heady zinc
#

no

#

it works

#

in old guilds

austere meadow
#

what does it return

#

whats an old guild GWchadMEGATHINK

fathom pebble
#

a channel

heady zinc
#

guilds that were existing before it was deprecated smh

austere meadow
#

i thought discord converted all guilds

fathom pebble
#

no

austere meadow
#

no i know that

fathom pebble
#

my bot support guild has a default channel

heady zinc
#

why would they go through the pain of converting them all tho

#

but yeah anyway

#

it may results in ratelimits if you don't add an interval

#

and it annoys most users

austere meadow
#

i dont recommend doing it

mighty barn
#

It's not nice in general

#

And spammy

earnest phoenix
#

I know, but with the new update to my bot there is a required channel and since people don’t have it, the bot keeps throwing errors

#

And there are some servers that I didn’t even know it was on

austere meadow
#

why dont you just return if the bot doesn't find that specific channel?

earnest phoenix
#

Well i did

#

But the console gets spammed

mighty barn
#

Put it as a message in the help command?

earnest phoenix
#

That’s a good idea.

#

Thanks guys

trim plinth
#

You could just give back a return message stating how you need a new channel for it

#

if it throws back an error

#

because there isn't a correct channel

austere meadow
#

@heady zinc sorry, defaultChannel isn't a property in master and i get so used to master lmao

#

do they still have it in 11.3 tho

#

apparently

heady zinc
#

well anyway its still deprecated and a lot of guilds were created since then

#

so no point in using it

austere meadow
#

yeah

heady zinc
#

people using master cuz v12 is taking years to release

austere meadow
#

yes

#

master is pretty stable imo

#

it hasn't caused any issues for me

#

and i like the new stuff in it

heady zinc
#

still waiting for that internal caching thing zoomeyes

austere meadow
#

ohh ikr

#

ffs when™

prime cliff
#

No default channel is suppose to resolve to the default channel and if you delete it then it changes to the first channel it finds?

heady zinc
#

just returns undefined in that case

earnest phoenix
#
const randomcolor = '0x'+Math.floor(Math.random()*16777215).toString(16);

why this is not working ?

#

@austere meadow

austere meadow
#

what are you doing

#

are you trying to get a random color?

languid dragon
#

i dont actually know if that code works or not

#

but i think in order for colours to work

#

its gotta be

color: 0xFFFFFF

not

color: "0xFFFFFF"
tidal laurel
#

hidden links in enbed messages? how does it works:D

heady zinc
#

indeed it only takes integer

#

so you'd have to parseInt() it

earnest phoenix
#

@austere meadow I'm trying to generate random color

bitter sundial
#

just remove the 0x part and tostring

#

👌🏻

earnest phoenix
#

K I'll try

heady zinc
#

@tidal laurel [text](http://spookylink) zoomeyes

tidal laurel
#

thanks 😄

earnest phoenix
#

@bitter sundial dude it's not working it's only changing that time when I'm restarting the bot.

bitter sundial
#

looks like you set the variable on startup then

#

set it inside the command or make it into a function

earnest phoenix
#

Oh 😅 thanks

halcyon mountain
#

@bitter sundial Are you from Finland

south finch
bitter sundial
#

yes

earnest phoenix
#

idk if its new or not

#

but looks good

inner jewel
#

timestamps

earnest phoenix
#

thank you

quiet bobcat
#

🤔

elder rapids
#

Use UTC on that btw

severe socket
plush frost
#

how i do host a website with A name to a subdomain

topaz fjord
#

A wut

plush frost
#

example

#

i host something on exa.ple.ip:66 and i want use it in example.com

topaz fjord
#

Use nginx or apache2

plush frost
#

i use nginx

glossy sand
#

wait so you have something hosted at 12.34.56.78:90

plush frost
#

yep

glossy sand
#

purchase the domain and set up a dns apex record

plush frost
#

im asking which one i do

#

?

glossy sand
#

uhh yes

#

i think?

topaz fjord
#

Use cloudflare...

plush frost
#

yeah

#

got it

glossy sand
#

use cloudflare for what lol

topaz fjord
#

@glossy sand for ip protection u cuck

glossy sand
#

what in the world is "ip protection" supposed to mean

plush frost
#

but im getting EADDRNOTAVAIL error

#

when i do

topaz fjord
#

@glossy sand ddos n shit

glossy sand
#

that's not even related to the question lol

#

@plush frost when you do what?

plush frost
#

when im trying use my domain

#

on a node processes

#

when trying s

#

use my domain

#

EADDRNOTAVAIL

glossy sand
#

you still just bind to 0.0.0.0

#

the dns handles everything and eventually tells the client to use your ip

potent lily
#

Free CloudFlare doens't protect every protocol ^^

plush frost
#

the problem i dont use default port

#

:80 one

glossy sand
#

oh uhh

#

you'll want to run a reverse proxy server

#

I've heard nginx is pretty good for that purpose but I don't personally have any experience

plush frost
#

thx

earnest phoenix
#

Does the streamOptions.seek for dispatcher even work?

#

It doesn't seem to seek

#

@glossy sand Nginx is the best choice for static serving & reverse proxy.

languid dragon
#

          args.splice(0, 2)
          for (let a in args) {
            let role = message.guild.roles.get(args[a].replace(/[<#>]/, ''))
            if (!role) {
              let role2 = message.guild.roles.find('name', args[a].replace(/[<#>]/, ''))
              if (!role2) {
                returnMsg += `${args[a]} is not a valid role.\n`
              } else {
                returnMsg += `The role **${role2.name}** was deleted.\n`
                role2.delete();
              }
            } else {
              returnMsg += `The role **${role.name}** was deleted.\n`
              role.delete();
            }
          }
outer kettle
#

am I able to get help in here???

languid dragon
#

yes

outer kettle
#

okay so the money game bot with the elephant profile pic I need help with the command call ( set-fine-amount <command> <min | max> <amount> )

#

the perenthace's I put in there

restive silo
#

uhh

#

this is not dirext support for bots

#

its more like develope help with creating bots

#

you should ask the owner of that bot instead

#

and i think you mean unbelievebleBot

outer kettle
#

yes that one...

#

okay how's the dev of the bot???

restive silo
#

i think its unbelieveble

#

@umbral pelican

umbral pelican
spare spruce
#

does anyone know what im trying do here? im confused RN

#
    var message11 = dclient.guild.channels.get("408336953419759617");
    var Dusername = dclient.users.get("100463282099326976").tag;
    client.say(channel, 'Discord: **' + Dusername + '**: ' + message11);```
#

i trying relay Discord to twitch

#

i done from twitch to discord im trying relay back from discord to twitch

potent lily
#

🤔

fleet mason
potent lily
#

100463282099326976 is you

#

You want to send a message in the "408336953419759617" channel and you want to send 'Discord: node ChisdealHD.js: ' + message11

#

And message11 is the channel as obj ?

#

@spare spruce

spare spruce
#

well firat all for example this

#
//relays twitch chat to discord server
    var channel = dclient.channels.find('name', 'chisdealmethschat');
    var username = userstate['username'];
    channel.send('Twitch: **' + username + '**: ' + message);
#

thats how i can pull from twitch to discord

#

but i need way do backwords too like discord to twitch

potent lily
#

idk

spare spruce
#

just idk how i pull out channel

#

like get info

potent lily
#

Get the channel ?

#

Wich one ? discord one ?

spare spruce
#

discord 1

#

try read discord channel to post in twitch

#

thats methered i try do

potent lily
#

that's D.JS right ?

spare spruce
#

problem is idk how i get info out there like chat

#

yes

#

and TMI js

#

TMI = twitch nodjs

#

kinda intergrate both RN

potent lily
#

oh to say where the discord message is from wich discord channel ?

spare spruce
#

like for example when we talking like this

#

i need way pull out put in twitch

potent lily
#

Wich info you need from discord ? Channel name ?

spare spruce
#

client.say(channel, 'Discord: **' + Dusername + '**: ' + message11); this twitch fuction to write data

#

discord chat

#

how many times i have to say

potent lily
#

oh

spare spruce
#

i mean discord channel = discord chat

#

as ya see i done for twitch dclient.channels.find('name', 'chisdealmethschat');

#

i need get data from chat channel

potent lily
#

When you receive a new message you send it back to the Twitch api thing you have

spare spruce
#

yes

#

like anythign type sends to twitch

#

as back relay

#

as ya see works for twitch to discord but not discord to twitch

potent lily
#

i don't use JS but you probably have a hook who get call when someone send a new message

spare spruce
#

2nd message didnt came threw to twitch

#

hmm

potent lily
#

First did ?

spare spruce
#

first all i need know how to pull out chat data

#

then i can do all rest

potent lily
#

When the hook get call he send a obj call message in Python

#

So you can make message.content to have content

#

There is probably something like that in JS

spare spruce
#

what that bot called again coldon or what ever is

#

what can read all discord chats in html

#

like that but i need fuction call in twitch

#

that bot @gilded rivet

#

like that when thy did as HTML

#

but i need know how do that so i can do that to twtich as sipific channel

potent lily
#

Idk hope someone can help you with the info you gave me ^^

#

Good luck 😉

earnest phoenix
#

@spare spruce use one of the many twitch api library's on npm

near jasper
#

Anyone need a Translator For Hungarian i can do it in Github

deep parrot
#

@spare spruce are you using the twitch api?

earnest phoenix
#

What is the member. tag for Discord Account Creation Time?

inner jewel
#

timestamp = (entityId >>> 22) + 1420070400000

earnest phoenix
#

Nevermind I'm dumb

#

I found it

#

Why does the streamOptions.seek not work

#

Do I have to return the dispatcher?

topaz fjord
#

For what

cerulean zinc
topaz fjord
#

idk if u can

uncut slate
#

ofcourse you can

uncut slate
#

it'll be pretty complicated, but you definitely can @cerulean zinc

cerulean zinc
#

Yea...

uncut slate
#

use process.stdout.write and process.stdin.on('keystroke', cb)

cerulean zinc
#

hmm. Alright

pale plume
#

looking for a bot that post otc stock charts and share structures

earnest phoenix
#
events.js:188
      throw err;
      ^

Error: Unhandled "error" event. ([object Object])
    at Client.emit (events.js:186:19)
    at WebSocketConnection.onError (C:\Users\owner\Desktop\Weather Bot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:371:17)
    at WebSocket.onError (C:\Users\owner\Desktop\Weather Bot\node_modules\ws\lib\event-target.js:128:16)
    at emitOne (events.js:116:13)
    at WebSocket.emit (events.js:211:7)
    at WebSocket.finalize (C:\Users\owner\Desktop\Weather Bot\node_modules\ws\lib\websocket.js:190:41)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)```
Any help
gilded blaze
#

yes we can help with an error

earnest phoenix
#

xD

gilded blaze
#

don't need the code

earnest phoenix
#

xD

earnest phoenix
#

what does it mean when you get "No available voice nodes"

#

i think i know what it means but i just wanna make sure

austere meadow
#

you may have provided the wrong details when creating the player

earnest phoenix
#

oh, heh that might be it

fleet mason
#

is this something i should care about "(node:13428) DeprecationWarning: ClientUser#setGame: use ClientUser#setActivity instead"

restive silo
#

yes

#

because in the next major update setGame is not a thing anymore

fleet mason
#

ok so if i just change setgame with setactivity the code should work

restive silo
#

yes most likely

fleet mason
#

ok

fleet mason
#
      if(client.id !== '407182079437307904')return;
      let text = args.slice(0).join(" ");
  message.delete();
  message.channel.send(text, {
tts: true
});
}
``` what did i do wrong with if(client.id ...
restive silo
#

client has no id

#

a ClientUser does

#

a User does

#

a Member does

fleet mason
#

ok so what i want is that if the channel is not channelID return

restive silo
#

then you wanna get the if from the channel that message is from

fleet mason
#

yea the channel id is the 'numbers'

restive silo
#

yes i know

#

then use a channel object instead client

#

ez fix

fleet mason
#

ok

#

i dont understand XD

heady zinc
topaz fjord
#

@earnest phoenix oo what u using

trim abyss
#

Go probably

fleet mason
#
      if(message.channel.id !== '407182079437307904');
      message.channel.send("You can only use !say in the TTS channel.")return;

} else {

        let text = args.slice(0).join(" ");
    message.delete();
    message.channel.send(text, {
  tts: true
  });
  }
``` how do i get this code to work/ return and send message if the channel is wrong or send the message that the command is saying?
topaz fjord
#

What the fuck is that return

heady zinc
#

your if is broken af

#

like first return should be before the value that is supposed to be returned

fleet mason
#

i wanted it to send a message before returning

topaz fjord
#

How does it not error which is the question

heady zinc
#

second the code that should be executed if a condition is true should be inside the condition brackets GWchinaSakuraThinking

topaz fjord
#

Learn if and else statements pls

fleet mason
#
      if(message.channel.id !== '407182079437307904')return;


        let text = args.slice(0).join(" ");
    message.delete();
    message.channel.send(text, {
  tts: true
  });
  }```
#

that works but it wont send a message

heady zinc
#

way better zoomeyes

topaz fjord
#

Because you didn't make it send a message zoomeyes

fleet mason
#

i want it to send a costum message before returning

topaz fjord
#

Ik

#
if(message.channel.id !== 'ehaterver') return message.channel.send('Your message');
#

@fleet mason

fleet mason
#

it didnt work. if the message was sent in the wrong channel it wouldent post a message but if i sent it in the channel i wanted it posted the message that i didnt want to post.

#
      if(message.channel.id !== '407182079437307904') return
       message.channel.send('You can only use !say in the TTS channel.');

        let text = args.slice(0).join(" ");
    message.delete();
    message.channel.send(text, {
  tts: true
  });
  }
topaz fjord
#

Your questions make no sense

fleet mason
#

ok so i have different chats in my discord. I only want !say to work in one of them. That is what the purpose of the if(message ... if the message is posted in the wrong chat the bot will say that the !say dosent work in this channel and that it only work in the other. If the message is posted in the right channel the bot will repeat the message that the user sent.

#

@topaz fjord

frail kestrel
#

ok so

#

spoonfeed because im gay hA nO

fleet mason
#

i want it to send the message to the channel to help the user

frail kestrel
#

???

#

what

heady zinc
#

if you could try to avoid spoon-feeding

#

would be appreciated

frail kestrel
#

o heck

topaz fjord
#

If you try to learn js then it would be better zoomeyes

frail kestrel
#

yes

#

omg

#

if you try to learn js .then(console.log('it would be better'));

fleet mason
#

ok i just added a another if(... to the command and it works XD. pretty shit but i works bloblul

deft rapids
#

How do you code a bot?

earnest phoenix
#

magick

icy sorrel
#

You write stuff and the stuff does a thing

deft rapids
#

Mmk

fervent flame
#

With <3 and github

#

jk

potent lily
#

with mspaint cc neko

earnest phoenix
#

Anyone have code for Discord.js for when the bot starts it logs a list in console of the guilds it is in.

#

I also use bot.on

languid dragon
#

nobody is gonna just

#

give u the code

quasi marsh
#

Discord.js should have methods to list all guilds, you should be able to use a for loop to get all the names

heady zinc
#

well a basic forEach()

#

or a map

#

or anything else that lets you iterate through guilds

earnest phoenix
#

@topaz fjord lavalink,

topaz fjord
#

@earnest phoenix did u fix it

earnest phoenix
#

@topaz fjord yeah it was a port thing i did on accident, now all i have is normal code errors so im nearly half way there XD

topaz fjord
#

Lol

#

Lavalink is sexy

earnest phoenix
#

looks like sexy

#

ive always used ffmpeg

topaz fjord
#

If u need help I can help u

#

@earnest phoenix

earnest phoenix
#

@topaz fjord what lib do you work on?

whole mural
#

@low rivet sorry for the ghost ping, realised what i wrote was retarded

spare spruce
#

how can i give my bot a discord ritch

#

keeps getting me it

#

not bot

earnest phoenix
#

What

topaz fjord
#

@earnest phoenix d.js

earnest phoenix
#

Bots cannot have rich presence

whole mural
#

I wish they could 😦

spare spruce
#

:/

#

well rip mah bot without discord ritch

whole mural
#

why?

spare spruce
#

well gessing i have to use as streaming mode

strange escarp
#

How would one go about making a markov chain that stays on topic?

glossy sand
#

you... don't?

#

that's not really the point of a markov chain

strange escarp
#

I understand that

#

But I just thought of something that may work

glossy sand
#

i mean you might be able to filter content for certain keywords and respond with a canned "i can't answer that!" response

#

but that's cheaty

strange escarp
#

I thought of something interesting

#

It'll store a string and a boolean for each user

#

The string is the last response that Analogue gave the user

#

The boolean was whether the user complained about the response or not

#

Upon Analogue's next reply

#

If the user didn't complain about it

#

It stores the old reply in the Markov chain

#

And replaces the "last" string with the new reply

glossy sand
#

that relies on users acting in good faith

strange escarp
#

I know

#

I'm used to the nature of the internet

#

It'll be fun to see what happens

#

"The start method can take in either a string str, in which case it will look to use that word to start the sentence."

whole mural
#

I made a markov bot before!

#

@strange escarp 😛

strange escarp
#

Yeah

#

The results are pretty random

whole mural
#

mhm

strange escarp
#

I made one in Ruby before

#

This is my first markov bot in Javascript

whole mural
#

I was going to add some natural langauge processing to try and make it seem a bit more coherant

#

i landed up not doing that because, lazy.

strange escarp
#

Heh

whole mural
#

also, all the users of the only server i had it on complained about it.

strange escarp
#
module.js:540
    throw err;
    ^

Error: Cannot find module 'markovchain'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\Alexander\Desktop\Discord\Analogue\analogue.js:2:16)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
#

RIP me

whole mural
#

🇫

strange escarp
#

This is what happens when I forget to install a library

whole mural
#

lmfao

strange escarp
#

One npm install later

earnest phoenix
#

@topaz fjord oof i eris

#

how would i check if the user id is equal to a user id from an array (js)

glossy sand
#

use Array::includes

#

if (arrayOfUserIds.includes(someId)) { ... }

earnest phoenix
#

thanks, works fine

#

How do I get streamOptions.seek to work?

cerulean zinc
#

Also does limiting the volume feature to $4 patreon seem fair...

#

also Its hard to know what to limit to patreon, upvotes or not at all

whole mural
#

limit EVERYTHING to patreon

#

kek

#

but have it so only 1 member per 1000 members of a server need to be on the patreon

#

(please dont do this)

heady zinc
#

If not limiting anything is not affordable, you should only "give additional perks" rather than "limiting features", giving a volume command (which is kinda useless) rather than restricting the whole music feature to donators seems pretty lit to me

quasi marsh
#

The only thing I'm offering additionally is custom language files to integrate, it's paid because of the work required to update the files and do the support

#

And I post sneak peaks in chat sometimes

#

I personally don't believe in restricting, I believe I should offer a quality product that included all the things required to make it work as good as it can

topaz fjord
#

@earnest phoenix not that much of difference

earnest phoenix
#

@topaz fjord aight

spare spruce
#

like is there way stop that

#

this i got RN

#
dclient.on('message', function(message) {
    var username = message.author.tag;
    var discordname = message.guild.name;
    var message = message.content;
    client.say("#nate_playz14", 'Discord: ' + discordname + ': ' + username + ': ' + message);
});```
potent lily
#

Ignore bot message

earnest phoenix
#
dclient.on('message', function(message) {
    var username = message.author.tag;
    var discordname = message.guild.name;
    var message = message.content;
    client.say("#nate_playz14", 'Discord: ' + discordname + ': ' + username + ': ' + message);
});
#

plus if you have more than one listener it will spam

#

so 🤷 @spare spruce

strange escarp
#
analogue.on("message", (message) => {
    if(message.author.id != 390700050038390804) {
        try {
            // TODO
        } catch(error) {
            try {
                message.channel.send({embed: {
                    "color": 0xCCCCCC,
                    "description": "I'm sorry, but something seems to have gone wrong. I'll inform the developer about the issue. Your ticket number is: " + errorNum,
                    "title": "Analogue"
                }});
            } finally {
                console.log("Ticket " + errorNum + ": " + error.stack);
                errorNum++;
            }
        }
    }
});

Does this look stable?

earnest phoenix
#

try it

strange escarp
#

It seems to work fine

#

But it hasn't been under a heavy load yet

earnest phoenix
#

try it under one maybe idk

strange escarp
#

Would the ticket numbers be the same at any given time?

earnest phoenix
#

not sure actually

inner jewel
#

no

#

because js is single threaded

topaz fjord
#

The ticket mins would retsrated if bot restarted right?

inner jewel
#

if it was multithreaded then possibly

topaz fjord
#

Mum's*

#

Nums

inner jewel
#

you could just send, say, b64 of the message id

#

guaranteed to be unique

topaz fjord
#

That works

inner jewel
#

and short enough

topaz fjord
#

Who needs short bloblul

#

Long is gud just like your dick

uncut slate
#

@strange escarp why is the error send in another try

strange escarp
#

Just in case the channel is deleted when the bot is processing

#

The try/finally statement makes sure the console.log runs

#

So I get the error either way

uncut slate
#

or you could log before sending the message

#

also you'll want to await that if that's what you're going for

strange escarp
#

Then what would catch that error?

uncut slate
#

the top try-catch

strange escarp
#

If it errors in that portion, there is nothing to catch it

uncut slate
#

well you aren't catching anything, so

strange escarp
#

I added a todo comment

#

Right now I'm programming it with a ton of contractions

spare spruce
#

@earnest phoenix i try make so Relays Dsicord to twitch and twitch to Discord

uncut slate
#

I'm talking about this

            try {
                message.channel.send({embed: {
                    "color": 0xCCCCCC,
                    "description": "I'm sorry, but something seems to have gone wrong. I'll inform the developer about the issue. Your ticket number is: " + errorNum,
                    "title": "Analogue"
                }});
            } finally {
                console.log("Ticket " + errorNum + ": " + error.stack);
                errorNum++;
            }
#

you're not catching anything

spare spruce
#

so like you can talk discord and twitch back

strange escarp
#

@uncut slate I will be soon

topaz fjord
#

Why try catch and finally

#

Wtf

spare spruce
#

problem is message.content doing stuff

uncut slate
#

well, whatever you want to do, you'll want to await that

topaz fjord
#

Aether

strange escarp
#

@topaz fjord The finally is part of a different try

topaz fjord
#

Teach me something

uncut slate
#

what

topaz fjord
#

Why is my args.join(" ") sucking dick

uncut slate
#

hm?

uncut slate
#

I have no idea what goes on before that, try console.log(args)

topaz fjord
#

It results an array with 2 items

#

test and word

glossy sand
#

smells like that's not even the callsite in question

#

that should at least produce something prefixed with ytsearch:

#

regardless of what Array::join returns

topaz fjord
#

Ye

uncut slate
#

yeah, so you're logging it from somewhere else, or calling it from somewhere else

topaz fjord
#

Wdym

pseudo inlet
#

@client.command(pass_context=True)
async def mname(ctx):
mname = ['Patrick.','Jeffery.','John.','Jason.','Graysen.','Devon.','Nathan.','Eric.','Jaden.','Timmothy.','Aiden.','Aaron.','Aidan.','Connor.','Jackson.','Felix.','George.','Riley.']
maleoutput = random.choice(mname)
await client.say(maleoutput)
print(':: generated the name %s' % maleoutput)

Not working. Using discord.py

topaz fjord
#

@uncut slate

uncut slate
#

That logged output isn't being called from that line you screenshotted

#

it's being sourced from either another console.log or another resolveTracks

topaz fjord
#

The loved output is coming from the resolveTracks function

#

Logged

earnest phoenix
#

Hello can someone help me with making a bot. I'm willing to pay for it.

I want to grow my community.
I have a paid section. with paid channels.

My idea:
1 invite = access to the paid channels for 1 day.
When you invite 2 it doesnt effect the day access. When 24 hours are over he loose the acces. He need to invite 1 new member to gain acces again.

1 problem:
When someone have 2 account's and leave the server and with the other server he invited himself back he have access again for the paid channels.

Some idea's about that?

Can someone make that.

cerulean zinc
#

when you want a nice site but you're shit at frontend

topaz fjord
#

@cerulean zinc k

#

@cerulean zinc play some beam ng with me whebn

cerulean zinc
#

Not multiplayer yet

topaz fjord
#

fuk

pseudo inlet
#

so can anyone help me with this

#

@client.command(pass_context=True)
async def mname(ctx):
mname = ['Patrick.','Jeffery.','John.','Jason.','Graysen.','Devon.','Nathan.','Eric.','Jaden.','Timmothy.','Aiden.','Aaron.','Aidan.','Connor.','Jackson.','Felix.','George.','Riley.']
maleoutput = random.choice(mname)
await client.say(maleoutput)
print(':: generated the name %s' % maleoutput)

Not working. Using discord.py

low rivet
#

what does not working mean

pseudo inlet
#

means its not working

#

thats what

#

it means

#

hlrepe

#

help

abstract mango
#

just read the error

pseudo inlet
#

i did

#

i dont under stand

glossy sand
#

you're mixing tabs and spaces in your indentation

#

don't do that

pseudo inlet
#

kk

#

ty

grave mirage
#

how can i get my bot to be permanently online? Currently, it is only online when I do "node bot.js".

#

When I turn off my computer, the bot turns off too

glossy sand
#

well uh your computer runs the bot

#

so of course when you turn it off, the bot also turns off, so to speak

south finch
#

buy a vps

glossy sand
#

yeah that ^

#

essentially a computer that stays on, all the time

grave mirage
#

ok

torpid vale
#

10/10 example for random.dog.js

#
const randomCat = require('random.dog.js');
const randomCatApi = randomCat.api();
 
randomCatApi.getDog().then((dog) => console.log(cat.url))```
#

xD

#

that was on npm

topaz fjord
#

Why use package

#

Use the API weebsite

earnest phoenix
#

Lol k 😂

mystic stone
#

what happened to #312614469819826177? were there just so many that they decided it wouldn't need updating anymore?

icy sorrel
#

Written guides for different libraries in different languages are comming to the website soon~ish, that might be why they locked the channel.

heady zinc
#

^

austere meadow
#

bit of a random question but does anyone know if its possible to get the name of a playlist from lavalink (using lavalink.js)? the videos from the playlist return just fine but it doesn't seem like theres any way to get the name of the retrieved playlist

jagged plume
#

nope

#

but you could just make a request to the youtube api and it should give it to you

austere meadow
#

alright cheers 👍

scenic crest
#

Does the Java/C Lavaplayer provide you with this information

austere meadow
earnest phoenix
#

boys

#
line 5, in <module>
    url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats"
NameError: name 'bot' is not defined```
jagged plume
#

bot is not defined

earnest phoenix
#

yes

jagged plume
#

so?

earnest phoenix
#

wont run

austere meadow
#

do you have access to "bot" in the current context

jagged plume
#

change it to client or whatever you are using ..?

austere meadow
#

or that ^

earnest phoenix
#
import aiohttp


dbltoken = "SFnfsSFJvncSDFJ1.DUjTog.MMwwFFffEW-jBOI2JeeZ_20M"
url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats"
headers = {"Authorization" : dbltoken}

async def on_ready():
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)

async def on_server_join(server):
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)

async def on_server_remove(server):
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)```
#

right?

#

@austere meadow @jagged plume

restive silo
#

dont show your token

earnest phoenix
#

@restive silo ik

austere meadow
#

^ better change that

earnest phoenix
#

no

#

tell me

austere meadow
#

i dont use python so im personally not sure but you probably don't have access to bot in that context

#

meaning you need to put that code somewhere else

#

either that or your client isn't called bot

earnest phoenix
austere meadow
#

do you call your client bot

earnest phoenix
#

mines not client its gulids

#

how sure u r

#

eh no don’t listen to me idk py

#

lol

#

but i know you define by doing bot =

#

p!info

#

i see

#

i need to fix

#

my counting server

#

wont wokr

#

bruh

#

i have lots to fix

austere meadow
#

commands dont work here btw

#

need to go to testing channels for that

earnest phoenix
#

ik

austere meadow
earnest phoenix
#

lol

#

@austere meadow whendid u applied for hype

austere meadow
#

lets move to general

fleet mason
#

what does this error mean C:\Users\sande\Desktop\mybot>node mybot.js
module.js:665
throw err;
^

SyntaxError: C:\Users\sande\Desktop\mybot\config2.json: Unexpected token c in JSON at position 0
at JSON.parse (<anonymous>)
at Object.Module._extensions..json (module.js:662:27)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\sande\Desktop\mybot\mybot.js:4:16)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)

austere meadow
#

you're trying to JSON.parse something that isn't a JSON object i believe

topaz fjord
#

Why did you change the name

fleet mason
#

ops

#

that was wrong

topaz fjord
#

He first error said you have a syntax error in your Json file

fleet mason
#

but i have 2 config.json

topaz fjord
#

Read the error

fleet mason
#

so i removed the working 1 with the 1 that didnt work

topaz fjord
#

It says config2.json

fleet mason
#

ok so the token is wrong?

heady zinc
#

wat

topaz fjord
#

Show me your Json file

#

Without token

#

@fleet mason

fleet mason
#

im using that one because i used a command that had a modid

#

and i couldent get it to work

topaz fjord
#

Why are u using config.json when it's using config.js

quiet bobcat
#

🤔

topaz fjord
#

It's a simple thing to fix

#

So im gonna leave that to you

fleet mason
#

o wow

#

i feel stupid now

wispy schooner
quiet bobcat
#

lol

wispy schooner
#

o/

quiet bobcat
#

o/

earnest phoenix
#

how do u add favicon to website in html ?

stone kiln
#

use google

earnest phoenix
#

i did

#

and nothing showed up

stone kiln
#

google better

#

¯_(ツ)_/¯

earnest phoenix
#

most websites were just talking about icons

#

oml

wispy schooner
#

@earnest phoenix that's because a favicon is an icon you add to your website

earnest phoenix
#

do i use link element ?

stone kiln
#

yes

earnest phoenix
#

Yes

earnest phoenix
#

Any python nerds here that also happen to understand dmx and usb stuff? pls dm

#

wat

#

ugh whenever im trying to change the background colour of my website, this happens ;-;

trim plinth
#

oof

quiet bobcat
#

It's because you're using comic sans

earnest phoenix
#

i changed the div element to p element

#

not bothered

#

to change font

pale light
#

can you not

tawny lava
#

nice

glossy sand
#

well that was a fast ban

quiet bobcat
#

gg

earnest phoenix
#

hi i would like to know how i can send a embed in the main bot.js file

code:
```Shrug.on(guildCreate, guild => {

const log = guild.channels.find(`409024107276140575`);

const embed = new Discord.RichEmbed()
.setTitle(`New Guild Joined! #${Shrug.guilds.array().length}`)
.setThumbnail(`${guild.iconURL}`)
.setColor(0x00FF00)
.addField(`Name`, `${guild.name}`, true)
.addField(`Member Count`, `${guild.memberCount}`, true)
.addField(`Owner`, `<@${guild.owner.id}>`, true)
.addField(`ID`, `${guild.id}`, true);


log.send({embed});

})```

error:

      if (typeof value === 'undefined') throw new Error('Value must be specified
.');
                                        ^

Error: Value must be specified.
    at Map.find (D:\Bots\Shrug\node_modules\discord.js\src\util\Collection.js:19
3:47)
    at Client.Shrug.on.guild (D:\Bots\Shrug\ShrugCore.js:9:29)
    at emitOne (events.js:116:13)
    at Client.emit (events.js:211:7)
    at ClientDataManager.newGuild (D:\Bots\Shrug\node_modules\discord.js\src\cli
ent\ClientDataManager.js:35:21)
    at GuildCreateHandler.handle (D:\Bots\Shrug\node_modules\discord.js\src\clie
nt\websocket\packets\handlers\GuildCreate.js:17:26)
    at WebSocketPacketManager.handle (D:\Bots\Shrug\node_modules\discord.js\src\
client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (D:\Bots\Shrug\node_modules\discord.js\src\c
lient\websocket\WebSocketConnection.js:330:35)
    at WebSocketConnection.onMessage (D:\Bots\Shrug\node_modules\discord.js\src\
client\websocket\WebSocketConnection.js:293:17)
    at WebSocket.onMessage (D:\Bots\Shrug\node_modules\ws\lib\event-target.js:12
0:16)```
mighty barn
#

@long jungle when you use find you have to define something

earnest phoenix
#

wrong tyler