#development

1 messages ยท Page 795 of 1

astral yoke
#

This is my index.js.

#

.

#

.

#

.

#

require("./error"); //this file checks that all modules are installed, etc.
const logger = require("../utils/logger"); //better console logging
const { Client, Collection } = require("discord.js");
const bot = new Client(); //creates the Discord Client
const data = require("./loaders/reader"); //this returns data user entered in botconfig file
const fs = require("fs");
const mysql = require("mysql");

["aliases", "commands"].forEach(x => bot[x] = new Collection()); //bot.aliases, bot.commands = Discord Collections
["console", "command", "event"].forEach(x => require(../handlers/${x})(bot)); //run all of these files with param bot

logger.log("Successfully loaded other files.");
bot.login(data.token); //login with the bot token defined in botconfig file

var con = mysql.createConnection({
host: "localhost",
user: "root",
password: "HIDDENPASSWORD",
database: "sadb"
});

con.connect(err => {
if(err) throw err;
console.log("Connected to database!");
con.query("SHOW TABLES", console.log);
});

let cmd = bot.commands.get(command.slice(prefix.length));
if(cmd) cmd.run(bot, message, args, con);

function generateXp() {
let min =20;
let max = 30;
return Math.floor(Math.random() * (max - min + 1)) + min;
}

con.query(SELECT * FROM xp WHERE id = '${message.author.id}', (err, rows) => {
if(err) throw err;
console.log(rows);
});

#

(password is not the actual password)

digital ibex
#

hi, i'm setting up a host for a friend and i'm getting this error, anyone know what it means?

amber fractal
astral yoke
#

Most likely invalid token.^

#

@amber fractal Are you able to help me?

amber fractal
#

We'll see

#

Yeah you never defined command on line 28 you do command.slice but never define it

astral yoke
#

How do I define it?

amber fractal
#

well it seems like your command handler is like most, so you should just split the message content (I would toLowerCase() it first to make your commands case-insensitive) then define command as the first part of the split array

digital ibex
amber fractal
#

I literally told you

astral yoke
#

You already sent that and already got a response.

amber fractal
earnest phoenix
#

im doing a dashboard

#

and i get all icons of my servers what im in

#

and i found this

#

is a gif

grizzled raven
#

no its a png

ocean frigate
#

What is the ratelimit of message editing in discord for bots?

earnest phoenix
#

@astral yoke a tip so ppl can read your code a lil easier

#

has syntax highlighting and a monospace font

#
var a = 0
for (a = 0; a <= 1; a++)
 yeet();

manic furnace
#

Hi, how to add colors in bots page in top.gg?

ocean frigate
#

@manic furnace use ```html
<style>...</style>

manic furnace
#

Ok

#

I cant understand hehe

earnest phoenix
manic furnace
#

Where do i put in?

#

The code

tidal parrot
#

In the box

manic furnace
#

Description?

marble juniper
#

where else

#

ofc the desctiption

ocean frigate
#

What is the ratelimit of message editing in discord for bots?

earnest phoenix
#

idk

#

i'm sure it's on the dev docs

#

nope.

marble juniper
#

@ocean frigate every 5 seconds is the limit

ocean frigate
#

edit a message every five seconds?

marble juniper
#

but it would be better if you do it every 7 seconds

#

also yes editing

ocean frigate
#

hmm

#

I would have crossed the limit

#

thank god i asked it

exotic prism
#

(node:23) DeprecationWarning: ClientUser#setGame: use ClientUser#setActivity instead
am i required to change this? i think it is a same thing

earnest phoenix
#

no

#

it snot

#

its not

#

setgame was before discord had "watching" and "streaming" statuses

#

you arent required to change it

#

but it's highly recommended

exotic prism
#

oh thanks

sudden geyser
#

@exotic prism you should

#

not required, yet.

cold canyon
#

Does anyone know any free hosting services other than heroku and openshift that supports python

ionic bison
#

glitch does, but that's still shit-

cold canyon
#

Does it save data on the disk that the script generates

exotic prism
#

uhh i think it glitch but im not sure

cold canyon
#

Welp ima try glitch

marble juniper
#

I don't think glitch even supports python

#

because all that glitch is meant for is web pages

#

and it only has node.js

#

and Supports only javascript

#

as far as I know

earnest phoenix
#

wdym?

#

you're not meant to host a discord bot there anyways

marble juniper
#

yes

#

its not meant as a vps

#

its for hosting your website

#

I don't see why people complain about that glitch sucks for discord bots when you are not even supposed to put discord bots on it

earnest phoenix
#

glitch is good for small bots like mine

#

glitch?

#

yES

#

i dont like it

#

its very powerful if you have a small bot

#

i got very low ping on glitch

#

i just host mine on my raspberry pi

#

i dont have raspberyy pi

#

so rip

#

the ping like just now is: 0.109338 Sec/s

#

?

#

i dont understand that format

#

wdym?

modest maple
#

That's 100ms

earnest phoenix
#

ok

#

my ping with glitch is 6-100 ms

#

glitch isn't powerful at all lmao

#

having good latency isn't equivalent to server power

#

it just means it's hosted closer to NYC (where discord api servers are located at)

#

oK

quartz kindle
#

0.109338 seconds per second

little cape
#

Hello, I have a question, how do you get emojis custum in your bot? because i can't... :/
if someone can show me an example ! Thank You

zenith orchid
#

bot.emojis.get("ID")

earnest phoenix
#

@zenith orchid how da paper we get emoji id

lilac wharf
earnest phoenix
#

:\

zenith orchid
#

Or find

#

bot.emojis.find(a => a.name == "exampleEmoji") for v12 d.js

earnest phoenix
#

i use latest stable

zenith orchid
#

I think v11 => bot.emojis.find("name", "exampleEmoji")

earnest phoenix
#

tHaNk YoU

zenith orchid
#

Np

earnest phoenix
#

No, this method is deprecated

#

Find with a function, even in v11

#

how to disable

#

this

#

?

knotty steeple
#

is your bot a clone

earnest phoenix
#

no

#

is at my friend

knotty steeple
#

is that your bot

#

because if you cant disable your own responses you have a problem

little cape
#

like that ?

   
   message.channel.send(`${test}`);``` @zenith orchid
quartz kindle
#

that version of .find is deprecated, you should use it with a function instead

#

like ping showed for v12, its the recommended way for v11 as well

little cape
#

im in v11 discord.js

marble juniper
#

do it like this

client.emojis.find(emoji => emoji.name == 'name here')
knotty steeple
#

always use a function

#

find.find

#

yes

marble juniper
#

or if you just want to get the emoji by id you use get

quartz kindle
#

.find.find

#

lul

marble juniper
#

bruh

#

find.find

#

(edited)

#

or well as I said you can use get instead if you want to search by id

#
client.emojis.get("id")
earnest phoenix
#

-bots

gilded plankBOT
marble juniper
zenith orchid
#

@little capeno

little cape
#

hmm, can someone give me an example with an emoji please :/

#

with client.emojis.find and message.channel.send

zenith orchid
#
message.channel.send(`<:${emoji.name}:${emoji.id}>`)```
#

@little cape try

#

but idk for v11.

#

Maybe not work.

hoary elm
#

That works for 11 to if you use the old method you get a depreciation warning

little cape
#

im in discord.js v11.5.1,
I tried but I have the following error : cannot read property 'name" of null

marble juniper
#

then it wasn't able to find the emoji

little cape
#

I tried with another emoji but I have the same problem

marble juniper
#

is the bot inside the server with the emoji

little cape
#

oh yes okey, it is not possible to use emojis from other server ?

marble juniper
#

you bot must be inside the server with the emoji you are trying to search

little cape
marble juniper
#

you're bot can also use emojis from other servers he is in

#

and use it in a different server

#

just make sure the bot is inside the server with the emojis you are trying to use

#

and make sure the id is correct or the name is correct

little cape
#

Oh okay perfect thank you so much for your explanation ! i get it ! Thank you so much @zenith orchid @marble juniper

earnest phoenix
#

.

modest maple
#

no dot post ty

marble juniper
#

@ Website Administrators

modest maple
#

hmm

knotty steeple
#

@little cape dont spoonfeed

earnest phoenix
#

who can give a commands to copy and paste on python

modest maple
#

no one because thats not how this server works

earnest phoenix
#

ehhh

blissful scaffold
#

We don't give usable code and commands, we do help if you already have code that isn't working

earnest phoenix
#

how do you get the last votes? I can't find it in the documentation

modest maple
#

what lib

modest maple
earnest phoenix
#

js

modest maple
summer torrent
#

dbl.getVotes() @earnest phoenix

earnest phoenix
#

invalid syntax

slender thistle
#

away or await

modest maple
#

also wrong version of d.py

earnest phoenix
#

no

slender thistle
#

Why is there more than one _time command

earnest phoenix
#

bot it's red

modest maple
#

no its defo the wrong version of d.py

#

you are massivley out of date

slender thistle
#

Just let it be

#

Are they really using rewrite instead of asynv

modest maple
#

other way shiv

#

xD

earnest phoenix
#

my version of .py is 3.6.0

modest maple
#

thats python

slender thistle
modest maple
#

bot.say is like the OG version isnt it

#

that was even before async branch

slender thistle
#

it exists in 0.16.12

modest maple
#

OG async

#

lmao

slender thistle
#

I don't speak d.py version lower than 1.0

earnest phoenix
#

ok

#

as I showed it, parts were copied from the net and parts were made by myself

modest maple
#

we noticed

#

going of the fact that 99% of that code is wrong

surreal sage
#
if(command === "start") {
    const time = args[0]
    const ms2 = ms(time)
    var milli = parseInt(ms2, 10)
    const embed = new Discord.RichEmbed()
    .setTitle("Countdown")
    message.channel.send(embed).then(e => {
          setInterval(() => {
            const embed = new Discord.RichEmbed()
    .setTitle(`Countdown - ${milli - 1000}`)
    e.edit(embed)
    }, 1000)
    })
  }

i have this, i want it to countdown but i think it just does -1000 at

#

and not updates the early variable

#

i want it to update the variable to -1000

quartz kindle
#

code blocks pls

surreal sage
#

wdym

quartz kindle
#

``` code here ```

earnest phoenix
#

avoid editing every second

#

you're going to get ratelimited

surreal sage
#

ok ut just tell

plain wyvern
#

hey guys, can any of you help me i'm having trouble pulling votes in python

earnest phoenix
#

hey and this invalid syntax is what should I do with it

quartz kindle
#

@plain wyvern did you check shivaco's answer?

#

it should be webhook_auth not Authorization

earnest phoenix
#

thi is invalid sytax

quartz kindle
#

yes, away doesnt exist

hoary elm
#

@earnest phoenix away isnt it supposed to be await?

modest maple
#

yes

plain wyvern
#

what ?

earnest phoenix
#

I took from the net

modest maple
#

@earnest phoenix EXACTLY SO DONT COPY AND PASTE

hoary elm
#

๐Ÿคฆ๐Ÿปโ€โ™‚๏ธ

plain wyvern
#

I saw it, but I took the data from my bot

earnest phoenix
#

and only this syntax I want to fix

plain wyvern
quartz kindle
#

@earnest phoenix the syntax error is because away doesnt exist, it should be await

modest maple
#

your code is one of the worst bits of code i have ever seen @earnest phoenix

  • You use bot even tho you use client
  • you use two run statments which then block all your code
  • you dont await ur using away which doesnt exist
  • you are on a nearly 2 year out of date lib and trying to run it with a modern version
  • And youve leaked your token
#

This is why you dont copy and paste code without knowing how to code python or any other language first

hoary elm
#

all reasons why copy pasting is a bad idea...

  1. you never know how old the code you are copying is.
modest maple
#

not even that like

#

theyre copying the code from several versions

#

and just good god

#

it is horrific

hoary elm
#

lol, to some people i guess just following some up to date guides is to hard ๐Ÿคทโ€โ™‚๏ธ

earnest phoenix
#

I love waking up and immediately seeing this kind of thing right away lol

quartz kindle
#

@earnest phoenix if you didnt understand what cf8 said about your token, this is your bot token:

#

if people have this, they can easily hack your bot

#

go to your discordapp bot page and reset your token

earnest phoenix
#

ok

solemn quartz
#

lol

visual sandal
#

How dangerous is it to keep my token in my code.. cause there is only 1 other person that has access to my code.

#

Still a dumb thing to do?

earnest phoenix
#

yes

twilit rapids
#

If you can smash that persons ass if they abuse it irl then you're fine

#

Else I wouldn't recommend it

earnest phoenix
#

well ye lol

visual sandal
#

lmao

prime cliff
#

If you can smash that persons ass if they abuse it irl then you're fine
Timo 2020 guys ๐Ÿ‘ ๐Ÿ‘

bitter sundial
#

anyone ever sent a webhook with an attachment without a library lul

prime cliff
twilit rapids
#

Same for me

prime cliff
#

Oh god every message you send

twilit rapids
#

Is it

#

Oh yes it is

summer torrent
#

test

#

same

gusty tartan
#

test

#

nope nothing

summer torrent
#

kicked

slender thistle
#

It responded if you have f in your message

gusty tartan
#

always late sad

#

bad prefix management ig

#

oh wait it's french what was i expecting

sudden geyser
#

engrish

bitter sundial
surreal sage
#
if(command === "timer") {
    try {
    const time = args[0]
    if(!time) return message.reply("Specify a time to set the timer!");
      const ms2 = ms(time)
      var milli = parseInt(ms2, 10)
      message.delete()
    const timerEmbed = new Discord.RichEmbed()
    .setTitle("Timer")
    .setDescription("I will notify you when this timer has ended.")
    .setFooter(`${message.author.username}`)
    .setColor("#ff8c00")
    message.channel.send(timerEmbed).then(msg => {
      ////////////////////
      setInterval(() => {
        if(ms2 === 0) { //
          clearInterval()
        const embed = new Discord.RichEmbed()
        .setTitle("Timer")
        .setDescription("Timer has Ended")
        .setColor("#ff8c00")
                msg.edit(embed)
      message.channel.send(`${message.author}, Timer ended.`).then(m => {
        setTimeout(() => {
          m.delete()
        }, 50);
      })
        }//
        //
        const tim = new Discord.RichEmbed()
    .setTitle(`Timer - ${nice(milli = Math.floor(milli - 1000))}`)
    .setDescription("I will notify you when this timer has ended.")
    .setFooter(`${message.author.username}`)
    .setColor("#ff8c00")
        msg.edit(tim)
    }, 1010)
    })
  } catch (error) {
    message.reply("There was a error.")
  }
  }```

it doesn't update the embed when it is at 0
#

tim is a embed :)

#

oh wait

#
if(command === "timer") {
    try {
    const time = args[0]
    if(!time) return message.reply("Specify a time to set the timer!");
      const ms2 = ms(time)
      var milli = parseInt(ms2, 10)
      message.delete()
    const timerEmbed = new Discord.RichEmbed()
    .setTitle("Timer")
    .setDescription("I will notify you when this timer has ended.")
    .setFooter(`${message.author.username}`)
    .setColor("#ff8c00")
    message.channel.send(timerEmbed).then(msg => {
      ////////////////////
      setInterval(() => {
        if(milli === 0) { //
          clearInterval()
        const embed = new Discord.RichEmbed()
        .setTitle("Timer")
        .setDescription("Timer has Ended")
        .setColor("#ff8c00")
                msg.edit(embed)
      message.channel.send(`${message.author}, Timer ended.`).then(m => {
        setTimeout(() => {
          m.delete()
        }, 50);
      })
        }//
        //
        const tim = new Discord.RichEmbed()
    .setTitle(`Timer - ${nice(milli = Math.floor(milli - 1000))}`)
    .setDescription("I will notify you when this timer has ended.")
    .setFooter(`${message.author.username}`)
    .setColor("#ff8c00")
        msg.edit(tim)
    }, 1010)
    })
  } catch (error) {
    message.reply("There was a error.")
  }
  }```
#

what do i need to do to fix this

earnest phoenix
#

you need defined nice

surreal sage
#

it is

#

its just not in this script block

earnest phoenix
#

Hello. It is possible to make legal RGB?

surreal sage
#

wut

earnest phoenix
#

i mean

#

i need the code of giveaway

#

rainbow role but legal

summer torrent
#

@earnest phoenix code it?

earnest phoenix
#

legal lol

#

yes

summer torrent
#

@earnest phoenix rainbow role is against to tos

earnest phoenix
#

there's no legal and illegal - you aren't breaking the law lol

surreal sage
#

i still need help

earnest phoenix
#

@summer torrent the code , that is command of giveaway

summer torrent
#

@earnest phoenix so?

earnest phoenix
#

i need the command

#

my english is shit so

summer torrent
#

we don't give you a code

earnest phoenix
#

i dont know make this code

surreal sage
#

hello?

pale vessel
#

learn

summer torrent
#

learn

pale vessel
#

nice

surreal sage
#

HELLO

earnest phoenix
#

yeah i learn English

pale vessel
#

not you

summer torrent
#

@earnest phoenix rainbow role is api abuse

surreal sage
#

HELLOOO???

earnest phoenix
#

ok

surreal sage
#

i need help

summer torrent
#

@surreal sage ask

surreal sage
#
if(command === "timer") {
    try {
    const time = args[0]
    if(!time) return message.reply("Specify a time to set the timer!");
      const ms2 = ms(time)
      var milli = parseInt(ms2, 10)
      message.delete()
    const timerEmbed = new Discord.RichEmbed()
    .setTitle("Timer")
    .setDescription("I will notify you when this timer has ended.")
    .setFooter(`${message.author.username}`)
    .setColor("#ff8c00")
    message.channel.send(timerEmbed).then(msg => {
      ////////////////////
      setInterval(() => {
        if(milli === 0) { //
          clearInterval()
        const embed = new Discord.RichEmbed()
        .setTitle("Timer")
        .setDescription("Timer has Ended")
        .setColor("#ff8c00")
                msg.edit(embed)
      message.channel.send(`${message.author}, Timer ended.`).then(m => {
        setTimeout(() => {
          m.delete()
        }, 50);
      })
        }//
        //
        const tim = new Discord.RichEmbed()
    .setTitle(`Timer - ${nice(milli = Math.floor(milli - 1000))}`)
    .setDescription("I will notify you when this timer has ended.")
    .setFooter(`${message.author.username}`)
    .setColor("#ff8c00")
        msg.edit(tim)
    }, 1010)
    })
  } catch (error) {
    message.reply("There was a error.")
  }
  }``` It doesnt react at 0
earnest phoenix
#

have you tried debugging

surreal sage
#

or how

#

does not work

#

there is no error btw

earnest phoenix
#

Yes, but as far as I know it is possible to do Rainbow Role, which doesn't abuse the Discord API.

surreal sage
#

its just incorrect

earnest phoenix
#

have you tried debugging though

surreal sage
#

y

summer torrent
#

@earnest phoenix no

quartz kindle
#

that code is very wrong @surreal sage

earnest phoenix
#

because... that's how you identify the problem

surreal sage
#

there is no error

quartz kindle
#

a setInterval() will always run forever

surreal sage
#

how to clear it

quartz kindle
#

if you start an interval it will never stop

#

like this

#
let interval = setInterval(...)
clearInterval(interval)```
surreal sage
#

ah okkkk

quartz kindle
#

also, you cannot edit a message on a interval of 50ms

#

you are only allowed to send/edit messages 5 times in 5 seconds

surreal sage
#

yes

#

1 second a change

#

btw

earnest phoenix
#

Even if the color of the role is changed every 2 minutes, is it still an abuse of Discord's API?

surreal sage
#

that 50ms is for message delete

#

@earnest phoenix nup

earnest phoenix
#

so rainbow role with color change every 2 minutes is legal lol

#

i still cant get over using legal and illegal you got me wheezing

#

at that point it isn't even a rainbow role

pale vessel
#

it's the legalized version, which is very scuffed

quartz kindle
#

why cant people format and indent their codes correctly smh

earnest phoenix
#

because they're using vim to write code ๐Ÿ™ƒ

summer torrent
#

@earnest phoenix pls stop asking for rainbow role code

quartz kindle
#

they're using notepad

pale vessel
#

he's not asking for the code

earnest phoenix
#

Can someone help me with my bot? i coded it iin c#

#

pls dm

#

you can ask your question here

#

oh alright

#

i just joined

pale vessel
#

welcome

earnest phoenix
#

thanls

#

thanks*

#

wait

pale vessel
#

oof

earnest phoenix
#

okay so i just started

#

how do i make a purge command

summer torrent
#

use hastebin

earnest phoenix
#

sure

summer torrent
#

which lib do you use

earnest phoenix
#

first use GetMessagesAsync on a text channel, then call and await FlattenAsync on the result of GetMessagesAsync

#

after doing that you get a collection of messages you can pass to DeleteMessagesAsync on a text channel

#

note, this is my first ever day of coding so i dont understand the language rlly good

pale vessel
#

i think you should learn it first, even a little

summer torrent
#

^

earnest phoenix
#

yea kinda true

pale vessel
#

LULW

earnest phoenix
#

i just need this little line of code lmao

#

no one is going to spoonfeed you

#

im not asking you to spoonfeed me

summer torrent
#

first learn language

pale vessel
#

we're here to only give directions

earnest phoenix
#

ah

#

my b

#

i just cant figure it out

summer torrent
#

do you check docs?

earnest phoenix
#

yeah i can try that

wheat jolt
pale vessel
#

rip server

digital ibex
#

Hi, how would i set up MongoDB for my discord bot? For someone who has never used mongo

wheat jolt
#

I just made 24h uninstalling and reinstalling phpmyadmin again and editing the config.inc.php

earnest phoenix
#

so?

summer torrent
#

@digital ibex there is so many guide

wheat jolt
#

a bit rude @earnest phoenix

pale vessel
#

well, he's officially lost

#

so...

earnest phoenix
#

@wheat jolt haha.

digital ibex
#

And i just got confused on all of them, now i'm finally going to try again

#

can u show me a tutorial which u think is the best

earnest phoenix
#

don't follow tutorials, follow docs

#

docs are always up to date and explain how the lib works

digital ibex
#

ok

summer torrent
#

tutorial is for beginners weirdsip

digital ibex
#

mongodb is a lib?

summer torrent
digital ibex
#

ok, ty

tame ginkgo
#

How do I get the web hook shit to work so it sends s message when ever someone votes?

earnest phoenix
#

wrappers around mongo i meant

summer torrent
amber fractal
#

I would use the official mongo driver

earnest phoenix
#

you need an active webserver for the webhook to post to

amber fractal
#

Well I do mmLol

#

Never really liked mongoose

#

unnecessary middleman

digital ibex
#

where do i put this?

#

doesn't say

amber fractal
#

where you want to connect

#

Usually at the start of your main file

wheat jolt
earnest phoenix
#

you know there's more to that page than just code blocks

#

read the text that's above the fancy colored one

wheat jolt
#

.-.

pale vessel
#

that is a disturbing profile picture by the way

earnest phoenix
#

i call it

#

art

wheat jolt
#

I firstly read that text a day ago

pale vessel
#

ah yes

earnest phoenix
#

that message wasn't directed at you @wheat jolt

wheat jolt
#

Ah

earnest phoenix
#

my internet is just dying so my messages get sent out slower

#

sorry for the confusion lol

wheat jolt
#

np

tight plinth
#

how can I change the votebutton color on the website?

amber fractal
#

css

tight plinth
#

according to instect element thats how buttons are named

#

*inspect

amber fractal
#

Are you trying to change the color of the button or the text

tight plinth
#

button

amber fractal
#

color changes text color

tight plinth
#

text isnt changed

amber fractal
#

because it's being overridden most likely

tight plinth
#

and if I put bg color it's only visible on mobile, it dissapear after some frames on desk

amber fractal
#

Honestly that's the easiest fix tho lmao

tight plinth
#

(body)

amber fractal
#

well buttons in general

#

I can do just the vote button too

tight plinth
#

nothing works fuckkkkkkkkkkkkk

amber fractal
tight plinth
#

tried everything I can

#

(I suck at css)

amber fractal
#

oh

#

I see

#

you didnt use the class selector

#

it's .classname

#

you did a (idk what they're actually called) type selection

#

votebutton isnt an actual element type so try

.votebutton{
   ...
}```
tight plinth
#

and apparently preview dont work for css (or i rly suck at css wtffffffffffff)

#

*preview button

#

fuckkkkkkkkkkkkkkkkkkk

amber fractal
#

What do you have now?

#

Because it should work

#

the preview button

tight plinth
earnest phoenix
#

well yes you used color not background-color

amber fractal
#

Does the vote button not appear on non-accepted bots?

tight plinth
#

same thing for bg-color

#

yes it does

#

*doesnt

amber fractal
#

well then how do you expect to see a change on something that isnt there

tight plinth
#

wait

#

I fixd it

#

I just delete a space

#

anyway thx u guys

wicked pivot
#

how do you play a radio for the sake of a link in a voice channel? playStream("link")?

plain wyvern
modest maple
#

read the error

#

"already in use"

tight plinth
#

LEARN TO READ

#

Everyone is not Pit from kid icarus

earnest phoenix
#

need someone to spoonfeed m

#

e

modest maple
#

well then here is not the place for u

#

cya

earnest phoenix
#

open your mouth

#

here comes the airplane

#

NYOOOOOOOM ๐Ÿฅ„ โœˆ๏ธ

#

guys (im coding in c# .net core fyi) how do i make dms embedded? i know how to make the bot send dms but not how to make them embedded

surreal sage
#
          const intev = setInterval(() => {
            if(milli === 0) {
              clearInterval(intev)
              const peopleReacted = msg.reactions.get("๐ŸŽ‰").users;
                var winner = peopleReacted.random()
                        channel.send(`${winner} has won ${item}! :tada:`)
                        const finalE = new Discord.RichEmbed()
                        .setTitle("Giveaway Over")
                        .setColor("#7cfc00")
                        .setDescription(`Winner: ${winner}`)
                        msg.edit(finalE) //test
            }```
It sends the winner = message but it doesnt send the embed, How can i fixxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#

@earnest phoenix Do you know how to make a embed

earnest phoenix
#

yes i do know how to do it in the normal servers chat

surreal sage
#

then you can do in the dms

#

make the embed defind and send it in the authors dms

#

actually the same

earnest phoenix
#

await Context.User.SendMessageAsync() okay so where do i put that code lol

#

i cant figure it out

#

Can someone teach me how to make a queue command?

#

in discord.js

surreal sage
#

@earnest phoenix wdym with queue

earnest phoenix
#

:\

#

queue

surreal sage
#

what queue

#

music?

earnest phoenix
#

for my music system

#

YeS

surreal sage
#

ok idk

earnest phoenix
#

F

surreal sage
#

IDk

earnest phoenix
#

f

surreal sage
#

F
@earnest phoenix Hmm, Not bad

earnest phoenix
#

wdym

#
Can someone teach me how to make a queue command?
in discord.js```
#

that's not how edit works @surreal sage

#

the embed argument is the second argument

surreal sage
#

no i mean

earnest phoenix
#

@earnest phoenix use EmbedBuilder, once you're done building your embed you can call Build on it, the result of Build() will return an Embed which you pass to SendMessageAsync

surreal sage
#

it doesnt edit the embd

#

embed

earnest phoenix
#

example embed

surreal sage
#

wut no

earnest phoenix
#

exactly

#

it doesn't

surreal sage
#

How can i

earnest phoenix
#

because you aren't using the edit method correctly

#

i told you, the embed argument for edit is the second argument, not the first

#
Can someone teach me how to make a queue command?
in discord.js```

can someone tell me how?

#

@earnest phoenix pls explain to me in dms

#

your question is too abstract

surreal sage
#

But Can i make a var file and if the clear starts it sets it to 1 and if its becomes 1 it will executes these 2

earnest phoenix
#

no, ask your questions here

#

fine

#

what in the literal hell did you just say casual

#

[Command("help", RunMode = RunMode.Async)]
[Summary("shows all commands")]
public async Task Help()
{
var user = Context.User as SocketGuildUser;

        builder.WithTitle($"All commands are listed below");
        builder.WithFooter("Made by proper");
        builder.WithCurrentTimestamp();
        builder.AddField("!help", "!i wanna see a rainbow high in the sky\r\n!test\r\n!username\r\n!purge (amount)\r\n!testrole (testsrole)", true);
        builder.WithColor(Color.Blue);

        await ReplyAsync("", false, builder.Build());
        {
            //sending message per direct message
            await Context.User.SendMessageAsync("!i wanna see a rainbow high in the sky\r\n!test\r\n!username\r\n!purge (amount)\r\n!testrole (testsrole)");
#

okay so i have this

#

where tf do i make an embed for dms

#

ReplyAsync is just a short for SendMessageAsync

#

they have the exact same arguments

#

yea someone else told me that but i dont know what to do with this knowledge lmao

#

logically connect it

#

yea but that is my question

#

kinda

#

if you can't, you aren't cut out for programming

#

this is just... logical thinking at this point

#

hm, if their arguments are the same, then surely what i pass to the method would be the same

#

@earnest phoenix unlike you, i just started today

#

so i dont have that logical thinking yet

#

lol

#

Can someone teach me how to make a queue command?
in discord.js

#

it's not a thing you learn by programming, it's either what you have or don't have

#

the whole aspect of programming is being able to solve logical problems yourself by using... logic

#

that includes, but isn't restricted to, math problems, physics etc etc

#

dude, if it is so simple to you, pls change the code for me so i know what to do in the future

#

๐Ÿ˜ฆ

#

i'm not spoonfeeding you

modest maple
#
  1. your not gonna get spoon fed
#
  1. If Code for sending messages in DMs is THE SAME as it is for sending messages in server channels, what do you normally do for sending embeds to guild channels
earnest phoenix
#

imo, sometimes its ok to get spoonfed just so you know what to do in the future

#

so i can use it as an example

lament tusk
#

what do you do when you feel like you've a really good idea for a bot but you feel like it's too complex to code

earnest phoenix
#

have an existential crisis

lament tusk
#

me rn

earnest phoenix
#

ffs

#

im having a brain crisis

#

i have -10 iq in coding alr? lmao

modest maple
#

i think youre overthinking this xD

earnest phoenix
#

yea i am

#

reeee

#

i feel like such an idiot rn

#

but i just cant seem to figure it out ;-;

#

im losing braincells every second

#

omg

#

general rage

#

sos

#

@earnest phoenix tell me. im so dumb. im overthinking this

#

have you tried playing around

#

with your code

#

yes

#

do you have visual studio

#

yes

#

hover over ReplyAsync and then hover over SendMessageAsync

#

and see their arguments

#

do i add IUserMessage?

#

my god

#

im out

#

lmao

#

thats y i need ur help

#

your problem is that you're faceplanting into a library that requires intermediate c# knowledge

#

which you don't have

#

you don't know basic terminology

#

ok master

#

but i just need this for my owns server

#

you don't know what an argument is, do you

#

well yes

#

and

#

my god

#

i still dont understand

#

pls

#

tell

#

me

#

my dude

#

how do you keep ignoring the key word

#

the same

#

the arguments are the EXACT same

#

dude i am a beginner. you cant expect me to just change the arguments and hocus pocus

#

yes i can

#

who says i can't

#

this is basic terminology you should know

#

ok so when you started out, you knew every basic thing of c#?

#

on your first day

#

when i started out i actually started out how i was supposed to - codecademy and docs

#

and not using a library which requires you to have advanced knowledge

#

ugh i know that

#

i just need this one thing done for my server

#

i can't help you more than keep telling you in 5 different ways that the arguments are the exact same and what you pass to the method is exactly the same

#

dude im not doing this for commercial use or future coding, im just doing it for this one bot in my server

#

okay

#

and

modest maple
#

this is hard to watch

earnest phoenix
#

i understand that it is hard to watch for people that are way better in this

#

i just dont have the knowledge

modest maple
#

How do you not understand the idea that what you have todo for sending stuff to DMs is the EXACT SAME AS DOING IT FOR SENDING IT TO SERVER CHANNELS

earnest phoenix
#

because im stupid okayy?

#

what codecademy course do you recommend for building discord bots @earnest phoenix

#

i didn't use one for bots so i don't know

#

pls spoonfeed me

#

im too dumb

#

for this

#

pls?

#

lets try this instead

amber fractal
earnest phoenix
#

in maths, when you have 2x + 4 = 12, and then you have 2y + 4 = 12, does anything change in the way you solve the equation despite the label for the variable changing?

#

No

#

exactly

#

the same logic applies here

#

the only thing different is the label

#

Yes, but i just dont know what to change

#

my god

quartz kindle
earnest phoenix
#

Some idee is forming in my head

#

Idea*

#

Do i put that code in between the brackets in the brackets after SendMessageAsync?

#

lol

quartz kindle
earnest phoenix
#

Im not on pc rn

#

So i cant try

quartz kindle
#

lol

#

why are you asking for help now then?

#

ask when you can actually work on it

earnest phoenix
#

3 mins ago i was on pc

#

But i had to go

quartz kindle
#

alright then

earnest phoenix
#

SendMessageAsync(โ€œcommandsโ€, true, builder.Build());

#

Just tell me if im close or not

#

congrats

#

you got it

#

Finally thanks for your patience

vagrant tree
#

is there a way to make 'invisible' the 'name' in an embed and only have the value?

modest maple
#

use a blank space unicode character

vagrant tree
#

thank you!

#

im getting the error SyntaxError: invalid character in identifier

#

nvm worked it out

earnest phoenix
#

another question, (sorry) now that i have the code like stated above, it sends the server message in dms in embed but not the personal message. it has turned it around

#

something like that

#

what

#

just... switch the arguments?

quartz kindle
#

what personal message?

earnest phoenix
#

ReplyAsync refers to the channel that the cmd was executed in

#

okay

#

wait i will send a ss

#

My bot take 3 attempts to play music
only 3th time works
I use D.js latest stable

#

I use opuscript

#

Someone have any idea what happend?

#

@earnest phoenix i want it so "Try to recover the messages now noob" is embedded

#

it also sends the server message embedded with the other commands

#

it sends the personal msg not embedded

quartz kindle
#

thats what builds the embed

earnest phoenix
#

yes

#

@quartz kindle you can help me with what i asked above?

#

here @quartz kindle

quartz kindle
#

thats in the help command

earnest phoenix
#

yea but it does the same with all

#

:C

quartz kindle
#

where is the builder part of the purge command that you showed?

#

@earnest phoenix post code

earnest phoenix
#

Ok

#

hastebin?

quartz kindle
#

yes

earnest phoenix
#

K

#

wait a sec

quartz kindle
#

ok, does the embed show now?

earnest phoenix
#

yes but still not really

quartz kindle
#

wdym not really?

earnest phoenix
#

you checked my code?

#

the one below is the server message and the one above the server message is the personal

#

i just want it to send the personal but embedded

quartz kindle
#

have you tried reading your own code?

earnest phoenix
#

yup

#

i 'tried'

quartz kindle
#

and? did you seriously not figure it out?

#

i mean, the answer is right there

earnest phoenix
#

wait

#

let my slow brain process this]

quartz kindle
#

you send the embed by using builder.Build()

#

builder.Build() creates an embed using the data from the builder written in the lines above

#

you literally just put whatever text you want in those

earnest phoenix
modest maple
#

TOKEN LEAK AGAIN MY GUY

quartz kindle
#

@earnest phoenix did you just show your token again?

modest maple
#

READ WHAT WE TOLD YOU

quartz kindle
#

your bot gonna get hacked

modest maple
#

That code will NEVER work

#

just saying

earnest phoenix
#

@earnest phoenix use config

modest maple
#

so so so so so many things are wrong with it

earnest phoenix
#

thats the worst code

#

ive seen

#

make a config file and store ur token and prefix

#

in recent years

modest maple
#

it proper hurts to read

earnest phoenix
#

@modest maple

});

client.login(config.token);
#

that makes you feel better?

modest maple
#

@earnest phoenix thats not python

#

and no

earnest phoenix
#

ok

modest maple
#

no it does not

earnest phoenix
#

ok

#

I did everything ok and it doesn't work and g! help works

modest maple
#

YOU DIDNT DO ANYTHING OKAY

#

that code is NOT okay

earnest phoenix
#

@earnest phoenix try make an embed

modest maple
#

@earnest phoenix bruh thats not helping

earnest phoenix
#

making an embed

#

solves nothing

#

it solved something at my bot

#

spam

modest maple
#

they have no idea wtf theyre doing and your solution is 'make an embed'

earnest phoenix
#

my bot spammed

#

not everyones issues are the same

#

ok

modest maple
#

when

  1. You arnt even giving idea in python
  2. You dont even seem to be very competent at coding yourself
#

making an embed solves litterally nothing

earnest phoenix
#

OK OK

#

LMAO

#

HELP HIM THEN

modest maple
#

๐Ÿ‘ Blocking ๐Ÿ‘ code ๐Ÿ‘ blocks ๐Ÿ‘ shit ๐Ÿ‘

earnest phoenix
#

i dont know much about python but im assuming they're trying to like

#

login

#

numerous times

modest maple
#

anything under that first login wont even get run

earnest phoenix
#

why the fuck he do client.run 2 times?

modest maple
#

welcome to this conversation

earnest phoenix
#

thanks

#

at least i don't see them awaying anything anymore dodo

#

that 2 client.run hurt my eyes

#

@quartz kindle ok i fixed the dm issue but the server message still doesnt get embedded

modest maple
earnest phoenix
#

lul

#

@earnest phoenix can i see your code ?

quartz kindle
#

@earnest phoenix you still didnt get it?

earnest phoenix
#

I could help you

quartz kindle
#

@earnest phoenix btw i checked your code and didnt see anything wrong there

earnest phoenix
#

I tried with a guide and nothing

#

try harderโ„ข๏ธ

modest maple
#

@earnest phoenix STOP COPY AND PASTING CODE

#

and LEARN THE BASICS OF PYTHON

earnest phoenix
#

@quartz kindle i did get the dms right but not the server message

modest maple
#

D.py is NOT made for beginners

#

you very clearly have no idea what you are doing in terms of async, Decorators, blocking code etc..

quartz kindle
#

nvmยฒ

#

@earnest phoenix how so?

modest maple
#

then you wait 2 weeks

earnest phoenix
#

I think you mean coding

#

they don't what they're doing OMEGALUL

#

@quartz kindle thank you

quartz kindle
earnest phoenix
#

Yeah i tried that

#

@quartz kindle good to see a man that helps the community

quartz kindle
#

then what are you trying to do?

#

@earnest phoenix i try lol

earnest phoenix
#

:D

quartz kindle
#

notice how my arrow is pointing the entire line to the block below

#

you need to move the entire line

#

you cannot use Build if you didnt set up the builder yet

earnest phoenix
#

Ah ok

#

i cant host my bot inside Visual Studio Code?

quartz kindle
#

the builder code has to be before you try to use builder.Build()

prime cliff
#

^

quartz kindle
#

@earnest phoenix "host" no lol

earnest phoenix
#

Ok

quartz kindle
#

you can run it with vsc, just like you can run it in your pc with any other thing

earnest phoenix
#

yeah thats what i mean

prime cliff
#

You need to use SendMessage after the embed

#

Also the { } need to be removed in the sendmessage

neat ingot
#

hi, what monitoring tools do you guys use for your bot application? assuming you host it online

earnest phoenix
#

hmm

#

@quartz kindle i am getting confused, do you want me to get that entire line down or builder.build up

#

you are probably cringing your ass of rn xD

#

@earnest phoenix how do i run js bot on vsc?

#

how am i supposed to know lmao

#

i just started today

#

you dont run it on vsc?

zenith orchid
#

shell

earnest phoenix
#

ok

#

welp

#

i give up

#

show me ur code

#

i can help

#

read the above messages

#

Ok

#

@earnest phoenix also, you installed node.js on vsc?

#

noo

#

F

#

F

#

i am on visual studio 2019 and running c# .net core

#

ok

prime cliff
#

@earnest phoenix remove lin 97 and 100 from the image you sent

hoary elm
prime cliff
#

Your builder.withColor(); is already done so those { } are invalid

earnest phoenix
#

ohh

#

ok ill try

#

someone know how to self host a discord.js bot?

prime cliff
#

Also your delete message function is using m which is invalid?

earnest phoenix
#

yea i fixed that

#

oh w8 nvm

#

but the embed is really weird

#

the text isnt embedded but below the text is a little square with nothing in it which is embedded

prime cliff
#

Idk why you are sending blank embeds

lavish seal
#

so pretty new to this *just started at 2 am last night xD but how can i make more then one embed option?

#

I get error embed has already been declared

earnest phoenix
prime cliff
#

@earnest phoenix try Embed embed = builder.Build();
On line 103 and replace those other builder.Build() with just embed

earnest phoenix
#

okay

hoary elm
#

@lavish seal that's cause you're calling embed twice

#

So instead do

const embed = new Discord.RichEmbed()
Then start the next one as
const embed2 = new Discord.RichEmbed()

earnest phoenix
lavish seal
#

ohhh alright

#

thank you

hoary elm
#

Np

lavish seal
#

that makes sense then

hoary elm
#

@lavish seal also for embed fields its usually .addField("Title Here", "Description Here")

earnest phoenix
#

doesnt work ๐Ÿ˜ฆ

prime cliff
#

Hmm

earnest phoenix
#

what's your issue in the first place

#

python or javascript?

modest maple
#

what

earnest phoenix
#

@earnest phoenix my issue?

#

yes

lavish seal
#

ohh ok cool

earnest phoenix
#

well, i fixed most of the dms now but with the purge command, it shows the message in the server un-embedded but with a blank embed underneath

#

modules are transient

#

create a new instance of your EmbedBuilder in your command

#

not in the class

#

ok now you are talking hocus pocus

#

for me

hoary elm
#

Lol

earnest phoenix
#

do i need to translate it to ooga booga

#

where you have new EmbedBuilder() in your class - don't, move it in your method

#

modules are recreated on every command meaning the embed will aswell

#

lmao

#

yeah ooga booga will work

hoary elm
#

LMFAO yeah that might be more understandable honestly ๐Ÿ˜‚๐Ÿ˜‚

earnest phoenix
#

still not ooga booga enough lmao

#

i literally told you

#

what to do

#

and where

#

but ok

#

ok

#

i will try to translate it myseld

#

ok so i only move new EmbedBuilder() up or the whole lune

#

line*

#

41 errors : (

prime cliff
#

Fix the errors then

earnest phoenix
#

you have it set as a field in the class right now

public class myclass {
EmbedBuilder embed;

  void method() {
    embed.Whatever
  }
}

instead create the embed in the method itself

public class myclass {
  void method() {
    var embed = new EmbedBuilder();
    embed.Whatever
  }
}
prime cliff
#

visual studio is the easiest tool for you to debug c#

#

I don't see how you need more help

earnest phoenix
#

removing the field means that you'll also have to add the latter code to other methods too

#

exactly

#

ok

#

also

#

your class isn't public

#

nope

#

does it matter?

#

it cant be recognized by AddModulesAsync if isn't public

#

ah

#

gives me 68 errors

#

because all builders are invalid

prime cliff
#

Blob_Sweat how are you creating more errors

earnest phoenix
#

idk

#

i did exactly as cry told me

hoary elm
earnest phoenix
#

well yes

#

what's your code now

lavish seal
earnest phoenix
#

you aren't sending the embed

lavish seal
#

ah nevermind

#

oh yea i just seen that lmao

hoary elm
#

Lol

lavish seal
#

also sorry, as i said im new to this lol so ill probably have quite a few simple issues

mossy vine
#

also keep in mind the 25 field limit

hoary elm
#

Everyone here will do what we can to help. Just don't expect to be spoon fed ๐Ÿ˜

#

And yes the 25 field limit i forgot about that

mossy vine
#

make use of other embed properties, like title, description, footer

quartz kindle
#

@earnest phoenix for the love of god you should really learn some basic coding

#

else you will get perma-stuck on the stupidest things

#

all the damn time

earnest phoenix
#

yea i probably should

#

but i dont know where to begin

#

@earnest phoenix we could live share if you want

#

you can hastebin the code

#

i'm laying in bed cant be bothered to go to my desk

#

alr

#

how tf does hastebin work lol

#

it doesnt create a link or something

#

its broken again lmao

#

use a fork

#

ok this works

#

does it work for you?

#

yes

#

...you literally changed nothing

#

unless im blind

#

yup i changed it back

#

i-

#

because i needed to test another line

quartz kindle
#

why do almost all your commands send both a message in the server and a message in dms?

earnest phoenix
#

because thats what i want

quartz kindle
#

that sounds incredibly annoying lol

earnest phoenix
#

you will also want to try catch sending dms

#

hmm its just a server with friends so they dont rlly mind

#

because there's a 50/50 chance it will fail

#

and throw an exception

#

translate to ooga booga pls

#

that is ooga booga

#

stop being a help vampire

hoary elm
#

Lol

quartz kindle
#

exception = error

earnest phoenix
#

ahh ty

quartz kindle
earnest phoenix
#

@earnest phoenix srry im a help vampire

quartz kindle
#

and you're still not respecting the order of the code

#

that line will send an empty one

earnest phoenix
#

ahhh

quartz kindle
#

also, im not sure which library you're using, but the one i checked the docs for says that the second argument is for enabling TTS (text to speech), so im not sure if you want to enable TTS everywhere like you're doing lol

hoary elm
#

@quartz kindle I think what he's trying to do is make them inline

#

With discord.js if you add that true to embed fields it puts them inline

#

.NET core of course could be different

earnest phoenix
#

I think what he's trying to do is make them inline
they're sending a message lol

#

i don't know how you connected it to embed fields

hoary elm
#

I know it's not doing what it's suppose to I'm just saying I'm guessing that's what he's trying to do

quartz kindle
#

inlining is set in embeds not in message sending

hoary elm
#

Like I said .NET core could be different never really used it ๐Ÿคท๐Ÿปโ€โ™‚๏ธ

earnest phoenix
hoary elm
#

Ahh I didn't even notice that was in the message send my bad

earnest phoenix
#

.netcore is an environment

prime cliff
#

Wait where is your builder object???

quartz kindle
#

its set in the beginning of the code

earnest phoenix
#

but @earnest phoenix what exactly do you want me to change

lavish seal
#

how come the bot responds to more than the one prefix i set it to? i set the prefix to ` but it also responds to ! and ?

prime cliff
#

Erm that would be very bad

#

You need to put the builder in the commands themselfs

earnest phoenix
#

oh my god i quit

quartz kindle
prime cliff
#

That would be bad

hoary elm
#

@lavish seal you need to make it return if the message doesn't include the prefix

earnest phoenix
#

guys im a noob srry

prime cliff
#

Trying to use reuse an embed with old data left over is ThonkangEyes

quartz kindle
#

doesnt the class get called again on every message?

#

or is the class just for defining commands?

prime cliff
#

The class defines the commands

earnest phoenix
#

well

lavish seal
#

this all i currently did regarding the prefix lol, what do i need to do to make it return if the message doesnt include the prefix?

quartz kindle
#

so the message event doesnt create a new class instance?

earnest phoenix
#

the class gets recreated on every command execution

prime cliff
#

But you can inject services and objects into it or just use them as static values like he is trying to do with the embed builder