Skip to content

Instantly share code, notes, and snippets.

Rapptz /
Last active October 28, 2022 14:40 — forked from Zomatree/


messages can be sent with the components key to add buttons and other components (when discord brings them out), you can edit and add new buttons via editing the message, this is useful for the disabled key to stop people from clicking it.

Example Payload

    "content": "this is an example message for components",
    "components": [
        {"type": 1, "components": [
 {"type": 2, "style": 2, "label": "Button 1", "custom_id": "1"},
Rapptz /
Last active October 28, 2022 14:40
For Jake

I restricted these to client-only QoL features that I thought were small.

  • Reverse sorting search
  • Group by Guild in Emoji panel so you can see what guild an emoji is in
  • Disabling "GIF" or "Gift" buttons in the message box
  • Hover over for complete timestamp on messages
    • Maybe the same for embed timestamps?
  • More time information in call messages (e.g. how long it lasted for) (I know it's provided in the message since I have it in
  • Lock channels so you don't accidentally move them by dragging (this one might be less trivial iunno)
  • Character count indicator for knowing if you're reaching 2000 characters. too hard apparently
View DiscordAvatar.cs
using Discord;
namespace Yonom.DiscordTools
static class DiscordAvatar
// for documentation purposes only
private static enum DefaultAvatars
blurple = 0,
View gist:a4f2c24dcd9507be2404e1f9a943f02e
2016-11-02 17:31:20 #python_discord-py @luke#7172: uhhh
2016-11-02 17:31:36 #python_discord-py @Fuyukai desu#0588: what
2016-11-02 17:31:46 #python_discord-py @luke#7172: :/
2016-11-02 17:31:50 #python_discord-py @luke#7172: I don't know how to do this
2016-11-02 17:32:27 #python_discord-py @luke#7172: I need to get info of another shard
2016-11-02 17:33:03 #python_discord-py @luke#7172: like server amount, etc
2016-11-02 17:33:07 #python_discord-py @luke#7172: whats the best method to do this
2016-11-02 17:34:07 #python_discord-py @Fuyukai desu#0588: ipc
2016-11-02 17:34:37 #python_discord-py @luke#7172: Indian Penal Code?
2016-11-02 17:34:41 #python_discord-py @Recchan#4305: who shards
import requests
import json
USER_TOKEN = 'token'
class Embeds:
def __init__(self, data):
basic_keys = ('title', 'type', 'description', 'url', 'timestamp', 'color',
'footer', 'image', 'thumbnail', 'provider', 'author')
Rapptz /
Last active October 28, 2022 14:42
Showing off custom commands using discord.ext
import discord
from discord.ext import commands
import json, inspect
import functools
import re
# some JSON set up for our storage because >lazy<
class CustomCommandEntry:
__slots__ = ['name', 'content', 'guild_id']
Rapptz /
Last active October 28, 2022 14:42
Changelog for R. Danny

Changelog (Updated Jan. 29th 2016)

The bot has been completely rewritten.

For feature requests or questions feel free to ping/private message @Danny.

Big changes

  • Most things don't require quotes anymore. A lot of people had a hard time with the concept of adding quotes to things so if it's the last argument of a command
Rapptz /
Created January 26, 2016 08:42
The random map generator for Splatoon tournaments.
from __future__ import division
import random
from collections import Counter, namedtuple
import bisect
import math
# for my own purposes.
debug = False
def weighted_choice(choices):
Rapptz /
Created December 20, 2015 00:29
R. Danny v3.0.0

R. Danny v3.0.0 ideas:

  • Fully asyncio rewrite.
    • Will use the async branch (or v0.10.0) when it becomes available.
  • Authority system based on permissions/roles.
    • e.g. Manage Messages -> !cleanup is valid
    • e.g. Bot Mod -> can call bot commands without having the permissions themselves
    • This will make it easier for people to administrate on servers I'm not on.
  • Remove cronjob and pass it in as a background task to the event loop
  • Lowers the need of dependencies by quite a bit.
Rapptz /
Last active November 29, 2015 00:32

Breaking changes from v0.8.0 to v0.9.0:

  • All HTTP requests now throw exceptions.
  • send_message no longer takes in a string ID for destination.
    • Use discord.Object(id='...') instead.
  • discord.InvalidEventName is removed
  • discord.InvalidDestination is renamed to discord.ClientException
  • on_server_create was renamed to on_server_join
  • on_server_delete was renamed to on_server_remove
  • A lot of the factory methods in discord.Colour were renamed.