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 collection of tools for managing Jira issues for the RHODS project

RHODS-Jira-Tools A collection of tools for managing Jira issues for the RHODS project move_to_qa.py This script handles transitioning a given Jira iss

Alex Corvin 1 Sep 20, 2022
An unofficial wrapper for Engineer Man's Piston API

Pistonpy Pistonpy is an API wrapper for the Piston code execution engine by Engineer Man. Key Features Simple modern and efficient Pythonic API using

AalbatrossGuy 4 Jan 03, 2022
This is a tool to help people to make a bot for labelling images for machine learning projects.

labeller_images_python_telegramBOT This is a bot to help collect data for any machine learning project. It was developed using the python-telegram-bot

Diego Silveira 2 Nov 13, 2021
Join & Leave spam for aminoapps using aminoboi

JLspam.py Join & Leave spam for https://aminoapps.com using aminoboi Instalaรงรฃo apt-get update -y apt-get upgrade -y apt-get install git pkg install

Moleey 1 Dec 21, 2021
A simple message content sniping Discord bot which you can run yourself! Sniping API pulled from isobot and Arch bot

Discord Snipe Bot This is a bot made with the same message content sniping API from isobot and Arch bot. It's default prefix is -, however you can als

notsniped 5 Aug 11, 2022
Python Client for Instagram API

This project is not actively maintained. Proceed at your own risk! python-instagram A Python 2/3 client for the Instagram REST and Search APIs Install

Facebook Archive 2.9k Dec 30, 2022
A Telelgram Bot to Extract Text from an Image

Text-Scanner-OCR A Telelgram Bot to Extract Text from an Image Configs Vars API_KEY: Your API_KEY from OCR Space GROUP: Your Group Username without '@

ALBY 8 Feb 20, 2022
If you are in allot of groups or channel and you would like to leave them at once use this

Telegram-auto-leave-groups If you are in allot of groups or channel and you would like to leave them at once use this USER GUIDE ๐Ÿ‘ฃ Insert your telegr

Julius Njoroge 4 Jan 03, 2023
Auto Moderation is a powerfull moderation bot

Auto Moderation.py Auto Moderation a powerful Moderation Discord Bot ๐ŸŽญ Futures Moderation Auto Moderation ๐Ÿš€ Installation git clone https://github.co

Gโˆ™MAX 2 Apr 02, 2022
Telegram Bot to Filter posts in Bot Inline search

Inline-Filter-Bot A Telegram Bot for filter in Inline Features Unlimited Filters Supports all type of filters Supports Alert Button Using Common Marku

Code X Botz 67 Dec 26, 2022
This wrapper now has async support, its basically the same except it uses asyncio

This is a python wrapper for my api api_url = "https://api.dhravya.me/" This wrapper now has async support, its basically the same except it uses asyn

Dhravya Shah 5 Mar 10, 2022
Discord bot written in discord.py

Orion Discord bot written in discord.py Installation Installation of code is supported for macOS only currently First open the terminal. If incase you

Zeus 3 May 19, 2022
Short Program using Transavia's API to notify via email an user waiting for a flight at special dates and with the best price

Flight-Notifier Short Program using Transavia's API to notify via email an user waiting for a flight at special dates and with the best price Algorith

Wassim 2 Apr 10, 2022
Discord Unverified Token Gen

Discord-Unverified-Token-Gen This is a token gen that was made in an hour and just generates unverified tokens, most will be locked. Usage: in cmd jus

Aran 2 Oct 23, 2022
๐€ ๐ฆ๐จ๐๐ฎ๐ฅ๐š๐ซ ๐“๐ž๐ฅ๐ž๐ ๐ซ๐š๐ฆ ๐†๐ซ๐จ๐ฎ๐ฉ ๐ฆ๐š๐ง๐š๐ ๐ž๐ฆ๐ž๐ง๐ญ ๐›๐จ๐ญ ๐ฐ๐ข๐ญ๐ก ๐ฎ๐ฅ๐ญ๐ข๐ฆ๐š๐ญ๐ž ๐Ÿ๐ž๐š๐ญ๐ฎ๐ซ๐ž๐ฌ

๐‡๐จ๐ฐ ๐“๐จ ๐ƒ๐ž๐ฉ๐ฅ๐จ๐ฒ For easiest way to deploy this Bot click on the below button ๐Œ๐š๐๐ž ๐๐ฒ ๐’๐ฎ๐ฉ๐ฉ๐จ๐ซ๐ญ ๐†๐ซ๐จ๐ฎ๐ฉ ๐’๐จ๐ฎ๐ซ๐œ๐ž๐ฌ ๐†๐ž๐ง๐ž?

Mukesh Solanki 2 Oct 06, 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
๐Ÿ’ป Discord-Auto-Translate-Bot - If you type in the chat room, it automatically translates.

๐Ÿ’ป Discord-Auto-Translate-Bot - If you type in the chat room, it automatically translates.

LeeSooHyung 2 Jan 20, 2022
PyDiscord, a maintained fork of discord.py, is a python wrapper for the Discord API.

discord.py A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. The Future of discord.py Please read the gi

Omkaar 1 Jan 16, 2022
Discord Token Finder - Find half of your target's token with just their ID.

Discord Token Finder - Find half of your target's token with just their ID.

Ttawi 2 Apr 07, 2022
Shred your reddit comment and post history

trasheddit Shred your reddit comment and post history (x89/Shreddit replacement) Usage Simple Example Download trasheddit: git clone https://github.co

Elly 2 Jan 05, 2022