Skip to content

Instantly share code, notes, and snippets.

@bensonchow123
bensonchow123 / carousel.html
Created June 25, 2024 16:26
the html code with boostrap 5.3.3
@bensonchow123
bensonchow123 / issue.html
Created October 24, 2023 12:54
disable on form submit
<form id="reportEventForm" method="POST" action="{{ url_for('map.main_map_page')}}">
{{ report_event_form.hidden_tag() }}
<fieldset>
<div class="mb-3">
<label class="col-form-lacbel">Node to report:</label>
{% if report_event_form.node_to_report.errors %}
{{ report_event_form.node_to_report(class="form-control is-invalid") }}
<div class="invalid-feedback">
{% for error in report_event_form.node_to_report.errors %}
<span>{{ error }}</span>
@bensonchow123
bensonchow123 / button_view.py
Created July 6, 2022 09:44
Button not responding
class AdvertisementConfirmButton(ui.View):
def __init__(self, author, skybies_cost, num_messages):
super().__init__(timeout=10)
self.reply = None
self.author = author
self.skybies_cost = skybies_cost
self.num_messages = num_messages
async def on_timeout(self):
if self.reply.reference:
class AdvertisementConfirmButton(ui.View):
def __init__(self, author, skybies_cost, num_messages):
super().__init__(timeout=10)
self.reply = None
self.author = author
self.skybies_cost = skybies_cost
self.num_messages = num_messages
async def on_timeout(self):
if self.reply.reference:
@bensonchow123
bensonchow123 / view_class.py
Created July 6, 2022 06:17
Full view class
class AdvertisementConfirmButton(ui.View):
def __init__(self, author, skybies_cost, num_messages):
super().__init__(timeout=10)
self.reply = None
self.author = author
self.skybies_cost = skybies_cost
self.num_messages = num_messages
async def on_timeout(self):
if self.reply.reference:
Ignoring exception in on_message
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.10/site-packages/nextcord/client.py", line 445, in _run_event
await coro(*args, **kwargs)
File "/app/Cogs/SelfPromotion.py", line 154, in message_cost_system
confirm_button.reply = await message.reply(view=AdvertisementConfirmButton)
File "/app/.heroku/python/lib/python3.10/site-packages/nextcord/message.py", line 1714, in reply
return await self.channel.send(content, reference=self, **kwargs)
File "/app/.heroku/python/lib/python3.10/site-packages/nextcord/abc.py", line 1402, in send
components = view.to_components()
import os
from datetime import datetime, timedelta
from nextcord import utils, TextChannel, MessageType
from dotenv import load_dotenv
from nextcord.ext import commands
from pymongo import MongoClient
load_dotenv()
cluster = MongoClient(os.getenv("MongoDbSecretKey"))
import os
from datetime import datetime, timedelta
from nextcord import utils, TextChannel, MessageType
from dotenv import load_dotenv
from nextcord.ext import commands
from pymongo import MongoClient
load_dotenv()
cluster = MongoClient(os.getenv("MongoDbSecretKey"))
import asyncio
import os
import aiohttp
from datetime import datetime, timezone, timedelta
import nextcord
from nextcord import Message, utils
from dotenv import load_dotenv
from nextcord.ext import commands, tasks
from pymongo import MongoClient, ASCENDING
import asyncio
import os
import aiohttp
from datetime import datetime, timezone, timedelta
import nextcord
from nextcord import Message, utils
from dotenv import load_dotenv
from nextcord.ext import commands, tasks
from pymongo import MongoClient, ASCENDING