fs.writeFile("./shards.json", JSON.stringify(shards), (err) => {
if (err) console.log(err)
});
if(message.guild.id === "368458249508487168");
console.log("Can't send Shard notifications!")
}else {
if(!message.guild.id === "368458249508487168");
let shardEmbed = new Discord.RichEmbed()
.setAuthor(message.author.username)
.setColor("#0000FF")
.addField("π", `${shardAmt} shards added!`);
message.channel.send(shardEmbed).then(msg => {msg.delete(5000)});
}```
#development
1 messages Β· Page 398 of 1
One secone let me format that correctly so I can actually read it lmao
if(!message.guild.id === "368458249508487168");
let shardEmbed = new Discord.RichEmbed()
.setAuthor(message.author.username)
.setColor("#0000FF")
.addField(":ring:", `${shardAmt} shards added!`);```
that ! there?
why do you have a semi on that if statement
if (err) console.log(err)
});
if(message.guild.id === "368458249508487168");
console.log("Can't send Shard notifications!")
}else {
if(message.guild.id !== "368458249508487168");
let shardEmbed = new Discord.RichEmbed()
.setAuthor(message.author.username)
.setColor("#0000FF")
.addField("π", `${shardAmt} shards added!`);
message.channel.send(shardEmbed).then(msg => {msg.delete(5000)});
}```
should be that
ahh thank you
No it shouldn't
oh
you're missing an opening bracket
yes he is
oh

fs.writeFile("./shards.json", JSON.stringify(shards), (err) => {
if (err) console.log(err)
});
if(message.guild.id === "368458249508487168") {
console.log("Can't send Shard notifications!")
}else {
let shardEmbed = new Discord.RichEmbed()
.setAuthor(message.author.username)
.setColor("#0000FF")
.addField("π", `${shardAmt} shards added!`);
message.channel.send(shardEmbed).then(msg => {msg.delete(5000)});
}
thank you
although that ID isn't ours
ik
that id is too new
its my test
oh
just incase π
I wanna know why you're writing your shards to a json file tho...
oh
You literally dont have to
shards is currency
u cuck
xD
*2500
or just shard at 1k like i did
let me add this ID
Eris does it automatically Turtle π
@delicate zephyr same with d.js
what is sharding
ok
sounds pretty cool
well you could set the number or shards to auto so it does it for u
i wrote sharding at 0 
same Natan
With?
My dick is stuck
ffs
No
I need help
Whenever
I
Try srtting up
A rank
It says the rank doesnt exist

Hello
How do i see if a user has voted?
Discord.js and without the dbl module?
Can't see anything here
Just talks about punishments etc.
GET/bots/{bot.id?}/check?userId=<id>
Turtle > : (
Turtle* also i said not the dbl module 
o sorry
Tortoise!
@spring ember I still don't get how to get it to work
Is https://discordbots.org/api/docs#bots a node module?
it seems like dblapi.js, the one I use on my bot, but how would I get it to work on my website?
you need to write a backend running it
or do the HTTP requests on clients if th'yre for endpoints that don't require auth
ok
I have the code, but I get a 401 error
here:
$(function() {
console.log('hello world :o')
$.getJSON('https://discordbots.org/api/bots/414568996017537044/votes', function(votes) {
console.log(votes);
})
})
thats because you're logged in
oh!
when you are doing requests from code alone you need the auth header
how would I log in?
you don't
ok
you add the auth header
i see
with your api token for your bot
what code would i put in, it isn't here:
@trim plinth
@wet ferry add the header Authorization to your code with your API token
if you are new to jQuery, just use the npm package to save you hassle
I mean Ik how that works, but how would I add the Auth header?
don't
???
you'll be putting your DBL token in the website
which means it'll be public
don't do that
you keep a cache of upvoters in your backend (eg express)
and send the relevant data to the front end with a rest api
maybe you should just use something like snekfetch instead for now instead of jumping into unknown territory
wouldn't solve the main issue
what is snekfetch?
well if you don't know jQuery to the fullest extent, may be better to go with snekfetch
depends really
@inner jewel can you make a token for full access to the API, but make it not a bot? It would be useful
what
An open token just for API use
why would you need something for other than a bot
or make is so you don't need an api
and how did Solace do it on his website?
what website?
Did you look at the bottom
you mean this? https://discord.is-a-big-me.me/9734bbd099.png
yes
looks like a template

IT IS!
looks like ejs
hmmm
Ok let me make this clearer. I am running node on my website to keep it up and online, but I have the website in a different folder. How can I use the node files to send data to an HTML file from my node file, or get access to the api by putting my tokens in a private .env file. Ok here is my code host thing:
https://glitch.com/edit/#!/rare-expert?path=public/api.js:9:2
You can view it
i guess he fetches the revelant data from the bot process and replaces on the template
If you want to do that you'll probs need to use ejs
google express and ejs
or vue 
you'll need to run backend code
best code ever https://jaczaus.me/i/jg4d8qqrbf31fdd.png
One thing at a time... How would i add a auth header?
can someone just show me how?
@inner jewel
Β―_(γ)_/Β―
Did you try Google
also you definitely don't want to add one there
i am new!
And if your new?
I mean how would I do it?
auth header for what?
like litterally, how would I get the API to show the servercount and points!
You know that gif was directed to you right?
Nvm
kinda says how
get("/", (_,_) =>
render(db.run {j=>
val stats = for(i <- 0 until j.get("shard-count").toInt) yield {
j.hgetAll(s"stats-shard-$i").asScala.mapValues(_.toLong)
}
stats.reduce((map1, map2)=>(map1.keySet ++ map2.keySet).map(i=>(i, map1.getOrElse(i, 0L) + map2.getOrElse(i, 0L))).toMap).asJava
}, "materialize/index.vm")
)```this is what i have on my backend
Β―_(γ)_/Β―
you'll need something similar
What framework would be good for creating a Java website?
Java website 
Backend
oof
π¦
CAN someone just tell me or give me a guide on this????
@inner jewel
it would be helpful
i don't use js
What do you use then?
π¦
@wet ferry There are plenty tutorials
its called go to google.com
search what you want to know
click a tutoiral
@wet ferry what do you need help w/
am I allowed to ask for help with css
sure @hushed oyster
ok
so
i'm making a box with bulma
but if its long enough the content inside the box is going outside of the borders
my code is <p class="box center" style="width: 1000px; text-align: center;">content</p>
Put the p in a div that has the class box instead of giving the class to the p?
Not sure how one could make that
Well nvm I guess, I'll just have to spend some time making my own
Basically its a bot independent webhook for receiving votes and stores them in a db
So it still collects votes when the bot is offline
I mean I'm sure one exists (I think someone made that here)
But you would then have to bind it to a port and then a domain and such
So lots of config setup anyways
@glossy mason still has the same result
Any chance you could throw it into a CodePen or something, where I (or someone else) can look at and tinker with it?
it's for a secret project that I don't want anyone to know about yet
i won't

@tiny lodge I want to have a website with a vote count and a server count. I was wondering how that is possible with my setup: https://glitch.com/edit/#!/rare-expert?path=public/api.js:9:2
wy are people joining?
lol
oh to help me
$.getJSON('https://discordbots.org/api/bots/414568996017537044/stats', function(data) {
console.log(data.server_count);
});
that was a test
i got an error because I have to log in, but I don't want to put my api token in
because it would be public
how would I even define an api token and make is secret?
and yes, that's what I need help with
make a separate config file
wdym?
You can make it in process.env I think
dunno
It definitely does not
This is a public glitch repo so probably process.env is better
now it does 
lol api requiers auth
@wet ferry wrong!!!!
^
not all endpoints require auth!!!!
???
stats endpoint (where you just get info on a bot) I can't see auth requirement
The API docs even list what requires auth
Well, what abt votes and servercounts?
and that's mostly just the stuff for posting stats or looking at stuff more focused to the bot and the dev
wait stats endpoint isn't auth required
wy can't I get those
lul
Server count can be done without auth
π¦
I literally posted doing that earlier
yeah it doesnt require auth
Ik it isn't auth required for stats because I have a dbl command that searches any bots stats from the API and it doesn't need auth 
HTTP Status Code 401: The request has not been applied because it lacks valid authentication credentials for the target resource.
But as everyone else said, getting vote count does require auth.
HTTP 401 !== HTTP 403

wait why would vote count be locked behind an auth gate
idfk
yeah it isnt
We're not talking about that
not just votes
points
https://discordbots.org/api/bots/{botid}
if u request that you can find the points there
"points" 
shard count, etc
Probably better to just get /bot/id rather than /bot/id/stats
@tiny lodge that endpoint only give server count and shards
api identifiers change over time, probably sometime along the way it was converted to votes but they didn't change the JSON 
/bot/id give everything about the bot
Nice
That's a smol points and server count
9 votes and 16 servers reee
lmao i have 19 on a 1.6k server bot
LOL they still have betadesc in the API
i dont really care about upvotes
The most I've ever had is 2, for 570 servers
Sadly you have to care about upvotes because they make your bot higher in the list
yup..........
if you want attention, upvote lock 
I didn't even meet my cert requirement when they added upvote
@elder rapids upvote rewards soonβ’
But I do now
I literally have a vote-beg on my site
But it's a small notification they can click away (and it stays away for a week)
personally I prefered the old way of cert previously but ehhh it's fine as they were probably getting flooded with cert apps
what are you trying to get?
bcos /bots/{botid} gives you points if that's what you wantt
ok have fun with your stats and such
lol
wy won't this work?
$(function() {
console.log('hello world :o')
$.getJSON('https://discordbots.org/api/bots/414568996017537044', function(data) {
console.log(data.server_count);
console.log(data.points);
data.points.appendTo('strong#votes')
data.server_count.appendTo('strong#servers')
})
})
I can't .appendTo , but how would I format it so I can?
it's in api.js: https://glitch.com/edit/#!/rare-expert?path=public/api.js:9:2
and the html code is here:https://glitch.com/edit/#!/rare-expert?path=views/index.html:99:45
@tiny lodge
@topaz fjord
@trim plinth
@elder rapids
β
lol
wy does everyone leave
ya with the stuff I do, I pull a big gay and use snekfetch for my http shit
Well for one
cus I don't usually make websites
so youll be better off w/ the others
ahh vue, I wanna get into that so bad
It's really nice
I'm making a single page app dashboard
Mee6 made a SPA website
I like SPA so I decided to do my own (plus my site need an upgrade anyways)
owo
@wet ferry Because appendTo is not a function. You can do:
$("strong#votes").text(data.points);
$("strong#servers").text(data.server_count);
It works:
thanks sooo much!
based tyrone EVA ending: https://www.youtube.com/watch?v=oyFQVZ2h0V8
any ideas why the server count on discordbots.org isnt showing? is there a minimum limit?
it just says N/A
ah, negative, i will add it in the morning and see how it goes
thank you
Server count examples should be deleted that shit is legacy
I wouldn't recommend viewing that for info
Just look at the API online and use official libs if you can
L
Do you mean JDA?
I don't know java, sorry
its fine π
I'll figure it out eventually π¦
hey does anyone know java 8 or jda?
How can I display the bots uptime with discord.py async?
I'm sure there's a argument for it though, like bot.uptime or something.
I'll just do trial and error on my bots debug.
Β―_(γ)_/Β―
@gilded thunder there is no such argument. As @lament meteor said. Set a variable at startup and then retrieve it.
arc!stats
not here
welp
why do you have an uptime function?
That's all I could think.
class MyAwesomeBot(discord.ext.Bot):
def __init__(self):
self.startup_date = datetime.datetime.now()
and import datetime, right?
and discord yes
Thanks, at least this will work 
(the class and __init__ are not full examples)
message.channel.send("**These people reacted with " + classes[i] +"**\n" + reactions[i].users.map(s => s.username + ' Discord ID: ' + s.id).join('\n'));
await message.channel.send("**These people reacted with other / they are leftovers**\n" + otherR.users.map(o => o.username + 'Discord ID: ' + o.id).join("\n"));
``` how can i make it so that the 2nd message waits for the first one to finish
await the first one
await just waits for that function to complete before proceeding
^
(anyways you must await all message sends)
Read about coroutines
XkijuX Discord ID: 202159988666400769
These people reacted with other / they are leftovers:
These people reacted with priest:
XkijuX Discord ID: 202159988666400769
These people reacted with other / they are leftovers:```
didnt work
show what you did
Show code
also do what @spring ember said
(also also PLS use discord.py rewrite, not async since it's feature locked and will be deprecated soon)
welp i'm screwed.
what have you done
using async.
Await message.channel.send("**These people reacted with " + classes[i] +"**\n" + reactions[i].users.map(s => s.username + ' Discord ID: ' + s.id).join('\n'));
await message.channel.send("**These people reacted with other / they are leftovers**\n" + otherR.users.map(o => o.username + 'Discord ID: ' + o.id).join("\n"));
I'll just... add it*
Hmmm that's strange then
pong
It doesn't take much time to convert to rewrite
Ok I can try to do that
Oof
or just develop yourself π€¦
how do you utilise rotating statuses? the below code doesn't seem to work for me. [was originally at 10 seconds but put to 1 for testing purposes]
setTimeout(function() {
client.user.setActivity(`${statuses[Math.floor(Math.random() * statuses.length)]}`);
}, 1000);
i can assume it's ratelimiting(?)
try to put it every 30 seconds or 10 seconds
i tried 10sec
maybe ratelimit
??
@frail kestrel presence update ratelimits are 5 every 60 seconds
oh
if you do it once every 10 seconds you're going to hit the ratelimit
oof
so 60/5 is. . . 12
@frail kestrel what is statuses? setActivity requires an object to be passed
setInterval, not setTimeout @frail kestrel
o shit aeth is on top of the game didn't even realize 
you might want to make it circular instead btw
instead of randomised
but that's very subjective
thats so confusing tbh why do they have setPresence and setActivity
aren't they essentially the same thing
setPresence probably lets you pass a full presence
not just activity but also status (online/dnd/etc)
oh
setActivity uses setPresence, just fucking use setPresence (β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
no u
Discord why u do this
In sql, I have the column x in table y. I want to overwrite all fields in column x to equal 500. How would do that?
UPDATE table_name SET column = value
if you only want to update the values in a column under a specific condition
you can add WHERE into there
ok, thoughtso
@earnest phoenix how did you put your website on your bot page?
<iframe>
the iframe is empty help
wdym @spring ember
I did <iframe src="website"></iframe>
with the my website as the website
and it's blank
<iframe src="https://makersandbot.glitch.me"></iframe>
oh it's because I don't have https
ya...
how do I use font awesome via the dbl site?
Bots page yes
@earnest phoenix hey is it possible to use a map with klasa and mongoose 
wdym
would like to use that for my Starboard and modlog
instead of arrays
since arrays succ for objects
ask Kyra
well if you tell me that then i know the answer already 
oh i think i found another way
...are you capitalizing "Override"?
are you actually overriding? same name, arguments and return type?
do you actually have the jvm configured properly in your ide?
of a method in a superclass/interface implemented
what characters should I escape in SQL string?
you shouldn't build SQL strings manually
is there any lib for that?
use prepared statements
what do you mean? I want to save a tag for example which is a key and value
use a prepared statementΒ²
This JDBC Java tutorial describes how to use JDBC API to create, insert into, update, and query tables. You will also learn how to use simple and prepared statements, stored procedures and perform transactions
oh thanks
guys when i use if (args[0] !== "1" || args[0] !== "2") return message.channel.send("Test")
it says test when i type 1 or 2 but it shouldn't
mention if you want to help
what lib
&&
looks like djs
yes, you are checking that it isnt 1 and not 2
readthedocs
(if you use &&)
if
args[0] does not equal "1"
OR
args[0] does not equal "2"
and*
@earnest phoenix you're being ignorant
this isnt even d.js related
wo what mean or guys
sry
|| = or
&& = and
k
k
i use this
if (args[0] !== '1' || args[0] !== '2') return message.channel.send(".lang [1 / 2]\n 1 for english\n2 for arabic");```
it returns every time i say .lang 1 or .lang 2
because one of those statements gets fulfilled always
it won't fulfill only if args[0] is 1 and 2
which is impossible
thats why you need to use && (and)
// args[0] = 2
if (args[0] === 1 || args[0] === 2) {
// do a thing
1 / 2 will go here
} else {
// do another thing
anything else goes here
}
nvm
hh
xD
okay A big thanks to @solemn obsidian
thanks you helped me
and thanks for trying @inner jewel
is there a certain way to embed my html page into the display, ive tried all the ways i know of.. iframe etc.. i see others have used it, but mine shows up blank. On my bot's page
http
Won't work
Iframe links need to be ttps
HTTPS required
Https
oh ok
Use something like cloudflare or letsencrypt
π ok just threw something together appreciate it
For https
great thanks guys
yes
- learn a programming language
- take a look at the docs of your preferred language discord library
Hmmmmm.... I am trying to make a bot with a few similar commands to one I already made, but the commands don't work when I copy-paste them. Why? (I code in Discord.js)
And also how do I use emojis in discord.js?
Thanks!
whats actually in weeb.sh cause theres from what ive seen few docs on it around why you should apply and whats actually in it
Yay, I made a bot, you may use it. Itβs name is BobboBot. Itβs a bot that can do custom commands, reminders, play music, level ups and more.
dont advertise....
^
you made it yourself
99% of the people in this server have also made a bot...
With all those features in 10 minutes
thats why where here
its not advertising he just sharing his accomplishments
he stole it off of GitHub
i believe the term is "forked"
Not in #development pls
also talking of advertising ive made an images api and wondering where would be a good place to share it around / adverticse
is there a server anyone know where to like share and advertise that stuff?
also how to ask how do i share "this" and describe what "this" is without slightly advertising is interesting...
How is this #development related?
Can anyone help me out with a command?
I'm trying to get whois.com info then print it to a richembed. I'm using whois from NPM and all it returns is object, object
const Discord = require("discord.js");
const fs = require("fs");
const config = require("../config.json");
const errors = require("../utils/errors.js");
const whois = require('whois');
module.exports.run = async (bot, message, args) => {
//$whois (url)
let url = args[0];
if (args[0] === "help") {
return errors.cmdhelp(message, "`$whois (url)`", "Acquires WHOIS information for a given domain.", "Whois");
}
let output = whois.lookup('${url}', function (err, data) {
});
console.log(output);
let embed = new Discord.RichEmbed()
.setTitle(`Whois Info for ${url}`)
.addField(`Returns:`, `${output}`);
message.channel.send(embed);
}
module.exports.help = {
name: "whois"
}```
https://imgur.com/F96mZjJ
That means it's returning an object from the whois.lookup
You have to interpret the data
I would see the API for that to get the data you want
@gilded blaze using? I'm pretty new to JS as a whole but im slowly figuring it out
not asking for a spoon feed
Console log the object
yeah i did that
All the info is there
π
@austere meadow i noticed you muted my bot @meager ember for responding to commands that it didnt have, i originally wrote that because my logs were getting flooded with command not found crap and i wanted to inform users on how to actually use said bot. Ive recently removed that completely and he will no longer respond to commands he doesnt have, requesting unmute π
you could also just JSON.stringify the whois data
@elder rapids I could, but im only tryna get like specific parts of it
- substr is mad inefficient for that
It was a joke ;P
dick π
@spring ember developmemt as it could allow others t further develop there bots?
I didnβt steal it. I took me ages. I have actually been working on that for about 7 days.
That was my brother too.
Sorry about him.
ah, the good ole "that was my brother"
how does one fetch the avatar of a new guild member/
in what lib
discord.js
what version?
latest
let icon =
var welcome = new Discord.RichEmbed()
.addField("Member Joined", `Welcome, ${member}.`)
.setAuthor(`${member}`)
.setThumbnail(``)
//.addField("Total Members",`${guildamount}`)
var role = member.guild.roles.find('name', 'Member');
// Send the message to a designated channel on a server:
const channel = member.guild.channels.find('name', 'server-log');```
so
setThumbnail () should be the avatar of the new member
it would be member.user.avatarURL()
ye
then you could use .user
to get the guildMember as a user
and User has the property avatarURL()
I want to have my bot message the message author in Discord.py
But - my bot iis giving me a "required argument" error
help?
I know I asked this a few hours earlier, but I can't figure out the "@Override" function of jdk 8 (i'm trying to make a basic discord bot on intellij). It seems to understand, but it says something like "method does not override method from superclass." I'm using Windows x86 and yes, I looked it up. Switching the java type isnt working...
are you sure
im googling that error and im finding lots more than switching java type
@uneven sand Async or rewrite?
async
you need my source or no?
I know there are way more solutions but I cant do those
Cuz for some reason they dont pop up π¦
π
await bot.send_message(ctx.message.author, embed=embed)
Replace embed=embed with your text response if that's what you want.
The error.
Also indent by 4 spaces.
Give me the error. @uneven sand
gimme a moment....
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.
Missing ctx.message.author
the full error
That's who it sends the message too.
the entire stack trace pls
k
Pisi
I'm connected to Discord
Bot ID: dfssf
Connected on 5 Servers:
Ignoring exception in command credits
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\discord\ext\commands\core.py", line 367, in invoke
yield from self.prepare(ctx)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\discord\ext\commands\core.py", line 345, in prepare
yield from self._parse_arguments(ctx)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\discord\ext\commands\core.py", line 304, in _parse_arguments
transformed = yield from self.transform(ctx, param)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\discord\ext\commands\core.py", line 212, in transform
raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.
hey
@hidden veldt what's your code?
oh lmao
@uneven sand you aren't providing the command enough parameters
thanks guys for the help
give me your code
k
and put it in code blocks please
its is loading...
HOLD UP
π
package gradle.wrapper;
import net.dv8tion.jda.core.AccountType;
import net.dv8tion.jda.core.JDABuilder;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
import javax.security.auth.login.LoginException;
public class Main {
public static void main(String[] args) throws LoginException {
JDABuilder builder = new JDABuilder(AccountType.BOT);
String token = "NDM2MDE3MTQ3NzYwODY5Mzg4.DbhZdw.lK1f5PY54UIYP7POPlLg4nrr7XI";
builder.setToken(token);
builder.addEventListener(new Main());
builder.buildAsync();
}
@Override
public void onMessageReceived(MessageReceivedEvent event){
System.out.println("we got a message from " +
event.getAuthor().getName() + ": " +
event.getMessage().getContentDisplay()
);
if(event.getMessage().getContentRaw().equals("e!ping")){
event.getChannel().sendMessage("pong!").queue();
}
}
}
there
we go
*Code blocks 
^
also token leak
lmao
@hidden veldt you might wanna reset your token lol
you need to extend ListenerAdapter
well have fun getting your bot defined 
no matter what i do i cant get the dbl library to work
console.log("loaded dbl.js");
exports.commands = [
"check"
];
exports.check = {
process: function(client, msg) {
const DBL = require("dblapi.js");
const dbl = new DBL("xd123");
if (dbl.hasVoted(msg.author.id)) {
msg.channel.send("True");
}
}
};
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size);
}, 1800000);
});
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('xd123', client);
"client is not defined"
@sand vale why are you using the ready event before you even define client
read what i just said
im not talking about that
i currently define it before
console.log("loaded dbl.js");
exports.commands = [
"check"
];
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('xd123', client);
exports.check = {
process: function(client, msg) {
const DBL = require("dblapi.js");
const dbl = new DBL("xd123");
if (dbl.hasVoted(msg.author.id)) {
msg.channel.send("True");
}
}
};
client.on('ready', () => {
dbl.postStats(client.guilds.size);
});
client.on("guildCreate", function(guild) {
dbl.postStats(client.guilds.size);
});
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size);
}, 900000);
});
but when i check if someone voted no matter the value it returns true
and my guild count isnt on the website
ah shit
im retarded
i forgot to replace it when i recopied the example
still doesnt explain why the server count doesnt appear on the site
before that https://media.turtle-bot.com/f/tKtMq.png
why are you redefining DBL and dbl in the exports.check
if you define it outside then you dont need to define it again
just trying things out
just trying things out
doesnt sound like a valid excuse
its not
but even with those fixes both check still doesnt work
and the site doesnt update
const Discord = require("discord.js");
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('nut', client);
exports.check = {
process: function(client, msg,suffix) {
if (dbl.hasVoted(suffix)) {
msg.channel.send("True");
}
}
};
client.on('ready', () => {
dbl.postStats(client.guilds.size);
});
client.on("guildCreate", function(guild) {
dbl.postStats(client.guilds.size);
});
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size);
}, 900000);
});
nvm
so if you pass const dbl = new DBL('nut', client); client into this then it will automatically post the stats to the website every 30 minutes
its not actually nut
idk if that token is supposed to be private or not
so i left it out
How can I make the action happen when I vote?
hasVoted returns a promise
@bitter sundial Its a true?
const Discord = require('discord.js');
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('nut', client);
module.exports.run = async (client, message, args) => {
exports.check = {
process: function(client, msg,suffix) {
if(!dbl.hasVoted(suffix)) return message.reply("You need a give vote! https://discordbots.org/bot/425005732338073600/vote")
if (dbl.hasVoted(suffix)) {
let mesaj = args.slice(0).join(' ');
if (mesaj.length < 1) return message.channel.send(new Discord.RichEmbed().setDescription('Please write a skin name. :writing_hand:').setColor('RANDOM'));
const mesaj2 = new Discord.RichEmbed()
.setColor('RANDOM')
.setDescription(`${mesaj}`)
.setImage(`https://visage.surgeplay.com/full/404/${mesaj}.png`)
message.channel.send(mesaj2);
}
}
};
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ['mcskin', 'mcs'],
permLevel: 0
};
exports.help = {
name: 'mcskin',
description: 'Δ°stediΔiniz Εeyi bota yazdΔ±rΔ±r.',
usage: 'yaz [yazdΔ±rmak istediΔiniz Εey]'
};
it is ```js
Promise is a truthy value so it'll always be true
you need to either await it in an async function or resolve the promise
with .then
Oh!
Not working! π¦
because msg was already defined
This is not happening!
Can someone fix it and code it?
@bitter sundial
Did you just ping Tonkku to fix your code 
@prime cliff
Hi
yup just unfamiliar with json bodies
so all mine look like this
{"content": " {{VideoChannel}}{{VideoPreviewImage}}{{VideoDescription}}{{CreatedAt}} **{{VideoTitle}}** : {{VideoUrl}}"}
https://hastebin.com/fanotewoqu.js
Not working! π¦
This is not happening!
Can someone fix it and code it?
drop the table and recreate
Oh ok
Or just delete rows where 1=1?
Lol no
I want to create web that will list every png file I have on specific folder (/var/www/html/captures/) using php
I already have https://mrsheldon.me/captures/
Just need to make the list there
Oof php wait a sec I need to read the PHP docs
scandir(string $dir) this wil return an array
I didn't understand anything lol I haven't coded php in a long time
Looks good
I use express.js so I do it all with the comfort of JavaScript
But I think php is a great language
Hey guys, Iβm new coder, canβt figure out how to code a bot to count #
Any advice ?
Ok that identifies but how do I count the true?
Like I said newbie coder lol
Does js have a count method ?
count #?
Does that apply in js?
Ah ok
Hey
Hi
hi, anyone got any idea on how to push and pull data to a local database file like sqlite or sqlite3? I cant get the code right for the npm sqlite library, it keeps saying:
TypeError: Cannot read property 'get' of null```
```Unhandled Rejection!:
TypeError: Cannot read property 'run' of null```
so using DblApi.GetVotersAsync(1).. shouldnt that return the last 1 day of votes?
like 24 hours ago from the time now
@glossy robin Code?
im trying to set up a command that lets a user redeem a role using a code
i've looked into it
but keep getting like member not definited etc.
const Discord = require("discord.js");
const fs = require("fs");
const errors = require("../utils/errors.js")
const config = require("../config.json");
module.exports.run = async (bot, message, args) => {
//$help (command)
message.delete();
var offcode = ["censored", "sorry", "lads", "xD"];
let code = args[0];
var role = message.author.guild.roles.find('name', 'Offline');
if(args[0] === offcode) {
message.author.addRole(role);
return message.channel.reply("Yo, what is up boys.")
}
}
module.exports.help = {
name: "redeem"
}```
can anyone throw me some help with that?
well thats not the error i even got
i know i fucked that part
but like idk why member isn't saying its defined
because even when i define it
it dont work
does it even have member in there
@cunning oxide ERROR at line 17. message.channel.reply is not a function. use message.channel.send();
@cunning oxide also try message.member for adding roles
any of u familiar with the GetVotersAsync method?
Nope im not
argh π
^ Yeah, that there should be message.reply
Code
@bot.command(pass_context=True)
async def hackban(ctx, user: discord.Member):
if ctx.message.author.server_permissions.administrator or ctx.message.author.server_permissions.ban_member:
embed=discord.Embed(title="User hackbanned.", description="User has been hackbanned.", color=0x176cd5)
await bot.say(embed=embed)
await bot.ban(user)
else:
embed = discord.Embed(title="Permission Denied.", description="You don't have permission to use this command.", color=0x176cd5)
await bot.say(embed=embed)```
Error
```Ignoring exception in command hackban:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 367, in invoke
yield from self.prepare(ctx)
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 345, in prepare
yield from self._parse_arguments(ctx)
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 304, in _parse_arguments
transformed = yield from self.transform(ctx, param)
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 223, in transform
raise e
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 221, in transform
return (yield from self.do_conversion(ctx, converter, argument))
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 184, in do_conversion
return instance.convert()
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/converter.py", line 100, in convert
raise BadArgument('Member "{}" not found'.format(self.argument))
discord.ext.commands.errors.BadArgument: Member "80351110224678912" not found```
Hackban rofl
Why did you call it hackban? π€£
When it works, that is.
Everyone else calls it hackban.
Banning a member who isn't in the server.
Member not found.
But it passes an ID to ban.
In my case, tested with b1nzy's.
If I had it as async def hackban(ctx, member: discord.Member): then it would need a ping.
Mh, I don't think that is how hackban works. Try it with my id.
ID not found.
Are you sure hackban works like that?
Yep.
It only works on rewrite, I believe.
anyone have a c# httprequest GET to get voters in the last 24 hours? π
It works for rewrite on my end.
@gilded thunder https://github.com/TheTrain2000/async2rewrite
GitHub
async2rewrite - Automagically converts discord.py async-branch code to rewrite-branch code.
I'm aware of it.
ah ok
how di u
do pip3
Good luck. DM if you need help.
@gilded thunder if u want to ban all peoples that not currently in the server use an event
i don't what language u use but make an event that when someone join he got ban
unless he was in the whitelist
probably already previously mentioned: add a built in function to quote previous posts in a channel on any server your in.., does anyone have something of that sort written already?
ature of discord.py i've seen ppl quote others, is that bot related, or a built -in cmd feature i overlooked?
welp, half my msg went to sh~
how can u easily quote others in discord?*
w/o a bot
outside of high-lighting the words and ctrl+ copy and ctrl+ paste
a direct quote from a user
any help?
I need help, so here is my code for report.js=
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
console.log("works");
};
module.exports.help = {
name: "report"
};
and it gives me this error
SyntaxError: Unexpected token (
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at jsfile.forEach (/Users/samirtata/Desktop/Strike/app.js:20:15)
at Array.forEach (native)
Update node
and how do i do that?
your node version doesn't support async/await
what OS?
uh you can either download the newest version from the node website or you can use the n tool
if you're on windows go to nodejs.org and install current
if you're on linux use google its ur friend
ok so I downloaded the pkg from website, do i just drag it into my bot folder?
no
uh no
you need to install it.
node is a runtime
~~Phanta you have to speak english to the kid
~~
ok I am installing it
nice i downloaded it and I did rs and it does not do anything
yeeeee
Why does it do that
Ok yes
What are the requirements for a bot to be listed under the "music bots" section? Because my bot ( @azure ermine ) can play music but is not there.
I know it's stupid to ask coz it would be at the very end with the low vote count but I want to be prepared for when it potentially becomes more popular
Edit: If it was adding the music tag then I've done that since posting this question
Music tag will automatically add it there, the position there depends on amount of upvotes
using java scrip how do I add that awesome log for user updated their pic side by side?
that is sweet ^^
Some of your guys bots just amaze me, thats talent and hard work in action!
Canvas, 2x width of normal profile pic width, 2nd pic offseted by the width of pic
ty ill look it up ^^
trying to make logs for my bot and here gives me so many ideas implementing them as a new coder that's the hard part
http://prntscr.com/j7oujt got this one done for the most part but i get so many logs that a user has edited their msg and they haven't i did something wrong
http://prntscr.com/j7ovay
same with name changes
http://prntscr.com/j7oujt
One step at a time for an old man just learning the ropes
you get logs that user edited while they havent
because on discords end embedding an image
yea
is editing the message
so if I post a link
it gets edited when this image appears
ok that explains so much
you can check if the content doesnt change then ignore
ty, so much studding to do wish I was young and doing this, seems like at 42 my brain takes longer to absorb new info
you are welcome
I did figure out how to do an event with out a prefix to pull info thankfully that took forever
http://prntscr.com/j7oxgt
@solemn obsidian how do you store the image that was removed?



