Skip to content

Instantly share code, notes, and snippets.

@foxbot
foxbot / to-do.md
Last active June 23, 2016 07:13
Strife To-Do List

Strife 2

Changelogs

Strife 2.0-dev2-breaking (6/22/16)

  • Updated to Discord.Net dev-04bf733
  • Supports User Accounts
  • Authenticate User Accounts without a Token
  • Message Timestamps
  • Edited Messages will be suffixed with (EDITED)
@foxbot
foxbot / handler.cs
Created August 26, 2016 01:31
Discord.Net 1.0 Debug Command Handler
StringBuilder builder = new StringBuilder();
var searchResult = _commands.Search(msg, argPos);
if (searchResult.IsSuccess)
{
foreach (var cmd in searchResult.Commands)
{
builder.Append($"**{cmd.Text}({string.Join(",", cmd.Parameters.Select(x => GetParamName(x)))})** ");
var preconditionResult = await cmd.CheckPreconditions(msg);
var parseResult = await cmd.Parse(msg, searchResult, preconditionResult);
if (parseResult.IsSuccess)
@foxbot
foxbot / UtilityModule.cs
Created October 18, 2016 20:09
your purge command is really bad quick hold this
public class UtilityModule : ModuleBase
{
[Command("purge")]
[Alias("clean", "cleanup", "prune")]
[Summary("Cleans the bot's messages")]
[RequirePermission(ChannelPermission.ManageMessages)]
public async Task Clean(
[Summary("The optional number of messages to delete; defaults to 10")] int count = 10,
[Summary("The type of messages to delete - Self, Bot, or All")] DeleteType deleteType = DeleteType.Self,
[Summary("The strategy to delete messages - BulkDelete or Manual")] DeleteStrategy deleteStrategy = DeleteStrategy.BulkDelete)

Keybase proof

I hereby claim:

  • I am foxbot on github.
  • I am foxbot (https://keybase.io/foxbot) on keybase.
  • I have a public key whose fingerprint is 0740 1620 1C1B 5515 ED17 E35B D7BC C95E BD22 D089

To claim this, I am signing this object:

@foxbot
foxbot / LogMutator.cs
Created June 21, 2017 07:09
Mutate the LogSeverity on a LogMessage object
using System.Reflection;
using Discord;
namespace DiscordBot
{
public class LogMutator
{
private readonly FieldInfo _sevField;
public LogMutator()
@foxbot
foxbot / help.cs
Created September 22, 2017 00:21
your help command is bad - this one is no better
public class HelpModule : ModuleBase
{
private readonly CommandService _commands;
private readonly IServiceProvider _map;
public HelpModule(IServiceProvider map, CommandService commands)
{
_commands = commands;
_map = map;
}
@foxbot
foxbot / README.md
Last active October 16, 2018 15:01
Christmas CSS!

Christmas CSS!

Celebrate this year's holiday season in style with Christmas CSS!

Installation

With BeautifulDiscord

Download the contents of the [CSS file] to your discord-custom.css (this is generally in %localappdata%\Discord\app-version\resources)

@foxbot
foxbot / ReliabilityService.cs
Last active May 15, 2021 12:52
Discord.Net Reliability Service (until connection issues are resolved)
using System;
using System.Threading;
using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
// Change this namespace if desired
namespace foxboat.Services
{
// This service requires that your bot is being run by a daemon that handles
@foxbot
foxbot / worldcup.py
Created July 13, 2018 09:21
world cup score reporting bot for discord
import aiohttp
import asyncio
import discord
import os
CHANNEL_ID = 381870553235193857
class State:
def __init__(self, token):
self.discord = discord.http.HTTPClient()