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
Filters to block and remove copycat-websites from DuckDuckGo and Google. Specific to dev websites like StackOverflow or GitHub.

uBlock-Origin-dev-filter Filters to block and remove copycat-websites from DuckDuckGo and Google. Specific to dev websites like StackOverflow or GitHu

1.7k Dec 30, 2022
A Python wrapper for the DeepL API

deepl.py A Python wrapper for the DeepL API installing Install and update using pip: pip install deepl.py A simple example. # Sync Sample import deep

grarich 18 Dec 12, 2022
A Python Module That Uses ANN To Predict A Stocks Price And Also Provides Accurate Technical Analysis With Many High Potential Implementations!

Stox ⚡ A Python Module For The Stock Market ⚡ A Module to predict the "close price" for the next day and give "technical analysis". It uses a Neural N

Dopevog 31 Dec 16, 2022
Telegram bot which has truecaller and smsbomber features

Truecaller-telegram_bot Add your telegram bot api key in main.py and you are good to go To get a api key Goto telegram and search BotFather From the c

Rudranag 32 Dec 05, 2022
Python wrapper to simplify calls to AncestryDNA API.

AncestryDNA API wrapper Ancestry exposes an undocumented REST API for its DNA features. This Python wrapper inventories the available calls, and expos

Matt 2 Jun 10, 2022
🚀 A fast, flexible and lightweight Discord API wrapper for Python.

Krema A fast, flexible and lightweight Discord API wrapper for Python. Installation Unikorn unikorn add kremayard krema -no-confirmation Pip pip insta

Krema 20 Sep 04, 2022
DeleteAllBot - Telegram bot to delete all messages in a group

Delete All Bot A star ⭐ from you means a lot to me ! Telegram bot to delete all

Stark Bots 15 Dec 26, 2022
This is a very easy to use tool developed in python that will search for free courses from multiple sites including youtube and enroll in the ones in which it can.

Free-Course-Hunter-and-Enroller This is a very easy to use tool developed in python that will search for free courses from multiple sites including yo

Zain 12 Nov 12, 2022
Discord Selfbot, 90+ commands

Setting the bot up. STEP 1: copy the directory yook.club selfbot was downloaded and extracted into, open cmd and type "cd " then paste. STEP 2: python

yook 1 Dec 12, 2021
This discord bot will help you to control your target through PickleC2

PickleC2-Bot This discord bot will help you to control your target through PickleC2 WHAT's a PickleC2? PickleC2 is a simple C2 framework written in py

4 Jun 25, 2022
A Pythonic wrapper for the Wikipedia API

Wikipedia Wikipedia is a Python library that makes it easy to access and parse data from Wikipedia. Search Wikipedia, get article summaries, get data

Jonathan Goldsmith 2.5k Dec 28, 2022
A simple script that will watch a stream for you and earn the channel points.

Credits Main idea: https://github.com/gottagofaster236/Twitch-Channel-Points-Miner Bet system (Selenium): https://github.com/ClementRoyer/TwitchAutoCo

Alessandro Maggio 1.1k Jan 08, 2023
A simple tool that allows you to change your default AWS CLI profile.

Select AWS Profile Select AWS Profile (slapr) is a simple tool that lets you select which AWS Profile you want to use and sets it as the default AWS p

Antoni Yanev 2 Nov 09, 2022
A napari plugin for visualising and interacting with electron cryotomograms

napari-subboxer A napari plugin for visualising and interacting with electron cryotomograms. Installation You can install napari-subboxer via pip: pip

3 Nov 25, 2021
Instagram bot for promoting ROKA trainee soldier(just like me)'s consolation letters.

Instagram_bot (필자를 포함한) 모든 대한민국 훈련병들을 위한 인스타그램 인편지기입니다. Instagram bot for promoting ROKA trainee soldier(just like me)'s consolation letters. 들어가기 (Ge

Lee, Jongjun 2 Nov 21, 2021
Quadrirrotor UFABC - ROS/Gazebo

QuadROS_UFABC - Repositório utilizado durante minha dissertação de mestrado para simular sistemas de controle e estimação para navegação de um quadrirrotor utilizando visão computacional.

Mateus Ribeiro 1 Dec 13, 2022
Collection of script to manage WLED devices

Collection of script to manage WLED devices

Daniel Poelzleithner 4 Sep 26, 2022
Yes, it's true :orange_heart: This repository has 346 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 serverless! If

512 Jan 01, 2023
A python crypto trading bot on Binance using RSI in 25 Lines 🚀

RSI Crypto Trading Bot - Binance A Crypto Trading Bot on Binance trading BTCUSDT and ETHUSDT using RSI in 25 Lines of Code Getting Started Note Python

Blankly Finance 10 Dec 26, 2022
Auxiliator is telegram bot for basic web-application analysis

Auxiliator Auxiliator is telegram bot for basic web-application analysis What for? Sometimes there is no access to your main PC, where you can scan we

Revoltage 13 Dec 26, 2021