Skip to content

Instantly share code, notes, and snippets.

View kzndotsh's full-sized avatar

kzndotsh kzndotsh

View GitHub Profile
@AmazingAkai
AmazingAkai / bot.py
Last active July 6, 2024 10:12
Discord.py button roles example.
from __future__ import annotations
import re
from typing import Optional
import discord
from discord.ext import commands
# Role IDs to labels mapping.
# role_id: label
@eylenburg
eylenburg / msoffice_in_linux.md
Last active September 23, 2024 15:24
Installing Microsoft Office in Linux

Step by step guide: How to install Microsoft Office in any Linux distribution

There are multiple options how to install MS Office on Linux.

VM-based - Integrate Windows apps running in a Windows virtual machine as native-looking in Linux

  1. Winapps, based on KVM, QEMU, Docker/Podman and FreeRDP. Still actively maintained (getting Github commits). Decribed below
  2. Cassowary, based on KVM, QEMU, libvirt/virt-manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use. Last release in Feb 2022 and seems to be abandoned.

The VM-based options means can run Office 2021 or Office 365 including all apps, but while the Windows apps themselves run flawlessly (as they're running on real Windows) there's various freerdp-related bugs you may encounter.

@Jbziscool
Jbziscool / reportsystem.py
Created October 21, 2023 22:03
Report system using discord.py
from discord import ui # remember to import this
class banreason(ui.Modal, title='Punishment information'):
reason = ui.TextInput(label='Reason')
def __init__(self, member: discord.Member):
super().__init__()
self.member = member
@LeoCx1000
LeoCx1000 / ___README.md
Last active August 25, 2024 15:24
Mentionable CommandTree implementation to allow mentioning slash commands in discord.py

discord.py MentionableTree implementation

My implementation of a CommandTree subclass which allows for finding a mention for a given app command.

How to use?

Just copy the entire third file into a new file python of your project, and import it.

Additions to the default CommandTree.

@tboerger
tboerger / README.md
Created November 14, 2022 13:43
Hack The Box: Starting Point Tier 0

Meow

Questionnaire

What does the acronym VM stand for?
Virtual Machine
@Soheab
Soheab / complete..md
Last active July 15, 2024 05:30
See here a custom check for all types of commands that can be used to check if user has any permissions you pass

See here the "complete" check

"complete" as in it supports app and text commands and has some comments explaining the code. As you may have noticed, there are multiple files in this gist:

Text Cmmands Only Here

Complete

See here the complete check with support for app and text commands:

from typing import Any, TYPE_CHECKING, List
import asyncio
from discord import ui, Interaction
class GlobalView(ui.View):
def __init__(
self,
@imptype
imptype / messagemaker.py
Last active May 25, 2024 19:02
A better embed maker/embed builder for discord.py
"""
The messagemaker command!
Supports:
- Editing message content
- Add, edit, remove, clear embeds: title, desc, timestamp, fields etc. - everything to customize an embed.
-- Exporting and Importing exclusively for the embed
- Importing JSON: from modal text input, from mystbin link, from existing message
- Exporting to JSON, as a message or uploaded as file and mystbin link if < 2000 chars
- Sending to: a channel, a webhook, edit existing message
# Copyright 2020-present Michael Hall
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@imptype
imptype / embedmaker.py
Last active May 2, 2024 19:25
embed maker command
"""
A quick embed maker command.
Supports Title, URL, Description, Color, Timestamp,
Author (name, icon, url), Footer (icon, name), Image (url), Thumbnail (url)
adding and inserting fields (name, value, inline, index),
removing fields (index),
clearing fields,
editing fields (select -> name, value, inline)