The discord.js interactions PR has been merged, and d.js master (v13 dev) now has proper support for slash commands!
Official resources:
.terminal-line-cursor-effect::after { | |
content: ' _'; | |
animation: animate 1.5s linear infinite; | |
} | |
@keyframes animate { | |
0% { | |
opacity: 0; | |
} | |
50% { |
// Subscribe on YouTube, and follow on TikTok (@mattupham)! Socials found below: | |
// https://mattupham.com/links | |
// @ me on Discord with any questions! | |
https://link.mattupham.com/discord | |
// -------------------------------------------- | |
// PLEASE REPLACE "your-api-key-here" WITH AN | |
// API KEY FROM https://ipgeolocation.io/ | |
let apiKey = "your-api-key-here"; |
The discord.js interactions PR has been merged, and d.js master (v13 dev) now has proper support for slash commands!
Official resources:
If you're wondering what Gateway Intents are, what Privileged Intents are, why your bot can't see statuses, or why your bot can't see member joins anymore, then this page should explain it to you!
if you do not know what intents are, please read this entire page
First, a short explanation of how bots work: bots can make requests over the REST (HTTP) API to retreive information and do actions, and they get real-time updates from Discord in the form of websocket gateway events. They can also fetch server members via the gateway.
Examples of gateway events you are probably familiar with are Message Create (a message was sent) and Guild Member Add (a user joined a server).
// Welcome to my gist! This is how you can create an invite tracker using JavaScript and Discord.JS! | |
// First we are going to statt off in our ready event. | |
// Create a new Collection called guildInvites and add it to your client | |
// client is the new Client you created in your main file. If you're using an event handler, make sure to pass the client into this file. | |
const { Collection } = require("discord.js"); | |
// Collection is an enhanced Map which we are going to save our invites to. | |
const guildInvites = new Collection(); | |
client.invites = guildInvites; |
//github.com/realSaddy | |
// This uses pm2 by default, feel free to change any of the pipeline commands | |
const secret = ""; | |
const repo = "/location"; | |
const branch = "master" | |
const pipeline = [ | |
'pm2 stop server', | |
'cd ' + repo + ' && git pull origin master', | |
`cd `+repo+` && npm install`, | |
`cd `+repo+` && pm2 restart server` |
import React from "react"; | |
import { NextPageContext } from "next"; | |
const blogPostsRssXml = (blogPosts: IBlogPost[]) => { | |
let latestPostDate: string = ""; | |
let rssItemsXml = ""; | |
blogPosts.forEach(post => { | |
const postDate = Date.parse(post.createdAt); | |
if (!latestPostDate || postDate > Date.parse(latestPostDate)) { | |
latestPostDate = post.createdAt; |
Good to know: Iptables reads rules from top to bottom, stopping at the first rule that matches.
chain: group of rules (Default ones are INPUT, OUTPUT and FORWARD).
target: What to do with a packet (Often used are ACCEPT, DROP (No echo/"offline"), REJECT (Echoes back 'not authorized icmp')).