Tetracycline (TC) is one of the most important therapeutic drugs that is widely used in hospitals. However, its harmful effects on human health and various ecosystems cannot be ignored. Owing to its poor metabolic activity and low biodegradability, TC commonly discharges as the parent compound and accumulates readily in sludges and soils by precipitation from wastewater, which can induce the evolution of antibiotic-resistant bacteria; therefore, it has been listed as one of the new pollutants with potential ecotoxicological risk. The control measures and environmental management of TC pollutants in environmental water samples require precise determination of TC pollutant concentrations. Carbon dots (CDs) are an emerging type of fluorescent material with numerous advantages such as easy preparation, low cost, low toxicity, and good biocompatibility. Consequently, they have attracted widespread attention in the field of TC detection. Herein, we synthesized TE-CDs with good blue-fluorescence performance via flow-assisted melt polymerization using tricarboxylic acid and ethylenediamine as raw precursors. The morphology and structure of the prepared TE-CDs were characterized. The transmission electron microscopy (TEM) results showed that the prepared TE-CDs were well dispersed, with an average diameter of (2.43±0.48) nm. The X-ray diffraction (XRD) results showed that the TE-CDs had an amorphous carbon structure. Infrared spectroscopy and X-ray photoelectron spectroscopy (XPS) characterizations showed that the surface of the TE-CDs was rich in hydrophilic groups, such as amino, hydroxyl, and carboxyl groups, which indicated that TE-CDs had good water solubility and were advantageous for detecting TC in medical wastewater. Subsequently, the optical properties of the TE-CDs were investigated. The fluorescence emission spectra of the TE-CDs were recorded at various excitation wavelengths. The emission spectra of the TE-CDs exhibited excitation wavelength dependence and when the excitation wavelength changes from 300 nm to 400 nm, their fluorescence intensity decreased to varying degrees. The TE-CDs exhibited optimal fluorescence intensity at an excitation wavelength of 368 nm, while the emission wavelength was 448 nm. TC could effectively quench the blue fluorescence of the CDs, and by utilizing this property, the detection of TC concentration could be achieved. After the addition of TC, the fluorescence of the system immediately reached an extreme value, and no significant change was observed within 10 min. An incubation time of 20 s was selected to obtain precise results. Additionally, the TE-CDs exhibited stable fluorescence intensity over a wide pH range. The fluorescence stability of the TE-CDs was investigated, and no significant change in fluorescence intensity was observed after standing for 10 d, indicating that the prepared TE-CDs had excellent fluorescence stability. The fluorescence intensity of the TE-CDs decreased to varying degrees within the range of 2-200 mg/L TC until complete quenching occurred. TC mass concentration in the range of 4-20 mg/L showed a good linear relationship (R2=0.9978) with the fluorescence quenching intensity of the TE-CDs. The limit of detection was 0.2 mg/L. A preliminary investigation was undertaken to explore the quenching mechanism of the TE-CDs fluorescence by TC. Upon addition of TC, a significant reduction in the fluorescence lifetime of the TE-CDs was observed. During the quenching process, no new substances were observed by UV absorption spectroscopy. Additionally, no significant changes in the 1H NMR spectra of the TE-CDs were noted before and after the addition of TC, indicating the absence of an interaction between the TE-CDs and TC. Therefore, the quenching mechanism may involve dynamic quenching. The selectivity and anti-interference ability of the developed method were evaluated; in the presence of interfering substances, TC quenched the fluorescence of the TE-CDs, indicating that the TE-CDs had good selectivity and anti-interference performance towards TC. The method was applied to the quantitative detection of TC in medical wastewater, with recoveries of 96.5%-119.8% and relative standard deviations of 0.8%-2.6%. In conclusion, the analytical performance of the proposed method is comparable with that of previously reported detection methods; moreover, the method has the advantages of low operational cost, simple preparation process, time-saving, and good repeatability. Therefore, the TE-CDs can be used as chemical sensors for the detection of TC in medical wastewater and have good practical applications.