Skip to content

Instantly share code, notes, and snippets.

View iamnotacoder-djs's full-sized avatar

Aspin Tojps iamnotacoder-djs

View GitHub Profile
@iamnotacoder-djs
iamnotacoder-djs / remnant.ahk
Created April 6, 2023 17:24
Remnant: From the Ashes gun/armor switch script
#singleInstance, force
Setup := 0
Weapon := 0
*1::changeSetup()
changeSetup() {
global Setup
if (Setup < 1)
@iamnotacoder-djs
iamnotacoder-djs / index.js
Created December 21, 2022 08:32
Add overlay to GIF file
const gifFrames = require('gif-frames'); // @1.0.1
const { createCanvas, loadImage } = require('canvas'); // @2.10.2
const GifEncoder = require('gif-encoder'); // 0.4.3
const fs = require("fs");
convertBanner();
async function convertBanner() {
const originalFrames = await gifFrames({ url: 'source.gif', frames: "all" }).catch(console.error);
if (!originalFrames) return;
@iamnotacoder-djs
iamnotacoder-djs / stream.sh
Created December 4, 2022 09:57
Stream to YouTube/Twitch
#! /bin/bash
VBR="4500k" # Битрейт видео
FPS="60" # FPS
QUAL="veryfast" # Пресет качества для FFmpeg
TWITCH_URL="rtmp://live-hel.twitch.tv/app" # URL RTMP Twitch
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL RTMP YouTube
FOLDER="day" # Имя папки с видео роликами
KEY="170j" # Ключ потока
@iamnotacoder-djs
iamnotacoder-djs / Habrahabr.js
Last active September 20, 2022 10:14
Discord.js@14.3.0 Autocomplete Option Example
/**
* Пример использования Autocomplete-опции Slash-команды на базе шаблона (хандлера) DiscordBotIda:
* https://github.com/idaspin/DiscordBotIda/
* Установка: установить модуль rss-parser; Перенести файл Habrahabr.js в папку /commands/
*/
'use strict';
const BaseCommand = require('../structures/BaseCommand'),
{ ApplicationCommandType, ApplicationCommandOptionType, AttachmentBuilder, EmbedBuilder, Collection } = require('discord.js'),
Parser = require('rss-parser'),
parser = new Parser();
@iamnotacoder-djs
iamnotacoder-djs / index_1.js
Last active September 7, 2022 01:42
Discord.js@14.0.3 Rainbow-Role Bot
const { Client, GatewayIntentBits } = require('discord.js'), // discord.js@14.0.3
client = new Client({ intents: [ GatewayIntentBits.Guilds ] });
client.login("your bot token")
.then(() => {
timeout1h();
});
async function timeout1h() {
setTimeout(timeout1h, 1000 * 60 * 60);
@iamnotacoder-djs
iamnotacoder-djs / index.js
Last active June 26, 2022 23:35
Discord.js@13.8.0 Banner Changer
const { Client, Intents, MessageEmbed, MessageActionRow, MessageButton } = require('discord.js'),
client = new Client({ intents: [Intents.FLAGS.GUILDS ] }),
fs = require('fs');
client.login("your bot token")
.then(() => {
client.db = require('quick.db'); // quick.db@^7.1.3
timeout1h();
});
@iamnotacoder-djs
iamnotacoder-djs / index.js
Created February 26, 2022 13:21
Discord.js@13.6.0 Discord Modals
const { Client, Intents, MessageEmbed, MessageActionRow, MessageButton } = require('discord.js'),
client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES ] }),
dsModals = require('discord-modals'),
{ Modal, TextInputComponent, showModal } = require('discord-modals');
dsModals(client);
var config = {
token: "your bot token",
prefix: "/",
@iamnotacoder-djs
iamnotacoder-djs / index.js
Created February 25, 2022 01:58
Discord.js@13.6.0 Server lockdown
const { Client, Intents, Collection } = require('discord.js'),
client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES ] }),
fs = require('fs');
client.db = require("quick.db");
client.commands = new Collection();
client.applicationCommands = [];
var config = {
token: "your bot token",
@iamnotacoder-djs
iamnotacoder-djs / coin.js
Created February 14, 2022 08:34
tmi.js Twitch Chat Bot Example | Command handler
const help = {
name: "coin",
usage: "Flip a coin"
};
module.exports = {
help: help,
messageExecute(client, opts) {
exec(client, opts);
}
@iamnotacoder-djs
iamnotacoder-djs / index.js
Created February 9, 2022 19:27
Discord.js@13.6.0 Quiz Mini-game
const { Client, Intents, MessageEmbed, MessageActionRow, MessageButton } = require('discord.js'),
client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES ] });
client.db = require("quick.db");
var config = {
token: "your bot token",
prefix: "/",
adminID: "admin id",
embed_color: "#ffffff"