A discord http interactions framework built on top of Sanic

Overview

snowfin

An async discord http interactions framework built on top of Sanic

Installing

for now just install the package through pip via github

# Unix based
pip3 install git+https://github.com/kajdev/snowfin

# Windows
py -m pip install git+https://github.com/kajdev/snowfin

Example

Simple slash command

import snowfin
from snowfin.response import MessageResponse

bot = snowfin.Client('public_key')

@snowfin.SlashCommand(name="hello")
async def on_slash(request):
    return MessageResponse('world')

bot.run("0.0.0.0", 80, debug=True)

Slash command with a deferred response

import asyncio
import snowfin
from snowfin.response import DeferredResponse, MessageResponse

bot = snowfin.Client('public_key')

@snowfin.SlashCommand(name="hello")
async def on_slash(request):
    return DeferredResponse(on_slash_defer)

async def on_slash_defer(request):
    await asyncio.sleep(1)
    return MessageResponse('Ok, *Now* I want to respond ;)')

bot.run("0.0.0.0", 80, debug=True)

Links

You might also like...
domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time.
domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time.

domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time

A Discord Bot - has a few commands. Built using python - Discord.py - RIP.
A Discord Bot - has a few commands. Built using python - Discord.py - RIP.

Discord_Bot A Discord Bot has been built here. It is capable of running a few commands. The below present screenshot should suffice in terms of explai

Bypass Hcaptcha Purely based on http requests, Creates unlocked discord accounts if used correctly

hcaptcha-bypass-discord Bypass HCAPTCHA purely based on http requests Works for discord dosen't create locked accounts :)) HOW TO USE ◉ add the hcapby

Useful tools for building interactions in Python

discord-interactions-python Types and helper functions for Discord Interactions webhooks. Installation Available via pypi: pip install discord-interac

Typed interactions with the GitHub API v3

PyGitHub PyGitHub is a Python library to access the GitHub API v3 and Github Enterprise API v3. This library enables you to manage GitHub resources su

📷 Instagram Bot - Tool for automated Instagram interactions
📷 Instagram Bot - Tool for automated Instagram interactions

InstaPy Tooling that automates your social media interactions to “farm” Likes, Comments, and Followers on Instagram Implemented in Python using the Se

This package allows interactions with the BuyCoins API.

The BuyCoins Python library allows interactions with the BuyCoins API from applications written in Python.

Unit testing AWS interactions with pytest and moto. These examples demonstrate how to structure, setup, teardown, mock, and conduct unit testing. The source code is only intended to demonstrate unit testing.

Unit Testing Interactions with Amazon Web Services (AWS) Unit testing AWS interactions with pytest and moto. These examples demonstrate how to structu

It's a Discord bot to control your PC using your Discord Channel or using Reco: Discord PC Remote Controller App.
It's a Discord bot to control your PC using your Discord Channel or using Reco: Discord PC Remote Controller App.

Reco PC Server Reco PC Server is a cross platform PC Controller Discord Bot which is a modified and improved version of Chimera for Reco-Discord PC Re

Comments
  • Added logging level and description localizations

    Added logging level and description localizations

    Without description_localizations in the SlashOption class, an error would be raised when trying to make an option because the SlashOption class did not have the description_localizations attribute.

    Also set the logging level.

    opened by Shinobou 1
  • fix: added `snowfin.Client.command` and set the logging level

    fix: added `snowfin.Client.command` and set the logging level

    The issue with some commands is the command was not getting added to the bot. To fix this I added snowfin.Client.command. Now a command may look like:

    @bot.command
    @snowfin.slash_command(name="hello")
    async def hello(context: Interaction):
        return MessageResponse('Ok, *Now* I want to respond ;)')
    
    opened by Shinobou 1
  • Updated type hints of `User`

    Updated type hints of `User`

    While fetching the user, the avatar can sometimes be None. This would cause the raise of dacite.exceptions.WrongTypeError. Also changed the type hint of the user attribute of Client to Optional[User] as it was declared as None.

    opened by Shinobou 1
  • Callback loading bug

    Callback loading bug

    Since commands and callbacks are on each client, calling the decorators snowfin.slash_command, snowfin.select_callback, etc., does not work as it doesn't load the callbacks into the client. Tested with https://github.com/KAJdev/snowfin/blob/main/examples/deferred_example.py and https://github.com/KAJdev/snowfin/blob/main/examples/component_example.py.

    It seems like it requires it to be a Module, and load_module() must be called in order to properly load the callbacks into the client.

    Simple non-working example:

    import snowfin
    from snowfin.models import Interaction
    import asyncio
    
    bot = snowfin.Client(...)
    
    
    @snowfin.slash_command(name="hello")
    async def on_slash(context: Interaction):
        return snowfin.DeferredResponse(on_slash_defer)
    
    async def on_slash_defer(context: Interaction):
        await asyncio.sleep(1)
        return snowfin.MessageResponse('Ok, *Now* I want to respond ;)')
    
    
    bot.run("0.0.0.0", 8000, debug=True, auto_reload=True)
    
    opened by julien777z 1
Releases(v0.1.2-alpha)
  • v0.1.2-alpha(Jun 17, 2022)

    What's Changed

    • Add discord server link by @KAJdev in https://github.com/KAJdev/snowfin/pull/1
    • Rebase for now by @KAJdev in https://github.com/KAJdev/snowfin/pull/2
    • changes to readme by @xPolar in https://github.com/KAJdev/snowfin/pull/3
    • Bringing dev up do date yet again by @KAJdev in https://github.com/KAJdev/snowfin/pull/4
    • Fix event listeners and update examples by @KAJdev in https://github.com/KAJdev/snowfin/pull/5
    • fix 500s when request isn't from Discord by @KAJdev in https://github.com/KAJdev/snowfin/pull/6
    • fix some issues related to serialization of choices by @KAJdev in https://github.com/KAJdev/snowfin/pull/7
    • Updated type hints of User by @Shinobou in https://github.com/KAJdev/snowfin/pull/8
    • Rebase dev by @KAJdev in https://github.com/KAJdev/snowfin/pull/9
    • Merge dev into main by @KAJdev in https://github.com/KAJdev/snowfin/pull/10
    • v0.1.2 merge dev into master by @KAJdev in https://github.com/KAJdev/snowfin/pull/17

    New Contributors

    • @KAJdev made their first contribution in https://github.com/KAJdev/snowfin/pull/1
    • @xPolar made their first contribution in https://github.com/KAJdev/snowfin/pull/3

    Full Changelog: https://github.com/KAJdev/snowfin/commits/v0.1.2-alpha

    Source code(tar.gz)
    Source code(zip)
Owner
kaj
I do a whole bunch of Python stuff, and C# too.
kaj
Evernote SDK for Python

Evernote SDK for Python Evernote API version 1.28 This SDK is intended for use with Python 2.X For Evernote's beta Python 3 SDK see https://github.com

Evernote 612 Dec 30, 2022
:lock: Python 2.7/3.X client for HashiCorp Vault

hvac HashiCorp Vault API client for Python 3.x Tested against the latest release, HEAD ref, and 3 previous minor versions (counting back from the late

hvac 1k Dec 29, 2022
FTP Anonymous Login

FTPAnon FTP Anonymous Login Install git clone https://github.com/SiThuTuntimehacker/FTPAnon cd FTPAnon bash install.sh access ftp sever " ftpaccess.tx

SiThuTun 3 Mar 23, 2022
Wats2PDF - Convert whatsapp exported chat(without media) into a readable pdf format

Wats2PDF convert whatsApp exported chat into a readable pdf format. convert with

5 Apr 26, 2022
Yes, it's true :revolving_hearts: This repository has 301 stars.

Yes, it's true! Inspired by a similar repository from @RealPeha, but implemented using a webhook on AWS Lambda and API Gateway, so it's serv

511 Dec 30, 2022
Projeto do segundo módulo da Resilia

@ Projeto Resilia : Módulo 2 Vamos jogar Forca ! O jogo da forca é um jogo em que o jogador tem que acertar qual é a palavra proposta, tendo como dica

Mateus Sartorio 2 Feb 24, 2022
Telegram üzerinden paylaşılan kısa linkleri geçmenin daha hızlı bir yolu

Telegram Url skipper Telegramda paylaşılan kısa linkleri geçmenin daha hızlı bir yolu · Hata Raporla · Öneri Yap İçerik Tablosu Kurulum Kullanım Lisan

WarForPeace 6 Oct 07, 2022
This is the repository for HalpyBOT, the Hull Seals IRC Chatbot Assistant.

HalpyBOT 1.4.2 This is the repository for HalpyBOT, the Hull Seals IRC Chatbot Assistant. Description This repository houses all of the files required

The Hull Seals 3 Nov 03, 2022
An asyncio Python wrapper around the Discord API, forked off of Rapptz's Discord.py.

Novus A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. A full fork of Rapptz's Discord.py library, with

Voxel Fox 60 Jan 03, 2023
Repositorio dedicado a contener los archivos fuentes del bot de discord "Lector de Ejercicios".

Lector de Ejercicios Este bot de discord está pensado para usarse únicamente en el discord de la materia Algoritmos y Programación I, de la Facultad d

Franco Lighterman Reismann 3 Sep 17, 2022
Simple spam bot made in python

Simple Spam Bot A Simple and easy way to be the most hated person between your friends, All you have to do is spam the group chat using this bot until

Kareem Osama 6 Sep 05, 2022
a Disqus alternative

Isso – a commenting server similar to Disqus Isso – Ich schrei sonst – is a lightweight commenting server written in Python and JavaScript. It aims to

Martin Zimmermann 4.7k Jan 02, 2023
A Discord bot to scrape textfiles from messages and put them to Hastebin

A Discord bot to scrape textfiles from messages and put them to Hastebin. Intended to use on support servers to help users read textfiles on mobile.

1 Jan 23, 2022
Gera um PDF, logo depois de você responder um questionário simples, e envia para o e-mail que você informar.

PDF generator and send it for your email Criador: Francisco Robson de O. Dutra Filho Repositório criado no dia 18/09/2021 Instagram: @robsondutra_ Sob

8 Nov 22, 2021
A free, minimal, lightweight, cross-platform, easily expandable Twitch IRC/API bot.

parky's twitch bot A free, minimal, lightweight, cross-platform, easily expandable Twitch IRC/API bot. Features 🔌 Connect to Twitch IRC chat! 🔌 Conn

Andreas Schneider 10 Dec 30, 2022
Fastest Pancakeswap Sniper BOT TORNADO CASH 2022-V1 (MAC WINDOWS ANDROID LINUX)

Fastest Pancakeswap Sniper BOT TORNADO CASH 2022-V1 (MAC WINDOWS ANDROID LINUX) ⭐️ AUTO BUY TOKEN ON LAUNCH AFTER ADD LIQUIDITY ⭐️ ⭐️ Support Uniswap

Crypto Trader 7 Jan 31, 2022
Rapid Sms Bomber For Indian Number.

Bombzilla Rapid Sms Bomber For Indian Number. Installation git clone https://github.com/sarv99/Bombzilla cd Bombzilla chmod +x setup.sh ./setup.sh Af

Saurav Jangid 1 Jan 12, 2022
This is a small Messnger with the cmd as an interface

Messenger This is a small messenger with the cmd as an interface. It started as a project to learn more about Python 3. If you want to run a version o

1 Feb 24, 2022
Projeto Informações Conta do Instagram - Instagram Account Information Project

VESTA-tools A collection of simple tools that proved to be needed for handling large periodic calculations with the VASP software package. distTotCalc

Thiago Souza 1 Dec 02, 2021
ByDiego Token Grabber is a Discord Stealer

ByDiego Token Grabber is a Discord Stealer. This way you can get too much information from x person if you pass it on and open it

zByDiegoM.T 4 Mar 11, 2022