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
import asyncio | |
import discord | |
from fastapi import FastAPI | |
app = FastAPI() | |
client = discord.Client() | |
# where the magic happens | |
# register an asyncio.create_task(client.start()) on app's startup event |
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 { APIMessage, Structures } = require("discord.js"); | |
class ExtAPIMessage extends APIMessage { | |
resolveData() { | |
if (this.data) return this; | |
super.resolveData(); | |
const allowedMentions = this.options.allowedMentions || this.target.client.options.allowedMentions || {}; | |
if (allowedMentions.repliedUser !== undefined) { | |
if (this.data.allowed_mentions === undefined) this.data.allowed_mentions = {}; | |
Object.assign(this.data.allowed_mentions, { replied_user: allowedMentions.repliedUser }); |
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
import asyncio | |
import logging | |
import time | |
from contextlib import suppress | |
from typing import Union | |
import discord | |
""" |
- Install (TinyMCE 5.x)
npm install --save tinymce @tinymce/tinymce-react copy-webpack-plugin
- Copy static files(tinymce skins) to
public
folder. Edit filenext.config.js
const path = require('path');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
- Create a file
Image.js
from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that acceptsuploadFunc
(function to be called withimage
being uploaded) and additional logicif(upload) { ... } else { ... previous base64 logic .. }
in thenew Plugin
section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'
/**
* Matches following attributes in Markdown-typed image: [, alt, src, title]
*
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 FullHeightPage = () => ( | |
<div> | |
Hello World! | |
<style global jsx>{` | |
html, | |
body, | |
body > div:first-child, | |
div#__next, | |
div#__next > div { | |
height: 100%; |