Skip to content

Instantly share code, notes, and snippets.

Working from home

Carter Fyko

Working from home
View GitHub Profile
Fyko / LogHandler.ts
Last active Jan 27, 2021
utility for batch-handling general discord server logs, sending 10 embeds at a time
View LogHandler.ts
import PatrolClient from '../client/TugBoatClient';
import { MessageEmbed, Collection } from 'discord.js';
import { createWebhook } from '../util';
const chunkArray = <T>(list: T[], chunksize: number): T[][] =>
new Array(Math.ceil(list.length / chunksize)).fill(undefined).map(() => list.splice(0, chunksize));
export default class LogHandler {
protected interval!: NodeJS.Timeout;
View okay.txt
Fyko / ExtendedGuild.ts
Last active Sep 4, 2020
collector for guild member add event in discord.js
View ExtendedGuild.ts
import { Client, Collection, GuildMember, Snowflake, Structures, Guild as ImportedGuild } from 'discord.js';
import GuildMemberCollector, { GuildMemberCollectorOptions } from './GuildMemberCollector';
type MemberCollection = Collection<Snowflake, GuildMember>;
declare module 'discord.js' {
interface Guild {
filter: (member: GuildMember) => boolean,
options?: GuildMemberCollectorOptions,
extern crate log;
use anyhow::Result;
use rustacles_brokers::amqp::AmqpBroker;
use serde_json::{from_slice, to_vec};
use std::collections::HashMap;
use tokio::time::{delay_for, timeout, Duration};
pub use proxy::models::*;
Fyko / Dockerfile
Created Jul 25, 2020
Dockerfile that caches cargo packages
View Dockerfile
# syntax=docker/dockerfile-upstream:experimental
# Note: Remember to change the workdir & paths that use "trakor/inkress"
# --------------------------------
# building in this image
# --------------------------------
Fyko / index.ts
Created Apr 22, 2020
util function for verifiying hcaptcha token, sorry dom
View index.ts
import fetch from 'node-fetch';
import qs from 'querystring';
enum ErrorCode {
'missing-input-secret' = 'Your secret key is missing.',
'invalid-input-secret' = 'Your secret key is invalid or malformed.',
'missing-input-response' = 'The response parameter (verification token) is missing.',
'invalid-input-response' = 'The response parameter (verification token) is invalid or malformed.',
'bad-request' = 'The request is invalid or malformed.',
'invalid-or-already-seen-response' = 'The response parameter has already been checked, or has another issue.',
Fyko /
Created Dec 15, 2019
My keybase verification

Keybase proof

I hereby claim:

  • I am fyko on github.
  • I am fyko ( on keybase.
  • I have a public key ASAMTkMlDtCWi1VXm-H0Tjx_pF1FaI1ylldPBkPqypesJgo

To claim this, I am signing this object:

Fyko / discord entity
Last active Nov 26, 2019
Short guide on getting Discord entity IDs such as servers, channels, and users
View discord entity

This guide will walk you through obtaining Discord IDs such as your server ID.

  1. Ensure that Developer Mode is on. If not, head to Settings => Appearance then toggle Developer Mode.
  • Settings
  • Appearance
  • Developer Mode
  1. For most Discord entities (servers, channels, users, messages) you can simply right click the item and click Copy ID
    However, for emoji IDs you must escape the emoji by placing a foreword slash () infront of the emoji. Ex: \:blobreach: then copy the ID from there.
  • Server ID
Fyko /
Last active Feb 2, 2021
Discord Token Security

This gist takes advantage of GitHub's Token Scanning feature to reset Discord Bot tokens that users post on Discord.

Fyko / prompt.js
Last active May 17, 2019
An example of confirmation with Discord.js
View prompt.js
const responses = await => ===, {
max: 1,
time: 10000
if (!responses || responses.size !== 1) {
// timed out
const response = responses.first();