This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fr.skybeast.tutorial; | |
import org.bukkit.Bukkit; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Method; | |
import java.util.Objects; | |
import java.util.function.Supplier; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Renvoie <code>true</code> si l'inventaire donné possède assez de place pour obtenir | |
* l'item donné. | |
* <p> | |
* Cette méthode utilise l'API StreamAPI de Java8 ainsi que les lambda, pour plus d'information. | |
* <p> | |
* Exemple: | |
* <pre> | |
* {@code | |
* //Donne un diamant quand un joueur lance un oeuf. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.bukkit.*; | |
import org.bukkit.block.BlockState; | |
import org.bukkit.block.banner.Pattern; | |
import org.bukkit.enchantments.Enchantment; | |
import org.bukkit.inventory.ItemFlag; | |
import org.bukkit.inventory.ItemStack; | |
import org.bukkit.inventory.meta.*; | |
import org.bukkit.material.MaterialData; | |
import org.bukkit.potion.PotionData; | |
import org.bukkit.potion.PotionEffect; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { exec } = require('child_process') | |
const curl = `curl 'https://discordapp.com/api/v6/channels/$channel/messages' -H 'origin: https://discordapp.com' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: fr' -H 'authorization: $authorization' -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36' -H 'content-type: application/json' -H 'accept: */*' -H 'referer: https://discordapp.com/channels/414430510287159298/414468161753186324' -H 'authority: discordapp.com' -H 'dnt: 1' --data-binary '{"content":"$message","nonce":"422183212660293632","tts":false}' --compressed` | |
const accounts = { | |
'drafter2002': 'XXXXXXXXXXXX', // Authorization tokens; | |
'Licorne salée': 'XXXXXXXXXXXX', // Get them by inspecting the HTTP headers of Discord queries | |
'Life is Potato': 'XXXXXXXXXXXX', | |
'SkyBeast': 'XXXXXXXXXXXX', | |
} | |
const commands = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Client } = require('discord.js') | |
const fs = require('fs') | |
const client = new Client() | |
client.on('ready', async () => { | |
console.log('bot ready') | |
const guild = client.guilds.get('297780867286433792') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Jimp = require('jimp') | |
const { readdirSync } = require('fs') | |
const { join } = require('path') | |
const floodfill = require('./floodfill') | |
const sq = i => Math.pow(i, 2) | |
const distsq = ([ r1, g1, b1 ], [ r2, g2, b2 ]) => sq(r1 - r2) + sq(g1 - g2) + sq(b1 - b2) | |
//// Variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { blue, green } from 'chalk' | |
import { Client } from 'discord.js' | |
const client = new Client() | |
client.login(process.env.DISCORD_TOKEN).then(async () => { | |
const guild = client.guilds.get('394954745612399274') | |
await guild.fetchMembers() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Migi, { command, on, react } from '@popcorn.moe/migi' | |
import EPenser from '@epenserdiscord/epenser-migi-module' | |
import Help from '@shiro/help' | |
import Meme from '@shiro/meme' | |
const migi = new Migi({ | |
root: __dirname | |
}) | |
migi.loadModule(EPenser) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const express = require('express') | |
const app = express() | |
const cat = fs.readFileSync('osiris.jpg') | |
app.get('*', (req, res) => { | |
const a = { | |
headers: req.headers, | |
baseUrl: req.baseUrl, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch') | |
const url = 'https://bayfiles.com/W6Z6ceh8bf/rengekawai_jpg' | |
async function getCdn() { | |
const res = await fetch(url) | |
const text = await res.text() | |
const [, cdn] = /<a href="https:\/\/cdn-(\d{2})/.exec(text) | |
return cdn |
OlderNewer