#development

1 messages ยท Page 468 of 1

worn hull
#

(@me if needed)

primal ferry
#

Hi, ฤฐm usind NodeJS discord.js. How i can get message guild owner id ?

worn hull
#

@primal ferry msg.guild.owner.user.tag

zealous veldt
#

um no

#

<message>.guild.owner.id @primal ferry

primal ferry
#

thanks โค

zealous veldt
#

no problem ๐Ÿ˜ƒ

heady zinc
#

please refer to d.js's documentation

#

djs has a great documentation

#

facking use it

worn hull
#

hm

#

so What would be the issue if my Bot didn't respond to any messages?

zealous veldt
#

you're going to need to tell us more than that

worn hull
#

So I coded it with discord.js

#

And After i installed the packages

#

it all crashed

#

and wont respond

#

after manual reboot

#

No Errors

#

@gilded blaze So My bot wont respond to any messages

#

exact same code on my other bot (

gilded blaze
#

Show the code where it should respond to messages.

worn hull
#

which?

gilded blaze
#

Where you receive the Message event and try to respond.

worn hull
#

o

#

Dms?

gilded blaze
#

why

#

just do it here

worn hull
#

the

#

message

#

code

gilded blaze
#

I don't think system is a property of the Message object.

zealous veldt
#

its not

gilded blaze
#

Unless you set it.

zealous veldt
#

o

#

no

#

system is

gilded blaze
#

Check that all the if statements that return are actually working.

zealous veldt
#

it tells if it was a discord message (e.g. clyde)

gilded blaze
#

oh

#

Interesting.

zealous veldt
#

not really useful to check ir for a bot tho

worn hull
#

It works perfect in my Other bot but not this bott

gilded blaze
#

Is it actually logging in?

worn hull
#

Ye

#

Its logged inj

#

[2018-08-21 23:02:32]: READY [READY] Sunrise#4622, ready to serve 59 users in 1 servers.

1534892686590 Ping Received

1534892829391 Ping Received

1534893108395 Ping Received

gilded blaze
#

Oh so you are receiving.

worn hull
#

ye

#

but its not responding

#

to any command

gilded blaze
#

Show where you are logging Ping received.

zealous veldt
#

Gateway I'd assume

worn hull
#

client.login(process.env.BOT_TOKEN, {fetchAllMembers: true});
};

zealous veldt
#

oh

worn hull
#

const http = require('http');
const express = require('express');
const app = express();
app.get("/", (request, response) => {
console.log(Date.now() + " Ping Received");
response.sendStatus(200);
});
app.listen(process.env.PORT);
setInterval(() => {
http.get(http://${process.env.PROJECT_DOMAIN}.glitch.me/);
}, 279000);

gilded blaze
#

Umm that is express.

worn hull
#

ye

zealous veldt
#

oof glitch

worn hull
#

its on Glitch

#

since my Laptop cant run Visual

zealous veldt
gilded blaze
#

You're not telling it to send a message. Just sending 200 response code.

worn hull
#

want me to send Glitch invite?

#

in dsm

#

dms?

gilded blaze
#

Na. I don't really know how to fix ur issue

worn hull
#

o

earnest phoenix
#

can i get some help with eris?

worn hull
#

?

zealous veldt
#

probably

#

just ask your question and someone will probably answer it

primal ferry
#

Hi how can i send timed message ? with discord.js like : this message will be delete in 5 seconds

zealous veldt
#
msg.channel.send('this will self destruct in 5 seconds').then((m) => {
    setTimeout(m.delete, 5000);
});``` I believe should work @primal ferry
#

lmk if it does or doesn't

uncut slate
#

you'd probably have to m.delete.bind(m) or () => m.delete()

zealous veldt
#

^ listen to aeth not me lol

worn hull
#

i need this stupid bot to work

#

ugh

zealous veldt
#

a bot is only as smart as its creator

compact haven
#

@zealous veldt m => { m.delete({timeout: 5000}) } or m => { m.delete(5000) }

zealous veldt
#

the latter I believe

arctic mesa
#

Hello im wondering if somebody can make me a bot
Just a bot who recognizes me and my friend kassandra and says Hey Kassandra And Alex! How are you today
And they'res a cmd that says
!Good !bad !Amazing

#

aaaaa

#

i cant see m ymouse

earnest phoenix
#

do it yourself buddy

arctic mesa
#

wwwwwwwot

#

i cant see my mouse

#

my pc is lagging

#

i dwnloaded the coding program

#

i cant see my mouse now

#

wtf

#

I CANT SEE MY MOUSE

uncut slate
arctic mesa
#

what the fuck

#

i cant do it

#

or move my mouse

#

my mouse wont work

uncut slate
zealous veldt
#

why would you even want that bot

#

its just dumb lmfao

arctic mesa
#

Idk

#

but my mouse

#

isnt on the screen

#

aaaaaa

#

i downloaded

#

the coding software

#

thats all

quasi marsh
#

Go to shitpost please

zealous veldt
#

no dont polute shitpost with him pls

uncut slate
#

moose, you too

zealous veldt
#

k

devout raven
#

Hmm

earnest phoenix
#

That was interesting

lone orchid
#

hey, im using discord.js

quiet bobcat
#

cool

lone orchid
#

i want my bot to set pUser = message.author.id if anything other than a member is mentioned

#

and if a member is mentioned pUser = message.mentions.members.first().id

#

nothing i've tried seems to work

quiet bobcat
#

if(message.mentions.members.first()) do the thing else do the other thing

#

return before the else thing aswell

earnest phoenix
#

also be aware that the mention might not be correct if you allow a mention prefix for your bot

quiet bobcat
#

Is there a way to do what splice does in JS but in Java?

spring ember
#

Collections.addAll I think

quiet bobcat
#

but for a string[]

spring ember
#

use lists then

quiet bobcat
#

lists?

spring ember
#

call me on Discord

opaque trail
#

how would i implement the api, so i need to post every whatever minutes or does the dblapi.js library do it for me

earnest phoenix
#

lib does it for you

sinful lotus
#

make your own lib if you want a lightweight implementation, or use dblapi.js

earnest phoenix
#

is there any example of write and delete one message after a few seconds?

sinful lotus
#

simply as

const m = await msg.channel.send('hi');
await m.delete();
#

or use .then

earnest phoenix
#

thnx

#

that will delete immediately and they will come back asking how to make a delay facepunch

#

yes

heady zinc
#

actually djs is holding your hand so you can just do m.delete(5000) and djs would delete it after 5 seconds

earnest phoenix
#

i make the delay

#

but now dont work

#

oh ty

#

fully working

#

what can i do to solve that?
int value should be less than or equal to 100.

sinful lotus
#

what are you Exactly doing

earnest phoenix
#

im trying to clear more than 100 messages

#

@sinful lotus

sinful lotus
#

u cannot do that

#

if you want to delete more than 100 messages

#

maybe do it on a loop

earnest phoenix
#

ty

#

other thing

#

and to delete all messages?

#

any example like

#

while(still exist messages){deletemessage;}

#

anyone?

wide shale
#

yes

#

But you cant with bulk delete if its older than 2 weeks

earnest phoenix
#

so what should i do?

wide shale
#

delete messages with a loop

earnest phoenix
#

yes

#

the unique issue is

#

make it detect if there is no more messages

wide shale
#

fetch all messages

#

then a while loop

earnest phoenix
#

ok i dont get it i will search on internet

wide shale
#

ยฏ_(ใƒ„)_/ยฏ

earnest phoenix
#

it simple dont delete anything

#
async () => {
          let fetched;
          do {
            fetched = await channel.fetchMessages({limit: 100});
            message.channel.bulkDelete(fetched);
            i = i + 1
          }
          while(fetched.size >= 2);
        }```
wide shale
#

You want to delete all messages?

earnest phoenix
#

yup

wide shale
#

just delete the channel and make it again

#

easier

earnest phoenix
#

and how to get the channel infos

#

and recreate it

#

with same premissions

#

and same name

#

and same shit

wide shale
#

its in the library docs

knotty steeple
#

what if there is no manage channel perms

earnest phoenix
#

yup

wide shale
#

then do the other method

earnest phoenix
#

anyone can ajust the code?

#
          let fetched;
          do {
            fetched = await channel.fetchMessages({limit: 100});
            message.channel.bulkDelete(fetched);
            i = i + 1
          }
          while(fetched.size >= 2);
        }```
knotty steeple
#

no

wide shale
#

thats bulkDelete

#

it wont work for 2 week older messages

earnest phoenix
#

ok so im fucked

primal ferry
#

Hi how i can do a cooldown with discord.js ? like;

Starting in 3 second
Starting in 2 second(edited)
Starting in 1 second(edited)
latent heron
#

try a setinterval function for the function to repeat time and then decrement every function call

#

idk i dont code in js

quartz kindle
#

or a setTimeout with .then() blocks

primal ferry
#
        
        msg => {msg.edit("Starting in 2 seconds")}
        )```
#

i can do edit with this

#

but i cant did 1 second

quartz kindle
#

msg => {setTimeout(function(){msg.edit("Starting in 2 seconds")},1000)}

arctic mesa
#

msg => {setTimeout(function(){msg.edit("Starting in 2 seconds")},1000)}

thorn rapids
#

I need some help with people having to react to a message to get a role

primal ferry
#

So how can i edit message with Starting in 1 seconds ๐Ÿ˜„

sullen path
#

I assume put another .then() on the edit, but I don't do JS

quartz kindle
#

yes, another .then() after the msg.edit

arctic mesa
#

โ–ฌโ–ฌฮนโ•โ•โ•โ•โ•โ•โ•-

loud salmon
autumn rain
#

Can someone tell me how to write a <h2> for DiscordBots markdown? It won't work for me somehow..

latent heron
#

<h2></h2>

#

tags are a bit broken

autumn rain
#

<h2>RoleManagement</h2>
Does not work for me

#

At least in Preview all Text between h2 is not visible

latent heron
#
<h2>
    RoleManagement
</h2>```
#

try that

#

yeah

#

thats preview m8

#

try saving

autumn rain
#

Okey ๐Ÿ˜„

#

Nope still.. The first h1 works well, but anything else is broken somehow

#

Dark mode is not supported here ;D

latent heron
#

oof

#

yeah thats odd

#

im able to use h2 on my page

autumn rain
#

Yes it works, but as soon as I enable dark mode i dont see it anymore, thats what i tried to highlight by marking it.

sick cloud
#

you can make the text another colour

latent heron
#

the HTML does support CSS ๐Ÿ˜‹

autumn rain
#

Unsure if I should. I think I'll wait until approval and check again if the Dark-Theme bug was fixed. Then I can edit my page again.

latent heron
#

thats how other bot pages have their fancy iframe setups

#

they just plug their code into the detailed description

sick cloud
#

and then add js and get removed

latent heron
#

yeah

#

i have my own

#

just disabled

pine wind
#

111

earnest phoenix
#

-bots @latent heron

gilded plankBOT
#

This user has no bots

latent heron
#

REEEE

quiet bobcat
earnest phoenix
#

i needed help

#

but no one

#

wanted to help

latent heron
#

any C# discord libs

earnest phoenix
#

no

#

me

latent heron
inner jewel
#

d#+

latent heron
#

thx

hybrid seal
#

Hey

#

How do I use APIs on Discord Bot List?

zealous veldt
earnest phoenix
topaz fjord
#
<Client>.on('error', (err) => {
console.log(err)
})
small wagon
#

sup

topaz fjord
#

@earnest phoenix put this in your main file and wait for it to come back

loud salmon
#

@earnest phoenix bots can respond in #commands

copper shell
#

why is there a fatal error message?

#

on my pc?

loud salmon
#

is it even a discord bot problem?

#

have you tried using google?

copper shell
#

i do use google

#

i just was doing something than a warning thing appeared idk if it is discord or what

fickle mantle
#

Is there a bot that can make role color rainbow

knotty steeple
#

no

loud salmon
#

that is api abuse

#

and will most likely get the bot deleted

fickle mantle
#

I've heard of bots that can do it

tawdry fox
#

can someone explain me what this js function do?

function sdt(){var n=new Date,i=new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds()).getTime(),t=countDownDate-i,r=Math.floor(t/864e5),u=Math.floor(t%864e5/36e5),f=Math.floor(t%36e5/6e4),e=Math.floor(t%6e4/1e3);document.getElementById("days").innerHTML=padLeft(r);document.getElementById("hours").innerHTML=padLeft(u);document.getElementById("minutes").innerHTML=padLeft(f);document.getElementById("seconds").innerHTML=padLeft(e);t<0&&(clearInterval(x),document.location=document.location)}
knotty steeple
#

holy shit

#

that is

loud salmon
#

did you try running it

knotty steeple
#

probably wants to know what it does first

loud salmon
#

oh yea

knotty steeple
#

before he runs it

zealous veldt
#

maybe format it too lmao

loud salmon
#

yea

knotty steeple
#

ill do that

#

wait a sec

tawdry fox
knotty steeple
#
function sdt()
{
    var n = new Date,
        i = new Date(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate(), n.getUTCHours(), n.getUTCMinutes(), n.getUTCSeconds()).getTime(),
        t = countDownDate - i,
        r = Math.floor(t / 864e5),
        u = Math.floor(t % 864e5 / 36e5),
        f = Math.floor(t % 36e5 / 6e4),
        e = Math.floor(t % 6e4 / 1e3);
    document.getElementById("days").innerHTML = padLeft(r);
    document.getElementById("hours").innerHTML = padLeft(u);
    document.getElementById("minutes").innerHTML = padLeft(f);
    document.getElementById("seconds").innerHTML = padLeft(e);
    t < 0 && (clearInterval(x), document.location = document.location)
}
#

there

zealous veldt
#

lmao that domain

knotty steeple
#

to me it looks like a date format thing

loud salmon
#

rip in edge

zealous veldt
#

I think it just does the time part of that website

knotty steeple
#

36e5?

tawdry fox
#

In Spain a tweet that consists of an invented mystery has been made viral

#

and that page is a part of the mystery

zealous veldt
#

o

#

that function just makes the clock move

loud salmon
#

yea

tawdry fox
#

Is there any way to know what we have to put in the field below the countdown?

zealous veldt
#

hm

#

one sec

tawdry fox
#

I'm going to take a shower and come back, I'll read what you say in about 10 minutes

zealous veldt
#

I'm trying to find the endpoint for that form

loud salmon
#

its a POST request to the same url

#

you have to pass a Pkey which i think is the password, as well as the jungle cookie, which i think is related to auth

zealous veldt
#

its interesting

tawdry fox
#

im back

zealous veldt
#

wb

primal ferry
#

Hi, Did i can use base64 image on embed thumbnail ?

tawdry fox
#

@primal ferry i'm not sure but i think that you can only use urls or attchfile along with the embed

slender thistle
#

display: none the base64 image and replace it with your link.

floral zinc
#

I need a sql expert in dms pls

topaz fjord
#

or you can ask your question here

#

and someone will help you

#

ยฏ_(ใƒ„)_/ยฏ

floral zinc
#

I have a Table with 3 cols in SQL.
Player, Goals, platform

Platform can only have the values pc, ps, xbox

I want to get the averages of the goals grouped by the platform and I need the output name to be GoalsAvg_pc, GoalsAvg_ps, GoalsAvg_xbox.. I know how to group it but Im stuck with the output names

Im usin Postgres

latent heron
#
using System;

namespace Testing {
  class bar {
    public string variable = "hello world!";

    static void Main(string[] args) {
      this.variable = variable;

      System.Console.WriteLine(variable);
    }
  }
}```
#

im doing something wrong here tho

#

im getting errors

zealous veldt
#

I'm pretty basic in C#, I don't think I can help you lol

#

Sorry

latent heron
#

oh nm then oof

#

i know someone who can help me but they offline rn

night imp
#

What errors?

latent heron
#
exit status 1
main.cs(8,23): error CS0120: An object reference is required to access non-static member `Testing.bar.variable'
main.cs(8,7): error CS0026: Keyword `this' is not valid in a static property, static method, or static field initializer
main.cs(8,12): warning CS1717: Assignment made to same variable; did you mean to assign something else?
main.cs(10,32): error CS0026: Keyword `this' is not valid in a static property, static method, or static field initializer
Compilation failed: 3 error(s), 1 warnings```
#

oh

#

the errors speak for themselves

#

oops

#

wait

#

well i need static in my Main() ๐Ÿค”

zealous veldt
#

o yeah

earnest phoenix
knotty steeple
#

why would you need a proxy

earnest phoenix
#

Public APIs block IPs that make to many requests in a span of time. I have already emailed the compan(y/ies), they are fine with it.

latent heron
#

dont make a lot of HTTP requests then ๐Ÿค”

knotty steeple
#

then dont make too many requests in a span of time?

latent heron
#

^

#

add a cooldown to it

#

or smth idk idc

earnest phoenix
#

Heh. They have it block them after just a few per day.

#

Its so gae

latent heron
#

take it up to them

knotty steeple
#

scrape the data

earnest phoenix
#

Samurai... You have to login to the API. I don't think you can scrape it

knotty steeple
#

what

earnest phoenix
#

It's a login API...

knotty steeple
#

do you know what scraping is

earnest phoenix
#

Nope

#

Assumed that it takes all information on the api

#

Idk

knotty steeple
#

it does

earnest phoenix
#

Can you do that with login apis?

latent heron
#

ok I figured out a workaround for the C#

#
public string variable = "hello world!";

    public static void Main() => new TestClass().NonStatic();

    public void NonStatic() {
      System.Console.WriteLine(this.variable);
    }```
#

static functions, variables or instances cannot support this since it is called a reference of the class

#

so you have to call the main content within a non-static function

#

basically i was being stupid because i knew main couldn't do exactly that limitation

knotty steeple
#

wait

#

since there is no api you have to scrape that page

#

you can do that with a page that uses the api or something like that

#

@earnest phoenix

zealous veldt
#

scrape it

earnest phoenix
#

@knotty steeple ok

#

Wait wtf

#

Im confuzled af

#

U can scrape a login api?

knotty steeple
earnest phoenix
#

Lol sorry

#

Im like

#

Fucking stupid

knotty steeple
#

just google website scraping

earnest phoenix
#

Ok

latent heron
#

so wait

earnest phoenix
#

It just pulls text off the page right?

knotty steeple
#

yes

earnest phoenix
#

How am i supposed to login with that

#

Lol

knotty steeple
#

oml

earnest phoenix
knotty steeple
#

you dont scrape the api

earnest phoenix
#

I scrape the page

#

But obviously u can't login like 1000 times to different accounts on one ip

#

Lol

wide ruin
#

So I have a code on glitch.com, and there is the main file (server.js) which has code like `if(command === help){

}`

There is also a file called command/help.js which has the code for the help command

How can I run the command/help.js file from server.js?

Discord.js lib

knotty steeple
#

what does help.js look like

wide ruin
#

Just has the code for help command

knotty steeple
#

what

#

is

#

in

#

help.js

wide ruin
#

Consts, vars and rich embeds

knotty steeple
#

what is the code in help.js

wide ruin
#

Do you just want the code link?

knotty steeple
#

you can just send the code in a codeblock

wide ruin
#

It's easier for you to help then as well

#

I may misunderstand

#

Please enable server dms

knotty steeple
#

you can send it here

wide ruin
#

I don't want the code public

#

It's easier this way

knotty steeple
#

well

#

cant help u

#

im not enabling dms

wide ruin
#

Just add as friend quickly

#

Remove after

knotty steeple
#

sigh

#

fine

wide ruin
#

Thanks

knotty steeple
#

ok send

ruby dust
#

me all the time

knotty steeple
#

sends link to glitch join link when i said send in a codeblock

wide ruin
#

Just use the link

knotty steeple
#

```js
// commands/help.js stuff
```

wide ruin
#

Whatever

#

module.exports.run = (bot, message) => {
  //.addField("", "")
  
  const e = new Discord.RichEmbed()
          .setTitle("iSauce")
          .setDescription("Here are the commands ")
          .addField("Ping", "Responds with Pong ")
          .addField("Link", "[Responds with a link to invite me](https://discordapp.com/api/oauth2/authorize?client_id=481212990398398466&permissions=8&scope=bot)")
          .addField("Version", "Checks my current version")
          .addField("Vsauce", "Gives a link to the Vsauce youtube channel")
          .addField("Video", "Sends a random Vsauce video")
          .addField("Kick", "Kicks a member")
          .addField("Ban", "Bans a member")
          .setColor(0x00ff00)
          .setAuthor(`requested by ${message.author.tag}`, `${message.author.displayAvatarURL}`)
          .setFooter("My creator is Pineapplefan1234YT#9295 and i had help from Bakagain#1844")
          message.channel.send(e)

}
module.exports.help = {
  name: "help"
}```
knotty steeple
#

ok so

ruby dust
#

I don't see what's so super secret about this code... sigh

knotty steeple
#

you have to require the file

wide ruin
#

And the one in server.js is

#
        {
            
            
        } ```
#

It is there is an if above it

knotty steeple
#

you have to require commands/help.js

wide ruin
#

I d k what that means

ruby dust
#

so you know how to require discord.js but you don't know how to require commands/help.js?

knotty steeple
ruby dust
#

literally the first line of your code I see is requiring discord.js

wide ruin
#

It isn't just me working on it tho

#

So what will it be?

ruby dust
#

is it your bot?

wide ruin
#

Const help = require ('command/help.js')

#

Is that how?

#

It is my bot

knotty steeple
#

javascript is case sensitive

#

so its const, not Const

wide ruin
#

That's just my mobile keyboard

#

Auto capitalise

#

But was it right?

knotty steeple
#

also did you look at what i sent

wide ruin
#

Which one

knotty steeple
wide ruin
#

Sorry

#

I am more dense than osium

knotty steeple
#

what

wide ruin
#

The densest substance

#

Below me

zealous veldt
#

lol

wide ruin
#

So in the server.js file, I type the require, then what

knotty steeple
#

did you even look at what i sent

#

like

#

at all

wide ruin
#

I didn't get it

#

Can you just tell me?

#

Please

topaz fjord
#

no spoon feeding sir

knotty steeple
#

this is the last time im sending it

viscid falcon
#

how would i check if my bot can dm the user

knotty steeple
#

use a try catch

#

try to send the user a dm

#

if it catches an error have a message saying cant send dm

wide ruin
#

I don't get how circles and squared can translate to what I am doing

#

Squares*

#

D E N S E

#

Just leave it

#

The other dev is here

topaz fjord
#

other dev

viscid falcon
#

so what something like -

async function dm() {
message.author.send('message')
    catch (error)
    message.channel.send('**It appears I can't pm you!**')
}
dm()
knotty steeple
#

no

viscid falcon
#

oh

#

sorry i never have really used catch before

topaz fjord
#

try catch

#
try {
    // code
} catch(e) {
    // something with e
}
knotty steeple
#

heck

wide ruin
#

The other dev went offline

topaz fjord
#

who is this other dev

viscid falcon
#

so it would be like -

try {
    message.author.send('message')
}
catch (error) {
    message.channel.send(`**It appears I can't dm you**`)
}
ruby dust
#

eh, kinda

#

but what if bot can't even send messages in the current channel?

uncut slate
#

that catch clause would never be ran, you're missing an await

viscid falcon
#

where would i put the await?

wide ruin
#

So, module.exports.run = (bot, message) => { what do I do after this?

uncut slate
#

either

try {
  await message.author.send('message');
} catch (e) {
  message.channel.send('no');
}

or

message.author.send('message')
  .catch(e => {
    message.channel.send('no');
  });
viscid falcon
#

and did you get demoted, were you not mod before?

uncut slate
#

naw I resigned

topaz fjord
#

he didnt get demoted

viscid falcon
#

oh

#

well thanks!

wide ruin
#

So what do I need to put after module.exports.run = (bot, message) => {
?

#

Anybody

topaz fjord
#

you first need a command handler

viscid falcon
#

i bet the link he gave you said it

wide ruin
#

Well

#

I tried a command handler

#

And it broke the whole thing

topaz fjord
#

command handler is how you put commands in seperate files

wide ruin
#

How do I add a command handler

viscid falcon
#

if your using js

#

im assuming you are

wide ruin
#

Yeah

viscid falcon
#

so yeah thats a good guide

wide ruin
#

But can I just get code to copy in

#

I need code because the bot was hacked

knotty steeple
#

its a guide

viscid falcon
#

thats Spoon feeding

knotty steeple
#

follow the guide

wide ruin
#

The code was working

knotty steeple
#

no one is going to spoonfeed you

viscid falcon
#

its a guide just follow the steps

knotty steeple
#

@viscid falcon help vampire he is

#

google what that is

viscid falcon
#

its not hard, even me with barely any knowledge of js can do it

wide ruin
#

I am dense

#

And the link isn't actually letting me continue

knotty steeple
#

it works

wide ruin
#

Not for me

topaz fjord
viscid falcon
#

those things are great for when your stuck, especially if your bot is kinda generic

#

like mine

latent heron
#
using System;

namespace Mammalia {
  public class Person {
    public string[] life_identifs = {"name", "age", "weight"};
    public string[] person_identifs = new string[3];

    public static void Main() => new Person().makePerson();
    
    public void makePerson() {
      int count = 0;

      foreach(string component in this.life_identifs) {
        System.Console.WriteLine("What is your {0}?", component);
        var answer = Console.ReadLine();
        this.person_identifs[count] = answer;

        count++;
      }

      count = 0;
      System.Console.WriteLine();
      foreach(string answer in this.person_identifs) {
        System.Console.WriteLine("Your {0} is {1}.", this.life_identifs[count], answer);

        count++;
      }
    }
  }
}```
#

i got bored

#

so i created a shitty C# script

zealous veldt
#

nice

knotty steeple
#

("Your {0} is {1}.", this.life_identifs[count], answer)

#

what is this python?

zealous veldt
#

hush

wide ruin
#

Why can I not just have code, the bot was working fine before

viscid falcon
#

becuase we all work hard to make our bots work, even when something breaks, we fix it, its not our jobs its yours

wide ruin
#

It's not my fault

viscid falcon
#

ik

#

i had a power outage and i corrupted a lot of my code, i still rewrote it

wide ruin
#

It wasn't me who broke it

knotty steeple
#

well just rewrite it

topaz fjord
#

we cant give you code
because it counts as spoon feeding

wide ruin
#

I didn't write that part

latent heron
#

๐Ÿค”

#

well sam

#

it was either format in C#

#

or doing a long concat method

#

and concatenating is ๐Ÿคข

knotty steeple
#

concat?

wide ruin
#

I didn't write the part that was deleted

viscid falcon
#

k

knotty steeple
#

Your ${this.life_identifiers[count]} is ${answer}.

viscid falcon
#

then just write it this time around

knotty steeple
latent heron
#

ew

#

no

wide ruin
#

Idk what the code was

zealous veldt
#

I like C#

latent heron
#

what if i wanna change the variable names

#

hm

knotty steeple
#

idk

inner jewel
#

s"Your ${life_identifiers[count]} is $count"

wide ruin
#

I can't rewrite that part

zealous veldt
#

I have like a weird IDE/lang synesthesia

latent heron
#

i wanna try coding a discord bot in C#

#

just for shits n giggles

#

to see how well it does

knotty steeple
#

@wide ruin what

latent heron
#

afaik

zealous veldt
#

ive done it

viscid falcon
#

then dont rewrite it do this magical thing called write it

latent heron
#

discord api supports c#

knotty steeple
#

if you made it once you can make it again

latent heron
#

and C# is one of the only langs that can do rich presence

zealous veldt
#

moosebot v1 was c#

latent heron
#

besides custom user made ones

inner jewel
#

discord api doesn't support <language>

latent heron
#

oof

inner jewel
#

it's just websocket + http

#

any language with implementations for those can use the discord api

wide ruin
#

I can't write the code

latent heron
#

i guess that python code that discord has in the dev docs is meaningless then ๐Ÿ˜ฐ

#

and the c# code

viscid falcon
#

then find a tutorial

#

like the one i linked u

knotty steeple
#

thought it was java

latent heron
#

pineapple

knotty steeple
#

lol

latent heron
#

stop asking people to give you code

#

code it yourself or ask someone else outside this server

zealous veldt
#

isn't most of their example stuff pseudocode

inner jewel
#

technically the official rich presence thing is c++

#

but it can be used in any language that has ffi calls to it

latent heron
#

well technically C++ is good mainly of memory allocation events and can do more specified targeting

viscid falcon
latent heron
#

C# is pretty much tighter in all

zealous veldt
#

C# is the language of games now

inner jewel
#

a command handler can be just a map of command name to command

zealous veldt
#

because of UE and Unity

inner jewel
#

UE is c++ afaik

zealous veldt
#

I think you can use either

inner jewel
#

and any big game will most likely be using c(++)

latent heron
#

you can do C++ and C# in games with UE

inner jewel
#

because performance

zealous veldt
#

yeah

latent heron
#

i think its only C# in Unity also

inner jewel
#

and control of the memory

zealous veldt
#

Unity is C# scripting

wide ruin
#

@viscid falcon module.exports = { name: 'ping', description: 'Ping!', execute(message, args) { message.channel.send('Pong.'); }, };

latent heron
#

C# is pretty good imo for game engine support but I do see it having one fatal flaw

inner jewel
#

on a garbage collected language you have no control over when GC might happen

zealous veldt
#

which always feels weird to me

latent heron
#

and that's memory allocation

inner jewel
#

and that will pause the game

latent heron
#

C# can't deal with memory well on huge levels if you make a game

#

you can't really get rid of it either

#

so that is where C++ shines in

viscid falcon
#

ok, why did you give me that

wide ruin
#

Is that the right code to use?

viscid falcon
#

yes

wide ruin
#

Making sure

#

Thanks

inner jewel
#

that's the right code to use depending on your command handler

#

the format of the commands depends on it

latent heron
#

you're making sure but you didn't test the code now did ya

#

๐Ÿค”

#

not trying to be harsh man but

#

use common sense

#

ugh god i just realized something

#

now that i deleted my bot

#

its gonna take ages to get it back into DBL

zealous veldt
#

lmao

latent heron
#

because they may have new stuff to look for

zealous veldt
#

yeah

knotty steeple
#
exports.run = async (bot, msg) => {
  // command code
}

exports.settings = {
  aliases: [],
  disabled: false,
  owner: false,
  nsfw: false
}

exports.info = {
  name: "command",
  desc: "The description",
  usage: "how u use the command"
}
#

this is how mine looks like

zealous veldt
#

and like no mods lol

latent heron
#

yeah

#

fuck its gonna suck

#

ugh

#

well im gonna work on my bots then i guess

zealous veldt
#

my help listing for help is next level

latent heron
#

i wanna try out how to do reaction help commands

#

like pages

zealous veldt
latent heron
#

i have an idea of how you do this in python

zealous veldt
#

I need to really learn how to use collectors

latent heron
#

requires probably associate arrays on many levels and defining for events

inner jewel
#

since we're sharing command handlers ```scala
object CommandName {
permission = ...
category = ...

override def process(implicit c: Context): Unit = {
    ...
}

}```

zealous veldt
#

lol

knotty steeple
#

lol

zealous veldt
knotty steeple
#

holy shit

zealous veldt
#

?

latent heron
#

sec, got idea

knotty steeple
#

i cant squint to look at that

wide ruin
#

@viscid falcon it's just going to send the word ping in that example, not run the file

zealous veldt
#

good

#

you're not supposed to

inner jewel
#

for pagination i used a listener and a small state machine

viscid falcon
#

k

knotty steeple
#

lol

zealous veldt
#

its big because it makes a few rethink calls and stuff

viscid falcon
#

i really cant be much help, i dont even know how it works myself, i just followed a guide

knotty steeple
#

i create a reaction collector then when someone clicks on a reaction i edit the messages and my command array gets sliced

#

how mine works mmLol

#

slice command array then join by line breaks

zealous veldt
#

hmm

inner jewel
#

paginator is just a small helper ```scala
trait Paginator[T] {
def renderPage(page: T, message: Message): Unit

def send(channel: MessageChannel, page: T): RestAction[Message]

}```

zealous veldt
#

imma try to extend the message object

#

wish me luck

knotty steeple
#

good luck

#

how tf are you even gonna do that

zealous veldt
knotty steeple
#

Discord.Message ๐Ÿค”

zealous veldt
#

yeah

#

it should be that

outer niche
#

My developers drop out and put my bot offline I need help

shy verge
#

well ok

#

first of all why did they drop out

outer niche
#

@shy verge I do not know

shy verge
#

also you should just be able to log into whatever your hosting solution is and restart the bot

west raptor
#

^

outer niche
#

?

shy verge
#

log into the computer running the bot and restart it

outer niche
#

Oo ok

knotty steeple
#

what does next() do on node.js

shy verge
#

tells you to stop using node.js

knotty steeple
shy verge
outer niche
#

We don't use that

zealous veldt
#

That's part of generator functions right?

knotty steeple
#

idk

zealous veldt
#

I've used it in middleware in express

knotty steeple
#

what does it do

outer niche
#

Well gtg find a new dev

zealous veldt
#

um

#

how about develop yourself lmao

shy verge
#

@outer niche do you at least have the source code for the bot?

outer niche
#

@zealous veldt cant

zealous veldt
#

why?

outer niche
#

My PC can't run it

west raptor
#

what

zealous veldt
#

run what?

outer niche
#

Code

west raptor
#

it can

zealous veldt
#

lmao

#

yes it can

#

if it can run discord it can run code

shy verge
#

how the fuck is your PC unable to run a console application

outer niche
#

It is to old

inner jewel
#

next() isn't a node thing

zealous veldt
#

its running fucking electron

inner jewel
#

it's an express thing

zealous veldt
#

it'll be fine

inner jewel
#

it calls the next middleware

west raptor
#

ok

#

ok

#

first

#

any computer can run code

#

ok

outer niche
#

Nop

west raptor
#

bet

shy verge
#

bet

zealous veldt
#

its running discord

inner jewel
#

discord has node internally

zealous veldt
#

which is heavier than any bot that you'd be making

inner jewel
#

if it runs discord it runs node

outer niche
#

No it duz not

loud salmon
#

what lang

zealous veldt
#

ffs

shy verge
#

๐Ÿ‘

west raptor
#

oml

shy verge
#

well yeah what language are you using

outer niche
#

Hold on

shy verge
#

hmmm

west raptor
#

alright, can you download a code editor? that's what is going to edit the code within the files

shy verge
#

ok python is mega lightweight just install python and pip whatever library you're using

outer niche
#

@west raptor the computer is crap and I can't download crap

west raptor
#

.

inner jewel
#

if you can't download anything, you can't make/work on a bot

zealous veldt
#

or use nano or something

shy verge
#

how did you download discord then lol

zealous veldt
#

but if you can run discord you can run vscode

uncut slate
#

web client MmmYea

shy verge
#

also all thing considered they're on windows not linux

#

so nano isn't an option

zealous veldt
#

btw, nobody is going to make your bot for you just because you cant code "because of your computer"

outer niche
#

I run Discord off of a phone

west raptor
#

what

zealous veldt
#

ffs

west raptor
#

u just said

#

you are on pc

knotty steeple
#

has a pc

zealous veldt
#

why do you want a bot if you can't even make it yourself?

knotty steeple
#

but uses discord on phone

inner jewel
#

you could run python/node on a phone

shy verge
#

though if you ask us to code for you we will happily whip up a forkbomb script for you

knotty steeple
#

you can?

inner jewel
#

but your bot wouldn't stay online

#

after locking the phone

#

yes

outer niche
#

Look I can't download crap on that computer and I don't get another one for another 3 years and all my developers dropped out and all I'm asking for is help

inner jewel
#

node and python can run on arm

west raptor
#

ok look

#

how old

#

is your computer

inner jewel
#

no one is going to write your bot for you because you can't do it

outer niche
#

I don't know but none of y'all are helping me anymore so I'm out

prime cliff
#

Pretty sure any old computer can run a bot GWmythicalThonkCool

west raptor
#

WHAT

shy verge
#

we're asking you simple questions to help you lol

zealous veldt
#

I could run my bot off my phone if I wanted

#

infact

#

ima do it

#

sec

shy verge
#

bet

zealous veldt
#

actualy i need to fix something first

west raptor
#

if its js

#

yea

zealous veldt
#

but i can

#

termux is amazing

knotty steeple
#

im sure

inner jewel
#

brb building openjdk for x86

knotty steeple
#

if i had a 2GB pc

#

it could run a bot

zealous veldt
#

I have a 6gb ram phone

#

lmao natan

west raptor
#

ok

outer niche
#

Look the computer is trash it barely runs I can't use the thing for anything more than wise download a coding program and the person that was developing for me reset my bot put it offline and now I don't have access to redo it

inner jewel
#

mine's 4gb

knotty steeple
#

i dont have a phone

#

@outer niche how much ram

zealous veldt
#

oof

west raptor
#

can you launch notepad atleast

outer niche
#

@knotty steeple I do not know

prime cliff
#

If your computer is that slow sounds like you have a virus or something causing it to break ๐Ÿค”

shy verge
#

ok here's the million dollar question

zealous veldt
#

yeah

shy verge
#

how old are you

outer niche
#

Does it matter how old I am

shy verge
#

kinda

zealous veldt
#

i think you mean 12 dollar question @shy verge

west raptor
#

^

outer niche
#

Yeah I'm not going to tell random strangers how old I am

zealous veldt
#

his wage is $1/year

shy verge
#

dude we're not asking for your location

#

just your age

#

We don't even know who you are lol

zealous veldt
#

lmao like knowing how you are would do anything bad

outer niche
#

I don't know about that question I just don't like telling people how old I am

prime cliff
#

How come?

shy verge
#

lamo chill he's not gonna tell us

outer niche
#

I don't know any of you

west raptor
#

we cant track down

#

and none of us would if we could

outer niche
#

21

west raptor
#

.

shy verge
#

k

knotty steeple
#

Windows Key > Search Bar > System Information

prime cliff
#

@outer niche mkay how about this try use your computer and create a new user account and see if that lags

shy verge
#

that wasn't so hard was it

knotty steeple
shy verge
#

ok best course of action is to install Ubuntu server if your computer is really as potato as you say it is

prime cliff
#

Asking new users to install ubuntu pls

outer niche
#

Alright people need me now

#

Bye

shy verge
#

ok

zealous veldt
#

4gb is enough to run a bot

west raptor
#

ok

zealous veldt
#

and vs code

prime cliff
#

๐Ÿ‘‹

knotty steeple
#

i run tons of stuff on my laptop

zealous veldt
#

i could host my bot on my 3gb phone

knotty steeple
#

maybe its using like 80% of memory right now because of torch

zealous veldt
#

or my 6gb phone

#

or my 2gb phone

prime cliff
#

My laptop isnt expensive but atleast i can run Rocket League with medium graphics :/

knotty steeple
#

yep

prime cliff
#

Good enough for me

knotty steeple
#

~88%

sand torrent
#

hi

#

anyone here?

knotty steeple
#

just say what you need

tulip snow
#

How to install python?

knotty steeple
west raptor
#

@sand torrent what's the issue?

sand torrent
#

i wanna create a bot

loud salmon
#

you literally just pm'ed me that Thonk

west raptor
#

well

sand torrent
#

but u never helped me all u did was send a video

west raptor
#

do you know any programming languages?

sand torrent
#

ya

west raptor
#

what do you know?

sand torrent
#

visual studio c++

west raptor
#

.

#

ok

#

uh

gilded blaze
#

Although C++ libs arenโ€™t updated like the other more popular ones

tulip snow
#

I would suggest JavaScript or Python

inner jewel
tulip snow
#

Can somone help me with this?

Traceback (most recent call last):
  File "index.py", line 3, in <module>
    from discord.ext.commands import HelpFormatter
ModuleNotFoundError: No module named 'discord'
bright spear
#

not sure but it looks like you dont have discord.py installed?

zealous veldt
#

oh hai advaith

tulip snow
#

Whats a simple language I can use to code a bot (besides JS) || Tag Me

west raptor
#

oof

#

i was gonna say js

tulip snow
#

I already have a js bot

long forge
#

in js does:

${client.users.size}```
show you only the users online? Or the total users?
tulip snow
#

Online I belive

long forge
#

huh. ok

#

Does it also include bot users?

tulip snow
#

I think

west raptor
#

nope, it shows all

#

you can filter it tho i think

frigid bone
#

Most likely cached users

#

So not all

west raptor
#
${(this).client.users.filter(u => u.presence.status === 'online').size}
``` i *think* this would work
#

correct me if im wrong

gilded blaze
#

Yes users are cached users

#

If you want to get total you can loop through the guilds members

frigid bone
#

^

#

Don't forget to fetch guild members to update cache, though that shouldn't be necessary if you need to list online users only

blazing elbow
#

Ello

tulip snow
#

What do you type in terminal to start a LUA bot?

knotty steeple
#

do you even know lua

tulip snow
#

nope

#

Im just gonna test out the language for a couple of days

knotty steeple
#

why are you making a bot in lua but you dont know it GWqlabsNotLikeNoot

tulip snow
#

Im gonna learn it XD

#

Just not yet

knotty steeple
#

well learn how to run a lua file

west raptor
#

lua is cool, and yea, learn lua and learn how to run a file

#

run a lua file

#

god

#

my wording is bad

frigid bone
#

probably lua entry_point.lua

#

Assuming you have Lua installed

zealous veldt
#

hey could I get some with extending Discord.js's Message object in javascript

#

I want to add some extra information to it

#

though I can't seem to get it to also have the actual message objects data (channel, author, content, etc.)

#

I have successfully extended the Client object ```js
class MooseClient extends Client {

constructor(options) {
    super(options);

    this.playermanager = null;
    this.logger = log;
    this.dev = null;
    this.config = null;
    this.hastebin = hastebin;
    this.r = r;
    this.once("ready", this._ready.bind(this));

}

_ready() {
    this.playermanager = new PlayerManager(this, nodes, {
        user: this.user.id,
        shards: 1
    });
    log.info(`Lavaplayer Ready`);

    if (fs.existsSync('./development')) {
        this.dev = true;
    } else {
        this.dev = false;
    }
    this.config = Config;
}

}```

#

and that works fine and I'm able to access the playermanager, etc. from the client object

#

though my message class just has the params that I set

gilded blaze
#

Do you use super()?

zealous veldt
#

yes

#
class MooseMessage extends Discord.Message {
    constructor(msg) {
        super(msg);

        this.isMoosage = true;
        this.hello = 'world';
   }
}```
#

though when I try to use that i get things as undefined

#

shit

gilded blaze
#

Well you need to know how the Message class works. The constructor accepts client, data, and channel.

zealous veldt
#

so I should have it like this? js constructor(channel, data, client) { ... }

#

do I need to manually set all of the properties D.js sets?

tulip snow
#

How do you install things on lua like on javascript its like npm i (package)

gilded blaze
#

When you do super() pass the client, data which contains content and id and other stuff, and the channel object

zealous veldt
#

@tulip snow yes

#

ok

tulip snow
#

Is it the same for lua?

zealous veldt
#

o

#

um

#

dont know lua stuff

tulip snow
#

same

gilded blaze
#

No

#

NPM is built for js

#

Search for a dependency manager for Lua

shy verge
knotty steeple
#

no he was just putting an example GWslippyPeepoS

shy verge
#

you're welcome

zealous veldt
gilded blaze
#

Yes. If you want to access the data.

zealous veldt
#

ok

gilded blaze
#

You only have to define the data you want, but I recommend setting all of it

zealous veldt
#

alright, thanks so much ๐Ÿ˜ƒ

gilded blaze
#

๐Ÿ‘

tulip snow
#
PS C:\Users\username\desktop\Bot> lua bot.lua
C:\Program Files (x86)\Lua\5.1\lua.exe: bot.lua:1: module 'discordia' not found:
        no field package.preload['discordia']
        no file '.\discordia.lua'
        no file 'C:\Program Files (x86)\Lua\5.1\lua\discordia.lua'
        no file 'C:\Program Files (x86)\Lua\5.1\lua\discordia\init.lua'
        no file 'C:\Program Files (x86)\Lua\5.1\discordia.lua'
        no file 'C:\Program Files (x86)\Lua\5.1\discordia\init.lua'
        no file 'C:\Program Files (x86)\Lua\5.1\lua\discordia.luac'
        no file '.\discordia.dll'
        no file 'C:\Program Files (x86)\Lua\5.1\discordia.dll'
        no file 'C:\Program Files (x86)\Lua\5.1\loadall.dll'
        no file 'C:\Program Files (x86)\Lua\5.1\clibs\discordia.dll'
        no file 'C:\Program Files (x86)\Lua\5.1\clibs\loadall.dll'
        no file '.\discordia51.dll'
        no file 'C:\Program Files (x86)\Lua\5.1\discordia51.dll'
        no file 'C:\Program Files (x86)\Lua\5.1\clibs\discordia51.dll'
stack traceback:
        [C]: in function 'require'
        bot.lua:1: in main chunk
        [C]: ?
knotty steeple
#

lit install SinisterRectus/discordia

shy verge
#

lit

viscid falcon
#

this chat is lit

tulip snow
#

cringe

viscid falcon
#

no u

tulip snow
#

I cant get it im just gonna go back to JavaScript ๐Ÿ˜ƒ

knotty steeple
#

did you actually try to learn lua?

tulip snow
#

No but I cant figure out how to install packages it was saying discordia not found or somthing

knotty steeple
tulip snow
#

I did that and it didnt work

wicked summit
inner jewel
#

msg.guild.id === 'id1' || msg.guild.id === 'id2'

wicked summit
#

Like that?

#

Okey

night imp
#

|| means or in an if statement

#

so you can put multiple parameters

#

if(this || or_this) then

#

&& means both have to be true

wicked summit
#

@inner jewel

night imp
#

if(this && this_too) then

wicked summit
#

Can you unmute my bot

#

I will test it

inner jewel
#

is it fixed?

wicked summit
#

Idk i will test it

latent heron
#

test it on another server first before telling them to unmute

wicked summit
#

In here

latent heron
#

if they unmute they're assuming it has been fixed already

wicked summit
#

Thats fixed

strange maple
#

idk how to get bot... sry i new

shy rose
#

most bots have invites if thats what your after

#

most are like @someBot invite and get there link

bright spear
#

if the bot is on discordbots.org just press the big invite button on the bot page

shy rose
#

see i left mine neutral lol

earnest phoenix
#

does anyone know how to use custom fonts in canvas ?

#

discord.js

sick cloud
#

anyone got experience with wit.ai? i keep getting this error:

    at validate (/home/tony/Bots/Aurora/node_modules/node-wit/lib/wit.js:88:11)
    at new Wit (/home/tony/Bots/Aurora/node_modules/node-wit/lib/wit.js:20:45)
    at Object.<anonymous> (/home/tony/Bots/Aurora/app.js:9:13)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
[tony@server Aurora]$ ```
earnest phoenix
#

I was wondering, is it okay to take some custom emojis from here?

#

i really like the tick yes and nos

earnest phoenix
#

ask some staff because there might be copyright issues in "taking" them

#

but im sure you can use them in your bot

#

i mean taking it for my bot yeah ๐Ÿ˜ฎ

elfin salmon
#

how do i start making bots

lament meteor
#

@sick cloud did u set an auth?

sick cloud
#

i got it, nvm

lament meteor
#

ok ๐Ÿ‘ hope it works as u wanted it to be

wide ruin
#

How can you make a bot add a channel when it join a new server?

#

Discord.js

frigid bone
#

You mean create a channel? You need to listen to the 'guildCreate' event, which is fired when the bot joins a new guild

lament meteor
#

createChannel() thingy

cobalt swan
#

Looking for a developer who can help me with embed messages to group people who types a 3 digit code for example, pm me for more please.

quartz kindle
#

if you want more help, post here. we're not gonna dm you

cobalt swan
#

Sure

quartz kindle
#

you want to know how to listen for the 3 digit code?

#

can anyone type it or only the person who used the command?

cobalt swan
#

Everyone can type it as soon the countdown has started, depends on their last 3 digits of their server id, so basically they match together with the same ID

#

Same goes for anyone else

#

It must be a 3 digit code with only numbers and letters in it

earnest phoenix
#

what language are you using?

#

and what lib?

cobalt swan
#

It will ignore any message if it's not 3 digits, so ignore 1, 2, 4, 5 digits etc...

#

Im using dbm

earnest phoenix
#

oh my god

cobalt swan
#

?