#development
1 messages ยท Page 795 of 1
.
.
.
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)
hi, i'm setting up a host for a friend and i'm getting this error, anyone know what it means?
We'll see
Yeah you never defined command on line 28 you do command.slice but never define it
How do I define it?
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
Any ideas on what this means?https://cdn.discordapp.com/attachments/272764566411149314/680959823881437210/unknown.png
I literally told you
im doing a dashboard
and i get all icons of my servers what im in
and i found this
is a gif
no its a png
What is the ratelimit of message editing in discord for bots?
@astral yoke a tip so ppl can read your code a lil easier
asjdhkjhfjfh
has syntax highlighting and a monospace font
var a = 0
for (a = 0; a <= 1; a++)
yeet();
@manic furnace use ```html
<style>...</style>
In the box
Description?
What is the ratelimit of message editing in discord for bots?
idk
i'm sure it's on the dev docs
nope.
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
@ocean frigate every 5 seconds is the limit
edit a message every five seconds?
(node:23) DeprecationWarning: ClientUser#setGame: use ClientUser#setActivity instead
am i required to change this? i think it is a same thing
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
oh thanks
Does anyone know any free hosting services other than heroku and openshift that supports python
glitch does, but that's still shit-
Does it save data on the disk that the script generates
uhh i think it glitch but im not sure
Welp ima try glitch
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
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
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?
That's 100ms
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
0.109338 seconds per second
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
bot.emojis.get("ID")
@zenith orchid how da paper we get emoji id
:\
i use latest stable
I think v11 => bot.emojis.find("name", "exampleEmoji")
tHaNk YoU
Np
No, this method is deprecated
Find with a function, even in v11
how to disable
this
?
is your bot a clone
is that your bot
because if you cant disable your own responses you have a problem
like that ?
message.channel.send(`${test}`);``` @zenith orchid
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
im in v11 discord.js
do it like this
client.emojis.find(emoji => emoji.name == 'name here')
or if you just want to get the emoji by id you use get
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")
-bots
@little capeno
hmm, can someone give me an example with an emoji please :/
with client.emojis.find and message.channel.send
message.channel.send(`<:${emoji.name}:${emoji.id}>`)```
@little cape try
but idk for v11.
Maybe not work.
That works for 11 to if you use the old method you get a depreciation warning
im in discord.js v11.5.1,
I tried but I have the following error : cannot read property 'name" of null
then it wasn't able to find the emoji
I tried with another emoji but I have the same problem
is the bot inside the server with the emoji
oh yes okey, it is not possible to use emojis from other server ?
you bot must be inside the server with the emoji you are trying to search
like that :
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
Oh okay perfect thank you so much for your explanation ! i get it ! Thank you so much @zenith orchid @marble juniper
.
no dot post ty
@ Website Administrators
hmm
@little cape dont spoonfeed
who can give a commands to copy and paste on python
no one because thats not how this server works
ehhh
We don't give usable code and commands, we do help if you already have code that isn't working
how do you get the last votes? I can't find it in the documentation
what lib
dbl.marcorennmaus.de API Documentation
@earnest phoenix https://top.gg/api/docs#pylib
js
dbl.getVotes() @earnest phoenix
away or await
no
Why is there more than one _time command
bot it's red
my version of .py is 3.6.0
thats python
What's the version of your discord.py
not d.py
bot.say is like the OG version isnt it
that was even before async branch
it exists in 0.16.12
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
code blocks pls
wdym
``` code here ```
ok ut just tell
hey guys, can any of you help me i'm having trouble pulling votes in python
hey and this invalid syntax is what should I do with it
@plain wyvern did you check shivaco's answer?
it should be webhook_auth not Authorization
yes, away doesnt exist
@earnest phoenix away isnt it supposed to be await?
yes
what ?
I took from the net
๐คฆ๐ปโโ๏ธ
I saw it, but I took the data from my bot
and only this syntax I want to fix

@earnest phoenix the syntax error is because away doesnt exist, it should be await
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
all reasons why copy pasting is a bad idea...
- you never know how old the code you are copying is.
not even that like
theyre copying the code from several versions
and just good god
it is horrific
lol, to some people i guess just following some up to date guides is to hard ๐คทโโ๏ธ
I love waking up and immediately seeing this kind of thing right away lol
@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
ok
lol
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?
yes
If you can smash that persons ass if they abuse it irl then you're fine
Else I wouldn't recommend it
well ye lol
lmao
If you can smash that persons ass if they abuse it irl then you're fine
Timo 2020 guys ๐ ๐
anyone ever sent a webhook with an attachment without a library lul
This bot is dming me
Same for me
Oh god every message you send
kicked
It responded if you have f in your message
engrish
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
you need defined nice
Hello. It is possible to make legal RGB?
wut
@earnest phoenix code it?
@earnest phoenix rainbow role is against to tos
there's no legal and illegal - you aren't breaking the law lol
i still need help
@summer torrent the code , that is command of giveaway
@earnest phoenix so?
we don't give you a code
i dont know make this code
hello?
learn
learn
nice
HELLO
yeah i learn English
not you
@earnest phoenix rainbow role is api abuse
HELLOOO???
ok
i need help
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
have you tried debugging
Yes, but as far as I know it is possible to do Rainbow Role, which doesn't abuse the Discord API.
its just incorrect
have you tried debugging though
y
@earnest phoenix no
that code is very wrong @surreal sage
because... that's how you identify the problem
there is no error
a setInterval() will always run forever
how to clear it
if you start an interval it will never stop
like this
let interval = setInterval(...)
clearInterval(interval)```
ah okkkk
also, you cannot edit a message on a interval of 50ms
you are only allowed to send/edit messages 5 times in 5 seconds
Even if the color of the role is changed every 2 minutes, is it still an abuse of Discord's API?
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
it's the legalized version, which is very scuffed
why cant people format and indent their codes correctly smh
because they're using vim to write code ๐
@earnest phoenix pls stop asking for rainbow role code
they're using notepad
he's not asking for the code
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
welcome
oof
use hastebin
sure
which lib do you use
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
i think you should learn it first, even a little
^
yea kinda true
LULW
i just need this little line of code lmao
no one is going to spoonfeed you
im not asking you to spoonfeed me
first learn language
we're here to only give directions
do you check docs?
rip server
Hi, how would i set up MongoDB for my discord bot? For someone who has never used mongo
I just made 24h uninstalling and reinstalling phpmyadmin again and editing the config.inc.php
so?
@digital ibex there is so many guide
a bit rude @earnest phoenix
@wheat jolt haha.
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
don't follow tutorials, follow docs
docs are always up to date and explain how the lib works
ok
tutorial is for beginners 
mongodb is a lib?
ok, ty
How do I get the web hook shit to work so it sends s message when ever someone votes?
wrappers around mongo i meant
@tame ginkgo #topgg-api
I would use the official mongo driver
you need an active webserver for the webhook to post to
http://alex.is-bad.com/7k7RV4R.png does anyone have an idea?
you know there's more to that page than just code blocks
read the text that's above the fancy colored one
.-.
that is a disturbing profile picture by the way
I firstly read that text a day ago
ah yes
that message wasn't directed at you @wheat jolt
Ah
my internet is just dying so my messages get sent out slower
sorry for the confusion lol
np
how can I change the votebutton color on the website?
css
https://prnt.sc/r6iwwl nothing happens
according to instect element thats how buttons are named
*inspect
Are you trying to change the color of the button or the text
button
color changes text color
text isnt changed
because it's being overridden most likely
and if I put bg color it's only visible on mobile, it dissapear after some frames on desk
Honestly that's the easiest fix tho lmao
(body)
https://oliy.is-just-a.dev/83nu79_2889.png I can get it to change
well buttons in general
I can do just the vote button too
nothing works fuckkkkkkkkkkkkk
https://oliy.is-just-a.dev/pe88fh_2890.png idk why it wouldnt work
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{
...
}```
and apparently preview dont work for css (or i rly suck at css wtffffffffffff)
*preview button
fuckkkkkkkkkkkkkkkkkkk
well yes you used color not background-color
Does the vote button not appear on non-accepted bots?
well then how do you expect to see a change on something that isnt there
how do you play a radio for the sake of a link in a voice channel? playStream("link")?
one can help-me ?http://prntscr.com/r6j3hi
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
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
yes i do know how to do it in the normal servers chat
then you can do in the dms
make the embed defind and send it in the authors dms
actually the same
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
@earnest phoenix wdym with queue
ok idk
F
IDk
f
F
@earnest phoenix Hmm, Not bad
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
no i mean
@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
example embed
wut no
How can i
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
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
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
- your not gonna get spoon fed
- 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
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
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
have an existential crisis
me rn
i think youre overthinking this xD
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
c# is not just discord.net lol
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
this is hard to watch
i understand that it is hard to watch for people that are way better in this
i just dont have the knowledge
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
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
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
Some idee is forming in my head
Idea*
Do i put that code in between the brackets in the brackets after SendMessageAsync?
lol
alright then
SendMessageAsync(โcommandsโ, true, builder.Build());
Just tell me if im close or not
congrats
you got it
Finally thanks for your patience
is there a way to make 'invisible' the 'name' in an embed and only have the value?
use a blank space unicode character
thank you!
im getting the error SyntaxError: invalid character in identifier
nvm worked it out
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?
what personal message?
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
yes
@quartz kindle you can help me with what i asked above?
here @quartz kindle
thats in the help command
where is the builder part of the purge command that you showed?
@earnest phoenix post code
yes
ok, does the embed show now?
@quartz kindle https://paste.ofcode.org/m6SNjCcnYY62fBhyupTtZ6
@quartz kindle
yes but still not really
wdym not really?
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
have you tried reading your own code?
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
why commandas g!invite and link dosen't wokrs?
TOKEN LEAK AGAIN MY GUY
@earnest phoenix did you just show your token again?
READ WHAT WE TOLD YOU
your bot gonna get hacked
@earnest phoenix use config
so so so so so many things are wrong with it
thats the worst code
ive seen
make a config file and store ur token and prefix
in recent years
it proper hurts to read
ok
no it does not
@earnest phoenix try make an embed
@earnest phoenix bruh thats not helping
they have no idea wtf theyre doing and your solution is 'make an embed'
when
- You arnt even giving idea in python
- You dont even seem to be very competent at coding yourself
making an embed solves litterally nothing
if they read my previous points:
https://discordapp.com/channels/264445053596991498/272764566411149314/681134513455497218
They would know
๐ Blocking ๐ code ๐ blocks ๐ shit ๐
i dont know much about python but im assuming they're trying to like
login
numerous times
anything under that first login wont even get run
why the fuck he do client.run 2 times?
welcome to this conversation
thanks
at least i don't see them awaying anything anymore 
that 2 client.run hurt my eyes
@quartz kindle ok i fixed the dm issue but the server message still doesnt get embedded
Learn the Basics of python @earnest phoenix
https://automatetheboringstuff.com/ (for complete beginners to programming)
https://learnxinyminutes.com/docs/python3/ (for people who know programming already)
https://docs.python.org/3/tutorial/ (official tutorial)
http://python.swaroopch.com/ (useful book)
http://greenteapress.com/wp/think-python-2e/ (another decent book)
see also: http://www.codeabbey.com/ (exercises for beginners)
@earnest phoenix you still didnt get it?
I could help you
@earnest phoenix btw i checked your code and didnt see anything wrong there
@quartz kindle i did get the dms right but not the server message
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..
I think you mean coding
they don't what they're doing 
@quartz kindle thank you
@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
the builder code has to be before you try to use builder.Build()
^
@earnest phoenix "host" no lol
Ok
you can run it with vsc, just like you can run it in your pc with any other thing
yeah thats what i mean
You need to use SendMessage after the embed
Also the { } need to be removed in the sendmessage
hi, what monitoring tools do you guys use for your bot application? assuming you host it online
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
like this?
@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?
shell
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
@earnest phoenix remove lin 97 and 100 from the image you sent
@earnest phoenix https://code.visualstudio.com/docs/languages/dotnet in regards to starting it and what not ๐
Your builder.withColor(); is already done so those { } are invalid
Also your delete message function is using m which is invalid?
yea i fixed that
now its like this @prime cliff
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
like this but in server chat @prime cliff
Idk why you are sending blank embeds
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
@prime cliff this is the code now
@earnest phoenix try Embed embed = builder.Build();
On line 103 and replace those other builder.Build() with just embed
okay
@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()
@prime cliff like this?
Np
that makes sense then
@lavish seal also for embed fields its usually .addField("Title Here", "Description Here")
doesnt work ๐ฆ
Hmm
what
ohh ok cool
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
Lol
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
LMFAO yeah that might be more understandable honestly ๐๐
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 : (
Fix the errors then
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
}
}
visual studio is the easiest tool for you to debug c#
I don't see how you need more help
removing the field means that you'll also have to add the latter code to other methods too
@earnest phoenix i have it like this
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
how are you creating more errors
Sorry but 100% relevant to this situation
so currently when i do the command it doesnt work, what did i do wrong?
you aren't sending the embed
Lol
also sorry, as i said im new to this lol so ill probably have quite a few simple issues
also keep in mind the 25 field limit
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
make use of other embed properties, like title, description, footer
@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
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
why do almost all your commands send both a message in the server and a message in dms?
because thats what i want
that sounds incredibly annoying lol
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
Lol
exception = error
ahh ty
pretty sure you dont need this line everywhere
@earnest phoenix srry im a help vampire
and you're still not respecting the order of the code
there is no build yet here
that line will send an empty one
ahhh
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
@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
@quartz kindle library is discord.net
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
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
inlining is set in embeds not in message sending
Like I said .NET core could be different never really used it ๐คท๐ปโโ๏ธ
discord.net* to refer to it correctly
Ahh I didn't even notice that was in the message send my bad
.netcore is an environment
Wait where is your builder object???
its set in the beginning of the code
but @earnest phoenix what exactly do you want me to change
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 ?
oh my god i quit
he put the builder here
That would be bad
@lavish seal you need to make it return if the message doesn't include the prefix
guys im a noob srry
Trying to use reuse an embed with old data left over is 
doesnt the class get called again on every message?
or is the class just for defining commands?
The class defines the commands
well
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?
so the message event doesnt create a new class instance?
the class gets recreated on every command execution
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





discord pls
