This file contains 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 kunou.commands | |
import kunou.startup.Kunou | |
import net.dv8tion.jda.core.entities.Member | |
import net.dv8tion.jda.core.entities.Message | |
import org.slf4j.LoggerFactory | |
import java.lang.NumberFormatException | |
/* This is an example of primary constructors in Kotlin. Note the use of the "val" keyword, which declares | |
an immutable property/field/variable. Notice how it can be used in constructors to declare properties. |
This file contains 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
<# | |
# Discord Bot Powershell Launch Script | |
#> | |
$BotWorkingDir = [environment]::CurrentDirectory | |
$BotName = "MyBot" | |
<# | |
# BotType = 1: .NET Core bot. | |
# BotType = 0: .NET Framework (.exe) bot. |
This file contains 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
// requires Jint | |
// | |
// this can be used for video streams as well, with few modifications | |
public async Task<string> GetYtAudioUrl(string id) | |
{ | |
await Task.Yield(); | |
var utf8 = new UTF8Encoding(false); | |
var wc = new WebClient(); |
This file contains 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
using DSharpPlus; | |
using DSharpPlus.CommandsNext; | |
using DSharpPlus.CommandsNext.Attributes; | |
using DSharpPlus.Entities; | |
using DSharpPlus.Interactivity; | |
using GameStage.Core.Entities.Eval; | |
using Humanizer; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.CSharp.Scripting; | |
using Microsoft.CodeAnalysis.Scripting; |
This file contains 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
using DSharpPlus.CommandsNext; | |
using DSharpPlus.Interactivity; | |
using DSharpPlus.Entities; | |
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Threading.Tasks; | |
using DSharpPlus; | |
using Humanizer; | |
using GameStage.Entities.Config; |
This file contains 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
// LootService.cs | |
using DSharpPlus; | |
using DSharpPlus.CommandsNext; | |
using DSharpPlus.Entities; | |
using DSharpPlus.EventArgs; | |
using DSharpPlus.Exceptions; | |
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; |
This file contains 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 Jid = require('@xmpp/jid').JID; | |
const Session = require('node-xmpp-server').C2SStream; | |
module.exports = class ConnectionManager { | |
constructor() { | |
/** | |
* @type Map<String, Array<Session>> | |
*/ | |
this._connections = new Map(); | |
} |
This file contains 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
using agsXMPP; | |
using agsXMPP.protocol.tls; | |
using agsXMPP.Xml; | |
using agsXMPP.Xml.Dom; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Security; |
This file contains 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
public class ObjectIdConverter : TypeConverter | |
{ | |
public override bool CanConvertFrom(ITypeDescriptorContext context, | |
Type sourceType) | |
{ | |
if (sourceType == typeof(string)) | |
return true; | |
return base.CanConvertFrom(context, sourceType); | |
} |
This file contains 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
#include <iostream> | |
#include <cstdio> | |
#include <filesystem> | |
using namespace std; | |
enum MoneyType { | |
Moeda, | |
Nota | |
}; |