Skip to content

Instantly share code, notes, and snippets.

View AlexzanderFlores's full-sized avatar
🏠
Working from home

Alexzander Flores AlexzanderFlores

🏠
Working from home
View GitHub Profile
// Both are assuming you already have access to a channel variable
// Roles. You can get the ID from role.id
const roleId = '741229944927158315'
channel.send(`Hey <@&${roleId}>!`)
// Users. You can get the ID from member.id, user.id, etc.
const userId = '251120969320497152'
channel.send(`Hey <@${userId}>`)
const rememberMe = true // From your signup form
// Add in your own callbacks here to handle these events
const callback = { onSuccess: () => {}, onFailure: () => {} }
if (rememberMe) {
user.setDeviceStatusRemembered(callback)
} else {
user.setDeviceStatusNotRemembered(callback)
user.forgetDevice(callback)
module.exports = {
commands: ['deletechannel', 'delchannel', 'delc'],
minArgs: 1,
expectedArgs: '<channel name>',
permissionError: 'You must be an administrator to use this.',
permission: 'ADMINISTRATOR',
callback: (message, arguments, text) => {
const { guild } = message
const channel = guild.channels.cache
.filter((channel) => {
version: 0.2
phases:
pre_build:
commands:
- npm install
build:
commands:
- npm run build
const botId = '723819104045105172'
client.on('message', (message) => {
// If your bot is tagged at all:
for (const user of message.mentions.users) {
if (user.id === botId) {
// TODO: Send help command via message.channel.send
break
}
}
//https://youtu.be/Mgs7jl430vs
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
// Scripts for https://youtu.be/FEI-uEdb2y8
"deploy": "react-scripts build && aws s3 rm s3://wornoffkeys.com/ --recursive && aws s3 cp ./build s3://wornoffkeys.com/ --recursive --acl public-read"
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
@AlexzanderFlores
AlexzanderFlores / index.js
Created January 2, 2020 15:07
AWS Cognito + React JS Tutorial: Account Registration (2020)
// https://www.youtube.com/watch?v=-qo5GFdN-Ck
import React, { useState } from 'react';
import { CognitoUserPool } from 'amazon-cognito-identity-js';
export default () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const poolData = {