#development
1 messages · Page 1274 of 1
One message removed from a suspended account.
🐸
const Discord = require("discord.js");
module.exports.config = {
name: "ban",
aliases: []
}
module.exports.run = async (client, message, args) => {
if(!message.member.hasPermission("BAN_MEMBERS")) return message.channel.send(':x: **You don\'t have permission to run this command!** :x:')
if(!message.guild.me.hasPermission("BAN_MEMBERS")) return message.channel.send('I don\'t have the right permissions.')
const member = message.mentions.members.first() || message.guild.members.cache.get(args[0]);
if(!args[0]) return message.channel.send('Please specify a user to ban.');
if(!member) return message.channel.send('Can\'t seem to find this user. Sorry about that!');
if(!member.bannable) return message.channel.send('This user can\'t be banned. It is either because they are a mod/admin, or their highest role is higher than mine.\n\`Or:\`\nthe bot you trying to ban with, owner, etc!');
if(member.id === message.author.id) return message.channel.send('You can\'t ban yourself!');
let reason = args.slice(1).join(" ");
if(reason === "") reason = 'Unspecified';
member.ban(reason)
.catch(err => {
if(err) return message.channel.send(':no_entry_sign: **Something went wrong!** :no_entry_sign:')
})
const banembed = new Discord.MessageEmbed()
.setColor(0x75ff58)
.setTitle('Member Banned')
.setThumbnail(member.user.displayAvatarURL())
.addField('User Banned', member)
.addField('Kicked by', message.author)
.addField('Reason', reason)
.setFooter('Time baned', client.user.displayAvatarURL())
.setTimestamp()
message.channel.send(banembed);
}
Why anyone help?
because theres an error
quite literally cannot tell you the issue if we dont know the error
make spscific variable maybe?
do you understand what this is doing
.catch(err => {
if(err) return message.channel.send(':no_entry_sign: **Something went wrong!** :no_entry_sign:')
})
yeah it catches errors
It doesnt pop on my terminal
cause your catching it
how can I seeit?
log it
delete the command
log the err
but can I delete it too?
if you delete it and theres an error your bot will most likely go offline
if you delete it and theres an error your bot will most likely go offline
@thick gull so it can pop up on my terminal
where do I put console.log then
console.log(err)

or with //
bro just tell
lol
I will delete the command and put it back after
@thick gull

:facepalm:
@thick gull how can <i consolelog it got dammit
learn the basics of js pls
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
then what's the point of making a disc bot lol
One message removed from a suspended account.
One message removed from a suspended account.
no but i mean like
who would even make a disc bot and think. OH IM JUST GONNA STEAL PEOPLES CODE AND NoT LEARN ANYTHING
One message removed from a suspended account.
Ardor why i deserb to be beeat
@autumn aspen i use
constandlet😎
@thin turretletganglets go lmao
Lul
and copy and paste shit without knowing what its doing
@sage bobcat at first i thought he actually knew js and was trolling, considering he knows how to ban, get multiple args, and check perms
but then i remembered he copied it

The code: const num = 10;
The guys code: 10 = num + const();
XDD
let Endph = {"definition": "Someone who steals code", "userexampleid": "722434956202344499"}
let let = let
let Endph = {"definition": "Someone who steals code", "userexampleid": "722434956202344499"}
@zenith knoll ha..ha...ha
const const = const
ha...ha...ha
var var = var
u done with learning js?
yes
Eww who quotes a integer in an array
const json = require("./jsonexample");
console.log(Object.keys(json).length);
IF the jsonexample.json looks like
{
id: "101001",
something: "idk"
}
@autumn aspen what does this return in console?
vv this person is an absolute weeb vv
/\/\ mirror /\/\
mmm
then what's the point of making a disc bot lol
@sweet ruin because he wants to feel like he made something
yes
people don’t realize that programming is not just copy pasting everything
theres no fun in it
or following a tutorial
if u copy
sure you can look at those as examples
Yeah, it's all docs
but that’s not what it really is
when I was starting JS I looked at other peoples code and etc
never copied it
search it up
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
Is join/leave channel or role manage rate liimited?
everything is
pretty much everything is ratelimited
relategd dto discord functions
and if it's not, it is, because global ratelimits
like sending, getting, (not fetching idk y)
@autumn aspen what does this return in console?
@zenith knoll wouldnt it return an error because the filetype wasnt specified?
Or does require automatically get filetypes for js and json files
🐸
its a json object
there is no such thing as a json object
There are objects. And there is json.
json is literally an object
No, JSON is a string.
i guess
The only place that tries to call something a "JSON Object" is w3schools and their site is shit.
what are some reasons not to use quickdb
Outdated
quickdb is one of the slowest database wrappers
W3 still uses document.write()
Compared to the leading brand™
🐸
what are some reasons not to use quickdb
@stark abyss its slow
ic
compared to mongodb
Other than that, it's very functional for what it does.
Though, biased opinion here, enmap is better than quick.db if you want something easy to use 😛

Quickdb slow but my rewrite which is never gonna be finished isn't
thats me
quickdb can be as fast as enmap if it keeps imitating enmap 
Why would I wanna imitate enmap :yert:
i feel like mongodb is the standard for discord bots
@misty sigil because you can get free 500MB in their site
god this is a straight up war
and bots store like strings
Because you already did by switching ot better-sqlite3 after I did 😛
@thick gull and its easy to host your own clusters
yea
Friendly competitive jabs guys, nothing to see here, move along
and it works well for the data that most bots are storing
tbh "mongo is the standard" is only true because "every blogger uses mongo because every blogger uses mongo"
if you use quick.db, just learn sql[ite]
Cargo culting at its best.
Hey cane were help me?
I wanna make a welcome message with image manipulation (pillow)
Maybe cancel were help me? (Python)
why is atlas the first thing people think of when it comes to mongodb?
Because it's an official tool, as in, it's made by the mongo team, so it's often linked, and has high rankings because of this.
valid point ig
i'm trying to find the username closest to the value entered, but it doesn't work. where am i doing wrong
message.guild.members.cache.find(m => m.user.username.toLowerCase().includes(args.join(' ')) === args.join(' ').toLocaleLowerCase())
ex: /avatar aprox
return: aproxthethat
error?
One message removed from a suspended account.
One message removed from a suspended account.
Cannot read property 'user' of undefined
One message removed from a suspended account.
One message removed from a suspended account.
yea
One message removed from a suspended account.
i wanted to see if you had an error first 😛
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
im a just remind that there is different versions of js
a client side js
used in chrome browsers and others
that’s for clients; e.g. websites
node is just a runtime
There are also other JS engines 😛
didja know there was a Java javascript engine? It's called Rhino.
which is more of a framework
There's also JScript which is the core Windows engine
been around since windows 98 I think
can someone help me with a simple purge command that deletes an remakes channel with same perms in discord.js pls
Thanks
else (cmd === "clean")
{
channel.clone
channel.delete
}
literally just this
shit
forgot ()
it doesnt exicute in the channel
you have to define the channel:)?
class purgechat : BaseCommandModule
{
[Command("pc")]
[Aliases("purgechat")]
[Description("Purges chat")]
[RequireRoles(RoleCheckMode.Any, new string[] {"gang", "OWNER" })]
public async Task Pc(CommandContext ctx)
{
DiscordChannel channel = ctx.Channel;
await channel.CloneAsync();
await channel.DeleteAsync();
}
}
is how its done in c#
<pc is done
in that channel
< interesting prefix
yea
its the development version of my main bot
with the prefix of >
whitch has 4chan greentext
>greentext
greentext

its jank bc its uses css codeblocks
but whatever
how do i make it run in the current channel
like i said
c# and py gang
how do I not loose my mind while coding
dunno

but @umbral zealot how do i make it so it looks for the channel its exicuted in
@sudden tulip message.channel
😐
no?
how to get a specific thing out of an array? ive tried .splice(5, 5) but sometimes it cuts the rest of the array
he’s not using JS
no i am
oh
I mean this isn't much different from C#. You still have to define stuff to use it.

it can't guess what you mean
because unicode.
https://www.thetopsites.net/article/50777238.shtml i just want to just the isEmoji() function but you can put multiple emotes or etc so
emojis are unicode characters that take up two ascii character slots.
how do you check if the string is a single emoji
else if (cmd === "clean")
{
message.channel.clone()
message.channel.delete()
}
google is being bad
that's a simple question with a very hard answer.
@sudden tulip well how did you define your message variable
at the top
@silver lintel im kinda dumb when it comes to js but isnt the second 5 how many elements it’s deleting
did you call it message? msg? flkjasldkjfsadf? What?
that's a simple question with a very hard answer.
@umbral zealot ikr, i found a very useful answer but it wasnt in nodejs so i couldnt use it
msg
yeah it's called msg.
yes im bigdumb
you're just inexperienced, and you should get aquainted with JS before making a bot in it
<member>.kick()
I suggest checking docs
you can get mentions using..
fairnuff
message.mentions.members.first();
assuming your using Djs ; https://discord.Js.org
message.mentions.members.first().kick();
i think
it will kick the first mentioned user
yea
¯_(ツ)_/¯
https://stackoverflow.com/questions/18862256/how-to-detect-emoji-using-javascript prob the most useful answer so far to me
inb4 shitty node package with an array of every Unicode Character
i can use .match() and check if the output is null and/or the .length is 1
inb4 shitty node package with an array of every Unicode Character
@thick gullinb4?
in before
as in i am calling it
?????
what
I can’t tell if you don’t know what inb4 means or
System.out.print("Created!");
}``` doesn't work when I create a channel. Anyone know why? The class is added as listener and extends ListenerAdapter
Not overly familiar with C# but could google emmit event listeners
Those are responsible for pinging on events
That's Java.
I tried google and nobody has had this issue
I have two other event listeners in this class and they work fine. This is the only one not working
This is all I'm seeing when I try to override the class (JDA)
I don't see anything for onChannelCreate
Not familar but is there an emit for channel create lite?
not sure if it's contained in the recieved message or another handle
There are only "emitters" for the specific channel, but not one for any channel create
Emitters in JDA work by extending a class (abstract class called ListenerAdapter).
You then override the method which will be called, which acts as the event listener.
ahh
Haven't explored its eventlisteners fully only care for the few events.
Good to know
textchannelcreate
The signature for text channels would look like as followed: java @Override public void onTextChannelCreate(@NotNull TextChannelCreateEvent event) { // ... }
yeah np
The only place that tries to call something a "JSON Object" is w3schools and their site is shit.
@umbral zealot thats where i used to self learn my js oop
quickdb is one of the slowest database wrappers
@umbral zealot im leaning into rethinkdb idk y
I mean, they're different things. quick.db and enmap are wrappers around sqlite, and you can use them without instlaling a server or stuff
python sus
rethinkdb doesn't have that much support anymore
community updates have been really slow
How come e.getGuild().getMemberById() works on my private server but doesn't work on a another server? On mine it prints "FunkyMoneyman" with some other stuff but on the big server it prints "null"
which library
rethink went deprecated then came back I think
How come
e.getGuild().getMemberById()works on my private server but doesn't work on a another server? On mine it prints "FunkyMoneyman" with some other stuff but on the big server it prints "null"
@solid citrus what library are you using
They're using JDA
rethinkdb doesn't have that much support anymore
community updates have been really slow
uh basically it lost commercial company backing
The user may or may not be cached.
A while ago JDA I think was caching everything by default and couldn't be configured, but it now can.
how can I make it work regardless of server then?
one option would be to fetch the member with one of the methods that start with retrieve
?
i got it
I'm trying e.getGuild().retrieveMemberById(user.toString()); but idk if that is the correct way to do it lite
Thanks
also doesn't work
https://i.gyazo.com/6a0f00aa600e21c4e484e3487b0cdbb3.png public void onTextChannelCreate(@Nonnull TextChannelCreateEvent e) throws IllegalArgumentException { System.out.println(e.getChannel().getTopic()); System.out.print(e.getGuild().getMemberById(e.getChannel().getTopic()) + " | " + e.getGuild().getMemberById(e.getChannel().getTopic().toString())); I can't do retrieve because that gives me a restaction and U can't use rest actions @sudden geyser
So you're trying to get a member in the guild by the channel name's topic?
Yet e.getChannel().getTopic() is returning null 🤔
oh I'm blind
getMemberById is returning null on one server but not another
Is that user in that other server as well?
If I were to do a dashboard? How would I add mongo support?
yes
This is what it should look like https://i.gyazo.com/ee41083cc5a8c18362722adc16b4d474.png
it works on my private server for some reason and u said cuz its cashed or something but a bot shouldn't have to rely on that
Hmm, could you try something like this instead: java e.getGuild().retrieveMemberById(e.getChannel().getTopic()).queue(member -> { // print `member` }, err -> { /* handle error*/ })
This is what I was talking about before about retrieving.
What does hovering over the red give you
That'd error on my language of choice
Lambda expressions are not supported at level 5
uh
ok
well I set lamba language to 8
and I can't undo it
so hopefully its worth it
red is gone
Ah it should be changeable that option but glad that solved it.
I deal wit hthat in a few languages going from their lower levels to higher
ok it printed out MB:FunkyMoneyMan(U:FunkyMoneyMan(199995281121607682) / G:Private(703287729303060540))
lambdas are only supported in java8+
I had a similar issue in the past but it was a different error
Then you found the user now
and why are you even on level 5 in the first place
Nice funky
so why does coding it this way work but the other one doesn't
You weren't in the cache for that large guild
Uhhhh may be awaiting a call
and why are you even on level 5 in the first place
wasn't my choice it was set to 5
Java doesn't have async/await btw
so why did this fix it?
I mean not necessarily can you go and do a function in function call to pass to parameter
need to calc it ahead of time some cases
I'd try putting topic to variable then passing it through
prior way and see if that does it
what do I put inside handle error
If you want to ignore the error put nothing, but if (and you should) want to handle the error, log it to the console or tell the user that the user couldn't be found.
Yeah^
retrieveMemberById works by looking in the cache for the user. If it's found, it'll immediately return. If it can't find them, it'll send an HTTP request to Discord for the guild member. If it's found, it'll be returned. Else you'll get an error as it couldn't be found.
Very helpful them catches for making solid bots/software
logging errors likely a bad design tbh
put somewhere that notifies you
be it dumping on your support server in a hidden channel or something else
or just use some logger module/package
or just send it to a channel
It's built in

most modules
With a website dashboard, how can I connect it to mongo?
installing dependencies for every little thing is hella wasteful imo
You use it for early dev, and build you way to prolific statements to prevent such
plus you dont learn anything from it
@opal plank https://www.npmjs.com/package/is-odd ¯_(ツ)_/¯
wtf is that for?
installing dependencies for every little thing
that package tbh
486k weekly downloads
e.getReaction().removeReaction(e.getUser()); I've also had issues with this not working at all even on my server
yikes
It's essentially a safer way of checking if something is odd
486k weekly downloads, and then you take a look at the majority of the discord bots(specially d.js) and tell me about quality @fluid basin
¯_(ツ)_/¯
Hi
How does sentry work btw
no my point is that installing dependencies for little things happen all the time 
How to get 16 letters in $randomString??
what
$randomString
what language is that
Seems to be some bot maker thing
and my point being by doing that you dont learn anything from it
sentry? isn't that an analytics/monitoring framework/platform
I don't think installing a dependency for logging is a bad thing though. Have it pretty print for your console messages (trace/debug/info/warn/error/fatal), ability to write to a file for the logs, no need to make network requests to store it instead, all the wonderful bits
Possibly, but my question may be invalid because I'm not familiar with it in any way
you missing my point lite
I'll probably take a look later myself
im not against logging stuff, im against not writing your own handller and relying on small packages
php uses a lot of $
$_USER
@slender thistle what will you need it for anyways
I have a log/time module I made to just include in a utilities folder
no problem with that, keeps me informed.
It depends on what it does really. For example, some packages have it set up where one dependency can also set up a logger and your project can configure which logs you want to see and how it's all formatted. If it's just you wanting to log what you want, then yeah go ahead and write your own.
my point being you shouldnt rely on packages whenever its possible
that might be only me opinion however
I have to use a fancy logger for WebRTC
you are free to ignore it
if its some complicated package, you are wasting time
It's the dev's choice imo. There are very good reasons to rely on dependencies, regardless of how small it appears.
if it is something repetitive, you wasting time
if it something you already done, you wasting time
else, its good to write your own
Hellu. I have come to steal your cocolate chip cookies
can't steal something I don't have
What you guyz were discussing?
dependencies
@fluid basin not sure if I will need it tbh, it was more of a random curiosity question
:p
what is the code to send a primate message to a player I legit can't find it
ok
those were questions not statements
anyway, you need to provide more info
which language and library?
no you solved it for me
Erm, you welcome, i guess?
first of all, have users ever been referred to as players
Second of all, how would I check for a certain Reddit user using their API
with the docs
stonks
Reddit gives you the best of the internet in one place. Get a constantly updating feed of breaking news, fun stories, pics, memes, and videos just for you. Passionate about something niche? Reddit has thousands of vibrant communities with people that share your interests. Alte...
@opaque hawk https://www.reddit.com/dev/api/#GET_users_search
Reddit gives you the best of the internet in one place. Get a constantly updating feed of breaking news, fun stories, pics, memes, and videos just for you. Passionate about something niche? Reddit has thousands of vibrant communities with people that share your interests. Alte...
I used the discord.js urban dictionary example but seeing as that is urban and not Reddit it didn’t work as it applies term=${args[1]} to the end of https://www.reddit.com/u/
ok
Alright
@opal plank koa? No, I haven't even used socket.io enough to use it for my websites. My websites are mostly static or everything is handled by Bootstrap
hmmm i see
kinda was looking at my dashboard and wondering if i should work on it a bit
cuz i havent done that at all
What's koa?
thinking about it tbh
i got apache already hosted locally
should be somewhat easy to get it done
I'd say go for it
wondering if i should use boiler templates or make something from scratch
What do you think might be better in the long term?
very good question actually
using a boiler helps me mow down time on the development of the bot since i get it over with quicker, but on the other hand i'll be using given tools, i'd prefer to learn it rather than useing pre-made's
Is time critical in this case?
not critical, but motivation starting to get into me these past few days
i've got 7 different projects tied with the leviathan
Could go with the latter option then
Youtube bot, Discor dbot, Twitch bot, Dashboard, Metrics dashboard 1 and 2
wew
yeah 1 person handling all that been getting on my nerves
Erwin I've excluded node_modules in tsconfig.json, but it is still showing error from there? What should I do
How to unban in d.js?
Can someone be my friends here? It's my first time using discord😅
😂
💀
how do i use https get to an image url from a website using a query input from discord like /type/category when the website returns { "url": "image link" }
GuildMemberManager#unban
https://discord.js.org/#/docs/main/stable/class/GuildMemberManager?scrollTo=unban
How would I go about adding my site inline here
as I like my site a lot (and used alot of effort into it) so i want it to be visible
but the iframe is less than 300 characters
Ah
Yeah
sadly I cannot copy the site files into it XD
<!-- oh hello mods how are you doing -->
@compact oriole it's fine just put a copypasta in comments /s
:)
The way I went with my server count test app is shuffled the lorem ipsum copypasta and used it as my description
well time to make a long comment
Hold A ftw
Gnu plus linux
is this good?
<div style="width: 100%; height: 100%">
<!-- English: Dear mods, this comment is used to inflate the character count as my site is fully inside the provided Iframe. -->
<!-- STANDARD GALACTIC ALPHABET: Dᒷᔑ∷ ᒲ𝙹↸ᓭ, ℸ ̣ ⍑╎ᓭ ᓵ𝙹ᒲᒲᒷリℸ ̣ ╎ᓭ ⚍ᓭᒷ↸ ℸ ̣ 𝙹 ╎リ⎓ꖎᔑℸ ̣ ᒷ ℸ ̣ ⍑ᒷ ᓵ⍑ᔑ∷ᔑᓵℸ ̣ ᒷ∷ ᓵ𝙹⚍リℸ ̣ ᔑᓭ ᒲ|| ᓭ╎ℸ ̣ ᒷ ╎ᓭ ⎓⚍ꖎꖎ|| ╎リᓭ╎↸ᒷ ℸ ̣ ⍑ᒷ !¡∷𝙹⍊╎↸ᒷ↸ i⎓∷ᔑᒲᒷ. -->
<iframe src="https://trivia.wtf/" title="Trivia Bot Homepage"></iframe>
</div>
Why the div though
idk
Can't you technically just apply style to the iframe directly?

what u guys think?
https://hastebin.com/ecumogacuw.js
hasPermission: function(permission, message) {
if (!message.member.hasPermission(permission)) return 1;
if (!message.guild.me.hasPermission(permission)) return 2;
},
what are u trying to do?
humm
Who knows python
hi guess my bot not joining on a channel while deploy on heroku while works fine on my pc anyone,can anyone help?
hi guess my bot not joining on a channel while deploy on heroku while works fine on my pc anyone,can anyone help?
@manic sage what?
can u explain it a little bit better
so i deployed my bot on heroku and while i type the join command its not joining the channel but when i run it on pc it works fine
can u send the code?
and i recommend u to not use heroku
it will ask u for a credit card later
and u will have limited hours
till u have to pay
u should use repl.it 
@dense nest feel free to ask your questions straight away
i know but its a different issue
Heroku

Good luck hosting music bots on that
@slender thistle ye bro
There's no native support for those whatsoever
it's more for like web development
mhm
and u can use uptimerobot too so ur bot is always 24/7
repl.it is an online testing environment with an IDE but
they don't mind uptime robots
repl.it is an online testing environment with an IDE but
@slender thistle it's still kind of better
yea
Which is why I'm in favor of using repl.it over Glitch or Heroku
Hell, you can probably make your own script ping itself every once in a while
😎
While the other two are decent enough, I consider repl.it the most decent online service for hosting small bots
but the sad thing is u cannot have private projects
VPS if all else fails
like glitch or heroku
Ehh
I have Github student pack so sike
I wouldn't specifically care if someone stole my code, I just cba to make my official bot's code open-source 😂
I wouldn't specifically care if someone stole my code, I just cba to make my official bot's code open-source 😂
@slender thistle that's also true
but whatever let's stop talking about hosts
Some people might mind it, yeah, but that's someone else's headache
ye
it's not really prohibited as hosts are somewhat related to development ¯\_(ツ)_/¯
But sure, my head isn't feeling well atm
i remembered that i once followed a tutorial incorrectly and i tried to host my bot in heroku with github and i leaked my bot's token
cuz i had a config.json file

Well 😂
kek
and that was when discord didn't tell ya if u leaked it
Man, good old times
yea
i actually started to make bots in discord.js in the 11.4.2
at least that's what i see on my old bot's project
the one i leaked
well i don't
i'm too lazy
and i already got acostumbrated to discord.js
idfk if it's acostumbrated or not
but whatever
used to
aye
cuz i speak spanish and i don't know a lot of english
so i should be checking google translate

^
how do i get the number roles in a discord server?
how do i get the number roles in a discord server?
@west agate message.guild.roles.size
try that but i'm not that sure that it works
no its okay
the real question is
bad emoji
how do i get a servers owner?
the user of the owner or the id?
user
try message.guild.owner
guild#ownee#user
😎
guild#ownee#user
@pale vessel u spelled it wrong
and yea
message.guild.owner.user
mobile moment
bad phone
i tried message.guild.owner.tag
user.tag
message.guild.owner.user.tag
there we go it works!
yw
my name is jeff
oop
my name is jeff
@pale vessel ma nem i ñe
So im getting a api, and i need help splitting it into variables to send. So far, ive got:
import requests
import json
url = 'https://api.2b2t.dev/prioq'
response = requests.get(url)
thingy = response.text
def my_function(food):
for x in food:
print(x)
fruits = thingy```
imma try make a translation
how do I could handle that when someone reacts 🇽 to my message, I would delete the message sent by the bot?
bot
lolritter 
@restive furnace make a react collector and delete message
awaitreactions
@pale vessel pog lolrittter dosent know python or hed help me .-.
^or that
i think u got it on discordjs.guide
fetch the message and delete it, but how i can check if the user is the user who ran the command?
how to make an reaction collector
i'm sure you have to parse it as json first, if the api returns json
fetch the message and delete it, but how i can check if the user is the user who ran the command
@restive furnace if (reactor == message.author) //do ur thing
Response.json
message.react('👍').then(() => message.react('👎'));
const filter = (reaction, user) => {
return ['👍', '👎'].includes(reaction.emoji.name) && user.id === message.author.id;
};
message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === '👍') {
message.reply('you reacted with a thumbs up.');
} else {
message.reply('you reacted with a thumbs down.');
}
})
.catch(collected => {
message.reply('you reacted with neither a thumbs up, nor a thumbs down.');
});
idfk if it's reactor
you can google how to parse json in python lul
^ I copied from the site it self
exactly
@restive furnace if (reactor == message.author) //do ur thing
reaction collectors only works for some time only, i want it to last like forever
why did you send that
@pale vessel requests does it for you. It's response.json
reaction collectors only works for some time only, i want it to last like forever
@restive furnace change the time in time: 60000 then
there's no way to make it forever
don't use reaction collectors for those
what then
i don't use those for mine
There is, if you use raw reaction
raw reaction listeners?
yes, raw listeners
But yes I would just use on reaction then check if it's a X and the message is by the bot and if so then try to delete
Easiest way
and fetch the above message to check if the user who made the reaction has sent the command, right?
Yoooo
Thats me again lol
const serverQueue = message.bot.queue.get(message.guild.id);
@restive furnace oh yeah and that too
alright
Why i have an error with queu
how do i unban members?
i'm sure you mean message.client, assuming you attached the queue to your client
bot.queue = new Map();
Guild.unban(Id) ?
yeah, message.client
i'm sure you mean message.client, assuming you attached the queue to your client
@pale vessel yes, client it bot
that's just how it works
bot is client, that's why you should name your client as client to avoid confusion
So i gotta split this into a table ._.
So..i need to write client?
Ok let me try
rovi told you how
Its not formatted at all
that doesn't look like json though
Its not
So how do i parse this into a json table lmao
@dense nest u are trying to turn a json table in an array
¿
what is wrong with this?
what does the error say
put ur mouse in the part where it says succ and it should say the error
i mean where it says succ
thats it
@dense nest did you try .json
ohhhh
@placid iron how?
Request.json
bruh why u using then succ if u are not gonna use the variable succ
Rather than request.text
when i remove it it gives a hell lot of erros
what do the errors say
are you using a tslint for js or something
i am
ts?
@placid iron
Wtff
Tbh its like 3am and im super tired
response = requests.get(url)
json_data = response.json()```
Np
My great grandma is moving from the house she bought in '89
And its a massive property
Lots of tears shed today hehehe
Anyway tyvm
Oh ahaha, yeah no problem. Have a good day
You too
@placid iron can you freind me?
And another question
How would i send info to the api
Ex. A username
if you mean lolritter's api, it uses query strings so just append ?username=<username> to the url
all good, you'll get there haha
Flaz
assuming you have npm, you can use npm i ms
fs is built in, you don't have to install it
So if I install it now I will have it on my bot right?
yes
oh thx
but do I type npm i ms
then code . do I have it or do I go for desktop or cd in commandprompT?
@pale vessel
in your bot's directory
in your bot's directory
@pale vessel oh its terminal right?
yes
oh lmao forgot
thx
yes
@pale vessel ok so I installed it do I just need to put the require ms in a js file?
yeah
yep
yep
@pale vessel thx man helped alot
I got one question more about that "react with X, bot deletes the message". So if the server is very active, like 100 messages/min on one channel, do I just have to fetch more than 1 message on the channel and check its content && author matches the user who reacted?
yep
@pale vessel do I need a ms.json or smh
nope, it's already installed
it puts it inside package.json for you
no, for that you have to require it and use it
no, for that you have to require it and use it
@pale vessel like in a js file right?
yes
yes, because it's built in
@restive furnace the reaction event provides message, the way i do is by detecting the mention inside the message via message.content and check if the id is the same as the person that reacted. that's why my bot always mention members when replying to them
Is it useles to use await in this case?
module.exports = {
name: 'setvoting',
description: 'Choose if voting is required for commands.',
dev: true,
async execute(message) {
message.client.voting = !message.client.voting;
if(!message.client.voting) await message.reply('*Voting disabled.*');
else await message.reply('*Voting enabled.*');
},
};
it resolves the promises before continuing.
i almost every where use async in my bot atleast
client.guilds.cache.get('699877474925936680').members.length this dont work??
var muteRole = message.guild.roles.cache.get('Muted', 'muted');
Is this working?
lmao
client.guilds.cache.get('699877474925936680').members.lengththis dont work??
@carmine summit what u tryna do?
client.guilds.cache.get('ID').members.cache.size @carmine summit
Shouldn't this wait until a return is given from the client.request() function?
const requestResults = await message.client.request(message, request);
if (message.content.startsWith(prefix + "feed")) {
if (message.channel.id == "735243676460253225") {
const args =
" " + message.content.slice(prefix.length).replace(/^feed/, "").trim();
queueMessageText =
"**The twitter feed has been searched and sent by this/these keyword(s): **";
queueMessageText +=
" " + message.content.slice(prefix.length).replace(/^feed/, "").trim();
setInterval(T.get, 60000);
T.get("search/tweets", { q: args, count: 10 }, function (
err,
data,
response
) {
console.log(data);
status = data.statuses[0];
data.statuses.forEach((status) => {
const embed = new Discord.MessageEmbed();
embed.setTitle("Twitter Feed Poster");
embed.setDescription(`${status.text}`);
embed.setImage(`${status.user.profile_image_url}`);
embed.setFooter("Command created for Pokehub!");
embed.setColor("#FF0000");
embed.setAuthor(
"@" + `${status.user.screen_name}\n` + `${status.user.name}`
);
embed.setURL(
`https://twitter.com/${status.user_screen_name}/status/${status.id_str}`
);
message.channel.send(embed);
});
});
message.channel.send(queueMessageText);
} else {
message.channel.send(
"You can only use this command in the #general channel!"
);```
return this.request('GET', path, params, callback)
^
TypeError: this.request is not a function
could anyone help me?
client.guilds.cache.get('ID').members.cache.size @carmine summit
@opaque seal why the cache?
Or this @carmine summit https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=memberCount
I wish I could use js on my bot site
as I can't rezise the Iframe without it
no way in css...
but at least on pc it works now
(don't mid tags, fixing now)
just when it goes to mobile, it brakes
(iframe scrollbar as iframe is not full height of site)
oh ok
then add
body {
height: 100%;
}
also why tf does top.gg use !important css tag on the shadow of the bot image
no
it's an iframe
oh
that won't work
and the site isn't simple, so I can't just put it there
the site itself is React/NextJS compiled js/css/html
and I can't use js yet
you can hide everything on the bot page
@weak parrot could probably confirm or deny if its true
You can iframe your website as long as it doesn't contain anything against our rules
epik
You're not allowed to hide the navbar, that's one of the things you definitely can't remove
@split hazel but can you edit its css
What exactly are you planning on doing just putting it in description or do the whole page?
@honest perch you can just make sure every button name is the same and works
just look at iaras page
cutest website on earth award
Yeah removing navigation elements ads and essentials buttons (report and so on) are a big no no
you can't remove ads
could I redo them?
like hide default stuff and do it again with my style in the box
whats the html element for the ads
Sure you can remake them as long as functionality of the buttons is still there
hot take
dbl makes revenue off your bot page and you don't get any of it lol
to have a cherry on top, those are google ads which means trackers everywhere
does dbl really have that much ads?
brave bad
opera is good but opera is a shit company







