#development
1 messages · Page 836 of 1
My channel name is #chat
I am trying to get a message from a channel only when a command is executed
Which one is better:
const Discord = require('discord.js'); const client = new Discord.Client(); client.login("token").then(() => { console.log("I am ready"); var guild = client.guilds.get('guildid'); if(guild && guild.channels.get('channelid')){ guild.channels.get('channelid').send("Good Morning").then(() => client.destroy()); } else { console.log("nope"); //if the bot doesn't have guild with the id guildid // or if the guild doesn't have the channel with id channelid } client.destroy(); });OR
const Discord = require('discord.js'); const client = new Discord.Client(); client.on('message', message => { //... }); client.on('ready', () => { setTimeout(function(){ // in leftToEight() milliseconds run this: sendMessage(); // send the message once var dayMillseconds = 1000 * 60 * 60 * 24; setInterval(function(){ // repeat this every 24 hours sendMessage(); }, dayMillseconds) }, leftToEight()) }) function leftToEight(){ var d = new Date(); return (-d + d.setHours(8,0,0,0)); } function sendMessage(){ var guild = client.guilds.get('guildid'); if(guild && guild.channels.get('channelid')){ guild.channels.get('channelid').send("Good Morning"); } } client.login("token");
@wide wharf
@wide wharf the first one
@earnest phoenix
no
@quartz kindle
the 2nd one
@sudden geyser
why are you pinging me
^^ quote
⛔ | يرجى كتابة أي شيء بعد ألأمر
@earnest phoenix other langs in #memes-and-media
the 1st one does not work
@finite bough But everyone, @sudden geyser and @quartz kindle both says the 2nd one
yea
selfbot
yes coz
1st*
1st*
LMAO
big brain
haha
⛔ | يرجى كتابة أي شيء بعد ألأمر
@earnest phoenix other langs in #memes-and-media

Xddd
I don't think talking to a selfbot will do anything
But
How do you do that the Greeting message
will be send in ALL the servers in the first
channel where the bot can type in at 8am?
1st one hello
Hi
#memes-and-media for chatting pls
But there it will just send in only one channel (one channel id) so??
in the first one
How do you do that the Greeting message
will be send in ALL the servers in the first
channel where the bot can type in at 8am?
@wide wharf
1st one does not work
second one than?
yes
iterate over each guild and check if it's 8 am. If it's 8 am, find a channel by its permission if you can send messages in it <TextChannel>.permissionsFor(someone).has(thePermission)
Can I get rank
no
Lol
@wide wharf you have a bigger issue to solve: 8am in which timezone?
Uh
earth timezone duh
has anyone ever had that message.author.id references another discord user than the one making the request?
@wide wharf so your bot will only ever be used in central europe?
or is it a server-specific bot?
@raven token no
rip lol
ikr? idk what caused it
such as global variables
nope just reading out message.author.id
show code?
client.createMessage(msg.channel.id, msg.author.id); this is it haha, and i get the same as someone else
like its the most basic command ever
i cant find the cause either, i used a certain command on someone and it now mistakes me for him
@wide wharf so your bot will only ever be used in central europe?
@quartz kindle Uh no but most of the servers (12) where my bot is in, are in central europe... so
is there a certain place where this linking can go wrong?
Google Greenwich:
8 am GMT is 8 am UTC
@quartz kindle So how can I do that the bot will send a message in the first channel where he has perms to send messages?
Because I don't want to do that with channel id, because then the bot will only work in one server 😦
@raven token are you using Eris?
I am using discord.js
so what happens if your bot gets added to a server that is in a different timezone? lmao
you think that might be the problem? i might be confusing libraries? 🤔
or to people who are in the server, but live in a different timezone than the server's
My bot also has a few commands that use time, by default it uses GMT but there is a command to change the time for your server
@raven token no, just so i know what you're doing. anyway that snipped is not enough information to know whats going on
And if you need to show the time in everyone's own timezone then I think the only option is to use an embed and use the time value in there.
That time is always shown at your computer/phone's timezone
@quartz kindle would you be against DMing? 🤔 i cant rly put all the bot code in here...
two hastebin
there's also https://pastebin.com/
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

lmao
white theme by default, ads, trackers and annoying popups
there's like 100 bins out there
i have one at home
When pastebin doesn't even load for you
tim uses recycle bin
Yes
});
^
SyntaxError: Unexpected token )
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
i checked ALL brackets and they are perfect
show code
too big
like from start to end of the bracket?
I probably wont make my code public
you need jesus and christ
no thanks
same
i checked each and every bracket
well, ok
how much ram does your bot use?
Idk
100-200mbs
@pale vessel if i keep on adding the space(type nothing there)
The error keeps coming to the last line
can that help?
do you use an ide?
sometimes }); are before }
First used using Nano
I probably wont make my code public
@small prairie dude, unless you have top secret pentagon codes there noone will steal them
nano lol
just show us the section where it's erroring
does the bracket match the starting one?
im using discord js, according to my app, its using around 180mb. but my host is claiming near 1gb 😄
@pale vessel wdym?
@lyric mountain The error transfers to the last line
if i keep adding a new line
the error is in the last one
sure, because you added more chars to the code
thing is
we need to see the code
if you don't want to show the entire code, just show us the function where that is happening
code 👏 review
even a single line would help
wif
lulz
what if
i found it our by removing each bracket code
a new kind of if
do you not have an IDE with syntax highlighting lol?
wif stands for what-if
this is why you don't use nano
even notepad++ would highlight it
lol
intellij
need that intellisense yo!
nah. notepad works for me
thanks tho
intellisense?
intellisense guesses what your typing and suggests an autofill
nano
vim
i mean cpu and ram usage
lol
:wq
just use np++ dude
i can type 'fo' and it fills a for loop ~~ for example
unless you're working on a headless os
np++ is the lower you'll be able to get for js coding
with highlighting
vs code isnt an ide though. but i guess it can be used as such for certain environments
its very versatile
honestly, try it, you wont be sad
i'm fine for now
i tried it one day when sublime text had an update and became super laggy. havent went back
"something light" that ain't intellij
who were you referring to
human error
Sure
I am receiving "Topology is closed, please connect" error
I've been researching for a few days, but none worked
And the number of connection is usually +80
in discord.js - v12.0.2 is there a way to get the total memory for a bot?
no
cause discord.js doesnt look at your memory, you need to use process#method, it can show it, and im not spoonfeeder, wo figure it out by googling for example.
I mean RAM
So it can only check the memory usage?
no.
${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}
``` = Memory Usage
you cant even that with d.js, you need to use process (node process) and check there, or use third party libraries
ooh ok
process != discord.js
Can we not use some other way to get the total memory?
process or third party libraries/packages.
OOh ok
for examole
but you dont need, cause process has heapTotal method too, but ye, bye! 👋 hope it works.
@dusky marsh @prime cliff I finally got it to host with no issues! My code was the issue as I forgot a parameter when creating the embeds on discord.js@11.5.1, so yeah its working now!
Thank you guys for your help last night
@heavy marsh heapUsed is not accurate for memory usage btw
and as Dany pointed out, to get total system memory, use os
ooh ok
and btw, os doesnt need to be installed, its integrated into node
client.guilds.reduce((a, b) => a + b.memberCount, 0)```
Who should we change the eval when its sharded
function clean(text) {
if (typeof(text) === "string")
return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
else
return text;
}
let code = args.join(" ");
if (!code) return message.channel.send(` **Please enter a command to eval!** - **Usage:** \`${config.prefix}eval <code>\``);
try {
let evaled = eval(code);
if (typeof evaled !== "string")
evaled = require("util").inspect(evaled);
message.channel.send(clean(evaled), {code:"xl"});
} catch (err) {
message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
}
For me?
he was talking to me
no
Where can I find a text channel permission calculator?
or do I use the same one as I use for the bot?
Can someone give me a basic discord.py bot?
No
Ok
read guides holy frick
I do
not that hard
Can't find a good guide
the official docs should have an example
Where
Have you tried using your browser.
@summer torrent if i wanted to do the same with guilds do i just replace membercount with guildcount?
literally everything you need is on google, if you can't find it - congrats, you don't know how to use google
same for channels?
no
so i need it for channels?
i kinda hate it
i don't care
wows
an unmodified discord.js automatically caches all guilds and channels
so all you need to do is check the size of the guild store and channel store
although dms will count as well (when used), so you will need to account for that if you want only guild channels
so client.channels.cache.size is sufficient
yes
Can you not make a eval that will work on shards?
Like for example get information from a guild which is on another shard?
eval bot.guilds.cache.get("611881570202025986").shardID
For example
Will not give you the shard id?
Could you give me a small example
psuedo code:
for shard_data in (bot.shards):
shard_data.guilds.cache.get("??")
basically, that is what you would do
But you will have to do it in the eval right. Like I mean you dont have to change anything on the eval command right?
Eval command before sharding and after shard is the same right?
when sharding, each shard will have a number of guilds assigned to it
that means that shard 1 has X guilds, and shard 2 has Y guilds
trying to get a guild that is in shard 1 from shard 2 will not work
as the guild does not exist in shard 2
the problem is not the eval command, is how you're using it
if you're using the sharding manager, the only way to access data from other shards is via broadcastEval or fetchClientValues
let evaled;
if (args.broadcast && bot.shard) {
evaled = await bot.shard.broadcastEval(args.code);
}
else {
evaled = eval(args);
}
if (typeof evaled !== 'string') {
evaled = require('util').inspect(evaled);
}
let output = await message.channel.send({
embed: {
fields: [
{
name: ':inbox_tray: INPUT',
value: `\`\`\`js\n${args}\n\`\`\``
},
{
name: ':outbox_tray: OUTPUT',
value: `\`\`\`js\n${clean(bot, evaled)}\n\`\`\``
}
]
}
});
if (args.delete) {
output.delete(10000).catch(() => {});
message.delete(1000).catch(() => {});
}
}
catch(e) {
let error = await message.channel.send({
embed: {
fields: [
{
name: ':no_entry: ERROR',
value: `\`\`\`js\n${clean(bot, e)}\n\`\`\``
}
]
}
});
if (args.delete) {
error.delete(10000).catch(() => {});
message.delete(1000).catch(() => {});
}
what does args.delete do
How do I check if client.users.cache.get() returns something because if(!user) doesn’t work.
What version(s) of dot net are supported?
if(!user) does work lol
I am confused lol
let player = await client.users.cache.get(user);
let stats = await db.collection("users").findOne({_id: user});
console.log(player, stats, "yay");
if(!player || !stats) return;
console.log("test yeah");
the console.log() says that player and stats are valid but the if thing does not
you dont need to await player
its not an async function
idk about your db
what does the first console.log show?
how about this console.log(typeof player, typeof stats, Boolean(player), Boolean(stats))
wait lemme edit the file using vi
(node:15) UnhandledPromiseRejectionWarning: TypeError: message.author.createMessageCollector is not a function
at Object.execute (/home/container/commands/DoNotIndex/backdoor.js:14:38)
at Client.<anonymous> (/home/container/index.js:139:13)
at Client.emit (events.js:311:20)
at MessageCreateHandler.handle (/home/container/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/container/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
at WebSocketConnection.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:311:20)
at Receiver.receiverOnMessage (/home/container/node_modules/ws/lib/websocket.js:789:20)
(node:15) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15) [DEP0018] DeprecationWarning: Unhandled promise
How would I make a messagecollector in a DM
channel
(in discord.js v11)
Oh.
Thanks
Is there a way to clear a file in command prompt?
because im too lazy to scroll down the file when in vi editor
i guess i should just boot up my pc and view it there
i have another issue
(node:15) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'createMessageCollector' of null
at Object.execute (/home/container/commands/DoNotIndex/backdoor.js:14:48)
at Client.<anonymous> (/home/container/index.js:139:13)
at Client.emit (events.js:311:20)
at MessageCreateHandler.handle (/home/container/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/container/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
at WebSocketConnection.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:311:20)
at Receiver.receiverOnMessage (/home/container/node_modules/ws/lib/websocket.js:789:20)
(node:15) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15) [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.
i
try to make a messagecollector
in message.author.dmChannel
do i make a new dmchannel?
then the if should work
but it doesn’t?
brackets make it more explicit
plus they are mandatory for multi-lines
not using brackets is just a silly shortcut for lazy people
I think i will try if(Boolean(player) && Boolean(stats))
well, Boolean shouldnt be needed, because the if basically does that already
(node:20520) UnhandledPromiseRejectionWarning: TypeError: Class extends value #<ShoukakuPlayer> is not a constructor or null
Im doing
class player extends serverCache.player {
if thats not a way to extend the class, then How would I keep the events of ShoukakuPlayer in my new class
I like always using brackets.
Whatever you're extending is not a class/constructor?
Unless I'm not getting something.
player is not a class
but when I log it its a class 
I mean
idk if this is a class
but I think it is? 🤔
<ref *1> ShoukakuPlayer {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
voiceConnection: ShoukakuLink {
node: ShoukakuSocket {
_events: [Object: null prototype],
_eventsCount: 4,
_maxListeners: undefined,
shoukaku: [Shoukaku],
players: [Map],
rest: [ShoukakuRest],
state: 'CONNECTED',
stats: [Object],
reconnectAttempts: 0,
name: 'Node Test #1',
ws: [WebSocket],
[Symbol(kCapture)]: false
},
player: [Circular *1],
guildID: '689157206028976153',
shardID: 0,
userID: '691451179212865619',
sessionID: 'fd7292cbbd9de06f2b36ac540bc9b484',
voiceChannelID: '689166772267516003',
selfMute: false,
selfDeaf: true,
state: 'CONNECTED'
},
track: null,
paused: false,
volume: 100,
bands: [],
position: 0,
type: 'track',
[Symbol(kCapture)]: false
}```
It looks like an instance of the class.
It needs to be the actual constructor/class that's being extended.
How could I extend the instance?
is it possible?
Wheres the constructor here (I know its there but what is Shoukaku Player)
@mystic violet if its just new ShoukakuPlayer, you should be able to do class x extends ShoukakuPlayer
I think you have the wrong server
@crimson vapor I did that
(node:20520) UnhandledPromiseRejectionWarning: TypeError: Class extends value #<ShoukakuPlayer> is not a constructor or null
Im doing
class player extends serverCache.player {```
you cant extend class instances, only the class itself
.player is an instance of the class, that is created when it joins a voice channel
How would I be able to make a embed that lists all the servers my bot is in?
@mystic violet do serverCache.player.constructor
ok
@astral yoke loop through every entry in bot.guilds
I know this is a bot server, but im trying to setup an ftp server. any idea where I would put the credentials "username and password" to login to the ftp?
Lmao I fucking knew it
Screw my fuckin host at this point
Suspension Reason: Overdue on payment
I mean, what did you use it for?
I planned on using one mainly for my own Purposes and one for maybe a public api
The funny thing is
It says Overdue on payment right
yeah
'Authorization' : token,
'Content-Type' : 'application/json'
}
stats = {
'server_count' : str(len(self.client.guilds)), # Remove self if not necessary
'member_count' : sum(len(s.members) for s in self.client.guilds), # Remove self if not necessary
'shard_count' : self.client.shard_count # Remove self if not necessary
}
data = json.dumps(stats, sort_keys=True, indent=4, separators=(',', ': '))
async with aiohttp.ClientSession() as s:
async with s.post(f"https://arcane-botcenter.xyz/api/{bot_id}/stats", headers=headers, data=data) as r:
text = await r.text()
await ctx.send(f'{r.status} : {text}')``` ```Traceback (most recent call last):
File "C:\Users\culan\Desktop\echo\echo.py", line 37, in <module>
bot.load_extension("arcaneapi")
File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 621, in load_extension
lib = importlib.import_module(name)
File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 724, in exec_module
File "<frozen importlib._bootstrap_external>", line 860, in get_code
File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\culan\Desktop\echo\arcaneapi.py", line 20
async with aiohttp.ClientSession() as s:
^
SyntaxError: 'async with' outside async function```
I could probably get you an early access one through us but idk if you'd trust us since you just met me yesterday @earnest phoenix
Like look at this shit
you should probably get a refund
And suspending my VPS because of "overdue on payment"
bruh
Paysafe isn't refundable, I could message them asking to unsuspend it
But like the VPS before, they will probably screw it up again
and what do you get for it?
5 euros, not that much, so it's not that painful
what was your provider
Like that would've been the VPS for the bot, 2gb ram, 100gb space or so and done
so you use it for less ram intensive purposes?
Well I kinda went for more CPU than storage on it
Though for the API one I'm definitely going for Space and Bandwidth
we have 1 VPS for sale
£6/m - 2GB RAM 15GB storage and unlimited bandwidth
that's like 6.55 euro
$7
hey, my ftp server
192.168.0.8
``` Is working, I portforwarded it and my ftp: (my ip address) isnt working
any idea why
I'm staying on my hu Host for now
is it a local ftp server?
Yeah it is
like just for you
No its for my friend
...
I was literally about to throw my phone against the wall
does it have a static ip?
what errors are you getting?
connection refused?
@earnest phoenix ight, good luck with getting your server problem fixed
I mean, my local one gives me the ftp username and password to type, the ip one here. ill send it in dms
I cant connect to it
Its fixed already, I didn't upload anything on that VPS because I knew it would happen
says site cant be reached
@outer niche you can't use asynchronus functions inside synchronus functions
if you need to request in a synchronus function use requests
I did I think
hi
how would i make something like this?
"1 year, 223 days and 8 hours ago"
and for joined he server
their docs have everything, so look it up
Looking for a simple bot to pull images from an imgur album after the command /smoke is ran
if anyone is for some reason interested
I wish I could make a bot
why cant you . ?
don't give up 🙂 keep learning, you'll get it over time you wont just know everything over night.
I already gave up
well thats not good,
yea why not i have pycharm ill give it a shot
if you need to request in a synchronus function use
requests
@trim saddle suggesting a blocking lib for an async lib
@slender thistle did you not hear the issue
Using async in sync functions
i refuse to deasyncify something just for the sake of using it in a sync fucntion
besides i use requests for posts
posts don't block
will an inline statement like this work with setting variables?
let logWebhook = isBeta ? config.beta.logChannel : config.stable.logChannel;
ye
is that a yes
Not for me
cool
just
don't look at yt tutorials
use official or "Official" but yeah, they better than yt tutorials
like if you would like to learn js and make bot in node.js this would be your guide https://discordjs.guide or https://discord.js.org
try guildMember.cache.roles.add
this is going to be in the instance of a message so message.guildMember.cache.roles.add?
(node:9076) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined
message.member.guild.roles.create({ // <== left here
data: {
name: "Rolename",
color: "0xE400FF",
permissions: ['SEND_MESSAGES', 'VIEW_CHANNEL', 'CHANGE_NICKNAME', 'SPEAK', 'CONNECT', 'USE_EXTERNAL_EMOJIS', 'READ_MESSAGE_HISTORY', 'ATTACH_FILES', 'ADD_REACTIONS', 'EMBED_LINKS', 'USE_VAD'],
mentionable: true
}
}).then(function(role){
message.member.guild.roles.add(role);
.catch(console.error);
});
message.member.roles.add
im trying to make it create a role then add that role to the person that ran the command. it creates the role successfully but i cant get it too add
messages don't have guildMembers, just members, and they aren't a collection
that worked. thanks man!!!
don't ask for approval
you have to wait 2 weeks or more for them to review it its not on demand
Anyone know a discord.js music bot on GitHub?
How i would make a command that can delete more than 100 msgs, i tried using for(let i = 0; i < parseInt(args[0]); i++) {} but cant figure out what to do next? (i know its possible because many bots have it.)
discord's got a limit for a reason, you'd need to time it out
use the general bulk deletion in groups of 50 or something, split apart, just keep the user notified of progress
so smh like 100 ms per deletion is ok or need even more?
Well that would be ten a second
So i have a command called avatar that shows an avatar + it's link in an embed but when i use the command on myself it shows it full size but when i mention others... It doesn't show it in full size... Is there something that I'm doing wrong?
IDK
the size depends on the user's profile picture
u can always resize it
he did
Hmm... But that happens on everybody when i mention them
Is there something wrong?
I'm CONFUSION
try viewing it on desktop
Hmm lemme try
I am looking for someone who can help code some bots plz dm me if interested
💰
@pale vessel it looks fine in the desktop version
then there you go
mobile discord is different in some ways from the desktop/web version
markdown too
Hmm... So is that an issue with discord app?(on mobile)
yes
Hmm... Discord staff is on crack or smoking weed or something...
Now mobile version better than old mobile version.
true, but still its worse than desktop/web version.
i find it interesting that people manage to code on the phone.
how can I know how many ppl are connected into a vc using d.js v12
@earnest phoenix it is interesting as I'm coding on mobile but it's way too hard than expected...
i mean i did code plugins on a tablet back then for the pre-Minecraft Bedrock Edition
So i do feel that
everyone gotta start somewhere eh
Yea... Epic gamer moment...
i hosted my bot to heruko via github and that mean will be 24/7 active?
@soft flare if you have connected your credit card with heroku
yes
else it will have a limited amount of uptime per month
it is free for a limited amount of time per month
if u connect your credit card
it will still be free
nvm i will host it back when its was before
i dont need to explain (discord.js)
When the Internet starts going back to the future
@honest perch show the code please...
Just turn it around 
@honest perch you can use
${msg.createdTimestamp - message.createdTimestamp}
Instead
@honest perch just like this
works now thanks 😆
Whats that editor
can i somehow remove the undefined without saving the name in a db and without using 12v
How can i start
@restive furnace it's Mix file manager's own in-app code editor but i mostly use Termux's nano module
First of all, you gotta decide on what language you can use, so a bit of pre-knowledge about coding would be helpful
so i'd suggest reading that first
@earnest phoenix you should watch some updated bot making tutorials on YouTube or something...
@earnest phoenix pls provide them an official guide link
oop sorry
oldState and newState
U can use these for ur bot
oldState.channel?
i am using 11v
life makes sense now xD
its ok
This is weird
Yes?
is it better to see if the channel is deleted using channelDelete event or channelUpdate event
coz i am adding both the events in my bot
so will it be efficient if i do something like if (newchannel.id === 'undefined)
if the new channel id is undefined
the that means channel is deleted
that way channelUpdate can see it
Hmmmm
The channelUpdate can see if a user
voice a => voice b
BUT he is undefined if he disconnect
wut
U can use the channelUpdate for resolve this
channelUpdate has nothing to do with voice channels
No yeah sorry x)
ima try it and see if it works
I'm confusing the events
How to use Kubernetes scaling for discord bot sharding?
(No this isn't a good answer sorry)
!isNaN
ok?
It doesn't work
why
It already si
if(!isNaN(reason)) {
const embed = new Discord.RichEmbed()
.setColor("#00aaff")
.setImage(`https://http.cat/404.jpg`)
message.channel.send({embed})}```
that's a valid number
^
why is it 404
.setImage
but it's a valid number
you want an invalid number to return 404
I use !isNaN
Nan is not an number
that means a valid nunber
!NaN means is an number
if(NaN(reason)) {
const embed = new Discord.RichEmbed()
.setColor("#00aaff")
.setImage(`https://http.cat/404.jpg`)
message.channel.send({embed})}```
it's not not a number
Like that
yes
Ok thanks
(node:31694) UnhandledPromiseRejectionWarning: TypeError: NaN is not a function
isNaN
how would one make a bot edit messages multiple times
discord.js I know how to edit once but not twice or more
for(let i = 0; i < /*how much times you wanna edit your message */; i++) is your answer
noy spoonfeeding
like make inside that msg#edit and setTimeout.
easy peasy'
how does one wait for a webhook in python? i want to use twitch webhooks for stream notifications, (@ me)
@earnest phoenix ^
the amount of roles in what
in a guild
do it the same way except add .cache after .roles
^
@earnest phoenix if you don't know it's like this:
message.guild.roles.cache.size
so. like. how do they work on the python end then? the interwebs is confusing me
webhooks are in a sense reverse APIs
instead of you making a request to the API
the API makes a request to xouz
you*
While downloading buffer with node-fetch, does the library expose any 'buffer downloaded so far' property in it? I want to create a some kind of transfer bar, getting the percentage from total buffer amount & buffer transferred so far
Or do I have to go deeper than that and use native libraries
but like, how do i listen? or do i just like set up a script at /webhook on my server to process it? or can it be done within d.py or py
host a webserver
i know that much.
i moved my bot onto a vps for this specific purpose
then what else do you need to know..?
thats pretty much it right?
You need a webserver framework
in python, im assuming
https://pypi.org/project/Webhook-Listener/ i saw this but wasnt sure if it needed anything else, or if it'd work with dpy
Anything that's async
so either aiohttp.web (what dblpy uses) or separate Django/Flask script
@split hazel i think it doesnt.
oki. ty
what problem with bot
what bot
what what
the tic tac
Hey im hosting an ftp server, ftp:192.168.0.8 works on my PC, but my actual ip doesn't work on another PC, Im portforwarding and stuff. any help?
g*tictactoe
firewall?
Ive enabled "ftp server" to pass through windows firewall
do you think its my routers firewall?
ok @slender thistle new problem.
class WebhookHandler:
async def hello(self, request):
return web.Response(text="Hello world")
def __init__(self, bot):
self.app = web.Application()
self.bot = bot
self.app.add_routes([web.get("/", self.hello)])
def start(self):
web.run_app(self.app)
this code doesnt work, cuz dbl already has a server open. so..do i attach to that somehow or..?
if we knew the problem, maybe
I figured out the problem, it was with windows firewall, Im wondering how to enable my FTP server to work through windows firewall, (right now I just have it turned off)
open a port?
How 😂
On my router?
both that and windows i think
all done
the port?
np
Iae
@earnest phoenix either edit dblpy's internal code to add more endpoints or make the webhook run separately
but-
how do I make it separate? The server I tried to start already had no relation to dbl
I’m willing to hire I need a bot Dev dm me if interested
Payment will be up to 200 SGD
really? okay then
yes chief*
it's public afaik
Im guessing its online like glitch
youtube
Every like 2 mins I stare at my glitch project. Cause if I leave it for like quite a few minutes, project gotta refresh..so I making sure it dont so it stays online 😂
Uh idk then
no
Time for an osu integration, why not
yes
get the API key
although it'll be deprecated soon (after v2 comes out)
setinterval
that's javascript though
setTimeout could actually work too if you cycle through them
oh lmao, that clientid tho

are you using v2 API?
what is that even
ye
v2 isn't out yet
Is it even properly documented yet kek
oh oof
what is that i've never seen that
wrong page
lemme retry 
nodesu
y not
Can guess it uses v1 
nodesu is garbage
node-osu
yes it uses v1
not for me
I remember actually doing some stupid stuff with v2
quick question : I forgot how to use the map function to map server roles. How to use this function?
.map(r => r)

how did you get the token tho shivaco
I've seen a repo that has a tutorial but it didn't really work for me
yep
that's it
I followed something there, it worked fine for me
it said error or something
anyone here
it should give a callback
channel.guild.fetchAuditLogs({type:12}).then(audit => audit.entries.find(entry => entry.executor.id == entry.executor.id).then(entry => {
author = entry.executor;
author.ban("User deleted a channel, possible nuke attempt.")
console.log(`Channel ${channel.name} delete by ${author.tag}`);
}).catch((err) => {
console.log(err)
}))
});```
Though I certainly remember making it working following that guide
all right I'll give it a shot agane
why wont it take perm from the user who deleted role
this so confusing
might just go to sleep
wtf is this
makes no sense to me
same
TIm sounds frustrated when he says "wtf".
fuck it ill put the osu thing aside
It's not that hard at least
yea
wdym
@quartz kindle that code made me go:
code string The code you received.
how do you wanna get osu data?
@slender thistle https://flazepe.is-inside.me/7e73VZHH.png got itttt

it was the redirect link
I knew you could do it
now i don't need a json file for country codes
What token? 🤔
bearer token
Can't you make it "non-expiring"?
well you check the mentioned user and compare it with the author
id would be good
try mention.id
yeah
<@!id>
oh dang, it does work

yummy
Resolved
https://gyazo.com/3729c0bf48153ae4a8e59991cdb44325
if(oldVoice && newVoice){
let slog = newMember.guild.channels.find(channel => channel.name == row.clogs);
if (!slog) return;
if (row.logsenabled === "disabled") return;
let sVoice = new Discord.RichEmbed()
.setColor("#36393f")
.setThumbnail(newMember.user.avatarURL)
.setTitle("Vocaux")
.addField("Utilisateur", `${newMember.user.tag} - (<@${newMember.user.id}>)`)
.addField("A switché de channel", "Ancien channel: `"+oldVoice.name+"`\nNouveau channel: `"+newVoice.name+"`")
return newMember.guild.channels.find("id", slog.id).send(sVoice);
}```
I don't see why i can't make this
what are you trying to do
@restive furnace what to do here ?
send your bot error here
or the logs
does it print anything into console?
like logged in?
Oh ohk just a minute
:/
what about it
easier than i thought, time for json
What to fill up
anything that has the *
no
i feel like i wanna die alr
yes, i wanna test the concept though if its practical for the bot
anyone know how to use FS to move a file from /tempt/ to a folder on the server?
author = entry.executor;
author.ban("User deleted a channel, possible nuke attempt.")
console.log(`Channel ${channel.name} delete by ${author.tag}`);
}).catch((err) => {
console.log(err)
})
})```
bot.on('channelDelete', async channel => {
author = entry.executor;
author.ban("User deleted a channel, possible nuke attempt.")
console.log(`Channel ${channel.name} delete by ${author.tag}`);
}).catch((err) => {
console.log(err)
})```
remove })

the whole coding broke
lol
var author
🤔
?
not author = nanana
const author = entry.executor
Put this
Anyone can help me? :/
entry is not defined
Yeah u have to define entry
yes
let entry = await member.guild.fetchAuditLogs({type: <number>}).then(audit => audit.entries.first())```
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
@earnest phoenix You've set slog to a string, it won't have an id property.
let entry = await member.guild.fetchAuditLogs({type: 12}).then(audit => audit.entries.first())```
@late hill and why for the join and leave he work? 🤔
I take in the sqlite database
member not defined
Because you didn't make that mistake there?
hmm
Mmmh
Okay ty
I see
this broke even more
wtf
1sec
He work now lol ty
he?
oh thats dope
?
Why?
cuz in future i might make one
where someone leaves vc
it says who left
why this break
This is easy to make and short code 
@earnest phoenix define member
its hard for me cuz i aint speak english that much
Oh you speak what normaly?
🤔
somalian
Too hard srry
lmao
this finna be like
wick bot type
hi uhm
i am trying to make a command handler for Eris, i am kinda stuck on what to do
any ideas why it doesn't load and stuff?
hi
not sure how wrong it is but i am sure it is very wrong
shrug
no error whatsoever?
nope
what exactly isnt working? have you tried debugging?
i have
and in a seperate file i do ```js
module.exports = {
name: 'i',
execute(message) {
console.log('aaa')
client.createMessage(message.channel.id, 'd')
}
nothing logs & nothing gets sent





