Skip to content

Instantly share code, notes, and snippets.

View aDu's full-sized avatar
how do i post stories??? i quit facebook for this

Alanski aDu

how do i post stories??? i quit facebook for this
View GitHub Profile
@aDu
aDu / discord_music.js
Last active March 11, 2022 13:11
A minimalistic/simple music player in a Discord voice channel, using the "eris" NodeJS Discord wrapper. Put this into your existing Eris bot.
// Plays music in a Discord voice channel, using the "eris" NodeJS Discord wrapper.
// Requires ffmpeg (https://github.com/abalabahaha/eris/issues/470).
const ytdl = require('ytdl-core')
const VOICE_CHANNEL_ID = "VOICE_CHANNEL_ID_HERE"
const YOUTUBE_VIDEO = "http://www.youtube.com/watch?v=5qap5aO4i9A"
function joinAndPlay() {
bot.joinVoiceChannel(VOICE_CHANNEL_ID).catch((err) => {
@aDu
aDu / bot.js
Last active July 10, 2020 07:25
Eris react to role bot (using https://github.com/abalabahaha/eris/). Gives the Guild Discord role when reacting (removes the role if you already had the role).
var emojiToRole = {
'❤️': '730969029392597014',
'🧡': '550097270906028042',
'💛': '730970455158292582',
'💚': '730970493527654531',
'💙': '526038406182993941',
'💜': '541054776440520744',
'🖤': '730970538335404033',
'🤍': '730982363605237800',
}
@aDu
aDu / SoundZone.cs
Last active July 3, 2020 01:06
Unity3D Sound Zone - Collider2D instead of point audio source (because Unity only supports audio coming from a single point or circle, instead of coming from a custom shape). AudioSource will move as close to the player as possible but keeping inside the collider. Please modify it to suit your use-cases (modify the Player.Instance and AudioMgr.I…
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// 2D Sound Zone.
// Recommended AudioSource settings: Spatial Blend: 3D. Doppler Level, Spread and reverb zone mix set to 0.
// AudioSource will move as close to the player as possible, but will stay within the collider.
// Only works with only one Collider2D component.
// https://gist.github.com/aDu/d57b923c96f242e28fe029f3980c5123
public class SoundZone : MonoBehaviour