#development
1 messages · Page 623 of 1
Odd
yep it doesnt even show up in tag
You did do "50" instead of "50%" or "50px"
Wait
It works fine
The padding
900px is much larger than any screen I've ever seen
Anyone know why the bot sends the message twice?
does that really matter
no, but if 900px is much larger than any screen I've ever seen that's just odd
Eh
I've set it to 0 and it shows up.
Perhaps the two padding in <a> and <img> are conflicting with eachother
guess what fixing size fixed the issue
:v
talking about that lazy
i need a bit of help on one other thing
do u know and cdn package that i can use to store data in mongo
s3?
umm how much is it monthly
For webpage?
About 80 cents usd
Depending on how much you upload and how frequently
Since I constantly make edits mine is normally around 5 each month
More of a google cloud guy myself cough
That works too
lazy okay so iam doing a document website like google docs
google cloud is big sexy
so it would have articles how much would that be
That's what I do
yes
can u use emotes from other servers in ur bot?
Yes
or does anyone have a guide for that
\:emote:
does it require the emote to be global?
server\:emote:?
:v
@west spoke unhashable type: 'dict'
why is that a error
{
'title': 'Python and MongoDB',
'content': 'PyMongo is fun, you guys',
'author': 'Scott',
'date_posted': 'April 20, 2018'
},
{
'title': 'Python and Jazz',
'content': 'jazz is fun, you guys',
'author': 'jaZz',
'date_posted': 'May 21, 2019'
}
}```
its python
from pymongo import MongoClient
client = MongoClient('n/a')
app = Flask(__name__)
posts = [
{
{
'title': 'Python and MongoDB',
'content': 'PyMongo is fun, you guys',
'author': 'Scott',
'date_posted': 'April 20, 2018'
}, {
'title': 'Python and Jazz',
'content': 'jazz is fun, you guys',
'author': 'jaZz',
'date_posted': 'May 21, 2019'
}
}
]
usettings = client.user.settings
#user_settings = {
# 'title': 'Python and MongoDB',
# 'content': 'PyMongo is fun, you guys',
# 'author': 'Scott'
#}
#result = usettings.insert_one(user_settings)
#print('One post: {0}'.format(result.inserted_id))
@app.route("/")
def home():
return "Hello World!"
if __name__ == '__main__':
app.run(debug=True, port=3000)```
thats what i got rn
and posts it to check
Put parentheses around the json
wdym
from flask import Flask, render_template
from pymongo import MongoClient
client = MongoClient('n/a')
app = Flask(__name__)
posts = ([
{
{
'title': 'Python and MongoDB',
'content': 'PyMongo is fun, you guys',
'author': 'Scott',
'date_posted': 'April 20, 2018'
}, {
'title': 'Python and Jazz',
'content': 'jazz is fun, you guys',
'author': 'jaZz',
'date_posted': 'May 21, 2019'
}
}
])
usettings = client.user.settings
#user_settings = {
# 'title': 'Python and MongoDB',
# 'content': 'PyMongo is fun, you guys',
# 'author': 'Scott'
#}
#result = usettings.insert_one(user_settings)
#print('One post: {0}'.format(result.inserted_id))
@app.route("/")
def home():
return "Hello World!"
if __name__ == '__main__':
app.run(debug=True, port=3000)
It means multi-line strings
same error
(thing) is exactly the same as thing when used as an expression
(thing,) would make it a tuple
To whoever uses C# and Newtonsoft.Json
Does anyone know why this JSON can't serialize?
.JSON (works)
"criteria":
[
{
"goal": 2,
"value_type": 1,
"bound": 1
}
]
.JSON (fails)
"criteria":
[
{
"goal": 3,
"event_type": 1,
"bound": 1
}
]
.JSON (fails)
"criteria":
[
{
"goal": 3,
"value_type": 1,
"event_type": 1,
"bound": 1
}
]
Class
public class Merit
{
public Merit(MeritGoalType goal, MeritValueType? type = null, EventType? eventType = null)
{
switch(goal)
{
case MeritGoalType.Collect:
if (!type.HasValue)
throw new Exception();
Type = type;
break;
case MeritGoalType.Event:
if(!eventType.HasValue)
throw new Exception();
Event = eventType;
break;
}
}
[JsonProperty("goal")]
public MeritGoalType Goal { get; }
[JsonProperty("value_type")]
public MeritValueType? Type { get; }
[JsonProperty("event_type")]
public EventType? Event { get; }
}```
The first version correctly serializes when using **value_type**, but **event_type** is always considered null, even if a **value_type** is specified. It feels like there is no proper reason as to why it won't account for **event_type**.
node index.js... get rid of the run
Show code
Without your token this time
^
And r u sure that file is called index.js?
yeah
Have you saved?
lol
no
Lol
Also nice new pfp @zealous veldt
thank
If anyones up for it, i'm looking into the dlm for voting
https://discordbots.org/api/docs#jslib
ping me or dm or something please 😃
So i've gotten a couple of errors, and then stuff that wont give any errors
im trying to check if the message sender has voted or not
show code and show error
language and library
like could i get a personal guide xD
language and library
flash(f"Account created for {form.username.data}!", 'success') wow im gettings intreseting erros help plss
^
SyntaxError: invalid syntax```
What language is that?
looks like python
yee
That's py
um
from pymongo import MongoClient
from forms import RegistrationForm, LoginForm
client = MongoClient('mongodb+srv:rmrn.mongodb.net/test?retryWrites=true')
app = Flask(__name__)
app.config['SECRET_KEY'] = 'hi'
posts = [
{
'title': 'Python and MongoDB',
'content': 'PyMongo is fun, you guys',
'author': 'Scott',
'date_posted': 'April 20, 2018'
}, {
'title': 'Python and Jazz',
'content': 'jazz is fun, you guys',
'author': 'jaZz',
'date_posted': 'May 21, 2019'
}
]
usettings = client.user.settings
#user_settings = {
# 'title': 'Python and MongoDB',
# 'content': 'PyMongo is fun, you guys',
# 'author': 'Scott'
#}
#result = usettings.insert_one(user_settings)
#print('One post: {0}'.format(result.inserted_id))
@app.route("/")
def Home():
return render_template('Home.html', posts=posts)
@app.route("/register")
def register():
form = RegistrationForm()
if form.validate_on_submit():
flash(f'Account created for {form.username.data}!', 'success')
return render_template('register.html', title='Register', form=form)
@app.route("/login")
def login():
form = LoginForm()
return render_template('login.html', title='Login', form=form)
if __name__ == '__main__':
app.run(debug=True, port=3000)```
thats all i got in that file
🤔
any python coders here? that can help me?
@fiery stream did you need help with mongodb?
I can help with that
I have been loosing my mind over this for so long I cannot take this any more. I do not know why the function play is not being run while the console.log console.log("Checkpoint more in queue"); is running. I have to been missing something very obvious here right? ```js
let fetched = ops.active.get(dispatcher.guildID);
console.log("Defined fetch");
//if (!fetched) return console.log("Error at fetch");
fetched.queue.songs.shift();
//delete fetched.queue.songs[0];
console.log("Shifted queue");
ops.active.set(dispatcher.guildID, fetched);
console.log("Set queue");
if (!fetched.queue.songs[0]) {
console.log("Checkpoint nothing left");
let vc = fetched.queue.voiceChannel;
if (vc) vc.leave();
fetched.queue.textChannel.send(`🎶 || Finished playback`);
ops.active.delete(dispatcher.guildID);
} else {
console.log("Checkpoint more in queue");
play(client, setting, ops, fetched);
}
cool
can you help me then
lol
how do I update all
like if {"user": "1"}
how do i update everything with that
as part of the docu,ent?
@fiery stream ? sorry for the ping
update.many
how would the syntax turn out?
is that py of js
iin js i m
lol if u dont need it i dont got time to figure it out rn
if u free u should help me
anyone knows how to do dialogflow webhooks
?
@dusky marsh do u know dialogflow webhooks
if anyone knows dialogflow webhooks mention me
]]moreinfo What are you aiming to do? What have you tried? etc.
If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.
okay so dialogflow webhook im tring to pull websearch data like dictionary, memes, jokes
for example i want my bot to answers questions like
A!chat whats life
so pulls life from api and searches it and returns back
@robust acorn in pymongo, client.db.collection.update_many
@Sabres#1556 What happens is that the bot has try to send a private message to a person, but this person does not accept private messages from the server where is the bot. You'd have to do a wrestling like that
.catch(err) => {
message.channel.send("error")
}
ow
um help
module.js:550
throw err;
^
Error: Cannot find module 'ytdl-core'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/app/commands/play.js:1:76)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)```
yes
how i fix
npm install ytdl-core
i did
-0-
its working
is this all i need to get the thing to work
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('Your discordbots.org token', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})```
well yes
thats it
ok im done
what this mean
node v8.15.1, with pnpm
Installing...
WARN Moving dblapi.js that was installed by a different package manager to "node_modules/.ignored
ERROR ENOTEMPTY: directory not empty, rename '/rbd/pnpm-volume/68332d7f-e7f3-45a4-abdc-7a0779d008a1/node_modules/dblapi.js' -> '/rbd/pnpm-volume/68332d7f-e7f3-45a4-abdc-7a0779d008a1/node_modules/.ignored/dblapi.js'
Read the docs
i still dont get it
help me make help command discord.js
idk what i did
your are trying to write to your server's root directory but don't have permissions
all i was doing is npm install dblapi.js
fix previous errors but now i get this error at this line "const DBL = require("dblapi.js");"```
module.js:550
throw err;
^
Error: Cannot find module 'dblapi.js'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/app/server.js:8:13)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)```
help me make help command discord.js
You didnt install dblapi.js in your bot's directory
i got this
$ npm install dblapi.js
npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/discord.js-dc9e85fd/typings/discord.js-test.ts'
npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/discord.js-dc9e85fd/typings/index.d.ts'
npm ERR! path /app/node_modules/.staging/discord-bot-list-b92468f3/node_modules/ajv
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/app/node_modules/.staging/discord-bot-list-b92468f3/node_modules/ajv' -> '/app/node_modules/.staging/ajv-15783739'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/8.15.1/_logs/2019-05-28T06_56_09_468Z-debug.log```
on which folder is your bot in?
normaly when i open the console on glitch its the bots folder
what do you get if you type pwd
/app
now type ls
what did you get
antiswear.json botconfig.json commands LICENSE.md node_modules package.json package-lock.json pommands public README.md server.js shrinkwrap.yaml views
you should be in the right folder now
Hey guys, bot is written in python, just wondering why the title is shown this way? Is there a way to remove the yellow
no same error
@earnest phoenix no idea, i would be interested in how to get that yellow lmao
Well if I figure out why the hell it does it I'll change it and let you know xD @quartz kindle
Lmao
@earnest phoenix show me the contents of package.json
@quartz kindle https://pastebin.com/wnpiP6g3
try using these
rm package-lock.json
npm cache --force clean
then try to install again
also, you have a bunch of weird dependencies in there, maybe you should clean it up
i got this in logs
ERROR ENOTEMPTY: directory not empty, rename '/rbd/pnpm-volume/68332d7f-e7f3-45a4-abdc-7a0779d008a1/node_modules/dblapi.js' -> '/rbd/pnpm-volume/68332d7f-e7f3-45a4-abdc-7a0779d008a1/node_modules/.ignored/dblapi.js'```
what different package manager lol
?
either your system is completely messed up, or its glitch's fault
i would make a new folder and start from scratch
ive been installing with npm
so, apparently glitch doesnt support that quite well
it says you need to use their package search function on the top of the window, or you need to edit your package.json file and let glitch install them automatically
idk what you mean
use this button when you go to package.json
oh
thx
to all that help
me
hey me again
@quartz kindle i install it with that saurch thing
i get node v8.15.1, with pnpm
Installing...
WARN Moving dblapi.js that was installed by a different package manager to "node_modules/.ignored
ERROR ENOTEMPTY: directory not empty, rename '/rbd/pnpm-volume/68332d7f-e7f3-45a4-abdc-7a0779d008a1/node_modules/dblapi.js' -> '/rbd/pnpm-volume/68332d7f-e7f3-45a4-abdc-7a0779d008a1/node_modules/.ignored/dblapi.js'
If youre on glitch you just add the package to package.json and it should install automatifally
what package
ok thts done
@mossy vine no errors now thx
but how long it take till website will show
how meny servers its in
How to host bot in glitch?
your bot's code
@modern sable in the server.js
he was asking for the code that you use to submit your server count
hey can someone tell me the hex to the colours which blends into discord's background
for embeds
i have no code to do that @modern sable
Dark theme: RGB 54, 57, 62
if you're a student, use DigitalOcean Credits from GitHub Student Pack @earnest phoenix
google and amazon have vps's free for 12 months
oh forgot about that
@quartz kindle
const DBL = require("dblapi.js");
const dbl = new DBL(' token removed in copy', client);
// Optional events
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
is server.js you main bot file?
yes
does anything come up in the console when you run it?
no
show me the full file
@earnest phoenix you have two different clients
?????????????????
oh
your client is the const bot
not the const client
why even have 2 clients if the bot is your client
you create a client and add it to DBL, then you create a bot and login with it
client is never logged in
how i fix
use bot
remove client
not client
put bot in DBL
ok
and move your DBL down there, or move your bot up
also count is redudant just to make that code more better
you can do bot.guilds.size
what the fuck lmfao
why "your"
And below as well too*
true
I'm gramer polise
Grammar police
roast
Gramer polise
That's not how you spell it
someone doesnt understand trolling

im dumb or someting idk what ya'll mean i cant fix the code im why to stupid
do you understand what your code is doing?
you have to create a client, then add the client to DBL, then login with the client
you create a client like this: const YOURCLIENTNAMEHERE = new Discord.Client();
yes got that
then you add the client to DBL like this: const dbl = new DBL(yourtoken, YOURCLIENTNAMEHERE);
then you login: YOURCLIENTNAMEHERE.login(bot token)
thats what i dont have
can you make events stop listening? d.js
you should not create multiple clients, which means do not have ... new Discord.Client(); more than once in your entire code
you should chose 1 client name only, which in your case you chose the name bot, and use it for everything
so do not create a client named client
then you just need to make sure things are in the right order
ie, dont try to use things before creating them, for example trying to use bot.something before const bot = ...
@lament meteor idk, but you could try the js/browser way: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener
@earnest phoenix that means your bot token is wrong in the bot.login() part
Eris has a disableEvents option, maybe discord.js does too?
@quartz kindle what token it need
o ill see
the one from discordapp.com or discordbot.org
the one from discordapp
ok thats why
the discordbots token is for the DBL part
@late hill yes it does, but i think hes trying to "unlisten" an event, not disable it
i also accept donations
@lament meteor i also found this https://stackoverflow.com/questions/39071211/whats-the-appropriate-use-of-removelistener-in-this-case
apparently you need to pass a named function to the listener, so you can remove it later
o
from the glitch threads, that means an error with the automatic installer, meaning something in your package.json is wrong
its not my bot im just hosting it for him/her
well, their package.json is wrong or missing something
i want to use variable for JSON data
but commandlist.lang mean lang in JSON instead
lang variable is "ENG"
and commandlist JSON have a path call "ENG"
and i want to use var lang to get data in commandlist.json with var lang path...
commandlist[lang]
Hey how would I go about in discord.js having a bot react to every message in a channel with 👍 and 👎.
just add message.react('emote').then(message.react('emote2'))
in your index
No for every message in a channel.
just return the channel
K
past messages or future messages?
if(message.channel.id !== 'idofchannel') return;
Anyone got any idea why a Discord bot would disconnect from a voice channel randomly with no error (discord.py rewrite)
I'm thinking CloudFlare as it was way worse on a Vultr vps
A) Your bot errored out and you are ignoring errors in your code
B) Your bot lost connection to Discord
C) Your Internet is a bad
D) Discord
^
No errors for it are being supressed
impossible if there's just me and a bot in there
D as in DISC
nobody can see those channels
Ayy how do u do command handler in python
And errors are printing, I've had plenty print
Then what are they
Help how do u do command handler in py
Not relevant to the error I am getting.
The only way it wouldn’t print anything is if it isn’t responding to ACKS but I don’t know d.py
Ask in the official py help cuz yea Amelia
What does that do
Simplifies the way of creating bot commands
Alright, thanks anywho
i'd just assume it's cloudflare
A websocket connection wouldn’t be managed by cloudflare I don’t think
Commands/ping.py?
it is, berry
Yes, you can, Jazz
They aren’t sending requests to you
cloudflare on discord's side, not on user's
Unless it’s cloudflare on their end
Oh ok, well I doubt it cuz it doesn’t effect anyone else rn
i've experienced a few cloudflare ws disconnects with a huge uptime bot
If you’re getting kicked off my cloudflare for large uptime than your connection is just bad
The longer your up the more often they check
Uhh ohh
@slender thistle do u know dialogflow webhooks btw???
Never used never heard
bruh i couldnt set up python
how come
😦
{ DiscordAPIError: Invalid Form Body
embed.fields[2].value: This field is required
at item.request.gen.end (C:\Users\Jake\Desktop\GIT HUB\Discord-Test-Bot\discordbot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:79:15)
at then (C:\Users\Jake\Desktop\GIT HUB\Discord-Test-Bot\discordbot\node_modules\snekfetch\src\index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
name: 'DiscordAPIError',
message:
'Invalid Form Body\nembed.fields[2].value: This field is required',
path: '/api/v7/channels/580550830038581300/messages',
code: 50035,
method: 'POST' } ```
Yet another Discord API error 😦
You submitted a embed which contains a field with no value
if (type == "messageDelete") {
message = args[0];
const date = new Date()
console.log(`[${moment(date).format('DD-MM-Y hh:mm: A')}][${message.guild.name}] User ${message.author.tag}s message has been deleted`)
let msgContent = '';
if (message.content.length > 0) {
msgContent += message.content;
}
if (message.attachments.array().length > 0) {
msgContent = msgContent + '\n' + message.attachments.array()[0].proxyURL;
}
const embed = {
"embed": {
"color": 0xd05333,
"title": 'Message Removed',
'fields': [
{
'name': 'member:',
'value': `${message.author}`,
'inline': true
},
{
'name': 'channel:',
'value': `${message.channel}`,
'inline': true
},
{
'name': 'message:',
'value': `${msgContent}`
},
],
footer: {
'text': "member id: " + message.id + " | " + moment(date).format('DD-MM-Y hh:mm:ss A')
}
}
};
logChannel.send(embed)
.catch(function (err) {)
}
@modern sable
Oh i see
How can I display author avatar below help command
I used displayAvatarURL but it only send link
You can check
.setFooter('footer text', message.author.displayAvatarURL) should be what youre looking for
np
I just got a big ol' error in my console and I have no clue as to what it means
ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2484)
Something something error in data transfer
No reference to my bot script
sounds fun....
may i let my bot create invite link
as long as your bot has perms they can make invite links
i wanna let my bot go generate invite links of servers it joined
just an idea
generating invites to guilds your bot is in without permission (so you can join?) would probably be considered api abuse
ikr
i just thought about that
not api abuse (i dont think)
but it is a reason for people to not use your bot
It is
k
no, delete_message has no context of the message you want to delete

check their documentation
client.delete_message(message)
Learn the lib
(read the documentation)
actually are there even any docs for the async branch anymore since it was deprecated
It didn't works but it's ok
line 72, in on_message AttributeError: 'Client' object has no attribute 'delete_message'
I don't understand
Can you do an example pls?
dir(client) and find the appropriate method (since i don't use the async branch and idk what it is)
@grim aspen he said he's using the async branch
Tnks
can i get some help in #topgg-api
let user = message.mentions.users.first() || message.author;
if(!xp[user.id]) {
xp[user.id] = {
xp: 1,
};
}
let addxp = 1;
let cExp = xp[user.id].xp;
xp[message.author.id].xp = currentExp + addxp;
let embed = new Discord.RichEmbed()
.setTitle(`T'es stat en terme de message sur le serveur !`)
.addField('À écrit :', `${cExp} message !`)
.setColor(`#dc143c`)
.setFooter(`demande de ${message.author.username}`)
.setTimestamp()
return message.channel.send(embed)``` hello i'm french, i have a little problem with some of my code i would like when i mention a member its shows the xp of the member mentioned and problem when i mention a member no error and no response from the bot
Wdym commands
console.log('This bot is online!')
})
bot.on('message', message=>{
let args = message.content.substring(PREFIX.legnth).split(" ");
switch(args[0]){
case 's!help' :
message.channel.sendMessage('This bot is being developed on! Wait until the bot is finished!')
break;
}
})
bot.login(token);```
k
Yeah python is easier. Much easier.
let user = message.mentions.users.first() || message.author;
if(!xp[user.id]) {
xp[user.id] = {
xp: 1,
};
}
let addxp = 1;
let cExp = xp[user.id].xp;
xp[message.author.id].xp = currentExp + addxp;
let embed = new Discord.RichEmbed()
.setTitle(`T'es stat en terme de message sur le serveur !`)
.addField('À écrit :', `${cExp} message !`)
.setColor(`#dc143c`)
.setFooter(`demande de ${message.author.username}`)
.setTimestamp()
return message.channel.send(embed)``` hello i'm french, i have a ittle problem with some of my code i would like when i mention a member its shows the xp of the member mentioned and the problem when i mention a member no error and no bot response can anyone help me?
I hosted my bot on heroku and it was 24/7 but after I done some major edit bot goes off after using one command
mood
Lol
let helpembed;
if (!args[0]) {
helpembed = new
discord.RichEmbed()
.setColor('#7289DA')
.setTitle(`Help commands`)
.setDescription(`Toutes les catégorie de commandes !`)
.addField ("► Admin", `Use ** ${prefix} help Admin ** to get help!`)
.addField ("► Useless", `Use ** ${prefix} help Useless ** for help!`)
.addField ("► Commands", `Use ** ${prefix} help Commands ** to get help!`)
.setThumbnail ( 'https://i.imgur.com/1VAnB9B.png')
.setFooter (`Help asked by ${message.author.username}`, message.author.displayAvatarURL );```
i remember we tried to move to heroku
and it just didnt work
no matter what we tried
so uh
i went back to home hosting it
but i dont do that anymore :D
we use a VPS i think?
but we got it connected to a webserver we made
if(message.content === prefix + "stat") {
if(message.author.bot)return;
let user = message.mentions.users.first() || message.author;
if(!xp[user.id]) {
xp[user.id] = {
xp: 1,
};
}
let addxp = 1;
let cExp = xp[user.id].xp;
xp[user.id].xp = cExp + addxp;
let embed = new Discord.RichEmbed()
.setTitle(`Les stat de ${user.username} en terme de message sur le serveur !`)
.addField('À écrit :', `${cExp} message !`)
.setColor(`#dc143c`)
.setFooter(`demande de ${message.author.username}`)
.setTimestamp()
message.channel.send(embed)
}
})```hello i'm french, i have a ittle problem with some of my code i would like when i mention a member its shows the xp of the member mentioned and the problem when i mention a member no error and no bot response can anyone help me???
so we can start and stop the bot with a push of a button
hmm
put it in a try block
and add a catch block
@earnest phoenix did i get that right?
but yeah put it in a try block and then add a catch block to catch any errors
also you dont need the () after RichEmbed i dont think
Heroku doesn’t like it when you write to files in my experience
But maybe I’m dumb
no i dont think it does
@earnest phoenix you do need it
o
we dont use it hh
oh
I thought you needed it
no i dont think you do
because i mean your just defining embed are you not
or am i being really dumb again
well
i mean we dont use it and it works perfectly fine
so you shouldn't need it
OH I THINK I KNOW THE ERROR!
instead of saying the first mention OR the author
check that there is a mention
and if not
let user - msg.author
@wicked pivot
Don't have money to buy vps
lol we are using the credits a friend gets from his highschool
because he is in computer science
we are working on a way to raise money to pay for a VPS we actually own
I just need to remove message.mentions.users.first() ?
I mention someone every time but it does not work unfortunately
tony
have you tried my solution
let user equal the first mention
and if user doesnt exist
let user equal the author
This is for me
yes yes basic it was like that but I want to make sure that the members can see the "xp" of the other
Hey, so I need help with developing a method that when someone inserts a URL, it gets deleted. Problem is, every text in the string gets deleted
Here is my code:
const request = require('request');
const {promisify, inspect} = require("util");
const req = promisify(request);
for(var i in phrase) {
console.log(phrase[i])
try {
if ((phrase[i].includes('https') || phrase[i].includes('http')) && await urlExists(phrase[i]))
await phrase[i].splice(i, 1)
} catch (e) {
}
}
async function urlExists(url) {
let exists = false;
try {
let {statusCode} = await req({ url: url, method: 'HEAD' });
if (statusCode == 200) exists = true
} catch(e) {
}
return exists;
}
And this is my test array:
[ 'hi', 'my', 'name', 'is', 'NightYoshi370', 'https://discordapp.com/', 'how', 'are', 'you', 'today?' ]
const bot = new Discord.Client();
const token = 'GoodLuckWithThat';
const PREFIX = 's!';
bot.on('ready', () => {
console.log('This bot is online!')
})
bot.on('message', message=>{
let args = message.content.substring(PREFIX.legnth).split(" ");
switch(args[0]){
case 's!help' :
message.channel.sendMessage('This bot is being developed on! Wait until the bot is finished!')
break;
}
})
bot.login(token);```
i need help
what lines of code do i need to copy if i wanted to make a new command and where would i paste it?
ping me if you have an answer
Please use properly formatted codeblocks
^
-bots @earnest phoenix
@warm copper
@earnest phoenix Don't use luca in here, use it in a testing channel pelase
No quota left
```bot.channel.get('channel id ').setName('name here', voice)
Error cannot read property .setName of undefined
I want to make a web dashboard for my bot in php. I want to list the guilds into a listbox. How can I do this?
I can echo the guilds, but i can't get these into a listbox
iterate over them and build an html string
But how can I do this? And list them into multiple lines.
example <select> taghtml <select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select>
I know this
That's a w3s example if I've ever seen one 
echo "<select>";
foreach($guilds as $key => $value) {
echo "<option value='".$key."'>".$value['name']."</option>";
}
echo "</select>";```
what's wrong with using w3schools tho
assuming $guilds is an associative array where $key is the guild id and $value is an assiciative array containing the guild information
Nothing, it's a great resource
ohh thanks
Their choice of car manufacturer needs updating though
lmao
🤔
$guildurl = 'https://discordapp.com/api/users/@me/guilds';
$guilds = apiRequest($guildurl);
echo "<select>";
foreach($guilds as $key => $value) {
echo "<option value='".$key."'>".$value['name']."</option>";
}
echo "</select>";
w3 isnt that great
Here is my try
a lot of their stuff is super old and outdated
yeah, like their choice of car manufacturers
saab ;-;

I'm not really a fan of web dev anymore, so I wouldn't really know if there's anything more upto date
mdn is good
I'm successfully got the server names. Now how can I put this into that "listbox" ?
I used this:
foreach ($guilds as $guild) {
$teszt2 = $guild->name;
}
What is good hosting
Ok. I combined with my code:
<form method="GET">
<?php echo "<select>";
foreach($guilds as $guild) {
echo "<option value='".$guild->name."'></option>";
}
echo "</select>";?>
And I'm just getting this:
PS: I've got 90 servers
if you inspect element, do you see all of the content?
possible css problem then?
🤔
There are a few pinned
?
Check the pinned messages in this channel
But wait! I can't put an echo, because it displays an error when i put it.
But if I remove it, it won't display the server names
"string".$variable."string" = "string"+variable+"string" in javascript
because you need to put it in two places
<option> has a value and a content
ok, thanks I'll give a try
<option value="value here">content here</option>
content is what you will see
value is what you get if you click on it
if you need to access the guilds ID later, you should put the id in the value
<option value="guild id">guild name</option>
Me not have USD
currency doesnt matter if you have a credit card or paypal
google / amazon - good performance, free for 1 year (requires a credit card to sign up)
heroku / glitch - meh performance, free forever (with limitations, requires scripts to keep it on)
scaleway / galaxygate / hetzner / ovh - good performance, as cheap as 3-5 USD per month, accepts paypal
help me 😦
@mystic hare logout and connect you
logout https://discordbots.org/bot/new?
@mystic hare You disconnected from the site?
You have to disconnect from the site and then reconnect so that it refreshes because you have a slight mistake
relog
yes
and now its must be good.
To mention a user in a message, this is correct?
let mentionuser = guild.members.mentions
or
let mentionuser = members.mentions
?
ok wait..
k
@earnest phoenix just write their ID like this <@ID>
you are logged in with the wrong discord account in the browser @mystic hare
@mystic hare
Make sure you are logged into the right account at https://discordapp.com/channels/@me (Open this in your browser!)
Log out on the web client and log back in to the correct account.
Your desktop client is not the same as on the website.
its work, thanks @earnest phoenix @quartz kindle @earnest phoenix
Because autorole isn't a property of guild.
So how do I do it? @warm marsh
autorole command
const Discord = require ("discord.js");
module.exports.run = (message, bot) => {
let oldRole = message.guild.autorole
if (!message.args == "off") {
if (oldRole !== false) {
bot.config.setAuto(message.guild.id, false);
return message.send("**✅ Autorole désactivé.**")
} else {
return message.send('**❌ Veuillez écrire un rôle à donner automatiquement.**')
}
}
if (message.mentions.roles.first()) return message.send("**❌ Veuillez écrire le nom du rôle complètement au lieu de le mentionner.**")
if (!message.guild.roles.exists('name', message.suffix)) return message.send("❌ Le rôle **"+message.suffix+"** n'existe pas dans ce serveur. Vérifiez l'orthographe.");
if (message.guild.roles.find('name', message.suffix).position > message.guild.member(bot.user).highestRole.position) return message.send("**❌ Je ne peut pas assigner ce rôle automotiquement car il est au dessus du mien.**");
bot.config.setAuto(message.guild.id, message.suffix);
message.send("✅ Le rôle **" +message.suffix+ "** sera attribué aux utilisateurs quand ils rejoigneront le serveur.")
}
module.exports.help = {
name:"autorole"
}
^
You will need to make oldrole equal to your stored role
surprised you just ignore the deprecation warnings about that
i still dont get what hes trying to do with .autorole
also, the answer to your problem message.guild.autorole is undefined is very simple
there is no such property as autorole on guild
I think he thinks that when his bot creates a stored "autorole" is saves to guild.
Possible.
theres defaultRole, which is just the @everyone role of the guild
which is also the id of the guild
wut
...
Your variable "oldRole" can't equal message.guild.autorole as it doesn't exist.
You must make "oldRole" equal to your stored one maybe.
read the fucking docs and realize that there is no property called autorole on Guild, and stop ignoring the damn deprecation warnings
xD
@mossy vine speak better please, I'm not a monster
sorry
not serious
a library like discord.js
eris is faster, lighter, harder to use, and has worse documentation
I thought master for d.js was better now
its the same
im talking from personal experience ok
vim
Vim?
Isnt vim terminal?
Does somebody know something about hosting at Heroku for discord bots?
My bots won't start up anymore for a reason
- nice email leak
- it says that quota is reached
- the email was still logged in #265156361791209475 gg
How can i solve that?
pay
Okay
FYI: heroku has recently updated their stuff so you can no longer infinitely keep using their worker dyno's 😂
(might be quite a few people coming here to ask what's going on with their bot)
^You're gonna have to pay now 
Or switch to glitch /s
yeet
Okay
@late hill same with me
rip heroku
you can still have it for free
you just need a credit card
Accounts are given a base of 550 free dyno hours each month. In addition to these base hours, accounts which verify with a credit card will receive an additional 450 hours added to the monthly free dyno quota. This means you can receive a total of 1000 free dyno hours per month, if you verify your account with a credit card.
When you use all your free dyno hours for a given month, all free apps on your account will be forced to sleep for the rest of the month.
550 hours = 22 days
1000 hours = 41 days
so if you dont have a credit card in your account, after you bot reaches the limit, it will sleep for the rest of the month lmao (8-9 days)
yes
I don't have creadit card
i have a maestro too
The other one is MasterCard, which is more of a personal one that also works with PayPal
ayy how do i check if user is playing a game or not
what language?
exports.run = (client, message, args) => {
var user = message.mentions.users.first() || message.author;
if (user.presence.game.name === "Spotify" && user.presence.game.type === 2) {
const embed = new Discord.RichEmbed()
.setAuthor("Spotify")
.setColor(client.config.botColor)
.setThumbnail(user.presence.game.assets.largeImageURL)
.addField("**Song name :**", `\`🎵\` ${user.presence.game.details}`, true)
.addField("**Album :**", `\`📀\` ${user.presence.game.assets.largeText}`, true)
.addField("**Author(s) :**", `\`🎤\` ${user.presence.game.state}`, true)
.addField("Listen to this track :", `https://open.spotify.com/track/${user.presence.game.syncID}`, true);
return message.channel.send(embed);
} else if (!user.presence.game.name === "Spotify" && user.presence.game.type === 2) {
message.channel.send(`\`[ERROR ❌]\`, ${user.username} may not be listening to a registered sound`);
}
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User"
};
exports.help = {
name: "spotify",
category: "Misc",
description: "check what the user is listening",
usage: "spotify (args)"
};```
he i cant manage to get my else command work help
d
Heroku or glitch?
Neither
a proper vps
@fiery stream !something === something doesnt work the way you think it does
you should use something !== something
Does anyone know how to install the discord.py rewrite?
because cloning the git repository gives an error
Thanks
np
Why my bot bot aprovved?
It takes a week to approve bots
Nope @opaque eagle
Yeah that too ^
@opaque eagle ye
:(
@quartz kindle same issue with the spotify
whats the issue?
is anyone else receiving a Unhandled Rejection: Error: ENOTFOUND discordapp.com discordapp.com:443 i just started my bot it worked yesterday but now it won't work at all.
nvm it's working now
o/
if(message.content === prefix + "stat") {
if(message.author.bot)return;
let user = message.author
if (message.mentions.users.first()) user = message.mentions.users.first()
if(!xp[user.id]) {
xp[user.id] = {
xp: 1
};
}
let addxp = 1;
let cExp = xp[user.id].xp;
xp[user.id].xp = cExp + addxp;
let embed = new Discord.RichEmbed()
.setTitle(`Les stat de ${user.username} en terme de message sur le serveur !`)
.addField('À écrit :', `${cExp} message !`)
.setColor(`#dc143c`)
.setFooter(`demande de ${message.author.username}`)
.setTimestamp()
message.channel.send(embed)
}
})``` hello i'm french, i have a ittle problem with some of my code i would like when i mention a member its shows the xp of the member mentioned and the problem when i mention a member no error and no bot response can anyone help me???
if(message.content === prefix + "stat") {
that checks if the message is EXACTLY prefix+"stat"
not more not less
@wicked pivot
How can I do so that I can make the order with a mentions?
Is there a way for me to see some info on the servers my bot has been added to?
I wanna know the names and how many people are in it
@wicked pivot use msg.content.startsWith(prefix+"stat")
thx
Is google.js down??
let user = message.author
if (message.mentions.members.first()) user = message.mentions.members.first()
///////////
.setTitle(`Les stat de ${user.username} en terme de message sur le serveur !`)
``` ${user.username} undefined " when I mention
Is google.js down help
i dont even know what google.js is
@wicked pivot members dont have usernames
user = user account. has username
member = guild member. has nickname
you can convert a member to a user using member.user
if it's a package that scrapes google you probably got ipbanned from google themselves
use duckduckgo for scraping
Duck duck go?
@earnest phoenix cuz lets us use there api on there webpage
wot?
duckduckgo allows scraping and they have a public api
i prefer to scrape duckduckgo since the api is surface light searching, it doesn't return much
@earnest phoenix do the have npm module or just post n req
i don't
but generally all you have to do is GET request https://duckduckgo.com/html/?q=<your search term> and parse the response you get
the response is a html object
that's not what i said
Wdym mean then
you GET request the page, in return you get a html response, you then parse the html so you can easily fetch objects from it, in .net, generally c#, we use html agility pack (https://github.com/zzzprojects/html-agility-pack)
i know you aren't
Its been to long
how long
i just like programming, and im taking computer science in my course
same!
Getting 3rd one is getting ready
what
Lol its gonna take time because its in python i dont know any of it
My 3rd bot is getting ready
ok but like
Making many bots != being a good developer
when did you add that bot
Thats nice emoji im gonna use it for my bot
I already have my bot here
@fresh swallow
my bot isnt here yet
Ohh
Nice
2 days 14 hours
we had to update something (we had a directory issue) so we had to shut it down a few days ago
oof
U got heartbeat
69mb???
thats actually normal for some bots
Can we appreciate the people who learn the programming language before coding Discord bots
only 6 guilds?
for a bot in 18 servers, yes
@slender thistle so not me
So bad or good?
bad
Total members
Serving
A!eval client.users.get("583336869169987586").send(client.users.size + "this many members 🙌🏼")
Got it?
Oof
thats not what i asked
Then what
also client.users.size will only have cached users which is why you only have 26k despite being in this server with 40k+
client.guilds.reduce((a, c) => a + c.memberCount, 0)
that will tally an accurate member count
Oof
users are cached because otherwise your bot would use an absolutely ridiculous amount of memory
Ohh
your bot has access to every user if you want with fetchUser() or fetchMember() but it wont just store all of them (unless you turn that on but its not recommended)
Interesting
so you can go get a user thats not in your cache with a fetch method, but if theyre already cached then you can just use get() on the users collection
I don’t really care bout it
im just saying your user count is totally off
¯_(ツ)_/¯
no idea what that is but if they have docs, thats probably all you need



