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
A discord.py extension for sending, receiving and handling ui interactions in discord

discord-ui A discord.py extension for using discord ui/interaction features pip package ▪ read the docs ▪ examples Introduction This is a discord.py u

34 Dec 29, 2022
Bot simply search for the files from provided channel according to given query and gives link to those files as buttons!

Auto Filter Bot ㅤㅤㅤㅤㅤㅤㅤ ㅤㅤㅤㅤㅤㅤㅤ You can call this as an Auto Filter Bot if you like :D Bot simply search for the files from provided channel according

TroJanzHEX 89 Nov 23, 2022
TORNADO CASH Proxy Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX)

TORNADO CASH Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX) ⭐️ A ful

Crypto Trader 1 Jan 06, 2022
GitPython is a python library used to interact with Git repositories.

Gitoxide: A peek into the future… I started working on GitPython in 2009, back in the days when Python was 'my thing' and I had great plans with it. O

3.8k Jan 03, 2023
NewpaperNews-API - Json data of the news with python

NewsAPI API Documentation BASE_URL = "https://saurav.tech/NewsAPI/" top_headline

Aryaman Prakash 2 Sep 23, 2022
Osmnx-examples - Usage examples, demos, and tutorials for OSMnx.

OSMnx Examples OSMnx is a Python package to work with street networks and other spatial data from OpenStreetMap: retrieve, model, analyze, and visuali

Geoff Boeing 1.2k Jan 03, 2023
Powerful Telegram Maintained UserBot in Telethon

Fire-X UserBot The Awaited Bot Fire-X userbot The Most Powerful Telegram Userbot. This Userbot is Safe to use in Your Telegram Account. It is not like

22 Oct 21, 2022
Telegram music & video bot direct play music

Telegram music & video bot direct play music

noinoi-X 1 Dec 28, 2021
this is a telegram torrent bot

owner of this repo :- AYUSH contact me :- AYUSH Slam Mirror Bot This is a telegram bot writen in python for mirroring files on the internet to our bel

AYUSH 237 Dec 16, 2021
An API Client package to access the APIs for NBA.com

nba_api An API Client package to access the APIs for NBA.com Development Version: v1.1.9 nba_api is an API Client for www.nba.com. This package is mea

Swar Patel 1.4k Jan 01, 2023
Fast discord token checker with high cpm

Discord-Token-checker Fast discord token checker with high cpm preivew Download git clone https://github.com/TusTusDev/Discord-Token-checker pip insta

Tustus 1 Oct 15, 2021
A robust, low-level connector for the Discord API

Bauxite Bauxite is a robust, low-level connector for the Discord API. What is Bauxite for? Bauxite is made for two main purposes: Creating higher-leve

1 Dec 04, 2021
A Python library for PagerDuty.

Pygerduty Python Library for PagerDuty's REST API and Events API. This library was originally written to support v1 and is currently being updated to

Dropbox 164 Dec 20, 2022
FAIR Enough Metrics is an API for various FAIR Metrics Tests, written in python

☑️ FAIR Enough metrics for research FAIR Enough Metrics is an API for various FAIR Metrics Tests, written in python, conforming to the specifications

Maastricht University IDS 3 Jul 06, 2022
Pls give vaccine.

Pls Give Vaccine A script to spam yourself with vaccine notifications. Explore the docs » View Demo · Report Bug · Request Feature Table of Contents A

Rohan Mukherjee 3 Oct 27, 2021
An simple python script for remove rockstar account for fivem, very useful for cheating or change account for unban from an server, remember change steam account.

This tool is used for be unbanned from servers, u need disconnect the discord, use other steam account and uninstall xbox for be unbanned 100%, it only work for unban in server, not global

MiguDEV 4 Oct 10, 2022
Twitter-redesign - Twitter Redesign With Django

Twitter Redesign A project that tests Django and React knowledge through a twitt

Mark Jumba 1 Jun 01, 2022
A simple python discord bot with commands for moderation and utility.

Discord Bot A simple python discord bot with commands for moderation, utility and fun. Moderation $kick user reason - Kick a user from the server

3 Jan 07, 2022
discord bot made in discord.py

udeline discord bot made in discord.py, which's main features include: general use server moderation fun commands other cool commands dependencies dis

1 Feb 08, 2022
Acid's Utilities is a bot for my Discord server that alerts when I go live, welcomes new users, has some awesome games and so much more!

Acid's Utilities Acid's Utilities is a bot for my Discord server that alerts when I go live, welcomes new users, has some awesome games and so much mo

AcidFilms (Fin Stuart) 3 Nov 19, 2021