#development
1 messages · Page 596 of 1
He sent the loop
whoops i forgot the semicolon
const prefixes = [prefix1, prefix2];
for (var i = 0; i < prefixes.length; i++) {
if (message.content.startsWith(prefixes[i]) {//run some code}
}```
return maybe
can i speak in portuguese and u put it in google translator?
uhh ok
ok
então
eu tenho uma variavel para prefix
e queria
tranformar ela
pra ela responder a alguns prefixos a mais
eu estou tentando
colocar o seu codigo
dentro do meu
mas não esta funcionando
hmm
code:
ohh
const prefixes = [prefix1, prefix2, prefix3];
var x = 0;
for (var i = 0; i < prefixes.length; i++) {
if (message.content.startsWith(prefixes[i]) {
x = 1;
}
}
if (x == 0) return;```
that should work
Or you could just do prefix.includes(), no?
it has to start with the prefix
you forgot the }
Could use Array.some
after x = 1;
still doesnt work
array.some might work
how can i use it
uhh u should delete that
why?
...

oh ok nvm

nope nothing wrong here
var prefixes = ["","",""];
function checkSW(p) {
return message.content.startsWith(p);
}
if (!prefixes.some(checkSW)) return;```
hey so having slight issue in d.js
i have
if(!command.startsWith(prefix)) return;```
in my code, but it doesnt seem to be working
my prefix is `j!` but the bot responds to `l!` or `i!` too
i will teste
@earnest phoenix what is command supposed to mean?
let command = messageArray[0];
@buoyant wagon is that correct?
i think
@buoyant wagon do u wanna i give u my index in DM?
@alpine cliff
da uma lida ae
@alpine cliff oq vc quer perguntar?
heeeeeeeeelllllppppp meeeee
I need that my bot return the two prefixes
anyperson know how make this?
@alpine cliff ta bom?
kkkkk
eu ja perguntei
so que a maneira que eles respondem
funfam pra eles
e pra mim n ,-,
@zealous crypt
@alpine cliff vai no Discord.js
q tradução tosca kkkk (what a bad translation lmao)
why are webhooks so slow...
[TypeScript] So I have classes for commands that all extend an abstract Command class... how would I add a property to the abstract Command class that gets the name of the childrens' filenames to use for the command name?
@quartz kindle are u br?
Right
I need help
I run npm un dblapi.js
and it tells me ```npm WARN deprecated snekfetch@3.6.4: use node-fetch instead
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/dblapi.js" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-03-31T23_59_13_859Z-debug.log```
like-- I'm trying to uninstall you, why the fuck you complaining about installation??
He's trying to uninstall
to are in the folder of the bot
Ill make this simple
any time i do npm and then something
i get that error
all the time
even when i have hard deleted it off of my system
do npm --v
what has gone wrong here
tell me what it says
5.8.0
can you do node --version
what was it 
I have spent the past good few hours on this
and all i needed to do was npm rebuild.
someone shoot me
:+1: I gtg
hey so dumb question how do you send an emoji from another guild?
get the id of the emoji
then js const emojiName = client.emojis.get("emojiid"); message.channel.send(emojiName);
nvm figured it out
I was looking for the actual message to send to discord also I don't use js
but anyway does anyone know why my spinner doesn't work right as an emoji? #265156322012561408
it looks fine to me @west skiff
It's not looping right for me, it completes the circle then stops immediately and resets
It should ease back into being just the dot
like this
does .mp4 embed? I have that too
probably just not formatted right
So does it look like that video for you?
no
f
client.music.load(`ytsearch:${args.join(' ')}`).then(r => client.music.players.get(message.guild.id).play(r.tracks[0]))
{ playlistInfo: {},
loadType: 'SEARCH_RESULT',
tracks:
[ [Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object] ] }
How could I check if the number of tracks
is 0
and if so
send a message
can someone make a bot that you can mine fake bitcoin (for a server im making) ((i also dont know how to code a bot))
@burnt moon how old are you
No
then no thanks
@burnt moon pls
well just know that u need to be 13 to legally use discord
did you read the embed?
You seem to have asked for a very specific bot/feature. You likely won't find it on the site if you havent searched already... What you can do is talk to Oliy#0330 to get access to #434058442764714002 and find a developer willing to do the job. Be sure you provide enough details like payment options, if you are going to selfhost it or not, how fast you want it done, etc.
how do you put a text inside an embed that has a link
yeah it's just standard markdown
how do i make my bot ignore other bots
if (message.author.bot) return;
//Below to make the bot not listen to DMs
if (message.channel.type == "dm") return;```
uhh i only know discord.js
@latent spoke
@languid vault Still need help or nah?
-bots @lusty dew
@molten prairie
-bots
@unkempt steppe
Please don't use Luca in here
@lusty dew TRACK_LOADED/SEARCH_RESULT/PLAYLIST_LOADED will never have zero tracks
it'd be NO_MATCHES/LOAD_FAILED
Yea
I already got that lol
I am just wondering now
how I would check if it would be 0
it will never be 0
It will just be empty
Ah okie
an empty array and an absent value are different
So could I just check if the client.music.load
returns No Matches?
then if it does I can just send out a message to the channel?
hello, why isn't the message being sent?
client.on('ready',()=>{
console.log('work')
if(new Date().getHours()==8)
{
client.channels.get('281113673282486273').send('8 hours')
}
})
Any errors?
no
Well is hours even 8?
okay, sorry it works))
guys how to check the time in an infinite loop? not just once
client.on('ready',()=>{
console.log('work')
if(new Date().getHours()==9)
{
client.channels.get('281113673282486273').send('9 hours')
}
})
y
does anyone know how to change the name of a bot
@earnest phoenix npm start and make sure you have a run script in package.json
you don't have a package.json
also it's recommended to work in the project folder rather than the home folder
also it's recommended to work in the project folder rather than the home folder
no
figure it out
Maybe get a better tutorial because it's basic stuff
start at a lower level... like with basic node/js
yea thats not what that means
no it wont
.send() returns a promise
use .then or async/await to resolve it into the correct embed
@alpine cliff yes
.sentembed ??
I think it's not in d.js library
Why are webhooks so slow? People aren't gonna bother voting if they get the reward a hour later
Please fix this
yo anyone know cpp?
just wondering what it would mean if you declare a var such as, int a = [300][300]
Anyone up with experience of Lavaplayer and D4j?
@fiery birch what
You mean int a[300][300]?
i mean exactly that 
Yes
Do bot invites get reset daily?
It's a 2d array
tyty
@earnest phoenix bot invites?
I meant votes
Oh that reset I thought like when you can vote again
Yeah it was bad wording on my part
how to get the @everyone role in discord.js cuz in discord.net there's guild.everyonerole but not in discord.js
const client = new Discord.Client({ disableEveryone: false})```?
dunno if thats correct
you can read the docs
I'll try
also I'm getting this error when trying to install quick.db
the solution on sof didnt help :/
Dear anyone, what am I doing wrong. I tried this 5 times by now, but it just won't update...
I'm using Heroku
Btw no april joke, I tought it might be because I ran out of dyno hours last month so I tried today (new month with new dyno hours)
I wonder to buy a computer/server to host bots in my house. What should I buy?
raspberry pi is an inexpensive way to run a small server
Probably because you're missing some of the stuff that's currently on that repo
You could force push
@earnest phoenix the everyone role can be tagged with <@&guildid>. also, for that error use this:
Run npm i windows-build-tools --production --vs2015 --add-python-to-PATH --global as admin, and restart terminal.
Restarting machine can also be required.
Would most likely fix your issue
already tried
already tried what eggplant
that exact command?
if none of the commands work, go to the node-gyp readme on github and follow the manual installation instructions for windows
How can i get the both with names ? (Python)
uservoice = ctx.message.author.voice.voice_channel
botvoice = bot.voice_client_in(server)
With names?
I need them te be same to make this: if botvoice != uservoice: work
uservoice = ╔• Minecraft Ⅰ
botvoice = <discord.voice_client.VoiceClient object at 0x0000022ED3C399B0>```
jas cus the .id whont worke
534010878870290513
Ignoring exception in command play
Traceback (most recent call last):
File "C:\Users\frick\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 50, in wrapped
ret = yield from coro(*args, **kwargs)
File "C:\Users\frick\Desktop\discord bots\musik\bot 247.py", line 63, in play
print(botvoice.id)
AttributeError: 'VoiceClient' object has no attribute 'id'
Yep, you would need to use .channel on botvoice, which would return Channel
And that Channel would have an attribute id
Thank you 😃

and where is the token?
OMFG
@mossy vine
are you new to coding?
yes, at bot coding , at JavaScript not
you should read the docs or something or try to lear coding before starting making a bot
alright
go to your bot application at https://discordapp.com/developers/applications/
Integrate your service with Discord — whether it's a bot or a game or your whatever you wildest imagination can come up with.
select your bot application
navigate to the "Bot" tab
and under token there will be a "copy" button. paste that token into your client.login()
be sure to not share this token
your token is basically your bots password. if someone knows it, they have full access to your bot
@commands.command()
async def kick(self, member: discord.User, *, reason='No Reason'):
embed = discord.Embed(
colour = discord.Colour.blue()
)
await self.client.kick(member)
embed.set_author(name='Twite Kick')
embed.add_field(name="Member", value=member, inline=False)
embed.add_field(name='Kicked by', value=f'{message.author}', inline=False)
embed.add_field(name="Reason", value=reason, inline=False)
await self.client.say(embed=embed)
I tried using ctx.message.author but then the message you have to send gets strange and i just want it to be !kick {member} {reason} but yea that wont work so if anyone have any suggestions come with it (cogs btw)
first send info then kick
sorry, i dont know python
saying i dont know x is annoying, you're not contributing to anything, if you don't know how to help out just... don't send a message lol
how do i stop the bot
it might be because the member is getting deleted from the cache
member: discord.User -> self.client.kick(member)
How do i stop my bot?
but thats not what i need..
https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.kick This says that you need Member, not User
exit the process...? @quiet topaz
i need it to send WHO kicked the member
ok
in the kicked by tab
@quiet topaz press ctrl+c in the terminal to exit the running node process
ok
ctx.message.author is what you need, although I don't get what's wrong when you use that
weird as in
because i have to have self, ctx, user stuff reason stuff
!kick ctx {member} reason stuff
No you don't need to enter ctx when uisng the command
You'll need pass_context=True in your command decorator if you use ctx
How do I get the day, month and year instead of everything when using message.createdAt? This looks very cluttered and I only need 1st April 2019 https://geedees.succ.world/i/rr0z.png
There we go thank you
@earnest phoenix lang and lib?
Discord.js @cry#2046
Master
@earnest phoenix
so from what i'm seeing createdAt returns a date, you can then use methods on the date e.g .getMonth() to get the month number
so yours would be something like .getDate() .getMonth() .getFullYear()
however month is returned in a number so you'll have to keep an array of named months somewhere
what's a good way to create a database for users in python?
https://gyazo.com/97f0f3a998775a8878b26dfffb8a0eb4 How to get that image? It's not an embed message, it's with a website url (meta tag)
pm me cuz I gtg
opengraph meta tags
<meta property="og:image" content="https://imgur.com/tKkG2N7.png" />
I tried that
but doesn't work
you have to fill the rest of properties
wdym?
you have to fill og:title and og:description so discord can construct an actual embed with content
yea I have that
I just showed that
<meta property="og:title" content="Dustie Bot" />
<meta property="og:image" content="https://imgur.com/tKkG2N7.png" />
<meta property="og:description" content="The most customizable and user friendly bot that always accepts suggestions!" />
no, you only have og:image filled
what I have
ah
JDA: How 2 check if the added reaction to my message is 👍? I can't figure out what I should check
the event provides a MessageReaction which has a getReactionEmote method @willow marlin
@merry stirrup did you try using anything else but imgur
yass. But how do I compare both ReactionEmotes?
I mean, somehow I must get the ReactionEmote object of :thumbsup:
just .Equals them...?
or compare their getName
and no you'll never get unicode emojis in :name: format
they'll always be returned in their unicode value e.g \👍
I can't find a way how to compare to the unicode value. reactionEmote.equals("👍") doesn't work :/
But I can add reactions with message.addReaction("✅").queue();
equalsing them probably expects instance of another reactionEmote
i told you compare their getName()
But what will happen if someone is using his custom emoji, named thumbsup?
aaah, that's understandable :D. Thank you 😉
using glitch
(node:1058) UnhandledPromiseRejectionWarning: TypeError: client.guildsettings.get is not a function
at module.exports (/app/events/message.js:28:43)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
(node:1058) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1058) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
anybody that can help me with this error please 😦
wait does it just say the error
I'm using Glitch, I tried to enable-pnpm it was like that again
also we need code
to see
it legit says TypeError: client.guildsettings.get is not a function
yea, what are you asking for then if it "legit says <insert error>
@marble needle
@marble needle Whats the problem?
on google or somethin
the problem is using glitch
TypeError: client.guildsettings.get is not a function
i have tried everything and its still give me that error 😦 @junior summit
oof
no matter what i type i get that error thats why i =m asking here for help
object properties are case sensitive
its guidSettings not guidsettings
mind researching your issue for like half a second before asking lol
also make sure
Rye, can you help me?
client is not confused with bot
idk
it might be bot.guildSettings.get or something
idk
if he passes client in his module export you can be fairly sure he called his discord client client and not bot
@marble needle Can you help me please.?
just saw that you defined some db table as client.guildsettings, disregard what i said earlier
dude if i haven't replied after the 5th mention you won't make me reply after a 6th
@slate kayak if your thing crashes on line 28 does the mentioned check work?
can I get some help with the "Discord Server List" ?
it's being fixed
everything works but i only get that error when i do prefix help @marble needle
]#
does it only crash on <prefix>help (e.g all other commands work) or does every command crash
How would i go around making my bot respond to dms?
lib?
It straight up refuses to find it
not using python but they also seem to have a ChannelType property https://discordpy.readthedocs.io/en/latest/api.html#discord.Channel.type
could check for that and return if the type's private
accidentally linked the /latest/ docs but it seems to be the same for async
DM: message.server is None
how can i implement that?
An if with that condition
reuploading my bot to my VPS for like the 10th time today
It works on my PC
lets hope it works on the VPS. 🤞
@slender thistle `@commands.command(pass_context=True)
async def rps(self, ctx, member1: discord.Member, member2: discord.Member):
channel = ctx.message.server.channel
await self.bot.send_message(member1, "You have been invited to RPS, choose either 'Rock' 'Paper' or 'Scissors'")
await self.bot.send_message(member2, "You have been invited to RPS, choose either 'Rock' 'Paper' or 'Scissors'")
`
i have this
Hi
no_pm=True in command decorator @unreal rampart
Does client refer to client ID?
const dbl = new DBL('Your discordbots.org token', client);
np
implement a listener for "error"
you prolly lost connection to the websocket or something
if (message.member.roles.has(allowedRole.id)) {
console.log('foo')
}else{
console.log('blah')
}
How does that happen? my vps is always on
it returns blah when i have a the role
could also be an issue on discord's side. apart from that, "always on" doesn't mean that there can't/won't be any network issues
damn
if (message.member.roles.has(allowedRole.id)) {
console.log('foo')
}else{
console.log('blah')
}
it returns blah when i have a the role
is there anything I can do to maybe ignore the error so the bot doesn't drop @marble needle
you don't just ignore errors in programming lol
implement a listener for it and you'll get the exact reason for the crash, if it's a network issue you'll just have to reconnect
await channel.overwritePermissions(message.author, {
VIEW_CHANNEL: true
});
await channel.overwritePermissions(everyone, {
VIEW_CHANNEL: false
});
so this is what I'm trying to do but I can't figure out how to get the @everyone role like that I tried doing this:
let everyone = message.guild.roles.find(r => r.id == 562374492316368934);
but it won't work and it would only work on my server.
lmao I swear I tohught about that but I thought it wouldn't work it just worked
tysm
ok
why wouldn't it work lol
its a role like any other, except for the fact that its name can't be edited
oof
if (message.member.roles.has(allowedRole.id)) {
console.log('foo')
}else{
console.log('blah')
}
it returns blah when i have a the role
discord.js
doublecheck if you're even getting the right role
is that even valid js
not that I know of, tho I tested it and it didn't work the way I expected it to. So I'm guessing it is not? correct me if I'm wrong.
No thats not valid js
😄
Dear anyone, what am I doing wrong. I tried this 5 times by now, but it just won't update... I'm using Heroku. Btw no april joke, I tought it might be because I ran out of dyno hours last month so I tried today (new month with new dyno hours)
Well and an extra failed build...
View the build log
Hold on
@pale marsh
Ah fuck
It now needs 3.7
Running 3.6.5
Forced to rewrite
Btw anyone, I fixed it.
I putted in file called 'runtime.txt' with the version of Python
And I had changed this in the requirement file:
google-auth google-auth-oauthlib google-auth-httplib2
to:
google-auth
google-auth-oauthlib
google-auth-httplib2
And then it just worked! Awesome.
Making bots is so confusing
Making a discord bot is not that confusing at all. Most of it has the easiest to follow documentation
?
the detailed description?
someone know how to do a long interval "send a message every hour"
i think its ```setInterval(message => {
console.log('test')
}, 60 * 60 * 1000)```
i'm not sure
setInterval(() => message.channel.send('test'), 3600000)
set the time to whatever you want, but yea setInterval is the best way to do these delayed loops

Hey guys, I hadn't seen this until recently but one of my bots isn't getting an "ONLINE" status. I just tried changing the Discord bot token and it still seems to be doing the same thing
what bot
It's showing "???" instead of "ONLINE".
it needs to be in here for it to be online on the site
@grim hamlet
your bot is not
it was kicked for that reason
It had been for the last couple months...
Umm.. I guess I'll add it again?
Ah, yeah I had adjusted some of the permissions. I must have missed that.
Thanks!
mhm, when you fix the issue you can ping one of the mods and they'll invite it back
I'll add it again. I think all the perms have been sorted out. I just noticed a weird case with a few users with strange permissions
appreciate it!
no no no
So the general flow is to alert the mods rather than resubmit?
your bot is fine on the list
it got kicked from this server
it's still on the list
you dont resubmit for kicks
gotcha
you just gotta fix the issue
and tell a mod
if it was removed from the list
then you'd have to resubmit
make sense?
Yup. Got it. Let me just triple check that isn't the issue anymore on my test server
mhm
epic gamer
Is it normal to see bots with votes back to 0 on DBL when it was more than 70 yesterday ?
@ashen vector yeah, votes reset at the start of each month
Ok I see, thank you.
No prob 😃
uh i submitted a bot to dbl
and it was denied
i didnt save the long description
and i spent so much time for that
💢
can i recover it...
i mean... wrong chat, but why not save it
keep your shit under version control with a tool like git and keep a README.md handy
they even let you import one
i saved it but it was in a git repo and i accidentally reset the git repo
without commiting
:|
you mean deleted?
yesss
oof
well important lesson for the future :) keep your code safe
am i allowed to mention them 🤔
i wouldnt
oh
just put it in general, theyre likely to see
i did a screenshot though so i think i'll just use that as reference lmao
if you check #memes-and-media there are at least 2 mods online rn
oh
gl
yess
I autosave all my code in google drive
please say sike
ekis
Can someone help me with this?
I am trying to get the first user in the list of users who reacted to a message.
Here is my code:
client.on('messageReactionAdd', (reaction, user) => {
if(reaction.emoji.name === "✅") {
console.log(reaction.users[0]);
}
});```
I am trying to get this user:
'267025484028706816' => User {
id: '267025484028706816',
username: 'Vanished',
discriminator: '1111',
avatar: 'a_547cce2e1af163a30b3c9ce59a849f16',
bot: false,
lastMessageID: '562550225873403914',
lastMessage:
Message {
channel: [TextChannel],
deleted: false,
id: '562550225873403914',
type: 'DEFAULT',
content: 'hmm',
author: [Circular],
member: [GuildMember],
pinned: false,
tts: false,
nonce: '568721003362910208',
system: false,
embeds: [],
attachments: Collection [Map] {},
createdTimestamp: 1554192825526,
editedTimestamp: null,
reactions: [Collection],
mentions: [MessageMentions],
webhookID: null,
hit: null,
_edits: [] } } }
if you just want the first user, you shouldnt use messageReactionAdd
you should use something like message.awaitReactions or message.createReactionCollector
since those can be switched on and off
messageReactionAdd will run forever and execute on ALL reactions from EVERYONE
?
<html>
<style>
.longdescription .content {
border-radius: 360%;
padding: 0px;
background-color: #0c0c0cab;
margin-top: 0%;
color: #0c0c0cab;
}
</style>
<style>
#bot-details-page {
background-image: url("https://nebot.us/assets/24.png");
background-color: #1f2424;
background-repeat: repeat;
padding-top: 120px;
width: 100%;
position: absolute;
z-index: 1;
}
</style>
<style>
.bot-description {
font: 400 14px "Karla", sans-serif;
color: #ffffff;
line-height: 1.36;
margin-top: 10px;
}
</style>
<style>
#createdby b {
background-color: #4fb4f9;
}
</style>
<style>
#bot-details-page .bot-img {
display: block;
width: 260px;
height: 260px;
background: transparent;
box-shadow: none !important;
animation:float 10s ease-in-out infinite;
content: url('https://nebot.us/assets/nep.png');
}
@keyframes float {
50% {
transform: translatey(-20px);
}
}
</style>
<style>
#bot-info {
background-color: #00000029;
}
</style>
<style>
@keyframes float {
50% {
transform: translatey(-20px);
}
</style>
<style>
p {
color:#FFF;
}
</style>
<body>
<iframe src="https://nebot.us">
<p>Your browser does not support iframes.</p>
</iframe>
</body>```
you dont need new style tags for every single css rule. also you dont need the html tag nor body tags
other than that i dont know what you want lol
he's asking why it doesn't work when it's all in one style tag
It should work
@quartz kindle can I get some examples for the reaction collector?
Thanks.
@quartz kindle How do I access the users in that collection?
@slim heart it's very reliable
If you need data consistency I recommend something like Apache Ignite
@slim heart I want to access the users that have reacted an emoji with the ReactionCollector
Doesn’t that kinda destroy the purpose of sharding
@lethal sun with the collected one, inside the collection, by the key of the emoji you want there’s a users collection in that
do you actually need to have a Developer License (Discord) to be able to have purchase-able in-game items?
will that then allow you to sell things? or are you able to just sell it on on your website without the need for the License
this isn't the place to ask that
this is discord bot development not discord game development
im asking in regards to a bot
you need the license to publish your game on the discord store
No, the license only allows you to publish game onto the Discord store. You can buy games and in app items without it.
@earnest phoenix
yeah
im still waiting for them to allow developers to upload mac and linux builds
To make a bot, you dont need the license.
Understood.
So it wouldn't be required if I were to sell premium items in my economy bot?
no not at all, as you arent selling the items through the discord store, but your own system
Thankyou :)
👍
someone know how to purge message of a user ?
get x messages from channel, filter the collection (array) so there are only messages whose author is y, pass that to your lib's method to delete messages
im trying to set up a webserver with flask, but i get an exec format error on line 8 (app.run)
from flask import Flask, redirect, render_template, send_from_directory
app = Flask(__name__, static_url_path='/static')
@app.route('/')
def helloWorld():
return send_from_directory('main.html')
app.run(host='0.0.0.0', port=8080, debug=True)```
removing debug=True seems to fix it 🤔
Full traceback please
File "server.py", line 8, in <module>
app.run(host='0.0.0.0', port=8080, debug=True)
File "/home/cyber28/.local/lib/python2.7/site-packages/flask/app.py", line 943, in run
run_simple(host, port, self, **options)
File "/home/cyber28/.local/lib/python2.7/site-packages/werkzeug/serving.py", line 988, in run_simple
run_with_reloader(inner, extra_files, reloader_interval, reloader_type)
File "/home/cyber28/.local/lib/python2.7/site-packages/werkzeug/_reloader.py", line 332, in run_with_reloader
sys.exit(reloader.restart_with_reloader())
File "/home/cyber28/.local/lib/python2.7/site-packages/werkzeug/_reloader.py", line 176, in restart_with_reloader
exit_code = subprocess.call(args, env=new_environ, close_fds=False)
File "/usr/lib/python2.7/subprocess.py", line 172, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error```
@mossy vine Do you literally just use send_from_directory('main.html')?
no im trying to figure things out and that is just the code from that moment
Tbh not sure what causes that
It works for me just fine
from flask import Flask, send_file
app = Flask(__name__, static_url_path='/static')
@app.route('/')
def yeet():
return send_file('start.bat')
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
Sending request to http://127.0.0.1:5000/ works fine 
Oh, wait
python2.7
i dont even know what version of python im using
Try using python3 when running the script
vscode says im using python 3.7.1 but flask is installed in a python2.7 folder
running with python3 says that flask is not installed
You installed it through wrong environment variable
Install it on pip3
pip seems to be Python 2.7 for you
running with python3 still gives the same error
Literally the same one or something changed?
it changed to
Exec format error: thepathofthepythonfile
good day. how do people usually create proper frontpages for bots on dbl? what is the best (looks/labor) way of getting some simple design (but not just text)? It should also be able to use that same design for any other bots index sites. I have experience in wordpress, css, bootstrap. any recommendations?
You can use CSS in long description 
okey so all designs are custom css, and i guess most people take templates from somewhere to achieve this?
because i dont want to tinker on css code to be honest
Cyber, what's string of file path you have?
?
you mean this?
OSError: [Errno 8] Exec format error: '/media/cyber28/Maxtor/Coding/python/cyber28.xyz/server.py'
is this modesta responsible for the whole design of your site?
yes. modestacss made by alexflipnote. i really love it, tho people may judge you as more and more people start to use it as a basic template
and can you use frameworks like that / can you include css files in the long desc of the dbl bot frontpage?
of course
Tbh I can't reproduce this. Can you show me the full script and how you run it?
ok nice thanks
i sent the full script earlier
Ah
i run it with just python server.py or python3 server.py, producing the same traceback that also includes the file path
What's the full traceback when using python3?
File "server.py", line 8, in <module>
app.run(host='0.0.0.0', port=8080, debug=True)
File "/home/cyber28/.local/lib/python3.6/site-packages/flask/app.py", line 943, in run
run_simple(host, port, self, **options)
File "/home/cyber28/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 988, in run_simple
run_with_reloader(inner, extra_files, reloader_interval, reloader_type)
File "/home/cyber28/.local/lib/python3.6/site-packages/werkzeug/_reloader.py", line 332, in run_with_reloader
sys.exit(reloader.restart_with_reloader())
File "/home/cyber28/.local/lib/python3.6/site-packages/werkzeug/_reloader.py", line 176, in restart_with_reloader
exit_code = subprocess.call(args, env=new_environ, close_fds=False)
File "/usr/lib/python3.6/subprocess.py", line 267, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/media/cyber28/Maxtor/Coding/python/cyber28.xyz/server.py'```
Guys so I'm trying to add logging to my bot and it's working but I have 1 issue from what I understand to make the embed show the current time u need to keep setTimeStamp empty ( .setTimestamp(); ) but it seems to crash my bot "rich embed fields may not be empty".
show code
looks valid to me /shrug
if you remove .setTimestamp() do you still get the error?
it said fields cant be empty but both messages should have content
ow yeah I actually do still get the error
I don't understand how you manage to get OSError. I literally can't reproduce it in any damn way lol
it only happens if debug is set to true in app.run()
I have it set to True and it still works
¯_(ツ)_/¯
Any1 need help?
how can I do a variable where are the members of a dc server?
@earnest phoenix either the content of newMessage or oldMessage is false
and how i write them in to a message
@earnest phoenix "rich embed fields may not be empty" its bc a variable is not define
and the bot cant add it in .addField
santana, he might not be using js
No, because newMessage or oldMessage is false @earnest phoenix
after sending the embed
And the second param of an field can't be a boolean
Is there a way to make it so if someone clicks the vote button on the dbl website a message gets sent to a channel saying: (user) has just upvoted Cryptonox! My Bot is running on Discord.js
do you have that event inside something else
Wdym @earnest phoenix
@dapper glade Webhook exists
@dapper glade #topgg-api i think
Mk
im so confused rn it happens with every embed I try to send
Does api support webhook?
I told you your problem @earnest phoenix
if the embed sends, thats not the problem
ok wiat
its the event I think
did I forget anything?
cuz it doesnt crash when its commented
looks fine
Different text editors have different colors
default visual studio code
Okay, but he's like confused
its commented out thats why its green
No ^
in default vsc theme comments are dark green
He meant this part ^
oh that
Yeah that 😂
because its a class and in vsc default theme those are light green
wait i didnt even read context
ok imma just leave to avoid losing more braincells
If its the same, it shouldn't even fire the event at the first place
yeah
Also, i see a bug there
Embed loaded = content stays the same
why my bot crashes ?I want to make a @golden gull bot, and it should tag someone random... client.on('message', message => {
// If the message is "@golden gull"
if (message.content === '@golden gull') {
var user = 1;
var userrandom = guild.memberCount;
message.channel.send('test');
}
});
where do you define guild
you appearently dont
you would need message.guild.memberCount
also you tagged some rando xd
xD
and memberCount won't provide you a random user
yes, it isnt ready yet, but it chashes if i want tofine the variable user
wait, i think i know how
Cyber told you how, multiple times in fact
y o u n e e d message.guild
how, i dont understant where i should write message.guild
...
would be a good way to start from
help yourself
@earnest phoenix side question, did you make that website?
yes
i love it
5 minute mess
please learn javascript before you ask us for help
I'm keeping that url
yeah, but i want to know, how i know how much members are on a server
thanks a ton
oml
you need a guild object
and you can use the memberCount property on it

figure it out
or read the goddamn docs
@quiet topaz Go learn JS, don't come back until you know the basics (at least). You're not only wasting your time on shit, but our too. Now, bye!
not a method, property
ok, i go and learn xd
please be nice to beginners
Bro, scroll up ^
using the users collection would rather be more accurate than memberCount
i saw
😑
Okay than
please direct them to actual guides instead of just telling them to learn the language
@quiet topaz Please stay with us here, we are going to help you waste our time! ❤
its called self dependency and learning to do research
satana please
unless you have fetched every user from the guild, using the users collection won't give an accurate member count
saying as Guild.members.size as an example
they want to return a random user
this chat man
yeah, i know better batch script vbscript
and dont get discouraged by guys on discord servers that just say "learn js"
thats a start 👌
ngl, doing discord bots to get into programming is a brilliant idea. dbots are simple and multipurpose bots get you into figuring out APIs and stuff
although you aren't gonna get many servers, your aim shud be to learn not expand
eh not really. youre learning a lib more than youre learning the language
hm fair
i am to frustrated for js
Learning the language basics and basic scripts is better than doing using high-level libraries without knowing basics of language
especially since you can get a decent bot going by watching tuts and using boilerplates without actually understanding how anything works
discord bots are cool and all but its not an ideal place to start
yes, but i dont know what i should program with batch or vbs
ive never used vbs, but i doubt you'll get anywhere with batch
i think batch is easyier than vbs, sry for my bad english...
np ur english is fine. Up to you tbh. My batch experience was bad, partially due to notepad being my editor and an inability to understand batch properly
i am playing roblox know... bb
i want to do a leaderboard in json and i do one but, its just say the top user and not a top 10
someone know how to do a top 10 ?
@earnest phoenix that makes no sense... you at least need to give an example of your JSON data and a bit of code showing what you have
dont use json as a database
How can I get an name out of an voice channel id (in Python)
no its not
if youre writing to json youre very prone to corruption
its not a database and if you could use json instead of a database, none of them would exist
json is only for reading static data
@idle basalt using json doesn't necessarily mean writing to a file tho... you could store it in RAM and update file data before stopping the program
it's a file with strictly typed syntax, it's size will grow in a dramatic way very quickly, and due to the nature of being a file you can't do async operations like editing/reading it from two different places at the same time
true but the OP isn't asking if json is bad
were preventing problems before they start
nothing wrong with educating people about bad practises and suggesting a better solution
its up to them to decide whether or not they'd like to change their project, if the file corrupts upon read/write it'll be on him :>
Hi, I was wondering if anyone could help with the loops in JS. This is my code.
var br = ["x", "x", "x"];
for (var i = 0; i < 3; i++){
const filter = m => m.author.id === message.author.id;
message.reply("Insert var. Will expire in 10 seconds...").then(r => r.delete(10000));
message.channel.awaitMessages(filter, {
max: 1,
time: 10000
}).then(collected => {
if (collected.first().content === "cancel") {
return message.reply("Canceled!");
}
br[i] = collected.first().content;
})
}
I'm trying to make the user write something in the array br. If I do it without the For loop, it works once, but I want to keep collecting the output of the users... This or a while loop is the only thing I could come up with, and it doesn't seem to be working.
do you want to collect the first three messages?
Yes
Damn I didnt notice that
I'll try it now
Hmm the program doesn't wait for me though, he just runs the loop For three times, without waiting for an answer or at least the 10 seconds.
uhh no, remove the loop
Okey, I see, I dont need the loop anymore
And how do I tell the array br to store the data? Since I dont have the var 'i' anymore?
br[1] = collected.second().content;
br[2] = collected.third().content ```
Like this?
hmm collected.second and .third aren't functions apparently, so it doesn't work
I'm checking the .map in the Discord Guide, thank you
Thanks for the help, at least I'm not bugging my mind with the loop anymore xD👍
@inner jewel @loud salmon my bot was kicked from Discord Bot List for a permissions issue where it was responding over DMs to enable "send messages". Everything should be sorted out now. Can I get it un-kicked or should I reapply?
https://discordbots.org/bot/487298106849886224
Sorry for distracting, guys 😃
Awesome. thanks!
@earnest phoenix, Use https://enmap.evie.codes
nope
She's working on Josh now. Almost v5
@earnest phoenix, It's a db
with points system
per-server settings
and has an example top10 command
u
?
When I use my music bot it has a static sound when it plays bass or somethhing, the vps runs at around 100mbps download is the internet the issue?
so it is wifi?
which lib are you using
discord.js
aka node
it was good before when i had a vps with gigabit internet but then when it hit like 100mbps and i switched vps it sucks
so is the internet the issue?
yep
both
different headphones
its the bass
wen it plays bass it makes static
noises
try playing a local file maybe? see if it happens then
if its fine then, then its internet, but if not, its something else
how do i play a local file
idk how to do that
like a local file on my computer
of course it will work
i use spotify to play the same song
it works without static
maybe just internet then
of the server
Connection.playFile()
yeah or server
-> !