get('1.0', 'end-1c')
124125-12521251-125
136136-26236713-136
137235-16372072-136
652612-72374734-136
defaultdict(<class 'list'>, {'124125': ['12521251-125'], '136136': ['26236713-136'], '137235': ['16372072-136'], '652612': ['72374734-136']})
https://core.telegram.org/bots/api#sendvideo
supports_streaming: Pass True, if the uploaded video is suitable for streaming
https://pypi.org/project/mem-edit/
import ctypes
from mem_edit import Process
magic_number = ctypes.ulong(1234567890)
pid = Process.get_pid_by_name('magic.exe')
with Process.open_process(pid) as p:
addrs = p.search_all_memory(magic_number)
# We don't want to edit if there's more than one result...
assert(len(addrs) == 1)
# We don't actually have to read the value here, but let's do so anyways...
num_ulong = p.read_memory(addrs[0], ctypes.c_ulong())
num = num_ulong.value
p.write_memory(addrs[0], ctypes.c_ulong(num + 1))
xml_ = '''<svg>
<g id="Group 182">
<path id="Vector_791" d="" fill="#C0D898" stroke="#806239" stroke-width="0.75" stroke-miterlimit="10"/>
<path id="Vector_792" d="" fill="white"/>
<path id="1478" d="" fill="#3F5714"/>
<path id="7.47" d="" fill="#454545"/>
</g>
<g id="1495">
<path id="Vector_795" d="" fill="#C0D898" stroke="#806239" stroke-width="0.75" stroke-miterlimit="10"/>
<path id="Vector_796" d="" fill="white"/>
<path id="1495_2" d="" fill="#3F5714"/>
<path id="7.47" d="" fill="#454545"/>
</g>
</svg>'''
import lxml.etree as ET
root = ET.fromstring(xml_)
tree = ET.ElementTree(root)
svg_ = tree.getroot()
for i in svg_.findall(".//g"):
if "Group" in i.attrib['id']:
i.attrib['id'] = i.getchildren()[2].attrib['id']
print(ET.tostring(tree, pretty_print=True).decode("utf-8"))
<svg>
<g id="1478">
<path id="Vector_791" d="" fill="#C0D898" stroke="#806239" stroke-width="0.75" stroke-miterlimit="10"/>
<path id="Vector_792" d="" fill="white"/>
<path id="1478" d="" fill="#3F5714"/>
<path id="7.47" d="" fill="#454545"/>
</g>
<g id="1495">
<path id="Vector_795" d="" fill="#C0D898" stroke="#806239" stroke-width="0.75" stroke-miterlimit="10"/>
<path id="Vector_796" d="" fill="white"/>
<path id="1495_2" d="" fill="#3F5714"/>
<path id="7.47" d="" fill="#454545"/>
</g>
</svg>
@bot.command()
@commands.has_permissions(ban_members=True)
async def swipe(ctx):
role_name = ("Тостер")
role = tuple(get(ctx.guild.roles, name=n) for n in role_names)
for m in ctx.guild.members:
try:
await member.remove_roles(*role)
except:
print(f"Не удалось удалить роль для {m} либо её у него нет.")
await ctx.send("Удалено.")
https://discordpy.readthedocs.io/en/latest/api.htm...
@bot.event
async def on_message(message):
rolemute = discord.utils.get(message.guild.roles, name=('Muted'))
if rolemute in message.author.roles:
await message.channel.purge(limit=1)
await bot.process_commands(message)